vendor: 8,633 bytes, line 1
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Globe=t()}(this,(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function r(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?n(Object(i),!0).forEach((function(n){t(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".scene-container .clickable {\n cursor: pointer;\n}");const s="177",a=100,o=200,l=204,u=205,c=301,h=302,A=303,d=304,p=306,f=1e3,m=1001,g=1002,_=1003,v=1004,y=1005,x=1006,b=1007,w=1008,T=1009,S=1010,M=1011,E=1012,C=1013,R=1014,N=1015,P=1016,D=1017,L=1018,I=1020,O=35902,B=1021,U=1022,F=1023,k=1026,q=1027,V=1028,z=1029,G=1030,j=1031,H=1033,W=33776,X=33777,Q=33778,Y=33779,$=35840,K=35841,Z=35842,J=35843,ee=36196,te=37492,ne=37496,re=37808,ie=37809,se=37810,ae=37811,oe=37812,le=37813,ue=37814,ce=37815,he=37816,Ae=37817,de=37818,pe=37819,fe=37820,me=37821,ge=36492,_e=36494,ve=36495,ye=36283,xe=36284,be=36285,we=36286,Te="",Se="srgb",Me="srgb-linear",Ee="linear",Ce="srgb",Re=7680,Ne=513,Pe=515,De=35044,Le=35048,Ie="300 es",Oe=2e3,Be=2001;class Ue{addEventListener(e,t){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[e]&&(n[e]=[]),-1===n[e].indexOf(t)&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return void 0!==n&&void 0!==n[e]&&-1!==n[e].indexOf(t)}removeEventListener(e,t){const n=this._listeners;if(void 0===n)return;const r=n[e];if(void 0!==r){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){const t=this._listeners;if(void 0===t)return;const n=t[e.type];if(void 0!==n){e.target=this;const t=n.slice(0);for(let n=0,r=t.length;n<r;n++)t[n].call(this,e);e.target=null}}}const Fe=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let ke=1234567;const qe=Math.PI/180,Ve=180/Math.PI;function ze(){const e=4294967295*Math.random()|0,t=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(Fe[255&e]+Fe[e>>8&255]+Fe[e>>16&255]+Fe[e>>24&255]+"-"+Fe[255&t]+Fe[t>>8&255]+"-"+Fe[t>>16&15|64]+Fe[t>>24&255]+"-"+Fe[63&n|128]+Fe[n>>8&255]+"-"+Fe[n>>16&255]+Fe[n>>24&255]+Fe[255&r]+Fe[r>>8&255]+Fe[r>>16&255]+Fe[r>>24&255]).toLowerCase()}function Ge(e,t,n){return Math.max(t,Math.min(n,e))}function je(e,t){return(e%t+t)%t}function He(e,t,n){return(1-n)*e+n*t}function We(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return e/4294967295;case Uint16Array:return e/65535;case Uint8Array:return e/255;case Int32Array:return Math.max(e/2147483647,-1);case Int16Array:return Math.max(e/32767,-1);case Int8Array:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}function Xe(e,t){switch(t.constructor){case Float32Array:return e;case Uint32Array:return Math.round(4294967295*e);case Uint16Array:return Math.round(65535*e);case Uint8Array:return Math.round(255*e);case Int32Array:return Math.round(2147483647*e);case Int16Array:return Math.round(32767*e);case Int8Array:return Math.round(127*e);default:throw new Error("Invalid component type.")}}const Qe={DEG2RAD:qe,RAD2DEG:Ve,generateUUID:ze,clamp:Ge,euclideanModulo:je,mapLinear:function(e,t,n,r,i){return r+(e-t)*(i-r)/(n-t)},inverseLerp:function(e,t,n){return e!==t?(n-e)/(t-e):0},lerp:He,damp:function(e,t,n,r){return He(e,t,1-Math.exp(-n*r))},pingpong:function(e,t=1){return t-Math.abs(je(e,2*t)-t)},smoothstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*(3-2*e)},smootherstep:function(e,t,n){return e<=t?0:e>=n?1:(e=(e-t)/(n-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},seededRandom:function(e){void 0!==e&&(ke=e);let t=ke+=1831565813;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296},degToRad:function(e){return e*qe},radToDeg:function(e){return e*Ve},isPowerOfTwo:function(e){return!(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},setQuaternionFromProperEuler:function(e,t,n,r,i){const s=Math.cos,a=Math.sin,o=s(n/2),l=a(n/2),u=s((t+r)/2),c=a((t+r)/2),h=s((t-r)/2),A=a((t-r)/2),d=s((r-t)/2),p=a((r-t)/2);switch(i){case"XYX":e.set(o*c,l*h,l*A,o*u);break;case"YZY":e.set(l*A,o*c,l*h,o*u);break;case"ZXZ":e.set(l*h,l*A,o*c,o*u);break;case"XZX":e.set(o*c,l*p,l*d,o*u);break;case"YXY":e.set(l*d,o*c,l*p,o*u);break;case"ZYZ":e.set(l*p,l*d,o*c,o*u);break;default:}},normalize:Xe,denormalize:We};class Ye{constructor(e=0,t=0){Ye.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 11,563 bytes, line 1
1sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6],this.y=r[1]*t+r[4]*n+r[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Ge(this.x,e.x,t.x),this.y=Ge(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ge(this.x,e,t),this.y=Ge(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Ge(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ge(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),r=Math.sin(t),i=this.x-e.x,s=this.y-e.y;return this.x=i*n-s*r+e.x,this.y=i*r+s*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class $e{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,s,a){let o=n[r+0],l=n[r+1],u=n[r+2],c=n[r+3];const h=i[s+0],A=i[s+1],d=i[s+2],p=i[s+3];if(0===a)return e[t+0]=o,e[t+1]=l,e[t+2]=u,void(e[t+3]=c);if(1===a)return e[t+0]=h,e[t+1]=A,e[t+2]=d,void(e[t+3]=p);if(c!==p||o!==h||l!==A||u!==d){let e=1-a;const t=o*h+l*A+u*d+c*p,n=t>=0?1:-1,r=1-t*t;if(r>Number.EPSILON){const i=Math.sqrt(r),s=Math.atan2(i,t*n);e=Math.sin(e*s)/i,a=Math.sin(a*s)/i}const i=a*n;if(o=o*e+h*i,l=l*e+A*i,u=u*e+d*i,c=c*e+p*i,e===1-a){const e=1/Math.sqrt(o*o+l*l+u*u+c*c);o*=e,l*=e,u*=e,c*=e}}e[t]=o,e[t+1]=l,e[t+2]=u,e[t+3]=c}static multiplyQuaternionsFlat(e,t,n,r,i,s){const a=n[r],o=n[r+1],l=n[r+2],u=n[r+3],c=i[s],h=i[s+1],A=i[s+2],d=i[s+3];return e[t]=a*d+u*c+o*A-l*h,e[t+1]=o*d+u*h+l*c-a*A,e[t+2]=l*d+u*A+a*h-o*c,e[t+3]=u*d-a*c-o*h-l*A,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,r=e._y,i=e._z,s=e._order,a=Math.cos,o=Math.sin,l=a(n/2),u=a(r/2),c=a(i/2),h=o(n/2),A=o(r/2),d=o(i/2);switch(s){case"XYZ":this._x=h*u*c+l*A*d,this._y=l*A*c-h*u*d,this._z=l*u*d+h*A*c,this._w=l*u*c-h*A*d;break;case"YXZ":this._x=h*u*c+l*A*d,this._y=l*A*c-h*u*d,this._z=l*u*d-h*A*c,this._w=l*u*c+h*A*d;break;case"ZXY":this._x=h*u*c-l*A*d,this._y=l*A*c+h*u*d,this._z=l*u*d+h*A*c,this._w=l*u*c-h*A*d;break;case"ZYX":this._x=h*u*c-l*A*d,this._y=l*A*c+h*u*d,this._z=l*u*d-h*A*c,this._w=l*u*c+h*A*d;break;case"YZX":this._x=h*u*c+l*A*d,this._y=l*A*c+h*u*d,this._z=l*u*d-h*A*c,this._w=l*u*c-h*A*d;break;case"XZY":this._x=h*u*c-l*A*d,this._y=l*A*c-h*u*d,this._z=l*u*d+h*A*c,this._w=l*u*c+h*A*d;break;default:}return!0===t&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],r=t[4],i=t[8],s=t[1],a=t[5],o=t[9],l=t[2],u=t[6],c=t[10],h=n+a+c;if(h>0){const e=.5/Math.sqrt(h+1);this._w=.25/e,this._x=(u-o)*e,this._y=(i-l)*e,this._z=(s-r)*e}else if(n>a&&n>c){const e=2*Math.sqrt(1+n-a-c);this._w=(u-o)/e,this._x=.25*e,this._y=(r+s)/e,this._z=(i+l)/e}else if(a>c){const e=2*Math.sqrt(1+a-n-c);this._w=(i-l)/e,this._x=(r+s)/e,this._y=.25*e,this._z=(o+u)/e}else{const e=2*Math.sqrt(1+c-n-a);this._w=(s-r)/e,this._x=(i+l)/e,this._y=(o+u)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ge(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(0===n)return this;const r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,r=e._y,i=e._z,s=e._w,a=t._x,o=t._y,l=t._z,u=t._w;return this._x=n*u+s*a+r*l-i*o,this._y=r*u+s*o+i*a-n*l,this._z=i*u+s*l+n*o-r*a,this._w=s*u-n*a-r*o-i*l,this._onChangeCallback(),this}slerp(e,t){if(0===t)return this;if(1===t)return this.copy(e);const n=this._x,r=this._y,i=this._z,s=this._w;let a=s*e._w+n*e._x+r*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=s,this._x=n,this._y=r,this._z=i,this;const o=1-a*a;if(o<=Number.EPSILON){const e=1-t;return this._w=e*s+t*this._w,this._x=e*n+t*this._x,this._y=e*r+t*this._y,this._z=e*i+t*this._z,this.normalize(),this}const l=Math.sqrt(o),u=Math.atan2(l,a),c=Math.sin((1-t)*u)/l,h=Math.sin(t*u)/l;return this._w=s*c+this._w*h,this._x=n*c+this._x*h,this._y=r*c+this._y*h,this._z=i*c+this._z*h,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Ke{constructor(e=0,t=0,n=0){Ke.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return void 0===n&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(Je.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(Je.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=e.elements,s=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*s,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*s,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*s,this}applyQuaternion(e){const t=this.x,n=this.y,r=this.z,i=e.x,s=e.y,a=e.z,o=e.w,l=2*(s*r-a*n),u=2*(a*t-i*r),c=2*(i*n-s*t);return this.x=t+o*l+s*c-a*u,this.y=n+o*u+a*l-i*c,this.z=r+o*c+i*u-s*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Ge(this.x,e.x,t.x),this.y=Ge(this.y,e.y,t.y),this.z=Ge(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ge(this.x,e,t),this.y=Ge(this.y,e,t),this.z=Ge(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Ge(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}
vendor: 4,519 bytes, line 1
1round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,r=e.y,i=e.z,s=t.x,a=t.y,o=t.z;return this.x=r*o-i*a,this.y=i*s-n*o,this.z=n*a-r*s,this}projectOnVector(e){const t=e.lengthSq();if(0===t)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Ze.copy(this).projectOnVector(e),this.sub(Ze)}reflect(e){return this.sub(Ze.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(0===t)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ge(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,4*t)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,3*t)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=2*Math.random()-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Ze=new Ke,Je=new $e;class et{constructor(e,t,n,r,i,s,a,o,l){et.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,s,a,o,l)}set(e,t,n,r,i,s,a,o,l){const u=this.elements;return u[0]=e,u[1]=r,u[2]=a,u[3]=t,u[4]=i,u[5]=o,u[6]=n,u[7]=s,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[3],o=n[6],l=n[1],u=n[4],c=n[7],h=n[2],A=n[5],d=n[8],p=r[0],f=r[3],m=r[6],g=r[1],_=r[4],v=r[7],y=r[2],x=r[5],b=r[8];return i[0]=s*p+a*g+o*y,i[3]=s*f+a*_+o*x,i[6]=s*m+a*v+o*b,i[1]=l*p+u*g+c*y,i[4]=l*f+u*_+c*x,i[7]=l*m+u*v+c*b,i[2]=h*p+A*g+d*y,i[5]=h*f+A*_+d*x,i[8]=h*m+A*v+d*b,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],u=e[8];
vendor: 4,213 bytes, line 1
1return t*s*u-t*a*l-n*i*u+n*a*o+r*i*l-r*s*o}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=u*s-a*l,h=a*o-u*i,A=l*i-s*o,d=t*c+n*h+r*A;if(0===d)return this.set(0,0,0,0,0,0,0,0,0);const p=1/d;return e[0]=c*p,e[1]=(r*l-u*n)*p,e[2]=(a*n-r*s)*p,e[3]=h*p,e[4]=(u*t-r*o)*p,e[5]=(r*i-a*t)*p,e[6]=A*p,e[7]=(n*o-l*t)*p,e[8]=(s*t-n*i)*p,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,r,i,s,a){const o=Math.cos(i),l=Math.sin(i);return this.set(n*o,n*l,-n*(o*s+l*a)+s+e,-r*l,r*o,-r*(-l*s+o*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(tt.makeScale(e,t)),this}rotate(e){return this.premultiply(tt.makeRotation(-e)),this}translate(e,t){return this.premultiply(tt.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<9;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return(new this.constructor).fromArray(this.elements)}}const tt=new et;function nt(e){for(let t=e.length-1;t>=0;--t)if(e[t]>=65535)return!0;return!1}function rt(e){return document.createElementNS("http://www.w3.org/1999/xhtml",e)}function it(){const e=rt("canvas");return e.style.display="block",e}const st={};function at(e){e in st||(st[e]=!0)}const ot=(new et).set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),lt=(new et).set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);const ut=function(){const e={enabled:!0,workingColorSpace:Me,spaces:{},convert:function(e,t,n){return!1!==this.enabled&&t!==n&&t&&n?(this.spaces[t].transfer===Ce&&(e.r=ct(e.r),e.g=ct(e.g),e.b=ct(e.b)),this.spaces[t].primaries!==this.spaces[n].primaries&&(e.applyMatrix3(this.spaces[t].toXYZ),e.applyMatrix3(this.spaces[n].fromXYZ)),this.spaces[n].transfer===Ce&&(e.r=ht(e.r),e.g=ht(e.g),e.b=ht(e.b)),e):e},workingToColorSpace:function(e,t){return this.convert(e,this.workingColorSpace,t)},colorSpaceToWorking:function(e,t){return this.convert(e,t,this.workingColorSpace)},getPrimaries:function(e){return this.spaces[e].primaries},getTransfer:function(e){return e===Te?Ee:this.spaces[e].transfer},getLuminanceCoefficients:function(e,t=this.workingColorSpace){return e.fromArray(this.spaces[t].luminanceCoefficients)},define:function(e){Object.assign(this.spaces,e)},_getMatrix:function(e,t,n){return e.copy(this.spaces[t].toXYZ).multiply(this.spaces[n].fromXYZ)},_getDrawingBufferColorSpace:function(e){return this.spaces[e].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(e=this.workingColorSpace){return this.spaces[e].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(t,n){return at("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),e.workingToColorSpace(t,n)},toWorkingColorSpace:function(t,n){return at("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),e.colorSpaceToWorking(t,n)}},t=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],r=[.3127,.329];return e.define({[Me]:{primaries:t,whitePoint:r,transfer:Ee,toXYZ:ot,fromXYZ:lt,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:Se},outputColorSpaceConfig:{drawingBufferColorSpace:Se}},[Se]:{primaries:t,whitePoint:r,transfer:Ce,toXYZ:ot,fromXYZ:lt,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:Se}}}),e}();function ct(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}
vendor: 4,255 bytes, line 1
1function ht(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}let At;let dt=0;class pt{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:dt++}),this.uuid=ze(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):null!==t?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){!0===e&&this.version++}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.images[this.uuid])return e.images[this.uuid];const n={uuid:this.uuid,url:""},r=this.data;if(null!==r){let e;if(Array.isArray(r)){e=[];for(let t=0,n=r.length;t<n;t++)r[t].isDataTexture?e.push(ft(r[t].image)):e.push(ft(r[t]))}else e=ft(r);n.url=e}return t||(e.images[this.uuid]=n),n}}function ft(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap?class{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src))return e.src;if("undefined"==typeof HTMLCanvasElement)return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{void 0===At&&(At=rt("canvas")),At.width=e.width,At.height=e.height;const t=At.getContext("2d");e instanceof ImageData?t.putImageData(e,0,0):t.drawImage(e,0,0,e.width,e.height),n=At}return n.toDataURL(t)}static sRGBToLinear(e){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap){const t=rt("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const r=n.getImageData(0,0,e.width,e.height),i=r.data;for(let e=0;e<i.length;e++)i[e]=255*ct(i[e]/255);return n.putImageData(r,0,0),t}if(e.data){const t=e.data.slice(0);for(let e=0;e<t.length;e++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[e]=Math.floor(255*ct(t[e]/255)):t[e]=ct(t[e]);return{data:t,width:e.width,height:e.height}}return e}}.getDataURL(e):e.data?{data:Array.from(e.data),width:e.width,height:e.height,type:e.data.constructor.name}:{}}let mt=0;const gt=new Ke;class _t extends Ue{constructor(e=_t.DEFAULT_IMAGE,t=_t.DEFAULT_MAPPING,n=1001,r=1001,i=1006,s=1008,a=1023,o=1009,l=_t.DEFAULT_ANISOTROPY,u=""){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:mt++}),this.uuid=ze(),this.name="",this.source=new pt(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=r,this.magFilter=i,this.minFilter=s,this.anisotropy=l,this.format=a,this.internalFormat=null,this.type=o,this.offset=new Ye(0,0),this.repeat=new Ye(1,1),this.center=new Ye(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new et,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=u,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(gt).x}get height(){return this.source.getSize(gt).y}get depth(){return this.source.getSize(gt).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return(new this.constructor).copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace
vendor: 8,774 bytes, line 1
1=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(void 0===n)continue;const r=this[t];void 0!==r&&(r&&n&&r.isVector2&&n.isVector2||r&&n&&r.isVector3&&n.isVector3||r&&n&&r.isMatrix3&&n.isMatrix3?r.copy(n):this[t]=n)}}toJSON(e){const t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,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,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(300!==this.mapping)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case f:e.x=e.x-Math.floor(e.x);break;case m:e.x=e.x<0?0:1;break;case g:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case f:e.y=e.y-Math.floor(e.y);break;case m:e.y=e.y<0?0:1;break;case g:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){!0===e&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){!0===e&&this.pmremVersion++}}_t.DEFAULT_IMAGE=null,_t.DEFAULT_MAPPING=300,_t.DEFAULT_ANISOTROPY=1;class vt{constructor(e=0,t=0,n=0,r=1){vt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=r}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,r){return this.x=e,this.y=t,this.z=n,this.w=r,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,r=this.z,i=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*r+s[12]*i,this.y=s[1]*t+s[5]*n+s[9]*r+s[13]*i,this.z=s[2]*t+s[6]*n+s[10]*r+s[14]*i,this.w=s[3]*t+s[7]*n+s[11]*r+s[15]*i,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,r,i;const s=.01,a=.1,o=e.elements,l=o[0],u=o[4],c=o[8],h=o[1],A=o[5],d=o[9],p=o[2],f=o[6],m=o[10];if(Math.abs(u-h)<s&&Math.abs(c-p)<s&&Math.abs(d-f)<s){if(Math.abs(u+h)<a&&Math.abs(c+p)<a&&Math.abs(d+f)<a&&Math.abs(l+A+m-3)<a)return this.set(1,0,0,0),this;t=Math.PI;const e=(l+1)/2,o=(A+1)/2,g=(m+1)/2,_=(u+h)/4,v=(c+p)/4,y=(d+f)/4;return e>o&&e>g?e<s?(n=0,r=.707106781,i=.707106781):(n=Math.sqrt(e),r=_/n,i=v/n):o>g?o<s?(n=.707106781,r=0,i=.707106781):(r=Math.sqrt(o),n=_/r,i=y/r):g<s?(n=.707106781,r=.707106781,i=0):(i=Math.sqrt(g),n=v/i,r=y/i),this.set(n,r,i,t),this}let g=Math.sqrt((f-d)*(f-d)+(c-p)*(c-p)+(h-u)*(h-u));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(c-p)/g,this.z=(h-u)/g,this.w=Math.acos((l+A+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Ge(this.x,e.x,t.x),this.y=Ge(this.y,e.y,t.y),this.z=Ge(this.z,e.z,t.z),this.w=Ge(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ge(this.x,e,t),this.y=Ge(this.y,e,t),this.z=Ge(this.z,e,t),this.w=Ge(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Ge(n,e,t))}floor(){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(){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(){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(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class yt extends Ue{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:x,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new vt(0,0,e,t),this.scissorTest=!1,this.viewport=new vt(0,0,e,t);const r={width:e,height:t,depth:n.depth},i=new _t(r);this.textures=[];const s=n.count;for(let e=0;e<s;e++)this.textures[e]=i.clone(),this.textures[e].isRenderTargetTexture=!0,this.textures[e].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:x,generateMipmaps:!1,flipY:!1,internalFormat:null};void 0!==e.mapping&&(t.mapping=e.mapping),void 0!==e.wrapS&&(t.wrapS=e.wrapS),void 0!==e.wrapT&&(t.wrapT=e.wrapT),void 0!==e.wrapR&&(t.wrapR=e.wrapR),void 0!==e.magFilter&&(t.magFilter=e.magFilter),void 0!==e.minFilter&&(t.minFilter=e.minFilter),void 0!==e.format&&(t.format=e.format),void 0!==e.type&&(t.type=e.type),void 0!==e.anisotropy&&(t.anisotropy=e.anisotropy),void 0!==e.colorSpace&&(t.colorSpace
vendor: 4,781 bytes, line 1
1=e.colorSpace),void 0!==e.flipY&&(t.flipY=e.flipY),void 0!==e.generateMipmaps&&(t.generateMipmaps=e.generateMipmaps),void 0!==e.internalFormat&&(t.internalFormat=e.internalFormat);for(let e=0;e<this.textures.length;e++)this.textures[e].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){null!==this._depthTexture&&(this._depthTexture.renderTarget=null),null!==e&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let r=0,i=this.textures.length;r<i;r++)this.textures[r].image.width=e,this.textures[r].image.height=t,this.textures[r].image.depth=n,this.textures[r].isArrayTexture=this.textures[r].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return(new this.constructor).copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const n=Object.assign({},e.textures[t].image);this.textures[t].source=new pt(n)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,null!==e.depthTexture&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class xt extends yt{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class bt extends _t{constructor(e=null,t=1,n=1,r=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=_,this.minFilter=_,this.wrapR=m,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class wt{constructor(e=new Ke(1/0,1/0,1/0),t=new Ke(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(St.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(St.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=St.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return(new this.constructor).copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){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(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(void 0!==n){const r=n.getAttribute("position");if(!0===t&&void 0!==r&&!0!==e.isInstancedMesh)for(let t=0,n=r.count;t<n;t++)!0===e.isMesh?e.getVertexPosition(t,St):St.fromBufferAttribute(r,t),St.applyMatrix4(e.matrixWorld),this.expandByPoint(St);else void 0!==e.boundingBox?(null===e.boundingBox&&e.computeBoundingBox(),Mt.copy(e.boundingBox)):(null===n.boundingBox&&n.computeBoundingBox(),Mt.copy(n.boundingBox)),Mt.applyMatrix4(e.matrixWorld),this.union(Mt)}const r=e.children;for(let e=0,n=r.length;e<n;e++)this.expandByObject(r[e],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,St),St.distanceToSquared(e.center)<=e.radius*e.radiu
vendor: 10,222 bytes, line 1
1s}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Lt),It.subVectors(this.max,Lt),Et.subVectors(e.a,Lt),Ct.subVectors(e.b,Lt),Rt.subVectors(e.c,Lt),Nt.subVectors(Ct,Et),Pt.subVectors(Rt,Ct),Dt.subVectors(Et,Rt);let t=[0,-Nt.z,Nt.y,0,-Pt.z,Pt.y,0,-Dt.z,Dt.y,Nt.z,0,-Nt.x,Pt.z,0,-Pt.x,Dt.z,0,-Dt.x,-Nt.y,Nt.x,0,-Pt.y,Pt.x,0,-Dt.y,Dt.x,0];return!!Ut(t,Et,Ct,Rt,It)&&(t=[1,0,0,0,1,0,0,0,1],!!Ut(t,Et,Ct,Rt,It)&&(Ot.crossVectors(Nt,Pt),t=[Ot.x,Ot.y,Ot.z],Ut(t,Et,Ct,Rt,It)))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,St).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=.5*this.getSize(St).length()),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()||(Tt[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Tt[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Tt[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Tt[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Tt[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Tt[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Tt[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Tt[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Tt)),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const Tt=[new Ke,new Ke,new Ke,new Ke,new Ke,new Ke,new Ke,new Ke],St=new Ke,Mt=new wt,Et=new Ke,Ct=new Ke,Rt=new Ke,Nt=new Ke,Pt=new Ke,Dt=new Ke,Lt=new Ke,It=new Ke,Ot=new Ke,Bt=new Ke;function Ut(e,t,n,r,i){for(let s=0,a=e.length-3;s<=a;s+=3){Bt.fromArray(e,s);const a=i.x*Math.abs(Bt.x)+i.y*Math.abs(Bt.y)+i.z*Math.abs(Bt.z),o=t.dot(Bt),l=n.dot(Bt),u=r.dot(Bt);if(Math.max(-Math.max(o,l,u),Math.min(o,l,u))>a)return!1}return!0}const Ft=new wt,kt=new Ke,qt=new Ke;class Vt{constructor(e=new Ke,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;void 0!==t?n.copy(t):Ft.setFromPoints(e).getCenter(n);let r=0;for(let t=0,i=e.length;t<i;t++)r=Math.max(r,n.distanceToSquared(e[t]));return this.radius=Math.sqrt(r),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;kt.subVectors(e,this.center);const t=kt.lengthSq();if(t>this.radius*this.radius){const e=Math.sqrt(t),n=.5*(e-this.radius);this.center.addScaledVector(kt,n/e),this.radius+=n}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(!0===this.center.equals(e.center)?this.radius=Math.max(this.radius,e.radius):(qt.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(kt.copy(e.center).add(qt)),this.expandByPoint(kt.copy(e.center).sub(qt))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return(new this.constructor).copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const zt=new Ke,Gt=new Ke,jt=new Ke,Ht=new Ke,Wt=new Ke,Xt=new Ke,Qt=new Ke;class Yt{constructor(e=new Ke,t=new Ke(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,zt)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=zt.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(zt.copy(this.origin).addScaledVector(this.direction,t),zt.distanceToSquared(e))}distanceSqToSegment(e,t,n,r){Gt.copy(e).add(t).multiplyScalar(.5),jt.copy(t).sub(e).normalize(),Ht.copy(this.origin).sub(Gt);const i=.5*e.distanceTo(t),s=-this.direction.dot(jt),a=Ht.dot(this.direction),o=-Ht.dot(jt),l=Ht.lengthSq(),u=Math.abs(1-s*s);let c,h,A,d;if(u>0)if(c=s*o-a,h=s*a-o,d=i*u,c>=0)if(h>=-d)if(h<=d){const e=1/u;c*=e,h*=e,A=c*(c+s*h+2*a)+h*(s*c+h+2*o)+l}else h=i,c=Math.max(0,-(s*h+a)),A=-c*c+h*(h+2*o)+l;else h=-i,c=Math.max(0,-(s*h+a)),A=-c*c+h*(h+2*o)+l;else h<=-d?(c=Math.max(0,-(-s*i+a)),h=c>0?-i:Math.min(Math.max(-i,-o),i),A=-c*c+h*(h+2*o)+l):h<=d?(c=0,h=Math.min(Math.max(-i,-o),i),A=h*(h+2*o)+l):(c=Math.max(0,-(s*i+a)),h=c>0?i:Math.min(Math.max(-i,-o),i),A=-c*c+h*(h+2*o)+l);else h=s>0?-i:i,c=Math.max(0,-(s*h+a)),A=-c*c+h*(h+2*o)+l;return n&&n.copy(this.origin).addScaledVector(this.direction,c),r&&r.copy(Gt).addScaledVector(jt,h),A}intersectSphere(e,t){zt.subVectors(e.center,this.origin);const n=zt.dot(this.direction),r=zt.dot(zt)-n*n,i=e.radius*e.radius;if(r>i)return null;const s=Math.sqrt(i-r),a=n-s,o=n+s;return o<0?null:a<0?this.at(o,t):this.at(a,t)}intersectsSphere(e){return!(e.radius<0)&&this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return null===n?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,r,i,s,a,o;const l=1/this.direction.x,u=1/this.direction.y,c=1/this.direction.z,h=this.origin;return l>=0?(n=(e.min.x-h.x)*l,r=(e.max.x-h.x)*l):(n=(e.max.x-h.x)*l,r=(e.min.x-h.x)*l),u>=0?(i=(e.min.y-h.y)*u,s=(e.max.y-h.y)*u):(i=(e.max.y-h.y)*u,s=(e.min.y-h.y)*u),n>s||i>r?null:((i>n||isNaN(n))&&(n=i),(s<r||isNaN(r))&&(r=s),c>=0?(a=(e.min.z-h.z)*c,o=(e.max.z-h.z)*c):(a=(e.max.z-h.z)*c,o=(e.min.z-h.z)*c),n>o||a>r?null:((a>n||n!=n)&&(n=a),(o<r||r!=r)&&(r=o),r<0?null:this.at(n>=0?n:r,t)))}intersectsBox(e){return null!==this.intersectBox(e,zt)}intersectTriangle(e,t,n,r,i){Wt.subVectors(t,e),Xt.subVectors(n,e),Qt.crossVectors(Wt,Xt);let s,a=this.direction.dot(Qt);if(a>0){if(r)return null;s=1}else{if(!(a<0))return null;s=-1,a=-a}Ht.subVectors(this.origin,e);const o=s*this.direction.dot(Xt.crossVectors(Ht,Xt));if(o<0)return null;const l=s*this.direction.dot(Wt.cross(Ht));if(l<0)return null;if(o+l>a)return null;const u=-s*Ht.dot(Qt);return u<0?null:this.at(u/a,i)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return(new this.constructor).copy(this)}}class $t{constructor(e,t,n,r,i,s,a,o,l,u,c,h,A,d,p,f){$t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==e&&this.set(e,t,n,r,i,s,a,o,l,u,c,h,A,d,p,f)}set(e,t,n,r,i,s,a,o,l,u,c,h,A,d,p,f){const m=this.elements;return m[0]=e,m[4]=t,m[8]=n,m[12]=r,m[1]=i,m[5]=s,m[9]=a,m[13]=o,m[2]=l,m[6]=u,m[10]=c,m[14]=h,m[3]=A,m[7]=d,m[11]=p,m[15]=f,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new $t).fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,r=1/Kt.setFromMatrixColumn(e,0).length(),i=1/Kt.setFromMatrixColumn(e,1).length(),s=1/Kt.setFromMatrixColumn(e,2).length();return t[0]=n[0]*r,t[1]=n[1]*r,t[2]=n[2]*r,t[3]=0,t[4]=n[4]*i,t[5]=n[5]*i,t[6]=n[6]*i,t[7]=0,t[8]=n[8]*s,t[9]=n[9]*s,t[10]=n[10]*s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,r=e.y,i=e.z,s=Math.cos(n),a=Math.sin(n),o=Math.cos(r),l=Math.sin(r),u=Math.cos(i),c=Math.sin(i);if("XYZ"===e.order){const e=s*u,n=s*c,r=a*u,i=a*c;t[0]=o*u,t[4]=-o*c,t[8]=l,t[1]=n+r*l,t[5]=e-i*l,t[9]=-a*o,t[2]=i-e*l,t[6]=r+n*l,t[10]=s*o}
vendor: 6,956 bytes, line 1
1else if("YXZ"===e.order){const e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e+i*a,t[4]=r*a-n,t[8]=s*l,t[1]=s*c,t[5]=s*u,t[9]=-a,t[2]=n*a-r,t[6]=i+e*a,t[10]=s*o}else if("ZXY"===e.order){const e=o*u,n=o*c,r=l*u,i=l*c;t[0]=e-i*a,t[4]=-s*c,t[8]=r+n*a,t[1]=n+r*a,t[5]=s*u,t[9]=i-e*a,t[2]=-s*l,t[6]=a,t[10]=s*o}else if("ZYX"===e.order){const e=s*u,n=s*c,r=a*u,i=a*c;t[0]=o*u,t[4]=r*l-n,t[8]=e*l+i,t[1]=o*c,t[5]=i*l+e,t[9]=n*l-r,t[2]=-l,t[6]=a*o,t[10]=s*o}else if("YZX"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*u,t[4]=i-e*c,t[8]=r*c+n,t[1]=c,t[5]=s*u,t[9]=-a*u,t[2]=-l*u,t[6]=n*c+r,t[10]=e-i*c}else if("XZY"===e.order){const e=s*o,n=s*l,r=a*o,i=a*l;t[0]=o*u,t[4]=-c,t[8]=l*u,t[1]=e*c+i,t[5]=s*u,t[9]=n*c-r,t[2]=r*c-n,t[6]=a*u,t[10]=i*c+e}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Jt,e,en)}lookAt(e,t,n){const r=this.elements;return rn.subVectors(e,t),0===rn.lengthSq()&&(rn.z=1),rn.normalize(),tn.crossVectors(n,rn),0===tn.lengthSq()&&(1===Math.abs(n.z)?rn.x+=1e-4:rn.z+=1e-4,rn.normalize(),tn.crossVectors(n,rn)),tn.normalize(),nn.crossVectors(rn,tn),r[0]=tn.x,r[4]=nn.x,r[8]=rn.x,r[1]=tn.y,r[5]=nn.y,r[9]=rn.y,r[2]=tn.z,r[6]=nn.z,r[10]=rn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,r=t.elements,i=this.elements,s=n[0],a=n[4],o=n[8],l=n[12],u=n[1],c=n[5],h=n[9],A=n[13],d=n[2],p=n[6],f=n[10],m=n[14],g=n[3],_=n[7],v=n[11],y=n[15],x=r[0],b=r[4],w=r[8],T=r[12],S=r[1],M=r[5],E=r[9],C=r[13],R=r[2],N=r[6],P=r[10],D=r[14],L=r[3],I=r[7],O=r[11],B=r[15];return i[0]=s*x+a*S+o*R+l*L,i[4]=s*b+a*M+o*N+l*I,i[8]=s*w+a*E+o*P+l*O,i[12]=s*T+a*C+o*D+l*B,i[1]=u*x+c*S+h*R+A*L,i[5]=u*b+c*M+h*N+A*I,i[9]=u*w+c*E+h*P+A*O,i[13]=u*T+c*C+h*D+A*B,i[2]=d*x+p*S+f*R+m*L,i[6]=d*b+p*M+f*N+m*I,i[10]=d*w+p*E+f*P+m*O,i[14]=d*T+p*C+f*D+m*B,i[3]=g*x+_*S+v*R+y*L,i[7]=g*b+_*M+v*N+y*I,i[11]=g*w+_*E+v*P+y*O,i[15]=g*T+_*C+v*D+y*B,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],r=e[8],i=e[12],s=e[1],a=e[5],o=e[9],l=e[13],u=e[2],c=e[6],h=e[10],A=e[14];return e[3]*(+i*o*c-r*l*c-i*a*h+n*l*h+r*a*A-n*o*A)+e[7]*(+t*o*A-t*l*h+i*s*h-r*s*A+r*l*u-i*o*u)+e[11]*(+t*l*c-t*a*A-i*s*c+n*s*A+i*a*u-n*l*u)+e[15]*(-r*a*u-t*o*c+t*a*h+r*s*c-n*s*h+n*o*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const r=this.elements;return e.isVector3?(r[12]=e.x,r[13]=e.y,r[14]=e.z):(r[12]=e,r[13]=t,r[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],a=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],A=e[11],d=e[12],p=e[13],f=e[14],m=e[15],g=c*f*l-p*h*l+p*o*A-a*f*A-c*o*m+a*h*m,_=d*h*l-u*f*l-d*o*A+s*f*A+u*o*m-s*h*m,v=u*p*l-d*c*l+d*a*A-s*p*A-u*a*m+s*c*m,y=d*c*o-u*p*o-d*a*h+s*p*h+u*a*f-s*c*f,x=t*g+n*_+r*v+i*y;if(0===x)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const b=1/x;return e[0]=g*b,e[1]=(p*h*i-c*f*i-p*r*A+n*f*A+c*r*m-n*h*m)*b,e[2]=(a*f*i-p*o*i+p*r*l-n*f*l-a*r*m+n*o*m)*b,e[3]=(c*o*i-a*h*i-c*r*l+n*h*l+a*r*A-n*o*A)*b,e[4]=_*b,e[5]=(u*f*i-d*h*i+d*r*A-t*f*A-u*r*m+t*h*m)*b,e[6]=(d*o*i-s*f*i-d*r*l+t*f*l+s*r*m-t*o*m)*b,e[7]=(s*h*i-u*o*i+u*r*l-t*h*l-s*r*A+t*o*A)*b,e[8]=v*b,e[9]=(d*c*i-u*p*i-d*n*A+t*p*A+u*n*m-t*c*m)*b,e[10]=(s*p*i-d*a*i+d*n*l-t*p*l-s*n*m+t*a*m)*b,e[11]=(u*a*i-s*c*i-u*n*l+t*c*l+s*n*A-t*a*A)*b,e[12]=y*b,e[13]=(u*p*r-d*c*r+d*n*h-t*p*h-u*n*f+t*c*f)*b,e[14]=(d*a*r-s*p*r-d*n*o+t*p*o+s*n*f-t*a*f)*b,e[15]=(s*c*r-u*a*r+u*n*o-t*c*o-s*n*h+t*a*h)*b,this}scale(e){const t=this.elements,n=e.x,r=e.y,i=e.z;return t[0]*=n,t[4]*=r,t[8]*=i,t[1]*=n,t[5]*=r,t[9]*=i,t[2]*=n,t[6]*=r,t[10]*=i,t[3]*=n,t[7]*=r,t[11]*=i,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],r=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,r))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),r=Math.sin(t),i=1-n,s=e.x,a=e.y,o=e.z,l=i*s,u=i*a;return this.set(l*s+n,l*a-r*o,l*o+r*a,0,l*a+r*o,u*a+n,u*o-r*s,0,l*o-r*a,u*o+r*s,i*o*o+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,r,i,s){return this.set(1,n,i,0,e,1,s,0,t,r,1,0,0,0,0,1),this}compose(e,t,n){const r=this.elements,i=t._x,s=t._y,a=t._z,o=t._w,l=i+i,u=s+s,c=a+a,h=i*l,A=i*u,d=i*c,p=s*u,f=s*c,m=a*c,g=o*l,_=o*u,v=o*c,y=n.x,x=n.y,b=n.z;return r[0]=(1-(p+m))*y,r[1]=(A+v)*y,r[2]=(d-_)*y,r[3]=0,r[4]=(A-v)*x,r[5]=(1-(h+m))*x,r[6]=(f+g)*x,r[7]=0,r[8]=(d+_)*b,r[9]=(f-g)*b,r[10]=(1-(h+p))*b,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,this}decompose(e,t,n){const r=this.elements;let i=Kt.set(r[0],r[1],r[2]).length();const s=Kt.set(r[4],r[5],r[6]).length(),a=Kt.set(r[8],r[9],r[10]).length();this.determinant()<0&&(i=-i),e.x=r[12],e.y=r[13],e.z=r[14],Zt.copy(this);const o=1/i,l=1/s,u=1/a;return Zt.elements[0]*=o,Zt.elements[1]*=o,Zt.elements[2]*=o,Zt.elements[4]*=l,Zt.elements[5]*=l,Zt.elements[6]*=l,Zt.elements[8]*=u,Zt.elements[9]*=u,Zt.elements[10]*=u,t.setFromRotationMatrix(Zt),n.x=i,n.y=s,n.z=a,this}makePerspective(e,t,n,r,i,s,a=2e3){const o=this.elements,l=2*i/(t-e),u=2*i/(n-r),c=(t+e)/(t-e),h=(n+r)/(n-r);let A,d;if(a===Oe)A=-(s+i)/(s-i),d=-2*s*i/(s-i);else{if(a!==Be)throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);A=-s/(s-i),d=-s*i/(s-i)}return o[0]=l,o[4]=0,o[8]=c,o[12]=0,o[1]=0,o[5]=u,o[9]=h,o[13]=0,o[2]=0,o[6]=0,o[10]=A,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(e,t,n,r,i,s,a=2e3){const o=this.elements,l=1/(t-e),u=1/(n-r),c=1/(s-i),h=(t+e)*l,A=(n+r)*u;let d,p;if(a===Oe)d=(s+i)*c,p=-2*c;else{if(a!==Be)throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);d=i*c,p=-1*c}return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-h,o[1]=0,o[5]=2*u,o[9]=0,o[13]=-A,o[2]=0,o[6]=0,o[10]=p,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let e=0;e<16;e++)if(t[e]!==n[e])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}
vendor: 4,628 bytes, line 1
1const Kt=new Ke,Zt=new $t,Jt=new Ke(0,0,0),en=new Ke(1,1,1),tn=new Ke,nn=new Ke,rn=new Ke,sn=new $t,an=new $e;class on{constructor(e=0,t=0,n=0,r=on.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=r}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,r=this._order){return this._x=e,this._y=t,this._z=n,this._order=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const r=e.elements,i=r[0],s=r[4],a=r[8],o=r[1],l=r[5],u=r[9],c=r[2],h=r[6],A=r[10];switch(t){case"XYZ":this._y=Math.asin(Ge(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,A),this._z=Math.atan2(-s,i)):(this._x=Math.atan2(h,l),this._z=0);break;case"YXZ":this._x=Math.asin(-Ge(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,A),this._z=Math.atan2(o,l)):(this._y=Math.atan2(-c,i),this._z=0);break;case"ZXY":this._x=Math.asin(Ge(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(-c,A),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(o,i));break;case"ZYX":this._y=Math.asin(-Ge(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(h,A),this._z=Math.atan2(o,i)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(Ge(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-u,l),this._y=Math.atan2(-c,i)):(this._x=0,this._y=Math.atan2(a,A));break;case"XZY":this._z=Math.asin(-Ge(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(h,l),this._y=Math.atan2(a,i)):(this._x=Math.atan2(-u,A),this._y=0);break;default:}return this._order=t,!0===n&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return sn.makeRotationFromQuaternion(e),this.setFromRotationMatrix(sn,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return an.setFromEuler(this),this.setFromQuaternion(an,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],void 0!==e[3]&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}on.DEFAULT_ORDER="XYZ";class ln{constructor(){this.mask=1}set(e){this.mask=1<<e>>>0}enable(e){this.mask|=1<<e}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e}disable(e){this.mask&=~(1<<e)}disableAll(){this.mask=0}test(e){return 0!=(this.mask&e.mask)}isEnabled(e){return!!(this.mask&1<<e)}}let un=0;const cn=new Ke,hn=new $e,An=new $t,dn=new Ke,pn=new Ke,fn=new Ke,mn=new $e,gn=new Ke(1,0,0),_n=new Ke(0,1,0),vn=new Ke(0,0,1),yn={type:"added"},xn={type:"removed"},bn={type:"childadded",child:null},wn={type:"childremoved",child:null};class Tn extends Ue{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:un++}),this.uuid=ze(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Tn.DEFAULT_UP.clone();const e=new Ke,t=new on,n=new $e,r=new Ke(1,1,1);t._onChange((function(){n.setFromEuler(t,!1)})),n._onChange((function(){t.setFromQuaternion(n,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:r},modelViewMatrix:{value:new $t},normalMatrix:{value:new et}}),this.matrix=new $t,this.matrixWorld=new $t,this.matrixAutoUpdate=Tn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new ln,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}
vendor: 4,117 bytes, line 1
1setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hn.setFromAxisAngle(e,t),this.quaternion.multiply(hn),this}rotateOnWorldAxis(e,t){return hn.setFromAxisAngle(e,t),this.quaternion.premultiply(hn),this}rotateX(e){return this.rotateOnAxis(gn,e)}rotateY(e){return this.rotateOnAxis(_n,e)}rotateZ(e){return this.rotateOnAxis(vn,e)}translateOnAxis(e,t){return cn.copy(e).applyQuaternion(this.quaternion),this.position.add(cn.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(gn,e)}translateY(e){return this.translateOnAxis(_n,e)}translateZ(e){return this.translateOnAxis(vn,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(An.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?dn.copy(e):dn.set(e,t,n);const r=this.parent;this.updateWorldMatrix(!0,!1),pn.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?An.lookAt(pn,dn,this.up):An.lookAt(dn,pn,this.up),this.quaternion.setFromRotationMatrix(An),r&&(An.extractRotation(r.matrixWorld),hn.setFromRotationMatrix(An),this.quaternion.premultiply(hn.invert()))}add(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return e===this||e&&e.isObject3D&&(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(yn),bn.child=e,this.dispatchEvent(bn),bn.child=null),this}remove(e){if(arguments.length>1){for(let e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}const t=this.children.indexOf(e);return-1!==t&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(xn),wn.child=e,this.dispatchEvent(wn),wn.child=null),this}removeFromParent(){const e=this.parent;return null!==e&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),An.copy(this.matrixWorld).invert(),null!==e.parent&&(e.parent.updateWorldMatrix(!0,!1),An.multiply(e.parent.matrixWorld)),e.applyMatrix4(An),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(yn),bn.child=e,this.dispatchEvent(bn),bn.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,r=this.children.length;n<r;n++){const r=this.children[n].getObjectByProperty(e,t);if(void 0!==r)return r}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const r=this.children;for(let i=0,s=r.length;i<s;i++)r[i].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(pn,e,fn),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(pn,mn,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverse(e)}traverseVisible(e){if(!1===this.visible)return;e(this);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;null!==t&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,r=t.length;n<r;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(!0===e&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),!0===this.matrixWorldAutoUpdate&&(null===this.parent?this.matrixWorld.copy(this.matrix
vendor: 5,874 bytes, line 1
1):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),!0===t){const e=this.children;for(let t=0,n=e.length;t<n;t++)e[t].updateWorldMatrix(!1,!0)}}toJSON(e){const t=void 0===e||"string"==typeof e,n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const r={};function i(t,n){return void 0===t[n.uuid]&&(t[n.uuid]=n.toJSON(e)),n.uuid}if(r.uuid=this.uuid,r.type=this.type,""!==this.name&&(r.name=this.name),!0===this.castShadow&&(r.castShadow=!0),!0===this.receiveShadow&&(r.receiveShadow=!0),!1===this.visible&&(r.visible=!1),!1===this.frustumCulled&&(r.frustumCulled=!1),0!==this.renderOrder&&(r.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(r.userData=this.userData),r.layers=this.layers.mask,r.matrix=this.matrix.toArray(),r.up=this.up.toArray(),!1===this.matrixAutoUpdate&&(r.matrixAutoUpdate=!1),this.isInstancedMesh&&(r.type="InstancedMesh",r.count=this.count,r.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(r.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(r.type="BatchedMesh",r.perObjectFrustumCulled=this.perObjectFrustumCulled,r.sortObjects=this.sortObjects,r.drawRanges=this._drawRanges,r.reservedRanges=this._reservedRanges,r.geometryInfo=this._geometryInfo.map((e=>({...e,boundingBox:e.boundingBox?e.boundingBox.toJSON():void 0,boundingSphere:e.boundingSphere?e.boundingSphere.toJSON():void 0}))),r.instanceInfo=this._instanceInfo.map((e=>({...e}))),r.availableInstanceIds=this._availableInstanceIds.slice(),r.availableGeometryIds=this._availableGeometryIds.slice(),r.nextIndexStart=this._nextIndexStart,r.nextVertexStart=this._nextVertexStart,r.geometryCount=this._geometryCount,r.maxInstanceCount=this._maxInstanceCount,r.maxVertexCount=this._maxVertexCount,r.maxIndexCount=this._maxIndexCount,r.geometryInitialized=this._geometryInitialized,r.matricesTexture=this._matricesTexture.toJSON(e),r.indirectTexture=this._indirectTexture.toJSON(e),null!==this._colorsTexture&&(r.colorsTexture=this._colorsTexture.toJSON(e)),null!==this.boundingSphere&&(r.boundingSphere=this.boundingSphere.toJSON()),null!==this.boundingBox&&(r.boundingBox=this.boundingBox.toJSON())),this.isScene)this.background&&(this.background.isColor?r.background=this.background.toJSON():this.background.isTexture&&(r.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&!0!==this.environment.isRenderTargetTexture&&(r.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){r.geometry=i(e.geometries,this.geometry);const t=this.geometry.parameters;if(void 0!==t&&void 0!==t.shapes){const n=t.shapes;if(Array.isArray(n))for(let t=0,r=n.length;t<r;t++){const r=n[t];i(e.shapes,r)}else i(e.shapes,n)}}if(this.isSkinnedMesh&&(r.bindMode=this.bindMode,r.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(i(e.skeletons,this.skeleton),r.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const t=[];for(let n=0,r=this.material.length;n<r;n++)t.push(i(e.materials,this.material[n]));r.material=t}else r.material=i(e.materials,this.material);if(this.children.length>0){r.children=[];for(let t=0;t<this.children.length;t++)r.children.push(this.children[t].toJSON(e).object)}if(this.animations.length>0){r.animations=[];for(let t=0;t<this.animations.length;t++){const n=this.animations[t];r.animations.push(i(e.animations,n))}}if(t){const t=s(e.geometries),r=s(e.materials),i=s(e.textures),a=s(e.images),o=s(e.shapes),l=s(e.skeletons),u=s(e.animations),c=s(e.nodes);t.length>0&&(n.geometries=t),r.length>0&&(n.materials=r),i.length>0&&(n.textures=i),a.length>0&&(n.images=a),o.length>0&&(n.shapes=o),l.length>0&&(n.skeletons=l),u.length>0&&(n.animations=u),c.length>0&&(n.nodes=c)}return n.object=r,n;function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}}clone(e){return(new this.constructor).copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(let t=0;t<e.children.length;t++){const n=e.children[t];this.add(n.clone())}return this}}Tn.DEFAULT_UP=new Ke(0,1,0),Tn.DEFAULT_MATRIX_AUTO_UPDATE=!0,Tn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Sn=new Ke,Mn=new Ke,En=new Ke,Cn=new Ke,Rn=new Ke,Nn=new Ke,Pn=new Ke,Dn=new Ke,Ln=new Ke,In=new Ke,On=new vt,Bn=new vt,Un=new vt;class Fn{constructor(e=new Ke,t=new Ke,n=new Ke){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,r){r.subVectors(n,t),Sn.subVectors(e,t),r.cross(Sn);const i=r.lengthSq();return i>0?r.multiplyScalar(1/Math.sqrt(i)):r.set(0,0,0)}static getBarycoord(e,t,n,r,i){Sn.subVectors(r,t),Mn.subVectors(n,t),En.subVectors(e,t);const s=Sn.dot(Sn),a=Sn.dot(Mn),o=Sn.dot(En),l=Mn.dot(Mn),u=Mn.dot(En),c=s*l-a*a;if(0===c)return i.set(0,0,0),null;const h=1/c,A=(l*o-a*u)*h,d=(s*u-a*o)*h;return i.set(1-A-d,d,A)}static containsPoint(e,t,n,r){return null!==this.getBarycoord(e,t,n,r,Cn)&&Cn.x>=0&&Cn.y>=0&&Cn.x+Cn.y<=1}static getInterpolation(e,t,n,r,i,s,a,o){return null===this.getBarycoord(e,t,n,r,Cn)?(o.x=0,o.y=0,"z"in o&&(o.z=0),"w"in o&&(o.w=0),null):(o.setScalar(0),o.addScaledVector(i,Cn.x),o.addScaledVector(s,Cn.y),o.addScaledVector(a,
vendor: 9,004 bytes, line 1
1Cn.z),o)}static getInterpolatedAttribute(e,t,n,r,i,s){return On.setScalar(0),Bn.setScalar(0),Un.setScalar(0),On.fromBufferAttribute(e,t),Bn.fromBufferAttribute(e,n),Un.fromBufferAttribute(e,r),s.setScalar(0),s.addScaledVector(On,i.x),s.addScaledVector(Bn,i.y),s.addScaledVector(Un,i.z),s}static isFrontFacing(e,t,n,r){return Sn.subVectors(n,t),Mn.subVectors(e,t),Sn.cross(Mn).dot(r)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,r){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[r]),this}setFromAttributeAndIndices(e,t,n,r){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,r),this}clone(){return(new this.constructor).copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Sn.subVectors(this.c,this.b),Mn.subVectors(this.a,this.b),.5*Sn.cross(Mn).length()}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Fn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Fn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,r,i){return Fn.getInterpolation(e,this.a,this.b,this.c,t,n,r,i)}containsPoint(e){return Fn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Fn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,r=this.b,i=this.c;let s,a;Rn.subVectors(r,n),Nn.subVectors(i,n),Dn.subVectors(e,n);const o=Rn.dot(Dn),l=Nn.dot(Dn);if(o<=0&&l<=0)return t.copy(n);Ln.subVectors(e,r);const u=Rn.dot(Ln),c=Nn.dot(Ln);if(u>=0&&c<=u)return t.copy(r);const h=o*c-u*l;if(h<=0&&o>=0&&u<=0)return s=o/(o-u),t.copy(n).addScaledVector(Rn,s);In.subVectors(e,i);const A=Rn.dot(In),d=Nn.dot(In);if(d>=0&&A<=d)return t.copy(i);const p=A*l-o*d;if(p<=0&&l>=0&&d<=0)return a=l/(l-d),t.copy(n).addScaledVector(Nn,a);const f=u*d-A*c;if(f<=0&&c-u>=0&&A-d>=0)return Pn.subVectors(i,r),a=(c-u)/(c-u+(A-d)),t.copy(r).addScaledVector(Pn,a);const m=1/(f+p+h);return s=p*m,a=h*m,t.copy(n).addScaledVector(Rn,s).addScaledVector(Nn,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.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},qn={h:0,s:0,l:0},Vn={h:0,s:0,l:0};function zn(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+6*(t-e)*(2/3-n):e}let Gn=class{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(void 0===t&&void 0===n){const t=e;t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Se){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,ut.colorSpaceToWorking(this,t),this}setRGB(e,t,n,r=ut.workingColorSpace){return this.r=e,this.g=t,this.b=n,ut.colorSpaceToWorking(this,r),this}setHSL(e,t,n,r=ut.workingColorSpace){if(e=je(e,1),t=Ge(t,0,1),n=Ge(n,0,1),0===t)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,i=2*n-r;this.r=zn(i,r,e+1/3),this.g=zn(i,r,e),this.b=zn(i,r,e-1/3)}return ut.colorSpaceToWorking(this,r),this}setStyle(e,t=Se){function n(e){void 0!==e&&parseFloat(e)}let r;if(r=/^(\w+)\(([^\)]*)\)/.exec(e)){let e;const i=r[1],s=r[2];switch(i){case"rgb":case"rgba":if(e=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(e[4]),this.setRGB(Math.min(255,parseInt(e[1],10))/255,Math.min(255,parseInt(e[2],10))/255,Math.min(255,parseInt(e[3],10))/255,t);if(e=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(e[4]),this.setRGB(Math.min(100,parseInt(e[1],10))/100,Math.min(100,parseInt(e[2],10))/100,Math.min(100,parseInt(e[3],10))/100,t);break;case"hsl":case"hsla":if(e=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return n(e[4]),this.setHSL(parseFloat(e[1])/360,parseFloat(e[2])/100,parseFloat(e[3])/100,t);break;default:}}else if(r=/^\#([A-Fa-f\d]+)$/.exec(e)){const e=r[1],n=e.length;if(3===n)return this.setRGB(parseInt(e.charAt(0),16)/15,parseInt(e.charAt(1),16)/15,parseInt(e.charAt(2),16)/15,t);if(6===n)return this.setHex(parseInt(e,16),t)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Se){const n=kn[e.toLowerCase()];return void 0!==n&&this.setHex(n,t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=ct(e.r),this.g=ct(e.g),this.b=ct(e.b),this}copyLinearToSRGB(e){return this.r=ht(e.r),this.g=ht(e.g),this.b=ht(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Se){return ut.workingToColorSpace(jn.copy(this),e),65536*Math.round(Ge(255*jn.r,0,255))+256*Math.round(Ge(255*jn.g,0,255))+Math.round(Ge(255*jn.b,0,255))}getHexString(e=Se){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=ut.workingColorSpace){ut.workingToColorSpace(jn.copy(this),t);const n=jn.r,r=jn.g,i=jn.b,s=Math.max(n,r,i),a=Math.min(n,r,i);let o,l;const u=(a+s)/2;if(a===s)o=0,l=0;else{const e=s-a;switch(l=u<=.5?e/(s+a):e/(2-s-a),s){case n:o=(r-i)/e+(r<i?6:0);break;case r:o=(i-n)/e+2;break;case i:o=(n-r)/e+4}o/=6}return e.h=o,e.s=l,e.l=u,e}getRGB(e,t=ut.workingColorSpace){return ut.workingToColorSpace(jn.copy(this),t),e.r=jn.r,e.g=jn.g,e.b=jn.b,e}getStyle(e=Se){ut.workingToColorSpace(jn.copy(this),e);const t=jn.r,n=jn.g,r=jn.b;return e!==Se?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${r.toFixed(3)})`:`rgb(${Math.round(255*t)},${Math.round(255*n)},${Math.round(255*r)})`}offsetHSL(e,t,n){return this.getHSL(qn),this.setHSL(qn.h+e,qn.s+t,qn.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}
vendor: 2,580 bytes, line 1
1lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(qn),e.getHSL(Vn);const n=He(qn.h,Vn.h,t),r=He(qn.s,Vn.s,t),i=He(qn.l,Vn.l,t);return this.setHSL(n,r,i),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,r=this.b,i=e.elements;return this.r=i[0]*t+i[3]*n+i[6]*r,this.g=i[1]*t+i[4]*n+i[7]*r,this.b=i[2]*t+i[5]*n+i[8]*r,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};const jn=new Gn;Gn.NAMES=kn;let Hn=0;class Wn extends Ue{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Hn++}),this.uuid=ze(),this.name="",this.type="Material",this.blending=1,this.side=0,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=l,this.blendDst=u,this.blendEquation=a,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Gn(0,0,0),this.blendAlpha=0,this.depthFunc=3,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=519,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Re,this.stencilZFail=Re,this.stencilZPass=Re,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.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(void 0!==e)for(const t in e){const n=e[t];if(void 0===n)continue;const r=this[t];void 0!==r&&(r&&r.isColor?r.set(n):r&&r.isVector3&&n&&n.isVector3?r.copy(n):this[t]=n)}}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};function r(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}
vendor: 5,422 bytes, line 1
1if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),void 0!==this.sheen&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),void 0!==this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),void 0!==this.dispersion&&(n.dispersion=this.dispersion),void 0!==this.iridescence&&(n.iridescence=this.iridescence),void 0!==this.iridescenceIOR&&(n.iridescenceIOR=this.iridescenceIOR),void 0!==this.iridescenceThicknessRange&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),void 0!==this.anisotropy&&(n.anisotropy=this.anisotropy),void 0!==this.anisotropyRotation&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,void 0!==this.combine&&(n.combine=this.combine)),void 0!==this.envMapRotation&&(n.envMapRotation=this.envMapRotation.toArray()),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(n.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),void 0!==this.transmission&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),void 0!==this.thickness&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),void 0!==this.attenuationDistance&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(n.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(n.size=this.size),null!==this.shadowSide&&(n.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),1!==this.blending&&(n.blending=this.blending),0!==this.side&&(n.side=this.side),!0===this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=!0),this.blendSrc!==l&&(n.blendSrc=this.blendSrc),this.blendDst!==u&&(n.blendDst=this.blendDst),this.blendEquation!==a&&(n.blendEquation=this.blendEquation),null!==this.blendSrcAlpha&&(n.blendSrcAlpha=this.blendSrcAlpha),null!==this.blendDstAlpha&&
vendor: 13,884 bytes, line 1
1(n.blendDstAlpha=this.blendDstAlpha),null!==this.blendEquationAlpha&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),0!==this.blendAlpha&&(n.blendAlpha=this.blendAlpha),3!==this.depthFunc&&(n.depthFunc=this.depthFunc),!1===this.depthTest&&(n.depthTest=this.depthTest),!1===this.depthWrite&&(n.depthWrite=this.depthWrite),!1===this.colorWrite&&(n.colorWrite=this.colorWrite),255!==this.stencilWriteMask&&(n.stencilWriteMask=this.stencilWriteMask),519!==this.stencilFunc&&(n.stencilFunc=this.stencilFunc),0!==this.stencilRef&&(n.stencilRef=this.stencilRef),255!==this.stencilFuncMask&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Re&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Re&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Re&&(n.stencilZPass=this.stencilZPass),!0===this.stencilWrite&&(n.stencilWrite=this.stencilWrite),void 0!==this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.alphaHash&&(n.alphaHash=!0),!0===this.alphaToCoverage&&(n.alphaToCoverage=!0),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=!0),!0===this.forceSinglePass&&(n.forceSinglePass=!0),!0===this.wireframe&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.flatShading&&(n.flatShading=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),!1===this.fog&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData),t){const t=r(e.textures),i=r(e.images);t.length>0&&(n.textures=t),i.length>0&&(n.images=i)}return n}clone(){return(new this.constructor).copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(null!==t){const e=t.length;n=new Array(e);for(let r=0;r!==e;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){!0===e&&this.version++}}class Xn extends Wn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Gn(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.envMapRotation=new on,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Qn=function(){const e=new ArrayBuffer(4),t=new Float32Array(e),n=new Uint32Array(e),r=new Uint32Array(512),i=new Uint32Array(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(r[e]=0,r[256|e]=32768,i[e]=24,i[256|e]=24):t<-14?(r[e]=1024>>-t-14,r[256|e]=1024>>-t-14|32768,i[e]=-t-1,i[256|e]=-t-1):t<=15?(r[e]=t+15<<10,r[256|e]=t+15<<10|32768,i[e]=13,i[256|e]=13):t<128?(r[e]=31744,r[256|e]=64512,i[e]=24,i[256|e]=24):(r[e]=31744,r[256|e]=64512,i[e]=13,i[256|e]=13)}const s=new Uint32Array(2048),a=new Uint32Array(64),o=new Uint32Array(64);for(let e=1;e<1024;++e){let t=e<<13,n=0;for(;!(8388608&t);)t<<=1,n-=8388608;t&=-8388609,n+=947912704,s[e]=t|n}for(let e=1024;e<2048;++e)s[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)a[e]=e<<23;a[31]=1199570944,a[32]=2147483648;for(let e=33;e<63;++e)a[e]=2147483648+(e-32<<23);a[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(o[e]=1024);return{floatView:t,uint32View:n,baseTable:r,shiftTable:i,mantissaTable:s,exponentTable:a,offsetTable:o}}();function Yn(e){Math.abs(e),e=Ge(e,-65504,65504),Qn.floatView[0]=e;const t=Qn.uint32View[0],n=t>>23&511;return Qn.baseTable[n]+((8388607&t)>>Qn.shiftTable[n])}function $n(e){const t=e>>10;return Qn.uint32View[0]=Qn.mantissaTable[Qn.offsetTable[t]+(1023&e)]+Qn.exponentTable[t],Qn.floatView[0]}const Kn=new Ke,Zn=new Ye;let Jn=0;class er{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Jn++}),this.name="",this.array=e,this.itemSize=t,this.count=void 0!==e?e.length/t:0,this.normalized=n,this.usage=De,this.updateRanges=[],this.gpuType=N,this.version=0}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let r=0,i=this.itemSize;r<i;r++)this.array[e+r]=t.array[n+r];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(2===this.itemSize)for(let t=0,n=this.count;t<n;t++)Zn.fromBufferAttribute(this,t),Zn.applyMatrix3(e),this.setXY(t,Zn.x,Zn.y);else if(3===this.itemSize)for(let t=0,n=this.count;t<n;t++)Kn.fromBufferAttribute(this,t),Kn.applyMatrix3(e),this.setXYZ(t,Kn.x,Kn.y,Kn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Kn.fromBufferAttribute(this,t),Kn.applyMatrix4(e),this.setXYZ(t,Kn.x,Kn.y,Kn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Kn.fromBufferAttribute(this,t),Kn.applyNormalMatrix(e),this.setXYZ(t,Kn.x,Kn.y,Kn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Kn.fromBufferAttribute(this,t),Kn.transformDirection(e),this.setXYZ(t,Kn.x,Kn.y,Kn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=We(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Xe(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=We(t,this.array)),t}setX(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=We(t,this.array)),t}setY(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=We(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=We(t,this.array)),t}setW(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array),i=Xe(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=r,this.array[e+3]=i,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return""!==this.name&&(e.name=this.name),this.usage!==De&&(e.usage=this.usage),e}}class tr extends er{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class nr extends er{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class rr extends er{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=$n(this.array[e*this.itemSize]);return this.normalized&&(t=We(t,this.array)),t}setX(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize]=Yn(t),this}getY(e){let t=$n(this.array[e*this.itemSize+1]);return this.normalized&&(t=We(t,this.array)),t}setY(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+1]=Yn(t),this}getZ(e){let t=$n(this.array[e*this.itemSize+2]);return this.normalized&&(t=We(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+2]=Yn(t),this}getW(e){let t=$n(this.array[e*this.itemSize+3]);return this.normalized&&(t=We(t,this.array)),t}setW(e,t){return this.normalized&&(t=Xe(t,this.array)),this.array[e*this.itemSize+3]=Yn(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array)),this.array[e+0]=Yn(t),this.array[e+1]=Yn(n),this}setXYZ(e,t,n,r){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array)),this.array[e+0]=Yn(t),this.array[e+1]=Yn(n),this.array[e+2]=Yn(r),this}setXYZW(e,t,n,r,i){return e*=this.itemSize,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array),i=Xe(i,this.array)),this.array[e+0]=Yn(t),this.array[e+1]=Yn(n),this.array[e+2]=Yn(r),this.array[e+3]=Yn(i),this}}class ir extends er{constructor(e,t,n){super(new Float32Array(e),t,n)}}let sr=0;const ar=new $t,or=new Tn,lr=new Ke,ur=new wt,cr=new wt,hr=new Ke;class Ar extends Ue{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:sr++}),this.uuid=ze(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=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={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(nt(e)?nr:tr)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return void 0!==this.attributes[e]}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;void 0!==t&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const t=(new et).getNormalMatrix(e);n.applyNormalMatrix(t),n.needsUpdate=!0}const r=this.attributes.tangent;return void 0!==r&&(r.transformDirection(e),r.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}applyQuaternion(e){return ar.makeRotationFromQuaternion(e),this.applyMatrix4(ar),this}rotateX(e){return ar.makeRotationX(e),this.applyMatrix4(ar),this}rotateY(e){return ar.makeRotationY(e),this.applyMatrix4(ar),this}rotateZ(e){return ar.makeRotationZ(e),this.applyMatrix4(ar),this}translate(e,t,n){return ar.makeTranslation(e,t,n),this.applyMatrix4(ar),this}scale(e,t,n){return ar.makeScale(e,t,n),this.applyMatrix4(ar),this}lookAt(e){return or.lookAt(e),or.updateMatrix(),this.applyMatrix4(or.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(lr).negate(),this.translate(lr.x,lr.y,lr.z),this}setFromPoints(e){const t=this.getAttribute("position");if(void 0===t){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(r.x,r.y,r.z||0)}this.setAttribute("position",new ir(t,3))}else{const n=Math.min(e.length,t.count);for(let r=0;r<n;r++){const n=e[r];t.setXYZ(r,n.x,n.y,n.z||0)}e.length,t.count,t.needsUpdate=!0}return this}
vendor: 5,197 bytes, line 1
1computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new wt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)this.boundingBox.set(new Ke(-1/0,-1/0,-1/0),new Ke(1/0,1/0,1/0));else{if(void 0!==e){if(this.boundingBox.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];ur.setFromBufferAttribute(n),this.morphTargetsRelative?(hr.addVectors(this.boundingBox.min,ur.min),this.boundingBox.expandByPoint(hr),hr.addVectors(this.boundingBox.max,ur.max),this.boundingBox.expandByPoint(hr)):(this.boundingBox.expandByPoint(ur.min),this.boundingBox.expandByPoint(ur.max))}}else this.boundingBox.makeEmpty();isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Vt);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute)this.boundingSphere.set(new Ke,1/0);else if(e){const n=this.boundingSphere.center;if(ur.setFromBufferAttribute(e),t)for(let e=0,n=t.length;e<n;e++){const n=t[e];cr.setFromBufferAttribute(n),this.morphTargetsRelative?(hr.addVectors(ur.min,cr.min),ur.expandByPoint(hr),hr.addVectors(ur.max,cr.max),ur.expandByPoint(hr)):(ur.expandByPoint(cr.min),ur.expandByPoint(cr.max))}ur.getCenter(n);let r=0;for(let t=0,i=e.count;t<i;t++)hr.fromBufferAttribute(e,t),r=Math.max(r,n.distanceToSquared(hr));if(t)for(let i=0,s=t.length;i<s;i++){const s=t[i],a=this.morphTargetsRelative;for(let t=0,i=s.count;t<i;t++)hr.fromBufferAttribute(s,t),a&&(lr.fromBufferAttribute(e,t),hr.add(lr)),r=Math.max(r,n.distanceToSquared(hr))}this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)}}computeTangents(){const e=this.index,t=this.attributes;if(null===e||void 0===t.position||void 0===t.normal||void 0===t.uv)return;const n=t.position,r=t.normal,i=t.uv;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new er(new Float32Array(4*n.count),4));const s=this.getAttribute("tangent"),a=[],o=[];for(let e=0;e<n.count;e++)a[e]=new Ke,o[e]=new Ke;const l=new Ke,u=new Ke,c=new Ke,h=new Ye,A=new Ye,d=new Ye,p=new Ke,f=new Ke;function m(e,t,r){l.fromBufferAttribute(n,e),u.fromBufferAttribute(n,t),c.fromBufferAttribute(n,r),h.fromBufferAttribute(i,e),A.fromBufferAttribute(i,t),d.fromBufferAttribute(i,r),u.sub(l),c.sub(l),A.sub(h),d.sub(h);const s=1/(A.x*d.y-d.x*A.y);isFinite(s)&&(p.copy(u).multiplyScalar(d.y).addScaledVector(c,-A.y).multiplyScalar(s),f.copy(c).multiplyScalar(A.x).addScaledVector(u,-d.x).multiplyScalar(s),a[e].add(p),a[t].add(p),a[r].add(p),o[e].add(f),o[t].add(f),o[r].add(f))}let g=this.groups;0===g.length&&(g=[{start:0,count:e.count}]);for(let t=0,n=g.length;t<n;++t){const n=g[t],r=n.start;for(let t=r,i=r+n.count;t<i;t+=3)m(e.getX(t+0),e.getX(t+1),e.getX(t+2))}const _=new Ke,v=new Ke,y=new Ke,x=new Ke;function b(e){y.fromBufferAttribute(r,e),x.copy(y);const t=a[e];_.copy(t),_.sub(y.multiplyScalar(y.dot(t))).normalize(),v.crossVectors(x,t);const n=v.dot(o[e])<0?-1:1;s.setXYZW(e,_.x,_.y,_.z,n)}for(let t=0,n=g.length;t<n;++t){const n=g[t],r=n.start;for(let t=r,i=r+n.count;t<i;t+=3)b(e.getX(t+0)),b(e.getX(t+1)),b(e.getX(t+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(void 0!==t){let n=this.getAttribute("normal");if(void 0===n)n=new er(new Float32Array(3*t.count),3),this.setAttribute("normal",n);else for(let e=0,t=n.count;e<t;e++)n.setXYZ(e,0,0,0);const r=new Ke,i=new Ke,s=new Ke,a=new Ke,o=new Ke,l=new Ke,u=new Ke,c=new Ke;if(e)for(let h=0,A=e.count;h<A;h+=3){const A=e.getX(h+0),d=e.getX(h+1),p=e.getX(h+2);r.fromBufferAttribute(t,A),i.fromBufferAttribute(t,d),s.fromBufferAttribute(t,p),u.subVectors(s,i),c.subVectors(r,i),u.cross(c),a.fromBufferAttribute(n,A),o.fromBufferAttribute(n,d),l.fromBufferAttribute(n,p),a.add(u),o.add(u),l.add(u),n.setXYZ(A,a.x,a.y,a.z),n.setXYZ(d,o.x,o.y,o.z),n.setXYZ(p,l.x,l.y,l.z)}else for(let e=0,a=t.count;e<a;e+=3)r.fromBufferAttribute(t,e+0),i.fromBufferAttribute(t,e+1),s.fromBufferAttribute(t,e+2),u.subVectors(s,i),c.subVectors(r,i),u.cross(c),n.setXYZ(e+0,u.x,u.y,u.z),n.setXYZ(e+1,u.x,u.y,u.z),n.setXYZ(e+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)hr.fromBufferAttribute(e,t),hr.normalize(),e.setXYZ(t,hr.x,hr.y,hr.z)}toNonIndexed(){function e(e,t){const n=e.array,r=e.itemSize,i=e.normalized,s=new n.constructor(t.length*r);let a=0,o=0;for(let i=0,l=t.length;i<l;i++){a=e.isInterleavedBufferAttribute?t[i]*e.data.stride+e.offset:t[i]*r;for(let e=0;e<r;e++)s[o++]=n[a++]}return new er(s,r,i)}if(null===this.index)return this;const t=new Ar,n=this.index.array,r=this.attributes;for(const i in r){const s=e(r[i],n);t.setAttribute(i,s)}const i=this.morphAttributes;for(const r in i){const s=[],a=i[r];for(let t=0,r=a.length;t<r;t++){const r=e(a[t],n);s.push(r)}t.morphAttributes[r]=s}t.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let e=0,n=s.length;e<n;e++){const n=s[e];t.addGroup(n.start,n.count,n.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 4,409 bytes, line 1
1if(e.uuid=this.uuid,e.type=this.type,""!==this.name&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),void 0!==this.parameters){const t=this.parameters;for(const n in t)void 0!==t[n]&&(e[n]=t[n]);return e}e.data={attributes:{}};const t=this.index;null!==t&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const t in n){const r=n[t];e.data.attributes[t]=r.toJSON(e.data)}const r={};let i=!1;for(const t in this.morphAttributes){const n=this.morphAttributes[t],s=[];for(let t=0,r=n.length;t<r;t++){const r=n[t];s.push(r.toJSON(e.data))}s.length>0&&(r[t]=s,i=!0)}i&&(e.data.morphAttributes=r,e.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));const a=this.boundingSphere;return null!==a&&(e.data.boundingSphere=a.toJSON()),e}clone(){return(new this.constructor).copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;null!==n&&this.setIndex(n.clone());const r=e.attributes;for(const e in r){const n=r[e];this.setAttribute(e,n.clone(t))}const i=e.morphAttributes;for(const e in i){const n=[],r=i[e];for(let e=0,i=r.length;e<i;e++)n.push(r[e].clone(t));this.morphAttributes[e]=n}this.morphTargetsRelative=e.morphTargetsRelative;const s=e.groups;for(let e=0,t=s.length;e<t;e++){const t=s[e];this.addGroup(t.start,t.count,t.materialIndex)}const a=e.boundingBox;null!==a&&(this.boundingBox=a.clone());const o=e.boundingSphere;return null!==o&&(this.boundingSphere=o.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const dr=new $t,pr=new Yt,fr=new Vt,mr=new Ke,gr=new Ke,_r=new Ke,vr=new Ke,yr=new Ke,xr=new Ke,br=new Ke,wr=new Ke;class Tr extends Tn{constructor(e=new Ar,t=new Xn){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}getVertexPosition(e,t){const n=this.geometry,r=n.attributes.position,i=n.morphAttributes.position,s=n.morphTargetsRelative;t.fromBufferAttribute(r,e);const a=this.morphTargetInfluences;if(i&&a){xr.set(0,0,0);for(let n=0,r=i.length;n<r;n++){const r=a[n],o=i[n];0!==r&&(yr.fromBufferAttribute(o,e),s?xr.addScaledVector(yr,r):xr.addScaledVector(yr.sub(t),r))}t.add(xr)}return t}raycast(e,t){const n=this.geometry,r=this.material,i=this.matrixWorld;if(void 0!==r){if(null===n.boundingSphere&&n.computeBoundingSphere(),fr.copy(n.boundingSphere),fr.applyMatrix4(i),pr.copy(e.ray).recast(e.near),!1===fr.containsPoint(pr.origin)){if(null===pr.intersectSphere(fr,mr))return;if(pr.origin.distanceToSquared(mr)>(e.far-e.near)**2)return}dr.copy(i).invert(),pr.copy(e.ray).applyMatrix4(dr),null!==n.boundingBox&&!1===pr.intersectsBox(n.boundingBox)||this._computeIntersections(e,t,pr)}}_computeIntersections(e,t,n){let r;const i=this.geometry,s=this.material,a=i.index,o=i.attributes.position,l=i.attributes.uv,u=i.attributes.uv1,c=i.attributes.normal,h=i.groups,A=i.drawRange;if(null!==a)if(Array.isArray(s))for(let i=0,o=h.length;i<o;i++){const o=h[i],d=s[o.materialIndex];for(let i=Math.max(o.start,A.start),s=Math.min(a.count,Math.min(o.start+o.count,A.start+A.count));i<s;i+=3)r=Sr(this,d,e,n,l,u,c,a.getX(i),a.getX(i+1),a.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=o.materialIndex,t.push(r))}else for(let i=Math.max(0,A.start),o=Math.min(a.count,A.start+A.count);i<o;i+=3)r=Sr(this,s,e,n,l,u,c,a.getX(i),a.getX(i+1),a.getX(i+2)),r&&(r.faceIndex=Math.floor(i/3),t.pu
vendor: 6,026 bytes, line 1
1sh(r));else if(void 0!==o)if(Array.isArray(s))for(let i=0,a=h.length;i<a;i++){const a=h[i],d=s[a.materialIndex];for(let i=Math.max(a.start,A.start),s=Math.min(o.count,Math.min(a.start+a.count,A.start+A.count));i<s;i+=3)r=Sr(this,d,e,n,l,u,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),r.face.materialIndex=a.materialIndex,t.push(r))}else for(let i=Math.max(0,A.start),a=Math.min(o.count,A.start+A.count);i<a;i+=3)r=Sr(this,s,e,n,l,u,c,i,i+1,i+2),r&&(r.faceIndex=Math.floor(i/3),t.push(r))}}function Sr(e,t,n,r,i,s,a,o,l,u){e.getVertexPosition(o,gr),e.getVertexPosition(l,_r),e.getVertexPosition(u,vr);const c=function(e,t,n,r,i,s,a,o){let l;if(l=1===t.side?r.intersectTriangle(a,s,i,!0,o):r.intersectTriangle(i,s,a,0===t.side,o),null===l)return null;wr.copy(o),wr.applyMatrix4(e.matrixWorld);const u=n.ray.origin.distanceTo(wr);return u<n.near||u>n.far?null:{distance:u,point:wr.clone(),object:e}}(e,t,n,r,gr,_r,vr,br);if(c){const e=new Ke;Fn.getBarycoord(br,gr,_r,vr,e),i&&(c.uv=Fn.getInterpolatedAttribute(i,o,l,u,e,new Ye)),s&&(c.uv1=Fn.getInterpolatedAttribute(s,o,l,u,e,new Ye)),a&&(c.normal=Fn.getInterpolatedAttribute(a,o,l,u,e,new Ke),c.normal.dot(r.direction)>0&&c.normal.multiplyScalar(-1));const t={a:o,b:l,c:u,normal:new Ke,materialIndex:0};Fn.getNormal(gr,_r,vr,t.normal),c.face=t,c.barycoord=e}return c}class Mr extends Ar{constructor(e=1,t=1,n=1,r=1,i=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:r,heightSegments:i,depthSegments:s};const a=this;r=Math.floor(r),i=Math.floor(i),s=Math.floor(s);const o=[],l=[],u=[],c=[];let h=0,A=0;function d(e,t,n,r,i,s,d,p,f,m,g){const _=s/f,v=d/m,y=s/2,x=d/2,b=p/2,w=f+1,T=m+1;let S=0,M=0;const E=new Ke;for(let s=0;s<T;s++){const a=s*v-x;for(let o=0;o<w;o++){const h=o*_-y;E[e]=h*r,E[t]=a*i,E[n]=b,l.push(E.x,E.y,E.z),E[e]=0,E[t]=0,E[n]=p>0?1:-1,u.push(E.x,E.y,E.z),c.push(o/f),c.push(1-s/m),S+=1}}for(let e=0;e<m;e++)for(let t=0;t<f;t++){const n=h+t+w*e,r=h+t+w*(e+1),i=h+(t+1)+w*(e+1),s=h+(t+1)+w*e;o.push(n,r,s),o.push(r,i,s),M+=6}a.addGroup(A,M,g),A+=M,h+=S}d("z","y","x",-1,-1,n,t,e,s,i,0),d("z","y","x",1,-1,n,t,-e,s,i,1),d("x","z","y",1,1,e,n,t,r,s,2),d("x","z","y",1,-1,e,n,-t,r,s,3),d("x","y","z",1,-1,e,t,n,r,i,4),d("x","y","z",-1,-1,e,t,-n,r,i,5),this.setIndex(o),this.setAttribute("position",new ir(l,3)),this.setAttribute("normal",new ir(u,3)),this.setAttribute("uv",new ir(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Mr(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Er(e){const t={};for(const n in e){t[n]={};for(const r in e[n]){const i=e[n][r];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?t[n][r]=null:t[n][r]=i.clone():Array.isArray(i)?t[n][r]=i.slice():t[n][r]=i}}return t}function Cr(e){const t={};for(let n=0;n<e.length;n++){const r=Er(e[n]);for(const e in r)t[e]=r[e]}return t}function Rr(e){const t=e.getRenderTarget();return null===t?e.outputColorSpace:!0===t.isXRRenderTarget?t.texture.colorSpace:ut.workingColorSpace}const Nr={clone:Er,merge:Cr};class Pr extends Wn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==e&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Er(e.uniforms),this.uniformsGroups=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].clone());return t}(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const n in this.uniforms){const r=this.uniforms[n].value;r&&r.isTexture?t.uniforms[n]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?t.uniforms[n]={type:"c",value:r.getHex()}:r&&r.isVector2?t.uniforms[n]={type:"v2",value:r.toArray()}:r&&r.isVector3?t.uniforms[n]={type:"v3",value:r.toArray()}:r&&r.isVector4?t.uniforms[n]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?t.uniforms[n]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?t.uniforms[n]={type:"m4",value:r.toArray()}:t.uniforms[n]={value:r}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const e in this.extensions)!0===this.extensions[e]&&(n[e]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class Dr extends Tn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new $t,this.projectionMatrix=new $t,this.projectionMatrixInverse=new $t,this.coordinateSystem=Oe}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}
vendor: 4,628 bytes, line 1
1const Lr=new Ke,Ir=new Ye,Or=new Ye;class Br extends Dr{constructor(e=50,t=1,n=.1,r=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=r,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*Ve*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*qe*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*Ve*Math.atan(Math.tan(.5*qe*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Lr.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Lr.x,Lr.y).multiplyScalar(-e/Lr.z),Lr.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Lr.x,Lr.y).multiplyScalar(-e/Lr.z)}getViewSize(e,t){return this.getViewBounds(e,Ir,Or),t.subVectors(Or,Ir)}setViewOffset(e,t,n,r,i,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*qe*this.fov)/this.zoom,n=2*t,r=this.aspect*n,i=-.5*r;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,a=s.fullHeight;i+=s.offsetX*r/e,t-=s.offsetY*n/a,r*=s.width/e,n*=s.height/a}const a=this.filmOffset;0!==a&&(i+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(i,i+r,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const Ur=-90;class Fr extends Tn{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const r=new Br(Ur,1,e,t);r.layers=this.layers,this.add(r);const i=new Br(Ur,1,e,t);i.layers=this.layers,this.add(i);const s=new Br(Ur,1,e,t);s.layers=this.layers,this.add(s);const a=new Br(Ur,1,e,t);a.layers=this.layers,this.add(a);const o=new Br(Ur,1,e,t);o.layers=this.layers,this.add(o);const l=new Br(Ur,1,e,t);l.layers=this.layers,this.add(l)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,r,i,s,a,o]=t;for(const e of t)this.remove(e);if(e===Oe)n.up.set(0,1,0),n.lookAt(1,0,0),r.up.set(0,1,0),r.lookAt(-1,0,0),i.up.set(0,0,-1),i.lookAt(0,1,0),s.up.set(0,0,1),s.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),o.up.set(0,1,0),o.lookAt(0,0,-1);else{if(e!==Be)throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);n.up.set(0,-1,0),n.lookAt(-1,0,0),r.up.set(0,-1,0),r.lookAt(1,0,0),i.up.set(0,0,1),i.lookAt(0,1,0),s.up.set(0,0,-1),s.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),o.up.set(0,-1,0),o.lookAt(0,0,-1)}for(const e of t)this.add(e),e.updateMatrixWorld()}update(e,t){null===this.parent&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:r}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,s,a,o,l,u]=this.children,c=e.getRenderTarget(),h=e.getActiveCubeFace(),A=e.getActiveMipmapLevel(),d=e.xr.enabled;e.xr.enabled=!1;const p=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,r),e.render(t,i),e.setRenderTarget(n,1,r),e.render(t,s),e.setRenderTarget(n,2,r),e.render(t,a),e.setRenderTarget(n,3,r),e.render(t,o),e.setRenderTarget(n,4,r),e.render(t,l),n.texture.generateMipmaps=p,e.setRenderTarget(n,5,r),e.render(t,u),e.setRenderTarget(c,h,A),e.xr.enabled=d,n.texture.needsPMREMUpdate=!0}}class kr extends _t{constructor(e=[],t=301,n,r,i,s,a,o,l,u){super(e,t,n,r,i,s,a,o,l,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class qr extends xt{constructor(e=1,t={}
vendor: 8,093 bytes, line 1
1){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},r=[n,n,n,n,n,n];this.texture=new kr(r),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={tEquirect:{value:null}},r="\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t",i="\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t",s=new Mr(5,5,5),a=new Pr({name:"CubemapFromEquirect",uniforms:Er(n),vertexShader:r,fragmentShader:i,side:1,blending:0});a.uniforms.tEquirect.value=t;const o=new Tr(s,a),l=t.minFilter;return t.minFilter===w&&(t.minFilter=x),new Fr(1,10,this).update(e,o),t.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(e,t=!0,n=!0,r=!0){const i=e.getRenderTarget();for(let i=0;i<6;i++)e.setRenderTarget(this,i),e.clear(t,n,r);e.setRenderTarget(i)}}let Vr=class extends Tn{constructor(){super(),this.isGroup=!0,this.type="Group"}};const zr={type:"move"};class Gr{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new Vr,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new Vr,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Ke,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Ke),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new Vr,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Ke,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Ke),this._grip}dispatchEvent(e){return null!==this._targetRay&&this._targetRay.dispatchEvent(e),null!==this._grip&&this._grip.dispatchEvent(e),null!==this._hand&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this}update(e,t,n){let r=null,i=null,s=null;const a=this._targetRay,o=this._grip,l=this._hand;if(e&&"visible-blurred"!==t.session.visibilityState){if(l&&e.hand){s=!0;for(const r of e.hand.values()){const e=t.getJointPose(r,n),i=this._getHandJoint(l,r);null!==e&&(i.matrix.fromArray(e.transform.matrix),i.matrix.decompose(i.position,i.rotation,i.scale),i.matrixWorldNeedsUpdate=!0,i.jointRadius=e.radius),i.visible=null!==e}const r=l.joints["index-finger-tip"],i=l.joints["thumb-tip"],a=r.position.distanceTo(i.position),o=.02,u=.005;l.inputState.pinching&&a>o+u?(l.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!l.inputState.pinching&&a<=o-u&&(l.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else null!==o&&e.gripSpace&&(i=t.getPose(e.gripSpace,n),null!==i&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1));null!==a&&(r=t.getPose(e.targetRaySpace,n),null===r&&null!==i&&(r=i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(zr)))}return null!==a&&(a.visible=null!==r),null!==o&&(o.visible=null!==i),null!==l&&(l.visible=null!==s),this}_getHandJoint(e,t){if(void 0===e.joints[t.jointName]){const n=new Vr;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class jr extends Tn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new on,this.environmentIntensity=1,this.environmentRotation=new on,this.overrideMaterial=null,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),null!==e.background&&(this.background=e.background.clone()),null!==e.environment&&(this.environment=e.environment.clone()),null!==e.fog&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),null!==e.overrideMaterial&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return null!==this.fog&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),1!==this.backgroundIntensity&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),1!==this.environmentIntensity&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class Hr{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.usage=De,this.updateRanges=[],this.version=0,this.uuid=ze()}onUploadCallback(){}set needsUpdate(e){!0===e&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let r=0,i=this.stride;r<i;r++)this.array[e+r]=t.array[n+r];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ze()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return void 0===e.arrayBuffers&&(e.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=ze()),void 0===e.arrayBuffers[this.array.buffer._uuid]&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Wr=new Ke;class Xr{constructor(e,t,n,r=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=r}
vendor: 8,585 bytes, line 1
1get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Wr.fromBufferAttribute(this,t),Wr.applyMatrix4(e),this.setXYZ(t,Wr.x,Wr.y,Wr.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Wr.fromBufferAttribute(this,t),Wr.applyNormalMatrix(e),this.setXYZ(t,Wr.x,Wr.y,Wr.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Wr.fromBufferAttribute(this,t),Wr.transformDirection(e),this.setXYZ(t,Wr.x,Wr.y,Wr.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=We(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Xe(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Xe(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=We(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=We(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=We(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=We(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this}setXYZW(e,t,n,r,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=Xe(t,this.array),n=Xe(n,this.array),r=Xe(r,this.array),i=Xe(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=r,this.data.array[e+3]=i,this}clone(e){if(void 0===e){const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return new er(new this.array.constructor(e),this.itemSize,this.normalized)}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Xr(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(void 0===e){const e=[];for(let t=0;t<this.count;t++){const n=t*this.data.stride+this.offset;for(let t=0;t<this.itemSize;t++)e.push(this.data.array[n+t])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:e,normalized:this.normalized}}return void 0===e.interleavedBuffers&&(e.interleavedBuffers={}),void 0===e.interleavedBuffers[this.data.uuid]&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Qr extends _t{constructor(e=null,t=1,n=1,r,i,s,a,o,l=1003,u=1003,c,h){super(null,s,a,o,l,u,r,i,c,h),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Yr extends er{constructor(e,t,n,r=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=r}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const $r=new Ke,Kr=new Ke,Zr=new et;class Jr{constructor(e=new Ke(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,r){return this.normal.set(e,t,n),this.constant=r,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const r=$r.subVectors(n,t).cross(Kr.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(r,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta($r),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const i=-(e.start.dot(this.normal)+this.constant)/r;return i<0||i>1?null:t.copy(e.start).addScaledVector(n,i)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||Zr.getNormalMatrix(e),r=this.coplanarPoint($r).applyMatrix4(e),i=this.normal.applyMatrix3(n).normalize();return this.constant=-r.dot(i),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const ei=new Vt,ti=new Ke;class ni{constructor(e=new Jr,t=new Jr,n=new Jr,r=new Jr,i=new Jr,s=new Jr){this.planes=[e,t,n,r,i,s]}set(e,t,n,r,i,s){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(r),a[4].copy(i),a[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=2e3){const n=this.planes,r=e.elements,i=r[0],s=r[1],a=r[2],o=r[3],l=r[4],u=r[5],c=r[6],h=r[7],A=r[8],d=r[9],p=r[10],f=r[11],m=r[12],g=r[13],_=r[14],v=r[15];if(n[0].setComponents(o-i,h-l,f-A,v-m).normalize(),n[1].setComponents(o+i,h+l,f+A,v+m).normalize(),n[2].setComponents(o+s,h+u,f+d,v+g).normalize(),n[3].setComponents(o-s,h-u,f-d,v-g).normalize(),n[4].setComponents(o-a,h-c,f-p,v-_).normalize(),t===Oe)n[5].setComponents(o+a,h+c,f+p,v+_).normalize();else{if(t!==Be)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(a,c,p,_).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),ei.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),ei.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(ei)}intersectsSprite(e){return ei.center.set(0,0,0),ei.radius=.7071067811865476,ei.applyMatrix4(e.matrixWorld),this.intersectsSphere(ei)}intersectsSphere(e){const t=this.planes,n=e.center,r=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<r)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const r=t[n];if(ti.x=r.normal.x>0?e.max.x:e.min.x,ti.y=r.normal.y>0?e.max.y:e.min.y,ti.z=r.normal.z>0?e.max.z:e.min.z,r.distanceToPoint(ti)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}const ri=new $t,ii=new ni;class si{constructor(){this.coordinateSystem=Oe}intersectsObject(e,t){if(!t.isArrayCamera||0===t.cameras.length)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(ri.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ii.setFromProjectionMatrix(ri,this.coordinateSystem),ii.intersectsObject(e))return!0}return!1}intersectsSprite(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(ri.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ii.setFromProjectionMatrix(ri,this.coordinateSystem),ii.intersectsSprite(e))return!0}return!1}intersectsSphere(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(ri.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ii.setFromProjectionMatrix(ri,this.coordinateSystem),ii.intersectsSphere(e))return!0}return!1}
vendor: 5,287 bytes, line 1
1intersectsBox(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(ri.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ii.setFromProjectionMatrix(ri,this.coordinateSystem),ii.intersectsBox(e))return!0}return!1}containsPoint(e,t){if(!t||!t.cameras||0===t.cameras.length)return!1;for(let n=0;n<t.cameras.length;n++){const r=t.cameras[n];if(ri.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),ii.setFromProjectionMatrix(ri,this.coordinateSystem),ii.containsPoint(e))return!0}return!1}clone(){return new si}}class ai extends Wn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Gn(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const oi=new Ke,li=new Ke,ui=new $t,ci=new Yt,hi=new Vt,Ai=new Ke,di=new Ke;class pi extends Tn{constructor(e=new Ar,t=new ai){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[0];for(let e=1,r=t.count;e<r;e++)oi.fromBufferAttribute(t,e-1),li.fromBufferAttribute(t,e),n[e]=n[e-1],n[e]+=oi.distanceTo(li);e.setAttribute("lineDistance",new ir(n,1))}return this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Line.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),hi.copy(n.boundingSphere),hi.applyMatrix4(r),hi.radius+=i,!1===e.ray.intersectsSphere(hi))return;ui.copy(r).invert(),ci.copy(e.ray).applyMatrix4(ui);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=this.isLineSegments?2:1,u=n.index,c=n.attributes.position;if(null!==u){const n=Math.max(0,s.start),r=Math.min(u.count,s.start+s.count);for(let i=n,s=r-1;i<s;i+=l){const n=u.getX(i),r=u.getX(i+1),s=fi(this,e,ci,o,n,r,i);s&&t.push(s)}if(this.isLineLoop){const i=u.getX(r-1),s=u.getX(n),a=fi(this,e,ci,o,i,s,r-1);a&&t.push(a)}}else{const n=Math.max(0,s.start),r=Math.min(c.count,s.start+s.count);for(let i=n,s=r-1;i<s;i+=l){const n=fi(this,e,ci,o,i,i+1,i);n&&t.push(n)}if(this.isLineLoop){const i=fi(this,e,ci,o,r-1,n,r-1);i&&t.push(i)}}}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}}function fi(e,t,n,r,i,s,a){const o=e.geometry.attributes.position;if(oi.fromBufferAttribute(o,i),li.fromBufferAttribute(o,s),n.distanceSqToSegment(oi,li,Ai,di)>r)return;Ai.applyMatrix4(e.matrixWorld);const l=t.ray.origin.distanceTo(Ai);return l<t.near||l>t.far?void 0:{distance:l,point:di.clone().applyMatrix4(e.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:e}}const mi=new Ke,gi=new Ke;class _i extends pi{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(null===e.index){const t=e.attributes.position,n=[];for(let e=0,r=t.count;e<r;e+=2)mi.fromBufferAttribute(t,e),gi.fromBufferAttribute(t,e+1),n[e]=0===e?0:n[e-1],n[e+1]=n[e]+mi.distanceTo(gi);e.setAttribute("lineDistance",new ir(n,1))}return this}}class vi extends Wn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Gn(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const yi=new $t,xi=new Yt,bi=new Vt,wi=new Ke;function Ti(e,t,n,r,i,s,a){const o=xi.distanceSqToPoint(e);if(o<n){const n=new Ke;xi.closestPointToPoint(e,n),n.applyMatrix4(r);const l=i.ray.origin.distanceTo(n);if(l<i.near||l>i.far)return;s.push({distance:l,distanceToRay:Math.sqrt(o),point:n,index:t,face:null,faceIndex:null,barycoord:null,object:a})}}class Si extends _t{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=_,this.minFilter=_,this.generateMipmaps=!1,this.needsUpdate=!0}}class Mi extends _t{constructor(e,t,n=1014,r,i,s,a=1003,o=1003,l,u=1026,c=1){if(u!==k&&u!==q)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super({width:e,height:t,depth:c},r,i,s,a,o,u,n,l),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new pt(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return null!==this.compareFunction&&(t.compareFunction=this.compareFunction),t}}class Ei extends Ar{constructor(e=1,t=32,n=0,r=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radiu
vendor: 4,110 bytes, line 1
1s:e,segments:t,thetaStart:n,thetaLength:r},t=Math.max(3,t);const i=[],s=[],a=[],o=[],l=new Ke,u=new Ye;s.push(0,0,0),a.push(0,0,1),o.push(.5,.5);for(let i=0,c=3;i<=t;i++,c+=3){const h=n+i/t*r;l.x=e*Math.cos(h),l.y=e*Math.sin(h),s.push(l.x,l.y,l.z),a.push(0,0,1),u.x=(s[c]/e+1)/2,u.y=(s[c+1]/e+1)/2,o.push(u.x,u.y)}for(let e=1;e<=t;e++)i.push(e,e+1,0);this.setIndex(i),this.setAttribute("position",new ir(s,3)),this.setAttribute("normal",new ir(a,3)),this.setAttribute("uv",new ir(o,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ei(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Ci extends Ar{constructor(e=1,t=1,n=1,r=32,i=1,s=!1,a=0,o=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:r,heightSegments:i,openEnded:s,thetaStart:a,thetaLength:o};const l=this;r=Math.floor(r),i=Math.floor(i);const u=[],c=[],h=[],A=[];let d=0;const p=[],f=n/2;let m=0;function g(n){const i=d,s=new Ye,p=new Ke;let g=0;const _=!0===n?e:t,v=!0===n?1:-1;for(let e=1;e<=r;e++)c.push(0,f*v,0),h.push(0,v,0),A.push(.5,.5),d++;const y=d;for(let e=0;e<=r;e++){const t=e/r*o+a,n=Math.cos(t),i=Math.sin(t);p.x=_*i,p.y=f*v,p.z=_*n,c.push(p.x,p.y,p.z),h.push(0,v,0),s.x=.5*n+.5,s.y=.5*i*v+.5,A.push(s.x,s.y),d++}for(let e=0;e<r;e++){const t=i+e,r=y+e;!0===n?u.push(r,r+1,t):u.push(r+1,r,t),g+=3}l.addGroup(m,g,!0===n?1:2),m+=g}!function(){const s=new Ke,g=new Ke;let _=0;const v=(t-e)/n;for(let l=0;l<=i;l++){const u=[],m=l/i,_=m*(t-e)+e;for(let e=0;e<=r;e++){const t=e/r,i=t*o+a,l=Math.sin(i),p=Math.cos(i);g.x=_*l,g.y=-m*n+f,g.z=_*p,c.push(g.x,g.y,g.z),s.set(l,v,p).normalize(),h.push(s.x,s.y,s.z),A.push(t,1-m),u.push(d++)}p.push(u)}for(let n=0;n<r;n++)for(let r=0;r<i;r++){const s=p[r][n],a=p[r+1][n],o=p[r+1][n+1],l=p[r][n+1];(e>0||0!==r)&&(u.push(s,a,l),_+=3),(t>0||r!==i-1)&&(u.push(a,o,l),_+=3)}l.addGroup(m,_,0),m+=_}(),!1===s&&(e>0&&g(!0),t>0&&g(!1)),this.setIndex(u),this.setAttribute("position",new ir(c,3)),this.setAttribute("normal",new ir(h,3)),this.setAttribute("uv",new ir(A,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ci(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ri{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,r=this.getPoint(0),i=0;t.push(0);for(let s=1;s<=e;s++)n=this.getPoint(s/e),i+=n.distanceTo(r),t.push(i),r=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let r=0;const i=n.length;let s;s=t||e*n[i-1];let a,o=0,l=i-1;for(;o<=l;)if(r=Math.floor(o+(l-o)/2),a=n[r]-s,a<0)o=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(r=l,n[r]===s)return r/(i-1);const u=n[r];return(r+(s-u)/(n[r+1]-u))/(i-1)}getTangent(e,t){const n=1e-4;let r=e-n,i=e+n;r<0&&(r=0),i>1&&(i=1);const s=this.getPoint(r),a=this.getPoint(i),o=t||(s.isVector2?new Ye:new Ke);return o.copy(a).sub(s).normalize(),o}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new Ke,r=[],i=[],s=[],a=new Ke,o=new $t;for(let t=0;t<=e;t++){const n=t/e;r[t]=this.getTangentAt(n,new Ke)}i[0]=new Ke,s[0]=new Ke;let l=Number.MAX_VALUE;const u=Math.abs(r[0].x),c=Math.abs(r[0].y),h=Math.abs(r[0].z);u<=l&&(l=u,n.set(1,0,0)),c<=l&&(l=c,n.set(0,1,0)),h<=l&&n.set(0,0,1),a.crossVectors(r[0],n).normalize(),i[0].crossVectors(r[0],a),s[0].crossVectors(r[0],i[0]);for(let t=1;t<=e;
vendor: 7,748 bytes, line 1
1t++){if(i[t]=i[t-1].clone(),s[t]=s[t-1].clone(),a.crossVectors(r[t-1],r[t]),a.length()>Number.EPSILON){a.normalize();const e=Math.acos(Ge(r[t-1].dot(r[t]),-1,1));i[t].applyMatrix4(o.makeRotationAxis(a,e))}s[t].crossVectors(r[t],i[t])}if(!0===t){let t=Math.acos(Ge(i[0].dot(i[e]),-1,1));t/=e,r[0].dot(a.crossVectors(i[0],i[e]))>0&&(t=-t);for(let n=1;n<=e;n++)i[n].applyMatrix4(o.makeRotationAxis(r[n],t*n)),s[n].crossVectors(r[n],i[n])}return{tangents:r,normals:i,binormals:s}}clone(){return(new this.constructor).copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ni extends Ri{constructor(e=0,t=0,n=1,r=1,i=0,s=2*Math.PI,a=!1,o=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=r,this.aStartAngle=i,this.aEndAngle=s,this.aClockwise=a,this.aRotation=o}getPoint(e,t=new Ye){const n=t,r=2*Math.PI;let i=this.aEndAngle-this.aStartAngle;const s=Math.abs(i)<Number.EPSILON;for(;i<0;)i+=r;for(;i>r;)i-=r;i<Number.EPSILON&&(i=s?0:r),!0!==this.aClockwise||s||(i===r?i=-r:i-=r);const a=this.aStartAngle+e*i;let o=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){const e=Math.cos(this.aRotation),t=Math.sin(this.aRotation),n=o-this.aX,r=l-this.aY;o=n*e-r*t+this.aX,l=n*t+r*e+this.aY}return n.set(o,l)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}function Pi(){let e=0,t=0,n=0,r=0;function i(i,s,a,o){e=i,t=a,n=-3*i+3*s-2*a-o,r=2*i-2*s+a+o}return{initCatmullRom:function(e,t,n,r,s){i(t,n,s*(n-e),s*(r-t))},initNonuniformCatmullRom:function(e,t,n,r,s,a,o){let l=(t-e)/s-(n-e)/(s+a)+(n-t)/a,u=(n-t)/a-(r-t)/(a+o)+(r-n)/o;l*=a,u*=a,i(t,n,l,u)},calc:function(i){const s=i*i;return e+t*i+n*s+r*(s*i)}}}const Di=new Ke,Li=new Pi,Ii=new Pi,Oi=new Pi;function Bi(e,t,n,r,i){const s=.5*(r-t),a=.5*(i-n),o=e*e;return(2*n-2*r+s+a)*(e*o)+(-3*n+3*r-2*s-a)*o+s*e+n}function Ui(e,t,n,r){return function(e,t){const n=1-e;return n*n*t}(e,t)+function(e,t){return 2*(1-e)*e*t}(e,n)+function(e,t){return e*e*t}(e,r)}function Fi(e,t,n,r,i){return function(e,t){const n=1-e;return n*n*n*t}(e,t)+function(e,t){const n=1-e;return 3*n*n*e*t}(e,n)+function(e,t){return 3*(1-e)*e*e*t}(e,r)+function(e,t){return e*e*e*t}(e,i)}class ki extends Ri{constructor(e=new Ye,t=new Ye,n=new Ye,r=new Ye){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Ye){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(Fi(e,r.x,i.x,s.x,a.x),Fi(e,r.y,i.y,s.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class qi extends Ri{constructor(e=new Ke,t=new Ke,n=new Ke,r=new Ke){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=r}getPoint(e,t=new Ke){const n=t,r=this.v0,i=this.v1,s=this.v2,a=this.v3;return n.set(Fi(e,r.x,i.x,s.x,a.x),Fi(e,r.y,i.y,s.y,a.y),Fi(e,r.z,i.z,s.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class Vi extends Ri{constructor(e=new Ye,t=new Ye){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Ye){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Ye){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class zi extends Ri{constructor(e=new Ye,t=new Ye,n=new Ye){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Ye){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(Ui(e,r.x,i.x,s.x),Ui(e,r.y,i.y,s.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class Gi extends Ri{constructor(e=new Ke,t=new Ke,n=new Ke){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Ke){const n=t,r=this.v0,i=this.v1,s=this.v2;return n.set(Ui(e,r.x,i.x,s.x),Ui(e,r.y,i.y,s.y),Ui(e,r.z,i.z,s.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ji extends Ri{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Ye){const n=t,r=this.points,i=(r.length-1)*e,s=Math.floor(i),a=i-s,o=r[0===s?s:s-1],l=r[s],u=r[s>r.length-2?r.length-1:s+1],c=r[s>r.length-3?r.length-1:s+2];return n.set(Bi(a,o.x,l.x,u.x,c.x),Bi(a,o.y,l.y,u.y,c.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Ye).fromArray(n))}return this}}var Hi=Object.freeze({__proto__:null,ArcCurve:class extends Ni{constructor(e,t,n,r,i,s){super(e,t,n,n,r,i,s),this.isArcCurve=!0,this.type="ArcCurve"}},CatmullRomCurve3:class extends Ri{constructor(e=[],t=!1,n="centripetal",r=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=r}getPoint(e,t=new Ke){const n=t,r=this.points,i=r.length,s=(i-(this.closed?0:1))*e;let a,o,l=Math.floor(s),u=s-l;this.closed?l+=l>0?0:(Math.floor(Math.abs(l)/i)+1)*i:0===u&&l===i-1&&(l=i-2,u=1),this.closed||l>0?a=r[(l-1)%i]:(Di.subVectors(r[0],r[1]).add(r[0]),a=Di);const c=r[l%i],h=r[(l+1)%i];
vendor: 9,386 bytes, line 1
1if(this.closed||l+2<i?o=r[(l+2)%i]:(Di.subVectors(r[i-1],r[i-2]).add(r[i-1]),o=Di),"centripetal"===this.curveType||"chordal"===this.curveType){const e="chordal"===this.curveType?.5:.25;let t=Math.pow(a.distanceToSquared(c),e),n=Math.pow(c.distanceToSquared(h),e),r=Math.pow(h.distanceToSquared(o),e);n<1e-4&&(n=1),t<1e-4&&(t=n),r<1e-4&&(r=n),Li.initNonuniformCatmullRom(a.x,c.x,h.x,o.x,t,n,r),Ii.initNonuniformCatmullRom(a.y,c.y,h.y,o.y,t,n,r),Oi.initNonuniformCatmullRom(a.z,c.z,h.z,o.z,t,n,r)}else"catmullrom"===this.curveType&&(Li.initCatmullRom(a.x,c.x,h.x,o.x,this.tension),Ii.initCatmullRom(a.y,c.y,h.y,o.y,this.tension),Oi.initCatmullRom(a.z,c.z,h.z,o.z,this.tension));return n.set(Li.calc(u),Ii.calc(u),Oi.calc(u)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push(n.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const n=this.points[t];e.points.push(n.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const n=e.points[t];this.points.push((new Ke).fromArray(n))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}},CubicBezierCurve:ki,CubicBezierCurve3:qi,EllipseCurve:Ni,LineCurve:Vi,LineCurve3:class extends Ri{constructor(e=new Ke,t=new Ke){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new Ke){const n=t;return 1===e?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Ke){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}},QuadraticBezierCurve:zi,QuadraticBezierCurve3:Gi,SplineCurve:ji});class Wi extends Ri{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=!0===e.isVector2?"LineCurve":"LineCurve3";this.curves.push(new Hi[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),r=this.getCurveLengths();let i=0;for(;i<r.length;){if(r[i]>=n){const e=r[i]-n,s=this.curves[i],a=s.getLength(),o=0===a?0:1-e/a;return s.getPointAt(o,t)}i++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,r=this.curves.length;n<r;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let r=0,i=this.curves;r<i.length;r++){const s=i[r],a=s.isEllipseCurve?2*e:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?e*s.points.length:e,o=s.getPoints(a);for(let e=0;e<o.length;e++){const r=o[e];n&&n.equals(r)||(t.push(r),n=r)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push(n.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const n=this.curves[t];e.curves.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const n=e.curves[t];this.curves.push((new Hi[n.type]).fromJSON(n))}return this}}let Xi=class extends Wi{constructor(e){super(),this.type="Path",this.currentPoint=new Ye,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new Vi(this.currentPoint.clone(),new Ye(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,r){const i=new zi(this.currentPoint.clone(),new Ye(e,t),new Ye(n,r));return this.curves.push(i),this.currentPoint.set(n,r),this}bezierCurveTo(e,t,n,r,i,s){const a=new ki(this.currentPoint.clone(),new Ye(e,t),new Ye(n,r),new Ye(i,s));return this.curves.push(a),this.currentPoint.set(i,s),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new ji(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,r,i,s){const a=this.currentPoint.x,o=this.currentPoint.y;return this.absarc(e+a,t+o,n,r,i,s),this}absarc(e,t,n,r,i,s){return this.absellipse(e,t,n,n,r,i,s),this}ellipse(e,t,n,r,i,s,a,o){const l=this.currentPoint.x,u=this.currentPoint.y;return this.absellipse(e+l,t+u,n,r,i,s,a,o),this}absellipse(e,t,n,r,i,s,a,o){const l=new Ni(e,t,n,r,i,s,a,o);if(this.curves.length>0){const e=l.getPoint(0);e.equals(this.currentPoint)||this.lineTo(e.x,e.y)}this.curves.push(l);const u=l.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}};class Qi extends Xi{constructor(e){super(e),this.uuid=ze(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,r=this.holes.length;n<r;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push(n.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const n=this.holes[t];e.holes.push(n.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const n=e.holes[t];this.holes.push((new Xi).fromJSON(n))}return this}}function Yi(e,t,n,r,i){let s;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(let i=t;i<n;i+=r)s=gs(i/r|0,e[i],e[i+1],s);else for(let i=n-r;i>=t;i-=r)s=gs(i/r|0,e[i],e[i+1],s);return s&&hs(s,s.next)&&(_s(s),s=s.next),s}function $i(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!hs(r,r.next)&&0!==cs(r.prev,r,r.next))r=r.next;else{if(_s(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function Ki(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=ss(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n=1;do{let r,i=e;e=null;let s=null;for(t=0;i;){t++;let a=i,o=0;for(let e=0;e<n&&(o++,a=a.nextZ,a);e++);let l=n;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||i.z<=a.z)?(r=i,i=i.nextZ,o--):(r=a,a=a.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=a}s.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,s);let o=e;for(;e.prev!==e.next;){const l=e.prev,u=e.next;if(s?Ji(e,r,i,s):Zi(e))t.push(l.i,e.i,u.i),_s(e),e=u.next,o=u.next;else if((e=u)===o){a?1===a?Ki(e=es($i(e),t),t,n,r,i,s,2):2===a&&ts(e,t,n,r,i,s):Ki($i(e),t,n,r,i,s,1);break}}}function Zi(e){const t=e.prev,n=e,r=e.next;if(cs(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,u=r.y,c=Math.min(i,s,a),h=Math.min(o,l,u),A=Math.max(i,s,a),d=Math.max(o,l,u);let p=r.next;for(;p!==t;){if(p.x>=c&&p.x<=A&&p.y>=h&&p.y<=d&&ls(i,o,s,l,a,u,p.x,p.y)&&cs(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Ji(e,t,n,r){const i=e.prev,s=e,a=e.next;if(cs(i,s,a)>=0)return!1;const o=i.x,l=s.x,u=a.x,c=i.y,h=s.y,A=a.y,d=Math.min(o,l,u),p=Math.min(c,h,A),f=Math.max(o,l,u),m=Math.max(c,h,A),g=ss(d,p,t,n,r),_=ss(f,m,t,n,r);let v=e.prevZ,y=e.nextZ;for(;v&&v.z>=g&&y&&y.z<=_;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==i&&v!==a&&ls(o,c,l,h,u,A,v.x,v.y)&&cs(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ls(o,c,l,h,u,A,y.x,y.y)&&cs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==i&&v!==a&&ls(o,c,l,h,u,A,v.x,v.y)&&cs(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;y&&y.z<=_;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&ls(o,c,l,h,u,A,y.x,y.y)&&cs(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function es(e,t){let n=e;do{const r=n.prev,i=n.next.next;!hs(r,i)&&As(r,n,n.next,i)&&fs(r,i)&&fs(i,r)&&(t.push(r.i,n.i,i.i),_s(n),_s(n.next),n=e=i),n=n.next}while(n!==e);return $i(n)}function ts(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&us(a,e)){let o=ms(a,e);return a=$i(a,a.next),o=$i(o,o.next),Ki(a,t,n,r,i,s,0),void Ki(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function ns(e,t){let n=e.x-t.x;return 0===n&&(n=e.y-t.y,0===n)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function rs(e,t){const n=function(e,t){let n=t;const r=e.x,i=e.y;let s,a=-1/0;
vendor: 9,718 bytes, line 1
1if(hs(e,n))return n;do{if(hs(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,s=n.x<n.next.x?n:n.next,e===r))return s}n=n.next}while(n!==t);if(!s)return null;const o=s,l=s.x,u=s.y;let c=1/0;n=s;do{if(r>=n.x&&n.x>=l&&r!==n.x&&os(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)){const t=Math.abs(i-n.y)/(r-n.x);fs(n,e)&&(t<c||t===c&&(n.x>s.x||n.x===s.x&&is(s,n)))&&(s=n,c=t)}n=n.next}while(n!==o);return s}(e,t);if(!n)return t;const r=ms(n,e);return $i(r,r.next),$i(n,n.next)}function is(e,t){return cs(e.prev,e,t.prev)<0&&cs(t.next,e,e.next)<0}function ss(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function as(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function os(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function ls(e,t,n,r,i,s,a,o){return!(e===a&&t===o)&&os(e,t,n,r,i,s,a,o)}function us(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&As(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(fs(e,t)&&fs(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(cs(e.prev,e,t.prev)||cs(e,t.prev,t))||hs(e,t)&&cs(e.prev,e,e.next)>0&&cs(t.prev,t,t.next)>0)}function cs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function hs(e,t){return e.x===t.x&&e.y===t.y}function As(e,t,n,r){const i=ps(cs(e,t,n)),s=ps(cs(e,t,r)),a=ps(cs(n,r,e)),o=ps(cs(n,r,t));return i!==s&&a!==o||!(0!==i||!ds(e,n,t))||!(0!==s||!ds(e,r,t))||!(0!==a||!ds(n,e,r))||!(0!==o||!ds(n,t,r))}function ds(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function ps(e){return e>0?1:e<0?-1:0}function fs(e,t){return cs(e.prev,e,e.next)<0?cs(e,t,e.next)>=0&&cs(e,e.prev,t)>=0:cs(e,t,e.prev)<0||cs(e,e.next,t)<0}function ms(e,t){const n=vs(e.i,e.x,e.y),r=vs(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function gs(e,t,n,r){const i=vs(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function _s(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function vs(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class ys{static area(e){const t=e.length;let n=0;for(let r=t-1,i=0;i<t;r=i++)n+=e[r].x*e[i].y-e[i].x*e[r].y;return.5*n}static isClockWise(e){return ys.area(e)<0}static triangulateShape(e,t){const n=[],r=[],i=[];xs(e),bs(n,e);let s=e.length;t.forEach(xs);for(let e=0;e<t.length;e++)r.push(s),s+=t[e].length,bs(n,t[e]);const a=class{static triangulate(e,t,n=2){return function(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=Yi(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(r&&(s=function(e,t,n,r){const i=[];for(let n=0,s=t.length;n<s;n++){const a=Yi(e,t[n]*r,n<s-1?t[n+1]*r:e.length,r,!1);a===a.next&&(a.steiner=!0),i.push(as(a))}i.sort(ns);for(let e=0;e<i.length;e++)n=rs(i[e],n);return n}(e,t,s,n)),e.length>80*n){o=1/0,l=1/0;let t=-1/0,r=-1/0;for(let s=n;s<i;s+=n){const n=e[s],i=e[s+1];n<o&&(o=n),i<l&&(l=i),n>t&&(t=n),i>r&&(r=i)}u=Math.max(t-o,r-l),u=0!==u?32767/u:0}return Ki(s,a,n,o,l,u,0),a}(e,t,n)}}.triangulate(n,r);for(let e=0;e<a.length;e+=3)i.push(a.slice(e,e+3));return i}}function xs(e){const t=e.length;t>2&&e[t-1].equals(e[0])&&e.pop()}function bs(e,t){for(let n=0;n<t.length;n++)e.push(t[n].x),e.push(t[n].y)}class ws extends Ar{constructor(e=new Qi([new Ye(.5,.5),new Ye(-.5,.5),new Ye(-.5,-.5),new Ye(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,r=[],i=[];for(let t=0,n=e.length;t<n;t++)s(e[t]);function s(e){const s=[],a=void 0!==t.curveSegments?t.curveSegments:12,o=void 0!==t.steps?t.steps:1,l=void 0!==t.depth?t.depth:1;let u=void 0===t.bevelEnabled||t.bevelEnabled,c=void 0!==t.bevelThickness?t.bevelThickness:.2,h=void 0!==t.bevelSize?t.bevelSize:c-.1,A=void 0!==t.bevelOffset?t.bevelOffset:0,d=void 0!==t.bevelSegments?t.bevelSegments:3;const p=t.extrudePath,f=void 0!==t.UVGenerator?t.UVGenerator:Ts;let m,g,_,v,y,x=!1;p&&(m=p.getSpacedPoints(o),x=!0,u=!1,g=p.computeFrenetFrames(o,!1),_=new Ke,v=new Ke,y=new Ke),u||(d=0,c=0,h=0,A=0);const b=e.extractPoints(a);let w=b.shape;const T=b.holes;if(!ys.isClockWise(w)){w=w.reverse();for(let e=0,t=T.length;e<t;e++){const t=T[e];ys.isClockWise(t)&&(T[e]=t.reverse())}}function S(e){let t=e[0];for(let n=1;n<=e.length;n++){const r=n%e.length,i=e[r],s=i.x-t.x,a=i.y-t.y,o=s*s+a*a,l=Math.max(Math.abs(i.x),Math.abs(i.y),Math.abs(t.x),Math.abs(t.y));o<=1.0000000000000001e-20*l*l?(e.splice(r,1),n--):t=i}}S(w),T.forEach(S);const M=T.length,E=w;for(let e=0;e<M;e++){const t=T[e];w=w.concat(t)}function C(e,t,n){return e.clone().addScaledVector(t,n)}const R=w.length;function N(e,t,n){let r,i,s;const a=e.x-t.x,o=e.y-t.y,l=n.x-e.x,u=n.y-e.y,c=a*a+o*o,h=a*u-o*l;if(Math.abs(h)>Number.EPSILON){const h=Math.sqrt(c),A=Math.sqrt(l*l+u*u),d=t.x-o/h,p=t.y+a/h,f=((n.x-u/A-d)*u-(n.y+l/A-p)*l)/(a*u-o*l);r=d+a*f-e.x,i=p+o*f-e.y;const m=r*r+i*i;if(m<=2)return new Ye(r,i);s=Math.sqrt(m/2)}else{let e=!1;a>Number.EPSILON?l>Number.EPSILON&&(e=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(e=!0):Math.sign(o)===Math.sign(u)&&(e=!0),e?(r=-o,i=a,s=Math.sqrt(c)):(r=a,i=o,s=Math.sqrt(c/2))}return new Ye(r/s,i/s)}const P=[];for(let e=0,t=E.length,n=t-1,r=e+1;e<t;e++,n++,r++)n===t&&(n=0),r===t&&(r=0),P[e]=N(E[e],E[n],E[r]);const D=[];let L,I,O=P.concat();for(let e=0,t=M;e<t;e++){const t=T[e];L=[];for(let e=0,n=t.length,r=n-1,i=e+1;e<n;e++,r++,i++)r===n&&(r=0),i===n&&(i=0),L[e]=N(t[e],t[r],t[i]);D.push(L),O=O.concat(L)}if(0===d)I=ys.triangulateShape(E,T);else{const e=[],t=[];for(let n=0;n<d;n++){const r=n/d,i=c*Math.cos(r*Math.PI/2),s=h*Math.sin(r*Math.PI/2)+A;for(let t=0,n=E.length;t<n;t++){const n=C(E[t],P[t],s);k(n.x,n.y,-i),0===r&&e.push(n)}for(let e=0,n=M;e<n;e++){const n=T[e];L=D[e];const a=[];for(let e=0,t=n.length;e<t;e++){const t=C(n[e],L[e],s);k(t.x,t.y,-i),0===r&&a.push(t)}0===r&&t.push(a)}}I=ys.triangulateShape(e,t)}const B=I.length,U=h+A;for(let e=0;e<R;e++){const t=u?C(w[e],O[e],U):w[e];x?(v.copy(g.normals[0]).multiplyScalar(t.x),_.copy(g.binormals[0]).multiplyScalar(t.y),y.copy(m[0]).add(v).add(_),k(y.x,y.y,y.z)):k(t.x,t.y,0)}for(let e=1;e<=o;e++)for(let t=0;t<R;t++){const n=u?C(w[t],O[t],U):w[t];x?(v.copy(g.normals[e]).multiplyScalar(n.x),_.copy(g.binormals[e]).multiplyScalar(n.y),y.copy(m[e]).add(v).add(_),k(y.x,y.y,y.z)):k(n.x,n.y,l/o*e)}for(let e=d-1;e>=0;e--){const t=e/d,n=c*Math.cos(t*Math.PI/2),r=h*Math.sin(t*Math.PI/2)+A;for(let e=0,t=E.length;e<t;e++){const t=C(E[e],P[e],r);k(t.x,t.y,l+n)}for(let e=0,t=T.length;e<t;e++){const t=T[e];L=D[e];for(let e=0,i=t.length;e<i;e++){const i=C(t[e],L[e],r);x?k(i.x,i.y+m[o-1].y,m[o-1].x+n):k(i.x,i.y,l+n)}}}function F(e,t){let n=e.length;for(;--n>=0;){const r=n;let i=n-1;i<0&&(i=e.length-1);for(let e=0,n=o+2*d;e<n;e++){const n=R*e,s=R*(e+1);V(t+r+n,t+i+n,t+i+s,t+r+s)}}}function k(e,t,n){s.push(e),s.push(t),s.push(n)}function q(e,t,i){z(e),z(t),z(i);const s=r.length/3,a=f.generateTopUV(n,r,s-3,s-2,s-1);G(a[0]),G(a[1]),G(a[2])}function V(e,t,i,s){z(e),z(t),z(s),z(t),z(i),z(s);const a=r.length/3,o=f.generateSideWallUV(n,r,a-6,a-3,a-2,a-1);G(o[0]),G(o[1]),G(o[3]),G(o[1]),G(o[2]),G(o[3])}function z(e){r.push(s[3*e+0]),r.push(s[3*e+1]),r.push(s[3*e+2])}function G(e){i.push(e.x),i.push(e.y)}!function(){const e=r.length/3;if(u){let e=0,t=R*e;for(let e=0;e<B;e++){const n=I[e];q(n[2]+t,n[1]+t,n[0]+t)}e=o+2*d,t=R*e;for(let e=0;e<B;e++){const n=I[e];q(n[0]+t,n[1]+t,n[2]+t)}}else{for(let e=0;e<B;e++){const t=I[e];q(t[2],t[1],t[0])}for(let e=0;e<B;e++){const t=I[e];q(t[0]+R*o,t[1]+R*o,t[2]+R*o)}}n.addGroup(e,r.length/3-e,0)}(),function(){const e=r.length/3;let t=0;F(E,t),t+=E.length;for(let e=0,n=T.length;e<n;e++){const n=T[e];F(n,t),t+=n.length}n.addGroup(e,r.length/3-e,1)}()}this.setAttribute("position",new ir(r,3)),this.setAttribute("uv",new ir(i,2)),this.computeVertexNormals()}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return function(e,t,n){if(n.shapes=[],Array.isArray(e))for(let t=0,r=e.length;t<r;t++){const r=e[t];n.shapes.push(r.uuid)}else n.shapes.push(e.uuid);return n.options=Object.assign({},t),void 0!==t.extrudePath&&(n.options.extrudePath=t.extrudePath.toJSON()),n}(this.parameters.shapes,this.parameters.options,e)}static fromJSON(e,t){const n=[];for(let r=0,i=e.shapes.length;r<i;r++){const i=t[e.shapes[r]];n.push(i)}const r=e.options.extrudePath;return void 0!==r&&(e.options.extrudePath=(new Hi[r.type]).fromJSON(r)),new ws(n,e.options)}}const Ts={generateTopUV:function(e,t,n,r,i){const s=t[3*n],a=t[3*n+1],o=t[3*r],l=t[3*r+1],u=t[3*i],c=t[3*i+1];return[new Ye(s,a),new Ye(o,l),new Ye(u,c)]},generateSideWallUV:function(e,t,n,r,i,s){const a=t[3*n],o=t[3*n+1],l=t[3*n+2],u=t[3*r],c=t[3*r+1],h=t[3*r+2],A=t[3*i],d=t[3*i+1],p=t[3*i+2],f=t[3*s],m=t[3*s+1],g=t[3*s+2];return Math.abs(o-c)<Math.abs(a-u)?[new Ye(a,1-l),new Ye(u,1-h),new Ye(A,1-p),new Ye(f,1-g)]:[new Ye(o,1-l),new Ye(c,1-h),new Ye(d,1-p),new Ye(m,1-g)]}};class Ss extends Ar{constructor(e=1,t=1,n=1,r=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:r};
vendor: 14,393 bytes, line 1
1const i=e/2,s=t/2,a=Math.floor(n),o=Math.floor(r),l=a+1,u=o+1,c=e/a,h=t/o,A=[],d=[],p=[],f=[];for(let e=0;e<u;e++){const t=e*h-s;for(let n=0;n<l;n++){const r=n*c-i;d.push(r,-t,0),p.push(0,0,1),f.push(n/a),f.push(1-e/o)}}for(let e=0;e<o;e++)for(let t=0;t<a;t++){const n=t+l*e,r=t+l*(e+1),i=t+1+l*(e+1),s=t+1+l*e;A.push(n,r,s),A.push(r,i,s)}this.setIndex(A),this.setAttribute("position",new ir(d,3)),this.setAttribute("normal",new ir(p,3)),this.setAttribute("uv",new ir(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ss(e.width,e.height,e.widthSegments,e.heightSegments)}}class Ms extends Ar{constructor(e=1,t=32,n=16,r=0,i=2*Math.PI,s=0,a=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:r,phiLength:i,thetaStart:s,thetaLength:a},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const o=Math.min(s+a,Math.PI);let l=0;const u=[],c=new Ke,h=new Ke,A=[],d=[],p=[],f=[];for(let A=0;A<=n;A++){const m=[],g=A/n;let _=0;0===A&&0===s?_=.5/t:A===n&&o===Math.PI&&(_=-.5/t);for(let n=0;n<=t;n++){const o=n/t;c.x=-e*Math.cos(r+o*i)*Math.sin(s+g*a),c.y=e*Math.cos(s+g*a),c.z=e*Math.sin(r+o*i)*Math.sin(s+g*a),d.push(c.x,c.y,c.z),h.copy(c).normalize(),p.push(h.x,h.y,h.z),f.push(o+_,1-g),m.push(l++)}u.push(m)}for(let e=0;e<n;e++)for(let r=0;r<t;r++){const t=u[e][r+1],i=u[e][r],a=u[e+1][r],l=u[e+1][r+1];(0!==e||s>0)&&A.push(t,i,l),(e!==n-1||o<Math.PI)&&A.push(i,a,l)}this.setIndex(A),this.setAttribute("position",new ir(d,3)),this.setAttribute("normal",new ir(p,3)),this.setAttribute("uv",new ir(f,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Ms(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Es extends Ar{constructor(e=new Gi(new Ke(-1,-1,0),new Ke(-1,1,0),new Ke(1,1,0)),t=64,n=1,r=8,i=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:r,closed:i};const s=e.computeFrenetFrames(t,i);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const a=new Ke,o=new Ke,l=new Ye;let u=new Ke;const c=[],h=[],A=[],d=[];function p(i){u=e.getPointAt(i/t,u);const l=s.normals[i],A=s.binormals[i];for(let e=0;e<=r;e++){const t=e/r*Math.PI*2,i=Math.sin(t),s=-Math.cos(t);o.x=s*l.x+i*A.x,o.y=s*l.y+i*A.y,o.z=s*l.z+i*A.z,o.normalize(),h.push(o.x,o.y,o.z),a.x=u.x+n*o.x,a.y=u.y+n*o.y,a.z=u.z+n*o.z,c.push(a.x,a.y,a.z)}}!function(){for(let e=0;e<t;e++)p(e);p(!1===i?t:0),function(){for(let e=0;e<=t;e++)for(let n=0;n<=r;n++)l.x=e/t,l.y=n/r,A.push(l.x,l.y)}(),function(){for(let e=1;e<=t;e++)for(let t=1;t<=r;t++){const n=(r+1)*(e-1)+(t-1),i=(r+1)*e+(t-1),s=(r+1)*e+t,a=(r+1)*(e-1)+t;d.push(n,i,a),d.push(i,s,a)}}()}(),this.setIndex(d),this.setAttribute("position",new ir(c,3)),this.setAttribute("normal",new ir(h,3)),this.setAttribute("uv",new ir(A,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Es((new Hi[e.path.type]).fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class Cs extends Ar{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},null!==e){const t=[],n=new Set,r=new Ke,i=new Ke;if(null!==e.index){const s=e.attributes.position,a=e.index;let o=e.groups;0===o.length&&(o=[{start:0,count:a.count,materialIndex:0}]);for(let e=0,l=o.length;e<l;++e){const l=o[e],u=l.start;for(let e=u,o=u+l.count;e<o;e+=3)for(let o=0;o<3;o++){const l=a.getX(e+o),u=a.getX(e+(o+1)%3);r.fromBufferAttribute(s,l),i.fromBufferAttribute(s,u),!0===Rs(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}}else{const s=e.attributes.position;for(let e=0,a=s.count/3;e<a;e++)for(let a=0;a<3;a++){const o=3*e+a,l=3*e+(a+1)%3;r.fromBufferAttribute(s,o),i.fromBufferAttribute(s,l),!0===Rs(r,i,n)&&(t.push(r.x,r.y,r.z),t.push(i.x,i.y,i.z))}}this.setAttribute("position",new ir(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Rs(e,t,n){const r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`,i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`;return!0!==n.has(r)&&!0!==n.has(i)&&(n.add(r),n.add(i),!0)}class Ns extends Wn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Gn(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 Gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new on,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ps extends Wn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Gn(16777215),this.specular=new Gn(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new on,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ds extends Wn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Gn(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new on,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Ls extends Wn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=3200,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class Is extends Wn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const Os={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};const Bs=new class{constructor(e,t,n){const r=this;let i,s=!1,a=0,o=0;const l=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(e){o++,!1===s&&void 0!==r.onStart&&r.onStart(e,a,o),s=!0},this.itemEnd=function(e){a++,void 0!==r.onProgress&&r.onProgress(e,a,o),a===o&&(s=!1,void 0!==r.onLoad&&r.onLoad())},this.itemError=function(e){void 0!==r.onError&&r.onError(e)},this.resolveURL=function(e){return i?i(e):e},this.setURLModifier=function(e){return i=e,this},this.addHandler=function(e,t){return l.push(e,t),this},this.removeHandler=function(e){const t=l.indexOf(e);return-1!==t&&l.splice(t,2),this},this.getHandler=function(e){for(let t=0,n=l.length;t<n;t+=2){const n=l[t],r=l[t+1];if(n.global&&(n.lastIndex=0),n.test(e))return r}return null}}};class Us{constructor(e){this.manager=void 0!==e?e:Bs,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise((function(r,i){n.load(e,r,t,i)}))}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Us.DEFAULT_MATERIAL_NAME="__DEFAULT";class Fs extends Us{constructor(e){super(e)}load(e,t,n,r){void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);const i=this,s=Os.get(e);if(void 0!==s)return i.manager.itemStart(e),setTimeout((function(){t&&t(s),i.manager.itemEnd(e)}),0),s;const a=rt("img");function o(){u(),Os.add(e,this),t&&t(this),i.manager.itemEnd(e)}function l(t){u(),r&&r(t),i.manager.itemError(e),i.manager.itemEnd(e)}function u(){a.removeEventListener("load",o,!1),a.removeEventListener("error",l,!1)}return a.addEventListener("load",o,!1),a.addEventListener("error",l,!1),"data:"!==e.slice(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),i.manager.itemStart(e),a.src=e,a}}class ks extends Us{constructor(e){super(e)}load(e,t,n,r){const i=new _t,s=new Fs(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(e,(function(e){i.image=e,i.needsUpdate=!0,void 0!==t&&t(i)}),n,r),i}}class qs extends Tn{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Gn(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,void 0!==this.groundColor&&(t.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(t.object.distance=this.distance),void 0!==this.angle&&(t.object.angle=this.angle),void 0!==this.decay&&(t.object.decay=this.decay),void 0!==this.penumbra&&(t.object.penumbra=this.penumbra),void 0!==this.shadow&&(t.object.shadow=this.shadow.toJSON()),void 0!==this.target&&(t.object.target=this.target.uuid),t}}class Vs extends qs{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Tn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Gn(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const zs=new $t,Gs=new Ke,js=new Ke;
vendor: 5,237 bytes, line 1
1class Hs{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ye(512,512),this.mapType=T,this.map=null,this.mapPass=null,this.matrix=new $t,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new ni,this._frameExtents=new Ye(1,1),this._viewportCount=1,this._viewports=[new vt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;Gs.setFromMatrixPosition(e.matrixWorld),t.position.copy(Gs),js.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(js),t.updateMatrixWorld(),zs.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(zs),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(zs)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Ws extends Hs{constructor(){super(new Br(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=2*Ve*e.angle*this.focus,r=this.mapSize.width/this.mapSize.height*this.aspect,i=e.distance||t.far;n===t.fov&&r===t.aspect&&i===t.far||(t.fov=n,t.aspect=r,t.far=i,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Xs extends qs{constructor(e,t,n=0,r=Math.PI/3,i=0,s=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Tn.DEFAULT_UP),this.updateMatrix(),this.target=new Tn,this.distance=n,this.angle=r,this.penumbra=i,this.decay=s,this.map=null,this.shadow=new Ws}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Qs=new $t,Ys=new Ke,$s=new Ke;class Ks extends Hs{constructor(){super(new Br(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Ye(4,2),this._viewportCount=6,this._viewports=[new vt(2,1,1,1),new vt(0,1,1,1),new vt(3,1,1,1),new vt(1,1,1,1),new vt(3,0,1,1),new vt(1,0,1,1)],this._cubeDirections=[new Ke(1,0,0),new Ke(-1,0,0),new Ke(0,0,1),new Ke(0,0,-1),new Ke(0,1,0),new Ke(0,-1,0)],this._cubeUps=[new Ke(0,1,0),new Ke(0,1,0),new Ke(0,1,0),new Ke(0,1,0),new Ke(0,0,1),new Ke(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,r=this.matrix,i=e.distance||n.far;i!==n.far&&(n.far=i,n.updateProjectionMatrix()),Ys.setFromMatrixPosition(e.matrixWorld),n.position.copy(Ys),$s.copy(n.position),$s.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt($s),n.updateMatrixWorld(),r.makeTranslation(-Ys.x,-Ys.y,-Ys.z),Qs.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Qs)}}class Zs extends qs{constructor(e,t,n=0,r=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=r,this.shadow=new Ks}get power(){return 4*this.intensity*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Js extends Dr{constructor(e=-1,t=1,n=1,r=-1,i=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=r,this.near=i,this.far=s,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this}setViewOffset(e,t,n,r,i,s){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let i=n-e,s=n+e,a=r+t,o=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;i+=e*this.view.offsetX,s=i+e*this.view.width,a-=t*this.view.offsetY,o=a-t*this.view.height}
vendor: 10,957 bytes, line 1
1this.projectionMatrix.makeOrthographic(i,s,a,o,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,null!==this.view&&(t.object.view=Object.assign({},this.view)),t}}class ea extends Hs{constructor(){super(new Js(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class ta extends qs{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Tn.DEFAULT_UP),this.updateMatrix(),this.target=new Tn,this.shadow=new ea}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class na extends qs{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class ra extends qs{constructor(e,t,n=10,r=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=r}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class ia{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new Ke)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.282095),t.addScaledVector(s[1],.488603*r),t.addScaledVector(s[2],.488603*i),t.addScaledVector(s[3],.488603*n),t.addScaledVector(s[4],n*r*1.092548),t.addScaledVector(s[5],r*i*1.092548),t.addScaledVector(s[6],.315392*(3*i*i-1)),t.addScaledVector(s[7],n*i*1.092548),t.addScaledVector(s[8],.546274*(n*n-r*r)),t}getIrradianceAt(e,t){const n=e.x,r=e.y,i=e.z,s=this.coefficients;return t.copy(s[0]).multiplyScalar(.886227),t.addScaledVector(s[1],1.023328*r),t.addScaledVector(s[2],1.023328*i),t.addScaledVector(s[3],1.023328*n),t.addScaledVector(s[4],.858086*n*r),t.addScaledVector(s[5],.858086*r*i),t.addScaledVector(s[6],.743125*i*i-.247708),t.addScaledVector(s[7],.858086*n*i),t.addScaledVector(s[8],.429043*(n*n-r*r)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].fromArray(e,t+3*r);return this}toArray(e=[],t=0){const n=this.coefficients;for(let r=0;r<9;r++)n[r].toArray(e,t+3*r);return e}static getBasisAt(e,t){const n=e.x,r=e.y,i=e.z;t[0]=.282095,t[1]=.488603*r,t[2]=.488603*i,t[3]=.488603*n,t[4]=1.092548*n*r,t[5]=1.092548*r*i,t[6]=.315392*(3*i*i-1),t[7]=1.092548*n*i,t[8]=.546274*(n*n-r*r)}}class sa extends qs{constructor(e=new ia,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class aa extends Ar{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class oa extends Br{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class la{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ua(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=ua();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ua(){return performance.now()}class ca extends Hr{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const ha=new $t;function Aa(e,t){return e.distance-t.distance}function da(e,t,n,r){let i=!0;if(e.layers.test(t.layers)&&!1===e.raycast(t,n)&&(i=!1),!0===i&&!0===r){const r=e.children;for(let e=0,i=r.length;e<i;e++)da(r[e],t,n,!0)}}class pa{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){const e=1e-6;return this.phi=Ge(this.phi,e,Math.PI-e),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ge(t/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class fa{constructor(e,t,n,r){fa.prototype.isMatrix2=!0,this.elements=[1,0,0,1],void 0!==e&&this.set(e,t,n,r)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,r){const i=this.elements;return i[0]=e,i[2]=t,i[1]=n,i[3]=r,this}}const ma=new Ke,ga=new Ke;class _a{constructor(){this.type="ShapePath",this.color=new Gn,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Xi,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,r){return this.currentPath.quadraticCurveTo(e,t,n,r),this}bezierCurveTo(e,t,n,r,i,s){return this.currentPath.bezierCurveTo(e,t,n,r,i,s),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(e,t){const n=t.length;let r=!1;for(let i=n-1,s=0;s<n;i=s++){let n=t[i],a=t[s],o=a.x-n.x,l=a.y-n.y;if(Math.abs(l)>Number.EPSILON){if(l<0&&(n=t[s],o=-o,a=t[i],l=-l),e.y<n.y||e.y>a.y)continue;if(e.y===n.y){if(e.x===n.x)return!0}else{const t=l*(e.x-n.x)-o*(e.y-n.y);if(0===t)return!0;if(t<0)continue;r=!r}}else{if(e.y!==n.y)continue;if(a.x<=e.x&&e.x<=n.x||n.x<=e.x&&e.x<=a.x)return!0}}return r}const n=ys.isClockWise,r=this.subPaths;if(0===r.length)return[];let i,s,a;const o=[];if(1===r.length)return s=r[0],a=new Qi,a.curves=s.curves,o.push(a),o;let l=!n(r[0].getPoints());l=e?!l:l;const u=[],c=[];let h,A,d=[],p=0;c[p]=void 0,d[p]=[];for(let t=0,a=r.length;t<a;t++)s=r[t],h=s.getPoints(),i=n(h),i=e?!i:i,i?(!l&&c[p]&&p++,c[p]={s:new Qi,p:h},c[p].s.curves=s.curves,l&&p++,d[p]=[]):d[p].push({h:s,p:h[0]});if(!c[0])return function(e){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n],i=new Qi;i.curves=r.curves,t.push(i)}return t}(r);if(c.length>1){let e=!1,n=0;for(let e=0,t=c.length;e<t;e++)u[e]=[];for(let r=0,i=c.length;r<i;r++){const i=d[r];for(let s=0;s<i.length;s++){const a=i[s];let o=!0;for(let i=0;i<c.length;i++)t(a.p,c[i].p)&&(r!==i&&n++,o?(o=!1,u[i].push(a)):e=!0);o&&u[r].push(a)}}n>0&&!1===e&&(d=u)}for(let e=0,t=c.length;e<t;e++){a=c[e].s,o.push(a),A=d[e];for(let e=0,t=A.length;e<t;e++)a.holes.push(A[e].h)}return o}}class va extends Ue{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){void 0!==e&&(null!==this.domElement&&this.disconnect(),this.domElement=e)}disconnect(){}dispose(){}update(){}}function ya(e,t,n,r){const i=function(e){switch(e){case T:case S:return{byteLength:1,components:1};case E:case M:case P:return{byteLength:2,components:1};case D:case L:return{byteLength:2,components:4};case R:case C:case N:return{byteLength:4,components:1};case O:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${e}.`)}(r);switch(n){case B:return e*t;case V:case z:return e*t/i.components*i.byteLength;case G:case j:return e*t*2/i.components*i.byteLength;case U:return e*t*3/i.components*i.byteLength;case F:case H:return e*t*4/i.components*i.byteLength;case W:case X:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case Q:case Y:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case K:case J:return Math.max(e,16)*Math.max(t,8)/4;case $:case Z:return Math.max(e,8)*Math.max(t,8)/2;case ee:case te:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8;case ne:case re:return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16;case ie:return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16;case se:return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16;case ae:return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16;case oe:return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16;case le:return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16;case ue:return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16;case ce:return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16;case he:return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16;case Ae:return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16;case de:return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16;case pe:return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16;case fe:return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16;case me:return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16;case ge:case _e:case ve:return Math.ceil(e/4)*Math.ceil(t/4)*16;case ye:case xe:return Math.ceil(e/4)*Math.ceil(t/4)*8;case be:case we:return Math.ceil(e/4)*Math.ceil(t/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function xa(){let e=null,t=!1,n=null,r=null;function i(t,s){n(t,s),r=e.requestAnimationFrame(i)}return{start:function(){!0!==t&&null!==n&&(r=e.requestAnimationFrame(i),t=!0)},stop:function(){e.cancelAnimationFrame(r),t=!1},setAnimationLoop:function(e){n=e},setContext:function(t){e=t}}}function ba(e){const t=new WeakMap;return{get:function(e){return e.isInterleavedBufferAttribute&&(e=e.data),t.get(e)},remove:function(n){n.isInterleavedBufferAttribute&&(n=n.data);const r=t.get(n);r&&(e.deleteBuffer(r.buffer),t.delete(n))},update:function(n,r){if(n.isInterleavedBufferAttribute&&(n=n.data),n.isGLBufferAttribute){const e=t.get(n);
vendor: 1,812 bytes, line 1
1return void((!e||e.version<n.version)&&t.set(n,{buffer:n.buffer,type:n.type,bytesPerElement:n.elementSize,version:n.version}))}const i=t.get(n);if(void 0===i)t.set(n,function(t,n){const r=t.array,i=t.usage,s=r.byteLength,a=e.createBuffer();let o;if(e.bindBuffer(n,a),e.bufferData(n,r,i),t.onUploadCallback(),r instanceof Float32Array)o=e.FLOAT;else if(r instanceof Uint16Array)o=t.isFloat16BufferAttribute?e.HALF_FLOAT:e.UNSIGNED_SHORT;else if(r instanceof Int16Array)o=e.SHORT;else if(r instanceof Uint32Array)o=e.UNSIGNED_INT;else if(r instanceof Int32Array)o=e.INT;else if(r instanceof Int8Array)o=e.BYTE;else if(r instanceof Uint8Array)o=e.UNSIGNED_BYTE;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);o=e.UNSIGNED_BYTE}return{buffer:a,type:o,bytesPerElement:r.BYTES_PER_ELEMENT,version:t.version,size:s}}(n,r));else if(i.version<n.version){if(i.size!==n.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");!function(t,n,r){const i=n.array,s=n.updateRanges;if(e.bindBuffer(r,t),0===s.length)e.bufferSubData(r,0,i);else{s.sort(((e,t)=>e.start-t.start));let t=0;for(let e=1;e<s.length;e++){const n=s[t],r=s[e];r.start<=n.start+n.count+1?n.count=Math.max(n.count,r.start+r.count-n.start):(++t,s[t]=r)}s.length=t+1;for(let t=0,n=s.length;t<n;t++){const n=s[t];e.bufferSubData(r,n.start*i.BYTES_PER_ELEMENT,i,n.start,n.count)}n.clearUpdateRanges()}n.onUploadCallback()}(i.buffer,n,r),i.version=n.version}}}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:s}})),"undefined"!=typeof window&&(window.__THREE__||(window.__THREE__=s));const wa
vendor: 24,872 bytes, line 1
1={alphahash_fragment:"#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif",alphahash_pars_fragment:"#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif",alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_CLEARCOAT ) \n\t\tclearcoatSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_SHEEN ) \n\t\tsheenSpecularIndirect *= ambientOcclusion;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometryNormal, geometryViewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",batching_pars_vertex:"#ifdef USE_BATCHING\n\t#if ! defined( GL_ANGLE_multi_draw )\n\t#define gl_DrawID _gl_DrawID\n\tuniform int _gl_DrawID;\n\t#endif\n\tuniform highp sampler2D batchingTexture;\n\tuniform highp usampler2D batchingIdTexture;\n\tmat4 getBatchingMatrix( const in float i ) {\n\t\tint size = textureSize( batchingTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n\tfloat getIndirectIndex( const in int i ) {\n\t\tint size = textureSize( batchingIdTexture, 0 ).x;\n\t\tint x = i % size;\n\t\tint y = i / size;\n\t\treturn float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );\n\t}\n#endif\n#ifdef USE_BATCHING_COLOR\n\tuniform sampler2D batchingColorTexture;\n\tvec3 getBatchingColor( const in float i ) {\n\t\tint size = textureSize( batchingColorTexture, 0 ).x;\n\t\tint j = int( i );\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\treturn texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;\n\t}\n#endif",batching_vertex:"#ifdef USE_BATCHING\n\tmat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );\n#endif",begin_vertex:"vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"float 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_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n} // validated",iridescence_fragment:"#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\treturn vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\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 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 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 max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\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 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};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\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}\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}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn 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}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n} // validated",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = objectTangent;\n#endif\n#ifdef USE_BATCHING\n\tmat3 bm = mat3( batchingMatrix );\n\ttransformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );\n\ttransformedNormal = bm * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = bm * transformedTangent;\n\t#endif\n#endif\n#ifdef USE_INSTANCING\n\tmat3 im = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );\n\ttransformedNormal = im * transformedNormal;\n\t#ifdef USE_TANGENT\n\t\ttransformedTangent = im * transformedTangent;\n\t#endif\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\ttransformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE\n\t\temissiveColor = sRGBTransferEOTF( emissiveColor );\n\t#endif\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",colorspace_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",colorspace_pars_fragment:"vec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferEOTF( 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 sRGBTransferOETF( 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}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\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, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t}
vendor: 5,673 bytes, line 1
1 else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float vFogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn vec3( texture2D( gradientMap, coord ).r );\n\t#else\n\t\tvec2 fw = fwidth( coord ) * 0.5;\n\t\treturn mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );\n\t#endif\n}",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_fragment:"LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;",lights_lambert_pars_fragment:"varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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 vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\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}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\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 getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.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 getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}
vendor: 5,966 bytes, line 1
1\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 getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.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 vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;
vendor: 4,695 bytes, line 1
1\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).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_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_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}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alph
vendor: 11,921 bytes, line 1
1aB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * 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}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\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\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\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.roughness;\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 vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
vendor: 14,255 bytes, line 1
1\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\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\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, 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\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\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 ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometryNormal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tgl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\tvFragDepth = 1.0 + gl_Position.w;\n\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 sampledDiffuseColor = texture2D( map, vMapUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t#if defined( USE_POINTS_UV )\n\t\tvec2 uv = vUv;\n\t#else\n\t\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tdiffuseColor *= texture2D( map, uv );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_POINTS_UV )\n\tvarying vec2 vUv;\n#else\n\t#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\t\tuniform mat3 uvTransform;\n\t#endif\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphinstance_vertex:"#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif",morphcolor_vertex:"#if defined( USE_MORPHCOLORS )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t#endif\n\tuniform sampler2DArray morphTargetsTexture;\n\tuniform ivec2 morphTargetsTextureSize;\n\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t}\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t}\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 nonPerturbedNormal = normal;",normal_fragment_maps:"#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).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 * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );
vendor: 4,597 bytes, line 1
1\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#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",normal_pars_vertex:"#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",normal_vertex:"#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",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = nonPerturbedNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\tclearcoatNormal = normalize( tbn2 * clearcoatMapN );\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif",iridescence_pars_fragment:"#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif",opaque_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;\nconst float Inv255 = 1. / 255.;\nconst vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\nconst vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );\nconst vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );\nconst vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );\nvec4 packDepthToRGBA( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec4( 0., 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec4( 1., 1., 1., 1. );\n\tfloat vuf;\n\tfloat af = modf( v * PackFactors.a, vuf );\n\tfloat bf = modf( vuf * ShiftRight8, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );\n}\nvec3 packDepthToRGB( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec3( 0., 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec3( 1., 1., 1. );\n\tfloat vuf;\n\tfloat bf = modf( v * PackFactors.b, vuf );\n\tfloat gf = modf( vuf * ShiftRight8, vuf );\n\treturn vec3( vuf * Inv255, gf * PackUpscale, bf );\n}\nvec2 packDepthToRG( const in float v ) {\n\tif( v <= 0.0 )\n\t\treturn vec2( 0., 0. );\n\tif( v >= 1.0 )\n\t\treturn vec2( 1., 1. );\n\tfloat vuf;\n\tfloat gf = modf( v * 256., vuf );\n\treturn vec2( vuf * Inv255, gf );\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors4 );\n}\nfloat unpackRGBToDepth( const in vec3 v ) {\n\treturn dot( v, UnpackFactors3 );\n}\nfloat unpackRGToDepth( const in vec2 v ) {\n\treturn v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;\n}\nvec4 pack2HalfToRGBA( const in vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 25
vendor: 18,431 bytes, line 1
15.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( const in 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 depth, const in float near, const in float far ) {\n\treturn depth * ( 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 depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_BATCHING\n\tmvPosition = batchingMatrix * mvPosition;\n#endif\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n\tuniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#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 shadowIntensity;\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\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\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 shadowIntensity;\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 shadowIntensity, 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\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\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 mix( 1.0, shadow, shadowIntensity );\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 shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tfloat shadow = 1.0;\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\t\n\t\tfloat lightToPositionLength = length( lightToPosition );\n\t\tif ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {\n\t\t\tfloat dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\t\tdp += shadowBias;\n\t\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\t\tshadow = (\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t\t) * ( 1.0 / 9.0 );\n\t\t\t#else\n\t\t\t\tshadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t\t#endif\n\t\t}\n\t\treturn mix( 1.0, shadow, shadowIntensity );\n\t}\n#endif",shadowmap_pars_vertex:"#if NUM_SPOT_LIGHT_COORDS > 0\n\tuniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n\tvarying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#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 shadowIntensity;\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\tstruct SpotLightShadow {\n\t\t\tfloat shadowIntensity;\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 shadowIntensity;\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )\n\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\tvec4 shadowWorldPosition;\n#endif\n#if defined( USE_SHADOWMAP )\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if NUM_SPOT_LIGHT_COORDS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition;\n\t\t#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t\tshadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;\n\t\t#endif\n\t\tvSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, 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.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ 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.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\tuniform highp sampler2D boneTexture;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tint size = textureSize( boneTexture, 0 ).x;\n\t\tint j = int( i ) * 4;\n\t\tint x = j % size;\n\t\tint y = j / size;\n\t\tvec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );\n\t\tvec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );\n\t\tvec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );\n\t\tvec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );\n\t\treturn mat4( v1, v2, v3, v4 );\n\t}\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;
vendor: 2,005 bytes, line 1
1\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 CineonToneMapping( 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}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);
vendor: 9,105 bytes, line 1
1\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tconst float StartCompression = 0.8 - 0.04;\n\tconst float Desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min( color.r, min( color.g, color.b ) );\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max( color.r, max( color.g, color.b ) );\n\tif ( peak < StartCompression ) return color;\n\tfloat d = 1. - StartCompression;\n\tfloat newPeak = 1. - d * d / ( peak + d - StartCompression );\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );\n\treturn mix( color, vec3( newPeak ), g );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec4 transmittedLight;\n\t\tvec3 transmittance;\n\t\t#ifdef USE_DISPERSION\n\t\t\tfloat halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;\n\t\t\tvec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );\n\t\t\tfor ( int i = 0; i < 3; i ++ ) {\n\t\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );\n\t\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\t\trefractionCoords += 1.0;\n\t\t\t\trefractionCoords /= 2.0;\n\t\t\t\tvec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );\n\t\t\t\ttransmittedLight[ i ] = transmissionSample[ i ];\n\t\t\t\ttransmittedLight.a += transmissionSample.a;\n\t\t\t\ttransmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];\n\t\t\t}\n\t\t\ttransmittedLight.a /= 3.0;\n\t\t#else\n\t\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\t\trefractionCoords += 1.0;\n\t\t\trefractionCoords /= 2.0;\n\t\t\ttransmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\t\ttransmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\t#endif\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif",uv_pars_fragment:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;
vendor: 5,728 bytes, line 1
1\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_pars_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif",uv_vertex:"#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
vendor: 37,111 bytes, line 1
1\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_BATCHING\n\t\tworldPosition = batchingMatrix * worldPosition;\n\t#endif\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",background_frag:"uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",backgroundCube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",backgroundCube_frag:"#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",depth_vert:"#include <common>\n#include <batching_pars_vertex>\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 <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_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}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\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 <alphahash_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#elif DEPTH_PACKING == 3202\n\t\tgl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );\n\t#elif DEPTH_PACKING == 3203\n\t\tgl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\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 <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_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}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\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 <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_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}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <uv_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 <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\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 <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_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 <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\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\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_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 <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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 <normal_vertex>\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}",meshlambert_frag:"#define LAMBERT\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 <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_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 <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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_lambert_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\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_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 <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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 <normal_vertex>\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}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\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 <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_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 <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\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( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_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\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\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 ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_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 <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\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}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_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 <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_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 <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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 <normal_vertex>\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#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_DISPERSION\n\tuniform float dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\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 <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\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 <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_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 <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_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 <normal_vertex>\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}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_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 <normal_pars_fragment>\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\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\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 <alphahash_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\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_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}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_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 <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix[ 3 ];\n\tvec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );\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}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}"},
vendor: 766 bytes, line 1
1Ta={common:{diffuse:{value:new Gn(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new et},alphaMap:{value:null},alphaMapTransform:{value:new et},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new et}},envmap:{envMap:{value:null},envMapRotation:{value:new et},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new et}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new et}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new et},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new et},normalScale:{value:new Ye(1,1)}}
vendor: 7,766 bytes, line 1
1,displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new et},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new et}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new et}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new et}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Gn(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Gn(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new et},alphaTest:{value:0},uvTransform:{value:new et}},sprite:{diffuse:{value:new Gn(16777215)},opacity:{value:1},center:{value:new Ye(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new et},alphaMap:{value:null},alphaMapTransform:{value:new et},alphaTest:{value:0}}},Sa={basic:{uniforms:Cr([Ta.common,Ta.specularmap,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.fog]),vertexShader:wa.meshbasic_vert,fragmentShader:wa.meshbasic_frag},lambert:{uniforms:Cr([Ta.common,Ta.specularmap,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.fog,Ta.lights,{emissive:{value:new Gn(0)}}]),vertexShader:wa.meshlambert_vert,fragmentShader:wa.meshlambert_frag},phong:{uniforms:Cr([Ta.common,Ta.specularmap,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.fog,Ta.lights,{emissive:{value:new Gn(0)},specular:{value:new Gn(1118481)},shininess:{value:30}}]),vertexShader:wa.meshphong_vert,fragmentShader:wa.meshphong_frag},standard:{uniforms:Cr([Ta.common,Ta.envmap,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.roughnessmap,Ta.metalnessmap,Ta.fog,Ta.lights,{emissive:{value:new Gn(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:wa.meshphysical_vert,fragmentShader:wa.meshphysical_frag},toon:{uniforms:Cr([Ta.common,Ta.aomap,Ta.lightmap,Ta.emissivemap,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.gradientmap,Ta.fog,Ta.lights,{emissive:{value:new Gn(0)}}]),vertexShader:wa.meshtoon_vert,fragmentShader:wa.meshtoon_frag},matcap:{uniforms:Cr([Ta.common,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,Ta.fog,{matcap:{value:null}}]),vertexShader:wa.meshmatcap_vert,fragmentShader:wa.meshmatcap_frag},points:{uniforms:Cr([Ta.points,Ta.fog]),vertexShader:wa.points_vert,fragmentShader:wa.points_frag},dashed:{uniforms:Cr([Ta.common,Ta.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:wa.linedashed_vert,fragmentShader:wa.linedashed_frag},depth:{uniforms:Cr([Ta.common,Ta.displacementmap]),vertexShader:wa.depth_vert,fragmentShader:wa.depth_frag},normal:{uniforms:Cr([Ta.common,Ta.bumpmap,Ta.normalmap,Ta.displacementmap,{opacity:{value:1}}]),vertexShader:wa.meshnormal_vert,fragmentShader:wa.meshnormal_frag},sprite:{uniforms:Cr([Ta.sprite,Ta.fog]),vertexShader:wa.sprite_vert,fragmentShader:wa.sprite_frag},background:{uniforms:{uvTransform:{value:new et},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:wa.background_vert,fragmentShader:wa.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new et}},vertexShader:wa.backgroundCube_vert,fragmentShader:wa.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:wa.cube_vert,fragmentShader:wa.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:wa.equirect_vert,fragmentShader:wa.equirect_frag},distanceRGBA:{uniforms:Cr([Ta.common,Ta.displacementmap,{referencePosition:{value:new Ke},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:wa.distanceRGBA_vert,fragmentShader:wa.distanceRGBA_frag},shadow:{uniforms:Cr([Ta.lights,Ta.fog,{color:{value:new Gn(0)},opacity:{value:1}}]),vertexShader:wa.shadow_vert,fragmentShader:wa.shadow_frag}};Sa.physical={uniforms:Cr([Sa.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new et},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new et},clearcoatNormalScale:{value:new Ye(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new et},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new et},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new et},sheen:{value:0},sheenColor:{value:new Gn(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new et},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new et},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new et},transmissionSamplerSize:{value:new Ye},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new et},attenuationDistance:{value:0},attenuationColor:{value:new Gn(0)},specularColor:{value:new Gn(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new et},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new et},anisotropyVector:{value:new Ye},anisotropyMap:{value:null},anisotropyMapTransform:{value:new et}}]),vertexShader:wa.meshphysical_vert,fragmentShader:wa.meshphysical_frag};const Ma={r:0,b:0,g:0},Ea=new on,Ca=new $t;function Ra(e,t,n,r,i,s,a){const o=new Gn(0);let l,u,c=!0===s?0:1,h=null,A=0,d=null;function f(e){let r=!0===e.isScene?e.background:null;return r&&r.isTexture&&(r=(e.backgroundBlurriness>0?n:t).get(r)),r}function m(t,n){t.getRGB(Ma,Rr(e)),r.buffers.color.setClear(Ma.r,Ma.g,Ma.b,n,a)}return{getClearColor:function(){return o},setClearColor:function(e,t=1){o.set(e),c=t,m(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(e){c=e,m(o,c)},render:function(t){let n=!1;const i=f(t);null===i?m(o,c):i&&i.isColor&&(m(i,1),n=!0);const s=e.xr.getEnvironmentBlendMode();"additive"===s?r.buffers.color.setClear(0,0,0,1,a):"alpha-blend"===s&&r.buffers.color.setClear(0,0,0,0,a),(e.autoClear||n)&&(r.buffers.depth.setTest(!0),r.buffers.depth.setMask(!0),r.buffers.color.setMask(!0),e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil))},addToRenderList:function(t,n){const r=f(n);r&&(r.isCubeTexture||r.mapping===p)?(void 0===u&&(u=new Tr(new Mr(1,1,1),new Pr({name:"Backgroun
1dCubeMaterial",uniforms:Er(Sa.backgroundCube.uniforms),vertexShader:Sa.backgroundCube.vertexShader,fragmentShader:Sa.backgroundCube.fragmentShader,side:1,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),Ea.copy(n.backgroundRotation),Ea.x*=-1,Ea.y*=-1,Ea.z*=-1,r.isCubeTexture&&!1===r.isRenderTargetTexture&&(Ea.y*=-1,Ea.z*=-1),u.material.uniforms.envMap.value=r,u.material.uniforms.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,u.material.uniforms.backgroundBlurriness.value=n.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,u.material.uniforms.backgroundRotation.value.setFromMatrix4(Ca.makeRotationFromEuler(Ea)),u.material.toneMapped=ut.getTransfer(r.colorSpace)!==Ce,h===r&&A===r.version&&d===e.toneMapping||(u.material.needsUpdate=!0,h=r,A=r.version,d=e.toneMapping),u.layers.enableAll(),t.unshift(u,u.geometry,u.material,0,0,null)):r&&r.isTexture&&(void 0===l&&(l=new Tr(new Ss(2,2),new Pr({name:"BackgroundMaterial",uniforms:Er(Sa.background.uniforms),vertexShader:Sa.background.vertexShader,fragmentShader:Sa.background.fragmentShader,side:0,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),l.geometry.deleteAttribute("normal"),Object.defineProperty(l.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(l)),l.material.uniforms.t2D.value=r,l.material.uniforms.backgroundIntensity.value=n.backgroundIntensity,l.material.toneMapped=ut.getTransfer(r.colorSpace)!==Ce,!0===r.matrixAutoUpdate&&r.updateMatrix(),l.material.uniforms.uvTransform.value.copy(r.matrix),h===r&&A===r.version&&d===e.toneMapping||(l.material.needsUpdate=!0,h=r,A=r.version,d=e.toneMapping),l.layers.enableAll(),t.unshift(l,l.geometry,l.material,0,0,null))},dispose:function(){void 0!==u&&(u.geometry.dispose(),u.material.dispose(),u=void 0),void 0!==l&&(l.geometry.dispose(),l.material.dispose(),l=void 0)}}}function Na(e,t){const n=e.getParameter(e.MAX_VERTEX_ATTRIBS),r={},i=u(null);let s=i,a=!1;function o(t){return e.bindVertexArray(t)}function l(t){return e.deleteVertexArray(t)}function u(e){const t=[],r=[],i=[];for(let e=0;e<n;e++)t[e]=0,r[e]=0,i[e]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:t,enabledAttributes:r,attributeDivisors:i,object:e,attributes:{},index:null}}function c(){const e=s.newAttributes;for(let t=0,n=e.length;t<n;t++)e[t]=0}function h(e){A(e,0)}function A(t,n){const r=s.newAttributes,i=s.enabledAttributes,a=s.attributeDivisors;r[t]=1,0===i[t]&&(e.enableVertexAttribArray(t),i[t]=1),a[t]!==n&&(e.vertexAttribDivisor(t,n),a[t]=n)}function d(){const t=s.newAttributes,n=s.enabledAttributes;for(let r=0,i=n.length;r<i;r++)n[r]!==t[r]&&(e.disableVertexAttribArray(r),n[r]=0)}function p(t,n,r,i,s,a,o){!0===o?e.vertexAttribIPointer(t,n,r,s,a):e.vertexAttribPointer(t,n,r,i,s,a)}function f(){m(),a=!0,s!==i&&(s=i,o(s.object))}function m(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:function(n,i,l,f,m){let g=!1;const _=function(t,n,i){const s=!0===i.wireframe;let a=r[t.id];void 0===a&&(a={},r[t.id]=a);let o=a[n.id];void 0===o&&(o={},a[n.id]=o);let l=o[s];return void 0===l&&(l=u(e.createVertexArray()),o[s]=l),l}(f,l,i);s!==_&&(s=_,o(s.object)),g=function(e,t,n,r){const i=s.attributes,a=t.attributes;let o=0;const l=n.getAttributes();for(const t in l)if(l[t].location>=0){const n=i[t];let r=a[t];if(void 0===r&&("instanceMatrix"===t&&e.instanceMatrix&&(r=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(r=e.instanceColor)),void 0===n)return!0;if(n.attribute!==r)return!0;if(r&&n.data!==r.data)return!0;o++}return s.attributesNum!==o||s.index!==r}(n,f,l,m),g&&function(e,t,n,r){const i={},a=t.attributes;let o=0;const l=n.getAttributes();for(const t in l)if(l[t].location>=0){let n=a[t];void 0===n&&("instanceMatrix"===t&&e.instanceMatrix&&(n=e.instanceMatrix),"instanceColor"===t&&e.instanceColor&&(n=e.instanceColor));const r={};r.attribute=n,n&&n.data&&(r.data=n.data),i[t]=r,o++}s.attributes=i,s.attributesNum=o,s.index=r}(n,f,l,m),null!==m&&t.update(m,e.ELEMENT_ARRAY_BUFFER),(g||a)&&(a=!1,function(n,r,i,s){c();const a=s.attributes,o=i.getAttributes(),l=r.defaultAttributeValues;for(const r in o){const i=o[r];if(i.location>=0){let o=a[r];if(void 0===o&&("instanceMatrix"===r&&n.instanceMatrix&&(o=n.instanceMatrix),"instanceColor"===r&&n.instanceColor&&(o=n.instanceColor)),void 0!==o){const r=o.normalized,a=o.itemSize,l=t.get(o);if(void 0===l)continue;const u=l.buffer,c=l.type,d=l.bytesPerElement,f=c===e.INT||c===e.UNSIGNED_INT||o.gpuType===C;if(o.isInterleavedBufferAttribute){const t=o.data,l=t.stride,m=o.offset;if(t.isInstancedInterleavedBuffer){for(let e=0;e<i.locationSize;e++)A(i.location+e,t.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=t.meshPerAttribute*t.count)}else for(let e=0;e<i.locationSize;e++)h(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<i.locationSize;e++)p(i.location+e,a/i.locationSize,c,r,l*d,(m+a/i.locationSize*e)*d,f)}else{if(o.isInstancedBufferAttribute){for(let e=0;e<i.locationSize;e++)A(i.location+e,o.meshPerAttribute);!0!==n.isInstancedMesh&&void 0===s._maxInstanceCount&&(s._maxInstanceCount=o.meshPerAttribute*o.count)}
vendor: 1,639 bytes, line 1
1else for(let e=0;e<i.locationSize;e++)h(i.location+e);e.bindBuffer(e.ARRAY_BUFFER,u);for(let e=0;e<i.locationSize;e++)p(i.location+e,a/i.locationSize,c,r,a*d,a/i.locationSize*e*d,f)}}else if(void 0!==l){const t=l[r];if(void 0!==t)switch(t.length){case 2:e.vertexAttrib2fv(i.location,t);break;case 3:e.vertexAttrib3fv(i.location,t);break;case 4:e.vertexAttrib4fv(i.location,t);break;default:e.vertexAttrib1fv(i.location,t)}}}}d()}(n,i,l,f),null!==m&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t.get(m).buffer))},reset:f,resetDefaultState:m,dispose:function(){f();for(const e in r){const t=r[e];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e]}},releaseStatesOfGeometry:function(e){if(void 0===r[e.id])return;const t=r[e.id];for(const e in t){const n=t[e];for(const e in n)l(n[e].object),delete n[e];delete t[e]}delete r[e.id]},releaseStatesOfProgram:function(e){for(const t in r){const n=r[t];if(void 0===n[e.id])continue;const i=n[e.id];for(const e in i)l(i[e].object),delete i[e];delete n[e.id]}},initAttributes:c,enableAttribute:h,disableUnusedAttributes:d}}function Pa(e,t,n){let r;function i(t,i,s){0!==s&&(e.drawArraysInstanced(r,t,i,s),n.update(i,r,s))}this.setMode=function(e){r=e},this.render=function(t,i){e.drawArrays(r,t,i),n.update(i,r,1)},this.renderInstances=i,this.renderMultiDraw=function(e,i,s){if(0===s)return;t.get("WEBGL_multi_draw").multiDrawArraysWEBGL(r,e,0,i,0,s);let a=0;for(let e=0;e<s;e++)a+=i[e];n.update(a,r,1)},this.renderMultiDrawInstances=function(e,s,a,o){if(0===a)return;const l=t.get("WEBGL_multi_draw");if(null===l)for(let t=0;t<e.length;t++)i(e[t],s[t],o[t]);
vendor: 6,136 bytes, line 1
1else{l.multiDrawArraysInstancedWEBGL(r,e,0,s,0,o,0,a);let t=0;for(let e=0;e<a;e++)t+=s[e]*o[e];n.update(t,r,1)}}}function Da(e,t,n,r){let i;function s(t){if("highp"===t){if(e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let a=void 0!==n.precision?n.precision:"highp";const o=s(a);o!==a&&(a=o);const l=!0===n.logarithmicDepthBuffer,u=!0===n.reverseDepthBuffer&&t.has("EXT_clip_control"),c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),h=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS);return{isWebGL2:!0,getMaxAnisotropy:function(){if(void 0!==i)return i;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");i=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i},getMaxPrecision:s,textureFormatReadable:function(t){return t===F||r.convert(t)===e.getParameter(e.IMPLEMENTATION_COLOR_READ_FORMAT)},textureTypeReadable:function(n){const i=n===P&&(t.has("EXT_color_buffer_half_float")||t.has("EXT_color_buffer_float"));return!(n!==T&&r.convert(n)!==e.getParameter(e.IMPLEMENTATION_COLOR_READ_TYPE)&&n!==N&&!i)},precision:a,logarithmicDepthBuffer:l,reverseDepthBuffer:u,maxTextures:c,maxVertexTextures:h,maxTextureSize:e.getParameter(e.MAX_TEXTURE_SIZE),maxCubemapSize:e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),maxAttributes:e.getParameter(e.MAX_VERTEX_ATTRIBS),maxVertexUniforms:e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),maxVaryings:e.getParameter(e.MAX_VARYING_VECTORS),maxFragmentUniforms:e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),vertexTextures:h>0,maxSamples:e.getParameter(e.MAX_SAMPLES)}}function La(e){const t=this;let n=null,r=0,i=!1,s=!1;const a=new Jr,o=new et,l={value:null,needsUpdate:!1};function u(e,n,r,i){const s=null!==e?e.length:0;let u=null;if(0!==s){if(u=l.value,!0!==i||null===u){const t=r+4*s,i=n.matrixWorldInverse;o.getNormalMatrix(i),(null===u||u.length<t)&&(u=new Float32Array(t));for(let t=0,n=r;t!==s;++t,n+=4)a.copy(e[t]).applyMatrix4(i,o),a.normal.toArray(u,n),u[n+3]=a.constant}l.value=u,l.needsUpdate=!0}return t.numPlanes=s,t.numIntersection=0,u}this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(e,t){const n=0!==e.length||t||0!==r||i;return i=t,r=e.length,n},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(e,t){n=u(e,t,0)},this.setState=function(a,o,c){const h=a.clippingPlanes,A=a.clipIntersection,d=a.clipShadows,p=e.get(a);if(!i||null===h||0===h.length||s&&!d)s?u(null):(l.value!==n&&(l.value=n,l.needsUpdate=r>0),t.numPlanes=r,t.numIntersection=0);else{const e=s?0:r,t=4*e;let i=p.clippingState||null;l.value=i,i=u(h,o,t,c);for(let e=0;e!==t;++e)i[e]=n[e];p.clippingState=i,this.numIntersection=A?this.numPlanes:0,this.numPlanes+=e}}}function Ia(e){let t=new WeakMap;function n(e,t){return t===A?e.mapping=c:t===d&&(e.mapping=h),e}function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping;if(s===A||s===d){if(t.has(i))return n(t.get(i).texture,i.mapping);{const s=i.image;if(s&&s.height>0){const a=new qr(s.height);return a.fromEquirectangularTexture(e,i),t.set(i,a),i.addEventListener("dispose",r),n(a.texture,i.mapping)}return null}}}return i},dispose:function(){t=new WeakMap}}}const Oa=[.125,.215,.35,.446,.526,.582],Ba=new Js,Ua=new Gn;let Fa=null,ka=0,qa=0,Va=!1;const za=(1+Math.sqrt(5))/2,Ga=1/za,ja=[new Ke(-za,Ga,0),new Ke(za,Ga,0),new Ke(-Ga,0,za),new Ke(Ga,0,za),new Ke(0,za,-Ga),new Ke(0,za,Ga),new Ke(-1,1,-1),new Ke(1,1,-1),new Ke(-1,1,1),new Ke(1,1,1)],Ha=new Ke;let Wa=class{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,r=100,i={}){const{size:s=256,position:a=Ha}=i;Fa=this._renderer.getRenderTarget(),ka=this._renderer.getActiveCubeFace(),qa=this._renderer.getActiveMipmapLevel(),Va=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(s);const o=this._allocateTargets();return o.depthBuffer=!0,this._sceneToCubeUV(e,n,r,o,a),t>0&&this._blur(o,0,0,t),this._applyPMREM(o),this._cleanup(o),o}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=$a(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Ya(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(Fa,ka,qa),this._renderer.xr.enabled=Va,e.scissorTest=!1,Qa(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===c||e.mapping===h?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),Fa=this._renderer.getRenderTarget(),ka=this._renderer.getActiveCubeFace(),qa=this._renderer.getActiveMipmapLevel(),Va=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:x,minFilter:x,generateMipmaps:!1,type:P,format:F,colorSpace:Me,depthBuffer:!1}
vendor: 4,442 bytes, line 1
1,r=Xa(e,t,n);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=Xa(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(e){const t=[],n=[],r=[];let i=e;const s=e-4+1+Oa.length;for(let a=0;a<s;a++){const s=Math.pow(2,i);n.push(s);let o=1/s;a>e-4?o=Oa[a-e+4-1]:0===a&&(o=0),r.push(o);const l=1/(s-2),u=-l,c=1+l,h=[u,u,c,u,c,c,u,u,c,c,u,c],A=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*A),_=new Float32Array(f*d*A),v=new Float32Array(m*d*A);for(let e=0;e<A;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0];g.set(r,p*d*e),_.set(h,f*d*e);const i=[e,e,e,e,e,e];v.set(i,m*d*e)}const y=new Ar;y.setAttribute("position",new er(g,p)),y.setAttribute("uv",new er(_,f)),y.setAttribute("faceIndex",new er(v,m)),t.push(y),i>4&&i--}return{lodPlanes:t,sizeLods:n,sigmas:r}}(r)),this._blurMaterial=function(e,t,n){const r=new Float32Array(20),i=new Ke(0,1,0);return new Pr({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/t,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${e}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:r},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}(r,e,t)}return r}_compileMaterial(e){const t=new Tr(this._lodPlanes[0],e);this._renderer.compile(t,Ba)}_sceneToCubeUV(e,t,n,r,i){const s=new Br(90,1,t,n),a=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,u=l.autoClear,c=l.toneMapping;l.getClearColor(Ua),l.toneMapping=0,l.autoClear=!1;
vendor: 11,002 bytes, line 1
1const h=new Xn({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1}),A=new Tr(new Mr,h);let d=!1;const p=e.background;p?p.isColor&&(h.color.copy(p),e.background=null,d=!0):(h.color.copy(Ua),d=!0);for(let t=0;t<6;t++){const n=t%3;0===n?(s.up.set(0,a[t],0),s.position.set(i.x,i.y,i.z),s.lookAt(i.x+o[t],i.y,i.z)):1===n?(s.up.set(0,0,a[t]),s.position.set(i.x,i.y,i.z),s.lookAt(i.x,i.y+o[t],i.z)):(s.up.set(0,a[t],0),s.position.set(i.x,i.y,i.z),s.lookAt(i.x,i.y,i.z+o[t]));const u=this._cubeSize;Qa(r,n*u,t>2?u:0,u,u),l.setRenderTarget(r),d&&l.render(A,s),l.render(e,s)}A.geometry.dispose(),A.material.dispose(),l.toneMapping=c,l.autoClear=u,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===c||e.mapping===h;r?(null===this._cubemapMaterial&&(this._cubemapMaterial=$a()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===e.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Ya());const i=r?this._cubemapMaterial:this._equirectMaterial,s=new Tr(this._lodPlanes[0],i);i.uniforms.envMap.value=e;const a=this._cubeSize;Qa(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,Ba)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let t=1;t<r;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=ja[(r-t-1)%ja.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial,u=new Tr(this._lodPlanes[r],l),c=l.uniforms,h=this._sizeLods[n]-1,A=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,d=i/A,p=isFinite(i)?1+Math.floor(3*d):20,f=[];let m=0;for(let e=0;e<20;++e){const t=e/d,n=Math.exp(-t*t/2);f.push(n),0===e?m+=n:e<p&&(m+=2*n)}for(let e=0;e<f.length;e++)f[e]=f[e]/m;c.envMap.value=e.texture,c.samples.value=p,c.weights.value=f,c.latitudinal.value="latitudinal"===s,a&&(c.poleAxis.value=a);const{_lodMax:g}=this;c.dTheta.value=A,c.mipInt.value=g-n;const _=this._sizeLods[r];Qa(t,3*_*(r>g-4?r-g+4:0),4*(this._cubeSize-_),3*_,2*_),o.setRenderTarget(t),o.render(u,Ba)}};function Xa(e,t,n){const r=new xt(e,t,n);return r.texture.mapping=p,r.texture.name="PMREM.cubeUv",r.scissorTest=!0,r}function Qa(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function Ya(){return new Pr({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function $a(){return new Pr({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t",fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:0,depthTest:!1,depthWrite:!1})}function Ka(e){let t=new WeakMap,n=null;function r(e){const n=e.target;n.removeEventListener("dispose",r);const i=t.get(n);void 0!==i&&(t.delete(n),i.dispose())}return{get:function(i){if(i&&i.isTexture){const s=i.mapping,a=s===A||s===d,o=s===c||s===h;if(a||o){let s=t.get(i);const l=void 0!==s?s.texture.pmremVersion:0;if(i.isRenderTargetTexture&&i.pmremVersion!==l)return null===n&&(n=new Wa(e)),s=a?n.fromEquirectangular(i,s):n.fromCubemap(i,s),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),s.texture;if(void 0!==s)return s.texture;{const l=i.image;return a&&l&&l.height>0||o&&l&&function(e){let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(l)?(null===n&&(n=new Wa(e)),s=a?n.fromEquirectangular(i):n.fromCubemap(i),s.texture.pmremVersion=i.pmremVersion,t.set(i,s),i.addEventListener("dispose",r),s.texture):null}}}return i},dispose:function(){t=new WeakMap,null!==n&&(n.dispose(),n=null)}}}function Za(e){const t={};function n(n){if(void 0!==t[n])return t[n];let r;switch(n){case"WEBGL_depth_texture":r=e.getExtension("WEBGL_depth_texture")||e.getExtension("MOZ_WEBGL_depth_texture")||e.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":r=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":r=e.getExtension("WEBGL_compressed_texture_s3tc")||e.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":r=e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:r=e.getExtension(n)}return t[n]=r,r}return{has:function(e){return null!==n(e)},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(e){const t=n(e);return null===t&&at("THREE.WebGLRenderer: "+e+" extension not supported."),t}}}function Ja(e,t,n,r){const i={},s=new WeakMap;function a(e){const o=e.target;null!==o.index&&t.remove(o.index);for(const e in o.attributes)t.remove(o.attributes[e]);o.removeEventListener("dispose",a),delete i[o.id];const l=s.get(o);l&&(t.remove(l),s.delete(o)),r.releaseStatesOfGeometry(o),!0===o.isInstancedBufferGeometry&&delete o._maxInstanceCount,n.memory.geometries--}function o(e){const n=[],r=e.index,i=e.attributes.position;let a=0;if(null!==r){const e=r.array;a=r.version;for(let t=0,r=e.length;t<r;t+=3){const r=e[t+0],i=e[t+1],s=e[t+2];n.push(r,i,i,s,s,r)}}else{if(void 0===i)return;{const e=i.array;a=i.version;for(let t=0,r=e.length/3-1;t<r;t+=3){const e=t+0,r=t+1,i=t+2;n.push(e,r,r,i,i,e)}}}const o=new(nt(n)?nr:tr)(n,1);o.version=a;const l=s.get(e);l&&t.remove(l),s.set(e,o)}return{get:function(e,t){return!0===i[t.id]||(t.addEventListener("dispose",a),i[t.id]=!0,n.memory.geometries++),t},update:function(n){const r=n.attributes;for(const n in r)t.update(r[n],e.ARRAY_BUFFER)},getWireframeAttribute:function(e){const t=s.get(e);if(t){const n=e.index;null!==n&&t.version<n.version&&o(e)}else o(e);return s.get(e)}}}function eo(e,t,n){let r,i,s;function a(t,a,o){0!==o&&(e.drawElementsInstanced(r,a,i,t*s,o),n.update(a,r,o))}this.setMode=function(e){r=e},this.setIndex=function(e){i=e.type,s=e.bytesPerElement},this.render=function(t,a){e.drawElements(r,a,i,t*s),n.update(a,r,1)},this.renderInstances=a,this.renderMultiDraw=function(e,s,a){if(0===a)return;t.get("WEBGL_multi_draw").multiDrawElementsWEBGL(r,s,0,i,e,0,a);let o=0;for(let e=0;e<a;e++)o+=s[e];n.update(o,r,1)},this.renderMultiDrawInstances=function(e,o,l,u){if(0===l)return;const c=t.get("WEBGL_multi_draw");if(null===c)for(let t=0;t<e.length;t++)a(e[t]/s,o[t],u[t]);else{c.multiDrawElementsInstancedWEBGL(r,o,0,i,e,0,u,0,l);let t=0;for(let e=0;e<l;e++)t+=o[e]*u[e];n.update(t,r,1)}}}function to(e){const t={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:t,programs:null,autoReset:!0,reset:function(){t.calls=0,t.triangles=0,t.points=0,t.lines=0},update:function(n,r,i){switch(t.calls++,r){case e.TRIANGLES:t.triangles+=i*(n/3);break;case e.LINES:t.lines+=i*(n/2);break;case e.LINE_STRIP:t.lines+=i*(n-1);break;case e.LINE_LOOP:t.lines+=i*n;break;case e.POINTS:t.points+=i*n;break;default:}}}}function no(e,t,n){const r=new WeakMap,i=new vt;return{update:function(s,a,o){const l=s.morphTargetInfluences,u=a.morphAttributes.position||a.morphAttributes.normal||a.morphAttributes.color,c=void 0!==u?u.length:0;let h=r.get(a);if(void 0===h||h.count!==c){void 0!==h&&h.texture.dispose();const e=void 0!==a.morphAttributes.position,n=void 0!==a.morphAttributes.normal,s=void 0!==a.morphAttributes.color,o=a.morphAttributes.position||[],l=a.morphAttributes.normal||[],u=a.morphAttributes.color||[];let A=0;!0===e&&(A=1),!0===n&&(A=2),!0===s&&(A=3);let d=a.attributes.position.count*A,p=1;d>t.maxTextureSize&&(p=Math.ceil(d/t.maxTextureSize),d=t.maxTextureSize);const f=new Float32Array(d*p*4*c),m=new bt(f,d,p,c);m.type=N,m.needsUpdate=!0;const g=4*A;for(let t=0;t<c;t++){const r=o[t],a=l[t],c=u[t],h=d*p*4*t;
vendor: 5,303 bytes, line 1
1for(let t=0;t<r.count;t++){const o=t*g;!0===e&&(i.fromBufferAttribute(r,t),f[h+o+0]=i.x,f[h+o+1]=i.y,f[h+o+2]=i.z,f[h+o+3]=0),!0===n&&(i.fromBufferAttribute(a,t),f[h+o+4]=i.x,f[h+o+5]=i.y,f[h+o+6]=i.z,f[h+o+7]=0),!0===s&&(i.fromBufferAttribute(c,t),f[h+o+8]=i.x,f[h+o+9]=i.y,f[h+o+10]=i.z,f[h+o+11]=4===c.itemSize?i.w:1)}}function _(){m.dispose(),r.delete(a),a.removeEventListener("dispose",_)}h={count:c,texture:m,size:new Ye(d,p)},r.set(a,h),a.addEventListener("dispose",_)}if(!0===s.isInstancedMesh&&null!==s.morphTexture)o.getUniforms().setValue(e,"morphTexture",s.morphTexture,n);else{let t=0;for(let e=0;e<l.length;e++)t+=l[e];const n=a.morphTargetsRelative?1:1-t;o.getUniforms().setValue(e,"morphTargetBaseInfluence",n),o.getUniforms().setValue(e,"morphTargetInfluences",l)}o.getUniforms().setValue(e,"morphTargetsTexture",h.texture,n),o.getUniforms().setValue(e,"morphTargetsTextureSize",h.size)}}}function ro(e,t,n,r){let i=new WeakMap;function s(e){const t=e.target;t.removeEventListener("dispose",s),n.remove(t.instanceMatrix),null!==t.instanceColor&&n.remove(t.instanceColor)}return{update:function(a){const o=r.render.frame,l=a.geometry,u=t.get(a,l);if(i.get(u)!==o&&(t.update(u),i.set(u,o)),a.isInstancedMesh&&(!1===a.hasEventListener("dispose",s)&&a.addEventListener("dispose",s),i.get(a)!==o&&(n.update(a.instanceMatrix,e.ARRAY_BUFFER),null!==a.instanceColor&&n.update(a.instanceColor,e.ARRAY_BUFFER),i.set(a,o))),a.isSkinnedMesh){const e=a.skeleton;i.get(e)!==o&&(e.update(),i.set(e,o))}return u},dispose:function(){i=new WeakMap}}}const io=new _t,so=new Mi(1,1),ao=new bt,oo=new class extends _t{constructor(e=null,t=1,n=1,r=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:r},this.magFilter=_,this.minFilter=_,this.wrapR=m,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},lo=new kr,uo=[],co=[],ho=new Float32Array(16),Ao=new Float32Array(9),po=new Float32Array(4);function fo(e,t,n){const r=e[0];if(r<=0||r>0)return e;const i=t*n;let s=uo[i];if(void 0===s&&(s=new Float32Array(i),uo[i]=s),0!==t){r.toArray(s,0);for(let r=1,i=0;r!==t;++r)i+=n,e[r].toArray(s,i)}return s}function mo(e,t){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}function go(e,t){for(let n=0,r=t.length;n<r;n++)e[n]=t[n]}function _o(e,t){let n=co[t];void 0===n&&(n=new Int32Array(t),co[t]=n);for(let r=0;r!==t;++r)n[r]=e.allocateTextureUnit();return n}function vo(e,t){const n=this.cache;n[0]!==t&&(e.uniform1f(this.addr,t),n[0]=t)}function yo(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2f(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(mo(n,t))return;e.uniform2fv(this.addr,t),go(n,t)}}function xo(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3f(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else if(void 0!==t.r)n[0]===t.r&&n[1]===t.g&&n[2]===t.b||(e.uniform3f(this.addr,t.r,t.g,t.b),n[0]=t.r,n[1]=t.g,n[2]=t.b);else{if(mo(n,t))return;e.uniform3fv(this.addr,t),go(n,t)}}function bo(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4f(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(mo(n,t))return;e.uniform4fv(this.addr,t),go(n,t)}}function wo(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(mo(n,t))return;e.uniformMatrix2fv(this.addr,!1,t),go(n,t)}else{if(mo(n,r))return;po.set(r),e.uniformMatrix2fv(this.addr,!1,po),go(n,r)}}function To(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(mo(n,t))return;e.uniformMatrix3fv(this.addr,!1,t),go(n,t)}else{if(mo(n,r))return;Ao.set(r),e.uniformMatrix3fv(this.addr,!1,Ao),go(n,r)}}function So(e,t){const n=this.cache,r=t.elements;if(void 0===r){if(mo(n,t))return;e.uniformMatrix4fv(this.addr,!1,t),go(n,t)}else{if(mo(n,r))return;ho.set(r),e.uniformMatrix4fv(this.addr,!1,ho),go(n,r)}}function Mo(e,t){const n=this.cache;n[0]!==t&&(e.uniform1i(this.addr,t),n[0]=t)}function Eo(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2i(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(mo(n,t))return;e.uniform2iv(this.addr,t),go(n,t)}}function Co(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3i(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(mo(n,t))return;e.uniform3iv(this.addr,t),go(n,t)}}function Ro(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4i(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(mo(n,t))return;e.uniform4iv(this.addr,t),go(n,t)}}function No(e,t){const n=this.cache;n[0]!==t&&(e.uniform1ui(this.addr,t),n[0]=t)}function Po(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y||(e.uniform2ui(this.addr,t.x,t.y),n[0]=t.x,n[1]=t.y);else{if(mo(n,t))return;e.uniform2uiv(this.addr,t),go(n,t)}}function Do(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z||(e.uniform3ui(this.addr,t.x,t.y,t.z),n[0]=t.x,n[1]=t.y,n[2]=t.z);else{if(mo(n,t))return;e.uniform3uiv(this.addr,t),go(n,t)}}function Lo(e,t){const n=this.cache;if(void 0!==t.x)n[0]===t.x&&n[1]===t.y&&n[2]===t.z&&n[3]===t.w||(e.uniform4ui(this.addr,t.x,t.y,t.z,t.w),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w);else{if(mo(n,t))return;e.uniform4uiv(this.addr,t),go(n,t)}}
vendor: 10,964 bytes, line 1
1function Io(e,t,n){const r=this.cache,i=n.allocateTextureUnit();let s;r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),this.type===e.SAMPLER_2D_SHADOW?(so.compareFunction=Pe,s=so):s=io,n.setTexture2D(t||s,i)}function Oo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture3D(t||oo,i)}function Bo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTextureCube(t||lo,i)}function Uo(e,t,n){const r=this.cache,i=n.allocateTextureUnit();r[0]!==i&&(e.uniform1i(this.addr,i),r[0]=i),n.setTexture2DArray(t||ao,i)}function Fo(e,t){e.uniform1fv(this.addr,t)}function ko(e,t){const n=fo(t,this.size,2);e.uniform2fv(this.addr,n)}function qo(e,t){const n=fo(t,this.size,3);e.uniform3fv(this.addr,n)}function Vo(e,t){const n=fo(t,this.size,4);e.uniform4fv(this.addr,n)}function zo(e,t){const n=fo(t,this.size,4);e.uniformMatrix2fv(this.addr,!1,n)}function Go(e,t){const n=fo(t,this.size,9);e.uniformMatrix3fv(this.addr,!1,n)}function jo(e,t){const n=fo(t,this.size,16);e.uniformMatrix4fv(this.addr,!1,n)}function Ho(e,t){e.uniform1iv(this.addr,t)}function Wo(e,t){e.uniform2iv(this.addr,t)}function Xo(e,t){e.uniform3iv(this.addr,t)}function Qo(e,t){e.uniform4iv(this.addr,t)}function Yo(e,t){e.uniform1uiv(this.addr,t)}function $o(e,t){e.uniform2uiv(this.addr,t)}function Ko(e,t){e.uniform3uiv(this.addr,t)}function Zo(e,t){e.uniform4uiv(this.addr,t)}function Jo(e,t,n){const r=this.cache,i=t.length,s=_o(n,i);mo(r,s)||(e.uniform1iv(this.addr,s),go(r,s));for(let e=0;e!==i;++e)n.setTexture2D(t[e]||io,s[e])}function el(e,t,n){const r=this.cache,i=t.length,s=_o(n,i);mo(r,s)||(e.uniform1iv(this.addr,s),go(r,s));for(let e=0;e!==i;++e)n.setTexture3D(t[e]||oo,s[e])}function tl(e,t,n){const r=this.cache,i=t.length,s=_o(n,i);mo(r,s)||(e.uniform1iv(this.addr,s),go(r,s));for(let e=0;e!==i;++e)n.setTextureCube(t[e]||lo,s[e])}function nl(e,t,n){const r=this.cache,i=t.length,s=_o(n,i);mo(r,s)||(e.uniform1iv(this.addr,s),go(r,s));for(let e=0;e!==i;++e)n.setTexture2DArray(t[e]||ao,s[e])}class rl{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=function(e){switch(e){case 5126:return vo;case 35664:return yo;case 35665:return xo;case 35666:return bo;case 35674:return wo;case 35675:return To;case 35676:return So;case 5124:case 35670:return Mo;case 35667:case 35671:return Eo;case 35668:case 35672:return Co;case 35669:case 35673:return Ro;case 5125:return No;case 36294:return Po;case 36295:return Do;case 36296:return Lo;case 35678:case 36198:case 36298:case 36306:case 35682:return Io;case 35679:case 36299:case 36307:return Oo;case 35680:case 36300:case 36308:case 36293:return Bo;case 36289:case 36303:case 36311:case 36292:return Uo}}(t.type)}}class il{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=function(e){switch(e){case 5126:return Fo;case 35664:return ko;case 35665:return qo;case 35666:return Vo;case 35674:return zo;case 35675:return Go;case 35676:return jo;case 5124:case 35670:return Ho;case 35667:case 35671:return Wo;case 35668:case 35672:return Xo;case 35669:case 35673:return Qo;case 5125:return Yo;case 36294:return $o;case 36295:return Ko;case 36296:return Zo;case 35678:case 36198:case 36298:case 36306:case 35682:return Jo;case 35679:case 36299:case 36307:return el;case 35680:case 36300:case 36308:case 36293:return tl;case 36289:case 36303:case 36311:case 36292:return nl}}(t.type)}}class sl{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const r=this.seq;for(let i=0,s=r.length;i!==s;++i){const s=r[i];s.setValue(e,t[s.id],n)}}}const al=/(\w+)(\])?(\[|\.)?/g;function ol(e,t){e.seq.push(t),e.map[t.id]=t}function ll(e,t,n){const r=e.name,i=r.length;for(al.lastIndex=0;;){const s=al.exec(r),a=al.lastIndex;let o=s[1];const l="]"===s[2],u=s[3];if(l&&(o|=0),void 0===u||"["===u&&a+2===i){ol(n,void 0===u?new rl(o,e,t):new il(o,e,t));break}{let e=n.map[o];void 0===e&&(e=new sl(o),ol(n,e)),n=e}}}class ul{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let r=0;r<n;++r){const n=e.getActiveUniform(t,r);ll(n,e.getUniformLocation(t,n.name),this)}}setValue(e,t,n,r){const i=this.map[t];void 0!==i&&i.setValue(e,n,r)}setOptional(e,t,n){const r=t[n];void 0!==r&&this.setValue(e,n,r)}static upload(e,t,n,r){for(let i=0,s=t.length;i!==s;++i){const s=t[i],a=n[s.id];!1!==a.needsUpdate&&s.setValue(e,a.value,r)}}static seqWithValue(e,t){const n=[];for(let r=0,i=e.length;r!==i;++r){const i=e[r];i.id in t&&n.push(i)}return n}}function cl(e,t,n){const r=e.createShader(t);return e.shaderSource(r,n),e.compileShader(r),r}let hl=0;const Al=new et;function dl(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const r=parseInt(s[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+function(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let e=i;e<s;e++){const i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}(e.getShaderSource(t),r)}return i}function pl(e,t){const n=function(e){ut._getMatrix(Al,ut.workingColorSpace,e);const t=`mat3( ${Al.elements.map((e=>e.toFixed(4)))} )`;switch(ut.getTransfer(e)){case Ee:return[t,"LinearTransferOETF"];case Ce:return[t,"sRGBTransferOETF"];default:return[t,"LinearTransferOETF"]}}(t);return[`vec4 ${e}( vec4 value ) {`,`\treturn ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join("\n")}function fl(e,t){let n;switch(t){case 1:n="Linear";break;case 2:n="Reinhard";break;case 3:n="Cineon";break;case 4:n="ACESFilmic";break;case 6:n="AgX";break;case 7:n="Neutral";break;case 5:n="Custom";break;default:n="Linear"}return"vec3 "+e+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const ml=new Ke;function gl(e){return""!==e}function _l(e,t){const n=t.numSpotLightShadows+t.numSpotLightMaps-t.numSpotLightShadowsWithMaps;return e.replace(/NUM_DIR_LIGHTS/g,t.numDirLights).replace(/NUM_SPOT_LIGHTS/g,t.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,t.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,t.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,t.numPointLights).replace(/NUM_HEMI_LIGHTS/g,t.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,t.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,t.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,t.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,t.numPointLightShadows)}function vl(e,t){return e.replace(/NUM_CLIPPING_PLANES/g,t.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,t.numClippingPlanes-t.numClipIntersection)}const yl=/^[ \t]*#include +<([\w\d./]+)>/gm;function xl(e){return e.replace(yl,wl)}const bl=new Map;function wl(e,t){let n=wa[t];if(void 0===n){const e=bl.get(t);if(void 0===e)throw new Error("Can not resolve #include <"+t+">");n=wa[e]}return xl(n)}const Tl=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Sl(e){return e.replace(Tl,Ml)}function Ml(e,t,n,r){let i="";for(let e=parseInt(t);e<parseInt(n);e++)i+=r.replace(/\[\s*i\s*\]/g,"[ "+e+" ]").replace(/UNROLLED_LOOP_INDEX/g,e);return i}function El(e){let t=`precision ${e.precision} float;\n\tprecision ${e.precision} int;\n\tprecision ${e.precision} sampler2D;\n\tprecision ${e.precision} samplerCube;\n\tprecision ${e.precision} sampler3D;\n\tprecision ${e.precision} sampler2DArray;\n\tprecision ${e.precision} sampler2DShadow;\n\tprecision ${e.precision} samplerCubeShadow;\n\tprecision ${e.precision} sampler2DArrayShadow;\n\tprecision ${e.precision} isampler2D;\n\tprecision ${e.precision} isampler3D;\n\tprecision ${e.precision} isamplerCube;\n\tprecision ${e.precision} isampler2DArray;\n\tprecision ${e.precision} usampler2D;\n\tprecision ${e.precision} usampler3D;\n\tprecision ${e.precision} usamplerCube;\n\tprecision ${e.precision} usampler2DArray;\n\t`;return"highp"===e.precision?t+="\n#define HIGH_PRECISION":"mediump"===e.precision?t+="\n#define MEDIUM_PRECISION":"lowp"===e.precision&&(t+="\n#define LOW_PRECISION"),t}function Cl(e,t,n,r){const i=e.getContext(),s=n.defines;let a=n.vertexShader,o=n.fragmentShader;const l=function(e){let t="SHADOWMAP_TYPE_BASIC";return 1===e.shadowMapType?t="SHADOWMAP_TYPE_PCF":2===e.shadowMapType?t="SHADOWMAP_TYPE_PCF_SOFT":3===e.shadowMapType&&(t="SHADOWMAP_TYPE_VSM"),t}(n),u=function(e){let t="ENVMAP_TYPE_CUBE";if(e.envMap)switch(e.envMapMode){case c:case h:t="ENVMAP_TYPE_CUBE";break;case p:t="ENVMAP_TYPE_CUBE_UV"}return t}(n),A=function(e){let t="ENVMAP_MODE_REFLECTION";return e.envMap&&e.envMapMode===h&&(t="ENVMAP_MODE_REFRACTION"),t}(n),d=function(e){let t="ENVMAP_BLENDING_NONE";if(e.envMap)switch(e.combine){case 0:t="ENVMAP_BLENDING_MULTIPLY";break;case 1:t="ENVMAP_BLENDING_MIX";break;case 2:t="ENVMAP_BLENDING_ADD"}return t}(n),f=function(e){const t=e.envMapCubeUVHeight;if(null===t)return null;const n=Math.log2(t)-2,r=1/t;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:r,maxMip:n}}(n),m=function(e){return[e.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",e.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(gl).join("\n")}(n),g=function(e){const t=[];for(const n in e){const r=e[n];!1!==r&&t.push("#define "+n+" "+r)}return t.join("\n")}(s),_=i.createProgram();let v,y,x=n.glslVersion?"#version "+n.glslVersion+"\n":"";n.isRawShaderMaterial?(v=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(gl).join("\n"),v.length>0&&(v+="\n"),y=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g].filter(gl).join("\n"),y.length>0&&(y+="\n")):(v=[El(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+A:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IR
1IDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","\tuniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","\tattribute vec2 uv1;","#endif","#ifdef USE_UV2","\tattribute vec2 uv2;","#endif","#ifdef USE_UV3","\tattribute vec2 uv3;","#endif","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(gl).join("\n"),y=[El(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,g,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alph
vendor: 12,855 bytes, line 1
1aToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+A:"",n.envMap?"#define "+d:"",f?"#define CUBEUV_TEXEL_WIDTH "+f.texelWidth:"",f?"#define CUBEUV_TEXEL_HEIGHT "+f.texelHeight:"",f?"#define CUBEUV_MAX_MIP "+f.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&!1===n.flatShading?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+l:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",0!==n.toneMapping?"#define TONE_MAPPING":"",0!==n.toneMapping?wa.tonemapping_pars_fragment:"",0!==n.toneMapping?fl("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",wa.colorspace_pars_fragment,pl("linearToOutputTexel",n.outputColorSpace),(ut.getLuminanceCoefficients(ml),["float luminance( const in vec3 rgb ) {",`\tconst vec3 weights = vec3( ${ml.x.toFixed(4)}, ${ml.y.toFixed(4)}, ${ml.z.toFixed(4)} );`,"\treturn dot( weights, rgb );","}"].join("\n")),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(gl).join("\n")),a=xl(a),a=_l(a,n),a=vl(a,n),o=xl(o),o=_l(o,n),o=vl(o,n),a=Sl(a),o=Sl(o),!0!==n.isRawShaderMaterial&&(x="#version 300 es\n",v=[m,"#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+v,y=["#define varying in",n.glslVersion===Ie?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===Ie?"":"#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"+y);const b=x+v+a,w=x+y+o,T=cl(i,i.VERTEX_SHADER,b),S=cl(i,i.FRAGMENT_SHADER,w);function M(t){if(e.debug.checkShaderErrors){const n=i.getProgramInfoLog(_).trim(),r=i.getShaderInfoLog(T).trim(),s=i.getShaderInfoLog(S).trim();let a=!0,o=!0;if(!1===i.getProgramParameter(_,i.LINK_STATUS))if(a=!1,"function"==typeof e.debug.onShaderError)e.debug.onShaderError(i,_,T,S);else{dl(i,T,"vertex"),dl(i,S,"fragment")}else""!==n||""!==r&&""!==s||(o=!1);o&&(t.diagnostics={runnable:a,programLog:n,vertexShader:{log:r,prefix:v},fragmentShader:{log:s,prefix:y}})}i.deleteShader(T),i.deleteShader(S),E=new ul(i,_),C=function(e,t){const n={},r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES);for(let i=0;i<r;i++){const r=e.getActiveAttrib(t,i),s=r.name;let a=1;r.type===e.FLOAT_MAT2&&(a=2),r.type===e.FLOAT_MAT3&&(a=3),r.type===e.FLOAT_MAT4&&(a=4),n[s]={type:r.type,location:e.getAttribLocation(t,s),locationSize:a}}return n}(i,_)}let E,C;i.attachShader(_,T),i.attachShader(_,S),void 0!==n.index0AttributeName?i.bindAttribLocation(_,0,n.index0AttributeName):!0===n.morphTargets&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_),this.getUniforms=function(){return void 0===E&&M(this),E},this.getAttributes=function(){return void 0===C&&M(this),C};let R=!1===n.rendererExtensionParallelShaderCompile;return this.isReady=function(){return!1===R&&(R=i.getProgramParameter(_,37297)),R},this.destroy=function(){r.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=hl++,this.cacheKey=t,this.usedTimes=1,this.program=_,this.vertexShader=T,this.fragmentShader=S,this}let Rl=0;class Nl{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,r=this._getShaderStage(t),i=this._getShaderStage(n),s=this._getShaderCacheForMaterial(e);return!1===s.has(r)&&(s.add(r),r.usedTimes++),!1===s.has(i)&&(s.add(i),i.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const e of t)e.usedTimes--,0===e.usedTimes&&this.shaderCache.delete(e.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return void 0===n&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return void 0===n&&(n=new Pl(e),t.set(e,n)),n}}class Pl{constructor(e){this.id=Rl++,this.code=e,this.usedTimes=0}}function Dl(e,t,n,r,i,s,a){const o=new ln,l=new Nl,u=new Set,c=[],h=i.logarithmicDepthBuffer,A=i.vertexTextures;let d=i.precision;const f={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"};function m(e){return u.add(e),0===e?"uv":`uv${e}`}return{getParameters:function(s,o,c,g,_){const v=g.fog,y=_.geometry,x=s.isMeshStandardMaterial?g.environment:null,b=(s.isMeshStandardMaterial?n:t).get(s.envMap||x),w=b&&b.mapping===p?b.image.height:null,T=f[s.type];null!==s.precision&&(d=i.getMaxPrecision(s.precision),s.precision);const S=y.morphAttributes.position||y.morphAttributes.normal||y.morphAttributes.color,M=void 0!==S?S.length:0;let E,C,R,N,P=0;if(void 0!==y.morphAttributes.position&&(P=1),void 0!==y.morphAttributes.normal&&(P=2),void 0!==y.morphAttributes.color&&(P=3),T){const e=Sa[T];E=e.vertexShader,C=e.fragmentShader}else E=s.vertexShader,C=s.fragmentShader,l.update(s),R=l.getVertexShaderID(s),N=l.getFragmentShaderID(s);const D=e.getRenderTarget(),L=e.state.buffers.depth.getReversed(),I=!0===_.isInstancedMesh,O=!0===_.isBatchedMesh,B=!!s.map,U=!!s.matcap,F=!!b,k=!!s.aoMap,q=!!s.lightMap,V=!!s.bumpMap,z=!!s.normalMap,G=!!s.displacementMap,j=!!s.emissiveMap,H=!!s.metalnessMap,W=!!s.roughnessMap,X=s.anisotropy>0,Q=s.clearcoat>0,Y=s.dispersion>0,$=s.iridescence>0,K=s.sheen>0,Z=s.transmission>0,J=X&&!!s.anisotropyMap,ee=Q&&!!s.clearcoatMap,te=Q&&!!s.clearcoatNormalMap,ne=Q&&!!s.clearcoatRoughnessMap,re=$&&!!s.iridescenceMap,ie=$&&!!s.iridescenceThicknessMap,se=K&&!!s.sheenColorMap,ae=K&&!!s.sheenRoughnessMap,oe=!!s.specularMap,le=!!s.specularColorMap,ue=!!s.specularIntensityMap,ce=Z&&!!s.transmissionMap,he=Z&&!!s.thicknessMap,Ae=!!s.gradientMap,de=!!s.alphaMap,pe=s.alphaTest>0,fe=!!s.alphaHash,me=!!s.extensions;let ge=0;s.toneMapped&&(null!==D&&!0!==D.isXRRenderTarget||(ge=e.toneMapping));const _e={shaderID:T,shaderType:s.type,shaderName:s.name,vertexShader:E,fragmentShader:C,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:N,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:d,batching:O,batchingColor:O&&null!==_._colorsTexture,instancing:I,instancingColor:I&&null!==_.instanceColor,instancingMorph:I&&null!==_.morphTexture,supportsVertexTextures:A,outputColorSpace:null===D?e.outputColorSpace:!0===D.isXRRenderTarget?D.texture.colorSpace:Me,alphaToCoverage:!!s.alphaToCoverage,map:B,matcap:U,envMap:F,envMapMode:F&&b.mapping,envMapCubeUVHeight:w,aoMap:k,lightMap:q,bumpMap:V,normalMap:z,displacementMap:A&&G,emissiveMap:j,normalMapObjectSpace:z&&1===s.normalMapType,normalMapTangentSpace:z&&0===s.normalMapType,metalnessMap:H,roughnessMap:W,anisotropy:X,anisotropyMap:J,clearcoat:Q,clearcoatMap:ee,clearcoatNormalMap:te,clearcoatRoughnessMap:ne,dispersion:Y,iridescence:$,iridescenceMap:re,iridescenceThicknessMap:ie,sheen:K,sheenColorMap:se,sheenRoughnessMap:ae,specularMap:oe,specularColorMap:le,specularIntensityMap:ue,transmission:Z,transmissionMap:ce,thicknessMap:he,gradientMap:Ae,opaque:!1===s.transparent&&1===s.blending&&!1===s.alphaToCoverage,alphaMap:de,alphaTest:pe,alphaHash:fe,combine:s.combine,mapUv:B&&m(s.map.channel),aoMapUv:k&&m(s.aoMap.channel),lightMapUv:q&&m(s.lightMap.channel),bumpMapUv:V&&m(s.bumpMap.channel),normalMapUv:z&&m(s.normalMap.channel),displacementMapUv:G&&m(s.displacementMap.channel),emissiveMapUv:j&&m(s.emissiveMap.channel),metalnessMapUv:H&&m(s.metalnessMap.channel),roughnessMapUv:W&&m(s.roughnessMap.channel),anisotropyMapUv:J&&m(s.anisotropyMap.channel),clearcoatMapUv:ee&&m(s.clearcoatMap.channel),clearcoatNormalMapUv:te&&m(s.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:ne&&m(s.clearcoatRoughnessMap.channel),iridescenceMapUv:re&&m(s.iridescenceMap.channel),iridescenceThicknessMapUv:ie&&m(s.iridescenceThicknessMap.channel),sheenColorMapUv:se&&m(s.sheenColorMap.channel),sheenRoughnessMapUv:ae&&m(s.sheenRoughnessMap.channel),specularMapUv:oe&&m(s.specularMap.channel),specularColorMapUv:le&&m(s.specularColorMap.channel),specularIntensityMapUv:ue&&m(s.specularIntensityMap.channel),transmissionMapUv:ce&&m(s.transmissionMap.channel),thicknessMapUv:he&&m(s.thicknessMap.channel),alphaMapUv:de&&m(s.alphaMap.channel),vertexTangents:!!y.attributes.tangent&&(z||X),vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!y.attributes.color&&4===y.attributes.color.itemSize,pointsUvs:!0===_.isPoints&&!!y.attributes.uv&&(B||de),fog:!!v,useFog:!0===s.fog,fogExp2:!!v&&v.isFogExp2,flatShading:!0===s.flatShading,sizeAttenuation:!0===s.sizeAttenuation,logarithmicDepthBuffer:h,reverseDepthBuffer:L,skinning:!0===_.isSkinnedMesh,morphTargets:void 0!==y.morphAttributes.position,morphNormals:void 0!==y.morphAttributes.normal,morphColors:void 0!==y.morphAttributes.color,morphTargetsCount:M,morphTextureStride:P,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numSpotLightMaps:o.spotLightMap.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numSpotLightShadowsWithMaps:o.numSpotLightShadowsWithMaps,numLightProbes:o.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:s.dithering,shadowMapEnabled:e.shadowMap.enabled&&c.length>0,shadowMapType:e.shadowMap.type,toneMapping:ge,decodeVideoTexture:B&&!0===s.map.isVideoTexture&&ut.getTransfer(s.map.colorSpace)===Ce,decodeVideoTextureEmissive:j&&!0===s.emissiveMap.isVideoTexture&&ut.getTransfer(s.emissiveMap.colorSpace)===Ce,premultipliedAlpha:s.premultipliedAlpha,doubleSided:2===s.side,flipSided:1===s.side,useDepthPacking:s.depthPacking>=0,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionCl
vendor: 9,071 bytes, line 1
1ipCullDistance:me&&!0===s.extensions.clipCullDistance&&r.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(me&&!0===s.extensions.multiDraw||O)&&r.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:r.has("KHR_parallel_shader_compile"),customProgramCacheKey:s.customProgramCacheKey()};return _e.vertexUv1s=u.has(1),_e.vertexUv2s=u.has(2),_e.vertexUv3s=u.has(3),u.clear(),_e},getProgramCacheKey:function(t){const n=[];if(t.shaderID?n.push(t.shaderID):(n.push(t.customVertexShaderID),n.push(t.customFragmentShaderID)),void 0!==t.defines)for(const e in t.defines)n.push(e),n.push(t.defines[e]);return!1===t.isRawShaderMaterial&&(function(e,t){e.push(t.precision),e.push(t.outputColorSpace),e.push(t.envMapMode),e.push(t.envMapCubeUVHeight),e.push(t.mapUv),e.push(t.alphaMapUv),e.push(t.lightMapUv),e.push(t.aoMapUv),e.push(t.bumpMapUv),e.push(t.normalMapUv),e.push(t.displacementMapUv),e.push(t.emissiveMapUv),e.push(t.metalnessMapUv),e.push(t.roughnessMapUv),e.push(t.anisotropyMapUv),e.push(t.clearcoatMapUv),e.push(t.clearcoatNormalMapUv),e.push(t.clearcoatRoughnessMapUv),e.push(t.iridescenceMapUv),e.push(t.iridescenceThicknessMapUv),e.push(t.sheenColorMapUv),e.push(t.sheenRoughnessMapUv),e.push(t.specularMapUv),e.push(t.specularColorMapUv),e.push(t.specularIntensityMapUv),e.push(t.transmissionMapUv),e.push(t.thicknessMapUv),e.push(t.combine),e.push(t.fogExp2),e.push(t.sizeAttenuation),e.push(t.morphTargetsCount),e.push(t.morphAttributeCount),e.push(t.numDirLights),e.push(t.numPointLights),e.push(t.numSpotLights),e.push(t.numSpotLightMaps),e.push(t.numHemiLights),e.push(t.numRectAreaLights),e.push(t.numDirLightShadows),e.push(t.numPointLightShadows),e.push(t.numSpotLightShadows),e.push(t.numSpotLightShadowsWithMaps),e.push(t.numLightProbes),e.push(t.shadowMapType),e.push(t.toneMapping),e.push(t.numClippingPlanes),e.push(t.numClipIntersection),e.push(t.depthPacking)}(n,t),function(e,t){o.disableAll(),t.supportsVertexTextures&&o.enable(0),t.instancing&&o.enable(1),t.instancingColor&&o.enable(2),t.instancingMorph&&o.enable(3),t.matcap&&o.enable(4),t.envMap&&o.enable(5),t.normalMapObjectSpace&&o.enable(6),t.normalMapTangentSpace&&o.enable(7),t.clearcoat&&o.enable(8),t.iridescence&&o.enable(9),t.alphaTest&&o.enable(10),t.vertexColors&&o.enable(11),t.vertexAlphas&&o.enable(12),t.vertexUv1s&&o.enable(13),t.vertexUv2s&&o.enable(14),t.vertexUv3s&&o.enable(15),t.vertexTangents&&o.enable(16),t.anisotropy&&o.enable(17),t.alphaHash&&o.enable(18),t.batching&&o.enable(19),t.dispersion&&o.enable(20),t.batchingColor&&o.enable(21),e.push(o.mask),o.disableAll(),t.fog&&o.enable(0),t.useFog&&o.enable(1),t.flatShading&&o.enable(2),t.logarithmicDepthBuffer&&o.enable(3),t.reverseDepthBuffer&&o.enable(4),t.skinning&&o.enable(5),t.morphTargets&&o.enable(6),t.morphNormals&&o.enable(7),t.morphColors&&o.enable(8),t.premultipliedAlpha&&o.enable(9),t.shadowMapEnabled&&o.enable(10),t.doubleSided&&o.enable(11),t.flipSided&&o.enable(12),t.useDepthPacking&&o.enable(13),t.dithering&&o.enable(14),t.transmission&&o.enable(15),t.sheen&&o.enable(16),t.opaque&&o.enable(17),t.pointsUvs&&o.enable(18),t.decodeVideoTexture&&o.enable(19),t.decodeVideoTextureEmissive&&o.enable(20),t.alphaToCoverage&&o.enable(21),e.push(o.mask)}(n,t),n.push(e.outputColorSpace)),n.push(t.customProgramCacheKey),n.join()},getUniforms:function(e){const t=f[e.type];let n;if(t){const e=Sa[t];n=Nr.clone(e.uniforms)}else n=e.uniforms;return n},acquireProgram:function(t,n){let r;for(let e=0,t=c.length;e<t;e++){const t=c[e];if(t.cacheKey===n){r=t,++r.usedTimes;break}}return void 0===r&&(r=new Cl(e,n,t,s),c.push(r)),r},releaseProgram:function(e){if(0==--e.usedTimes){const t=c.indexOf(e);c[t]=c[c.length-1],c.pop(),e.destroy()}},releaseShaderCache:function(e){l.remove(e)},programs:c,dispose:function(){l.dispose()}}}function Ll(){let e=new WeakMap;return{has:function(t){return e.has(t)},get:function(t){let n=e.get(t);return void 0===n&&(n={},e.set(t,n)),n},remove:function(t){e.delete(t)},update:function(t,n,r){e.get(t)[n]=r},dispose:function(){e=new WeakMap}}}function Il(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.material.id!==t.material.id?e.material.id-t.material.id:e.z!==t.z?e.z-t.z:e.id-t.id}function Ol(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function Bl(){const e=[];let t=0;const n=[],r=[],i=[];function s(n,r,i,s,a,o){let l=e[t];return void 0===l?(l={id:n.id,object:n,geometry:r,material:i,groupOrder:s,renderOrder:n.renderOrder,z:a,group:o},e[t]=l):(l.id=n.id,l.object=n,l.geometry=r,l.material=i,l.groupOrder=s,l.renderOrder=n.renderOrder,l.z=a,l.group=o),t++,l}return{opaque:n,transmissive:r,transparent:i,init:function(){t=0,n.length=0,r.length=0,i.length=0},push:function(e,t,a,o,l,u){const c=s(e,t,a,o,l,u);a.transmission>0?r.push(c):!0===a.transparent?i.push(c):n.push(c)},unshift:function(e,t,a,o,l,u){const c=s(e,t,a,o,l,u);a.transmission>0?r.unshift(c):!0===a.transparent?i.unshift(c):n.unshift(c)},finish:function(){for(let n=t,r=e.length;n<r;n++){const t=e[n];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.group=null}},sort:function(e,t){n.length>1&&n.sort(e||Il),r.length>1&&r.sort(t||Ol),i.length>1&&i.sort(t||Ol)}}}function Ul(){let e=new WeakMap;return{get:function(t,n){const r=e.get(t);let i;return void 0===r?(i=new Bl,e.set(t,[i])):n>=r.length?(i=new Bl,r.push(i)):i=r[n],i},dispose:function(){e=new WeakMap}}}function Fl(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":n={direction:new Ke,color:new Gn};break;case"SpotLight":n={position:new Ke,direction:new Ke,color:new Gn,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Ke,color:new Gn,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Ke,skyColor:new Gn,groundColor:new Gn};break;case"RectAreaLight":n={color:new Gn,position:new Ke,halfWidth:new Ke,halfHeight:new Ke}}return e[t.id]=n,n}}}let kl=0;function ql(e,t){return(t.castShadow?2:0)-(e.castShadow?2:0)+(t.map?1:0)-(e.map?1:0)}function Vl(e){const t=new Fl,n=function(){const e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];let n;switch(t.type){case"DirectionalLight":case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ye};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ye,shadowCameraNear:1,shadowCameraFar:1e3}}return e[t.id]=n,n}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let e=0;e<9;e++)r.probe.push(new Ke);const i=new Ke,s=new $t,a=new $t;return{setup:function(i){let s=0,a=0,o=0;for(let e=0;e<9;e++)r.probe[e].set(0,0,0);let l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0;i.sort(ql);for(let e=0,v=i.length;e<v;e++){const v=i[e],y=v.color,x=v.intensity,b=v.distance,w=v.shadow&&v.shadow.map?v.shadow.map.texture:null;if(v.isAmbientLight)s+=y.r*x,a+=y.g*x,o+=y.b*x;else if(v.isLightProbe){for(let e=0;e<9;e++)r.probe[e].addScaledVector(v.sh.coefficients[e],x);_++}else if(v.isDirectionalLight){const e=t.get(v);if(e.color.copy(v.color).multiplyScalar(v.intensity),v.castShadow){const e=v.shadow,t=n.get(v);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.normalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,r.directionalShadow[l]=t,r.directionalShadowMap[l]=w,r.directionalShadowMatrix[l]=v.shadow.matrix,d++}r.directional[l]=e,l++}else if(v.isSpotLight){const e=t.get(v);e.position.setFromMatrixPosition(v.matrixWorld),e.color.copy(y).multiplyScalar(x),e.distance=b,e.coneCos=Math.cos(v.angle),e.penumbraCos=Math.cos(v.angle*(1-v.penumbra)),e.decay=v.decay,r.spot[c]=e;const i=v.shadow;if(v.map&&(r.spotLightMap[m]=v.map,m++,i.updateMatrices(v),v.castShadow&&g++),r.spotLightMatrix[c]=i.matrix,v.castShadow){const e=n.get(v);e.shadowIntensity=i.intensity,e.shadowBias=i.bias,e.shadowNormalBias=i.normalBias,e.shadowRadius=i.radius,e.shadowMapSize=i.mapSize,r.spotShadow[c]=e,r.spotShadowMap[c]=w,f++}c++}else if(v.isRectAreaLight){const e=t.get(v);e.color.copy(y).multiplyScalar(x),e.halfWidth.set(.5*v.width,0,0),e.halfHeight.set(0,.5*v.height,0),r.rectArea[h]=e,h++}else if(v.isPointLight){const e=t.get(v);if(e.color.copy(v.color).multiplyScalar(v.intensity),e.distance=v.distance,e.decay=v.decay,v.castShadow){const e=v.shadow,t=n.get(v);t.shadowIntensity=e.intensity,t.shadowBias=e.bias,t.shadowNormalBias=e.n
vendor: 21,887 bytes, line 1
1ormalBias,t.shadowRadius=e.radius,t.shadowMapSize=e.mapSize,t.shadowCameraNear=e.camera.near,t.shadowCameraFar=e.camera.far,r.pointShadow[u]=t,r.pointShadowMap[u]=w,r.pointShadowMatrix[u]=v.shadow.matrix,p++}r.point[u]=e,u++}else if(v.isHemisphereLight){const e=t.get(v);e.skyColor.copy(v.color).multiplyScalar(x),e.groundColor.copy(v.groundColor).multiplyScalar(x),r.hemi[A]=e,A++}}h>0&&(!0===e.has("OES_texture_float_linear")?(r.rectAreaLTC1=Ta.LTC_FLOAT_1,r.rectAreaLTC2=Ta.LTC_FLOAT_2):(r.rectAreaLTC1=Ta.LTC_HALF_1,r.rectAreaLTC2=Ta.LTC_HALF_2)),r.ambient[0]=s,r.ambient[1]=a,r.ambient[2]=o;const v=r.hash;v.directionalLength===l&&v.pointLength===u&&v.spotLength===c&&v.rectAreaLength===h&&v.hemiLength===A&&v.numDirectionalShadows===d&&v.numPointShadows===p&&v.numSpotShadows===f&&v.numSpotMaps===m&&v.numLightProbes===_||(r.directional.length=l,r.spot.length=c,r.rectArea.length=h,r.point.length=u,r.hemi.length=A,r.directionalShadow.length=d,r.directionalShadowMap.length=d,r.pointShadow.length=p,r.pointShadowMap.length=p,r.spotShadow.length=f,r.spotShadowMap.length=f,r.directionalShadowMatrix.length=d,r.pointShadowMatrix.length=p,r.spotLightMatrix.length=f+m-g,r.spotLightMap.length=m,r.numSpotLightShadowsWithMaps=g,r.numLightProbes=_,v.directionalLength=l,v.pointLength=u,v.spotLength=c,v.rectAreaLength=h,v.hemiLength=A,v.numDirectionalShadows=d,v.numPointShadows=p,v.numSpotShadows=f,v.numSpotMaps=m,v.numLightProbes=_,r.version=kl++)},setupView:function(e,t){let n=0,o=0,l=0,u=0,c=0;const h=t.matrixWorldInverse;for(let t=0,A=e.length;t<A;t++){const A=e[t];if(A.isDirectionalLight){const e=r.directional[n];e.direction.setFromMatrixPosition(A.matrixWorld),i.setFromMatrixPosition(A.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(h),n++}else if(A.isSpotLight){const e=r.spot[l];e.position.setFromMatrixPosition(A.matrixWorld),e.position.applyMatrix4(h),e.direction.setFromMatrixPosition(A.matrixWorld),i.setFromMatrixPosition(A.target.matrixWorld),e.direction.sub(i),e.direction.transformDirection(h),l++}else if(A.isRectAreaLight){const e=r.rectArea[u];e.position.setFromMatrixPosition(A.matrixWorld),e.position.applyMatrix4(h),a.identity(),s.copy(A.matrixWorld),s.premultiply(h),a.extractRotation(s),e.halfWidth.set(.5*A.width,0,0),e.halfHeight.set(0,.5*A.height,0),e.halfWidth.applyMatrix4(a),e.halfHeight.applyMatrix4(a),u++}else if(A.isPointLight){const e=r.point[o];e.position.setFromMatrixPosition(A.matrixWorld),e.position.applyMatrix4(h),o++}else if(A.isHemisphereLight){const e=r.hemi[c];e.direction.setFromMatrixPosition(A.matrixWorld),e.direction.transformDirection(h),c++}}},state:r}}function zl(e){const t=new Vl(e),n=[],r=[],i={lightsArray:n,shadowsArray:r,camera:null,lights:t,transmissionRenderTarget:{}};return{init:function(e){i.camera=e,n.length=0,r.length=0},state:i,setupLights:function(){t.setup(n)},setupLightsView:function(e){t.setupView(n,e)},pushLight:function(e){n.push(e)},pushShadow:function(e){r.push(e)}}}function Gl(e){let t=new WeakMap;return{get:function(n,r=0){const i=t.get(n);let s;return void 0===i?(s=new zl(e),t.set(n,[s])):r>=i.length?(s=new zl(e),i.push(s)):s=i[r],s},dispose:function(){t=new WeakMap}}}function jl(e,t,n){let r=new ni;const i=new Ye,s=new Ye,a=new vt,o=new Ls({depthPacking:3201}),l=new Is,u={},c=n.maxTextureSize,h={0:1,1:0,2:2},A=new Pr({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ye},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),d=A.clone();d.defines.HORIZONTAL_PASS=1;const p=new Ar;p.setAttribute("position",new er(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const f=new Tr(p,A),m=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=1;let g=this.type;function v(n,r){const s=t.update(f);A.defines.VSM_SAMPLES!==n.blurSamples&&(A.defines.VSM_SAMPLES=n.blurSamples,d.defines.VSM_SAMPLES=n.blurSamples,A.needsUpdate=!0,d.needsUpdate=!0),null===n.mapPass&&(n.mapPass=new xt(i.x,i.y)),A.uniforms.shadow_pass.value=n.map.texture,A.uniforms.resolution.value=n.mapSize,A.uniforms.radius.value=n.radius,e.setRenderTarget(n.mapPass),e.clear(),e.renderBufferDirect(r,null,s,A,f,null),d.uniforms.shadow_pass.value=n.mapPass.texture,d.uniforms.resolution.value=n.mapSize,d.uniforms.radius.value=n.radius,e.setRenderTarget(n.map),e.clear(),e.renderBufferDirect(r,null,s,d,f,null)}function y(t,n,r,i){let s=null;const a=!0===r.isPointLight?t.customDistanceMaterial:t.customDepthMaterial;if(void 0!==a)s=a;else if(s=!0===r.isPointLight?l:o,e.localClippingEnabled&&!0===n.clipShadows&&Array.isArray(n.clippingPlanes)&&0!==n.clippingPlanes.length||n.displacementMap&&0!==n.displacementScale||n.alphaMap&&n.alphaTest>0||n.map&&n.alphaTest>0||!0===n.alphaToCoverage){const e=s.uuid,t=n.uuid;let r=u[e];void 0===r&&(r={},u[e]=r);let i=r[t];void 0===i&&(i=s.clone(),r[t]=i,n.addEventListener("dispose",b)),s=i}return s.visible=n.visible,s.wireframe=n.wireframe,s.side=3===i?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:h[n.side],s.alphaMap=n.alphaMap,s.alphaTest=!0===n.alphaToCoverage?.5:n.alphaTest,s.map=n.map,s.clipShadows=n.clipShadows,s.clippingPlanes=n.clippingPlanes,s.clipIntersection=n.clipIntersection,s.displacementMap=n.displacementMap,s.displacementScale=n.displacementScale,s.displacementBias=n.displacementBias,s.wireframeLinewidth=n.wireframeLinewidth,s.linewidth=n.linewidth,!0===r.isPointLight&&!0===s.isMeshDistanceMaterial&&(e.properties.get(s).light=r),s}function x(n,i,s,a,o){if(!1===n.visible)return;if(n.layers.test(i.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&3===o)&&(!n.frustumCulled||r.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,n.matrixWorld);const r=t.update(n),l=n.material;if(Array.isArray(l)){const t=r.groups;for(let u=0,c=t.length;u<c;u++){const c=t[u],h=l[c.materialIndex];if(h&&h.visible){const t=y(n,h,a,o);n.onBeforeShadow(e,n,i,s,r,t,c),e.renderBufferDirect(s,null,r,t,n,c),n.onAfterShadow(e,n,i,s,r,t,c)}}}else if(l.visible){const t=y(n,l,a,o);n.onBeforeShadow(e,n,i,s,r,t,null),e.renderBufferDirect(s,null,r,t,n,null),n.onAfterShadow(e,n,i,s,r,t,null)}}const l=n.children;for(let e=0,t=l.length;e<t;e++)x(l[e],i,s,a,o)}function b(e){e.target.removeEventListener("dispose",b);for(const t in u){const n=u[t],r=e.target.uuid;r in n&&(n[r].dispose(),delete n[r])}}this.render=function(t,n,o){if(!1===m.enabled)return;if(!1===m.autoUpdate&&!1===m.needsUpdate)return;if(0===t.length)return;const l=e.getRenderTarget(),u=e.getActiveCubeFace(),h=e.getActiveMipmapLevel(),A=e.state;A.setBlending(0),A.buffers.color.setClear(1,1,1,1),A.buffers.depth.setTest(!0),A.setScissorTest(!1);const d=3!==g&&3===this.type,p=3===g&&3!==this.type;for(let l=0,u=t.length;l<u;l++){const u=t[l],h=u.shadow;if(void 0===h)continue;if(!1===h.autoUpdate&&!1===h.needsUpdate)continue;i.copy(h.mapSize);const f=h.getFrameExtents();if(i.multiply(f),s.copy(h.mapSize),(i.x>c||i.y>c)&&(i.x>c&&(s.x=Math.floor(c/f.x),i.x=s.x*f.x,h.mapSize.x=s.x),i.y>c&&(s.y=Math.floor(c/f.y),i.y=s.y*f.y,h.mapSize.y=s.y)),null===h.map||!0===d||!0===p){const e=3!==this.type?{minFilter:_,magFilter:_}:{};null!==h.map&&h.map.dispose(),h.map=new xt(i.x,i.y,e),h.map.texture.name=u.name+".shadowMap",h.camera.updateProjectionMatrix()}e.setRenderTarget(h.map),e.clear();const m=h.getViewportCount();for(let e=0;e<m;e++){const t=h.getViewport(e);a.set(s.x*t.x,s.y*t.y,s.x*t.z,s.y*t.w),A.viewport(a),h.updateMatrices(u,e),r=h.getFrustum(),x(n,o,h.camera,u,this.type)}!0!==h.isPointLightShadow&&3===this.type&&v(h,o),h.needsUpdate=!1}g=this.type,m.needsUpdate=!1,e.setRenderTarget(l,u,h)}}const Hl={0:1,2:6,4:7,3:5,1:0,6:2,7:4,5:3};function Wl(e,t){const n=new function(){let t=!1;const n=new vt;let r=null;const i=new vt(0,0,0,0);return{setMask:function(n){r===n||t||(e.colorMask(n,n,n,n),r=n)},setLocked:function(e){t=e},setClear:function(t,r,s,a,o){!0===o&&(t*=a,r*=a,s*=a),n.set(t,r,s,a),!1===i.equals(n)&&(e.clearColor(t,r,s,a),i.copy(n))},reset:function(){t=!1,r=null,i.set(-1,0,0,0)}}},r=new function(){let n=!1,r=!1,i=null,s=null,a=null;return{setReversed:function(e){if(r!==e){const n=t.get("EXT_clip_control");e?n.clipControlEXT(n.LOWER_LEFT_EXT,n.ZERO_TO_ONE_EXT):n.clipControlEXT(n.LOWER_LEFT_EXT,n.NEGATIVE_ONE_TO_ONE_EXT),r=e;const i=a;a=null,this.setClear(i)}},getReversed:function(){return r},setTest:function(t){t?j(e.DEPTH_TEST):H(e.DEPTH_TEST)},setMask:function(t){i===t||n||(e.depthMask(t),i=t)},setFunc:function(t){if(r&&(t=Hl[t]),s!==t){switch(t){case 0:e.depthFunc(e.NEVER);break;case 1:e.depthFunc(e.ALWAYS);break;case 2:e.depthFunc(e.LESS);break;case 3:default:e.depthFunc(e.LEQUAL);break;case 4:e.depthFunc(e.EQUAL);break;case 5:e.depthFunc(e.GEQUAL);break;case 6:e.depthFunc(e.GREATER);break;case 7:e.depthFunc(e.NOTEQUAL)}s=t}},setLocked:function(e){n=e},setClear:function(t){a!==t&&(r&&(t=1-t),e.clearDepth(t),a=t)},reset:function(){n=!1,i=null,s=null,a=null,r=!1}}},i=new function(){let t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,u=null;return{setTest:function(n){t||(n?j(e.STENCIL_TEST):H(e.STENCIL_TEST))},setMask:function(r){n===r||t||(e.stencilMask(r),n=r)},setFunc:function(t,n,a){r===t&&i===n&&s===a||(e.stencilFunc(t,n,a),r=t,i=n,s=a)},setOp:function(t,n,r){a===t&&o===n&&l===r||(e.stencilOp(t,n,r),a=t,o=n,l=r)},setLocked:function(e){t=e},setClear:function(t){u!==t&&(e.clearStencil(t),u=t)},reset:function(){t=!1,n=null,r=null,i=null,s=null,a=null,o=null,l=null,u=null}}},s=new WeakMap,c=new WeakMap;let h={},A={},d=new WeakMap,p=[],f=null,m=!1,g=null,_=null,v=null,y=null,x=null,b=null,w=null,T=new Gn(0,0,0),S=0,M=!1,E=null,C=null,R=null,N=null,P=null;const D=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let L=!1,I=0;const O=e.getParameter(e.VERSION);-1!==O.indexOf("WebGL")?(I=parseFloat(/^WebGL (\d)/.exec(O)[1]),L=I>=1):-1!==O.indexOf("OpenGL ES")&&(I=parseFloat(/^OpenGL ES (\d)/.exec(O)[1]),L=I>=2);let B=null,U={};const F=e.getParameter(e.SCISSOR_BOX),k=e.getParameter(e.VIEWPORT),q=(new vt).fromArray(F),V=(new vt).fromArray(k);function z(t,n,r,i){const s=new Uint8Array(4),a=e.createTexture();e.bindTexture(t,a),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(let a=0;a<r;a++)t===e.TEXTURE_3D||t===e.TEXTURE_2D_ARRAY?e.texImage3D(n,0,e.RGBA,1,1,i,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(n+a,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,s);return a}const G={};function j(t){!0!==h[t]&&(e.enable(t),h[t]=!0)}function H(t){!1!==h[t]&&(e.disable(t),h[t]=!1)}G[e.TEXTURE_2D]=z(e.TEXTURE_2D,e.TEXTURE_2D,1),G[e.TEXTURE_CUBE_MAP]=z(e.TEXTURE_CUBE_MAP,e.TEXTURE_CUBE_MAP_POSITIVE_X,6),G[e.TEXTURE_2D_ARRAY]=z(e.TEXTURE_2D_ARRAY,e.TEXTURE_2D_ARRAY,1,1),G[e.TEXTURE_3D]=z(e.TEXTURE_3D,e.TEXTURE_3D,1,1),n.setClear(0,0,0,1),r.setClear(1),i.setClear(0),j(e.DEPTH_TEST),r.setFunc(3),Y(!1),$(1),j(e.CULL_FACE),Q(0);const W={[a]:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT};W[103]=e.MIN,W[104]=e.MAX;const X={[o]:e.ZERO,201:e.ONE,202:e.SRC_COLOR,[l]:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,[u]:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA,211:e.CONSTANT_COLOR,212:e.ONE_MINUS_CONSTANT_COLOR,213:e.CONSTANT_ALPHA,214:e.ONE_MINUS_CONSTANT_ALPHA};function Q(t,n,r,i,s,o,l,u,c,h){if(0!==t){if(!1===m&&(j(e.BLEND),m=!0),5===t)s=s||n,o=o||r,l=l||i,n===_&&s===x||(e.blendEquationSeparate(W[n],W[s]),_=n,x=s),r===v&&i===y&&o===b&&l===w||(e.blendFuncSeparate(X[r],X[i],X[o],X[l]),v=r,y=i,b=o,w=l),!1!==u.equals(T)&&c===S||(e.blendColor(u.r,u.g,u.b,c),T.copy(u),S=c),g=t,M=!1;else if(t!==g||h!==M){if(_===a&&x===a||(e.blendEquation(e.FUNC_ADD),_=a,x=a),h)switch(t){case 1:e.blendFuncSeparate(e.ONE,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.ONE,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFuncSeparate(e.ZERO,e.SRC_COLOR,e.ZERO,e.SRC_ALPHA);break;default:}else switch(t){case 1:e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA);break;case 2:e.blendFunc(e.SRC_ALPHA,e.ONE);break;case 3:e.blendFuncSeparate(e.ZERO,e.ONE_MINUS_SRC_COLOR,e.ZERO,e.ONE);break;case 4:e.blendFunc(e.ZERO,e.SRC_COLOR);break;default:}v=null,y=null,b=null,w=null,T.set(0,0,0),S=0,g=t,M=h}}else!0===m&&(H(e.BLEND),m=!1)}function Y(t){E!==t&&(t?e.frontFace(e.CW):e.frontFace(e.CCW),E=t)}function $(t){0!==t?(j(e.CULL_FACE),t!==C&&(1===t?e.cullFace(e.BACK):2===t?e.cullFace(e.FRONT):e.cullFace(e.FRONT_AND_BACK))):H(e.CULL_FACE),C=t}function K(t,n,r){t?(j(e.POLYGON_OFFSET_FILL),N===n&&P===r||(e.polygonOffset(n,r),N=n,P=r)):H(e.POLYGON_OFFSET_FILL)}return{buffers:{color:n,depth:r,stencil:i},enable:j,disable:H,bindFramebuffer:function(t,n){return A[t]!==n&&(e.bindFramebuffer(t,n),A[t]=n,t===e.DRAW_FRAMEBUFFER&&(A[e.FRAMEBUFFER]=n),t===e.FRAMEBUFFER&&(A[e.DRAW_FRAMEBUFFER]=n),!0)},drawBuffers:function(t,n){let r=p,i=!1;if(t){r=d.get(n),void 0===r&&(r=[],d.set(n,r));const s=t.textures;if(r.length!==s.length||r[0]!==e.COLOR_ATTACHMENT0){for(let t=0,n=s.length;t<n;t++)r[t]=e.COLOR_ATTACHMENT0+t;r.length=s.length,i=!0}}else r[0]!==e.BACK&&(r[0]=e.BACK,i=!0);i&&e.drawBuffers(r)},useProgram:function(t){return f!==t&&(e.useProgram(t),f=t,!0)},setBlending:Q,setMaterial:function(t,s){2===t.side?H(e.CULL_FACE):j(e.CULL_FACE);let a=1===t.side;s&&(a=!a),Y(a),1===t.blending&&!1===t.transparent?Q(0):Q(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.blendColor,t.blendAlpha,t.premultipliedAlpha),r.setFunc(t.depthFunc),r.setTest(t.depthTest),r.setMask(t.depthWrite),n.setMask(t.colorWrite);const o=t.stencilWrite;i.setTest(o),o&&(i.setMask(t.stencilWriteMask),i.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),i.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),K(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?j(e.SAMPLE_ALPHA_TO_COVERAGE):H(e.SAMPLE_ALPHA_TO_COVERAGE)},setFlipSided:Y,setCullFace:$,setLineWidth:function(t){t!==R&&(L&&e.lineWidth(t),R=t)},setPolygonOffset:K,setScissorTest:function(t){t?j(e.SCISSOR_TEST):H(e.SCISSOR_TEST)},activeTexture:function(t){void 0===t&&(t=e.TEXTURE0+D-1),B!==t&&(e.activeTexture(t),B=t)},bindTexture:function(t,n,r){void 0===r&&(r=null===B?e.TEXTURE0+D-1:B);let i=U[r];void 0===i&&(i={type:void 0,texture:void 0},U[r]=i),i.type===t&&i.texture===n||(B!==r&&(e.activeTexture(r),B=r),e.bindTexture(t,n||G[t]),i.type=t,i.texture=n)},unbindTexture:function(){const t=U[B];void 0!==t&&void 0!==t.type&&(e.bindTexture(t.type,null),t.type=void 0,t.texture=void 0)},compressedTexImage2D:function(){try{e.compressedTexImage2D(...arguments)}catch(e){}},compressedTexImage3D:function(){try{e.compressedTexImage3D(...arguments)}catch(e){}},texImage2D:function(){try{e.texImage2D(...arguments)}catch(e){}},texImage3D:function(){try{e.texImage3D(...arguments)}catch(e){}},updateUBOMapping:function(t,n){let r=c.get(n);void 0===r&&(r=new WeakMap,c.set(n,r));let i=r.get(t);void 0===i&&(i=e.getUniformBlockIndex(n,t.name),r.set(t,i))},uniformBlockBinding:function(t,n){const r=c.get(n).get(t);s.get(n)!==r&&(e.uniformBlockBinding(n,r,t.__bindingPointIndex),s.set(n,r))},texStorage2D:function(){try{e.texStorage2D(...arguments)}catch(e){}},texStorage3D:function(){try{e.texStorage3D(...arguments)}catch(e){}},texSubImage2D:function(){try{e.texSubImage2D(...arguments)}catch(e){}},texSubImage3D:function(){try{e.texSubImage3D(...arguments)}catch(e){}},compressedTexSubImage2D:function(){try{e.compressedTexSubImage2D(...arguments)}catch(e){}},compressedTexSubImage3D:function(){try{e.compressedTexSubImage3D(...arguments)}catch(e){}},scissor:function(t){!1===q.equals(t)&&(e.scissor(t.x,t.y,t.z,t.w),q.copy(t))},viewport:function(t){!1===V.equals(t)&&(e.viewport(t.x,t.y,t.z,t.w),V.copy(t))},reset:function(){e.disable(e.BLEND),e.disable(e.CULL_FACE),e.disable(e.DEPTH_TEST),e.disable(e.POLYGON_OFFSET_FILL),e.disable(e.SCISSOR_TEST),e.disable(e.STENCIL_TEST),e.disable(e.SAMPLE_ALPHA_TO_COVERAGE),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ZERO),e.blendFuncSeparate(e.ONE,e.ZERO,e.ONE,e.ZERO),e.blendColor(0,0,0,0),e.colorMask(!0,!0,!0,!0),e.clearColor(0,0,0,0),e.depthMask(!0),e.depthFunc(e.LESS),r.setReversed(!1),e.clearDepth(1),e.stencilMask(4294967295),e.stencilFunc(e.ALWAYS,0,4294967295),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.clearStencil(0),e.cullFace(e.BACK),e.frontFace(e.CCW),e.polygonOffset(0,0),e.activeTexture(e.TEXTURE0),e.bindFramebuffer(e.FRAMEBUFFER,null),e.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),e.bindFramebuffer(e.READ_FRAMEBUFFER,null),e.useProgram(null),e.lineWidth(1),e.scissor(0,0,e.canvas.width,e.canvas.height),e.viewport(0,0,e.canvas.width,e.canvas.height),h={},B=null,U={},A={},d=new WeakMap,p=[],f=null,m=!1,g=null,_=null,v=null,y=null,x=null,b=null,w=null,T=new Gn(0,0,0),S=0,M=!1,E=null,C=null,R=null,N=null,P=null,q.set(0,0,e.canvas.width,e.canvas.height),V.set(0,0,e.canvas.width,e.canvas.height),n.reset(),r.reset(),i.reset()}}}function Xl(e,t,n,r,i,s,a){const o=t.has("WEBGL_multisampled_render_to_texture")?t.get("WEBGL_multisampled_render_to_texture"):null,l="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),u=new Ye,c=new WeakMap;let h;const A=new WeakMap;let d=!1;try{d="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(e){}function p(e,t){return d?new OffscreenCanvas(e,t):rt("canvas")}function T(e,t,n){let r=1;const i=se(e);if((i.width>n||i.height>n)&&(r=n/Math.max(i.width,i.height)),r<1){if("undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof VideoFrame&&e instanceof VideoFrame){const n=Math.floor(r*i.width),s=Math.floor(r*i.height);void 0===h&&(h=p(n,s));const a=t?p(n,s):h;return a.width=n,a.height=s,a.getContext("2d").drawImage(e,0,0,n,s),a}return e}return e}function S(e){return e.generateMipmaps}function M(t){e.generateMipmap(t)}function C(t){return t.isWebGLCubeRenderTarget?e.TEXTURE_CUBE_MAP:t.isWebGL3DRenderTarget?e.TEXTURE_3D:t.isWebGLArrayRenderTarget||t.isCompressedArrayTexture?e.TEXTURE_2D_ARRAY:e.TEXTURE_2D}function P(n,r,i,s,a=!1){if(null!==n&&void 0!==e[n])return e[n];let o=r;if(r===e.RED&&(i===e.FLOAT&&(o=e.R32F),i===e.HALF_FLOAT&&(o=e.R16F),i===e.UNSIGNED_BYTE&&(o=e.R8)),r===e.RED_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.R8UI),i===e.UNSIGNED_SHORT&&(o=e.R16UI),i===e.UNSIGNED_INT&&(o=e.R32UI),i===e.BYTE&&(o=e.R8I),i===e.SHORT&&(o=e.R16I),i===e.INT&&(o=e.R32I)),r===e.RG&&(i===e.FLOAT&&(o=e.RG32F),i===e.HALF_FLOAT&&(o=e.RG16F),i===e.UNSIGNED_BYTE&&(o=e.RG8)),r===e.RG_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RG8UI),i===e.UNSIGNED_SHORT&&(o=e.RG16UI),i===e.UNSIGNED_INT&&(o=e.RG32UI),i===e.BYTE&&(o=e.RG8I),i===e.SHORT&&(o=e.RG16I),i===e.INT&&(o=e.RG32I)),r===e.RGB_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGB8UI),i===e.UNSIGNED_SHORT&&(o=e.RGB16UI),i===e.UNSIGNED_INT&&(o=e.RGB32UI),i===e.BYTE&&(o=e.RGB8I),i===e.SHORT&&(o=e.RGB16I),i===e.INT&&(o=e.RGB32I)),r===e.RGBA_INTEGER&&(i===e.UNSIGNED_BYTE&&(o=e.RGBA8UI),i===e.UNSIGNED_SHORT&&(o=e.RGBA16UI),i===e.UNSIGNED_INT&&(o=e.RGBA32UI),i===e.BYTE&&(o=e.RGBA8I),i===e.SHORT&&(o=e.RGBA16I),i===e.INT&&(o=e.RGBA32I)),r===e.RGB&&i===e.UNSIGNED_INT_5_9_9_9_REV&&(o=e.RGB9_E5),r===e.RGBA){const t=a?Ee:ut.getTransfer(s);i===e.FLOAT&&(o=e.RGBA32F),i===e.HALF_FLOAT&&(o=e.RGBA16F),i===e.UNSIGNED_BYTE&&(o=t===Ce?e.SRGB8_ALPHA8:e.RGBA8),i===e.UNSIGNED_SHORT_4_4_4_4&&(o=e.RGBA4),i===e.UNSIGNED_SHORT_5_5_5_1&&(o=e.RGB5_A1)}return o!==e.R16F&&o!==e.R32F&&o!==e.RG16F&&o!==e.RG32F&&o!==e.RGBA16F&&o!==e.RGBA32F||t.get("EXT_color_buffer_float"),o}function D(t,n){let r;return t?null===n||n===R||n===I?r=e.DEPTH24_STENCIL8:n===N?r=e.DEPTH32F_STENCIL8:n===E&&(r=e.DEPTH24_STENCIL8):null===n||n===R||n===I?r=e.DEPTH_COMPONENT24:n===N?r=e.DEPTH_COMPONENT32F:n===E&&(r=e.DEPTH_COMPONENT16),r}function L(e,t){return!0===S(e)||e.isFramebufferTexture&&e.minFilter!==_&&e.minFilter!==x?Math.log2(Math.max(t.width,t.height))+1:void 0!==e.mipmaps&&e.mipmaps.length>0?e.mipmaps.length:e.isCompressedTexture&&Array.isArray(e.image)?t.mipmaps.length:1}function O(e){const t=e.target;t.removeEventListener("dispose",O),function(e){const t=r.get(e);if(void 0===t.__webglInit)return;const n=e.source,i=A.get(n);if(i){const r=i[t.__cacheKey];r.usedTimes--,0===r.usedTimes&&U(e),0===Object.keys(i).length&&A.delete(n)}r.remove(e)}(t),t.isVideoTexture&&c.delete(t)}function B(t){const n=t.target;n.removeEventListener("dispose",B),function(t){const n=r.get(t);if(t.depthTexture&&(t.depthTexture.dispose(),r.remove(t.depthTexture)),t.isWebGLCubeRen
1derTarget)for(let t=0;t<6;t++){if(Array.isArray(n.__webglFramebuffer[t]))for(let r=0;r<n.__webglFramebuffer[t].length;r++)e.deleteFramebuffer(n.__webglFramebuffer[t][r]);else e.deleteFramebuffer(n.__webglFramebuffer[t]);n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer[t])}else{if(Array.isArray(n.__webglFramebuffer))for(let t=0;t<n.__webglFramebuffer.length;t++)e.deleteFramebuffer(n.__webglFramebuffer[t]);else e.deleteFramebuffer(n.__webglFramebuffer);if(n.__webglDepthbuffer&&e.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&e.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer)for(let t=0;t<n.__webglColorRenderbuffer.length;t++)n.__webglColorRenderbuffer[t]&&e.deleteRenderbuffer(n.__webglColorRenderbuffer[t]);n.__webglDepthRenderbuffer&&e.deleteRenderbuffer(n.__webglDepthRenderbuffer)}const i=t.textures;for(let t=0,n=i.length;t<n;t++){const n=r.get(i[t]);n.__webglTexture&&(e.deleteTexture(n.__webglTexture),a.memory.textures--),r.remove(i[t])}r.remove(t)}(n)}function U(t){const n=r.get(t);e.deleteTexture(n.__webglTexture);const i=t.source;delete A.get(i)[n.__cacheKey],a.memory.textures--}let V=0;function z(t,i){const s=r.get(t);if(t.isVideoTexture&&function(e){const t=a.render.frame;c.get(e)!==t&&(c.set(e,t),e.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&s.__version!==t.version){const e=t.image;if(null===e);else if(!1!==e.complete)return void Y(s,t,i)}n.bindTexture(e.TEXTURE_2D,s.__webglTexture,e.TEXTURE0+i)}const G={[f]:e.REPEAT,[m]:e.CLAMP_TO_EDGE,[g]:e.MIRRORED_REPEAT},j={[_]:e.NEAREST,[v]:e.NEAREST_MIPMAP_NEAREST,[y]:e.NEAREST_MIPMAP_LINEAR,[x]:e.LINEAR,[b]:e.LINEAR_MIPMAP_NEAREST,[w]:e.LINEAR_MIPMAP_LINEAR},H={512:e.NEVER,519:e.ALWAYS,[Ne]:e.LESS,[Pe]:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL};function W(n,s){if(s.type!==N||!1!==t.has("OES_texture_float_linear")||s.magFilter!==x&&s.magFilter!==b&&s.magFilter!==y&&s.magFilter!==w&&s.minFilter!==x&&s.minFilter!==b&&s.minFilter!==y&&s.minFilter,e.texParameteri(n,e.TEXTURE_WRAP_S,G[s.wrapS]),e.texParameteri(n,e.TEXTURE_WRAP_T,G[s.wrapT]),n!==e.TEXTURE_3D&&n!==e.TEXTURE_2D_ARRAY||e.texParameteri(n,e.TEXTURE_WRAP_R,G[s.wrapR]),e.texParameteri(n,e.TEXTURE_MAG_FILTER,j[s.magFilter]),e.texParameteri(n,e.TEXTURE_MIN_FILTER,j[s.minFilter]),s.compareFunction&&(e.texParameteri(n,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(n,e.TEXTURE_COMPARE_FUNC,H[s.compareFunction])),!0===t.has("EXT_texture_filter_anisotropic")){if(s.magFilter===_)return;if(s.minFilter!==y&&s.minFilter!==w)return;if(s.type===N&&!1===t.has("OES_texture_float_linear"))return;if(s.anisotropy>1||r.get(s).__currentAnisotropy){const a=t.get("EXT_texture_filter_anisotropic");e.texParameterf(n,a.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,i.getMaxAnisotropy())),r.get(s).__currentAnisotropy=s.anisotropy}}}function X(t,n){let r=!1;void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",O));const i=n.source;let s=A.get(i);void 0===s&&(s={},A.set(i,s));const o=function(e){const t=[];
vendor: 1,046 bytes, line 1
1return t.push(e.wrapS),t.push(e.wrapT),t.push(e.wrapR||0),t.push(e.magFilter),t.push(e.minFilter),t.push(e.anisotropy),t.push(e.internalFormat),t.push(e.format),t.push(e.type),t.push(e.generateMipmaps),t.push(e.premultiplyAlpha),t.push(e.flipY),t.push(e.unpackAlignment),t.push(e.colorSpace),t.join()}(n);if(o!==t.__cacheKey){void 0===s[o]&&(s[o]={texture:e.createTexture(),usedTimes:0},a.memory.textures++,r=!0),s[o].usedTimes++;const i=s[t.__cacheKey];void 0!==i&&(s[t.__cacheKey].usedTimes--,0===i.usedTimes&&U(n)),t.__cacheKey=o,t.__webglTexture=s[o].texture}return r}function Q(e,t,n){return Math.floor(Math.floor(e/n)/t)}function Y(t,a,o){let l=e.TEXTURE_2D;(a.isDataArrayTexture||a.isCompressedArrayTexture)&&(l=e.TEXTURE_2D_ARRAY),a.isData3DTexture&&(l=e.TEXTURE_3D);const u=X(t,a),c=a.source;n.bindTexture(l,t.__webglTexture,e.TEXTURE0+o);const h=r.get(c);if(c.version!==h.__version||!0===u){n.activeTexture(e.TEXTURE0+o);const t=ut.getPrimaries(ut.workingColorSpace),r=a.colorSpace===Te?null:ut.getPrimaries(a.colorSpace),A=a.colorSpace
vendor: 2,466 bytes, line 1
1===Te||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,a.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,a.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,A);let d=T(a.image,!1,i.maxTextureSize);d=ie(a,d);const p=s.convert(a.format,a.colorSpace),f=s.convert(a.type);let m,g=P(a.internalFormat,p,f,a.colorSpace,a.isVideoTexture);W(l,a);const _=a.mipmaps,v=!0!==a.isVideoTexture,y=void 0===h.__version||!0===u,x=c.dataReady,b=L(a,d);if(a.isDepthTexture)g=D(a.format===q,a.type),y&&(v?n.texStorage2D(e.TEXTURE_2D,1,g,d.width,d.height):n.texImage2D(e.TEXTURE_2D,0,g,d.width,d.height,0,p,f,null));else if(a.isDataTexture)if(_.length>0){v&&y&&n.texStorage2D(e.TEXTURE_2D,b,g,_[0].width,_[0].height);for(let t=0,r=_.length;t<r;t++)m=_[t],v?x&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,p,f,m.data):n.texImage2D(e.TEXTURE_2D,t,g,m.width,m.height,0,p,f,m.data);a.generateMipmaps=!1}else v?(y&&n.texStorage2D(e.TEXTURE_2D,b,g,d.width,d.height),x&&function(t,r,i,s){const a=t.updateRanges;if(0===a.length)n.texSubImage2D(e.TEXTURE_2D,0,0,0,r.width,r.height,i,s,r.data);else{a.sort(((e,t)=>e.start-t.start));let o=0;for(let e=1;e<a.length;e++){const t=a[o],n=a[e],i=t.start+t.count,s=Q(n.start,r.width,4),l=Q(t.start,r.width,4);n.start<=i+1&&s===l&&Q(n.start+n.count-1,r.width,4)===s?t.count=Math.max(t.count,n.start+n.count-t.start):(++o,a[o]=n)}a.length=o+1;const l=e.getParameter(e.UNPACK_ROW_LENGTH),u=e.getParameter(e.UNPACK_SKIP_PIXELS),c=e.getParameter(e.UNPACK_SKIP_ROWS);e.pixelStorei(e.UNPACK_ROW_LENGTH,r.width);for(let t=0,o=a.length;t<o;t++){const o=a[t],l=Math.floor(o.start/4),u=Math.ceil(o.count/4),c=l%r.width,h=Math.floor(l/r.width),A=u,d=1;e.pixelStorei(e.UNPACK_SKIP_PIXELS,c),e.pixelStorei(e.UNPACK_SKIP_ROWS,h),n.texSubImage2D(e.TEXTURE_2D,0,c,h,A,d,i,s,r.data)}t.clearUpdateRanges(),e.pixelStorei(e.UNPACK_ROW_LENGTH,l),e.pixelStorei(e.UNPACK_SKIP_PIXELS,u),e.pixelStorei(e.UNPACK_SKIP_ROWS,c)}}(a,d,p,f)):n.texImage2D(e.TEXTURE_2D,0,g,d.width,d.height,0,p,f,d.data);else if(a.isCompressedTexture)if(a.isCompressedArrayTexture){v&&y&&n.texStorage3D(e.TEXTURE_2D_ARRAY,b,g,_[0].width,_[0].height,d.depth);for(let t=0,r=_.length;t<r;t++)if(m=_[t],a.format!==F){if(null!==p)if(v){if(x)if(a.layerUpdates.size>0){const r=ya(m.width,m.height,a.format,a.type);for(const i of a.layerUpdates){const s=m.data.subarray(i*r/m.data.BYTES_PER_ELEMENT,(i+1)
vendor: 5,023 bytes, line 1
1*r/m.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,i,m.width,m.height,1,p,s)}a.clearLayerUpdates()}else n.compressedTexSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,d.depth,p,m.data)}else n.compressedTexImage3D(e.TEXTURE_2D_ARRAY,t,g,m.width,m.height,d.depth,0,m.data,0,0)}else v?x&&n.texSubImage3D(e.TEXTURE_2D_ARRAY,t,0,0,0,m.width,m.height,d.depth,p,f,m.data):n.texImage3D(e.TEXTURE_2D_ARRAY,t,g,m.width,m.height,d.depth,0,p,f,m.data)}else{v&&y&&n.texStorage2D(e.TEXTURE_2D,b,g,_[0].width,_[0].height);for(let t=0,r=_.length;t<r;t++)m=_[t],a.format!==F?null!==p&&(v?x&&n.compressedTexSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,p,m.data):n.compressedTexImage2D(e.TEXTURE_2D,t,g,m.width,m.height,0,m.data)):v?x&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,m.width,m.height,p,f,m.data):n.texImage2D(e.TEXTURE_2D,t,g,m.width,m.height,0,p,f,m.data)}else if(a.isDataArrayTexture)if(v){if(y&&n.texStorage3D(e.TEXTURE_2D_ARRAY,b,g,d.width,d.height,d.depth),x)if(a.layerUpdates.size>0){const t=ya(d.width,d.height,a.format,a.type);for(const r of a.layerUpdates){const i=d.data.subarray(r*t/d.data.BYTES_PER_ELEMENT,(r+1)*t/d.data.BYTES_PER_ELEMENT);n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,r,d.width,d.height,1,p,f,i)}a.clearLayerUpdates()}else n.texSubImage3D(e.TEXTURE_2D_ARRAY,0,0,0,0,d.width,d.height,d.depth,p,f,d.data)}else n.texImage3D(e.TEXTURE_2D_ARRAY,0,g,d.width,d.height,d.depth,0,p,f,d.data);else if(a.isData3DTexture)v?(y&&n.texStorage3D(e.TEXTURE_3D,b,g,d.width,d.height,d.depth),x&&n.texSubImage3D(e.TEXTURE_3D,0,0,0,0,d.width,d.height,d.depth,p,f,d.data)):n.texImage3D(e.TEXTURE_3D,0,g,d.width,d.height,d.depth,0,p,f,d.data);else if(a.isFramebufferTexture){if(y)if(v)n.texStorage2D(e.TEXTURE_2D,b,g,d.width,d.height);else{let t=d.width,r=d.height;for(let i=0;i<b;i++)n.texImage2D(e.TEXTURE_2D,i,g,t,r,0,p,f,null),t>>=1,r>>=1}}else if(_.length>0){if(v&&y){const t=se(_[0]);n.texStorage2D(e.TEXTURE_2D,b,g,t.width,t.height)}for(let t=0,r=_.length;t<r;t++)m=_[t],v?x&&n.texSubImage2D(e.TEXTURE_2D,t,0,0,p,f,m):n.texImage2D(e.TEXTURE_2D,t,g,p,f,m);a.generateMipmaps=!1}else if(v){if(y){const t=se(d);n.texStorage2D(e.TEXTURE_2D,b,g,t.width,t.height)}x&&n.texSubImage2D(e.TEXTURE_2D,0,0,0,p,f,d)}else n.texImage2D(e.TEXTURE_2D,0,g,p,f,d);S(a)&&M(l),h.__version=c.version,a.onUpdate&&a.onUpdate(a)}t.__version=a.version}function $(t,i,a,l,u,c){const h=s.convert(a.format,a.colorSpace),A=s.convert(a.type),d=P(a.internalFormat,h,A,a.colorSpace),p=r.get(i),f=r.get(a);if(f.__renderTarget=i,!p.__hasExternalTextures){const t=Math.max(1,i.width>>c),r=Math.max(1,i.height>>c);u===e.TEXTURE_3D||u===e.TEXTURE_2D_ARRAY?n.texImage3D(u,c,d,t,r,i.depth,0,h,A,null):n.texImage2D(u,c,d,t,r,0,h,A,null)}n.bindFramebuffer(e.FRAMEBUFFER,t),re(i)?o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,l,u,f.__webglTexture,0,ne(i)):(u===e.TEXTURE_2D||u>=e.TEXTURE_CUBE_MAP_POSITIVE_X&&u<=e.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&e.framebufferTexture2D(e.FRAMEBUFFER,l,u,f.__webglTexture,c),n.bindFramebuffer(e.FRAMEBUFFER,null)}function K(t,n,r){if(e.bindRenderbuffer(e.RENDERBUFFER,t),n.depthBuffer){const i=n.depthTexture,s=i&&i.isDepthTexture?i.type:null,a=D(n.stencilBuffer,s),l=n.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,u=ne(n);re(n)?o.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,u,a,n.width,n.height):r?e.renderbufferStorageMultisample(e.RENDERBUFFER,u,a,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,a,n.width,n.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,l,e.RENDERBUFFER,t)}else{const t=n.textures;for(let i=0;i<t.length;i++){const a=t[i],l=s.convert(a.format,a.colorSpace),u=s.convert(a.type),c=P(a.internalFormat,l,u,a.colorSpace),h=ne(n);r&&!1===re(n)?e.renderbufferStorageMultisample(e.RENDERBUFFER,h,c,n.width,n.height):re(n)?o.renderbufferStorageMultisampleEXT(e.RENDERBUFFER,h,c,n.width,n.height):e.renderbufferStorage(e.RENDERBUFFER,c,n.width,n.height)}}e.bindRenderbuffer(e.RENDERBUFFER,null)}function Z(t,i){if(i&&i.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(e.FRAMEBUFFER,t),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const s=r.get(i.depthTexture);s.__renderTarget=i,s.__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),z(i.depthTexture,0);const a=s.__webglTexture,l=ne(i);if(i.depthTexture.format===k)re(i)?o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0,l):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.TEXTURE_2D,a,0);else{if(i.depthTexture.format!==q)throw new Error("Unknown depthTexture format");re(i)?o.framebufferTexture2DMultisampleEXT(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0,l):e.framebufferTexture2D(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.TEXTURE_2D,a,0)}}
vendor: 2,942 bytes, line 1
1function J(t){const i=r.get(t),s=!0===t.isWebGLCubeRenderTarget;if(i.__boundDepthTexture!==t.depthTexture){const e=t.depthTexture;if(i.__depthDisposeCallback&&i.__depthDisposeCallback(),e){const t=()=>{delete i.__boundDepthTexture,delete i.__depthDisposeCallback,e.removeEventListener("dispose",t)};e.addEventListener("dispose",t),i.__depthDisposeCallback=t}i.__boundDepthTexture=e}if(t.depthTexture&&!i.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");const e=t.texture.mipmaps;e&&e.length>0?Z(i.__webglFramebuffer[0],t):Z(i.__webglFramebuffer,t)}else if(s){i.__webglDepthbuffer=[];for(let r=0;r<6;r++)if(n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[r]),void 0===i.__webglDepthbuffer[r])i.__webglDepthbuffer[r]=e.createRenderbuffer(),K(i.__webglDepthbuffer[r],t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,s=i.__webglDepthbuffer[r];e.bindRenderbuffer(e.RENDERBUFFER,s),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,s)}}else{const r=t.texture.mipmaps;if(r&&r.length>0?n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer[0]):n.bindFramebuffer(e.FRAMEBUFFER,i.__webglFramebuffer),void 0===i.__webglDepthbuffer)i.__webglDepthbuffer=e.createRenderbuffer(),K(i.__webglDepthbuffer,t,!1);else{const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,r=i.__webglDepthbuffer;e.bindRenderbuffer(e.RENDERBUFFER,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,n,e.RENDERBUFFER,r)}}n.bindFramebuffer(e.FRAMEBUFFER,null)}const ee=[],te=[];function ne(e){return Math.min(i.maxSamples,e.samples)}function re(e){const n=r.get(e);return e.samples>0&&!0===t.has("WEBGL_multisampled_render_to_texture")&&!1!==n.__useRenderToTexture}function ie(e,t){const n=e.colorSpace;e.format,e.type;return!0===e.isCompressedTexture||!0===e.isVideoTexture||n!==Me&&n!==Te&&ut.getTransfer(n),t}function se(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement?(u.width=e.naturalWidth||e.width,u.height=e.naturalHeight||e.height):"undefined"!=typeof VideoFrame&&e instanceof VideoFrame?(u.width=e.displayWidth,u.height=e.displayHeight):(u.width=e.width,u.height=e.height),u}this.allocateTextureUnit=function(){const e=V;return i.maxTextures,V+=1,e},this.resetTextureUnits=function(){V=0},this.setTexture2D=z,this.setTexture2DArray=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?Y(s,t,i):n.bindTexture(e.TEXTURE_2D_ARRAY,s.__webglTexture,e.TEXTURE0+i)},this.setTexture3D=function(t,i){const s=r.get(t);t.version>0&&s.__version!==t.version?Y(s,t,i):n.bindTexture(e.TEXTURE_3D,s.__webglTexture,e.TEXTURE0+i)},this.setTextureCube=function(t,a){const o=r.get(t);t.version>0&&o.__version!==t.version?function(t,a,o){if(6!==a.image.length)return;const l=X(t,a),u=a.source;n.bindTexture(e.TEXTURE_CUBE_MAP,t.__webglTexture,e.TEXTURE0+o);const c=r.get(u);if(u.version!==c.__version||!0===l){n.activeTexture(e.TEXTURE0+o);
vendor: 6,508 bytes, line 1
1const t=ut.getPrimaries(ut.workingColorSpace),r=a.colorSpace===Te?null:ut.getPrimaries(a.colorSpace),h=a.colorSpace===Te||t===r?e.NONE:e.BROWSER_DEFAULT_WEBGL;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,a.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,a.unpackAlignment),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,h);const A=a.isCompressedTexture||a.image[0].isCompressedTexture,d=a.image[0]&&a.image[0].isDataTexture,p=[];for(let e=0;e<6;e++)p[e]=A||d?d?a.image[e].image:a.image[e]:T(a.image[e],!0,i.maxCubemapSize),p[e]=ie(a,p[e]);const f=p[0],m=s.convert(a.format,a.colorSpace),g=s.convert(a.type),_=P(a.internalFormat,m,g,a.colorSpace),v=!0!==a.isVideoTexture,y=void 0===c.__version||!0===l,x=u.dataReady;let b,w=L(a,f);if(W(e.TEXTURE_CUBE_MAP,a),A){v&&y&&n.texStorage2D(e.TEXTURE_CUBE_MAP,w,_,f.width,f.height);for(let t=0;t<6;t++){b=p[t].mipmaps;for(let r=0;r<b.length;r++){const i=b[r];a.format!==F?null!==m&&(v?x&&n.compressedTexSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,m,i.data):n.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,_,i.width,i.height,0,i.data)):v?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,0,0,i.width,i.height,m,g,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r,_,i.width,i.height,0,m,g,i.data)}}}else{if(b=a.mipmaps,v&&y){b.length>0&&w++;const t=se(p[0]);n.texStorage2D(e.TEXTURE_CUBE_MAP,w,_,t.width,t.height)}for(let t=0;t<6;t++)if(d){v?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,p[t].width,p[t].height,m,g,p[t].data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,_,p[t].width,p[t].height,0,m,g,p[t].data);for(let r=0;r<b.length;r++){const i=b[r].image[t].image;v?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,i.width,i.height,m,g,i.data):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,_,i.width,i.height,0,m,g,i.data)}}else{v?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,m,g,p[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,_,m,g,p[t]);for(let r=0;r<b.length;r++){const i=b[r];v?x&&n.texSubImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,0,0,m,g,i.image[t]):n.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+t,r+1,_,m,g,i.image[t])}}}S(a)&&M(e.TEXTURE_CUBE_MAP),c.__version=u.version,a.onUpdate&&a.onUpdate(a)}t.__version=a.version}(o,t,a):n.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture,e.TEXTURE0+a)},this.rebindTextures=function(t,n,i){const s=r.get(t);void 0!==n&&$(s.__webglFramebuffer,t,t.texture,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,0),void 0!==i&&J(t)},this.setupRenderTarget=function(t){const i=t.texture,o=r.get(t),l=r.get(i);t.addEventListener("dispose",B);const u=t.textures,c=!0===t.isWebGLCubeRenderTarget,h=u.length>1;if(h||(void 0===l.__webglTexture&&(l.__webglTexture=e.createTexture()),l.__version=i.version,a.memory.textures++),c){o.__webglFramebuffer=[];for(let t=0;t<6;t++)if(i.mipmaps&&i.mipmaps.length>0){o.__webglFramebuffer[t]=[];for(let n=0;n<i.mipmaps.length;n++)o.__webglFramebuffer[t][n]=e.createFramebuffer()}else o.__webglFramebuffer[t]=e.createFramebuffer()}else{if(i.mipmaps&&i.mipmaps.length>0){o.__webglFramebuffer=[];for(let t=0;t<i.mipmaps.length;t++)o.__webglFramebuffer[t]=e.createFramebuffer()}else o.__webglFramebuffer=e.createFramebuffer();if(h)for(let t=0,n=u.length;t<n;t++){const n=r.get(u[t]);void 0===n.__webglTexture&&(n.__webglTexture=e.createTexture(),a.memory.textures++)}if(t.samples>0&&!1===re(t)){o.__webglMultisampledFramebuffer=e.createFramebuffer(),o.__webglColorRenderbuffer=[],n.bindFramebuffer(e.FRAMEBUFFER,o.__webglMultisampledFramebuffer);for(let n=0;n<u.length;n++){const r=u[n];o.__webglColorRenderbuffer[n]=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,o.__webglColorRenderbuffer[n]);const i=s.convert(r.format,r.colorSpace),a=s.convert(r.type),l=P(r.internalFormat,i,a,r.colorSpace,!0===t.isXRRenderTarget),c=ne(t);e.renderbufferStorageMultisample(e.RENDERBUFFER,c,l,t.width,t.height),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+n,e.RENDERBUFFER,o.__webglColorRenderbuffer[n])}e.bindRenderbuffer(e.RENDERBUFFER,null),t.depthBuffer&&(o.__webglDepthRenderbuffer=e.createRenderbuffer(),K(o.__webglDepthRenderbuffer,t,!0)),n.bindFramebuffer(e.FRAMEBUFFER,null)}}if(c){n.bindTexture(e.TEXTURE_CUBE_MAP,l.__webglTexture),W(e.TEXTURE_CUBE_MAP,i);for(let n=0;n<6;n++)if(i.mipmaps&&i.mipmaps.length>0)for(let r=0;r<i.mipmaps.length;r++)$(o.__webglFramebuffer[n][r],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,r);else $(o.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+n,0);S(i)&&M(e.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(h){for(let i=0,s=u.length;i<s;i++){const s=u[i],a=r.get(s);n.bindTexture(e.TEXTURE_2D,a.__webglTexture),W(e.TEXTURE_2D,s),$(o.__webglFramebuffer,t,s,e.COLOR_ATTACHMENT0+i,e.TEXTURE_2D,0),S(s)&&M(e.TEXTURE_2D)}n.unbindTexture()}else{let r=e.TEXTURE_2D;if((t.isWebGL3DRenderTarget||t.isWebGLArrayRenderTarget)&&(r=t.isWebGL3DRenderTarget?e.TEXTURE_3D:e.TEXTURE_2D_ARRAY),n.bindTexture(r,l.__webglTexture),W(r,i),i.mipmaps&&i.mipmaps.length>0)for(let n=0;n<i.mipmaps.length;n++)$(o.__webglFramebuffer[n],t,i,e.COLOR_ATTACHMENT0,r,n);else $(o.__webglFramebuffer,t,i,e.COLOR_ATTACHMENT0,r,0);S(i)&&M(r),n.unbindTexture()}t.depthBuffer&&J(t)},this.updateRenderTargetMipmap=function(e){const t=e.textures;for(let i=0,s=t.length;i<s;i++){const s=t[i];if(S(s)){const t=C(e),i=r.get(s).__webglTexture;n.bindTexture(t,i),M(t),n.unbindTexture()}}},this.updateMultisampleRenderTarget=function(t){if(t.samples>0)if(!1===re(t)){const i=t.textures,s=t.width,a=t.height;let o=e.COLOR_BUFFER_BIT;const u=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT,c=r.get(t),h=i.length>1;if(h)for(let t=0;t<i.length;t++)n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,null),n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,null,0);n.bindFramebuffer(e.READ_FRAMEBUFFER,c.__webglMultisampledFramebuffer);const A=t.texture.mipmaps;A&&A.length>0?n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer[0]):n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglFramebuffer);for(let n=0;n<i.length;n++){if(t.resolveDepthBuffer&&(t.depthBuffer&&(o|=e.DEPTH_BUFFER_BIT),t.stencilBuffer&&t.resolveStencilBuffer&&(o|=e.STENCIL_BUFFER_BIT)),h){e.framebufferRenderbuffer(e.READ_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.RENDERBUFFER,c.__webglColorRen
vendor: 4,941 bytes, line 1
1derbuffer[n]);const t=r.get(i[n]).__webglTexture;e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0)}e.blitFramebuffer(0,0,s,a,0,0,s,a,o,e.NEAREST),!0===l&&(ee.length=0,te.length=0,ee.push(e.COLOR_ATTACHMENT0+n),t.depthBuffer&&!1===t.resolveDepthBuffer&&(ee.push(u),te.push(u),e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,te)),e.invalidateFramebuffer(e.READ_FRAMEBUFFER,ee))}if(n.bindFramebuffer(e.READ_FRAMEBUFFER,null),n.bindFramebuffer(e.DRAW_FRAMEBUFFER,null),h)for(let t=0;t<i.length;t++){n.bindFramebuffer(e.FRAMEBUFFER,c.__webglMultisampledFramebuffer),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.RENDERBUFFER,c.__webglColorRenderbuffer[t]);const s=r.get(i[t]).__webglTexture;n.bindFramebuffer(e.FRAMEBUFFER,c.__webglFramebuffer),e.framebufferTexture2D(e.DRAW_FRAMEBUFFER,e.COLOR_ATTACHMENT0+t,e.TEXTURE_2D,s,0)}n.bindFramebuffer(e.DRAW_FRAMEBUFFER,c.__webglMultisampledFramebuffer)}else if(t.depthBuffer&&!1===t.resolveDepthBuffer&&l){const n=t.stencilBuffer?e.DEPTH_STENCIL_ATTACHMENT:e.DEPTH_ATTACHMENT;e.invalidateFramebuffer(e.DRAW_FRAMEBUFFER,[n])}},this.setupDepthRenderbuffer=J,this.setupFrameBufferTexture=$,this.useMultisampledRTT=re}function Ql(e,t){return{convert:function(n,r=""){let i;const s=ut.getTransfer(r);if(n===T)return e.UNSIGNED_BYTE;if(n===D)return e.UNSIGNED_SHORT_4_4_4_4;if(n===L)return e.UNSIGNED_SHORT_5_5_5_1;if(n===O)return e.UNSIGNED_INT_5_9_9_9_REV;if(n===S)return e.BYTE;if(n===M)return e.SHORT;if(n===E)return e.UNSIGNED_SHORT;if(n===C)return e.INT;if(n===R)return e.UNSIGNED_INT;if(n===N)return e.FLOAT;if(n===P)return e.HALF_FLOAT;if(n===B)return e.ALPHA;if(n===U)return e.RGB;if(n===F)return e.RGBA;if(n===k)return e.DEPTH_COMPONENT;if(n===q)return e.DEPTH_STENCIL;if(n===V)return e.RED;if(n===z)return e.RED_INTEGER;if(n===G)return e.RG;if(n===j)return e.RG_INTEGER;if(n===H)return e.RGBA_INTEGER;if(n===W||n===X||n===Q||n===Y)if(s===Ce){if(i=t.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(n===W)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===X)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===Q)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===Y)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=t.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(n===W)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===X)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Q)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Y)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(n===$||n===K||n===Z||n===J){if(i=t.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(n===$)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===K)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Z)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===J)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===ee||n===te||n===ne){if(i=t.get("WEBGL_compressed_texture_etc"),null===i)return null;if(n===ee||n===te)return s===Ce?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(n===ne)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(n===re||n===ie||n===se||n===ae||n===oe||n===le||n===ue||n===ce||n===he||n===Ae||n===de||n===pe||n===fe||n===me){if(i=t.get("WEBGL_compressed_texture_astc"),null===i)return null;if(n===re)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===ie)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===se)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===ae)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===oe)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===le)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===ue)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===ce)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===he)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ae)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===de)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===pe)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===fe)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===me)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(n===ge||n===_e||n===ve){if(i=t.get("EXT_texture_compression_bptc"),null===i)return null;if(n===ge)return s===Ce?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===_e)return i.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===ve)return i.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}if(n===ye||n===xe||n===be||n===we){if(i=t.get("EXT_texture_compression_rgtc"),null===i)return null;
vendor: 9,695 bytes, line 1
1if(n===ge)return i.COMPRESSED_RED_RGTC1_EXT;if(n===xe)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===be)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===we)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return n===I?e.UNSIGNED_INT_24_8:void 0!==e[n]?e[n]:null}}}class Yl{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(null===this.texture){const r=new _t;e.properties.get(r).__webglTexture=t.texture,t.depthNear===n.depthNear&&t.depthFar===n.depthFar||(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=r}}getMesh(e){if(null!==this.texture&&null===this.mesh){const t=e.cameras[0].viewport,n=new Pr({vertexShader:"\nvoid main() {\n\n\tgl_Position = vec4( position, 1.0 );\n\n}",fragmentShader:"\nuniform sampler2DArray depthColor;\nuniform float depthWidth;\nuniform float depthHeight;\n\nvoid main() {\n\n\tvec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );\n\n\tif ( coord.x >= 1.0 ) {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;\n\n\t} else {\n\n\t\tgl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;\n\n\t}\n\n}",uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Tr(new Ss(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class $l extends Ue{constructor(e,t){super();const n=this;let r=null,i=1,s=null,a="local-floor",o=1,l=null,u=null,c=null,h=null,A=null,d=null;const p=new Yl,f=t.getContextAttributes();let m=null,g=null;const _=[],v=[],y=new Ye;let x=null;const b=new Br;b.viewport=new vt;const w=new Br;w.viewport=new vt;const S=[b,w],M=new oa;let E=null,C=null;function N(e){const t=v.indexOf(e.inputSource);if(-1===t)return;const n=_[t];void 0!==n&&(n.update(e.inputSource,e.frame,l||s),n.dispatchEvent({type:e.type,data:e.inputSource}))}function P(){r.removeEventListener("select",N),r.removeEventListener("selectstart",N),r.removeEventListener("selectend",N),r.removeEventListener("squeeze",N),r.removeEventListener("squeezestart",N),r.removeEventListener("squeezeend",N),r.removeEventListener("end",P),r.removeEventListener("inputsourceschange",D);for(let e=0;e<_.length;e++){const t=v[e];null!==t&&(v[e]=null,_[e].disconnect(t))}E=null,C=null,p.reset(),e.setRenderTarget(m),A=null,h=null,c=null,r=null,g=null,V.stop(),n.isPresenting=!1,e.setPixelRatio(x),e.setSize(y.width,y.height,!1),n.dispatchEvent({type:"sessionend"})}function D(e){for(let t=0;t<e.removed.length;t++){const n=e.removed[t],r=v.indexOf(n);r>=0&&(v[r]=null,_[r].disconnect(n))}for(let t=0;t<e.added.length;t++){const n=e.added[t];let r=v.indexOf(n);if(-1===r){for(let e=0;e<_.length;e++){if(e>=v.length){v.push(n),r=e;break}if(null===v[e]){v[e]=n,r=e;break}}if(-1===r)break}const i=_[r];i&&i.connect(n)}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(e){let t=_[e];return void 0===t&&(t=new Gr,_[e]=t),t.getTargetRaySpace()},this.getControllerGrip=function(e){let t=_[e];return void 0===t&&(t=new Gr,_[e]=t),t.getGripSpace()},this.getHand=function(e){let t=_[e];return void 0===t&&(t=new Gr,_[e]=t),t.getHandSpace()},this.setFramebufferScaleFactor=function(e){i=e,n.isPresenting},this.setReferenceSpaceType=function(e){a=e,n.isPresenting},this.getReferenceSpace=function(){return l||s},this.setReferenceSpace=function(e){l=e},this.getBaseLayer=function(){return null!==h?h:A},this.getBinding=function(){return c},this.getFrame=function(){return d},this.getSession=function(){return r},this.setSession=async function(u){if(r=u,null!==r){if(m=e.getRenderTarget(),r.addEventListener("select",N),r.addEventListener("selectstart",N),r.addEventListener("selectend",N),r.addEventListener("squeeze",N),r.addEventListener("squeezestart",N),r.addEventListener("squeezeend",N),r.addEventListener("end",P),r.addEventListener("inputsourceschange",D),!0!==f.xrCompatible&&await t.makeXRCompatible(),x=e.getPixelRatio(),e.getSize(y),"undefined"!=typeof XRWebGLBinding&&"createProjectionLayer"in XRWebGLBinding.prototype){let n=null,s=null,a=null;f.depth&&(a=f.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,n=f.stencil?q:k,s=f.stencil?I:R);const o={colorFormat:t.RGBA8,depthFormat:a,scaleFactor:i};c=new XRWebGLBinding(r,t),h=c.createProjectionLayer(o),r.updateRenderState({layers:[h]}),e.setPixelRatio(1),e.setSize(h.textureWidth,h.textureHeight,!1),g=new xt(h.textureWidth,h.textureHeight,{format:F,type:T,depthTexture:new Mi(h.textureWidth,h.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n),stencilBuffer:f.stencil,colorSpace:e.outputColorSpace,samples:f.antialias?4:0,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues})}else{const n={antialias:f.antialias,alpha:!0,depth:f.depth,stencil:f.stencil,framebufferScaleFactor:i};A=new XRWebGLLayer(r,t,n),r.updateRenderState({baseLayer:A}),e.setPixelRatio(1),e.setSize(A.framebufferWidth,A.framebufferHeight,!1),g=new xt(A.framebufferWidth,A.framebufferHeight,{format:F,type:T,colorSpace:e.outputColorSpace,stencilBuffer:f.stencil,resolveDepthBuffer:!1===A.ignoreDepthValues,resolveStencilBuffer:!1===A.ignoreDepthValues})}g.isXRRenderTarget=!0,this.setFoveation(o),l=null,s=await r.requestReferenceSpace(a),V.setContext(r),V.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(null!==r)return r.environmentBlendMode},this.getDepthTexture=function(){return p.getDepthTexture()};const L=new Ke,O=new Ke;function B(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}this.updateCamera=function(e){if(null===r)return;let t=e.near,n=e.far;null!==p.texture&&(p.depthNear>0&&(t=p.depthNear),p.depthFar>0&&(n=p.depthFar)),M.near=w.near=b.near=t,M.far=w.far=b.far=n,E===M.near&&C===M.far||(r.updateRenderState({depthNear:M.near,depthFar:M.far}),E=M.near,C=M.far),b.layers.mask=2|e.layers.mask,w.layers.mask=4|e.layers.mask,M.layers.mask=b.layers.mask|w.layers.mask;const i=e.parent,s=M.cameras;B(M,i);for(let e=0;e<s.length;e++)B(s[e],i);2===s.length?function(e,t,n){L.setFromMatrixPosition(t.matrixWorld),O.setFromMatrixPosition(n.matrixWorld);const r=L.distanceTo(O),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(s[8]+1)/s[0],A=a*c,d=a*h,p=r/(-c+h),f=p*-c;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===i[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{const t=a+p,n=o+p,i=A-f,s=d+(r-f),c=l*o/n*t,h=u*o/n*t;e.projectionMatrix.makePerspective(i,s,c,h,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(M,b,w):M.projectionMatrix.copy(b.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*Ve*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,M,i)},this.getCamera=function(){return M},this.getFoveation=function(){if(null!==h||null!==A)return o},this.setFoveation=function(e){o=e,null!==h&&(h.fixedFoveation=e),null!==A&&void 0!==A.fixedFoveation&&(A.fixedFoveation=e)},this.hasDepthSensing=function(){return null!==p.texture},this.getDepthSensingMesh=function(){return p.getMesh(M)};let U=null;const V=new xa;V.setAnimationLoop((function(t,i){if(u=i.getViewerPose(l||s),d=i,null!==u){const t=u.views;null!==A&&(e.setRenderTargetFramebuffer(g,A.framebuffer),e.setRenderTarget(g));let n=!1;t.length!==M.cameras.length&&(M.cameras.length=0,n=!0);for(let r=0;r<t.length;r++){const i=t[r];let s=null;if(null!==A)s=A.getViewport(i);else{const t=c.getViewSubImage(h,i);s=t.viewport,0===r&&(e.setRenderTargetTextures(g,t.colorTexture,t.depthStencilTexture),e.setRenderTarget(g))}let a=S[r];void 0===a&&(a=new Br,a.layers.enable(r),a.viewport=new vt,S[r]=a),a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.quaternion,a.scale),a.projectionMatrix.fromArray(i.projectionMatrix),a.projectionMatrixInverse.copy(a.projectionMatrix).invert(),a.viewport.set(s.x,s.y,s.width,s.height),0===r&&(M.matrix.copy(a.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),!0===n&&M.cameras.push(a)}const i=r.enabledFeatures;if(i&&i.includes("depth-sensing")&&"gpu-optimized"==r.depthUsage&&c){const n=c.getDepthInformation(t[0]);n&&n.isValid&&n.texture&&p.init(e,n,r.renderState)}}for(let e=0;e<_.length;e++){const t=v[e],n=_[e];null!==t&&void 0!==n&&n.update(t,i,l||s)}U&&U(t,i),i.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:i}),d=null})),this.setAnimationLoop=function(e){U=e},this.dispose=function(){}}}const Kl=new on,Zl=new $t;function Jl(e,t){function n(e,t){!0===e.matrixAutoUpdate&&e.updateMatrix(),t.value.copy(e.matrix)}function r(e,r){e.opacity.value=r.opacity,r.color&&e.diffuse.value.copy(r.color),r.emissive&&e.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),r.map&&(e.map.value=r.map,n(r.map,e.mapTransform)),r.alphaMap&&(e.alphaMap.value=r.alphaMap,n(r.alphaMap,e.alphaMapTransform)),r.bumpMap&&(e.bumpMap.value=r.bumpMap,n(r.bumpMap,e.bumpMapTransform),e.bumpScale.value=r.bumpScale,1===r.side&&(e.bumpScale.value*=-1)),r.normalMap&&(e.normalMap.value=r.normalMap,n(r.
vendor: 4,605 bytes, line 1
1normalMap,e.normalMapTransform),e.normalScale.value.copy(r.normalScale),1===r.side&&e.normalScale.value.negate()),r.displacementMap&&(e.displacementMap.value=r.displacementMap,n(r.displacementMap,e.displacementMapTransform),e.displacementScale.value=r.displacementScale,e.displacementBias.value=r.displacementBias),r.emissiveMap&&(e.emissiveMap.value=r.emissiveMap,n(r.emissiveMap,e.emissiveMapTransform)),r.specularMap&&(e.specularMap.value=r.specularMap,n(r.specularMap,e.specularMapTransform)),r.alphaTest>0&&(e.alphaTest.value=r.alphaTest);const i=t.get(r),s=i.envMap,a=i.envMapRotation;s&&(e.envMap.value=s,Kl.copy(a),Kl.x*=-1,Kl.y*=-1,Kl.z*=-1,s.isCubeTexture&&!1===s.isRenderTargetTexture&&(Kl.y*=-1,Kl.z*=-1),e.envMapRotation.value.setFromMatrix4(Zl.makeRotationFromEuler(Kl)),e.flipEnvMap.value=s.isCubeTexture&&!1===s.isRenderTargetTexture?-1:1,e.reflectivity.value=r.reflectivity,e.ior.value=r.ior,e.refractionRatio.value=r.refractionRatio),r.lightMap&&(e.lightMap.value=r.lightMap,e.lightMapIntensity.value=r.lightMapIntensity,n(r.lightMap,e.lightMapTransform)),r.aoMap&&(e.aoMap.value=r.aoMap,e.aoMapIntensity.value=r.aoMapIntensity,n(r.aoMap,e.aoMapTransform))}return{refreshFogUniforms:function(t,n){n.color.getRGB(t.fogColor.value,Rr(e)),n.isFog?(t.fogNear.value=n.near,t.fogFar.value=n.far):n.isFogExp2&&(t.fogDensity.value=n.density)},refreshMaterialUniforms:function(e,i,s,a,o){i.isMeshBasicMaterial||i.isMeshLambertMaterial?r(e,i):i.isMeshToonMaterial?(r(e,i),function(e,t){t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(e,i)):i.isMeshPhongMaterial?(r(e,i),function(e,t){e.specular.value.copy(t.specular),e.shininess.value=Math.max(t.shininess,1e-4)}(e,i)):i.isMeshStandardMaterial?(r(e,i),function(e,t){e.metalness.value=t.metalness,t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap,n(t.metalnessMap,e.metalnessMapTransform)),e.roughness.value=t.roughness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap,n(t.roughnessMap,e.roughnessMapTransform)),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}(e,i),i.isMeshPhysicalMaterial&&function(e,t,r){e.ior.value=t.ior,t.sheen>0&&(e.sheenColor.value.copy(t.sheenColor).multiplyScalar(t.sheen),e.sheenRoughness.value=t.sheenRoughness,t.sheenColorMap&&(e.sheenColorMap.value=t.sheenColorMap,n(t.sheenColorMap,e.sheenColorMapTransform)),t.sheenRoughnessMap&&(e.sheenRoughnessMap.value=t.sheenRoughnessMap,n(t.sheenRoughnessMap,e.sheenRoughnessMapTransform))),t.clearcoat>0&&(e.clearcoat.value=t.clearcoat,e.clearcoatRoughness.value=t.clearcoatRoughness,t.clearcoatMap&&(e.clearcoatMap.value=t.clearcoatMap,n(t.clearcoatMap,e.clearcoatMapTransform)),t.clearcoatRoughnessMap&&(e.clearcoatRoughnessMap.value=t.clearcoatRoughnessMap,n(t.clearcoatRoughnessMap,e.clearcoatRoughnessMapTransform)),t.clearcoatNormalMap&&(e.clearcoatNormalMap.value=t.clearcoatNormalMap,n(t.clearcoatNormalMap,e.clearcoatNormalMapTransform),e.clearcoatNormalScale.value.copy(t.clearcoatNormalScale),1===t.side&&e.clearcoatNormalScale.value.negate())),t.dispersion>0&&(e.dispersion.value=t.dispersion),t.iridescence>0&&(e.iridescence.value=t.iridescence,e.iridescenceIOR.value=t.iridescenceIOR,e.iridescenceThicknessMinimum.value=t.iridescenceThicknessRange[0],e.iridescenceThicknessMaximum.value=t.iridescenceThicknessRange[1],t.iridescenceMap&&(e.iridescenceMap.value=t.iridescenceMap,n(t.iridescenceMap,e.iridescenceMapTransform)),t.iridescenceThicknessMap&&(e.iridescenceThicknessMap.value=t.iridescenceThicknessMap,n(t.iridescenceThicknessMap,e.iridescenceThicknessMapTransform))),t.transmission>0&&(e.transmission.value=t.transmission,e.transmissionSamplerMap.value=r.texture,e.transmissionSamplerSize.value.set(r.width,r.height),t.transmissionMap&&(e.transmissionMap.value=t.transmissionMap,n(t.transmissionMap,e.transmissionMapTransform)),e.thickness.value=t.thickness,t.thicknessMap&&(e.thicknessMap.value=t.thicknessMap,n(t.thicknessMap,e.thicknessMapTransform)),e.attenuationDistance.value=t.attenuationDistance,e.attenuationColor.value.copy(t.attenuationColor)),t.anisotropy>0&&(e.anisotropyVector.value.set(t.anisotropy*Math.cos(t.anisotropyRotation),t.anisotropy*Math.sin(t.anisotropyRotation)),t.anisotropyMap&&(e.anisotropyMap.value=t.anisotropyMap,n(t.anisotropyMap,e.anisotropyMapTransform))),e.specularIntensity.value=t.specularIntensity,e.specularColor.value.copy(t.specularColor),t.specularColorMap&&(e.specularColorMap.value=t.specularColorMap,n(t.specularColorMap,e.specularColorMapTransform)),t.specularIntensityMap&&(e.specularIntensityMap.value=t.specularIntensityMap,n(t.specularIntensityMap,e.specularIntensityMapTransform))}
vendor: 4,297 bytes, line 1
1(e,i,o)):i.isMeshMatcapMaterial?(r(e,i),function(e,t){t.matcap&&(e.matcap.value=t.matcap)}(e,i)):i.isMeshDepthMaterial?r(e,i):i.isMeshDistanceMaterial?(r(e,i),function(e,n){const r=t.get(n).light;e.referencePosition.value.setFromMatrixPosition(r.matrixWorld),e.nearDistance.value=r.shadow.camera.near,e.farDistance.value=r.shadow.camera.far}(e,i)):i.isMeshNormalMaterial?r(e,i):i.isLineBasicMaterial?(function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform))}(e,i),i.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(e,i)):i.isPointsMaterial?function(e,t,r,i){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.size.value=t.size*r,e.scale.value=.5*i,t.map&&(e.map.value=t.map,n(t.map,e.uvTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i,s,a):i.isSpriteMaterial?function(e,t){e.diffuse.value.copy(t.color),e.opacity.value=t.opacity,e.rotation.value=t.rotation,t.map&&(e.map.value=t.map,n(t.map,e.mapTransform)),t.alphaMap&&(e.alphaMap.value=t.alphaMap,n(t.alphaMap,e.alphaMapTransform)),t.alphaTest>0&&(e.alphaTest.value=t.alphaTest)}(e,i):i.isShadowMaterial?(e.color.value.copy(i.color),e.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function eu(e,t,n,r){let i={},s={},a=[];const o=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS);function l(e,t,n,r){const i=e.value,s=t+"_"+n;if(void 0===r[s])return r[s]="number"==typeof i||"boolean"==typeof i?i:i.clone(),!0;{const e=r[s];if("number"==typeof i||"boolean"==typeof i){if(e!==i)return r[s]=i,!0}else if(!1===e.equals(i))return e.copy(i),!0}return!1}function u(e){const t={boundary:0,storage:0};return"number"==typeof e||"boolean"==typeof e?(t.boundary=4,t.storage=4):e.isVector2?(t.boundary=8,t.storage=8):e.isVector3||e.isColor?(t.boundary=16,t.storage=12):e.isVector4?(t.boundary=16,t.storage=16):e.isMatrix3?(t.boundary=48,t.storage=48):e.isMatrix4?(t.boundary=64,t.storage=64):e.isTexture,t}function c(t){const n=t.target;n.removeEventListener("dispose",c);const r=a.indexOf(n.__bindingPointIndex);a.splice(r,1),e.deleteBuffer(i[n.id]),delete i[n.id],delete s[n.id]}return{bind:function(e,t){const n=t.program;r.uniformBlockBinding(e,n)},update:function(n,h){let A=i[n.id];void 0===A&&(function(e){const t=e.uniforms;let n=0;for(let e=0,r=t.length;e<r;e++){const r=Array.isArray(t[e])?t[e]:[t[e]];for(let e=0,t=r.length;e<t;e++){const t=r[e],i=Array.isArray(t.value)?t.value:[t.value];for(let e=0,r=i.length;e<r;e++){const r=u(i[e]),s=n%16,a=s%r.boundary,o=s+a;n+=a,0!==o&&16-o<r.storage&&(n+=16-o),t.__data=new Float32Array(r.storage/Float32Array.BYTES_PER_ELEMENT),t.__offset=n,n+=r.storage}}}const r=n%16;r>0&&(n+=16-r),e.__size=n,e.__cache={}}(n),A=function(t){const n=function(){for(let e=0;e<o;e++)if(-1===a.indexOf(e))return a.push(e),e;return 0}();t.__bindingPointIndex=n;const r=e.createBuffer(),i=t.__size,s=t.usage;return e.bindBuffer(e.UNIFORM_BUFFER,r),e.bufferData(e.UNIFORM_BUFFER,i,s),e.bindBuffer(e.UNIFORM_BUFFER,null),e.bindBufferBase(e.UNIFORM_BUFFER,n,r),r}(n),i[n.id]=A,n.addEventListener("dispose",c));const d=h.program;r.updateUBOMapping(n,d);const p=t.render.frame;s[n.id]!==p&&(function(t){const n=i[t.id],r=t.uniforms,s=t.__cache;e.bindBuffer(e.UNIFORM_BUFFER,n);for(let t=0,n=r.length;t<n;t++){const n=Array.isArray(r[t])?r[t]:[r[t]];for(let r=0,i=n.length;r<i;r++){const i=n[r];if(!0===l(i,t,r,s)){const t=i.__offset,n=Array.isArray(i.value)?i.value:[i.value];let r=0;for(let s=0;s<n.length;s++){const a=n[s],o=u(a);"number"==typeof a||"boolean"==typeof a?(i.__data[0]=a,e.bufferSubData(e.UNIFORM_BUFFER,t+r,i.__data)):a.isMatrix3?(i.__data[0]=a.elements[0],i.__data[1]=a.elements[1],i.__data[2]=a.elements[2],i.__data[3]=0,i.__data[4]=a.elements[3],i.__data[5]=a.elements[4],i.__data[6]=a.elements[5],i.__data[7]=0,i.__data[8]=a.elements[6],i.__data[9]=a.elements[7],i.__data[10]=a.elements[8],i.__data[11]=0):(a.toArray(i.__data,r),r+=o.storage/Float32Array.BYTES_PER_ELEMENT)}e.bufferSubData(e.UNIFORM_BUFFER,t,i.__data)}}}e.bindBuffer(e.UNIFORM_BUFFER,null)}(n),s[n.id]=p)},dispose:function(){for(const t in i)e.deleteBuffer(i[t]);a=[],i={},s={}}}}
1const tu=new Ke,nu=new $t,ru=new $t,iu=new Ke,su=new Ke;function au(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var ou="object"==typeof global&&global&&global.Object===Object&&global,lu="object"==typeof self&&self&&self.Object===Object&&self,uu=ou||lu||Function("return this")(),cu=function(){return uu.Date.now()},hu=/\s/,Au=/^\s+/;var du=uu.Symbol,pu=Object.prototype,fu=pu.hasOwnProperty,mu=pu.toString,gu=du?du.toStringTag:void 0,_u=Object.prototype.toString,vu=du?du.toStringTag:void 0;var yu=/^[-+]0x[0-9a-f]+$/i,xu=/^0b[01]+$/i,bu=/^0o[0-7]+$/i,wu=parseInt;function Tu(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":vu&&vu in Object(e)?function(e){var t=fu.call(e,gu),n=e[gu];try{e[gu]=void 0;var r=!0}catch(e){}var i=mu.call(e);return r&&(t?e[gu]=n:delete e[gu]),i}(e):function(e){return _u.call(e)}(e)}(e)}(e))return NaN;if(au(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=au(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&hu.test(e.charAt(t)););return t}(e)+1).replace(Au,""):e}(e);var n=xu.test(e);return n||bu.test(e)?wu(e.slice(2),n?2:8):yu.test(e)?NaN:+e}var Su=Math.max,Mu=Math.min;function Eu(e,t,n){var r,i,s,a,o,l,u=0,c=!1,h=!1,A=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){var n=r,s=i;return r=i=void 0,u=t,a=e.apply(s,n)}function p(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-u>=s}function f(){var e=cu();if(p(e))return m(e);o=setTimeout(f,function(e){var n=t-(e-l);return h?Mu(n,s-(e-u)):n}(e))}function m(e){return o=void 0,A&&r?d(e):(r=i=void 0,a)}function g(){var e=cu(),n=p(e);if(r=arguments,i=this,l=e,n){if(void 0===o)return function(e){return u=e,o=setTimeout(f,t),c?d(e):a}(l);if(h)return clearTimeout(o),o=setTimeout(f,t),d(l)}return void 0===o&&(o=setTimeout(f,t)),a}return t=Tu(t)||0,au(n)&&(c=!!n.leading,s=(h="maxWait"in n)?Su(Tu(n.maxWait)||0,t):s,A="trailing"in n?!!n.trailing:A),g.cancel=function(){void 0!==o&&clearTimeout(o),u=0,r=l=i=o=void 0},g.flush=function(){return void 0===o?a:m(cu())},g}function Cu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ru(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Cu(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cu(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Nu=function(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(t,n){var r=n.default,i=void 0===r?null:r,s=n.triggerUpdate,a=void 0===s||s,o=n.onChange,l=void 0===o?function(e,t){}:o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.defaultVal=i,this.triggerUpdate=a,this.onChange=l}));function Pu(e){var t=e.stateInit,n=void 0===t?function(){return{}}:t,r=e.props,i=void 0===r?{}:r,s=e.methods,a=void 0===s?{}:s,o=e.aliases,l=void 0===o?{}:o,u=e.init,c=void 0===u?function(){}:u,h=e.update,A=void 0===h?function(){}:h,d=Object.keys(i).map((function(e){return new Nu(e,i[e])}));return function e(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var s=!!(this instanceof e?this.constructor:void 0),o=s?r.shift():void 0,u=r[0],h=void 0===u?{}:u,p=Object.assign({},n instanceof Function?n(h):n,{initialised:!1}),f={};function m(e){return g(e,h),_(),m}var g=function(e,t){c.call(m,e,p,t),p.initialised=!0},_=Eu((function(){p.initialised&&(A.call(m,p,f),f={})}),1);return d.forEach((function(e){m[e.name]=function(e){var t=e.name,n=e.triggerUpdate,r=void 0!==n&&n,i=e.onCh
vendor: 11,874 bytes, line 1
1ange,s=void 0===i?function(e,t){}:i,a=e.defaultVal,o=void 0===a?null:a;return function(e){var n=p[t];if(!arguments.length)return n;var i=void 0===e?o:e;return p[t]=i,s.call(m,i,p,n),!f.hasOwnProperty(t)&&(f[t]=n),r&&_(),m}}(e)})),Object.keys(a).forEach((function(e){m[e]=function(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=a[e]).call.apply(t,[m,p].concat(r))}})),Object.entries(l).forEach((function(e){var t=Ru(e,2),n=t[0],r=t[1];return m[n]=m[r]})),m.resetProps=function(){return d.forEach((function(e){m[e.name](e.defaultVal)})),m},m.resetProps(),p._rerender=_,s&&o&&m(o),m}}var Du=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Du.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*Du.Bounce.In(2*e):.5*Du.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e<Number.EPSILON?Number.EPSILON:e)>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),Lu=function(){return performance.now()},Iu=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var s=i[r];null===(e=s._group)||void 0===e||e.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0,r=e;n<r.length;n++){var i=r[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every((function(e){return!e.isPlaying()}))},e.prototype.update=function(e,t){void 0===e&&(e=Lu()),void 0===t&&(t=!0);var n=Object.keys(this._tweens);if(0!==n.length)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var i=this._tweens[n[r]],s=!t;i&&!1===i.update(e,s)&&!t&&this.remove(i)}n=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Ou={Linear:function(e,t){var n=e.length-1,r=n*t,i=Math.floor(r),s=Ou.Utils.Linear;return t<0?s(e[0],e[1],r):t>1?s(e[n],e[n-1],n-r):s(e[i],e[i+1>n?n:i+1],r-i)},Utils:{Linear:function(e,t,n){return(t-e)*n+e}}},Bu=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Uu=new Iu,Fu=function(){function e(e,t){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Du.Linear.None,this._interpolationFunction=Ou.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Bu.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,"object"==typeof t?(this._group=t,t.add(this)):!0===t&&(this._group=Uu,Uu.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=Lu()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var i in this._valuesEnd)r[i]=this._valuesEnd[i];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,n,r,i){for(var s in n){var a=e[s],o=Array.isArray(a),l=o?"array":typeof a,u=!o&&Array.isArray(n[s]);if("undefined"!==l&&"function"!==l){if(u){if(0===(m=n[s]).length)continue;for(var c=[a],h=0,A=m.length;h<A;h+=1){var d=this._handleRelativeValue(a,m[h]);if(isNaN(d)){u=!1;break}c.push(d)}u&&(n[s]=c)}if("object"!==l&&!o||!a||u)(void 0===t[s]||i)&&(t[s]=a),o||(t[s]*=1),r[s]=u?n[s].slice().reverse():t[s]||0;else{t[s]=o?[]:{};var p=a;for(var f in p)t[s][f]=p[f];r[s]=o?[]:{};var m=n[s];if(!this._isDynamic){var g={};for(var f in m)g[f]=m[f];n[s]=m=g}this._setupProperties(p,t[s],m,r[s],i)}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return void 0===e&&(e=Lu()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e),this},e.prototype.resume=function(e){return void 0===e&&(e=Lu()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):this},e.prototype.remove=function(){var e;return null===(e=this._group)||void 0===e||e.remove(this),this},e.prototype.delay=function(e){return void 0===e&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return void 0===e&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return void 0===e&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return void 0===e&&(e=Du.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=Ou.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(t,n){var r,i,s=this;if(void 0===t&&(t=Lu()),void 0===n&&(n=e.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!n)return!1;this.start(t,!0)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=t-this._startTime,o=this._duration+(null!==(r=this._repeatDelayTime)&&void 0!==r?r:this._delayTime),l=this._duration+this._repeat*o,u=function(){if(0===s._duration)return 1;if(a>l)return 1;var e=Math.trunc(a/o),t=a-e*o,n=Math.min(t/s._duration,1);return 0===n&&a===s._duration?1:n}(),c=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),0===this._duration||a>=this._duration){if(this._repeat>0){var h=Math.min(Math.trunc((a-this._duration)/o)+1,this._repeat);for(i in isFinite(this._repeat)&&(this._repeat-=h),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=o*h,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var A=0,d=this._chainedTweens.length;A<d;A++)this._chainedTweens[A].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,r){for(var i in n)if(void 0!==t[i]){var s=t[i]||0,a=n[i],o=Array.isArray(e[i]),l=Array.isArray(a);!o&&l?e[i]=this._interpolationFunction(a,r):"object"==typeof a&&a?this._updateProperties(e[i],s,a,r):"number"==typeof(a=this._handleRelativeValue(s,a))&&(e[i]=s+(a-s)*r)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];
vendor: 4,868 bytes, line 1
1this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e.autoStartOnUpdate=!1,e}();Bu.nextId;var ku=Uu;function qu(e,t,n,r,i){if(isNaN(t)||isNaN(n)||isNaN(r))return e;var s,a,o,l,u,c,h,A,d,p,f,m,g=e._root,_={data:i},v=e._x0,y=e._y0,x=e._z0,b=e._x1,w=e._y1,T=e._z1;if(!g)return e._root=_,e;for(;g.length;)if((A=t>=(a=(v+b)/2))?v=a:b=a,(d=n>=(o=(y+w)/2))?y=o:w=o,(p=r>=(l=(x+T)/2))?x=l:T=l,s=g,!(g=g[f=p<<2|d<<1|A]))return s[f]=_,e;if(u=+e._x.call(null,g.data),c=+e._y.call(null,g.data),h=+e._z.call(null,g.data),t===u&&n===c&&r===h)return _.next=g,s?s[f]=_:e._root=_,e;do{s=s?s[f]=new Array(8):e._root=new Array(8),(A=t>=(a=(v+b)/2))?v=a:b=a,(d=n>=(o=(y+w)/2))?y=o:w=o,(p=r>=(l=(x+T)/2))?x=l:T=l}while((f=p<<2|d<<1|A)==(m=(h>=l)<<2|(c>=o)<<1|u>=a));return s[m]=g,s[f]=_,e}function Vu(e,t,n,r,i,s,a){this.node=e,this.x0=t,this.y0=n,this.z0=r,this.x1=i,this.y1=s,this.z1=a}ku.getAll.bind(ku),ku.removeAll.bind(ku),ku.add.bind(ku),ku.remove.bind(ku),ku.update.bind(ku);const zu=(e,t,n,r,i,s)=>Math.sqrt((e-r)**2+(t-i)**2+(n-s)**2);function Gu(e){return e[0]}function ju(e){return e[1]}function Hu(e){return e[2]}function Wu(e,t,n,r){var i=new Xu(null==t?Gu:t,null==n?ju:n,null==r?Hu:r,NaN,NaN,NaN,NaN,NaN,NaN);return null==e?i:i.addAll(e)}function Xu(e,t,n,r,i,s,a,o,l){this._x=e,this._y=t,this._z=n,this._x0=r,this._y0=i,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this._root=void 0}function Qu(e){for(var t={data:e.data},n=t;e=e.next;)n=n.next={data:e.data};return t}var Yu=Wu.prototype=Xu.prototype;function $u(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Ku(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Zu(e){let t,n,r;function i(e,r,i=0,s=e.length){if(i<s){if(0!==t(r,r))return s;do{const t=i+s>>>1;n(e[t],r)<0?i=t+1:s=t}while(i<s)}return i}return 2!==e.length?(t=$u,n=(t,n)=>$u(e(t),n),r=(t,n)=>e(t)-n):(t=e===$u||e===Ku?e:Ju,n=e,r=e),{left:i,center:function(e,t,n=0,s=e.length){const a=i(e,t,n,s-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,s=e.length){if(i<s){if(0!==t(r,r))return s;do{const t=i+s>>>1;n(e[t],r)<=0?i=t+1:s=t}while(i<s)}return i}}}function Ju(){return 0}Yu.copy=function(){var e,t,n=new Xu(this._x,this._y,this._z,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1),r=this._root;if(!r)return n;if(!r.length)return n._root=Qu(r),n;for(e=[{source:r,target:n._root=new Array(8)}];r=e.pop();)for(var i=0;i<8;++i)(t=r.source[i])&&(t.length?e.push({source:t,target:r.target[i]=new Array(8)}):r.target[i]=Qu(t));return n},Yu.add=function(e){const t=+this._x.call(null,e),n=+this._y.call(null,e),r=+this._z.call(null,e);return qu(this.cover(t,n,r),t,n,r,e)},Yu.addAll=function(e){Array.isArray(e)||(e=Array.from(e));const t=e.length,n=new Float64Array(t),r=new Float64Array(t),i=new Float64Array(t);let s=1/0,a=1/0,o=1/0,l=-1/0,u=-1/0,c=-1/0;for(let h,A,d,p,f=0;f<t;++f)isNaN(A=+this._x.call(null,h=e[f]))||isNaN(d=+this._y.call(null,h))||isNaN(p=+this._z.call(null,h))||(n[f]=A,r[f]=d,i[f]=p,A<s&&(s=A),A>l&&(l=A),d<a&&(a=d),d>u&&(u=d),p<o&&(o=p),p>c&&(c=p));if(s>l||a>u||o>c)return this;this.cover(s,a,o).cover(l,u,c);for(let s=0;s<t;++s)qu(this,n[s],r[s],i[s],e[s]);return this},Yu.cover=function(e,t,n){if(isNaN(e=+e)||isNaN(t=+t)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,s=this._z0,a=this._x1,o=this._y1,l=this._z1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(t))+1,l=(s=Math.floor(n))+1;else{for(var u,c,h=a-r||1,A=this._root;r>e||e>=a||i>t||t>=o||s>n||n>=l;)switch(c=(n<s)<<2|(t<i)<<1|e<r,(u=new Array(8))[c]=A,A=u,h*=2,c){case 0:a=r+h,o=i+h,l=s+h;break;case 1:r=a-h,o=i+h,l=s+h;break;case 2:a=r+h,i=o-h,l=s+h;break;case 3:r=a-h,i=o-h,l=s+h;break;case 4:a=r+h,o=i+h,s=l-h;break;case 5:r=a-h,o=i+h,s=l-h;break;case 6:a=r+h,i=o-h,s=l-h;break;case 7:r=a-h,i=o-h,s=l-h}this._root&&this._root.length&&(this._root=A)}return this._x0=r,this._y0=i,this._z0=s,this._x1=a,this._y1=o,this._z1=l,this},Yu.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},Yu.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1],+e[0][2]).cover(+e[1][0],+e[1][1],+e[1][2]):isNaN(this._x0)?void 0:[[this._x0,this._y0,this._z0],[this._x1,this._y1,this._z1]]},Yu.find=function(e,t,n,r){var i,s,a,o,l,u,c,h,A,d=this._x0,p=this._y0,f=this._z0,m=this._x1,g=this._y1,_=this._z1,v=[],y=this._root;for(y&&v.push(new Vu(y,d,p,f,m,g,_)),null==r?r=1/0:(d=e-r,p=t-r,f=n-r,m=e+r,g=t+r,_=n+r,r*=r);h=v.pop();)if(!(!(y=h.node)||(s=h.x0)>m||(a=h.y0)>g||(o=h.z0)>_||(l=h.x1)<d||(u=h.y1)<p||(c=h.z1)<f))if(y.length){var x=(s+l)/2,b=(a+u)/2,w=(o+c)/2;v.push(new Vu(y[7],x,b,w,l,u,c),new Vu(y[6],s,b,w,x,u,c),new Vu(y[5],x,a,w,l,b,c),new Vu(y[4],s,a,w,x,b,c),new Vu(y[3],x,b,o,l,u,w),new Vu(y[2],s,b,o,x,u,w),new Vu(y[1],x,a,o,l,b,w),new Vu(y[0],s,a,o,x,b,w)),(A=(n>
vendor: 4,140 bytes, line 1
1=w)<<2|(t>=b)<<1|e>=x)&&(h=v[v.length-1],v[v.length-1]=v[v.length-1-A],v[v.length-1-A]=h)}else{var T=e-+this._x.call(null,y.data),S=t-+this._y.call(null,y.data),M=n-+this._z.call(null,y.data),E=T*T+S*S+M*M;if(E<r){var C=Math.sqrt(r=E);d=e-C,p=t-C,f=n-C,m=e+C,g=t+C,_=n+C,i=y.data}}return i},Yu.findAllWithinRadius=function(e,t,n,r){const i=[],s=e-r,a=t-r,o=n-r,l=e+r,u=t+r,c=n+r;return this.visit(((h,A,d,p,f,m,g)=>{if(!h.length)do{const s=h.data;zu(e,t,n,this._x(s),this._y(s),this._z(s))<=r&&i.push(s)}while(h=h.next);return A>l||d>u||p>c||f<s||m<a||g<o})),i},Yu.remove=function(e){if(isNaN(s=+this._x.call(null,e))||isNaN(a=+this._y.call(null,e))||isNaN(o=+this._z.call(null,e)))return this;var t,n,r,i,s,a,o,l,u,c,h,A,d,p,f,m=this._root,g=this._x0,_=this._y0,v=this._z0,y=this._x1,x=this._y1,b=this._z1;if(!m)return this;if(m.length)for(;;){if((h=s>=(l=(g+y)/2))?g=l:y=l,(A=a>=(u=(_+x)/2))?_=u:x=u,(d=o>=(c=(v+b)/2))?v=c:b=c,t=m,!(m=m[p=d<<2|A<<1|h]))return this;if(!m.length)break;(t[p+1&7]||t[p+2&7]||t[p+3&7]||t[p+4&7]||t[p+5&7]||t[p+6&7]||t[p+7&7])&&(n=t,f=p)}for(;m.data!==e;)if(r=m,!(m=m.next))return this;return(i=m.next)&&delete m.next,r?(i?r.next=i:delete r.next,this):t?(i?t[p]=i:delete t[p],(m=t[0]||t[1]||t[2]||t[3]||t[4]||t[5]||t[6]||t[7])&&m===(t[7]||t[6]||t[5]||t[4]||t[3]||t[2]||t[1]||t[0])&&!m.length&&(n?n[f]=m:this._root=m),this):(this._root=i,this)},Yu.removeAll=function(e){for(var t=0,n=e.length;t<n;++t)this.remove(e[t]);return this},Yu.root=function(){return this._root},Yu.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},Yu.visit=function(e){var t,n,r,i,s,a,o,l,u=[],c=this._root;for(c&&u.push(new Vu(c,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=u.pop();)if(!e(c=t.node,r=t.x0,i=t.y0,s=t.z0,a=t.x1,o=t.y1,l=t.z1)&&c.length){var h=(r+a)/2,A=(i+o)/2,d=(s+l)/2;(n=c[7])&&u.push(new Vu(n,h,A,d,a,o,l)),(n=c[6])&&u.push(new Vu(n,r,A,d,h,o,l)),(n=c[5])&&u.push(new Vu(n,h,i,d,a,A,l)),(n=c[4])&&u.push(new Vu(n,r,i,d,h,A,l)),(n=c[3])&&u.push(new Vu(n,h,A,s,a,o,d)),(n=c[2])&&u.push(new Vu(n,r,A,s,h,o,d)),(n=c[1])&&u.push(new Vu(n,h,i,s,a,A,d)),(n=c[0])&&u.push(new Vu(n,r,i,s,h,A,d))}return this},Yu.visitAfter=function(e){var t,n=[],r=[];for(this._root&&n.push(new Vu(this._root,this._x0,this._y0,this._z0,this._x1,this._y1,this._z1));t=n.pop();){var i=t.node;if(i.length){var s,a=t.x0,o=t.y0,l=t.z0,u=t.x1,c=t.y1,h=t.z1,A=(a+u)/2,d=(o+c)/2,p=(l+h)/2;(s=i[0])&&n.push(new Vu(s,a,o,l,A,d,p)),(s=i[1])&&n.push(new Vu(s,A,o,l,u,d,p)),(s=i[2])&&n.push(new Vu(s,a,d,l,A,c,p)),(s=i[3])&&n.push(new Vu(s,A,d,l,u,c,p)),(s=i[4])&&n.push(new Vu(s,a,o,p,A,d,h)),(s=i[5])&&n.push(new Vu(s,A,o,p,u,d,h)),(s=i[6])&&n.push(new Vu(s,a,d,p,A,c,h)),(s=i[7])&&n.push(new Vu(s,A,d,p,u,c,h))}r.push(t)}for(;t=r.pop();)e(t.node,t.x0,t.y0,t.z0,t.x1,t.y1,t.z1);return this},Yu.x=function(e){return arguments.length?(this._x=e,this):this._x},Yu.y=function(e){return arguments.length?(this._y=e,this):this._y},Yu.z=function(e){return arguments.length?(this._z=e,this):this._z};const ec=Zu($u).right;function tc(e,t){let n,r;if(void 0===t)for(const t of e)null!=t&&(void 0===n?t>=t&&(n=r=t):(n>t&&(n=t),r<t&&(r=t)));else{let i=-1;for(let s of e)null!=(s=t(s,++i,e))&&(void 0===n?s>=s&&(n=r=s):(n>s&&(n=s),r<s&&(r=s)))}return[n,r]}Zu((function(e){return null===e?NaN:+e})).center;class nc{constructor(){this._partials=new Float64Array(32),this._n=0}add(e){const t=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=t[r],s=e+i,a=Math.abs(e)<Math.abs(i)?e-(s-i):i-(s-e);a&&(t[n++]=a),e=s}return t[n]=e,this._n=n+1,this}valueOf(){const e=this._partials;let t,n,r,i=this._n,s=0;if(i>0){for(s=e[--i];i>0&&(t=s,n=e[--i],s=t+n,r=n-(s-t),!r););i>0&&(r<0&&e[i-1]<0||r>0&&e[i-1]>0)&&(n=2*r,t=s+n,n==t-s&&(s=t))}return s}}const rc=Math.sqrt(50),ic=Math.sqrt(10),sc=Math.sqrt(2);function ac(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),s=r/Math.pow(10,i),a=s>=rc?10:s>=ic?5:s>=sc?2:1;let o,l,u;return i<0?(u=Math.pow(10,-i)/a,o=Math.round(e*u),l=Math.round(t*u),o/u<e&&++o,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*a,o=Math.round(e/u),l=Math.round(t/u),o*u<e&&++o,l*u>
vendor: 10,224 bytes, line 1
1t&&--l),l<o&&.5<=n&&n<2?ac(e,t,2*n):[o,l,u]}function oc(e,t,n){return ac(e=+e,t=+t,n=+n)[2]}function lc(e){return Array.from(function*(e){for(const t of e)yield*t}(e))}function uc(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),s=new Array(i);++r<i;)s[r]=e+r*n;return s}function cc(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function hc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ac(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dc(){}var pc=.7,fc=1/pc,mc="\\s*([+-]?\\d+)\\s*",gc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_c="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vc=/^#([0-9a-f]{3,8})$/,yc=new RegExp(`^rgb\\(${mc},${mc},${mc}\\)$`),xc=new RegExp(`^rgb\\(${_c},${_c},${_c}\\)$`),bc=new RegExp(`^rgba\\(${mc},${mc},${mc},${gc}\\)$`),wc=new RegExp(`^rgba\\(${_c},${_c},${_c},${gc}\\)$`),Tc=new RegExp(`^hsl\\(${gc},${_c},${_c}\\)$`),Sc=new RegExp(`^hsla\\(${gc},${_c},${_c},${gc}\\)$`),Mc={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};function Ec(){return this.rgb().formatHex()}function Cc(){return this.rgb().formatRgb()}function Rc(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=vc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Nc(t):3===n?new Lc(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Pc(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Pc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=yc.exec(e))?new Lc(t[1],t[2],t[3],1):(t=xc.exec(e))?new Lc(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=bc.exec(e))?Pc(t[1],t[2],t[3],t[4]):(t=wc.exec(e))?Pc(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Tc.exec(e))?kc(t[1],t[2]/100,t[3]/100,1):(t=Sc.exec(e))?kc(t[1],t[2]/100,t[3]/100,t[4]):Mc.hasOwnProperty(e)?Nc(Mc[e]):"transparent"===e?new Lc(NaN,NaN,NaN,0):null}function Nc(e){return new Lc(e>>16&255,e>>8&255,255&e,1)}function Pc(e,t,n,r){return r<=0&&(e=t=n=NaN),new Lc(e,t,n,r)}function Dc(e,t,n,r){return 1===arguments.length?function(e){return e instanceof dc||(e=Rc(e)),e?new Lc((e=e.rgb()).r,e.g,e.b,e.opacity):new Lc}(e):new Lc(e,t,n,null==r?1:r)}function Lc(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ic(){return`#${Fc(this.r)}${Fc(this.g)}${Fc(this.b)}`}function Oc(){const e=Bc(this.opacity);return`${1===e?"rgb(":"rgba("}${Uc(this.r)}, ${Uc(this.g)}, ${Uc(this.b)}${1===e?")":`, ${e})`}`}function Bc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fc(e){return((e=Uc(e))<16?"0":"")+e.toString(16)}function kc(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vc(e,t,n,r)}function qc(e){if(e instanceof Vc)return new Vc(e.h,e.s,e.l,e.opacity);if(e instanceof dc||(e=Rc(e)),!e)return new Vc;if(e instanceof Vc)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),a=NaN,o=s-i,l=(s+i)/2;return o?(a=t===s?(n-r)/o+6*(n<r):n===s?(r-t)/o+2:(t-n)/o+4,o/=l<.5?s+i:2-s-i,a*=60):o=l>0&&l<1?0:a,new Vc(a,o,l,e.opacity)}function Vc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function zc(e){return(e=(e||0)%360)<0?e+360:e}function Gc(e){return Math.max(0,Math.min(1,e||0))}function jc(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}hc(dc,Rc,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ec,formatHex:Ec,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return qc(this).formatHsl()},formatRgb:Cc,toString:Cc}),hc(Lc,Dc,Ac(dc,{brighter(e){return e=null==e?fc:Math.pow(fc,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?pc:Math.pow(pc,e),new Lc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lc(Uc(this.r),Uc(this.g),Uc(this.b),Bc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ic,formatHex:Ic,formatHex8:function(){return`#${Fc(this.r)}${Fc(this.g)}${Fc(this.b)}${Fc(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Oc,toString:Oc})),hc(Vc,(function(e,t,n,r){return 1===arguments.length?qc(e):new Vc(e,t,n,null==r?1:r)}),Ac(dc,{brighter(e){return e=null==e?fc:Math.pow(fc,e),new Vc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?pc:Math.pow(pc,e),new Vc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Lc(jc(e>=240?e-240:e+120,i,r),jc(e,i,r),jc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Vc(zc(this.h),Gc(this.s),Gc(this.l),Bc(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Bc(this.opacity);return`${1===e?"hsl(":"hsla("}${zc(this.h)}, ${100*Gc(this.s)}%, ${100*Gc(this.l)}%${1===e?")":`, ${e})`}`}}));var Hc=e=>()=>e;function Wc(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Hc(isNaN(e)?t:e)}var Xc=function e(t){var n=function(e){return 1==(e=+e)?Wc:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Hc(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Dc(e)).r,(t=Dc(t)).r),i=n(e.g,t.g),s=n(e.b,t.b),a=Wc(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=s(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function Qc(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(s){for(n=0;n<r;++n)i[n]=e[n]*(1-s)+t[n]*s;return i}}function Yc(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $c(e,t){return(Yc(t)?Qc:Kc)(e,t)}function Kc(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,s=new Array(i),a=new Array(r);for(n=0;n<i;++n)s[n]=ih(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=s[n](e);return a}}function Zc(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Jc(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function eh(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=ih(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var th=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nh=new RegExp(th.source,"g");function rh(e,t){var n,r,i,s=th.lastIndex=nh.lastIndex=0,a=-1,o=[],l=[];for(e+="",t+="";(n=th.exec(e))&&(r=nh.exec(t));)(i=r.index)>s&&(i=t.slice(s,i),o[a]?o[a]+=i:o[++a]=i),(n=n[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:Jc(n,r)})),s=nh.lastIndex;return s<t.length&&(i=t.slice(s),o[a]?o[a]+=i:o[++a]=i),o.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)o[(n=l[r]).i]=n.x(e);return o.join("")})}function ih(e,t){var n,r=typeof t;return null==t||"boolean"===r?Hc(t):("number"===r?Jc:"string"===r?(n=Rc(t))?(t=n,Xc):rh:t instanceof Rc?Xc:t instanceof Date?Zc:Yc(t)?Qc:Array.isArray(t)?Kc:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?eh:Jc)(e,t)}function sh(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function ah(e){return+e}var oh=[0,1];function lh(e){return e}function uh(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}
vendor: 6,959 bytes, line 1
1function ch(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i<r?(r=uh(i,r),s=n(a,s)):(r=uh(r,i),s=n(s,a)),function(e){return s(r(e))}}function hh(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),s=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=uh(e[a],e[a+1]),s[a]=n(t[a],t[a+1]);return function(t){var n=ec(e,t,1,r)-1;return s[n](i[n](t))}}function Ah(){var e,t,n,r,i,s,a=oh,o=oh,l=ih,u=lh;function c(){var e=Math.min(a.length,o.length);return u!==lh&&(u=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?hh:ch,i=s=null,h}function h(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),o,l)))(e(u(t)))}return h.invert=function(n){return u(t((s||(s=r(o,a.map(e),Jc)))(n)))},h.domain=function(e){return arguments.length?(a=Array.from(e,ah),c()):a.slice()},h.range=function(e){return arguments.length?(o=Array.from(e),c()):o.slice()},h.rangeRound=function(e){return o=Array.from(e),l=sh,c()},h.clamp=function(e){return arguments.length?(u=!!e||lh,c()):u!==lh},h.interpolate=function(e){return arguments.length?(l=e,c()):l},h.unknown=function(e){return arguments.length?(n=e,h):n},function(n,r){return e=n,t=r,c()}}function dh(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ph(e){return(e=dh(Math.abs(e)))?e[1]:NaN}var fh,mh=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function gh(e){if(!(t=mh.exec(e)))throw new Error("invalid format: "+e);var t;return new _h({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function _h(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function vh(e,t){var n=dh(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}gh.prototype=_h.prototype,_h.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var yh={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>vh(100*e,t),r:vh,s:function(e,t){var n=dh(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(fh=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return s===a?r:s>a?r+new Array(s-a+1).join("0"):s>0?r.slice(0,s)+"."+r.slice(s):"0."+new Array(1-s).join("0")+dh(e,Math.max(0,t+s-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function xh(e){return e}var bh,wh,Th,Sh=Array.prototype.map,Mh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Eh(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)==(t=+t))return[e];const r=t<e,[i,s,a]=r?ac(t,e,n):ac(e,t,n);if(!(s>=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let e=0;e<o;++e)l[e]=(s-e)/-a;else for(let e=0;e<o;++e)l[e]=(s-e)*a;else if(a<0)for(let e=0;e<o;++e)l[e]=(i+e)/-a;else for(let e=0;e<o;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return function(e,t,n,r){var i,s=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?oc(t,e,n):oc(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=gh(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ph(t)/3)))-ph(Math.abs(e)))}(s,a))||(r.precision=i),Th(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ph(t)-ph(e))+1}(s,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-ph(Math.abs(e)))}(s))||(r.precision=i-2*("%"===r.type))}return wh(r)}(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,s=t(),a=0,o=s.length-1,l=s[a],u=s[o],c=10;for(u<l&&(i=l,l=u,u=i,i=a,a=o,o=i);c-- >0;){if((i=oc(l,u,n))===r)return s[a]=l,s[o]=u,t(s);if(i>0)l=Math.floor(l/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,u=Math.floor(u*i)/i}r=i}return e},e}function Ch(){var e=Ah()(lh,lh);return e.copy=function(){return t=e,Ch().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},cc.apply(e,arguments),Eh(e)}function Rh(){var e,t=0,n=1,r=1,i=[.5],s=[0,1];function a(t){return null!=t&&t<=t?s[ec(i,t,0,r)]:e}function o(){var e=-1;for(i=new Array(r);++e<r;)i[e]=((e+1)*n-(e-r)*t)/(r+1);return a}return a.domain=function(e){return arguments.length?([t,n]=e,t=+t,n=+n,o()):[t,n]},a.range=function(e){return arguments.length?(r=(s=Array.from(e)).length-1,o()):s.slice()},a.invertExtent=function(e){var a=s.indexOf(e);return a<0?[NaN,NaN]:a<1?[t,i[0]]:a>=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return Rh().domain([t,n]).range(s).unknown(e)},cc.apply(Eh(a),arguments)}bh=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?xh:(t=Sh.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var i=e.length,s=[],a=0,o=t[0],l=0;i>0&&o>0&&(l+o+1>r&&(o=Math.max(1,r-l)),s.push(e.substring(i-=o,i+o)),!((l+=o+1)>r));)o=t[a=(a+1)%t.length];return s.reverse().join(n)}),i=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?xh:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(Sh.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"â":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=gh(e)).fill,n=e.align,h=e.sign,A=e.symbol,d=e.zero,p=e.width,f=e.comma,m=e.precision,g=e.trim,_=e.type;"n"===_?(f=!0,_="g"):yh[_]||(void 0===m&&(m=12),g=!0,_="g"),(d||"0"===t&&"="===n)&&(d=!0,t="0",n="=");var v="$"===A?i:"#"===A&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",y="$"===A?s:/[%p]/.test(_)?l:"",x=yh[_],b=/[defgprs%]/.test(_);function w(e){var i,s,l,A=v,w=y;if("c"===_)w=x(e)+w,e="";else{var T=(e=+e)<0||1/e<0;
vendor: 4,206 bytes, line 1
1if(e=isNaN(e)?c:x(Math.abs(e),m),g&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),T&&0==+e&&"+"!==h&&(T=!1),A=(T?"("===h?h:u:"-"===h||"("===h?"":h)+A,w=("s"===_?Mh[8+fh/3]:"")+w+(T&&"("===h?")":""),b)for(i=-1,s=e.length;++i<s;)if(48>(l=e.charCodeAt(i))||l>57){w=(46===l?a+e.slice(i+1):e.slice(i))+w,e=e.slice(0,i);break}}f&&!d&&(e=r(e,1/0));var S=A.length+e.length+w.length,M=S<p?new Array(p-S+1).join(t):"";switch(f&&d&&(e=r(M+e,M.length?p-w.length:1/0),M=""),n){case"<":e=A+e+w+M;break;case"=":e=A+M+e+w;break;case"^":e=M.slice(0,S=M.length>>1)+A+e+w+M.slice(S);break;default:e=M+A+e+w}return o(e)}return m=void 0===m?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),w.toString=function(){return e+""},w}return{format:h,formatPrefix:function(e,t){var n=h(((e=gh(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(ph(t)/3))),i=Math.pow(10,-r),s=Mh[8+r/3];return function(e){return n(i*e)+s}}}}({thousands:",",grouping:[3],currency:["$",""]}),wh=bh.format,Th=bh.formatPrefix;var Nh=1e-6,Ph=1e-12,Dh=Math.PI,Lh=Dh/2,Ih=Dh/4,Oh=2*Dh,Bh=180/Dh,Uh=Dh/180,Fh=Math.abs,kh=Math.atan,qh=Math.atan2,Vh=Math.cos,zh=Math.ceil,Gh=Math.exp,jh=Math.hypot,Hh=Math.log,Wh=Math.sin,Xh=Math.sign||function(e){return e>0?1:e<0?-1:0},Qh=Math.sqrt,Yh=Math.tan;function $h(e){return e>1?Lh:e<-1?-Lh:Math.asin(e)}function Kh(e){return(e=Wh(e/2))*e}function Zh(){}function Jh(e,t){e&&tA.hasOwnProperty(e.type)&&tA[e.type](e,t)}var eA={Feature:function(e,t){Jh(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)Jh(n[r].geometry,t)}},tA={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){nA(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)nA(n[r],t,0)},Polygon:function(e,t){rA(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)rA(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)Jh(n[r],t)}};function nA(e,t,n){var r,i=-1,s=e.length-n;for(t.lineStart();++i<s;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function rA(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)nA(e[n],t,1);t.polygonEnd()}function iA(e,t){e&&eA.hasOwnProperty(e.type)?eA[e.type](e,t):Jh(e,t)}var sA,aA,oA,lA,uA,cA,hA,AA,dA,pA,fA,mA,gA,_A,vA,yA,xA=new nc,bA=new nc,wA={point:Zh,lineStart:Zh,lineEnd:Zh,polygonStart:function(){xA=new nc,wA.lineStart=TA,wA.lineEnd=SA},polygonEnd:function(){var e=+xA;bA.add(e<0?Oh+e:e),this.lineStart=this.lineEnd=this.point=Zh},sphere:function(){bA.add(Oh)}};function TA(){wA.point=MA}function SA(){EA(sA,aA)}function MA(e,t){wA.point=EA,sA=e,aA=t,oA=e*=Uh,lA=Vh(t=(t*=Uh)/2+Ih),uA=Wh(t)}function EA(e,t){var n=(e*=Uh)-oA,r=n>=0?1:-1,i=r*n,s=Vh(t=(t*=Uh)/2+Ih),a=Wh(t),o=uA*a,l=lA*s+o*Vh(i),u=o*r*Wh(i);xA.add(qh(u,l)),oA=e,lA=s,uA=a}function CA(e){return[qh(e[1],e[0]),$h(e[2])]}function RA(e){var t=e[0],n=e[1],r=Vh(n);return[r*Vh(t),r*Wh(t),Wh(n)]}function NA(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function PA(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function DA(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function LA(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function IA(e){var t=Qh(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var OA,BA,UA,FA,kA,qA,VA,zA,GA,jA,HA,WA,XA,QA,YA,$A,KA={point:ZA,lineStart:ed,lineEnd:td,polygonStart:function(){KA.point=nd,KA.lineStart=rd,KA.lineEnd=id,_A=new nc,wA.polygonStart()},polygonEnd:function(){wA.polygonEnd(),KA.point=ZA,KA.lineStart=ed,KA.lineEnd=td,xA<0?(cA=-(AA=180),hA=-(dA=90)):_A>Nh?dA=90:_A<-1e-6&&(hA=-90),yA[0]=cA,yA[1]=AA},sphere:function(){cA=-(AA=180),hA=-(dA=90)}};function ZA(e,t){vA.push(yA=[cA=e,AA=e]),t<hA&&(hA=t),t>dA&&(dA=t)}function JA(e,t){var n=RA([e*Uh,t*Uh]);if(gA){var r=PA(gA,n),i=PA([r[1],-r[0],0],r);IA(i),i=CA(i);var s,a=e-pA,o=a>0?1:-1,l=i[0]*Bh*o,u=Fh(a)>180;u^(o*pA<l&&l<o*e)?(s=i[1]*Bh)>
vendor: 4,274 bytes, line 1
1dA&&(dA=s):u^(o*pA<(l=(l+360)%360-180)&&l<o*e)?(s=-i[1]*Bh)<hA&&(hA=s):(t<hA&&(hA=t),t>dA&&(dA=t)),u?e<pA?sd(cA,e)>sd(cA,AA)&&(AA=e):sd(e,AA)>sd(cA,AA)&&(cA=e):AA>=cA?(e<cA&&(cA=e),e>AA&&(AA=e)):e>pA?sd(cA,e)>sd(cA,AA)&&(AA=e):sd(e,AA)>sd(cA,AA)&&(cA=e)}else vA.push(yA=[cA=e,AA=e]);t<hA&&(hA=t),t>dA&&(dA=t),gA=n,pA=e}function ed(){KA.point=JA}function td(){yA[0]=cA,yA[1]=AA,KA.point=ZA,gA=null}function nd(e,t){if(gA){var n=e-pA;_A.add(Fh(n)>180?n+(n>0?360:-360):n)}else fA=e,mA=t;wA.point(e,t),JA(e,t)}function rd(){wA.lineStart()}function id(){nd(fA,mA),wA.lineEnd(),Fh(_A)>Nh&&(cA=-(AA=180)),yA[0]=cA,yA[1]=AA,gA=null}function sd(e,t){return(t-=e)<0?t+360:t}function ad(e,t){return e[0]-t[0]}function od(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function ld(e){var t,n,r,i,s,a,o;if(dA=AA=-(cA=hA=1/0),vA=[],iA(e,KA),n=vA.length){for(vA.sort(ad),t=1,s=[r=vA[0]];t<n;++t)od(r,(i=vA[t])[0])||od(r,i[1])?(sd(r[0],i[1])>sd(r[0],r[1])&&(r[1]=i[1]),sd(i[0],r[1])>sd(r[0],r[1])&&(r[0]=i[0])):s.push(r=i);for(a=-1/0,t=0,r=s[n=s.length-1];t<=n;r=i,++t)i=s[t],(o=sd(r[1],i[0]))>a&&(a=o,cA=i[0],AA=r[1])}return vA=yA=null,cA===1/0||hA===1/0?[[NaN,NaN],[NaN,NaN]]:[[cA,hA],[AA,dA]]}var ud={sphere:Zh,point:cd,lineStart:Ad,lineEnd:fd,polygonStart:function(){ud.lineStart=md,ud.lineEnd=gd},polygonEnd:function(){ud.lineStart=Ad,ud.lineEnd=fd}};function cd(e,t){e*=Uh;var n=Vh(t*=Uh);hd(n*Vh(e),n*Wh(e),Wh(t))}function hd(e,t,n){++OA,UA+=(e-UA)/OA,FA+=(t-FA)/OA,kA+=(n-kA)/OA}function Ad(){ud.point=dd}function dd(e,t){e*=Uh;var n=Vh(t*=Uh);QA=n*Vh(e),YA=n*Wh(e),$A=Wh(t),ud.point=pd,hd(QA,YA,$A)}function pd(e,t){e*=Uh;var n=Vh(t*=Uh),r=n*Vh(e),i=n*Wh(e),s=Wh(t),a=qh(Qh((a=YA*s-$A*i)*a+(a=$A*r-QA*s)*a+(a=QA*i-YA*r)*a),QA*r+YA*i+$A*s);BA+=a,qA+=a*(QA+(QA=r)),VA+=a*(YA+(YA=i)),zA+=a*($A+($A=s)),hd(QA,YA,$A)}function fd(){ud.point=cd}function md(){ud.point=_d}function gd(){vd(WA,XA),ud.point=cd}function _d(e,t){WA=e,XA=t,e*=Uh,t*=Uh,ud.point=vd;var n=Vh(t);QA=n*Vh(e),YA=n*Wh(e),$A=Wh(t),hd(QA,YA,$A)}function vd(e,t){e*=Uh;var n=Vh(t*=Uh),r=n*Vh(e),i=n*Wh(e),s=Wh(t),a=YA*s-$A*i,o=$A*r-QA*s,l=QA*i-YA*r,u=jh(a,o,l),c=$h(u),h=u&&-c/u;GA.add(h*a),jA.add(h*o),HA.add(h*l),BA+=c,qA+=c*(QA+(QA=r)),VA+=c*(YA+(YA=i)),zA+=c*($A+($A=s)),hd(QA,YA,$A)}function yd(e){OA=BA=UA=FA=kA=qA=VA=zA=0,GA=new nc,jA=new nc,HA=new nc,iA(e,ud);var t=+GA,n=+jA,r=+HA,i=jh(t,n,r);return i<Ph&&(t=qA,n=VA,r=zA,BA<Nh&&(t=UA,n=FA,r=kA),(i=jh(t,n,r))<Ph)?[NaN,NaN]:[qh(n,t)*Bh,$h(r/i)*Bh]}function xd(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function bd(e,t){return Fh(e)>Dh&&(e-=Math.round(e/Oh)*Oh),[e,t]}function wd(e,t,n){return(e%=Oh)?t||n?xd(Sd(e),Md(t,n)):Sd(e):t||n?Md(t,n):bd}function Td(e){return function(t,n){return Fh(t+=e)>Dh&&(t-=Math.round(t/Oh)*Oh),[t,n]}}function Sd(e){var t=Td(e);return t.invert=Td(-e),t}function Md(e,t){var n=Vh(e),r=Wh(e),i=Vh(t),s=Wh(t);function a(e,t){var a=Vh(t),o=Vh(e)*a,l=Wh(e)*a,u=Wh(t),c=u*n+o*r;return[qh(l*i-c*s,o*n-u*r),$h(c*i+l*s)]}return a.invert=function(e,t){var a=Vh(t),o=Vh(e)*a,l=Wh(e)*a,u=Wh(t),c=u*i-l*s;return[qh(l*i+u*s,o*n+c*r),$h(c*n-o*r)]},a}function Ed(e,t){(t=RA(t))[0]-=e,IA(t);var n=function(e){return e>1?0:e<-1?Dh:Math.acos(e)}(-t[1]);return((-t[2]<0?-n:n)+Oh-Nh)%Oh}function Cd(){var e,t=[];return{point:function(t,n,r){e.push([t,n,r])},lineStart:function(){t.push(e=[])},lineEnd:Zh,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var n=t;return t=[],e=null,n}}}function Rd(e,t){return Fh(e[0]-t[0])<Nh&&Fh(e[1]-t[1])<Nh}function Nd(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Pd(e,t,n,r,i){var s,a,o=[],l=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,n,r=e[0],a=e[t];if(Rd(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),s=0;s<t;++s)i.point((r=e[s])[0],r[1]);return void i.lineEnd()}a[0]+=2e-6}o.push(n=new Nd(r,e,null,!0)),l.push(n.o=new Nd(r,null,n,!1)),o.push(n=new Nd(a,e,null,!1)),l.push(n.o=new Nd(a,null,n,!0))}})),o.length){for(l.sort(t),Dd(o),Dd(l),s=0,a=l.length;s<a;++s)l[s].e=n=!n;for(var u,c,h=o[0];;){for(var A=h,d=!0;A.v;)if((A=A.n)===h)return;u=A.z,i.lineStart();do{if(A.v=A.o.v=!0,A.e){if(d)for(s=0,a=u.length;s<a;
vendor: 4,658 bytes, line 1
1++s)i.point((c=u[s])[0],c[1]);else r(A.x,A.n.x,1,i);A=A.n}else{if(d)for(u=A.p.z,s=u.length-1;s>=0;--s)i.point((c=u[s])[0],c[1]);else r(A.x,A.p.x,-1,i);A=A.p}u=(A=A.o).z,d=!d}while(!A.v);i.lineEnd()}}}function Dd(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function Ld(e){return Fh(e[0])<=Dh?e[0]:Xh(e[0])*((Fh(e[0])+Dh)%Oh-Dh)}function Id(e,t){var n=Ld(t),r=t[1],i=Wh(r),s=[Wh(n),-Vh(n),0],a=0,o=0,l=new nc;1===i?r=Lh+Nh:-1===i&&(r=-Lh-Nh);for(var u=0,c=e.length;u<c;++u)if(A=(h=e[u]).length)for(var h,A,d=h[A-1],p=Ld(d),f=d[1]/2+Ih,m=Wh(f),g=Vh(f),_=0;_<A;++_,p=y,m=b,g=w,d=v){var v=h[_],y=Ld(v),x=v[1]/2+Ih,b=Wh(x),w=Vh(x),T=y-p,S=T>=0?1:-1,M=S*T,E=M>Dh,C=m*b;if(l.add(qh(C*S*Wh(M),g*w+C*Vh(M))),a+=E?T+S*Oh:T,E^p>=n^y>=n){var R=PA(RA(d),RA(v));IA(R);var N=PA(s,R);IA(N);var P=(E^T>=0?-1:1)*$h(N[2]);(r>P||r===P&&(R[0]||R[1]))&&(o+=E^T>=0?1:-1)}}return(a<-1e-6||a<Nh&&l<-1e-12)^1&o}function Od(e,t,n,r){return function(i){var s,a,o,l=t(i),u=Cd(),c=t(u),h=!1,A={point:d,lineStart:f,lineEnd:m,polygonStart:function(){A.point=g,A.lineStart=_,A.lineEnd=v,a=[],s=[]},polygonEnd:function(){A.point=d,A.lineStart=f,A.lineEnd=m,a=lc(a);var e=Id(s,r);a.length?(h||(i.polygonStart(),h=!0),Pd(a,Ud,e,n,i)):e&&(h||(i.polygonStart(),h=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),h&&(i.polygonEnd(),h=!1),a=s=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(t,n){e(t,n)&&i.point(t,n)}function p(e,t){l.point(e,t)}function f(){A.point=p,l.lineStart()}function m(){A.point=d,l.lineEnd()}function g(e,t){o.push([e,t]),c.point(e,t)}function _(){c.lineStart(),o=[]}function v(){g(o[0][0],o[0][1]),c.lineEnd();var e,t,n,r,l=c.clean(),A=u.result(),d=A.length;if(o.pop(),s.push(o),o=null,d)if(1&l){if((t=(n=A[0]).length-1)>0){for(h||(i.polygonStart(),h=!0),i.lineStart(),e=0;e<t;++e)i.point((r=n[e])[0],r[1]);i.lineEnd()}}else d>1&&2&l&&A.push(A.pop().concat(A.shift())),a.push(A.filter(Bd))}return A}}function Bd(e){return e.length>1}function Ud(e,t){return((e=e.x)[0]<0?e[1]-Lh-Nh:Lh-e[1])-((t=t.x)[0]<0?t[1]-Lh-Nh:Lh-t[1])}bd.invert=bd;var Fd=Od((function(){return!0}),(function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(s,a){var o=s>0?Dh:-Dh,l=Fh(s-n);Fh(l-Dh)<Nh?(e.point(n,r=(r+a)/2>0?Lh:-Lh),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(o,r),e.point(s,r),t=0):i!==o&&l>=Dh&&(Fh(n-i)<Nh&&(n-=i*Nh),Fh(s-o)<Nh&&(s-=o*Nh),r=function(e,t,n,r){var i,s,a=Wh(e-n);return Fh(a)>Nh?kh((Wh(t)*(s=Vh(r))*Wh(n)-Wh(r)*(i=Vh(t))*Wh(e))/(i*s*a)):(t+r)/2}(n,r,s,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(o,r),t=0),e.point(n=s,r=a),i=o},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}}),(function(e,t,n,r){var i;if(null==e)i=n*Lh,r.point(-Dh,i),r.point(0,i),r.point(Dh,i),r.point(Dh,0),r.point(Dh,-i),r.point(0,-i),r.point(-Dh,-i),r.point(-Dh,0),r.point(-Dh,i);else if(Fh(e[0]-t[0])>Nh){var s=e[0]<t[0]?Dh:-Dh;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}),[-Dh,-Lh]);function kd(e){var t=Vh(e),n=2*Uh,r=t>0,i=Fh(t)>Nh;function s(e,n){return Vh(e)*Vh(n)>t}function a(e,n,r){var i=[1,0,0],s=PA(RA(e),RA(n)),a=NA(s,s),o=s[0],l=a-o*o;if(!l)return!r&&e;var u=t*a/l,c=-t*o/l,h=PA(i,s),A=LA(i,u);DA(A,LA(s,c));var d=h,p=NA(A,d),f=NA(d,d),m=p*p-f*(NA(A,A)-1);if(!(m<0)){var g=Qh(m),_=LA(d,(-p-g)/f);if(DA(_,A),_=CA(_),!r)return _;var v,y=e[0],x=n[0],b=e[1],w=n[1];x<y&&(v=y,y=x,x=v);var T=x-y,S=Fh(T-Dh)<Nh;if(!S&&w<b&&(v=b,b=w,w=v),S||T<Nh?S?b+w>0^_[1]<(Fh(_[0]-y)<Nh?b:w):b<=_[1]&&_[1]<=w:T>Dh^(y<=_[0]&&_[0]<=x)){var M=LA(d,(-p+g)/f);return DA(M,A),[_,CA(M)]}}}function o(t,n){var i=r?e:Dh-e,s=0;return t<-i?s|=1:t>i&&(s|=2),n<-i?s|=4:n>i&&(s|=8),s}return Od(s,(function(e){var t,n,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(h,A){var d,p=[h,A],f=s(h,A),m=r?f?0:o(h,A):f?o(h+(h<0?Dh:-Dh),A):0;if(!t&&(u=l=f)&&e.lineStart(),f!==l&&(!(d=a(t,p))||Rd(t,d)||Rd(p,d))&&(p[2]=1),f!==l)c=0,f?(e.lineStart(),d=a(p,t),e.point(d[0],d[1])):(d=a(t,p),e.point(d[0],d[1],2),e.lineEnd()),t=d;else if(i&&t&&r^f){var g;m&n||!(g=a(p,t,!0))||(c=0,r?(e.lineStart(),e.point(g[0][0],g[0][1]),e.point(g[1][0],g[1][1]),e.lineEnd()):(e.point(g[1][0],g[1][1]),e.lineEnd(),e.lineStart(),e.point(g[0][0],g[0][1],3)))}!f||t&&Rd(t,p)||e.point(p[0],p[1]),t=p,l=f,n=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}}),(function(t,r,i,s){!function(e,t,n,r,i,s){if(n){var a=Vh(t),o=Wh(t),l=r*n;null==i?(i=t+r*Oh,s=t-l/2):(i=Ed(a,i),s=Ed(a,s),(r>0?i<s:i>s)&&(i+=r*Oh));for(var u,c=i;r>0?c>s:c<s;c-=l)u=CA([a,-o*Vh(c),-o*Wh(c)]),e.point(u[0],u[1])}}(s,e,n,i,t,r)}
vendor: 9,681 bytes, line 1
1),r?[0,-e]:[-Dh,e-Dh])}var qd,Vd,zd,Gd,jd=1e9,Hd=-jd;function Wd(e,t,n,r){function i(i,s){return e<=i&&i<=n&&t<=s&&s<=r}function s(i,s,o,u){var c=0,h=0;if(null==i||(c=a(i,o))!==(h=a(s,o))||l(i,s)<0^o>0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+o+4)%4)!==h);else u.point(s[0],s[1])}function a(r,i){return Fh(r[0]-e)<Nh?i>0?0:3:Fh(r[0]-n)<Nh?i>0?2:1:Fh(r[1]-t)<Nh?i>0?1:0:i>0?3:2}function o(e,t){return l(e.x,t.x)}function l(e,t){var n=a(e,1),r=a(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}return function(a){var l,u,c,h,A,d,p,f,m,g,_,v=a,y=Cd(),x={point:b,lineStart:function(){x.point=w,u&&u.push(c=[]),g=!0,m=!1,p=f=NaN},lineEnd:function(){l&&(w(h,A),d&&m&&y.rejoin(),l.push(y.result())),x.point=b,m&&v.lineEnd()},polygonStart:function(){v=y,l=[],u=[],_=!0},polygonEnd:function(){var t=function(){for(var t=0,n=0,i=u.length;n<i;++n)for(var s,a,o=u[n],l=1,c=o.length,h=o[0],A=h[0],d=h[1];l<c;++l)s=A,a=d,A=(h=o[l])[0],d=h[1],a<=r?d>r&&(A-s)*(r-a)>(d-a)*(e-s)&&++t:d<=r&&(A-s)*(r-a)<(d-a)*(e-s)&&--t;return t}(),n=_&&t,i=(l=lc(l)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),i&&Pd(l,o,t,s,a),a.polygonEnd()),v=a,l=u=c=null}};function b(e,t){i(e,t)&&v.point(e,t)}function w(s,a){var o=i(s,a);if(u&&c.push([s,a]),g)h=s,A=a,d=o,g=!1,o&&(v.lineStart(),v.point(s,a));else if(o&&m)v.point(s,a);else{var l=[p=Math.max(Hd,Math.min(jd,p)),f=Math.max(Hd,Math.min(jd,f))],y=[s=Math.max(Hd,Math.min(jd,s)),a=Math.max(Hd,Math.min(jd,a))];!function(e,t,n,r,i,s){var a,o=e[0],l=e[1],u=0,c=1,h=t[0]-o,A=t[1]-l;if(a=n-o,h||!(a>0)){if(a/=h,h<0){if(a<u)return;a<c&&(c=a)}else if(h>0){if(a>c)return;a>u&&(u=a)}if(a=i-o,h||!(a<0)){if(a/=h,h<0){if(a>c)return;a>u&&(u=a)}else if(h>0){if(a<u)return;a<c&&(c=a)}if(a=r-l,A||!(a>0)){if(a/=A,A<0){if(a<u)return;a<c&&(c=a)}else if(A>0){if(a>c)return;a>u&&(u=a)}if(a=s-l,A||!(a<0)){if(a/=A,A<0){if(a>c)return;a>u&&(u=a)}else if(A>0){if(a<u)return;a<c&&(c=a)}return u>0&&(e[0]=o+u*h,e[1]=l+u*A),c<1&&(t[0]=o+c*h,t[1]=l+c*A),!0}}}}}(l,y,e,t,n,r)?o&&(v.lineStart(),v.point(s,a),_=!1):(m||(v.lineStart(),v.point(l[0],l[1])),v.point(y[0],y[1]),o||v.lineEnd(),_=!1)}p=s,f=a,m=o}return x}}var Xd={sphere:Zh,point:Zh,lineStart:function(){Xd.point=Yd,Xd.lineEnd=Qd},lineEnd:Zh,polygonStart:Zh,polygonEnd:Zh};function Qd(){Xd.point=Xd.lineEnd=Zh}function Yd(e,t){Vd=e*=Uh,zd=Wh(t*=Uh),Gd=Vh(t),Xd.point=$d}function $d(e,t){e*=Uh;var n=Wh(t*=Uh),r=Vh(t),i=Fh(e-Vd),s=Vh(i),a=r*Wh(i),o=Gd*n-zd*r*s,l=zd*n+Gd*r*s;qd.add(qh(Qh(a*a+o*o),l)),Vd=e,zd=n,Gd=r}var Kd=[null,null],Zd={type:"LineString",coordinates:Kd};function Jd(e,t){return Kd[0]=e,Kd[1]=t,function(e){return qd=new nc,iA(e,Xd),+qd}(Zd)}var ep={Feature:function(e,t){return np(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)if(np(n[r].geometry,t))return!0;return!1}},tp={Sphere:function(){return!0},Point:function(e,t){return rp(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(rp(n[r],t))return!0;return!1},LineString:function(e,t){return ip(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(ip(n[r],t))return!0;return!1},Polygon:function(e,t){return sp(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)if(sp(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)if(np(n[r],t))return!0;return!1}};function np(e,t){return!(!e||!tp.hasOwnProperty(e.type))&&tp[e.type](e,t)}function rp(e,t){return 0===Jd(e,t)}function ip(e,t){for(var n,r,i,s=0,a=e.length;s<a;s++){if(0===(r=Jd(e[s],t)))return!0;if(s>0&&(i=Jd(e[s],e[s-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))<Ph*i)return!0;n=r}return!1}function sp(e,t){return!!Id(e.map(ap),op(t))}function ap(e){return(e=e.map(op)).pop(),e}function op(e){return[e[0]*Uh,e[1]*Uh]}function lp(e,t,n){var r=uc(e,t-Nh,n).concat(t);return function(e){return r.map((function(t){return[e,t]}))}}function up(e,t,n){var r=uc(e,t-Nh,n).concat(t);return function(e){return r.map((function(t){return[t,e]}))}}function cp(e,t){var n=e[0]*Uh,r=e[1]*Uh,i=t[0]*Uh,s=t[1]*Uh,a=Vh(r),o=Wh(r),l=Vh(s),u=Wh(s),c=a*Vh(n),h=a*Wh(n),A=l*Vh(i),d=l*Wh(i),p=2*$h(Qh(Kh(s-r)+a*l*Kh(i-n))),f=Wh(p),m=p?function(e){var t=Wh(e*=p)/f,n=Wh(p-e)/f,r=n*c+t*A,i=n*h+t*d,s=n*o+t*u;return[qh(i,r)*Bh,qh(s,Qh(r*r+i*i))*Bh]}:function(){return[n*Bh,r*Bh]};return m.distance=p,m}var hp=e=>e,Ap=1/0,dp=Ap,pp=-Ap,fp=pp,mp={point:function(e,t){e<Ap&&(Ap=e),e>pp&&(pp=e),t<dp&&(dp=t),t>fp&&(fp=t)},lineStart:Zh,lineEnd:Zh,polygonStart:Zh,polygonEnd:Zh,result:function(){var e=[[Ap,dp],[pp,fp]];return pp=fp=-(dp=Ap=1/0),e}};function gp(e){return function(t){var n=new _p;for(var r in e)n[r]=e[r];return n.stream=t,n}}function _p(){}function vp(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=r&&e.clipExtent(null),iA(n,e.stream(mp)),t(mp.result()),null!=r&&e.clipExtent(r),e}function yp(e,t,n){return vp(e,(function(n){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+t[0][0]+(r-s*(n[1][0]+n[0][0]))/2,o=+t[0][1]+(i-s*(n[1][1]+n[0][1]))/2;e.scale(150*s).translate([a,o])}),n)}_p.prototype={constructor:_p,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var xp=Vh(30*Uh);function bp(e,t){return+t?function(e,t){function n(r,i,s,a,o,l,u,c,h,A,d,p,f,m){var g=u-r,_=c-i,v=g*g+_*_;if(v>4*t&&f--){var y=a+A,x=o+d,b=l+p,w=Qh(y*y+x*x+b*b),T=$h(b/=w),S=Fh(Fh(b)-1)<Nh||Fh(s-h)<Nh?(s+h)/2:qh(x,y),M=e(S,T),E=M[0],C=M[1],R=E-r,N=C-i,P=_*R-g*N;(P*P/v>t||Fh((g*R+_*N)/v-.5)>.3||a*A+o*d+l*p<xp)&&(n(r,i,s,a,o,l,E,C,S,y/=w,x/=w,b,f,m),m.point(E,C),n(E,C,S,y,x,b,u,c,h,A,d,p,f,m))}}return function(t){var r,i,s,a,o,l,u,c,h,A,d,p,f={point:m,lineStart:g,lineEnd:v,polygonStart:function(){t.polygonStart(),f.lineStart=y},polygonEnd:function(){t.polygonEnd(),f.lineStart=g}};function m(n,r){n=e(n,r),t.point(n[0],n[1])}function g(){c=NaN,f.point=_,t.lineStart()}function _(r,i){var s=RA([r,i]),a=e(r,i);n(c,h,u,A,d,p,c=a[0],h=a[1],u=r,A=s[0],d=s[1],p=s[2],16,t),t.point(c,h)}function v(){f.point=m,t.lineEnd()}function y(){g(),f.point=x,f.lineEnd=b}function x(e,t){_(r=e,t),i=c,s=h,a=A,o=d,l=p,f.point=_}function b(){n(c,h,u,A,d,p,i,s,r,a,o,l,16,t),f.lineEnd=v,v()}return f}}(e,t):function(e){return gp({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}(e)}var wp=gp({point:function(e,t){this.stream.point(e*Uh,t*Uh)}});function Tp(e,t,n,r,i,s){if(!s)return function(e,t,n,r,i){function s(s,a){return[t+e*(s*=r),n-e*(a*=i)]}return s.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*i]},s}(e,t,n,r,i);var a=Vh(s),o=Wh(s),l=a*e,u=o*e,c=a/e,h=o/e,A=(o*n-a*t)/e,d=(o*t+a*n)/e;function p(e,s){return[l*(e*=r)-u*(s*=i)+t,n-u*e-l*s]}return p.invert=function(e,t){return[r*(c*e-h*t+A),i*(d-h*e-c*t)]},p}function Sp(e,t){return[e,Hh(Yh((Lh+t)/2))]}function Mp(e,t){var n=Vh(t),r=1+Vh(e)*n;return[n*Wh(e)/r,Wh(t)/r]}function Ep(){return function(e){return function(e){var t,n,r,i,s,a,o,l,u,c,h=150,A=480,d=250,p=0,f=0,m=0,g=0,_=0,v=0,y=1,x=1,b=null,w=Fd,T=null,S=hp,M=.5;function E(e){return l(e[0]*Uh,e[1]*Uh)}function C(e){return(e=l.invert(e[0],e[1]))&&[e[0]*Bh,e[1]*Bh]}function R(){var e=Tp(h,0,0,y,x,v).apply(null,t(p,f)),r=Tp(h,A-e[0],d-e[1],y,x,v);return n=wd(m,g,_),o=xd(t,r),l=xd(n,o),a=bp(o,M),N()}function N(){return u=c=null,E}return E.stream=function(e){return u&&c===e?u:u=wp(function(e){return gp({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}(n)(w(a(S(c=e)))))},E.preclip=function(e){return arguments.length?(w=e,b=void 0,N()):w},E.postclip=function(e){return arguments.length?(S=e,T=r=i=s=null,N()):S},E.clipAngle=function(e){return arguments.length?(w=+e?kd(b=e*Uh):(b=null,Fd),N()):b*Bh},E.clipExtent=function(e){return arguments.length?(S=null==e?(T=r=i=s=null,hp):Wd(T=+e[0][0],r=+e[0][1],i=+e[1][0],s=+e[1][1]),N()):null==T?null:[[T,r],[i,s]]},E.scale=function(e){return arguments.length?(h=+e,R()):h},E.translate=function(e){return arguments.length?(A=+e[0],d=+e[1],R()):[A,d]},E.center=function(e){return arguments.length?(p=e[0]%360*Uh,f=e[1]%360*Uh,R()):[p*Bh,f*Bh]},E.rotate=function(e){return arguments.length?(m=e[0]%360*Uh,g=e[1]%360*Uh,_=e.length>2?e[2]%360*Uh:0,R()):[m*Bh,g*Bh,_*Bh]},E.angle=function(e){return arguments.length?(v=e%360*Uh,R()):v*Bh},E.reflectX=function(e){return arguments.length?(y=e?-1:1,R()):y<0},E.reflectY=function(e){return arguments.length?(x=e?-1:1,R()):x<0},E.precision=function(e){return arguments.length?(a=bp(o,M=e*e),N()):Qh(M)},E.fitExtent=function(e,t){return yp(E,e,t)},E.fitSize=function(e,t){return function(e,t,n){return yp(e,[[0,0],t],n)}(E,e,t)},E.fitWidth=function(e,t){return function(e,t,n){return vp(e,(function(n){var r=+t,i=r/(n[1][0]-n[0][0]),s=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];e.scale(150*i).translate([s,a])}),n)}(E,e,t)},E.fitHeight=function(e,t){return function(e,t,n){return vp(e,(function(n){var r=+t,i=r/(n[1][1]-n[0][1]),s=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;e.scale(150*i).translate([s,a])}),n)}(E,e,t)},function(){return t=e.apply(this,arguments),E.invert=t.invert&&C,R()}}((function(){return e}))()}(Mp).scale(250).clipAngle(142)}function Cp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Rp(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}
vendor: 1,047 bytes, line 1
1function Np(e,t,n){return t=Bp(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Up()?Reflect.construct(t,[],Bp(e).constructor):t.apply(e,n))}function Pp(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dp(e,t){return e.get(Rp(e,t))}function Lp(e,t,n){Pp(e,t),t.set(e,n)}function Ip(e,t,n){return e.set(Rp(e,t),n),n}function Op(e,t,n){return(t=Vp(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bp(e){return Bp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bp(e)}function Up(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Up=function(){return!!e})()}
1function Fp(e,t){return Fp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fp(e,t)}function kp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||zp(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qp(e){return function(e){if(Array.isArray(e))return Cp(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||zp(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vp(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function zp(e,t){if(e){if("string"==typeof e)return Cp(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cp(e,t):void 0}}Sp.invert=function(e,t){return[e,2*kh(Gh(t))-Lh]},Mp.invert=function(e,t){var n=Qh(e*e+t*t),r=function(e){return 2*kh(e)}(n),i=Wh(r),s=Vh(r);return[qh(e*i,n*s),$h(n&&t*i/n)]};var Gp=function(e){e instanceof Array?e.forEach(Gp):(e.map&&e.map.dispose(),e.dispose())},jp=function(e){e.geometry&&e.geometry.dispose(),e.material&&Gp(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(jp)},Hp=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),jp(t)}};function Wp(e,t,n){var r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return{x:n*Math.sin(r)*Math.cos(i),y:n*Math.cos(r),z:n*Math.sin(r)*Math.sin(i)}}function Xp(e){return e*Math.PI/180}var Qp=function(e){return 1-(Sp(0,(.5-e)*Math.PI)[1]/Math.PI+1)/2},Yp=function(e){return Math.max(0,Math.min(1,Qp(e)))},$p=function(e){return.5-Sp.invert(0,(2*(1-e)-1)*Math.PI)[1]/Math.PI},Kp=function(e,t,n,r){var i=Math.pow(2,e),s=Math.max(0,Math.min(i-1,Math.floor((n+180)*i/360))),a=(90-r)/180;return t&&(a=Math.max(0,Math.min(1,Qp(a)))),[s,Math.floor(a*i)]},Zp=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,s=arguments.length>5?arguments[5]:void 0,a=[],o=Math.pow(2,e),l=360/o,u=180/o,c=void 0===i?o-1:i,h=void 0===s?o-1:s,A=n,d=Math.min(o-1,c);A<=d;A++)for(var p=r,f=Math.min(o-1,h);p<=f;p++){var m=p,g=u;t&&(m=0===p?p:$p(p/o)*o,g=180*((p+1===o?p+1:$p((p+1)/o)*o)-m)/o);var _=(A+.5)*l-180,v=90-(180*m/o+g/2),y=g;a.push({x:A,y:p,lng:_,lat:v,latLen:y})}return a},Jp=new WeakMap,ef=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf=new WeakMap,sf=new WeakMap,af=new WeakMap,of=new WeakMap,lf=new WeakSet,uf=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.tileUrl,s=r.minLevel,a=void 0===s?0:s,o=r.maxLevel,l=void 0===o?17:o,u=r.mercatorProjection,c=void 0===u||u;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){Pp(e,t),t.add(e)}(n=Np(this,t),lf),Lp(n,Jp,void 0),Lp(n,ef,void 0),Lp(n,tf,void 0),Lp(n,nf,void 0),Lp(n,rf,{}),Lp(n,sf,void 0),Lp(n,af,void 0),Lp(n,of,void 0),Op(n,"minLevel",void 0),Op(n,"maxLevel",void 0),Op(n,"thresholds",qp(new Array(30)).map((function(e,t){return 8/Math.pow(2,t)}))),Op(n,"curvatureResolution",5),Op(n,"tileMargin",0),Op(n,"clearTiles",(function(){Object.values(Dp(rf,n)).forEac
1h((function(e){e.forEach((function(e){e.obj&&(n.remove(e.obj),Hp(e.obj),delete e.obj)}))})),Ip(rf,n,{})})),Ip(Jp,n,e),n.tileUrl=i,Ip(ef,n,c),n.minLevel=a,n.maxLevel=l,n.level=0,n.add(Ip(of,n,new Tr(new Ms(.99*Dp(Jp,n),180,90),new Xn({color:0})))),Dp(of,n).visible=!1,Dp(of,n).material.polygonOffset=!0,Dp(of,n).material.polygonOffsetUnits=3,Dp(of,n).material.polygonOffsetFactor=1,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fp(e,t)}(t,e),function(e,t,n){return function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Vp(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"tileUrl",get:function(){return Dp(tf,this)},set:function(e){Ip(tf,this,e),this.updatePov(Dp(af,this))}},{key:"level",get:function(){return Dp(nf,this)},set:function(e){var t=this;Dp(rf,this)[e]||Rp(lf,this,cf).call(this,e);var n=Dp(nf,this);if(Ip(nf,this,e),e!==n&&void 0!==n){if(Dp(of,this).visible=e>0,Dp(rf,this)[e].forEach((function(e){return e.obj&&(e.obj.material.depthWrite=!0)}
vendor: 7,248 bytes, line 1
1)),n<e&&Dp(rf,this)[n].forEach((function(e){return e.obj&&(e.obj.material.depthWrite=!1)})),n>e)for(var r=e+1;r<=n;r++)Dp(rf,this)[r]&&Dp(rf,this)[r].forEach((function(e){e.obj&&(t.remove(e.obj),Hp(e.obj),delete e.obj)}));Rp(lf,this,hf).call(this)}}},{key:"updatePov",value:function(e){var t,n=this;if(e&&e instanceof Dr&&(Ip(af,this,e),Ip(sf,this,(function(r){if(!r.hullPnts){var i=360/Math.pow(2,n.level),s=r.lng,a=r.lat,o=r.latLen,l=s-i/2,u=s+i/2,c=a-o/2,h=a+o/2;r.hullPnts=[[a,s],[c,l],[h,l],[c,u],[h,u]].map((function(e){var t=kp(e,2);return Wp(t[0],t[1],Dp(Jp,n))})).map((function(e){var t=e.x,n=e.y,r=e.z;return new Ke(t,n,r)}))}return t||(t=new ni,e.updateMatrix(),e.updateMatrixWorld(),t.setFromProjectionMatrix((new $t).multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse))),r.hullPnts.some((function(e){return t.containsPoint(e.clone().applyMatrix4(n.matrixWorld))}))})),this.tileUrl)){var r=(e.position.clone().distanceTo(this.getWorldPosition(new Ke))-Dp(Jp,this))/Dp(Jp,this),i=this.thresholds.findIndex((function(e){return e&&e<=r}));this.level=Math.min(this.maxLevel,Math.max(this.minLevel,i<0?this.thresholds.length:i)),Rp(lf,this,hf).call(this)}}}])}(Vr);function cf(e){var t=this;if(e>7)Dp(rf,this)[e]=[];else{var n=Dp(rf,this)[e]=Zp(e,Dp(ef,this));n.forEach((function(e){return e.centroid=Wp(e.lat,e.lng,Dp(Jp,t))})),n.octree=Wu().x((function(e){return e.centroid.x})).y((function(e){return e.centroid.y})).z((function(e){return e.centroid.z})).addAll(n)}}function hf(){var e=this;if(this.tileUrl&&void 0!==this.level&&Dp(rf,this).hasOwnProperty(this.level)&&(Dp(sf,this)||!(this.level>6))){var t=Dp(rf,this)[this.level];if(Dp(af,this)){var n=this.worldToLocal(Dp(af,this).position.clone());if(t.octree){var r,i=this.worldToLocal(Dp(af,this).position.clone()),s=3*(i.length()-Dp(Jp,this));t=(r=t.octree).findAllWithinRadius.apply(r,qp(i).concat([s]))}else{var a=function(e){var t=e.x,n=e.y,r=e.z,i=Math.sqrt(t*t+n*n+r*r),s=Math.acos(n/i),a=Math.atan2(r,t);return{lat:90-180*s/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),r:i}}(n),o=90*(a.r/Dp(Jp,this)-1),l=o/Math.cos(Xp(a.lat)),u=[a.lng-l,a.lng+l],c=[a.lat+o,a.lat-o],h=kp(Kp(this.level,Dp(ef,this),u[0],c[0]),2),A=h[0],d=h[1],p=kp(Kp(this.level,Dp(ef,this),u[1],c[1]),2),f=p[0],m=p[1];!t.record&&(t.record={});var g=t.record;if(g.hasOwnProperty("".concat(Math.round((A+f)/2),"_").concat(Math.round((d+m)/2)))){for(var _=[],v=A;v<=f;v++)for(var y=d;y<=m;y++){var x="".concat(v,"_").concat(y);g.hasOwnProperty(x)||(g[x]=Zp(this.level,Dp(ef,this),v,y,v,y)[0],t.push(g[x])),_.push(g[x])}t=_}else t=Zp(this.level,Dp(ef,this),A,d,f,m).map((function(e){var n="".concat(e.x,"_").concat(e.y);return g.hasOwnProperty(n)?g[n]:(g[n]=e,t.push(e),e)}))}}t.filter((function(e){return!e.obj})).filter(Dp(sf,this)||function(){return!0}).forEach((function(t){var n=t.x,r=t.y,i=t.lng,s=t.lat,a=t.latLen,o=360/Math.pow(2,e.level);if(!t.obj){var l=o*(1-e.tileMargin),u=a*(1-e.tileMargin),c=Xp(i),h=Xp(-s),A=new Tr(new Ms(Dp(Jp,e),Math.ceil(l/e.curvatureResolution),Math.ceil(u/e.curvatureResolution),Xp(90-l/2)+c,Xp(l),Xp(90-u/2)+h,Xp(u)),new Ds);if(Dp(ef,e)){var d=kp([s+a/2,s-a/2].map((function(e){return.5-e/180})),2),p=d[0],f=d[1];!function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=Ch().domain([1,0]).range([t,n]).clamp(!0),i=Ch().domain([Yp(t),Yp(n)]).range([1,0]).clamp(!0),s=function(e){return i(Yp(r(e)))},a=e.array,o=0,l=a.length;o<l;o+=2)a[o+1]=s(a[o+1]);e.needsUpdate=!0}(A.geometry.attributes.uv,p,f)}t.obj=A}t.loading||(t.loading=!0,(new ks).load(e.tileUrl(n,r,e.level),(function(n){var r=t.obj;r&&(n.colorSpace=Se,r.material.map=n,r.material.color=null,r.material.needsUpdate=!0,e.add(r)),t.loading=!1})))}))}}function Af(e,t,n=2){const r=t&&t.length,i=r?t[0]*n:e.length;let s=df(e,0,i,n,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,u;if(r&&(s=function(e,t,n,r){const i=[];for(let n=0,s=t.length;n<s;n++){const a=df(e,t[n]*r,n<s-1?t[n+1]*r:e.length,r,!1);a===a.next&&(a.steiner=!0),i.push(Tf(a))}i.sort(yf);for(let e=0;e<i.length;e++)n=xf(i[e],n);return n}(e,t,s,n)),e.length>80*n){o=1/0,l=1/0;let t=-1/0,r=-1/0;for(let s=n;s<i;s+=n){const n=e[s],i=e[s+1];n<o&&(o=n),i<l&&(l=i),n>t&&(t=n),i>r&&(r=i)}u=Math.max(t-o,r-l),u=0!==u?32767/u:0}return ff(s,a,n,o,l,u,0),a}function df(e,t,n,r,i){let s;if(i===function(e,t,n,r){let i=0;for(let s=t,a=n-r;s<n;s+=r)i+=(e[a]-e[s])*(e[s+1]+e[a+1]),a=s;return i}(e,t,n,r)>0)for(let i=t;i<n;i+=r)s=Of(i/r|0,e[i],e[i+1],s);else for(let i=n-r;i>=t;i-=r)s=Of(i/r|0,e[i],e[i+1],s);return s&&Rf(s,s.next)&&(Bf(s),s=s.next),s}function pf(e,t){if(!e)return e;t||(t=e);let n,r=e;do{if(n=!1,r.steiner||!Rf(r,r.next)&&0!==Cf(r.prev,r,r.next))r=r.next;else{if(Bf(r),r=t=r.prev,r===r.next)break;n=!0}}while(n||r!==t);return t}function ff(e,t,n,r,i,s,a){if(!e)return;!a&&s&&function(e,t,n,r){let i=e;do{0===i.z&&(i.z=wf(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,n=1;do{let r,i=e;e=null;let s=null;for(t=0;i;){t++;let a=i,o=0;for(let e=0;e<n&&(o++,a=a.nextZ,a);e++);let l=n;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||i.z<=a.z)?(r=i,i=i.nextZ,o--):(r=a,a=a.nextZ,l--),s?s.nextZ=r:e=r,r.prevZ=s,s=r;i=a}s.nextZ=null,n*=2}while(t>1)}(i)}(e,r,i,s);let o=e;for(;e.prev!==e.next;){const l=e.prev,u=e.next;if(s?gf(e,r,i,s):mf(e))t.push(l.i,e.i,u.i),Bf(e),e=u.next,o=u.next;else if((e=u)===o){a?1===a?ff(e=_f(pf(e),t),t,n,r,i,s,2):2===a&&vf(e,t,n,r,i,s):ff(pf(e),t,n,r,i,s,1);break}}}function mf(e){const t=e.prev,n=e,r=e.next;if(Cf(t,n,r)>=0)return!1;const i=t.x,s=n.x,a=r.x,o=t.y,l=n.y,u=r.y,c=Math.min(i,s,a),h=Math.min(o,l,u),A=Math.max(i,s,a),d=Math.max(o,l,u);let p=r.next;for(;p!==t;){if(p.x>=c&&p.x<=A&&p.y>=h&&p.y<=d&&Mf(i,o,s,l,a,u,p.x,p.y)&&Cf(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function gf(e,t,n,r){const i=e.prev,s=e,a=e.next;if(Cf(i,s,a)>=0)return!1;const o=i.x,l=s.x,u=a.x,c=i.y,h=s.y,A=a.y,d=Math.min(o,l,u),p=Math.min(c,h,A),f=Math.max(o,l,u),m=Math.max(c,h,A),g=wf(d,p,t,n,r),_=wf(f,m,t,n,r);let v=e.prevZ,y=e.nextZ;for(;v&&v.z>=g&&y&&y.z<=_;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==i&&v!==a&&Mf(o,c,l,h,u,A,v.x,v.y)&&Cf(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&Mf(o,c,l,h,u,A,y.x,y.y)&&Cf(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;v&&v.z>=g;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=m&&v!==i&&v!==a&&Mf(o,c,l,h,u,A,v.x,v.y)&&Cf(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;y&&y.z<=_;){if(y.x>=d&&y.x<=f&&y.y>=p&&y.y<=m&&y!==i&&y!==a&&Mf(o,c,l,h,u,A,y.x,y.y)&&Cf(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function _f(e,t){let n=e;do{const r=n.prev,i=n.next.next;!Rf(r,i)&&Nf(r,n,n.next,i)&&Lf(r,i)&&Lf(i,r)&&(t.push(r.i,n.i,i.i),Bf(n),Bf(n.next),n=e=i),n=n.next}while(n!==e);return pf(n)}function vf(e,t,n,r,i,s){let a=e;do{let e=a.next.next;for(;e!==a.prev;){if(a.i!==e.i&&Ef(a,e)){let o=If(a,e);return a=pf(a,a.next),o=pf(o,o.next),ff(a,t,n,r,i,s,0),void ff(o,t,n,r,i,s,0)}e=e.next}a=a.next}while(a!==e)}function yf(e,t){let n=e.x-t.x;return 0===n&&(n=e.y-t.y,0===n)&&(n=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),n}function xf(e,t){const n=function(e,t){let n=t;const r=e.x,i=e.y;let s,a=-1/0;
vendor: 4,173 bytes, line 1
1if(Rf(e,n))return n;do{if(Rf(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){const e=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(e<=r&&e>a&&(a=e,s=n.x<n.next.x?n:n.next,e===r))return s}n=n.next}while(n!==t);if(!s)return null;const o=s,l=s.x,u=s.y;let c=1/0;n=s;do{if(r>=n.x&&n.x>=l&&r!==n.x&&Sf(i<u?r:a,i,l,u,i<u?a:r,i,n.x,n.y)){const t=Math.abs(i-n.y)/(r-n.x);Lf(n,e)&&(t<c||t===c&&(n.x>s.x||n.x===s.x&&bf(s,n)))&&(s=n,c=t)}n=n.next}while(n!==o);return s}(e,t);if(!n)return t;const r=If(n,e);return pf(r,r.next),pf(n,n.next)}function bf(e,t){return Cf(e.prev,e,t.prev)<0&&Cf(t.next,e,e.next)<0}function wf(e,t,n,r,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Tf(e){let t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Sf(e,t,n,r,i,s,a,o){return(i-a)*(t-o)>=(e-a)*(s-o)&&(e-a)*(r-o)>=(n-a)*(t-o)&&(n-a)*(s-o)>=(i-a)*(r-o)}function Mf(e,t,n,r,i,s,a,o){return!(e===a&&t===o)&&Sf(e,t,n,r,i,s,a,o)}function Ef(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Nf(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Lf(e,t)&&Lf(t,e)&&function(e,t){let n=e,r=!1;const i=(e.x+t.x)/2,s=(e.y+t.y)/2;do{n.y>s!=n.next.y>s&&n.next.y!==n.y&&i<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Cf(e.prev,e,t.prev)||Cf(e,t.prev,t))||Rf(e,t)&&Cf(e.prev,e,e.next)>0&&Cf(t.prev,t,t.next)>0)}function Cf(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Rf(e,t){return e.x===t.x&&e.y===t.y}function Nf(e,t,n,r){const i=Df(Cf(e,t,n)),s=Df(Cf(e,t,r)),a=Df(Cf(n,r,e)),o=Df(Cf(n,r,t));return i!==s&&a!==o||!(0!==i||!Pf(e,n,t))||!(0!==s||!Pf(e,r,t))||!(0!==a||!Pf(n,e,r))||!(0!==o||!Pf(n,t,r))}function Pf(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Df(e){return e>0?1:e<0?-1:0}function Lf(e,t){return Cf(e.prev,e,e.next)<0?Cf(e,t,e.next)>=0&&Cf(e,e.prev,t)>=0:Cf(e,t,e.prev)<0||Cf(e,e.next,t)<0}function If(e,t){const n=Uf(e.i,e.x,e.y),r=Uf(t.i,t.x,t.y),i=e.next,s=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function Of(e,t,n,r){const i=Uf(e,t,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function Bf(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Uf(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Ff(e){const t=[],n=[],r=e[0][0].length;let i=0,s=0;for(const a of e){for(const e of a)for(let n=0;n<r;n++)t.push(e[n]);s&&(i+=s,n.push(i)),s=a.length}return{vertices:t,holes:n,dimensions:r}}function kf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qf(e,t,n){return t=Vf(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,zf()?Reflect.construct(t,[],Vf(e).constructor):t.apply(e,n))}function Vf(e){return Vf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vf(e)}function zf(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(zf=function(){return!!e})()}function Gf(e,t){return Gf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gf(e,t)}function jf(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}
1finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||Wf(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Hf(e){return function(e){if(Array.isArray(e))return kf(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wf(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wf(e,t){if(e){if("string"==typeof e)return kf(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kf(e,t):void 0}}var Xf=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){var i=180*Jd(r,n)/Math.PI;if(i>e)for(var s=cp(n,r),a=n.length>2||r.length>2?Jc(n[2]||0,r[2]||0):null,o=a?function(e){return[].concat(Hf(s(e)),[a(e)])}:s,l=1/Math.ceil(i/e),u=l;u<1;)t.push(o(u)),u+=l}t.push(n=r)})),t},Qf="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:Ar,Float32BufferAttribute:ir},Yf=(new Qf.BufferGeometry).setAttribute?"setAttribute":"addAttribute",$f=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=qf(this,t)).type="GeoJsonGeometry",n.parameters={geoJson:e,radius:r,resolution:i};var s=({Point:u,MultiPoint:function(e,t){var n={vertices:[],indices:[]};return e.map((function(e){return u(e,t)})).forEach((function(e){var t=jf(e,1)[0];Kf(n,t)})),[n]},LineString:c,MultiLineString:function(e,t){var n={vertices:[],indices:[]};return e.map((function(e){return c(e,t)})).forEach((function(e){var t=jf(e,1)[0];Kf(n,t)})),[n]},Polygon:h,MultiPolygon:function(e,t){var n={vertices:[],indices:[]},r={vertices:[],indices:[]};e.map((function(e){return h(e,t)})).forEach((function(e){var t=jf(e,2),i=t[0],s=t[1];Kf(n,i),s&&Kf(r,s)}));var i=[n];return r.vertices.length&&i.push(r),i}}[e.type]||function(){return[]})(e.coordinates,r),a=[],o=[],l=0;function u(e,t){return[{vertices:Jf(e[1],e[0],t+(e[2]||0)),indices:[]}]}function c(e,t){for(var n=Ff([Xf(e,i).map((function(e){var n=jf(e,3),r=n[0],i=n[1],s=n[2];return Jf(i,r,t+(void 0===s?0:s))}))]).vertices,r=Math.round(n.length/3),s=[],a=1;a<r;a++)s.push(a-1,a);return[{vertices:n,indices:s}]}function h(e,t){for(var n=Ff(e.map((function(e){return Xf(e,i).map((function(e){var n=jf(e,3),r=n[0],i=n[1],s=n[2];return Jf(i,r,t+(void 0===s?0:s))}))}))),r=n.vertices,s=n.holes,a=s[0]||1/0,o=r.slice(0,3*a),l=r.slice(3*a),u=new Set(s),c=Math.round(r.length/3),h=[],A=[],d=1;d<c;d++)u.has(d)||(d<a?h.push(d-1,d):A.push(d-1-a,d-a));var p=[{indices:h,vertices:o}];return s.length&&p.push({indices:A,vertices:l}),p}return s.forEach((function(e){var t=a.length;Kf({indices:a,vertices:o},e),n.addGroup(t,a.length-t,l++)})),a.length&&n.setIndex(a),o.length&&n[Yf]("position",new Qf.Float32BufferAttribute(o,3)),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gf(e,t)}(t,e),function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(Qf.BufferGeometry);function Kf(e,t){var n=Math.round(e.vertices.length/3);Zf(e.vertices,t.vertices),Zf(e.indices,t.indices.map((function(e){return e+n})))}function Zf(e,t){var n,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Wf(e))){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}
vendor: 5,532 bytes, line 1
1}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){o=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(o)throw s}}}}(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e.push(i)}}catch(e){r.e(e)}finally{r.f()}}function Jf(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}function em(e){let t,n,r,i=-1,s=0;for(let a=0;a<e.length;++a){const o=e[a];if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return null;if(-1===i&&(i=o.gpuType),i!==o.gpuType)return null;s+=o.count*n}const a=new t(s),o=new er(a,n,r);let l=0;for(let t=0;t<e.length;++t){const r=e[t];if(r.isInterleavedBufferAttribute){const e=l/n;for(let t=0,i=r.count;t<i;t++)for(let i=0;i<n;i++){const n=r.getComponent(t,i);o.setComponent(t+e,i,n)}}else a.set(r.array,l);l+=r.count*n}return void 0!==i&&(o.gpuType=i),o}function tm(e){const t=e.data.array.constructor,n=e.count,r=e.itemSize,i=e.normalized,s=new t(n*r);let a;a=e.isInstancedInterleavedBufferAttribute?new Yr(s,r,i,e.meshPerAttribute):new er(s,r,i);for(let t=0;t<n;t++)a.setX(t,e.getX(t)),r>=2&&a.setY(t,e.getY(t)),r>=3&&a.setZ(t,e.getZ(t)),r>=4&&a.setW(t,e.getW(t));return a}var nm=Object.freeze({__proto__:null,computeMikkTSpaceTangents:function(e,t,n=!0){if(!t||!t.isReady)throw new Error("BufferGeometryUtils: Initialized MikkTSpace library required.");if(!e.hasAttribute("position")||!e.hasAttribute("normal")||!e.hasAttribute("uv"))throw new Error('BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.');function r(e){if(e.normalized||e.isInterleavedBufferAttribute){const t=new Float32Array(e.count*e.itemSize);for(let n=0,r=0;n<e.count;n++)t[r++]=e.getX(n),t[r++]=e.getY(n),e.itemSize>2&&(t[r++]=e.getZ(n));return t}return e.array instanceof Float32Array?e.array:new Float32Array(e.array)}const i=e.index?e.toNonIndexed():e,s=t.generateTangents(r(i.attributes.position),r(i.attributes.normal),r(i.attributes.uv));if(n)for(let e=3;e<s.length;e+=4)s[e]*=-1;return i.setAttribute("tangent",new er(s,4)),e!==i&&e.copy(i),e},computeMorphedAttributes:function(e){const t=new Ke,n=new Ke,r=new Ke,i=new Ke,s=new Ke,a=new Ke,o=new Ke,l=new Ke,u=new Ke;function c(e,c,h,A,d,p,f,m){t.fromBufferAttribute(c,d),n.fromBufferAttribute(c,p),r.fromBufferAttribute(c,f);const g=e.morphTargetInfluences;if(h&&g){o.set(0,0,0),l.set(0,0,0),u.set(0,0,0);for(let e=0,c=h.length;e<c;e++){const c=g[e],m=h[e];0!==c&&(i.fromBufferAttribute(m,d),s.fromBufferAttribute(m,p),a.fromBufferAttribute(m,f),A?(o.addScaledVector(i,c),l.addScaledVector(s,c),u.addScaledVector(a,c)):(o.addScaledVector(i.sub(t),c),l.addScaledVector(s.sub(n),c),u.addScaledVector(a.sub(r),c)))}t.add(o),n.add(l),r.add(u)}e.isSkinnedMesh&&(e.applyBoneTransform(d,t),e.applyBoneTransform(p,n),e.applyBoneTransform(f,r)),m[3*d+0]=t.x,m[3*d+1]=t.y,m[3*d+2]=t.z,m[3*p+0]=n.x,m[3*p+1]=n.y,m[3*p+2]=n.z,m[3*f+0]=r.x,m[3*f+1]=r.y,m[3*f+2]=r.z}const h=e.geometry,A=e.material;let d,p,f;const m=h.index,g=h.attributes.position,_=h.morphAttributes.position,v=h.morphTargetsRelative,y=h.attributes.normal,x=h.morphAttributes.position,b=h.groups,w=h.drawRange;let T,S,M,E,C,R,N;const P=new Float32Array(g.count*g.itemSize),D=new Float32Array(y.count*y.itemSize);if(null!==m)if(Array.isArray(A))for(T=0,M=b.length;T<M;T++)for(C=b[T],R=Math.max(C.start,w.start),N=Math.min(C.start+C.count,w.start+w.count),S=R,E=N;S<E;S+=3)d=m.getX(S),p=m.getX(S+1),f=m.getX(S+2),c(e,g,_,v,d,p,f,P),c(e,y,x,v,d,p,f,D);else for(R=Math.max(0,w.start),N=Math.min(m.count,w.start+w.count),T=R,M=N;T<M;T+=3)d=m.getX(T),p=m.getX(T+1),f=m.getX(T+2),c(e,g,_,v,d,p,f,P),c(e,y,x,v,d,p,f,D);else if(Array.isArray(A))for(T=0,M=b.length;T<M;T++)for(C=b[T],R=Math.max(C.start,w.start),N=Math.min(C.start+C.count,w.start+w.count),S=R,E=N;S<E;S+=3)d=S,p=S+1,f=S+2,c(e,g,_,v,d,p,f,P),c(e,y,x,v,d,p,f,D);else for(R=Math.max(0,w.start),N=Math.min(g.count,w.start+w.count),T=R,M=N;T<M;T+=3)d=T,p=T+1,f=T+2,c(e,g,_,v,d,p,f,P),c(e,y,x,v,d,p,f,D);return{positionAttribute:g,normalAttribute:y,morphedPositionAttribute:new ir(P,3),morphedNormalAttribute:new ir(D,3)}},deepCloneAttribute:function(e){return e.isInstancedInterleavedBufferAttribute||e.isInterleavedBufferAttribute?tm(e):e.isInstancedBufferAttribute?(new Yr).copy(e):(new er).copy(e)},deinterleaveAttribute:tm,deinterleaveGeometry:function(e){const t=e.attributes,n=e.morphTargets,r=new Map;for(const e in t){const n=t[e];n.isInterleavedBufferAttribute&&(r.has(n)||r.set(n,tm(n)),t[e]=r.get(n))}for(const e in n){const t=n[e];t.isInterleavedBufferAttribute&&(r.has(t)||r.set(t,tm(t)),n[e]=r.get(t))}},estimateBytesUsed:function(e){let t=0;for(const n in e.attributes){const r=e.getAttribute(n);t+=r.count*r.itemSize*r.array.BYTES_PER_ELEMENT}const n=e.getIndex();return t+=n?n.count*n.itemSize*n.array.BYTES_PER_ELEMENT:0,t},interleaveAttributes:function(e){let t,n=0,r=0;for(let i=0,s=e.length;i<s;++i){const s=e[i];if(void 0===t&&(t=s.array.constructor),t!==s.array.constructor)return null;n+=s.array.length,r+=s.itemSize}const i=new Hr(new t(n),r);let s=0;const a=[],o=["getX","getY","getZ","getW"],l=["setX","setY","setZ","
1setW"];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.itemSize,u=n.count,c=new Xr(i,r,s,n.normalized);a.push(c),s+=r;for(let e=0;e<u;e++)for(let t=0;t<r;t++)c[l[t]](e,n[o[t]](e))}return a},mergeAttributes:em,mergeGeometries:function(e,t=!1){const n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),i=new Set(Object.keys(e[0].morphAttributes)),s={},a={},o=e[0].morphTargetsRelative,l=new Ar;let u=0;for(let c=0;c<e.length;++c){const h=e[c];let A=0;if(n!==(null!==h.index))return null;for(const e in h.attributes){if(!r.has(e))return null;void 0===s[e]&&(s[e]=[]),s[e].push(h.attributes[e]),A++}if(A!==r.size)return null;if(o!==h.morphTargetsRelative)return null;for(const e in h.morphAttributes){if(!i.has(e))return null;void 0===a[e]&&(a[e]=[]),a[e].push(h.morphAttributes[e])}if(t){let e;if(n)e=h.index.count;else{if(void 0===h.attributes.position)return null;e=h.attributes.position.count}l.addGroup(u,e,c),u+=e}}if(n){let t=0;const n=[];for(let r=0;r<e.length;++r){const i=e[r].index;for(let e=0;e<i.count;++e)n.push(i.getX(e)+t);t+=e[r].attributes.position.count}l.setIndex(n)}for(const e in s){const t=em(s[e]);if(!t)return null;l.setAttribute(e,t)}for(const e in a){const t=a[e][0].length;if(0===t)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[e]=[];for(let n=0;n<t;++n){const t=[];for(let r=0;r<a[e].length;++r)t.push(a[e][r][n]);const r=em(t);if(!r)return null;l.morphAttributes[e].push(r)}}return l},mergeGroups:function(e){if(0===e.groups.length)return e;let t=e.groups;if(t=t.sort(((e,t)=>e.materialIndex!==t.materialIndex?e.materialIndex-t.materialIndex:e.start-t.start)),null===e.getIndex()){const t=e.getAttribute("position"),n=[];for(let e=0;e<t.count;e+=3)n.push(e,e+1,e+2);e.setIndex(n)}const n=e.getIndex(),r=[];for(let e=0;e<t.length;e++){const i=t[e],s=i.start,a=s+i.count;for(let e=s;e<a;e++)r.push(n.getX(e))}e.dispose(),e.setIndex(r);let i=0;for(let e=0;e<t.length;e++){const n=t[e];n.start=i,i+=n.count}let s=t[0];e.groups=[s];for(let n=1;n<t.length;n++){const r=t[n];s.materialIndex===r.materialIndex?s.count+=r.count:(s=r,e.groups.push(s))}return e},mergeVertices:function(e,t=1e-4){t=Math.max(t,Number.EPSILON);const n={},r=e.getIndex(),i=e.getAttribute("position"),s=r?r.count:i.count;let a=0;const o=Object.keys(e.attributes),l={},u={},c=[],h=["getX","getY","getZ","getW"],A=["setX","setY","setZ","setW"];for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.attributes[n];l[n]=new r.constructor(new r.array.constructor(r.count*r.itemSize),r.itemSize,r.normalized);const i=e.morphAttributes[n];i&&(u[n]||(u[n]=[]),i.forEach(((e,t)=>{const r=new e.array.constructor(e.count*e.itemSize);u[n][t]=new e.constructor(r,e.itemSize,e.normalized)})))}const d=.5*t,p=Math.log10(1/t),f=Math.pow(10,p),m=d*f;for(let t=0;t<s;t++){const i=r?r.getX(t):t;let s="";for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.getAttribute(n),a=r.itemSize;for(let e=0;e<a;e++)s+=~~(r[h[e]](i)*f+m)+","}if(s in n)c.push(n[s]);else{for(let t=0,n=o.length;t<n;t++){const n=o[t],r=e.getAttribute(n),s=e.morphAttributes[n],c=r.itemSize,d=l[n],p=u[n];for(let e=0;e<c;e++){const t=h[e],n=A[e];if(d[n](a,r[t](i)),s)for(let e=0,r=s.length;e<r;e++)p[e][n](a,s[e][t](i))}}n[s]=a,c.push(a),a++}}const g=e.clone();for(const t in e.attributes){const e=l[t];if(g.setAttribute(t,new e.constructor(e.array.slice(0,a*e.itemSize),e.itemSize,e.normalized)),t in u)for(let e=0;e<u[t].length;e++){const n=u[t][e];g.morphAttributes[t][e]=new n.constructor(n.array.slice(0,a*n.itemSize),n.itemSize,n.normalized)}}return g.setIndex(c),g},toCreasedNormals:function(e,t=Math.PI/3){const n=Math.cos(t),r=100*(1+1e-10),i=[new Ke,new Ke,new Ke],s=new Ke,a=new Ke,o=new Ke,l=new Ke;function u(e){return`${~~(e.x*r)},${~~(e.y*r)},${~~(e.z*r)}`}const c=e.index?e.toNonIndexed():e,h=c.attributes.position,A={};for(let e=0,t=h.count/3;e<t;e++){const t=3*e,n=i[0].fromBufferAttribute(h,t+0),r=i[1].fromBufferAttribute(h,t+1),o=i[2].fromBufferAttribute(h,t+2);s.subVectors(o,r),a.subVectors(n,r);const l=(new Ke).crossVectors(s,a).normalize();for(let e=0;e<3;e++){const t=u(i[e]);t in A||(A[t]=[]),A[t].push(l)}}const d=new Float32Array(3*h.count),p=new er(d,3,!1);for(let e=0,t=h.count/3;e<t;e++){const t=3*e,r=i[0].fromBufferAttribute(h,t+0),c=i[1].fromBufferAttribute(h,t+1),d=i[2].fromBufferAttribute(h,t+2);s.subVectors(d,c),a.subVectors(r,c),o.crossVectors(s,a).normalize();for(let e=0;e<3;e++){const r=A[u(i[e])];l.set(0,0,0);for(let e=0,t=r.length;e<t;e++){const t=r[e];o.dot(t)>n&&l.add(t)}l.normalize(),p.setXYZ(t+e,l.x,l.y,l.z)}}return c.setAttribute("normal",p),c},toTrianglesDrawMode:function(e,t){if(0===t)return e;if(2===t||1===t){let n=e.getIndex();if(null===n){const t=[],r=e.getAttribute("position");if(void 0===r)return e;for(let e=0;e<r.count;e++)t.push(e);e.setIndex(t),n=e.getIndex()}const r=n.count-2,i=[];if(2===t)for(let e=1;e<=r;e++)i.push(n.getX(0)),i.push(n.getX(e)),i.push(n.getX(e+1));else for(let e=0;e<r;e++)e%2==0?(i.push(n.getX(e)),i.push(n.getX(e+1)),i.push(n.getX(e+2))):(i.push(n.getX(e+2)),i.push(n.getX(e+1)),i.push(n.getX(e)));i.length;const s=e.clone();return s.setIndex(i),s.clearGroups(),s}return e}}),rm=function(e){return"function"==typeof e?e:"string"==typeof e?function(t){return t[e]}:function(t){return e}};function im(e){return im="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},im(e)}var sm=/^\s+/,am=/\s+$/;function om(e,t){if(t=t||{},(e=e||"")instanceof om)return e;if(!(this instanceof om))return new om(e,t);var n=function(e){var t={r:0,g:0,b:0}
vendor: 4,486 bytes, line 1
1,n=1,r=null,i=null,s=null,a=!1,o=!1;return"string"==typeof e&&(e=function(e){e=e.replace(sm,"").replace(am,"").toLowerCase();var t,n=!1;if(Tm[e])e=Tm[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Um.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Um.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Um.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Um.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Um.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Um.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Um.hex8.exec(e))?{r:Rm(t[1]),g:Rm(t[2]),b:Rm(t[3]),a:Lm(t[4]),format:n?"name":"hex8"}:(t=Um.hex6.exec(e))?{r:Rm(t[1]),g:Rm(t[2]),b:Rm(t[3]),format:n?"name":"hex"}:(t=Um.hex4.exec(e))?{r:Rm(t[1]+""+t[1]),g:Rm(t[2]+""+t[2]),b:Rm(t[3]+""+t[3]),a:Lm(t[4]+""+t[4]),format:n?"name":"hex8"}:!!(t=Um.hex3.exec(e))&&{r:Rm(t[1]+""+t[1]),g:Rm(t[2]+""+t[2]),b:Rm(t[3]+""+t[3]),format:n?"name":"hex"}}(e)),"object"==im(e)&&(Fm(e.r)&&Fm(e.g)&&Fm(e.b)?(t=function(e,t,n){return{r:255*Em(e,255),g:255*Em(t,255),b:255*Em(n,255)}}(e.r,e.g,e.b),a=!0,o="%"===String(e.r).substr(-1)?"prgb":"rgb"):Fm(e.h)&&Fm(e.s)&&Fm(e.v)?(r=Pm(e.s),i=Pm(e.v),t=function(e,t,n){e=6*Em(e,360),t=Em(t,100),n=Em(n,100);var r=Math.floor(e),i=e-r,s=n*(1-t),a=n*(1-i*t),o=n*(1-(1-i)*t),l=r%6;return{r:255*[n,a,s,s,o,n][l],g:255*[o,n,n,a,s,s][l],b:255*[s,s,o,n,n,a][l]}}(e.h,r,i),a=!0,o="hsv"):Fm(e.h)&&Fm(e.s)&&Fm(e.l)&&(r=Pm(e.s),s=Pm(e.l),t=function(e,t,n){var r,i,s;function a(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=Em(e,360),t=Em(t,100),n=Em(n,100),0===t)r=i=s=n;else{var o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=a(l,o,e+1/3),i=a(l,o,e),s=a(l,o,e-1/3)}return{r:255*r,g:255*i,b:255*s}}(e.h,r,s),a=!0,o="hsl"),e.hasOwnProperty("a")&&(n=e.a)),n=Mm(n),{ok:a,format:e.format||o,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}function lm(e,t,n){e=Em(e,255),t=Em(t,255),n=Em(n,255);var r,i,s=Math.max(e,t,n),a=Math.min(e,t,n),o=(s+a)/2;if(s==a)r=i=0;else{var l=s-a;switch(i=o>.5?l/(2-s-a):l/(s+a),s){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,l:o}}function um(e,t,n){e=Em(e,255),t=Em(t,255),n=Em(n,255);var r,i,s=Math.max(e,t,n),a=Math.min(e,t,n),o=s,l=s-a;if(i=0===s?0:l/s,s==a)r=0;else{switch(s){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{h:r,s:i,v:o}}function cm(e,t,n,r){var i=[Nm(Math.round(e).toString(16)),Nm(Math.round(t).toString(16)),Nm(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function hm(e,t,n,r){return[Nm(Dm(r)),Nm(Math.round(e).toString(16)),Nm(Math.round(t).toString(16)),Nm(Math.round(n).toString(16))].join("")}function Am(e,t){t=0===t?0:t||10;var n=om(e).toHsl();return n.s-=t/100,n.s=Cm(n.s),om(n)}function dm(e,t){t=0===t?0:t||10;var n=om(e).toHsl();return n.s+=t/100,n.s=Cm(n.s),om(n)}function pm(e){return om(e).desaturate(100)}function fm(e,t){t=0===t?0:t||10;var n=om(e).toHsl();return n.l+=t/100,n.l=Cm(n.l),om(n)}function mm(e,t){t=0===t?0:t||10;var n=om(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),om(n)}function gm(e,t){t=0===t?0:t||10;var n=om(e).toHsl();return n.l-=t/100,n.l=Cm(n.l),om(n)}function _m(e,t){var n=om(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,om(n)}function vm(e){var t=om(e).toHsl();return t.h=(t.h+180)%360,om(t)}function ym(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var n=om(e).toHsl(),r=[om(e)],i=360/t,s=1;s<t;s++)r.push(om({h:(n.h+s*i)%360,s:n.s,l:n.l}));return r}function xm(e){var t=om(e).toHsl(),n=t.h;return[om(e),om({h:(n+72)%360,s:t.s,l:t.l}),om({h:(n+216)%360,s:t.s,l:t.l})]}function bm(e,t,n){t=t||6,n=n||30;var r=om(e).toHsl(),i=360/n,s=[om(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,s.push(om(r));return s}function wm(e,t){t=t||6;for(var n=om(e).toHsv(),r=n.h,i=n.s,s=n.v,a=[],o=1/t;
vendor: 5,963 bytes, line 1
1t--;)a.push(om({h:r,s:i,v:s})),s=(s+o)%1;return a}om.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Mm(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=um(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=um(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=lm(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=lm(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return cm(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,i){var s=[Nm(Math.round(e).toString(16)),Nm(Math.round(t).toString(16)),Nm(Math.round(n).toString(16)),Nm(Dm(r))];return i&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*Em(this._r,255))+"%",g:Math.round(100*Em(this._g,255))+"%",b:Math.round(100*Em(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*Em(this._r,255))+"%, "+Math.round(100*Em(this._g,255))+"%, "+Math.round(100*Em(this._b,255))+"%)":"rgba("+Math.round(100*Em(this._r,255))+"%, "+Math.round(100*Em(this._g,255))+"%, "+Math.round(100*Em(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Sm[cm(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+hm(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=om(e);n="#"+hm(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return om(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(fm,arguments)},brighten:function(){return this._applyModification(mm,arguments)},darken:function(){return this._applyModification(gm,arguments)},desaturate:function(){return this._applyModification(Am,arguments)},saturate:function(){return this._applyModification(dm,arguments)},greyscale:function(){return this._applyModification(pm,arguments)},spin:function(){return this._applyModification(_m,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(bm,arguments)},complement:function(){return this._applyCombination(vm,arguments)},monochromatic:function(){return this._applyCombination(wm,arguments)},splitcomplement:function(){return this._applyCombination(xm,arguments)},triad:function(){return this._applyCombination(ym,[3])},tetrad:function(){return this._applyCombination(ym,[4])}},om.fromRatio=function(e,t){if("object"==im(e)){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:Pm(e[r]));e=n}return om(e,t)},om.equals=function(e,t){return!(!e||!t)&&om(e).toRgbString()==om(t).toRgbString()},om.random=function(){return om.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},om.mix=function(e,t,n){n=0===n?0:n||50;var r=om(e).toRgb(),i=om(t).toRgb(),s=n/100;return om({r:(i.r-r.r)*s+r.r,g:(i.g-r.g)*s+r.g,b:(i.b-r.b)*s+r.b,a:(i.a-r.a)*s+r.a})},om.readability=function(e,t){var n=om(e),r=om(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},om.isReadable=function(e,t,n){var r,i,s=om.readability(e,t);switch(i=!1,(r=function(e){var t,n;return"AA"!==(t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==t&&(t="AA"),"small"!==(n=(e.size||"small").toLowerCase())&&"large"!==n&&(n="small"),{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":i=s>=4.5;break;case"AAlarge":i=s>=3;break;case"AAAsmall":i=s>=7}return i},om.mostReadable=function(e,t,n){var r,i,s,a,o=null,l=0;i=(n=n||{}).includeFallbackColors,s=n.level,a=n.size;
vendor: 1,589 bytes, line 1
1for(var u=0;u<t.length;u++)(r=om.readability(e,t[u]))>l&&(l=r,o=om(t[u]));return om.isReadable(e,o,{level:s,size:a})||!i?o:(n.includeFallbackColors=!1,om.mostReadable(e,["#fff","#000"],n))};var Tm=om.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
10",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Sm=om.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(Tm);function Mm(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Em(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Cm(e){return Math.min(1,Math.max(0,e))}function Rm(e){return parseInt(e,16)}function Nm(e){return 1==e.length?"0"+e:""+e}function Pm(e){return e<=1&&(e=100*e+"%"),e}function Dm(e){return Math.round(255*parseFloat(e)).toString(16)}function Lm(e){return Rm(e)/255}var Im,Om,Bm,Um=(Om="[\\s|\\(]+("+(Im="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Im+")[,|\\s]+("+Im+")\\s*\\)?",Bm="[\\s|\\(]+("+Im+")[,|\\s]+("+Im+")[,|\\s]+("+Im+")[,|\\s]+("+Im+")\\s*\\)?",{CSS_UNIT:new RegExp(Im),rgb:new RegExp("rgb"+Om),rgba:new RegExp("rgba"+Bm),hsl:new RegExp("hsl"+Om),hsla:new RegExp("hsla"+Bm),hsv:new RegExp("hsv"+Om),hsva:new RegExp("hsva"
1+Bm),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Fm(e){return!!Um.CSS_UNIT.exec(e)}function km(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function qm(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function Vm(e,t){return e.get(qm(e,t))}function zm(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function Gm(e,t,n){return e.set(qm(e,t),n),n}function jm(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function Hm(e,t){if(e){if("string"==typeof e)return km(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?km(e,t):void 0}}var Wm=new WeakMap,Xm=new WeakMap,Qm=new WeakMap,Ym=new WeakMap,$m=new WeakMap,Km=new WeakMap,Zm=function(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jm(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),zm(this,Wm,new Map),zm(this,Xm,new Map),zm(this,Qm,(function(e){return e})),zm(this,Ym,(function(){return{}})),zm(this,$m,(function(){})),zm(this,Km,(function(){}))}),[{key:"getObj",value:function(e){return Vm(Wm,this).get(Vm(Qm,this).call(this,e))}},{key:"getData",value:function(e){return Vm(Xm,this).get(e)}},{key:"entries",value:function(){return function(e){return function(e){if(Array.isArray(e))return km(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Hm(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Vm(Xm,this).entries()).map((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||Hm(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),n=t[0];return[t[1],n]}))}},{key:"id",value:function(e){return Gm(Qm,this,rm(e)),this}},{key:"onCreateObj",value:function(e){return Gm(Ym,this,e),this}},{key:"onUpdateObj",value:function(e){return Gm($m,this,e),this}},{key:"onRemoveObj",value:function(e){return Gm(Km,this,e),this}},{key:"digest",value:function(e){var t=this;e.filter((function(e){return!Vm(Wm,t).has(Vm(Qm,t).call(t,e))})).forEach((function(e){var n=Vm(Ym,t).call(t,e);Vm(Wm,t).set(Vm(Qm,t).call(t,e),n),Vm(Xm,t).set(n,e)}));var n=new Map(e.map((function(e){return[Vm(Qm,t).call(t,e),e]})));return Vm(Wm,this).forEach((function(e,r){n.has(r)?Vm($m,t).call(t,e,n.get(r)):(Vm(Km,t).call(t,e,r),Vm(Wm,t).delete(r),Vm(Xm,t).delete(e))})),this}},{key:"clear",value:function(){return this.digest([]),this}}]);var Jm,eg={exports:{}},tg=(Jm||(Jm=1,function(e){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){var r=n(1),i=function(){function e(e,t,n){void 0===e&&(e=NaN),void 0===t&&(t=NaN),void 0===n&&(n=!1),this._minFPS=t,this._maxFPS=e,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new r.default,this._onPause=new r.default,this._onTick=new r.default,this._onTickOncePerFrame=new r.default,n||this.resume()}return e.prototype.updateOnce=function(e){e(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateO
vendor: 4,345 bytes, line 1
1nce())},e.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle))},e.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll()},Object.defineProperty(e.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeScale",{get:function(){return this._timeScale},set:function(e){this._timeScale!==e&&(this._timeScale=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),e.prototype.animateOnce=function(){var e=this;this._animationFrameHandle=window.requestAnimationFrame((function(){return e.onFrame()}))},e.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce()},e.prototype.update=function(e,t){void 0===t&&(t=!0),this._currentTick++,this._currentTime+=e,this._tickDeltaTime=e,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),t&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick)},e.prototype.getTimer=function(){return Date.now()},e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=i},function(e,t,n){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t){var n=function(){function e(){this.functions=[]}return e.prototype.add=function(e){return-1===this.functions.indexOf(e)&&(this.functions.push(e),!0)},e.prototype.remove=function(e){var t=this.functions.indexOf(e);return t>-1&&(this.functions.splice(t,1),!0)},e.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.functions.concat().forEach((function(t){t.apply(void 0,e)}))},Object.defineProperty(e.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=n}])}])}(eg)),eg.exports),ng=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(tg);const rg=134217729;function ig(e,t,n,r,i){let s,a,o,l,u=t[0],c=r[0],h=0,A=0;c>u==c>-u?(s=u,u=t[++h]):(s=c,c=r[++A]);let d=0;if(h<e&&A<n)for(c>u==c>-u?(a=u+s,o=s-(a-u),u=t[++h]):(a=c+s,o=s-(a-c),c=r[++A]),s=a,0!==o&&(i[d++]=o);h<e&&A<n;)c>u==c>-u?(a=s+u,l=a-s,o=s-(a-l)+(u-l),u=t[++h]):(a=s+c,l=a-s,o=s-(a-l)+(c-l),c=r[++A]),s=a,0!==o&&(i[d++]=o);for(;h<e;)a=s+u,l=a-s,o=s-(a-l)+(u-l),u=t[++h],s=a,0!==o&&(i[d++]=o);for(;A<n;)a=s+c,l=a-s,o=s-(a-l)+(c-l),c=r[++A],s=a,0!==o&&(i[d++]=o);return 0===s&&0!==d||(i[d++]=s),d}function sg(e){return new Float64Array(e)}const ag=sg(4),og=sg(8),lg=sg(12),ug=sg(16),cg=sg(4);function hg(e,t,n,r,i,s){const a=(t-s)*(n-i),o=(e-i)*(r-s),l=a-o,u=
vendor: 12,028 bytes, line 1
1Math.abs(a+o);return Math.abs(l)>=33306690738754716e-32*u?l:-function(e,t,n,r,i,s,a){let o,l,u,c,h,A,d,p,f,m,g,_,v,y,x,b,w,T;const S=e-i,M=n-i,E=t-s,C=r-s;y=S*C,A=rg*S,d=A-(A-S),p=S-d,A=rg*C,f=A-(A-C),m=C-f,x=p*m-(y-d*f-p*f-d*m),b=E*M,A=rg*E,d=A-(A-E),p=E-d,A=rg*M,f=A-(A-M),m=M-f,w=p*m-(b-d*f-p*f-d*m),g=x-w,h=x-g,ag[0]=x-(g+h)+(h-w),_=y+g,h=_-y,v=y-(_-h)+(g-h),g=v-b,h=v-g,ag[1]=v-(g+h)+(h-b),T=_+g,h=T-_,ag[2]=_-(T-h)+(g-h),ag[3]=T;let R=function(e,t){let n=t[0];for(let e=1;e<4;e++)n+=t[e];return n}(0,ag),N=22204460492503146e-32*a;if(R>=N||-R>=N)return R;if(h=e-S,o=e-(S+h)+(h-i),h=n-M,u=n-(M+h)+(h-i),h=t-E,l=t-(E+h)+(h-s),h=r-C,c=r-(C+h)+(h-s),0===o&&0===l&&0===u&&0===c)return R;if(N=11093356479670487e-47*a+33306690738754706e-32*Math.abs(R),R+=S*c+C*o-(E*u+M*l),R>=N||-R>=N)return R;y=o*C,A=rg*o,d=A-(A-o),p=o-d,A=rg*C,f=A-(A-C),m=C-f,x=p*m-(y-d*f-p*f-d*m),b=l*M,A=rg*l,d=A-(A-l),p=l-d,A=rg*M,f=A-(A-M),m=M-f,w=p*m-(b-d*f-p*f-d*m),g=x-w,h=x-g,cg[0]=x-(g+h)+(h-w),_=y+g,h=_-y,v=y-(_-h)+(g-h),g=v-b,h=v-g,cg[1]=v-(g+h)+(h-b),T=_+g,h=T-_,cg[2]=_-(T-h)+(g-h),cg[3]=T;const P=ig(4,ag,4,cg,og);y=S*c,A=rg*S,d=A-(A-S),p=S-d,A=rg*c,f=A-(A-c),m=c-f,x=p*m-(y-d*f-p*f-d*m),b=E*u,A=rg*E,d=A-(A-E),p=E-d,A=rg*u,f=A-(A-u),m=u-f,w=p*m-(b-d*f-p*f-d*m),g=x-w,h=x-g,cg[0]=x-(g+h)+(h-w),_=y+g,h=_-y,v=y-(_-h)+(g-h),g=v-b,h=v-g,cg[1]=v-(g+h)+(h-b),T=_+g,h=T-_,cg[2]=_-(T-h)+(g-h),cg[3]=T;const D=ig(P,og,4,cg,lg);y=o*c,A=rg*o,d=A-(A-o),p=o-d,A=rg*c,f=A-(A-c),m=c-f,x=p*m-(y-d*f-p*f-d*m),b=l*u,A=rg*l,d=A-(A-l),p=l-d,A=rg*u,f=A-(A-u),m=u-f,w=p*m-(b-d*f-p*f-d*m),g=x-w,h=x-g,cg[0]=x-(g+h)+(h-w),_=y+g,h=_-y,v=y-(_-h)+(g-h),g=v-b,h=v-g,cg[1]=v-(g+h)+(h-b),T=_+g,h=T-_,cg[2]=_-(T-h)+(g-h),cg[3]=T;const L=ig(D,lg,4,cg,ug);return ug[L-1]}(e,t,n,r,i,s,u)}const Ag=Math.pow(2,-52),dg=new Uint32Array(512);class pg{static from(e,t=yg,n=xg){const r=e.length,i=new Float64Array(2*r);for(let s=0;s<r;s++){const r=e[s];i[2*s]=t(r),i[2*s+1]=n(r)}return new pg(i)}constructor(e){const t=e.length>>1;if(t>0&&"number"!=typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;const n=Math.max(2*t-5,0);this._triangles=new Uint32Array(3*n),this._halfedges=new Int32Array(3*n),this._hashSize=Math.ceil(Math.sqrt(t)),this._hullPrev=new Uint32Array(t),this._hullNext=new Uint32Array(t),this._hullTri=new Uint32Array(t),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(t),this._dists=new Float64Array(t),this.update()}update(){const{coords:e,_hullPrev:t,_hullNext:n,_hullTri:r,_hullHash:i}=this,s=e.length>>1;let a=1/0,o=1/0,l=-1/0,u=-1/0;for(let t=0;t<s;t++){const n=e[2*t],r=e[2*t+1];n<a&&(a=n),r<o&&(o=r),n>l&&(l=n),r>u&&(u=r),this._ids[t]=t}const c=(a+l)/2,h=(o+u)/2;let A,d,p;for(let t=0,n=1/0;t<s;t++){const r=fg(c,h,e[2*t],e[2*t+1]);r<n&&(A=t,n=r)}const f=e[2*A],m=e[2*A+1];for(let t=0,n=1/0;t<s;t++){if(t===A)continue;const r=fg(f,m,e[2*t],e[2*t+1]);r<n&&r>0&&(d=t,n=r)}let g=e[2*d],_=e[2*d+1],v=1/0;for(let t=0;t<s;t++){if(t===A||t===d)continue;const n=gg(f,m,g,_,e[2*t],e[2*t+1]);n<v&&(p=t,v=n)}let y=e[2*p],x=e[2*p+1];if(v===1/0){for(let t=0;t<s;t++)this._dists[t]=e[2*t]-e[0]||e[2*t+1]-e[1];_g(this._ids,this._dists,0,s-1);const t=new Uint32Array(s);let n=0;for(let e=0,r=-1/0;e<s;e++){const i=this._ids[e],s=this._dists[i];s>r&&(t[n++]=i,r=s)}return this.hull=t.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(hg(f,m,g,_,y,x)<0){const e=d,t=g,n=_;d=p,g=y,_=x,p=e,y=t,x=n}const b=function(e,t,n,r,i,s){const a=n-e,o=r-t,l=i-e,u=s-t,c=a*a+o*o,h=l*l+u*u,A=.5/(a*u-o*l);return{x:e+(u*c-o*h)*A,y:t+(a*h-l*c)*A}}(f,m,g,_,y,x);this._cx=b.x,this._cy=b.y;for(let t=0;t<s;t++)this._dists[t]=fg(e[2*t],e[2*t+1],b.x,b.y);_g(this._ids,this._dists,0,s-1),this._hullStart=A;let w=3;n[A]=t[p]=d,n[d]=t[A]=p,n[p]=t[d]=A,r[A]=0,r[d]=1,r[p]=2,i.fill(-1),i[this._hashKey(f,m)]=A,i[this._hashKey(g,_)]=d,i[this._hashKey(y,x)]=p,this.trianglesLen=0,this._addTriangle(A,d,p,-1,-1,-1);for(let s,a,o=0;o<this._ids.length;o++){const l=this._ids[o],u=e[2*l],c=e[2*l+1];if(o>0&&Math.abs(u-s)<=Ag&&Math.abs(c-a)<=Ag)continue;if(s=u,a=c,l===A||l===d||l===p)continue;let h=0;for(let e=0,t=this._hashKey(u,c);e<this._hashSize&&(h=i[(t+e)%this._hashSize],-1===h||h===n[h]);e++);h=t[h];let f,m=h;for(;f=n[m],hg(u,c,e[2*m],e[2*m+1],e[2*f],e[2*f+1])>=0;)if(m=f,m===h){m=-1;break}if(-1===m)continue;let g=this._addTriangle(m,l,n[m],-1,-1,r[m]);r[l]=this._legalize(g+2),r[m]=g,w++;let _=n[m];for(;f=n[_],hg(u,c,e[2*_],e[2*_+1],e[2*f],e[2*f+1])<0;)g=this._addTriangle(_,l,f,r[l],-1,r[_]),r[l]=this._legalize(g+2),n[_]=_,w--,_=f;if(m===h)for(;f=t[m],hg(u,c,e[2*f],e[2*f+1],e[2*m],e[2*m+1])<0;)g=this._addTriangle(f,l,m,-1,r[m],r[f]),this._legalize(g+2),r[f]=g,n[m]=m,w--,m=f;this._hullStart=t[l]=m,n[m]=t[_]=l,n[l]=_,i[this._hashKey(u,c)]=l,i[this._hashKey(e[2*m],e[2*m+1])]=m}this.hull=new Uint32Array(w);for(let e=0,t=this._hullStart;e<w;e++)this.hull[e]=t,t=n[t];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(e,t){return Math.floor(function(e,t){const n=e/(Math.abs(e)+Math.abs(t));return(t>0?3-n:1+n)/4}(e-this._cx,t-this._cy)*this._hashSize)%this._hashSize}_legalize(e){const{_triangles:t,_halfedges:n,coords:r}=this;let i=0,s=0;for(;;){const a=n[e],o=e-e%3;if(s=o+(e+2)%3,-1===a){if(0===i)break;e=dg[--i];continue}const l=a-a%3,u=o+(e+1)%3,c=l+(a+2)%3,h=t[s],A=t[e],d=t[u],p=t[c];if(mg(r[2*h],r[2*h+1],r[2*A],r[2*A+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){t[e]=p,t[a]=h;const r=n[c];if(-1===r){let t=this._hullStart;do{if(this._hullTri[t]===c){this._hullTri[t]=e;break}t=this._hullPrev[t]}while(t!==this._hullStart)}this._link(e,r),this._link(a,n[s]),this._link(s,c);const o=l+(a+1)%3;i<dg.length&&(dg[i++]=o)}else{if(0===i)break;e=dg[--i]}}return s}_link(e,t){this._halfedges[e]=t,-1!==t&&(this._halfedges[t]=e)}_addTriangle(e,t,n,r,i,s){const a=this.trianglesLen;return this._triangles[a]=e,this._triangles[a+1]=t,this._triangles[a+2]=n,this._link(a,r),this._link(a+1,i),this._link(a+2,s),this.trianglesLen+=3,a}}function fg(e,t,n,r){const i=e-n,s=t-r;return i*i+s*s}function mg(e,t,n,r,i,s,a,o){const l=e-a,u=t-o,c=n-a,h=r-o,A=i-a,d=s-o,p=c*c+h*h,f=A*A+d*d;return l*(h*f-p*d)-u*(c*f-p*A)+(l*l+u*u)*(c*d-h*A)<0}function gg(e,t,n,r,i,s){const a=n-e,o=r-t,l=i-e,u=s-t,c=a*a+o*o,h=l*l+u*u,A=.5/(a*u-o*l),d=(u*c-o*h)*A,p=(a*h-l*c)*A;return d*d+p*p}function _g(e,t,n,r){if(r-n<=20)for(let i=n+1;i<=r;i++){const r=e[i],s=t[r];let a=i-1;for(;a>=n&&t[e[a]]>s;)e[a+1]=e[a--];e[a+1]=r}else{let i=n+1,s=r;vg(e,n+r>>1,i),t[e[n]]>t[e[r]]&&vg(e,n,r),t[e[i]]>t[e[r]]&&vg(e,i,r),t[e[n]]>t[e[i]]&&vg(e,n,i);const a=e[i],o=t[a];for(;;){do{i++}while(t[e[i]]<o);do{s--}while(t[e[s]]>o);if(s<i)break;vg(e,i,s)}e[n+1]=e[s],e[s]=a,r-i+1>=s-n?(_g(e,t,i,r),_g(e,t,n,s-1)):(_g(e,t,n,s-1),_g(e,t,i,r))}}function vg(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function yg(e){return e[0]}function xg(e){return e[1]}function bg(e,t){var n,r,i,s,a,o,l,u,c,h=0,A=e[0],d=e[1],p=t.length;for(n=0;n<p;n++){r=0;var f=t[n],m=f.length-1;if((u=f[0])[0]!==f[m][0]&&u[1]!==f[m][1])throw new Error("First and last coordinates in a ring must be the same");for(s=u[0]-A,a=u[1]-d;r<m;r++){if(o=(c=f[r+1])[0]-A,l=c[1]-d,0===a&&0===l){if(o<=0&&s>=0||s<=0&&o>=0)return 0}else if(l>=0&&a<=0||l<=0&&a>=0){if(0===(i=hg(s,o,a,l,0,0)))return 0;(i>0&&l>0&&a<=0||i<0&&l<=0&&a>0)&&h++}u=c,a=l,s=o}}return h%2!=0}var wg=function(e,t,n={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");const r=function(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if("Feature"===e.type&&null!==e.geometry&&"Point"===e.geometry.type)return[...e.geometry.coordinates];if("Point"===e.type)return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}(e),i="Feature"===(s=t).type?s.geometry:s;var s;const a=i.type,o=t.bbox;let l=i.coordinates;if(o&&!1===function(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}(r,o))return!1;"Polygon"===a&&(l=[l]);let u=!1;for(var c=0;c<l.length;++c){const e=bg(r,l[c]);if(0===e)return!n.ignoreBoundary;e&&(u=!0)}return u};const Tg=1e-6;class Sg{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},${this._y1=+t}`}arc(e,t,n){const r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Tg||Math.abs(this._y1-i)>Tg)&&(this._+="L"+r+","+i),n&&(this._+=`A${n},${n},0,1,1,${e-n},${t}A${n},${n},0,1,1,${this._x1=r},${this._y1=i}`)}rect(e,t,n,r){this._+=`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${+n}v${+r}h${-n}Z`}value(){return this._||null}}class Mg{constructor(){this._=[]}moveTo(e,t){this._.push([e,t])}closePath(){this._.push(this._[0].slice())}lineTo(e,t){this._.push([e,t])}value(){return this._.length?this._:null}}class Eg{constructor(e,[t,n,r,i]=[0,0,960,500]){if(!((r=+r)>=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:e,hull:t,triangles:n},vectors:r}=this;let i,s;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let r,o,l=0,u=0,c=n.length;l<c;l+=3,u+=2){const c=2*n[l],h=2*n[l+1],A=2*n[l+2],d=e[c],p=e[c+1],f=e[h],m=e[h+1],g=e[A],_=e[A+1],v=f-d,y=m-p,x=g-d,b=_-p,w=2*(v*b-y*x);if(Math.abs(w)<1e-9){if(void 0===i){i=s=0;for(const n of t)i+=e[2*n],s+=e[2*n+1];i/=t.length,s/=t.length}const n=1e9*Math.sign((i-d)*b-(s-p)*x);r=(d+g)/2-n*b,o=(p+_)/2+n*x}else{const e=1/w,t=v*v+y*y,n=x*x+b*b;r=d+(b*t-y*n)*e,o=p+(v*n-x*t)*e}a[u]=r,a[u+1]=o}let o,l,u,c=t[t.length-1],h=4*c,A=e[2*c],d=e[2*c+1];r.fill(0);for(let n=0;n<t.length;++n)c=t[n],o=h,l=A,u=d,h=4*c,A=e[2*c],d=e[2*c+1],r[o+2]=r[h]=u-d,r[o+3]=r[h+1]=A-l}render(e){const t=null==e?e=new Sg:void 0,{delaunay:{halfedges:n,inedges:r,hull:i},circumcenters:s,vectors:a}=this;if(i.length<=1)return null;for(let t=0,r=n.length;t<r;++t){const r=n[t];if(r<t)continue;const i=2*Math.floor(t/3),a=2*Math.floor(r/3),o=s[i],l=s[i+1],u=s[a],c=s[a+1];this._renderSegment(o,l,u,c,e)}let o,l=i[i.length-1];for(let t=0;t<i.length;++t){o=l,l=i[t];const n=2*Math.floor(r[l]/3),u=s[n],c=s[n+1],h=4*o,A=this._project(u,c,a[h+2],a[h+3]);A&&this._renderSegment(u,c,A[0],A[1],e)}return t&&t.value()}renderBounds(e){const t=null==e?e=new Sg:void 0;return e.rect(this.xmin,this.ymin,this.xmax-this.xmin,this.ymax-this.ymin),t&&t.value()}renderCell(e,t){const n=null==t?t=new Sg:void 0,r=this._clip(e);if(null===r||!r.length)return;t.moveTo(r[0],r[1]);let i=r.length;for(;r[0]===r[i-2]&&r[1]===r[i-1]&&i>1;)i-=2;for(let e=2;e<i;e+=2)r[e]===r[e-2]&&r[e+1]===r[e-1]||t.lineTo(r[e],r[e+1]);return t.closePath(),n&&n.value()}*cellPolygons(){const{delaunay:{points:e}}=this;for(let t=0,n=e.length/2;t<n;++t){const e=this.cellPolygon(t);e&&(e.index=t,yield e)}}cellPolygon(e){const t=new Mg;return this.renderCell(e,t),t.value()}_renderSegment(e,t,n,r,i){let s;const a=this._regioncode(e,t),o=this._regioncode(n,r);0===a&&0===o?(i.moveTo(e,t),i.lineTo(n,r)):(s=this._clipSegment(e,t,n,r,a,o))&&(i.moveTo(s[0],s[1]),i.lineTo(s[2],s[3]))}contains(e,t,n){return(t=+t)==t&&(n=+n)==n&&this.delaunay._step(e,t,n)===e}*neighbors(e){const t=this._clip(e);if(t)for(const n of this.delaunay.neighbors(e)){const e=this._clip(n);if(e)e:for(let r=0,i=t.length;r<i;r+=2)for(let s=0,a=e.length;s<a;s+=2)if(t[r]===e[s]&&t[r+1]===e[s+1]&&t[(r+2)%i]===e[(s+a-2)%a]&&t[(r+3)%i]===e[(s+a-1)%a]){yield n;break e}}}_cell(e){const{circumcenters:t,delaunay:{inedges:n,halfedges:r,triangles:i}}=this,s=n[e];if(-1===s)return null;const a=[];let o=s;do{const n=Math.floor(o/3);
vendor: 4,362 bytes, line 1
1if(a.push(t[2*n],t[2*n+1]),o=o%3==2?o-2:o+1,i[o]!==e)break;o=r[o]}while(o!==s&&-1!==o);return a}_clip(e){if(0===e&&1===this.delaunay.hull.length)return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];const t=this._cell(e);if(null===t)return null;const{vectors:n}=this,r=4*e;return this._simplify(n[r]||n[r+1]?this._clipInfinite(e,t,n[r],n[r+1],n[r+2],n[r+3]):this._clipFinite(e,t))}_clipFinite(e,t){const n=t.length;let r,i,s,a,o=null,l=t[n-2],u=t[n-1],c=this._regioncode(l,u),h=0;for(let A=0;A<n;A+=2)if(r=l,i=u,l=t[A],u=t[A+1],s=c,c=this._regioncode(l,u),0===s&&0===c)a=h,h=0,o?o.push(l,u):o=[l,u];else{let t,n,A,d,p;if(0===s){if(null===(t=this._clipSegment(r,i,l,u,s,c)))continue;[n,A,d,p]=t}else{if(null===(t=this._clipSegment(l,u,r,i,c,s)))continue;[d,p,n,A]=t,a=h,h=this._edgecode(n,A),a&&h&&this._edge(e,a,h,o,o.length),o?o.push(n,A):o=[n,A]}a=h,h=this._edgecode(d,p),a&&h&&this._edge(e,a,h,o,o.length),o?o.push(d,p):o=[d,p]}if(o)a=h,h=this._edgecode(o[0],o[1]),a&&h&&this._edge(e,a,h,o,o.length);else if(this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2))return[this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax,this.xmin,this.ymin];return o}_clipSegment(e,t,n,r,i,s){const a=i<s;for(a&&([e,t,n,r,i,s]=[n,r,e,t,s,i]);;){if(0===i&&0===s)return a?[n,r,e,t]:[e,t,n,r];if(i&s)return null;let o,l,u=i||s;8&u?(o=e+(n-e)*(this.ymax-t)/(r-t),l=this.ymax):4&u?(o=e+(n-e)*(this.ymin-t)/(r-t),l=this.ymin):2&u?(l=t+(r-t)*(this.xmax-e)/(n-e),o=this.xmax):(l=t+(r-t)*(this.xmin-e)/(n-e),o=this.xmin),i?(e=o,t=l,i=this._regioncode(e,t)):(n=o,r=l,s=this._regioncode(n,r))}}_clipInfinite(e,t,n,r,i,s){let a,o=Array.from(t);if((a=this._project(o[0],o[1],n,r))&&o.unshift(a[0],a[1]),(a=this._project(o[o.length-2],o[o.length-1],i,s))&&o.push(a[0],a[1]),o=this._clipFinite(e,o))for(let t,n=0,r=o.length,i=this._edgecode(o[r-2],o[r-1]);n<r;n+=2)t=i,i=this._edgecode(o[n],o[n+1]),t&&i&&(n=this._edge(e,t,i,o,n),r=o.length);else this.contains(e,(this.xmin+this.xmax)/2,(this.ymin+this.ymax)/2)&&(o=[this.xmin,this.ymin,this.xmax,this.ymin,this.xmax,this.ymax,this.xmin,this.ymax]);return o}_edge(e,t,n,r,i){for(;t!==n;){let n,s;switch(t){case 5:t=4;continue;case 4:t=6,n=this.xmax,s=this.ymin;break;case 6:t=2;continue;case 2:t=10,n=this.xmax,s=this.ymax;break;case 10:t=8;continue;case 8:t=9,n=this.xmin,s=this.ymax;break;case 9:t=1;continue;case 1:t=5,n=this.xmin,s=this.ymin}r[i]===n&&r[i+1]===s||!this.contains(e,n,s)||(r.splice(i,0,n,s),i+=2)}return i}_project(e,t,n,r){let i,s,a,o=1/0;if(r<0){if(t<=this.ymin)return null;(i=(this.ymin-t)/r)<o&&(a=this.ymin,s=e+(o=i)*n)}else if(r>0){if(t>=this.ymax)return null;(i=(this.ymax-t)/r)<o&&(a=this.ymax,s=e+(o=i)*n)}if(n>0){if(e>=this.xmax)return null;(i=(this.xmax-e)/n)<o&&(s=this.xmax,a=t+(o=i)*r)}else if(n<0){if(e<=this.xmin)return null;(i=(this.xmin-e)/n)<o&&(s=this.xmin,a=t+(o=i)*r)}return[s,a]}_edgecode(e,t){return(e===this.xmin?1:e===this.xmax?2:0)|(t===this.ymin?4:t===this.ymax?8:0)}_regioncode(e,t){return(e<this.xmin?1:e>this.xmax?2:0)|(t<this.ymin?4:t>this.ymax?8:0)}_simplify(e){if(e&&e.length>4){for(let t=0;t<e.length;t+=2){const n=(t+2)%e.length,r=(t+4)%e.length;(e[t]===e[n]&&e[n]===e[r]||e[t+1]===e[n+1]&&e[n+1]===e[r+1])&&(e.splice(n,2),t-=2)}e.length||(e=null)}return e}}const Cg=2*Math.PI,Rg=Math.pow;function Ng(e){return e[0]}function Pg(e){return e[1]}function Dg(e,t,n){return[e+Math.sin(e+t)*n,t+Math.cos(e-t)*n]}class Lg{static from(e,t=Ng,n=Pg,r){return new Lg("length"in e?function(e,t,n,r){const i=e.length,s=new Float64Array(2*i);for(let a=0;a<i;++a){const i=e[a];s[2*a]=t.call(r,i,a,e),s[2*a+1]=n.call(r,i,a,e)}return s}(e,t,n,r):Float64Array.from(function*(e,t,n,r){let i=0;for(const s of e)yield t.call(r,s,i,e),yield n.call(r,s,i,e),++i}(e,t,n,r)))}constructor(e){this._delaunator=new pg(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}update(){return this._delaunator.update(),this._init(),this}_init(){const e=this._delaunator,t=this.points;if(e.hull&&e.hull.length>2&&function(e){const{triangles:t,coords:n}=e;for(let e=0;e<t.length;e+=3){const r=2*t[e],i=2*t[e+1],s=2*t[e+2];if((n[s]-n[r])*(n[i+1]-n[r+1])-(n[i]-n[r])*(n[s+1]-n[r+1])>1e-10)return!1}return!0}(e)){this.collinear=Int32Array.from({length:t.length/2},((e,t)=>t)).sort(((e,n)=>
vendor: 4,195 bytes, line 1
1t[2*e]-t[2*n]||t[2*e+1]-t[2*n+1]));const e=this.collinear[0],n=this.collinear[this.collinear.length-1],r=[t[2*e],t[2*e+1],t[2*n],t[2*n+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let e=0,n=t.length/2;e<n;++e){const n=Dg(t[2*e],t[2*e+1],i);t[2*e]=n[0],t[2*e+1]=n[1]}this._delaunator=new pg(t)}else delete this.collinear;const n=this.halfedges=this._delaunator.halfedges,r=this.hull=this._delaunator.hull,i=this.triangles=this._delaunator.triangles,s=this.inedges.fill(-1),a=this._hullIndex.fill(-1);for(let e=0,t=n.length;e<t;++e){const t=i[e%3==2?e-2:e+1];-1!==n[e]&&-1!==s[t]||(s[t]=e)}for(let e=0,t=r.length;e<t;++e)a[r[e]]=e;r.length<=2&&r.length>0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],s[r[0]]=1,2===r.length&&(s[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(e){return new Eg(this,e)}*neighbors(e){const{inedges:t,hull:n,_hullIndex:r,halfedges:i,triangles:s,collinear:a}=this;if(a){const t=a.indexOf(e);return t>0&&(yield a[t-1]),void(t<a.length-1&&(yield a[t+1]))}const o=t[e];if(-1===o)return;let l=o,u=-1;do{if(yield u=s[l],l=l%3==2?l-2:l+1,s[l]!==e)return;if(l=i[l],-1===l){const t=n[(r[e]+1)%n.length];return void(t!==u&&(yield t))}}while(l!==o)}find(e,t,n=0){if((e=+e)!=e||(t=+t)!=t)return-1;const r=n;let i;for(;(i=this._step(n,e,t))>=0&&i!==n&&i!==r;)n=i;return i}_step(e,t,n){const{inedges:r,hull:i,_hullIndex:s,halfedges:a,triangles:o,points:l}=this;if(-1===r[e]||!l.length)return(e+1)%(l.length>>1);let u=e,c=Rg(t-l[2*e],2)+Rg(n-l[2*e+1],2);const h=r[e];let A=h;do{let r=o[A];const h=Rg(t-l[2*r],2)+Rg(n-l[2*r+1],2);if(h<c&&(c=h,u=r),A=A%3==2?A-2:A+1,o[A]!==e)break;if(A=a[A],-1===A){if(A=i[(s[e]+1)%i.length],A!==r&&Rg(t-l[2*A],2)+Rg(n-l[2*A+1],2)<c)return A;break}}while(A!==h);return u}render(e){const t=null==e?e=new Sg:void 0,{points:n,halfedges:r,triangles:i}=this;for(let t=0,s=r.length;t<s;++t){const s=r[t];if(s<t)continue;const a=2*i[t],o=2*i[s];e.moveTo(n[a],n[a+1]),e.lineTo(n[o],n[o+1])}return this.renderHull(e),t&&t.value()}renderPoints(e,t){void 0!==t||e&&"function"==typeof e.moveTo||(t=e,e=null),t=null==t?2:+t;const n=null==e?e=new Sg:void 0,{points:r}=this;for(let n=0,i=r.length;n<i;n+=2){const i=r[n],s=r[n+1];e.moveTo(i+t,s),e.arc(i,s,t,0,Cg)}return n&&n.value()}renderHull(e){const t=null==e?e=new Sg:void 0,{hull:n,points:r}=this,i=2*n[0],s=n.length;e.moveTo(r[i],r[i+1]);for(let t=1;t<s;++t){const i=2*n[t];e.lineTo(r[i],r[i+1])}return e.closePath(),t&&t.value()}hullPolygon(){const e=new Mg;return this.renderHull(e),e.value()}renderTriangle(e,t){const n=null==t?t=new Sg:void 0,{points:r,triangles:i}=this,s=2*i[e*=3],a=2*i[e+1],o=2*i[e+2];return t.moveTo(r[s],r[s+1]),t.lineTo(r[a],r[a+1]),t.lineTo(r[o],r[o+1]),t.closePath(),n&&n.value()}*trianglePolygons(){const{triangles:e}=this;for(let t=0,n=e.length/3;t<n;++t)yield this.trianglePolygon(t)}trianglePolygon(e){const t=new Mg;return this.renderTriangle(e,t),t.value()}}const Ig=Math.PI,Og=Ig/2,Bg=180/Ig,Ug=Ig/180,Fg=Math.atan2,kg=Math.cos,qg=Math.max,Vg=Math.min,zg=Math.sin,Gg=Math.sign||function(e){return e>0?1:e<0?-1:0},jg=Math.sqrt;function Hg(e){return e>1?Og:e<-1?-Og:Math.asin(e)}function Wg(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Xg(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Qg(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function Yg(e){var t=jg(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);return[e[0]/t,e[1]/t,e[2]/t]}function $g(e){return[Fg(e[1],e[0])*Bg,Hg(qg(-1,Vg(1,e[2])))*Bg]}function Kg(e){const t=e[0]*Ug,n=e[1]*Ug,r=kg(n);return[r*kg(t),r*zg(t),zg(n)]}function Zg(e){return Wg((e=e.map((e=>Kg(e))))[0],Xg(e[2],e[1]))}function Jg(e){const t=function(e){if(e.length<2)return{};let t=0;for(;isNaN(e[t][0]+e[t][1])&&t++<e.length;);const n=function(e){function t(t){return(t=e(t[0]*Uh,t[1]*Uh))[0]*=Bh,t[1]*=Bh,t}return e=wd(e[0]*Uh,e[1]*Uh,e.length>2?e[2]*Uh:0),t.invert=function(t){return(t=e.invert(t[0]*Uh,t[1]*Uh))[0]*=Bh,t[1]*=Bh,t},t}(e[t]),r=Ep().translate([0,0]).scale(1).rotate(n.invert([180,0])),i=[];let s=1;for(let t=0,n=(e=e.map(r)).length;t<n;t++){let n=e[t][0]**2+e[t][1]**2;!isFinite(n)||n>1e32?i.push(t):n>s&&(s=n)}const a=1e6*jg(s);
1i.forEach((t=>e[t]=[a,0])),e.push([0,a]),e.push([-a,0]),e.push([0,-a]);const o=Lg.from(e);o.projection=r;const{triangles:l,halfedges:u,inedges:c}=o;for(let n=0,r=u.length;n<r;n++)if(u[n]<0){const e=n%3==2?n-2:n+1,r=n%3==0?n+2:n-1,i=u[e],s=u[r];u[i]=s,u[s]=i,u[e]=u[r]=-1,l[n]=l[e]=l[r]=t,c[l[i]]=i%3==0?i+2:i-1,c[l[s]]=s%3==0?s+2:s-1,n+=2-n%3}else l[n]>e.length-3-1&&(l[n]=t);return o}(e),n=function(e){const{triangles:t}=e;if(!t)return[];const n=[];for(let e=0,r=t.length/3;e<r;e++){const r=t[3*e],i=t[3*e+1],s=t[3*e+2];r!==i&&i!==s&&n.push([r,s,i])}return n}(t),r=function(e,t){const n=new Set;return 2===t.length?[[0,1]]:(e.forEach((e=>{if(e[0]!==e[1]&&!(Zg(e.map((e=>t[e])))<0))for(let t,r=0;r<3;r++)t=(r+1)%3,n.add(tc([e[r],e[t]]).join("-"))})),Array.from(n,(e=>e.split("-").map(Number))))}(n,e),i=function(e,t){const n=[];return e.forEach((e=>{for(let t=0;t<3;t++){const r=e[t],i=e[(t+1)%3];n[r]=n[r]||[],n[r].push(i)}})),0===e.length&&(2===t?(n[0]=[1],n[1]=[0]):1===t&&(n[0]=[])),n}(n,e.length),s=function(e,t){function n(e,t){let n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return n*n+r*r+i*i}return function(r,i,s){void 0===s&&(s=0);let a,o,l=s;const u=Kg([r,i]);do{a=s,s=null,o=n(u,Kg(t[a])),e[a].forEach((e=>{let r=n(u,Kg(t[e]));if(r<o)return o=r,s=e,void(l=e)}))}while(null!==s);return l}}(i,e),a=function(e,t){return e.map((e=>{const n=e.map((e=>t[e])).map(Kg);return $g(Yg(Qg(Qg(Xg(n[1],n[0]),Xg(n[2],n[1])),Xg(n[0],n[2]))))}))}(n,e),{polygons:o,centers:l}=function(e,t,n){const r=[],i=e.slice();if(0===t.length){if(n.length<2)return{polygons:r,centers:i};if(2===n.length){const e=Kg(n[0]),t=Kg(n[1]),s=Yg(Qg(e,t)),o=Yg(Xg(e,t)),l=Xg(s,o),u=[s,Xg(s,l),Xg(Xg(s,l),l),Xg(Xg(Xg(s,l),l),l)].map($g).map(a);return r.push(u),r.push(u.slice().reverse()),{polygons:r,centers:i}}}t.forEach(((e,t)=>{for(let n=0;n<3;n++){const i=e[n],s=e[(n+1)%3],a=e[(n+2)%3];r[i]=r[i]||[],r[i].push([s,a,t,[i,s,a]])}}));const s=r.map((e=>{const t=[e[0][2]];let r=e[0][1];for(let n=1;n<e.length;n++)for(let n=0;n<e.length;n++)if(e[n][0]==r){r=e[n][1],t.push(e[n][2]);break}if(t.length>2)return t;if(2==t.length){const r=e_(n[e[0][3][0]],n[e[0][3][1]],i[t[0]]),s=e_(n[e[0][3][2]],n[e[0][3][0]],i[t[0]]),o=a(r),l=a(s);return[t[0],l,t[1],o]}}));function a(e){let n=-1;return i.slice(t.length,1/0).forEach(((r,i)=>{r[0]===e[0]&&r[1]===e[1]&&(n=i+t.length)})),n<0&&(n=i.length,i.push(e)),n}return{polygons:s,centers:i}}(a,n,e),u=function(e){const t=[];return e.forEach((e=>{if(!e)return;let n=e[e.length-1];for(let r of e)r>n&&t.push([n,r]),n=r})),t}(o),c=function(e,t){const n=new Set,r=[];e.map((e=>{if(!(Zg(e.map((e=>t[e>t.length?0:e])))>1e-12))for(let t=0;t<3;t++){let r=[e[t],e[(t+1)%3]],i=`${r[0]}-${r[1]}`;n.has(i)?n.delete(i):n.add(`${r[1]}-${r[0]}`)}}));const i=new Map;let s;if(n.forEach((e=>{e=e.split("-").map(Number),i.set(e[0],e[1]),s=e[0]})),void 0===s)return r;let a=s;do{r.push(a);let e=i.get(a);i.set(a,-1),a=e}while(a>-1&&a!==s);return r}(n,e),h=function(e,t){return function(n){const r=new Map,i=new Map;return e.forEach(((e,t)=>{const s=e.join("-");r.set(s,n[t]),i.set(s,!0)})),t.forEach((e=>{let t=0,n=-1;for(let i=0;i<3;i++){let s=tc([e[i],e[(i+1)%3]]).join("-");r.get(s)>t&&(t=r.get(s),n=s)}i.set(n,!1)})),e.map((e=>i.get(e.join("-"))))}}(r,n);return{delaunay:t,edges:r,triangles:n,centers:l,neighbors:i,polygons:o,mesh:u,hull:c,urquhart:h,find:s}}function e_(e,t,n){e=Kg(e),t=Kg(t),n=Kg(n);const r=Gg(Wg(Xg(t,e),n));return $g(Yg(Qg(e,t)).map((e=>r*e)))}function t_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n_(e,t,n){return t=r_(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i_()?Reflect.construct(t,[],r_(e).constructor):t.apply(e,n))}function r_(e){return r_=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r_(e)}function i_(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i_=function(){return!!e})()}function s_(e,t){return s_=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},s_(e,t)}function a_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}
1finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||l_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o_(e){return function(e){if(Array.isArray(e))return t_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l_(e,t){if(e){if("string"==typeof e)return t_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t_(e,t):void 0}}function u_(e,t){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?function(e,t){return(e&&ep.hasOwnProperty(e.type)?ep[e.type]:np)(e,t)}(t,e):wg(e,t)}var c_=window.THREE?window.THREE:{BufferGeometry:Ar,Float32BufferAttribute:ir},h_=(new c_.BufferGeometry).setAttribute?"setAttribute":"addAttribute",A_=function(e){function t(e,n,r,i,s,a,o){var l;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(l=n_(this,t)).type="ConicPolygonGeometry",l.parameters={polygonGeoJson:e,bottomHeight:n,topHeight:r,closedBottom:i,closedTop:s,includeSides:a,curvatureResolution:o},n=n||0,r=r||1,i=void 0===i||i,s=void 0===s||s,a=void 0===a||a;var u=function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).resolution,n=void 0===t?1/0:t,r=function(e,t){return e.map((function(e){var n,r=[];return e.forEach((function(e){if(n){var i=180*Jd(e,n)/Math.PI;if(i>t)for(var s=cp(n,e),a=1/Math.ceil(i/t),o=a;o<1;)r.push(s(o)),o+=a}r.push(n=e)})),r}))}(e,n),i=lc(r),s=function(e,t){var n={type:"Polygon",coordinates:e},r=a_(ld(n),2),i=a_(r[0],2),s=i[0],a=i[1],o=a_(r[1],2),l=o[0],u=o[1];if(Math.min(Math.abs(l-s),Math.abs(u-a))<t)return[];var c=s>l||u>=89||a<=-89;return function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.minLng,r=t.maxLng,i=t.minLat,s=t.maxLat,a=Math.round(Math.pow(360/e,2)/Math.PI),o=(1+Math.sqrt(5))/2,l=function(e){return e/o*360%360-180},u=function(e){return Math.acos(2*e/a-1)/Math.PI*180-90},c=function(e){return a*(Math.cos((e+90)*Math.PI/180)+1)/2},h=[void 0!==s?Math.ceil(c(s)):0,void 0!==i?Math.floor(c(i)):a-1],A=void 0===n&&void 0===r?function(){return!0}:void 0===n?function(e){return e<=r}:void 0===r?function(e){return e>=n}:r>=n?function(e){return e>=n&&e<=r}:function(e){return e>=n||e<=r},d=[],p=h[0];p<=h[1];p++){var f=l(p);A(f)&&d.push([f,u(p)])}return d}(t,{minLng:s,maxLng:l,minLat:a,maxLat:u}).filter((function(e){return u_(e,n,c)}))}(e,n),a=[].concat(o_(i),o_(s)),o={type:"Polygon",coordinates:e},l=a_(ld(o),2),u=a_(l[0],2),c=u[0],h=u[1],A=a_(l[1],2),d=A[0],p=A[1],f=c>d||p>=89||h<=-89,m=[];if(f){var g=function(e){const t=function(e){if(t.delaunay=null,t._data=e,"object"==typeof t._data&&"FeatureCollection"===t._data.type&&(t._data=t._data.features),"object"==typeof t._data){const e=t._data.map((e=>[t._vx(e),t._vy(e),e])).filter((e=>isFinite(e[0]+e[1])));t.points=e.map((e=>[e[0],e[1]])),t.valid=e.map((e=>e[2])),t.delaunay=Jg(t.points)}return t};return t._vx=function(e){return"object"==typeof e&&"type"in e?yd(e)[0]:0 in e?e[0]:void 0},t._vy=function(e){return"object"==typeof e&&"type"in e?yd(e)[1]:1 in e?e[1]:void 0},t.x=function(e){return e?(t._vx=e,t):t._vx},t.y=function(e){return e?(t._vy=e,t):t._vy},t.polygons=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const n={type:"FeatureCollection",features:[]};return 0===t.valid.length||(t.delaunay.polygons.forEach(((e,r)=>n.features.push({type:"Feature",geometry:e?{type:"Polygon",coordinates:[[...e,e[0]].map((e=>t.delaunay.centers[e]))]}:null,properties:{site:t.valid[r],sitecoordinates:t.points[r],neighbours:t.delaunay.neighbors[r]}}))),1===t.valid.length&&n.features.push({type:"Feature",geometry:{type:"Sphere"},properties:{site:t.valid[0],sitecoordinates:t.points[0],neighbours:[]}})),n},t.triangles=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"FeatureCollection",features:t.delaunay.triangles.map(((e,n)=>((e=e.map((e=>t.points[e]))).center=t.delaunay.centers[n],e))).filter((e=>Zg(e)>0)).map((e=>
1({type:"Feature",properties:{circumcenter:e.center},geometry:{type:"Polygon",coordinates:[[...e,e[0]]]}})))}},t.links=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const n=t.delaunay.edges.map((e=>Jd(t.points[e[0]],t.points[e[1]]))),r=t.delaunay.urquhart(n);return{type:"FeatureCollection",features:t.delaunay.edges.map(((e,i)=>({type:"Feature",properties:{source:t.valid[e[0]],target:t.valid[e[1]],length:n[i],urquhart:!!r[i]},geometry:{type:"LineString",coordinates:[t.points[e[0]],t.points[e[1]]]}})))}},t.mesh=function(e){return void 0!==e&&t(e),!!t.delaunay&&{type:"MultiLineString",coordinates:t.delaunay.edges.map((e=>[t.points[e[0]],t.points[e[1]]]))}},t.cellMesh=function(e){if(void 0!==e&&t(e),!t.delaunay)return!1;const{centers:n,polygons:r}=t.delaunay,i=[];for(const e of r)if(e)for(let t=e.length,r=e[t-1],s=e[0],a=0;a<t;r=s,s=e[++a])s>r&&i.push([n[r],n[s]]);return{type:"MultiLineString",coordinates:i}},t._found=void 0,t.find=function(e,n,r){if(t._found=t.delaunay.find(e,n,t._found),!r||Jd([e,n],t.points[t._found])<r)return t._found},t.hull=function(e){void 0!==e&&t(e);const n=t.delaunay.hull,r=t.points;return 0===n.length?null:{type:"Polygon",coordinates:[[...n.map((e=>r[e])),r[n[0]]]]}},e?t(e):t}(a).triangles(),_=new Map(a.map((function(e,t){var n=a_(e,2),r=n[0],i=n[1];return["".concat(r,"-").concat(i),t]})));g.features.forEach((function(e){var t,n=e.geometry.coordinates[0].slice(0,3).reverse(),r=[];if(n.forEach((function(e){var t=a_(e,2),n=t[0],i=t[1],s="".concat(n,"-").concat(i);_.has(s)&&r.push(_.get(s))})),3===r.length){if(r.some((function(e){return e<i.length}))&&!u_(e.properties.circumcenter,o,f))return;(t=m).push.apply(t,r)}}))}else if(s.length)for(var v=pg.from(a),y=function(e){var t,n=[2,1,0].map((function(t){return v.triangles[e+t]})),r=n.map((function(e){return a[e]}));if(n.some((function(e){return e<i.length}))){var s=[0,1].map((function(e){return function(e,t){let n=0,r=0;if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(++n,r+=t);else{let i=-1;for(let s of e)null!=(s=t(s,++i))&&(s=+s)>=s&&(++n,r+=s)}if(n)return r/n}(r,(function(t){return t[e]}))}));if(!u_(s,o,f))return 1}(t=m).push.apply(t,o_(n))},x=0,b=v.triangles.length;x<b;x+=3)y(x);else{var w=Ff(r),T=w.vertices,S=w.holes;m=Af(T,void 0===S?[]:S,2)}var M=Ch(tc(a,(function(e){return e[0]})),[0,1]),E=Ch(tc(a,(function(e){return e[1]})),[0,1]),C=a.map((function(e){var t=a_(e,2),n=t[0],r=t[1];return[M(n),E(r)]}));return{contour:r,triangles:{points:a,indices:m,uvs:C}}}(e,{resolution:o=o||5}),c=u.contour,h=u.triangles,A=lc(h.uvs),d=[],p=[],f=[],m=0,g=function(e){var t=Math.round(d.length/3),n=f.length;d=d.concat(e.vertices),p=p.concat(e.uvs),f=f.concat(t?e.indices.map((function(e){return e+t})):e.indices),l.addGroup(n,f.length-n,m++)};function _(e,t){var n="function"==typeof t?t:function(){return t},r=e.map((function(e){return e.map((function(e){var t=a_(e,2),r=t[0],i=t[1];return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180;return[n*Math.sin(r)*Math.cos(i),n*Math.cos(r),n*Math.sin(r)*Math.sin(i)]}(i,r,n(r,i))}))}));return Ff(r)}function v(e){return{indices:arguments.length>
vendor: 6,547 bytes, line 1
11&&void 0!==arguments[1]&&!arguments[1]?h.indices.slice().reverse():h.indices,vertices:_([h.points],e).vertices,uvs:A}}return a&&g(function(){for(var e=_(c,n),t=e.vertices,i=e.holes,s=_(c,r).vertices,a=lc([s,t]),o=Math.round(s.length/3),l=new Set(i),u=0,h=[],A=0;A<o;A++){var d=A+1;if(d===o)d=u;else if(l.has(d)){var p=d;d=u,u=p}h.push(A,A+o,d+o),h.push(d+o,d,A)}for(var f=[],m=1;m>=0;m--)for(var g=0;g<o;g+=1)f.push(g/(o-1),m);return{indices:h,vertices:a,uvs:f}}()),i&&g(v(n,!1)),s&&g(v(r,!0)),l.setIndex(f),l[h_]("position",new c_.Float32BufferAttribute(d,3)),l[h_]("uv",new c_.Float32BufferAttribute(p,2)),l.computeVertexNormals(),l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s_(e,t)}(t,e),function(e){return Object.defineProperty(e,"prototype",{writable:!1}),e}(t)}(c_.BufferGeometry);function d_(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||g_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f_(e){return function(e){if(Array.isArray(e))return d_(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m_(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function g_(e,t){if(e){if("string"==typeof e)return d_(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d_(e,t):void 0}}var __=function(e){var t,n,r,i,s,a,o=void 0!==(e=e||{})?e:{},l={};for(t in o)o.hasOwnProperty(t)&&(l[t]=o[t]);n="object"==typeof window,r="function"==typeof importScripts,s="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,i=s&&!n&&!r,a=!n&&!i&&!r;var u,c,h,A,d,p="";i?(p=__dirname+"/",u=function(e,t){var n;return(n=te(e))||(A||(A=require("fs")),d||(d=require("path")),e=d.normalize(e),n=A.readFileSync(e)),t?n:n.toString()},h=function(e){var t=u(e,!0);return t.buffer||(t=new Uint8Array(t)),v(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),o.inspect=function(){return"[Emscripten Module object]"}):a?("undefined"!=typeof read&&(u=function(e){var t=te(e);return t?J(t):read(e)}),h=function(e){var t;return(t=te(e))?t:"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(v("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(n||r)&&(r?p=self.location.href:"undefined"!=typeof document&&document.currentScript&&(p=document.currentScript.src),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",u=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText}catch(t){var n=te(e);if(n)return J(n);throw t}},r&&(h=function(e){try{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}catch(t){var n=te(e);if(n)return n;throw t}}),c=function(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response)t(r.response);else{var i=te(e);i?t(i.buffer):n()}},r.onerror=n,r.send(null)});var f=o.print||void 0,m=o.printErr||void 0;for(t in l)l.hasOwnProperty(t)&&(o[t]=l[t]);l=null,o.arguments&&o.arguments,o.thisProgram&&o.thisProgram;var g=0,_=!1;function v(e,t){e||fe("Assertion failed: "+t)}function y(e){var t=o["_"+e];return v(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function x(e,t,n,r,i){var s={string:function(e){var t=0;if(null!=e&&0!==e){var n=1+(e.length<<2);!function(e,t,n){!function(e,t,n,r){if(!(r>0))return 0;for(var i=n+r-1,s=0;s<e.length;++s){var a=e.charCodeAt(s);if(a>=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(n>=i)break;t[n++]=a}else if(a<=2047){if(n+1>=i)break;t[n++]=192|a>>6,t[n++]=128|63&a}else if(a<=65535){if(n+2>=i)break;t[n++]=224|a>>12,t[n++]=128|a>>6&63,t[n++]=128|63&a}else{if(n+3>=i)break;t[n++]=240|a>>18,t[n++]=128|a>>12&63,t[n++]=128|a>>6&63,t[n++]=128|63&a}}t[n]=0}(e,T,t,n)}(e,t=ae(n),n)}return t},array:function(e){var t=ae(e.length);return function(e,t){w.set(e,t)}(e,t),t}},a=y(e),o=[],l=0;if(r)for(var u=0;u<r.length;u++){var c=s[n[u]];c?(0===l&&(l=le()),o[u]=c(r[u])):o[u]=r[u]}var h=a.apply(null,o);return h=function(e){return"string"===t?N(e):"boolean"===t?Boolean(e):e}(h),0!==l&&oe(l),h}var b,w,T,S,M,E,C,R="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function N(e,t){return e?function(e,t,n){for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;if(i-t>16&&e.subarray&&R)return R.decode(e.subarray(t,i));for(var s="";t<i;){var a=e[t++];if(128&a){var o=63&e[t++];if(192!=(224&a)){var l=63&e[t++];if((a=224==(240&a)?(15&a)<<12|o<<6|l:(7&a)<<18|o<<12|l<<6|63&e[t++])<65536)s+=String.fromCharCode(a);else{var u=a-65536;s+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else s+=String.fromCharCode((31&a)<<6|o)}else s+=String.fromCharCode(a)}return s}(T,e,t):""}function P(e,t){return e%t>0&&(e+=t-e%t),e}function D(e){b=e,o.HEAP8=w=new Int8Array(e),o.HEAP16=S=new Int16Array(e),o.HEAP32=M=new Int32Array(e),o.HEAPU8=T=new Uint8Array(e),o.HEAPU16=new Uint16Array(e),o.HEAPU32=new
vendor: 916 bytes, line 1
1Uint32Array(e),o.HEAPF32=E=new Float32Array(e),o.HEAPF64=C=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var L=o.TOTAL_MEMORY||33554432;function I(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?o.dynCall_v(n):o.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t()}}L=(b=o.buffer?o.buffer:new ArrayBuffer(L)).byteLength,D(b),M[7152]=5271520;var O=[],B=[],U=[],F=[];function k(e){O.unshift(e)}function q(e){F.unshift(e)}var V=Math.abs,z=Math.ceil,G=Math.floor,j=Math.min,H=0,W=null;o.preloadedImages={},o.preloadedAudios={};var X,Q,Y=null,$="data:application/octet-stream;base64,";function K(e){return String.prototype.startsWith?e.startsWith($):0===e.indexOf($)}function Z(){return w.length}function J(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}Y
vendor: 28,573 bytes, line 1
1="data:application/octet-stream;base64,AAAAAAAAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAGAAAAAQAAAAQAAAADAAAABgAAAAUAAAACAAAAAAAAAAIAAAADAAAAAQAAAAQAAAAGAAAAAAAAAAUAAAADAAAABgAAAAQAAAAFAAAAAAAAAAEAAAACAAAABAAAAAUAAAAGAAAAAAAAAAIAAAADAAAAAQAAAAUAAAACAAAAAAAAAAEAAAADAAAABgAAAAQAAAAGAAAAAAAAAAUAAAACAAAAAQAAAAQAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAAAAAAEAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAYAAAAAAAAABQAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAYAAAAAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAMAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABQAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAYAAAAAAAAAAQAAAAIAAAADAAAABAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAYAAAAAAAAAAwAAAAIAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAFAAAABAAAAAAAAAABAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAYAAAAAAAAABAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAgAAAAQAAAADAAAACAAAAAEAAAAHAAAABgAAAAkAAAAAAAAAAwAAAAIAAAACAAAABgAAAAoAAAALAAAAAAAAAAEAAAAFAAAAAwAAAA0AAAABAAAABwAAAAQAAAAMAAAAAAAAAAQAAAB/AAAADwAAAAgAAAADAAAAAAAAAAwAAAAFAAAAAgAAABIAAAAKAAAACAAAAAAAAAAQAAAABgAAAA4AAAALAAAAEQAAAAEAAAAJAAAAAgAAAAcAAAAVAAAACQAAABMAAAADAAAADQAAAAEAAAAIAAAABQAAABYAAAAQAAAABAAAAAAAAAAPAAAACQAAABMAAAAOAAAAFAAAAAEAAAAHAAAABgAAAAoAAAALAAAAGAAAABcAAAAFAAAAAgAAABIAAAALAAAAEQAAABcAAAAZAAAAAgAAAAYAAAAKAAAADAAAABwAAAANAAAAGgAAAAQAAAAPAAAAAwAAAA0AAAAaAAAAFQAAAB0AAAADAAAADAAAAAcAAAAOAAAAfwAAABEAAAAbAAAACQAAABQAAAAGAAAADwAAABYAAAAcAAAAHwAAAAQAAAAIAAAADAAAABAAAAASAAAAIQAAAB4AAAAIAAAABQAAABYAAAARAAAACwAAAA4AAAAGAAAAIwAAABkAAAAbAAAAEgAAABgAAAAeAAAAIAAAAAUAAAAKAAAAEAAAABMAAAAiAAAAFAAAACQAAAAHAAAAFQAAAAkAAAAUAAAADgAAABMAAAAJAAAAKAAAABsAAAAkAAAAFQAAACYAAAATAAAAIgAAAA0AAAAdAAAABwAAABYAAAAQAAAAKQAAACEAAAAPAAAACAAAAB8AAAAXAAAAGAAAAAsAAAAKAAAAJwAAACUAAAAZAAAAGAAAAH8AAAAgAAAAJQAAAAoAAAAXAAAAEgAAABkAAAAXAAAAEQAAAAsAAAAtAAAAJwAAACMAAAAaAAAAKgAAAB0AAAArAAAADAAAABwAAAANAAAAGwAAACgAAAAjAAAALgAAAA4AAAAUAAAAEQAAABwAAAAfAAAAKgAAACwAAAAMAAAADwAAABoAAAAdAAAAKwAAACYAAAAvAAAADQAAABoAAAAVAAAAHgAAACAAAAAwAAAAMgAAABAAAAASAAAAIQAAAB8AAAApAAAALAAAADUAAAAPAAAAFgAAABwAAAAgAAAAHgAAABgAAAASAAAANAAAADIAAAAlAAAAIQAAAB4AAAAxAAAAMAAAABYAAAAQAAAAKQAAACIAAAATAAAAJgAAABUAAAA2AAAAJAAAADMAAAAjAAAALgAAAC0AAAA4AAAAEQAAABsAAAAZAAAAJAAAABQAAAAiAAAAEwAAADcAAAAoAAAANgAAACUAAAAnAAAANAAAADkAAAAYAAAAFwAAACAAAAAmAAAAfwAAACIAAAAzAAAAHQAAAC8AAAAVAAAAJwAAACUAAAAZAAAAFwAAADsAAAA5AAAALQAAACgAAAAbAAAAJAAAABQAAAA8AAAALgAAADcAAAApAAAAMQAAADUAAAA9AAAAFgAAACEAAAAfAAAAKgAAADoAAAArAAAAPgAAABwAAAAsAAAAGgAAACsAAAA+AAAALwAAAEAAAAAaAAAAKgAAAB0AAAAsAAAANQAAADoAAABBAAAAHAAAAB8AAAAqAAAALQAAACcAAAAjAAAAGQAAAD8AAAA7AAAAOAAAAC4AAAA8AAAAOAAAAEQAAAAbAAAAKAAAACMAAAAvAAAAJgAAACsAAAAdAAAARQAAADMAAABAAAAAMAAAADEAAAAeAAAAIQAAAEMAAABCAAAAMgAAADEAAAB/AAAAPQAAAEIAAAAhAAAAMAAAACkAAAAyAAAAMAAAACAAAAAeAAAARgAAAEMAAAA0AAAAMwAAAEUAAAA2AAAARwAAACYAAAAvAAAAIgAAADQAAAA5AAAARgAAAEoAAAAgAAAAJQAAADIAAAA1AAAAPQAAAEEAAABLAAAAHwAAACkAAAAsAAAANgAAAEcAAAA3AAAASQAAACIAAAAzAAAAJAAAADcAAAAoAAAANgAAACQAAABIAAAAPAAAAEkAAAA4AAAARAAAAD8AAABNAAAAIwAAAC4AAAAtAAAAOQAAADsAAABKAAAATgAAACUAAAAnAAAANAAAADoAAAB/AAAAPgAAAEwAAAAsAAAAQQAAACoAAAA7AAAAPwAAAE4AAABPAAAAJwAAAC0AAAA5AAAAPAAAAEgAAABEAAAAUAAAACgAAAA3AAAALgAAAD0AAAA1AAAAMQAAACkAAABRAAAASwAAAEIAAAA+AAAAKwAAADoAAAAqAAAAUgAAAEAAAABMAAAAPwAAAH8AAAA4AAAALQAAAE8AAAA7AAAATQAAAEAAAAAvAAAAPgAAACsAAABUAAAARQAAAFIAAABBAAAAOgAAADUAAAAsAAAAVgAAAEwAAABLAAAAQgAAAEMAAABRAAAAVQAAADEAAAAwAAAAPQAAAEMAAABCAAAAMgAAADAAAABXAAAAVQAAAEYAAABEAAAAOAAAADwAAAAuAAAAWgAAAE0AAABQAAAARQAAADMAAABAAAAALwAAAFkAAABHAAAAVAAAAEYAAABDAAAANAAAADIAAABTAAAAVwAAAEoAAABHAAAAWQAAAEkAAABbAAAAMwAAAEUAAAA2AAAASAAAAH8AAABJAAAANwAAAFAAAAA8AAAAWAAAAEkAAABbAAAASAAAAFgAAAA2AAAARwAAADcAAABKAAAATgAAAFMAAABcAAAANAAAADkAAABGAAAASwAAAEEAAAA9AAAANQAAAF4AAABWAAAAUQAAAEwAAABWAAAAUgAAAGAAAAA6AAAAQQAAAD4AAABNAAAAPwAAAEQAAAA4AAAAXQAAAE8AAABaAAAATgAAAEoAAAA7AAAAOQAAAF8AAABcAAAATwAAAE8AAABOAAAAPwAAADsAAABdAAAAXwAAAE0AAABQAAAARAAAAEgAAAA8AAAAYwAAAFoAAABYAAAAUQAAAFUAAABeAAAAZQAAAD0AAABCAAAASwAAAFIAAABgAAAAVAAAAGIAAAA+AAAATAAAAEAAAABTAAAAfwAAAEoAAABGAAAAZAAAAFcAAABcAAAAVAAAAEUAAABSAAAAQAAAAGEAAABZAAAAYgAAAFUAAABXAAAAZQAAAGYAAABCAAAAQwAAAFEAAABWAAAATAAAAEsAAABBAAAAaAAAAGAAAABeAAAAVwAAAFMAAABmAAAAZAAAAEMAAABGAAAAVQAAAFgAAABIAAAAWwAAAEkAAABjAAAAUAAAAGkAAABZAAAAYQAAAFsAAABnAAAARQAAAFQAAABHAAAAWgAAAE0AAABQAAAARAAAAGoAAABdAAAAYwAAAFsAAABJAAAAWQAAAEcAAABpAAAAWAAAAGcAAABcAAAAUwAAAE4AAABKAAAAbAAAAGQAAABfAAAAXQAAAE8AAABaAAAATQAAAG0AAABfAAAAagAAAF4AAABWAAAAUQAAAEsAAABrAAAAaAAAAGUAAABfAAAAXAAAAE8AAABOAAAAbQAAAGwAAABdAAAAYAAAAGgAAABiAAAAbgAAAEwAAABWAAAAUgAAAGEAAAB/AAAAYgAAAFQAAABnAAAAWQAAAG8AAABiAAAAbgAAAGEAAABvAAAAUgAAAGAAAABUAAAAYwAAAFAAAABpAAAAWAAAAGoAAABaAAAAcQAAAGQAAABmAAAAUwAAAFcAAABsAAAAcgAAAFwAAABlAAAAZgAAAGsAAABwAAAAUQAAAFUAAABeAAAAZgAAAGUAAABXAAAAVQAAAHIAAABwAAAAZAAAAGcAAABbAAAAYQAAAFkAAAB0AAAAaQAAAG8AAABoAAAAawAAAG4AAABzAAAAVgAAAF4AAABgAAAAaQAAAFgAAABnAAAAWwAAAHEAAABjAAAAdAAAAGoAAABdAAAAYwAAAFoAAAB1AAAAbQAAAHEAAABrAAAAfwAAAGUAAABeAAAAcwAAAGgAAABwAAAAbAAAAGQAAABfAAAAXAAAAHYAAAByAAAAbQAAAG0AAABsAAAAXQAAAF8AAAB1AAAAdgAAAGoAAABuAAAAYgAAAGgAAABgAAAAdwAAAG8AAABzAAAAbwAAAGEAAABuAAAAYgAAAHQAAABnAAAAdwAAAHAAAABrAAAAZgAAAGUAAAB4AAAAcwAAAHIAAABxAAAAYwAAAHQAAABpAAAAdQAAAGoAAAB5AAAAcgAAAHAAAABkAAAAZgAAAHYAAAB4AAAAbAAAAHMAAABuAAAAawAAAGgAAAB4AAAAdwAAAHAAAAB0AAAAZwAAAHcAAABvAAAAcQAAAGkAAAB5AAAAdQAAAH8AAABtAAAAdgAAAHEAAAB5AAAAagAAAHYAAAB4AAAAbAAAAHIAAAB1AAAAeQAAAG0AAAB3AAAAbwAAAHMAAABuAAAAeQAAAHQAAAB4AAAAeAAAAHMAAAByAAAAcAAAAHkAAAB3AAAAdgAAAHkAAAB0AAAAeAAAAHcAAAB1AAAAcQAAAHYAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAACAAAABQAAAAEAAAAAAAAA/////wEAAAAAAAAAAwAAAAQAAAACAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAABQAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAFAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAUAAAABAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAABAAAAAUAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAFAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAUAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAD//////////wEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAAAAAAAAAAABAAAAAgAAAAYAAAAEAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAAAAAAAAAAAAQAAAAEAAAAFAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAAAAAAAAAAABAAAAAwAAAAcAAAAGAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADgAAAAIAAAAAAAAAAAAAAAEAAAAAAAAACQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAMAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAAAAAAAAAAAAAEAAAAEAAAACAAAAAoAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAAAAAAAAAAAAQAAAAsAAAAPAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAIAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAAAAAAAAAAAAQAAAAwAAAAQAAAADAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAAAAAAAAAAABAAAACgAAABMAAAAIAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAAAAAAAAAAAAAEAAAANAAAAEQAAAA0AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAACAAAAAAAAAAAAAAABAAAADgAAABIAAAAPAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAADwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABIAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAAAAAAAAQAAAP//////////EwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAASAAAAAAAAABgAAAAAAAAAIQAAAAAAAAAeAAAAAAAAACAAAAADAAAAMQAAAAEAAAAwAAAAAwAAADIAAAADAAAACAAAAAAAAAAFAAAABQAAAAoAAAAFAAAAFgAAAAAAAAAQAAAAAAAAABIAAAAAAAAAKQAAAAEAAAAhAAAAAAAAAB4AAAAAAAAABAAAAAAAAAAAAAAABQAAAAIAAAAFAAAADwAAAAEAAAAIAAAAAAAAAAUAAAAFAAAAHwAAAAEAAAAWAAAAAAAAABAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAA4AAAAAAAAACgAAAAAAAAALAAAAAAAAABEAAAADAAAAGAAAAAEAAAAXAAAAAwAAABkAAAADAAAAAAAAAAAAAAABAAAABQAAAAkAAAAFAAAABQAAAAAAAAACAAAAAAAAAAYAAAAAAAAAEgAAAAEAAAAKAAAAAAAAAAsAAAAAAAAABAAAAAEAAAADAAAABQAAAAcAAAAFAAAACAAAAAEAAAAAAAAAAAAAAAEAAAAFAAAAEAAAAAEAAAAFAAAAAAAAAAIAAAAAAAAABwAAAAAAAAAVAAAAAAAAACYAAAAAAAAACQAAAAAAAAATAAAAAAAAACIAAAADAAAADgAAAAEAAAAUAAAAAwAAACQAAAADAAAAAwAAAAAAAAANAAAABQAAAB0AAAAFAAAAAQAAAAAAAAAHAAAAAAAAABUAAAAAAAAABgAAAAEAAAAJAAAAAAAAABMAAAAAAAAABAAAAAIAAAAMAAAABQAAABoAAAAFAAAAAAAAAAEAAAADAAAAAAAAAA0AAAAFAAAAAgAAAAEAAAABAAAAAAAAAAcAAAAAAAAAGgAAAAAAAAAqAAAAAAAAADoAAAAAAAAAHQAAAAAAAAArAAAAAAAAAD4AAAADAAAAJgAAAAEAAAAvAAAAAwAAAEAAAAADAAAADAAAAAAAAAAcAAAABQAAACwAAAAFAAAADQAAAAAAAAAaAAAAAAAAACoAAAAAAAAAFQAAAAEAAAAdAAAAAAAAACsAAAAAAAAABAAAAAMAAAAPAAAABQAAAB8AAAAFAAAAAwAAAAEAAAAMAAAAAAAAABwAAAAFAAAABwAAAAEAAAANAAAAAAAAABoAAAAAAAAAHwAAAAAAAAApAAAAAAAAADEAAAAAAAAALAAAAAAAAAA1AAAAAAAAAD0AAAADAAAAOgAAAAEAAABBAAAAAwAAAEsAAAADAAAADwAAAAAAAAAWAAAABQAAACEAAAAFAAAAHAAAAAAAAAAfAAAAAAAAACkAAAAAAAAAKgAAAAEAAAAsAAAAAAAAADUAAAAAAAAABAAAAAQAAAAIAAAABQAAABAAAAAFAAAADAAAAAEAAAAPAAAAAAAAABYAAAAFAAAAGgAAAAEAAAAcAAAAAAAAAB8AAAAAAAAAMgAAAAAAAAAwAAAAAAAAADEAAAADAAAAIAAAAAAAAAAeAAAAAwAAACEAAAADAAAAGAAAAAMAAAASAAAAAwAAABAAAAADAAAARgAAAAAAAABDAAAAAAAAAEIAAAADAAAANAAAAAMAAAAyAAAAAAAAADAAAAAAAAAAJQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAUwAAAAAAAABXAAAAAwAAAFUAAAADAAAASgAAAAMAAABGAAAAAAAAAEMAAAAAAAAAOQAAAAEAAAA0AAAAAwAAADIAAAAAAAAAGQAAAAAAAAAXAAAAAAAAABgAAAADAAAAEQAAAAAAAAALAAAAAwAAAAoAAAADAAAADgAAAAMAAAAGAAAAAwAAAAIAAAADAAAALQAAAAAAAAAnAAAAAAAAACUAAAADAAAAIwAAAAMAAAAZAAAAAAAAABcAAAAAAAAAGwAAAAMAAAARAAAAAAAAAAsAAAADAAAAPwAAAAAAAAA7AAAAAwAAADkAAAADAAAAOAAAAAMAAAAtAAAAAAAAACcAAAAAAAAALgAAAAMAAAAjAAAAAwAAABkAAAAAAAAAJAAAAAAAAAAUAAAAAAAAAA4AAAADAAAAIgAAAAAAAAATAAAAAwAAAAkAAAADAAAAJgAAAAMAAAAVAAAAAwAAAAcAAAADAAAANwAAAAAAAAAoAAAAAAAAABsAAAADAAAANgAAAAMAAAAkAAAAAAAAABQAAAAAAAAAMwAAAAMAAAAiAAAAAAAAABMAAAADAAAASAAAAAAAAAA8AAAAAwAAAC4AAAADAAAASQAAAAMAAAA3AAAAAAAAACgAAAAAAAAARwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAQAAAAAAAAAAvAAAAAAAAACYAAAADAAAAPgAAAAAAAAArAAAAAwAAAB0AAAADAAAAOgAAAAMAAAAqAAAAAwAAABoAAAADAAAAVAAAAAAAAABFAAAAAAAAADMAAAADAAAAUgAAAAMAAABAAAAAAAAAAC8AAAAAAAAATAAAAAMAAAA+AAAAAAAAACsAAAADAAAAYQAAAAAAAABZAAAAAwAAAEcAAAADAAAAYgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAYAAAAAMAAABSAAAAAwAAAEAAAAAAAAAASwAAAAAAAABBAAAAAAAAADoAAAADAAAAPQAAAAAAAAA1AAAAAwAAACwAAAADAAAAMQAAAAMAAAApAAAAAwAAAB8AAAADAAAAXgAAAAAAAABWAAAAAAAAAEwAAAADAAAAUQAAAAMAAABLAAAAAAAAAEEAAAAAAAAAQgAAAAMAAAA9AAAAAAAAADUAAAADAAAAawAAAAAAAABoAAAAAwAAAGAAAAADAAAAZQAAAAMAAABeAAAAAAAAAFYAAAAAAAAAVQAAAAMAAABRAAAAAwAAAEsAAAAAAAAAOQAAAAAAAAA7AAAAAAAAAD8AAAADAAAASgAAAAAAAABOAAAAAwAAAE8AAAADAAAAUwAAAAMAAABcAAAAAwAAAF8AAAADAAAAJQAAAAAAAAAnAAAAAwAAAC0AAAADAAAANAAAAAAAAAA5AAAAAAAAADsAAAAAAAAARgAAAAMAAABKAAAAAAAAAE4AAAADAAAAGAAAAAAAAAAXAAAAAwAAABkAAAADAAAAIAAAAAMAAAAlAAAAAAAAACcAAAADAAAAMgAAAAMAAAA0AAAAAAAAADkAAAAAAAAALgAAAAAAAAA8AAAAAAAAAEgAAAADAAAAOAAAAAAAAABEAAAAAwAAAFAAAAADAAAAPwAAAAMAAABNAAAAAwAAAFoAAAADAAAAGwAAAAAAAAAoAAAAAwAAADcAAAADAAAAIwAAAAAAAAAuAAAAAAAAADwAAAAAAAAALQAAAAMAAAA4AAAAAAAAAEQAAAADAAAADgAAAAAAAAAUAAAAAwAAACQAAAADAAAAEQAAAAMAAAAbAAAAAAAAACgAAAADAAAAGQAAAAMAAAAjAAAAAAAAAC4AAAAAAAAARwAAAAAAAABZAAAAAAAAAGEAAAADAAAASQAAAAAAAABbAAAAAwAAAGcAAAADAAAASAAAAAMAAABYAAAAAwAAAGkAAAADAAAAMwAAAAAAAABFAAAAAwAAAFQAAAADAAAANgAAAAAAAABHAAAAAAAAAFkAAAAAAAAANwAAAAMAAABJAAAAAAAAAFsAAAADAAAAJgAAAAAAAAAvAAAAAwAAAEAAAAADAAAAIgAAAAMAAAAzAAAAAAAAAEUAAAADAAAAJAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAYAAAAAAAAABoAAAAAAAAAGsAAAADAAAAYgAAAAAAAABuAAAAAwAAAHMAAAADAAAAYQAAAAMAAABvAAAAAwAAAHcAAAADAAAATAAAAAAAAABWAAAAAwAAAF4AAAADAAAAUgAAAAAAAABgAAAAAAAAAGgAAAAAAAAAVAAAAAMAAABiAAAAAAAAAG4AAAADAAAAOgAAAAAAAABBAAAAAwAAAEsAAAADAAAAPgAAAAMAAABMAAAAAAAAAFYAAAADAAAAQAAAAAMAAABSAAAAAAAAAGAAAAAAAAAAVQAAAAAAAABXAAAAAAAAAFMAAAADAAAAZQAAAAAAAABmAAAAAwAAAGQAAAADAAAAawAAAAMAAABwAAAAAwAAAHIAAAADAAAAQgAAAAAAAABDAAAAAwAAAEYAAAADAAAAUQAAAAAAAABVAAAAAAAAAFcAAAAAAAAAXgAAAAMAAABlAAAAAAAAAGYAAAADAAAAMQAAAAAAAAAwAAAAAwAAADIAAAADAAAAPQAAAAMAAABCAAAAAAAAAEMAAAADAAAASwAAAAMAAABRAAAAAAAAAFUAAAAAAAAAXwAAAAAAAABcAAAAAAAAAFMAAAAAAAAATwAAAAAAAABOAAAAAAAAAEoAAAADAAAAPwAAAAEAAAA7AAAAAwAAADkAAAADAAAAbQAAAAAAAABsAAAAAAAAAGQAAAAFAAAAXQAAAAEAAABfAAAAAAAAAFwAAAAAAAAATQAAAAEAAABPAAAAAAAAAE4AAAAAAAAAdQAAAAQAAAB2AAAABQAAAHIAAAAFAAAAagAAAAEAAABtAAAAAAAAAGwAAAAAAAAAWgAAAAEAAABdAAAAAQAAAF8AAAAAAAAAWgAAAAAAAABNAAAAAAAAAD8AAAAAAAAAUAAAAAAAAABEAAAAAAAAADgAAAADAAAASAAAAAEAAAA8AAAAAwAAAC4AAAADAAAAagAAAAAAAABdAAAAAAAAAE8AAAAFAAAAYwAAAAEAAABaAAAAAAAAAE0AAAAAAAAAWAAAAAEAAABQAAAAAAAAAEQAAAAAAAAAdQAAAAMAAABtAAAABQAAAF8AAAAFAAAAcQAAAAEAAABqAAAAAAAAAF0AAAAAAAAAaQAAAAEAAABjAAAAAQAAAFoAAAAAAAAAaQAAAAAAAABYAAAAAAAAAEgAAAAAAAAAZwAAAAAAAABbAAAAAAAAAEkAAAADAAAAYQAAAAEAAABZAAAAAwAAAEcAAAADAAAAcQAAAAAAAABjAAAAAAAAAFAAAAAFAAAAdAAAAAEAAABpAAAAAAAAAFgAAAAAAAAAbwAAAAEAAABnAAAAAAAAAFsAAAAAAAAAdQAAAAIAAABqAAAABQAAAFoAAAAFAAAAeQAAAAEAAABxAAAAAAAAAGMAAAAAAAAAdwAAAAEAAAB0AAAAAQAAAGkAAAAAAAAAdwAAAAAAAABvAAAAAAAAAGEAAAAAAAAAcwAAAAAAAABuAAAAAAAAAGIAAAADAAAAawAAAAEAAABoAAAAAwAAAGAAAAADAAAAeQAAAAAAAAB0AAAAAAAAAGcAAAAFAAAAeAAAAAEAAAB3AAAAAAAAAG8AAAAAAAAAcAAAAAEAAABzAAAAAAAAAG4AAAAAAAAAdQAAAAEAAABxAAAABQAAAGkAAAAFAAAAdgAAAAEAAAB5AAAAAAAAAHQAAAAAAAAAcgAAAAEAAAB4AAAAAQAAAHcAAAAAAAAAcgAAAAAAAABwAAAAAAAAAGsAAAAAAAAAZAAAAAAAAABmAAAAAAAAAGUAAAADAAAAUwAAAAEAAABXAAAAAwAAAFUAAAADAAAAdgAAAAAAAAB4AAAAAAAAAHMAAAAFAAAAbAAAAAEAAAByAAAAAAAAAHAAAAAAAAAAXAAAAAEAAABkAAAAAAAAAGYAAAAAAAAAdQAAAAAAAAB5AAAABQAAAHcAAAAFAAAAbQAAAAEAAAB2AAAAAAAAAHgAAAAAAAAAXwAAAAEAAABsAAAAAQAAAHIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAGAAAAAgAAAAUAAAABAAAABAAAAAAAAAAAAAAABQAAAAMAAAABAAAABgAAAAQAAAACAAAAAAAAAH6iBfbytuk/Gq6akm/58z/Xrm0Liez0P5doSdOpSwRAWs602ULg8D/dT7Rcbo/1v1N1RQHFNOM/g9Snx7HW3L8HWsP8Q3jfP6VwOLosutk/9rjk1YQcxj+gnmKMsNn6P/HDeuPFY+M/YHwDjqKhB0Ci19/fCVrbP4UxKkDWOP6/pvljWa09tL9wi7wrQXjnv/Z6yLImkM2/3yTlOzY14D+m+WNZrT20PzwKVQnrQwNA9nrIsiaQzT/g40rFrRQFwPa45NWEHMa/kbslHEZq97/xw3rjxWPjv4cLC2SMBci/otff3wla27+rKF5oIAv0P1N1RQHFNOO/iDJPGyWHBUAHWsP8Q3jfvwQf/by16gXAfqIF9vK26b8XrO0Vh0r+v9eubQuJ7PS/BxLrA0ZZ479azrTZQuDwv1MK1EuItPw/yscgV9Z6FkAwHBR2WjQMQJNRzXsQ5vY/GlUHVJYKF0DONuFv2lMNQNCGZ28QJfk/0WUwoIL36D8ggDOMQuATQNqMOeAy/wZAWFYOYM+M2z/LWC4uH3oSQDE+LyTsMgRAkJzhRGWFGEDd4soovCQQQKqk0DJMEP8/rGmNdwOLBUAW2X/9xCbjP4hu3dcqJhNAzuYItRvdB0CgzW3zJW/sPxotm/Y2TxRAQAk9XmdDDEC1Kx9MKgT3P1M+NctcghZAFVqcLlb0C0Bgzd3sB2b2P77mZDPUWhZAFROHJpUGCEDAfma5CxXtPz1DWq/zYxRAmhYY5824F0DOuQKWSbAOQNCMqrvu3fs/L6DR22K2wT9nAAxPBU8RQGiN6mW43AFAZhu25b633D8c1YgmzowSQNM25BRKWARArGS08/lNxD+LFssHwmMRQLC5aNcxBgJABL9HT0WRF0CjCmJmOGEOQHsuaVzMP/s/TWJCaGGwBUCeu1PAPLzjP9nqN9DZOBNAKE4JcydbCkCGtbd1qjPzP8dgm9U8jhVAtPeKTkVwDkCeCLss5l37P401XMPLmBdAFd29VMVQDUBg0yA55h75Pz6odcYLCRdApBM4rBrkAkDyAVWgQxbRP4XDMnK20hFAymLlF7EmzD8GUgo9XBHlP3lbK7T9COc/k+OhPthhy7+YGEpnrOvCPzBFhLs15u4/epbqB6H4uz9IuuLF5svev6lzLKY31es/CaQ0envF5z8ZY0xlUADXv7zaz7HYEuI/CfbK1sn16T8uAQfWwxLWPzKn/YuFN94/5KdbC1AFu793fyCSnlfvPzK2y4doAMY/NRg5t1/X6b/shq4QJaHDP5yNIAKPOeI/vpn7BSE30r/X4YQrO6nrv78Ziv/Thto/DqJ1Y6+y5z9l51NaxFrlv8QlA65HOLS/86dxiEc96z+Hj0+LFjneP6LzBZ8LTc2/DaJ1Y6+y579l51NaxFrlP8QlA65HOLQ/8qdxiEc967+Jj0+LFjnev6LzBZ8LTc0/1qdbC1AFuz93fyCSnlfvvzK2y4doAMa/NRg5t1/X6T/vhq4QJaHDv5yNIAKPOeK/wJn7BSE30j/W4YQrO6nrP78Ziv/Thtq/CaQ0envF578XY0xlUADXP7zaz7HYEuK/CvbK1sn16b8rAQfWwxLWvzKn/YuFN96/zWLlF7EmzL8GUgo9XBHlv3lbK7T9COe/kOOhPthhyz+cGEpnrOvCvzBFhLs15u6/c5bqB6H4u79IuuLF5sveP6lzLKY31eu/AQAAAP////8HAAAA/////zEAAAD/////VwEAAP////9hCQAA/////6dBAAD/////kcsBAP/////3kAwA/////8H2VwAAAAAAAAAAAAAAAAACAAAA/////w4AAAD/////YgAAAP////+uAgAA/////8ISAAD/////ToMAAP////8ilwMA/////+4hGQD/////gu2vAAAAAAAAAAAAAAAAAAAAAAACAAAA//////////8BAAAAAwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////////////////////AQAAAAAAAAACAAAA////////////////AwAAAP//////////////////////////////////////////////////////////AgAAAP//////////AQAAAAAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD/////////////////////AQAAAP///////////////wIAAAD///////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAD///////////////8CAAAAAQAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8BAAAAAgAAAP///////////////wAAAAD/////////////////////AwAAAP///////////////////////////////wIAAAD///////////////8BAAAA/////////////////////wAAAAD/////////////////////AwAAAP////////////////////////////////////////////////////8DAAAA/////////////////////wAAAAABAAAA//////////8CAAAA//////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAA////////////////AgAAAAAAAAABAAAA//////////////////////////////////////////////////////////////////////////8DAAAAAQAAAP//////////AgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAACAAAAAAAAAAIAAAABAAAAAQAAAAIAAAACAAAAAAAAAAUAAAAFAAAAAAAAAAIAAAACAAAAAwAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAgAAAAEAAAACAAAAAgAAAAIAAAAAAAAABQAAAAYAAAAAAAAAAgAAAAIAAAADAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAMAAAACAAAAAgAAAAAAAAAFAAAABwAAAAAAAAACAAAAAgAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAABAAAAAIAAAACAAAAAAAAAAUAAAAIAAAAAAAAAAIAAAACAAAAAwAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAIAAAAAAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAAAAAAABQAAAAkAAAAAAAAAAgAAAAIAAAADAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAgAAAAIAAAAAAAAAAwAAAA4AAAACAAAAAAAAAAIAAAADAAAAAAAAAAAAAAACAAAAAgAAAAMAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAACAAAAAgAAAAAAAAADAAAACgAAAAIAAAAAAAAAAgAAAAMAAAABAAAAAAAAAAIAAAACAAAAAwAAAAcAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAACAAAAAAAAAAMAAAALAAAAAgAAAAAAAAACAAAAAwAAAAIAAAAAAAAAAgAAAAIAAAADAAAACAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAIAAAAAAAAAAwAAAAwAAAACAAAAAAAAAAIAAAADAAAAAwAAAAAAAAACAAAAAgAAAAMAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAACAAAAAgAAAAAAAAADAAAADQAAAAIAAAAAAAAAAgAAAAMAAAAEAAAAAAAAAAIAAAACAAAAAwAAAAoAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAACAAAAAAAAAAMAAAAGAAAAAgAAAAAAAAACAAAAAwAAAA8AAAAAAAAAAgAAAAIAAAADAAAACwAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAgAAAAIAAAAAAAAAAwAAAAcAAAACAAAAAAAAAAIAAAADAAAAEAAAAAAAAAACAAAAAgAAAAMAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAgAAAAAAAAADAAAACAAAAAIAAAAAAAAAAgAAAAMAAAARAAAAAAAAAAIAAAACAAAAAwAAAA0AAAAAAAAAAAAAAAAAAAAAAAAACAAAAAIAAAACAAAAAAAAAAMAAAAJAAAAAgAAAAAAAAACAAAAAwAAABIAAAAAAAAAAgAAAAIAAAADAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAJAAAAAgAAAAIAAAAAAAAAAwAAAAUAAAACAAAAAAAAAAIAAAADAAAAEwAAAAAAAAACAAAAAgAAAAMAAAAPAAAAAAAAAAAAAAAAAAAAAAAAABAAAAACAAAAAAAAAAIAAAABAAAAEwAAAAIAAAACAAAAAAAAAAUAAAAKAAAAAAAAAAIAAAACAAAAAwAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEQAAAAIAAAAAAAAAAgAAAAEAAAAPAAAAAgAAAAIAAAAAAAAABQAAAAsAAAAAAAAAAgAAAAIAAAADAAAAEQAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAgAAAAAAAAACAAAAAQAAABAAAAACAAAAAgAAAAAAAAAFAAAADAAAAAAAAAACAAAAAgAAAAMAAAASAAAAAAAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAIAAAABAAAAEQAAAAIAAAACAAAAAAAAAAUAAAANAAAAAAAAAAIAAAACAAAAAwAAABMAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAIAAAAAAAAAAgAAAAEAAAASAAAAAgAAAAIAAAAAAAAABQAAAA4AAAAAAAAAAgAAAAIAAAADAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAEAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAQAAAAAAAAABQAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAEAAAAAAQAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAABAAAAAAAAAAAAAQAAAAAAAAAAAAA6B6FaUp9QQTPXMuL4myJBraiDfBwx9UBYJseitzTIQOL5if9jqZtAnXX+Z+ycb0C3pucbhRBCQG8wJBYqpRRAlWbDCzCY5z/eFWBUEve6P/+qo4Q50Y4/D9YM3iCcYT8fcA2QJSA0P4ADxu0qAAc/BNcGolVJ2j5d9FACqwquPh9z7MthtI9CSUSYJke/YUJQ/64OyjU0Qpi0+HCmFQdCm3GfIVdh2kHsJ11kAyauQYC3UDFJOoFBSJsFV1OwU0FK5fcxX4AmQWhy/zZIt/lACqaCPsBjzUDbdUNIScugQMYQlVJ4MXNANiuq8GTvRUDxTXnulxEZQFZ8QX5kpuw/qmG/JwYFlEAluh3Q6DB+QKn4vyNq0GZAKOXekas+UUB8xabXXhI6QG63C2pLtSNAdDBtyNfLDUDyOcu67ID2P0rCMvRXAeE/Ki2TSVyzyT9Dk+8Sz2uzP5J+w5ARWp0/NQAoOiMuhj9YnP+RyMJwPxgW7TvQVFk/KgsLYF0kQz9g5dAC6IwzQcgHPVvDex1B1XjppodHBkHJq3OMM9fwQNvcmJ7wddlAInGPpQs/w0BRobq5EBmtQJZ2ai7n+ZVAtv2G5E+bgECG+gIfKBlpQK5f8jdI91JAL39sL/WpPEB8rGxhDqklQK6yUf43XhBAxL9y/tK8+D86XyZpgrHiPwAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAP////8AAAAAAAAAAAAAAAABAAAAAAAAAAAAAAD/////AAAAAAAAAAABAAAAAQAAAAAAAAAAAAAA/////wAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8FAAAABQAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////
vendor: 8,530 bytes, line 1
1///////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAABQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQAAAAAAAQABAAABAQAAAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAquJYWJZl+D9jaeZNtj/zPwwdI9KqaeO/qGefXwdHdz+q4lhYlmX4P+OrlPMN3PI/DB0j0qpp47+7SQLV4VIEQKriWFiWZfg/r2kma3tz8T82eQmLqNIGwMRIWXMqSvo/fcCszPux9j+jara6ozTwP6hnn18HR3c/MSoKLequ8r+SabgA2nj0P7jBLbDOHO8/1Ym/ICfH4T+6lxjvlFXHv73m373LRPU/0vXyDVxo7T+ToKRHJXMAQF/33578aPE/pAyy64tD9T8+U/hCvyruPwxv8Y7YYwLAuXYr8NAiCEB4+LDK0Sn0P1Qeuy4j+eo/OMx50n7K7L+TrGB/nyf8v5ehC2fbYPM/aXMKexiT6z8mFRIMjg/zP7yUVwGGBNw/E6opHERf8z/z0wR2g9DqPw4pBpcOhvu/NbA29uWAA8DMaTExyXzyP02biiQ+Ruk/S8jz2/FKBEB1pzZnpbb9P7pQU4wLfPI//7ZcQXeG6D9CqEQvAYoIwDB2VB6sSgRAVyv8H5We8T+EHWF8XNPmPzB2wT8Nrrg/SEi+cX+w4L8of+GtdSDxP1sjk5AdouU/6ZjOVru13r8K0obqI6bxvwVbdNXyhfA/w5GG024n5z+rwmtMzP8BwLw9pSX49QXABe/2uQxP8D+b6wCzCvXkP7uGT87fK+Q/pz/JWw4coj+qoBf2J0nwP/yE3PUo0+I/vFJeHcaC+D96luSIqvntP/bf8sHUYu8/gZNN41mL4z9bhOqVOF4FwO6lmAh1hQhAbCVxbdhk7z+1C8NdDcfiPwG36x/0OQBAx0WJ76c2+D9nlSHXANfuP2HlfZ3gqOE/EwnVlVPg9r96+oHzEH//v5bXzdT1Auw/DM3GwLsA4D9p/8uoKcr+v+U9x5DQVAPAehjSdghb7D9sc1IetODgP8MVwwB1pu6/azPk6OGe978W8t/TUc3rP+0QMvYfP+A/RsG/QpSE8D+l3uwScxzgPwQaifgujuw/k1Vti1I43z8MAwLnSh0GQH5nYnwwZgJAiGUzWC5s6j8WyyI/BbLgPw4iUapGeQJAB3W+imnp/j9BLWR4ssrpP2t+gG5Pstk/cpBsfm6DCMCOpU9dOZsFQEv8nFypHeo/ehJ6i+6S2D9jqlGEmarLv7STC5TRiOa/bC+x8WZD6D9H3yUkWpDZP8gZvmCMuQLAreY19/eRBsCoPOc8UzzpP6KI/QV+y9g/t/MoboyWzT+Hv5q3Zu3Mvy2xROCT4uY/9gQitMMg1T9abAqhWMDkv1oLTavoUfG/PMUJP9CD5j+fHRX3t6fSPz7W2gk6bvs/WRnuHwqN9D8YFturGCTmP1EZczv0b9I/5t4exabB5D/1ESLh5fTEP9X2z6SYweQ/6lv3I2zT0D9zkRGNUNMAQKoSvc4EIfs/Xggt8wQI5T+mJHHg/w/SP4lhT/9t8vQ/DrZ/DbwH7D+XlhbYZrjkP34LIpFt6c4/lwfp8fLX9L+j96CTTf76v3WdNhEv9uM/d8c3o4lV0D/vFdCHVcsFwAHeDq0F1QhApbYqcZiN5D9KoilqByXLPwX0/diA0vq/0fo0GxnxAMBbaTkvlCzjP/RrFrWXrMs/UYTrky7jA0DB9f4FiZYAQEGAk/3QzeE/r/TeqE8t0D/OqjlsnPbvvz8RKU8JOfW/smSEbK/O4T8MzuyPm3DDP/rFtctq9gZAfb1EVEaSA0Dts5dVInnhP18SFMc79MM/7y34cw6LAMDFrRJsZO0DwC2KLvLSYuA/hx5wcUHewz+49SnK/4ruPyeS0PX9a+E/ZxaaLvvZ3z8WPu5T2QS8Pygo4RIvMqa/BJ0Kqsd0279cKW4ay8jdP3b05bmZ364/10/qtdxk2r+Bcz6CDMvpv54qOw+Amdw/qLV71pW7sT/YKc80nIPUP8OfIaBJ77G/LyTuD1un2z+diYu8efWzP1wU7ACkfwjAZroyPL1yBkAmv3lKJJbbPysKSE4W+p0/dIgqY79TA8ATLTOQ3tsGwJ2zweD/Xdg/XO/jXeFUaL8VW2qLFKfov1cA9Aa6XfK/tIa7YGgI2T+f3hu/sxqPv2nXdPpf3Pc/jkw8Jbda8j+tT/z8tGPVP1yBHpJd35k/KYvYOy1s8j/yz+kCQjPrP9+agH7x59g/PZfJ9aBhpr/rDKzvYBb+PwtkiaGCt/c/vb1mVr+f1T/JIHwHc8Govw7aeF6+9vG/Xv7kD6fp979isYioQYHVP7AIQZuSFrG/3z1AdUTnAUDN3XY9O7f9P0AdQ9ljYNQ/dJANJPTOrb8kLECUiiPlP4yF7UgmStA/9xGmXxCG1T9qZzix4W2zv2SGJRJVrPe/Fh9a2M/B/b8IexzFCoPSP9y1QFD2bLe/Q86cWLJe/b+mOOfYm78BwOTjkPAGE9E/8aPCUKu/ub9pPZyLCiUGwBA7Mev/BQlALOmrlRi+0j+AMJ/dKULBv7iLtL6a6QRAEMDV/yajAUDa62dE3crJP1P70RgBUbq/38hVnR6esT/s1tG10Z/Ov/zLwalHPss/dTS9NKTXx78nMcRzCIEHQAabxDsAmQRA0tyLK3gSyT+Aui7nOhDGv5Gs58z3WgHATN3forJuBMCAui7nOhDGP9Lciyt4Esm/WAJyHQ4c7z8UP5HFIs3iP3U0vTSk18c//MvBqUc+y7+cvv8HLg/Kvy1I/mHsI+K/U/vRGAFRuj/a62dE3crJv8p+WV8KlQjAuQ/nOP43B0CAMJ/dKULBPyzpq5UYvtK/ZoU+VoLh4L9etLlRUfvtv/GjwlCrv7k/5OOQ8AYT0b9DfT9FhufXPwUX8hJp+4u/3LVAUPZstz8IexzFCoPSv9+L609E5fQ/q9Fz7X2J7T9qZzix4W2zP/cRpl8QhtW/vtNilqGX+j8MOy7QJoL0P3SQDST0zq0/QB1D2WNg1L8IIjSvGNkDwGB8Jou2GAfAsAhBm5IWsT9isYioQYHVvyS9D3zb6uy/gnwRa7uM9L/JIHwHc8GoP729Zla/n9W/CsAHJZwmAEDEW6OYT1r6Pz2XyfWgYaY/35qAfvHn2L83Tdy4lS30vxf2/gZ0jPq/XIEekl3fmb+tT/z8tGPVvybPr2zJ1/+/K7mJ0ypVAsCf3hu/sxqPPwCGu2BoCNm/5oITrpZn+r+UDUyDP+n/v1zv413hVGg/nbPB4P9d2L9MlmkxNvgCQMtZlKE85v8/KwpIThb6nb8mv3lKJJbbv8+SZsTvOOc/pQCIIOYw0j+diYu8efWzvy8k7g9bp9u/kxYDa+pKtD9XlYvA8HnVv6i1e9aVu7G/nio7D4CZ3L/WR6rNh5EGwCkgQweBkghAdvTluZnfrr9cKW4ay8jdvxbjhr1f1QVAR5C0MzivAkAWPu5T2QS8v2cWmi772d+/cKj4lzLJCEBx2QJfYrMFQIcecHFB3sO/LYou8tJi4L+jr7lhO38BwIcI0Nb7xgTAXxIUxzv0w7/ts5dVInnhv0T+l8DZLfE/MP3FoFvS5D8MzuyPm3DDv7JkhGyvzuG/tzhzRIRc0b9Ovv3/0z7mv6/03qhPLdC/m4CT/dDN4b9dwjU5VCQBQBBJX1ntCv0/9GsWtZesy79baTkvlCzjv1mjYgEz++S/oW6KnOQW8b9KoilqByXLv6W2KnGYjeS/SmaKz3Vx9z+BZB5yxGHwP3fHN6OJVdC/dZ02ES/2478PuaBjLrXaP4/JU81pPaO/fgsikW3pzr+XlhbYZrjkv4tSn7YDbP0/f2LnFKlF9z+mJHHg/w/Sv14ILfMECOW/mfg4qYhR/b+OP+RQDCACwOpb9yNs09C/1fbPpJjB5L9pN2WOVZ3wv3hHy9nxIve/URlzO/Rv0r8YFturGCTmv1d1/KKR8QPA8gsy9qzSB8CfHRX3t6fSvzzFCT/Qg+a/EYStnrzV9r/2QJqI7Lb9v/YEIrTDINW/LbFE4JPi5r/7kQEs5fEDQHunnf4GeQBAooj9BX7L2L+oPOc8Uzzpv+ydYY2SSAfAL4HK6CRTB0BH3yUkWpDZv2wvsfFmQ+i/Ik0Yzruh6T8fM3LoGoDUP3oSeovukti/S/ycXKkd6r9rEv+7UWcHQCRIQe/GfwNAa36Abk+y2b9BLWR4ssrpv9KT87qa0bM/FTyktw823L8WyyI/BbLgv4hlM1gubOq/DizMp9Ki6r8b5ckdjVrzv5NVbYtSON+/BBqJ+C6O7L/dUBFqgyXYv00Wh18r7+q/7RAy9h8/4L8W8t/TUc3rv4RM5DKx3wDAfvWIj94aBcBsc1IetODgv3oY0nYIW+y/oGcTFF54AUDkJqS/FKX6PwzNxsC7AOC/ltfN1PUC7L+5Wrz/zHnzP6688w2rNOc/YeV9neCo4b9nlSHXANfuvw9RsxKjY/s/1V8GteXE8j+1C8NdDcfiv2wlcW3YZO+/IOywaA7Q8b9bFP+4Tg36v4GTTeNZi+O/9t/ywdRi77+tRc3yFR7eP2bkcHXJkLO//ITc9SjT4r+qoBf2J0nwv2YHKoswwfm/iQcLspCjAcCb6wCzCvXkvwXv9rkMT/C/YkuwYAMXBMApCNUai9kIwMORhtNuJ+e/BVt01fKF8L+ZqWEfvIjsP6h693QZYNk/WyOTkB2i5b8of+GtdSDxvwpaaulDSwVADMQAX+lOAECEHWF8XNPmv1cr/B+VnvG/XyFG6opcCMD/mtR32/UEQP+2XEF3hui/ulBTjAt88r/imfCfRP+yP9zbvtc8XeO/TZuKJD5G6b/MaTExyXzyvxiTQeElXOO/rbJRQVGN9L/z0wR2g9DqvxOqKRxEX/O/FDGCEei99j9x8zV4VYTmP2lzCnsYk+u/l6ELZ9tg878pRXacaDT/v3k6GZRqoQXAVB67LiP56r94+LDK0Sn0vwO6pZ9b7wFAvK0nKVcc9j8+U/hCvyruv6QMsuuLQ/W/FPhKFYv46j8MyxaDTOW/v9L18g1caO2/vebfvctE9b/7GD8ZrF3xv3gx1AR9bQDAuMEtsM4c77+SabgA2nj0v5xKFIwxsATArKNSBaKsB0Cjara6ozTwv33ArMz7sfa/dF2U0FcWCcDxL357DJX/P69pJmt7c/G/quJYWJZl+L/YntVJlnrSP4sRLzXM+fe/46uU8w3c8r+q4lhYlmX4v85lu5+QRwRAsI0H/WU8479jaeZNtj/zv6riWFiWZfi/sI0H/WU847/OZbufkEcEQHAoPUBrnss/9exKzDtFtT88wM8kax+gP9OqeKeAYog/MW0ItiZvcj+ph+smvt5bP2lCaV5dEUU/StaUmQDaLz+kK9y22BMYP0O3whZuMwI/IIbgZGWE6z7UkjYaEM3UPuezxwa9cr8+LybxRMnFpz6E1N8DbPiRPsYjySMvK3s+//////8fAAj//////zMQCP////9/MiAI/////28yMAj/////YzJACP///z9iMlAI////N2IyYAj///8zYjJwCP//vzNiMoAI//+rM2IykAj/f6szYjKgCP8PqzNiMrAI/wOrM2IywAi/A6szYjLQCJ8DqzNiMuAImQOrM2Iy8Aj//////z8PCP//////Kx8I/////38pLwj/////Pyk/CP////85KU8I////PzgpXwj///8POClvCP///w44KX8I//8fDjgpjwj//w8OOCmfCP9/DQ44Ka8I/w8NDjgpvwj/DQ0OOCnPCP8MDQ44Kd8IxwwNDjgp7wjEDA0OOCn/CAcAAAAHAAAAAQAAAAIAAAAEAAAAAwAAAAAAAAAAAAAABwAAAAMAAAABAAAAAgAAAAUAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAGAAAAAgAAAAMAAAAFAAAABAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAwAAAAEAAAAFAAAABAAAAAAAAAAAAAAABwAAAAUAAAADAAAABAAAAAEAAAAAAAAAAgAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAABgtRFT7Ifk/GC1EVPsh+b8YLURU+yEJQBgtRFT7IQnAYWxnb3MuYwBoM05laWdoYm9yUm90YXRpb25zAGNvb3JkaWprLmMAX3VwQXA3Q2hlY2tlZABfdXBBcDdyQ2hlY2tlZABkaXJlY3RlZEVkZ2UuYwBkaXJlY3RlZEVkZ2VUb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpclt0bXBGaWprLmZhY2VdW2ZpamsuZmFjZV0gPT0gS0kAZmFjZWlqay5jAF9mYWNlSWprUGVudFRvQ2VsbEJvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9DZWxsQm91bmRhcnkAaDNJbmRleC5jAGNvbXBhY3RDZWxscwBsYXRMbmdUb0NlbGwAY2VsbFRvQ2hpbGRQb3MAdmFsaWRhdGVDaGlsZFBvcwBsYXRMbmcuYwBjZWxsQXJlYVJhZHMyAHBvbHlnb24tPm5leHQgPT0gTlVMTABsaW5rZWRHZW8uYwBhZGROZXdMaW5rZWRQb2x5Z29uAG5leHQgIT0gTlVMTABsb29wICE9IE5VTEwAYWRkTmV3TGlua2VkTG9vcABwb2x5Z29uLT5maXJzdCA9PSBOVUxMAGFkZExpbmtlZExvb3AAY29vcmQgIT0gTlVMTABhZGRMaW5rZWRDb29yZABsb29wLT5maXJzdCA9PSBOVUxMAGlubmVyTG9vcHMgIT0gTlVMTABub3JtYWxpemVNdWx0aVBvbHlnb24AYmJveGVzICE9IE5VTEwAY2FuZGlkYXRlcyAhPSBOVUxMAGZpbmRQb2x5Z29uRm9ySG9sZQBjYW5kaWRhdGVCQm94ZXMgIT0gTlVMTAByZXZEaXIgIT0gSU5WQUxJRF9ESUdJVABsb2NhbGlqLmMAY2VsbFRvTG9jYWxJamsAYmFzZUNlbGwgIT0gb3JpZ2luQmFzZUNlbGwAIShvcmlnaW5PblBlbnQgJiYgaW5kZXhPblBlbnQpAGJhc2VDZWxsID09IG9yaWdpbkJhc2VDZWxsAGJhc2VDZWxsICE9IElOVkFMSURfQkFTRV9DRUxMAGxvY2FsSWprVG9DZWxsACFfaXNCYXNlQ2VsbFBlbnRhZ29uKGJhc2VDZWxsKQBiYXNlQ2VsbFJvdGF0aW9ucyA+PSAwAGdyaWRQYXRoQ2VsbHMAcG9seWZpbGwuYwBpdGVyU3RlcFBvbHlnb25Db21wYWN0ADAAdmVydGV4LmMA
vendor: 99,558 bytes, line 1
1Y2VsbFRvVmVydGV4AGdyYXBoLT5idWNrZXRzICE9IE5VTEwAdmVydGV4R3JhcGguYwBpbml0VmVydGV4R3JhcGgAbm9kZSAhPSBOVUxMAGFkZFZlcnRleE5vZGU=";var ee="function"==typeof atob?atob:function(e){var t,n,r,i,s,a,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",u=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{t=o.indexOf(e.charAt(u++))<<2|(i=o.indexOf(e.charAt(u++)))>>4,n=(15&i)<<4|(s=o.indexOf(e.charAt(u++)))>>2,r=(3&s)<<6|(a=o.indexOf(e.charAt(u++))),l+=String.fromCharCode(t),64!==s&&(l+=String.fromCharCode(n)),64!==a&&(l+=String.fromCharCode(r))}while(u<e.length);return l};function te(e){if(K(e))return function(e){if("boolean"==typeof i&&i){var t;try{t=Buffer.from(e,"base64")}catch(n){t=new Buffer(e,"base64")}return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}try{for(var n=ee(e),r=new Uint8Array(n.length),s=0;s<n.length;++s)r[s]=n.charCodeAt(s);return r}catch(e){throw new Error("Converting base64 string to bytes failed.")}}(e.slice($.length))}var ne=function(e,t,n){var r=new e.Int8Array(n),i=new e.Int32Array(n);new e.Uint8Array(n),new e.Float32Array(n);var s=new e.Float64Array(n),a=0|t.o,o=0|t.p,l=e.Math.floor,u=e.Math.abs,c=e.Math.sqrt,h=e.Math.pow,A=e.Math.cos,d=e.Math.sin,p=e.Math.tan,f=e.Math.acos,m=e.Math.asin,g=e.Math.atan,_=e.Math.atan2,v=e.Math.ceil,y=e.Math.imul,x=e.Math.min,b=e.Math.max,w=e.Math.clz32,T=t.b,S=t.c,M=t.d,E=t.e,C=t.f,R=t.g,N=t.h,P=t.i,D=28640;function L(e,t,n,r){return 0|I(e|=0,t|=0,n|=0,r|=0,0)}function I(e,t,n,r,s){var a,o=0,l=0,u=0,c=0;if(a=D,D=D+16|0,l=a,!(0|O(e|=0,t|=0,n|=0,r|=0,s|=0)))return D=a,0|(r=0);do{if((0|n)>=0){if((0|n)>13780509){if(0|(o=0|At(15,l)))break;l=0|i[(u=l)>>2],u=0|i[u+4>>2]}else c=0|nn(0|n,0|(o=((0|n)<0)<<31>>31),3,0),u=0|S(),o=0|Kt(0|n,0|o,1,0),o=0|Kt(0|(o=0|nn(0|c,0|u,0|o,0|S())),0|S(),1,0),u=0|S(),i[l>>2]=o,i[l+4>>2]=u,l=o;if(pn(0|r,0,l<<3),0|s){pn(0|s,0,l<<2),o=0|B(e,t,n,r,s,l,u,0);break}(o=0|$t(l,4))?(c=0|B(e,t,n,r,o,l,u,0),Yt(o),o=c):o=13}else o=2}while(0);return D=a,0|(c=o)}function O(e,t,n,r,s){e|=0,t|=0,n|=0,r|=0,s|=0;var a,o,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,m=o+8|0,i[(f=a=o)>>2]=e,i[f+4>>2]=t,(0|n)<0)return D=o,0|(m=2);if(i[(l=r)>>2]=e,i[l+4>>2]=t,(l=!!(0|s))&&(i[s>>2]=0),0|Ge(e,t))return D=o,0|(m=9);i[m>>2]=0;e:do{if((0|n)>=1)if(l)for(d=1,A=0,p=0,f=1,l=e;;){if(!(A|p)){if(0|(l=0|U(l,t,4,m,a)))break e;if(0|Ge(l=0|i[(t=a)>>2],t=0|i[t+4>>2])){l=9;break e}}if(0|(l=0|U(l,t,0|i[26800+(p<<2)>>2],m,a)))break e;if(l=0|i[(t=a)>>2],t=0|i[t+4>>2],i[(e=r+(d<<3)|0)>>2]=l,i[e+4>>2]=t,i[s+(d<<2)>>2]=f,u=(0|(e=A+1|0))==(0|f),h=6==(0|(c=p+1|0)),0|Ge(l,t)){l=9;break e}if((0|(f=f+(h&u&1)|0))>(0|n)){l=0;break}d=d+1|0,A=u?0:e,p=u?h?0:c:p}else for(d=1,A=0,p=0,f=1,l=e;;){if(!(A|p)){if(0|(l=0|U(l,t,4,m,a)))break e;if(0|Ge(l=0|i[(t=a)>>2],t=0|i[t+4>>2])){l=9;break e}}if(0|(l=0|U(l,t,0|i[26800+(p<<2)>>2],m,a)))break e;if(l=0|i[(t=a)>>2],t=0|i[t+4>>2],i[(e=r+(d<<3)|0)>>2]=l,i[e+4>>2]=t,u=(0|(e=A+1|0))==(0|f),h=6==(0|(c=p+1|0)),0|Ge(l,t)){l=9;break e}if((0|(f=f+(h&u&1)|0))>(0|n)){l=0;break}d=d+1|0,A=u?0:e,p=u?h?0:c:p}else l=0}while(0);return D=o,0|(m=l)}function B(e,t,n,r,s,a,o,l){n|=0,r|=0,s|=0,l|=0;var u,c,h,A=0,d=0,p=0,f=0,m=0,g=0,_=0;if(h=D,D=D+16|0,u=h+8|0,c=h,A=0|sn(0|(e|=0),0|(t|=0),0|(a|=0),0|(o|=0)),p=0|S(),!(!(0|(_=0|i[(g=f=r+(A<<3)|0)>>2]))&!(0|(g=0|i[g+4>>2]))|(d=(0|_)==(0|e)&(0|g)==(0|t))))do{A=0|rn(0|(A=0|Kt(0|A,0|p,1,0)),0|S(),0|a,0|o),p=0|S(),d=(0|(g=0|i[(_=f=r+(A<<3)|0)>>2]))==(0|e)&(0|(_=0|i[_+4>>2]))==(0|t)}while(!(!(0|g)&!(0|_)|d));if(A=s+(A<<2)|0,d&&(0|i[A>>2])<=(0|l))return D=h,0|(_=0);if(i[(_=f)>>2]=e,i[_+4>>2]=t,i[A>>2]=l,(0|l)>=(0|n))return D=h,0|(_=0);switch(d=l+1|0,i[u>>2]=0,0|(A=0|U(e,t,2,u,c))){case 9:m=9;break;case 0:(A=0|B(0|i[(A=c)>>2],0|i[A+4>>2],n,r,s,a,o,d))||(m=9)}e:do{if(9==(0|m)){switch(i[u>>2]=0,0|(A=0|U(e,t,3,u,c))){case 9:break;case 0:if(0|(A=0|B(0|i[(A=c)>>2],0|i[A+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(A=0|U(e,t,1,u,c))){case 9:break;case 0:if(0|(A=0|B(0|i[(A=c)>>2],0|i[A+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(A=0|U(e,t,5,u,c))){case 9:break;case 0:if(0|(A=0|B(0|i[(A=c)>>2],0|i[A+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(A=0|U(e,t,4,u,c))){case 9:break;case 0:if(0|(A=0|B(0|i[(A=c)>>2],0|i[A+4>>2],n,r,s,a,o,d)))break e;break;default:break e}switch(i[u>>2]=0,0|(A=0|U(e,t,6,u,c))){case 9:break;case 0:if(0|(A=0|B(0|i[(A=c)>>2],0|i[A+4>>2],n,r,s,a,o,d)))break e;break;default:break e}return D=h,0|(_=0)}}while(0);return D=h,0|(_=A)}function U(e,t,n,r,s){e|=0,t|=0,s|=0;var a,o,l=0,u=0,c=0,h=0,A=0,d=0,p=0;if((n|=0)>>>0>6)return 0|(s=1);if(A=(0|i[(r|=0)>>2])%6|0,i[r>>2]=A,(0|A)>0){l=0;do{n=0|ve(n),l=l+1|0}while((0|l)<(0|i[r>>2]))}if(A=0|on(0|e,0|t,45),S(),(o=127&A)>>>0>121)return 0|(s=5);a=0|We(e,t),l=0|on(0|e,0|t,52),S(),l&=15;e:do{if(l){for(;;){if(c=0|on(0|e,0|t,0|(u=3*(15-l|0)|0)),S(),7==(0|(c&=7))){t=5;break}if(p=!(0|Ke(l)),l=l+-1|0,d=0|ln(7,0,0|u),t&=~S(),e=0|ln(0|i[(p?432:16)+(28*c|0)+(n<<2)>>2],0,0|u)|e&~d,t|=u=0|S(),!(n=0|i[(p?640:224)+(28*c|0)+(n<<2)>>2])){n=0;break e}if(!l){h=8;break e}}return 0|t}h=8}while(0);8==(0|h)&&(e|=0|ln(0|(p=0|i[848+(28*o|0)+(n<<2)>>2]),0,45),t=S()|-1040385&t,n=0|i[4272+(28*o|0)+(n<<2)>>2],127&~p||(p=0|ln(0|i[848+(28*o|0)+20>>2],0,45),t=S()|-1040385&t,n=0|i[4272+(28*o|0)+20>>2],e=0|Qe(p|e,t),t=0|S(),i[r>>2]=1+(0|i[r>>2]))),c=0|on(0|e,0|t,45),S(),c&=127;e:do{if(0|q(c)){t:do{if(1==(0|We(e,t))){if((0|o)!=(0|c)){if(0|j(c,0|i[7696+(28*o|0)>>2])){e=0|$e(e,t),u=1,t=0|S();break}M(27795,26864,436,26872)}switch(0|a){case 3:e=0|Qe(e,t),t=0|S(),i[r>>2]=1+(0|i[r>>2]),u=0;break t;case 5:e=0|$e(e,t),t=0|S(),i[r>>2]=5+(0|i[r>>2]),u=0;break t;case 0:return 0|(p=9);default:return 0|(p=1)}}else u=0}while(0);if((0|n)>0){l=0;do{e=0|Xe(e,t),t=0|S(),l=l+1|0}while((0|l)!=(0|n))}if((0|o)!=(0|c)){if(!(0|V(c))){if(!!(0|u)|5!=(0|We(e,t)))break;i[r>>2]=1+(0|i[r>>2]);break}switch(127&A){case 8:case 118:break e}3!=(0|We(e,t))&&(i[r>>2]=1+(0|i[r>>2]))}}else if((0|n)>0){l=0;do{e=0|Qe(e,t),t=0|S(),l=l+1|0}while((0|l)!=(0|n))}}while(0);return i[r>>2]=((0|i[r>>2])+n|0)%6|0,i[(p=s)>>2]=e,i[p+4>>2]=t,0|(p=0)}function F(e,t,n,r){n|=0,r|=0;var s,a,o,l=0,u=0;for(o=D,D=D+16|0,s=o,a=o+8|0,l=(l=!(0|Ge(e|=0,t|=0)))?1:2;;){if(i[a>>2]=0,!(0|U(e,t,l,a,s))&((0|i[(u=s)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0)){e=4;break}if((l=l+1|0)>>>0>=7){l=7,e=4;break}}return 4==(0|e)?(D=o,0|l):0}function k(e,t,n,r,a,o,l){t|=0,n|=0,r|=0,a|=0,o|=0,l|=0;var u,c,h,A,d,p,f,m,g,_,v=0,y=0,x=0,b=0,w=0,T=0,M=0,E=0,C=0,R=0,N=0,P=0,L=0,I=0,O=0,B=0,U=0,F=0,k=0;if(_=D,D=D+64|0,f=_+48|0,m=_+32|0,g=_+24|0,u=_+8|0,c=_,(0|(y=0|i[(e|=0)>>2]))<=0)return D=_,0|(O=0);for(h=e+4|0,A=f+8|0,d=m+8|0,p=u+8|0,v=0,L=0;;){P=(x=0|i[h>>2])+(L<<4)|0,i[f>>2]=i[P>>2],i[f+4>>2]=i[P+4>>2],i[f+8>>2]=i[P+8>>2],i[f+12>>2]=i[P+12>>2],(0|L)==(y+-1|0)?(i[m>>2]=i[x>>2],i[m+4>>2]=i[x+4>>2],i[m+8>>2]=i[x+8>>2],i[m+12>>2]=i[x+12>>2]):(P=x+(L+1<<4)|0,i[m>>2]=i[P>>2],i[m+4>>2]=i[P+4>>2],i[m+8>>2]=i[P+8>>2],i[m+12>>2]=i[P+12>>2]),y=0|te(f,m,r,g);e:do{if(y)x=0,v=y;else if(x=0|i[(y=g)>>2],(0|(y=0|i[y+4>>2]))>0|!(0|y)&x>>>0>0){N=0,P=0;t:for(;;){if(U=1/(+(x>>>0)+4294967296*+(0|y)),k=+s[f>>3],F=+((y=0|Zt(0|x,0|y,0|N,0|P))>>>0)+4294967296*+(0|S()),B=+(N>>>0)+4294967296*+(0|P),s[u>>3]=U*(k*F)+U*(+s[m>>3]*B),s[p>>3]=U*(+s[A>>3]*F)+U*(+s[d>>3]*B),0|(y=0|Ze(u,r,c))){v=y;break}T=0|sn(0|(C=0|i[(R=c)>>2]),0|(R=0|i[R+4>>2]),0|t,0|n),b=0|S(),x=0|i[(w=y=l+(T<<3)|0)>>2],w=0|i[w+4>>2];n:do{if(!(0|x)&!(0|w))I=y,O=16;else for(M=0,E=0;;){if((0|M)>(0|n)|(0|M)==(0|n)&E>>>0>t>>>0){v=1;break t}if((0|x)==(0|C)&(0|w)==(0|R))break n;if(T=0|rn(0|(y=0|Kt(0|T,0|b,1,0)),0|S(),0|t,0|n),b=0|S(),E=0|Kt(0|E,0|M,1,0),M=0|S(),!(0|(x=0|i[(w=y=l+(T<<3)|0)>>2]))&!(0|(w=0|i[w+4>>2]))){I=y,O=16;break}}}while(0);if(16!=(0|O)||(O=0,!(0|C)&!(0|R))||(i[(E=I)>>2]=C,i[E+4>>2]=R,E=o+(i[a>>2]<<3)|0,i[E>>2]=C,i[E+4>>2]=R,E=0|Kt(0|i[(E=a)>>2],0|i[E+4>>2],1,0),C=0|S(),i[(R=a)>>2]=E,i[R+4>>2]=C),N=0|Kt(0|N,0|P,1,0),P=0|S(),x=0|i[(y=g)>>2],!((0|(y=0|i[y+4>>2]))>(0|P)|(0|y)==(0|P)&x>>>0>N>>>0)){x=1;break e}}x=0}else x=1}while(0);if(L=L+1|0,!x){O=21;break}if((0|L)>=(0|(y=0|i[e>>2]))){v=0,O=21;break}}return 21==(0|O)?(D=_,0|v):0}function q(e){return(e|=0)>>>0>121?0|(e=0):0|(e=0|i[7696+(28*e|0)+16>>2])}function V(e){return 4==(0|(e|=0))|117==(0|e)|0}function z(e){return 0|i[11120+(216*(0|i[(e|=0)>>2])|0)+(72*(0|i[e+4>>2])|0)+(24*(0|i[e+8>>2])|0)+(i[e+12>>2]<<3)>>2]}function G(e){return 0|i[11120+(216*(0|i[(e|=0)>>2])|0)+(72*(0|i[e+4>>2])|0)+(24*(0|i[e+8>>2])|0)+(i[e+12>>2]<<3)+4>>2]}function j(e,t){return t|=0,(0|i[7696+(28*(e|=0)|0)+20>>2])==(0|t)?0|(t=1):0|(t=(0|i[7696+(28*e|0)+24>>2])==(0|t))}function H(e,t){return 0|i[848+(28*(e|=0)|0)+((t|=0)<<2)>>2]}function W(e,t){return t|=0,(0|i[848+(28*(e|=0)|0)>>2])==(0|t)?0|(t=0):(0|i[848+(28*e|0)+4>>2])==(0|t)?0|(t=1):(0|i[848+(28*e|0)+8>>2])==(0|t)?0|(t=2):(0|i[848+(28*e|0)+12>>2])==(0|t)?0|(t=3):(0|i[848+(28*e|0)+16>>2])==(0|t)?0|(t=4):(0|i[848+(28*e|0)+20>>2])==(0|t)?0|(t=5):0|((0|i[848+(28*e|0)+24>>2])==(0|t)?6:7)}function X(e){var t,n,r;return t=(r=+s[16+(e|=0)>>3])-(n=+s[e+24>>3]),+(r<n?t+6.283185307179586:t)}function Q(e){return+s[16+(e|=0)>>3]<+s[e+24>>3]|0}function Y(e){return+(+s[(e|=0)>>3]-+s[e+8>>3])}function $(e,t){e|=0;var n,r,i=0;return(i=+s[(t|=0)>>3])>=+s[e+8>>3]&&i<=+s[e>>3]?(n=+s[e+16>>3],i=+s[e+24>>3],t=(r=+s[t+8>>3])>=i,e=r<=n&1,n<i?t&&(e=1):t||(e=0),0|(t=!!(0|e))):0|(t=0)}function K(e,t){t|=0;var n,r,i,a,o,l=0,u=0,c=0,h=0;return+s[(e|=0)>>3]<+s[t+8>>3]||+s[e+8>>3]>+s[t>>3]?0|(l=0):(i=(u=+s[e+16>>3])<(h=+s[(n=e+24|0)>>3]),c=(o=+s[(l=t+16|0)>>3])<(a=+s[(r=t+24|0)>>3]),t=h-o<a-u,e=i?c|t?1:2:0,t=c?i?1:t?2:1:0,(u=+ut(u,e))<+ut(+s[r>>3],t)||(h=+ut(+s[n>>3],e))>+ut(+s[l>>3],t)?0|(c=0):0|(c=1))}function Z(e,t){t|=0;var n,r,i,a,o,l=0,u=0,c=0,h=0;return+s[(e|=0)>>3]<+s[t>>3]||+s[e+8>>3]>+s[t+8>>3]?0|(l=0):(i=(a=+s[(l=e+16|0)>>3])<(u=+s[e+24>>3]),c=(h=+s[(n=t+16|0)>>3])<(o=+s[(r=t+24|0)>>3]),t=u-h<o-a,e=i?c|t?1:2:0,t=c?i?1:t?2:1:0,(u=+ut(u,e))<=+ut(+s[r>>3],t)?0|(c=(h=+ut(+s[l>>3],e))>=+ut(+s[n>>3],t)):0|(c=0))}function J(e,t){e|=0,t|=0;var n,r,a,o,l,u=0;a=D,D=D+176|0,i[(r=a)>>2]=4,u=+s[t>>3],s[r+8>>3]=u,o=+s[t+16>>3],s[r+16>>3]=o,s[r+24>>3]=u,u=+s[t+24>>3],s[r+32>>3]=u,l=+s[t+8>>3],s[r+40>>3]=l,s[r+48>>3]=u,s[r+56>>3]=l,s[r+64>>3]=o,n=96+(t=r+72|0)|0;do{i[t>>2]=0,t=t+4|0}while((0|t)<(0|n));dn(0|e,0|r,168),D=a}function ee(e,t,n){e|=0,t|=0,n|=0;var r,o,c,h,A,d,p,f=0,m=0,g=0,_=0,y=0,b=0,w=0;d=D,D=D+288|0,A=d+264|0,_=d+96|0,m=(f=g=d)+96|0;do{i[f>>2]=0,f=f+4|0}while((0|f)<(0|m));return 0|(t=0|rt(t,g))?(D=d,0|(b=t)):(tt(g=0|i[(m=g)>>2],m=0|i[m+4>>2],A),nt(g,m,_),h=+ct(A,_+8|0),s[A>>3]=+s[e>>3],s[(m=A+8|0)>>3]=+s[e+16>>3],s[_>>3]=+s[e+8>>3],s[(g=_+8|0)>>3]=+s[e+24>>3],o=+ct(A,_),w=+s[m>>3]-+s[g>>3],c=+u(+w),p=+s[A>>3]-+s[_>>3],r=+u(+p),!(0==w|0==p)&&(w=+cn(+c,+r),w=+v(+o*o/+hn(+w/+hn(+c,+r),3)/(h*(2.59807621135*h)*.8)),s[a>>3]=w,y=~~w>>>0,b=+u(w)>=1?w>0?~~+x(+l(w/4294967296),4294967295)>>>0:~~+v((w-+(~~w>>>0))/4294967296)>>>0:0,2146435072&~i[a+4>>2])?(_=!(0|y)&!(0|b),i[(t=n)>>2]=_?1:y,i[t+4>>2]=_?0:b,t=0):t=1,D=d,0|(b=t))}function te(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var o,c,h,A,d=0,p=0,f=0;A=D,D=D+288|0,c=A+264|0,h=A+96|0,o=(d=p=A)+96|0;do{i[d>>2]=0,d=d+4|0}while((0|d)<(0|o));return 0|(n=0|rt(n,p))?(D=A,0|(r=n)):(tt(d=0|i[(n=p)>>2],n=0|i[n+4>>2],c),nt(d,n,h),f=+ct(c,h+8|0),f=+v(+ +ct(e,t)/(2*f)),s[a>>3]=f,n=~~f>>>0,d=+u(f)>=1?f>0?~~+x(+l(f/4294967296),4294967295)>>>0:~~+v((f-+(~~f>>>0))/4294967296)>>>0:0,2146435072&~i[a+4>>2]?(p=!(0|n)&!(0|d),i[r>>2]=p?1:n,i[r+4>>2]=p?0:d,D=A,0|(r=0)):(D=A,0|(r=1)))}function ne(e,t,n,r){t|=0,n|=0,r|=0,i[(e|=0)>>2]=t,i[e+4>>2]=n,i[e+8>>2]=r}function re(e,t){e|=0;var n,r,a,o,l=0,c=0,h=0,A=0,d=0,p=0,f=0;i[(o=8+(t|=0)|0)>>2]=0,r=+s[e>>3],A=+u(+r),a=+s[e+8>>3],A+=.5*(d=1.1547005383792515*+u(+a)),A-=+(0|(l=~~A)),d-=+(0|(e=~~d));do{if(A<.5){if(A<.3333333333333333){if(i[t>>2]=l,d<.5*(A+1)){i[t+4>>2]=e;break}e=e+1|0,i[t+4>>2]=e;break}if(e=(1&!(d<(f=1-A)))+e|0,i[t+4>>2]=e,f<=d&d<2*A){l=l+1|0,i[t>>2]=l;break}i[t>>2]=l;break}if(!(A<.6666666666666666)){if(l=l+1|0,i[t>>2]=l,d<.5*A){i[t+4>>2]=e;break}e=e+1|0,i[t+4>>2]=e;break}if(d<1-A){if(i[t+4>>2]=e,2*A-1<d){i[t>>2]=l;break}}else e=e+1|0,i[t+4>>2]=e;l=l+1|0,i[t>>2]=l}while(0);do{if(r<0){if(1&e){l=~~(+(0|l)-(2*(+((p=0|Zt(0|l,((0|l)<0)<<31>>31,0|(p=(e+1|0)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|S()))+1)),i[t>>2]=l;break}l=~~(+(0|l)-2*(+((p=0|Zt(0|l,((0|l)<0)<<31>>31,0|(p=(0|e)/2|0),((0|p)<0)<<31>>31))>>>0)+4294967296*+(0|S()))),i[t>>2]=l;break}}while(0);p=t+4|0,a<0&&(l=l-((1|e<<1)/2|0)|0,i[t>>2]=l,e=0-e|0,i[p>>2]=e),c=e-l|0,(0|l)<0?(h=0-l|0,i[p>>2]=c,i[o>>2]=h,i[t>>2]=0,e=c,l=0):h=0,(0|e)<0&&(l=l-e|0,i[t>>2]=l,h=h-e|0,i[o>>2]=h,i[p>>2]=0,e=0),n=l-h|0,c=e-h|0,(0|h)<0&&(i[t>>2]=n,i[p>>2]=c,i[o>>2]=0,e=c,l=n,h=0),(0|(c=(0|h)<(0|(c=(0|e)<(0|l)?e:l))?h:c))<=0||(i[t>>2]=l-c,i[p>>2]=e-c,i[o>>2]=h-c)}function ie(e){var t,n=0,r=0,s=0,a=0,o=0;n=0|i[(e|=0)>>2],r=0|i[(t=e+4|0)>>2],(0|n)<0&&(r=r-n|0,i[t>>2]=r,i[(o=e+8|0)>>2]=(0|i[o>>2])-n,i[e>>2]=0,n=0),(0|r)<0?(n=n-r|0,i[e>>2]=n,a=(0|i[(o=e+8|0)>>2])-r|0,i[o>>2]=a,i[t>>2]=0,r=0):(o=a=e+8|0,a=0|i[a>>2]),(0|a)<0&&(n=n-a|0,i[e>>2]=n,r=r-a|0,i[t>>2]=r,i[o>>2]=0,a=0),(0|(s=(0|a)<(0|(s=(0|r)<(0|n)?r:n))?a:s))<=0||(i[e>>2]=n-s,i[t>>2]=r-s,i[o>>2]=a-s)}function se(e,t){var n,r;t|=0,r=0|i[8+(e|=0)>>2],n=+((0|i[e+4>>2])-r|0),s[t>>3]=+((0|i[e>>2])-r|0)-.5*n,s[t+8>>3]=.8660254037844386*n}function ae(e,t,n){e|=0,t|=0,i[(n|=0)>>2]=(0|i[t>>2])+(0|i[e>>2]),i[n+4>>2]=(0|i[t+4>>2])+(0|i[e+4>>2]),i[n+8>>2]=(0|i[t+8>>2])+(0|i[e+8>>2])}function oe(e,t,n){e|=0,t|=0,i[(n|=0)>>2]=(0|i[e>>2])-(0|i[t>>2]),i[n+4>>2]=(0|i[e+4>>2])-(0|i[t+4>>2]),i[n+8>>2]=(0|i[e+8>>2])-(0|i[t+8>>2])}function le(e,t){t|=0;var n,r=0;r=0|y(0|i[(e|=0)>>2],t),i[e>>2]=r,n=0|y(0|i[(r=e+4|0)>>2],t),i[r>>2]=n,t=0|y(0|i[(e=e+8|0)>>2],t),i[e>>2]=t}function ue(e){var t,n,r=0,s=0,a=0,o=0,l=0;l=(0|(n=0|i[(e|=0)>>2]))<0,e=(e=(s=(0|(o=((t=(0|(a=(0|i[e+4>>2])-(l?n:0)|0))<0)?0-a|0:0)+((0|i[e+8>>2])-(l?n:0))|0))<0)?0:o)-((a=(0|(s=(0|e)<(0|(s=(0|(r=(t?0:a)-(s?o:0)|0))<(0|(o=(l?0:n)-(t?a:0)-(s?o:0)|0))?r:o))?e:s))>0)?s:0)|0,r=r-(a?s:0)|0;e:do{switch(o-(a?s:0)|0){case 0:switch(0|r){case 0:return 0|(l=0|e?1==(0|e)?1:7:0);case 1:return 0|(l=0|e?1==(0|e)?3:7:2);default:break e}case 1:switch(0|r){case 0:return 0|(l=0|e?1==(0|e)?5:7:4);case 1:if(e)break e;return 0|(e=6);default:break e}}}while(0);return 0|(l=7)}function ce(e){var t,n,r=0,s=0,a=0,o=0,l=0,u=0,c=0;if(u=0|i[(n=8+(e|=0)|0)>>2],(t=(0|i[e>>2])-u|0)>>>0>715827881|(u=(0|i[(c=e+4|0)>>2])-u|0)>>>0>715827881){if(o=2147483647-t|0,l=-2147483648-t|0,(a=(0|t)>0)?(0|o)<(0|t):(0|l)>(0|t))return 0|(c=1);if(s=t<<1,a?(2147483647-s|0)<(0|t):(-2147483648-s|0)>(0|t))return 0|(c=1);if((0|u)>0?(2147483647-u|0)<(0|u):(-2147483648-u|0)>(0|u))return 0|(c=1);if(r=3*t|0,s=u<<1,(a?(0|o)<(0|s):(0|l)>(0|s))||((0|t)>-1?(-2147483648|r)>=(0|u):(-2147483648^r)<(0|u)))return 0|(c=1)}else s=u<<1,r=3*t|0;return a=0|Xt(.14285714285714285*+(r-u|0)),i[e>>2]=a,o=0|Xt(.14285714285714285*+(s+t|0)),i[c>>2]=o,i[n>>2]=0,r=(s=(0|o)<(0|a))?a:o,(0|(s=s?o:a))<0&&((-2147483648==(0|s)||((0|r)>0?(2147483647-r|0)<(0|s):(-2147483648-r|0)>(0|s)))&&M(27795,26892,354,26903),((0|r)>-1?(-2147483648|r)>=(0|s):(-2147483648^r)<(0|s))&&M(27795,26892,354,26903)),r=o-a|0,(0|a)<0?(s=0-a|0,i[c>>2]=r,i[n>>2]=s,i[e>>2]=0,a=0):(r=o,s=0),(0|r)<0&&(a=a-r|0,i[e>>2]=a,s=s-r|0,i[n>>2]=s,i[c>>2]=0,r=0),l=a-s|0,o=r-s|0,(0|s)<0?(i[e>>2]=l,i[c>>2]=o,i[n>>2]=0,r=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|r)<(0|o)?r:o))?s:a))<=0||(i[e>>2]=o-a,i[c>>2]=r-a,i[n>>2]=s-a),0|(c=0)}function he(e){var t,n=0,r=0,s=0,a=0,o=0,l=0,u=0;if(a=0|i[(t=8+(e|=0)|0)>>2],(o=(0|i[e>>2])-a|0)>>>0>715827881|(a=(0|i[(l=e+4|0)>>2])-a|0)>>>0>715827881){if((r=(0|o)>0)?(2147483647-o|0)<(0|o):(-2147483648-o|0)>(0|o))return 0|(l=1);if(n=o<<1,(s=(0|a)>0)?(2147483647-a|0)<(0|a):(-2147483648-a|0)>(0|a))return 0|(l=1);if(u=a<<1,s?(2147483647-u|0)<(0|a):(-2147483648-u|0)>(0|a))return 0|(u=1);if(r?(2147483647-n|0)<(0|a):(-2147483648-n|0)>(0|a))return 0|(u=1);if(r=3*a|0,(0|a)>-1?(-2147483648|r)>=(0|o):(-2147483648^r)<(0|o))return 0|(u=1)}else r=3*a|0,n=o<<1;return s=0|Xt(.14285714285714285*+(n+a|0)),i[e>>2]=s,a=0|Xt(.14285714285714285*+(r-o|0)),i[l>>2]=a,i[t>>2]=0,n=(r=(0|a)<(0|s))?s:a,(0|(r=r?a:s))<0&&((-2147483648==(0|r)||((0|n)>0?(2147483647-n|0)<(0|r):(-2147483648-n|0)>(0|r)))&&M(27795,26892,402,26917),((0|n)>-1?(-2147483648|n)>=(0|r):(-2147483648^n)<(0|r))&&M(27795,26892,402,26917)),n=a-s|0,(0|s)<0?(r=0-s|0,i[l>>2]=n,i[t>>2]=r,i[e>>2]=0,s=0):(n=a,r=0),(0|n)<0&&(s=s-n|0,i[e>>2]=s,r=r-n|0,i[t>>2]=r,i[l>>2]=0,n=0),o=s-r|0,a=n-r|0,(0|r)<0?(i[e>>2]=o,i[l>>2]=a,i[t>>2]=0,n=a,a=o,r=0):a=s,(0|(s=(0|r)<(0|(s=(0|n)<(0|a)?n:a))?r:s))<=0||(i[e>>2]=a-s,i[l>>2]=n-s,i[t>>2]=r-s),0|(u=0)}function Ae(e){var t,n,r=0,s=0,a=0,o=0,l=0;s=0|i[(t=8+(e|=0)|0)>>2],a=0|Xt(.14285714285714285*+((3*(r=(0|i[e>>2])-s|0)|0)-(s=(0|i[(n=e+4|0)>>2])-s|0)|0)),i[e>>2]=a,r=0|Xt(.14285714285714285*+((s<<1)+r|0)),i[n>>2]=r,i[t>>2]=0,s=r-a|0,(0|a)<0?(l=0-a|0,i[n>>2]=s,i[t>>2]=l,i[e>>2]=0,r=s,a=0,s=l):s=0,(0|r)<0&&(a=a-r|0,i[e>>2]=a,s=s-r|0,i[t>>2]=s,i[n>>2]=0,r=0),l=a-s|0,o=r-s|0,(0|s)<0?(i[e>>2]=l,i[n>>2]=o,i[t>>2]=0,r=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|r)<(0|o)?r:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=r-a,i[t>>2]=s-a)}function de(e){var t,n,r=0,s=0,a=0,o=0,l=0;s=0|i[(t=8+(e|=0)|0)>>2],a=0|Xt(.14285714285714285*+(((r=(0|i[e>>2])-s|0)<<1)+(s=(0|i[(n=e+4|0)>>2])-s|0)|0)),i[e>>2]=a,r=0|Xt(.14285714285714285*+((3*s|0)-r|0)),i[n>>2]=r,i[t>>2]=0,s=r-a|0,(0|a)<0?(l=0-a|0,i[n>>2]=s,i[t>>2]=l,i[e>>2]=0,r=s,a=0,s=l):s=0,(0|r)<0&&(a=a-r|0,i[e>>2]=a,s=s-r|0,i[t>>2]=s,i[n>>2]=0,r=0),l=a-s|0,o=r-s|0,(0|s)<0?(i[e>>2]=l,i[n>>2]=o,i[t>>2]=0,r=o,o=l,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|r)<(0|o)?r:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=r-a,i[t>>2]=s-a)}function pe(e){var t,n,r,s=0,a=0,o=0,l=0;s=0|i[(e|=0)>>2],a=0|i[(n=e+4|0)>>2],o=0|i[(r=e+8|0)>>2],l=a+(3*s|0)|0,i[e>>2]=l,a=o+(3*a|0)|0,i[n>>2]=a,s=(3*o|0)+s|0,i[r>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=o,i[r>>2]=s,i[e>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function fe(e){var t,n,r,s=0,a=0,o=0,l=0;l=0|i[(e|=0)>>2],o=(3*(s=0|i[(n=e+4|0)>>2])|0)+l|0,l=(a=0|i[(r=e+8|0)>>2])+(3*l|0)|0,i[e>>2]=l,i[n>>2]=o,s=(3*a|0)+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,i[e>>2]=l,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=l-s|0,o=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=o,i[r>>2]=0,l=t,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(i[e>>2]=l-a,i[n>>2]=o-a,i[r>>2]=s-a)}function me(e,t){e|=0;var n,r,s,a=0,o=0,l=0;((t|=0)-1|0)>>>0>=6||(l=(0|i[15440+(12*t|0)>>2])+(0|i[e>>2])|0,i[e>>2]=l,s=e+4|0,o=(0|i[15440+(12*t|0)+4>>2])+(0|i[s>>2])|0,i[s>>2]=o,r=e+8|0,t=(0|i[15440+(12*t|0)+8>>2])+(0|i[r>>2])|0,i[r>>2]=t,a=o-l|0,(0|l)<0?(t=t-l|0,i[s>>2]=a,i[r>>2]=t,i[e>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,i[e>>2]=o,t=t-a|0,i[r>>2]=t,i[s>>2]=0,a=0),n=o-t|0,l=a-t|0,(0|t)<0?(i[e>>2]=n,i[s>>2]=l,i[r>>2]=0,o=n,t=0):l=a,(0|(a=(0|t)<(0|(a=(0|l)<(0|o)?l:o))?t:a))<=0||(i[e>>2]=o-a,i[s>>2]=l-a,i[r>>2]=t-a))}function ge(e){var t,n,r,s=0,a=0,o=0,l=0;l=0|i[(e|=0)>>2],o=(s=0|i[(n=e+4|0)>>2])+l|0,l=(a=0|i[(r=e+8|0)>>2])+l|0,i[e>>2]=l,i[n>>2]=o,s=a+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function _e(e){var t,n,r,s=0,a=0,o=0,l=0;s=0|i[(e|=0)>>2],o=0|i[(n=e+4|0)>>2],a=0|i[(r=e+8|0)>>2],l=o+s|0,i[e>>2]=l,o=a+o|0,i[n>>2]=o,s=a+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,o=0):(a=o,o=l),(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function ve(e){switch(0|(e|=0)){case 1:e=5;break;case 5:e=4;break;case 4:e=6;break;case 6:e=2;break;case 2:e=3;break;case 3:e=1}return 0|e}function ye(e){switch(0|(e|=0)){case 1:e=3;break;case 3:e=2;break;case 2:e=6;break;case 6:e=4;break;case 4:e=5;break;case 5:e=1}return 0|e}function xe(e){var t,n,r,s=0,a=0,o=0,l=0;s=0|i[(e|=0)>>2],a=0|i[(n=e+4|0)>>2],o=0|i[(r=e+8|0)>>2],l=a+(s<<1)|0,i[e>>2]=l,a=o+(a<<1)|0,i[n>>2]=a,s=(o<<1)+s|0,i[r>>2]=s,o=a-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=o,i[r>>2]=s,i[e>>2]=0,a=o,o=0):o=l,(0|a)<0&&(o=o-a|0,i[e>>2]=o,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=o-s|0,l=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=l,i[r>>2]=0,o=t,s=0):l=a,(0|(a=(0|s)<(0|(a=(0|l)<(0|o)?l:o))?s:a))<=0||(i[e>>2]=o-a,i[n>>2]=l-a,i[r>>2]=s-a)}function be(e){var t,n,r,s=0,a=0,o=0,l=0;l=0|i[(e|=0)>>2],o=((s=0|i[(n=e+4|0)>>2])<<1)+l|0,l=(a=0|i[(r=e+8|0)>>2])+(l<<1)|0,i[e>>2]=l,i[n>>2]=o,s=(a<<1)+s|0,i[r>>2]=s,a=o-l|0,(0|l)<0?(s=s-l|0,i[n>>2]=a,i[r>>2]=s,i[e>>2]=0,l=0):a=o,(0|a)<0&&(l=l-a|0,i[e>>2]=l,s=s-a|0,i[r>>2]=s,i[n>>2]=0,a=0),t=l-s|0,o=a-s|0,(0|s)<0?(i[e>>2]=t,i[n>>2]=o,i[r>>2]=0,l=t,s=0):o=a,(0|(a=(0|s)<(0|(a=(0|o)<(0|l)?o:l))?s:a))<=0||(i[e>>2]=l-a,i[n>>2]=o-a,i[r>>2]=s-a)}function we(e,t){t|=0;var n,r,s,a=0,o=0,l=0;return s=(0|(r=(0|i[(e|=0)>>2])-(0|i[t>>2])|0))<0,n=(0|(o=(0|i[e+4>>2])-(0|i[t+4>>2])-(s?r:0)|0))<0,t=(t=(e=(0|(l=(s?0-r|0:0)+(0|i[e+8>>2])-(0|i[t+8>>2])+(n?0-o|0:0)|0))<0)?0:l)-((o=(0|(e=(0|t)<(0|(e=(0|(a=(n?0:o)-(e?l:0)|0))<(0|(l=(s?0:r)-(n?o:0)-(e?l:0)|0))?a:l))?t:e))>0)?e:0)|0,a=a-(o?e:0)|0,0|((0|(e=(0|(e=l-(o?e:0)|0))>-1?e:0-e|0))>(0|(t=(0|(a=(0|a)>-1?a:0-a|0))>(0|(t=(0|t)>-1?t:0-t|0))?a:t))?e:t)}function Te(e,t){var n;t|=0,n=0|i[8+(e|=0)>>2],i[t>>2]=(0|i[e>>2])-n,i[t+4>>2]=(0|i[e+4>>2])-n}function Se(e,t){t|=0;var n,r,s,a=0,o=0,l=0;if(o=0|i[(e|=0)>>2],i[t>>2]=o,l=0|i[e+4>>2],i[(r=t+4|0)>>2]=l,i[(s=t+8|0)>>2]=0,e=(a=(0|l)<(0|o))?o:l,(0|(a=a?l:o))<0){if(-2147483648==(0|a)||((0|e)>0?(2147483647-e|0)<(0|a):(-2147483648-e|0)>(0|a)))return 0|(t=1);if((0|e)>-1?(-2147483648|e)>=(0|a):(-2147483648^e)<(0|a))return 0|(t=1)}return e=l-o|0,(0|o)<0?(a=0-o|0,i[r>>2]=e,i[s>>2]=a,i[t>>2]=0,o=0):(e=l,a=0),(0|e)<0&&(o=o-e|0,i[t>>2]=o,a=a-e|0,i[s>>2]=a,i[r>>2]=0,e=0),n=o-a|0,l=e-a|0,(0|a)<0?(i[t>>2]=n,i[r>>2]=l,i[s>>2]=0,e=l,l=n,a=0):l=o,(0|(o=(0|a)<(0|(o=(0|e)<(0|l)?e:l))?a:o))<=0||(i[t>>2]=l-o,i[r>>2]=e-o,i[s>>2]=a-o),0|(t=0)}function Me(e){var t,n,r,s;n=(s=0|i[(t=8+(e|=0)|0)>>2])-(0|i[e>>2])|0,i[e>>2]=n,e=(0|i[(r=e+4|0)>>2])-s|0,i[r>>2]=e,i[t>>2]=0-(e+n)}function Ee(e){var t,n,r=0,s=0,a=0,o=0,l=0;r=0-(s=0|i[(e|=0)>>2])|0,i[e>>2]=r,i[(t=e+8|0)>>2]=0,o=(a=0|i[(n=e+4|0)>>2])+s|0,(0|s)>0?(i[n>>2]=o,i[t>>2]=s,i[e>>2]=0,r=0,a=o):s=0,(0|a)<0?(l=r-a|0,i[e>>2]=l,s=s-a|0,i[t>>2]=s,i[n>>2]=0,o=l-s|0,r=0-s|0,(0|s)<0?(i[e>>2]=o,i[n>>2]=r,i[t>>2]=0,a=r,s=0):(a=0,o=l)):o=r,(0|(r=(0|s)<(0|(r=(0|a)<(0|o)?a:o))?s:r))<=0||(i[e>>2]=o-r,i[n>>2]=a-r,i[t>>2]=s-r)}function Ce(e,t,n){n|=0;var r,s,a=0,o=0;return s=D,D=D+16|0,r=s,o=-2130706433&(t|=0)|134217728,!0&268435456==(2013265920&t)?(a=0|on(0|(e|=0),0|t,56),S(),a=0|function(e,t,n){n|=0;var r,s=0,a=0;if(r=D,D=D+16|0,a=r,s=0|Ge(e|=0,t|=0),(n+-1|0)>>>0>5)return D=r,0|(a=-1);if(1==(0|n)&(s=!!(0|s)))return D=r,0|(a=-1);do{if(!(0|Ft(e,t,a))){if(s){s=(5+(0|i[26352+(n<<2)>>2])-(0|i[a>>2])|0)%5|0;break}s=(6+(0|i[26384+(n<<2)>>2])-(0|i[a>>2])|0)%6|0;break}s=-1}while(0);return D=r,0|(a=s)}(e,o,7&a),-1==(0|a)?(i[n>>2]=0,D=s,0|(o=6)):(0|et(e,o,r)&&M(27795,26932,282,26947),t=0|on(0|e,0|t,52),S(),t&=15,0|Ge(e,o)?De(r,t,a,2,n):Be(r,t,a,2,n),D=s,0|(o=0))):(D=s,0|(o=6))}function Re(e,t,n,r){t|=0,r|=0;var a,o=0,l=0,u=0,c=0;if(a=D,D=D+16|0,function(e,t,n){t|=0,n|=0;var r,a,o=0;a=D,D=D+32|0,function(e,t){t|=0;var n,r,i=0;i=+s[(e|=0)>>3],n=+A(+i),i=+d(+i),s[t+16>>3]=i,i=+s[e+8>>3],r=n*+A(+i),s[t>>3]=r,i=n*+d(+i),s[t+8>>3]=i}(e|=0,r=a),i[t>>2]=0,s[n>>3]=5,(o=+Ut(16400,r))<+s[n>>3]&&(i[t>>2]=0,s[n>>3]=o),(o=+Ut(16424,r))<+s[n>>3]&&(i[t>>2]=1,s[n>>3]=o),(o=+Ut(16448,r))<+s[n>>3]&&(i[t>>2]=2,s[n>>3]=o),(o=+Ut(16472,r))<+s[n>>3]&&(i[t>>2]=3,s[n>>3]=o),(o=+Ut(16496,r))<+s[n>>3]&&(i[t>>2]=4,s[n>>3]=o),(o=+Ut(16520,r))<+s[n>>3]&&(i[t>>2]=5,s[n>>3]=o),(o=+Ut(16544,r))<+s[n>>3]&&(i[t>>2]=6,s[n>>3]=o),(o=+Ut(16568,r))<+s[n>>3]&&(i[t>>2]=7,s[n>>3]=o),(o=+Ut(16592,r))<+s[n>>3]&&(i[t>>2]=8,s[n>>3]=o),(o=+Ut(16616,r))<+s[n>>3]&&(i[t>>2]=9,s[n>>3]=o),(o=+Ut(16640,r))<+s[n>>3]&&(i[t>>2]=10,s[n>>3]=o),(o=+Ut(16664,r))<+s[n>>3]&&(i[t>>2]=11,s[n>>3]=o),(o=+Ut(16688,r))<+s[n>>3]&&(i[t>>2]=12,s[n>>3]=o),(o=+Ut(16712,r))<+s[n>>3]&&(i[t>>2]=13,s[n>>3]=o),(o=+Ut(16736,r))<+s[n>>3]&&(i[t>>2]=14,s[n>>3]=o),(o=+Ut(16760,r))<+s[n>>3]&&(i[t>>2]=15,s[n>>3]=o),(o=+Ut(16784,r))<+s[n>>3]&&(i[t>>2]=16,s[n>>3]=o),(o=+Ut(16808,r))<+s[n>>3]&&(i[t>>2]=17,s[n>>3]=o),(o=+Ut(16832,r))<+s[n>>3]&&(i[t>>2]=18,s[n>>3]=o),(o=+Ut(16856,r))<+s[n>>3]?(i[t>>2]=19,s[n>>3]=o,D=a):D=a}(e|=0,n|=0,c=a),(l=+f(+(1-.5*+s[c>>3])))<1e-16)return i[r>>2]=0,i[r+4>>2]=0,i[r+8>>2]=0,i[r+12>>2]=0,void(D=a);if(c=0|i[n>>2],o=+ot((o=+s[15920+(24*c|0)>>3])-+ot(+function(e,t){e|=0;var n,r,i,a,o;return a=+s[(t|=0)>>3],r=+A(+a),i=+s[t+8>>3]-+s[e+8>>3],o=r*+d(+i),n=+s[e>>3],+ +_(+o,+(+d(+a)*+A(+n)-+A(+i)*(r*+d(+n))))}(15600+(c<<4)|0,e))),u=0|Ke(t)?+ot(o+-.3334731722518321):o,o=2.618033988749896*+p(+l),(0|t)>0){e=0;do{o*=2.6457513110645907,e=e+1|0}while((0|e)!=(0|t))}l=+A(+u)*o,s[r>>3]=l,u=+d(+u)*o,s[r+8>>3]=u,D=a}function Ne(e,t,n,r,a){t|=0,n|=0,r|=0,a|=0;var o,l=0,h=0;if(l=+function(e){var t,n;return n=+s[(e|=0)>>3],t=+s[e+8>>3],+ +c(+(n*n+t*t))}(e|=0),l<1e-16)return t=15600+(t<<4)|0,i[a>>2]=i[t>>2],i[a+4>>2]=i[t+4>>2],i[a+8>>2]=i[t+8>>2],void(i[a+12>>2]=i[t+12>>2]);if(h=+_(+ +s[e+8>>3],+ +s[e>>3]),(0|n)>0){e=0;do{l*=.37796447300922725,e=e+1|0}while((0|e)!=(0|n))}o=.3333333333333333*l,r?(n=!(0|Ke(n)),l=+g(.381966011250105*(n?o:.37796447300922725*o))):(l=+g(.381966011250105*l),0|Ke(n)&&(h=+ot(h+.3334731722518321))),function(e,t,n,r){e|=0,t=+t,r|=0;var a=0,o=0,l=0,c=0;if((n=+n)<1e-16)return i[r>>2]=i[e>>2],i[r+4>>2]=i[e+4>>2],i[r+8>>2]=i[e+8>>2],void(i[r+12>>2]=i[e+12>>2]);o=t<0?t+6.283185307179586:t,o=t>=6.283185307179586?o+-6.283185307179586:o;do{if(!(o<1e-16)){if(a=+u(+(o+-3.141592653589793))<1e-16,t=+s[e>>3],a){t-=n,s[r>>3]=t,a=r;break}if(l=+A(+n),n=+d(+n),t=l*+d(+t)+ +A(+o)*(n*+A(+t)),t=+m(+((t=t>1?1:t)<-1?-1:t)),s[r>>3]=t,+u(+(t+-1.5707963267948966))<1e-16)return s[r>>3]=1.5707963267948966,void(s[r+8>>3]=0);if(+u(+(t+1.5707963267948966))<1e-16)return s[r>>3]=-1.5707963267948966,void(s[r+8>>3]=0);if(c=1/+A(+t),o=n*+d(+o)*c,n=+s[e>>3],t=c*((l-+d(+t)*+d(+n))/+A(+n)),l=o>1?1:o,t=t>1?1:t,(t=+s[e+8>>3]+ +_(+(l<-1?-1:l),+(t<-1?-1:t)))>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(t<-3.141592653589793)do{t+=6.283185307179586}while(t<-3.141592653589793);return void(s[r+8>>3]=t)}t=+s[e>>3]+n,s[r>>3]=t,a=r}while(0);if(+u(+(t+-1.5707963267948966))<1e-16)return s[a>>3]=1.5707963267948966,void(s[r+8>>3]=0);if(+u(+(t+1.5707963267948966))<1e-16)return s[a>>3]=-1.5707963267948966,void(s[r+8>>3]=0);if((t=+s[e+8>>3])>3.141592653589793)do{t+=-6.283185307179586}while(t>3.141592653589793);if(t<-3.141592653589793)do{t+=6.283185307179586}while(t<-3.141592653589793);s[r+8>>3]=t}(15600+(t<<4)|0,+ot(+s[15920+(24*t|0)>>3]-h),l,a)}function Pe(e,t,n){var r,s;t|=0,n|=0,r=D,D=D+16|0,se(4+(e|=0)|0,s=r),Ne(s,0|i[e>>2],t,0,n),D=r}function De(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o,l,u,c,h,A,d,p,f,m,g,_,v,y,x,b,w,T,S,E,C,R,N=0,P=0,L=0,I=0,O=0,B=0;if(R=D,D=D+272|0,I=R+240|0,S=R,E=R+224|0,C=R+208|0,g=R+176|0,_=R+160|0,v=R+192|0,y=R+144|0,x=R+128|0,b=R+112|0,w=R+96|0,T=R+80|0,i[(N=R+256|0)>>2]=t,i[I>>2]=i[e>>2],i[I+4>>2]=i[e+4>>2],i[I+8>>2]=i[e+8>>2],i[I+12>>2]=i[e+12>>2],Le(I,N,S),i[a>>2]=0,(0|(I=r+n+(5==(0|r)&1)|0))<=(0|n))D=R;else{l=E+4|0,u=g+4|0,c=n+5|0,h=16880+((o=0|i[N>>2])<<2)|0,A=16960+(o<<2)|0,d=x+8|0,p=b+8|0,f=w+8|0,m=C+4|0,L=n;e:for(;;){P=S+((0|L)%5<<4)|0,i[C>>2]=i[P>>2],i[C+4>>2]=i[P+4>>2],i[C+8>>2]=i[P+8>>2],i[C+12>>2]=i[P+12>>2];do{}while(2==(0|Ie(C,o,0,1)));if((0|L)>(0|n)&!!(0|Ke(t))){if(i[g>>2]=i[C>>2],i[g+4>>2]=i[C+4>>2],i[g+8>>2]=i[C+8>>2],i[g+12>>2]=i[C+12>>2],se(l,_),r=0|i[g>>2],N=0|i[17040+(80*r|0)+(i[E>>2]<<2)>>2],i[g>>2]=i[18640+(80*r|0)+(20*N|0)>>2],(0|(P=0|i[18640+(80*r|0)+(20*N|0)+16>>2]))>0){e=0;do{ge(u),e=e+1|0}while((0|e)<(0|P))}switch(P=18640+(80*r|0)+(20*N|0)+4|0,i[v>>2]=i[P>>2],i[v+4>>2]=i[P+4>>2],i[v+8>>2]=i[P+8>>2],le(v,3*(0|i[h>>2])|0),ae(u,v,u),ie(u),se(u,y),O=+(0|i[A>>2]),s[x>>3]=3*O,s[d>>3]=0,B=-1.5*O,s[b>>3]=B,s[p>>3]=2.598076211353316*O,s[w>>3]=B,s[f>>3]=-2.598076211353316*O,0|i[17040+(80*(0|i[g>>2])|0)+(i[C>>2]<<2)>>2]){case 1:e=b,r=x;break;case 3:e=w,r=b;break;case 2:e=x,r=w;break;default:e=12;break e}Ot(_,y,r,e,T),Ne(T,0|i[g>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])}if((0|L)<(0|c)&&(se(m,g),Ne(g,0|i[C>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),i[E>>2]=i[C>>2],i[E+4>>2]=i[C+4>>2],i[E+8>>2]=i[C+8>>2],i[E+12>>2]=i[C+12>>2],(0|(L=L+1|0))>=(0|I)){e=3;break}}3!=(0|e)?12==(0|e)&&M(26970,27017,572,27027):D=R}}function Le(e,t,n){e|=0,t|=0,n|=0;var r,s=0,a=0,o=0,l=0,u=0;r=D,D=D+128|0,a=r,l=20240,u=60+(o=s=r+64|0)|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20304,u=(o=a)+60|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Ke(0|i[t>>2])))?s:a,xe(a=e+4|0),be(a),0|Ke(0|i[t>>2])&&(fe(a),i[t>>2]=1+(0|i[t>>2])),i[n>>2]=i[e>>2],ae(a,s,t=n+4|0),ie(t),i[n+16>>2]=i[e>>2],ae(a,s+12|0,t=n+20|0),ie(t),i[n+32>>2]=i[e>>2],ae(a,s+24|0,t=n+36|0),ie(t),i[n+48>>2]=i[e>>2],ae(a,s+36|0,t=n+52|0),ie(t),i[n+64>>2]=i[e>>2],ae(a,s+48|0,n=n+68|0),ie(n),D=r}function Ie(e,t,n,r){n|=0,r|=0;var s,a,o,l,u,c,h=0,A=0,d=0,p=0,f=0;if(c=D,D=D+32|0,u=c+12|0,a=c,f=4+(e|=0)|0,p=0|i[16960+((t|=0)<<2)>>2],p=(l=!!(0|r))?3*p|0:p,h=0|i[f>>2],s=0|i[(o=e+8|0)>>2],l){if((0|(h=s+h+(r=0|i[(A=e+12|0)>>2])|0))==(0|p))return D=c,0|(f=1);d=A}else h=s+h+(r=0|i[(d=e+12|0)>>2])|0;if((0|h)<=(0|p))return D=c,0|(f=0);do{if((0|r)>0){if(r=0|i[e>>2],(0|s)>0){A=18640+(80*r|0)+60|0,r=e;break}r=18640+(80*r|0)+40|0,n?(ne(u,p,0,0),oe(f,u,a),_e(a),ae(a,u,f),A=r,r=e):(A=r,r=e)}else A=18640+(80*(0|i[e>>2])|0)+20|0,r=e}while(0);if(i[r>>2]=i[A>>2],(0|i[(h=A+16|0)>>2])>0){r=0;do{ge(f),r=r+1|0}while((0|r)<(0|i[h>>2]))}return e=A+4|0,i[u>>2]=i[e>>2],i[u+4>>2]=i[e+4>>2],i[u+8>>2]=i[e+8>>2],t=0|i[16880+(t<<2)>>2],le(u,l?3*t|0:t),ae(f,u,f),ie(f),r=l&&((0|i[o>>2])+(0|i[f>>2])+(0|i[d>>2])|0)==(0|p)?1:2,D=c,0|(f=r)}function Oe(e,t){e|=0,t|=0;var n=0;do{n=0|Ie(e,t,0,1)}while(2==(0|n));return 0|n}function Be(e,t,n,r,a){e|=0,t|=0,n|=0,r|=0,a|=0;var o,l,u,c,h,A,d,p,f,m,g,_,v,y,x,b,w,T,S=0,E=0,C=0,R=0,N=0;if(T=D,D=D+240|0,y=T+208|0,x=T,b=T+192|0,w=T+176|0,f=T+160|0,m=T+144|0,g=T+128|0,_=T+112|0,v=T+96|0,i[(S=T+224|0)>>2]=t,i[y>>2]=i[e>>2],i[y+4>>2]=i[e+4>>2],i[y+8>>2]=i[e+8>>2],i[y+12>>2]=i[e+12>>2],Ue(y,S,x),i[a>>2]=0,(0|(p=r+n+(6==(0|r)&1)|0))<=(0|n))D=T;else{l=n+6|0,u=16960+((o=0|i[S>>2])<<2)|0,c=m+8|0,h=g+8|0,A=_+8|0,d=b+4|0,E=0,C=n,r=-1;e:for(;;){if(e=x+((S=(0|C)%6|0)<<4)|0,i[b>>2]=i[e>>2],i[b+4>>2]=i[e+4>>2],i[b+8>>2]=i[e+8>>2],i[b+12>>2]=i[e+12>>2],e=E,E=0|Ie(b,o,0,1),(0|C)>(0|n)&!!(0|Ke(t))&&1!=(0|e)&&(0|i[b>>2])!=(0|r)){switch(se(x+((S+5|0)%6<<4)+4|0,w),se(x+(S<<4)+4|0,f),R=+(0|i[u>>2]),s[m>>3]=3*R,s[c>>3]=0,N=-1.5*R,s[g>>3]=N,s[h>>3]=2.598076211353316*R,s[_>>3]=N,s[A>>3]=-2.598076211353316*R,S=0|i[y>>2],0|i[17040+(80*S|0)+(((0|r)==(0|S)?i[b>>2]:r)<<2)>>2]){case 1:e=g,r=m;break;case 3:e=_,r=g;break;case 2:e=m,r=_;break;default:e=8;break e}Ot(w,f,r,e,v),0|Bt(w,v)||0|Bt(f,v)||(Ne(v,0|i[y>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2]))}if((0|C)<(0|l)&&(se(d,w),Ne(w,0|i[b>>2],o,1,a+8+(i[a>>2]<<4)|0),i[a>>2]=1+(0|i[a>>2])),(0|(C=C+1|0))>=(0|p)){e=3;break}r=0|i[b>>2]}3!=(0|e)?8==(0|e)&&M(27054,27017,737,27099):D=T}}function Ue(e,t,n){e|=0,t|=0,n|=0;var r,s=0,a=0,o=0,l=0,u=0;r=D,D=D+160|0,a=r,l=20368,u=72+(o=s=r+80|0)|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));l=20448,u=(o=a)+72|0;do{i[o>>2]=i[l>>2],o=o+4|0,l=l+4|0}while((0|o)<(0|u));s=(u=!(0|Ke(0|i[t>>2])))?s:a,xe(a=e+4|0),be(a),0|Ke(0|i[t>>2])&&(fe(a),i[t>>2]=1+(0|i[t>>2])),i[n>>2]=i[e>>2],ae(a,s,t=n+4|0),ie(t),i[n+16>>2]=i[e>>2],ae(a,s+12|0,t=n+20|0),ie(t),i[n+32>>2]=i[e>>2],ae(a,s+24|0,t=n+36|0),ie(t),i[n+48>>2]=i[e>>2],ae(a,s+36|0,t=n+52|0),ie(t),i[n+64>>2]=i[e>>2],ae(a,s+48|0,t=n+68|0),ie(t),i[n+80>>2]=i[e>>2],ae(a,s+60|0,n=n+84|0),ie(n),D=r}function Fe(e,t){return t=0|on(0|(e|=0),0|(t|=0),45),S(),127&t}function ke(e,t){e|=0;var n=0,i=0,s=0,a=0;return!0&134217728==(-16777216&(t|=0))?(i=0|on(0|e,0|t,52),S(),i&=15,n=0|on(0|e,0|t,45),S(),(n&=127)>>>0>121?0|(e=0):!(613566756&(a=0|ln(0|(s=0|on(0|e,0|t,0|(a=3*(15^i)|0))),0|S(),0|a))&(0|Zt(-1227133514,-1171,0|a,0|(s=0|S()))))&!(4681&s&S())&&15==(0|i)|!(0|(a=0|on(0|ln(0|~e,0|~t,0|(a=19+(3*i|0)|0)),0|S(),0|a)))&!(0|S())?0|r[20528+n|0]?!(0|e)&!(0|(t&=8191))?0|(a=1):(a=0|un(0|e,0|t),S(),0|!!((63-a|0)%3|0)):0|(a=1):0|(a=0)):0|(e=0)}function qe(e,t,n,r){e|=0,n|=0,r|=0;var s=0,a=0,o=0,l=0;if(s=0|ln(0|(t|=0),0,52),a=0|S(),n=0|ln(0|n,0,45),n=0|a|S()|134225919,(0|t)<1)return a=-1,r=n,i[(t=e)>>2]=a,void(i[(e=e+4|0)>>2]=r);for(a=1,s=-1;l=0|ln(7,0,0|(o=3*(15-a|0)|0)),n&=~S(),s=s&~l|(o=0|ln(0|r,0,0|o)),n=0|n|S(),(0|a)!=(0|t);)a=a+1|0;i[(o=l=e)>>2]=s,i[(l=l+4|0)>>2]=n}function Ve(e,t,n,r){n|=0,r|=0;var s=0,a=0;if(a=0|on(0|(e|=0),0|(t|=0),52),S(),n>>>0>15)return 0|(r=4);if((0|(a&=15))<(0|n))return 0|(r=12);if((0|a)==(0|n))return i[r>>2]=e,i[r+4>>2]=t,0|(r=0);if(s=0|ln(0|n,0,52),s|=e,e=S()|-15728641&t,(0|a)>(0|n))do{t=0|ln(7,0,3*(14-n|0)|0),n=n+1|0,s|=t,e=0|S()|e}while((0|n)<(0|a));return i[r>>2]=s,i[r+4>>2]=e,0|(r=0)}function ze(e,t,n,r){n|=0,r|=0;var s=0,a=0,o=0;if(a=0|on(0|(e|=0),0|(t|=0),52),S(),!((0|n)<16&(0|(a&=15))<=(0|n)))return 0|(r=4);s=n-a|0,n=0|on(0|e,0|t,45),S();e:do{if(0|q(127&n)){t:do{if(0|a){for(n=1;!((o=0|ln(7,0,3*(15-n|0)|0))&e|0)&!((0|S())&t);){if(!(n>>>0<a>>>0))break t;n=n+1|0}n=0|bt(7,0,s,((0|s)<0)<<31>>31),s=0|S();break e}}while(0);n=0|Kt(0|(n=0|nn(0|(n=0|bt(7,0,s,((0|s)<0)<<31>>31)),0|S(),5,0)),0|S(),-5,-1),n=0|Kt(0|(n=0|tn(0|n,0|S(),6,0)),0|S(),1,0),s=0|S()}else n=0|bt(7,0,s,((0|s)<0)<<31>>31),s=0|S()}while(0);return i[(o=r)>>2]=n,i[o+4>>2]=s,0|(o=0)}function Ge(e,t){var n=0,r=0,i=0;if(i=0|on(0|(e|=0),0|(t|=0),45),S(),!(0|q(127&i)))return 0|(i=0);i=0|on(0|e,0|t,52),S(),i&=15;e:do{if(i)for(r=1;;){if(n=0|on(0|e,0|t,3*(15-r|0)|0),S(),0|(n&=7))break e;if(!(r>>>0<i>>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=1&!(0|n))}function je(e,t,n,r){return e|=0,t|=0,(0|(r|=0))<(0|(n|=0))?(r=e,T(0|(n=t)),0|r):(n=0|ln(-1,-1,3+(3*(r-n|0)|0)|0),r=0|ln(0|~n,0|~S(),3*(15-r|0)|0),n=~S()&t,r=~r&e,T(0|n),0|r)}function He(e,t,n,r){n|=0,r|=0;var s=0;return s=0|on(0|(e|=0),0|(t|=0),52),S(),(0|n)<16&(0|(s&=15))<=(0|n)?((0|s)<(0|n)&&(s=0|ln(-1,-1,3+(3*(n+-1-s|0)|0)|0),s=0|ln(0|~s,0|~S(),3*(15-n|0)|0),t=~S()&t,e&=~s),s=0|ln(0|n,0,52),n=-15728641&t|S(),i[r>>2]=e|s,i[r+4>>2]=n,0|(r=0)):0|(r=4)}function We(e,t){var n=0,r=0,i=0;if(i=0|on(0|(e|=0),0|(t|=0),52),S(),!(i&=15))return 0|(i=0);for(r=1;;){if(n=0|on(0|e,0|t,3*(15-r|0)|0),S(),0|(n&=7)){r=5;break}if(!(r>>>0<i>>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Xe(e,t){var n=0,r=0,i=0,s=0,a=0,o=0,l=0;if(l=0|on(0|(e|=0),0|(t|=0),52),S(),!(l&=15))return l=e,T(0|(o=t)),0|l;for(o=1,n=0;;){r=0|ln(7,0,0|(s=3*(15-o|0)|0)),i=0|S(),a=0|on(0|e,0|t,0|s),S(),e=(s=0|ln(0|ve(7&a),0,0|s))|e&~r,t=(a=0|S())|t&~i;e:do{if(!n)if(!(s&r|0)&!(a&i|0))n=0;else if(r=0|on(0|e,0|t,52),S(),r&=15){n=1;t:for(;;){switch(a=0|on(0|e,0|t,3*(15-n|0)|0),S(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0<r>>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(i=0|on(0|e,0|t,0|(a=3*(15-n|0)|0)),S(),s=0|ln(7,0,0|a),t&=~S(),e=e&~s|(a=0|ln(0|ve(7&i),0,0|a)),t=0|t|S(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return T(0|t),0|e}function Qe(e,t){var n=0,r=0,i=0,s=0,a=0;if(r=0|on(0|(e|=0),0|(t|=0),52),S(),!(r&=15))return r=e,T(0|(n=t)),0|r;for(n=1;a=0|on(0|e,0|t,0|(s=3*(15-n|0)|0)),S(),i=0|ln(7,0,0|s),t&=~S(),e=(s=0|ln(0|ve(7&a),0,0|s))|e&~i,t=0|S()|t,n>>>0<r>>>0;)n=n+1|0;return T(0|t),0|e}function Ye(e,t){var n=0,r=0,i=0,s=0,a=0,o=0,l=0;if(l=0|on(0|(e|=0),0|(t|=0),52),S(),!(l&=15))return l=e,T(0|(o=t)),0|l;for(o=1,n=0;;){r=0|ln(7,0,0|(s=3*(15-o|0)|0)),i=0|S(),a=0|on(0|e,0|t,0|s),S(),e=(s=0|ln(0|ye(7&a),0,0|s))|e&~r,t=(a=0|S())|t&~i;e:do{if(!n)if(!(s&r|0)&!(a&i|0))n=0;else if(r=0|on(0|e,0|t,52),S(),r&=15){n=1;t:for(;;){switch(a=0|on(0|e,0|t,3*(15-n|0)|0),S(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0<r>>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(s=0|ln(7,0,0|(i=3*(15-n|0)|0)),a=t&~S(),t=0|on(0|e,0|t,0|i),S(),e=e&~s|(t=0|ln(0|ye(7&t),0,0|i)),t=0|a|S(),!(n>>>0<r>>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(o>>>0<l>>>0))break;o=o+1|0}return T(0|t),0|e}function $e(e,t){var n=0,r=0,i=0,s=0,a=0;if(r=0|on(0|(e|=0),0|(t|=0),52),S(),!(r&=15))return r=e,T(0|(n=t)),0|r;for(n=1;s=0|ln(7,0,0|(a=3*(15-n|0)|0)),i=t&~S(),t=0|on(0|e,0|t,0|a),S(),e=(t=0|ln(0|ye(7&t),0,0|a))|e&~s,t=0|S()|i,n>>>0<r>>>0;)n=n+1|0;return T(0|t),0|e}function Ke(e){return(0|(e|=0))%2|0}function Ze(e,t,n){n|=0;var r,s=0;return r=D,D=D+16|0,s=r,(t|=0)>>>0>15?(D=r,0|(s=4)):2146435072&~i[4+(e|=0)>>2]&&2146435072&~i[e+8+4>>2]?(function(e,t,n){var r,i;r=D,D=D+16|0,Re(e|=0,t|=0,n|=0,i=r),re(i,n+4|0),D=r}(e,t,s),t=0|function(e,t){e|=0;var n,r=0,s=0,a=0,o=0,l=0,u=0,c=0,h=0;if(n=D,D=D+64|0,u=n+40|0,s=n+24|0,a=n+12|0,o=n,ln(0|(t|=0),0,52),r=134225919|S(),!t)return(0|i[e+4>>2])>2||(0|i[e+8>>2])>2||(0|i[e+12>>2])>2?(u=0,T(0|(l=0)),D=n,0|u):(ln(0|z(e),0,45),l=0|S()|r,u=-1,T(0|l),D=n,0|u);if(i[u>>2]=i[e>>2],i[u+4>>2]=i[e+4>>2],i[u+8>>2]=i[e+8>>2],i[u+12>>2]=i[e+12>>2],l=u+4|0,(0|t)>0)for(e=-1;i[s>>2]=i[l>>2],i[s+4>>2]=i[l+4>>2],i[s+8>>2]=i[l+8>>2],1&t?(Ae(l),i[a>>2]=i[l>>2],i[a+4>>2]=i[l+4>>2],i[a+8>>2]=i[l+8>>2],pe(a)):(de(l),i[a>>2]=i[l>>2],i[a+4>>2]=i[l+4>>2],i[a+8>>2]=i[l+8>>2],fe(a)),oe(s,a,o),ie(o),c=0|ln(7,0,0|(h=3*(15-t|0)|0)),r&=~S(),e=(h=0|ln(0|ue(o),0,0|h))|e&~c,r=0|S()|r,(0|t)>1;)t=t+-1|0;else e=-1;e:do{if((0|i[l>>2])<=2&&(0|i[u+8>>2])<=2&&(0|i[u+12>>2])<=2){if(t=0|ln(0|(s=0|z(u)),0,45),t|=e,e=S()|-1040385&r,o=0|G(u),!(0|q(s))){if((0|o)<=0)break;for(a=0;;){if(s=0|on(0|t,0|e,52),S(),s&=15)for(r=1;u=0|on(0|t,0|e,0|(h=3*(15-r|0)|0)),S(),c=0|ln(7,0,0|h),e&=~S(),t=t&~c|(h=0|ln(0|ve(7&u),0,0|h)),e=0|e|S(),r>>>0<s>>>0;)r=r+1|0;if((0|(a=a+1|0))==(0|o))break e}}a=0|on(0|t,0|e,52),S(),a&=15;t:do{if(a){r=1;n:for(;;){switch(h=0|on(0|t,0|e,3*(15-r|0)|0),S(),7&h){case 1:break n;case 0:break;default:break t}if(!(r>>>0<a>>>0))break t;r=r+1|0}if(0|j(s,0|i[u>>2]))for(r=1;c=0|ln(7,0,0|(u=3*(15-r|0)|0)),h=e&~S(),e=0|on(0|t,0|e,0|u),S(),t=t&~c|(e=0|ln(0|ye(7&e),0,0|u)),e=0|h|S(),r>>>0<a>>>0;)r=r+1|0;else for(r=1;u=0|on(0|t,0|e,0|(h=3*(15-r|0)|0)),S(),c=0|ln(7,0,0|h),e&=~S(),t=t&~c|(h=0|ln(0|ve(7&u),0,0|h)),e=0|e|S(),r>>>0<a>>>0;)r=r+1|0}}while(0);if((0|o)>0){r=0;do{t=0|Xe(t,e),e=0|S(),r=r+1|0}while((0|r)!=(0|o))}}else t=0,e=0}while(0);return h=t,T(0|(c=e)),D=n,0|h}(s,t),s=0|S(),i[n>>2]=t,i[n+4>>2]=s,!(0|t)&!(0|s)&&M(27795,27122,959,27145),D=r,0|(s=0)):(D=r,0|(s=3))}function Je(e,t,n){var r,s=0,a=0,o=0;if(r=4+(n|=0)|0,a=0|on(0|(e|=0),0|(t|=0),52),S(),a&=15,o=0|on(0|e,0|t,45),S(),s=!(0|a),0|q(127&o)){if(s)return 0|(o=1);s=1}else{if(s)return 0|(o=0);s=0|i[r>>2]||0|i[n+8>>2]?1:1&!!(0|i[n+12>>2])}for(n=1;1&n?pe(r):fe(r),o=0|on(0|e,0|t,3*(15-n|0)|0),S(),me(r,7&o),n>>>0<a>>>0;)n=n+1|0;return 0|s}function et(e,t,n){n|=0;var r,s,a=0,o=0,l=0,u=0,c=0,h=0;if(s=D,D=D+16|0,r=s,h=0|on(0|(e|=0),0|(t|=0),45),S(),(h&=127)>>>0>121)return i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,i[n+12>>2]=0,D=s,0|(h=5);e:do{if(0|q(h)&&(l=0|on(0|e,0|t,52),S(),0|(l&=15))){a=1;t:for(;;){switch(c=0|on(0|e,0|t,3*(15-a|0)|0),S(),7&c){case 5:break t;case 0:break;default:a=t;break e}if(!(a>>>0<l>>>0)){a=t;break e}a=a+1|0}for(o=1,a=t;u=0|ln(7,0,0|(t=3*(15-o|0)|0)),c=a&~S(),a=0|on(0|e,0|a,0|t),S(),e=e&~u|(a=0|ln(0|ye(7&a),0,0|t)),a=0|c|S(),o>>>0<l>>>0;)o=o+1|0}else a=t}while(0);if(c=7696+(28*h|0)|0,i[n>>2]=i[c>>2],i[n+4>>2]=i[c+4>>2],i[n+8>>2]=i[c+8>>2],i[n+12>>2]=i[c+12>>2],!(0|Je(e,a,n)))return D=s,0|(h=0);if(u=n+4|0,i[r>>2]=i[u>>2],i[r+4>>2]=i[u+4>>2],i[r+8>>2]=i[u+8>>2],l=0|on(0|e,0|a,52),S(),c=15&l,1&l?(fe(u),l=c+1|0):l=c,0|q(h)){e:do{if(c)for(t=1;;){if(o=0|on(0|e,0|a,3*(15-t|0)|0),S(),0|(o&=7)){a=o;break e}if(!(t>>>0<c>>>0)){a=0;break}t=t+1|0}else a=0}while(0);a=4==(0|a)&1}else a=0;if(0|Ie(n,l,a,0)){if(0|q(h))do{}while(0|Ie(n,l,0,0));(0|l)!=(0|c)&&de(u)}else(0|l)!=(0|c)&&(i[u>>2]=i[r>>2],i[u+4>>2]=i[r+4>>2],i[u+8>>2]=i[r+8>>2]);return D=s,0|(h=0)}function tt(e,t,n){n|=0;var r,i,s=0;return i=D,D=D+16|0,0|(s=0|et(e|=0,t|=0,r=i))?(D=i,0|s):(s=0|on(0|e,0|t,52),S(),Pe(r,15&s,n),D=i,0|(s=0))}function nt(e,t,n){n|=0;var r,i=0,s=0,a=0;if(r=D,D=D+16|0,0|(i=0|et(e|=0,t|=0,a=r)))return D=r,0|(a=i);i=0|on(0|e,0|t,45),S(),i=!(0|q(127&i)),s=0|on(0|e,0|t,52),S(),s&=15;e:do{if(!i){if(0|s)for(i=1;;){if(!(!((0|ln(7,0,3*(15-i|0)|0))&e|0)&!((0|S())&t)))break e;if(!(i>>>0<s>>>0))break;i=i+1|0}return De(a,s,0,5,n),D=r,0}}while(0);return Be(a,s,0,6,n),D=r,0}function rt(e,t){t|=0;var n=0,r=0,s=0,a=0,o=0,l=0,u=0;if((e|=0)>>>0>15)return 0|(l=4);if(ln(0|e,0,52),l=134225919|S(),!e){n=0,r=0;do{0|q(r)&&(ln(0|r,0,45),o=0|l|S(),i[(e=t+(n<<3)|0)>>2]=-1,i[e+4>>2]=o,n=n+1|0),r=r+1|0}while(122!=(0|r));return 0|(n=0)}n=0,o=0;do{if(0|q(o)){for(ln(0|o,0,45),r=1,s=-1,a=0|l|S();s&=~(u=0|ln(7,0,3*(15-r|0)|0)),a&=~S(),(0|r)!=(0|e);)r=r+1|0;i[(u=t+(n<<3)|0)>>2]=s,i[u+4>>2]=a,n=n+1|0}o=o+1|0}while(122!=(0|o));return 0|(n=0)}function it(e,t,n,r){e|=0,r|=0;var s=0,a=0,o=0;s=0|on(0|(t|=0),0|(n|=0),52),S(),!(0|t)&!(0|n)|(0|r)>15|(0|(s&=15))>(0|r)?(a=-1,t=-1,n=0,s=0):(t=0|je(t,n,s+1|0,r),o=-15728641&S(),n=0|ln(0|r,0,52),a=s,t=(t=!(0|Ge(n|=t,o=0|o|S())))?-1:r,s=o),i[(o=e)>>2]=n,i[o+4>>2]=s,i[e+8>>2]=a,i[e+12>>2]=t}function st(e,t,n,r){n|=0,r|=0;var s=0,a=0;return s=0|on(0|(e|=0),0|(t|=0),52),S(),s&=15,i[(a=r+8|0)>>2]=s,!(0|e)&!(0|t)|(0|n)>15|(0|s)>(0|n)?(i[(n=r)>>2]=0,i[n+4>>2]=0,i[a>>2]=-1,void(i[r+12>>2]=-1)):(e=0|je(e,t,s+1|0,n),a=-15728641&S(),s=0|ln(0|n,0,52),s|=e,a=0|a|S(),i[(e=r)>>2]=s,i[e+4>>2]=a,e=r+12|0,0|Ge(s,a)?void(i[e>>2]=n):void(i[e>>2]=-1))}function at(e){var t,n=0,r=0,s=0,a=0,o=0,l=0,u=0,c=0;if(!(!(0|(n=0|i[(r=e|=0)>>2]))&!(0|(r=0|i[r+4>>2]))||(s=0|on(0|n,0|r,52),S(),n=0|Kt(0|(u=0|ln(1,0,3*(15^(s&=15))|0)),0|S(),0|n,0|r),r=0|S(),i[(u=e)>>2]=n,i[u+4>>2]=r,(0|s)<(0|(l=0|i[(u=e+8|0)>>2]))))){for(t=e+12|0,o=s;;){if((0|o)==(0|l)){s=5;break}if(c=(0|o)==(0|i[t>>2]),s=0|on(0|n,0|r,0|(a=3*(15-o|0)|0)),S(),c&1==(0|(s&=7))&!0){s=7;break}if(!(7==(0|s)&!0)){s=10;break}if(n=0|Kt(0|n,0|r,0|(c=0|ln(1,0,0|a)),0|S()),r=0|S(),i[(c=e)>>2]=n,i[c+4>>2]=r,!((0|o)>(0|l))){s=10;break}o=o+-1|0}if(5==(0|s))return i[(c=e)>>2]=0,i[c+4>>2]=0,i[u>>2]=-1,void(i[t>>2]=-1);if(7==(0|s))return l=0|Kt(0|n,0|r,0|(l=0|ln(1,0,0|a)),0|S()),u=0|S(),i[(c=e)>>2]=l,i[c+4>>2]=u,void(i[t>>2]=o+-1)}}function ot(e){var t;return t=(e=+e)<0?e+6.283185307179586:e,+(e>=6.283185307179586?t+-6.283185307179586:t)}function lt(e,t){return t|=0,+u(+(+s[(e|=0)>>3]-+s[t>>3]))<17453292519943298e-27?0|(t=+u(+(+s[e+8>>3]-+s[t+8>>3]))<17453292519943298e-27):0|(t=0)}function ut(e,t){switch(e=+e,0|(t|=0)){case 1:e=e<0?e+6.283185307179586:e;break;case 2:e=e>0?e+-6.283185307179586:e}return+e}function ct(e,t){e|=0;var n,r,i,a=0;return r=+s[(t|=0)>>3],n=+s[e>>3],a=(i=+d(.5*(r-n)))*i+(a=+d(.5*(+s[t+8>>3]-+s[e+8>>3])))*(+A(+r)*+A(+n)*a),2*+_(+ +c(+a),+ +c(+(1-a)))*6371.007180918475}function ht(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20656+(e<<3)>>3],0|(t=0))}function At(e,t){t|=0;var n=0;return(e|=0)>>>0>15?0|(t=4):(n=0|nn(0|(n=0|bt(7,0,e,((0|e)<0)<<31>>31)),0|S(),120,0),e=0|S(),i[t>>2]=2|n,i[t+4>>2]=e,0|(t=0))}function dt(e,t,n){e|=0,n|=0;var r,i,a,o,l=0,u=0,h=0,f=0,m=0,v=0;return v=+s[(t|=0)>>3],a=+s[e>>3],m=+d(.5*(v-a)),h=+s[t+8>>3],i=+s[e+8>>3],f=+d(.5*(h-i)),r=+A(+a),o=+A(+v),f=2*+_(+ +c(+(f=m*m+f*(o*r*f))),+ +c(+(1-f))),m=+s[n>>3],v=+d(.5*(m-v)),l=+s[n+8>>3],h=+d(.5*(l-h)),u=+A(+m),h=2*+_(+ +c(+(h=v*v+h*(o*u*h))),+ +c(+(1-h))),m=+d(.5*(a-m)),l=+d(.5*(i-l)),l=2*+_(+ +c(+(l=m*m+l*(r*u*l))),+ +c(+(1-l))),4*+g(+ +c(+ +p(.5*(u=.5*(f+h+l)))*+p(.5*(u-f))*+p(.5*(u-h))*+p(.5*(u-l))))}function pt(e,t,n){n|=0;var r,a,o,l=0,u=0;if(o=D,D=D+192|0,a=o,0|(u=0|tt(e|=0,t|=0,r=o+168|0)))return D=o,0|(n=u);if(0|nt(e,t,a)&&M(27795,27190,415,27199),(0|(t=0|i[a>>2]))>0){if(l=+dt(a+8|0,a+8+((1!=(0|t)&1)<<4)|0,r)+0,1!=(0|t)){e=1;do{l+=+dt(a+8+((u=e)<<4)|0,a+8+((0|(e=e+1|0))%(0|t)<<4)|0,r)}while((0|e)<(0|t))}}else l=0;return s[n>>3]=l,D=o,0|(n=0)}function ft(e){e|=0;var t,n,r=0;return(t=0|$t(1,12))||M(27280,27235,49,27293),0|(r=0|i[(n=e+4|0)>>2])?(i[(r=r+8|0)>>2]=t,i[n>>2]=t,0|t):(0|i[e>>2]&&M(27310,27235,61,27333),i[(r=e)>>2]=t,i[n>>2]=t,0|t)}function mt(e,t){var n,r;return e|=0,t|=0,(r=0|Qt(24))||M(27347,27235,78,27361),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[r+16>>2]=0,0|(n=0|i[(t=e+4|0)>>2])?(i[n+16>>2]=r,i[t>>2]=r,0|r):(0|i[e>>2]&&M(27376,27235,82,27361),i[e>>2]=r,i[t>>2]=r,0|r)}function gt(e){var t=0,n=0,r=0,s=0;if(e|=0)for(r=1;;){if(0|(t=0|i[e>>2]))do{if(0|(n=0|i[t>>2]))do{s=n,n=0|i[n+16>>2],Yt(s)}while(0|n);s=t,t=0|i[t+8>>2],Yt(s)}while(0|t);if(t=e,e=0|i[e+8>>2],r||Yt(t),!e)break;r=0}}function _t(e){var t,n,r=0,a=0,o=0,l=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0,w=0,T=0,S=0,E=0,C=0,R=0,N=0,P=0,D=0,L=0,I=0,O=0,B=0;if(0|i[(l=8+(e|=0)|0)>>2])return 0|(B=1);if(!(o=0|i[e>>2]))return 0|(B=0);r=o,a=0;do{a=a+1|0,r=0|i[r+8>>2]}while(0|r);if(a>>>0<2)return 0|(B=0);(n=0|Qt(a<<2))||M(27396,27235,317,27415),(t=0|Qt(a<<5))||M(27437,27235,321,27415),i[e>>2]=0,i[(C=e+4|0)>>2]=0,i[l>>2]=0,a=0,I=0,E=0,m=0;e:for(;;){if(f=0|i[o>>2]){c=0,h=f;do{if(d=+s[h+8>>3],r=h,h=0|i[h+16>>2],A=+s[(l=(p=!(0|h))?f:h)+8>>3],+u(+(d-A))>3.141592653589793){B=14;break}c+=(A-d)*(+s[r>>3]+ +s[l>>3])}while(!p);if(14==(0|B)){B=0,c=0,r=f;do{S=+s[r+8>>3],D=0|i[(L=r+16|0)>>2],T=+s[(D=0|D?D:f)+8>>3],c+=(+s[r>>3]+ +s[D>>3])*((T<0?T+6.283185307179586:T)-(S<0?S+6.283185307179586:S)),r=0|i[(0|r?L:o)>>2]}while(0|r)}c>0?(i[n+(I<<2)>>2]=o,I=I+1|0,l=E,r=m):B=19}else B=19;if(19==(0|B)){B=0;do{if(!a){if(m){l=C,h=m+8|0,r=o,a=e;break}if(0|i[e>>2]){B=27;break e}l=C,h=e,r=o,a=e;break}if(0|i[(r=a+8|0)>>2]){B=21;break e}if(!(a=0|$t(1,12))){B=23;break e}i[r>>2]=a,l=a+4|0,h=a,r=m}while(0);if(i[h>>2]=o,i[l>>2]=o,h=t+(E<<5)|0,p=0|i[o>>2]){for(s[(f=t+(E<<5)+8|0)>>3]=17976931348623157e292,s[(m=t+(E<<5)+24|0)>>3]=17976931348623157e292,s[h>>3]=-17976931348623157e292,s[(g=t+(E<<5)+16|0)>>3]=-17976931348623157e292,b=17976931348623157e292,w=-17976931348623157e292,l=0,_=p,d=17976931348623157e292,y=17976931348623157e292,x=-17976931348623157e292,A=-17976931348623157e292;c=+s[_>>3],S=+s[_+8>>3],_=0|i[_+16>>2],T=+s[((v=!(0|_))?p:_)+8>>3],c<d&&(s[f>>3]=c,d=c),S<y&&(s[m>>3]=S,y=S),c>x?s[h>>3]=c:c=x,S>A&&(s[g>>3]=S,A=S),b=S>0&S<b?S:b,w=S<0&S>w?S:w,l|=+u(+(S-T))>3.141592653589793,!v;)x=c;l&&(s[g>>3]=w,s[m>>3]=b)}else i[h>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,i[h+12>>2]=0,i[h+16>>2]=0,i[h+20>>2]=0,i[h+24>>2]=0,i[h+28>>2]=0;l=E+1|0}if(o=0|i[(L=o+8|0)>>2],i[L>>2]=0,!o){B=45;break}E=l,m=r}if(21==(0|B))M(27213,27235,35,27247);else if(23==(0|B))M(27267,27235,37,27247);else if(27==(0|B))M(27310,27235,61,27333);else if(45==(0|B)){e:do{if((0|I)>0){for(L=!(0|l),P=l<<2,D=!(0|e),N=0,r=0;;){if(R=0|i[n+(N<<2)>>2],L)B=73;else{if(!(E=0|Qt(P))){B=50;break}if(!(C=0|Qt(P))){B=52;break}t:do{if(D)a=0;else{for(l=0,a=0,h=e;o=t+(l<<5)|0,0|vt(0|i[h>>2],o,0|i[R>>2])?(i[E+(a<<2)>>2]=h,i[C+(a<<2)>>2]=o,v=a+1|0):v=a,h=0|i[h+8>>2];)l=l+1|0,a=v;if((0|v)>0)if(o=0|i[E>>2],1==(0|v))a=o;else for(g=0,_=-1,a=o,m=o;;){for(p=0|i[m>>2],o=0,h=0;f=(0|(l=0|i[i[E+(h<<2)>>2]>>2]))==(0|p)?o:o+(1&vt(l,0|i[C+(h<<2)>>2],0|i[p>>2]))|0,(0|(h=h+1|0))!=(0|v);)o=f;if(a=(l=(0|f)>(0|_))?m:a,(0|(o=g+1|0))==(0|v))break t;g=o,_=l?f:_,m=0|i[E+(o<<2)>>2]}else a=0}}while(0);if(Yt(E),Yt(C),a){if(o=0|i[(l=a+4|0)>>2])a=o+8|0;else if(0|i[a>>2]){B=70;break}i[a>>2]=R,i[l>>2]=R}else B=73}if(73==(0|B)){if(B=0,0|(r=0|i[R>>2]))do{C=r,r=0|i[r+16>>2],Yt(C)}while(0|r);Yt(R),r=1}if((0|(N=N+1|0))>=(0|I)){O=r;break e}}50==(0|B)?M(27452,27235,249,27471):52==(0|B)?M(27490,27235,252,27471):70==(0|B)&&M(27310,27235,61,27333)}else O=0}while(0);return Yt(n),Yt(t),0|(B=O)}return 0}function vt(e,t,n){e|=0;var r=0,a=0,o=0,l=0,u=0,c=0,h=0,A=0;if(!(0|$(t|=0,n|=0)))return 0|(e=0);if(t=0|Q(t),r=+s[n>>3],a=t&(a=+s[n+8>>3])<0?a+6.283185307179586:a,!(e=0|i[e>>2]))return 0|(e=0);if(t){t=0,h=a,n=e;e:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],A=0|i[(n=n+16|0)>>2],o=+s[(A=0|A?A:e)>>3],u=+s[A+8>>3],l>o?(c=l,l=u):(c=o,o=l,l=a,a=u),(r=r==o|r==c?r+2220446049250313e-31:r)<o|r>c;)if(!(n=0|i[n>>2])){n=22;break e}if(((c=(u=l<0?l+6.283185307179586:l)+(r-o)/(c-o)*((l=a<0?a+6.283185307179586:a)-u))<0?c+6.283185307179586:c)>(h=u==h|l==h?h+-2220446049250313e-31:h)&&(t^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|t}else{t=0,h=a,n=e;e:for(;;){for(;l=+s[n>>3],a=+s[n+8>>3],A=0|i[(n=n+16|0)>>2],o=+s[(A=0|A?A:e)>>3],u=+s[A+8>>3],l>o?(c=l,l=u):(c=o,o=l,l=a,a=u),(r=r==o|r==c?r+2220446049250313e-31:r)<o|r>c;)if(!(n=0|i[n>>2])){n=22;break e}if(l+(r-o)/(c-o)*(a-l)>(h=l==h|a==h?h+-2220446049250313e-31:h)&&(t^=1),!(n=0|i[n>>2])){n=22;break}}if(22==(0|n))return 0|t}return 0}function yt(e,t,n,s,a){n|=0,s|=0,a|=0;var o,l,u,c,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0;if(c=D,D=D+32|0,y=c+16|0,u=c,h=0|on(0|(e|=0),0|(t|=0),52),S(),h&=15,g=0|on(0|n,0|s,52),S(),(0|h)!=(15&g))return D=c,0|(y=12);if(f=0|on(0|e,0|t,45),S(),f&=127,m=0|on(0|n,0|s,45),S(),f>>>0>121|(m&=127)>>>0>121)return D=c,0|(y=5);if(g=(0|f)!=(0|m)){if(7==(0|(d=0|W(f,m))))return D=c,0|(y=1);7==(0|(p=0|W(m,f)))?M(27514,27538,161,27548):(_=d,A=p)}else _=0,A=0;o=0|q(f),l=0|q(m),i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0;do{if(_){if(d=(0|(m=0|i[4272+(28*f|0)+(_<<2)>>2]))>0,l)if(d){f=0,p=n,d=s;do{p=0|Ye(p,d),d=0|S(),1==(0|(A=0|ye(A)))&&(A=0|ye(1)),f=f+1|0}while((0|f)!=(0|m));m=A,f=p,p=d}else m=A,f=n,p=s;else if(d){f=0,p=n,d=s;do{p=0|$e(p,d),d=0|S(),A=0|ye(A),f=f+1|0}while((0|f)!=(0|m));m=A,f=p,p=d}else m=A,f=n,p=s;if(Je(f,p,y),g||M(27563,27538,191,27548),(d=!!(0|o))&(A=!!(0|l))&&M(27590,27538,192,27548),d){if(7==(0|(A=0|We(e,t)))){h=5;break}if(0|r[22e3+(7*A|0)+_|0]){h=1;break}f=p=0|i[21168+(28*A|0)+(_<<2)>>2]}else if(A){if(7==(0|(A=0|We(f,p)))){h=5;break}if(0|r[22e3+(7*A|0)+m|0]){h=1;break}f=0,p=0|i[21168+(28*m|0)+(A<<2)>>2]}else f=0,p=0;if((f|p|0)<0)h=5;else{if((0|p)>0){d=y+4|0,A=0;do{_e(d),A=A+1|0}while((0|A)!=(0|p))}if(i[u>>2]=0,i[u+4>>2]=0,i[u+8>>2]=0,me(u,_),0|h)for(;0|Ke(h)?pe(u):fe(u),(0|h)>1;)h=h+-1|0;if((0|f)>0){h=0;do{_e(u),h=h+1|0}while((0|h)!=(0|f))}ae(v=y+4|0,u,v),ie(v),v=51}}else if(Je(n,s,y),!!(0|o)&!!(0|l))if((0|m)!=(0|f)&&M(27621,27538,261,27548),7==(0|(A=0|We(e,t)))|7==(0|(h=0|We(n,s))))h=5;else if(0|r[22e3+(7*A|0)+h|0])h=1;else if((0|(A=0|i[21168+(28*A|0)+(h<<2)>>2]))>0){d=y+4|0,h=0;do{_e(d),h=h+1|0}while((0|h)!=(0|A));v=51}else v=51;else v=51}while(0);return 51==(0|v)&&(h=y+4|0,i[a>>2]=i[h>>2],i[a+4>>2]=i[h+4>>2],i[a+8>>2]=i[h+8>>2],h=0),D=c,0|(y=h)}function xt(e,t,n,r){n|=0,r|=0;var s,a,o,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0;if(o=D,D=D+48|0,s=o+36|0,c=o+24|0,h=o+12|0,A=o,l=0|on(0|(e|=0),0|(t|=0),52),S(),l&=15,p=0|on(0|e,0|t,45),S(),(p&=127)>>>0>121)return D=o,0|(r=5);if(a=0|q(p),ln(0|l,0,52),g=134225919|S(),i[(u=r)>>2]=-1,i[u+4>>2]=g,!l)return 7==(0|(l=0|ue(n)))||127==(0|(l=0|H(p,l)))?(D=o,0|(g=1)):(f=0|ln(0|l,0,45),m=0|S(),m=-1040385&i[(p=r)+4>>2]|m,i[(g=r)>>2]=i[p>>2]|f,i[g+4>>2]=m,D=o,0|(g=0));for(i[s>>2]=i[n>>2],i[s+4>>2]=i[n+4>>2],i[s+8>>2]=i[n+8>>2],n=l;;){if(u=n,n=n+-1|0,i[c>>2]=i[s>>2],i[c+4>>2]=i[s+4>>2],i[c+8>>2]=i[s+8>>2],0|Ke(u)){if(0|(l=0|ce(s))){n=13;break}i[h>>2]=i[s>>2],i[h+4>>2]=i[s+4>>2],i[h+8>>2]=i[s+8>>2],pe(h)}else{if(0|(l=0|he(s))){n=13;break}i[h>>2]=i[s>>2],i[h+4>>2]=i[s+4>>2],i[h+8>>2]=i[s+8>>2],fe(h)}if(oe(c,h,A),ie(A),v=0|i[(l=r)>>2],l=0|i[l+4>>2],_=0|ln(7,0,0|(y=3*(15-u|0)|0)),l&=~S(),y=0|ln(0|ue(A),0,0|y),l=0|S()|l,i[(g=r)>>2]=y|v&~_,i[g+4>>2]=l,(0|u)<=1){n=14;break}}e:do{if(13!=(0|n)&&14==(0|n))if((0|i[s>>2])<=1&&(0|i[s+4>>2])<=1&&(0|i[s+8>>2])<=1){A=127==(0|(l=0|H(p,n=0|ue(s))))?0:0|q(l);t:do{if(n){if(a){if(7==(0|(l=0|We(e,t)))){l=5;break e}if((0|(u=0|i[21376+(28*l|0)+(n<<2)>>2]))>0){l=n,n=0;do{l=0|ve(l),n=n+1|0}while((0|n)!=(0|u))}else l=n;if(1==(0|l)){l=9;break e}127==(0|(n=0|H(p,l)))&&M(27648,27538,411,27678),0|q(n)?M(27693,27538,412,27678):(m=n,f=u,d=l)}else m=l,f=0,d=n;if((0|(h=0|i[4272+(28*p|0)+(d<<2)>>2]))<=-1&&M(27724,27538,419,27678),!A){if((0|f)<0){l=5;break e}if(0|f){l=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];do{n=0|Qe(n,u),u=0|S(),i[(y=r)>>2]=n,i[y+4>>2]=u,l=l+1|0}while((0|l)<(0|f))}if((0|h)<=0){l=m,n=58;break}for(l=0,n=0|i[(u=r)>>2],u=0|i[u+4>>2];;)if(n=0|Qe(n,u),u=0|S(),i[(y=r)>>2]=n,i[y+4>>2]=u,(0|(l=l+1|0))==(0|h)){l=m,n=58;break t}}if(7==(0|(c=0|W(m,p)))&&M(27514,27538,428,27678),n=0|i[(l=r)>>2],l=0|i[l+4>>2],(0|h)>0){u=0;do{n=0|Qe(n,l),l=0|S(),i[(y=r)>>2]=n,i[y+4>>2]=l,u=u+1|0}while((0|u)!=(0|h))}if(7==(0|(l=0|We(n,l)))&&M(27795,27538,440,27678),n=0|V(m),(0|(n=0|i[(n?21792:21584)+(28*c|0)+(l<<2)>>2]))<0&&M(27795,27538,454,27678),n){l=0,u=0|i[(c=r)>>2],c=0|i[c+4>>2];do{u=0|Xe(u,c),c=0|S(),i[(y=r)>>2]=u,i[y+4>>2]=c,l=l+1|0}while((0|l)<(0|n));l=m,n=58}else l=m,n=58}else if(!!(0|a)&!!(0|A)){if(7==(0|(n=0|We(e,t)))|7==(0|(u=0|We(0|i[(u=r)>>2],0|i[u+4>>2])))){l=5;break e}if((0|(u=0|i[21376+(28*n|0)+(u<<2)>>2]))<0){l=5;break e}if(u){n=0,c=0|i[(h=r)>>2],h=0|i[h+4>>2];do{c=0|Qe(c,h),h=0|S(),i[(y=r)>>2]=c,i[y+4>>2]=h,n=n+1|0}while((0|n)<(0|u));n=58}else n=59}else n=58}while(0);if(58==(0|n)&&A&&(n=59),59==(0|n)&&1==(0|We(0|i[(y=r)>>2],0|i[y+4>>2]))){l=9;break}_=0|i[(y=r)>>2],y=-1040385&i[y+4>>2],v=0|ln(0|l,0,45),y=0|y|S(),i[(l=r)>>2]=_|v,i[l+4>>2]=y,l=0}else l=1}while(0);return D=o,0|(y=l)}function bt(e,t,n,r){e|=0,t|=0;var i=0,s=0,a=0;if(!(0|(n|=0))&!(0|(r|=0)))return s=1,T(0|(i=0)),0|s;s=e,i=t,e=1,t=0;do{e=0|nn(0|((a=!0&!(1&n))?1:s),0|(a?0:i),0|e,0|t),t=0|S(),n=0|an(0|n,0|r,1),r=0|S(),s=0|nn(0|s,0|i,0|s,0|i),i=0|S()}while(!(!(0|n)&!(0|r)));return T(0|t),0|e}function wt(e,t,n,r){n|=0,r|=0;var a,o=0,l=0,u=0,c=0,h=0,d=0;a=D,D=D+16|0,l=a,u=0|on(0|(e|=0),0|(t|=0),52),S(),u&=15;do{if(u){if(!(o=0|tt(e,t,l))){h=+s[l>>3],c=1/+A(+h),d=+s[25968+(u<<3)>>3],s[n>>3]=h+d,s[n+8>>3]=h-d,h=+s[l+8>>3],c*=d,s[n+16>>3]=c+h,s[n+24>>3]=h-c;break}return D=a,0|(u=o)}if(o=0|on(0|e,0|t,45),S(),(o&=127)>>>0>121)return D=a,0|(u=5);l=22064+(o<<5)|0,i[n>>2]=i[l>>2],i[n+4>>2]=i[l+4>>2],i[n+8>>2]=i[l+8>>2],i[n+12>>2]=i[l+12>>2],i[n+16>>2]=i[l+16>>2],i[n+20>>2]=i[l+20>>2],i[n+24>>2]=i[l+24>>2],i[n+28>>2]=i[l+28>>2];break}while(0);return function(e,t){t=+t;var n,r,i,a,o,l,u,c=0,h=0;c=(a=+s[(i=16+(e|=0)|0)>>3])-(r=+s[(n=e+24|0)>>3]),c=a<r?c+6.283185307179586:c,h=+s[e>>3],c=.5*(c*t-c),h+=t=.5*((u=h-(l=+s[(o=e+8|0)>>3]))*t-u),s[e>>3]=h>1.5707963267948966?1.5707963267948966:h,t=l-t,s[o>>3]=t<-1.5707963267948966?-1.5707963267948966:t,t=(t=a+c)>3.141592653589793?t+-6.283185307179586:t,s[i>>3]=t<-3.141592653589793?t+6.283185307179586:t,t=(t=r-c)>3.141592653589793?t+-6.283185307179586:t,s[n>>3]=t<-3.141592653589793?t+6.283185307179586:t}(n,r?1.4:1.1),(0|i[(r=26096+(u<<3)|0)>>2])==(0|e)&&(0|i[r+4>>2])==(0|t)&&(s[n>>3]=1.5707963267948966),(0|i[(u=26224+(u<<3)|0)>>2])==(0|e)&&(0|i[u+4>>2])==(0|t)&&(s[n+8>>3]=-1.5707963267948966),1.5707963267948966!=+s[n>>3]&&-1.5707963267948966!=+s[n+8>>3]?(D=a,0|(u=0)):(s[n+16>>3]=3.141592653589793,s[n+24>>3]=-3.141592653589793,D=a,0|(u=0))}function Tt(e,t,n,s){e|=0,t|=0,n|=0,s|=0;var a,o,l,u=0,c=0,h=0,A=0;l=D,D=D+48|0,a=l+40|0,o=l,qe(c=l+32|0,0,0,0),h=0|i[c>>2],c=0|i[c+4>>2];do{if(n>>>0<=15){if(0|(u=0|Rt(s))){i[(s=o)>>2]=0,i[s+4>>2]=0,i[o+8>>2]=u,i[o+12>>2]=-1,h=o+29|0,i[(s=o+16|0)>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,r[s+12|0]=0,r[0|h]=0|r[0|a],r[h+1|0]=0|r[a+1|0],r[h+2|0]=0|r[a+2|0];break}if(u=0|$t(1+(0|i[t+8>>2])|0,32)){Nt(t,u),i[(A=o)>>2]=h,i[A+4>>2]=c,i[o+8>>2]=0,i[o+12>>2]=n,i[o+16>>2]=s,i[o+20>>2]=t,i[o+24>>2]=u,r[o+28|0]=0,r[0|(h=o+29|0)]=0|r[0|a],r[h+1|0]=0|r[a+1|0],r[h+2|0]=0|r[a+2|0];break}i[(s=o)>>2]=0,i[s+4>>2]=0,i[o+8>>2]=13,i[o+12>>2]=-1,h=o+29|0,i[(s=o+16|0)>>2]=0,i[s+4>>2]=0,i[s+8>>2]=0,r[s+12|0]=0,r[0|h]=0|r[0|a],r[h+1|0]=0|r[a+1|0],r[h+2|0]=0|r[a+2|0];break}i[(h=o)>>2]=0,i[h+4>>2]=0,i[o+8>>2]=4,i[o+12>>2]=-1,A=o+29|0,i[(h=o+16|0)>>2]=0,i[h+4>>2]=0,i[h+8>>2]=0,r[h+12|0]=0,r[0|A]=0|r[0|a],r[A+1|0]=0|r[a+1|0],r[A+2|0]=0|r[a+2|0]}while(0);St(o),i[e>>2]=i[o>>2],i[e+4>>2]=i[o+4>>2],i[e+8>>2]=i[o+8>>2],i[e+12>>2]=i[o+12>>2],i[e+16>>2]=i[o+16>>2],i[e+20>>2]=i[o+20>>2],i[e+24>>2]=i[o+24>>2],i[e+28>>2]=i[o+28>>2],D=l}function St(e){var t,n,s,a,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0;if(a=D,D=D+336|0,t=a+168|0,n=a,!(0|(l=0|i[(u=e|=0)>>2]))&!(0|(u=0|i[u+4>>2])))D=a;else{if(0|r[0|(o=e+28|0)]?(l=0|Mt(l,u),u=0|S()):r[0|o]=1,!(0|i[i[(s=e+20|0)>>2]>>2]))return 0|(l=0|i[(o=e+24|0)>>2])&&Yt(l),i[(b=e)>>2]=0,i[b+4>>2]=0,i[e+8>>2]=0,i[s>>2]=0,i[e+12>>2]=-1,i[e+16>>2]=0,i[o>>2]=0,void(D=a);c=15&(o=0|i[(b=e+16|0)>>2]);e:do{if(!(0|l)&!(0|u))x=e+24|0;else{v=e+12|0,g=3==(0|c),m=255&o,p=3==(1|c),_=e+24|0,f=(c+-1|0)>>>0<3,A=3==(2|c),d=n+8|0;t:for(;;){if(h=0|on(0|l,0|u,52),S(),(0|(h&=15))==(0|i[v>>2])){switch(15&m){case 0:case 2:case 3:if(0|(c=0|tt(l,u,t))){y=15;break t}if(0|Pt(0|i[s>>2],0|i[_>>2],t)){y=19;break t}}if(p&&(c=0|i[4+(0|i[s>>2])>>2],i[t>>2]=i[c>>2],i[t+4>>2]=i[c+4>>2],i[t+8>>2]=i[c+8>>2],i[t+12>>2]=i[c+12>>2],0|$(26832,t))){if(0|Ze(0|i[4+(0|i[s>>2])>>2],h,n)){y=25;break}if((0|i[(c=n)>>2])==(0|l)&&(0|i[c+4>>2])==(0|u)){y=29;break}}if(f){if(0|(c=0|nt(l,u,t))){y=32;break}if(0|wt(l,u,n,0)){y=36;break}if(A&&0|Dt(0|i[s>>2],0|i[_>>2],t,n)){y=42;break}if(p&&0|It(0|i[s>>2],0|i[_>>2],t,n)){y=42;break}}if(g){if(o=0|wt(l,u,t,1),c=0|i[_>>2],0|o){y=45;break}if(0|K(c,t)){if(J(n,t),0|Z(t,0|i[_>>2])){y=53;break}if(0|Pt(0|i[s>>2],0|i[_>>2],d)){y=53;break}if(0|It(0|i[s>>2],0|i[_>>2],n,t)){y=53;break}}}}do{if((0|h)<(0|i[v>>2])){if(o=0|wt(l,u,t,1),c=0|i[_>>2],0|o){y=58;break t}if(!(0|K(c,t))){y=73;break}if(0|Z(0|i[_>>2],t)&&(J(n,t),0|Dt(0|i[s>>2],0|i[_>>2],n,t))){y=65;break t}if(0|(l=0|He(l,u,h+1|0,n))){y=67;break t}l=0|i[(u=n)>>2],u=0|i[u+4>>2]}else y=73}while(0);if(73==(0|y)&&(y=0,l=0|Mt(l,u),u=0|S()),!(0|l)&!(0|u)){x=_;break e}}switch(0|y){case 15:0|(o=0|i[_>>2])&&Yt(o),i[(y=e)>>2]=0,i[y+4>>2]=0,i[s>>2]=0,i[v>>2]=-1,i[b>>2]=0,i[_>>2]=0,i[e+8>>2]=c,y=20;break;case 19:i[e>>2]=l,i[e+4>>2]=u,y=20;break;case 25:M(27795,27761,470,27772);break;case 29:case 42:return i[e>>2]=l,i[e+4>>2]=u,void(D=a);case 32:return 0|(o=0|i[_>>2])&&Yt(o),i[(x=e)>>2]=0,i[x+4>>2]=0,i[s>>2]=0,i[v>>2]=-1,i[b>>2]=0,i[_>>2]=0,i[e+8>>2]=c,void(D=a);case 36:M(27795,27761,493,27772);break;case 45:0|c&&Yt(c),i[(y=e)>>2]=0,i[y+4>>2]=0,i[s>>2]=0,i[v>>2]=-1,i[b>>2]=0,i[_>>2]=0,i[e+8>>2]=o,y=55;break;case 53:i[e>>2]=l,i[e+4>>2]=u,y=55;break;case 58:0|c&&Yt(c),i[(y=e)>>2]=0,i[y+4>>2]=0,i[s>>2]=0,i[v>>2]=-1,i[b>>2]=0,i[_>>2]=0,i[e+8>>2]=o,y=71;break;case 65:i[e>>2]=l,i[e+4>>2]=u,y=71;break;case 67:return 0|(o=0|i[_>>2])&&Yt(o),i[(x=e)>>2]=0,i[x+4>>2]=0,i[s>>2]=0,i[v>>2]=-1,i[b>>2]=0,i[_>>2]=0,i[e+8>>2]=l,void(D=a)}if(20==(0|y))return void(D=a);if(55==(0|y))return void(D=a);if(71==(0|y))return void(D=a)}}while(0);0|(o=0|i[x>>2])&&Yt(o),i[(y=e)>>2]=0,i[y+4>>2]=0,i[e+8>>2]=0,i[s>>2]=0,i[e+12>>2]=-1,i[b>>2]=0,i[x>>2]=0,D=a}}function Mt(e,t){var n,r=0,s=0,a=0,o=0,l=0,u=0,c=0,h=0,A=0;n=D,D=D+16|0,A=n,s=0|on(0|(e|=0),0|(t|=0),52),S(),s&=15,r=0|on(0|e,0|t,45),S();do{if(s){for(;r=0|ln(s+4095|0,0,52),a=S()|-15728641&t,r=r|e|(l=0|ln(7,0,0|(o=3*(15-s|0)|0))),a|=u=0|S(),c=0|on(0|e,0|t,0|o),S(),s=s+-1|0,!((c&=7)>>>0<6);){if(!s){h=4;break}t=a,e=r}if(4==(0|h)){r=0|on(0|r,0|a,45),S();break}return A=0|ln(((A=!(0|c)&!!(0|Ge(r,a)))?2:1)+c|0,0,0|o),h=0|S()|t&~u,A|=e&~l,T(0|h),D=n,0|A}}while(0);return(r&=127)>>>0>120?(A=0,T(0|(h=0)),D=n,0|A):(qe(A,0,r+1|0,0),h=0|i[A+4>>2],A=0|i[A>>2],T(0|h),D=n,0|A)}function Et(e,t,n){e|=0;var r,a=0,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0;if(!(0|$(t|=0,n|=0)))return 0|(p=0);if(t=0|Q(t),a=+s[n>>3],o=t&(o=+s[n+8>>3])<0?o+6.283185307179586:o,(0|(p=0|i[e>>2]))<=0)return 0|(p=0);if(r=0|i[e+4>>2],t){t=0,d=o,n=-1,e=0;e:for(;;){for(A=e;u=+s[r+(A<<4)>>3],o=+s[r+(A<<4)+8>>3],l=+s[r+((e=(n+2|0)%(0|p)|0)<<4)>>3],c=+s[r+(e<<4)+8>>3],u>l?(h=u,u=c):(h=l,l=u,u=o,o=c),(a=a==l|a==h?a+2220446049250313e-31:a)<l|a>h;){if((0|(n=A+1|0))>=(0|p)){n=22;break e}e=A,A=n,n=e}if(((h=(c=u<0?u+6.283185307179586:u)+(a-l)/(h-l)*((u=o<0?o+6.283185307179586:o)-c))<0?h+6.283185307179586:h)>(d=c==d|u==d?d+-2220446049250313e-31:d)&&(t^=1),(0|(e=A+1|0))>=(0|p)){n=22;break}n=A}if(22==(0|n))return 0|t}else{t=0,d=o,n=-1,e=0;e:for(;;){for(A=e;u=+s[r+(A<<4)>>3],o=+s[r+(A<<4)+8>>3],l=+s[r+((e=(n+2|0)%(0|p)|0)<<4)>>3],c=+s[r+(e<<4)+8>>3],u>l?(h=u,u=c):(h=l,l=u,u=o,o=c),(a=a==l|a==h?a+2220446049250313e-31:a)<l|a>h;){if((0|(n=A+1|0))>=(0|p)){n=22;break e}e=A,A=n,n=e}if(u+(a-l)/(h-l)*(o-u)>(d=u==d|o==d?d+-2220446049250313e-31:d)&&(t^=1),(0|(e=A+1|0))>=(0|p)){n=22;break}n=A}if(22==(0|n))return 0|t}return 0}function Ct(e,t){t|=0;var n,r,a,o,l,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0;if(!(r=0|i[(e|=0)>>2]))return i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,void(i[t+28>>2]=0);if(s[(a=t+8|0)>>3]=17976931348623157e292,s[(o=t+24|0)>>3]=17976931348623157e292,s[t>>3]=-17976931348623157e292,s[(l=t+16|0)>>3]=-17976931348623157e292,!((0|r)<=0)){for(n=0|i[e+4>>2],g=17976931348623157e292,_=-17976931348623157e292,v=0,e=-1,d=17976931348623157e292,p=17976931348623157e292,m=-17976931348623157e292,h=-17976931348623157e292,y=0;c=+s[n+(y<<4)>>3],f=+s[n+(y<<4)+8>>3],A=+s[n+(((0|(e=e+2|0))==(0|r)?0:e)<<4)+8>>3],c<d&&(s[a>>3]=c,d=c),f<p&&(s[o>>3]=f,p=f),c>m?s[t>>3]=c:c=m,f>h&&(s[l>>3]=f,h=f),g=f>0&f<g?f:g,_=f<0&f>_?f:_,v|=+u(+(f-A))>3.141592653589793,(0|(e=y+1|0))!=(0|r);)x=y,m=c,y=e,e=x;v&&(s[l>>3]=_,s[o>>3]=g)}}function Rt(e){return 0|((e|=0)>>>0<4?0:15)}function Nt(e,t){t|=0;var n,r=0,a=0,o=0,l=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0,w=0,T=0,S=0,M=0;if(_=0|i[(e|=0)>>2]){if(s[(v=t+8|0)>>3]=17976931348623157e292,s[(y=t+24|0)>>3]=17976931348623157e292,s[t>>3]=-17976931348623157e292,s[(x=t+16|0)>>3]=-17976931348623157e292,(0|_)>0){for(o=0|i[e+4>>2],m=17976931348623157e292,g=-17976931348623157e292,a=0,r=-1,A=17976931348623157e292,d=17976931348623157e292,f=-17976931348623157e292,c=-17976931348623157e292,b=0;l=+s[o+(b<<4)>>3],p=+s[o+(b<<4)+8>>3],h=+s[o+(((0|(S=r+2|0))==(0|_)?0:S)<<4)+8>>3],l<A&&(s[v>>3]=l,A=l),p<d&&(s[y>>3]=p,d=p),l>f?s[t>>3]=l:l=f,p>c&&(s[x>>3]=p,c=p),m=p>0&p<m?p:m,g=p<0&p>g?p:g,a|=+u(+(p-h))>3.141592653589793,(0|(r=b+1|0))!=(0|_);)S=b,f=l,b=r,r=S;a&&(s[x>>3]=g,s[y>>3]=m)}}else i[t>>2]=0,i[t+4>>2]=0,i[t+8>>2]=0,i[t+12>>2]=0,i[t+16>>2]=0,i[t+20>>2]=0,i[t+24>>2]=0,i[t+28>>2]=0;if(!((0|(r=0|i[(S=e+8|0)>>2]))<=0)){n=e+12|0,T=0;do{if(o=0|i[n>>2],a=T,y=t+((T=T+1|0)<<5)|0,x=0|i[o+(a<<3)>>2]){if(s[(b=t+(T<<5)+8|0)>>3]=17976931348623157e292,s[(e=t+(T<<5)+24|0)>>3]=17976931348623157e292,s[y>>3]=-17976931348623157e292,s[(w=t+(T<<5)+16|0)>>3]=-17976931348623157e292,(0|x)>0){for(_=0|i[o+(a<<3)+4>>2],m=17976931348623157e292,g=-17976931348623157e292,o=0,a=-1,v=0,A=17976931348623157e292,d=17976931348623157e292,p=-17976931348623157e292,c=-17976931348623157e292;l=+s[_+(v<<4)>>3],f=+s[_+(v<<4)+8>>3],h=+s[_+(((0|(a=a+2|0))==(0|x)?0:a)<<4)+8>>3],l<A&&(s[b>>3]=l,A=l),f<d&&(s[e>>3]=f,d=f),l>p?s[y>>3]=l:l=p,f>c&&(s[w>>3]=f,c=f),m=f>0&f<m?f:m,g=f<0&f>g?f:g,o|=+u(+(f-h))>3.141592653589793,(0|(a=v+1|0))!=(0|x);)M=v,v=a,p=l,a=M;o&&(s[w>>3]=g,s[e>>3]=m)}}else i[y>>2]=0,i[y+4>>2]=0,i[y+8>>2]=0,i[y+12>>2]=0,i[y+16>>2]=0,i[y+20>>2]=0,i[y+24>>2]=0,i[y+28>>2]=0,r=0|i[S>>2]}while((0|T)<(0|r))}}function Pt(e,t,n){var r=0,s=0,a=0;if(!(0|Et(e|=0,t|=0,n|=0)))return 0|(s=0);if((0|i[(s=e+8|0)>>2])<=0)return 0|(s=1);for(r=e+12|0,e=0;;){if(a=e,e=e+1|0,0|Et((0|i[r>>2])+(a<<3)|0,t+(e<<5)|0,n)){e=0,r=6;break}if((0|e)>=(0|i[s>>2])){e=1,r=6;break}}return 6==(0|r)?0|e:0}function Dt(e,t,n,r){r|=0;var s,a,o=0,l=0,u=0,c=0,h=0;if(a=D,D=D+16|0,s=a,!(0|Et(e|=0,t|=0,u=8+(n|=0)|0)))return D=a,0|(c=0);c=e+8|0;e:do{if((0|i[c>>2])>0){for(l=e+12|0,o=0;;){if(h=o,o=o+1|0,0|Et((0|i[l>>2])+(h<<3)|0,t+(o<<5)|0,u)){o=0;break}if((0|o)>=(0|i[c>>2]))break e}return D=a,0|o}}while(0);if(0|Lt(e,t,n,r))return D=a,0|(h=0);i[s>>2]=i[n>>2],i[s+4>>2]=u,o=0|i[c>>2];e:do{if((0|o)>0)for(e=e+12|0,u=0,l=o;;){if(o=0|i[e>>2],(0|i[o+(u<<3)>>2])>0){if(0|Et(s,r,0|i[o+(u<<3)+4>>2])){o=0;break e}if(o=u+1|0,0|Lt((0|i[e>>2])+(u<<3)|0,t+(o<<5)|0,n,r)){o=0;break e}l=0|i[c>>2]}else o=u+1|0;if(!((0|o)<(0|l))){o=1;break}u=o}else o=1}while(0);return D=a,0|(h=o)}function Lt(e,t,n,r){e|=0,n|=0;var a,o,l,u,c,h,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0,w=0,T=0,S=0,M=0;if(h=D,D=D+176|0,u=h+172|0,A=h+168|0,c=h,!(0|K(t|=0,r|=0)))return D=h,0|(e=0);if(function(e,t,n,r){var a,o,l,u,c;t|=0,n|=0,r|=0,e=(o=+s[16+(e|=0)>>3])<(c=+s[e+24>>3]),a=(u=+s[t+16>>3])<(l=+s[t+24>>3]),t=c-u<l-o,i[n>>2]=e?a|t?1:2:0,i[r>>2]=a?e?1:t?2:1:0}(t,r,u,A),dn(0|c,0|n,168),(0|i[n>>2])>0){t=0;do{b=+ut(+s[(S=c+8+(t<<4)+8|0)>>3],0|i[A>>2]),s[S>>3]=b,t=t+1|0}while((0|t)<(0|i[n>>2]))}o=+s[r>>3],l=+s[r+8>>3],b=+ut(+s[r+16>>3],0|i[A>>2]),a=+ut(+s[r+24>>3],0|i[A>>2]);e:do{if((0|i[e>>2])>0){if(r=e+4|0,(0|(A=0|i[c>>2]))<=0)for(t=0;;)if((0|(t=t+1|0))>=(0|i[e>>2])){t=0;break e}for(n=0;;){if(t=0|i[r>>2],y=+s[t+(n<<4)>>3],x=+ut(+s[t+(n<<4)+8>>3],0|i[u>>2]),t=0|i[r>>2],S=(0|(n=n+1|0))%(0|i[e>>2])|0,d=+s[t+(S<<4)>>3],p=+ut(+s[t+(S<<4)+8>>3],0|i[u>>2]),!(y>=o)|!(d>=o)&&!(y<=l)|!(d<=l)&&!(x<=a)|!(p<=a)&&!(x>=b)|!(p>=b)){v=d-y,g=p-x,t=0;do{if(M=t,S=(0|(t=t+1|0))==(0|A)?0:t,d=+s[c+8+(M<<4)+8>>3],p=+s[c+8+(S<<4)+8>>3]-d,f=+s[c+8+(M<<4)>>3],!(0==(_=v*p-g*(m=+s[c+8+(S<<4)>>3]-f))||(w=x-d,T=y-f,m=(w*m-p*T)/_,m<0|m>1))&&(_=(v*w-g*T)/_)>=0&_<=1){t=1;break e}}while((0|t)<(0|A))}if((0|n)>=(0|i[e>>2])){t=0;break}}}else t=0}while(0);return D=h,0|(M=t)}function It(e,t,n,r){var s=0,a=0,o=0;if(0|Lt(e|=0,t|=0,n|=0,r|=0))return 0|(a=1);if((0|i[(a=e+8|0)>>2])<=0)return 0|(a=0);for(s=e+12|0,e=0;;){if(o=e,e=e+1|0,0|Lt((0|i[s>>2])+(o<<3)|0,t+(e<<5)|0,n,r)){e=1,s=6;break}if((0|e)>=(0|i[a>>2])){e=0,s=6;break}}return 6==(0|s)?0|e:0}function Ot(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var a,o,l,u,c,h,A,d=0;u=+s[(e|=0)>>3],l=+s[t>>3]-u,o=+s[e+8>>3],a=+s[t+8>>3]-o,h=+s[n>>3],d=((d=+s[r>>3]-h)*(o-(A=+s[n+8>>3]))-(u-h)*(c=+s[r+8>>3]-A))/(l*c-a*d),s[i>>3]=u+l*d,s[i+8>>3]=o+a*d}function Bt(e,t){return t|=0,+u(+(+s[(e|=0)>>3]-+s[t>>3]))<1.1920928955078125e-7?0|(t=+u(+(+s[e+8>>3]-+s[t+8>>3]))<1.1920928955078125e-7):0|(t=0)}function Ut(e,t){var n,r,i;return t|=0,+((i=+s[(e|=0)>>3]-+s[t>>3])*i+(r=+s[e+8>>3]-+s[t+8>>3])*r+(n=+s[e+16>>3]-+s[t+16>>3])*n)}function Ft(e,t,n){n|=0;var r,s,a,o,l=0,u=0,c=0;if(o=D,D=D+32|0,c=o,0|(l=0|et(e|=0,t|=0,s=o+16|0)))return D=o,0|(n=l);r=0|Fe(e,t),a=0|We(e,t),function(e,t){e=7696+(28*(e|=0)|0)|0,i[(t|=0)>>2]=i[e>>2],i[t+4>>2]=i[e+4>>2],i[t+8>>2]=i[e+8>>2],i[t+12>>2]=i[e+12>>2]}(r,c),l=0|function(e,t){e|=0;var n=0,r=0;if((t|=0)>>>0>20)return-1;do{if((0|i[11120+(216*t|0)>>2])!=(0|e))if((0|i[11120+(216*t|0)+8>>2])!=(0|e))if((0|i[11120+(216*t|0)+16>>2])!=(0|e))if((0|i[11120+(216*t|0)+24>>2])!=(0|e))if((0|i[11120+(216*t|0)+32>>2])!=(0|e))if((0|i[11120+(216*t|0)+40>>2])!=(0|e))if((0|i[11120+(216*t|0)+48>>2])!=(0|e))if((0|i[11120+(216*t|0)+56>>2])!=(0|e))if((0|i[11120+(216*t|0)+64>>2])!=(0|e))if((0|i[11120+(216*t|0)+72>>2])!=(0|e))if((0|i[11120+(216*t|0)+80>>2])!=(0|e))if((0|i[11120+(216*t|0)+88>>2])!=(0|e))if((0|i[11120+(216*t|0)+96>>2])!=(0|e))if((0|i[11120+(216*t|0)+104>>2])!=(0|e))if((0|i[11120+(216*t|0)+112>>2])!=(0|e))if((0|i[11120+(216*t|0)+120>>2])!=(0|e))if((0|i[11120+(216*t|0)+128>>2])!=(0|e)){if((0|i[11120+(216*t|0)+136>>2])!=(0|e)){if((0|i[11120+(216*t|0)+144>>2])==(0|e)){e=0,n=2,r=0;break}if((0|i[11120+(216*t|0)+152>>2])==(0|e)){e=0,n=2,r=1;break}if((0|i[11120+(216*t|0)+160>>2])==(0|e)){e=0,n=2,r=2;break}if((0|i[11120+(216*t|0)+168>>2])==(0|e)){e=1,n=2,r=0;break}if((0|i[11120+(216*t|0)+176>>2])==(0|e)){e=1,n=2,r=1;break}if((0|i[11120+(216*t|0)+184>>2])==(0|e)){e=1,n=2,r=2;break}if((0|i[11120+(216*t|0)+192>>2])==(0|e)){e=2,n=2,r=0;break}if((0|i[11120+(216*t|0)+200>>2])==(0|e)){e=2,n=2,r=1;break}if((0|i[11120+(216*t|0)+208>>2])==(0|e)){e=2,n=2,r=2;break}return-1}e=2,n=1,r=2}else e=2,n=1,r=1;else e=2,n=1,r=0;else e=1,n=1,r=2;else e=1,n=1,r=1;else e=1,n=1,r=0;else e=0,n=1,r=2;else e=0,n=1,r=1;else e=0,n=1,r=0;else e=2,n=0,r=2;else e=2,n=0,r=1;else e=2,n=0,r=0;else e=1,n=0,r=2;else e=1,n=0,r=1;else e=1,n=0,r=0;else e=0,n=0,r=2;else e=0,n=0,r=1;else e=0,n=0,r=0}while(0);return 0|i[11120+(216*t|0)+(72*n|0)+(24*e|0)+(r<<3)+4>>2]}(r,0|i[s>>2]);e:do{if(0|q(r)){switch(0|r){case 4:e=0;break;case 14:e=1;break;case 24:e=2;break;case 38:e=3;break;case 49:e=4;break;case 58:e=5;break;case 63:e=6;break;case 72:e=7;break;case 83:e=8;break;case 97:e=9;break;case 107:e=10;break;case 117:e=11;break;default:l=1;break e}if(u=0|i[26416+(24*e|0)+8>>2],t=0|i[26416+(24*e|0)+16>>2],(0|(e=0|i[s>>2]))!=(0|i[c>>2])&&(c=0|V(r))|(0|(e=0|i[s>>2]))==(0|t)&&(l=(l+1|0)%6|0),3==(0|a)&(0|e)==(0|t)){l=(l+5|0)%6|0,u=22;break}5==(0|a)&(0|e)==(0|u)?(l=(l+1|0)%6|0,u=22):u=22}else u=22}while(0);return 22==(0|u)&&(i[n>>2]=l,l=0),D=o,0|(n=l)}function kt(e,t,n,r){n|=0,r|=0;var s,a,o,l,u,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0;if(u=D,D=D+32|0,y=u+24|0,l=u+20|0,o=u+8|0,a=u+16|0,s=u,p=(p=!(0|Ge(e|=0,t|=0)))?6:5,m=0|on(0|e,0|t,52),S(),p>>>0<=n>>>0)return D=u,0|(r=2);!(g=!(0|(m&=15)))&&!((_=0|ln(7,0,3*(15^m)|0))&e|0)&!((0|S())&t)?c=n:h=4;e:do{if(4==(0|h)){if((0|((c=!!(0|Ge(e,t)))?4:5))<(0|n))return D=u,0|(r=1);if(0|Ft(e,t,y))return D=u,0|(r=1);if(h=(0|i[y>>2])+n|0,7==(0|(_=0|i[(c=c?26704+((0|h)%5<<2)|0:26736+((0|h)%6<<2)|0)>>2])))return D=u,0|(r=1);i[l>>2]=0,c=0|U(e,t,_,l,o);do{if(!c){if(f=0|i[(d=o)>>2],h=(A=(d=0|i[d+4>>2])>>>0<t>>>0|(0|d)==(0|t)&f>>>0<e>>>0)?f:e,A=A?d:t,!g&&!(f&(g=0|ln(7,0,3*(15^m)|0))|0)&!(d&(0|S())))c=n;else{if(d=(n+-1+p|0)%(0|p)|0,c=0|Ge(e,t),(0|d)<0&&M(27795,27797,246,27806),(0|((p=!!(0|c))?4:5))<(0|d)&&M(27795,27797,246,27806),0|Ft(e,t,y)&&M(27795,27797,246,27806),c=(0|i[y>>2])+d|0,7==(0|(d=0|i[(c=p?26704+((0|c)%5<<2)|0:26736+((0|c)%6<<2)|0)>>2]))&&M(27795,27797,246,27806),i[a>>2]=0,0|(c=0|U(e,t,d,a,s)))break;p=0|i[(f=s)>>2],f=0|i[f+4>>2];do{if(f>>>0<A>>>0|(0|f)==(0|A)&p>>>0<h>>>0){if(h=0|Ge(p,f)?0|F(p,f,e,t):0|i[26800+(((0|i[a>>2])+(0|i[26768+(d<<2)>>2])|0)%6<<2)>>2],c=0|Ge(p,f),(h+-1|0)>>>0>5){c=-1,h=p,A=f;break}if(1==(0|h)&(c=!!(0|c))){c=-1,h=p,A=f;break}do{if(!(0|Ft(p,f,y))){if(c){c=(5+(0|i[26352+(h<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[26384+(h<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);h=p,A=f}else c=n}while(0);f=0|i[(d=o)>>2],d=0|i[d+4>>2]}if((0|h)==(0|f)&(0|A)==(0|d)){if(e=(p=!!(0|Ge(f,d)))?0|F(f,d,e,t):0|i[26800+(((0|i[l>>2])+(0|i[26768+(_<<2)>>2])|0)%6<<2)>>2],c=0|Ge(f,d),(e+-1|0)>>>0<=5&&!(1==(0|e)&(v=!!(0|c))))do{if(!(0|Ft(f,d,y))){if(v){c=(5+(0|i[26352+(e<<2)>>2])-(0|i[y>>2])|0)%5|0;break}c=(6+(0|i[26384+(e<<2)>>2])-(0|i[y>>2])|0)%6|0;break}c=-1}while(0);else c=-1;c=6==(0|(c=c+1|0))|p&5==(0|c)?0:c}t=A,e=h;break e}}while(0);return D=u,0|(r=c)}}while(0);return v=0|ln(0|c,0,56),y=S()|-2130706433&t|536870912,i[r>>2]=v|e,i[r+4>>2]=y,D=u,0|(r=0)}function qt(e,t,n){e|=0,n|=0;var r=0;(0|(t|=0))>0?(r=0|$t(t,4),i[e>>2]=r,r||M(27819,27842,40,27856)):i[e>>2]=0,i[e+4>>2]=t,i[e+8>>2]=0,i[e+12>>2]=n}function Vt(e){var t,n,r,a=0,o=0,l=0,c=0;t=4+(e|=0)|0,n=e+12|0,r=e+8|0;e:for(;;){for(o=0|i[t>>2],a=0;;){if((0|a)>=(0|o))break e;if(l=0|i[e>>2],c=0|i[l+(a<<2)>>2])break;a=a+1|0}a=l+(~~(+u(+ +h(10,+ +(15-(0|i[n>>2])|0))*(+s[c>>3]+ +s[c+8>>3]))%+(0|o))>>>0<<2)|0,o=0|i[a>>2];t:do{if(0|o){if(l=c+32|0,(0|o)==(0|c))i[a>>2]=i[l>>2];else{if(!(a=0|i[(o=o+32|0)>>2]))break;for(;(0|a)!=(0|c);)if(!(a=0|i[(o=a+32|0)>>2]))break t;i[o>>2]=i[l>>2]}Yt(c),i[r>>2]=(0|i[r>>2])-1}}while(0)}Yt(0|i[e>>2])}function zt(e){var t,n=0,r=0;for(t=0|i[4+(e|=0)>>2],r=0;;){if((0|r)>=(0|t)){n=0,r=4;break}if(n=0|i[(0|i[e>>2])+(r<<2)>>2]){r=4;break}r=r+1|0}return 4==(0|r)?0|n:0}function Gt(e,t){t|=0;var n=0,r=0,a=0,o=0;if(n=~~(+u(+ +h(10,+ +(15-(0|i[12+(e|=0)>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,n=(0|i[e>>2])+(n<<2)|0,!(r=0|i[n>>2]))return 0|(o=1);o=t+32|0;do{if((0|r)!=(0|t)){if(!(n=0|i[r+32>>2]))return 0|(o=1);for(a=n;;){if((0|a)==(0|t)){a=8;break}if(!(n=0|i[a+32>>2])){n=1,a=10;break}r=a,a=n}if(8==(0|a)){i[r+32>>2]=i[o>>2];break}if(10==(0|a))return 0|n}else i[n>>2]=i[o>>2]}while(0);return Yt(t),i[(o=e+8|0)>>2]=(0|i[o>>2])-1,0|(o=0)}function jt(e,t,n){e|=0,t|=0,n|=0;var r,a=0,o=0,l=0;(r=0|Qt(40))||M(27872,27842,98,27885),i[r>>2]=i[t>>2],i[r+4>>2]=i[t+4>>2],i[r+8>>2]=i[t+8>>2],i[r+12>>2]=i[t+12>>2],i[(o=r+16|0)>>2]=i[n>>2],i[o+4>>2]=i[n+4>>2],i[o+8>>2]=i[n+8>>2],i[o+12>>2]=i[n+12>>2],i[r+32>>2]=0,o=~~(+u(+ +h(10,+ +(15-(0|i[e+12>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,o=(0|i[e>>2])+(o<<2)|0,a=0|i[o>>2];do{if(a){for(;!(0|lt(a,t)&&0|lt(a+16|0,n));)if(o=0|i[a+32>>2],!(0|i[(a=0|o?o:a)+32>>2])){l=10;break}if(10==(0|l)){i[a+32>>2]=r;break}return Yt(r),0|(l=a)}i[o>>2]=r}while(0);return i[(l=e+8|0)>>2]=1+(0|i[l>>2]),0|(l=r)}function Ht(e,t,n){t|=0,n|=0;var r=0,a=0;if(a=~~(+u(+ +h(10,+ +(15-(0|i[12+(e|=0)>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,!(a=0|i[(0|i[e>>2])+(a<<2)>>2]))return 0|(n=0);if(!n){for(e=a;;){if(0|lt(e,t)){r=10;break}if(!(e=0|i[e+32>>2])){e=0,r=10;break}}if(10==(0|r))return 0|e}for(e=a;;){if(0|lt(e,t)&&0|lt(e+16|0,n)){r=10;break}if(!(e=0|i[e+32>>2])){e=0,r=10;break}}return 10==(0|r)?0|e:0}function Wt(e,t){t|=0;var n=0;if(n=~~(+u(+ +h(10,+ +(15-(0|i[12+(e|=0)>>2])|0))*(+s[t>>3]+ +s[t+8>>3]))%+(0|i[e+4>>2]))>>>0,!(e=0|i[(0|i[e>>2])+(n<<2)>>2]))return 0|(n=0);for(;;){if(0|lt(e,t)){t=5;break}if(!(e=0|i[e+32>>2])){e=0,t=5;break}}return 5==(0|t)?0|e:0}function Xt(e){return 0|+fn(+(e=+e))}function Qt(e){e|=0;var t,n=0,r=0,s=0,a=0,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0;t=D,D=D+16|0,p=t;do{if(e>>>0<245){if(e=(h=e>>>0<11?16:e+11&-8)>>>3,3&(r=(d=0|i[6977])>>>e))return s=0|i[(r=8+(e=27948+((n=(1&r^1)+e|0)<<1<<2)|0)|0)>>2],(0|(o=0|i[(a=s+8|0)>>2]))==(0|e)?i[6977]=d&~(1<<n):(i[o+12>>2]=e,i[r>>2]=o),b=n<<3,i[s+4>>2]=3|b,i[(b=s+b+4|0)>>2]=1|i[b>>2],D=t,0|(b=a);if(h>>>0>(A=0|i[6979])>>>0){if(0|r)return n=((n=r<<e&((n=2<<e)|0-n))&0-n)-1|0,o=0|i[(e=8+(n=27948+((s=((r=(n>>>=u=n>>>12&16)>>>5&8)|u|(o=(n>>>=r)>>>2&4)|(e=(n>>>=o)>>>1&2)|(s=(n>>>=e)>>>1&1))+(n>>>s)|0)<<1<<2)|0)|0)>>2],(0|(r=0|i[(u=o+8|0)>>2]))==(0|n)?(e=d&~(1<<s),i[6977]=e):(i[r+12>>2]=n,i[e>>2]=r,e=d),l=(b=s<<3)-h|0,i[o+4>>2]=3|h,i[4+(a=o+h|0)>>2]=1|l,i[o+b>>2]=l,0|A&&(s=0|i[6982],r=27948+((n=A>>>3)<<1<<2)|0,e&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[6977]=e|n,n=r,e=r+8|0),i[e>>2]=s,i[n+12>>2]=s,i[s+8>>2]=n,i[s+12>>2]=r),i[6979]=l,i[6982]=a,D=t,0|(b=u);if(o=0|i[6978]){for(r=(o&0-o)-1|0,r=c=0|i[28212+(((s=(r>>>=a=r>>>12&16)>>>5&8)|a|(l=(r>>>=s)>>>2&4)|(u=(r>>>=l)>>>1&2)|(c=(r>>>=u)>>>1&1))+(r>>>c)<<2)>>2],u=c,c=(-8&i[c+4>>2])-h|0;(e=0|i[r+16>>2])||(e=0|i[r+20>>2]);)r=e,u=(a=(l=(-8&i[e+4>>2])-h|0)>>>0<c>>>0)?e:u,c=a?l:c;if((l=u+h|0)>>>0>u>>>0){a=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(e=u+20|0)>>2])&&!(n=0|i[(e=u+16|0)>>2])){r=0;break}for(;;)if(r=0|i[(s=n+20|0)>>2])n=r,e=s;else{if(!(r=0|i[(s=n+16|0)>>2]))break;n=r,e=s}i[e>>2]=0,r=n}else r=0|i[u+8>>2],i[r+12>>2]=n,i[n+8>>2]=r,r=n}while(0);do{if(0|a){if(n=0|i[u+28>>2],(0|u)==(0|i[(e=28212+(n<<2)|0)>>2])){if(i[e>>2]=r,!r){i[6978]=o&~(1<<n);break}}else if(i[((0|i[(b=a+16|0)>>2])==(0|u)?b:a+20)>>2]=r,!r)break;i[r+24>>2]=a,0|(n=0|i[u+16>>2])&&(i[r+16>>2]=n,i[n+24>>2]=r),0|(n=0|i[u+20>>2])&&(i[r+20>>2]=n,i[n+24>>2]=r)}}while(0);return c>>>0<16?(b=c+h|0,i[u+4>>2]=3|b,i[(b=u+b+4|0)>>2]=1|i[b>>2]):(i[u+4>>2]=3|h,i[l+4>>2]=1|c,i[l+c>>2]=c,0|A&&(s=0|i[6982],r=27948+((n=A>>>3)<<1<<2)|0,(n=1<<n)&d?n=0|i[(e=r+8|0)>>2]:(i[6977]=n|d,n=r,e=r+8|0),i[e>>2]=s,i[n+12>>2]=s,i[s+8>>2]=n,i[s+12>>2]=r),i[6979]=c,i[6982]=l),D=t,0|(b=u+8|0)}d=h}else d=h}else d=h}else if(e>>>0<=4294967231)if(h=-8&(e=e+11|0),s=0|i[6978]){a=0-h|0,c=(e>>>=8)?h>>>0>16777215?31:h>>>(7+(c=14-((u=(520192+(g=e<<(d=(e+1048320|0)>>>16&8))|0)>>>16&4)|d|(c=(245760+(g<<=u)|0)>>>16&2))+(g<<c>>>15)|0)|0)&1|c<<1:0,r=0|i[28212+(c<<2)>>2];e:do{if(r)for(e=0,u=h<<(31==(0|c)?0:25-(c>>>1)|0),o=0;;){if((l=(-8&i[r+4>>2])-h|0)>>>0<a>>>0){if(!l){e=r,a=0,g=65;break e}e=r,a=l}if(o=!(0|(g=0|i[r+20>>2]))|(0|g)==(0|(r=0|i[r+16+(u>>>31<<2)>>2]))?o:g,!r){r=o,g=61;break}u<<=1}else r=0,e=0,g=61}while(0);if(61==(0|g)){if(!(0|r)&!(0|e)){if(!(e=((e=2<<c)|0-e)&s)){d=h;break}d=(e&0-e)-1|0,e=0,r=0|i[28212+(((o=(d>>>=l=d>>>12&16)>>>5&8)|l|(u=(d>>>=o)>>>2&4)|(c=(d>>>=u)>>>1&2)|(r=(d>>>=c)>>>1&1))+(d>>>r)<<2)>>2]}r?g=65:(u=e,l=a)}if(65==(0|g))for(o=r;;){if(a=(r=(d=(-8&i[o+4>>2])-h|0)>>>0<a>>>0)?d:a,e=r?o:e,(r=0|i[o+16>>2])||(r=0|i[o+20>>2]),!r){u=e,l=a;break}o=r}if(0|u&&l>>>0<((0|i[6979])-h|0)>>>0&&(A=u+h|0)>>>0>u>>>0){o=0|i[u+24>>2],n=0|i[u+12>>2];do{if((0|n)==(0|u)){if(!(n=0|i[(e=u+20|0)>>2])&&!(n=0|i[(e=u+16|0)>>2])){n=0;break}for(;;)if(r=0|i[(a=n+20|0)>>2])n=r,e=a;else{if(!(r=0|i[(a=n+16|0)>>2]))break;n=r,e=a}i[e>>2]=0}else b=0|i[u+8>>2],i[b+12>>2]=n,i[n+8>>2]=b}while(0);do{if(o){if(e=0|i[u+28>>2],(0|u)==(0|i[(r=28212+(e<<2)|0)>>2])){if(i[r>>2]=n,!n){s&=~(1<<e),i[6978]=s;break}}else if(i[((0|i[(b=o+16|0)>>2])==(0|u)?b:o+20)>>2]=n,!n)break;i[n+24>>2]=o,0|(e=0|i[u+16>>2])&&(i[n+16>>2]=e,i[e+24>>2]=n),(e=0|i[u+20>>2])&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);e:do{if(l>>>0<16)b=l+h|0,i[u+4>>2]=3|b,i[(b=u+b+4|0)>>2]=1|i[b>>2];else{if(i[u+4>>2]=3|h,i[A+4>>2]=1|l,i[A+l>>2]=l,n=l>>>3,l>>>0<256){r=27948+(n<<1<<2)|0,(e=0|i[6977])&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[6977]=e|n,n=r,e=r+8|0),i[e>>2]=A,i[n+12>>2]=A,i[A+8>>2]=n,i[A+12>>2]=r;break}if(n=28212+((r=(n=l>>>8)?l>>>0>16777215?31:l>>>(7+(r=14-((y=(520192+(b=n<<(x=(n+1048320|0)>>>16&8))|0)>>>16&4)|x|(r=(245760+(b<<=y)|0)>>>16&2))+(b<<r>>>15)|0)|0)&1|r<<1:0)<<2)|0,i[A+28>>2]=r,i[4+(e=A+16|0)>>2]=0,i[e>>2]=0,!(s&(e=1<<r))){i[6978]=s|e,i[n>>2]=A,i[A+24>>2]=n,i[A+12>>2]=A,i[A+8>>2]=A;break}n=0|i[n>>2];t:do{if((-8&i[n+4>>2])!=(0|l)){for(s=l<<(31==(0|r)?0:25-(r>>>1)|0);e=0|i[(r=n+16+(s>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|l)){n=e;break t}s<<=1,n=e}i[r>>2]=A,i[A+24>>2]=n,i[A+12>>2]=A,i[A+8>>2]=A;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=A,i[x>>2]=A,i[A+8>>2]=b,i[A+12>>2]=n,i[A+24>>2]=0}}while(0);return D=t,0|(b=u+8|0)}d=h}else d=h;else d=-1}while(0);if((r=0|i[6979])>>>0>=d>>>0)return n=r-d|0,e=0|i[6982],n>>>0>15?(b=e+d|0,i[6982]=b,i[6979]=n,i[b+4>>2]=1|n,i[e+r>>2]=n,i[e+4>>2]=3|d):(i[6979]=0,i[6982]=0,i[e+4>>2]=3|r,i[(b=e+r+4|0)>>2]=1|i[b>>2]),D=t,0|(b=e+8|0);if((l=0|i[6980])>>>0>d>>>0)return y=l-d|0,i[6980]=y,x=(b=0|i[6983])+d|0,i[6983]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|d,D=t,0|(b=b+8|0);if(0|i[7095]?e=0|i[7097]:(i[7097]=4096,i[7096]=4096,i[7098]=-1,i[7099]=-1,i[7100]=0,i[7088]=0,i[7095]=-16&p^1431655768,e=4096),u=d+48|0,(h=(o=e+(c=d+47|0)|0)&(a=0-e|0))>>>0<=d>>>0)return D=t,0|(b=0);if(0|(e=0|i[7087])&&(p=(A=0|i[7085])+h|0)>>>0<=A>>>0|p>>>0>e>>>0)return D=t,0|(b=0);e:do{if(4&i[7088])n=0,g=143;else{r=0|i[6983];t:do{if(r){for(s=28356;!((p=0|i[s>>2])>>>0<=r>>>0&&(p+(0|i[s+4>>2])|0)>>>0>r>>>0);){if(!(e=0|i[s+8>>2])){g=128;break t}s=e}if((n=o-l&a)>>>0<2147483647)if((0|(e=0|mn(0|n)))==((0|i[s>>2])+(0|i[s+4>>2])|0)){if(-1!=(0|e)){l=n,o=e,g=145;break e}}else s=e,g=136;else n=0}else g=128}while(0);do{if(128==(0|g))if(-1!=(0|(r=0|mn(0)))&&(n=r,m=(n=((m=(f=0|i[7096])-1|0)&n|0?(m+n&0-f)-n|0:0)+h|0)+(f=0|i[7085])|0,n>>>0>d>>>0&n>>>0<2147483647)){if(0|(p=0|i[7087])&&m>>>0<=f>>>0|m>>>0>p>>>0){n=0;break}if((0|(e=0|mn(0|n)))==(0|r)){l=n,o=r,g=145;break e}s=e,g=136}else n=0}while(0);do{if(136==(0|g)){if(r=0-n|0,!(u>>>0>n>>>0&n>>>0<2147483647&-1!=(0|s))){if(-1==(0|s)){n=0;break}l=n,o=s,g=145;break e}if((e=c-n+(e=0|i[7097])&0-e)>>>0>=2147483647){l=n,o=s,g=145;break e}if(-1==(0|mn(0|e))){mn(0|r),n=0;break}l=e+n|0,o=s,g=145;break e}}while(0);i[7088]=4|i[7088],g=143}}while(0);if(143==(0|g)&&h>>>0<2147483647&&!(-1==(0|(y=0|mn(0|h)))|1^(v=(_=(m=0|mn(0))-y|0)>>>0>(d+40|0)>>>0)|y>>>0<m>>>0&-1!=(0|y)&-1!=(0|m)^1)&&(l=v?_:n,o=y,g=145),145==(0|g)){n=(0|i[7085])+l|0,i[7085]=n,n>>>0>(0|i[7086])>>>0&&(i[7086]=n),c=0|i[6983];e:do{if(c){for(n=28356;;){if((0|o)==((e=0|i[n>>2])+(r=0|i[n+4>>2])|0)){g=154;break}if(!(s=0|i[n+8>>2]))break;n=s}if(!(154!=(0|g)||(x=n+4|0,8&i[n+12>>2]))&&o>>>0>c>>>0&e>>>0<=c>>>0){i[x>>2]=r+l,x=c+(y=7&(y=c+8|0)?0-y&7:0)|0,y=(b=(0|i[6980])+l|0)-y|0,i[6983]=x,i[6980]=y,i[x+4>>2]=1|y,i[c+b+4>>2]=40,i[6984]=i[7099];break}for(o>>>0<(0|i[6981])>>>0&&(i[6981]=o),r=o+l|0,n=28356;;){if((0|i[n>>2])==(0|r)){g=162;break}if(!(e=0|i[n+8>>2]))break;n=e}if(162==(0|g)&&!(8&i[n+12>>2])){i[n>>2]=o,i[(A=n+4|0)>>2]=(0|i[A>>2])+l,h=(A=o+(7&(A=o+8|0)?0-A&7:0)|0)+d|0,u=(n=r+(7&(n=r+8|0)?0-n&7:0)|0)-A-d|0,i[A+4>>2]=3|d;t:do{if((0|c)==(0|n))b=(0|i[6980])+u|0,i[6980]=b,i[6983]=h,i[h+4>>2]=1|b;else{if((0|i[6982])==(0|n)){b=(0|i[6979])+u|0,i[6979]=b,i[6982]=h,i[h+4>>2]=1|b,i[h+b>>2]=b;break}if(1==(3&(e=0|i[n+4>>2]))){l=-8&e,s=e>>>3;n:do{if(e>>>0<256){if(e=0|i[n+8>>2],(0|(r=0|i[n+12>>2]))==(0|e)){i[6977]=i[6977]&~(1<<s);break}i[e+12>>2]=r,i[r+8>>2]=e;break}o=0|i[n+24>>2],e=0|i[n+12>>2];do{if((0|e)==(0|n)){if(e=0|i[(s=4+(r=n+16|0)|0)>>2])r=s;else if(!(e=0|i[r>>2])){e=0;break}for(;;)if(s=0|i[(a=e+20|0)>>2])e=s,r=a;else{if(!(s=0|i[(a=e+16|0)>>2]))break;e=s,r=a}i[r>>2]=0}else b=0|i[n+8>>2],i[b+12>>2]=e,i[e+8>>2]=b}while(0);if(!o)break;s=28212+((r=0|i[n+28>>2])<<2)|0;do{if((0|i[s>>2])==(0|n)){if(i[s>>2]=e,0|e)break;i[6978]=i[6978]&~(1<<r);break n}if(i[((0|i[(b=o+16|0)>>2])==(0|n)?b:o+20)>>2]=e,!e)break n}while(0);if(i[e+24>>2]=o,0|(s=0|i[(r=n+16|0)>>2])&&(i[e+16>>2]=s,i[s+24>>2]=e),!(r=0|i[r+4>>2]))break;i[e+20>>2]=r,i[r+24>>2]=e}while(0);n=n+l|0,a=l+u|0}else a=u;if(i[(n=n+4|0)>>2]=-2&i[n>>2],i[h+4>>2]=1|a,i[h+a>>2]=a,n=a>>>3,a>>>0<256){r=27948+(n<<1<<2)|0,(e=0|i[6977])&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[6977]=e|n,n=r,e=r+8|0),i[e>>2]=h,i[n+12>>2]=h,i[h+8>>2]=n,i[h+12>>2]=r;break}n=a>>>8;do{if(n){if(a>>>0>16777215){s=31;break}s=a>>>(7+(s=14-((y=(520192+(b=n<<(x=(n+1048320|0)>>>16&8))|0)>>>16&4)|x|(s=(245760+(b<<=y)|0)>>>16&2))+(b<<s>>>15)|0)|0)&1|s<<1}else s=0}while(0);if(n=28212+(s<<2)|0,i[h+28>>2]=s,i[4+(e=h+16|0)>>2]=0,i[e>>2]=0,!((e=0|i[6978])&(r=1<<s))){i[6978]=e|r,i[n>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break}n=0|i[n>>2];n:do{if((-8&i[n+4>>2])!=(0|a)){for(s=a<<(31==(0|s)?0:25-(s>>>1)|0);e=0|i[(r=n+16+(s>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|a)){n=e;break n}s<<=1,n=e}i[r>>2]=h,i[h+24>>2]=n,i[h+12>>2]=h,i[h+8>>2]=h;break t}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=h,i[x>>2]=h,i[h+8>>2]=b,i[h+12>>2]=n,i[h+24>>2]=0}}while(0);return D=t,0|(b=A+8|0)}for(n=28356;!((e=0|i[n>>2])>>>0<=c>>>0&&(b=e+(0|i[n+4>>2])|0)>>>0>c>>>0);)n=0|i[n+8>>2];n=(e=(e=(a=b+-47|0)+(7&(e=a+8|0)?0-e&7:0)|0)>>>0<(a=c+16|0)>>>0?c:e)+8|0,x=o+(y=7&(y=o+8|0)?0-y&7:0)|0,y=(r=l+-40|0)-y|0,i[6983]=x,i[6980]=y,i[x+4>>2]=1|y,i[o+r+4>>2]=40,i[6984]=i[7099],i[(r=e+4|0)>>2]=27,i[n>>2]=i[7089],i[n+4>>2]=i[7090],i[n+8>>2]=i[7091],i[n+12>>2]=i[7092],i[7089]=o,i[7090]=l,i[7092]=0,i[7091]=n,n=e+24|0;do{x=n,i[(n=n+4|0)>>2]=7}while((x+8|0)>>>0<b>>>0);if((0|e)!=(0|c)){if(o=e-c|0,i[r>>2]=-2&i[r>>2],i[c+4>>2]=1|o,i[e>>2]=o,n=o>>>3,o>>>0<256){r=27948+(n<<1<<2)|0,(e=0|i[6977])&(n=1<<n)?n=0|i[(e=r+8|0)>>2]:(i[6977]=e|n,n=r,e=r+8|0),i[e>>2]=c,i[n+12>>2]=c,i[c+8>>2]=n,i[c+12>>2]=r;break}if(r=28212+((s=(n=o>>>8)?o>>>0>16777215?31:o>>>(7+(s=14-((y=(520192+(b=n<<(x=(n+1048320|0)>>>16&8))|0)>>>16&4)|x|(s=(245760+(b<<=y)|0)>>>16&2))+(b<<s>>>15)|0)|0)&1|s<<1:0)<<2)|0,i[c+28>>2]=s,i[c+20>>2]=0,i[a>>2]=0,!((n=0|i[6978])&(e=1<<s))){i[6978]=n|e,i[r>>2]=c,i[c+24>>2]=r,i[c+12>>2]=c,i[c+8>>2]=c;break}n=0|i[r>>2];t:do{if((-8&i[n+4>>2])!=(0|o)){for(s=o<<(31==(0|s)?0:25-(s>>>1)|0);e=0|i[(r=n+16+(s>>>31<<2)|0)>>2];){if((-8&i[e+4>>2])==(0|o)){n=e;break t}s<<=1,n=e}i[r>>2]=c,i[c+24>>2]=n,i[c+12>>2]=c,i[c+8>>2]=c;break e}}while(0);b=0|i[(x=n+8|0)>>2],i[b+12>>2]=c,i[x>>2]=c,i[c+8>>2]=b,i[c+12>>2]=n,i[c+24>>2]=0}}else!(0|(b=0|i[6981]))|o>>>0<b>>>0&&(i[6981]=o),i[7089]=o,i[7090]=l,i[7092]=0,i[6986]=i[7095],i[6985]=-1,i[6990]=27948,i[6989]=27948,i[6992]=27956,i[6991]=27956,i[6994]=27964,i[6993]=27964,i[6996]=27972,i[6995]=27972,i[6998]=27980,i[6997]=27980,i[7e3]=27988,i[6999]=27988,i[7002]=27996,i[7001]=27996,i[7004]=28004,i[7003]=28004,i[7006]=28012,i[7005]=28012,i[7008]=28020,i[7007]=28020,i[7010]=28028,i[7009]=28028,i[7012]=28036,i[7011]=28036,i[7014]=28044,i[7013]=28044,i[7016]=28052,i[7015]=28052,i[7018]=28060,i[7017]=28060,i[7020]=28068,i[7019]=28068,i[7022]=28076,i[7021]=28076,i[7024]=28084,i[7023]=28084,i[7026]=28092,i[7025]=28092,i[7028]=28100,i[7027]=28100,i[7030]=28108,i[7029]=28108,i[7032]=28116,i[7031]=28116,i[7034]=28124,i[7033]=28124,i[7036]=28132,i[7035]=28132,i[7038]=28140,i[7037]=28140,i[7040]=28148,i[7039]=28148,i[7042]=28156,i[7041]=28156,i[7044]=28164,i[7043]=28164,i[7046]=28172,i[7045]=28172,i[7048]=28180,i[7047]=28180,i[7050]=28188,i[7049]=28188,i[7052]=28196,i[7051]=28196,x=o+(y=7&(y=o+8|0)?0-y&7:0)|0,y=(b=l+-40|0)-y|0,i[6983]=x,i[6980]=y,i[x+4>>2]=1|y,i[o+b+4>>2]=40,i[6984]=i[7099]}while(0);if((n=0|i[6980])>>>0>d>>>0)return y=n-d|0,i[6980]=y,x=(b=0|i[6983])+d|0,i[6983]=x,i[x+4>>2]=1|y,i[b+4>>2]=3|d,D=t,0|(b=b+8|0)}return i[(b=27904)>>2]=12,D=t,0|(b=0)}function Yt(e){var t=0,n=0,r=0,s=0,a=0,o=0,l=0,u=0;if(e|=0){n=e+-8|0,s=0|i[6981],u=n+(t=-8&(e=0|i[e+-4>>2]))|0;do{if(1&e)l=n,o=n;else{if(r=0|i[n>>2],!(3&e))return;if(a=r+t|0,(o=n+(0-r)|0)>>>0<s>>>0)return;if((0|i[6982])==(0|o)){if(3&~(t=0|i[(e=u+4|0)>>2])){l=o,t=a;break}return i[6979]=a,i[e>>2]=-2&t,i[o+4>>2]=1|a,void(i[o+a>>2]=a)}if(n=r>>>3,r>>>0<256){if(e=0|i[o+8>>2],(0|(t=0|i[o+12>>2]))==(0|e)){i[6977]=i[6977]&~(1<<n),l=o,t=a;break}i[e+12>>2]=t,i[t+8>>2]=e,l=o,t=a;break}s=0|i[o+24>>2],e=0|i[o+12>>2];do{if((0|e)==(0|o)){if(e=0|i[(n=4+(t=o+16|0)|0)>>2])t=n;else if(!(e=0|i[t>>2])){e=0;break}for(;;)if(n=0|i[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|i[(r=e+16|0)>>2]))break;e=n,t=r}i[t>>2]=0}else l=0|i[o+8>>2],i[l+12>>2]=e,i[e+8>>2]=l}while(0);if(s){if(t=0|i[o+28>>2],(0|i[(n=28212+(t<<2)|0)>>2])==(0|o)){if(i[n>>2]=e,!e){i[6978]=i[6978]&~(1<<t),l=o,t=a;break}}else if(i[((0|i[(l=s+16|0)>>2])==(0|o)?l:s+20)>>2]=e,!e){l=o,t=a;break}i[e+24>>2]=s,0|(n=0|i[(t=o+16|0)>>2])&&(i[e+16>>2]=n,i[n+24>>2]=e),(t=0|i[t+4>>2])?(i[e+20>>2]=t,i[t+24>>2]=e,l=o,t=a):(l=o,t=a)}else l=o,t=a}}while(0);if(!(o>>>0>=u>>>0)&&1&(r=0|i[(e=u+4|0)>>2])){if(2&r)i[e>>2]=-2&r,i[l+4>>2]=1|t,i[o+t>>2]=t,s=t;else{if((0|i[6983])==(0|u)){if(u=(0|i[6980])+t|0,i[6980]=u,i[6983]=l,i[l+4>>2]=1|u,(0|l)!=(0|i[6982]))return;return i[6982]=0,void(i[6979]=0)}if((0|i[6982])==(0|u))return u=(0|i[6979])+t|0,i[6979]=u,i[6982]=o,i[l+4>>2]=1|u,void(i[o+u>>2]=u);s=(-8&r)+t|0,n=r>>>3;do{if(r>>>0<256){if(t=0|i[u+8>>2],(0|(e=0|i[u+12>>2]))==(0|t)){i[6977]=i[6977]&~(1<<n);break}i[t+12>>2]=e,i[e+8>>2]=t;break}a=0|i[u+24>>2],e=0|i[u+12>>2];do{if((0|e)==(0|u)){if(e=0|i[(n=4+(t=u+16|0)|0)>>2])t=n;else if(!(e=0|i[t>>2])){n=0;break}for(;;)if(n=0|i[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|i[(r=e+16|0)>>2]))break;e=n,t=r}i[t>>2]=0,n=e}else n=0|i[u+8>>2],i[n+12>>2]=e,i[e+8>>2]=n,n=e}while(0);if(0|a){if(e=0|i[u+28>>2],(0|i[(t=28212+(e<<2)|0)>>2])==(0|u)){if(i[t>>2]=n,!n){i[6978]=i[6978]&~(1<<e);break}}else if(i[((0|i[(r=a+16|0)>>2])==(0|u)?r:a+20)>>2]=n,!n)break;i[n+24>>2]=a,0|(t=0|i[(e=u+16|0)>>2])&&(i[n+16>>2]=t,i[t+24>>2]=n),0|(e=0|i[e+4>>2])&&(i[n+20>>2]=e,i[e+24>>2]=n)}}while(0);if(i[l+4>>2]=1|s,i[o+s>>2]=s,(0|l)==(0|i[6982]))return void(i[6979]=s)}if(e=s>>>3,s>>>0<256)return n=27948+(e<<1<<2)|0,(t=0|i[6977])&(e=1<<e)?e=0|i[(t=n+8|0)>>2]:(i[6977]=t|e,e=n,t=n+8|0),i[t>>2]=l,i[e+12>>2]=l,i[l+8>>2]=e,void(i[l+12>>2]=n);e=28212+((r=(e=s>>>8)?s>>>0>16777215?31:s>>>(7+(r=14-((a=(520192+(u=e<<(o=(e+1048320|0)>>>16&8))|0)>>>16&4)|o|(r=(245760+(u<<=a)|0)>>>16&2))+(u<<r>>>15)|0)|0)&1|r<<1:0)<<2)|0,i[l+28>>2]=r,i[l+20>>2]=0,i[l+16>>2]=0,t=0|i[6978],n=1<<r;e:do{if(t&n){e=0|i[e>>2];t:do{if((-8&i[e+4>>2])!=(0|s)){for(r=s<<(31==(0|r)?0:25-(r>>>1)|0);t=0|i[(n=e+16+(r>>>31<<2)|0)>>2];){if((-8&i[t+4>>2])==(0|s)){e=t;break t}r<<=1,e=t}i[n>>2]=l,i[l+24>>2]=e,i[l+12>>2]=l,i[l+8>>2]=l;break e}}while(0);u=0|i[(o=e+8|0)>>2],i[u+12>>2]=l,i[o>>2]=l,i[l+8>>2]=u,i[l+12>>2]=e,i[l+24>>2]=0}else i[6978]=t|n,i[e>>2]=l,i[l+24>>2]=e,i[l+12>>2]=l,i[l+8>>2]=l}while(0);if(u=(0|i[6985])-1|0,i[6985]=u,!(0|u)){for(e=28364;e=0|i[e>>2];)e=e+8|0;i[6985]=-1}}}}function $t(e,t){t|=0;var n=0;return(e|=0)?(n=0|y(t,e),(t|e)>>>0>65535&&(n=((n>>>0)/(e>>>0)|0)==(0|t)?n:-1)):n=0,(e=0|Qt(n))&&3&i[e+-4>>2]?(pn(0|e,0,0|n),0|e):0|e}function Kt(e,t,n,r){return 0|(T((t|=0)+(r|=0)+((n=(e|=0)+(n|=0)>>>0)>>>0<e>>>0|0)>>>0|0),n)}function Zt(e,t,n,r){return 0|(T(0|(r=(t|=0)-(r|=0)-((n|=0)>>>0>(e|=0)>>>0|0)>>>0)),e-n>>>0)}function Jt(e){return 0|((e|=0)?31-(0|w(e^e-1)):32)}function en(e,t,n,r,s){s|=0;var a=0,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0;if(h=e|=0,o=n|=0,l=d=r|=0,!(c=u=t|=0))return a=!!(0|s),l?a?(i[s>>2]=0|e,i[s+4>>2]=0&t,s=0,0|(T(0|(d=0)),s)):(s=0,0|(T(0|(d=0)),s)):(a&&(i[s>>2]=(h>>>0)%(o>>>0),i[s+4>>2]=0),s=(h>>>0)/(o>>>0)>>>0,0|(T(0|(d=0)),s));a=!(0|l);do{if(o){if(!a){if((a=(0|w(0|l))-(0|w(0|c))|0)>>>0<=31){o=A=a+1|0,e=h>>>(A>>>0)&(t=a-31>>31)|c<<(l=31-a|0),t&=c>>>(A>>>0),a=0,l=h<<l;break}return s?(i[s>>2]=0|e,i[s+4>>2]=u|0&t,s=0,0|(T(0|(d=0)),s)):(s=0,0|(T(0|(d=0)),s))}if((a=o-1|0)&o|0){o=l=33+(0|w(0|o))-(0|w(0|c))|0,e=(A=32-l|0)-1>>31&c>>>((p=l-32|0)>>>0)|(c<<A|h>>>(l>>>0))&(t=p>>31),t&=c>>>(l>>>0),a=h<<(f=64-l|0)&(u=A>>31),l=(c<<f|h>>>(p>>>0))&u|h<<A&l-33>>31;break}return 0|s&&(i[s>>2]=a&h,i[s+4>>2]=0),1==(0|o)?(f=0|e,0|(T(0|(p=u|0&t)),f)):(p=c>>>((f=0|Jt(0|o))>>>0)|0,f=c<<32-f|h>>>(f>>>0),0|(T(0|p),f))}if(a)return 0|s&&(i[s>>2]=(c>>>0)%(o>>>0),i[s+4>>2]=0),f=(c>>>0)/(o>>>0)>>>0,0|(T(0|(p=0)),f);if(!h)return 0|s&&(i[s>>2]=0,i[s+4>>2]=(c>>>0)%(l>>>0)),f=(c>>>0)/(l>>>0)>>>0,0|(T(0|(p=0)),f);if(!((a=l-1|0)&l))return 0|s&&(i[s>>2]=0|e,i[s+4>>2]=a&c|0&t),p=0,f=c>>>((0|Jt(0|l))>>>0),0|(T(0|p),f);if((a=(0|w(0|l))-(0|w(0|c))|0)>>>0<=30){o=t=a+1|0,e=c<<(l=31-a|0)|h>>>(t>>>0),t=c>>>(t>>>0),a=0,l=h<<l;break}return s?(i[s>>2]=0|e,i[s+4>>2]=u|0&t,f=0,0|(T(0|(p=0)),f)):(f=0,0|(T(0|(p=0)),f))}while(0);if(o){c=0|Kt(0|(A=0|n),0|(h=d|0&r),-1,-1),n=0|S(),u=l,l=0;do{r=u,u=a>>>31|u<<1,a=l|a<<1,Zt(0|c,0|n,0|(r=e<<1|r>>>31),0|(d=e>>>31|t<<1)),l=1&(p=(f=0|S())>>31|((0|f)<0?-1:0)<<1),e=0|Zt(0|r,0|d,p&A|0,(((0|f)<0?-1:0)>>31|((0|f)<0?-1:0)<<1)&h),t=0|S(),o=o-1|0}while(0|o);c=u,u=0}else c=l,u=0,l=0;return o=0,0|s&&(i[s>>2]=e,i[s+4>>2]=t),f=a<<1&-2|l,0|(T(0|(p=(0|a)>>>31|(c|o)<<1|u)),f)}function tn(e,t,n,r){var i,s,a,o,l;return n|=0,s=(r|=0)>>31|((0|r)<0?-1:0)<<1,i=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,a=0|Zt((l=(t|=0)>>31|((0|t)<0?-1:0)<<1)^(e|=0)|0,(o=((0|t)<0?-1:0)>>31|((0|t)<0?-1:0)<<1)^t|0,0|l,0|o),e=s^l,t=i^o,0|Zt((0|en(a,0|S(),0|Zt(s^n|0,i^r|0,0|s,0|i),0|S(),0))^e,(0|S())^t,0|e,0|t)}function nn(e,t,n,r){var i,s;return t|=0,r|=0,n=0|function(e,t){var n,r,i,s=0;return e=((n=0|y(s=65535&(t|=0),i=65535&(e|=0)))>>>16)+(0|y(s,r=e>>>16))|0,t=0|y(s=t>>>16,i),0|(T((e>>>16)+(0|y(s,r))+(((65535&e)+t|0)>>>16)|0),e+t<<16|65535&n)}(i=e|=0,s=n|=0),e=0|S(),0|(T((0|y(t,s))+(0|y(r,i))+e|0&e),n)}function rn(e,t,n,r){var s,a,o,l,u,c;return n|=0,s=D,D=D+16|0,l=0|s,c=(r|=0)>>31|((0|r)<0?-1:0)<<1,u=((0|r)<0?-1:0)>>31|((0|r)<0?-1:0)<<1,en(e=0|Zt((o=(t|=0)>>31|((0|t)<0?-1:0)<<1)^(e|=0)|0,(a=((0|t)<0?-1:0)>>31|((0|t)<0?-1:0)<<1)^t|0,0|o,0|a),t=0|S(),0|Zt(c^n|0,u^r|0,0|c,0|u),0|S(),l),r=0|Zt(i[l>>2]^o|0,i[l+4>>2]^a|0,0|o,0|a),n=0|S(),D=s,0|(T(0|n),r)}function sn(e,t,n,r){var s,a;return a=D,D=D+16|0,en(e|=0,t|=0,n|=0,r|=0,s=0|a),D=a,0|(T(0|i[s+4>>2]),i[s>>2])}function an(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(T(t>>n|0),e>>>n|(t&(1<<n)-1)<<32-n):(T(0|((0|t)<0?-1:0)),t>>n-32)}function on(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(T(t>>>n|0),e>>>n|(t&(1<<n)-1)<<32-n):(T(0),t>>>n-32|0)}function ln(e,t,n){return e|=0,(0|(n|=0))<32?(T((t|=0)<<n|(e&(1<<n)-1<<32-n)>>>32-n),e<<n):(T(e<<n-32),0)}function un(e,t,n){return e|=0,32==(0|(t=0|w(t|=0)))&&(t=t+(0|w(e))|0),T(0),0|t}function cn(e,t){return t=+t,(e=+e)!=e?+t:t!=t?+e:+b(+e,+t)}function hn(e,t){return t=+t,(e=+e)!=e?+t:t!=t?+e:+x(+e,+t)}function An(e){return(e=+e)>=0?+l(e+.5):+v(e-.5)}function dn(e,t,n){e|=0,t|=0;var s,a,o=0;if((0|(n|=0))>=8192)return R(0|e,0|t,0|n),0|e;if(a=0|e,s=e+n|0,(3&e)==(3&t)){for(;3&e;){if(!n)return 0|a;r[0|e]=0|r[0|t],e=e+1|0,t=t+1|0,n=n-1|0}for(o=(n=-4&s)-64|0;(0|e)<=(0|o);)i[e>>2]=i[t>>2],i[e+4>>2]=i[t+4>>2],i[e+8>>2]=i[t+8>>2],i[e+12>>2]=i[t+12>>2],i[e+16>>2]=i[t+16>>2],i[e+20>>2]=i[t+20>>2],i[e+24>>2]=i[t+24>>2],i[e+28>>2]=i[t+28>>2],i[e+32>>2]=i[t+32>>2],i[e+36>>2]=i[t+36>>2],i[e+40>>2]=i[t+40>>2],i[e+44>>2]=i[t+44>>2],i[e+48>>2]=i[t+48>>2],i[e+52>>2]=i[t+52>>2],i[e+56>>2]=i[t+56>>2],i[e+60>>2]=i[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|n);)i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0}else for(n=s-4|0;(0|e)<(0|n);)r[0|e]=0|r[0|t],r[e+1|0]=0|r[t+1|0],r[e+2|0]=0|r[t+2|0],r[e+3|0]=0|r[t+3|0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|s);)r[0|e]=0|r[0|t],e=e+1|0,t=t+1|0;return 0|a}function pn(e,t,n){t|=0;var s,a=0,o=0,l=0;if(s=(e|=0)+(n|=0)|0,t&=255,(0|n)>=67){for(;3&e;)r[0|e]=t,e=e+1|0;for(l=t|t<<8|t<<16|t<<24,o=(a=-4&s)-64|0;(0|e)<=(0|o);)i[e>>2]=l,i[e+4>>2]=l,i[e+8>>2]=l,i[e+12>>2]=l,i[e+16>>2]=l,i[e+20>>2]=l,i[e+24>>2]=l,i[e+28>>2]=l,i[e+32>>2]=l,i[e+36>>2]=l,i[e+40>>2]=l,i[e+44>>2]=l,i[e+48>>2]=l,i[e+52>>2]=l,i[e+56>>2]=l,i[e+60>>2]=l,e=e+64|0;for(;(0|e)<(0|a);)i[e>>2]=l,e=e+4|0}for(;(0|e)<(0|s);)r[0|e]=t,e=e+1|0;return s-n|0}function fn(e){return(e=+e)>=0?+l(e+.5):+v(e-.5)}function mn(e){var t,n,r;return e|=0,r=0|C(),(0|e)>0&(0|(t=(n=0|i[o>>2])+e|0))<(0|n)|(0|t)<0?(P(0|t),E(12),-1):(0|t)>(0|r)&&!(0|N(0|t))?(E(12),-1):(i[o>>2]=t,0|n)}return{___divdi3:tn,___muldi3:nn,___remdi3:rn,___uremdi3:sn,_areNeighborCells:function(e,t,n,r,s){s|=0;var a,o,l,u=0,c=0,h=0,A=0;if(l=D,D=D+64|0,o=l,a=l+56|0,!(!0&134217728==(2013265920&(t|=0))&!0&134217728==(2013265920&(r|=0))))return D=l,0|(s=5);if((0|(e|=0))==(0|(n|=0))&(0|t)==(0|r))return i[s>>2]=0,D=l,0|(s=0);if(c=0|on(0|e,0|t,52),S(),c&=15,A=0|on(0|n,0|r,52),S(),(0|c)!=(15&A))return D=l,0|(s=12);if(u=c+-1|0,c>>>0>1){Ve(e,t,u,o),Ve(n,r,u,a),h=0|i[(A=o)>>2],A=0|i[A+4>>2];e:do{if((0|h)==(0|i[a>>2])&&(0|A)==(0|i[a+4>>2])){u=0|on(0|e,0|t,0|(c=3*(15^c)|0)),S(),u&=7,c=0|on(0|n,0|r,0|c),S(),c&=7;do{if(!(0|u)|!(0|c))i[s>>2]=1,u=0;else if(7==(0|u))u=5;else{if(1==(0|u)|1==(0|c)&&0|Ge(h,A)){u=5;break}if((0|i[15536+(u<<2)>>2])!=(0|c)&&(0|i[15568+(u<<2)>>2])!=(0|c))break e;i[s>>2]=1,u=0}}while(0);return D=l,0|(s=u)}}while(0)}c=(u=o)+56|0;do{i[u>>2]=0,u=u+4|0}while((0|u)<(0|c));return L(e,t,1,o),u=(0|i[(t=o)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+8|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+16|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+24|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+32|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)||(0|i[(t=o+40|0)>>2])==(0|n)&&(0|i[t+4>>2])==(0|r)?1:1&((0|i[(u=o+48|0)>>2])==(0|n)?(0|i[u+4>>2])==(0|r):0),i[s>>2]=u,D=l,0|(s=0)},_bitshift64Ashr:an,_bitshift64Lshr:on,_bitshift64Shl:ln,_calloc:$t,_cellAreaKm2:function(e,t,n){return 0|(e=0|pt(e|=0,t|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475),0|e},_cellAreaM2:function(e,t,n){return 0|(e=0|pt(e|=0,t|=0,n|=0))||(s[n>>3]=6371.007180918475*+s[n>>3]*6371.007180918475*1e3*1e3),0|e},_cellAreaRads2:pt,_cellToBoundary:nt,_cellToCenterChild:He,_cellToChildPos:function(e,t,n,r){n|=0,r|=0;var s,a=0,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0;if(s=D,D=D+16|0,_=s,v=0|on(0|(e|=0),0|(t|=0),52),S(),v&=15,n>>>0>15)return D=s,0|(v=4);if((0|v)<(0|n))return D=s,0|(v=12);if((0|v)!=(0|n))if(o=0|ln(0|n,0,52),o|=e,u=S()|-15728641&t,(0|v)>(0|n)){c=n;do{g=0|ln(7,0,3*(14-c|0)|0),c=c+1|0,o|=g,u=0|S()|u}while((0|c)<(0|v));g=o}else g=o;else g=e,u=t;m=0|on(0|g,0|u,45),S();e:do{if(0|q(127&m)){if(c=0|on(0|g,0|u,52),S(),0|(c&=15))for(o=1;;){if(!(!((m=0|ln(7,0,3*(15-o|0)|0))&g|0)&!((0|S())&u))){h=33;break e}if(!(o>>>0<c>>>0))break;o=o+1|0}if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|v)>(0|n)){for(m=-15728641&t,f=v;;){if(p=f,(f=f+-1|0)>>>0>15|(0|v)<(0|f)){h=19;break}if((0|v)!=(0|f))if(o=0|ln(0|f,0,52),o|=e,c=0|S()|m,(0|v)<(0|p))d=o;else{h=f;do{d=0|ln(7,0,3*(14-h|0)|0),h=h+1|0,o|=d,c=0|S()|c}while((0|h)<(0|v));d=o}else d=e,c=t;if(A=0|on(0|d,0|c,45),S(),0|q(127&A)){A=0|on(0|d,0|c,52),S(),A&=15;t:do{if(A)for(h=1;;){if(o=0|on(0|d,0|c,3*(15-h|0)|0),S(),0|(o&=7))break t;if(!(h>>>0<A>>>0)){o=0;break}h=h+1|0}else o=0}while(0);o=1&!(0|o)}else o=0;if(c=0|on(0|e,0|t,3*(15-p|0)|0),S(),7==(0|(c&=7))){a=5,h=42;break}if(1==(0|c)&(o=!!(0|o))){a=5,h=42;break}if(0|(d=c+((!!(0|c)&o)<<31>>31)|0)&&(h=0|bt(7,0,h=v-p|0,((0|h)<0)<<31>>31),A=0|S(),o?(o=0|Kt(0|(o=0|nn(0|h,0|A,5,0)),0|S(),-5,-1),o=0|Kt(0|(o=0|tn(0|o,0|S(),6,0)),0|S(),1,0),c=0|S()):(o=h,c=A),p=0|Kt(0|o,0|c,0|(p=0|nn(0|h,0|A,0|(p=d+-1|0),((0|p)<0)<<31>>31)),0|S()),A=0|Kt(0|p,0|(d=0|S()),0|i[(A=r)>>2],0|i[A+4>>2]),d=0|S(),i[(p=r)>>2]=A,i[p+4>>2]=d),(0|f)<=(0|n)){h=37;break}}if(19==(0|h))M(27795,27122,1276,27158);else{if(37==(0|h)){a=0|i[(l=r)+4>>2],l=0|i[l>>2];break}if(42==(0|h))return D=s,0|a}}else a=0,l=0}else h=33}while(0);e:do{if(33==(0|h)){if(i[(m=r)>>2]=0,i[m+4>>2]=0,(0|v)>(0|n)){for(o=v;;){if(a=0|on(0|e,0|t,3*(15-o|0)|0),S(),7==(0|(a&=7))){a=5;break}if(a=0|nn(0|(l=0|bt(7,0,l=v-o|0,((0|l)<0)<<31>>31)),0|S(),0|a,0),l=0|S(),l=0|Kt(0|i[(m=r)>>2],0|i[m+4>>2],0|a,0|l),a=0|S(),i[(m=r)>>2]=l,i[m+4>>2]=a,(0|(o=o+-1|0))<=(0|n))break e}return D=s,0|a}a=0,l=0}}while(0);return 0|ze(g,u,v,_)&&M(27795,27122,1236,27173),((0|a)>-1|-1==(0|a)&l>>>0>4294967295)&((0|(_=0|i[(v=_)+4>>2]))>(0|a)|((0|_)==(0|a)?(0|i[v>>2])>>>0>l>>>0:0))?(D=s,0|(v=0)):(M(27795,27122,1316,27158),0)},_cellToChildren:function(e,t,n,r){r|=0;var s,a,o=0,l=0;if(a=D,D=D+16|0,it(s=a,e|=0,t|=0,n|=0),!(0|(e=0|i[(t=s)>>2]))&!(0|(t=0|i[t+4>>2])))return D=a,0;o=0,n=0;do{i[(l=r+(o<<3)|0)>>2]=e,i[l+4>>2]=t,o=0|Kt(0|o,0|n,1,0),n=0|S(),at(s),e=0|i[(l=s)>>2],t=0|i[l+4>>2]}while(!(!(0|e)&!(0|t)));return D=a,0},_cellToChildrenSize:ze,_cellToLatLng:tt,_cellToLocalIj:function(e,t,n,r,i,s){var a,o;return e|=0,s|=0,o=D,D=D+16|0,a=o,(i|=0)?e=15:(e=0|yt(e,t|=0,n|=0,r|=0,a))||(Te(a,s),e=0),D=o,0|e},_cellToParent:Ve,_cellToVertex:kt,_cellToVertexes:function(e,t,n){n|=0;var r,s=0,a=0;return a=!(0|Ge(e|=0,t|=0)),r=!(0|(s=0|kt(e,t,0,n))),a?r?0|(s=0|kt(e,t,1,n+8|0))||0|(s=0|kt(e,t,2,n+16|0))||0|(s=0|kt(e,t,3,n+24|0))||(s=0|kt(e,t,4,n+32|0))?0|(a=s):0|kt(e,t,5,n+40|0):0|(a=s):r?0|(s=0|kt(e,t,1,n+8|0))||0|(s=0|kt(e,t,2,n+16|0))||0|(s=0|kt(e,t,3,n+24|0))||0|(s=0|kt(e,t,4,n+32|0))?0|(a=s):(i[(a=n+40|0)>>2]=0,i[a+4>>2]=0,0|(a=0)):0|(a=s)},_cellsToDirectedEdge:function(e,t,n,r,s){return s|=0,7==(0|(n=0|F(e|=0,t|=0,n|=0,r|=0)))?0|(s=11):(r=0|ln(0|n,0,56),t=-2130706433&t|S()|268435456,i[s>>2]=e|r,i[s+4>>2]=t,0|(s=0))},_cellsToLinkedMultiPolygon:function(e,t,n){n|=0;var r,s,a,o=0;if(a=D,D=D+32|0,r=a,e=0|function(e,t,n){e|=0,n|=0;var r,s,a=0,o=0,l=0,u=0,c=0,h=0;if(s=D,D=D+176|0,r=s,(0|(t|=0))<1)return qt(n,0,0),D=s,0;for(c=0|on(0|i[(c=e)>>2],0|i[c+4>>2],52),S(),qt(n,(0|t)>6?t:6,15&c),c=0;!(0|(a=0|nt(0|i[(a=e+(c<<3)|0)>>2],0|i[a+4>>2],r)));){if((0|(a=0|i[r>>2]))>0){u=0;do{l=r+8+(u<<4)|0,(o=0|Ht(n,a=r+8+((0|(u=u+1|0))%(0|a)<<4)|0,l))?Gt(n,o):jt(n,l,a),a=0|i[r>>2]}while((0|u)<(0|a))}if((0|(c=c+1|0))>=(0|t)){a=0,h=13;break}}return 13==(0|h)?(D=s,0|a):(Vt(n),D=s,0|(h=a))}(e|=0,t|=0,s=a+16|0),0|e)return D=a,0|(n=e);if(i[n>>2]=0,i[n+4>>2]=0,i[n+8>>2]=0,0|(e=0|zt(s)))do{t=0|ft(n);do{mt(t,e),o=e+16|0,i[r>>2]=i[o>>2],i[r+4>>2]=i[o+4>>2],i[r+8>>2]=i[o+8>>2],i[r+12>>2]=i[o+12>>2],Gt(s,e),e=0|Wt(s,r)}while(0|e);e=0|zt(s)}while(0|e);return Vt(s),(e=0|_t(n))?(gt(n),D=a,0|(o=e)):(D=a,0|(o=0))},_childPosToCell:function(e,t,n,r,s,a){e|=0,t|=0,a|=0;var o,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0;if(o=D,D=D+16|0,l=o,(s|=0)>>>0>15)return D=o,0|(a=4);if(u=0|on(0|(n|=0),0|(r|=0),52),S(),(0|(u&=15))>(0|s))return D=o,0|(a=12);if(0|ze(n,r,s,l)&&M(27795,27122,1236,27173),!(((0|t)>-1|-1==(0|t)&e>>>0>4294967295)&((0|(h=0|i[(A=l)+4>>2]))>(0|t)|((0|h)==(0|t)?(0|i[A>>2])>>>0>e>>>0:0))))return D=o,0|(a=2);A=s-u|0,s=0|ln(0|s,0,52),c=S()|-15728641&r,i[(h=a)>>2]=s|n,i[h+4>>2]=c,h=0|on(0|n,0|r,45),S();
vendor: 4,910 bytes, line 1
1e:do{if(0|q(127&h)){if(0|u)for(l=1;;){if(!(!((h=0|ln(7,0,3*(15-l|0)|0))&n|0)&!((0|S())&r)))break e;if(!(l>>>0<u>>>0))break;l=l+1|0}if((0|A)<1)return D=o,0|(a=0);for(h=15^u,r=-1,c=1,l=1;;){u=0|bt(7,0,u=A-c|0,((0|u)<0)<<31>>31),n=0|S();do{if(l){if(l=0|tn(0|(l=0|Kt(0|(l=0|nn(0|u,0|n,5,0)),0|S(),-5,-1)),0|S(),6,0),(0|t)>(0|(s=0|S()))|(0|t)==(0|s)&e>>>0>l>>>0){t=0|Zt(0|(t=0|Kt(0|e,0|t,-1,-1)),0|S(),0|l,0|s),l=0|S(),f=0|i[(d=a)>>2],d=0|i[d+4>>2],p=0|ln(7,0,0|(m=3*(h+r|0)|0)),d&=~S(),m=0|ln(0|(s=0|Kt(0|(r=0|tn(0|t,0|l,0|u,0|n)),0|(e=0|S()),2,0)),0|S(),0|m),d=0|S()|d,i[(s=a)>>2]=m|f&~p,i[s+4>>2]=d,e=0|Zt(0|t,0|l,0|(e=0|nn(0|r,0|e,0|u,0|n)),0|S()),l=0,t=0|S();break}p=0|i[(m=a)>>2],m=0|i[m+4>>2],f=0|ln(7,0,3*(h+r|0)|0),m&=~S(),i[(l=a)>>2]=p&~f,i[l+4>>2]=m,l=1;break}s=0|i[(p=a)>>2],p=0|i[p+4>>2],d=0|ln(7,0,0|(r=3*(h+r|0)|0)),p&=~S(),r=0|ln(0|(m=0|tn(0|e,0|t,0|u,0|n)),0|(l=0|S()),0|r),p=0|S()|p,i[(f=a)>>2]=r|s&~d,i[f+4>>2]=p,e=0|Zt(0|e,0|t,0|(l=0|nn(0|m,0|l,0|u,0|n)),0|S()),l=0,t=0|S()}while(0);if(!((0|A)>(0|c))){t=0;break}r=~c,c=c+1|0}return D=o,0|t}}while(0);if((0|A)<1)return D=o,0|(m=0);for(s=15^u,l=1;;){if(f=0|bt(7,0,f=A-l|0,((0|f)<0)<<31>>31),m=0|S(),n=0|i[(c=a)>>2],c=0|i[c+4>>2],r=0|ln(7,0,0|(u=3*(s-l|0)|0)),c&=~S(),u=0|ln(0|(d=0|tn(0|e,0|t,0|f,0|m)),0|(p=0|S()),0|u),c=0|S()|c,i[(h=a)>>2]=u|n&~r,i[h+4>>2]=c,e=0|Zt(0|e,0|t,0|(m=0|nn(0|d,0|p,0|f,0|m)),0|S()),t=0|S(),(0|A)<=(0|l)){t=0;break}l=l+1|0}return D=o,0|t},_compactCells:function(e,t,n,r){t|=0;var s,a=0,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0,w=0,T=0,E=0,C=0,R=0,N=0,P=0,D=0;if(!(0|(n|=0))&!(0|(r|=0)))return 0|(D=0);if(o=0|i[(a=e|=0)>>2],!0&!(15728640&(a=0|i[a+4>>2]))){if(!((0|r)>0|!(0|r)&n>>>0>0))return 0|(D=0);if(i[(D=t)>>2]=o,i[D+4>>2]=a,1==(0|n)&!(0|r))return 0|(D=0);a=1,o=0;do{P=0|i[4+(N=e+(a<<3)|0)>>2],i[(D=t+(a<<3)|0)>>2]=i[N>>2],i[D+4>>2]=P,a=0|Kt(0|a,0|o,1,0),o=0|S()}while((0|o)<(0|r)|(0|o)==(0|r)&a>>>0<n>>>0);return 0|(a=0)}if(!(P=0|Qt(s=n<<3)))return 0|(D=13);if(dn(0|P,0|e,0|s),!(N=0|$t(n,8)))return Yt(P),0|(D=13);e:for(;;){C=0|on(0|(h=0|i[(a=P)>>2]),0|(a=0|i[a+4>>2]),52),S(),R=(C&=15)-1|0,E=!!(0|C),T=(0|r)>0|!(0|r)&n>>>0>0;t:do{if(E&T){if(y=0|ln(0|R,0,52),x=0|S(),R>>>0>15){if(!(!(0|h)&!(0|a))){D=16;break e}for(o=0,e=0;;){if(o=0|Kt(0|o,0|e,1,0),!((0|(e=0|S()))<(0|r)|(0|e)==(0|r)&o>>>0<n>>>0))break t;if(!(!(0|(w=0|i[(l=P+(o<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2])))){a=l,D=16;break e}}}for(u=h,e=a,o=0,l=0;;){if(!(!(0|u)&!(0|e))){if(!(!0&!(117440512&e))){D=21;break e}if(A=0|on(0|u,0|e,52),S(),(0|(A&=15))<(0|R)){a=12,D=27;break e}if((0|A)!=(0|R)&&(u|=y,e=-15728641&e|x,A>>>0>=C>>>0)){c=R;do{w=0|ln(7,0,3*(14-c|0)|0),c=c+1|0,u|=w,e=0|S()|e}while(c>>>0<A>>>0)}if(p=0|sn(0|u,0|e,0|n,0|r),f=0|S(),!(!(0|(d=0|i[(A=c=N+(p<<3)|0)>>2]))&!(0|(A=0|i[A+4>>2])))){_=0,v=0;do{if((0|_)>(0|r)|(0|_)==(0|r)&v>>>0>n>>>0){D=31;break e}if((0|d)==(0|u)&(-117440513&A)==(0|e)){m=0|on(0|d,0|A,56),S(),g=1+(m&=7)|0,w=0|on(0|d,0|A,45),S();n:do{if(0|q(127&w)){if(d=0|on(0|d,0|A,52),S(),!(d&=15)){A=6;break}for(A=1;;){if(!(!((w=0|ln(7,0,3*(15-A|0)|0))&u|0)&!((0|S())&e))){A=7;break n}if(!(A>>>0<d>>>0)){A=6;break}A=A+1|0}}else A=7}while(0);if((m+2|0)>>>0>A>>>0){D=41;break e}w=0|ln(0|g,0,56),e=S()|-117440513&e,i[(b=c)>>2]=0,i[b+4>>2]=0,u|=w}else p=0|rn(0|(p=0|Kt(0|p,0|f,1,0)),0|S(),0|n,0|r),f=0|S();v=0|Kt(0|v,0|_,1,0),_=0|S(),d=0|i[(A=c=N+(p<<3)|0)>>2],A=0|i[A+4>>2]}while(!(!(0|d)&!(0|A)))}i[(w=c)>>2]=u,i[w+4>>2]=e}if(o=0|Kt(0|o,0|l,1,0),!((0|(l=0|S()))<(0|r)|(0|l)==(0|r)&o>>>0<n>>>0))break t;u=0|i[(e=P+(o<<3)|0)>>2],e=0|i[e+4>>2]}}}while(0);if(w=0|Kt(0|n,0|r,5,0),(b=0|S())>>>0<0|!(0|b)&w>>>0<11){D=85;break}if(w=0|tn(0|n,0|r,6,0),S(),!(w=0|$t(w,8))){D=48;break}do{if(T){for(g=0,e=0,m=0,_=0;;){if(!(0|(o=0|i[(l=A=N+(g<<3)|0)>>2]))&!(0|(l=0|i[l+4>>2])))b=m;else{d=0|on(0|o,0|l,56),S(),u=1+(d&=7)|0,p=-117440513&l,b=0|on(0|o,0|l,45),S();t:do{if(0|q(127&b)){if(f=0|on(0|o,0|l,52),S(),0|(f&=15))for(c=1;;){if(!(!(o&(b=0|ln(7,0,3*(15-c|0)|0))|0)&!(p&(0|S()))))break t;if(!(c>>>0<f>>>0))break;c=c+1|0}o|=l=0|ln(0|u,0,56),l=0|S()|p,i[(u=A)>>2]=o,i[u+4>>2]=l,u=d+2|0}}while(0);7==(0|u)?(i[(b=w+(e<<3)|0)>>2]=o,i[b+4>>2]=-117440513&l,e=0|Kt(0|e,0|m,1,0),b=0|S()):b=m}if(g=0|Kt(0|g,0|_,1,0),!((0|(_=0|S()))<(0|r)|(0|_)==(0|r)&g>>>0<n>>>0))break;m=b}if(T){if(v=R>>>0>15,y=0|ln(0|R,0,52),x=0|S(),!E){for(o=0,c=0,u=0,l=0;!(0|h)&!(0|a)||(i[(R=t+(o<<3)|0)>>2]=h,i[R+4>>2]=a,o=0|Kt(0|o,0|c,1,0),c=0|S()),u=0|Kt(0|u,0|l,1,0),(0|(l=0|S()))<(0|r)|(0|l)==(0|r)&u>>>0<n>>>0;)h=0|i[(a=P+(u<<3)|0)>>2],a=0|i[a+4>>2];a=b;break}for(o=0,c=0,l=0,u=0;;){do{if(!(!(0|h)&!(0|a))){if(f=0|on(0|h,0|a,52),S(),v|(0|(f&=15))<(0|R)){D=80;break e}if((0|f)!=(0|R)){if(A=h|y,d=-15728641&a|x,f>>>0>=C>>>0){p=R;do{E=0|ln(7,0,3*(14-p|0)|0),p=p+1|0,A|=E,d=0|S()|d}while(p>>>0<f>>>0)}}else A=h,d=a;m=0|sn(0|A,0|d,0|n,0|r),p=0,f=0,_=0|S();do{if((0|p)>(0|r)|(0|p)==(0|r)&f>>>0>n>>>0){D=81;break e}if((-117440513&(g=0|i[4+(E=N+(m<<3)|0)>>2]))==(0|d)&&(0|i[E>>
vendor: 22,057 bytes, line 1
12])==(0|A)){D=65;break}m=0|rn(0|(E=0|Kt(0|m,0|_,1,0)),0|S(),0|n,0|r),_=0|S(),f=0|Kt(0|f,0|p,1,0),p=0|S(),E=N+(m<<3)|0}while((0|i[E>>2])!=(0|A)||(0|i[E+4>>2])!=(0|d));if(65==(0|D)&&(D=0,!0&100663296==(117440512&g)))break;i[(E=t+(o<<3)|0)>>2]=h,i[E+4>>2]=a,o=0|Kt(0|o,0|c,1,0),c=0|S()}}while(0);if(l=0|Kt(0|l,0|u,1,0),!((0|(u=0|S()))<(0|r)|(0|u)==(0|r)&l>>>0<n>>>0))break;h=0|i[(a=P+(l<<3)|0)>>2],a=0|i[a+4>>2]}a=b}else o=0,a=b}else o=0,e=0,a=0}while(0);if(pn(0|N,0,0|s),dn(0|P,0|w,e<<3),Yt(w),!(0|e)&!(0|a)){D=89;break}t=t+(o<<3)|0,r=a,n=e}if(16==(0|D))!0&!(117440512&a)?(a=4,D=27):D=21;else if(31==(0|D))M(27795,27122,529,27132);else{if(41==(0|D))return Yt(P),Yt(N),0|(D=10);if(48==(0|D))return Yt(P),Yt(N),0|(D=13);80==(0|D)?M(27795,27122,620,27132):81==(0|D)?M(27795,27122,632,27132):85==(0|D)&&(dn(0|t,0|P,n<<3),D=89)}return 21==(0|D)?(Yt(P),Yt(N),0|(D=5)):27==(0|D)?(Yt(P),Yt(N),0|(D=a)):89==(0|D)?(Yt(P),Yt(N),0|(D=0)):0},_destroyLinkedMultiPolygon:gt,_directedEdgeToBoundary:Ce,_directedEdgeToCells:function(e,t,n){e|=0;var r,s,a,o=0;return r=D,D=D+16|0,o=r,!0&268435456==(2013265920&(t|=0))?(s=-2130706433&t|134217728,i[(a=n|=0)>>2]=e,i[a+4>>2]=s,i[o>>2]=0,t=0|on(0|e,0|t,56),S(),o=0|U(e,s,7&t,o,n+8|0),D=r,0|o):(D=r,0|(o=6))},_edgeLengthKm:function(e,t,n){n|=0;var r,a=0,o=0,l=0,u=0,h=0,p=0,f=0;if(r=D,D=D+176|0,0|(e=0|Ce(e|=0,t|=0,u=r)))return u=e,l=+s[n>>3],l*=6371.007180918475,s[n>>3]=l,D=r,0|u;if(s[n>>3]=0,(0|(e=0|i[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,s[n>>3]=l,D=r,0|u;t=e+-1|0,e=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((e=e+1|0)<<4)>>3],f=+d(.5*(a-p)),h=o,o=+s[u+8+(e<<4)+8>>3],h=f*f+(h=+d(.5*(o-h)))*(+A(+p)*+A(+a)*h),l+=2*+_(+ +c(+h),+ +c(+(1-h)))}while((0|e)!=(0|t));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,s[n>>3]=f,D=r,0|u},_edgeLengthM:function(e,t,n){n|=0;var r,a=0,o=0,l=0,u=0,h=0,p=0,f=0;if(r=D,D=D+176|0,0|(e=0|Ce(e|=0,t|=0,u=r)))return u=e,l=+s[n>>3],l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=r,0|u;if(s[n>>3]=0,(0|(e=0|i[u>>2]))<=1)return u=0,l=0,l*=6371.007180918475,l*=1e3,s[n>>3]=l,D=r,0|u;t=e+-1|0,e=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((e=e+1|0)<<4)>>3],f=+d(.5*(a-p)),h=o,o=+s[u+8+(e<<4)+8>>3],h=f*f+(h=+d(.5*(o-h)))*(+A(+p)*+A(+a)*h),l+=2*+_(+ +c(+h),+ +c(+(1-h)))}while((0|e)!=(0|t));return s[n>>3]=l,u=0,f=l,f*=6371.007180918475,f*=1e3,s[n>>3]=f,D=r,0|u},_edgeLengthRads:function(e,t,n){n|=0;var r,a=0,o=0,l=0,u=0,h=0,p=0,f=0;if(r=D,D=D+176|0,0|(e=0|Ce(e|=0,t|=0,u=r)))return D=r,0|(u=e);if(s[n>>3]=0,(0|(e=0|i[u>>2]))<=1)return D=r,0|(u=0);t=e+-1|0,e=0,a=+s[u+8>>3],o=+s[u+16>>3],l=0;do{p=a,a=+s[u+8+((e=e+1|0)<<4)>>3],f=+d(.5*(a-p)),h=o,o=+s[u+8+(e<<4)+8>>3],h=f*f+(h=+d(.5*(o-h)))*(+A(+a)*+A(+p)*h),l+=2*+_(+ +c(+h),+ +c(+(1-h)))}while((0|e)<(0|t));return s[n>>3]=l,D=r,0|(u=0)},_emscripten_replace_memory:function(e){return r=new Int8Array(e),i=new Int32Array(e),s=new Float64Array(e),n=e,!0},_free:Yt,_getBaseCellNumber:Fe,_getDirectedEdgeDestination:function(e,t,n){e|=0,t|=0,n|=0;var r,s,a=0;return r=D,D=D+16|0,i[(a=r)>>2]=0,!0&268435456==(2013265920&t)?(s=0|on(0|e,0|t,56),S(),a=0|U(e,-2130706433&t|134217728,7&s,a,n),D=r,0|a):(D=r,0|(a=6))},_getDirectedEdgeOrigin:function(e,t,n){return e|=0,n|=0,!0&268435456==(2013265920&(t|=0))?(i[n>>2]=e,i[n+4>>2]=-2130706433&t|134217728,0|(n=0)):0|(n=6)},_getHexagonAreaAvgKm2:ht,_getHexagonAreaAvgM2:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20784+(e<<3)>>3],0|(t=0))},_getHexagonEdgeLengthAvgKm:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[20912+(e<<3)>>3],0|(t=0))},_getHexagonEdgeLengthAvgM:function(e,t){return t|=0,(e|=0)>>>0>15?0|(t=4):(s[t>>3]=+s[21040+(e<<3)>>3],0|(t=0))},_getIcosahedronFaces:function e(t,n,r){r|=0;var s,a=0,o=0,l=0,u=0,c=0,h=0,A=0,d=0;s=D,D=D+128|0,A=s+112|0,l=s+96|0,d=s,o=0|on(0|(t|=0),0|(n|=0),52),S(),c=15&o,i[A>>2]=c,u=0|on(0|t,0|n,45),S(),u&=127;e:do{if(0|q(u)){if(0|c)for(a=1;;){if(!(!((h=0|ln(7,0,3*(15-a|0)|0))&t|0)&!((0|S())&n))){o=0;break e}if(!(a>>>0<c>>>0))break;a=a+1|0}if(!(1&o))return h=0|ln(c+1|0,0,52),d=S()|-15728641&n,d=0|e((h|t)&~(A=0|ln(7,0,3*(14-c|0)|0)),d&~S(),r),D=s,0|d;o=1}else o=0}while(0);if(!(a=0|et(t,n,l))){o?(Le(l,A,d),h=5):(Ue(l,A,d),h=6);e:do{if(0|q(u))if(c)for(a=1;;){if(!(!((u=0|ln(7,0,3*(15-a|0)|0))&t|0)&!((0|S())&n))){t=2;break e}if(!(a>>>0<c>>>0)){t=5;break}a=a+1|0}else t=5;else t=2}while(0);pn(0|r,-1,t<<2);e:do{if(o)for(l=0;;){if(Oe(u=d+(l<<4)|0,0|i[A>>2]),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))a=r;else{o=0;do{if((o=o+1|0)>>>0>=t>>>0){a=1;break e}c=0|i[(a=r+(o<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[a>>2]=u,(l=l+1|0)>>>0>=h>>>0){a=0;break}}else for(l=0;;){if(Ie(u=d+(l<<4)|0,0|i[A>>2],0,1),u=0|i[u>>2],-1==(0|(c=0|i[r>>2]))|(0|c)==(0|u))a=r;else{o=0;do{if((o=o+1|0)>>>0>=t>>>0){a=1;break e}c=0|i[(a=r+(o<<2)|0)>>2]}while(!(-1==(0|c)|(0|c)==(0|u)))}if(i[a>>2]=u,(l=l+1|0)>>>0>=h>>>0){a=0;break}}}while(0)}return D=s,0|(d=a)},_getNumCells:At,_getPentagons:rt,_getRes0Cells:function(e){e|=0;var t=0,n=0,r=0;t=0;do{ln(0|t,0,45),r=134225919|S(),i[(n=e+(t<<3)|0)>>2]=-1,i[n+4>>2]=r,t=t+1|0}while(122!=(0|t));return 0},_getResolution:function(e,t){return t=0|on(0|(e|=0),0|(t|=0),52),S(),15&t},_greatCircleDistanceKm:ct,_greatCircleDistanceM:function(e,t){e|=0;var n,r,i,a=0;return r=+s[(t|=0)>>3],n=+s[e>>3],a=(i=+d(.5*(r-n)))*i+(a=+d(.5*(+s[t+8>>3]-+s[e+8>>3])))*(+A(+r)*+A(+n)*a),2*+_(+ +c(+a),+ +c(+(1-a)))*6371.007180918475*1e3},_greatCircleDistanceRads:function(e,t){e|=0;var n,r,i,a=0;return r=+s[(t|=0)>>3],n=+s[e>>3],a=(i=+d(.5*(r-n)))*i+(a=+d(.5*(+s[t+8>>3]-+s[e+8>>3])))*(+A(+r)*+A(+n)*a),2*+_(+ +c(+a),+ +c(+(1-a)))},_gridDisk:L,_gridDiskDistances:I,_gridDistance:function(e,t,n,r,s){n|=0,r|=0,s|=0;var a,o,l=0,u=0;return o=D,D=D+32|0,u=o,0|(a=0|yt(e|=0,t|=0,e,t,l=o+12|0))?(D=o,0|(u=a)):0|(e=0|yt(e,t,n,r,u))?(D=o,0|(u=e)):(l=0|we(l,u),i[(u=s)>>2]=l,i[u+4>>2]=((0|l)<0)<<31>>31,D=o,0|(u=0))},_gridPathCells:function(e,t,n,r,s){n|=0,r|=0,s|=0;var a,o,l=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0,w=0,T=0,E=0,C=0;if(o=D,D=D+48|0,c=o+12|0,E=o,!(l=0|yt(e|=0,t|=0,e,t,a=o+24|0))&&!(l=0|yt(e,t,n,r,c))){T=((0|(w=0|we(a,c)))<0)<<31>>31,i[a>>2]=0,i[a+4>>2]=0,i[a+8>>2]=0,i[c>>2]=0,i[c+4>>2]=0,i[c+8>>2]=0,0|yt(e,t,e,t,a)&&M(27795,27538,692,27747),0|yt(e,t,n,r,c)&&M(27795,27538,697,27747),Me(a),Me(c),p=0|w?1/+(0|w):0,n=0|i[a>>2],v=p*+((0|i[c>>2])-n|0),r=0|i[(y=a+4|0)>>2],x=p*+((0|i[c+4>>2])-r|0),l=0|i[(b=a+8|0)>>2],p*=+((0|i[c+8>>2])-l|0),i[E>>2]=n,i[(f=E+4|0)>>2]=r,i[(m=E+8|0)>>2]=l;e:do{if((0|w)<0)l=0;else for(g=0,_=0;;){C=v*(A=+(_>>>0)+4294967296*+(0|g))+ +(0|n),h=x*A+ +(0|r),A=p*A+ +(0|l),n=~~+An(+C),c=~~+An(+h),l=~~+An(+A),C=+u(+(+(0|n)-C)),h=+u(+(+(0|c)-h)),A=+u(+(+(0|l)-A));do{if(!(C>h&C>A)){if(d=0-n|0,h>A){r=d-l|0;break}r=c,l=d-c|0;break}n=0-(c+l)|0,r=c}while(0);if(i[E>>2]=n,i[f>>2]=r,i[m>>2]=l,Ee(E),0|(l=0|xt(e,t,E,s+(_<<3)|0)))break e;if(!((0|g)<(0|T)|(0|g)==(0|T)&_>>>0<w>>>0)){l=0;break e}n=0|Kt(0|_,0|g,1,0),g=r=0|S(),_=n,n=0|i[a>>2],r=0|i[y>>2],l=0|i[b>>2]}}while(0);return D=o,0|(E=l)}return D=o,0|(E=l)},_gridPathCellsSize:function(e,t,n,r,s){n|=0,r|=0,s|=0;var a,o=0,l=0,u=0;return a=D,D=D+32|0,u=a,(o=0|yt(e|=0,t|=0,e,t,l=a+12|0))||(o=0|yt(e,t,n,r,u))?(D=a,0|(u=o)):(r=0|Kt(0|(r=0|we(l,u)),((0|r)<0)<<31>>31,1,0),l=0|S(),i[(u=s)>>2]=r,i[u+4>>2]=l,D=a,0|(u=0))},_gridRingUnsafe:function(e,t,n,r){e|=0,t|=0,n|=0,r|=0;var s,a,o=0,l=0,u=0,c=0,h=0,A=0,d=0,p=0,f=0;if(a=D,D=D+16|0,f=a+8|0,i[(p=s=a)>>2]=e,i[p+4>>2]=t,!n)return i[(f=r)>>2]=e,i[f+4>>2]=t,D=a,0|(f=0);i[f>>2]=0;e:do{if(0|Ge(e,t))e=9;else{if(l=(0|n)>0){o=0,p=e;do{if(0|(e=0|U(p,t,4,f,s)))break e;if(o=o+1|0,0|Ge(p=0|i[(t=s)>>2],t=0|i[t+4>>2])){e=9;break e}}while((0|o)<(0|n));if(i[(d=r)>>2]=p,i[d+4>>2]=t,d=n+-1|0,l){A=0,e=1;do{if(o=26800+(A<<2)|0,5==(0|A))for(u=0|i[o>>2],l=0,o=e;;){if(0|(e=0|U(0|i[(e=s)>>2],0|i[e+4>>2],u,f,s)))break e;if((0|l)!=(0|d)){if(c=0|i[(h=s)>>2],h=0|i[h+4>>2],i[(e=r+(o<<3)|0)>>2]=c,i[e+4>>2]=h,0|Ge(c,h)){e=9;break e}e=o+1|0}else e=o;if((0|(l=l+1|0))>=(0|n))break;o=e}else for(u=s,h=0|i[o>>2],c=0,o=e,l=0|i[u>>2],u=0|i[u+4>>2];;){if(0|(e=0|U(l,u,h,f,s)))break e;if(l=0|i[(u=s)>>2],u=0|i[u+4>>2],i[(e=r+(o<<3)|0)>>2]=l,i[e+4>>2]=u,e=o+1|0,0|Ge(l,u)){e=9;break e}if((0|(c=c+1|0))>=(0|n))break;o=e}A=A+1|0}while(A>>>0<6);u=p,o=0|i[(e=s)>>2],l=t,e=0|i[e+4>>2]}else u=p,o=p,l=t,e=t}else i[(u=r)>>2]=e,i[u+4>>2]=t,u=e,o=e,l=t,e=t;e=(0|u)==(0|o)&(0|l)==(0|e)?0:9}}while(0);return D=a,0|(f=e)},_i64Add:Kt,_i64Subtract:Zt,_isPentagon:Ge,_isResClassIII:function(e,t){return t=0|on(0|(e|=0),0|(t|=0),52),S(),1&t},_isValidCell:ke,_isValidDirectedEdge:function(e,t){var n=0;switch(n=0|on(0|(e|=0),0|(t|=0),56),S(),7&n){case 0:case 7:return 0|(n=0)}return n=-2130706433&t|134217728,!0&268435456==(2013265920&t)?!0&16777216==(117440512&t)&!!(0|Ge(e,n))?0|(n=0):0|(n=0|ke(e,n)):0|(n=0)},_isValidVertex:function(e,t){e|=0;var n,r,s=0,a=0;return r=D,D=D+16|0,n=r,!0&536870912==(2013265920&(t|=0))&&0|ke(e,s=-2130706433&t|134217728)?(a=0|on(0|e,0|t,56),S(),s=(a=!(0|kt(e,s,7&a,n)))&((0|i[(s=n)>>2])==(0|e)?(0|i[s+4>>2])==(0|t):0)&1,D=r,0|s):(D=r,0|(s=0))},_latLngToCell:Ze,_llvm_ctlz_i64:un,_llvm_maxnum_f64:cn,_llvm_minnum_f64:hn,_llvm_round_f64:An,_localIjToCell:function(e,t,n,r,i){var s,a;return e|=0,t|=0,n|=0,i|=0,a=D,D=D+16|0,s=a,(r|=0)?n=15:(n=0|Se(n,s))||(n=0|xt(e,t,s,i)),D=a,0|n},_malloc:Qt,_maxFaceCount:function(e,t,n){n|=0;var r=0,s=0;if(s=0|on(0|(e|=0),0|(t|=0),45),S(),!(0|q(127&s)))return s=2,i[n>>2]=s,0;if(s=0|on(0|e,0|t,52),S(),!(s&=15))return s=5,i[n>>2]=s,0;for(r=1;;){if(!(!((0|ln(7,0,3*(15-r|0)|0))&e|0)&!((0|S())&t))){r=2,e=6;break}if(!(r>>>0<s>>>0)){r=5,e=6;break}r=r+1|0}return 6==(0|e)?(i[n>>2]=r,0):0},_maxGridDiskSize:function(e,t){t|=0;var n=0,r=0,s=0;return(0|(e|=0))<0?0|(t=2):(0|e)>13780509?0|(t=0|At(15,t)):(s=0|nn(0|e,0|(n=((0|e)<0)<<31>>31),3,0),r=0|S(),n=0|Kt(0|e,0|n,1,0),n=0|Kt(0|(n=0|nn(0|s,0|r,0|n,0|S())),0|S(),1,0),e=0|S(),i[t>>2]=n,i[t+4>>2]=e,0|(t=0))},_maxPolygonToCellsSize:function(e,t,n,r){e|=0,t|=0,r|=0;var s,a=0,o=0,l=0,u=0,c=0;if(s=D,D=D+48|0,a=s+16|0,o=s+8|0,l=s,0|(n=0|Rt(n|=0)))return D=s,0|(l=n);if(u=0|i[(c=e)+4>>2],i[(n=o)>>2]=i[c>>2],i[n+4>>2]=u,Ct(o,a),!(n=0|ee(a,t,l))){if(t=0|i[o>>2],(0|(o=0|i[e+8>>2]))>0){a=0|i[e+12>>2],n=0;do{t=(0|i[a+(n<<3)>>2])+t|0,n=n+1|0}while((0|n)<(0|o))}a=0|i[(n=l)>>2],(0|(n=0|i[n+4>>2]))<(0|(o=((0|t)<0)<<31>>31))|(0|n)==(0|o)&a>>>0<t>>>0?(i[(n=l)>>2]=t,i[n+4>>2]=o,n=o):t=a,u=0|Kt(0|t,0|n,12,0),c=0|S(),i[(n=l)>>2]=u,i[n+4>>2]=c,i[(n=r)>>2]=u,i[n+4>>2]=c,n=0}return D=s,0|(c=n)},_maxPolygonToCellsSizeExperimental:function(e,t,n,a){t|=0,n|=0,a|=0;var o,l,c=0,h=0,d=0,p=0,f=0,m=0,g=0,_=0;if(l=D,D=D+48|0,f=l+32|0,p=l+40|0,o=l,!(0|i[(e|=0)>>2]))return i[(m=a)>>2]=0,i[m+4>>2]=0,D=l,0|(m=0);qe(f,0,0,0),c=0|i[(d=f)>>2],d=0|i[d+4>>2];do{if(t>>>0>15)i[(m=o)>>2]=0,i[m+4>>2]=0,i[o+8>>2]=4,i[o+12>>2]=-1,n=o+29|0,i[(m=o+16|0)>>2]=0,i[m+4>>2]=0,i[m+8>>2]=0,r[m+12|0]=0,r[0|n]=0|r[0|p],r[n+1|0]=0|r[p+1|0],r[n+2|0]=0|r[p+2|0],n=4,m=9;else{if(0|(n=0|Rt(n))){i[(f=o)>>2]=0,i[f+4>>2]=0,i[o+8>>2]=n,i[o+12>>2]=-1,m=o+29|0,i[(f=o+16|0)>>2]=0,i[f+4>>2]=0,i[f+8>>2]=0,r[f+12|0]=0,r[0|m]=0|r[0|p],r[m+1|0]=0|r[p+1|0],r[m+2|0]=0|r[p+2|0],m=9;break}if(!(n=0|$t(1+(0|i[e+8>>2])|0,32))){i[(m=o)>>2]=0,i[m+4>>2]=0,i[o+8>>2]=13,i[o+12>>2]=-1,n=o+29|0,i[(m=o+16|0)>>2]=0,i[m+4>>2]=0,i[m+8>>2]=0,r[m+12|0]=0,r[0|n]=0|r[0|p],r[n+1|0]=0|r[p+1|0],r[n+2|0]=0|r[p+2|0],n=13,m=9;break}Nt(e,n),i[(_=o)>>2]=c,i[_+4>>2]=d,i[(d=o+8|0)>>2]=0,i[o+12>>2]=t,i[o+20>>2]=e,i[o+24>>2]=n,r[o+28|0]=0,r[0|(c=o+29|0)]=0|r[0|p],r[c+1|0]=0|r[p+1|0],r[c+2|0]=0|r[p+2|0],i[o+16>>2]=3,g=+Y(n),g*=+X(n),h=+u(+ +s[n>>3]),h=g/+A(+ +hn(+h,+ +u(+ +s[n+8>>3])))*6371.007180918475*6371.007180918475,n=0|i[(c=o+12|0)>>2];e:do{if((0|n)>0)do{if(ht(n+-1|0,f),!(h/+s[f>>3]>10))break e;n=(_=0|i[c>>2])-1|0,i[c>>2]=n}while((0|_)>1)}while(0);if(St(o),i[(c=a)>>2]=0,i[c+4>>2]=0,!(!(0|(n=0|i[(c=o)>>2]))&!(0|(c=0|i[c+4>>2]))))do{ze(n,c,t,f),p=f,p=0|Kt(0|i[(e=a)>>2],0|i[e+4>>2],0|i[p>>2],0|i[p+4>>2]),e=0|S(),i[(_=a)>>2]=p,i[_+4>>2]=e,St(o),n=0|i[(_=o)>>2],c=0|i[_+4>>2]}while(!(!(0|n)&!(0|c)));n=0|i[d>>2]}}while(0);return D=l,0|(_=n)},_memcpy:dn,_memset:pn,_originToDirectedEdges:function(e,t,n){n|=0;var r,s=0;return r=!(0|Ge(e|=0,t|=0)),t&=-2130706433,i[(s=n)>>2]=r?e:0,i[s+4>>2]=r?285212672|t:0,i[(s=n+8|0)>>2]=e,i[s+4>>2]=301989888|t,i[(s=n+16|0)>>2]=e,i[s+4>>2]=318767104|t,i[(s=n+24|0)>>2]=e,i[s+4>>2]=335544320|t,i[(s=n+32|0)>>2]=e,i[s+4>>2]=352321536|t,i[(n=n+40|0)>>2]=e,i[n+4>>2]=369098752|t,0},_pentagonCount:function(){return 12},_polygonToCells:function(e,t,n,r){e|=0,t|=0,r|=0;var s,a,o,l,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0,_=0,v=0,y=0,x=0,b=0,w=0,T=0,M=0,E=0,C=0,R=0,N=0,P=0,L=0,I=0,U=0,F=0,q=0;if(l=D,D=D+112|0,s=l+80|0,d=l+72|0,a=l,o=l+56|0,0|(u=0|Rt(n|=0)))return D=l,0|(q=u);if(!(q=0|Qt(32+(i[(p=e+8|0)>>2]<<5)|0)))return D=l,0|(q=13);if(Nt(e,q),!(u=0|Rt(n))){if(F=0|i[(U=e)+4>>2],i[(u=d)>>2]=i[U>>2],i[u+4>>2]=F,Ct(d,s),u=0|ee(s,t,a))U=0,F=0;else{if(u=0|i[d>>2],(0|(c=0|i[p>>2]))>0){h=0|i[e+12>>2],n=0;do{u=(0|i[h+(n<<3)>>2])+u|0,n=n+1|0}while((0|n)!=(0|c));n=u}else n=u;c=0|i[(u=a)>>2],(0|(u=0|i[u+4>>2]))<(0|(h=((0|n)<0)<<31>>31))|(0|u)==(0|h)&c>>>0<n>>>0?(i[(u=a)>>2]=n,i[u+4>>2]=h,u=h):n=c,U=0|Kt(0|n,0|u,12,0),F=0|S(),i[(u=a)>>2]=U,i[u+4>>2]=F,u=0}if(!u){if(!(n=0|$t(U,8)))return Yt(q),D=l,0|(q=13);if(!(A=0|$t(U,8)))return Yt(q),Yt(n),D=l,0|(q=13);i[(L=s)>>2]=0,i[L+4>>2]=0,I=0|i[(L=e)+4>>2],i[(u=d)>>2]=i[L>>2],i[u+4>>2]=I,u=0|k(d,U,F,t,s,n,A);e:do{if(u)Yt(n),Yt(A),Yt(q);else{t:do{if((0|i[p>>2])>0){for(h=e+12|0,c=0;u=0|k((0|i[h>>2])+(c<<3)|0,U,F,t,s,n,A),c=c+1|0,!(0|u);)if((0|c)>=(0|i[p>>2]))break t;Yt(n),Yt(A),Yt(q);break e}}while(0);(0|F)>0|!(0|F)&U>>>0>0&&pn(0|A,0,U<<3),L=0|i[(I=s)+4>>2];t:do{if((0|L)>0|!(0|L)&(0|i[I>>2])>>>0>0){R=n,N=A,P=n,L=A,I=n,u=n,M=n,E=A,C=A,n=A;n:for(;;){for(x=0,b=0,w=0,T=0,c=0,h=0;;){d=(A=a)+56|0;do{i[A>>2]=0,A=A+4|0}while((0|A)<(0|d));if(0|O(p=0|i[(t=R+(x<<3)|0)>>2],t=0|i[t+4>>2],1,a,0)){d=(A=a)+56|0;do{i[A>>2]=0,A=A+4|0}while((0|A)<(0|d));0|(A=0|$t(7,4))&&(B(p,t,1,a,A,7,0,0),Yt(A))}for(y=0;;){_=0|i[(v=a+(y<<3)|0)>>2],v=0|i[v+4>>2];r:do{if(!(0|_)&!(0|v))A=c,d=h;else{if(f=0|sn(0|_,0|v,0|U,0|F),p=0|S(),!(!(0|(d=0|i[(t=A=r+(f<<3)|0)>>2]))&!(0|(t=0|i[t+4>>2])))){m=0,g=0;do{if((0|m)>(0|F)|(0|m)==(0|F)&g>>>0>U>>>0)break n;if((0|d)==(0|_)&(0|t)==(0|v)){A=c,d=h;break r}f=0|rn(0|(A=0|Kt(0|f,0|p,1,0)),0|S(),0|U,0|F),p=0|S(),g=0|Kt(0|g,0|m,1,0),m=0|S(),d=0|i[(t=A=r+(f<<3)|0)>>2],t=0|i[t+4>>2]}while(!(!(0|d)&!(0|t)))}if(!(0|_)&!(0|v)){A=c,d=h;break}tt(_,v,o),0|Pt(e,q,o)&&(g=0|Kt(0|c,0|h,1,0),h=0|S(),i[(m=A)>>2]=_,i[m+4>>2]=v,i[(c=N+(c<<3)|0)>>2]=_,i[c+4>>2]=v,c=g),A=c,d=h}}while(0);if((y=y+1|0)>>>0>=7)break;c=A,h=d}if(x=0|Kt(0|x,0|b,1,0),b=0|S(),w=0|Kt(0|w,0|T,1,0),T=0|S(),c=0|i[(h=s)>>2],!((0|T)<(0|(h=0|i[h+4>>2]))|(0|T)==(0|h)&w>>>0<c>>>0))break;c=A,h=d}if((0|h)>0|!(0|h)&c>>>0>0){c=0,h=0;do{i[(T=R+(c<<3)|0)>>2]=0,i[T+4>>2]=0,c=0|Kt(0|c,0|h,1,0),h=0|S(),w=0|i[(T=s)+4>>2]}while((0|h)<(0|w)|((0|h)==(0|w)?c>>>0<(0|i[T>>2])>>>0:0))}if(i[(T=s)>>2]=A,i[T+4>>2]=d,!((0|d)>0|!(0|d)&A>>>0>0))break t;y=n,x=C,b=I,w=E,T=N,n=M,C=u,E=P,M=y,u=x,I=L,L=b,P=w,N=R,R=T}Yt(P),Yt(L),Yt(q),u=1;break e}u=A}while(0);Yt(q),Yt(n),Yt(u),u=0}}while(0);return D=l,0|(q=u)}}return Yt(q),D=l,0|(q=u)},_polygonToCellsExperimental:function(e,t,n,r,s,a){r|=0,s|=0,a|=0;var o,l,u,c=0,h=0,A=0,d=0,p=0,f=0,m=0,g=0;u=D,D=D+160|0,h=u+64|0,p=u+112|0,g=u,Tt(d=u+80|0,e|=0,t|=0,n|=0),it(h,0|i[(A=d)>>2],0|i[A+4>>2],t),o=0|i[(A=h)>>2],A=0|i[A+4>>2],c=0|i[d+8>>2],i[(f=p+4|0)>>2]=i[d>>2],i[f+4>>2]=i[d+4>>2],i[f+8>>2]=i[d+8>>2],i[f+12>>2]=i[d+12>>2],i[f+16>>2]=i[d+16>>2],i[f+20>>2]=i[d+20>>2],i[f+24>>2]=i[d+24>>2],i[f+28>>2]=i[d+28>>2],i[(f=g)>>2]=o,i[f+4>>2]=A,i[(f=g+8|0)>>2]=c,t=p,n=36+(e=g+12|0)|0;do{i[e>>2]=i[t>>2],e=e+4|0,t=t+4|0}while((0|e)<(0|n));if(i[(p=g+48|0)>>2]=i[h>>2],i[p+4>>2]=i[h+4>>2],i[p+8>>2]=i[h+8>>2],i[p+12>>2]=i[h+12>>2],!(0|o)&!(0|A))return D=u,0|(g=c);n=g+16|0,l=g+24|0,d=g+28|0,c=0,h=0,t=o,e=A;do{if(!((0|c)<(0|s)|(0|c)==(0|s)&h>>>0<r>>>0)){m=4;break}if(A=h,h=0|Kt(0|h,0|c,1,0),c=0|S(),i[(A=a+(A<<3)|0)>>2]=t,i[A+4>>2]=e,at(p),!(0|(t=0|i[(e=p)>>2]))&!(0|(e=0|i[e+4>>2]))){if(St(n),!(0|(e=0|i[(t=n)>>2]))&!(0|(t=0|i[t+4>>2]))){m=10;break}st(e,t,0|i[d>>2],p),t=0|i[(e=p)>>2],e=0|i[e+4>>2]}i[(A=g)>>2]=t,i[A+4>>2]=e}while(!(!(0|t)&!(0|e)));return 4==(0|m)?(0|(t=0|i[(e=g+40|0)>>2])&&Yt(t),i[(m=g+16|0)>>2]=0,i[m+4>>2]=0,i[l>>2]=0,i[g+36>>2]=0,i[d>>2]=-1,i[g+32>>2]=0,i[e>>2]=0,st(0,0,0,p),i[g>>2]=0,i[g+4>>2]=0,i[f>>2]=0,D=u,0|(g=14)):(10==(0|m)&&(i[g>>2]=0,i[g+4>>2]=0,i[f>>2]=i[l>>2]),g=0|i[f>>2],D=u,0|g)},_readInt64AsDoubleFromPointer:function(e){return+(+((0|i[(e|=0)>>2])>>>0)+4294967296*+(0|i[e+4>>2]))},_res0CellCount:function(){return 122},_round:fn,_sbrk:mn,_sizeOfCellBoundary:function(){return 168},_sizeOfCoordIJ:function(){return 8},_sizeOfGeoLoop:function(){return 8},_sizeOfGeoPolygon:function(){return 16},_sizeOfH3Index:function(){return 8},_sizeOfLatLng:function(){return 16},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompactCells:function(e,t,n,r,s,a,o){e|=0,r|=0,s|=0,a|=0;var l,u=0,c=0,h=0,A=0,d=0,p=0,f=0,m=0;if(l=D,D=D+16|0,m=l,!((0|(n|=0))>0|!(0|n)&(t|=0)>>>0>0))return D=l,0|(m=0);if((0|(o|=0))>=16)return D=l,0|(m=12);p=0,f=0,d=0,u=0;e:for(;;){if(A=0|on(0|(c=0|i[(h=e+(p<<3)|0)>>2]),0|(h=0|i[h+4>>2]),52),S(),(15&A)>(0|o)){u=12,c=11;break}if(it(m,c,h,o),!(0|(h=0|i[(A=m)>>2]))&!(0|(A=0|i[A+4>>2])))c=d;else{c=d;do{if(!((0|u)<(0|a)|(0|u)==(0|a)&c>>>0<s>>>0)){c=10;break e}i[(d=r+(c<<3)|0)>>2]=h,i[d+4>>2]=A,c=0|Kt(0|c,0|u,1,0),u=0|S(),at(m),h=0|i[(d=m)>>2],A=0|i[d+4>>2]}while(!(!(0|h)&!(0|A)))}if(p=0|Kt(0|p,0|f,1,0),!((0|(f=0|S()))<(0|n)|(0|f)==(0|n)&p>>>0<t>>>0)){u=0,c=11;break}d=c}return 10==(0|c)?(D=l,0|(m=14)):11==(0|c)?(D=l,0|u):0},_uncompactCellsSize:function(e,t,n,r,s){e|=0,t|=0,n|=0,r|=0,s|=0;var a,o,l=0,u=0,c=0,h=0,A=0,d=0;o=D,D=D+16|0,a=o;e:do{if((0|n)>0|!(0|n)&t>>>0>0){for(A=0,u=0,l=0,d=0;;){if(!(!(0|(c=0|i[(h=e+(A<<3)|0)>>2]))&!(0|(h=0|i[h+4>>2]))||(h=!(0|ze(c,h,r,a)),u=0|Kt(0|i[(c=a)>>2],0|i[c+4>>2],0|u,0|l),l=0|S(),h))){l=12;break}if(A=0|Kt(0|A,0|d,1,0),!((0|(d=0|S()))<(0|n)|(0|d)==(0|n)&A>>>0<t>>>0))break e}return D=o,0|l}u=0,l=0}while(0);return i[s>>2]=u,i[s+4>>2]=l,D=o,0|(s=0)},_vertexToLatLng:function(e,t,n){n|=0;var r,s,a,o,l=0,u=0;return o=D,D=D+192|0,s=o,a=o+168|0,l=0|on(0|(e|=0),0|(t|=0),56),S(),l&=7,0|(r=0|et(e,u=-2130706433&t|134217728,a))?(D=o,0|(u=r)):(t=0|on(0|e,0|t,52),S(),t&=15,0|Ge(e,u)?De(a,t,l,1,s):Be(a,t,l,1,s),u=s+8|0,i[n>>2]=i[u>>2],i[n+4>>2]=i[u+4>>2],i[n+8>>2]=i[u+8>>2],i[n+12>>2]=i[u+12>>2],D=o,0|(u=0))},establishStackSpace:function(e,t){D=e|=0},stackAlloc:function(e){var t;return t=D,D=15+(D=D+(e|=0)|0)&-16,0|t},stackRestore:function(e){D=e|=0},stackSave:function(){return 0|D}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},{b:function(e){g=e},c:function(){return g},d:function(e,t,n,r){fe("Assertion failed: "+N(e)+", at: "+[t?N(t):"unknown filename",n,r?N(r):"unknown function"])},e:function(e){return o.___errno_location&&(M[o.___errno_location()>>2]=e),e},f:Z,g:function(e,t,n){T.set(T.subarray(t,t+n),e)},h:function(e){var t=Z(),n=16777216,r=2130706432;if(e>r)return!1;for(var i=Math.max(t,16777216);i<e;)i=i<=536870912?P(2*i,n):Math.min(P((3*i+2147483648)/4,n),r);return!!function(e){try{var t=new ArrayBuffer(e);if(t.byteLength!=e)return;return new Int8Array(t).set(w),re(t),D(t),1}catch(e){}}(i)},i:function(e){fe("OOM")},o:28624,p:28608},b);o.___divdi3=ne.___divdi3,o.___muldi3=ne.___muldi3,o.___remdi3=ne.___remdi3,o.___uremdi3=ne.___uremdi3,o._areNeighborCells=ne._areNeighborCells,o._bitshift64Ashr=ne._bitshift64Ashr,o._bitshift64Lshr=ne._bitshift64Lshr,o._bitshift64Shl=ne._bitshift64Shl,o._calloc=ne._calloc,o._cellAreaKm2=ne._cellAreaKm2,o._cellAreaM2=ne._cellAreaM2,o._cellAreaRads2=ne._cellAreaRads2,o._cellToBoundary=ne._cellToBoundary,o._cellToCenterChild=ne._cellToCenterChild,o._cellToChildPos=ne._cellToChildPos,o._cellToChildren=ne._cellToChildren,o._cellToChildrenSize=ne._cellToChildrenSize,o._cellToLatLng=ne._cellToLatLng,o._cellToLocalIj=ne._cellToLocalIj,o._cellToParent=ne._cellToParent,o._cellToVertex=ne._cellToVertex,o._cellToVertexes=ne._cellToVertexes,o._cellsToDirectedEdge=ne._cellsToDirectedEdge,o._cellsToLinkedMultiPolygon=ne._cellsToLinkedMultiPolygon,o._childPosToCell=ne._childPosToCell,o._compactCells=ne._compactCells,o._destroyLinkedMultiPolygon=ne._destroyLinkedMultiPolygon,o._directedEdgeToBoundary=ne._directedEdgeToBoundary,o._directedEdgeToCells=ne._directedEdgeToCells,o._edgeLengthKm=ne._edgeLengthKm,o._edgeLengthM=ne._edgeLengthM,o._edgeLengthRads=ne._edgeLengthRads;var re=o._emscripten_replace_memory=ne._emscripten_replace_memory;o._free=ne._free,o._getBaseCellNumber=ne._getBaseCellNumber,o._getDirectedEdgeDestination=ne._getDirectedEdgeDestination,o._getDirectedEdgeOrigin=ne._getDirectedEdgeOrigin,o._getHexagonAreaAvgKm2=ne._getHexagonAreaAvgKm2,o._getHexagonAreaAvgM2=ne._getHexagonAreaAvgM2,o._getHexagonEdgeLengthAvgKm=ne._getHexagonEdgeLengthAvgKm,o._getHexagonEdgeLengthAvgM=ne._getHexagonEdgeLengthAvgM,o._getIcosahedronFaces=ne._getIcosahedronFaces,o._getNumCells=ne._getNumCells,o._getPentagons=ne._getPentagons,o._getRes0Cells=ne._getRes0Cells,o._getResolution=ne._getResolution,o._greatCircleDistanceKm=ne._greatCircleDistanceKm,o._greatCircleDistanceM=ne._greatCircleDistanceM,o._greatCircleDistanceRads=ne._greatCircleDistanceRads,o._gridDisk=ne._gridDisk,o._gridDiskDistances=ne._gridDiskDistances,o._gridDistance=ne._gridDistance,o._gridPathCells=ne._gridPathCells,o._gridPathCellsSize=ne._gridPathCellsSize,o._gridRingUnsafe=ne._gridRingUnsafe,o._i64Add=ne._i64Add,o._i64Subtract=ne._i64Subtract,o._isPentagon=ne._isPentagon,o._isResClassIII=ne._isResClassIII,o._isValidCell=ne._isValidCell,o._isValidDirectedEdge=ne._isValidDirectedEdge,o._isValidVertex=ne._isValidVertex,o._latLngToCell=ne._latLngToCell,o._llvm_ctlz_i64=ne._llvm_ctlz_i64,o._llvm_maxnum_f64=ne._llvm_maxnum_f64,o._llvm_minnum_f64=ne._llvm_minnum_f64,o._llvm_round_f64=ne._llvm_round_f64,o._localIjToCell=ne._localIjToCell,o._malloc=ne._malloc,o._maxFaceCount=ne._maxFaceCount,o._maxGr
1idDiskSize=ne._maxGridDiskSize,o._maxPolygonToCellsSize=ne._maxPolygonToCellsSize,o._maxPolygonToCellsSizeExperimental=ne._maxPolygonToCellsSizeExperimental,o._memcpy=ne._memcpy,o._memset=ne._memset,o._originToDirectedEdges=ne._originToDirectedEdges,o._pentagonCount=ne._pentagonCount,o._polygonToCells=ne._polygonToCells,o._polygonToCellsExperimental=ne._polygonToCellsExperimental,o._readInt64AsDoubleFromPointer=ne._readInt64AsDoubleFromPointer,o._res0CellCount=ne._res0CellCount,o._round=ne._round,o._sbrk=ne._sbrk,o._sizeOfCellBoundary=ne._sizeOfCellBoundary,o._sizeOfCoordIJ=ne._sizeOfCoordIJ,o._sizeOfGeoLoop=ne._sizeOfGeoLoop,o._sizeOfGeoPolygon=ne._sizeOfGeoPolygon,o._sizeOfH3Index=ne._sizeOfH3Index,o._sizeOfLatLng=ne._sizeOfLatLng,o._sizeOfLinkedGeoPolygon=ne._sizeOfLinkedGeoPolygon,o._uncompactCells=ne._uncompactCells,o._uncompactCellsSize=ne._uncompactCellsSize,o._vertexToLatLng=ne._vertexToLatLng,o.establishStackSpace=ne.establishStackSpace;var ie,se,ae=o.stackAlloc=ne.stackAlloc,oe=o.stackRestore=ne.stackRestore,le=o.stackSave=ne.stackSave;if(o.asm=ne,o.cwrap=function(e,t,n,r){var i=(n=n||[]).every((function(e){return"number"===e}));return"string"!==t&&i&&!r?y(e):function(){return x(e,t,n,arguments)}},o.setValue=function(e,t,n,r){switch("*"===(n=n||"i8").charAt(n.length-1)&&(n="i32"),n){case"i1":case"i8":w[0|e]=t;break;case"i16":S[e>>1]=t;break;case"i32":M[e>>2]=t;break;case"i64":Q=[t>>>0,(X=t,+V(X)>=1?X>0?(0|j(+G(X/4294967296),4294967295))>>>0:~~+z((X-+(~~X>>>0))/4294967296)>>>0:0)],M[e>>2]=Q[0],M[e+4>>2]=Q[1];break;case"float":E[e>>2]=t;break;case"double":C[e>>3]=t;break;default:fe("invalid type for setValue: "+n)}},o.getValue=function(e,t,n){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return w[0|e];case"i16":return S[e>>1];case"i32":case"i64":return M[e>>2];case"float":return E[e>>2];case"double":return C[e>>3];default:fe("invalid type for getValue: "+t)}return null},Y)if(K(Y)||(ie=Y,Y=o.locateFile?o.locateFile(ie,p):p+ie),i||a){var ue=h(Y);T.set(ue,8)}else{H++,o.monitorRunDependencies&&o.monitorRunDependencies(H);var ce=function(e){e.byteLength&&(e=new Uint8Array(e)),T.set(e,8),o.memoryInitializerRequest&&delete o.memoryInitializerRequest.response,function(){if(H--,o.monitorRunDependencies&&o.monitorRunDependencies(H),0==H&&W){var e=W;W=null,e()}}()},he=function(){c(Y,ce,(function(){throw"could not load memory initializer "+Y}))},Ae=te(Y);if(Ae)ce(Ae.buffer);else if(o.memoryInitializerRequest){var de=function(){var e=o.memoryInitializerRequest,t=e.response;if(200!==e.status&&0!==e.status){var n=te(o.memoryInitializerRequestURL);if(!n)return void he();t=n.buffer}ce(t)};o.memoryInitializerRequest.response?setTimeout(de,0):o.memoryInitializerRequest.addEventListener("load",de)}else he()}function pe(e){function t(){se||(se=!0,_||(I(B),I(U),o.onRuntimeInitialized&&o.onRuntimeInitialized(),function(){if(o.postRun)for("function"==typeof o.postRun&&(o.postRun=[o.postRun]);o.postRun.length;)q(o.postRun.shift());I(F)}()))}H>0||(function(){if(o.preRun)for("function"==typeof o.preRun&&(o.preRun=[o.preRun]);o.preRun.length;)k(o.preRun.shift());I(O)}(),H>0||(o.setStatus?(o.setStatus("Running..."),setTimeout((function(){setTimeout((function(){o.setStatus("")}),1),t()}),1)):t()))}function fe(e){throw o.onAbort&&o.onAbort(e),f(e+=""),m(e),_=!0,"abort("+e+"). Build with -s ASSERTIONS=1 for more info."}if(W=function e(){se||pe(),se||(W=e)},o.run=pe,o.abort=fe,o.preInit)for("function"==typeof o.preInit&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return pe(),e}("object"==typeof __?__:{}),v_="number",y_={0:"Success",1:"The operation failed but a more specific error is not available",2:"Argument was outside of acceptable range",3:"Latitude or longitude arguments were outside of acceptable range",4:"Resolution argument was outside of acceptable range",5:"Cell argument was not valid",6:"Directed edge argument was not valid",7:"Undirected edge argument was not valid",8:"Vertex argument was not valid",9:"Pentagon distortion was encountered",10:"Duplicate input",11:"Cell arguments were not neighbors",12:"Cell arguments had incompatible resolutions",13:"Memory allocation failed",14:"Bounds of provided memory were insufficient",15:"Mode or flags argument was not val
1id"},x_={1e3:"Unknown unit",1001:"Array length out of bounds",1002:"Got unexpected null value for H3 index"};function b_(e,t,n){var r=n&&"value"in n,i=new Error((e[t]||"Unknown error")+" (code: "+t+(r?", value: "+n.value:"")+")");return i.code=t,i}function w_(e,t){return b_(y_,e,2===arguments.length?{value:t}:{})}function T_(e,t){return b_(x_,e,2===arguments.length?{value:t}:{})}function S_(e){if(0!==e)throw w_(e)}var M_={};[["sizeOfH3Index",v_],["sizeOfLatLng",v_],["sizeOfCellBoundary",v_],["sizeOfGeoLoop",v_],["sizeOfGeoPolygon",v_],["sizeOfLinkedGeoPolygon",v_],["sizeOfCoordIJ",v_],["readInt64AsDoubleFromPointer",v_],["isValidCell",v_,[v_,v_]],["latLngToCell",v_,[v_,v_,v_,v_]],["cellToLatLng",v_,[v_,v_,v_]],["cellToBoundary",v_,[v_,v_,v_]],["maxGridDiskSize",v_,[v_,v_]],["gridDisk",v_,[v_,v_,v_,v_]],["gridDiskDistances",v_,[v_,v_,v_,v_,v_]],["gridRingUnsafe",v_,[v_,v_,v_,v_]],["maxPolygonToCellsSize",v_,[v_,v_,v_,v_]],["polygonToCells",v_,[v_,v_,v_,v_]],["maxPolygonToCellsSizeExperimental",v_,[v_,v_,v_,v_]],["polygonToCellsExperimental",v_,[v_,v_,v_,v_,v_,v_]],["cellsToLinkedMultiPolygon",v_,[v_,v_,v_]],["destroyLinkedMultiPolygon",null,[v_]],["compactCells",v_,[v_,v_,v_,v_]],["uncompactCells",v_,[v_,v_,v_,v_,v_,v_]],["uncompactCellsSize",v_,[v_,v_,v_,v_,v_]],["isPentagon",v_,[v_,v_]],["isResClassIII",v_,[v_,v_]],["getBaseCellNumber",v_,[v_,v_]],["getResolution",v_,[v_,v_]],["maxFaceCount",v_,[v_,v_,v_]],["getIcosahedronFaces",v_,[v_,v_,v_]],["cellToParent",v_,[v_,v_,v_,v_]],["cellToChildren",v_,[v_,v_,v_,v_]],["cellToCenterChild",v_,[v_,v_,v_,v_]],["cellToChildrenSize",v_,[v_,v_,v_,v_]],["cellToChildPos",v_,[v_,v_,v_,v_]],["childPosToCell",v_,[v_,v_,v_,v_,v_,v_]],["areNeighborCells",v_,[v_,v_,v_,v_,v_]],["cellsToDirectedEdge",v_,[v_,v_,v_,v_,v_]],["getDirectedEdgeOrigin",v_,[v_,v_,v_]],["getDirectedEdgeDestination",v_,[v_,v_,v_]],["isValidDirectedEdge",v_,[v_,v_]],["directedEdgeToCells",v_,[v_,v_,v_]],["originToDirectedEdges",v_,[v_,v_,v_]],["directedEdgeToBoundary",v_,[v_,v_,v_]],["gridDistance",v_,[v_,v_,v_,v_,v_]],["gridPathCells",v_,[v_,v_,v_,v_,v_]],["gridPathCellsSize",v_,[v_,v_,v_,v_,v_]],["cellToLocalIj",v_,[v_,v_,v_,v_,v_,v_]],["localIjToCell",v_,[v_,v_,v_,v_,v_]],["getHexagonAreaAvgM2",v_,[v_,v_]],["getHexagonAreaAvgKm2",v_,[v_,v_]],["getHexagonEdgeLengthAvgM",v_,[v_,v_]],["getHexagonEdgeLengthAvgKm",v_,[v_,v_]],["greatCircleDistanceM",v_,[v_,v_]],["greatCircleDistanceKm",v_,[v_,v_]],["greatCircleDistanceRads",v_,[v_,v_]],["cellAreaM2",v_,[v_,v_,v_]],["cellAreaKm2",v_,[v_,v_,v_]],["cellAreaRads2",v_,[v_,v_,v_]],["edgeLengthM",v_,[v_,v_,v_]],["edgeLengthKm",v_,[v_,v_,v_]],["edgeLengthRads",v_,[v_,v_,v_]],["getNumCells",v_,[v_,v_]],["getRes0Cells",v_,[v_]],["res0CellCount",v_],["getPentagons",v_,[v_,v_]],["pentagonCount",v_],["cellToVertex",v_,[v_,v_,v_,v_]],["cellToVertexes",v_,[v_,v_,v_]],["vertexToLatLng",v_,[v_,v_,v_]],["isValidVertex",v_,[v_,v_]]].forEach((function(e){M_[e[0]]=__.cwrap.apply(__,e)}));var E_=16,C_=M_.sizeOfH3Index(),R_=M_.sizeOfLatLng(),N_=M_.sizeOfCellBoundary(),P_=M_.sizeOfGeoPolygon(),D_=M_.sizeOfGeoLoop();M_.sizeOfLinkedGeoPolygon(),M_.sizeOfCoordIJ();var L_=Math.pow(2,32)-1,I_=/[^0-9a-fA-F]/;function O_(e){if(Array.isArray(e)&&2===e.length&&Number.isInteger(e[0])&&Number.isInteger(e[1]))return e;if("string"!=typeof e||I_.test(e))return[0,0];var t=parseInt(e.substring(0,e.length-8),E_);return[parseInt(e.substring(e.length-8),E_),t]}function B_(e){if(e>=0)return e.toString(E_);var t=U_(8,(e&=2147483647).toString(E_));return t=(parseInt(t[0],E_)+8).toString(E_)+t.substring(1)}function U_(e,t){for(var n=e-t.length,r="",i=0;i<n;i++)r+="0";return r+=t}function F_(e,t,n){for(var r=e.length,i=__._calloc(r,R_),s=n?1:0,a=n?0:1,o=0;o<2*r;o+=2)__.HEAPF64.set([e[o/2][s],e[o/2][a]].map(W_),i/8+o);return __.HEAPU32.set([r,i],t/4),t}function k_(e,t){void 0===t&&(t=0);var n=__.getValue(e+C_*t,"i32"),r=__.getValue(e+C_*t+4,"i32");return r?function(e,t){return B_(t)+U_(8,B_(e))}(n,r):null}function q_(e){return 180*__.getValue(e,"double")/Math.PI}function V_(e){return[q_(e+8),q_(e)]}function z_(e,t,n){var r=__._malloc(R_);__.HEAPF64.set([e,t].map(W_),r/8);var i=__._malloc(C_);try{return S_(M_.latLngToCell(r,n,i)),function(e){if(!e)throw T_(1002);return e}(k_(i))}finally{__._free(i),__._free(r)}}function G_(e){var t,n=__._malloc(R_),r=O_(e),i=r[0],s=r[1];try{return S_(M_.cellToLatLng(i,s,n)),[q_(t=n),q_(t+8)]}finally{__._free(n)}}function j_(e,t){var n=__._malloc(N_),r=O_(e),i=r[0],s=r[1];try{return S_(M_.cellToBoundary(i,s,n)),function(e){for(var t=__.getValue(e,"i32"),n=e+8,r=[],i=V_,s=0;s<2*t;s+=2)r.push(i(n+8*s));return r.push(r[0]),r}(n)}finally{__._free(n)}}function H_(e,t,n){if(function(e){if("number"!=typeof e||e<0||e>15||Math.floor(e)!==e)throw w_(4,e)}(t),n=Boolean(n),0===e.length||0===e[0].length)return[];var r,i=function(e,t){var n,r=e.length-1,i=__._calloc(P_),s=0+D_,a=s+4;if(F_(e[0],i+0,t),r>0){n=__._calloc(r,D_);for(var o=0;o<r;o++)F_(e[o+1],n+D_*o,t)}return __.setValue(i+s,r,"i32"),__.setValue(i+a,n,"i32"),i}("number"==typeof e[0][0]?[e]:e,n),s=__._malloc(8);try{S_(M_.maxPolygonToCellsSize(i,t,0,s));var a=function(e){if(e>L_)throw T_(1001,e);return e}((r=s,M_.readInt64AsDoubleFromPointer(r))),o=__._calloc(a,C_);try{return S_(M_.polygonToCells(i,t,0,o)),function(e,t){for(var n=[],r=0;r<t;r++){var i=k_(e,r);null!==i&&n.push(i)}return n}(o,a)}finally{__._free(o)}}finally{__._free(s),function(e){var t=0+D_,n=t+4;__._free(__.getValue(e+0+4,"i8*"));var r=__.getValue(e+t,"i32");if(r>0){for(var i=__.getValue(e+n,"i32"),s=0;s<r;s++)__._free(__.getValue(i+D_*s+4,"i8*"));__._free(i)}__._free(e)}(i)}}function W_(e){return e*Math.PI/180}const X_=["alphaMap","alphaTest","anisotropy","anisotropyMap","anisotropyRotation","aoMap","aoMapIntensity","attenuationColor","attenuationDistance","bumpMap","clearcoat","clearcoatMap","clearcoatNormalMap","clearcoatNormalScale","clearcoatRoughness","color","dispersion","displacementMap","emissive","emissiveIntensity","emissiveMap","envMap","envMapIntensity","gradientMap","ior","iridescence","iridescenceIOR","iridescenceMap","iridescenceThicknessMap","lightMap","lightMapIntensity","map","matcap","metalness","metalnessMap","normalMap","normalScale","opacity","roughness","roughnessMap","sheen","sheenColor","sheenColorMap","sheenRoughnessMap","shininess","specular","specularColor","specularColorMap","specularIntensity","specularIntensityMap","specularMap","thickness","transmission","transmissionMap"];class Q_{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=!0===e.object.isSkinnedMesh,this.refreshUniforms=X_,this.renderId=0}firstInitialization(e){return!1===this.renderObjects.has(e)&&(this.getRenderObjectData(e),!0)}needsVelocity(e){const t=e.getMRT();return null!==t&&t.has("velocity")}getRenderObjectData(e){let t=this.renderObjects.get(e);if(void 0===t){const{geometry:n,material:r,object:i}=e;if(t={material:this.getMaterialData(r),geometry:{id:n.id,attributes:this.getAttributesData(n.attributes),indexVersion:n.index?n.index.version:null,drawRange:{start:n.drawRange.start,count:n.drawRange.count}},worldMatrix:i.matrixWorld.clone()},i.center&&(t.center=i.center.clone()),i.morphTargetInfluences&&(t.morphTargetInfluences=i.morphTargetInfluences.slice()),null!==e.bundle&&(t.version=e.bundle.version),t.material.transmission>0){const{width:n,height:r}=e.context;t.bufferWidth=n,t.bufferHeight=r}this.renderObjects.set(e,t)}return t}getAttributesData(e){const t={};for(const n in e){const r=e[n];t[n]={version:r.version}}return t}containsNode(e){const t=e.material;for(const e in t)if(t[e]&&t[e].isNode)return!0;return null!==e.renderer.overrideNodes.modelViewMatrix||null!==e.renderer.overrideNodes.modelNormalViewMatrix}getMaterialData(e){const t={};for(const n of this.refreshUniforms){const r=e[n];null!=r&&("object"==typeof r&&void 0!==r.clone?!0===r.isTexture?t[
1n]={id:r.id,version:r.version}:t[n]=r.clone():t[n]=r)}return t}equals(e){const{object:t,material:n,geometry:r}=e,i=this.getRenderObjectData(e);if(!0!==i.worldMatrix.equals(t.matrixWorld))return i.worldMatrix.copy(t.matrixWorld),!1;const s=i.material;for(const e in s){const t=s[e],r=n[e];if(void 0!==t.equals){if(!1===t.equals(r))return t.copy(r),!1}else if(!0===r.isTexture){if(t.id!==r.id||t.version!==r.version)return t.id=r.id,t.version=r.version,!1}else if(t!==r)return s[e]=r,!1}if(s.transmission>0){const{width:t,height:n}=e.context;if(i.bufferWidth!==t||i.bufferHeight!==n)return i.bufferWidth=t,i.bufferHeight=n,!1}const a=i.geometry,o=r.attributes,l=a.attributes,u=Object.keys(l),c=Object.keys(o);if(a.id!==r.id)return a.id=r.id,!1;if(u.length!==c.length)return i.geometry.attributes=this.getAttributesData(o),!1;for(const e of u){const t=l[e],n=o[e];if(void 0===n)return delete l[e],!1;if(t.version!==n.version)return t.version=n.version,!1}const h=r.index,A=a.indexVersion,d=h?h.version:null;if(A!==d)return a.indexVersion=d,!1;if(a.drawRange.start!==r.drawRange.start||a.drawRange.count!==r.drawRange.count)return a.drawRange.start=r.drawRange.start,a.drawRange.count=r.drawRange.count,!1;if(i.morphTargetInfluences){let e=!1;for(let n=0;n<i.morphTargetInfluences.length;n++)i.morphTargetInfluences[n]!==t.morphTargetInfluences[n]&&(e=!0);if(e)return!0}return i.center&&!1===i.center.equals(t.center)?(i.center.copy(t.center),!0):(null!==e.bundle&&(i.version=e.bundle.version),!0)}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e)||this.needsVelocity(t.renderer))return!0;const{renderId:n}=t;if(this.renderId!==n)return this.renderId=n,!0;const r=!0===e.object.static,i=null!==e.bundle&&!0===e.bundle.static&&this.getRenderObjectData(e).version===e.bundle.version;return!r&&!i&&!0!==this.equals(e)}}function Y_(e,t=0){let n=3735928559^t,r=1103547991^t;if(e instanceof Array)for(let t,i=0;i<e.length;i++)t=e[i],n=Math.imul(n^t,2654435761),r=Math.imul(r^t,1597334677);else for(let t,i=0;i<e.length;i++)t=e.charCodeAt(i),n=Math.imul(n^t,2654435761),r=Math.imul(r^t,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)}const $_=e=>Y_(e),K_=e=>Y_(e),Z_=(...e)=>Y_(e);function J_(e,t=!1){const n=[];!0===e.isNode&&(n.push(e.id),e=e.getSelf());for(const{property:r,childNode:i}of ev(e))n.push(Y_(r.slice(0,-4)),i.getCacheKey(t));return Y_(n)}function*ev(e,t=!1){for(const n in e){if(!0===n.startsWith("_"))continue;const r=e[n];if(!0===Array.isArray(r))for(let e=0;e<r.length;e++){const i=r[e];i&&(!0===i.isNode||t&&"function"==typeof i.toJSON)&&(yield{property:n,index:e,childNode:i})}else if(r&&!0===r.isNode)yield{property:n,childNode:r};else if("object"==typeof r)for(const e in r){const i=r[e];i&&(!0===i.isNode||t&&"function"==typeof i.toJSON)&&(yield{property:n,index:e,childNode:i})}}}const tv=new Map([[1,"float"],[2,"vec2"],[3,"vec3"],[4,"vec4"],[9,"mat3"],[16,"mat4"]]),nv=new WeakMap;function rv(e){return tv.get(e)}function iv(e){if(/[iu]?vec\d/.test(e))return e.startsWith("ivec")?Int32Array:e.startsWith("uvec")?Uint32Array:Float32Array;if(/mat\d/.test(e))return Float32Array;if(/float/.test(e))return Float32Array;if(/uint/.test(e))return Uint32Array;if(/int/.test(e))return Int32Array;throw new Error(`THREE.NodeUtils: Unsupported type: ${e}`)}function sv(e){return/float|int|uint/.test(e)?1:/vec2/.test(e)?2:/vec3/.test(e)?3:/vec4/.test(e)||/mat2/.test(e)?4:/mat3/.test(e)?9:/mat4/.test(e)?16:void 0}function av(e){return/float|int|uint/.test(e)?1:/vec2/.test(e)?2:/vec3/.test(e)?3:/vec4/.test(e)||/mat2/.test(e)?4:/mat3/.test(e)?12:/mat4/.test(e)?16:void 0}function ov(e){return/float|int|uint/.test(e)?4:/vec2/.test(e)?8:/vec3/.test(e)||/vec4/.test(e)?16:/mat2/.test(e)?8:/mat3/.test(e)?48:/mat4/.test(e)?64:void 0}function lv(e){if(null==e)return null;const t=typeof e;return!0===e.isNode?"node":"number"===t?"float":"boolean"===t?"bool":"string"===t?"string":"function"===t?"shader":!0===e.isVector2?"vec2":!0===e.isVector3?"vec3":!0===e.isVector4?"vec4":!0===e.isMatrix2?"mat2":!0===e.isMatrix3?"mat3":!0===e.isMatrix4?"mat4":!0===e.isColor?"color":e instanceof ArrayBuffer?"ArrayBuffer":null}function uv(e,...t){const n=e?e.slice(-4):void 0;return 1===t.length&&("vec2"===n?t=[t[0],t[0]]:"vec3"===n?t=[t[0],t[0],t[0]]:"vec4"===n&&(t=[t[0],t[0],t[0],t[0]])),"color"===e?new Gn(...t):"vec2"===n?new Ye(...t):"vec3"===n?new Ke(...t):"vec4"===n?new vt(...t):"mat2"===n?new fa(...t):"mat3"===n?new et(...t):"mat4"===n?
vendor: 6,920 bytes, line 1
1new $t(...t):"bool"===e?t[0]||!1:"float"===e||"int"===e||"uint"===e?t[0]||0:"string"===e?t[0]||"":"ArrayBuffer"===e?Av(t[0]):null}function cv(e){let t=nv.get(e);return void 0===t&&(t={},nv.set(e,t)),t}function hv(e){let t="";const n=new Uint8Array(e);for(let e=0;e<n.length;e++)t+=String.fromCharCode(n[e]);return btoa(t)}function Av(e){return Uint8Array.from(atob(e),(e=>e.charCodeAt(0))).buffer}const dv={VERTEX:"vertex",FRAGMENT:"fragment"},pv={NONE:"none",FRAME:"frame",RENDER:"render",OBJECT:"object"},fv={READ_ONLY:"readOnly",WRITE_ONLY:"writeOnly",READ_WRITE:"readWrite"},mv=["fragment","vertex"],gv=["setup","analyze","generate"],_v=[...mv,"compute"],vv=["x","y","z","w"],yv={analyze:"setup",generate:"analyze"};let xv=0;class bv extends Ue{static get type(){return"Node"}constructor(e=null){super(),this.nodeType=e,this.updateType=pv.NONE,this.updateBeforeType=pv.NONE,this.updateAfterType=pv.NONE,this.uuid=Qe.generateUUID(),this.version=0,this.global=!1,this.parents=!1,this.isNode=!0,this._cacheKey=null,this._cacheKeyVersion=0,Object.defineProperty(this,"id",{value:xv++})}set needsUpdate(e){!0===e&&this.version++}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this.getSelf()),this}onFrameUpdate(e){return this.onUpdate(e,pv.FRAME)}onRenderUpdate(e){return this.onUpdate(e,pv.RENDER)}onObjectUpdate(e){return this.onUpdate(e,pv.OBJECT)}onReference(e){return this.updateReference=e.bind(this.getSelf()),this}getSelf(){return this.self||this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(const{childNode:e}of ev(this))yield e}dispose(){this.dispatchEvent({type:"dispose"})}traverse(e){e(this);for(const t of this.getChildren())t.traverse(e)}getCacheKey(e=!1){return!0!==(e=e||this.version!==this._cacheKeyVersion)&&null!==this._cacheKey||(this._cacheKey=Z_(J_(this,e),this.customCacheKey()),this._cacheKeyVersion=this.version),this._cacheKey}customCacheKey(){return 0}getScope(){return this}getHash(){return this.uuid}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){const t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return"void"}getNodeType(e){const t=e.getNodeProperties(this);return t.outputNode?t.outputNode.getNodeType(e):this.nodeType}getShared(e){const t=this.getHash(e);return e.getNodeFromHash(t)||this}setup(e){const t=e.getNodeProperties(this);let n=0;for(const e of this.getChildren())t["node"+n++]=e;return t.outputNode||null}analyze(e,t=null){const n=e.increaseUsage(this);if(!0===this.parents){const n=e.getDataFromNode(this,"any");n.stages=n.stages||{},n.stages[e.shaderStage]=n.stages[e.shaderStage]||[],n.stages[e.shaderStage].push(t)}if(1===n){const t=e.getNodeProperties(this);for(const n of Object.values(t))n&&!0===n.isNode&&n.build(e,this)}}generate(e,t){const{outputNode:n}=e.getNodeProperties(this);if(n&&!0===n.isNode)return n.build(e,t)}updateBefore(){}updateAfter(){}update(){}build(e,t=null){const n=this.getShared(e);if(this!==n)return n.build(e,t);const r=e.getDataFromNode(this);r.buildStages=r.buildStages||{},r.buildStages[e.buildStage]=!0;const i=yv[e.buildStage];if(i&&!0!==r.buildStages[i]){const t=e.getBuildStage();e.setBuildStage(i),this.build(e),e.setBuildStage(t)}e.addNode(this),e.addChain(this);let s=null;const a=e.getBuildStage();if("setup"===a){this.updateReference(e);const t=e.getNodeProperties(this);if(!0!==t.initialized){t.initialized=!0,t.outputNode=this.setup(e)||t.outputNode||null;for(const n of Object.values(t))if(n&&!0===n.isNode){if(!0===n.parents){const t=e.getNodeProperties(n);t.parents=t.parents||[],t.parents.push(this)}n.build(e)}}s=t.outputNode}else if("analyze"===a)this.analyze(e,t);else if("generate"===a)if(1===this.generate.length){const n=this.getNodeType(e),r=e.getDataFromNode(this);s=r.snippet,void 0===s?void 0===r.generated?(r.generated=!0,s=this.generate(e)||"",r.snippet=s):s="":void 0!==r.flowCodes&&void 0!==e.context.nodeBlock&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),s=e.format(s,n,t)}else s=this.generate(e,t)||"";return e.removeChain(this),e.addSequentialNode(this),s}getSerializeChildren(){return ev(this)}serialize(e){const t=this.getSerializeChildren(),n={};for(const{property:r,index:i,childNode:s}of t)void 0!==i?(void 0===n[r]&&(n[r]=Number.isInteger(i)?[]:{}),n[r][i]=s.toJSON(e.meta).uuid):n[r]=s.toJSON(e.meta).uuid;Object.keys(n).length>0&&(e.inputNodes=n)}deserialize(e){if(void 0!==e.inputNodes){const t=e.meta.nodes;for(const n in e.inputNodes)if(Array.isArray(e.inputNodes[n])){const r=[];for(const i of e.inputNodes[n])r.push(t[i]);this[n]=r}else if("object"==typeof e.inputNodes[n]){const r={};for(const i in e.inputNodes[n]){const s=e.inputNodes[n][i];r[i]=t[s]}this[n]=r}else{const r=e.inputNodes[n];this[n]=t[r]}}}toJSON(e){const{uuid:t,type:n}=this,r=void 0===e||"string"==typeof e;r&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];function s(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(void 0===i&&(i={uuid:t,type:n,meta:e,metadata:{version:4.7,type:"Node",generator:"Node.toJSON"}},!0!==r&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta),r){const t=s(e.textures),n=s(e.images),r=s(e.nodes);t.length>0&&(i.textures=t),n.length>0&&(i.images=n),r.length>0&&(i.nodes=r)}return i}}class wv extends bv{static get type(){return"ArrayElementNode"}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}getNodeType(e){return this.node.getElementType(e)}generate(e){const t=this.indexNode.getNodeType(e);return`${this.node.build(e)}[ ${this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:"uint")} ]`}}class Tv extends bv{static get type(){return"ConvertNode"}constructor(e,t){super(),this.node=e,this.convertTo=t}getNodeType(e){const t=this.node.getNodeType(e);let n=null;for(const r of this.convertTo.split("|"))null!==n&&e.getTypeLength(t)!==e.getTypeLength(r)||(n=r);return n}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){const n=this.node,r=this.getNodeType(e),i=n.build(e,r);return e.format(i,r,t)}}class Sv extends bv{static get type(){return"TempNode"}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if("generate"===e.getBuildStage()){const n=e.getVectorType(this.getNodeType(e,t)),r=e.getDataFromNode(this);if(void 0!==r.propertyName)return e.format(r.propertyName,n,t);if("void"!==n&&"void"!==t&&this.hasDependencies(e)){const i=super.build(e,n),s=e.getVarFromNode(this,null,n),a=e.getPropertyName(s);return e.addLineFlowCode(`${a} = ${i}`,this),r.snippet=i,r.propertyName=a,e.format(r.propertyName,n,t)}}return super.build(e,t)}}class Mv extends Sv{static get type(){return"JoinNode"}constructor(e=[],t=null){super(t),this.nodes=e}
1getNodeType(e){return null!==this.nodeType?e.getVectorType(this.nodeType):e.getTypeFromLength(this.nodes.reduce(((t,n)=>t+e.getTypeLength(n.getNodeType(e))),0))}generate(e,t){const n=this.getNodeType(e),r=e.getTypeLength(n),i=this.nodes,s=e.getComponentType(n),a=[];let o=0;for(const t of i){if(o>=r)break;let n,i=t.getNodeType(e),l=e.getTypeLength(i);o+l>r&&(l=r-o,i=e.getTypeFromLength(l)),o+=l,n=t.build(e,i);const u=e.getComponentType(i);u!==s&&(n=e.format(n,u,s)),a.push(n)}const l=`${e.getType(n)}( ${a.join(", ")} )`;return e.format(l,n,t)}}const Ev=vv.join("");class Cv extends bv{static get type(){return"SplitNode"}constructor(e,t="x"){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(const t of this.components)e=Math.max(vv.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}getNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}generate(e,t){const n=this.node,r=e.getTypeLength(n.getNodeType(e));let i=null;if(r>1){let s=null;this.getVectorLength()>=r&&(s=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));const a=n.build(e,s);i=this.components.length===r&&this.components===Ev.slice(0,this.components.length)?e.format(a,s,t):e.format(`${a}.${this.components}`,this.getNodeType(e),t)}else i=n.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}}class Rv extends Sv{static get type(){return"SetNode"}constructor(e,t,n){super(),this.sourceNode=e,this.components=t,this.targetNode=n}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{sourceNode:t,components:n,targetNode:r}=this,i=this.getNodeType(e),s=e.getComponentType(r.getNodeType(e)),a=e.getTypeFromLength(n.length,s),o=r.build(e,a),l=t.build(e,i),u=e.getTypeLength(i),c=[];for(let e=0;e<u;e++){const t=vv[e];t===n[0]?(c.push(o),e+=n.length-1):c.push(l+"."+t)}return`${e.getType(i)}( ${c.join(", ")} )`}}class Nv extends Sv{static get type(){return"FlipNode"}constructor(e,t){super(),this.sourceNode=e,this.components=t}getNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){const{components:t,sourceNode:n}=this,r=this.getNodeType(e),i=n.build(e),s=e.getVarFromNode(this),a=e.getPropertyName(s);e.addLineFlowCode(a+" = "+i,this);const o=e.getTypeLength(r),l=[];let u=0;for(let e=0;e<o;e++){const n=vv[e];n===t[u]?(l.push("1.0 - "+a+"."+n),u++):l.push(a+"."+n)}return`${e.getType(r)}( ${l.join(", ")} )`}}class Pv extends bv{static get type(){return"InputNode"}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}getNodeType(){return null===this.nodeType?lv(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=lv(this.value),e.nodeType=this.nodeType,"ArrayBuffer"===e.valueType&&(e.value=hv(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?uv(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){}}const Dv=/float|u?int/;class Lv extends Pv{static get type(){return"ConstNode"}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){const n=this.getNodeType(e);return Dv.test(n)&&Dv.test(t)?e.generateConst(t,this.value):e.format(this.generateConst(e),n,t)}}class Iv extends bv{static get type(){return"MemberNode"}constructor(e,t){super(),this.node=e,this.property=t,this.isMemberNode=!0}getNodeType(e){return this.node.getMemberType(e,this.property)}generate(e){return this.node.build(e)+"."+this.property}}let Ov=null;const Bv=new Map;function Uv(e,t){if(Bv.has(e));else{if("function"!=typeof t)throw new Error(`THREE.TSL: Node element ${e} is not a function`);Bv.set(e,t)}}const Fv=e=>e.replace(/r|s/g,"x").replace(/g|t/g,"y").replace(/b|p/g,"z").replace(/a|q/g,"w"),kv=e=>Fv(e).split("").sort().join(""),qv={setup(e,t){const n=t.shift();return e(hy(n),...t)},get(e,t,n){if("string"==typeof t&&void 0===e[t]){if(!0!==e.isStackNode&&"assign"===t)return(...e)=>(Ov.assign(n,...e),n);if(Bv.has(t)){const r=Bv.get(t);return e.isStackNode?(...e)=>n.add(r(...e)):(...e)=>r(n,...e)}if("self"===t)return e;if(t.endsWith("Assign")&&Bv.has(t.slice(0,t.length-6))){const r=Bv.get(t.
1slice(0,t.length-6));return e.isStackNode?(...e)=>n.assign(e[0],r(...e)):(...e)=>n.assign(r(n,...e))}if(!0===/^[xyzwrgbastpq]{1,4}$/.test(t))return t=Fv(t),cy(new Cv(n,t));if(!0===/^set[XYZWRGBASTPQ]{1,4}$/.test(t))return t=kv(t.slice(3).toLowerCase()),n=>cy(new Rv(e,t,cy(n)));if(!0===/^flip[XYZWRGBASTPQ]{1,4}$/.test(t))return t=kv(t.slice(4).toLowerCase()),()=>cy(new Nv(cy(e),t));if("width"===t||"height"===t||"depth"===t)return"width"===t?t="x":"height"===t?t="y":"depth"===t&&(t="z"),cy(new Cv(e,t));if(!0===/^\d+$/.test(t))return cy(new wv(n,new Lv(Number(t),"uint")));if(!0===/^get$/.test(t))return e=>cy(new Iv(n,e))}return Reflect.get(e,t,n)},set:(e,t,n,r)=>"string"!=typeof t||void 0!==e[t]||!0!==/^[xyzwrgbastpq]{1,4}$/.test(t)&&"width"!==t&&"height"!==t&&"depth"!==t&&!0!==/^\d+$/.test(t)?Reflect.set(e,t,n,r):(r[t].assign(n),!0)},Vv=new WeakMap,zv=new WeakMap,Gv=function(e,t=null){for(const n in e)e[n]=cy(e[n],t);return e},jv=function(e,t=null){const n=e.length;for(let r=0;r<n;r++)e[r]=cy(e[r],t);return e},Hv=function(e,t=null,n=null,r=null){const i=e=>cy(null!==r?Object.assign(e,r):e);let s,a,o,l=t;function u(t){let n;return n=l?/[a-z]/i.test(l)?l+"()":l:e.type,void 0!==a&&t.length<a?t.concat(new Array(a-t.length).fill(0)):void 0!==o&&t.length>o?t.slice(0,o):t}return null===t?s=(...t)=>i(new e(...Ay(u(t)))):null!==n?(n=cy(n),s=(...r)=>i(new e(t,...Ay(u(r)),n))):s=(...n)=>i(new e(t,...Ay(u(n)))),s.setParameterLength=(...e)=>(1===e.length?a=o=e[0]:2===e.length&&([a,o]=e),s),s.setName=e=>(l=e,s),s},Wv=function(e,...t){return cy(new e(...Ay(t)))};class Xv extends bv{constructor(e,t){super(),this.shaderNode=e,this.inputNodes=t,this.isShaderCallNodeInternal=!0}getNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){const{shaderNode:t,inputNodes:n}=this,r=e.getNodeProperties(t),i=t.namespace&&t.namespace===e.namespace?e.getNamespace("once"):"once";if(r[i])return r[i];let s=null;if(t.layout){let r=zv.get(e.constructor);void 0===r&&(r=new WeakMap,zv.set(e.constructor,r));let i=r.get(t);void 0===i&&(i=cy(e.buildFunctionNode(t)),r.set(t,i)),e.addInclude(i),s=cy(i.call(n))}else{const r=t.jsFunc,i=null!==n||r.length>1?r(n||[],e):r(e);s=cy(i)}return t.once&&(r[i]=s),s}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){const t=e.getNodeProperties(this),n=e.getOutputNamespace();return t[n]=t[n]||this.setupOutput(e),t[n]}build(e,t=null){let n=null;const r=e.getBuildStage(),i=e.getNodeProperties(this),s=e.getOutputNamespace(),a=this.getOutputNode(e);if("setup"===r){const t=e.getNamespace("initialized");!0!==i[t]&&(i[t]=!0,i[s]=this.getOutputNode(e),i[s].build(e)),n=i[s]}else"analyze"===r?a.build(e,t):"generate"===r&&(n=a.build(e,t)||"");return n}}class Qv extends bv{constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1,this.namespace=null}setLayout(e){return this.layout=e,this}call(e=null){return hy(e),cy(new Xv(this,e))}setup(){return this.call()}}const Yv=[!1,!0],$v=[0,1,2,3],Kv=[-1,-2],Zv=[.5,1.5,1/3,1e-6,1e6,Math.PI,2*Math.PI,1/Math.PI,2/Math.PI,1/(2*Math.PI),Math.PI/2],Jv=new Map;for(const e of Yv)Jv.set(e,new Lv(e));const ey=new Map;for(const e of $v)ey.set(e,new Lv(e,"uint"));const ty=new Map([...ey].map((e=>new Lv(e.value,"int"))));for(const e of Kv)ty.set(e,new Lv(e,"int"));const ny=new Map([...ty].map((e=>new Lv(e.value))));for(const e of Zv)ny.set(e,new Lv(e));for(const e of Zv)ny.set(-e,new Lv(-e));const ry={bool:Jv,uint:ey,ints:ty,float:ny},iy=new Map([...Jv,...ny]),sy=(e,t)=>iy.has(e)?iy.get(e):!0===e.isNode?e:new Lv(e,t),ay=function(e,t=null){return(...n)=>{if((0===n.length||!["bool","float","int","uint"].includes(e)&&n.every((e=>"object"!=typeof e)))&&(n=[uv(e,...n)]),1===n.length&&null!==t&&t.has(n[0]))return cy(t.get(n[0]));if(1===n.length){const t=sy(n[0],e);return(e=>{try{return e.getNodeType()}catch(e){return}})(t)===e?cy(t):cy(new Tv(t,e))}const r=n.map((e=>sy(e)));return cy(new Mv(r,e))}},oy=e=>"object"==typeof e&&null!==e?e.value:e,ly=e=>null!=e?e.nodeType||e.convertTo||("string"==typeof e?e:null):null;function uy(e,t){return new Proxy(new Qv(e,t),qv)}const cy=(e,t=null)=>function(e,t=null){const n=lv(e);
1if("node"===n){let t=Vv.get(e);return void 0===t&&(t=new Proxy(e,qv),Vv.set(e,t),Vv.set(t,t)),t}return null===t&&("float"===n||"boolean"===n)||n&&"shader"!==n&&"string"!==n?cy(sy(e,t)):"shader"===n?my(e):e}(e,t),hy=(e,t=null)=>new Gv(e,t),Ay=(e,t=null)=>new jv(e,t),dy=(...e)=>new Hv(...e),py=(...e)=>new Wv(...e);let fy=0;const my=(e,t=null)=>{let n=null;null!==t&&("object"==typeof t?n=t.return:("string"==typeof t&&(n=t),t=null));const r=new uy(e,n),i=(...e)=>{let t;hy(e),t=e[0]&&(e[0].isNode||Object.getPrototypeOf(e[0])!==Object.prototype)?[...e]:e[0];const i=r.call(t);return"void"===n&&i.toStack(),i};if(i.shaderNode=r,i.id=r.id,i.getNodeType=(...e)=>r.getNodeType(...e),i.getCacheKey=(...e)=>r.getCacheKey(...e),i.setLayout=e=>(r.setLayout(e),i),i.once=(e=null)=>(r.once=!0,r.namespace=e,i),null!==t){if("object"!=typeof t.inputs){const e={name:"fn"+fy++,type:n,inputs:[]};for(const n in t)"return"!==n&&e.inputs.push({name:n,type:t[n]});t=e}i.setLayout(t)}return i},gy=e=>{Ov=e},_y=()=>Ov,vy=(...e)=>Ov.If(...e);function yy(e){return Ov&&Ov.add(e),e}Uv("toStack",yy);const xy=new ay("color"),by=new ay("float",ry.float),wy=new ay("int",ry.ints),Ty=new ay("uint",ry.uint),Sy=new ay("bool",ry.bool),My=new ay("vec2"),Ey=new ay("ivec2"),Cy=new ay("uvec2"),Ry=new ay("bvec2"),Ny=new ay("vec3"),Py=new ay("ivec3"),Dy=new ay("uvec3"),Ly=new ay("bvec3"),Iy=new ay("vec4"),Oy=new ay("ivec4"),By=new ay("uvec4"),Uy=new ay("bvec4"),Fy=new ay("mat2"),ky=new ay("mat3"),qy=new ay("mat4");Uv("toColor",xy),Uv("toFloat",by),Uv("toInt",wy),Uv("toUint",Ty),Uv("toBool",Sy),Uv("toVec2",My),Uv("toIVec2",Ey),Uv("toUVec2",Cy),Uv("toBVec2",Ry),Uv("toVec3",Ny),Uv("toIVec3",Py),Uv("toUVec3",Dy),Uv("toBVec3",Ly),Uv("toVec4",Iy),Uv("toIVec4",Oy),Uv("toUVec4",By),Uv("toBVec4",Uy),Uv("toMat2",Fy),Uv("toMat3",ky),Uv("toMat4",qy);const Vy=dy(wv).setParameterLength(2),zy=(e,t)=>cy(new Tv(cy(e),t));Uv("element",Vy),Uv("convert",zy),Uv("append",(e=>yy(e)));class Gy extends bv{static get type(){return"PropertyNode"}constructor(e,t=null,n=!1){super(e),this.name=t,this.varying=n,this.isPropertyNode=!0,this.global=!0}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return!0===this.varying?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}}const jy=(e,t)=>cy(new Gy(e,t)),Hy=(e,t)=>cy(new Gy(e,t,!0)),Wy=py(Gy,"vec4","DiffuseColor"),Xy=py(Gy,"vec3","EmissiveColor"),Qy=py(Gy,"float","Roughness"),Yy=py(Gy,"float","Metalness"),$y=py(Gy,"float","Clearcoat"),Ky=py(Gy,"float","ClearcoatRoughness"),Zy=py(Gy,"vec3","Sheen"),Jy=py(Gy,"float","SheenRoughness"),ex=py(Gy,"float","Iridescence"),tx=py(Gy,"float","IridescenceIOR"),nx=py(Gy,"float","IridescenceThickness"),rx=py(Gy,"float","AlphaT"),ix=py(Gy,"float","Anisotropy"),sx=py(Gy,"vec3","AnisotropyT"),ax=py(Gy,"vec3","AnisotropyB"),ox=py(Gy,"color","SpecularColor"),lx=py(Gy,"float","SpecularF90"),ux=py(Gy,"float","Shininess"),cx=py(Gy,"vec4","Output"),hx=py(Gy,"float","dashSize"),Ax=py(Gy,"float","gapSize"),dx=py(Gy,"float","pointWidth"),px=py(Gy,"float","IOR"),fx=py(Gy,"float","Transmission"),mx=py(Gy,"float","Thickness"),gx=py(Gy,"float","AttenuationDistance"),_x=py(Gy,"color","AttenuationColor"),vx=py(Gy,"float","Dispersion");class yx extends bv{static get type(){return"UniformGroupNode"}constructor(e,t=!1,n=1){super("string"),this.name=e,this.shared=t,this.order=n,this.isUniformGroup=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}}const xx=e=>new yx(e),bx=(e,t=0)=>new yx(e,!0,t),wx=bx("frame"),Tx=bx("render"),Sx=xx("object");class Mx extends Pv{static get type(){return"UniformNode"}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name="",this.groupNode=Sx}label(e){return this.name=e,this}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}
1onUpdate(e,t){const n=this.getSelf();return e=e.bind(n),super.onUpdate((t=>{const r=e(t,n);void 0!==r&&(this.value=r)}),t)}generate(e,t){const n=this.getNodeType(e),r=this.getUniformHash(e);let i=e.getNodeFromHash(r);void 0===i&&(e.setHashNode(this,r),i=this);const s=i.getInputType(e),a=e.getUniformFromNode(i,s,e.shaderStage,this.name||e.context.label),o=e.getPropertyName(a);return void 0!==e.context.label&&delete e.context.label,e.format(o,n,t)}}const Ex=(e,t)=>{const n=ly(t||e),r=e&&!0===e.isNode?e.node&&e.node.value||e.value:e;return cy(new Mx(r,n))};class Cx extends Sv{static get type(){return"ArrayNode"}constructor(e,t,n=null){super(e),this.count=t,this.values=n,this.isArrayNode=!0}getNodeType(e){return null===this.nodeType&&(this.nodeType=this.values[0].getNodeType(e)),this.nodeType}getElementType(e){return this.getNodeType(e)}generate(e){const t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}}const Rx=(...e)=>{let t;if(1===e.length){const n=e[0];t=new Cx(null,n.length,n)}else{const n=e[0],r=e[1];t=new Cx(n,r)}return cy(t)};Uv("toArray",((e,t)=>
1Rx(Array(t).fill(e))));const Nx=dy(class extends Sv{static get type(){return"AssignNode"}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}getNodeType(e,t){return"void"!==t?this.targetNode.getNodeType(e):"void"}needsSplitAssign(e){const{targetNode:t}=this;if(!1===e.isAvailable("swizzleAssign")&&t.isSplitNode&&t.components.length>1){const n=e.getTypeLength(t.node.getNodeType(e));return vv.join("").slice(0,n)!==t.components}return!1}setup(e){const{targetNode:t,sourceNode:n}=this,r=e.getNodeProperties(this);r.sourceNode=n,r.targetNode=t.context({assign:!0})}generate(e,t){const{targetNode:n,sourceNode:r}=e.getNodeProperties(this),i=this.needsSplitAssign(e),s=n.getNodeType(e),a=n.build(e),o=r.build(e,s),l=r.getNodeType(e),u=e.getDataFromNode(this);let c;if(!0===u.initialized)"void"!==t&&(c=a);else if(i){const r=e.getVarFromNode(this,null,s),i=e.getPropertyName(r);e.addLineFlowCode(`${i} = ${o}`,this);const l=n.node,u=l.node.context({assign:!0}).build(e);for(let t=0;t<l.components.length;t++){const n=l.components[t];e.addLineFlowCode(`${u}.${n} = ${i}[ ${t} ]`,this)}"void"!==t&&(c=a)}else c=`${a} = ${o}`,"void"!==t&&"void"!==l||(e.addLineFlowCode(c,this),"void"!==t&&(c=a));return u.initialized=!0,e.format(c,s,t)}}).setParameterLength(2);Uv("assign",Nx);class Px extends Sv{static get type(){return"FunctionCallNode"}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}getNodeType(e){return this.functionNode.getNodeType(e)}generate(e){const t=[],n=this.functionNode,r=n.getInputs(e),i=this.parameters,s=(t,n)=>{const r=n.type;let i;return i="pointer"===r?"&"+t.build(e):t.build(e,r),i};if(Array.isArray(i)){if(i.length>r.length)i.length=r.length;else if(i.length<r.length)for(;i.length<r.length;)i.push(by(0));for(let e=0;e<i.length;e++)t.push(s(i[e],r[e]))}else for(const e of r){const n=i[e.name];void 0!==n?t.push(s(n,e)):t.push(s(by(0),e))}return`${n.build(e,"property")}( ${t.join(", ")} )`}}const Dx=(e,...t)=>(t=t.length>1||t[0]&&!0===t[0].isNode?Ay(t):hy(t[0]),cy(new Px(cy(e),t)));Uv("call",Dx);const Lx={"==":"equal","!=":"notEqual","<":"lessThan",">":"greaterThan","<=":"lessThanEqual",">=":"greaterThanEqual","%":"mod"};class Ix extends Sv{static get type(){return"OperatorNode"}constructor(e,t,n,...r){if(super(),r.length>0){let i=new Ix(e,t,n);for(let t=0;t<r.length-1;t++)i=new Ix(e,i,r[t]);t=i,n=r[r.length-1]}this.op=e,this.aNode=t,this.bNode=n,this.isOperatorNode=!0}getOperatorMethod(e,t){return e.getMethod(Lx[this.op],t)}getNodeType(e){const t=this.op,n=this.aNode,r=this.bNode,i=n.getNodeType(e),s=r?r.getNodeType(e):null;if("void"===i||"void"===s)return"void";if("%"===t)return i;if("~"===t||"&"===t||"|"===t||"^"===t||">>"===t||"<<"===t)return e.getIntegerType(i);if("!"===t||"&&"===t||"||"===t||"^^"===t)return"bool";if("=="===t||"!="===t||"<"===t||">"===t||"<="===t||">="===t){const t=Math.max(e.getTypeLength(i),e.getTypeLength(s));return t>1?`bvec${t}`:"bool"}if(e.isMatrix(i)){if("float"===s)return i;if(e.isVector(s))return e.getVectorFromMatrix(i);if(e.isMatrix(s))return i}else if(e.isMatrix(s)){if("float"===i)return s;if(e.isVector(i))return e.getVectorFromMatrix(s)}return e.getTypeLength(s)>e.getTypeLength(i)?s:i}generate(e,t){const n=this.op,{aNode:r,bNode:i}
vendor: 4,982 bytes, line 1
1=this,s=this.getNodeType(e);let a=null,o=null;"void"!==s?(a=r.getNodeType(e),o=i?i.getNodeType(e):null,"<"===n||">"===n||"<="===n||">="===n||"=="===n||"!="===n?e.isVector(a)?o=a:e.isVector(o)?a=o:a!==o&&(a=o="float"):">>"===n||"<<"===n?(a=s,o=e.changeComponentType(o,"uint")):"%"===n?(a=s,o=e.isInteger(a)&&e.isInteger(o)?o:a):e.isMatrix(a)?"float"===o?o="float":e.isVector(o)?o=e.getVectorFromMatrix(a):e.isMatrix(o)||(a=o=s):a=e.isMatrix(o)?"float"===a?"float":e.isVector(a)?e.getVectorFromMatrix(o):o=s:o=s):a=o=s;const l=r.build(e,a),u=i?i.build(e,o):null,c=e.getFunctionOperator(n);if("void"!==t){const r=e.renderer.coordinateSystem===Oe;if("=="===n||"!="===n||"<"===n||">"===n||"<="===n||">="===n)return r&&e.isVector(a)?e.format(`${this.getOperatorMethod(e,t)}( ${l}, ${u} )`,s,t):e.format(`( ${l} ${n} ${u} )`,s,t);if("%"===n)return e.isInteger(o)?e.format(`( ${l} % ${u} )`,s,t):e.format(`${this.getOperatorMethod(e,s)}( ${l}, ${u} )`,s,t);if("!"===n||"~"===n)return e.format(`(${n}${l})`,a,t);if(c)return e.format(`${c}( ${l}, ${u} )`,s,t);if(e.isMatrix(a)&&"float"===o)return e.format(`( ${u} ${n} ${l} )`,s,t);if("float"===a&&e.isMatrix(o))return e.format(`${l} ${n} ${u}`,s,t);{let i=`( ${l} ${n} ${u} )`;return!r&&"bool"===s&&e.isVector(a)&&e.isVector(o)&&(i=`all${i}`),e.format(i,s,t)}}if("void"!==a)return c?e.format(`${c}( ${l}, ${u} )`,s,t):e.isMatrix(a)&&"float"===o?e.format(`${u} ${n} ${l}`,s,t):e.format(`${l} ${n} ${u}`,s,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}}const Ox=dy(Ix,"+").setParameterLength(2,1/0).setName("add"),Bx=dy(Ix,"-").setParameterLength(2,1/0).setName("sub"),Ux=dy(Ix,"*").setParameterLength(2,1/0).setName("mul"),Fx=dy(Ix,"/").setParameterLength(2,1/0).setName("div"),kx=dy(Ix,"%").setParameterLength(2).setName("mod"),qx=dy(Ix,"==").setParameterLength(2).setName("equal"),Vx=dy(Ix,"!=").setParameterLength(2).setName("notEqual"),zx=dy(Ix,"<").setParameterLength(2).setName("lessThan"),Gx=dy(Ix,">").setParameterLength(2).setName("greaterThan"),jx=dy(Ix,"<=").setParameterLength(2).setName("lessThanEqual"),Hx=dy(Ix,">=").setParameterLength(2).setName("greaterThanEqual"),Wx=dy(Ix,"&&").setParameterLength(2,1/0).setName("and"),Xx=dy(Ix,"||").setParameterLength(2,1/0).setName("or"),Qx=dy(Ix,"!").setParameterLength(1).setName("not"),Yx=dy(Ix,"^^").setParameterLength(2).setName("xor"),$x=dy(Ix,"&").setParameterLength(2).setName("bitAnd"),Kx=dy(Ix,"~").setParameterLength(2).setName("bitNot"),Zx=dy(Ix,"|").setParameterLength(2).setName("bitOr"),Jx=dy(Ix,"^").setParameterLength(2).setName("bitXor"),eb=dy(Ix,"<<").setParameterLength(2).setName("shiftLeft"),tb=dy(Ix,">>").setParameterLength(2).setName("shiftRight"),nb=my((([e])=>(e.addAssign(1),e))),rb=my((([e])=>(e.subAssign(1),e))),ib=my((([e])=>{const t=wy(e).toConst();return e.addAssign(1),t})),sb=my((([e])=>{const t=wy(e).toConst();return e.subAssign(1),t}));Uv("add",Ox),Uv("sub",Bx),Uv("mul",Ux),Uv("div",Fx),Uv("mod",kx),Uv("equal",qx),Uv("notEqual",Vx),Uv("lessThan",zx),Uv("greaterThan",Gx),Uv("lessThanEqual",jx),Uv("greaterThanEqual",Hx),Uv("and",Wx),Uv("or",Xx),Uv("not",Qx),Uv("xor",Yx),Uv("bitAnd",$x),Uv("bitNot",Kx),Uv("bitOr",Zx),Uv("bitXor",Jx),Uv("shiftLeft",eb),Uv("shiftRight",tb),Uv("incrementBefore",nb),Uv("decrementBefore",rb),Uv("increment",ib),Uv("decrement",sb);const ab=(e,t)=>kx(e,t),ob=(e,t)=>kx(wy(e),wy(t));Uv("remainder",ab),Uv("modInt",ob);class lb extends Sv{static get type(){return"MathNode"}constructor(e,t,n=null,r=null){if(super(),(e===lb.MAX||e===lb.MIN)&&arguments.length>3){let i=new lb(e,t,n);for(let t=2;t<arguments.length-1;t++)i=new lb(e,i,arguments[t]);t=i,n=arguments[arguments.length-1],r=null}this.method=e,this.aNode=t,this.bNode=n,this.cNode=r,this.isMathNode=!0}getInputType(e){const t=this.aNode.getNodeType(e),n=this.bNode?this.bNode.getNodeType(e):null,r=this.cNode?this.cNode.getNodeType(e):null,i=e.isMatrix(t)?0:e.getTypeLength(t),s=e.isMatrix(n)?0:e.getTypeLength(n),a=e.isMatrix(r)?0:e.getTypeLength(r);return i>s&&i>a?t:s>a?n:a>i?r:t}getNodeType(e){const t=this.method;return t===lb.LENGTH||t===lb.DISTANCE||t===lb.DOT?"float":t===lb.CROSS?"vec3":t===lb.ALL||t===lb.ANY?"bool":t===lb.EQUALS?e.changeComponentType(this.aNode.getNodeType(e),"bool"):this.getInputType(e)}setup(e){const{aNode:t,bNode:n,method:r}=this;let i=null;if(r===lb.ONE_MINUS)i=Bx(1,t);else if(r===lb.RECIPROCAL)i=Fx(1,t);else if(r===lb.DIFFERENCE)i=Lb(Bx(t,n));else if(r===lb.TRANSFORM_DIRECTION){let r=t,s=n;e.isMatrix(r.getNodeType(e))?s=Iy(Ny(s),0):r=Iy(Ny(r),0);const a=Ux(r,s).xyz;i=Sb(a)}return null!==i?i:super.setup(e)}generate(e,t){if(e.getNodeProperties(this).outputNode)return super.generate(e,t);let n=this.method;const r=this.getNodeType(e),i=this.getInputType(e),s=this.aNode,a=this.bNode,o=this.cNode,l=e.renderer.coordinateSystem;if(n===lb.NEGATE)return e.format("( - "+s.build(e,i)+" )",r,t);{const u=[];return n===lb.CROSS?u.push(s.build(e,r),a.build(e,r)):l===Oe&&n===lb.
1STEP?u.push(s.build(e,1===e.getTypeLength(s.getNodeType(e))?"float":i),a.build(e,i)):l!==Oe||n!==lb.MIN&&n!==lb.MAX?n===lb.REFRACT?u.push(s.build(e,i),a.build(e,i),o.build(e,"float")):n===lb.MIX?u.push(s.build(e,i),a.build(e,i),o.build(e,1===e.getTypeLength(o.getNodeType(e))?"float":i)):(l===Be&&n===lb.ATAN&&null!==a&&(n="atan2"),"fragment"===e.shaderStage||n!==lb.DFDX&&n!==lb.DFDY||(n="/*"+n+"*/"),u.push(s.build(e,i)),null!==a&&u.push(a.build(e,i)),null!==o&&u.push(o.build(e,i))):u.push(s.build(e,i),a.build(e,1===e.getTypeLength(a.getNodeType(e))?"float":i)),e.format(`${e.getMethod(n,r)}( ${u.join(", ")} )`,r,t)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}}lb.ALL="all",lb.ANY="any",lb.RADIANS="radians",lb.DEGREES="degrees",lb.EXP="exp",lb.EXP2="exp2",lb.LOG="log",lb.LOG2="log2",lb.SQRT="sqrt",lb.INVERSE_SQRT="inversesqrt",lb.FLOOR="floor",lb.CEIL="ceil",lb.NORMALIZE="normalize",lb.FRACT="fract",lb.SIN="sin",lb.COS="cos",lb.TAN="tan",lb.ASIN="asin",lb.ACOS="acos",lb.ATAN="atan",lb.ABS="abs",lb.SIGN="sign",lb.LENGTH="length",lb.NEGATE="negate",lb.ONE_MINUS="oneMinus",lb.DFDX="dFdx",lb.DFDY="dFdy",lb.ROUND="round",lb.RECIPROCAL="reciprocal",lb.TRUNC="trunc",lb.FWIDTH="fwidth",lb.TRANSPOSE="transpose",lb.BITCAST="bitcast",lb.EQUALS="equals",lb.MIN="min",lb.MAX="max",lb.STEP="step",lb.REFLECT="reflect",lb.DISTANCE="distance",lb.DIFFERENCE="difference",lb.DOT="dot",lb.CROSS="cross",lb.POW="pow",lb.TRANSFORM_DIRECTION="transformDirection",lb.MIX="mix",lb.CLAMP="clamp",lb.REFRACT="refract",lb.SMOOTHSTEP="smoothstep",lb.FACEFORWARD="faceforward";const ub=by(1e-6),cb=by(1e6),hb=by(Math.PI),Ab=by(2*Math.PI),db=dy(lb,lb.ALL).setParameterLength(1),pb=dy(lb,lb.ANY).setParameterLength(1),fb=dy(lb,lb.RADIANS).setParameterLength(1),mb=dy(lb,lb.DEGREES).setParameterLength(1),gb=dy(lb,lb.EXP).setParameterLength(1),_b=dy(lb,lb.EXP2).setParameterLength(1),vb=dy(lb,lb.LOG).setParameterLength(1),yb=dy(lb,lb.LOG2).setParameterLength(1),xb=dy(lb,lb.SQRT).setParameterLength(1),bb=dy(lb,lb.INVERSE_SQRT).setParameterLength(1),wb=dy(lb,lb.FLOOR).setParameterLength(1),Tb=dy(lb,lb.CEIL).setParameterLength(1),Sb=dy(lb,lb.NORMALIZE).setParameterLength(1),Mb=dy(lb,lb.FRACT).setParameterLength(1),Eb=dy(lb,lb.SIN).setParameterLength(1),Cb=dy(lb,lb.COS).setParameterLength(1),Rb=dy(lb,lb.TAN).setParameterLength(1),Nb=dy(lb,lb.ASIN).setParameterLength(1),Pb=dy(lb,lb.ACOS).setParameterLength(1),Db=dy(lb,lb.ATAN).setParameterLength(1,2),Lb=dy(lb,lb.ABS).setParameterLength(1),Ib=dy(lb,lb.SIGN).setParameterLength(1),Ob=dy(lb,lb.LENGTH).setParameterLength(1),Bb=dy(lb,lb.NEGATE).setParameterLength(1),Ub=dy(lb,lb.ONE_MINUS).setParameterLength(1),Fb=dy(lb,lb.DFDX).setParameterLength(1),kb=dy(lb,lb.DFDY).setParameterLength(1),qb=dy(lb,lb.ROUND).setParameterLength(1),Vb=dy(lb,lb.RECIPROCAL).setParameterLength(1),zb=dy(lb,lb.TRUNC).setParameterLength(1),Gb=dy(lb,lb.FWIDTH).setParameterLength(1),jb=dy(lb,lb.TRANSPOSE).setParameterLength(1),Hb=dy(lb,lb.BITCAST).setParameterLength(2),Wb=(e,t)=>qx(e,t),Xb=dy(lb,lb.MIN).setParameterLength(2,1/0),Qb=dy(lb,lb.MAX).setParameterLength(2,1/0),Yb=dy(lb,lb.STEP).setParameterLength(2),$b=dy(lb,lb.REFLECT).setParameterLength(2),Kb=dy(lb,lb.DISTANCE).setParameterLength(2),Zb=dy(lb,lb.DIFFERENCE).setParameterLength(2),Jb=dy(lb,lb.DOT).setParameterLength(2),ew=dy(lb,lb.CROSS).setParameterLength(2),tw=dy(lb,lb.POW).setParameterLength(2),nw=dy(lb,lb.POW,2).setParameterLength(1),rw=dy(lb,lb.POW,3).setParameterLength(1),iw=dy(lb,lb.POW,4).setParameterLength(1),sw=dy(lb,lb.TRANSFORM_DIRECTION).setParameterLength(2),aw=e=>Ux(Ib(e),tw(Lb(e),1/3)),ow=e=>Jb(e,e),lw=dy(lb,lb.MIX).setParameterLength(3),uw=(e,t=0,n=1)=>cy(new lb(lb.CLAMP,cy(e),cy(t),cy(n))),cw=e=>uw(e),hw=dy(lb,lb.REFRACT).setParameterLength(3),Aw=dy(lb,lb.SMOOTHSTEP).setParameterLength(3),dw=dy(lb,lb.FACEFORWARD).setParameterLength(3),pw=my((([e])=>{const t=Jb(e.xy,My(12.9898,78.233)),n=kx(t,hb);return Mb(Eb(n).mul(43758.5453))})),fw=(e,t,n)=>lw(t,n,e),mw=(e,t,n)=>Aw(t,n,e),gw=(e,t)=>Db(e,t),_w=dw,vw=bb;Uv("all",db),Uv("any",pb),Uv("equals",Wb),Uv("radians",fb),Uv("degrees",mb),Uv("exp",gb),Uv("exp2",_b),Uv("log",vb),Uv("log2",yb),Uv("sqrt",xb),Uv("inverseSqrt",bb),Uv("floor",wb),Uv("ceil",Tb),Uv("normalize",Sb),Uv("fract",Mb),Uv("sin",Eb),Uv("cos",Cb),Uv("tan",Rb),Uv("asin",Nb),Uv("acos",Pb),Uv("atan",Db),Uv("abs",Lb),Uv("sign",Ib),Uv("length",Ob),Uv("lengthSq",ow),Uv("negate",Bb),Uv("oneMinus",Ub),Uv("dFdx",Fb),Uv("dFdy",kb),Uv("round",qb),Uv("reciprocal",Vb),Uv("trunc",zb),Uv("fwidth",Gb),Uv("atan2",gw),Uv("min",Xb),Uv("max",Qb),Uv("step",Yb),Uv("reflect",$b),Uv("distance",Kb),Uv("dot",Jb),Uv("cross",ew),Uv("pow",tw),Uv("pow2",nw),Uv("pow3",rw),Uv("pow4",iw),Uv("transformDirection",sw),Uv("mix",fw),Uv("
1clamp",uw),Uv("refract",hw),Uv("smoothstep",mw),Uv("faceForward",dw),Uv("difference",Zb),Uv("saturate",cw),Uv("cbrt",aw),Uv("transpose",jb),Uv("rand",pw);const yw=dy(class extends bv{static get type(){return"ConditionalNode"}constructor(e,t,n=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=n}getNodeType(e){const{ifNode:t,elseNode:n}=e.getNodeProperties(this);if(void 0===t)return this.setup(e),this.getNodeType(e);const r=t.getNodeType(e);if(null!==n){const t=n.getNodeType(e);if(e.getTypeLength(t)>e.getTypeLength(r))return t}return r}setup(e){const t=this.condNode.cache(),n=this.ifNode.cache(),r=this.elseNode?this.elseNode.cache():null,i=e.context.nodeBlock;e.getDataFromNode(n).parentNodeBlock=i,null!==r&&(e.getDataFromNode(r).parentNodeBlock=i);const s=e.getNodeProperties(this);s.condNode=t,s.ifNode=n.context({nodeBlock:n}),s.elseNode=r?r.context({nodeBlock:r}):null}generate(e,t){const n=this.getNodeType(e),r=e.getDataFromNode(this);if(void 0!==r.nodeProperty)return r.nodeProperty;const{condNode:i,ifNode:s,elseNode:a}=e.getNodeProperties(this),o=e.currentFunctionNode,l="void"!==t,u=l?jy(n).build(e):"";r.nodeProperty=u;const c=i.build(e,"bool");e.addFlowCode(`\n${e.tab}if ( ${c} ) {\n\n`).addFlowTab();let h=s.build(e,n);if(h&&(l?h=u+" = "+h+";":(h="return "+h+";",null===o&&(h="// "+h))),e.removeFlowTab().addFlowCode(e.tab+"\t"+h+"\n\n"+e.tab+"}"),null!==a){e.addFlowCode(" else {\n\n").addFlowTab();let t=a.build(e,n);t&&(l?t=u+" = "+t+";":(t="return "+t+";",null===o&&(t="// "+t))),e.removeFlowTab().addFlowCode(e.tab+"\t"+t+"\n\n"+e.tab+"}\n\n")}else e.addFlowCode("\n\n");return e.format(u,n,t)}}).setParameterLength(2,3);Uv("select",yw);const xw=(...e)=>yw(...e);Uv("cond",xw);class bw extends bv{static get type(){return"ContextNode"}constructor(e,t={}){super(),this.isContextNode=!0,this.node=e,this.value=t}getScope(){return this.node.getScope()}getNodeType(e){return this.node.getNodeType(e)}analyze(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}setup(e){const t=e.getContext();e.setContext({...e.context,...this.value}),this.node.build(e),e.setContext(t)}generate(e,t){const n=e.getContext();e.setContext({...e.context,...this.value});const r=this.node.build(e,t);return e.setContext(n),r}}const ww=dy(bw).setParameterLength(1,2),Tw=(e,t)=>ww(e,{label:t});Uv("context",ww),Uv("label",Tw);class Sw extends bv{static get type(){return"VarNode"}constructor(e,t=null,n=!1){super(),this.node=e,this.name=t,this.global=!0,this.isVarNode=!0,this.readOnly=n,this.parents=!0}getMemberType(e,t){return this.node.getMemberType(e,t)}getElementType(e){return this.node.getElementType(e)}getNodeType(e){return this.node.getNodeType(e)}generate(e){const{node:t,name:n,readOnly:r}=this,{renderer:i}=e,s=!0===i.backend.isWebGPUBackend;let a=!1,o=!1;r&&(a=e.isDeterministic(t),o=s?r:a);const l=e.getVectorType(this.getNodeType(e)),u=t.build(e,l),c=e.getVarFromNode(this,n,l,void 0,o),h=e.getPropertyName(c);let A=h;if(o)if(s)A=a?`const ${h}`:`let ${h}`;else{const n=e.getArrayCount(t);A=`const ${e.getVar(c.type,h,n)}`}return e.addLineFlowCode(`${A} = ${u}`,this),h}}const Mw=dy(Sw),Ew=(e,t=null)=>Mw(e,t).toStack(),Cw=(e,t=null)=>Mw(e,t,!0).toStack();Uv("toVar",Ew),Uv("toConst",Cw);const Rw=e=>Mw(e);Uv("temp",Rw);const Nw=dy(class extends bv{static get type(){return"VaryingNode"}constructor(e,t=null){super(),this.node=e,this.name=t,this.isVaryingNode=!0,this.interpolationType=null,this.interpolationSampling=null,this.global=!0}setInterpolation(e,t=null){return this.interpolationType=e,this.interpolationSampling=t,this}getHash(e){return this.name||super.getHash(e)}getNodeType(e){return this.node.getNodeType(e)}setupVarying(e){const t=e.getNodeProperties(this);let n=t.varying;if(void 0===n){const r=this.name,i=this.getNodeType(e),s=this.interpolationType,a=this.interpolationSampling;t.varying=n=e.getVaryingFromNode(this,r,i,s,a),t.node=this.node}return n.needsInterpolation||(n.needsInterpolation="fragment"===e.shaderStage),n}setup(e){this.setupVarying(e),e.flowNodeFromShaderStage(dv.VERTEX,this.node)}analyze(e){this.setupVarying(e),e.flowNodeFromShaderStage(dv.VERTEX,this.node)}generate(e){const t=e.getNodeProperties(this),n=this.setupVarying(e);if(void 0===t.propertyName){const r=this.getNodeType(e),i=e.getPropertyName(n,dv.VERTEX);e.flowNodeFromShaderStage(dv.VERTEX,this.node,r,i),t.propertyName=i}return e.getPropertyName(n)}}).setParameterLength(1,2),Pw=e=>Nw(e);Uv("toVarying",Nw),Uv("toVertexStage",Pw),Uv("varying",((...e)=>Nw(...e))),Uv("vertexStage",((...e)=>Nw(...e)));const Dw=my((([e])=>{const t=e.mul(.9478672986).add(.0521327014).pow(2.4),n=e.mul(.0773993808),r=e.lessThanEqual(.04045);return lw(t,n,r)}
1)).setLayout({name:"sRGBTransferEOTF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Lw=my((([e])=>{const t=e.pow(.41666).mul(1.055).sub(.055),n=e.mul(12.92),r=e.lessThanEqual(.0031308);return lw(t,n,r)})).setLayout({name:"sRGBTransferOETF",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),Iw="WorkingColorSpace";class Ow extends Sv{static get type(){return"ColorSpaceNode"}constructor(e,t,n){super("vec4"),this.colorNode=e,this.source=t,this.target=n}resolveColorSpace(e,t){return t===Iw?ut.workingColorSpace:"OutputColorSpace"===t?e.context.outputColorSpace||e.renderer.outputColorSpace:t}setup(e){const{colorNode:t}=this,n=this.resolveColorSpace(e,this.source),r=this.resolveColorSpace(e,this.target);let i=t;return!1!==ut.enabled&&n!==r&&n&&r?(ut.getTransfer(n)===Ce&&(i=Iy(Dw(i.rgb),i.a)),ut.getPrimaries(n)!==ut.getPrimaries(r)&&(i=Iy(ky(ut._getMatrix(new et,n,r)).mul(i.rgb),i.a)),ut.getTransfer(r)===Ce&&(i=Iy(Lw(i.rgb),i.a)),i):i}}const Bw=(e,t)=>cy(new Ow(cy(e),Iw,t)),Uw=(e,t)=>cy(new Ow(cy(e),t,Iw));Uv("workingToColorSpace",Bw),Uv("colorSpaceToWorking",Uw);let Fw=class extends wv{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),n=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,n,r)}};class kw extends bv{static get type(){return"ReferenceBaseNode"}constructor(e,t,n=null,r=null){super(),this.property=e,this.uniformType=t,this.object=n,this.count=r,this.properties=e.split("."),this.reference=n,this.node=null,this.group=null,this.updateType=pv.OBJECT}setGroup(e){return this.group=e,this}element(e){return cy(new Fw(this,cy(e)))}setNodeType(e){const t=Ex(null,e).getSelf();null!==this.group&&t.setGroup(this.group),this.node=t}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateValue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let n=e[t[0]];for(let e=1;e<t.length;e++)n=n[t[e]];return n}updateReference(e){return this.reference=null!==this.object?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}class qw extends kw{static get type(){return"RendererReferenceNode"}constructor(e,t,n=null){super(e,t,n),this.renderer=n,this.setGroup(Tx)}updateReference(e){return this.reference=null!==this.renderer?this.renderer:e.renderer,this.reference}}const Vw=(e,t,n=null)=>cy(new qw(e,t,n));class zw extends Sv{static get type(){return"ToneMappingNode"}constructor(e,t=jw,n=null){super("vec3"),this.toneMapping=e,this.exposureNode=t,this.colorNode=n}customCacheKey(){return Z_(this.toneMapping)}setup(e){const t=this.colorNode||e.context.color,n=this.toneMapping;if(0===n)return t;let r=null;const i=e.renderer.library.getToneMappingFunction(n);return r=null!==i?Iy(i(t.rgb,this.exposureNode),t.a):t,r}}const Gw=(e,t,n)=>cy(new zw(e,cy(t),cy(n))),jw=Vw("toneMappingExposure","float");Uv("toneMapping",((e,t,n)=>Gw(t,n,e)));class Hw extends Pv{static get type(){return"BufferAttributeNode"}constructor(e,t=null,n=0,r=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferStride=n,this.bufferOffset=r,this.usage=De,this.instanced=!1,this.attribute=null,this.global=!0,e&&!0===e.isBufferAttribute&&(this.attribute=e,this.usage=e.usage,this.instanced=e.isInstancedBufferAttribute)}getHash(e){if(0===this.bufferStride&&0===this.bufferOffset){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getNodeType(e){return null===this.bufferType&&(this.bufferType=e.getTypeFromAttribute(this.attribute)),this.bufferType}setup(e){if(null!==this.attribute)return;const t=this.getNodeType(e),n=this.value,r=e.getTypeLength(t),i=this.bufferStride||r,s=this.bufferOffset,a=!0===n.isInterleavedBuffer?n:new Hr(n,i),o=new Xr(a,r,s);a.setUsage(this.usage),this.attribute=o,this.attribute.isInstancedBufferAttribute=this.instanced}generate(e){const t=this.getNodeType(e),n=e.getBufferAttributeFromNode(this,t),r=e.getPropertyName(n);let i=null;return"vertex"===e.shaderStage||"compute"===e.shaderStage?(this.name=r,i=r):i=Nw(this).build(e,t),i}getInputType(){return"bufferAttribute"}setUsage(e){return this.usage=e,this.attribute&&!0===this.attribute.isBufferAttribute&&(this.attribute.usage=e),this}setInstanced(e){return this.instanced=e,this}}const Ww=(e,t=null,n=0,r=0)=>cy(new Hw(e,t,n,r)),Xw=(e,t=null,n=0,r=0)=>Ww(e,t,n,r).setUsage(Le),Qw=(e,t=null,n=0,r=0)=>Ww(e,t,n,r).setInstanced(!0),Yw=(e,t=null,n=0,r=0)=>Xw(e,t,n,r).setInstanced(!0);Uv("toAttribute",(e=>Ww(e.value)));class $w extends bv{static get type(){return"ComputeNode"}constructor(e,t,n=[64]){super("void"),this.isComputeNode=!0,this.computeNode=e,this.count=t,this.workgroupSize=n,this.dispatchCount=0,this.version=1,this.name="",this.updateBeforeType=pv.OBJECT,this.onInitFunction=null,this.updateDispatchCount()}dispose(){this.dispatchEvent({type:"dispose"})}label(e){return this.name=e,this}updateDispatchCount(){const{count:e,workgroupSize:t}=this;let n=t[0];for(let e=1;e<t.length;e++)n*=t[e];this.dispatchCount=Math.ceil(e/n)}onInit(e){return this.onInitFunction=e,this}updateBefore({renderer:e}){e.compute(this)}setup(e){const t=this.computeNode.build(e);return t&&(e.getNodeProperties(this).outputComputeNode=t.outputNode,t.outputNode=null),t}generate(e,t){const{shaderStage:n}=e;if("compute"===n){const t=this.computeNode.build(e,"void");""!==t&&e.addLineFlowCode(t,this)}else{const n=e.getNodeProperties(this).outputComputeNode;if(n)return n.build(e,t)}}}const Kw=(e,t,n)=>cy(new $w(cy(e),t,n));Uv("compute",Kw);class Zw extends bv{static get type(){return"CacheNode"}constructor(e,t=!0){super(),this.node=e,this.parent=t,this.isCacheNo
1de=!0}getNodeType(e){const t=e.getCache(),n=e.getCacheFromNode(this,this.parent);e.setCache(n);const r=this.node.getNodeType(e);return e.setCache(t),r}build(e,...t){const n=e.getCache(),r=e.getCacheFromNode(this,this.parent);e.setCache(r);const i=this.node.build(e,...t);return e.setCache(n),i}}const Jw=(e,t)=>cy(new Zw(cy(e),t)),eT=(e,t)=>e.context({namespace:t});Uv("cache",Jw);const tT=dy(class extends bv{static get type(){return"BypassNode"}constructor(e,t){super(),this.isBypassNode=!0,this.outputNode=e,this.callNode=t}getNodeType(e){return this.outputNode.getNodeType(e)}generate(e){const t=this.callNode.build(e,"void");return""!==t&&e.addLineFlowCode(t,this),this.outputNode.build(e)}}).setParameterLength(2);Uv("bypass",tT);class nT extends bv{static get type(){return"RemapNode"}constructor(e,t,n,r=by(0),i=by(1)){super(),this.node=e,this.inLowNode=t,this.inHighNode=n,this.outLowNode=r,this.outHighNode=i,this.doClamp=!0}setup(){const{node:e,inLowNode:t,inHighNode:n,outLowNode:r,outHighNode:i,doClamp:s}=this;let a=e.sub(t).div(n.sub(t));return!0===s&&(a=a.clamp()),a.mul(i.sub(r)).add(r)}}const rT=dy(nT,null,null,{doClamp:!1}).setParameterLength(3,5),iT=dy(nT).setParameterLength(3,5);Uv("remap",rT),Uv("remapClamp",iT);class sT extends bv{static get type(){return"ExpressionNode"}constructor(e="",t="void"){super(t),this.snippet=e}generate(e,t){const n=this.getNodeType(e),r=this.snippet;if("void"!==n)return e.format(r,n,t);e.addLineFlowCode(r,this)}}const aT=dy(sT).setParameterLength(1,2),oT=e=>(e?yw(e,aT("discard")):aT("discard")).toStack();Uv("discard",oT);class lT extends Sv{static get type(){return"RenderOutputNode"}constructor(e,t,n){super("vec4"),this.colorNode=e,this.toneMapping=t,this.outputColorSpace=n,this.isRenderOutputNode=!0}setup({context:e}){let t=this.colorNode||e.color;const n=(null!==this.toneMapping?this.toneMapping:e.toneMapping)||0,r=(null!==this.outputColorSpace?this.outputColorSpace:e.outputColorSpace)||Te;return 0!==n&&(t=t.toneMapping(n)),r!==Te&&r!==ut.workingColorSpace&&(t=t.workingToColorSpace(r)),t}}const uT=(e,t=null,n=null)=>cy(new lT(cy(e),t,n));Uv("renderOutput",uT);class cT extends Sv{static get type(){return"DebugNode"}constructor(e,t=null){super(),this.node=e,this.callback=t}getNodeType(e){return this.node.getNodeType(e)}setup(e){return this.node.build(e)}analyze(e){return this.node.build(e)}generate(e){const t=this.callback,n=this.node.build(e),r="--- TSL debug - "+e.shaderStage+" shader ---",i="-".repeat(r.length);let s="";return s+="// #"+r+"#\n",s+=e.flow.code.replace(/^\t/gm,"")+"\n",s+="/* ... */ "+n+" /* ... */\n",s+="// #"+i+"#\n",null!==t&&t(e,s),n}}const hT=(e,t=null)=>cy(new cT(cy(e),t));Uv("debug",hT);class AT extends bv{static get type(){return"AttributeNode"}constructor(e,t=null){super(t),this.global=!0,this._attributeName=e}getHash(e){return this.getAttributeName(e)}getNodeType(e){let t=this.nodeType;if(null===t){const n=this.getAttributeName(e);if(e.hasGeometryAttribute(n)){const r=e.geometry.getAttribute(n);t=e.getTypeFromAttribute(r)}else t="float"}return t}setAttributeName(e){return this._attributeName=e,this}getAttributeName(){return this._attributeName}generate(e){const t=this.getAttributeName(e),n=this.getNodeType(e);if(!0===e.hasGeometryAttribute(t)){const r=e.geometry.getAttribute(t),i=e.getTypeFromAttribute(r),s=e.getAttribute(t,i);return"vertex"===e.shaderStage?e.format(s.name,i,n):Nw(this).build(e,n)}return e.generateConst(n)}serialize(e){super.serialize(e),e.global=this.global,e._attributeName=this._attributeName}deserialize(e){super.deserialize(e),this.global=e.global,this._attributeName=e._attributeName}}const dT=(e,t=null)=>cy(new AT(e,t)),pT=(e=0)=>dT("uv"+(e>0?e:""),"vec2");const fT=dy(class extends bv{static get type(){return"TextureSizeNode"}constructor(e,t=null){super("uvec2"),this.isTextureSizeNode=!0,this.textureNode=e,this.levelNode=t}generate(e,t){const n=this.textureNode.build(e,"property"),r=null===this.levelNode?"0":this.levelNode.build(e,"int");return e.format(`${e.getMethod("textureDimensions")}( ${n}, ${r} )`,this.getNodeType(e),t)}}).setParameterLength(1,2);const mT=dy(class extends Mx{static get type(){return"MaxMipLevelNode"}constructor(e){super(0),this._textureNode=e,this.updateType=pv.FRAME}get textureNode(){return this._textureNode}get texture(){return this._textureNode.value}update(){const e=this.texture,t=e.images,n=t&&t.length>0?t[0]&&t[0].image||t[0]:e.image;if(n&&void 0!==n.width){const{width:e,height:t}=n;this.value=Math.log2(Math.max(e,t))}}}).setParameterLength(1),gT=new _t;class _T extends Mx{static get type(){return"TextureNode"}constructor(e=gT,t=null,n=null,r=null){super(e),this.isTextureNode=!0,this.uvNode=t,this.levelNode=n,this.biasNode=r,this.compareNode=null,this.depthNode=null,this.gradNode=null,this.sampler=!0,this.updateMatrix=!1,this.updateType=pv.NONE,this.referenceNode=null,this._value=e,this._matrixUniform=null,this.setUpdateMatrix(null===t)}set value(e){this.referenceNode?this.referenceNode.value=e:this._value=e}get value(){return this.referenceNode?this.referenceNode.value:this._value}getUniformHash(){return this.value.uuid}getNodeType(){return!0===this.value.isDepthTexture?"float":this.value.type===R?"uvec4":this.value.type===C?"ivec4":"vec4"}getInputType(){return"texture"}getDefaultUV(){return pT(this.value.channel)}updateReference(){return this.value}getTransformedUV(e){return null===this._matrixUniform&&(this._matrixUniform=Ex(this.value.matrix)),this._matrixUniform.mul(Ny(e,1)).xy}setUpdateMatrix(e){return this.updateMatrix=e,this.updateType=e?pv.OBJECT:pv.NONE,this}setupUV(e,t){const n=this.value;return e.isFlipY()&&(n.image instanceof ImageBitmap&&!0===n.flipY||!0===n.isRenderTargetTexture||!0===n.isFramebufferTexture||!0===n.isDepthTexture)&&(t=this.sampler?t.flipY():t.setY(wy(fT(this,this.levelNode).y).sub(t.y).sub(1))),t}setup(e){const t=e.getNodeProperties(this);t.referenceNode=this.referenceNode;const n=this.value;if(!n||!0!==n.isTexture)throw new Error("THREE.TSL: `texture( value )` function expects a valid instance of THREE.Texture().");let r=this.uvNode;null!==r&&!0!==e.context.forceUVContext||!e.context.getUV||(r=e.context.getUV(this,e)),r||(r=this.getDefaultUV()),!0===this.updateMatrix&&(r=this.getTransformedUV(r)),r=this.setupUV(e,r);let i=this.levelNode;null===i&&e.context.getTextureLevel&&(i=e.context.getTextureLevel(this)),t.uvNode=r,t.levelNode=i,t.biasNode=this.biasNode,t.compareNode=this.compareNode,t.gradNode=this.gradNode,t.depthNode=this.depthNode}generateUV(e,t){return t.build(e,!0===this.sampler?"vec2":"ivec2")}generateSnippet(e,t,n,r,i,s,a,o){const l=this.value;let u;
vendor: 4,864 bytes, line 1
1return u=r?e.generateTextureLevel(l,t,n,r,s):i?e.generateTextureBias(l,t,n,i,s):o?e.generateTextureGrad(l,t,n,o,s):a?e.generateTextureCompare(l,t,n,a,s):!1===this.sampler?e.generateTextureLoad(l,t,n,s):e.generateTexture(l,t,n,s),u}generate(e,t){const n=this.value,r=e.getNodeProperties(this),i=super.generate(e,"property");if(/^sampler/.test(t))return i+"_sampler";if(e.isReference(t))return i;{const s=e.getDataFromNode(this);let a=s.propertyName;if(void 0===a){const{uvNode:t,levelNode:n,biasNode:o,compareNode:l,depthNode:u,gradNode:c}=r,h=this.generateUV(e,t),A=n?n.build(e,"float"):null,d=o?o.build(e,"float"):null,p=u?u.build(e,"int"):null,f=l?l.build(e,"float"):null,m=c?[c[0].build(e,"vec2"),c[1].build(e,"vec2")]:null,g=e.getVarFromNode(this);a=e.getPropertyName(g);const _=this.generateSnippet(e,i,h,A,d,p,f,m);e.addLineFlowCode(`${a} = ${_}`,this),s.snippet=_,s.propertyName=a}let o=a;const l=this.getNodeType(e);return e.needsToWorkingColorSpace(n)&&(o=Uw(aT(o,l),n.colorSpace).setup(e).build(e,l)),e.format(o,l,t)}}setSampler(e){return this.sampler=e,this}getSampler(){return this.sampler}uv(e){return this.sample(e)}sample(e){const t=this.clone();return t.uvNode=cy(e),t.referenceNode=this.getSelf(),cy(t)}blur(e){const t=this.clone();t.biasNode=cy(e).mul(mT(t)),t.referenceNode=this.getSelf();const n=t.value;return!1===t.generateMipmaps&&(n&&!1===n.generateMipmaps||n.minFilter===_||n.magFilter===_)&&(t.biasNode=null),cy(t)}level(e){const t=this.clone();return t.levelNode=cy(e),t.referenceNode=this.getSelf(),cy(t)}size(e){return fT(this,e)}bias(e){const t=this.clone();return t.biasNode=cy(e),t.referenceNode=this.getSelf(),cy(t)}compare(e){const t=this.clone();return t.compareNode=cy(e),t.referenceNode=this.getSelf(),cy(t)}grad(e,t){const n=this.clone();return n.gradNode=[cy(e),cy(t)],n.referenceNode=this.getSelf(),cy(n)}depth(e){const t=this.clone();return t.depthNode=cy(e),t.referenceNode=this.getSelf(),cy(t)}serialize(e){super.serialize(e),e.value=this.value.toJSON(e.meta).uuid,e.sampler=this.sampler,e.updateMatrix=this.updateMatrix,e.updateType=this.updateType}deserialize(e){super.deserialize(e),this.value=e.meta.textures[e.value],this.sampler=e.sampler,this.updateMatrix=e.updateMatrix,this.updateType=e.updateType}update(){const e=this.value,t=this._matrixUniform;null!==t&&(t.value=e.matrix),!0===e.matrixAutoUpdate&&e.updateMatrix()}clone(){const e=new this.constructor(this.value,this.uvNode,this.levelNode,this.biasNode);return e.sampler=this.sampler,e.depthNode=this.depthNode,e.compareNode=this.compareNode,e.gradNode=this.gradNode,e}}const vT=dy(_T).setParameterLength(1,4).setName("texture"),yT=(e=gT,t=null,n=null,r=null)=>{let i;return e&&!0===e.isTextureNode?(i=cy(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=cy(t)),null!==n&&(i.levelNode=cy(n)),null!==r&&(i.biasNode=cy(r))):i=vT(e,t,n,r),i},xT=(...e)=>yT(...e).setSampler(!1);class bT extends Mx{static get type(){return"BufferNode"}constructor(e,t,n=0){super(e,t),this.isBufferNode=!0,this.bufferType=t,this.bufferCount=n}getElementType(e){return this.getNodeType(e)}getInputType(){return"buffer"}}const wT=(e,t,n)=>cy(new bT(e,t,n));class TT extends wv{static get type(){return"UniformArrayElementNode"}constructor(e,t){super(e,t),this.isArrayBufferElementNode=!0}generate(e){const t=super.generate(e),n=this.getNodeType(),r=this.node.getPaddedType();return e.format(t,r,n)}}class ST extends bT{static get type(){return"UniformArrayNode"}constructor(e,t=null){super(null),this.array=e,this.elementType=null===t?lv(e[0]):t,this.paddedType=this.getPaddedType(),this.updateType=pv.RENDER,this.isArrayBufferNode=!0}getNodeType(){return this.paddedType}getElementType(){return this.elementType}getPaddedType(){const e=this.elementType;let t="vec4";return"mat2"===e?t="mat2":!0===/mat/.test(e)?t="mat4":"i"===e.charAt(0)?t="ivec4":"u"===e.charAt(0)&&(t="uvec4"),t}update(){const{array:e,value:t}=this,n=this.elementType;if("float"===n||"int"===n||"uint"===n)for(let n=0;n<e.length;n++)t[4*n]=e[n];else if("color"===n)for(let n=0;n<e.length;n++){const r=4*n,i=e[n];t[r]=i.r,t[r+1]=i.g,t[r+2]=i.b||0}else if("mat2"===n)for(let n=0;n<e.length;n++){const r=4*n,i=e[n];t[r]=i.elements[0],t[r+1]=i.elements[1],t[r+2]=i.elements[2],t[r+3]=i.elements[3]}else if("mat3"===n)for(let n=0;n<e.length;n++){const r=16*n,i=e[n];t[r]=i.elements[0],t[r+1]=i.elements[1],t[r+2]=i.elements[2],t[r+4]=i.elements[3],t[r+5]=i.elements[4],t[r+6]=i.elements[5],t[r+8]=i.elements[6],t[r+9]=i.elements[7],t[r+10]=i.elements[8],t[r+15]=1}else if("mat4"===n)for(let n=0;n<e.length;n++){const r=16*n,i=e[n];for(let e=0;e<i.elements.length;e++)t[r+e]=i.elements[e]}else for(let n=0;n<e.length;n++){const r=4*n,i=e[n];t[r]=i.x,t[r+1]=i.y,t[r+2]=i.z||0,t[r+3]=i.w||0}}setup(e){const t=this.array.length,n=this.elementType;let r=Float32Array;const i=this.paddedType,s=e.getTypeLength(i);
1return"i"===n.charAt(0)&&(r=Int32Array),"u"===n.charAt(0)&&(r=Uint32Array),this.value=new r(t*s),this.bufferCount=t,this.bufferType=i,super.setup(e)}element(e){return cy(new TT(this,cy(e)))}}const MT=(e,t)=>cy(new ST(e,t)),ET=dy(class extends bv{constructor(e){super("float"),this.name=e,this.isBuiltinNode=!0}generate(){return this.name}}).setParameterLength(1),CT=Ex(0,"uint").label("u_cameraIndex").setGroup(bx("cameraIndex")).toVarying("v_cameraIndex"),RT=Ex("float").label("cameraNear").setGroup(Tx).onRenderUpdate((({camera:e})=>e.near)),NT=Ex("float").label("cameraFar").setGroup(Tx).onRenderUpdate((({camera:e})=>e.far)),PT=my((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const n=[];for(const t of e.cameras)n.push(t.projectionMatrix);t=MT(n).setGroup(Tx).label("cameraProjectionMatrices").element(e.isMultiViewCamera?ET("gl_ViewID_OVR"):CT).toVar("cameraProjectionMatrix")}else t=Ex("mat4").label("cameraProjectionMatrix").setGroup(Tx).onRenderUpdate((({camera:e})=>e.projectionMatrix));return t})).once()(),DT=my((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const n=[];for(const t of e.cameras)n.push(t.projectionMatrixInverse);t=MT(n).setGroup(Tx).label("cameraProjectionMatricesInverse").element(e.isMultiViewCamera?ET("gl_ViewID_OVR"):CT).toVar("cameraProjectionMatrixInverse")}else t=Ex("mat4").label("cameraProjectionMatrixInverse").setGroup(Tx).onRenderUpdate((({camera:e})=>e.projectionMatrixInverse));return t})).once()(),LT=my((({camera:e})=>{let t;if(e.isArrayCamera&&e.cameras.length>0){const n=[];for(const t of e.cameras)n.push(t.matrixWorldInverse);t=MT(n).setGroup(Tx).label("cameraViewMatrices").element(e.isMultiViewCamera?ET("gl_ViewID_OVR"):CT).toVar("cameraViewMatrix")}else t=Ex("mat4").label("cameraViewMatrix").setGroup(Tx).onRenderUpdate((({camera:e})=>e.matrixWorldInverse));return t})).once()(),IT=Ex("mat4").label("cameraWorldMatrix").setGroup(Tx).onRenderUpdate((({camera:e})=>e.matrixWorld)),OT=Ex("mat3").label("cameraNormalMatrix").setGroup(Tx).onRenderUpdate((({camera:e})=>e.normalMatrix)),BT=Ex(new Ke).label("cameraPosition").setGroup(Tx).onRenderUpdate((({camera:e},t)=>t.value.setFromMatrixPosition(e.matrixWorld))),UT=new Vt;class FT extends bv{static get type(){return"Object3DNode"}constructor(e,t=null){super(),this.scope=e,this.object3d=t,this.updateType=pv.OBJECT,this.uniformNode=new Mx(null)}getNodeType(){const e=this.scope;return e===FT.WORLD_MATRIX?"mat4":e===FT.POSITION||e===FT.VIEW_POSITION||e===FT.DIRECTION||e===FT.SCALE?"vec3":e===FT.RADIUS?"float":void 0}update(e){const t=this.object3d,n=this.uniformNode,r=this.scope;if(r===FT.WORLD_MATRIX)n.value=t.matrixWorld;else if(r===FT.POSITION)n.value=n.value||new Ke,n.value.setFromMatrixPosition(t.matrixWorld);else if(r===FT.SCALE)n.value=n.value||new Ke,n.value.setFromMatrixScale(t.matrixWorld);else if(r===FT.DIRECTION)n.value=n.value||new Ke,t.getWorldDirection(n.value);else if(r===FT.VIEW_POSITION){const r=e.camera;n.value=n.value||new Ke,n.value.setFromMatrixPosition(t.matrixWorld),n.value.applyMatrix4(r.matrixWorldInverse)}else if(r===FT.RADIUS){const r=e.object.geometry;null===r.boundingSphere&&r.computeBoundingSphere(),UT.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),n.value=UT.radius}}generate(e){const t=this.scope;return t===FT.WORLD_MATRIX?this.uniformNode.nodeType="mat4":t===FT.POSITION||t===FT.VIEW_POSITION||t===FT.DIRECTION||t===FT.SCALE?this.uniformNode.nodeType="vec3":t===FT.RADIUS&&(this.uniformNode.nodeType="float"),this.uniformNode.build(e)}serialize(e){super.serialize(e),e.scope=this.scope}deserialize(e){super.deserialize(e),this.scope=e.scope}}FT.WORLD_MATRIX="worldMatrix",FT.POSITION="position",FT.SCALE="scale",FT.VIEW_POSITION="viewPosition",FT.DIRECTION="direction",FT.RADIUS="radius";const kT=dy(FT,FT.DIRECTION).setParameterLength(1),qT=dy(FT,FT.WORLD_MATRIX).setParameterLength(1),VT=dy(FT,FT.POSITION).setParameterLength(1),zT=dy(FT,FT.SCALE).setParameterLength(1),GT=dy(FT,FT.VIEW_POSITION).setParameterLength(1),jT=dy(FT,FT.RADIUS).setParameterLength(1);class HT extends FT{static get type(){return"ModelNode"}constructor(e){super(e)}update(e){this.object3d=e.object,super.update(e)}}const WT=py(HT,HT.DIRECTION),XT=py(HT,HT.WORLD_MATRIX),QT=py(HT,HT.POSITION),YT=py(HT,HT.SCALE),$T=py(HT,HT.VIEW_POSITION),KT=py(HT,HT.RADIUS),ZT=Ex(new et).onObjectUpdate((({object:e},t)=>t.value.getNormalMatrix(e.matrixWorld))),JT=Ex(new $t).onObjectUpdate((({object:e},t)=>t.value.copy(e.matrixWorld).invert())),eS=my((e=>e.renderer.overrideNodes.modelViewMatrix||tS)).once()().toVar("modelViewMatrix"),tS=LT.mul(XT),nS=my((e=>
1(e.context.isHighPrecisionModelViewMatrix=!0,Ex("mat4").onObjectUpdate((({object:e,camera:t})=>e.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse,e.matrixWorld)))))).once()().toVar("highpModelViewMatrix"),rS=my((e=>{const t=e.context.isHighPrecisionModelViewMatrix;return Ex("mat3").onObjectUpdate((({object:e,camera:n})=>(!0!==t&&e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix))))})).once()().toVar("highpModelNormalViewMatrix"),iS=dT("position","vec3"),sS=iS.toVarying("positionLocal"),aS=iS.toVarying("positionPrevious"),oS=my((e=>XT.mul(sS).xyz.toVarying(e.getNamespace("v_positionWorld"))),"vec3").once("POSITION")(),lS=my((e=>sS.transformDirection(XT).toVarying(e.getNamespace("v_positionWorldDirection")).normalize().toVar("positionWorldDirection")),"vec3").once("POSITION")(),uS=my((e=>e.context.setupPositionView().toVarying(e.getNamespace("v_positionView"))),"vec3").once("POSITION")(),cS=uS.negate().toVarying("v_positionViewDirection").normalize().toVar("positionViewDirection");const hS=py(class extends bv{static get type(){return"FrontFacingNode"}constructor(){super("bool"),this.isFrontFacingNode=!0}generate(e){const{renderer:t,material:n}=e;return t.coordinateSystem===Oe&&1===n.side?"false":e.getFrontFacing()}}),AS=by(hS).mul(2).sub(1),dS=dT("normal","vec3"),pS=my((e=>!1===e.geometry.hasAttribute("normal")?Ny(0,1,0):dS),"vec3").once()().toVar("normalLocal"),fS=uS.dFdx().cross(uS.dFdy()).normalize().toVar("normalFlat"),mS=my((e=>{let t;return t=!0===e.material.flatShading?fS:Nw(bS(pS),"v_normalView").normalize(),t}),"vec3").once()().toVar("normalView"),gS=my((e=>{let t=mS.transformDirection(LT);return!0!==e.material.flatShading&&(t=Nw(t,"v_normalWorld")),t}),"vec3").once()().normalize().toVar("normalWorld"),_S=my((e=>{let t=e.context.setupNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(AS)),t}),"vec3").once()().toVar("transformedNormalView"),vS=_S.transformDirection(LT).toVar("transformedNormalWorld"),yS=my((e=>{let t=e.context.setupClearcoatNormal().context({getUV:null});return!0!==e.material.flatShading&&(t=t.mul(AS)),t}),"vec3").once()().toVar("transformedClearcoatNormalView"),xS=my((([e,t=XT])=>{const n=ky(t),r=e.div(Ny(n[0].dot(n[0]),n[1].dot(n[1]),n[2].dot(n[2])));return n.mul(r).xyz})),bS=my((([e],t)=>{const n=t.renderer.overrideNodes.modelNormalViewMatrix;if(null!==n)return n.transformDirection(e);const r=ZT.mul(e);return LT.transformDirection(r)})),wS=new on,TS=new $t,SS=Ex(0).onReference((({material:e})=>e)).onObjectUpdate((({material:e})=>e.refractionRatio)),MS=Ex(1).onReference((({material:e})=>e)).onObjectUpdate((function({material:e,scene:t}){return e.envMap?e.envMapIntensity:t.environmentIntensity})),ES=Ex(new $t).onReference((function(e){return e.material})).onObjectUpdate((function({material:e,scene:t}){const n=null!==t.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation;return n?(wS.copy(n),TS.makeRotationFromEuler(wS)):TS.identity(),TS})),CS=cS.negate().reflect(_S),RS=cS.negate().refract(_S,SS),NS=CS.transformDirection(LT).toVar("reflectVector"),PS=RS.transformDirection(LT).toVar("reflectVector"),DS=new kr;const LS=dy(class extends _T{static get type(){return"CubeTextureNode"}constructor(e,t=null,n=null,r=null){super(e,t,n,r),this.isCubeTextureNode=!0}getInputType(){return"cubeTexture"}getDefaultUV(){const e=this.value;return e.mapping===c?NS:e.mapping===h?PS:Ny(0,0,0)}setUpdateMatrix(){}setupUV(e,t){const n=this.value;return e.renderer.coordinateSystem!==Be&&n.isRenderTargetTexture||(t=Ny(t.x.negate(),t.yz)),ES.mul(t)}generateUV(e,t){return t.build(e,"vec3")}}).setParameterLength(1,4).setName("cubeTexture"),IS=(e=DS,t=null,n=null,r=null)=>{let i;return e&&!0===e.isCubeTextureNode?(i=cy(e.clone()),i.referenceNode=e.getSelf(),null!==t&&(i.uvNode=cy(t)),null!==n&&(i.levelNode=cy(n)),null!==r&&(i.biasNode=cy(r))):i=LS(e,t,n,r),i};class OS extends wv{static get type(){return"ReferenceElementNode"}constructor(e,t){super(e,t),this.referenceNode=e,this.isReferenceElementNode=!0}getNodeType(){return this.referenceNode.uniformType}generate(e){const t=super.generate(e),n=this.referenceNode.getNodeType(),r=this.getNodeType();return e.format(t,n,r)}}class BS extends bv{static get type(){return"ReferenceNode"}constructor(e,t,n=null,r=null){super(),this.property=e,this.uniformType=t,this.object=n,this.count=r,this.properties=e.split("."),this.reference=n,this.node=null,this.group=null,this.name=null,this.updateType=pv.OBJECT}element(e){return cy(new OS(this,cy(e)))}setGroup(e){return this.group=e,this}label(e){return this.name=e,this}setNodeType(e){let t=null;t=null!==this.count?wT(null,e,this.count):Array.isArray(this.getValueFromReference())?MT(null,e):"texture"===e?yT(null):"cubeTexture"===e?IS(null):Ex(null,e),null!==this.group&&t.setGroup(this.group),null!==this.name&&t.label(this.name),this.node=t.getSelf()}getNodeType(e){return null===this.node&&(this.updateReference(e),this.updateV
1alue()),this.node.getNodeType(e)}getValueFromReference(e=this.reference){const{properties:t}=this;let n=e[t[0]];for(let e=1;e<t.length;e++)n=n[t[e]];return n}updateReference(e){return this.reference=null!==this.object?this.object:e.object,this.reference}setup(){return this.updateValue(),this.node}update(){this.updateValue()}updateValue(){null===this.node&&this.setNodeType(this.uniformType);const e=this.getValueFromReference();Array.isArray(e)?this.node.array=e:this.node.value=e}}const US=(e,t,n)=>cy(new BS(e,t,n)),FS=(e,t,n,r)=>cy(new BS(e,t,r,n));class kS extends BS{static get type(){return"MaterialReferenceNode"}constructor(e,t,n=null){super(e,t,n),this.material=n,this.isMaterialReferenceNode=!0}updateReference(e){return this.reference=null!==this.material?this.material:e.material,this.reference}}const qS=(e,t,n=null)=>cy(new kS(e,t,n)),VS=my((e=>(!1===e.geometry.hasAttribute("tangent")&&e.geometry.computeTangents(),dT("tangent","vec4"))))(),zS=VS.xyz.toVar("tangentLocal"),GS=eS.mul(Iy(zS,0)).xyz.toVarying("v_tangentView").normalize().toVar("tangentView"),jS=GS.transformDirection(LT).toVarying("v_tangentWorld").normalize().toVar("tangentWorld"),HS=GS.toVar("transformedTangentView"),WS=HS.transformDirection(LT).normalize().toVar("transformedTangentWorld"),XS=my((([e,t],n)=>{let r=e.mul(VS.w).xyz;return!0!==n.material.flatShading&&(r=Nw(r,t)),r})).once(),QS=XS(dS.cross(VS),"v_bitangentGeometry").normalize().toVar("bitangentGeometry"),YS=XS(pS.cross(zS),"v_bitangentLocal").normalize().toVar("bitangentLocal"),$S=XS(mS.cross(GS),"v_bitangentView").normalize().toVar("bitangentView"),KS=XS(gS.cross(jS),"v_bitangentWorld").normalize().toVar("bitangentWorld"),ZS=XS(_S.cross(HS),"v_transformedBitangentView").normalize().toVar("transformedBitangentView"),JS=ZS.transformDirection(LT).normalize().toVar("transformedBitangentWorld"),eM=ky(GS,$S,mS),tM=cS.mul(eM),nM=(()=>{let e=ax.cross(cS);return e=e.cross(ax).normalize(),e=lw(e,_S,ix.mul(Qy.oneMinus()).oneMinus().pow2().pow2()).normalize(),e})(),rM=my((e=>{const{eye_pos:t,surf_norm:n,mapN:r,uv:i}=e,s=t.dFdx(),a=t.dFdy(),o=i.dFdx(),l=i.dFdy(),u=n,c=a.cross(u),h=u.cross(s),A=c.mul(o.x).add(h.mul(l.x)),d=c.mul(o.y).add(h.mul(l.y)),p=A.dot(A).max(d.dot(d)),f=AS.mul(p.inverseSqrt());return Ox(A.mul(r.x,f),d.mul(r.y,f),u.mul(r.z)).normalize()}));const iM=dy(class extends Sv{static get type(){return"NormalMapNode"}constructor(e,t=null){super("vec3"),this.node=e,this.scaleNode=t,this.normalMapType=0}setup(e){const{normalMapType:t,scaleNode:n}=this;let r=this.node.mul(2).sub(1);null!==n&&(r=Ny(r.xy.mul(n),r.z));let i=null;return 1===t?i=bS(r):0===t&&(i=!0===e.hasGeometryAttribute("tangent")?eM.mul(r).normalize():rM({eye_pos:uS,surf_norm:mS,mapN:r,uv:pT()})),i}}).setParameterLength(1,2),sM=my((({textureNode:e,bumpScale:t})=>{const n=t=>e.cache().context({getUV:e=>t(e.uvNode||pT()),forceUVContext:!0}),r=by(n((e=>e)));return My(by(n((e=>e.add(e.dFdx())))).sub(r),by(n((e=>e.add(e.dFdy())))).sub(r)).mul(t)})),aM=my((e=>{const{surf_pos:t,surf_norm:n,dHdxy:r}=e,i=t.dFdx().normalize(),s=n,a=t.dFdy().normalize().cross(s),o=s.cross(i),l=i.dot(a).mul(AS),u=l.sign().mul(r.x.mul(a).add(r.y.mul(o)));return l.abs().mul(n).sub(u).normalize()}));const oM=dy(class extends Sv{static get type(){return"BumpMapNode"}constructor(e,t=null){super("vec3"),this.textureNode=e,this.scaleNode=t}setup(){const e=null!==this.scaleNode?this.scaleNode:1,t=sM({textureNode:this.textureNode,bumpScale:e});return aM({surf_pos:uS,surf_norm:mS,dHdxy:t})}}).setParameterLength(1,2),lM=new Map;class uM extends bv{static get type(){return"MaterialNode"}constructor(e){super(),this.scope=e}getCache(e,t){let n=lM.get(e);return void 0===n&&(n=qS(e,t),lM.set(e,n)),n}getFloat(e){return this.getCache(e,"float")}getColor(e){return this.getCache(e,"color")}getTexture(e){return this.getCache("map"===e?"map":e+"Map","texture")}setup(e){const t=e.context.material,n=this.scope;let r=null;if(n===uM.COLOR){const e=void 0!==t.color?this.getColor(n):Ny();r=t.map&&!0===t.map.isTexture?e.mul(this.getTexture("map")):e}else if(n===uM.OPACITY){const e=this.getFloat(n);r=t.alphaMap&&!0===t.alphaMap.isTexture?e.mul(this.getTexture("alpha")):e}else if(n===uM.SPECULAR_STRENGTH)r=t.specularMap&&!0===t.specularMap.isTexture?this.getTexture("specular").r:by(1);else if(n===uM.SPECULAR_INTENSITY){const e=this.getFloat(n);r=t.specularIntensityMap&&!0===t.specularIntensityMap.isTexture?e.mul(this.getTexture(n).a):e}else if(n===uM.SPECULAR_COLOR){const e=this.getColor(n);r=t.specularColorMap&&!0===t.specularColorMap.isTexture?e.mul(this.getTexture(n).rgb):e}else if(n===uM.ROUGHNESS){const e=this.getFloat(n);r=t.roughnessMap&&!0===t.roughnessMap.isTexture?e.mul(this.getTexture(n).g):e}else if(n===uM.METALNESS){const e=this.getFloat(n);r=t.metalnessMap&&!0===t.metalnessMap.isTexture?e.mul(this.getTexture(n).b):e}else if(n===uM.EMISSIVE){const e=this.getFloat("emissiveIntensity"),i=this.getColor(n).mul(e);r=t.emissiveMap&&!0===t.emissiveMap.isTexture?i.mul(this.getTexture(n)):i}else if(n===uM.NORMAL)t.normalMap?(r=iM(this.getTexture("normal"),this.getCache("normalScale","vec2")),r.normalMapType=t.normalMapType):r=t.bumpMap?oM(this.getTexture("bump").r,this.getFloat("bumpScale")):mS;else if(n===uM.CLEARCOAT){const e=this.getFloat(n);r=t.clearcoatMap&&!0===t.clearcoatMap.isTexture?e.mul(this.getTexture(n).r):e}else if(n===uM.CLEARCOAT_ROUGHNESS){const e=this.getFloat(n);r=t.clearcoatRoughnessMap&&!0===t.clearcoatRoughnessMap.isTexture?e.mul(this.getTexture(n).r):e}else if(n===uM.CLEARCOAT_NORMAL)r=t.clearcoatNormalMap?iM(this.getTexture(n),this.getCache(n+"Scale","vec2")):mS;else if(n===uM.SHEEN){const e=this.getColor("sheenColor").mul(this.getFloat("sheen"));r=t.sheenColorMap&&!0===t.sheenColorMap.isTexture?e.mul(this.getTexture("sheenColor").rgb):e}else if(n===uM.SHEEN_ROUGHNESS){const e=this.getFloat(n);r=t.sheenRoughnessMap&&!0===t.sheenRoughnessMap.isTexture?e.mul(this.getTexture(n).a):e,r=r.clamp(.07,1)}else if(n===uM.ANISOTROPY)if(t.anisotropyMap&&!0===t.anisotropyMap.isTexture){const e=this.getTexture(n);r=Fy(XM.x,XM.y,XM.y.negate(),XM.x).mul(e.rg.mul(2).sub(My(1)).normalize().mul(e.b))}else r=XM;else if(n===uM.IRIDESCENCE_THICKNESS){const e=US("1","float",t.iridescenceThicknessRange);
1if(t.iridescenceThicknessMap){const i=US("0","float",t.iridescenceThicknessRange);r=e.sub(i).mul(this.getTexture(n).g).add(i)}else r=e}else if(n===uM.TRANSMISSION){const e=this.getFloat(n);r=t.transmissionMap?e.mul(this.getTexture(n).r):e}else if(n===uM.THICKNESS){const e=this.getFloat(n);r=t.thicknessMap?e.mul(this.getTexture(n).g):e}else if(n===uM.IOR)r=this.getFloat(n);else if(n===uM.LIGHT_MAP)r=this.getTexture(n).rgb.mul(this.getFloat("lightMapIntensity"));else if(n===uM.AO)r=this.getTexture(n).r.sub(1).mul(this.getFloat("aoMapIntensity")).add(1);else if(n===uM.LINE_DASH_OFFSET)r=t.dashOffset?this.getFloat(n):by(0);else{const t=this.getNodeType(e);r=this.getCache(n,t)}return r}}uM.ALPHA_TEST="alphaTest",uM.COLOR="color",uM.OPACITY="opacity",uM.SHININESS="shininess",uM.SPECULAR="specular",uM.SPECULAR_STRENGTH="specularStrength",uM.SPECULAR_INTENSITY="specularIntensity",uM.SPECULAR_COLOR="specularColor",uM.REFLECTIVITY="reflectivity",uM.ROUGHNESS="roughness",uM.METALNESS="metalness",uM.NORMAL="normal",uM.CLEARCOAT="clearcoat",uM.CLEARCOAT_ROUGHNESS="clearcoatRoughness",uM.CLEARCOAT_NORMAL="clearcoatNormal",uM.EMISSIVE="emissive",uM.ROTATION="rotation",uM.SHEEN="sheen",uM.SHEEN_ROUGHNESS="sheenRoughness",uM.ANISOTROPY="anisotropy",uM.IRIDESCENCE="iridescence",uM.IRIDESCENCE_IOR="iridescenceIOR",uM.IRIDESCENCE_THICKNESS="iridescenceThickness",uM.IOR="ior",uM.TRANSMISSION="transmission",uM.THICKNESS="thickness",uM.ATTENUATION_DISTANCE="attenuationDistance",uM.ATTENUATION_COLOR="attenuationColor",uM.LINE_SCALE="scale",uM.LINE_DASH_SIZE="dashSize",uM.LINE_GAP_SIZE="gapSize",uM.LINE_WIDTH="linewidth",uM.LINE_DASH_OFFSET="dashOffset",uM.POINT_SIZE="size",uM.DISPERSION="dispersion",uM.LIGHT_MAP="light",uM.AO="ao";const cM=py(uM,uM.ALPHA_TEST),hM=py(uM,uM.COLOR),AM=py(uM,uM.SHININESS),dM=py(uM,uM.EMISSIVE),pM=py(uM,uM.OPACITY),fM=py(uM,uM.SPECULAR),mM=py(uM,uM.SPECULAR_INTENSITY),gM=py(uM,uM.SPECULAR_COLOR),_M=py(uM,uM.SPECULAR_STRENGTH),vM=py(uM,uM.REFLECTIVITY),yM=py(uM,uM.ROUGHNESS),xM=py(uM,uM.METALNESS),bM=py(uM,uM.NORMAL),wM=py(uM,uM.CLEARCOAT),TM=py(uM,uM.CLEARCOAT_ROUGHNESS),SM=py(uM,uM.CLEARCOAT_NORMAL),MM=py(uM,uM.ROTATION),EM=py(uM,uM.SHEEN),CM=py(uM,uM.SHEEN_ROUGHNESS),RM=py(uM,uM.ANISOTROPY),NM=py(uM,uM.IRIDESCENCE),PM=py(uM,uM.IRIDESCENCE_IOR),DM=py(uM,uM.IRIDESCENCE_THICKNESS),LM=py(uM,uM.TRANSMISSION),IM=py(uM,uM.THICKNESS),OM=py(uM,uM.IOR),BM=py(uM,uM.ATTENUATION_DISTANCE),UM=py(uM,uM.ATTENUATION_COLOR),FM=py(uM,uM.LINE_SCALE),kM=py(uM,uM.LINE_DASH_SIZE),qM=py(uM,uM.LINE_GAP_SIZE),VM=py(uM,uM.LINE_WIDTH),zM=py(uM,uM.LINE_DASH_OFFSET),GM=py(uM,uM.POINT_SIZE),jM=py(uM,uM.DISPERSION),HM=py(uM,uM.LIGHT_MAP),WM=py(uM,uM.AO),XM=Ex(new Ye).onReference((function(e){return e.material})).onRenderUpdate((function({material:e}){this.value.set(e.anisotropy*Math.cos(e.anisotropyRotation),e.anisotropy*Math.sin(e.anisotropyRotation))})),QM=my((e=>e.context.setupModelViewProjection()),"vec4").once()().toVarying("v_modelViewProjection");class YM extends bv{static get type(){return"IndexNode"}constructor(e){super("uint"),this.scope=e,this.isIndexNode=!0}generate(e){const t=this.getNodeType(e),n=this.scope;let r,i;if(n===YM.VERTEX)r=e.getVertexIndex();else if(n===YM.INSTANCE)r=e.getInstanceIndex();else if(n===YM.DRAW)r=e.getDrawIndex();else if(n===YM.INVOCATION_LOCAL)r=e.getInvocationLocalIndex();else if(n===YM.INVOCATION_SUBGROUP)r=e.getInvocationSubgroupIndex();else{if(n!==YM.SUBGROUP)throw new Error("THREE.IndexNode: Unknown scope: "+n);r=e.getSubgroupIndex()}return i="vertex"===e.shaderStage||"compute"===e.shaderStage?r:Nw(this).build(e,t),i}}YM.VERTEX="vertex",YM.INSTANCE="instance",YM.SUBGROUP="subgroup",YM.INVOCATION_LOCAL="invocationLocal",YM.INVOCATION_SUBGROUP="invocationSubgroup",YM.DRAW="draw";const $M=py(YM,YM.VERTEX),KM=py(YM,YM.INSTANCE),ZM=py(YM,YM.SUBGROUP),JM=py(YM,YM.INVOCATION_SUBGROUP),eE=py(YM,YM.INVOCATION_LOCAL),tE=py(YM,YM.DRAW);class nE extends bv{static get type(){return"InstanceNode"}constructor(e,t,n=null){super("void"),this.count=e,this.instanceMatrix=t,this.instanceColor=n,this.instanceMatrixNode=null,this.instanceColorNode=null,this.updateType=pv.FRAME,this.buffer=null,this.bufferColor=null}setup(e){const{count:t,instanceMatrix:n,instanceColor:r}=this;let{instanceMatrixNode:i,instanceColorNode:s}=this;
vendor: 11,828 bytes, line 1
1if(null===i){if(t<=1e3)i=wT(n.array,"mat4",Math.max(t,1)).element(KM);else{const e=new ca(n.array,16,1);this.buffer=e;const t=n.usage===Le?Yw:Qw,r=[t(e,"vec4",16,0),t(e,"vec4",16,4),t(e,"vec4",16,8),t(e,"vec4",16,12)];i=qy(...r)}this.instanceMatrixNode=i}if(r&&null===s){const e=new Yr(r.array,3),t=r.usage===Le?Yw:Qw;this.bufferColor=e,s=Ny(t(e,"vec3",3,0)),this.instanceColorNode=s}const a=i.mul(sS).xyz;if(sS.assign(a),e.hasGeometryAttribute("normal")){const e=xS(pS,i);pS.assign(e)}null!==this.instanceColorNode&&Hy("vec3","vInstanceColor").assign(this.instanceColorNode)}update(){this.instanceMatrix.usage!==Le&&null!==this.buffer&&this.instanceMatrix.version!==this.buffer.version&&(this.buffer.version=this.instanceMatrix.version),this.instanceColor&&this.instanceColor.usage!==Le&&null!==this.bufferColor&&this.instanceColor.version!==this.bufferColor.version&&(this.bufferColor.version=this.instanceColor.version)}}const rE=dy(nE).setParameterLength(2,3);const iE=dy(class extends nE{static get type(){return"InstancedMeshNode"}constructor(e){const{count:t,instanceMatrix:n,instanceColor:r}=e;super(t,n,r),this.instancedMesh=e}}).setParameterLength(1);const sE=dy(class extends bv{static get type(){return"BatchNode"}constructor(e){super("void"),this.batchMesh=e,this.batchingIdNode=null}setup(e){null===this.batchingIdNode&&(null===e.getDrawIndex()?this.batchingIdNode=KM:this.batchingIdNode=tE);const t=my((([e])=>{const t=wy(fT(xT(this.batchMesh._indirectTexture),0).x),n=wy(e).mod(t),r=wy(e).div(t);return xT(this.batchMesh._indirectTexture,Ey(n,r)).x})).setLayout({name:"getIndirectIndex",type:"uint",inputs:[{name:"id",type:"int"}]}),n=t(wy(this.batchingIdNode)),r=this.batchMesh._matricesTexture,i=wy(fT(xT(r),0).x),s=by(n).mul(4).toInt().toVar(),a=s.mod(i),o=s.div(i),l=qy(xT(r,Ey(a,o)),xT(r,Ey(a.add(1),o)),xT(r,Ey(a.add(2),o)),xT(r,Ey(a.add(3),o))),u=this.batchMesh._colorsTexture;if(null!==u){const e=my((([e])=>{const t=wy(fT(xT(u),0).x),n=e,r=n.mod(t),i=n.div(t);return xT(u,Ey(r,i)).rgb})).setLayout({name:"getBatchingColor",type:"vec3",inputs:[{name:"id",type:"int"}]}),t=e(n);Hy("vec3","vBatchColor").assign(t)}const c=ky(l);sS.assign(l.mul(sS));const h=pS.div(Ny(c[0].dot(c[0]),c[1].dot(c[1]),c[2].dot(c[2]))),A=c.mul(h).xyz;pS.assign(A),e.hasGeometryAttribute("tangent")&&zS.mulAssign(c)}}).setParameterLength(1);const aE=dy(class extends wv{static get type(){return"StorageArrayElementNode"}constructor(e,t){super(e,t),this.isStorageArrayElementNode=!0}set storageBufferNode(e){this.node=e}get storageBufferNode(){return this.node}getMemberType(e,t){const n=this.storageBufferNode.structTypeNode;return n?n.getMemberType(e,t):"void"}setup(e){return!1===e.isAvailable("storageBuffer")&&!0===this.node.isPBO&&e.setupPBO(this.node),super.setup(e)}generate(e,t){let n;const r=e.context.assign;if(n=!1===e.isAvailable("storageBuffer")?!0!==this.node.isPBO||!0===r||!this.node.value.isInstancedBufferAttribute&&"compute"===e.shaderStage?this.node.build(e):e.generatePBO(this):super.generate(e),!0!==r){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}).setParameterLength(2);class oE extends bT{static get type(){return"StorageBufferNode"}constructor(e,t=null,n=0){let r,i=null;t&&t.isStruct?(r="struct",i=t.layout,(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)&&(n=e.count)):null===t&&(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute)?(r=rv(e.itemSize),n=e.count):r=t,super(e,r,n),this.isStorageBufferNode=!0,this.structTypeNode=i,this.access=fv.READ_WRITE,this.isAtomic=!1,this.isPBO=!1,this._attribute=null,this._varying=null,this.global=!0,!0!==e.isStorageBufferAttribute&&!0!==e.isStorageInstancedBufferAttribute&&(e.isInstancedBufferAttribute?e.isStorageInstancedBufferAttribute=!0:e.isStorageBufferAttribute=!0)}getHash(e){if(0===this.bufferCount){let t=e.globalCache.getData(this.value);return void 0===t&&(t={node:this},e.globalCache.setData(this.value,t)),t.node.uuid}return this.uuid}getInputType(){return this.value.isIndirectStorageBufferAttribute?"indirectStorageBuffer":"storageBuffer"}element(e){return aE(this,e)}setPBO(e){return this.isPBO=e,this}getPBO(){return this.isPBO}setAccess(e){return this.access=e,this}toReadOnly(){return this.setAccess(fv.READ_ONLY)}setAtomic(e){return this.isAtomic=e,this}toAtomic(){return this.setAtomic(!0)}getAttributeData(){return null===this._attribute&&(this._attribute=Ww(this.value),this._varying=Nw(this._attribute)),{attribute:this._attribute,varying:this._varying}}getNodeType(e){if(null!==this.structTypeNode)return this.structTypeNode.getNodeType(e);if(e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.getNodeType(e);const{attribute:t}=this.getAttributeData();return t.getNodeType(e)}getMemberType(e,t){return null!==this.structTypeNode?this.structTypeNode.getMemberType(e,t):"void"}generate(e){if(null!==this.structTypeNode&&this.structTypeNode.build(e),e.isAvailable("storageBuffer")||e.isAvailable("indirectStorageBuffer"))return super.generate(e);const{attribute:t,varying:n}=this.getAttributeData(),r=n.build(e);return e.registerTransform(r,t),r}}const lE=(e,t=null,n=0)=>cy(new oE(e,t,n)),uE=new WeakMap;class cE extends bv{static get type(){return"SkinningNode"}constructor(e){super("void"),this.skinnedMesh=e,this.updateType=pv.OBJECT,this.skinIndexNode=dT("skinIndex","uvec4"),this.skinWeightNode=dT("skinWeight","vec4"),this.bindMatrixNode=US("bindMatrix","mat4"),this.bindMatrixInverseNode=US("bindMatrixInverse","mat4"),this.boneMatricesNode=FS("skeleton.boneMatrices","mat4",e.skeleton.bones.length),this.positionNode=sS,this.toPositionNode=sS,this.previousBoneMatricesNode=null}getSkinnedPosition(e=this.boneMatricesNode,t=this.positionNode){const{skinIndexNode:n,skinWeightNode:r,bindMatrixNode:i,bindMatrixInverseNode:s}=this,a=e.element(n.x),o=e.element(n.y),l=e.element(n.z),u=e.element(n.w),c=i.mul(t),h=Ox(a.mul(r.x).mul(c),o.mul(r.y).mul(c),l.mul(r.z).mul(c),u.mul(r.w).mul(c));return s.mul(h).xyz}getSkinnedNormal(e=this.boneMatricesNode,t=pS){const{skinIndexNode:n,skinWeightNode:r,bindMatrixNode:i,bindMatrixInverseNode:s}=this,a=e.element(n.x),o=e.element(n.y),l=e.element(n.z),u=e.element(n.w);let c=Ox(r.x.mul(a),r.y.mul(o),r.z.mul(l),r.w.mul(u));return c=s.mul(c).mul(i),c.transformDirection(t).xyz}getPreviousSkinnedPosition(e){const t=e.object;return null===this.previousBoneMatricesNode&&(t.skeleton.previousBoneMatrices=new Float32Array(t.skeleton.boneMatrices),this.previousBoneMatricesNode=FS("skeleton.previousBoneMatrices","mat4",t.skeleton.bones.length)),this.getSkinnedPosition(this.previousBoneMatricesNode,aS)}needsPreviousBoneMatrices(e){const t=e.renderer.getMRT();return t&&t.has("velocity")||!0===cv(e.object).useVelocity}setup(e){this.needsPreviousBoneMatrices(e)&&aS.assign(this.getPreviousSkinnedPosition(e));const t=this.getSkinnedPosition();if(this.toPositionNode&&this.toPositionNode.assign(t),e.hasGeometryAttribute("normal")){const t=this.getSkinnedNormal();pS.assign(t),e.hasGeometryAttribute("tangent")&&zS.assign(t)}return t}generate(e,t){if("void"!==t)return super.generate(e,t)}update(e){const t=e.object&&e.object.skeleton?e.object.skeleton:this.skinnedMesh.skeleton;uE.get(t)!==e.frameId&&(uE.set(t,e.frameId),null!==this.previousBoneMatricesNode&&t.previousBoneMatrices.set(t.boneMatrices),t.update())}}const hE=e=>cy(new cE(e));class AE extends bv{static get type(){return"LoopNode"}constructor(e=[]){super(),this.params=e}getVarName(e){return String.fromCharCode("i".charCodeAt(0)+e)}getProperties(e){const t=e.getNodeProperties(this);if(void 0!==t.stackNode)return t;const n={};for(let e=0,t=this.params.length-1;e<t;e++){const t=this.params[e],r=!0!==t.isNode&&t.name||this.getVarName(e),i=!0!==t.isNode&&t.type||"int";n[r]=aT(r,i)}const r=e.addStack();t.returnsNode=this.params[this.params.length-1](n,e),t.stackNode=r;const i=this.params[0];return!0!==i.isNode&&"function"==typeof i.update&&(t.updateNode=my(this.params[0].update)(n)),e.removeStack(),t}getNodeType(e){const{returnsNode:t}=this.getProperties(e);return t?t.getNodeType(e):"void"}setup(e){this.getProperties(e)}generate(e){const t=this.getProperties(e),n=this.params,r=t.stackNode;for(let r=0,i=n.length-1;r<i;r++){const i=n[r];let s,a=!1,o=null,l=null,u=null,c=null,h=null,A=null;if(i.isNode?"bool"===i.getNodeType(e)?(a=!0,c="bool",l=i.build(e,c)):(c="int",u=this.getVarName(r),o="0",l=i.build(e,c),h="<"):(c=i.type||"int",u=i.name||this.getVarName(r),o=i.start,l=i.end,h=i.condition,A=i.update,"number"==typeof o?o=e.generateConst(c,o):o&&o.isNode&&(o=o.build(e,c)),"number"==typeof l?l=e.generateConst(c,l):l&&l.isNode&&(l=l.build(e,c)),void 0!==o&&void 0===l?(o+=" - 1",l="0",h=">="):void 0!==l&&void 0===o&&(o="0",h="<"),void 0===h&&(h=Number(o)>Number(l)?">=":"<")),a)s=`while ( ${l} )`;else{const n={start:o,end:l},r=n.start,i=n.end;let a;const d=()=>h.includes("<")?"+=":"-=";if(null!=A)switch(typeof A){case"function":a=e.flowStagesNode(t.updateNode,"void").code.replace(/\t|;/g,"");break;case"number":a=u+" "+d()+" "+e.generateConst(c,A);break;case"string":a=u+" "+A;break;default:a=A.isNode?u+" "+d()+" "+A.build(e):"break /* invalid update */"}else A="int"===c||"uint"===c?h.includes("<")?"++":"--":d()+" 1.",a=u+" "+A;s=`for ( ${e.getVar(c,u)+" = "+r}; ${u+" "+h+" "+i}; ${a} )`}e.addFlowCode((0===r?"\n":"")+e.tab+s+" {\n\n").addFlowTab()}const i=r.build(e,"void"),s=t.returnsNode?t.returnsNode.build(e):"";e.removeFlowTab().addFlowCode("\n"+e.tab+i);for(let t=0,n=this.params.length-1;t<n;t++)e.addFlowCode((0===t?"":e.tab)+"}\n\n").removeFlowTab();return e.addFlowTab(),s}}const dE=(...e)=>cy(new AE(Ay(e,"int"))).toStack(),pE=()=>aT("break").toStack(),fE=new WeakMap,mE=new vt,gE=my((({bufferMap:e,influence:t,stride:n,width:r,depth:i,offset:s})=>{const a=wy($M).mul(n).add(s),o=a.div(r),l=a.sub(o.mul(r));return xT(e,Ey(l,o)).depth(i).xyz.mul(t)}));const _E=dy(class extends bv{static get type(){return"MorphNode"}constructor(e){super("void"),this.mesh=e,this.morphBaseInfluence=Ex(1),this.updateType=pv.OBJECT}setup(e){const{geometry:t}=e,n=void 0!==t.morphAttributes.position,r=t.hasAttribute("normal")&&void 0!==t.morphAttributes.normal,i=t.morphAttributes.position||t.morphAttributes.normal||t.morphAttributes.color,s=void 0!==i?i.length:0,{texture:a,stride:o,size:l}=function(e){const t=void 0!==e.morphAttributes.position,n=void 0!==e.morphAttributes.normal,r=void 0!==e.morphAttributes.color,i=e.morphAttributes.position||e.morphAttributes.normal||e.morphAttributes.color,s=void 0!==i?i.length:0;let a=fE.get(e);if(void 0===a||a.count!==s){void 0!==a&&a.texture.dispose();const i=e.morphAttributes.position||[],o=e.morphAttributes.normal||[],l=e.morphAttributes.color||[];let u=0;!0===t&&(u=1),!0===n&&(u=2),!0===r&&(u=3);let c=e.attributes.position.count*u,h=1;const A=4096;c>A&&(h=Math.ceil(c/A),c=A);const d=new Float32Array(c*h*4*s),p=new bt(d,c,h,s);p.type=N,p.needsUpdate=!0;const f=4*u;for(let e=0;e<s;e++){const s=i[e],a=o[e],u=l[e],A=c*h*4*e;for(let e=0;e<s.count;e++){const i=e*f;!0===t&&(mE.fromBufferAttribute(s,e),d[A+i+0]=mE.x,d[A+i+1]=mE.y,d[A+i+2]=mE.z,d[A+i+3]=0),!0===n&&(mE.fromBufferAttribute(a,e),d[A+i+4]=mE.x,d[A+i+5]=mE.y,d[A+i+6]=mE.z,d[A+i+7]=0),!0===r&&(mE.fromBufferAttribute(u,e),d[A+i+8]=mE.x,d[A+i+9]=mE.y,d[A+i+10]=mE.z,d[A+i+11]=4===u.itemSize?mE.w:1)}}function m(){p.dispose(),fE.delete(e),e.removeEventListener("dispose",m)}a={count:s,texture:p,stride:u,size:new Ye(c,h)},fE.set(e,a),e.addEventListener("dispose",m)}return a}(t);!0===n&&sS.mulAssign(this.morphBaseInfluence),!0===r&&pS.mulAssign(this.morphBaseInfluence);const u=wy(l.width);dE(s,(({i:e})=>{const t=by(0).toVar();this.mesh.count>1&&null!==this.mesh.morphTexture&&void 0!==this.mesh.morphTexture?t.assign(xT(this.mesh.morphTexture,Ey(wy(e).add(1),wy(KM))).r):t.assign(US("morphTargetInfluences","float").element
1(e).toVar()),vy(t.notEqual(0),(()=>{!0===n&&sS.addAssign(gE({bufferMap:a,influence:t,stride:o,width:u,depth:e,offset:wy(0)})),!0===r&&pS.addAssign(gE({bufferMap:a,influence:t,stride:o,width:u,depth:e,offset:wy(1)}))}))}))}update(){const e=this.morphBaseInfluence;this.mesh.geometry.morphTargetsRelative?e.value=1:e.value=1-this.mesh.morphTargetInfluences.reduce(((e,t)=>e+t),0)}}).setParameterLength(1);class vE extends bv{static get type(){return"LightingNode"}constructor(){super("vec3"),this.isLightingNode=!0}}class yE extends vE{static get type(){return"AONode"}constructor(e=null){super(),this.aoNode=e}setup(e){e.context.ambientOcclusion.mulAssign(this.aoNode)}}const xE=dy(class extends bw{static get type(){return"LightingContextNode"}constructor(e,t=null,n=null,r=null){super(e),this.lightingModel=t,this.backdropNode=n,this.backdropAlphaNode=r,this._value=null}getContext(){const{backdropNode:e,backdropAlphaNode:t}=this,n={directDiffuse:Ny().toVar("directDiffuse"),directSpecular:Ny().toVar("directSpecular"),indirectDiffuse:Ny().toVar("indirectDiffuse"),indirectSpecular:Ny().toVar("indirectSpecular")};return{radiance:Ny().toVar("radiance"),irradiance:Ny().toVar("irradiance"),iblIrradiance:Ny().toVar("iblIrradiance"),ambientOcclusion:by(1).toVar("ambientOcclusion"),reflectedLight:n,backdrop:e,backdropAlpha:t}}setup(e){return this.value=this._value||(this._value=this.getContext()),this.value.lightingModel=this.lightingModel||e.context.lightingModel,super.setup(e)}});class bE extends vE{static get type(){return"IrradianceNode"}constructor(e){super(),this.node=e}setup(e){e.context.irradiance.addAssign(this.node)}}let wE,TE;class SE extends bv{static get type(){return"ScreenNode"}constructor(e){super(),this.scope=e,this.isViewportNode=!0}getNodeType(){return this.scope===SE.VIEWPORT?"vec4":"vec2"}getUpdateType(){let e=pv.NONE;return this.scope!==SE.SIZE&&this.scope!==SE.VIEWPORT||(e=pv.RENDER),this.updateType=e,e}update({renderer:e}){const t=e.getRenderTarget();this.scope===SE.VIEWPORT?null!==t?TE.copy(t.viewport):(e.getViewport(TE),TE.multiplyScalar(e.getPixelRatio())):null!==t?(wE.width=t.width,wE.height=t.height):e.getDrawingBufferSize(wE)}setup(){const e=this.scope;let t=null;return t=e===SE.SIZE?Ex(wE||(wE=new Ye)):e===SE.VIEWPORT?Ex(TE||(TE=new vt)):My(CE.div(EE)),t}generate(e){if(this.scope===SE.COORDINATE){let t=e.getFragCoord();if(e.isFlipY()){const n=e.getNodeProperties(EE).outputNode.build(e);t=`${e.getType("vec2")}( ${t}.x, ${n}.y - ${t}.y )`}return t}return super.generate(e)}}SE.COORDINATE="coordinate",SE.VIEWPORT="viewport",SE.SIZE="size",SE.UV="uv";const ME=py(SE,SE.UV),EE=py(SE,SE.SIZE),CE=py(SE,SE.COORDINATE),RE=py(SE,SE.VIEWPORT),NE=RE.zw,PE=CE.sub(RE.xy),DE=PE.div(NE),LE=my((()=>EE),"vec2").once()(),IE=my((()=>ME),"vec2").once()(),OE=my((()=>ME.flipY()),"vec2").once()(),BE=new Ye;class UE extends _T{static get type(){return"ViewportTextureNode"}constructor(e=ME,t=null,n=null){null===n&&((n=new Si).minFilter=w),super(n,e,t),this.generateMipmaps=!1,this.isOutputTextureNode=!0,this.updateBeforeType=pv.FRAME}updateBefore(e){const t=e.renderer;t.getDrawingBufferSize(BE);const n=this.value;n.image.width===BE.width&&n.image.height===BE.height||(n.image.width=BE.width,n.image.height=BE.height,n.needsUpdate=!0);const r=n.generateMipmaps;n.generateMipmaps=this.generateMipmaps,t.copyFramebufferToTexture(n),n.generateMipmaps=r}clone(){const e=new this.constructor(this.uvNode,this.levelNode,this.value);return e.generateMipmaps=this.generateMipmaps,e}}const FE=dy(UE).setParameterLength(0,3),kE=dy(UE,null,null,{generateMipmaps:!0}).setParameterLength(0,3);let qE=null;const VE=dy(class extends UE{static get type(){return"ViewportDepthTextureNode"}constructor(e=ME,t=null){null===qE&&(qE=new Mi),super(e,t,qE)}}).setParameterLength(0,2);class zE extends bv{static get type(){return"ViewportDepthNode"}constructor(e,t=null){super("float"),this.scope=e,this.valueNode=t,this.isViewportDepthNode=!0}generate(e){const{scope:t}=this;return t===zE.DEPTH_BASE?e.getFragDepth():super.generate(e)}setup({camera:e}){const{scope:t}=this,n=this.valueNode;let r=null;if(t===zE.DEPTH_BASE)null!==n&&(r=XE().assign(n));else if(t===zE.DEPTH)r=e.isPerspectiveCamera?jE(uS.z,RT,NT):GE(uS.z,RT,NT);else if(t===zE.LINEAR_DEPTH)if(null!==n)if(e.isPerspectiveCamera){const e=HE(n,RT,NT);r=GE(e,RT,NT)}else r=n;else r=GE(uS.z,RT,NT);return r}}
1zE.DEPTH_BASE="depthBase",zE.DEPTH="depth",zE.LINEAR_DEPTH="linearDepth";const GE=(e,t,n)=>e.add(t).div(t.sub(n)),jE=(e,t,n)=>t.add(e).mul(n).div(n.sub(t).mul(e)),HE=(e,t,n)=>t.mul(n).div(n.sub(t).mul(e).sub(n)),WE=(e,t,n)=>{t=t.max(1e-6).toVar();const r=yb(e.negate().div(t)),i=yb(n.div(t));return r.div(i)},XE=dy(zE,zE.DEPTH_BASE),QE=py(zE,zE.DEPTH),YE=dy(zE,zE.LINEAR_DEPTH).setParameterLength(0,1),$E=YE(VE());QE.assign=e=>XE(e);class KE extends bv{static get type(){return"ClippingNode"}constructor(e=KE.DEFAULT){super(),this.scope=e}setup(e){super.setup(e);const t=e.clippingContext,{intersectionPlanes:n,unionPlanes:r}=t;return this.hardwareClipping=e.material.hardwareClipping,this.scope===KE.ALPHA_TO_COVERAGE?this.setupAlphaToCoverage(n,r):this.scope===KE.HARDWARE?this.setupHardwareClipping(r,e):this.setupDefault(n,r)}setupAlphaToCoverage(e,t){return my((()=>{const n=by().toVar("distanceToPlane"),r=by().toVar("distanceToGradient"),i=by(1).toVar("clipOpacity"),s=t.length;if(!1===this.hardwareClipping&&s>0){const e=MT(t);dE(s,(({i:t})=>{const s=e.element(t);n.assign(uS.dot(s.xyz).negate().add(s.w)),r.assign(n.fwidth().div(2)),i.mulAssign(Aw(r.negate(),r,n))}))}const a=e.length;if(a>0){const t=MT(e),s=by(1).toVar("intersectionClipOpacity");dE(a,(({i:e})=>{const i=t.element(e);n.assign(uS.dot(i.xyz).negate().add(i.w)),r.assign(n.fwidth().div(2)),s.mulAssign(Aw(r.negate(),r,n).oneMinus())})),i.mulAssign(s.oneMinus())}Wy.a.mulAssign(i),Wy.a.equal(0).discard()}))()}setupDefault(e,t){return my((()=>{const n=t.length;if(!1===this.hardwareClipping&&n>0){const e=MT(t);dE(n,(({i:t})=>{const n=e.element(t);uS.dot(n.xyz).greaterThan(n.w).discard()}))}const r=e.length;if(r>0){const t=MT(e),n=Sy(!0).toVar("clipped");dE(r,(({i:e})=>{const r=t.element(e);n.assign(uS.dot(r.xyz).greaterThan(r.w).and(n))})),n.discard()}}))()}setupHardwareClipping(e,t){const n=e.length;return t.enableHardwareClipping(n),my((()=>{const r=MT(e),i=ET(t.getClipDistance());dE(n,(({i:e})=>{const t=r.element(e),n=uS.dot(t.xyz).sub(t.w).negate();i.element(e).assign(n)}))}))()}}KE.ALPHA_TO_COVERAGE="alphaToCoverage",KE.DEFAULT="default",KE.HARDWARE="hardware";const ZE=my((([e])=>Mb(Ux(1e4,Eb(Ux(17,e.x).add(Ux(.1,e.y)))).mul(Ox(.1,Lb(Eb(Ux(13,e.y).add(e.x)))))))),JE=my((([e])=>ZE(My(ZE(e.xy),e.z)))),eC=my((([e])=>{const t=Qb(Ob(Fb(e.xyz)),Ob(kb(e.xyz))),n=by(1).div(by(.05).mul(t)).toVar("pixScale"),r=My(_b(wb(yb(n))),_b(Tb(yb(n)))),i=My(JE(wb(r.x.mul(e.xyz))),JE(wb(r.y.mul(e.xyz)))),s=Mb(yb(n)),a=Ox(Ux(s.oneMinus(),i.x),Ux(s,i.y)),o=Xb(s,s.oneMinus()),l=Ny(a.mul(a).div(Ux(2,o).mul(Bx(1,o))),a.sub(Ux(.5,o)).div(Bx(1,o)),Bx(1,Bx(1,a).mul(Bx(1,a)).div(Ux(2,o).mul(Bx(1,o))))),u=a.lessThan(o.oneMinus()).select(a.lessThan(o).select(l.x,l.y),l.z);return uw(u,1e-6,1)})).setLayout({name:"getAlphaHashThreshold",type:"float",inputs:[{name:"position",type:"vec3"}]});class tC extends AT{static get type(){return"VertexColorNode"}constructor(e){super(null,"vec4"),this.isVertexColorNode=!0,this.index=e}getAttributeName(){const e=this.index;return"color"+(e>0?e:"")}generate(e){const t=this.getAttributeName(e);let n;return n=!0===e.hasGeometryAttribute(t)?super.generate(e):e.generateConst(this.nodeType,new vt(1,1,1,1)),n}serialize(e){super.serialize(e),e.index=this.index}deserialize(e){super.deserialize(e),this.index=e.index}}const nC=(e=0)=>cy(new tC(e));class rC extends Wn{static get type(){return"NodeMaterial"}get type(){return this.constructor.type}set type(e){}constructor(){super(),this.isNodeMaterial=!0,this.fog=!0,this.lights=!1,this.hardwareClipping=!1,this.lightsNode=null,this.envNode=null,this.aoNode=null,this.colorNode=null,this.normalNode=null,this.opacityNode=null,this.backdropNode=null,this.backdropAlphaNode=null,this.alphaTestNode=null,this.maskNode=null,this.positionNode=null,this.geometryNode=null,this.depthNode=null,this.receivedShadowPositionNode=null,this.castShadowPositionNode=null,this.receivedShadowNode=null,this.castShadowNode=null,this.outputNode=null,this.mrtNode=null,this.fragmentNode=null,this.vertexNode=null,Object.defineProperty(this,"shadowPositionNode",{get:()=>this.receivedShadowPositionNode,set:e=>{this.receivedShadowPositionNode=e}})}customProgramCacheKey(){return this.type+J_(this)}build(e){this.setup(e)}setupObserver(e){return new Q_(e)}setup(e){e.context.setupNormal=()=>this.setupNormal(e),e.context.setupPositionView=()=>this.setupPositionView(e),e.context.setupModelViewProjection=()=>this.setupModelViewProjection(e);const t=e.renderer,n=t.getRenderTarget();e.addStack();const r=this.setupVertex(e),i=this.vertexNode||r;let s;e.stack.outputNode=i,this.setupHardwareClipping(e),null!==this.geometryNode&&(e.stack.outputNode=e.stack.outputNode.bypass(this.geometryNode)),e.addFlow("vertex",e.removeStack()),e.addStack();const a=this.setupClipping(e);if(!0!==this.depthWrite&&!0!==this.depthTest||(null!==n?!0===n.depthBuffer&&this.setupDepth(e):!0===t.depth&&this.setupDepth(e)),null===this.fragmentNode){this.setupDiffuseColor(e),this.setupVariants(e);const r=this.setupLighting(e);null!==a&&e.stack.add(a);const i=Iy(r,Wy.a).max(0);
1s=this.setupOutput(e,i),cx.assign(s);const o=null!==this.outputNode;if(o&&(s=this.outputNode),null!==n){const e=t.getMRT(),n=this.mrtNode;null!==e?(o&&cx.assign(s),s=e,null!==n&&(s=e.merge(n))):null!==n&&(s=n)}}else{let t=this.fragmentNode;!0!==t.isOutputStructNode&&(t=Iy(t)),s=this.setupOutput(e,t)}e.stack.outputNode=s,e.addFlow("fragment",e.removeStack()),e.observer=this.setupObserver(e)}setupClipping(e){if(null===e.clippingContext)return null;const{unionPlanes:t,intersectionPlanes:n}=e.clippingContext;let r=null;if(t.length>0||n.length>0){const t=e.renderer.samples;this.alphaToCoverage&&t>1?r=cy(new KE(KE.ALPHA_TO_COVERAGE)):e.stack.add(cy(new KE))}return r}setupHardwareClipping(e){if(this.hardwareClipping=!1,null===e.clippingContext)return;const t=e.clippingContext.unionPlanes.length;t>0&&t<=8&&e.isAvailable("clipDistance")&&(e.stack.add(cy(new KE(KE.HARDWARE))),this.hardwareClipping=!0)}setupDepth(e){const{renderer:t,camera:n}=e;let r=this.depthNode;if(null===r){const e=t.getMRT();e&&e.has("depth")?r=e.get("depth"):!0===t.logarithmicDepthBuffer&&(r=n.isPerspectiveCamera?WE(uS.z,RT,NT):GE(uS.z,RT,NT))}null!==r&&QE.assign(r).toStack()}setupPositionView(){return eS.mul(sS).xyz}setupModelViewProjection(){return PT.mul(uS)}setupVertex(e){return e.addStack(),this.setupPosition(e),e.context.vertex=e.removeStack(),QM}setupPosition(e){const{object:t,geometry:n}=e;if((n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color)&&_E(t).toStack(),!0===t.isSkinnedMesh&&hE(t).toStack(),this.displacementMap){const e=qS("displacementMap","texture"),t=qS("displacementScale","float"),n=qS("displacementBias","float");sS.addAssign(pS.normalize().mul(e.x.mul(t).add(n)))}return t.isBatchedMesh&&sE(t).toStack(),t.isInstancedMesh&&t.instanceMatrix&&!0===t.instanceMatrix.isInstancedBufferAttribute&&iE(t).toStack(),null!==this.positionNode&&sS.assign(eT(this.positionNode,"POSITION")),sS}setupDiffuseColor({object:e,geometry:t}){null!==this.maskNode&&Sy(this.maskNode).not().discard();let n=this.colorNode?Iy(this.colorNode):hM;!0===this.vertexColors&&t.hasAttribute("color")&&(n=n.mul(nC())),e.instanceColor&&(n=Hy("vec3","vInstanceColor").mul(n)),e.isBatchedMesh&&e._colorsTexture&&(n=Hy("vec3","vBatchColor").mul(n)),Wy.assign(n);const r=this.opacityNode?by(this.opacityNode):pM;Wy.a.assign(Wy.a.mul(r));let i=null;(null!==this.alphaTestNode||this.alphaTest>0)&&(i=null!==this.alphaTestNode?by(this.alphaTestNode):cM,Wy.a.lessThanEqual(i).discard()),!0===this.alphaHash&&Wy.a.lessThan(eC(sS)).discard(),!1===this.transparent&&1===this.blending&&!1===this.alphaToCoverage?Wy.a.assign(1):null===i&&Wy.a.lessThanEqual(0).discard()}setupVariants(){}setupOutgoingLight(){return!0===this.lights?Ny(0):Wy.rgb}setupNormal(){return this.normalNode?Ny(this.normalNode):bM}setupEnvironment(){let e=null;return this.envNode?e=this.envNode:this.envMap&&(e=this.envMap.isCubeTexture?qS("envMap","cubeTexture"):qS("envMap","texture")),e}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new bE(HM)),t}setupLights(e){const t=[],n=this.setupEnvironment(e);n&&n.isLightingNode&&t.push(n);const r=this.setupLightMap(e);if(r&&r.isLightingNode&&t.push(r),null!==this.aoNode||e.material.aoMap){const e=null!==this.aoNode?this.aoNode:WM;t.push(new yE(e))}let i=this.lightsNode||e.lightsNode;return t.length>0&&(i=e.renderer.lighting.createNode([...i.getLights(),...t])),i}setupLightingModel(){}setupLighting(e){const{material:t}=e,{backdropNode:n,backdropAlphaNode:r,emissiveNode:i}=this,s=!0===this.lights||null!==this.lightsNode?this.setupLights(e):null;let a=this.setupOutgoingLight(e);if(s&&s.getScope().hasLights){const t=this.setupLightingModel(e)||null;a=xE(s,t,n,r)}else null!==n&&(a=Ny(null!==r?lw(a,n,r):n));return(i&&!0===i.isNode||t.emissive&&!0===t.emissive.isColor)&&(Xy.assign(Ny(i||dM)),a=a.add(Xy)),a}setupFog(e,t){const n=e.fogNode;return n&&(cx.assign(t),t=Iy(n)),t}setupOutput(e,t){return!0===this.fog&&(t=this.setupFog(e,t)),t}setDefaultValues(e){for(const t in e){const n=e[t];void 0===this[t]&&(this[t]=n,n&&n.clone&&(this[t]=n.clone()))}const t=Object.getOwnPropertyDescriptors(e.constructor.prototype);for(const e in t)void 0===Object.getOwnPropertyDescriptor(this.constructor.prototype,e)&&void 0!==t[e].get&&Object.defineProperty(this.constructor.prototype,e,t[e])}toJSON(e){const t=void 0===e||"string"==typeof e;t&&(e={textures:{},images:{},nodes:{}});const n=Wn.prototype.toJSON.call(this,e),r=ev(this);n.inputNodes={};for(const{property:t,childNode:i}of r)n.inputNodes[t]=i.toJSON(e).uuid;function i(e){const t=[];for(const n in e){const r=e[n];delete r.metadata,t.push(r)}return t}if(t){const t=i(e.textures),r=i(e.images),s=i(e.nodes);t.length>0&&(n.textures=t),r.length>0&&(n.images=r),s.length>0&&(n.nodes=s)}return n}copy(e){return this.lightsNode=e.lightsNode,this.envNode=e.envNode,this.colorNode=e.colorNode,this.normalNode=e.normalNode,this.opacityNode=e.opacityNode,this.backdropNode=e.backdropNode,this.backdropAlphaNode=e.backdropAlphaNode,this.alphaTestNode=e.alphaTestNode,this.maskNode=e.maskNode,this.positionNode=e.positionNode,this.geometryNode=e.geometryNode,this.depthNode=e.depthNode,this.receivedShadowPositionNode=e.receivedShadowPositionNode,this.castShadowPositionNode=e.castShadowPositionNode,this.receivedShadowNode=e.receivedShadowNode,this.castShadowNode=e.castShadowNode,this.outputNode=e.outputNode,this.mrtNode=e.mrtNode,this.fragmentNode=e.fragmentNode,this.vertexNode=e.vertexNode,super.copy(e)}}const iC=new ai;class sC extends rC{static get type(){return"LineBasicNodeMaterial"}constructor(e){super(),this.isLineBasicNodeMaterial=!0,this.setDefaultValues(iC),this.setValues(e)}}const aC=new class extends ai{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}};class oC extends rC{static get type(){return"LineDashedNodeMaterial"}constructor(e){super(),this.isLineDashedNodeMaterial=!0,this.setDefaultValues(aC),this.dashOffset=0,this.offsetNode=null,this.dashScaleNode=null,this.dashSizeNode=null,this.gapSizeNode=null,this.setValues(e)}setupVariants(){const e=this.offsetNode?by(this.offsetNode):zM,t=this.dashScaleNode?by(this.dashScaleNode):FM,n=this.dashSizeNode?by(this.dashSizeNode):kM,r=this.gapSizeNode?by(this.gapSizeNode):qM;hx.assign(n),Ax.assign(r);const i=Nw(dT("lineDistance").mul(t));(e?i.add(e):i).mod(hx.add(Ax)).greaterThan(hx).discard()}}let lC=null;const uC=dy(class extends UE{static get type(){return"ViewportSharedTextureNode"}
1constructor(e=ME,t=null){null===lC&&(lC=new Si),super(e,t,lC)}updateReference(){return this}}).setParameterLength(0,2),cC=e=>cy(e).mul(.5).add(.5),hC=new class extends Wn{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}};class AC extends rC{static get type(){return"MeshNormalNodeMaterial"}constructor(e){super(),this.isMeshNormalNodeMaterial=!0,this.setDefaultValues(hC),this.setValues(e)}setupDiffuseColor(){const e=this.opacityNode?by(this.opacityNode):pM;Wy.assign(Uw(Iy(cC(_S),e),Se))}}const dC=dy(class extends Sv{static get type(){return"EquirectUVNode"}constructor(e=lS){super("vec2"),this.dirNode=e}setup(){const e=this.dirNode,t=e.z.atan(e.x).mul(1/(2*Math.PI)).add(.5),n=e.y.clamp(-1,1).asin().mul(1/Math.PI).add(.5);return My(t,n)}}).setParameterLength(0,1);class pC extends qr{constructor(e=1,t={}){super(e,t),this.isCubeRenderTarget=!0}fromEquirectangularTexture(e,t){const n=t.minFilter,r=t.generateMipmaps;t.generateMipmaps=!0,this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const i=new Mr(5,5,5),s=dC(lS),a=new rC;a.colorNode=yT(t,s,0),a.side=1,a.blending=0;const o=new Tr(i,a),l=new jr;l.add(o),t.minFilter===w&&(t.minFilter=x);const u=new Fr(1,10,this),c=e.getMRT();return e.setMRT(null),u.update(e,l),e.setMRT(c),t.minFilter=n,t.currentGenerateMipmaps=r,o.geometry.dispose(),o.material.dispose(),this}}const fC=new WeakMap;function mC(e){const t=e.target;t.removeEventListener("dispose",mC);const n=fC.get(t);void 0!==n&&(fC.delete(t),n.dispose())}function gC(e,t){t===A?e.mapping=c:t===d&&(e.mapping=h)}const _C=dy(class extends Sv{static get type(){return"CubeMapNode"}constructor(e){super("vec3"),this.envNode=e,this._cubeTexture=null,this._cubeTextureNode=IS(null);const t=new kr;t.isRenderTargetTexture=!0,this._defaultTexture=t,this.updateBeforeType=pv.RENDER}updateBefore(e){const{renderer:t,material:n}=e,r=this.envNode;if(r.isTextureNode||r.isMaterialReferenceNode){const e=r.isTextureNode?r.value:n[r.property];if(e&&e.isTexture){const n=e.mapping;if(n===A||n===d){if(fC.has(e)){const t=fC.get(e);gC(t,e.mapping),this._cubeTexture=t}else{const n=e.image;if(function(e){return null!=e&&e.height>0}(n)){const r=new pC(n.height);r.fromEquirectangularTexture(t,e),gC(r.texture,e.mapping),this._cubeTexture=r.texture,fC.set(e,r.texture),e.addEventListener("dispose",mC)}else this._cubeTexture=this._defaultTexture}this._cubeTextureNode.value=this._cubeTexture}else this._cubeTextureNode=this.envNode}}}setup(e){return this.updateBefore(e),this._cubeTextureNode}}).setParameterLength(1);class vC extends vE{static get type(){return"BasicEnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){e.context.environment=_C(this.envNode)}}class yC extends vE{static get type(){return"BasicLightMapNode"}constructor(e=null){super(),this.lightMapNode=e}setup(e){const t=by(1/Math.PI);e.context.irradianceLightMap=this.lightMapNode.mul(t)}}class xC{start(e){e.lightsNode.setupLights(e,e.lightsNode.getLightNodes(e)),this.indirect(e)}finish(){}direct(){}directRectArea(){}indirect(){}ambientOcclusion(){}}class bC extends xC{constructor(){super()}indirect({context:e}){const t=e.ambientOcclusion,n=e.reflectedLight,r=e.irradianceLightMap;n.indirectDiffuse.assign(Iy(0)),r?n.indirectDiffuse.addAssign(r):n.indirectDiffuse.addAssign(Iy(1,1,1,0)),n.indirectDiffuse.mulAssign(t),n.indirectDiffuse.mulAssign(Wy.rgb)}finish(e){const{material:t,context:n}=e,r=n.outgoingLight,i=e.context.environment;if(i)switch(t.combine){case 0:r.rgb.assign(lw(r.rgb,r.rgb.mul(i.rgb),_M.mul(vM)));break;case 1:r.rgb.assign(lw(r.rgb,i.rgb,_M.mul(vM)));break;case 2:r.rgb.addAssign(i.rgb.mul(_M.mul(vM)));break;default:}}}const wC=new Xn;class TC extends rC{static get type(){return"MeshBasicNodeMaterial"}constructor(e){super(),this.isMeshBasicNodeMaterial=!0,this.lights=!0,this.setDefaultValues(wC),this.setValues(e)}setupNormal(){return mS}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new vC(t):null}setupLightMap(e){let t=null;return e.material.lightMap&&(t=new yC(HM)),t}setupOutgoingLight(){return Wy.rgb}setupLightingModel(){return new bC}}const SC=my((({f0:e,f90:t,dotVH:n})=>{const r=n.mul(-5.55473).sub(6.98316).mul(n).exp2();return e.mul(r.oneMinus()).add(t.mul(r))})),MC=my((e=>e.diffuseColor.mul(1/Math.PI))),EC=my((({dotNH:e})=>ux.mul(by(.5)).add(1).mul(by(1/Math.PI)).mul(e.pow(ux)))),CC=my((({lightDirection:e})=>{const t=e.add(cS).normalize(),n=_S.dot(t).clamp(),r=cS.dot(t).clamp(),i=SC({f0:ox,f90:1,dotVH:r}),s=by(.25),a=EC({dotNH:n});return i.mul(s).mul(a)}));class RC extends bC{constructor(e=!0){super(),this.specular=e}direct({lightDirection:e,lightColor:t,reflectedLight:n}){const r=_S.dot(e).clamp().mul(t);n.directDiffuse.addAssign(r.mul(MC({diffuseColor:Wy.rgb}))),!0===this.specular&&n.directSpecular.addAssign(r.mul(CC({lightDirection:e})).mul(_M))}indirect(e){const{ambientOcclusion:t,irradiance:n,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(n.mul(MC({diffuseColor:Wy}))),r.indirectDiffuse.mulAssign(t)}}const NC=new Ds;class PC extends rC{static get type(){return"MeshLambertNodeMaterial"}constructor(e){super(),this.isMeshLambertNodeMaterial=!0,this.lights=!0,this.setDefaultValues(NC),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new vC(t):null}setupLightingModel(){return new RC(!1)}}const DC=new Ps;class LC extends rC{static get type(){return"MeshPhongNodeMaterial"}constructor(e){super(),this.isMeshPhongNodeMaterial=!0,this.lights=!0,this.shininessNode=null,this.specularNode=null,this.setDefaultValues(DC),this.setValues(e)}setupEnvironment(e){const t=super.setupEnvironment(e);return t?new vC(t):null}setupLightingModel(){return new RC}setupVariants(){const e=(this.shininessNode?by(this.shininessNode):AM).max(1e-4);ux.assign(e);const t=this.specularNode||fM;ox.assign(t)}copy(e){return this.shininessNode=e.shininessNode,this.specularNode=e.specularNode,super.copy(e)}}const IC=my((e=>{if(!1===e.geometry.hasAttribute("normal"))return by(0);const t=mS.dFdx().abs().max(mS.dFdy().abs());return t.x.max(t.y).max(t.z)})),OC=my((e=>{const{roughness:t}=e,n=IC();let r=t.max(.0525);return r=r.add(n),r=r.min(1),r})),BC=my((({alpha:e,dotNL:t,dotNV:n})=>{const r=e.pow2(),i=t.mul(r.add(r.oneMinus().mul(n.pow2())).sqrt()),s=n.mul(r.add(r.oneMinus().mul(t.pow2())).sqrt());return Fx(.5,i.add(s).max(ub))})).setLayout({name:"V_GGX_SmithCorrelated",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNL",type:"float"},{name:"dotNV",type:"float"}]}),UC=my((({alphaT:e,alphaB:t,dotTV:n,dotBV:r,dotTL:i,dotBL:s,dotNV:a,dotNL:o})=>{const l=o.mul(Ny(e.mul(n),t.mul(r),a).length()),u=a.mul(Ny(e.mul(i),t.mul(s),o).length());return Fx(.5,l.add(u)).saturate()})).setLayout({name:"V_GGX_SmithCorrelated_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotTV",type:"float",qualifier:"in"},{name:"dotBV",type:"float",qualifier:"in"},{name:"dotTL",type:"float",qualifier:"in"},{name:"dotBL",type:"float",qualifier:"in"},{name:"dotNV",type:"float",qualifier:"in"},{name:"dotNL",type:"float",qualifier:"in"}]}),FC=my((({alpha:e,dotNH:t})=>{const n=e.pow2(),r=t.pow2().mul(n.oneMinus()).oneMinus();return n.div(r.pow2()).mul(1/Math.PI)})).setLayout({name:"D_GGX",type:"float",inputs:[{name:"alpha",type:"float"},{name:"dotNH",type:"float"}]}),kC=by(1/Math.PI),qC=my((({alphaT:e,alphaB:t,dotNH:n,dotTH:r,dotBH:i})=>{const s=e.mul(t),a=Ny(t.mul(r),e.mul(i),s.mul(n)),o=a.dot(a),l=s.div(o);return kC.mul(s.mul(l.pow2()))}
1)).setLayout({name:"D_GGX_Anisotropic",type:"float",inputs:[{name:"alphaT",type:"float",qualifier:"in"},{name:"alphaB",type:"float",qualifier:"in"},{name:"dotNH",type:"float",qualifier:"in"},{name:"dotTH",type:"float",qualifier:"in"},{name:"dotBH",type:"float",qualifier:"in"}]}),VC=my((e=>{const{lightDirection:t,f0:n,f90:r,roughness:i,f:s,USE_IRIDESCENCE:a,USE_ANISOTROPY:o}=e,l=e.normalView||_S,u=i.pow2(),c=t.add(cS).normalize(),h=l.dot(t).clamp(),A=l.dot(cS).clamp(),d=l.dot(c).clamp(),p=cS.dot(c).clamp();let f,m,g=SC({f0:n,f90:r,dotVH:p});if(oy(a)&&(g=ex.mix(g,s)),oy(o)){const e=sx.dot(t),n=sx.dot(cS),r=sx.dot(c),i=ax.dot(t),s=ax.dot(cS),a=ax.dot(c);f=UC({alphaT:rx,alphaB:u,dotTV:n,dotBV:s,dotTL:e,dotBL:i,dotNV:A,dotNL:h}),m=qC({alphaT:rx,alphaB:u,dotNH:d,dotTH:r,dotBH:a})}else f=BC({alpha:u,dotNL:h,dotNV:A}),m=FC({alpha:u,dotNH:d});return g.mul(f).mul(m)})),zC=my((({roughness:e,dotNV:t})=>{const n=Iy(-1,-.0275,-.572,.022),r=Iy(1,.0425,1.04,-.04),i=e.mul(n).add(r),s=i.x.mul(i.x).min(t.mul(-9.28).exp2()).mul(i.x).add(i.y);return My(-1.04,1.04).mul(s).add(i.zw)})).setLayout({name:"DFGApprox",type:"vec2",inputs:[{name:"roughness",type:"float"},{name:"dotNV",type:"vec3"}]}),GC=my((e=>{const{dotNV:t,specularColor:n,specularF90:r,roughness:i}=e,s=zC({dotNV:t,roughness:i});return n.mul(s.x).add(r.mul(s.y))})),jC=my((({f:e,f90:t,dotVH:n})=>{const r=n.oneMinus().saturate(),i=r.mul(r),s=r.mul(i,i).clamp(0,.9999);return e.sub(Ny(t).mul(s)).div(s.oneMinus())})).setLayout({name:"Schlick_to_F0",type:"vec3",inputs:[{name:"f",type:"vec3"},{name:"f90",type:"float"},{name:"dotVH",type:"float"}]}),HC=my((({roughness:e,dotNH:t})=>{const n=e.pow2(),r=by(1).div(n),i=t.pow2().oneMinus().max(.0078125);return by(2).add(r).mul(i.pow(r.mul(.5))).div(2*Math.PI)})).setLayout({name:"D_Charlie",type:"float",inputs:[{name:"roughness",type:"float"},{name:"dotNH",type:"float"}]}),WC=my((({dotNV:e,dotNL:t})=>by(1).div(by(4).mul(t.add(e).sub(t.mul(e)))))).setLayout({name:"V_Neubelt",type:"float",inputs:[{name:"dotNV",type:"float"},{name:"dotNL",type:"float"}]}),XC=my((({lightDirection:e})=>{const t=e.add(cS).normalize(),n=_S.dot(e).clamp(),r=_S.dot(cS).clamp(),i=_S.dot(t).clamp(),s=HC({roughness:Jy,dotNH:i}),a=WC({dotNV:r,dotNL:n});return Zy.mul(s).mul(a)})),QC=my((({N:e,V:t,roughness:n})=>{const r=e.dot(t).saturate(),i=My(n,r.oneMinus().sqrt());return i.assign(i.mul(.984375).add(.0078125)),i})).setLayout({name:"LTC_Uv",type:"vec2",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"roughness",type:"float"}]}),YC=my((({f:e})=>{const t=e.length();return Qb(t.mul(t).add(e.z).div(t.add(1)),0)})).setLayout({name:"LTC_ClippedSphereFormFactor",type:"float",inputs:[{name:"f",type:"vec3"}]}),$C=my((({v1:e,v2:t})=>{const n=e.dot(t),r=n.abs().toVar(),i=r.mul(.0145206).add(.4965155).mul(r).add(.8543985).toVar(),s=r.add(4.1616724).mul(r).add(3.417594).toVar(),a=i.div(s),o=n.greaterThan(0).select(a,Qb(n.mul(n).oneMinus(),1e-7).inverseSqrt().mul(.5).sub(a));return e.cross(t).mul(o)})).setLayout({name:"LTC_EdgeVectorFormFactor",type:"vec3",inputs:[{name:"v1",type:"vec3"},{name:"v2",type:"vec3"}]}),KC=my((({N:e,V:t,P:n,mInv:r,p0:i,p1:s,p2:a,p3:o})=>{const l=s.sub(i).toVar(),u=o.sub(i).toVar(),c=l.cross(u),h=Ny().toVar();return vy(c.dot(n.sub(i)).greaterThanEqual(0),(()=>{const l=t.sub(e.mul(t.dot(e))).normalize(),u=e.cross(l).negate(),c=r.mul(ky(l,u,e).transpose()).toVar(),A=c.mul(i.sub(n)).normalize().toVar(),d=c.mul(s.sub(n)).normalize().toVar(),p=c.mul(a.sub(n)).normalize().toVar(),f=c.mul(o.sub(n)).normalize().toVar(),m=Ny(0).toVar();m.addAssign($C({v1:A,v2:d})),m.addAssign($C({v1:d,v2:p})),m.addAssign($C({v1:p,v2:f})),m.addAssign($C({v1:f,v2:A})),h.assign(Ny(YC({f:m})))})),h})).setLayout({name:"LTC_Evaluate",type:"vec3",inputs:[{name:"N",type:"vec3"},{name:"V",type:"vec3"},{name:"P",type:"vec3"},{name:"mInv",type:"mat3"},{name:"p0",type:"vec3"},{name:"p1",type:"vec3"},{name:"p2",type:"vec3"},{name:"p3",type:"vec3"}]}),ZC=1/6,JC=e=>Ux(ZC,Ux(e,Ux(e,e.negate().add(3)).sub(3)).add(1)),eR=e=>Ux(ZC,Ux(e,Ux(e,Ux(3,e).sub(6))).add(4)),tR=e=>Ux(ZC,Ux(e,Ux(e,Ux(-3,e).add(3)).add(3)).add(1)),nR=e=>
vendor: 7,138 bytes, line 1
1Ux(ZC,tw(e,3)),rR=e=>JC(e).add(eR(e)),iR=e=>tR(e).add(nR(e)),sR=e=>Ox(-1,eR(e).div(JC(e).add(eR(e)))),aR=e=>Ox(1,nR(e).div(tR(e).add(nR(e)))),oR=(e,t,n)=>{const r=e.uvNode,i=Ux(r,t.zw).add(.5),s=wb(i),a=Mb(i),o=rR(a.x),l=iR(a.x),u=sR(a.x),c=aR(a.x),h=sR(a.y),A=aR(a.y),d=My(s.x.add(u),s.y.add(h)).sub(.5).mul(t.xy),p=My(s.x.add(c),s.y.add(h)).sub(.5).mul(t.xy),f=My(s.x.add(u),s.y.add(A)).sub(.5).mul(t.xy),m=My(s.x.add(c),s.y.add(A)).sub(.5).mul(t.xy),g=rR(a.y).mul(Ox(o.mul(e.sample(d).level(n)),l.mul(e.sample(p).level(n)))),_=iR(a.y).mul(Ox(o.mul(e.sample(f).level(n)),l.mul(e.sample(m).level(n))));return g.add(_)},lR=my((([e,t=by(3)])=>{const n=My(e.size(wy(t))),r=My(e.size(wy(t.add(1)))),i=Fx(1,n),s=Fx(1,r),a=oR(e,Iy(i,n),wb(t)),o=oR(e,Iy(s,r),Tb(t));return Mb(t).mix(a,o)})),uR=my((([e,t,n,r,i])=>{const s=Ny(hw(t.negate(),Sb(e),Fx(1,r))),a=Ny(Ob(i[0].xyz),Ob(i[1].xyz),Ob(i[2].xyz));return Sb(s).mul(n.mul(a))})).setLayout({name:"getVolumeTransmissionRay",type:"vec3",inputs:[{name:"n",type:"vec3"},{name:"v",type:"vec3"},{name:"thickness",type:"float"},{name:"ior",type:"float"},{name:"modelMatrix",type:"mat4"}]}),cR=my((([e,t])=>e.mul(uw(t.mul(2).sub(2),0,1)))).setLayout({name:"applyIorToRoughness",type:"float",inputs:[{name:"roughness",type:"float"},{name:"ior",type:"float"}]}),hR=kE(),AR=kE(),dR=my((([e,t,n],{material:r})=>{const i=(1===r.side?hR:AR).sample(e),s=yb(EE.x).mul(cR(t,n));return lR(i,s)})),pR=my((([e,t,n])=>(vy(n.notEqual(0),(()=>{const r=vb(t).negate().div(n);return gb(r.negate().mul(e))})),Ny(1)))).setLayout({name:"volumeAttenuation",type:"vec3",inputs:[{name:"transmissionDistance",type:"float"},{name:"attenuationColor",type:"vec3"},{name:"attenuationDistance",type:"float"}]}),fR=my((([e,t,n,r,i,s,a,o,l,u,c,h,A,d,p])=>{let f,m;if(p){f=Iy().toVar(),m=Ny().toVar();const i=c.sub(1).mul(p.mul(.025)),s=Ny(c.sub(i),c,c.add(i));dE({start:0,end:3},(({i:i})=>{const c=s.element(i),p=uR(e,t,h,c,o),g=a.add(p),_=u.mul(l.mul(Iy(g,1))),v=My(_.xy.div(_.w)).toVar();v.addAssign(1),v.divAssign(2),v.assign(My(v.x,v.y.oneMinus()));const y=dR(v,n,c);f.element(i).assign(y.element(i)),f.a.addAssign(y.a),m.element(i).assign(r.element(i).mul(pR(Ob(p),A,d).element(i)))})),f.a.divAssign(3)}else{const i=uR(e,t,h,c,o),s=a.add(i),p=u.mul(l.mul(Iy(s,1))),g=My(p.xy.div(p.w)).toVar();g.addAssign(1),g.divAssign(2),g.assign(My(g.x,g.y.oneMinus())),f=dR(g,n,c),m=r.mul(pR(Ob(i),A,d))}const g=m.rgb.mul(f.rgb),_=e.dot(t).clamp(),v=Ny(GC({dotNV:_,specularColor:i,specularF90:s,roughness:n})),y=m.r.add(m.g,m.b).div(3);return Iy(v.oneMinus().mul(g),f.a.oneMinus().mul(y).oneMinus())})),mR=ky(3.2404542,-.969266,.0556434,-1.5371385,1.8760108,-.2040259,-.4985314,.041556,1.0572252),gR=(e,t)=>e.sub(t).div(e.add(t)).pow2(),_R=my((({outsideIOR:e,eta2:t,cosTheta1:n,thinFilmThickness:r,baseF0:i})=>{const s=lw(e,t,Aw(0,.03,r)),a=e.div(s).pow2().mul(n.pow2().oneMinus()).oneMinus();vy(a.lessThan(0),(()=>Ny(1)));const o=a.sqrt(),l=gR(s,e),u=SC({f0:l,f90:1,dotVH:n}),c=u.oneMinus(),h=s.lessThan(e).select(Math.PI,0),A=by(Math.PI).sub(h),d=(e=>{const t=e.sqrt();return Ny(1).add(t).div(Ny(1).sub(t))})(i.clamp(0,.9999)),p=gR(d,s.toVec3()),f=SC({f0:p,f90:1,dotVH:o}),m=Ny(d.x.lessThan(s).select(Math.PI,0),d.y.lessThan(s).select(Math.PI,0),d.z.lessThan(s).select(Math.PI,0)),g=s.mul(r,o,2),_=Ny(A).add(m),v=u.mul(f).clamp(1e-5,.9999),y=v.sqrt(),x=c.pow2().mul(f).div(Ny(1).sub(v)),b=u.add(x).toVar(),w=x.sub(c).toVar();return dE({start:1,end:2,condition:"<=",name:"m"},(({m:e})=>{w.mulAssign(y);const t=((e,t)=>{const n=e.mul(2*Math.PI*1e-9),r=Ny(54856e-17,44201e-17,52481e-17),i=Ny(1681e3,1795300,2208400),s=Ny(43278e5,93046e5,66121e5),a=by(9747e-17*Math.sqrt(2*Math.PI*45282e5)).mul(n.mul(2239900).add(t.x).cos()).mul(n.pow2().mul(-45282e5).exp());let o=r.mul(s.mul(2*Math.PI).sqrt()).mul(i.mul(n).add(t).cos()).mul(n.pow2().negate().mul(s).exp());return o=Ny(o.x.add(a),o.y,o.z).div(1.0685e-7),mR.mul(o)})(by(e).mul(g),by(e).mul(_)).mul(2);b.addAssign(w.mul(t))})),b.max(Ny(0))})).setLayout({name:"evalIridescence",type:"vec3",inputs:[{name:"outsideIOR",type:"float"},{name:"eta2",type:"float"},{name:"cosTheta1",type:"float"},{name:"thinFilmThickness",type:"float"},{name:"baseF0",type:"vec3"}]}),vR=my((({normal:e,viewDir:t,roughness:n})=>{const r=e.dot(t).saturate(),i=n.pow2(),s=yw(n.lessThan(.25),by(-339.2).mul(i).add(by(161.4).mul(n)).sub(25.9),by(-8.48).mul(i).add(by(14.3).mul(n)).sub(9.95)),a=yw(n.lessThan(.25),by(44).mul(i).sub(by(23.7).mul(n)).add(3.26),by(1.97).mul(i).sub(by(3.27).mul(n)).add(.72));return yw(n.lessThan(.25),0,by(.1).mul(n).sub(.025)).add(s.mul(r).add(a).exp()).mul(1/Math.PI).saturate()})),yR=Ny(.04),xR=by(1);class bR extends xC{constructor(e=!1,t=!1,n=!1,r=!1,i=!1,s=!1){super(),this.clearcoat=e,this.sheen=t,this.iridescence=n,this.anisotropy=r,this.transmission=i,this.dispersion=s,this.clearcoatRadiance=null,this.clearcoatSpecularDirect=null,this.clearcoatSpecularIndirect=null,this.sheenSpecularDirect=null,this.sheenSpecularIndirect=null,this.iridescenceFresnel=null,this.iridescenceF0=null}start(e){if(!0===this.clearcoat&&(this.clearcoatRadiance=Ny().toVar("clearcoatRadiance"),this.clearcoatSpecularDirect=Ny().toVar("clearcoatSpecularDirect"),this.clearcoatSpecularIndirect=Ny().toVar("clearcoatSpecularIndirect")),!0===this.sheen&&(this.sheenSpecularDirect=Ny().toVar("sheenSpecularDirect"),this.sheenSpecularIndirect=Ny().toVar("sheenSpecularIndirect")),!0===this.iridescence){const e=_S.dot(cS).clamp();this.iridescenceFresnel=_R({outsideIOR:by(1),eta2:tx,cosTheta1:e,thinFilmThickness:nx,baseF0:ox}),this.iridescenceF0=jC({f:this.iridescenceFresnel,f90:1,dotVH:e})}if(!0===this.transmission){const t=oS,n=BT.sub(oS).normalize(),r=vS,i=e.context;i.backdrop=fR(r,n,Qy,Wy,ox,lx,t,XT,LT,PT,px,mx,_x,gx,this.dispersion?vx:null),i.backdropAlpha=fx,Wy.a.mulAssign(lw(1,i.backdrop.a,fx))}super.start(e)}computeMultiscattering(e,t,n){const r=_S.dot(cS).clamp(),i=zC({roughness:Qy,dotNV:r}),s=(this.iridescenceF0?ex.mix(ox,this.iridescenceF0):ox).mul(i.x).add(n.mul(i.y)),a=i.x.add(i.y).oneMinus(),o=ox.add(ox.oneMinus().mul(.047619)),l=s.mul(o).div(a.mul(o).oneMinus());e.addAssign(s),t.addAssign(l.mul(a))}direct({lightDirection:e,lightColor:t,reflectedLight:n}){const r=_S.dot(e).clamp().mul(t);if(!0===this.sheen&&this.sheenSpecularDirect.addAssign(r.mul(XC({lightDirection:e}))),!0===this.clearcoat){const n=yS.dot(e).clamp().mul(t);this.clearcoatSpecularDirect.addAssign(n.mul(VC({lightDirection:e,f0:yR,f90:xR,roughness:Ky,normalView:yS})))}n.directDiffuse.addAssign(r.mul(MC({diffuseColor:Wy.rgb}))),n.directSpecular.addAssign(r.mul(VC({lightDirection:e,f0:ox,f90:1,roughness:Qy,iridescence:this.iridescence,f:this.iridescenceFresnel,USE_IRIDESCENCE:this.iridescence,USE_ANISOTROPY:this.anisotropy})))}directRectArea({lightColor:e,lightPosition:t,halfWidth:n,halfHeight:r,reflectedLight:i,ltc_1:s,ltc_2:a}){const o=t.add(n).sub(r),l=t.sub(n).sub(r),u=t.sub(n).add(r),c=t.add(n).add(r),h=_S,A=cS,d=uS.toVar(),p=QC({N:h,V:A,roughness:Qy}),f=s.sample(p).toVar(),m=a.sample(p).toVar(),g=ky(Ny(f.x,0,f.y),Ny(0,1,0),Ny(f.z,0,f.w)).toVar(),_=ox.mul(m.x).add(ox.oneMinus().mul(m.y)).toVar();
1i.directSpecular.addAssign(e.mul(_).mul(KC({N:h,V:A,P:d,mInv:g,p0:o,p1:l,p2:u,p3:c}))),i.directDiffuse.addAssign(e.mul(Wy).mul(KC({N:h,V:A,P:d,mInv:ky(1,0,0,0,1,0,0,0,1),p0:o,p1:l,p2:u,p3:c})))}indirect(e){this.indirectDiffuse(e),this.indirectSpecular(e),this.ambientOcclusion(e)}indirectDiffuse(e){const{irradiance:t,reflectedLight:n}=e.context;n.indirectDiffuse.addAssign(t.mul(MC({diffuseColor:Wy})))}indirectSpecular(e){const{radiance:t,iblIrradiance:n,reflectedLight:r}=e.context;if(!0===this.sheen&&this.sheenSpecularIndirect.addAssign(n.mul(Zy,vR({normal:_S,viewDir:cS,roughness:Jy}))),!0===this.clearcoat){const e=yS.dot(cS).clamp(),t=GC({dotNV:e,specularColor:yR,specularF90:xR,roughness:Ky});this.clearcoatSpecularIndirect.addAssign(this.clearcoatRadiance.mul(t))}const i=Ny().toVar("singleScattering"),s=Ny().toVar("multiScattering"),a=n.mul(1/Math.PI);this.computeMultiscattering(i,s,lx);const o=i.add(s),l=Wy.mul(o.r.max(o.g).max(o.b).oneMinus());r.indirectSpecular.addAssign(t.mul(i)),r.indirectSpecular.addAssign(s.mul(a)),r.indirectDiffuse.addAssign(l.mul(a))}ambientOcclusion(e){const{ambientOcclusion:t,reflectedLight:n}=e.context,r=_S.dot(cS).clamp().add(t),i=Qy.mul(-16).oneMinus().negate().exp2(),s=t.sub(r.pow(i).oneMinus()).clamp();!0===this.clearcoat&&this.clearcoatSpecularIndirect.mulAssign(t),!0===this.sheen&&this.sheenSpecularIndirect.mulAssign(t),n.indirectDiffuse.mulAssign(t),n.indirectSpecular.mulAssign(s)}finish({context:e}){const{outgoingLight:t}=e;if(!0===this.clearcoat){const e=yS.dot(cS).clamp(),n=SC({dotVH:e,f0:yR,f90:xR}),r=t.mul($y.mul(n).oneMinus()).add(this.clearcoatSpecularDirect.add(this.clearcoatSpecularIndirect).mul($y));t.assign(r)}if(!0===this.sheen){const e=Zy.r.max(Zy.g).max(Zy.b).mul(.157).oneMinus(),n=t.mul(e).add(this.sheenSpecularDirect,this.sheenSpecularIndirect);t.assign(n)}}}const wR=by(1),TR=by(-2),SR=by(.8),MR=by(-1),ER=by(.4),CR=by(2),RR=by(.305),NR=by(3),PR=by(.21),DR=by(4),LR=by(4),IR=by(16),OR=my((([e])=>{const t=Ny(Lb(e)).toVar(),n=by(-1).toVar();return vy(t.x.greaterThan(t.z),(()=>{vy(t.x.greaterThan(t.y),(()=>{n.assign(yw(e.x.greaterThan(0),0,3))})).Else((()=>{n.assign(yw(e.y.greaterThan(0),1,4))}))})).Else((()=>{vy(t.z.greaterThan(t.y),(()=>{n.assign(yw(e.z.greaterThan(0),2,5))})).Else((()=>{n.assign(yw(e.y.greaterThan(0),1,4))}))})),n})).setLayout({name:"getFace",type:"float",inputs:[{name:"direction",type:"vec3"}]}),BR=my((([e,t])=>{const n=My().toVar();return vy(t.equal(0),(()=>{n.assign(My(e.z,e.y).div(Lb(e.x)))})).ElseIf(t.equal(1),(()=>{n.assign(My(e.x.negate(),e.z.negate()).div(Lb(e.y)))})).ElseIf(t.equal(2),(()=>{n.assign(My(e.x.negate(),e.y).div(Lb(e.z)))})).ElseIf(t.equal(3),(()=>{n.assign(My(e.z.negate(),e.y).div(Lb(e.x)))})).ElseIf(t.equal(4),(()=>{n.assign(My(e.x.negate(),e.z).div(Lb(e.y)))})).Else((()=>{n.assign(My(e.x,e.y).div(Lb(e.z)))})),Ux(.5,n.add(1))})).setLayout({name:"getUV",type:"vec2",inputs:[{name:"direction",type:"vec3"},{name:"face",type:"float"}]}),UR=my((([e])=>{const t=by(0).toVar();return vy(e.greaterThanEqual(SR),(()=>{t.assign(wR.sub(e).mul(MR.sub(TR)).div(wR.sub(SR)).add(TR))})).ElseIf(e.greaterThanEqual(ER),(()=>{t.assign(SR.sub(e).mul(CR.sub(MR)).div(SR.sub(ER)).add(MR))})).ElseIf(e.greaterThanEqual(RR),(()=>{t.assign(ER.sub(e).mul(NR.sub(CR)).div(ER.sub(RR)).add(CR))})).ElseIf(e.greaterThanEqual(PR),(()=>{t.assign(RR.sub(e).mul(DR.sub(NR)).div(RR.sub(PR)).add(NR))})).Else((()=>{t.assign(by(-2).mul(yb(Ux(1.16,e))))})),t})).setLayout({name:"roughnessToMip",type:"float",inputs:[{name:"roughness",type:"float"}]}),FR=my((([e,t])=>{const n=e.toVar();n.assign(Ux(2,n).sub(1));const r=Ny(n,1).toVar();return vy(t.equal(0),(()=>{r.assign(r.zyx)})).ElseIf(t.equal(1),(()=>{r.assign(r.xzy),r.xz.mulAssign(-1)})).ElseIf(t.equal(2),(()=>{r.x.mulAssign(-1)})).ElseIf(t.equal(3),(()=>{r.assign(r.zyx),r.xz.mulAssign(-1)})).ElseIf(t.equal(4),(()=>{r.assign(r.xzy),r.xy.mulAssign(-1)})).ElseIf(t.equal(5),(()=>{r.z.mulAssign(-1)})),r})).setLayout({name:"getDirection",type:"vec3",inputs:[{name:"uv",type:"vec2"},{name:"face",type:"float"}]}),kR=my((([e,t,n,r,i,s])=>{const a=by(n),o=Ny(t),l=uw(UR(a),TR,s),u=Mb(l),c=wb(l),h=Ny(qR(e,o,c,r,i,s)).toVar();return vy(u.notEqual(0),(()=>{const t=Ny(qR(e,o,c.add(1),r,i,s)).toVar();h.assign(lw(h,t,u))})),h})),qR=my((([e,t,n,r,i,s])=>{const a=by(n).toVar(),o=Ny(t),l=by(OR(o)).toVar(),u=by(Qb(LR.sub(a),0)).toVar();a.assign(Qb(a,LR));const c=by(_b(a)).toVar(),h=My(BR(o,l).mul(c.sub(2)).add(1)).toVar();return vy(l.greaterThan(2),(()=>{h.y.addAssign(c),l.subAssign(3)})),h.x.addAssign(l.mul(c)),h.x.addAssign(u.mul(Ux(3,IR))),h.y.addAssign(Ux(4,_b(s).sub(c))),h.x.mulAssign(r),h.y.mulAssign(i),e.sample(h).grad(My(),My())})),VR=my((({envMap:e,mipInt:t,outputDirection:n,theta:r,axis:i,CUBEUV_TEXEL_WIDTH:s,CUBEUV_TEXEL_HEIGHT:a,
1CUBEUV_MAX_MIP:o})=>{const l=Cb(r),u=n.mul(l).add(i.cross(n).mul(Eb(r))).add(i.mul(i.dot(n).mul(l.oneMinus())));return qR(e,u,t,s,a,o)})),zR=my((({n:e,latitudinal:t,poleAxis:n,outputDirection:r,weights:i,samples:s,dTheta:a,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:h})=>{const A=Ny(yw(t,n,ew(n,r))).toVar();vy(A.equal(Ny(0)),(()=>{A.assign(Ny(r.z,0,r.x.negate()))})),A.assign(Sb(A));const d=Ny().toVar();return d.addAssign(i.element(0).mul(VR({theta:0,axis:A,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:h}))),dE({start:wy(1),end:e},(({i:e})=>{vy(e.greaterThanEqual(s),(()=>{pE()}));const t=by(a.mul(by(e))).toVar();d.addAssign(i.element(e).mul(VR({theta:t.mul(-1),axis:A,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:h}))),d.addAssign(i.element(e).mul(VR({theta:t,axis:A,outputDirection:r,mipInt:o,envMap:l,CUBEUV_TEXEL_WIDTH:u,CUBEUV_TEXEL_HEIGHT:c,CUBEUV_MAX_MIP:h})))})),Iy(d,1)})),GR=[.125,.215,.35,.446,.526,.582],jR=new Js(-1,1,1,-1,0,1),HR=new Br(90,1),WR=new Gn;let XR=null,QR=0,YR=0;const $R=(1+Math.sqrt(5))/2,KR=1/$R,ZR=[new Ke(-$R,KR,0),new Ke($R,KR,0),new Ke(-KR,0,$R),new Ke(KR,0,$R),new Ke(0,$R,-KR),new Ke(0,$R,KR),new Ke(-1,1,-1),new Ke(1,1,-1),new Ke(-1,1,1),new Ke(1,1,1)],JR=new Ke,eN=new WeakMap,tN=[3,1,5,0,4,2],nN=FR(pT(),dT("faceIndex")).normalize(),rN=Ny(nN.x,nN.y,nN.z);class iN{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._lodMeshes=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._backgroundBox=null}get _hasInitialized(){return this._renderer.hasInitialized()}fromScene(e,t=0,n=.1,r=100,i={}){const{size:s=256,position:a=JR,renderTarget:o=null}=i;if(this._setSize(s),!1===this._hasInitialized){const s=o||this._allocateTarget();return i.renderTarget=s,this.fromSceneAsync(e,t,n,r,i),s}XR=this._renderer.getRenderTarget(),QR=this._renderer.getActiveCubeFace(),YR=this._renderer.getActiveMipmapLevel();const l=o||this._allocateTarget();return l.depthBuffer=!0,this._init(l),this._sceneToCubeUV(e,n,r,l,a),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}async fromSceneAsync(e,t=0,n=.1,r=100,i={}){return!1===this._hasInitialized&&await this._renderer.init(),this.fromScene(e,t,n,r,i)}fromEquirectangular(e,t=null){if(!1===this._hasInitialized){this._setSizeFromTexture(e);const n=t||this._allocateTarget();return this.fromEquirectangularAsync(e,n),n}return this._fromTexture(e,t)}async fromEquirectangularAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}fromCubemap(e,t=null){if(!1===this._hasInitialized){this._setSizeFromTexture(e);const n=t||this._allocateTarget();return this.fromCubemapAsync(e,t),n}return this._fromTexture(e,t)}async fromCubemapAsync(e,t=null){return!1===this._hasInitialized&&await this._renderer.init(),this._fromTexture(e,t)}async compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=lN(),await this._compileMaterial(this._cubemapMaterial))}async compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=uN(),await this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose(),null!==this._backgroundBox&&(this._backgroundBox.geometry.dispose(),this._backgroundBox.material.dispose())}_setSizeFromTexture(e){e.mapping===c||e.mapping===h?this._setSize(0===e.image.length?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4)}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(XR,QR,YR),e.scissorTest=!1,aN(e,0,0,e.width,e.height)}_fromTexture(e,t){this._setSizeFromTexture(e),XR=this._renderer.getRenderTarget(),QR=this._renderer.getActiveCubeFace(),YR=this._renderer.getActiveMipmapLevel();const n=t||this._allocateTarget();return this._init(n),this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTarget(){return sN(3*Math.max(this._cubeSize,112),4*this._cubeSize)}_init(e){if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==e.width||this._pingPongRenderTarget.height!==e.height){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=sN(e.width,e.height);const{_lodMax:t}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas,lodMeshes:this._lodMeshes}=function(e){const t=[],n=[],r=[],i=[];let s=e;const a=e-4+1+GR.length;for(let o=0;o<a;o++){const a=Math.pow(2,s);n.push(a);let l=1/a;o>e-4?l=GR[o-e+4-1]:0===o&&(l=0),r.push(l);const u=1/(a-2),c=-u,h=1+u,A=[c,c,h,c,h,h,c,c,h,h,c,h],d=6,p=6,f=3,m=2,g=1,_=new Float32Array(f*p*d),v=new Float32Array(m*p*d),y=new Float32Array(g*p*d);for(let e=0;e<d;e++){const t=e%3*2/3-1,n=e>2?0:-1,r=[t,n,0,t+2/3,n,0,t+2/3,n+1,0,t,n,0,t+2/3,n+1,0,t,n+1,0],i=tN[e];_.set(r,f*p*i),v.set(A,m*p*i);const s=[i,i,i,i,i,i];y.set(s,g*p*i)}const x=new Ar;x.setAttribute("position",new er(_,f)),x.setAttribute("uv",new er(v,m)),x.setAttribute("faceIndex",new er(y,g)),t.push(x),i.push(new Tr(x,null)),s>4&&s--}return{lodPlanes:t,sizeLods:n,sigmas:r,lodMeshes:i}}(t)),this._blurMaterial=function(e,t,n){const r=MT(new Array(20).fill(0)),i=Ex(new Ke(0,1,0)),s=Ex(0),a=by(20),o=Ex(0),l=Ex(1),u=yT(null),c=Ex(0),h=by(1/t),A=by(1/n),d=by(e),p={n:a,latitudinal:o,weights:r,poleAxis:i,outputDirection:rN,dTheta:s,samples:l,envMap:u,mipInt:c,CUBEUV_TEXEL_WIDTH:h,CUBEUV_TEXEL_HEIGHT:A,CUBEUV_MAX_MIP:d},f=oN("blur");return f.fragmentNode=zR({...p,latitudinal:o.equal(1)}),eN.set(f,p),f}(t,e.width,e.height)}}async _compileMaterial(e){const t=new Tr(this._lodPlanes[0],e);await this._renderer.compile(t,jR)}_sceneToCubeUV(e,t,n,r,i){const s=HR;s.near=t,s.far=n;const a=[1,1,1,1,-1,1],o=[1,-1,1,-1,1,-1],l=this._renderer,u=l.autoClear;l.getClearColor(WR),l.autoClear=!1;let c=this._backgroundBox;
1if(null===c){const e=new Xn({name:"PMREM.Background",side:1,depthWrite:!1,depthTest:!1});c=new Tr(new Mr,e)}let h=!1;const A=e.background;A?A.isColor&&(c.material.color.copy(A),e.background=null,h=!0):(c.material.color.copy(WR),h=!0),l.setRenderTarget(r),l.clear(),h&&l.render(c,s);for(let t=0;t<6;t++){const n=t%3;0===n?(s.up.set(0,a[t],0),s.position.set(i.x,i.y,i.z),s.lookAt(i.x+o[t],i.y,i.z)):1===n?(s.up.set(0,0,a[t]),s.position.set(i.x,i.y,i.z),s.lookAt(i.x,i.y+o[t],i.z)):(s.up.set(0,a[t],0),s.position.set(i.x,i.y,i.z),s.lookAt(i.x,i.y,i.z+o[t]));const u=this._cubeSize;aN(r,n*u,t>2?u:0,u,u),l.render(e,s)}l.autoClear=u,e.background=A}_textureToCubeUV(e,t){const n=this._renderer,r=e.mapping===c||e.mapping===h;r?null===this._cubemapMaterial&&(this._cubemapMaterial=lN(e)):null===this._equirectMaterial&&(this._equirectMaterial=uN(e));const i=r?this._cubemapMaterial:this._equirectMaterial;i.fragmentNode.value=e;const s=this._lodMeshes[0];s.material=i;const a=this._cubeSize;aN(t,0,0,3*a,2*a),n.setRenderTarget(t),n.render(s,jR)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const r=this._lodPlanes.length;for(let t=1;t<r;t++){const n=Math.sqrt(this._sigmas[t]*this._sigmas[t]-this._sigmas[t-1]*this._sigmas[t-1]),i=ZR[(r-t-1)%ZR.length];this._blur(e,t-1,t,n,i)}t.autoClear=n}_blur(e,t,n,r,i){const s=this._pingPongRenderTarget;this._halfBlur(e,s,t,n,r,"latitudinal",i),this._halfBlur(s,e,n,n,r,"longitudinal",i)}_halfBlur(e,t,n,r,i,s,a){const o=this._renderer,l=this._blurMaterial,u=this._lodMeshes[r];u.material=l;const c=eN.get(l),h=this._sizeLods[n]-1,A=isFinite(i)?Math.PI/(2*h):2*Math.PI/39,d=i/A,p=isFinite(i)?1+Math.floor(3*d):20,f=[];let m=0;for(let e=0;e<20;++e){const t=e/d,n=Math.exp(-t*t/2);f.push(n),0===e?m+=n:e<p&&(m+=2*n)}for(let e=0;e<f.length;e++)f[e]=f[e]/m;e.texture.frame=(e.texture.frame||0)+1,c.envMap.value=e.texture,c.samples.value=p,c.weights.array=f,c.latitudinal.value="latitudinal"===s?1:0,a&&(c.poleAxis.value=a);const{_lodMax:g}=this;c.dTheta.value=A,c.mipInt.value=g-n;const _=this._sizeLods[r];aN(t,3*_*(r>g-4?r-g+4:0),4*(this._cubeSize-_),3*_,2*_),o.setRenderTarget(t),o.render(u,jR)}}function sN(e,t){const n=new yt(e,t,{magFilter:x,minFilter:x,generateMipmaps:!1,type:P,format:F,colorSpace:Me});return n.texture.mapping=p,n.texture.name="PMREM.cubeUv",n.texture.isPMREMTexture=!0,n.scissorTest=!0,n}function aN(e,t,n,r,i){e.viewport.set(t,n,r,i),e.scissor.set(t,n,r,i)}function oN(e){const t=new rC;return t.depthTest=!1,t.depthWrite=!1,t.blending=0,t.name=`PMREM_${e}`,t}function lN(e){const t=oN("cubemap");return t.fragmentNode=IS(e,rN),t}function uN(e){const t=oN("equirect");return t.fragmentNode=yT(e,dC(rN),0),t}const cN=new WeakMap;const hN=dy(class extends Sv{static get type(){return"PMREMNode"}constructor(e,t=null,n=null){super("vec3"),this._value=e,this._pmrem=null,this.uvNode=t,this.levelNode=n,this._generator=null;const r=new _t;r.isRenderTargetTexture=!0,this._texture=yT(r),this._width=Ex(0),this._height=Ex(0),this._maxMip=Ex(0),this.updateBeforeType=pv.RENDER}set value(e){this._value=e,this._pmrem=null}get value(){return this._value}updateFromTexture(e){const t=function(e){const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}(e.image.height);this._texture.value=e,this._width.value=t.texelWidth,this._height.value=t.texelHeight,this._maxMip.value=t.maxMip}updateBefore(e){let t=this._pmrem;const n=t?t.pmremVersion:-1,r=this._value;n!==r.pmremVersion&&(t=!0===r.isPMREMTexture?r:function(e,t,n){const r=function(e){let t=cN.get(e);return void 0===t&&(t=new WeakMap,cN.set(e,t)),t}(t);let i=r.get(e);if((void 0!==i?i.pmremVersion:-1)!==e.pmremVersion){const t=e.image;if(e.isCubeTexture){if(!function(e){if(null==e)return!1;let t=0;for(let n=0;n<6;n++)void 0!==e[n]&&t++;return 6===t}(t))return null;i=n.fromCubemap(e,i)}else{if(!function(e){return null!=e&&e.height>0}(t))return null;i=n.fromEquirectangular(e,i)}i.pmremVersion=e.pmremVersion,r.set(e,i)}return i.texture}(r,e.renderer,this._generator),null!==t&&(this._pmrem=t,this.updateFromTexture(t)))}setup(e){null===this._generator&&(this._generator=new iN(e.renderer)),this.updateBefore(e);let t=this.uvNode;null===t&&e.context.getUV&&(t=e.context.getUV(this)),t=ES.mul(Ny(t.x,t.y.negate(),t.z));let n=this.levelNode;return null===n&&e.context.getTextureLevel&&(n=e.context.getTextureLevel(this)),kR(this._texture,t,n,this._width,this._height,this._maxMip)}dispose(){super.dispose(),null!==this._generator&&this._generator.dispose()}}).setParameterLength(1,3),AN=new WeakMap;class dN extends vE{static get type(){return"EnvironmentNode"}constructor(e=null){super(),this.envNode=e}setup(e){const{material:t}=e;let n=this.envNode;if(n.isTextureNode||n.isMaterialReferenceNode){const e=n.isTextureNode?n.value:t[n.property];let r=AN.get(e);void 0===r&&(r=hN(e),AN.set(e,r)),n=r}const r=!0===t.useAnisotropy||t.anisotropy>0?nM:_S,i=n.context(pN(Qy,r)).mul(MS),s=n.context(fN(vS)).mul(Math.PI).mul(MS),a=Jw(i),o=Jw(s);
vendor: 6,495 bytes, line 1
1e.context.radiance.addAssign(a),e.context.iblIrradiance.addAssign(o);const l=e.context.lightingModel.clearcoatRadiance;if(l){const e=n.context(pN(Ky,yS)).mul(MS),t=Jw(e);l.addAssign(t)}}}const pN=(e,t)=>{let n=null;return{getUV:()=>(null===n&&(n=cS.negate().reflect(t),n=e.mul(e).mix(n,t).normalize(),n=n.transformDirection(LT)),n),getTextureLevel:()=>e}},fN=e=>({getUV:()=>e,getTextureLevel:()=>by(1)}),mN=new Ns;class gN extends rC{static get type(){return"MeshStandardNodeMaterial"}constructor(e){super(),this.isMeshStandardNodeMaterial=!0,this.lights=!0,this.emissiveNode=null,this.metalnessNode=null,this.roughnessNode=null,this.setDefaultValues(mN),this.setValues(e)}setupEnvironment(e){let t=super.setupEnvironment(e);return null===t&&e.environmentNode&&(t=e.environmentNode),t?new dN(t):null}setupLightingModel(){return new bR}setupSpecular(){const e=lw(Ny(.04),Wy.rgb,Yy);ox.assign(e),lx.assign(1)}setupVariants(){const e=this.metalnessNode?by(this.metalnessNode):xM;Yy.assign(e);let t=this.roughnessNode?by(this.roughnessNode):yM;t=OC({roughness:t}),Qy.assign(t),this.setupSpecular(),Wy.assign(Iy(Wy.rgb.mul(e.oneMinus()),Wy.a))}copy(e){return this.emissiveNode=e.emissiveNode,this.metalnessNode=e.metalnessNode,this.roughnessNode=e.roughnessNode,super.copy(e)}}const _N=new class extends Ns{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ye(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return Ge(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(e){this.ior=(1+.4*e)/(1-.4*e)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Gn(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Gn(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Gn(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}};class vN extends gN{static get type(){return"MeshPhysicalNodeMaterial"}constructor(e){super(),this.isMeshPhysicalNodeMaterial=!0,this.clearcoatNode=null,this.clearcoatRoughnessNode=null,this.clearcoatNormalNode=null,this.sheenNode=null,this.sheenRoughnessNode=null,this.iridescenceNode=null,this.iridescenceIORNode=null,this.iridescenceThicknessNode=null,this.specularIntensityNode=null,this.specularColorNode=null,this.iorNode=null,this.transmissionNode=null,this.thicknessNode=null,this.attenuationDistanceNode=null,this.attenuationColorNode=null,this.dispersionNode=null,this.anisotropyNode=null,this.setDefaultValues(_N),this.setValues(e)}get useClearcoat(){return this.clearcoat>0||null!==this.clearcoatNode}get useIridescence(){return this.iridescence>0||null!==this.iridescenceNode}get useSheen(){return this.sheen>0||null!==this.sheenNode}get useAnisotropy(){return this.anisotropy>0||null!==this.anisotropyNode}get useTransmission(){return this.transmission>0||null!==this.transmissionNode}get useDispersion(){return this.dispersion>0||null!==this.dispersionNode}setupSpecular(){const e=this.iorNode?by(this.iorNode):OM;px.assign(e),ox.assign(lw(Xb(nw(px.sub(1).div(px.add(1))).mul(gM),Ny(1)).mul(mM),Wy.rgb,Yy)),lx.assign(lw(mM,1,Yy))}setupLightingModel(){return new bR(this.useClearcoat,this.useSheen,this.useIridescence,this.useAnisotropy,this.useTransmission,this.useDispersion)}setupVariants(e){if(super.setupVariants(e),this.useClearcoat){const e=this.clearcoatNode?by(this.clearcoatNode):wM,t=this.clearcoatRoughnessNode?by(this.clearcoatRoughnessNode):TM;$y.assign(e),Ky.assign(OC({roughness:t}))}if(this.useSheen){const e=this.sheenNode?Ny(this.sheenNode):EM,t=this.sheenRoughnessNode?by(this.sheenRoughnessNode):CM;Zy.assign(e),Jy.assign(t)}if(this.useIridescence){const e=this.iridescenceNode?by(this.iridescenceNode):NM,t=this.iridescenceIORNode?by(this.iridescenceIORNode):PM,n=this.iridescenceThicknessNode?by(this.iridescenceThicknessNode):DM;ex.assign(e),tx.assign(t),nx.assign(n)}if(this.useAnisotropy){const e=(this.anisotropyNode?My(this.anisotropyNode):RM).toVar();ix.assign(e.length()),vy(ix.equal(0),(()=>
1{e.assign(My(1,0))})).Else((()=>{e.divAssign(My(ix)),ix.assign(ix.saturate())})),rx.assign(ix.pow2().mix(Qy.pow2(),1)),sx.assign(eM[0].mul(e.x).add(eM[1].mul(e.y))),ax.assign(eM[1].mul(e.x).sub(eM[0].mul(e.y)))}if(this.useTransmission){const e=this.transmissionNode?by(this.transmissionNode):LM,t=this.thicknessNode?by(this.thicknessNode):IM,n=this.attenuationDistanceNode?by(this.attenuationDistanceNode):BM,r=this.attenuationColorNode?Ny(this.attenuationColorNode):UM;if(fx.assign(e),mx.assign(t),gx.assign(n),_x.assign(r),this.useDispersion){const e=this.dispersionNode?by(this.dispersionNode):jM;vx.assign(e)}}}setupClearcoatNormal(){return this.clearcoatNormalNode?Ny(this.clearcoatNormalNode):SM}setup(e){e.context.setupClearcoatNormal=()=>this.setupClearcoatNormal(e),super.setup(e)}copy(e){return this.clearcoatNode=e.clearcoatNode,this.clearcoatRoughnessNode=e.clearcoatRoughnessNode,this.clearcoatNormalNode=e.clearcoatNormalNode,this.sheenNode=e.sheenNode,this.sheenRoughnessNode=e.sheenRoughnessNode,this.iridescenceNode=e.iridescenceNode,this.iridescenceIORNode=e.iridescenceIORNode,this.iridescenceThicknessNode=e.iridescenceThicknessNode,this.specularIntensityNode=e.specularIntensityNode,this.specularColorNode=e.specularColorNode,this.transmissionNode=e.transmissionNode,this.thicknessNode=e.thicknessNode,this.attenuationDistanceNode=e.attenuationDistanceNode,this.attenuationColorNode=e.attenuationColorNode,this.dispersionNode=e.dispersionNode,this.anisotropyNode=e.anisotropyNode,super.copy(e)}}const yN=my((({normal:e,lightDirection:t,builder:n})=>{const r=e.dot(t),i=My(r.mul(.5).add(.5),0);if(n.material.gradientMap){const e=qS("gradientMap","texture").context({getUV:()=>i});return Ny(e.r)}{const e=i.fwidth().mul(.5);return lw(Ny(.7),Ny(1),Aw(by(.7).sub(e.x),by(.7).add(e.x),i.x))}}));class xN extends xC{direct({lightDirection:e,lightColor:t,reflectedLight:n},r){const i=yN({normal:dS,lightDirection:e,builder:r}).mul(t);n.directDiffuse.addAssign(i.mul(MC({diffuseColor:Wy.rgb})))}indirect(e){const{ambientOcclusion:t,irradiance:n,reflectedLight:r}=e.context;r.indirectDiffuse.addAssign(n.mul(MC({diffuseColor:Wy}))),r.indirectDiffuse.mulAssign(t)}}const bN=new class extends Wn{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Gn(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Gn(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(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.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}};class wN extends rC{static get type(){return"MeshToonNodeMaterial"}constructor(e){super(),this.isMeshToonNodeMaterial=!0,this.lights=!0,this.setDefaultValues(bN),this.setValues(e)}setupLightingModel(){return new xN}}const TN=py(class extends Sv{static get type(){return"MatcapUVNode"}constructor(){super("vec2")}setup(){const e=Ny(cS.z,0,cS.x.negate()).normalize(),t=cS.cross(e);return My(e.dot(_S),t.dot(_S)).mul(.495).add(.5)}}
1),SN=new class extends Wn{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Gn(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}};class MN extends rC{static get type(){return"MeshMatcapNodeMaterial"}constructor(e){super(),this.isMeshMatcapNodeMaterial=!0,this.setDefaultValues(SN),this.setValues(e)}setupVariants(e){const t=TN;let n;n=e.material.matcap?qS("matcap","texture").context({getUV:()=>t}):Ny(lw(.2,.8,t.y)),Wy.rgb.mulAssign(n.rgb)}}const EN=dy(class extends Sv{static get type(){return"RotateNode"}constructor(e,t){super(),this.positionNode=e,this.rotationNode=t}getNodeType(e){return this.positionNode.getNodeType(e)}setup(e){const{rotationNode:t,positionNode:n}=this;if("vec2"===this.getNodeType(e)){const e=t.cos(),r=t.sin();return Fy(e,r,r.negate(),e).mul(n)}{const e=t,r=qy(Iy(1,0,0,0),Iy(0,Cb(e.x),Eb(e.x).negate(),0),Iy(0,Eb(e.x),Cb(e.x),0),Iy(0,0,0,1)),i=qy(Iy(Cb(e.y),0,Eb(e.y),0),Iy(0,1,0,0),Iy(Eb(e.y).negate(),0,Cb(e.y),0),Iy(0,0,0,1)),s=qy(Iy(Cb(e.z),Eb(e.z).negate(),0,0),Iy(Eb(e.z),Cb(e.z),0,0),Iy(0,0,1,0),Iy(0,0,0,1));return r.mul(i).mul(s).mul(Iy(n,1)).xyz}}}).setParameterLength(2),CN=new class extends Wn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Gn(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}};class RN extends rC{static get type(){return"SpriteNodeMaterial"}constructor(e){super(),this.isSpriteNodeMaterial=!0,this._useSizeAttenuation=!0,this.positionNode=null,this.rotationNode=null,this.scaleNode=null,this.transparent=!0,this.setDefaultValues(CN),this.setValues(e)}setupPositionView(e){const{object:t,camera:n}=e,r=this.sizeAttenuation,{positionNode:i,rotationNode:s,scaleNode:a}=this,o=eS.mul(Ny(i||0));let l=My(XT[0].xyz.length(),XT[1].xyz.length());if(null!==a&&(l=l.mul(My(a))),!1===r)if(n.isPerspectiveCamera)l=l.mul(o.z.negate());else{const e=by(2).div(PT.element(1).element(1));l=l.mul(e.mul(2))}let u=iS.xy;if(t.center&&!0===t.center.isVector2){const e=((e,t,n)=>cy(new kw("center","vec2",n)))(0,0,t);u=u.sub(e.sub(.5))}u=u.mul(l);const c=by(s||MM),h=EN(u,c);return Iy(o.xy.add(h),o.zw)}copy(e){return this.positionNode=e.positionNode,this.rotationNode=e.rotationNode,this.scaleNode=e.scaleNode,super.copy(e)}get sizeAttenuation(){return this._useSizeAttenuation}set sizeAttenuation(e){this._useSizeAttenuation!==e&&(this._useSizeAttenuation=e,this.needsUpdate=!0)}}const NN=new vi;class PN extends RN{static get type(){return"PointsNodeMaterial"}constructor(e){super(),this.sizeNode=null,this.isPointsNodeMaterial=!0,this.setDefaultValues(NN),this.setValues(e)}setupPositionView(){const{positionNode:e}=this;return eS.mul(Ny(e||sS)).xyz}setupVertex(e){const t=super.setupVertex(e);if(!0!==e.material.isNodeMaterial)return t;const{rotationNode:n,scaleNode:r,sizeNode:i}=this,s=iS.xy.toVar(),a=RE.z.div(RE.w);if(n&&n.isNode){const e=by(n);s.assign(EN(s,e))}let o=null!==i?My(i):GM;return!0===this.sizeAttenuation&&(o=o.mul(o.div(uS.z.negate()))),r&&r.isNode&&(o=o.mul(My(r))),s.mulAssign(o.mul(2)),s.assign(s.div(RE.z)),s.y.assign(s.y.mul(a)),s.assign(s.mul(t.w)),t.addAssign(Iy(s,0,0)),t}get alphaToCoverage(){return this._useAlphaToCoverage}set alphaToCoverage(e){this._useAlphaToCoverage!==e&&(this._useAlphaToCoverage=e,this.needsUpdate=!0)}}class DN extends xC{constructor(){super(),this.shadowNode=by(1).toVar("shadowMask")}direct({lightNode:e}){null!==e.shadowNode&&this.shadowNode.mulAssign(e.shadowNode)}finish({context:e}){Wy.a.mulAssign(this.shadowNode.oneMinus()),e.outgoingLight.rgb.assign(Wy.rgb)}}const LN=new class extends Wn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Gn(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}};class IN extends rC{static get type(){return"ShadowNodeMaterial"}constructor(e){super(),this.isShadowNodeMaterial=!0,this.lights=!0,this.transparent=!0,this.setDefaultValues(LN),this.setValues(e)}setupLightingModel(){return new DN}}jy("vec3"),jy("vec3"),jy("vec3");class ON{constructor(e,t){this.nodes=e,this.info=t,this._context="undefined"!=typeof self?self:null,this._animationLoop=null,this._requestId=null}start(){const e=(t,n)=>{this._requestId=this._context.requestAnimationFrame(e),!0===this.info.autoReset&&this.info.reset(),this.nodes.nodeFrame.update(
vendor: 11,697 bytes, line 1
1),this.info.frame=this.nodes.nodeFrame.frameId,null!==this._animationLoop&&this._animationLoop(t,n)};e()}stop(){this._context.cancelAnimationFrame(this._requestId),this._requestId=null}getAnimationLoop(){return this._animationLoop}setAnimationLoop(e){this._animationLoop=e}getContext(){return this._context}setContext(e){this._context=e}dispose(){this.stop()}}class BN{constructor(){this.weakMap=new WeakMap}get(e){let t=this.weakMap;for(let n=0;n<e.length-1;n++)if(t=t.get(e[n]),void 0===t)return;return t.get(e[e.length-1])}set(e,t){let n=this.weakMap;for(let t=0;t<e.length-1;t++){const r=e[t];!1===n.has(r)&&n.set(r,new WeakMap),n=n.get(r)}return n.set(e[e.length-1],t),this}delete(e){let t=this.weakMap;for(let n=0;n<e.length-1;n++)if(t=t.get(e[n]),void 0===t)return!1;return t.delete(e[e.length-1])}}let UN=0;class FN{constructor(e,t,n,r,i,s,a,o,l,u){this.id=UN++,this._nodes=e,this._geometries=t,this.renderer=n,this.object=r,this.material=i,this.scene=s,this.camera=a,this.lightsNode=o,this.context=l,this.geometry=r.geometry,this.version=i.version,this.drawRange=null,this.attributes=null,this.pipeline=null,this.group=null,this.vertexBuffers=null,this.drawParams=null,this.bundle=null,this.clippingContext=u,this.clippingContextCacheKey=null!==u?u.cacheKey:"",this.initialNodesCacheKey=this.getDynamicCacheKey(),this.initialCacheKey=this.getCacheKey(),this._nodeBuilderState=null,this._bindings=null,this._monitor=null,this.onDispose=null,this.isRenderObject=!0,this.onMaterialDispose=()=>{this.dispose()},this.material.addEventListener("dispose",this.onMaterialDispose)}updateClipping(e){this.clippingContext=e}get clippingNeedsUpdate(){return null!==this.clippingContext&&this.clippingContext.cacheKey!==this.clippingContextCacheKey&&(this.clippingContextCacheKey=this.clippingContext.cacheKey,!0)}get hardwareClippingPlanes(){return!0===this.material.hardwareClipping?this.clippingContext.unionClippingCount:0}getNodeBuilderState(){return this._nodeBuilderState||(this._nodeBuilderState=this._nodes.getForRender(this))}getMonitor(){return this._monitor||(this._monitor=this.getNodeBuilderState().observer)}getBindings(){return this._bindings||(this._bindings=this.getNodeBuilderState().createBindings())}getBindingGroup(e){for(const t of this.getBindings())if(t.name===e)return t}getIndex(){return this._geometries.getIndex(this)}getIndirect(){return this._geometries.getIndirect(this)}getChainArray(){return[this.object,this.material,this.context,this.lightsNode]}setGeometry(e){this.geometry=e,this.attributes=null}getAttributes(){if(null!==this.attributes)return this.attributes;const e=this.getNodeBuilderState().nodeAttributes,t=this.geometry,n=[],r=new Set;for(const i of e){const e=i.node&&i.node.attribute?i.node.attribute:t.getAttribute(i.name);if(void 0===e)continue;n.push(e);const s=e.isInterleavedBufferAttribute?e.data:e;r.add(s)}return this.attributes=n,this.vertexBuffers=Array.from(r.values()),n}getVertexBuffers(){return null===this.vertexBuffers&&this.getAttributes(),this.vertexBuffers}getDrawParameters(){const{object:e,material:t,geometry:n,group:r,drawRange:i}=this,s=this.drawParams||(this.drawParams={vertexCount:0,firstVertex:0,instanceCount:0,firstInstance:0}),a=this.getIndex(),o=null!==a;let l=1;if(!0===n.isInstancedBufferGeometry?l=n.instanceCount:void 0!==e.count&&(l=Math.max(0,e.count)),0===l)return null;if(s.instanceCount=l,!0===e.isBatchedMesh)return s;let u=1;!0!==t.wireframe||e.isPoints||e.isLineSegments||e.isLine||e.isLineLoop||(u=2);let c=i.start*u,h=(i.start+i.count)*u;null!==r&&(c=Math.max(c,r.start*u),h=Math.min(h,(r.start+r.count)*u));const A=n.attributes.position;let d=1/0;o?d=a.count:null!=A&&(d=A.count),c=Math.max(c,0),h=Math.min(h,d);const p=h-c;return p<0||p===1/0?null:(s.vertexCount=p,s.firstVertex=c,s)}getGeometryCacheKey(){const{geometry:e}=this;let t="";for(const n of Object.keys(e.attributes).sort()){const r=e.attributes[n];t+=n+",",r.data&&(t+=r.data.stride+","),r.offset&&(t+=r.offset+","),r.itemSize&&(t+=r.itemSize+","),r.normalized&&(t+="n,")}for(const n of Object.keys(e.morphAttributes).sort()){const r=e.morphAttributes[n];t+="morph-"+n+",";for(let e=0,n=r.length;e<n;e++)t+=r[e].id+","}return e.index&&(t+="index,"),t}getMaterialCacheKey(){const{object:e,material:t}=this;let n=t.customProgramCacheKey();for(const e of function(e){const t=Object.keys(e);let n=Object.getPrototypeOf(e);for(;n;){const e=Object.getOwnPropertyDescriptors(n);for(const n in e)if(void 0!==e[n]){const r=e[n];r&&"function"==typeof r.get&&t.push(n)}n=Object.getPrototypeOf(n)}return t}(t)){if(/^(is[A-Z]|_)|^(visible|version|uuid|name|opacity|userData)$/.test(e))continue;const r=t[e];let i;if(null!==r){const e=typeof r;"number"===e?i=0!==r?"1":"0":"object"===e?(i="{",r.isTexture&&(i+=r.mapping),i+="}"):i=String(r)}else i=String(r);n+=i+","}return n+=this.clippingContextCacheKey+",",e.geometry&&(n+=this.getGeometryCacheKey()),e.skeleton&&(n+=e.skeleton.bones.length+","),e.isBatchedMesh&&(n+=e._matricesTexture.uuid+",",null!==e._colorsTexture&&(n+=e._colorsTexture.uuid+",")),e.count>1&&(n+=e.uuid+","),n+=e.receiveShadow+",",$_(n)}get needsGeometryUpdate(){return this.geometry.id!==this.object.geometry.id}get needsUpdate(){return this.initialNodesCacheKey!==this.getDynamicCacheKey()||this.clippingNeedsUpdate}getDynamicCacheKey(){let e=0;return!0!==this.material.isShadowPassMaterial&&(e=this._nodes.getCacheKey(this.scene,this.lightsNode)),this.camera.isArrayCamera&&(e=Z_(e,this.camera.cameras.length)),this.object.receiveShadow&&(e=Z_(e,1)),e}getCacheKey(){return this.getMaterialCacheKey()+this.getDynamicCacheKey()}dispose(){this.material.removeEventListener("dispose",this.onMaterialDispose),this.onDispose()}}const kN=[];class qN{constructor(e,t,n,r,i,s){this.renderer=e,this.nodes=t,this.geometries=n,this.pipelines=r,this.bindings=i,this.info=s,this.chainMaps={}}get(e,t,n,r,i,s,a,o){const l=this.getChainMap(o);kN[0]=e,kN[1]=t,kN[2]=s,kN[3]=i;let u=l.get(kN);return void 0===u?(u=this.createRenderObject(this.nodes,this.geometries,this.renderer,e,t,n,r,i,s,a,o),l.set(kN,u)):(u.updateClipping(a),u.needsGeometryUpdate&&u.setGeometry(e.geometry),(u.version!==t.version||u.needsUpdate)&&(u.initialCacheKey!==u.getCacheKey()?(u.dispose(),u=this.get(e,t,n,r,i,s,a,o)):u.version=t.version)),kN.length=0,u}getChainMap(e="default"){return this.chainMaps[e]||(this.chainMaps[e]=new BN)}dispose(){this.chainMaps={}}createRenderObject(e,t,n,r,i,s,a,o,l,u,c){const h=this.getChainMap(c),A=new FN(e,t,n,r,i,s,a,o,l,u);return A.onDispose=()=>{this.pipelines.delete(A),this.bindings.delete(A),this.nodes.delete(A),h.delete(A.getChainArray())},A}}class VN{constructor(){this.data=new WeakMap}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}delete(e){let t=null;return this.data.has(e)&&(t=this.data.get(e),this.data.delete(e)),t}has(e){return this.data.has(e)}dispose(){this.data=new WeakMap}}const zN=16;class GN extends VN{constructor(e){super(),this.backend=e}delete(e){const t=super.delete(e);return null!==t&&this.backend.destroyAttribute(e),t}update(e,t){const n=this.get(e);if(void 0===n.version)1===t?this.backend.createAttribute(e):2===t?this.backend.createIndexAttribute(e):3===t?this.backend.createStorageAttribute(e):4===t&&this.backend.createIndirectStorageAttribute(e),n.version=this._getBufferAttribute(e).version;else{const t=this._getBufferAttribute(e);(n.version<t.version||t.usage===Le)&&(this.backend.updateAttribute(e),n.version=t.version)}}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}function jN(e){return null!==e.index?e.index.version:e.attributes.position.version}function HN(e){const t=[],n=e.index,r=e.attributes.position;if(null!==n){const e=n.array;for(let n=0,r=e.length;n<r;n+=3){const r=e[n+0],i=e[n+1],s=e[n+2];t.push(r,i,i,s,s,r)}}else for(let e=0,n=r.array.length/3-1;e<n;e+=3){const n=e+0,r=e+1,i=e+2;t.push(n,r,r,i,i,n)}const i=new(nt(t)?nr:tr)(t,1);return i.version=jN(e),i}class WN extends VN{constructor(e,t){super(),this.attributes=e,this.info=t,this.wireframes=new WeakMap,this.attributeCall=new WeakMap}has(e){const t=e.geometry;return super.has(t)&&!0===this.get(t).initialized}updateForRender(e){!1===this.has(e)&&this.initGeometry(e),this.updateAttributes(e)}initGeometry(e){const t=e.geometry;this.get(t).initialized=!0,this.info.memory.geometries++;const n=()=>{this.info.memory.geometries--;const r=t.index,i=e.getAttributes();null!==r&&this.attributes.delete(r);for(const e of i)this.attributes.delete(e);const s=this.wireframes.get(t);void 0!==s&&this.attributes.delete(s),t.removeEventListener("dispose",n)};t.addEventListener("dispose",n)}updateAttributes(e){const t=e.getAttributes();for(const e of t)e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute?this.updateAttribute(e,3):this.updateAttribute(e,1);const n=this.getIndex(e);null!==n&&this.updateAttribute(n,2);const r=e.geometry.indirect;null!==r&&this.updateAttribute(r,4)}updateAttribute(e,t){const n=this.info.render.calls;e.isInterleavedBufferAttribute?void 0===this.attributeCall.get(e)?(this.attributes.update(e,t),this.attributeCall.set(e,n)):this.attributeCall.get(e.data)!==n&&(this.attributes.update(e,t),this.attributeCall.set(e.data,n),this.attributeCall.set(e,n)):this.attributeCall.get(e)!==n&&(this.attributes.update(e,t),this.attributeCall.set(e,n))}getIndirect(e){return e.geometry.indirect}getIndex(e){const{geometry:t,material:n}=e;let r=t.index;if(!0===n.wireframe){const e=this.wireframes;let n=e.get(t);void 0===n?(n=HN(t),e.set(t,n)):n.version!==jN(t)&&(this.attributes.delete(n),n=HN(t),e.set(t,n)),r=n}return r}}class XN{constructor(){this.autoReset=!0,this.frame=0,this.calls=0,this.render={calls:0,frameCalls:0,drawCalls:0,triangles:0,points:0,lines:0,timestamp:0},this.compute={calls:0,frameCalls:0,timestamp:0},this.memory={geometries:0,textures:0}}update(e,t,n){this.render.drawCalls++,e.isMesh||e.isSprite?this.render.triangles+=n*(t/3):e.isPoints?this.render.points+=n*t:e.isLineSegments?this.render.lines+=n*(t/2):e.isLine&&(this.render.lines+=n*(t-1))}reset(){this.render.drawCalls=0,this.render.frameCalls=0,this.compute.frameCalls=0,this.render.triangles=0,this.render.points=0,this.render.lines=0}dispose(){this.reset(),this.calls=0,this.render.calls=0,this.compute.calls=0,this.render.timestamp=0,this.compute.timestamp=0,this.memory.geometries=0,this.memory.textures=0}}class QN{constructor(e){this.cacheKey=e,this.usedTimes=0}}class YN extends QN{constructor(e,t,n){super(e),this.vertexProgram=t,this.fragmentProgram=n}}class $N extends QN{constructor(e,t){super(e),this.computeProgram=t,this.isComputePipeline=!0}}let KN=0;class ZN{constructor(e,t,n,r=null,i=null){this.id=KN++,this.code=e,this.stage=t,this.name=n,this.transforms=r,this.attributes=i,this.usedTimes=0}}class JN extends VN{constructor(e,t){super(),this.backend=e,this.nodes=t,this.bindings=null,this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}getForCompute(e,t){const{backend:n}=this,r=this.get(e);if(this._needsComputeUpdate(e)){const i=r.pipeline;i&&(i.usedTimes--,i.computeProgram.usedTimes--);const s=this.nodes.getForCompute(e);let a=this.programs.compute.get(s.computeShader);void 0===a&&(i&&0===i.computeProgram.usedTimes&&this._releaseProgram(i.computeProgram),a=new ZN(s.computeShader,"compute",e.name,s.transforms,s.nodeAttributes),this.programs.compute.set(s.computeShader,a),n.createProgram(a));const o=this._getComputeCacheKey(e,a);let l=this.caches.get(o);void 0===l&&(i&&0===i.usedTimes&&this._releasePipeline(i),l=this._getComputePipeline(e,a,o,t)),l.usedTimes++,a.usedTimes++,r.version=e.version,r.pipeline=l}return r.pipeline}getForRender(e,t=null){const{backend:n}=this,r=this.get(e);
1if(this._needsRenderUpdate(e)){const i=r.pipeline;i&&(i.usedTimes--,i.vertexProgram.usedTimes--,i.fragmentProgram.usedTimes--);const s=e.getNodeBuilderState(),a=e.material?e.material.name:"";let o=this.programs.vertex.get(s.vertexShader);void 0===o&&(i&&0===i.vertexProgram.usedTimes&&this._releaseProgram(i.vertexProgram),o=new ZN(s.vertexShader,"vertex",a),this.programs.vertex.set(s.vertexShader,o),n.createProgram(o));let l=this.programs.fragment.get(s.fragmentShader);void 0===l&&(i&&0===i.fragmentProgram.usedTimes&&this._releaseProgram(i.fragmentProgram),l=new ZN(s.fragmentShader,"fragment",a),this.programs.fragment.set(s.fragmentShader,l),n.createProgram(l));const u=this._getRenderCacheKey(e,o,l);let c=this.caches.get(u);void 0===c?(i&&0===i.usedTimes&&this._releasePipeline(i),c=this._getRenderPipeline(e,o,l,u,t)):e.pipeline=c,c.usedTimes++,o.usedTimes++,l.usedTimes++,r.pipeline=c}return r.pipeline}delete(e){const t=this.get(e).pipeline;return t&&(t.usedTimes--,0===t.usedTimes&&this._releasePipeline(t),t.isComputePipeline?(t.computeProgram.usedTimes--,0===t.computeProgram.usedTimes&&this._releaseProgram(t.computeProgram)):(t.fragmentProgram.usedTimes--,t.vertexProgram.usedTimes--,0===t.vertexProgram.usedTimes&&this._releaseProgram(t.vertexProgram),0===t.fragmentProgram.usedTimes&&this._releaseProgram(t.fragmentProgram))),super.delete(e)}dispose(){super.dispose(),this.caches=new Map,this.programs={vertex:new Map,fragment:new Map,compute:new Map}}updateForRender(e){this.getForRender(e)}_getComputePipeline(e,t,n,r){n=n||this._getComputeCacheKey(e,t);let i=this.caches.get(n);return void 0===i&&(i=new $N(n,t),this.caches.set(n,i),this.backend.createComputePipeline(i,r)),i}_getRenderPipeline(e,t,n,r,i){r=r||this._getRenderCacheKey(e,t,n);let s=this.caches.get(r);return void 0===s&&(s=new YN(r,t,n),this.caches.set(r,s),e.pipeline=s,this.backend.createRenderPipeline(e,i)),s}_getComputeCacheKey(e,t){return e.id+","+t.id}_getRenderCacheKey(e,t,n){return t.id+","+n.id+","+this.backend.getRenderCacheKey(e)}_releasePipeline(e){this.caches.delete(e.cacheKey)}_releaseProgram(e){const t=e.code,n=e.stage;this.programs[n].delete(t)}_needsComputeUpdate(e){const t=this.get(e);return void 0===t.pipeline||t.version!==e.version}_needsRenderUpdate(e){return void 0===this.get(e).pipeline||this.backend.needsRenderUpdate(e)}}class eP extends VN{constructor(e,t,n,r,i,s){super(),this.backend=e,this.textures=n,this.pipelines=i,this.attributes=r,this.nodes=t,this.info=s,this.pipelines.bindings=this}getForRender(e){const t=e.getBindings();for(const e of t){const n=this.get(e);void 0===n.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),n.bindGroup=e)}return t}getForCompute(e){const t=this.nodes.getForCompute(e).bindings;for(const e of t){const n=this.get(e);void 0===n.bindGroup&&(this._init(e),this.backend.createBindings(e,t,0),n.bindGroup=e)}return t}updateForCompute(e){this._updateBindings(this.getForCompute(e))}updateForRender(e){this._updateBindings(this.getForRender(e))}_updateBindings(e){for(const t of e)this._update(t,e)}_init(e){for(const t of e.bindings)if(t.isSampledTexture)this.textures.updateTexture(t.texture);else if(t.isStorageBuffer){const e=t.attribute,n=e.isIndirectStorageBufferAttribute?4:3;this.attributes.update(e,n)}}_update(e,t){const{backend:n}=this;let r=!1,i=!0,s=0,a=0;for(const t of e.bindings)if(!t.isNodeUniformsGroup||!1!==this.nodes.updateGroup(t)){if(t.isStorageBuffer){const e=t.attribute,n=e.isIndirectStorageBufferAttribute?4:3;this.attributes.update(e,n)}if(t.isUniformBuffer)t.update()&&n.updateBinding(t);else if(t.isSampler)t.update();else if(t.isSampledTexture){const e=this.textures.get(t.texture);t.needsBindingsUpdate(e.generation)&&(r=!0);const o=t.update(),l=t.texture;o&&this.textures.updateTexture(l);const u=n.get(l);if(void 0!==u.externalTexture||e.isDefaultTexture?i=!1:(s=10*s+l.id,a+=l.version),!0===n.isWebGPUBackend&&void 0===u.texture&&void 0===u.externalTexture&&(this.textures.updateTexture(l),r=!0),!0===l.isStorageTexture){const e=this.get(l);!0===t.store?e.needsMipmap=!0:this.textures.needsMipmaps(l)&&!0===e.needsMipmap&&(this.backend.generateMipmaps(l),e.needsMipmap=!1)}}}!0===r&&this.backend.updateBindings(e,t,i?s:0,a)}}function tP(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?e.z-t.z:e.id-t.id}function nP(e,t){return e.groupOrder!==t.groupOrder?e.groupOrder-t.groupOrder:e.renderOrder!==t.renderOrder?e.renderOrder-t.renderOrder:e.z!==t.z?t.z-e.z:e.id-t.id}function rP(e){return(e.transmission>0||e.transmissionNode)&&2===e.side&&!1===e.forceSinglePass}class iP{constructor(e,t,n){this.renderItems=[],this.renderItemsIndex=0,this.opaque=[],this.transparentDoublePass=[],this.transparent=[],this.bundles=[],this.lightsNode=e.getNode(t,n),this.lightsArray=[],this.scene=t,this.camera=n,this.occlusionQueryCount=0}begin(){return this.renderItemsIndex=0,this.opaque.length=0,this.transparentDoublePass.length=0,this.transparent.length=0,this.bundles.length=0,this.lightsArray.length=0,this.occlusionQueryCount=0,this}getNextRenderItem(e,t,n,r,i,s,a){let o=this.renderItems[this.renderItemsIndex];return void 0===o?(o={id:e.id,object:e,geometry:t,material:n,groupOrder:r,renderOrder:e.renderOrder,z:i,group:s,clippingContext:a},this.renderItems[this.renderItemsIndex]=o):(o.id=e.id,o.object=e,o.geometry=t,o.material=n,o.groupOrder=r,o.renderOrder=e.renderOrder,o.z=i,o.group=s,o.clippingContext=a
vendor: 3,412 bytes, line 1
1),this.renderItemsIndex++,o}push(e,t,n,r,i,s,a){const o=this.getNextRenderItem(e,t,n,r,i,s,a);!0===e.occlusionTest&&this.occlusionQueryCount++,!0===n.transparent||n.transmission>0?(rP(n)&&this.transparentDoublePass.push(o),this.transparent.push(o)):this.opaque.push(o)}unshift(e,t,n,r,i,s,a){const o=this.getNextRenderItem(e,t,n,r,i,s,a);!0===n.transparent||n.transmission>0?(rP(n)&&this.transparentDoublePass.unshift(o),this.transparent.unshift(o)):this.opaque.unshift(o)}pushBundle(e){this.bundles.push(e)}pushLight(e){this.lightsArray.push(e)}sort(e,t){this.opaque.length>1&&this.opaque.sort(e||tP),this.transparentDoublePass.length>1&&this.transparentDoublePass.sort(t||nP),this.transparent.length>1&&this.transparent.sort(t||nP)}finish(){this.lightsNode.setLights(this.lightsArray);for(let e=this.renderItemsIndex,t=this.renderItems.length;e<t;e++){const t=this.renderItems[e];if(null===t.id)break;t.id=null,t.object=null,t.geometry=null,t.material=null,t.groupOrder=null,t.renderOrder=null,t.z=null,t.group=null,t.clippingContext=null}}}const sP=[];class aP{constructor(e){this.lighting=e,this.lists=new BN}get(e,t){const n=this.lists;sP[0]=e,sP[1]=t;let r=n.get(sP);return void 0===r&&(r=new iP(this.lighting,e,t),n.set(sP,r)),sP.length=0,r}dispose(){this.lists=new BN}}let oP=0;class lP{constructor(){this.id=oP++,this.color=!0,this.clearColor=!0,this.clearColorValue={r:0,g:0,b:0,a:1},this.depth=!0,this.clearDepth=!0,this.clearDepthValue=1,this.stencil=!1,this.clearStencil=!0,this.clearStencilValue=1,this.viewport=!1,this.viewportValue=new vt,this.scissor=!1,this.scissorValue=new vt,this.renderTarget=null,this.textures=null,this.depthTexture=null,this.activeCubeFace=0,this.activeMipmapLevel=0,this.sampleCount=1,this.width=0,this.height=0,this.occlusionQueryCount=0,this.clippingContext=null,this.isRenderContext=!0}getCacheKey(){return uP(this)}}function uP(e){const{textures:t,activeCubeFace:n}=e,r=[n];for(const e of t)r.push(e.id);return K_(r)}const cP=[],hP=new jr,AP=new Dr;class dP{constructor(){this.chainMaps={}}get(e,t,n=null){let r;if(cP[0]=e,cP[1]=t,null===n)r="default";else{const e=n.texture.format;r=`${n.textures.length}:${e}:${n.samples}:${n.depthBuffer}:${n.stencilBuffer}`}const i=this._getChainMap(r);let s=i.get(cP);return void 0===s&&(s=new lP,i.set(cP,s)),cP.length=0,null!==n&&(s.sampleCount=0===n.samples?1:n.samples),s}getForClear(e=null){return this.get(hP,AP,e)}_getChainMap(e){return this.chainMaps[e]||(this.chainMaps[e]=new BN)}dispose(){this.chainMaps={}}}const pP=new Ke;class fP extends VN{constructor(e,t,n){super(),this.renderer=e,this.backend=t,this.info=n}updateRenderTarget(e,t=0){const n=this.get(e),r=0===e.samples?1:e.samples,i=n.depthTextureMips||(n.depthTextureMips={}),s=e.textures,a=this.getSize(s[0]),o=a.width>>t,l=a.height>>t;let u=e.depthTexture||i[t];const c=!0===e.depthBuffer||!0===e.stencilBuffer;let h=!1;void 0===u&&c&&(u=new Mi,u.format=e.stencilBuffer?q:k,u.type=e.stencilBuffer?I:R,u.image.width=o,u.image.height=l,u.image.depth=a.depth,u.isArrayTexture=!0===e.multiview&&a.depth>1,i[t]=u),n.width===a.width&&a.height===n.height||(h=!0,u&&(u.needsUpdate=!0,u.image.width=o,u.image.height=l,u.image.depth=u.isArrayTexture?u.image.depth:1)),n.width=a.width,n.height=a.height,n.textures=s,n.depthTexture=u||null,n.depth=e.depthBuffer,n.stencil=e.stencilBuffer,n.renderTarget=e,n.sampleCount!==r&&(h=!0,u&&(u.needsUpdate=!0),n.sampleCount=r);
1const A={sampleCount:r};if(!0!==e.isXRRenderTarget){for(let e=0;e<s.length;e++){const t=s[e];h&&(t.needsUpdate=!0),this.updateTexture(t,A)}u&&this.updateTexture(u,A)}if(!0!==n.initialized){n.initialized=!0;const t=()=>{e.removeEventListener("dispose",t);for(let e=0;e<s.length;e++)this._destroyTexture(s[e]);u&&this._destroyTexture(u),this.delete(e)};e.addEventListener("dispose",t)}}updateTexture(e,t={}){const n=this.get(e);if(!0===n.initialized&&n.version===e.version)return;const r=e.isRenderTargetTexture||e.isDepthTexture||e.isFramebufferTexture,i=this.backend;if(r&&!0===n.initialized&&(i.destroySampler(e),i.destroyTexture(e)),e.isFramebufferTexture){const t=this.renderer.getRenderTarget();e.type=t?t.texture.type:T}const{width:s,height:a,depth:o}=this.getSize(e);if(t.width=s,t.height=a,t.depth=o,t.needsMipmaps=this.needsMipmaps(e),t.levels=t.needsMipmaps?this.getMipLevels(e,s,a):1,r||!0===e.isStorageTexture)i.createSampler(e),i.createTexture(e,t),n.generation=e.version;else if(!0!==n.initialized&&i.createSampler(e),e.version>0){const r=e.image;if(void 0===r);else if(!1===r.complete);else{if(e.images){const n=[];for(const t of e.images)n.push(t);t.images=n}else t.image=r;void 0!==n.isDefaultTexture&&!0!==n.isDefaultTexture||(i.createTexture(e,t),n.isDefaultTexture=!1,n.generation=e.version),!0===e.source.dataReady&&i.updateTexture(e,t),t.needsMipmaps&&0===e.mipmaps.length&&i.generateMipmaps(e)}}else i.createDefaultTexture(e),n.isDefaultTexture=!0,n.generation=e.version;if(!0!==n.initialized){n.initialized=!0,n.generation=e.version,this.info.memory.textures++;const t=()=>{e.removeEventListener("dispose",t),this._destroyTexture(e)};e.addEventListener("dispose",t)}n.version=e.version}getSize(e,t=pP){let n=e.images?e.images[0]:e.image;return n?(void 0!==n.image&&(n=n.image),t.width=n.width||1,t.height=n.height||1,t.depth=e.isCubeTexture?6:n.depth||1):t.width=t.height=t.depth=1,t}getMipLevels(e,t,n){let r;return r=e.isCompressedTexture?e.mipmaps?e.mipmaps.length:1:Math.floor(Math.log2(Math.max(t,n)))+1,r}needsMipmaps(e){return!0===e.isCompressedTexture||e.generateMipmaps}_destroyTexture(e){!0===this.has(e)&&(this.backend.destroySampler(e),this.backend.destroyTexture(e),this.delete(e),this.info.memory.textures--)}}class mP extends Gn{constructor(e,t,n,r=1){super(e,t,n),this.a=r}set(e,t,n,r=1){return this.a=r,super.set(e,t,n)}copy(e){return void 0!==e.a&&(this.a=e.a),super.copy(e)}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}}class gP extends Gy{static get type(){return"ParameterNode"}constructor(e,t=null){super(e,t),this.isParameterNode=!0}getHash(){return this.uuid}generate(){return this.name}}const _P=dy(class extends bv{static get type(){return"StackNode"}constructor(e=null){super(),this.nodes=[],this.outputNode=null,this.parent=e,this._currentCond=null,this._expressionNode=null,this.isStackNode=!0}getNodeType(e){return this.outputNode?this.outputNode.getNodeType(e):"void"}getMemberType(e,t){return this.outputNode?this.outputNode.getMemberType(e,t):"void"}add(e){return this.nodes.push(e),this}If(e,t){const n=new uy(t);return this._currentCond=yw(e,n),this.add(this._currentCond)}ElseIf(e,t){const n=new uy(t),r=yw(e,n);return this._currentCond.elseNode=r,this._currentCond=r,this}Else(e){return this._currentCond.elseNode=new uy(e),this}Switch(e){return this._expressionNode=cy(e),this}Case(...e){const t=[];if(!(e.length>=2))throw new Error("TSL: Invalid parameter length. Case() requires at least two parameters.");for(let n=0;n<e.length-1;n++)t.push(this._expressionNode.equal(cy(e[n])));const n=new uy(e[e.length-1]);let r=t[0];for(let e=1;e<t.length;e++)r=r.or(t[e]);const i=yw(r,n);return null===this._currentCond?(this._currentCond=i,this.add(this._currentCond)):(this._currentCond.elseNode=i,this._currentCond=i,this)}Default(e){return this.Else(e),this}build(e,...t){const n=_y();gy(this);const r=e.buildStage;for(const t of this.nodes)if("setup"===r)t.build(e);else if("analyze"===r)t.build(e,this);else if("generate"===r){const n=e.getDataFromNode(t,"any").stages,r=n&&n[e.shaderStage];if(t.isVarNode&&r&&1===r.length&&r[0]&&r[0].isStackNode)continue;t.build(e,"void")}return gy(n),this.outputNode?this.outputNode.build(e,...t):super.build(e,...t)}else(...e){return this.Else(...e)}elseif(...e){return this.ElseIf(...e)}}).setParameterLength(0,1);class vP extends bv{static get type(){return"StructTypeNode"}constructor(e,t=null){var n;super("struct"),this.membersLayout=(n=e,Object.entries(n).map((([e,t])=>"string"==typeof t?{name:e,type:t,atomic:!1}:{name:e,type:t.type,atomic:t.atomic||!1}
1))),this.name=t,this.isStructLayoutNode=!0}getLength(){const e=Float32Array.BYTES_PER_ELEMENT;let t=0;for(const n of this.membersLayout){const r=n.type,i=av(r)*e,s=t%8,a=s%ov(r),o=s+a;t+=a,0!==o&&8-o<i&&(t+=8-o),t+=i}return 8*Math.ceil(t/8)/e}getMemberType(e,t){const n=this.membersLayout.find((e=>e.name===t));return n?n.type:"void"}getNodeType(e){return e.getStructTypeFromNode(this,this.membersLayout,this.name).name}setup(e){e.addInclude(this)}generate(e){return this.getNodeType(e)}}class yP extends bv{static get type(){return"StructNode"}constructor(e,t){super("vec3"),this.structLayoutNode=e,this.values=t,this.isStructNode=!0}getNodeType(e){return this.structLayoutNode.getNodeType(e)}getMemberType(e,t){return this.structLayoutNode.getMemberType(e,t)}generate(e){const t=e.getVarFromNode(this),n=t.type,r=e.getPropertyName(t);return e.addLineFlowCode(`${r} = ${e.generateStruct(n,this.structLayoutNode.membersLayout,this.values)}`,this),t.name}}class xP extends bv{static get type(){return"OutputStructNode"}constructor(...e){super(),this.members=e,this.isOutputStructNode=!0}getNodeType(e){const t=e.getNodeProperties(this);if(void 0===t.membersLayout){const n=this.members,r=[];for(let t=0;t<n.length;t++){const i="m"+t,s=n[t].getNodeType(e);r.push({name:i,type:s,index:t})}t.membersLayout=r,t.structType=e.getOutputStructTypeFromNode(this,t.membersLayout)}return t.structType.name}generate(e){const t=e.getOutputStructName(),n=this.members,r=""!==t?t+".":"";for(let t=0;t<n.length;t++){const i=n[t].build(e);e.addLineFlowCode(`${r}m${t} = ${i}`,this)}return t}}const bP=dy(xP);function wP(e,t){for(let n=0;n<e.length;n++)if(e[n].name===t)return n;return-1}const TP=dy(class extends xP{static get type(){return"MRTNode"}constructor(e){super(),this.outputNodes=e,this.isMRTNode=!0}has(e){return void 0!==this.outputNodes[e]}get(e){return this.outputNodes[e]}merge(e){const t={...this.outputNodes,...e.outputNodes};return TP(t)}setup(e){const t=this.outputNodes,n=[],r=e.renderer.getRenderTarget().textures;for(const e in t)n[wP(r,e)]=Iy(t[e]);return this.members=n,super.setup(e)}}),SP=my((([e])=>{const t=e.toUint().mul(747796405).add(2891336453),n=t.shiftRight(t.shiftRight(28).add(4)).bitXor(t).mul(277803737);return n.shiftRight(22).bitXor(n).toFloat().mul(1/2**32)})),MP=(e,t)=>tw(Ux(4,e.mul(Bx(1,e))),t),EP=my((([e])=>e.fract().sub(.5).abs())).setLayout({name:"tri",type:"float",inputs:[{name:"x",type:"float"}]}),CP=my((([e])=>Ny(EP(e.z.add(EP(e.y.mul(1)))),EP(e.z.add(EP(e.x.mul(1)))),EP(e.y.add(EP(e.x.mul(1))))))).setLayout({name:"tri3",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),RP=my((([e,t,n])=>{const r=Ny(e).toVar(),i=by(1.4).toVar(),s=by(0).toVar(),a=Ny(r).toVar();return dE({start:by(0),end:by(3),type:"float",condition:"<="},(()=>{const e=Ny(CP(a.mul(2))).toVar();r.addAssign(e.add(n.mul(by(.1).mul(t)))),a.mulAssign(1.8),i.mulAssign(1.5),r.mulAssign(1.2);const o=by(EP(r.z.add(EP(r.x.add(EP(r.y)))))).toVar();s.addAssign(o.div(i)),a.addAssign(.14)})),s})).setLayout({name:"triNoise3D",type:"float",inputs:[{name:"position",type:"vec3"},{name:"speed",type:"float"},{name:"time",type:"float"}]});const NP=dy(class extends bv{static get type(){return"FunctionOverloadingNode"}constructor(e=[],...t){super(),this.functionNodes=e,this.parametersNodes=t,this._candidateFnCall=null,this.global=!0}getNodeType(){return this.functionNodes[0].shaderNode.layout.type}setup(e){const t=this.parametersNodes;let n=this._candidateFnCall;if(null===n){let r=null,i=-1;for(const n of this.functionNodes){const s=n.shaderNode.layout;if(null===s)throw new Error("FunctionOverloadingNode: FunctionNode must be a layout.");const a=s.inputs;if(t.length===a.length){let s=0;for(let n=0;n<t.length;n++){const r=t[n],i=a[n];r.getNodeType(e)===i.type?s++:s=0}s>i&&(r=n,i=s)}}this._candidateFnCall=n=r(...t)}return n}}),PP=e=>(...t)=>NP(e,...t),DP=Ex(0).setGroup(Tx).onRenderUpdate((e=>e.time)),LP=Ex(0).setGroup(Tx).onRenderUpdate((e=>e.deltaTime)),IP=Ex(0,"uint").setGroup(Tx).onRenderUpdate((e=>e.frameId)),OP=my((([e,t,n=My(.5)])=>EN(e.sub(n),t).add(n))),BP=my((([e,t,n=My(.5)])=>{const r=e.sub(n),i=r.dot(r),s=i.mul(i).mul(t);return e.add(r.mul(s))})),UP=my((({position:e=null,horizontal:t=!0,vertical:n=!1})=>{let r;null!==e?(r=XT.toVar(),r[3][0]=e.x,r[3][1]=e.y,r[3][2]=e.z):r=XT;const i=LT.mul(r);return oy(t)&&(i[0][0]=XT[0].length(),i[0][1]=0,i[0][2]=0),oy(n)&&(i[1][0]=0,i[1][1]=XT[1].length(),i[1][2]=0),i[2][0]=0,i[2][1]=0,i[2][2]=1,PT.mul(i).mul(sS)})),FP=my((([e=null])=>{const t=YE();return YE(VE(e)).sub(t).lessThan(0).select(ME,e)}));const kP=dy(class extends bv{static get type(){return"SpriteSheetUVNode"}constructor(e,t=pT(),n=by(0)){super("vec2"),this.countNode=e,this.uvNode=t,this.frameNode=n}setup(){const{frameNode:e,uvNode:t,countNode:n}=this,{width:r,height:i}=n,s=e.mod(r.mul(i)).floor(),a=s.mod(r),o=i.sub(s.add(1).div(r).ceil()),l=n.reciprocal(),u=My(a,o);return t.add(u).mul(l)}}).setParameterLength(3);const qP=dy(class extends bv{static get type(){return"TriplanarTexturesNode"}constructor(e,t=null,n=null,r=by(1),i=sS,s=pS){super("vec4"),this.textureXNode=e,this.textureYNode=t,this.textureZNode=n,this.scaleNode=r,this.positionNode=i,this.normalNode=s}setup(){const{textureXNode:e,textureYNode:t,textureZNode:n,scaleNode:r,positionNode:i,normalNode:s}=this;let a=s.abs().normalize();a=a.div(a.dot(Ny(1)));const o=i.yz.mul(r),l=i.zx.mul(r),u=i.xy.mul(r),c=e.value,h=null!==t?t.value:c,A=null!==n?n.value:c,d=yT(c,o).mul(a.x),p=yT(h,l).mul(a.y),f=yT(A,u).mul(a.z);return Ox(d,p,f)}}).setParameterLength(1,6),VP=new Jr,zP=new Ke,GP=new Ke,jP=new Ke,HP=new $t,WP=new Ke(0,0,-1),XP=new vt,QP=new Ke,YP=new Ke,$P=new vt,KP=new Ye,ZP=new yt,JP=ME.flipX();ZP.depthTexture=new Mi(1,1);let eD=!1;class tD extends _T{static get type(){return"ReflectorNode"}constructor(e={}){super(e.defaultTexture||ZP.texture,JP),this._reflectorBaseNode=e.reflector||new nD(this,e),this._depthNode=null,this.setUpdateMatrix(!1)}get reflector(){return this._reflectorBaseNode}get target(){return this._reflectorBaseNode.target}getDepthNode(){if(null===this._depthNode){if(!0!==this._reflectorBaseNode.depth)throw new Error("THREE.ReflectorNode: Depth node
1can only be requested when the reflector is created with { depth: true }. ");this._depthNode=cy(new tD({defaultTexture:ZP.depthTexture,reflector:this._reflectorBaseNode}))}return this._depthNode}setup(e){return e.object.isQuadMesh||this._reflectorBaseNode.build(e),super.setup(e)}clone(){const e=new this.constructor(this.reflectorNode);return e._reflectorBaseNode=this._reflectorBaseNode,e}dispose(){super.dispose(),this._reflectorBaseNode.dispose()}}class nD extends bv{static get type(){return"ReflectorBaseNode"}constructor(e,t={}){super();const{target:n=new Tn,resolution:r=1,generateMipmaps:i=!1,bounces:s=!0,depth:a=!1}=t;this.textureNode=e,this.target=n,this.resolution=r,this.generateMipmaps=i,this.bounces=s,this.depth=a,this.updateBeforeType=s?pv.RENDER:pv.FRAME,this.virtualCameras=new WeakMap,this.renderTargets=new Map,this.forceUpdate=!1,this.hasOutput=!1}_updateResolution(e,t){const n=this.resolution;t.getDrawingBufferSize(KP),e.setSize(Math.round(KP.width*n),Math.round(KP.height*n))}setup(e){return this._updateResolution(ZP,e.renderer),super.setup(e)}dispose(){super.dispose();for(const e of this.renderTargets.values())e.dispose()}getVirtualCamera(e){let t=this.virtualCameras.get(e);return void 0===t&&(t=e.clone(),this.virtualCameras.set(e,t)),t}getRenderTarget(e){let t=this.renderTargets.get(e);return void 0===t&&(t=new yt(0,0,{type:P}),!0===this.generateMipmaps&&(t.texture.minFilter=1008,t.texture.generateMipmaps=!0),!0===this.depth&&(t.depthTexture=new Mi),this.renderTargets.set(e,t)),t}updateBefore(e){if(!1===this.bounces&&eD)return!1;eD=!0;const{scene:t,camera:n,renderer:r,material:i}=e,{target:s}=this,a=this.getVirtualCamera(n),o=this.getRenderTarget(a);r.getDrawingBufferSize(KP),this._updateResolution(o,r),GP.setFromMatrixPosition(s.matrixWorld),jP.setFromMatrixPosition(n.matrixWorld),HP.extractRotation(s.matrixWorld),zP.set(0,0,1),zP.applyMatrix4(HP),QP.subVectors(GP,jP);let l=!1;if(!0==QP.dot(zP)>0&&!1===this.forceUpdate){if(!1===this.hasOutput)return void(eD=!1);l=!0}QP.reflect(zP).negate(),QP.add(GP),HP.extractRotation(n.matrixWorld),WP.set(0,0,-1),WP.applyMatrix4(HP),WP.add(jP),YP.subVectors(GP,WP),YP.reflect(zP).negate(),YP.add(GP),a.coordinateSystem=n.coordinateSystem,a.position.copy(QP),a.up.set(0,1,0),a.up.applyMatrix4(HP),a.up.reflect(zP),a.lookAt(YP),a.near=n.near,a.far=n.far,a.updateMatrixWorld(),a.projectionMatrix.copy(n.projectionMatrix),VP.setFromNormalAndCoplanarPoint(zP,GP),VP.applyMatrix4(a.matrixWorldInverse),XP.set(VP.normal.x,VP.normal.y,VP.normal.z,VP.constant);const u=a.projectionMatrix;$P.x=(Math.sign(XP.x)+u.elements[8])/u.elements[0],$P.y=(Math.sign(XP.y)+u.elements[9])/u.elements[5],$P.z=-1,$P.w=(1+u.elements[10])/u.elements[14],XP.multiplyScalar(1/XP.dot($P)),u.elements[2]=XP.x,u.elements[6]=XP.y,u.elements[10]=r.coordinateSystem===Be?XP.z-0:XP.z+1-0,u.elements[14]=XP.w,this.textureNode.value=o.texture,!0===this.depth&&(this.textureNode.getDepthNode().value=o.depthTexture),i.visible=!1;const c=r.getRenderTarget(),h=r.getMRT(),A=r.autoClear;r.setMRT(null),r.setRenderTarget(o),r.autoClear=!0,l?(r.clear(),this.hasOutput=!1):(r.render(t,a),this.hasOutput=!0),r.setMRT(h),r.setRenderTarget(c),r.autoClear=A,i.visible=!0,eD=!1,this.forceUpdate=!1}}const rD=new Js(-1,1,1,-1,0,1);const iD=new class extends Ar{constructor(e=!1){super();const t=!1===e?[0,-1,0,1,2,1]:[0,2,0,0,2,0];this.setAttribute("position",new ir([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new ir(t,2))}};class sD extends Tr{constructor(e=null){super(iD,e),this.camera=rD,this.isQuadMesh=!0}async renderAsync(e){return e.renderAsync(this,rD)}render(e){e.render(this,rD)}}const aD=new Ye;class oD extends _T{static get type(){return"RTTNode"}constructor(e,t=null,n=null,r={type:P}){const i=new yt(t,n,r);super(i.texture,pT()),this.node=e,this.width=t,this.height=n,this.pixelRatio=1,this.renderTarget=i,this.textureNeedsUpdate=!0,this.autoUpdate=!0,this._rttNode=null,this._quadMesh=new sD(new rC),this.updateBeforeType=pv.RENDER}get autoSize(){return null===this.width}setup(e){return this._rttNode=this.node.context(e.getSharedContext()),this._quadMesh.material.name="RTT",this._quadMesh.material.needsUpdate=!0,super.setup(e)}setSize(e,t){this.width=e,this.height=t;const n=e*this.pixelRatio,r=t*this.pixelRatio;this.renderTarget.setSize(n,r),this.textureNeedsUpdate=!0}setPixelRatio(e){this.pixelRatio=e,this.setSize(this.width,this.height)}updateBefore({renderer:e}){if(!1===this.textureNeedsUpdate&&!1===this.autoUpdate)return;if(this.textureNeedsUpdate=!1,!0===this.autoSize){this.pixelRatio=e.getPixelRatio();const t=e.getSize(aD);this.setSize(t.width,t.height)}this._quadMesh.material.fragmentNode=this._rttNode;
1const t=e.getRenderTarget();e.setRenderTarget(this.renderTarget),this._quadMesh.render(e),e.setRenderTarget(t)}clone(){const e=new _T(this.value,this.uvNode,this.levelNode);return e.sampler=this.sampler,e.referenceNode=this,e}}const lD=(e,...t)=>cy(new oD(cy(e),...t)),uD=my((([e,t,n],r)=>{let i;r.renderer.coordinateSystem===Be?(e=My(e.x,e.y.oneMinus()).mul(2).sub(1),i=Iy(Ny(e,t),1)):i=Iy(Ny(e.x,e.y.oneMinus(),t).mul(2).sub(1),1);const s=Iy(n.mul(i));return s.xyz.div(s.w)})),cD=my((([e,t])=>{const n=t.mul(Iy(e,1)),r=n.xy.div(n.w).mul(.5).add(.5).toVar();return My(r.x,r.y.oneMinus())})),hD=my((([e,t,n])=>{const r=fT(xT(t)),i=Ey(e.mul(r)).toVar(),s=xT(t,i).toVar(),a=xT(t,i.sub(Ey(2,0))).toVar(),o=xT(t,i.sub(Ey(1,0))).toVar(),l=xT(t,i.add(Ey(1,0))).toVar(),u=xT(t,i.add(Ey(2,0))).toVar(),c=xT(t,i.add(Ey(0,2))).toVar(),h=xT(t,i.add(Ey(0,1))).toVar(),A=xT(t,i.sub(Ey(0,1))).toVar(),d=xT(t,i.sub(Ey(0,2))).toVar(),p=Lb(Bx(by(2).mul(o).sub(a),s)).toVar(),f=Lb(Bx(by(2).mul(l).sub(u),s)).toVar(),m=Lb(Bx(by(2).mul(h).sub(c),s)).toVar(),g=Lb(Bx(by(2).mul(A).sub(d),s)).toVar(),_=uD(e,s,n).toVar(),v=p.lessThan(f).select(_.sub(uD(e.sub(My(by(1).div(r.x),0)),o,n)),_.negate().add(uD(e.add(My(by(1).div(r.x),0)),l,n))),y=m.lessThan(g).select(_.sub(uD(e.add(My(0,by(1).div(r.y))),h,n)),_.negate().add(uD(e.sub(My(0,by(1).div(r.y))),A,n)));return Sb(ew(v,y))}));class AD extends Yr{constructor(e,t,n=Float32Array){super(ArrayBuffer.isView(e)?e:new n(e*t),t),this.isStorageInstancedBufferAttribute=!0}}class dD extends er{constructor(e,t,n=Float32Array){super(ArrayBuffer.isView(e)?e:new n(e*t),t),this.isStorageBufferAttribute=!0}}const pD=py(class extends bv{static get type(){return"PointUVNode"}constructor(){super("vec2"),this.isPointUVNode=!0}generate(){return"vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )"}}),fD=new on,mD=new $t;class gD extends bv{static get type(){return"SceneNode"}constructor(e=gD.BACKGROUND_BLURRINESS,t=null){super(),this.scope=e,this.scene=t}setup(e){const t=this.scope,n=null!==this.scene?this.scene:e.scene;let r;return t===gD.BACKGROUND_BLURRINESS?r=US("backgroundBlurriness","float",n):t===gD.BACKGROUND_INTENSITY?r=US("backgroundIntensity","float",n):t===gD.BACKGROUND_ROTATION&&(r=Ex("mat4").label("backgroundRotation").setGroup(Tx).onRenderUpdate((()=>{const e=n.background;return null!==e&&e.isTexture&&300!==e.mapping?(fD.copy(n.backgroundRotation),fD.x*=-1,fD.y*=-1,fD.z*=-1,mD.makeRotationFromEuler(fD)):mD.identity(),mD}))),r}}gD.BACKGROUND_BLURRINESS="backgroundBlurriness",gD.BACKGROUND_INTENSITY="backgroundIntensity",gD.BACKGROUND_ROTATION="backgroundRotation";const _D=py(gD,gD.BACKGROUND_BLURRINESS),vD=py(gD,gD.BACKGROUND_INTENSITY),yD=py(gD,gD.BACKGROUND_ROTATION);const xD=dy(class extends _T{static get type(){return"StorageTextureNode"}constructor(e,t,n=null){super(e,t),this.storeNode=n,this.isStorageTextureNode=!0,this.access=fv.WRITE_ONLY}getInputType(){return"storageTexture"}setup(e){super.setup(e);const t=e.getNodeProperties(this);return t.storeNode=this.storeNode,t}setAccess(e){return this.access=e,this}generate(e,t){let n;return n=null!==this.storeNode?this.generateStore(e):super.generate(e,t),n}toReadWrite(){return this.setAccess(fv.READ_WRITE)}toReadOnly(){return this.setAccess(fv.READ_ONLY)}toWriteOnly(){return this.setAccess(fv.WRITE_ONLY)}generateStore(e){const t=e.getNodeProperties(this),{uvNode:n,storeNode:r,depthNode:i}=t,s=super.generate(e,"property"),a=n.build(e,"uvec2"),o=r.build(e,"vec4"),l=i?i.build(e,"int"):null,u=e.generateTextureStore(e,s,a,l,o);e.addLineFlowCode(u,this)}clone(){const e=super.clone();return e.storeNode=this.storeNode,e}}).setParameterLength(1,3),bD=my((({texture:e,uv:t})=>{const n=1e-4,r=Ny().toVar();return vy(t.x.lessThan(n),(()=>{r.assign(Ny(1,0,0))})).ElseIf(t.y.lessThan(n),(()=>{r.assign(Ny(0,1,0))})).ElseIf(t.z.lessThan(n),(()=>{r.assign(Ny(0,0,1))})).ElseIf(t.x.greaterThan(.9999),(()=>{r.assign(Ny(-1,0,0))})).ElseIf(t.y.greaterThan(.9999),(()=>{r.assign(Ny(0,-1,0))})).ElseIf(t.z.greaterThan(.9999),(()=>{r.assign(Ny(0,0,-1))})).Else((()=>{const n=.01,i=e.sample(t.add(Ny(-.01,0,0))).r.sub(e.sample(t.add(Ny(n,0,0))).r),s=e.sample(t.add(Ny(0,-.01,0))).r.sub(e.sample(t.add(Ny(0,n,0))).r),a=e.sample(t.add(Ny(0,0,-.01))).r.sub(e.sample(t.add(Ny(0,0,n))).r);r.assign(Ny(i,s,a))})),r.normalize()}));const wD=dy(class extends _T{static get type(){return"Texture3DNode"}constructor(e,t=null,n=null){super(e,t,n),this.isTexture3DNode=!0}getInputType(){return"texture3D"}getDefaultUV(){return Ny(.5,.5,.5)}setUpdateMatrix(){}setupUV(e,t){const n=this.value;return!e.isFlipY()||!0!==n.isRenderTargetTexture&&!0!==n.isFramebufferTexture||(t=this.sampler?t.flipY():t.setY(wy(fT(this,this.levelNode).y).sub(t.y).sub(1))),t}generateUV(e,t){return t.build(e,"vec3")}normal(e){return bD({texture:this,uv:e})}}).setParameterLength(1,3);class TD extends BS{static get type(){return"UserDataNode"}constructor(e,t,n=null){super(e,t,n),this.userData=n}updateReference(e){return this.reference=null!==this.userData?this.userData:e.object.userData,this.reference}}const SD=new WeakMap;function MD(e){let t=SD.get(e);return void 0===t&&(t={},SD.set(e,t)),t}function ED(e,t=0){const n=MD(e);let r=n[t];return void 0===r&&(n[t]=r=new $t,n[t].copy(e.matrixWorld)),r}const CD=py(class extends Sv{static get type(){return"VelocityNode"}constructor(){super("vec2"),this.projectionMatrix=null,this.updateType=pv.OBJECT,this.updateAfterType=pv.OBJECT,this.previousModelWorldMatrix=Ex(new $t),this.previousProjectionMatrix=Ex(new $t).setGroup(Tx),this.previousCameraViewMatrix=Ex(new $t)}setProjectionMatrix(e){this.projectionMatrix=e}update({frameId:e,camera:t,object:n}){const r=ED(n);this.previousModelWorldMatrix.value.copy(r);const i=MD(t);i.frameId!==e&&(i.frameId=e,void 0===i.previousProjectionMatrix?(i.previousProjectionMatrix=new $t,i.previousCameraViewMatrix=new $t,i.currentProjectionMatrix=new $t,i.currentCameraViewMatrix=new $t,i.previousProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.previousCameraViewMatrix.copy(t.matrixWorldInverse)):(i.previousProjectionMatrix.copy(i.currentProjectionMatrix),i.previousCameraViewMatrix.copy(i.currentCameraViewMatrix)),i.currentProjectionMatrix.copy(this.projectionMatrix||t.projectionMatrix),i.currentCameraViewMatrix.copy(t.matrixWorldInverse),this.previousProjectionMatrix.value.copy(i.previousProjectionMatrix),this.previousCameraViewMatrix.value.copy(i.previousCameraViewMatrix))}updateAfter({object:e}){ED(e).copy(e.matrixWorld)}setup(){const e=null===this.projectionMatrix?PT:Ex(this.projectionMatrix),t=this.previousCameraViewMatrix.mul(this.previousModelWorldMatrix),n=e.mul(eS).mul(sS),r=this.previousProjectionMatrix.mul(t).mul(aS),i=n.xy.div(n.w),s=r.xy.div(r.w);return Bx(i,s)}}),RD=my((([e,t])=>Xb(1,e.oneMinus().div(t)).oneMinus())).setLayout({name:"blendBurn",type:"vec3",input
1s:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),ND=my((([e,t])=>Xb(e.div(t.oneMinus()),1))).setLayout({name:"blendDodge",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),PD=my((([e,t])=>e.oneMinus().mul(t.oneMinus()).oneMinus())).setLayout({name:"blendScreen",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),DD=my((([e,t])=>lw(e.mul(2).mul(t),e.oneMinus().mul(2).mul(t.oneMinus()).oneMinus(),Yb(.5,e)))).setLayout({name:"blendOverlay",type:"vec3",inputs:[{name:"base",type:"vec3"},{name:"blend",type:"vec3"}]}),LD=my((([e,t])=>{const n=t.a.add(e.a.mul(t.a.oneMinus()));return Iy(t.rgb.mul(t.a).add(e.rgb.mul(e.a).mul(t.a.oneMinus())).div(n),n)})).setLayout({name:"blendColor",type:"vec4",inputs:[{name:"base",type:"vec4"},{name:"blend",type:"vec4"}]}),ID=my((([e])=>Iy(e.rgb.mul(e.a),e.a)),{color:"vec4",return:"vec4"}),OD=my((([e])=>(vy(e.a.equal(0),(()=>Iy(0))),Iy(e.rgb.div(e.a),e.a))),{color:"vec4",return:"vec4"}),BD=my((([e])=>qD(e.rgb))),UD=my((([e,t=by(1)])=>t.mix(qD(e.rgb),e.rgb))),FD=my((([e,t=by(1)])=>{const n=Ox(e.r,e.g,e.b).div(3),r=e.r.max(e.g.max(e.b)),i=r.sub(n).mul(t).mul(-3);return lw(e.rgb,r,i)})),kD=my((([e,t=by(1)])=>{const n=Ny(.57735,.57735,.57735),r=t.cos();return Ny(e.rgb.mul(r).add(n.cross(e.rgb).mul(t.sin()).add(n.mul(Jb(n,e.rgb).mul(r.oneMinus())))))})),qD=(e,t=Ny(ut.getLuminanceCoefficients(new Ke)))=>Jb(e,t),VD=my((([e,t=Ny(1),n=Ny(0),r=Ny(1),i=by(1),s=Ny(ut.getLuminanceCoefficients(new Ke,Me))])=>{const a=e.rgb.dot(Ny(s)),o=Qb(e.rgb.mul(t).add(n),0).toVar(),l=o.pow(r).toVar();return vy(o.r.greaterThan(0),(()=>{o.r.assign(l.r)})),vy(o.g.greaterThan(0),(()=>{o.g.assign(l.g)})),vy(o.b.greaterThan(0),(()=>{o.b.assign(l.b)})),o.assign(a.add(o.sub(a).mul(i))),Iy(o.rgb,e.a)}));const zD=dy(class extends Sv{static get type(){return"PosterizeNode"}constructor(e,t){super(),this.sourceNode=e,this.stepsNode=t}setup(){const{sourceNode:e,stepsNode:t}=this;return e.mul(t).floor().div(t)}}).setParameterLength(2),GD=new Ye;class jD extends _T{static get type(){return"PassTextureNode"}constructor(e,t){super(t),this.passNode=e,this.setUpdateMatrix(!1)}setup(e){return e.object.isQuadMesh&&this.passNode.build(e),super.setup(e)}clone(){return new this.constructor(this.passNode,this.value)}}class HD extends jD{static get type(){return"PassMultipleTextureNode"}constructor(e,t,n=!1){super(e,null),this.textureName=t,this.previousTexture=n}updateTexture(){this.value=this.previousTexture?this.passNode.getPreviousTexture(this.textureName):this.passNode.getTexture(this.textureName)}setup(e){return this.updateTexture(),super.setup(e)}clone(){return new this.constructor(this.passNode,this.textureName,this.previousTexture)}}class WD extends Sv{static get type(){return"PassNode"}constructor(e,t,n,r={}){super("vec4"),this.scope=e,this.scene=t,this.camera=n,this.options=r,this._pixelRatio=1,this._width=1,this._height=1;const i=new Mi;i.isRenderTargetTexture=!0,i.name="depth";const s=new yt(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:P,...r});s.texture.name="output",s.depthTexture=i,this.renderTarget=s,this._textures={output:s.texture,depth:i},this._textureNodes={},this._linearDepthNodes={},this._viewZNodes={},this._previousTextures={},this._previousTextureNodes={},this._cameraNear=Ex(0),this._cameraFar=Ex(0),this._mrt=null,this._layers=null,this._resolution=1,this.isPassNode=!0,this.updateBeforeType=pv.FRAME,this.global=!0}setResolution(e){return this._resolution=e,this}getResolution(){return this._resolution}setLayers(e){return this._layers=e,this}getLayers(){return this._layers}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getTexture(e){let t=this._textures[e];return void 0===t&&(t=this.renderTarget.texture.clone(),t.name=e,this._textures[e]=t,this.renderTarget.textures.push(t)),t}getPreviousTexture(e){let t=this._previousTextures[e];return void 0===t&&(t=this.getTexture(e).clone(),this._previousTextures[e]=t),t}toggleTexture(e){const t=this._previousTextures[e];if(void 0!==t){const n=this._textures[e],r=this.renderTarget.textures.indexOf(n);this.renderTarget.textures[r]=t,this._textures[e]=t,this._previousTextures[e]=n,this._textureNodes[e].updateTexture(),this._previousTextureNodes[e].updateTexture()}}getTextureNode(e="output"){let t=this._textureNodes[e];return void 0===t&&(t=cy(new HD(this,e)),t.updateTexture(),this._textureNodes[e]=t),t}getPreviousTextureNode(e="output"){let t=this._previousTextureNodes[e];return void 0===t&&(void 0===this._textureNodes[e]&&this.getTextureNode(e),t=cy(new HD(this,e,!0)),t.updateTexture(),this._previousTextureNodes[e]=t),t}getViewZNode(e="depth"){let t=this._viewZNodes[e];if(void 0===t){const n=this._cameraNear,r=this._cameraFar;this._viewZNodes[e]=t=HE(this.getTextureNode(e),n,r)}return t}getLinearDepthNode(e="depth"){let t=this._linearDepthNodes[e];if(void 0===t){const n=this._cameraNear,r=this._cameraFar,i=this.getViewZNode(e);this._linearDepthNodes[e]=t=GE(i,n,r)}return t}setup({renderer:e}){return this.renderTarget.samples=void 0===this.options.samples?e.samples:this.options.samples,!0===e.backend.isWebGLBackend&&(this.renderTarget.samples=0),this.renderTarget.texture.type=e.getColorBufferType(),this.scope===WD.COLOR?this.getTextureNode():this.getLinearDepthNode()}updateBefore(e){const{renderer:t}=e,{scene:n}=this;let r,i;
1const s=t.getOutputRenderTarget();s&&!0===s.isXRRenderTarget?(i=1,r=t.xr.getCamera(),t.xr.updateCamera(r),GD.set(s.width,s.height)):(r=this.camera,i=t.getPixelRatio(),t.getSize(GD)),this._pixelRatio=i,this.setSize(GD.width,GD.height);const a=t.getRenderTarget(),o=t.getMRT(),l=r.layers.mask;this._cameraNear.value=r.near,this._cameraFar.value=r.far,null!==this._layers&&(r.layers.mask=this._layers.mask);for(const e in this._previousTextures)this.toggleTexture(e);t.setRenderTarget(this.renderTarget),t.setMRT(this._mrt),t.render(n,r),t.setRenderTarget(a),t.setMRT(o),r.layers.mask=l}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio*this._resolution,r=this._height*this._pixelRatio*this._resolution;this.renderTarget.setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget.dispose()}}WD.COLOR="color",WD.DEPTH="depth";class XD extends WD{static get type(){return"ToonOutlinePassNode"}constructor(e,t,n,r,i){super(WD.COLOR,e,t),this.colorNode=n,this.thicknessNode=r,this.alphaNode=i,this._materialCache=new WeakMap}updateBefore(e){const{renderer:t}=e,n=t.getRenderObjectFunction();t.setRenderObjectFunction(((e,n,r,i,s,a,o,l)=>{if((s.isMeshToonMaterial||s.isMeshToonNodeMaterial)&&!1===s.wireframe){const u=this._getOutlineMaterial(s);t.renderObject(e,n,r,i,u,a,o,l)}t.renderObject(e,n,r,i,s,a,o,l)})),super.updateBefore(e),t.setRenderObjectFunction(n)}_createMaterial(){const e=new rC;e.isMeshToonOutlineMaterial=!0,e.name="Toon_Outline",e.side=1;const t=pS.negate(),n=PT.mul(eS),r=by(1),i=n.mul(Iy(sS,1)),s=n.mul(Iy(sS.add(t),1)),a=Sb(i.sub(s));return e.vertexNode=i.add(a.mul(this.thicknessNode).mul(i.w).mul(r)),e.colorNode=Iy(this.colorNode,this.alphaNode),e}_getOutlineMaterial(e){let t=this._materialCache.get(e);return void 0===t&&(t=this._createMaterial(),this._materialCache.set(e,t)),t}}const QD=my((([e,t])=>e.mul(t).clamp())).setLayout({name:"linearToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),YD=my((([e,t])=>(e=e.mul(t)).div(e.add(1)).clamp())).setLayout({name:"reinhardToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),$D=my((([e,t])=>{const n=(e=(e=e.mul(t)).sub(.004).max(0)).mul(e.mul(6.2).add(.5)),r=e.mul(e.mul(6.2).add(1.7)).add(.06);return n.div(r).pow(2.2)})).setLayout({name:"cineonToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),KD=my((([e])=>{const t=e.mul(e.add(.0245786)).sub(90537e-9),n=e.mul(e.add(.432951).mul(.983729)).add(.238081);return t.div(n)})),ZD=my((([e,t])=>{const n=ky(.59719,.35458,.04823,.076,.90834,.01566,.0284,.13383,.83777),r=ky(1.60475,-.53108,-.07367,-.10208,1.10813,-.00605,-.00327,-.07276,1.07602);return e=e.mul(t).div(.6),e=n.mul(e),e=KD(e),(e=r.mul(e)).clamp()})).setLayout({name:"acesFilmicToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),JD=ky(Ny(1.6605,-.1246,-.0182),Ny(-.5876,1.1329,-.1006),Ny(-.0728,-.0083,1.1187)),eL=ky(Ny(.6274,.0691,.0164),Ny(.3293,.9195,.088),Ny(.0433,.0113,.8956)),tL=my((([e])=>{const t=Ny(e).toVar(),n=Ny(t.mul(t)).toVar(),r=Ny(n.mul(n)).toVar();return by(15.5).mul(r.mul(n)).sub(Ux(40.14,r.mul(t))).add(Ux(31.96,r).sub(Ux(6.868,n.mul(t))).add(Ux(.4298,n).add(Ux(.1191,t).sub(.00232))))})),nL=my((([e,t])=>{const n=Ny(e).toVar(),r=ky(Ny(.856627153315983,.137318972929847,.11189821299995),Ny(.0951212405381588,.761241990602591,.0767994186031903),Ny(.0482516061458583,.101439036467562,.811302368396859)),i=ky(Ny(1.1271005818144368,-.1413297634984383,-.14132976349843826),Ny(-.11060664309660323,1.157823702216272,-.11060664309660294),Ny(-.016493938717834573,-.016493938717834257,1.2519364065950405)),s=by(-12.47393),a=by(4.026069);return n.mulAssign(t),n.assign(eL.mul(n)),n.assign(r.mul(n)),n.assign(Qb(n,1e-10)),n.assign(yb(n)),n.assign(n.sub(s).div(a.sub(s))),n.assign(uw(n,0,1)),n.assign(tL(n)),n.assign(i.mul(n)),n.assign(tw(Qb(Ny(0),n),Ny(2.2))),n.assign(JD.mul(n)),n.assign(uw(n,0,1)),n}
vendor: 9,720 bytes, line 1
1)).setLayout({name:"agxToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]}),rL=my((([e,t])=>{const n=by(.76),r=by(.15);e=e.mul(t);const i=Xb(e.r,Xb(e.g,e.b)),s=yw(i.lessThan(.08),i.sub(Ux(6.25,i.mul(i))),.04);e.subAssign(s);const a=Qb(e.r,Qb(e.g,e.b));vy(a.lessThan(n),(()=>e));const o=Bx(1,n),l=Bx(1,o.mul(o).div(a.add(o.sub(n))));e.mulAssign(l.div(a));const u=Bx(1,Fx(1,r.mul(a.sub(l)).add(1)));return lw(e,Ny(l),u)})).setLayout({name:"neutralToneMapping",type:"vec3",inputs:[{name:"color",type:"vec3"},{name:"exposure",type:"float"}]});class iL extends bv{static get type(){return"CodeNode"}constructor(e="",t=[],n=""){super("code"),this.isCodeNode=!0,this.global=!0,this.code=e,this.includes=t,this.language=n}setIncludes(e){return this.includes=e,this}getIncludes(){return this.includes}generate(e){const t=this.getIncludes(e);for(const n of t)n.build(e);const n=e.getCodeFromNode(this,this.getNodeType(e));return n.code=this.code,n.code}serialize(e){super.serialize(e),e.code=this.code,e.language=this.language}deserialize(e){super.deserialize(e),this.code=e.code,this.language=e.language}}const sL=dy(iL).setParameterLength(1,3);class aL extends iL{static get type(){return"FunctionNode"}constructor(e="",t=[],n=""){super(e,t,n)}getNodeType(e){return this.getNodeFunction(e).type}getInputs(e){return this.getNodeFunction(e).inputs}getNodeFunction(e){const t=e.getDataFromNode(this);let n=t.nodeFunction;return void 0===n&&(n=e.parser.parseFunction(this.code),t.nodeFunction=n),n}generate(e,t){super.generate(e);const n=this.getNodeFunction(e),r=n.name,i=n.type,s=e.getCodeFromNode(this,i);""!==r&&(s.name=r);const a=e.getPropertyName(s),o=this.getNodeFunction(e).getCode(a);return s.code=o+"\n","property"===t?a:e.format(`${a}()`,i,t)}}const oL=(e,t=[],n="")=>{for(let e=0;e<t.length;e++){const n=t[e];"function"==typeof n&&(t[e]=n.functionNode)}const r=cy(new aL(e,t,n)),i=(...e)=>r.call(...e);return i.functionNode=r,i};const lL=dy(class extends bv{static get type(){return"ScriptableValueNode"}constructor(e=null){super(),this._value=e,this._cache=null,this.inputType=null,this.outputType=null,this.events=new Ue,this.isScriptableValueNode=!0}get isScriptableOutputNode(){return null!==this.outputType}set value(e){this._value!==e&&(this._cache&&"URL"===this.inputType&&this.value.value instanceof ArrayBuffer&&(URL.revokeObjectURL(this._cache),this._cache=null),this._value=e,this.events.dispatchEvent({type:"change"}),this.refresh())}get value(){return this._value}refresh(){this.events.dispatchEvent({type:"refresh"})}getValue(){const e=this.value;if(e&&null===this._cache&&"URL"===this.inputType&&e.value instanceof ArrayBuffer)this._cache=URL.createObjectURL(new Blob([e.value]));else if(e&&null!==e.value&&void 0!==e.value&&(("URL"===this.inputType||"String"===this.inputType)&&"string"==typeof e.value||"Number"===this.inputType&&"number"==typeof e.value||"Vector2"===this.inputType&&e.value.isVector2||"Vector3"===this.inputType&&e.value.isVector3||"Vector4"===this.inputType&&e.value.isVector4||"Color"===this.inputType&&e.value.isColor||"Matrix3"===this.inputType&&e.value.isMatrix3||"Matrix4"===this.inputType&&e.value.isMatrix4))return e.value;return this._cache||e}getNodeType(e){return this.value&&this.value.isNode?this.value.getNodeType(e):"float"}setup(){return this.value&&this.value.isNode?this.value:by()}serialize(e){super.serialize(e),null!==this.value?"ArrayBuffer"===this.inputType?e.value=hv(this.value):e.value=this.value?this.value.toJSON(e.meta).uuid:null:e.value=null,e.inputType=this.inputType,e.outputType=this.outputType}deserialize(e){super.deserialize(e);let t=null;null!==e.value&&(t="ArrayBuffer"===e.inputType?Av(e.value):"Texture"===e.inputType?e.meta.textures[e.value]:e.meta.nodes[e.value]||null),this.value=t,this.inputType=e.inputType,this.outputType=e.outputType}}).setParameterLength(1);class uL extends Map{get(e,t=null,...n){if(this.has(e))return super.get(e);if(null!==t){const r=t(...n);return this.set(e,r),r}}}class cL{constructor(e){this.scriptableNode=e}get parameters(){return this.scriptableNode.parameters}get layout(){return this.scriptableNode.getLayout()}getInputLayout(e){return this.scriptableNode.getInputLayout(e)}get(e){const t=this.parameters[e];return t?t.getValue():null}}const hL=new uL;const AL=dy(class extends bv{static get type(){return"ScriptableNode"}constructor(e=null,t={}){super(),this.codeNode=e,this.parameters=t,this._local=new uL,this._output=lL(null),this._outputs={},this._source=this.source,this._method=null,this._object=null,this._value=null,this._needsOutputUpdate=!0,this.onRefresh=this.onRefresh.bind(this),this.isScriptableNode=!0}get source(){return this.codeNode?this.codeNode.code:""}setLocal(e,t){return this._local.set(e,t)}getLocal(e){return this._local.get(e)}onRefresh(){this._refresh()}getInputLayout(e){for(const t of this.getLayout())if(t.inputType&&(t.id===e||t.name===e))return t}getOutputLayout(e){for(const t of this.getLayout())if(t.outputType&&(t.id===e||t.name===e))return t}setOutput(e,t){const n=this._outputs;return void 0===n[e]?n[e]=lL(t):n[e].value=t,this}getOutput(e){return this._outputs[e]}getParameter(e){return this.parameters[e]}setParameter(e,t){const n=this.parameters;return t&&t.isScriptableNode?(this.deleteParameter(e),n[e]=t,n[e].getDefaultOutput().events.addEventListener("refresh",this.onRefresh)):t&&t.isScriptableValueNode?(this.deleteParameter(e),n[e]=t,n[e].events.addEventListener("refresh",this.onRefresh)):void 0===n[e]?(n[e]=lL(t),n[e].events.addEventListener("refresh",this.onRefresh)):n[e].value=t,this}getValue(){return this.getDefaultOutput().getValue()}deleteParameter(e){let t=this.parameters[e];return t&&(t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.removeEventListener("refresh",this.onRefresh)),this}clearParameters(){for(const e of Object.keys(this.parameters))this.deleteParameter(e);return this.needsUpdate=!0,this}call(e,...t){const n=this.getObject()[e];if("function"==typeof n)return n(...t)}async callAsync(e,...t){const n=this.getObject()[e];if("function"==typeof n)return"AsyncFunction"===n.constructor.name?await n(...t):n(...t)}getNodeType(e){return this.getDefaultOutputNode().getNodeType(e)}refresh(e=null){null!==e?this.getOutput(e).refresh():this._refresh()}getObject(){if(this.needsUpdate&&this.dispose(),null!==this._object)return this._object;const e=new cL(this),t=hL.get("THREE"),n=hL.get("TSL"),r=this.getMethod(),i=[e,this._local,hL,()=>this.refresh(),(e,t)=>this.setOutput(e,t),t,n];this._object=r(...i);const s=this._object.layout;if(s&&(!1===s.cache&&this._local.clear(),this._output.outputType=s.outputType||null,Array.isArray(s.elements)))for(const e of s.elements){const t=e.id||e.name;e.inputType&&(void 0===this.getParameter(t)&&this.setParameter(t,null),this.getParameter(t).inputType=e.inputType),e.outputType&&(void 0===this.getOutput(t)&&this.setOutput(t,null),this.getOutput(t).outputType=e.outputType)}return this._object}deserialize(e){super.deserialize(e);for(const e in this.parameters){let t=this.parameters[e];t.isScriptableNode&&(t=t.getDefaultOutput()),t.events.addEventListener("refresh",this.onRefresh)}}getLayout(){return this.getObject().layout}getDefaultOutputNode(){const e=this.getDefaultOutput().value;return e&&e.isNode?e:by()}getDefaultOutput(){return this._exec()._output}getMethod(){if(this.needsUpdate&&this.dispose(),null!==this._method)return this._method;const e=["layout","init","main","dispose"].join(", "),t="\nreturn { ...output, "+e+" };",n="var "+e+"; var output = {};\n"+this.codeNode.code+t;return this._method=new Function(...["parameters","local","global","refresh","setOutput","THREE","TSL"],n),this._method}dispose(){null!==this._method&&(this._object&&"function"==typeof this._object.dispose&&this._object.dispose(),this._method=null,this._object=null,this._source=null,this._value=null,this._needsOutputUpdate=!0,this._output.value=null,this._outputs={})}setup(){return this.getDefaultOutputNode()}getCacheKey(e){const t=[$_(this.source),this.getDefaultOutputNode().getCacheKey(e)];for(const n in this.parameters)t.push(this.parameters[n].getCacheKey(e));return K_(t)}set needsUpdate(e){!0===e&&this.dispose()}get needsUpdate(){return this.source!==this._source}_exec(){return null===this.codeNode||(!0===this._needsOutputUpdate&&(this._value=this.call("main"),this._needsOutputUpdate=!1),this._output.value=this._value),this}_refresh(){this.needsUpdate=!0,this._exec(),this._output.refresh()}}).setParameterLength(1,2);function dL(e){let t;const n=e.context.getViewZ;return void 0!==n&&(t=n(this)),(t||uS.z).negate()}const pL=my((([e,t],n)=>{const r=dL(n);return Aw(e,t,r)})),fL=my((([e],t)=>{const n=dL(t);return e.mul(e,n,n).negate().exp().oneMinus()})),mL=my((([e,t])=>Iy(t.toFloat().mix(cx.rgb,e.toVec3()),cx.a)));let gL=null,_L=null;const vL=dy(class extends bv{static get type(){return"RangeNode"}constructor(e=by(),t=by()){super(),this.minNode=e,this.maxNode=t}getVectorLength(e){const t=e.getTypeLength(lv(this.minNode.value)),n=e.getTypeLength(lv(this.maxNode.value));return t>n?t:n}getNodeType(e){return e.object.count>1?e.getTypeFromLength(this.getVectorLength(e)):"float"}setup(e){const t=e.object;let n=null;if(t.count>1){const r=this.minNode.value,i=this.maxNode.value,s=e.getTypeLength(lv(r)),a=e.getTypeLength(lv(i));gL=gL||new vt,_L=_L||new vt,gL.setScalar(0),_L.setScalar(0),1===s?gL.setScalar(r):r.isColor?gL.set(r.r,r.g,r.b,1):gL.set(r.x,r.y,r.z||0,r.w||0),1===a?_L.setScalar(i):i.isColor?_L.set(i.r,i.g,i.b,1):_L.set(i.x,i.y,i.z||0,i.w||0);const o=4,l=o*t.count,u=new Float32Array(l);for(let e=0;e<l;e++){const t=e%o,n=gL.getComponent(t),r=_L.getComponent(t);u[e]=Qe.lerp(n,r,Math.random())}const c=this.getNodeType(e);
1if(t.count<=4096)n=wT(u,"vec4",t.count).element(KM).convert(c);else{const t=new Yr(u,4);e.geometry.setAttribute("__range"+this.id,t),n=Qw(t).convert(c)}}else n=by(0);return n}}).setParameterLength(2);class yL extends bv{static get type(){return"ComputeBuiltinNode"}constructor(e,t){super(t),this._builtinName=e}getHash(e){return this.getBuiltinName(e)}getNodeType(){return this.nodeType}setBuiltinName(e){return this._builtinName=e,this}getBuiltinName(){return this._builtinName}hasBuiltin(e){return e.hasBuiltin(this._builtinName)}generate(e,t){const n=this.getBuiltinName(e),r=this.getNodeType(e);return"compute"===e.shaderStage?e.format(n,r,t):e.generateConst(r)}serialize(e){super.serialize(e),e.global=this.global,e._builtinName=this._builtinName}deserialize(e){super.deserialize(e),this.global=e.global,this._builtinName=e._builtinName}}const xL=(e,t)=>cy(new yL(e,t)),bL=xL("numWorkgroups","uvec3"),wL=xL("workgroupId","uvec3"),TL=xL("globalId","uvec3"),SL=xL("localId","uvec3"),ML=xL("subgroupSize","uint"),EL=dy(class extends bv{constructor(e){super(),this.scope=e}generate(e){const{scope:t}=this,{renderer:n}=e;!0===n.backend.isWebGLBackend?e.addFlowCode(`\t// ${t}Barrier \n`):e.addLineFlowCode(`${t}Barrier()`,this)}});class CL extends wv{constructor(e,t){super(e,t),this.isWorkgroupInfoElementNode=!0}generate(e,t){let n;const r=e.context.assign;if(n=super.generate(e),!0!==r){const r=this.getNodeType(e);n=e.format(n,r,t)}return n}}class RL extends bv{constructor(e,t,n=0){super(t),this.bufferType=t,this.bufferCount=n,this.isWorkgroupInfoNode=!0,this.elementType=t,this.scope=e}label(e){return this.name=e,this}setScope(e){return this.scope=e,this}getElementType(){return this.elementType}getInputType(){return`${this.scope}Array`}element(e){return cy(new CL(this,e))}generate(e){return e.getScopedArray(this.name||`${this.scope}Array_${this.id}`,this.scope.toLowerCase(),this.bufferType,this.bufferCount)}}class NL extends bv{static get type(){return"AtomicFunctionNode"}constructor(e,t,n){super("uint"),this.method=e,this.pointerNode=t,this.valueNode=n,this.parents=!0}getInputType(e){return this.pointerNode.getNodeType(e)}getNodeType(e){return this.getInputType(e)}generate(e){const t=e.getNodeProperties(this),n=t.parents,r=this.method,i=this.getNodeType(e),s=this.getInputType(e),a=this.pointerNode,o=this.valueNode,l=[];l.push(`&${a.build(e,s)}`),null!==o&&l.push(o.build(e,s));const u=`${e.getMethod(r,i)}( ${l.join(", ")} )`;if(1!==n.length||!0!==n[0].isStackNode)return void 0===t.constNode&&(t.constNode=aT(u,i).toConst()),t.constNode.build(e);e.addLineFlowCode(u,this)}}NL.ATOMIC_LOAD="atomicLoad",NL.ATOMIC_STORE="atomicStore",NL.ATOMIC_ADD="atomicAdd",NL.ATOMIC_SUB="atomicSub",NL.ATOMIC_MAX="atomicMax",NL.ATOMIC_MIN="atomicMin",NL.ATOMIC_AND="atomicAnd",NL.ATOMIC_OR="atomicOr",NL.ATOMIC_XOR="atomicXor";const PL=dy(NL),DL=(e,t,n)=>PL(e,t,n).toStack();let LL;function IL(e){LL=LL||new WeakMap;let t=LL.get(e);return void 0===t&&LL.set(e,t={}),t}function OL(e){const t=IL(e);return t.shadowMatrix||(t.shadowMatrix=Ex("mat4").setGroup(Tx).onRenderUpdate((t=>(!0===e.castShadow&&!1!==t.renderer.shadowMap.enabled||e.shadow.updateMatrices(e),e.shadow.matrix))))}function BL(e,t=oS){const n=OL(e).mul(t);return n.xyz.div(n.w)}function UL(e){const t=IL(e);return t.position||(t.position=Ex(new Ke).setGroup(Tx).onRenderUpdate(((t,n)=>n.value.setFromMatrixPosition(e.matrixWorld))))}function FL(e){const t=IL(e);return t.targetPosition||(t.targetPosition=Ex(new Ke).setGroup(Tx).onRenderUpdate(((t,n)=>n.value.setFromMatrixPosition(e.target.matrixWorld))))}function kL(e){const t=IL(e);return t.viewPosition||(t.viewPosition=Ex(new Ke).setGroup(Tx).onRenderUpdate((({camera:t},n)=>{n.value=n.value||new Ke,n.value.setFromMatrixPosition(e.matrixWorld),n.value.applyMatrix4(t.matrixWorldInverse)})))}const qL=e=>LT.transformDirection(UL(e).sub(FL(e))),VL=(e,t)=>{for(const n of t)if(n.isAnalyticLightNode&&n.light.id===e)return n;return null},zL=new WeakMap,GL=[];class jL extends bv{static get type(){return"LightsNode"}constructor(){super("vec3"),this.totalDiffuseNode=Ny().toVar(),this.totalSpecularNode=Ny().toVar(),this.outgoingLightNode=Ny().toVar(),this._lights=[],this._lightNodes=null,this._lightNodesHash=null,this.global=!0}customCacheKey(){const e=this._lights;for(let t=0;t<e.length;t++){const n=e[t];if(GL.push(n.id),GL.push(n.castShadow?1:0),!0===n.isSpotLight){const e=null!==n.map?n.map.id:-1,t=n.colorNode?n.c
1olorNode.getCacheKey():-1;GL.push(e,t)}}const t=K_(GL);return GL.length=0,t}getHash(e){if(null===this._lightNodesHash){null===this._lightNodes&&this.setupLightsNode(e);const t=[];for(const e of this._lightNodes)t.push(e.getSelf().getHash());this._lightNodesHash="lights-"+t.join(",")}return this._lightNodesHash}analyze(e){const t=e.getNodeProperties(this);for(const n of t.nodes)n.build(e);t.outputNode.build(e)}setupLightsNode(e){const t=[],n=this._lightNodes,r=(e=>this._lights.sort(((e,t)=>e.id-t.id)))(),i=e.renderer.library;for(const e of r)if(e.isNode)t.push(cy(e));else{let r=null;if(null!==n&&(r=VL(e.id,n)),null===r){const n=i.getLightNodeClass(e.constructor);if(null===n)continue;let r=null;zL.has(e)?r=zL.get(e):(r=cy(new n(e)),zL.set(e,r)),t.push(r)}}this._lightNodes=t}setupDirectLight(e,t,n){const{lightingModel:r,reflectedLight:i}=e.context;r.direct({...n,lightNode:t,reflectedLight:i},e)}setupDirectRectAreaLight(e,t,n){const{lightingModel:r,reflectedLight:i}=e.context;r.directRectArea({...n,lightNode:t,reflectedLight:i},e)}setupLights(e,t){for(const n of t)n.build(e)}getLightNodes(e){return null===this._lightNodes&&this.setupLightsNode(e),this._lightNodes}setup(e){const t=e.lightsNode;e.lightsNode=this;let n=this.outgoingLightNode;const r=e.context,i=r.lightingModel,s=e.getNodeProperties(this);if(i){const{totalDiffuseNode:t,totalSpecularNode:a}=this;r.outgoingLight=n;const o=e.addStack();s.nodes=o.nodes,i.start(e);const{backdrop:l,backdropAlpha:u}=r,{directDiffuse:c,directSpecular:h,indirectDiffuse:A,indirectSpecular:d}=r.reflectedLight;let p=c.add(A);null!==l&&(p=Ny(null!==u?u.mix(p,l):l),r.material.transparent=!0),t.assign(p),a.assign(h.add(d)),n.assign(t.add(a)),i.finish(e),n=n.bypass(e.removeStack())}else s.nodes=[];return e.lightsNode=t,n}setLights(e){return this._lights=e,this._lightNodes=null,this._lightNodesHash=null,this}getLights(){return this._lights}get hasLights(){return this._lights.length>0}}class HL extends bv{static get type(){return"ShadowBaseNode"}constructor(e){super(),this.light=e,this.updateBeforeType=pv.RENDER,this.isShadowBaseNode=!0}setupShadowPosition({context:e,material:t}){WL.assign(t.receivedShadowPositionNode||e.shadowPositionWorld||oS)}}const WL=jy("vec3","shadowPositionWorld");const XL=new WeakMap,QL=my((({depthTexture:e,shadowCoord:t,depthLayer:n})=>{let r=yT(e,t.xy).label("t_basic");return e.isArrayTexture&&(r=r.depth(n)),r.compare(t.z)})),YL=my((({depthTexture:e,shadowCoord:t,shadow:n,depthLayer:r})=>{const i=(t,n)=>{let i=yT(e,t);return e.isArrayTexture&&(i=i.depth(r)),i.compare(n)},s=US("mapSize","vec2",n).setGroup(Tx),a=US("radius","float",n).setGroup(Tx),o=My(1).div(s),l=o.x.negate().mul(a),u=o.y.negate().mul(a),c=o.x.mul(a),h=o.y.mul(a),A=l.div(2),d=u.div(2),p=c.div(2),f=h.div(2);return Ox(i(t.xy.add(My(l,u)),t.z),i(t.xy.add(My(0,u)),t.z),i(t.xy.add(My(c,u)),t.z),i(t.xy.add(My(A,d)),t.z),i(t.xy.add(My(0,d)),t.z),i(t.xy.add(My(p,d)),t.z),i(t.xy.add(My(l,0)),t.z),i(t.xy.add(My(A,0)),t.z),i(t.xy,t.z),i(t.xy.add(My(p,0)),t.z),i(t.xy.add(My(c,0)),t.z),i(t.xy.add(My(A,f)),t.z),i(t.xy.add(My(0,f)),t.z),i(t.xy.add(My(p,f)),t.z),i(t.xy.add(My(l,h)),t.z),i(t.xy.add(My(0,h)),t.z),i(t.xy.add(My(c,h)),t.z)).mul(1/17)})),$L=my((({depthTexture:e,shadowCoord:t,shadow:n,depthLayer:r})=>{const i=(t,n)=>{let i=yT(e,t);return e.isArrayTexture&&(i=i.depth(r)),i.compare(n)},s=US("mapSize","vec2",n).setGroup(Tx),a=My(1).div(s),o=a.x,l=a.y,u=t.xy,c=Mb(u.mul(s).add(.5));return u.subAssign(c.mul(a)),Ox(i(u,t.z),i(u.add(My(o,0)),t.z),i(u.add(My(0,l)),t.z),i(u.add(a),t.z),lw(i(u.add(My(o.negate(),0)),t.z),i(u.add(My(o.mul(2),0)),t.z),c.x),lw(i(u.add(My(o.negate(),l)),t.z),i(u.add(My(o.mul(2),l)),t.z),c.x),lw(i(u.add(My(0,l.negate())),t.z),i(u.add(My(0,l.mul(2))),t.z),c.y),lw(i(u.add(My(o,l.negate())),t.z),i(u.add(My(o,l.mul(2))),t.z),c.y),lw(lw(i(u.add(My(o.negate(),l.negate())),t.z),i(u.add(My(o.mul(2),l.negate())),t.z),c.x),lw(i(u.add(My(o.negate(),l.mul(2))),t.z),i(u.add(My(o.mul(2),l.mul(2))),t.z),c.x),c.y)).mul(1/9)})),KL=my((({depthTexture:e,shadowCoord:t,depthLayer:n})=>{const r=by(1).toVar();let i=yT(e).sample(t.xy);e.isArrayTexture&&(i=i.depth(n)),i=i.rg;const s=Yb(t.z,i.x);return vy(s.notEqual(by(1)),(()=>{const e=t.z.sub(i.x),n=Qb(0,i.y.mul(i.y));let a=n.div(n.add(e.mul(e)));a=uw(Bx(a,.3).div(.95-.3)),r.assign(uw(Qb(s,a)))})),r})),ZL=my((([e,t,n])=>{let r=oS.sub(e).length();return r=r.sub(t).div(n.sub(t)),r=r.saturate(),r})),JL=e=>{let t=XL.get(e);if(void 0===t){const n=e.isPointLight?(e=>{const t=e.shadow.camera,n=US("near","float",t).setGroup(Tx),r=US("far","float",t).setGroup(Tx),i=VT(e);return ZL(i,n,r)})(e):null;t=new rC,t.colorNode=Iy(0,0,0,1),t.depthNode=n,t.isShadowPassMaterial=!0,t.name="ShadowMaterial",t.fog=!1,XL.set(e,t)}return t},eI=new BN,tI=[],nI=(e,t,n,r)=>{tI[0]=e,tI[1]=t;let i=eI.get(tI);return void 0!==i&&i.shadowType===n&&i.useVelocity===r||(i=(i,s,a,o,l,u,...c)=>{(!0===i.castShadow||i.receiveShadow&&3===n)&&(r&&(cv(i).useVelocity=!0),i.onBeforeShadow(e,i,a,t.camera,o,s.overrideMaterial,u),e.renderObject(i,s,a,o,l,u,...c),i.onAfterShadow(e,i,a,t.camera,o,s.overrideMaterial,u))},i.shadowType=n,i.useVelocity=r,eI.set(tI,i)),tI[0]=null,tI[1]=null,i}
vendor: 4,394 bytes, line 1
1,rI=my((({samples:e,radius:t,size:n,shadowPass:r,depthLayer:i})=>{const s=by(0).toVar("meanVertical"),a=by(0).toVar("squareMeanVertical"),o=e.lessThanEqual(by(1)).select(by(0),by(2).div(e.sub(1))),l=e.lessThanEqual(by(1)).select(by(0),by(-1));dE({start:wy(0),end:wy(e),type:"int",condition:"<"},(({i:e})=>{const u=l.add(by(e).mul(o));let c=r.sample(Ox(CE.xy,My(0,u).mul(t)).div(n));r.value.isArrayTexture&&(c=c.depth(i)),c=c.x,s.addAssign(c),a.addAssign(c.mul(c))})),s.divAssign(e),a.divAssign(e);const u=xb(a.sub(s.mul(s)));return My(s,u)})),iI=my((({samples:e,radius:t,size:n,shadowPass:r,depthLayer:i})=>{const s=by(0).toVar("meanHorizontal"),a=by(0).toVar("squareMeanHorizontal"),o=e.lessThanEqual(by(1)).select(by(0),by(2).div(e.sub(1))),l=e.lessThanEqual(by(1)).select(by(0),by(-1));dE({start:wy(0),end:wy(e),type:"int",condition:"<"},(({i:e})=>{const u=l.add(by(e).mul(o));let c=r.sample(Ox(CE.xy,My(u,0).mul(t)).div(n));r.value.isArrayTexture&&(c=c.depth(i)),s.addAssign(c.x),a.addAssign(Ox(c.y.mul(c.y),c.x.mul(c.x)))})),s.divAssign(e),a.divAssign(e);const u=xb(a.sub(s.mul(s)));return My(s,u)})),sI=[QL,YL,$L,KL];let aI;const oI=new sD;class lI extends HL{static get type(){return"ShadowNode"}constructor(e,t=null){super(e),this.shadow=t||e.shadow,this.shadowMap=null,this.vsmShadowMapVertical=null,this.vsmShadowMapHorizontal=null,this.vsmMaterialVertical=null,this.vsmMaterialHorizontal=null,this._node=null,this._cameraFrameId=new WeakMap,this.isShadowNode=!0,this.depthLayer=0}setupShadowFilter(e,{filterFn:t,depthTexture:n,shadowCoord:r,shadow:i,depthLayer:s}){const a=r.x.greaterThanEqual(0).and(r.x.lessThanEqual(1)).and(r.y.greaterThanEqual(0)).and(r.y.lessThanEqual(1)).and(r.z.lessThanEqual(1)),o=t({depthTexture:n,shadowCoord:r,shadow:i,depthLayer:s});return a.select(o,by(1))}setupShadowCoord(e,t){const{shadow:n}=this,{renderer:r}=e,i=US("bias","float",n).setGroup(Tx);let s,a=t;if(n.camera.isOrthographicCamera||!0!==r.logarithmicDepthBuffer)a=a.xyz.div(a.w),s=a.z,r.coordinateSystem===Be&&(s=s.mul(2).sub(1));else{const e=a.w;a=a.xy.div(e);const t=US("near","float",n.camera).setGroup(Tx),r=US("far","float",n.camera).setGroup(Tx);s=WE(e.negate(),t,r)}return a=Ny(a.x,a.y.oneMinus(),s.add(i)),a}getShadowFilterFn(e){return sI[e]}setupRenderTarget(e,t){const n=new Mi(e.mapSize.width,e.mapSize.height);n.name="ShadowDepthTexture",n.compareFunction=Ne;const r=t.createRenderTarget(e.mapSize.width,e.mapSize.height);return r.texture.name="ShadowMap",r.texture.type=e.mapType,r.depthTexture=n,{shadowMap:r,depthTexture:n}}setupShadow(e){const{renderer:t}=e,{light:n,shadow:r}=this,i=t.shadowMap.type,{depthTexture:s,shadowMap:a}=this.setupRenderTarget(r,e);if(r.camera.updateProjectionMatrix(),3===i&&!0!==r.isPointLightShadow){s.compareFunction=null,a.depth>1?(a._vsmShadowMapVertical||(a._vsmShadowMapVertical=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:G,type:P,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapVertical.texture.name="VSMVertical"),this.vsmShadowMapVertical=a._vsmShadowMapVertical,a._vsmShadowMapHorizontal||(a._vsmShadowMapHorizontal=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:G,type:P,depth:a.depth,depthBuffer:!1}),a._vsmShadowMapHorizontal.texture.name="VSMHorizontal"),this.vsmShadowMapHorizontal=a._vsmShadowMapHorizontal):(this.vsmShadowMapVertical=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:G,type:P,depthBuffer:!1}),this.vsmShadowMapHorizontal=e.createRenderTarget(r.mapSize.width,r.mapSize.height,{format:G,type:P,depthBuffer:!1}));let t=yT(s);s.isArrayTexture&&(t=t.depth(this.depthLayer));let n=yT(this.vsmShadowMapVertical.texture);s.isArrayTexture&&(n=n.depth(this.depthLayer));const i=US("blurSamples","float",r).setGroup(Tx),o=US("radius","float",r).setGroup(Tx),l=US("mapSize","vec2",r).setGroup(Tx);let u=this.vsmMaterialVertical||(this.vsmMaterialVertical=new rC);u.fragmentNode=rI({samples:i,radius:o,size:l,shadowPass:t,depthLayer:this.depthLayer}).context(e.getSharedContext()),u.name="VSMVertical",u=this.vsmMaterialHorizontal||(this.vsmMaterialHorizontal=new rC),u.fragmentNode=iI({samples:i,radius:o,size:l,shadowPass:n,depthLayer:this.depthLayer}).context(e.getSharedContext()),u.name="VSMHorizontal"}const o=US("intensity","float",r).setGroup(Tx),l=US("normalBias","float",r).setGroup(Tx),u=OL(n).mul(WL.add(vS.mul(l))),c=this.setupShadowCoord(e,u),h=r.filterNode||this.get
1ShadowFilterFn(t.shadowMap.type)||null;if(null===h)throw new Error("THREE.WebGPURenderer: Shadow map type not supported yet.");const A=3===i&&!0!==r.isPointLightShadow?this.vsmShadowMapHorizontal.texture:s,d=this.setupShadowFilter(e,{filterFn:h,shadowTexture:a.texture,depthTexture:A,shadowCoord:c,shadow:r,depthLayer:this.depthLayer});let p=yT(a.texture,c);s.isArrayTexture&&(p=p.depth(this.depthLayer));const f=lw(1,d.rgb.mix(p,1),o.mul(p.a)).toVar();return this.shadowMap=a,this.shadow.map=a,f}setup(e){if(!1!==e.renderer.shadowMap.enabled)return my((()=>{let t=this._node;return this.setupShadowPosition(e),null===t&&(this._node=t=this.setupShadow(e)),e.material.shadowNode,e.material.receivedShadowNode&&(t=e.material.receivedShadowNode(t)),t}))()}renderShadow(e){const{shadow:t,shadowMap:n,light:r}=this,{renderer:i,scene:s}=e;t.updateMatrices(r),n.setSize(t.mapSize.width,t.mapSize.height,n.depth),i.render(s,t.camera)}updateShadow(e){const{shadowMap:t,light:n,shadow:r}=this,{renderer:i,scene:s,camera:a}=e,o=i.shadowMap.type,l=t.depthTexture.version;this._depthVersionCached=l;const u=r.camera.layers.mask;4294967294&r.camera.layers.mask||(r.camera.layers.mask=a.layers.mask);const c=i.getRenderObjectFunction(),h=i.getMRT(),A=!!h&&h.has("velocity");aI=function(e,t,n){return n=function(e,t){return t=function(e,t={}){return t.background=e.background,t.backgroundNode=e.backgroundNode,t.overrideMaterial=e.overrideMaterial,t}(e,t),e.background=null,e.backgroundNode=null,e.overrideMaterial=null,t}(t,n=function(e,t){return t=function(e,t={}){return t.toneMapping=e.toneMapping,t.toneMappingExposure=e.toneMappingExposure,t.outputColorSpace=e.outputColorSpace,t.renderTarget=e.getRenderTarget(),t.activeCubeFace=e.getActiveCubeFace(),t.activeMipmapLevel=e.getActiveMipmapLevel(),t.renderObjectFunction=e.getRenderObjectFunction(),t.pixelRatio=e.getPixelRatio(),t.mrt=e.getMRT(),t.clearColor=e.getClearColor(t.clearColor||new Gn),t.clearAlpha=e.getClearAlpha(),t.autoClear=e.autoClear,t.scissorTest=e.getScissorTest(),t}(e,t),e.setMRT(null),e.setRenderObjectFunction(null),e.setClearColor(0,1),e.autoClear=!0,t}(e,n)),n}(i,s,aI),s.overrideMaterial=JL(n),i.setRenderObjectFunction(nI(i,r,o,A)),i.setClearColor(0,0),i.setRenderTarget(t),this.renderShadow(e),i.setRenderObjectFunction(c),3===o&&!0!==r.isPointLightShadow&&this.vsmPass(i),r.camera.layers.mask=u,function(e,t,n){!function(e,t){e.toneMapping=t.toneMapping,e.toneMappingExposure=t.toneMappingExposure,e.outputColorSpace=t.outputColorSpace,e.setRenderTarget(t.renderTarget,t.activeCubeFace,t.activeMipmapLevel),e.setRenderObjectFunction(t.renderObjectFunction),e.setPixelRatio(t.pixelRatio),e.setMRT(t.mrt),e.setClearColor(t.clearColor,t.clearAlpha),e.autoClear=t.autoClear,e.setScissorTest(t.scissorTest)}(e,n),function(e,t){e.background=t.background,e.backgroundNode=t.backgroundNode,e.overrideMaterial=t.overrideMaterial}(t,n)}(i,s,aI)}vsmPass(e){const{shadow:t}=this,n=this.shadowMap.depth;this.vsmShadowMapVertical.setSize(t.mapSize.width,t.mapSize.height,n),this.vsmShadowMapHorizontal.setSize(t.mapSize.width,t.mapSize.height,n),e.setRenderTarget(this.vsmShadowMapVertical),oI.material=this.vsmMaterialVertical,oI.render(e),e.setRenderTarget(this.vsmShadowMapHorizontal),oI.material=this.vsmMaterialHorizontal,oI.render(e)}dispose(){this.shadowMap.dispose(),this.shadowMap=null,null!==this.vsmShadowMapVertical&&(this.vsmShadowMapVertical.dispose(),this.vsmShadowMapVertical=null,this.vsmMaterialVertical.dispose(),this.vsmMaterialVertical=null),null!==this.vsmShadowMapHorizontal&&(this.vsmShadowMapHorizontal.dispose(),this.vsmShadowMapHorizontal=null,this.vsmMaterialHorizontal.dispose(),this.vsmMaterialHorizontal=null),super.dispose()}updateBefore(e){const{shadow:t}=this;let n=t.needsUpdate||t.autoUpdate;n&&(this._cameraFrameId[e.camera]===e.frameId&&(n=!1),this._cameraFrameId[e.camera]=e.frameId),n&&(this.updateShadow(e),this.shadowMap.depthTexture.version===this._depthVersionCached&&(t.needsUpdate=!1))}}const uI=(e,t)=>cy(new lI(e,t)),cI=new Gn,hI=my((([e,t])=>{const n=e.toVar(),r=Lb(n),i=Fx(1,Qb(r.x,Qb(r.y,r.z)));r.mulAssign(i),n.mulAssign(i.mul(t.mul(2).oneMinus()));const s=My(n.xy).toVar(),a=t.mul(1.5).oneMinus();return vy(r.z.greaterThanEqual(a),(()=>{vy(n.z.greaterThan(0),(()=>{s.x.assign(Bx(4,n.x))}))})).ElseIf(r.x.greaterThanEqual(a),(()=>{const e=Ib(n.x);s.x.assign(n.z.mul(e).add(e.mul(2)))})).ElseIf(r.y.greaterThanEqual(a),(()=>{const e=Ib(n.y);s.x.assign(n.x.add(e.mul(2)).add(2)),s.y.assign(n.z.mul(e).sub(2))})),My(.125,.25).mul(s).add(My(.375,.75)).flipY()})).setLayout({name:"cubeToUV",type:"vec2",inputs:[{name:"pos",type:"vec3"},{name:"texelSizeY",type:"float"}]}),AI=my((({depthTexture:e,bd3D:t,dp:n,texelSize:r})=>yT(e,hI(t,r.y)).compare(n))),dI=my((({depthTexture:e,bd3D:t,dp:n,texelSize:r,shadow:i})=>{const s=US("radius","float",i).setGroup(Tx),a=My(-1,1).mul(s).mul(r.y);return yT(e,hI(t.add(a.xyy),r.y)).compare(n).add(yT(e,hI(t.add(a.yyy),r.y)).compare(n)).add(yT(e,hI(t.add(a.xyx),r.y)).compare(n)).add(yT(e,hI(t.add(a.yyx),r.y)).compare(n)).add(yT(e,hI(t,r.y)).compare(n)).add(yT(e,hI(t.add(a.xxy),r.y)).compare(n)).add(yT(e,hI(t.add(a.yxy),r.y)).compare(n)).add(yT(e,hI(t.add(a.xxx),r.y)).compare(n)).add(yT(e,hI(t.add(a.yxx),r.y)).compare(n)).mul(1/9)})),pI=my((({filterFn:e,depthTexture:t,shadowCoord:n,shadow:r})=>{const i=n.xyz.toVar(),s=i.length(),a=Ex("float").setGroup(Tx).onRenderUpd
1ate((()=>r.camera.near)),o=Ex("float").setGroup(Tx).onRenderUpdate((()=>r.camera.far)),l=US("bias","float",r).setGroup(Tx),u=Ex(r.mapSize).setGroup(Tx),c=by(1).toVar();return vy(s.sub(o).lessThanEqual(0).and(s.sub(a).greaterThanEqual(0)),(()=>{const n=s.sub(a).div(o.sub(a)).toVar();n.addAssign(l);const h=i.normalize(),A=My(1).div(u.mul(My(4,2)));c.assign(e({depthTexture:t,bd3D:h,dp:n,texelSize:A,shadow:r}))})),c})),fI=new vt,mI=new Ye,gI=new Ye;class _I extends lI{static get type(){return"PointShadowNode"}constructor(e,t=null){super(e,t)}getShadowFilterFn(e){return 0===e?AI:dI}setupShadowCoord(e,t){return t}setupShadowFilter(e,{filterFn:t,shadowTexture:n,depthTexture:r,shadowCoord:i,shadow:s}){return pI({filterFn:t,shadowTexture:n,depthTexture:r,shadowCoord:i,shadow:s})}renderShadow(e){const{shadow:t,shadowMap:n,light:r}=this,{renderer:i,scene:s}=e,a=t.getFrameExtents();gI.copy(t.mapSize),gI.multiply(a),n.setSize(gI.width,gI.height),mI.copy(t.mapSize);const o=i.autoClear,l=i.getClearColor(cI),u=i.getClearAlpha();i.autoClear=!1,i.setClearColor(t.clearColor,t.clearAlpha),i.clear();const c=t.getViewportCount();for(let e=0;e<c;e++){const a=t.getViewport(e),o=mI.x*a.x,l=gI.y-mI.y-mI.y*a.y;fI.set(o,l,mI.x*a.z,mI.y*a.w),n.viewport.copy(fI),t.updateMatrices(r,e),i.render(s,t.camera)}i.autoClear=o,i.setClearColor(l,u)}}const vI=(e,t)=>cy(new _I(e,t));class yI extends vE{static get type(){return"AnalyticLightNode"}constructor(e=null){super(),this.light=e,this.color=new Gn,this.colorNode=e&&e.colorNode||Ex(this.color).setGroup(Tx),this.baseColorNode=null,this.shadowNode=null,this.shadowColorNode=null,this.isAnalyticLightNode=!0,this.updateType=pv.FRAME}getHash(){return this.light.uuid}getLightVector(e){return kL(this.light).sub(e.context.positionView||uS)}setupDirect(){}setupDirectRectArea(){}setupShadowNode(){return uI(this.light)}setupShadow(e){const{renderer:t}=e;if(!1===t.shadowMap.enabled)return;let n=this.shadowColorNode;if(null===n){const e=this.light.shadow.shadowNode;let t;t=void 0!==e?cy(e):this.setupShadowNode(),this.shadowNode=t,this.shadowColorNode=n=this.colorNode.mul(t),this.baseColorNode=this.colorNode}this.colorNode=n}setup(e){this.colorNode=this.baseColorNode||this.colorNode,this.light.castShadow?e.object.receiveShadow&&this.setupShadow(e):null!==this.shadowNode&&(this.shadowNode.dispose(),this.shadowNode=null,this.shadowColorNode=null);const t=this.setupDirect(e),n=this.setupDirectRectArea(e);t&&e.lightsNode.setupDirectLight(e,this,t),n&&e.lightsNode.setupDirectRectAreaLight(e,this,n)}update(){const{light:e}=this;this.color.copy(e.color).multiplyScalar(e.intensity)}}const xI=my((({lightDistance:e,cutoffDistance:t,decayExponent:n})=>{const r=e.pow(n).max(.01).reciprocal();return t.greaterThan(0).select(r.mul(e.div(t).pow4().oneMinus().clamp().pow2()),r)})),bI=({color:e,lightVector:t,cutoffDistance:n,decayExponent:r})=>{const i=t.normalize(),s=t.length(),a=xI({lightDistance:s,cutoffDistance:n,decayExponent:r});return{lightDirection:i,lightColor:e.mul(a)}};class wI extends yI{static get type(){return"PointLightNode"}constructor(e=null){super(e),this.cutoffDistanceNode=Ex(0).setGroup(Tx),this.decayExponentNode=Ex(2).setGroup(Tx)}update(e){const{light:t}=this;super.update(e),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}setupShadowNode(){return vI(this.light)}setupDirect(e){return bI({color:this.colorNode,lightVector:this.getLightVector(e),cutoffDistance:this.cutoffDistanceNode,decayExponent:this.decayExponentNode})}}const TI=my((([e=t()])=>{const t=e.mul(2),n=t.x.floor(),r=t.y.floor();return n.add(r).mod(2).sign()})),SI=my((([e=pT()],{renderer:t,material:n})=>{const r=ow(e.mul(2).sub(1));let i;if(n.alphaToCoverage&&t.samples>1){const e=by(r.fwidth()).toVar();i=Aw(e.oneMinus(),e.add(1),r).oneMinus()}else i=yw(r.greaterThan(1),0,1);return i})),MI=my((([e,t,n])=>{const r=by(n).toVar(),i=by(t).toVar(),s=Sy(e).toVar();return yw(s,i,r)})).setLayout({name:"mx_select",type:"float",inputs:[{name:"b",type:"bool"},{name:"t",type:"float"},{name:"f",type:"float"}]}),EI=my((([e,t])=>{const n=Sy(t).toVar(),r=by(e).toVar();return yw(n,r.negate(),r)})).setLayout({name:"mx_negate_if",type:"float",inputs:[{name:"val",type:"float"},{name:"b",type:"bool"}]}),CI=my((([e])=>{const t=by(e).toVar();return wy(wb(t))})).setLayout({name:"mx_floor",type:"int",inputs:[{name:"x",type:"float"}]}),RI=my((([e,t])=>{const n=by(e).toVar();return t.assign(CI(n)),n.sub(by(t))})),NI=my((([e,t,n,r,i,s])=>{const a=by(s).toVar(),o=by(i).toVar(),l=by(r).toVar(),u=by(n).toVar(),c=by(t).toVar(),h=by(e).toVar(),A=by(Bx(1,o)).toVar();return Bx(1,a).mul(h.mul(A).add(c.mul(o))).add(a.mul(u.mul(A).add(l.mul(o))))})).setLayout({name:"mx_bilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"}]}),PI=my((([e,t,n,r,i,s])=>{const a=by(s).toVar(),o=by(i).toVar(),l=Ny(r).toVar(),u=Ny(n).toVar(),c=Ny(t).toVar(),h=Ny(e).toVar(),A=by(Bx(1,o)).toVar();return Bx(1,a).mul(h.mul(A).add(c.mul(o))).add(a.mul(u.mul(A).add(l.mul(o))))}
1)).setLayout({name:"mx_bilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"}]}),DI=PP([NI,PI]),LI=my((([e,t,n,r,i,s,a,o,l,u,c])=>{const h=by(c).toVar(),A=by(u).toVar(),d=by(l).toVar(),p=by(o).toVar(),f=by(a).toVar(),m=by(s).toVar(),g=by(i).toVar(),_=by(r).toVar(),v=by(n).toVar(),y=by(t).toVar(),x=by(e).toVar(),b=by(Bx(1,d)).toVar(),w=by(Bx(1,A)).toVar();return by(Bx(1,h)).toVar().mul(w.mul(x.mul(b).add(y.mul(d))).add(A.mul(v.mul(b).add(_.mul(d))))).add(h.mul(w.mul(g.mul(b).add(m.mul(d))).add(A.mul(f.mul(b).add(p.mul(d))))))})).setLayout({name:"mx_trilerp_0",type:"float",inputs:[{name:"v0",type:"float"},{name:"v1",type:"float"},{name:"v2",type:"float"},{name:"v3",type:"float"},{name:"v4",type:"float"},{name:"v5",type:"float"},{name:"v6",type:"float"},{name:"v7",type:"float"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),II=my((([e,t,n,r,i,s,a,o,l,u,c])=>{const h=by(c).toVar(),A=by(u).toVar(),d=by(l).toVar(),p=Ny(o).toVar(),f=Ny(a).toVar(),m=Ny(s).toVar(),g=Ny(i).toVar(),_=Ny(r).toVar(),v=Ny(n).toVar(),y=Ny(t).toVar(),x=Ny(e).toVar(),b=by(Bx(1,d)).toVar(),w=by(Bx(1,A)).toVar();return by(Bx(1,h)).toVar().mul(w.mul(x.mul(b).add(y.mul(d))).add(A.mul(v.mul(b).add(_.mul(d))))).add(h.mul(w.mul(g.mul(b).add(m.mul(d))).add(A.mul(f.mul(b).add(p.mul(d))))))})).setLayout({name:"mx_trilerp_1",type:"vec3",inputs:[{name:"v0",type:"vec3"},{name:"v1",type:"vec3"},{name:"v2",type:"vec3"},{name:"v3",type:"vec3"},{name:"v4",type:"vec3"},{name:"v5",type:"vec3"},{name:"v6",type:"vec3"},{name:"v7",type:"vec3"},{name:"s",type:"float"},{name:"t",type:"float"},{name:"r",type:"float"}]}),OI=PP([LI,II]),BI=my((([e,t,n])=>{const r=by(n).toVar(),i=by(t).toVar(),s=Ty(e).toVar(),a=Ty(s.bitAnd(Ty(7))).toVar(),o=by(MI(a.lessThan(Ty(4)),i,r)).toVar(),l=by(Ux(2,MI(a.lessThan(Ty(4)),r,i))).toVar();return EI(o,Sy(a.bitAnd(Ty(1)))).add(EI(l,Sy(a.bitAnd(Ty(2)))))})).setLayout({name:"mx_gradient_float_0",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"}]}),UI=my((([e,t,n,r])=>{const i=by(r).toVar(),s=by(n).toVar(),a=by(t).toVar(),o=Ty(e).toVar(),l=Ty(o.bitAnd(Ty(15))).toVar(),u=by(MI(l.lessThan(Ty(8)),a,s)).toVar(),c=by(MI(l.lessThan(Ty(4)),s,MI(l.equal(Ty(12)).or(l.equal(Ty(14))),a,i))).toVar();return EI(u,Sy(l.bitAnd(Ty(1)))).add(EI(c,Sy(l.bitAnd(Ty(2)))))})).setLayout({name:"mx_gradient_float_1",type:"float",inputs:[{name:"hash",type:"uint"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),FI=PP([BI,UI]),kI=my((([e,t,n])=>{const r=by(n).toVar(),i=by(t).toVar(),s=Dy(e).toVar();return Ny(FI(s.x,i,r),FI(s.y,i,r),FI(s.z,i,r))})).setLayout({name:"mx_gradient_vec3_0",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"}]}),qI=my((([e,t,n,r])=>{const i=by(r).toVar(),s=by(n).toVar(),a=by(t).toVar(),o=Dy(e).toVar();return Ny(FI(o.x,a,s,i),FI(o.y,a,s,i),FI(o.z,a,s,i))})).setLayout({name:"mx_gradient_vec3_1",type:"vec3",inputs:[{name:"hash",type:"uvec3"},{name:"x",type:"float"},{name:"y",type:"float"},{name:"z",type:"float"}]}),VI=PP([kI,qI]),zI=my((([e])=>{const t=by(e).toVar();return Ux(.6616,t)})).setLayout({name:"mx_gradient_scale2d_0",type:"float",inputs:[{name:"v",type:"float"}]}),GI=my((([e])=>{const t=by(e).toVar();return Ux(.982,t)})).setLayout({name:"mx_gradient_scale3d_0",type:"float",inputs:[{name:"v",type:"float"}]}),jI=my((([e])=>{const t=Ny(e).toVar();return Ux(.6616,t)})).setLayout({name:"mx_gradient_scale2d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),HI=PP([zI,jI]),WI=my((([e])=>{const t=Ny(e).toVar();return Ux(.982,t)})).setLayout({name:"mx_gradient_scale3d_1",type:"vec3",inputs:[{name:"v",type:"vec3"}]}),XI=PP([GI,WI]),QI=my((([e,t])=>{const n=wy(t).toVar(),r=Ty(e).toVar();return r.shiftLeft(n).bitOr(r.shiftRight(wy(32).sub(n)))})).setLayout({name:"mx_rotl32",type:"uint",inputs:[{name:"x",type:"uint"},{name:"k",type:"int"}]}),YI=my((([e,t,n])=>{e.subAssign(n),e.bitXorAssign(QI(n,wy(4))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(QI(e,wy(6))),e.addAssign(n),n.subAssign(t),n.bitXorAssign(QI(t,wy(8))),t.addAssign(e),e.subAssign(n),e.bitXorAssign(QI(n,wy(16))),n.addAssign(t),t.subAssign(e),t.bitXorAssign(QI(e,wy(19))),e.addAssign(n),n.subAssign(t),n.bitXorAssign(QI(t,wy(4))),t.addAssign(e)})),$I=my((([e,t,n])=>{const r=Ty(n).toVar(),i=Ty(t).toVar(),s=Ty(e).toVar();return r.bitXorAssign(i),r.subAssign(QI(i,wy(14))),s.bitXorAssign(r),s.subAssign(QI(r,wy(11))),i.bitXorAssign(s),i.subAssign(QI(s,wy(25))),r.bitXorAssign(i),r.subAssign(QI(i,wy(16))),s.bitXorAssign(r),s.subAssign(QI(r,wy(4))),i.bitXorAssign(s),i.subAssign(QI(s,wy(14))),r.bitXorAssign(i),r.subAssign(QI(i,wy(24))),r}
1)).setLayout({name:"mx_bjfinal",type:"uint",inputs:[{name:"a",type:"uint"},{name:"b",type:"uint"},{name:"c",type:"uint"}]}),KI=my((([e])=>{const t=Ty(e).toVar();return by(t).div(by(Ty(wy(4294967295))))})).setLayout({name:"mx_bits_to_01",type:"float",inputs:[{name:"bits",type:"uint"}]}),ZI=my((([e])=>{const t=by(e).toVar();return t.mul(t).mul(t).mul(t.mul(t.mul(6).sub(15)).add(10))})).setLayout({name:"mx_fade",type:"float",inputs:[{name:"t",type:"float"}]}),JI=my((([e])=>{const t=wy(e).toVar(),n=Ty(Ty(1)).toVar(),r=Ty(Ty(wy(3735928559)).add(n.shiftLeft(Ty(2))).add(Ty(13))).toVar();return $I(r.add(Ty(t)),r,r)})).setLayout({name:"mx_hash_int_0",type:"uint",inputs:[{name:"x",type:"int"}]}),eO=my((([e,t])=>{const n=wy(t).toVar(),r=wy(e).toVar(),i=Ty(Ty(2)).toVar(),s=Ty().toVar(),a=Ty().toVar(),o=Ty().toVar();return s.assign(a.assign(o.assign(Ty(wy(3735928559)).add(i.shiftLeft(Ty(2))).add(Ty(13))))),s.addAssign(Ty(r)),a.addAssign(Ty(n)),$I(s,a,o)})).setLayout({name:"mx_hash_int_1",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),tO=my((([e,t,n])=>{const r=wy(n).toVar(),i=wy(t).toVar(),s=wy(e).toVar(),a=Ty(Ty(3)).toVar(),o=Ty().toVar(),l=Ty().toVar(),u=Ty().toVar();return o.assign(l.assign(u.assign(Ty(wy(3735928559)).add(a.shiftLeft(Ty(2))).add(Ty(13))))),o.addAssign(Ty(s)),l.addAssign(Ty(i)),u.addAssign(Ty(r)),$I(o,l,u)})).setLayout({name:"mx_hash_int_2",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),nO=my((([e,t,n,r])=>{const i=wy(r).toVar(),s=wy(n).toVar(),a=wy(t).toVar(),o=wy(e).toVar(),l=Ty(Ty(4)).toVar(),u=Ty().toVar(),c=Ty().toVar(),h=Ty().toVar();return u.assign(c.assign(h.assign(Ty(wy(3735928559)).add(l.shiftLeft(Ty(2))).add(Ty(13))))),u.addAssign(Ty(o)),c.addAssign(Ty(a)),h.addAssign(Ty(s)),YI(u,c,h),u.addAssign(Ty(i)),$I(u,c,h)})).setLayout({name:"mx_hash_int_3",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"}]}),rO=my((([e,t,n,r,i])=>{const s=wy(i).toVar(),a=wy(r).toVar(),o=wy(n).toVar(),l=wy(t).toVar(),u=wy(e).toVar(),c=Ty(Ty(5)).toVar(),h=Ty().toVar(),A=Ty().toVar(),d=Ty().toVar();return h.assign(A.assign(d.assign(Ty(wy(3735928559)).add(c.shiftLeft(Ty(2))).add(Ty(13))))),h.addAssign(Ty(u)),A.addAssign(Ty(l)),d.addAssign(Ty(o)),YI(h,A,d),h.addAssign(Ty(a)),A.addAssign(Ty(s)),$I(h,A,d)})).setLayout({name:"mx_hash_int_4",type:"uint",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xx",type:"int"},{name:"yy",type:"int"}]}),iO=PP([JI,eO,tO,nO,rO]),sO=my((([e,t])=>{const n=wy(t).toVar(),r=wy(e).toVar(),i=Ty(iO(r,n)).toVar(),s=Dy().toVar();return s.x.assign(i.bitAnd(wy(255))),s.y.assign(i.shiftRight(wy(8)).bitAnd(wy(255))),s.z.assign(i.shiftRight(wy(16)).bitAnd(wy(255))),s})).setLayout({name:"mx_hash_vec3_0",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"}]}),aO=my((([e,t,n])=>{const r=wy(n).toVar(),i=wy(t).toVar(),s=wy(e).toVar(),a=Ty(iO(s,i,r)).toVar(),o=Dy().toVar();return o.x.assign(a.bitAnd(wy(255))),o.y.assign(a.shiftRight(wy(8)).bitAnd(wy(255))),o.z.assign(a.shiftRight(wy(16)).bitAnd(wy(255))),o})).setLayout({name:"mx_hash_vec3_1",type:"uvec3",inputs:[{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"}]}),oO=PP([sO,aO]),lO=my((([e])=>{const t=My(e).toVar(),n=wy().toVar(),r=wy().toVar(),i=by(RI(t.x,n)).toVar(),s=by(RI(t.y,r)).toVar(),a=by(ZI(i)).toVar(),o=by(ZI(s)).toVar(),l=by(DI(FI(iO(n,r),i,s),FI(iO(n.add(wy(1)),r),i.sub(1),s),FI(iO(n,r.add(wy(1))),i,s.sub(1)),FI(iO(n.add(wy(1)),r.add(wy(1))),i.sub(1),s.sub(1)),a,o)).toVar();return HI(l)})).setLayout({name:"mx_perlin_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"}]}),uO=my((([e])=>{const t=Ny(e).toVar(),n=wy().toVar(),r=wy().toVar(),i=wy().toVar(),s=by(RI(t.x,n)).toVar(),a=by(RI(t.y,r)).toVar(),o=by(RI(t.z,i)).toVar(),l=by(ZI(s)).toVar(),u=by(ZI(a)).toVar(),c=by(ZI(o)).toVar(),h=by(OI(FI(iO(n,r,i),s,a,o),FI(iO(n.add(wy(1)),r,i),s.sub(1),a,o),FI(iO(n,r.add(wy(1)),i),s,a.sub(1),o),FI(iO(n.add(wy(1)),r.add(wy(1)),i),s.sub(1),a.sub(1),o),FI(iO(n,r,i.add(wy(1))),s,a,o.sub(1)),FI(iO(n.add(wy(1)),r,i.add(wy(1))),s.sub(1),a,o.sub(1)),FI(iO(n,r.add(wy(1)),i.add(wy(1))),s,a.sub(1),o.sub(1)),FI(iO(n.add(wy(1)),r.add(wy(1)),i.add(wy(1))),s.sub(1),a.sub(1),o.sub(1)),l,u,c)).toVar();return XI(h)})).setLayout({name:"mx_perlin_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"}]}),cO=PP([lO,uO]),hO=my((([e])=>{const t=My(e).toVar(),n=wy().toVar(),r=wy().toVar(),i=by(RI(t.x,n)).toVar(),s=by(RI(t.y,r)).toVar(),a=by(ZI(i)).toVar(),o=by(ZI(s)).toVar(),l=Ny(DI(VI(oO(n,r),i,s),VI(oO(n.add(wy(1)),r),i.sub(1),s),VI(oO(n,r.add(wy(1))),i,s.sub(1)),VI(oO(n.add(wy(1)),r.add(wy(1))),i.sub(1),s.sub(1)),a,o)).toVar();return HI(l)}
1)).setLayout({name:"mx_perlin_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),AO=my((([e])=>{const t=Ny(e).toVar(),n=wy().toVar(),r=wy().toVar(),i=wy().toVar(),s=by(RI(t.x,n)).toVar(),a=by(RI(t.y,r)).toVar(),o=by(RI(t.z,i)).toVar(),l=by(ZI(s)).toVar(),u=by(ZI(a)).toVar(),c=by(ZI(o)).toVar(),h=Ny(OI(VI(oO(n,r,i),s,a,o),VI(oO(n.add(wy(1)),r,i),s.sub(1),a,o),VI(oO(n,r.add(wy(1)),i),s,a.sub(1),o),VI(oO(n.add(wy(1)),r.add(wy(1)),i),s.sub(1),a.sub(1),o),VI(oO(n,r,i.add(wy(1))),s,a,o.sub(1)),VI(oO(n.add(wy(1)),r,i.add(wy(1))),s.sub(1),a,o.sub(1)),VI(oO(n,r.add(wy(1)),i.add(wy(1))),s,a.sub(1),o.sub(1)),VI(oO(n.add(wy(1)),r.add(wy(1)),i.add(wy(1))),s.sub(1),a.sub(1),o.sub(1)),l,u,c)).toVar();return XI(h)})).setLayout({name:"mx_perlin_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),dO=PP([hO,AO]),pO=my((([e])=>{const t=by(e).toVar(),n=wy(CI(t)).toVar();return KI(iO(n))})).setLayout({name:"mx_cell_noise_float_0",type:"float",inputs:[{name:"p",type:"float"}]}),fO=my((([e])=>{const t=My(e).toVar(),n=wy(CI(t.x)).toVar(),r=wy(CI(t.y)).toVar();return KI(iO(n,r))})).setLayout({name:"mx_cell_noise_float_1",type:"float",inputs:[{name:"p",type:"vec2"}]}),mO=my((([e])=>{const t=Ny(e).toVar(),n=wy(CI(t.x)).toVar(),r=wy(CI(t.y)).toVar(),i=wy(CI(t.z)).toVar();return KI(iO(n,r,i))})).setLayout({name:"mx_cell_noise_float_2",type:"float",inputs:[{name:"p",type:"vec3"}]}),gO=my((([e])=>{const t=Iy(e).toVar(),n=wy(CI(t.x)).toVar(),r=wy(CI(t.y)).toVar(),i=wy(CI(t.z)).toVar(),s=wy(CI(t.w)).toVar();return KI(iO(n,r,i,s))})).setLayout({name:"mx_cell_noise_float_3",type:"float",inputs:[{name:"p",type:"vec4"}]}),_O=PP([pO,fO,mO,gO]),vO=my((([e])=>{const t=by(e).toVar(),n=wy(CI(t)).toVar();return Ny(KI(iO(n,wy(0))),KI(iO(n,wy(1))),KI(iO(n,wy(2))))})).setLayout({name:"mx_cell_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"float"}]}),yO=my((([e])=>{const t=My(e).toVar(),n=wy(CI(t.x)).toVar(),r=wy(CI(t.y)).toVar();return Ny(KI(iO(n,r,wy(0))),KI(iO(n,r,wy(1))),KI(iO(n,r,wy(2))))})).setLayout({name:"mx_cell_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec2"}]}),xO=my((([e])=>{const t=Ny(e).toVar(),n=wy(CI(t.x)).toVar(),r=wy(CI(t.y)).toVar(),i=wy(CI(t.z)).toVar();return Ny(KI(iO(n,r,i,wy(0))),KI(iO(n,r,i,wy(1))),KI(iO(n,r,i,wy(2))))})).setLayout({name:"mx_cell_noise_vec3_2",type:"vec3",inputs:[{name:"p",type:"vec3"}]}),bO=my((([e])=>{const t=Iy(e).toVar(),n=wy(CI(t.x)).toVar(),r=wy(CI(t.y)).toVar(),i=wy(CI(t.z)).toVar(),s=wy(CI(t.w)).toVar();return Ny(KI(iO(n,r,i,s,wy(0))),KI(iO(n,r,i,s,wy(1))),KI(iO(n,r,i,s,wy(2))))})).setLayout({name:"mx_cell_noise_vec3_3",type:"vec3",inputs:[{name:"p",type:"vec4"}]}),wO=PP([vO,yO,xO,bO]),TO=my((([e,t,n,r])=>{const i=by(r).toVar(),s=by(n).toVar(),a=wy(t).toVar(),o=Ny(e).toVar(),l=by(0).toVar(),u=by(1).toVar();return dE(a,(()=>{l.addAssign(u.mul(cO(o))),u.mulAssign(i),o.mulAssign(s)})),l})).setLayout({name:"mx_fractal_noise_float",type:"float",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),SO=my((([e,t,n,r])=>{const i=by(r).toVar(),s=by(n).toVar(),a=wy(t).toVar(),o=Ny(e).toVar(),l=Ny(0).toVar(),u=by(1).toVar();return dE(a,(()=>{l.addAssign(u.mul(dO(o))),u.mulAssign(i),o.mulAssign(s)})),l})).setLayout({name:"mx_fractal_noise_vec3",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),MO=my((([e,t,n,r])=>{const i=by(r).toVar(),s=by(n).toVar(),a=wy(t).toVar(),o=Ny(e).toVar();return My(TO(o,a,s,i),TO(o.add(Ny(wy(19),wy(193),wy(17))),a,s,i))})).setLayout({name:"mx_fractal_noise_vec2",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),EO=my((([e,t,n,r])=>{const i=by(r).toVar(),s=by(n).toVar(),a=wy(t).toVar(),o=Ny(e).toVar(),l=Ny(SO(o,a,s,i)).toVar(),u=by(TO(o.add(Ny(wy(19),wy(193),wy(17))),a,s,i)).toVar();return Iy(l,u)})).setLayout({name:"mx_fractal_noise_vec4",type:"vec4",inputs:[{name:"p",type:"vec3"},{name:"octaves",type:"int"},{name:"lacunarity",type:"float"},{name:"diminish",type:"float"}]}),CO=my((([e,t,n,r,i,s,a])=>{const o=wy(a).toVar(),l=by(s).toVar(),u=wy(i).toVar(),c=wy(r).toVar(),h=wy(n).toVar(),A=wy(t).toVar(),d=My(e).toVar(),p=Ny(wO(My(A.add(c),h.add(u)))).toVar(),f=My(p.x,p.y).toVar();f.subAssign(.5),f.mulAssign(l),f.addAssign(.5);const m=My(My(by(A),by(h)).add(f)).toVar(),g=My(m.sub(d)).toVar();return vy(o.equal(wy(2)),(()=>Lb(g.x).add(Lb(g.y)))),vy(o.equal(wy(3)),(()=>Qb(Lb(g.x),Lb(g.y)))),Jb(g,g)})).setLayout({name:"mx_worley_distance_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),RO=my((([e,t,n,r,i,s,a,o,l])=>{const u=wy(l).toVar(),c=by(o).toVar(),h=wy(a).toVar(),A=wy(s).toVar(),d=wy(i).toVar(),p=wy(r).toVar(),f=wy(n).toVar(),m=wy(t).toVar(),g=Ny(e).toVar(),_=Ny(wO(Ny(m.add(d),f.add(A),p.add(h)))).toVar();_.subAssign(.5),_.mulAssign(c),_.addAssign(.5);const v=Ny(Ny(by(m),by(f),by(p)).add(_)).toVar(),y=Ny(v.sub(g)).toVar();return vy(u.equal(wy(2)),(()=>Lb(y.x).add(Lb(y.y)).add(Lb(y.z)))),vy(u.equal(wy(3)),(()=>Qb(Lb(y.x),Lb(y.y),Lb(y.z)))),Jb(y,y)})).setLayout({name:"mx_worley_distance_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"x",type:"int"},{name:"y",type:"int"},{name:"z",type:"int"},{name:"xoff",type:"int"},{name:"yoff",type:"int"},{name:"zoff",type:"int"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),NO=PP([CO,RO]),PO=my((([e,t,n])=>{const r=wy(n).toVar(),i=by(t).toVar(),s=My(e).toVar(),a=wy().toVar(),o=wy().toVar(),l=My(RI(s.x,a),RI(s.y,o)).toVar(),u=by(1e6).toVar();return dE({start:-1,end:wy(1),name:"x",condition:"<="},(({x:e})=>{dE({start:-1,end:wy(1),name:"y",condition:"<="},(({y:t})=>{const n=by(NO(l,e,t,a,o,i,r)).toVar();u.assign(Xb(u,n))}))})),vy(r.equal(wy(0)),(()=>{u.assign(xb(u))})),u})).setLayout({name:"mx_worley_noise_float_0",type:"float",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),DO=my((([e,t,n])=>{const r=wy(n).toVar(),i=by(t).toVar(),s=My(e).toVar(),a=wy().toVar(),o=wy().toVar(),l=My(RI(s.x,a),RI(s.y,o)).toVar(),u=My(1e6,1e6).toVar();return dE({start:-1,end:wy(1),name:"x",condition:"<="},(({x:e})=>{dE({start:-1,end:wy(1),name:"y",condition:"<="},(({y:t})=>{const n=by(NO(l,e,t,a,o,i,r)).toVar();vy(n.lessThan(u.x),(()=>{u.y.assign(u.x),u.x.assign(n)})).ElseIf(n.lessThan(u.y),(()=>{u.y.assign(n)}))}))})),vy(r.equal(wy(0)),(()=>{u.assign(xb(u))})),u})).setLayout({name:"mx_worley_noise_vec2_0",type:"vec2",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),LO=my((([e,t,n])=>{const r=wy(n).toVar(),i=by(t).toVar(),s=My(e).toVar(),a=wy().toVar(),o=wy().toVar(),l=My(RI(s.x,a),RI(s.y,o)).toVar(),u=Ny(1e6,1e6,1e6).toVar();return dE({start:-1,end:wy(1),name:"x",condition:"<="},(({x:e})=>{dE({start:-1,end:wy(1),name:"y",condition:"<="},(({y:t})=>{const n=by(NO(l,e,t,a,o,i,r)).toVar();vy(n.lessThan(u.x),(()=>{u.z.assign(u.y),u.y.assign(u.x),u.x.assign(n)})).ElseIf(n.lessThan(u.y),(()=>{u.z.assign(u.y),u.y.assign(n)})).ElseIf(n.lessThan(u.z),(()=>{u.z.assign(n)}))}))})),vy(r.equal(wy(0)),(()=>{u.assign(xb(u))})),u}
1)).setLayout({name:"mx_worley_noise_vec3_0",type:"vec3",inputs:[{name:"p",type:"vec2"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),IO=my((([e,t,n])=>{const r=wy(n).toVar(),i=by(t).toVar(),s=Ny(e).toVar(),a=wy().toVar(),o=wy().toVar(),l=wy().toVar(),u=Ny(RI(s.x,a),RI(s.y,o),RI(s.z,l)).toVar(),c=by(1e6).toVar();return dE({start:-1,end:wy(1),name:"x",condition:"<="},(({x:e})=>{dE({start:-1,end:wy(1),name:"y",condition:"<="},(({y:t})=>{dE({start:-1,end:wy(1),name:"z",condition:"<="},(({z:n})=>{const s=by(NO(u,e,t,n,a,o,l,i,r)).toVar();c.assign(Xb(c,s))}))}))})),vy(r.equal(wy(0)),(()=>{c.assign(xb(c))})),c})).setLayout({name:"mx_worley_noise_float_1",type:"float",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),OO=PP([PO,IO]),BO=my((([e,t,n])=>{const r=wy(n).toVar(),i=by(t).toVar(),s=Ny(e).toVar(),a=wy().toVar(),o=wy().toVar(),l=wy().toVar(),u=Ny(RI(s.x,a),RI(s.y,o),RI(s.z,l)).toVar(),c=My(1e6,1e6).toVar();return dE({start:-1,end:wy(1),name:"x",condition:"<="},(({x:e})=>{dE({start:-1,end:wy(1),name:"y",condition:"<="},(({y:t})=>{dE({start:-1,end:wy(1),name:"z",condition:"<="},(({z:n})=>{const s=by(NO(u,e,t,n,a,o,l,i,r)).toVar();vy(s.lessThan(c.x),(()=>{c.y.assign(c.x),c.x.assign(s)})).ElseIf(s.lessThan(c.y),(()=>{c.y.assign(s)}))}))}))})),vy(r.equal(wy(0)),(()=>{c.assign(xb(c))})),c})).setLayout({name:"mx_worley_noise_vec2_1",type:"vec2",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),UO=PP([DO,BO]),FO=my((([e,t,n])=>{const r=wy(n).toVar(),i=by(t).toVar(),s=Ny(e).toVar(),a=wy().toVar(),o=wy().toVar(),l=wy().toVar(),u=Ny(RI(s.x,a),RI(s.y,o),RI(s.z,l)).toVar(),c=Ny(1e6,1e6,1e6).toVar();return dE({start:-1,end:wy(1),name:"x",condition:"<="},(({x:e})=>{dE({start:-1,end:wy(1),name:"y",condition:"<="},(({y:t})=>{dE({start:-1,end:wy(1),name:"z",condition:"<="},(({z:n})=>{const s=by(NO(u,e,t,n,a,o,l,i,r)).toVar();vy(s.lessThan(c.x),(()=>{c.z.assign(c.y),c.y.assign(c.x),c.x.assign(s)})).ElseIf(s.lessThan(c.y),(()=>{c.z.assign(c.y),c.y.assign(s)})).ElseIf(s.lessThan(c.z),(()=>{c.z.assign(s)}))}))}))})),vy(r.equal(wy(0)),(()=>{c.assign(xb(c))})),c})).setLayout({name:"mx_worley_noise_vec3_1",type:"vec3",inputs:[{name:"p",type:"vec3"},{name:"jitter",type:"float"},{name:"metric",type:"int"}]}),kO=PP([LO,FO]),qO=my((([e])=>{const t=e.y,n=e.z,r=Ny().toVar();return vy(t.lessThan(1e-4),(()=>{r.assign(Ny(n,n,n))})).Else((()=>{let i=e.x;i=i.sub(wb(i)).mul(6).toVar();const s=wy(zb(i)),a=i.sub(by(s)),o=n.mul(t.oneMinus()),l=n.mul(t.mul(a).oneMinus()),u=n.mul(t.mul(a.oneMinus()).oneMinus());vy(s.equal(wy(0)),(()=>{r.assign(Ny(n,u,o))})).ElseIf(s.equal(wy(1)),(()=>{r.assign(Ny(l,n,o))})).ElseIf(s.equal(wy(2)),(()=>{r.assign(Ny(o,n,u))})).ElseIf(s.equal(wy(3)),(()=>{r.assign(Ny(o,l,n))})).ElseIf(s.equal(wy(4)),(()=>{r.assign(Ny(u,o,n))})).Else((()=>{r.assign(Ny(n,o,l))}))})),r})).setLayout({name:"mx_hsvtorgb",type:"vec3",inputs:[{name:"hsv",type:"vec3"}]}),VO=my((([e])=>{const t=Ny(e).toVar(),n=by(t.x).toVar(),r=by(t.y).toVar(),i=by(t.z).toVar(),s=by(Xb(n,Xb(r,i))).toVar(),a=by(Qb(n,Qb(r,i))).toVar(),o=by(a.sub(s)).toVar(),l=by().toVar(),u=by().toVar(),c=by().toVar();return c.assign(a),vy(a.greaterThan(0),(()=>{u.assign(o.div(a))})).Else((()=>{u.assign(0)})),vy(u.lessThanEqual(0),(()=>{l.assign(0)})).Else((()=>{vy(n.greaterThanEqual(a),(()=>{l.assign(r.sub(i).div(o))})).ElseIf(r.greaterThanEqual(a),(()=>{l.assign(Ox(2,i.sub(n).div(o)))})).Else((()=>{l.assign(Ox(4,n.sub(r).div(o)))})),l.mulAssign(1/6),vy(l.lessThan(0),(()=>{l.addAssign(1)}))})),Ny(l,u,c)})).setLayout({name:"mx_rgbtohsv",type:"vec3",inputs:[{name:"c",type:"vec3"}]}),zO=my((([e])=>{const t=Ny(e).toVar(),n=Ly(Gx(t,Ny(.04045))).toVar(),r=Ny(t.div(12.92)).toVar(),i=Ny(tw(Qb(t.add(Ny(.055)),Ny(0)).div(1.055),Ny(2.4))).toVar();return lw(r,i,n)})).setLayout({name:"mx_srgb_texture_to_lin_rec709",type:"vec3",inputs:[{name:"color",type:"vec3"}]}),GO=(e,t)=>{e=by(e),t=by(t);const n=My(t.dFdx(),t.dFdy()).length().mul(.7071067811865476);return Aw(e.sub(n),e.add(n),t)},jO=(e,t,n,r)=>lw(e,t,n[r].clamp()),HO=(e,t,n,r,i)=>lw(e,t,GO(n,r[i])),WO=my((([e,t,n])=>{const r=Sb(e).toVar(),i=Bx(by(.5).mul(t.sub(n)),oS).div(r).toVar(),s=Bx(by(-.5).mul(t.sub(n)),oS).div(r).toVar(),a=Ny().toVar();a.x=r.x.greaterThan(by(0)).select(i.x,s.x),a.y=r.y.greaterThan(by(0)).select(i.y,s.y),a.z=r.z.greaterThan(by(0)).select(i.z,s.z);const o=Xb(a.x,a.y,a.z).toVar();
1return oS.add(r.mul(o)).toVar().sub(n)})),XO=my((([e,t])=>{const n=e.x,r=e.y,i=e.z;let s=t.element(0).mul(.886227);return s=s.add(t.element(1).mul(1.023328).mul(r)),s=s.add(t.element(2).mul(1.023328).mul(i)),s=s.add(t.element(3).mul(1.023328).mul(n)),s=s.add(t.element(4).mul(.858086).mul(n).mul(r)),s=s.add(t.element(5).mul(.858086).mul(r).mul(i)),s=s.add(t.element(6).mul(i.mul(i).mul(.743125).sub(.247708))),s=s.add(t.element(7).mul(.858086).mul(n).mul(i)),s=s.add(t.element(8).mul(.429043).mul(Ux(n,n).sub(Ux(r,r)))),s}));var QO=Object.freeze({__proto__:null,BRDF_GGX:VC,BRDF_Lambert:MC,BasicPointShadowFilter:AI,BasicShadowFilter:QL,Break:pE,Const:Cw,Continue:()=>aT("continue").toStack(),DFGApprox:zC,D_GGX:FC,Discard:oT,EPSILON:ub,F_Schlick:SC,Fn:my,INFINITY:cb,If:vy,Loop:dE,NodeAccess:fv,NodeShaderStage:dv,NodeType:{BOOLEAN:"bool",INTEGER:"int",FLOAT:"float",VECTOR2:"vec2",VECTOR3:"vec3",VECTOR4:"vec4",MATRIX2:"mat2",MATRIX3:"mat3",MATRIX4:"mat4"},NodeUpdateType:pv,PCFShadowFilter:YL,PCFSoftShadowFilter:$L,PI:hb,PI2:Ab,PointShadowFilter:dI,Return:()=>aT("return").toStack(),Schlick_to_F0:jC,ScriptableNodeResources:hL,ShaderNode:uy,Stack:yy,Switch:(...e)=>Ov.Switch(...e),TBNViewMatrix:eM,VSMShadowFilter:KL,V_GGX_SmithCorrelated:BC,Var:Ew,abs:Lb,acesFilmicToneMapping:ZD,acos:Pb,add:Ox,addMethodChaining:Uv,addNodeElement:function(e){},agxToneMapping:nL,all:db,alphaT:rx,and:Wx,anisotropy:ix,anisotropyB:ax,anisotropyT:sx,any:pb,append:e=>yy(e),array:Rx,arrayBuffer:e=>cy(new Lv(e,"ArrayBuffer")),asin:Nb,assign:Nx,atan:Db,atan2:gw,atomicAdd:(e,t)=>DL(NL.ATOMIC_ADD,e,t),atomicAnd:(e,t)=>DL(NL.ATOMIC_AND,e,t),atomicFunc:DL,atomicLoad:e=>DL(NL.ATOMIC_LOAD,e,null),atomicMax:(e,t)=>DL(NL.ATOMIC_MAX,e,t),atomicMin:(e,t)=>DL(NL.ATOMIC_MIN,e,t),atomicOr:(e,t)=>DL(NL.ATOMIC_OR,e,t),atomicStore:(e,t)=>DL(NL.ATOMIC_STORE,e,t),atomicSub:(e,t)=>DL(NL.ATOMIC_SUB,e,t),atomicXor:(e,t)=>DL(NL.ATOMIC_XOR,e,t),attenuationColor:_x,attenuationDistance:gx,attribute:dT,attributeArray:(e,t="float")=>{let n,r;!0===t.isStruct?(n=t.layout.getLength(),r=iv("float")):(n=sv(t),r=iv(t));const i=new dD(e,n,r);return lE(i,t,e)},backgroundBlurriness:_D,backgroundIntensity:vD,backgroundRotation:yD,batch:sE,billboarding:UP,bitAnd:$x,bitNot:Kx,bitOr:Zx,bitXor:Jx,bitangentGeometry:QS,bitangentLocal:YS,bitangentView:$S,bitangentWorld:KS,bitcast:Hb,blendBurn:RD,blendColor:LD,blendDodge:ND,blendOverlay:DD,blendScreen:PD,blur:zR,bool:Sy,buffer:wT,bufferAttribute:Ww,bumpMap:oM,burn:(...e)=>RD(e),bvec2:Ry,bvec3:Ly,bvec4:Uy,bypass:tT,cache:Jw,call:Dx,cameraFar:NT,cameraIndex:CT,cameraNear:RT,cameraNormalMatrix:OT,cameraPosition:BT,cameraProjectionMatrix:PT,cameraProjectionMatrixInverse:DT,cameraViewMatrix:LT,cameraWorldMatrix:IT,cbrt:aw,cdl:VD,ceil:Tb,checker:TI,cineonToneMapping:$D,clamp:uw,clearcoat:$y,clearcoatRoughness:Ky,code:sL,color:xy,colorSpaceToWorking:Uw,colorToDirection:e=>cy(e).mul(2).sub(1),compute:Kw,computeSkinning:(e,t=null)=>{const n=new cE(e);return n.positionNode=lE(new Yr(e.geometry.getAttribute("position").array,3),"vec3").setPBO(!0).toReadOnly().element(KM).toVar(),n.skinIndexNode=lE(new Yr(new Uint32Array(e.geometry.getAttribute("skinIndex").array),4),"uvec4").setPBO(!0).toReadOnly().element(KM).toVar(),n.skinWeightNode=lE(new Yr(e.geometry.getAttribute("skinWeight").array,4),"vec4").setPBO(!0).toReadOnly().element(KM).toVar(),n.bindMatrixNode=Ex(e.bindMatrix,"mat4"),n.bindMatrixInverseNode=Ex(e.bindMatrixInverse,"mat4"),n.boneMatricesNode=wT(e.skeleton.boneMatrices,"mat4",e.skeleton.bones.length),n.toPositionNode=t,cy(n)},cond:xw,context:ww,convert:zy,convertColorSpace:(e,t,n)=>cy(new Ow(cy(e),t,n)),convertToTexture:(e,...t)=>e.isTextureNode?e:e.isPassNode?e.getTextureNode():lD(e,...t),cos:Cb,cross:ew,cubeTexture:IS,cubeTextureBase:LS,cubeToUV:hI,dFdx:Fb,dFdy:kb,dashSize:hx,debug:hT,decrement:sb,decrementBefore:rb,defaultBuildStages:gv,defaultShaderStages:mv,defined:oy,degrees:mb,deltaTime:LP,densityFog:function(e,t){return mL(e,fL(t))},densityFogFactor:fL,depth:QE,depthPass:(e,t,n)=>cy(new WD(WD.DEPTH,e,t,n)),difference:Zb,diffuseColor:Wy,directPointLight:bI,directionToColor:cC,dispersion:vx,distance:Kb,div
1:Fx,dodge:(...e)=>ND(e),dot:Jb,drawIndex:tE,dynamicBufferAttribute:Xw,element:Vy,emissive:Xy,equal:qx,equals:Wb,equirectUV:dC,exp:gb,exp2:_b,expression:aT,faceDirection:AS,faceForward:dw,faceforward:_w,float:by,floor:wb,fog:mL,fract:Mb,frameGroup:wx,frameId:IP,frontFacing:hS,fwidth:Gb,gain:(e,t)=>e.lessThan(.5)?MP(e.mul(2),t).div(2):Bx(1,MP(Ux(Bx(1,e),2),t).div(2)),gapSize:Ax,getConstNodeType:ly,getCurrentStack:_y,getDirection:FR,getDistanceAttenuation:xI,getGeometryRoughness:IC,getNormalFromDepth:hD,getParallaxCorrectNormal:WO,getRoughness:OC,getScreenPosition:cD,getShIrradianceAt:XO,getShadowMaterial:JL,getShadowRenderObjectFunction:nI,getTextureIndex:wP,getViewPosition:uD,globalId:TL,glsl:(e,t)=>sL(e,t,"glsl"),glslFn:(e,t)=>oL(e,t,"glsl"),grayscale:BD,greaterThan:Gx,greaterThanEqual:Hx,hash:SP,highpModelNormalViewMatrix:rS,highpModelViewMatrix:nS,hue:kD,increment:ib,incrementBefore:nb,instance:rE,instanceIndex:KM,instancedArray:(e,t="float")=>{let n,r;!0===t.isStruct?(n=t.layout.getLength(),r=iv("float")):(n=sv(t),r=iv(t));const i=new AD(e,n,r);return lE(i,t,e)},instancedBufferAttribute:Qw,instancedDynamicBufferAttribute:Yw,instancedMesh:iE,int:wy,inverseSqrt:bb,inversesqrt:vw,invocationLocalIndex:eE,invocationSubgroupIndex:JM,ior:px,iridescence:ex,iridescenceIOR:tx,iridescenceThickness:nx,ivec2:Ey,ivec3:Py,ivec4:Oy,js:(e,t)=>sL(e,t,"js"),label:Tw,length:Ob,lengthSq:ow,lessThan:zx,lessThanEqual:jx,lightPosition:UL,lightProjectionUV:BL,lightShadowMatrix:OL,lightTargetDirection:qL,lightTargetPosition:FL,lightViewPosition:kL,lightingContext:xE,lights:(e=[])=>cy(new jL).setLights(e),linearDepth:YE,linearToneMapping:QD,localId:SL,log:vb,log2:yb,logarithmicDepthToViewZ:(e,t,n)=>{const r=e.mul(vb(n.div(t)));return by(Math.E).pow(r).mul(t).negate()},loop:(...e)=>dE(...e),luminance:qD,mat2:Fy,mat3:ky,mat4:qy,matcapUV:TN,materialAO:WM,materialAlphaTest:cM,materialAnisotropy:RM,materialAnisotropyVector:XM,materialAttenuationColor:UM,materialAttenuationDistance:BM,materialClearcoat:wM,materialClearcoatNormal:SM,materialClearcoatRoughness:TM,materialColor:hM,materialDispersion:jM,materialEmissive:dM,materialEnvIntensity:MS,materialEnvRotation:ES,materialIOR:OM,materialIridescence:NM,materialIridescenceIOR:PM,materialIridescenceThickness:DM,materialLightMap:HM,materialLineDashOffset:zM,materialLineDashSize:kM,materialLineGapSize:qM,materialLineScale:FM,materialLineWidth:VM,materialMetalness:xM,materialNormal:bM,materialOpacity:pM,materialPointSize:GM,materialReference:qS,materialReflectivity:vM,materialRefractionRatio:SS,materialRotation:MM,materialRoughness:yM,materialSheen:EM,materialSheenRoughness:CM,materialShininess:AM,materialSpecular:fM,materialSpecularColor:gM,materialSpecularIntensity:mM,materialSpecularStrength:_M,materialThickness:IM,materialTransmission:LM,max:Qb,maxMipLevel:mT,mediumpModelViewMatrix:tS,metalness:Yy,min:Xb,mix:lw,mixElement:fw,mod:kx,modInt:ob,modelDirection:WT,modelNormalMatrix:ZT,modelPosition:QT,modelRadius:KT,modelScale:YT,modelViewMatrix:eS,modelViewPosition:$T,modelViewProjection:QM,modelWorldMatrix:XT,modelWorldMatrixInverse:JT,morphReference:_E,mrt:TP,mul:Ux,mx_aastep:GO,mx_cell_noise_float:(e=pT())=>_O(e.convert("vec2|vec3")),mx_contrast:(e,t=1,n=.5)=>by(e).sub(n).mul(t).add(n),mx_fractal_noise_float:(e=pT(),t=3,n=2,r=.5,i=1)=>TO(e,wy(t),n,r).mul(i),mx_fractal_noise_vec2:(e=pT(),t=3,n=2,r=.5,i=1)=>MO(e,wy(t),n,r).mul(i),mx_fractal_noise_vec3:(e=pT(),t=3,n=2,r=.5,i=1)=>SO(e,wy(t),n,r).mul(i),mx_fractal_noise_vec4:(e=pT(),t=3,n=2,r=.5,i=1)=>EO(e,wy(t),n,r).mul(i),mx_hsvtorgb:qO,mx_noise_float:(e=pT(),t=1,n=0)=>cO(e.convert("vec2|vec3")).mul(t).add(n),mx_noise_vec3:(e=pT(),t=1,n=0)=>dO(e.convert("vec2|vec3")).mul(t).add(n),mx_noise_vec4:(e=pT(),t=1,n=0)=>(e=e.convert("vec2|vec3"),Iy(dO(e),cO(e.add(My(19,73)))).mul(t).add(n)),mx_ramplr:(e,t,n=pT())=>jO(e,t,n,"x"),mx_ramptb:(e,t,n=pT())=>jO(e,t,n,"y"),mx_rgbtohsv:VO,mx_safepower:(e,t=1)=>(e=by(e)).abs().pow(t).mul(e.sign()),mx_splitlr:(e,t,n,r=pT())=>HO(e,t,n,r,"x"),mx_splittb:(e,t,n,r=pT())=>HO(e,t,n,r,"y"),mx_srgb_texture_to_lin_rec709:zO,mx_transform_uv:(e=1,t=0,n=pT())=>n.mul(e).add(t),mx_worley_noise_float:(e=pT(),t=1)=>OO(e.convert("vec2|vec3"),t,wy(1)),mx_worley_noise_vec2:(e=pT(),t=1)=>UO(e.convert("vec2|vec3"),t,wy(1)),mx_worley_noise_vec3:(e=pT(),t=1)=>kO(e.convert("vec2|vec3"),t,wy(1)),namespace:eT,negate:Bb,neutralToneMapping:rL,nodeArray:Ay,nodeImmutable:py,nodeObject:cy,nodeObjects:hy,nodeProxy:dy,normalFlat:fS,normalGeometry:dS,normalLocal:pS,normalMap:iM,normalView:mS,normalWorld:gS,normalize:Sb,not:Qx,notEqual:Vx,numWorkgroups:bL,objectDirection:kT,objectGroup:Sx,objectPosition:VT,objectRadius:jT,objectScale:zT,objectViewPosition:GT,objectWorldMatrix:qT,oneMinus:Ub,or:Xx,orthographicDepthToViewZ:(e,t,n)=>t.sub(n).mul(e).sub(t),oscSawtooth:(e=DP)=>
vendor: 4,264 bytes, line 1
1e.fract(),oscSine:(e=DP)=>e.add(.75).mul(2*Math.PI).sin().mul(.5).add(.5),oscSquare:(e=DP)=>e.fract().round(),oscTriangle:(e=DP)=>e.add(.5).fract().mul(2).sub(1).abs(),output:cx,outputStruct:bP,overlay:(...e)=>DD(e),overloadingFn:PP,parabola:MP,parallaxDirection:tM,parallaxUV:(e,t)=>e.sub(tM.mul(t)),parameter:(e,t)=>cy(new gP(e,t)),pass:(e,t,n)=>cy(new WD(WD.COLOR,e,t,n)),passTexture:(e,t)=>cy(new jD(e,t)),pcurve:(e,t,n)=>tw(Fx(tw(e,t),Ox(tw(e,t),tw(Bx(1,e),n))),1/t),perspectiveDepthToViewZ:HE,pmremTexture:hN,pointShadow:vI,pointUV:pD,pointWidth:dx,positionGeometry:iS,positionLocal:sS,positionPrevious:aS,positionView:uS,positionViewDirection:cS,positionWorld:oS,positionWorldDirection:lS,posterize:zD,pow:tw,pow2:nw,pow3:rw,pow4:iw,premult:ID,property:jy,radians:fb,rand:pw,range:vL,rangeFog:function(e,t,n){return mL(e,pL(t,n))},rangeFogFactor:pL,reciprocal:Vb,reference:US,referenceBuffer:FS,reflect:$b,reflectVector:NS,reflectView:CS,reflector:e=>cy(new tD(e)),refract:hw,refractVector:PS,refractView:RS,reinhardToneMapping:YD,remainder:ab,remap:rT,remapClamp:iT,renderGroup:Tx,renderOutput:uT,rendererReference:Vw,rotate:EN,rotateUV:OP,roughness:Qy,round:qb,rtt:lD,sRGBTransferEOTF:Dw,sRGBTransferOETF:Lw,sampler:e=>(!0===e.isNode?e:yT(e)).convert("sampler"),samplerComparison:e=>(!0===e.isNode?e:yT(e)).convert("samplerComparison"),saturate:cw,saturation:UD,screen:(...e)=>PD(e),screenCoordinate:CE,screenSize:EE,screenUV:ME,scriptable:AL,scriptableValue:lL,select:yw,setCurrentStack:gy,shaderStages:_v,shadow:uI,shadowPositionWorld:WL,shapeCircle:SI,sharedUniformGroup:bx,sheen:Zy,sheenRoughness:Jy,shiftLeft:eb,shiftRight:tb,shininess:ux,sign:Ib,sin:Eb,sinc:(e,t)=>Eb(hb.mul(t.mul(e).sub(1))).div(hb.mul(t.mul(e).sub(1))),skinning:hE,smoothstep:Aw,smoothstepElement:mw,specularColor:ox,specularF90:lx,spherizeUV:BP,split:(e,t)=>cy(new Cv(cy(e),t)),spritesheetUV:kP,sqrt:xb,stack:_P,step:Yb,storage:lE,storageBarrier:()=>EL("storage").toStack(),storageObject:(e,t,n)=>lE(e,t,n).setPBO(!0),storageTexture:xD,string:(e="")=>cy(new Lv(e,"string")),struct:(e,t=null)=>{const n=new vP(e,t),r=(...t)=>{let r=null;if(t.length>0)if(t[0].isNode){r={};const n=Object.keys(e);for(let e=0;e<t.length;e++)r[n[e]]=t[e]}else r=t[0];return cy(new yP(n,r))};return r.layout=n,r.isStruct=!0,r},sub:Bx,subgroupIndex:ZM,subgroupSize:ML,tan:Rb,tangentGeometry:VS,tangentLocal:zS,tangentView:GS,tangentWorld:jS,temp:Rw,texture:yT,texture3D:wD,textureBarrier:()=>EL("texture").toStack(),textureBicubic:lR,textureCubeUV:kR,textureLoad:xT,textureSize:fT,textureStore:(e,t,n)=>{const r=xD(e,t,n);return null!==n&&r.toStack(),r},thickness:mx,time:DP,timerDelta:(e=1)=>LP.mul(e),timerGlobal:(e=1)=>DP.mul(e),timerLocal:(e=1)=>DP.mul(e),toneMapping:Gw,toneMappingExposure:jw,toonOutlinePass:(e,t,n=new Gn(0,0,0),r=.003,i=1)=>cy(new XD(e,t,cy(n),cy(r),cy(i))),transformDirection:sw,transformNormal:xS,transformNormalToView:bS,transformedBentNormalView:nM,transformedBitangentView:ZS,transformedBitangentWorld:JS,transformedClearcoatNormalView:yS,transformedNormalView:_S,transformedNormalWorld:vS,transformedTangentView:HS,transformedTangentWorld:WS,transmission:fx,transpose:jb,triNoise3D:RP,triplanarTexture:(...e)=>qP(...e),triplanarTextures:qP,trunc:zb,tslFn:(...e)=>my(...e),uint:Ty,uniform:Ex,uniformArray:MT,uniformCubeTexture:(e=DS)=>LS(e),uniformGroup:xx,uniformTexture:(e=gT)=>yT(e),uniforms:(e,t)=>cy(new ST(e,t)),unpremult:OD,userData:(e,t,n)=>cy(new TD(e,t,n)),uv:pT,uvec2:Cy,uvec3:Dy,uvec4:By,varying:Nw,varyingProperty:Hy,vec2:My,vec3:Ny,vec4:Iy,vectorComponents:vv,velocity:CD,vertexColor:nC,vertexIndex:$M,vertexStage:Pw,vibrance:FD,viewZToLogarithmicDepth:WE,viewZToOrthographicDepth:GE,viewZToPerspectiveDepth:jE,viewport:RE,viewportBottomLeft:OE,viewportCoordinate:PE,viewportDepthTexture:VE,viewportLinearDepth:$E,viewportMipTexture:kE,viewportResolution:LE,viewportSafeUV:FP,viewportSharedTexture:uC,viewportSize:NE,viewportTexture:FE,viewportTopLeft:IE,viewportUV:DE,wgsl:(e,t)=>sL(e,t,"wgsl"),wgslFn:(e,t)=>oL(e,t,"wgsl"),workgroupArray:(e,t)=>cy(new RL("Workgroup",e,t)),workgroupBarrier:()=>EL("workgroup").toStack(),workgroupId:wL,workingToColorSpace:Bw,xor:Yx});const YO=new mP;class $O extends VN{constructor(e,t){super(),this.renderer=e,this.nodes=t}
vendor: 16,384 bytes, line 1
1update(e,t,n){const r=this.renderer,i=this.nodes.getBackgroundNode(e)||e.background;let s=!1;if(null===i)r._clearColor.getRGB(YO),YO.a=r._clearColor.a;else if(!0===i.isColor)i.getRGB(YO),YO.a=1,s=!0;else if(!0===i.isNode){const n=this.get(e),s=i;YO.copy(r._clearColor);let a=n.backgroundMesh;if(void 0===a){const e=ww(Iy(s).mul(vD),{getUV:()=>yD.mul(gS),getTextureLevel:()=>_D});let t=QM;t=t.setZ(t.w);const r=new rC;function o(){i.removeEventListener("dispose",o),a.material.dispose(),a.geometry.dispose()}r.name="Background.material",r.side=1,r.depthTest=!1,r.depthWrite=!1,r.allowOverride=!1,r.fog=!1,r.lights=!1,r.vertexNode=t,r.colorNode=e,n.backgroundMeshNode=e,n.backgroundMesh=a=new Tr(new Ms(1,32,32),r),a.frustumCulled=!1,a.name="Background.mesh",a.onBeforeRender=function(e,t,n){this.matrixWorld.copyPosition(n.matrixWorld)},i.addEventListener("dispose",o)}const o=s.getCacheKey();n.backgroundCacheKey!==o&&(n.backgroundMeshNode.node=Iy(s).mul(vD),n.backgroundMeshNode.needsUpdate=!0,a.material.needsUpdate=!0,n.backgroundCacheKey=o),t.unshift(a,a.geometry,a.material,0,0,null,null)}const a=r.xr.getEnvironmentBlendMode();if("additive"===a?YO.set(0,0,0,1):"alpha-blend"===a&&YO.set(0,0,0,0),!0===r.autoClear||!0===s){const e=n.clearColorValue;e.r=YO.r,e.g=YO.g,e.b=YO.b,e.a=YO.a,!0!==r.backend.isWebGLBackend&&!0!==r.alpha||(e.r*=e.a,e.g*=e.a,e.b*=e.a),n.depthClearValue=r._clearDepth,n.stencilClearValue=r._clearStencil,n.clearColor=!0===r.autoClearColor,n.clearDepth=!0===r.autoClearDepth,n.clearStencil=!0===r.autoClearStencil}else n.clearColor=!1,n.clearDepth=!1,n.clearStencil=!1}}let KO=0;class ZO{constructor(e="",t=[],n=0,r=[]){this.name=e,this.bindings=t,this.index=n,this.bindingsReference=r,this.id=KO++}}class JO{constructor(e,t,n,r,i,s,a,o,l,u=[]){this.vertexShader=e,this.fragmentShader=t,this.computeShader=n,this.transforms=u,this.nodeAttributes=r,this.bindings=i,this.updateNodes=s,this.updateBeforeNodes=a,this.updateAfterNodes=o,this.observer=l,this.usedTimes=0}createBindings(){const e=[];for(const t of this.bindings)if(!0!==t.bindings[0].groupNode.shared){const n=new ZO(t.name,[],t.index,t);e.push(n);for(const e of t.bindings)n.bindings.push(e.clone())}else e.push(t);return e}}class eB{constructor(e,t,n=null){this.isNodeAttribute=!0,this.name=e,this.type=t,this.node=n}}class tB{constructor(e,t,n){this.isNodeUniform=!0,this.name=e,this.type=t,this.node=n.getSelf()}get value(){return this.node.value}set value(e){this.node.value=e}get id(){return this.node.id}get groupNode(){return this.node.groupNode}}class nB{constructor(e,t,n=!1,r=null){this.isNodeVar=!0,this.name=e,this.type=t,this.readOnly=n,this.count=r}}class rB extends nB{constructor(e,t,n=null,r=null){super(e,t),this.needsInterpolation=!1,this.isNodeVarying=!0,this.interpolationType=n,this.interpolationSampling=r}}class iB{constructor(e,t,n=""){this.name=e,this.type=t,this.code=n,Object.defineProperty(this,"isNodeCode",{value:!0})}}let sB=0;class aB{constructor(e=null){this.id=sB++,this.nodesData=new WeakMap,this.parent=e}getData(e){let t=this.nodesData.get(e);return void 0===t&&null!==this.parent&&(t=this.parent.getData(e)),t}setData(e,t){this.nodesData.set(e,t)}}class oB{constructor(e,t){this.name=e,this.members=t,this.output=!1}}class lB{constructor(e,t){this.name=e,this.value=t,this.boundary=0,this.itemSize=0,this.offset=0}setValue(e){this.value=e}getValue(){return this.value}}class uB extends lB{constructor(e,t=0){super(e,t),this.isNumberUniform=!0,this.boundary=4,this.itemSize=1}}class cB extends lB{constructor(e,t=new Ye){super(e,t),this.isVector2Uniform=!0,this.boundary=8,this.itemSize=2}}class hB extends lB{constructor(e,t=new Ke){super(e,t),this.isVector3Uniform=!0,this.boundary=16,this.itemSize=3}}class AB extends lB{constructor(e,t=new vt){super(e,t),this.isVector4Uniform=!0,this.boundary=16,this.itemSize=4}}class dB extends lB{constructor(e,t=new Gn){super(e,t),this.isColorUniform=!0,this.boundary=16,this.itemSize=3}}class pB extends lB{constructor(e,t=new fa){super(e,t),this.isMatrix2Uniform=!0,this.boundary=8,this.itemSize=4}}class fB extends lB{constructor(e,t=new et){super(e,t),this.isMatrix3Uniform=!0,this.boundary=48,this.itemSize=12}}class mB extends lB{constructor(e,t=new $t){super(e,t),this.isMatrix4Uniform=!0,this.boundary=64,this.itemSize=16}}class gB extends uB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class _B extends cB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class vB extends hB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class yB extends AB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class xB extends dB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class bB extends pB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class wB extends fB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}class TB extends mB{constructor(e){super(e.name,e.value),this.nodeUniform=e}getValue(){return this.nodeUniform.value}getType(){return this.nodeUniform.type}}const SB=new WeakMap,MB=new Map([[Int8Array,"int"],[Int16Array,"int"],[Int32Array,"int"],[Uint8Array,"uint"],[Uint16Array,"uint"],[Uint32Array,"uint"],[Float32Array,"float"]]),EB=e=>/e/g.test(e)?String(e).replace(/\+/g,""):(e=Number(e))+(e%1?"":".0");class CB{constructor(e,t,n){this.object=e,this.material=e&&e.material||null,this.geometry=e&&e.geometry||null,this.renderer=t,this.parser=n,this.scene=null,this.camera=null,this.nodes=[],this.sequentialNodes=[],this.updateNodes=[],this.updateBeforeNodes=[],this.updateAfterNodes=[],this.hashNodes={},this.observer=null,this.lightsNode=null,this.environmentNode=null,this.fogNode=null,this.clippingContext=null,this.vertexShader=null,this.fragmentShader=null,this.computeShader=null,this.flowNodes={vertex:[],fragment:[],compute:[]},this.flowCode={vertex:"",fragment:"",compute:""},this.uniforms={vertex:[],fragment:[],compute:[],index:0},this.structs={vertex:[],fragment:[],compute:[],index:0},this.bindings={vertex:{},fragment:{},compute:{}},this.bindingsIndexes={},this.bindGroups=null,this.attributes=[],this.bufferAttributes=[],this.varyings=[],this.codes={},this.vars={},this.declarations={},this.flow={code:""},this.chaining=[],this.stack=_P(),this.stacks=[],this.tab="\t",this.currentFunctionNode=null,this.context={material:this.material},this.cache=new aB,this.globalCache=this.cache,this.flowsData=new WeakMap,this.shaderStage=null,this.buildStage=null}getBindGroupsCache(){let e=SB.get(this.renderer);return void 0===e&&(e=new BN,SB.set(this.renderer,e)),e}createRenderTarget(e,t,n){return new yt(e,t,n)}createCubeRenderTarget(e,t){return new pC(e,t)}includes(e){return this.nodes.includes(e)}getOutputStructName(){}_getBindGroup(e,t){const n=this.getBindGroupsCache(),r=[];let i,s=!0;for(const e of t)r.push(e),s=s&&!0!==e.groupNode.shared;return s?(i=n.get(r),void 0===i&&(i=new ZO(e,r,this.bindingsIndexes[e].group,r),n.set(r,i))):i=new ZO(e,r,this.bindingsIndexes[e].group,r),i}getBindGroupArray(e,t){const n=this.bindings[t];let r=n[e];return void 0===r&&(void 0===this.bindingsIndexes[e]&&(this.bindingsIndexes[e]={binding:0,group:Object.keys(this.bindingsIndexes).length}),n[e]=r=[]),r}getBindings(){let e=this.bindGroups;if(null===e){const t={},n=this.bindings;for(const e of _v)for(const r in n[e]){const i=n[e][r];(t[r]||(t[r]=[])).push(...i)}e=[];for(const n in t){const r=t[n],i=this._getBindGroup(n,r);e.push(i)}this.bindGroups=e}return e}sortBindingGroups(){const e=this.getBindings();e.sort(((e,t)=>e.bindings[0].groupNode.order-t.bindings[0].groupNode.order));for(let t=0;t<e.length;t++){const n=e[t];this.bindingsIndexes[n.name].group=t,n.index=t}}setHashNode(e,t){this.hashNodes[t]=e}addNode(e){!1===this.nodes.includes(e)&&(this.nodes.push(e),this.setHashNode(e,e.getHash(this)))}addSequentialNode(e){!1===this.sequentialNodes.includes(e)&&this.sequentialNodes.push(e)}buildUpdateNodes(){for(const e of this.nodes)e.getUpdateType()!==pv.NONE&&this.updateNodes.push(e.getSelf());for(const e of this.sequentialNodes){const t=e.getUpdateBeforeType(),n=e.getUpdateAfterType();t!==pv.NONE&&this.updateBeforeNodes.push(e.getSelf()),n!==pv.NONE&&this.updateAfterNodes.push(e.getSelf())}}get currentNode(){return this.chaining[this.chaining.length-1]}isFilteredTexture(e){return e.magFilter===x||e.magFilter===b||e.magFilter===y||e.magFilter===w||e.minFilter===x||e.minFilter===b||e.minFilter===y||e.minFilter===w}addChain(e){this.chaining.push(e)}removeChain(e){if(this.chaining.pop()!==e)throw new Error("NodeBuilder: Invalid node chaining!")}getMethod(e){return e}getNodeFromHash(e){return this.hashNodes[e]}addFlow(e,t){return this.flowNodes[e].push(t),t}setContext(e){this.context=e}getContext(){return this.context}getSharedContext(){return this.context,this.context}setCache(e){this.cache=e}getCache(){return this.cache}getCacheFromNode(e,t=!0){const n=this.getDataFromNode(e);return void 0===n.cache&&(n.cache=new aB(t?this.getCache():null)),n.cache}isAvailable(){return!1}getVertexIndex(){}getInstanceIndex(){}getDrawIndex(){}getFrontFacing(){}getFragCoord(){}isFlipY(){return!1}increaseUsage(e){const t=this.getDataFromNode(e);return t.usageCount=void 0===t.usageCount?1:t.usageCount+1,t.usageCount}generateTexture(){}generateTextureLod(){}generateArrayDeclaration(e,t){return this.getType(e)+"[ "+t+" ]"}generateArray(e,t,n=null){let r=this.generateArrayDeclaration(e,t)+"( ";for(let i=0;i<t;i++){const s=n?n[i]:null;r+=null!==s?s.build(this,e):this.generateConst(e),i<t-1&&(r+=", ")}return r+=" )",r}generateStruct(e,t,n=null){const r=[];for(const e of t){const{name:t,type:i}=e;n&&n[t]&&n[t].isNode?r.push(n[t].build(this,i)):r.push(this.generateConst(i))}return e+"( "+r.join(", ")+" )"}generateConst(e,t=null){if(null===t&&("float"===e||"int"===e||"uint"===e?t=0:"bool"===e?t=!1:"color"===e?t=new Gn:"vec2"===e?t=new Ye:"vec3"===e?t=new Ke:"vec4"===e&&(t=new vt)),"float"===e)return EB(t);if("int"===e)return`${Math.round(t)}`;if("uint"===e)return t>=0?`${Math.round(t)}u`:"0u";if("bool"===e)return t?"true":"false";if("color"===e)return`${this.getType("vec3")}( ${EB(t.r)}, ${EB(t.g)}, ${EB(t.b)} )`;const n=this.getTypeLength(e),r=this.getComponentType(e),i=e=>this.generateConst(r,e);if(2===n)return`${this.getType(e)}( ${i(t.x)}, ${i(t.y)} )`;if(3===n)return`${this.getType(e)}( ${i(t.x)}, ${i(t.y)}, ${i(t.z)} )`;if(4===n&&"mat2"!==e)return`${this.getType(e)}( ${i(t.x)}, ${i(t.y)}, ${i(t.z)}, ${i(t.w)} )`;if(n>=4&&t&&(t.isMatrix2||t.isMatrix3||t.isMatrix4))return`${this.getType(e)}( ${t.elements.map(i).join(", ")} )`;if(n>4)return`${this.getType(e)}()`;throw new Error(`NodeBuilder: Type '${e}' not found in generate constant attempt.`)}getType(e){return"color"===e?"vec3":e}hasGeometryAttribute(e){return this.geometry&&void 0!==this.geometry.getAttribute(e)}getAttribute(e,t){const n=this.attributes;for(const t of n)if(t.name===e)return t;const r=new eB(e,t);return this.registerDeclaration(r),n.push(r),r}getPropertyName(e){return e.name}isVector(e){return/vec\d/.test(e)}isMatrix(e){return/mat\d/.test(e)}isReference(e){return"void"===e||"property"===e||"sampler"===e||"samplerComparison"===e||"texture"===e||"cubeTexture"===e||"storageTexture"===e||"depthTexture"===e||"texture3D"===e}needsToWorkingColorSpace(){return!1}getComponentTypeFromTexture(e){const t=e.type;if(e.isDataTexture){if(t===C)return"int";if(t===R)return"uint"}return"float"}getElementType(e){return"mat2"===e?"vec2":"mat3"===e?"vec3":"mat4"===e?"vec4":this.getComponentType(e)}getComponentType(e){if("float"===(e=this.getVectorType(e))||"bool"===e||"int"===e||"uint"===e)return e;const t=/(b|i|u|)(vec|mat)([2-4])/.exec(e);return null===t?null:"b"===t[1]?"bool":"i"===t[1]?"int":"u"===t[1]?"uint":"float"}getVectorType(e){return"color"===e?"vec3":"texture"===e||"cubeTexture"===e||"storageTexture"===e||"texture3D"===e?"vec4":e}getTypeFromLength(e,t="float"){if(1===e)return t;let n=rv(e);const r="float"===t?"":t[0];return!0===/mat2/.test(t)&&(n=n.replace("vec","mat")),r+n}getTypeFromArray(e){return MB.get(e.constructor)}isInteger(e){return/int|uint|(i|u)vec/.test(e)}getTypeFromAttribute(e){let t=e;e.isInterleavedBufferAttribute&&(t=e.data);const n=t.array,r=e.itemSize,i=e.normalized;let s;return e instanceof rr||!0===i||(s=this.getTypeFromArray(n)),this.getTypeFromLength(r,s)}getTypeLength(e){const t=this.getVectorType(e),n=/vec([2-4])/.exec(t);return null!==n?Number(n[1]):"float"===t||"bool"===t||"int"===t||"uint"===t?1:!0===/mat2/.test(e)?4:!0===/mat3/.test(e)?9:!0===/mat4/.test(e)?16:0}getVectorFromMatrix(e){return e.replace("mat","vec")}changeComponentType(e,t){return this.getTypeFromLength(this.getTypeLength(e),t)}getIntegerType(e){const t=this.getComponentType(e);return"int"===t||"uint"===t?e:this.changeComponentType(e,"int")}addStack(){return this.stack=_P(this.stack),this.stacks.push(_y()||this.stack),gy(this.stack),this.stack}removeStack(){const e=this.stack;return this.stack=e.parent,gy(this.stacks.pop()),e}getDataFromNode(e,t=this.shaderStage,n=null){let r=(n=null===n?e.isGlobal(this)?this.globalCache:this.cache:n).getData(e);return void 0===r&&(r={},n.setData(e,r)),void 0===r[t]&&(r[t]={}),r[t]}getNodeProperties(e,t="any"){const n=this.getDataFromNode(e,t);return n.properties||(n.properties={outputNode:null})}getBufferAttributeFromNode(e,t){const n=this.getDataFromNode(e);let r=n.bufferAttribute;if(void 0===r){const i=this.uniforms.index++;r=new eB("nodeAttribute"+i,t,e),this.bufferAttributes.push(r),n.bufferAttribute=r}return r}getStructTypeFromNode(e,t,n=null,r=this.shaderStage){const i=this.getDataFromNode(e,r,this.globalCache);let s=i.structType;if(void 0===s){const e=this.structs.index++;null===n&&(n="StructType"+e),s=new oB(n,t),this.structs[r].push(s),i.structType=s}return s}getOutputStructTypeFromNode(e,t){const n=this.getStructTypeFromNode(e,t,"OutputType","fragment");return n.output=!0,n}getUniformFromNode(e,t,n=this.shaderStage,r=null){const i=this.getDataFromNode(e,n,this.globalCache);let s=i.uniform;if(void 0===s){const a=this.uniforms.index++;s=new tB(r||"nodeUniform"+a,t,e),this.uniforms[n].push(s),this.registerDeclaration(s),i.uniform=s}return s}getArrayCount(e){let t=null;return e.isArrayNode?t=e.count:e.isVarNode&&e.node.isArrayNode&&(t=e.node.count),t}getVarFromNode(e,t=null,n=e.getNodeType(this),r=this.shaderStage,i=!1){const s=this.getDataFromNode(e,r);let a=s.variable;if(void 0===a){const o=i?"_const":"_var",l=this.vars[r]||(this.vars[r]=[]),u=this.vars[o]||(this.vars[o]=0);null===t&&(t=(i?"nodeConst":"nodeVar")+u,this.vars[o]++);const c=this.getArrayCount(e);a=new nB(t,n,i,c),i||l.push(a),this.registerDeclaration(a),s.variable=a}return a}isDeterministic(e){if(e.isMathNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode))&&(!e.cNode||this.isDeterministic(e.cNode));if(e.isOperatorNode)return this.isDeterministic(e.aNode)&&(!e.bNode||this.isDeterministic(e.bNode));if(e.isArrayNode){if(null!==e.values)for(const t of e.values)if(!this.isDeterministic(t))return!1;return!0}return!!e.isConstNode}getVaryingFromNode(e,t=null,n=e.getNodeType(this),r=null,i=null){const s=this.getDataFromNode(e,"any");let a=s.varying;if(void 0===a){const e=this.varyings,o=e.length;null===t&&(t="nodeVarying"+o),a=new rB(t,n,r,i),e.push(a),this.registerDeclaration(a),s.varying=a}return a}get namespace(){return this.context.namespace}getOutputNamespace(){return this.getNamespace("outputNode")}getNamespace(e=""){const t=this.namespace;let n;return n=t?e?t+"_"+e:t:e,n}registerDeclaration(e){const t=this.shaderStage,n=this.declarations[t]||(this.declarations[t]={}),r=this.getPropertyName(e);let i=1,s=r;for(;void 0!==n[s];)s=r+"_"+i++;i>1&&(e.name=s),n[s]=e}getCodeFromNode(e,t,n=this.shaderStage){const r=this.getDataFromNode(e);let i=r.code;if(void 0===i){const e=this.codes[n]||(this.codes[n]=[]),s=e.length;i=new iB("nodeCode"+s,t),e.push(i),r.code=i
vendor: 5,625 bytes, line 1
1}return i}addFlowCodeHierarchy(e,t){const{flowCodes:n,flowCodeBlock:r}=this.getDataFromNode(e);let i=!0,s=t;for(;s;){if(!0===r.get(s)){i=!1;break}s=this.getDataFromNode(s).parentNodeBlock}if(i)for(const e of n)this.addLineFlowCode(e)}addLineFlowCodeBlock(e,t,n){const r=this.getDataFromNode(e),i=r.flowCodes||(r.flowCodes=[]),s=r.flowCodeBlock||(r.flowCodeBlock=new WeakMap);i.push(t),s.set(n,!0)}addLineFlowCode(e,t=null){return""===e||(null!==t&&this.context.nodeBlock&&this.addLineFlowCodeBlock(t,e,this.context.nodeBlock),e=this.tab+e,/;\s*$/.test(e)||(e+=";\n"),this.flow.code+=e),this}addFlowCode(e){return this.flow.code+=e,this}addFlowTab(){return this.tab+="\t",this}removeFlowTab(){return this.tab=this.tab.slice(0,-1),this}getFlowData(e){return this.flowsData.get(e)}flowNode(e){const t=e.getNodeType(this),n=this.flowChildNode(e,t);return this.flowsData.set(e,n),n}addInclude(e){null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(e)}buildFunctionNode(e){const t=new aL,n=this.currentFunctionNode;return this.currentFunctionNode=t,t.code=this.buildFunctionCode(e),this.currentFunctionNode=n,t}flowShaderNode(e){const t=e.layout,n={[Symbol.iterator](){let e=0;const t=Object.values(this);return{next:()=>({value:t[e],done:e++>=t.length})}}};for(const e of t.inputs)n[e.name]=new gP(e.type,e.name);e.layout=null;const r=e.call(n),i=this.flowStagesNode(r,t.type);return e.layout=t,i}flowStagesNode(e,t=null){const n=this.flow,r=this.vars,i=this.declarations,s=this.cache,a=this.buildStage,o=this.stack,l={code:""};this.flow=l,this.vars={},this.declarations={},this.cache=new aB,this.stack=_P();for(const n of gv)this.setBuildStage(n),l.result=e.build(this,t);return l.vars=this.getVars(this.shaderStage),this.flow=n,this.vars=r,this.declarations=i,this.cache=s,this.stack=o,this.setBuildStage(a),l}getFunctionOperator(){return null}buildFunctionCode(){}flowChildNode(e,t=null){const n=this.flow,r={code:""};return this.flow=r,r.result=e.build(this,t),this.flow=n,r}flowNodeFromShaderStage(e,t,n=null,r=null){const i=this.tab,s=this.cache,a=this.shaderStage,o=this.context;this.setShaderStage(e);const l={...this.context};delete l.nodeBlock,this.cache=this.globalCache,this.tab="\t",this.context=l;let u=null;if("generate"===this.buildStage){const i=this.flowChildNode(t,n);null!==r&&(i.code+=`${this.tab+r} = ${i.result};\n`),this.flowCode[e]=this.flowCode[e]+i.code,u=i}else u=t.build(this);return this.setShaderStage(a),this.cache=s,this.tab=i,this.context=o,u}getAttributesArray(){return this.attributes.concat(this.bufferAttributes)}getAttributes(){}getVaryings(){}getVar(e,t,n=null){return`${null!==n?this.generateArrayDeclaration(e,n):this.getType(e)} ${t}`}getVars(e){let t="";const n=this.vars[e];if(void 0!==n)for(const e of n)t+=`${this.getVar(e.type,e.name)}; `;return t}getUniforms(){}getCodes(e){const t=this.codes[e];let n="";if(void 0!==t)for(const e of t)n+=e.code+"\n";return n}getHash(){return this.vertexShader+this.fragmentShader+this.computeShader}setShaderStage(e){this.shaderStage=e}getShaderStage(){return this.shaderStage}setBuildStage(e){this.buildStage=e}getBuildStage(){return this.buildStage}buildCode(){}build(){const{object:e,material:t,renderer:n}=this;if(null!==t){let e=n.library.fromMaterial(t);null===e&&(e=new rC),e.build(this)}else this.addFlow("compute",e);for(const e of gv){this.setBuildStage(e),this.context.vertex&&this.context.vertex.isNode&&this.flowNodeFromShaderStage("vertex",this.context.vertex);for(const t of _v){this.setShaderStage(t);const n=this.flowNodes[t];for(const t of n)"generate"===e?this.flowNode(t):t.build(this)}}return this.setBuildStage(null),this.setShaderStage(null),this.buildCode(),this.buildUpdateNodes(),this}getNodeUniform(e,t){if("float"===t||"int"===t||"uint"===t)return new gB(e);if("vec2"===t||"ivec2"===t||"uvec2"===t)return new _B(e);if("vec3"===t||"ivec3"===t||"uvec3"===t)return new vB(e);if("vec4"===t||"ivec4"===t||"uvec4"===t)return new yB(e);if("color"===t)return new xB(e);if("mat2"===t)return new bB(e);if("mat3"===t)return new wB(e);if("mat4"===t)return new TB(e);throw new Error(`Uniform "${t}" not declared.`)}format(e,t,n){if((t=this.getVectorType(t))===(n=this.getVectorType(n))||null===n||this.isReference(n))return e;const r=this.getTypeLength(t),i=this.getTypeLength(n);return 16===r&&9===i?`${this.getType(n)}( ${e}[ 0 ].xyz, ${e}[ 1 ].xyz, ${e}[ 2 ].xyz )`:9===r&&4===i?`${this.getType(n)}( ${e}[ 0 ].xy, ${e}[ 1 ].xy )`:r>4||i>4||0===i?e:r===i?`${this.getType(n)}( ${e} )`:r>i?(e="bool"===n?`all( ${e} )`:`${e}.${"xyz".slice(0,i)}`,this.format(e,this.getTypeFromLength(i,this.getComponentType(t)),n)):4===i&&r>1?`${this.getType(n)}( ${this.format(e,t,"vec3")}, 1.0 )`:2===r?`${this.getType(n)}( ${this.format(e,t,"vec2")}, 0.0 )`:(1===r&&i>1&&t!==this.getComponentType(n)&&(e=`${this.getType(this.getComponentType(n))}( ${e} )`),`${this.getType(n)}( ${e} )`)}getSignature(){return"// Three.js r177 - Node System\n"}*[Symbol.iterator](){}createNodeMaterial(e="NodeMaterial"){throw new Error(`THREE.NodeBuilder: createNodeMaterial() was deprecated. Use new ${e}() instead.`)}}class RB{constructor(){this.time=0,this.deltaTime=0,this.frameId=0,this.renderId=0,this.updateMap=new WeakMap,this.updateBeforeMap=new WeakMap,this.updateAfterMap=new WeakMap,this.renderer=null,this.material=null,this.camera=null,this.object=null,this.scene=null}_getMaps(e,t){let n=e.get(t);return void 0===n&&(n={renderMap:new WeakMap,frameMap:new WeakMap},e.set(t,n)),n}updateBeforeNode(e){const t=e.getUpdateBeforeType(),n=e.updateReference(this);if(t===pv.FRAME){const{frameMap:t}=this._getMaps(this.updateBeforeMap,n);
1t.get(n)!==this.frameId&&!1!==e.updateBefore(this)&&t.set(n,this.frameId)}else if(t===pv.RENDER){const{renderMap:t}=this._getMaps(this.updateBeforeMap,n);t.get(n)!==this.renderId&&!1!==e.updateBefore(this)&&t.set(n,this.renderId)}else t===pv.OBJECT&&e.updateBefore(this)}updateAfterNode(e){const t=e.getUpdateAfterType(),n=e.updateReference(this);if(t===pv.FRAME){const{frameMap:t}=this._getMaps(this.updateAfterMap,n);t.get(n)!==this.frameId&&!1!==e.updateAfter(this)&&t.set(n,this.frameId)}else if(t===pv.RENDER){const{renderMap:t}=this._getMaps(this.updateAfterMap,n);t.get(n)!==this.renderId&&!1!==e.updateAfter(this)&&t.set(n,this.renderId)}else t===pv.OBJECT&&e.updateAfter(this)}updateNode(e){const t=e.getUpdateType(),n=e.updateReference(this);if(t===pv.FRAME){const{frameMap:t}=this._getMaps(this.updateMap,n);t.get(n)!==this.frameId&&!1!==e.update(this)&&t.set(n,this.frameId)}else if(t===pv.RENDER){const{renderMap:t}=this._getMaps(this.updateMap,n);t.get(n)!==this.renderId&&!1!==e.update(this)&&t.set(n,this.renderId)}else t===pv.OBJECT&&e.update(this)}update(){this.frameId++,void 0===this.lastTime&&(this.lastTime=performance.now()),this.deltaTime=(performance.now()-this.lastTime)/1e3,this.lastTime=performance.now(),this.time+=this.deltaTime}}class NB{constructor(e,t,n=null,r="",i=!1){this.type=e,this.name=t,this.count=n,this.qualifier=r,this.isConst=i}}NB.isNodeFunctionInput=!0;class PB extends yI{static get type(){return"DirectionalLightNode"}constructor(e=null){super(e)}setupDirect(){const e=this.colorNode;return{lightDirection:qL(this.light),lightColor:e}}}const DB=new $t,LB=new $t;let IB=null;class OB extends yI{static get type(){return"RectAreaLightNode"}constructor(e=null){super(e),this.halfHeight=Ex(new Ke).setGroup(Tx),this.halfWidth=Ex(new Ke).setGroup(Tx),this.updateType=pv.RENDER}update(e){super.update(e);const{light:t}=this,n=e.camera.matrixWorldInverse;LB.identity(),DB.copy(t.matrixWorld),DB.premultiply(n),LB.extractRotation(DB),this.halfWidth.value.set(.5*t.width,0,0),this.halfHeight.value.set(0,.5*t.height,0),this.halfWidth.value.applyMatrix4(LB),this.halfHeight.value.applyMatrix4(LB)}setupDirectRectArea(e){let t,n;e.isAvailable("float32Filterable")?(t=yT(IB.LTC_FLOAT_1),n=yT(IB.LTC_FLOAT_2)):(t=yT(IB.LTC_HALF_1),n=yT(IB.LTC_HALF_2));const{colorNode:r,light:i}=this;return{lightColor:r,lightPosition:kL(i),halfWidth:this.halfWidth,halfHeight:this.halfHeight,ltc_1:t,ltc_2:n}}static setLTC(e){IB=e}}class BB extends yI{static get type(){return"SpotLightNode"}constructor(e=null){super(e),this.coneCosNode=Ex(0).setGroup(Tx),this.penumbraCosNode=Ex(0).setGroup(Tx),this.cutoffDistanceNode=Ex(0).setGroup(Tx),this.decayExponentNode=Ex(0).setGroup(Tx),this.colorNode=Ex(this.color).setGroup(Tx)}update(e){super.update(e);const{light:t}=this;this.coneCosNode.value=Math.cos(t.angle),this.penumbraCosNode.value=Math.cos(t.angle*(1-t.penumbra)),this.cutoffDistanceNode.value=t.distance,this.decayExponentNode.value=t.decay}getSpotAttenuation(e,t){const{coneCosNode:n,penumbraCosNode:r}=this;return Aw(n,r,t)}getLightCoord(e){const t=e.getNodeProperties(this);let n=t.projectionUV;return void 0===n&&(n=BL(this.light,e.context.positionWorld),t.projectionUV=n),n}setupDirect(e){const{colorNode:t,cutoffDistanceNode:n,decayExponentNode:r,light:i}=this,s=this.getLightVector(e),a=s.normalize(),o=a.dot(qL(i)),l=this.getSpotAttenuation(e,o),u=s.length(),c=xI({lightDistance:u,cutoffDistance:n,decayExponent:r});let h,A,d=t.mul(l).mul(c);return i.colorNode?(A=this.getLightCoord(e),h=i.colorNode(A)):i.map&&(A=this.getLightCoord(e),h=yT(i.map,A.xy).onRenderUpdate((()=>i.map))),h&&(d=A.mul(2).sub(1).abs().lessThan(1).all().select(d.mul(h),d)),{lightColor:d,lightDirection:a}}}class UB extends BB{static get type(){return"IESSpotLightNode"}getSpotAttenuation(e,t){const n=this.light.iesMap;let r=null;if(n&&!0===n.isTexture){const e=t.acos().mul(1/Math.PI);r=yT(n,My(e,0),0).r}else r=super.getSpotAttenuation(t);return r}}const FB=my((([e,t])=>{const n=e.abs().sub(t);return Ob(Qb(n,0)).add(Xb(Qb(n.x,n.y),0))}));class kB extends BB{static get type(){return"ProjectorLightNode"}update(e){super.update(e);const t=this.light;if(this.penumbraCosNode.value=Math.min(Math.cos(t.angle*(1-t.penumbra)),.99999),null===t.aspect){let e=1;null!==t.map&&(e=t.map.width/t.map.height),t.shadow.aspect=e}else t.shadow.aspect=t.aspect}getSpotAttenuation(e){const t=this.penumbraCosNode,n=this.getLightCoord(e),r=n.xyz.div(n.w),i=FB(r.xy.sub(My(.5)),My(.5)),s=Fx(-1,Bx(1,Pb(t)).sub(1));return cw(i.mul(-2).mul(s))}}class qB extends yI{static get type(){return"AmbientLightNode"}constructor(e=null){super(e)}setup({context:e}){e.irradiance.addAssign(this.colorNode)}}class VB extends yI{static get type(){return"HemisphereLightNode"}constructor(e=null){super(e),this.lightPositionNode=UL(e),this.lightDirectionNode=this.lightPositionNode.normalize(),this.groundColorNode=Ex(new Gn).setGroup(Tx)}update(e){const{light:t}=this;super.update(e),this.lightPositionNode.object3d=t,this.groundColorNode.value.copy(t.groundColor).multiplyScalar(t.intensity)}setup(e){const{colorNode:t,groundColorNode:n,lightDirectionNode:r}=this,i=gS.dot(r).mul(.5).add(.5),s=lw(n,t,i);
vendor: 3,963 bytes, line 1
1e.context.irradiance.addAssign(s)}}class zB extends yI{static get type(){return"LightProbeNode"}constructor(e=null){super(e);const t=[];for(let e=0;e<9;e++)t.push(new Ke);this.lightProbe=MT(t)}update(e){const{light:t}=this;super.update(e);for(let e=0;e<9;e++)this.lightProbe.array[e].copy(t.sh.coefficients[e]).multiplyScalar(t.intensity)}setup(e){const t=XO(gS,this.lightProbe);e.context.irradiance.addAssign(t)}}class GB{parseFunction(){}}class jB{constructor(e,t,n="",r=""){this.type=e,this.inputs=t,this.name=n,this.precision=r}getCode(){}}jB.isNodeFunction=!0;const HB=/^\s*(highp|mediump|lowp)?\s*([a-z_0-9]+)\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)/i,WB=/[a-z_0-9]+/gi;class XB extends jB{constructor(e){const{type:t,inputs:n,name:r,precision:i,inputsCode:s,blockCode:a,headerCode:o}=(e=>{const t=(e=e.trim()).indexOf("#pragma main"),n=-1!==t?e.slice(t+12):e,r=n.match(HB);if(null!==r&&5===r.length){const i=r[4],s=[];let a=null;for(;null!==(a=WB.exec(i));)s.push(a);const o=[];let l=0;for(;l<s.length;){const e="const"===s[l][0];!0===e&&l++;let t=s[l][0];"in"===t||"out"===t||"inout"===t?l++:t="";const n=s[l++][0];let r=Number.parseInt(s[l][0]);!1===Number.isNaN(r)?l++:r=null;const i=s[l++][0];o.push(new NB(n,i,r,t,e))}const u=n.substring(r[0].length),c=void 0!==r[3]?r[3]:"";return{type:r[2],inputs:o,name:c,precision:void 0!==r[1]?r[1]:"",inputsCode:i,blockCode:u,headerCode:-1!==t?e.slice(0,t):""}}throw new Error("FunctionNode: Function is not a GLSL code.")})(e);super(t,n,r,i),this.inputsCode=s,this.blockCode=a,this.headerCode=o}getCode(e=this.name){let t;const n=this.blockCode;if(""!==n){const{type:r,inputsCode:i,headerCode:s,precision:a}=this;let o=`${r} ${e} ( ${i.trim()} )`;""!==a&&(o=`${a} ${o}`),t=s+o+n}else t="";return t}}class QB extends GB{parseFunction(e){return new XB(e)}}const YB=new WeakMap,$B=[],KB=[];class ZB extends VN{constructor(e,t){super(),this.renderer=e,this.backend=t,this.nodeFrame=new RB,this.nodeBuilderCache=new Map,this.callHashCache=new BN,this.groupsData=new BN,this.cacheLib={}}updateGroup(e){const t=e.groupNode,n=t.name;if(n===Sx.name)return!0;if(n===Tx.name){const t=this.get(e),n=this.nodeFrame.renderId;return t.renderId!==n&&(t.renderId=n,!0)}if(n===wx.name){const t=this.get(e),n=this.nodeFrame.frameId;return t.frameId!==n&&(t.frameId=n,!0)}$B[0]=t,$B[1]=e;let r=this.groupsData.get($B);return void 0===r&&this.groupsData.set($B,r={}),$B.length=0,r.version!==t.version&&(r.version=t.version,!0)}getForRenderCacheKey(e){return e.initialCacheKey}getForRender(e){const t=this.get(e);let n=t.nodeBuilderState;if(void 0===n){const{nodeBuilderCache:r}=this,i=this.getForRenderCacheKey(e);if(n=r.get(i),void 0===n){const t=this.backend.createNodeBuilder(e.object,this.renderer);t.scene=e.scene,t.material=e.material,t.camera=e.camera,t.context.material=e.material,t.lightsNode=e.lightsNode,t.environmentNode=this.getEnvironmentNode(e.scene),t.fogNode=this.getFogNode(e.scene),t.clippingContext=e.clippingContext,this.renderer.getOutputRenderTarget()&&this.renderer.getOutputRenderTarget().multiview&&t.enableMultiview(),t.build(),n=this._createNodeBuilderState(t),r.set(i,n)}n.usedTimes++,t.nodeBuilderState=n}return n}delete(e){if(e.isRenderObject){const t=this.get(e).nodeBuilderState;t.usedTimes--,0===t.usedTimes&&this.nodeBuilderCache.delete(this.getForRenderCacheKey(e))}return super.delete(e)}getForCompute(e){const t=this.get(e);let n=t.nodeBuilderState;if(void 0===n){const r=this.backend.createNodeBuilder(e,this.renderer);r.build(),n=this._createNodeBuilderState(r),t.nodeBuilderState=n}return n}_createNodeBuilderState(e){return new JO(e.vertexShader,e.fragmentShader,e.computeShader,e.getAttributesArray(),e.getBindings(),e.updateNodes,e.updateBeforeNodes,e.updateAfterNodes,e.observer,e.transforms)}getEnvironmentNode(e){this.updateEnvironment(e);let t=null;if(e.environmentNode&&e.environmentNode.isNode)t=e.environmentNode;else{const n=this.get(e);n.environmentNode&&(t=n.environmentNode)}return t}
vendor: 5,294 bytes, line 1
1getBackgroundNode(e){this.updateBackground(e);let t=null;if(e.backgroundNode&&e.backgroundNode.isNode)t=e.backgroundNode;else{const n=this.get(e);n.backgroundNode&&(t=n.backgroundNode)}return t}getFogNode(e){return this.updateFog(e),e.fogNode||this.get(e).fogNode||null}getCacheKey(e,t){$B[0]=e,$B[1]=t;const n=this.renderer.info.calls,r=this.callHashCache.get($B)||{};if(r.callId!==n){const i=this.getEnvironmentNode(e),s=this.getFogNode(e);t&&KB.push(t.getCacheKey(!0)),i&&KB.push(i.getCacheKey()),s&&KB.push(s.getCacheKey()),KB.push(this.renderer.getOutputRenderTarget()&&this.renderer.getOutputRenderTarget().multiview?1:0),KB.push(this.renderer.shadowMap.enabled?1:0),r.callId=n,r.cacheKey=K_(KB),this.callHashCache.set($B,r),KB.length=0}return $B.length=0,r.cacheKey}get isToneMappingState(){return!this.renderer.getRenderTarget()}updateBackground(e){const t=this.get(e),n=e.background;if(n){const r=0===e.backgroundBlurriness&&t.backgroundBlurriness>0||e.backgroundBlurriness>0&&0===t.backgroundBlurriness;if(t.background!==n||r){const i=this.getCacheNode("background",n,(()=>{if(!0===n.isCubeTexture||n.mapping===A||n.mapping===d||n.mapping===p){if(e.backgroundBlurriness>0||n.mapping===p)return hN(n);{let e;return e=!0===n.isCubeTexture?IS(n):yT(n),_C(e)}}if(!0===n.isTexture)return yT(n,ME.flipY()).setUpdateMatrix(!0);n.isColor}),r);t.backgroundNode=i,t.background=n,t.backgroundBlurriness=e.backgroundBlurriness}}else t.backgroundNode&&(delete t.backgroundNode,delete t.background)}getCacheNode(e,t,n,r=!1){const i=this.cacheLib[e]||(this.cacheLib[e]=new WeakMap);let s=i.get(t);return(void 0===s||r)&&(s=n(),i.set(t,s)),s}updateFog(e){const t=this.get(e),n=e.fog;if(n){if(t.fog!==n){const e=this.getCacheNode("fog",n,(()=>{if(n.isFogExp2){const e=US("color","color",n).setGroup(Tx),t=US("density","float",n).setGroup(Tx);return mL(e,fL(t))}if(n.isFog){const e=US("color","color",n).setGroup(Tx),t=US("near","float",n).setGroup(Tx),r=US("far","float",n).setGroup(Tx);return mL(e,pL(t,r))}}));t.fogNode=e,t.fog=n}}else delete t.fogNode,delete t.fog}updateEnvironment(e){const t=this.get(e),n=e.environment;if(n){if(t.environment!==n){const e=this.getCacheNode("environment",n,(()=>!0===n.isCubeTexture?IS(n):!0===n.isTexture?yT(n):void 0));t.environmentNode=e,t.environment=n}}else t.environmentNode&&(delete t.environmentNode,delete t.environment)}getNodeFrame(e=this.renderer,t=null,n=null,r=null,i=null){const s=this.nodeFrame;return s.renderer=e,s.scene=t,s.object=n,s.camera=r,s.material=i,s}getNodeFrameForRender(e){return this.getNodeFrame(e.renderer,e.scene,e.object,e.camera,e.material)}getOutputCacheKey(){const e=this.renderer;return e.toneMapping+","+e.currentColorSpace+","+e.xr.isPresenting}hasOutputChange(e){return YB.get(e)!==this.getOutputCacheKey()}getOutputNode(e){const t=this.renderer,n=this.getOutputCacheKey(),r=e.isArrayTexture?wD(e,Ny(ME,ET("gl_ViewID_OVR"))).renderOutput(t.toneMapping,t.currentColorSpace):yT(e,ME).renderOutput(t.toneMapping,t.currentColorSpace);return YB.set(e,n),r}updateBefore(e){const t=e.getNodeBuilderState();for(const n of t.updateBeforeNodes)this.getNodeFrameForRender(e).updateBeforeNode(n)}updateAfter(e){const t=e.getNodeBuilderState();for(const n of t.updateAfterNodes)this.getNodeFrameForRender(e).updateAfterNode(n)}updateForCompute(e){const t=this.getNodeFrame(),n=this.getForCompute(e);for(const e of n.updateNodes)t.updateNode(e)}updateForRender(e){const t=this.getNodeFrameForRender(e),n=e.getNodeBuilderState();for(const e of n.updateNodes)t.updateNode(e)}needsRefresh(e){const t=this.getNodeFrameForRender(e);return e.getMonitor().needsRefresh(e,t)}dispose(){super.dispose(),this.nodeFrame=new RB,this.nodeBuilderCache=new Map,this.cacheLib={}}}const JB=new Jr;class eU{constructor(e=null){this.version=0,this.clipIntersection=null,this.cacheKey="",this.shadowPass=!1,this.viewNormalMatrix=new et,this.clippingGroupContexts=new WeakMap,this.intersectionPlanes=[],this.unionPlanes=[],this.parentVersion=null,null!==e&&(this.viewNormalMatrix=e.viewNormalMatrix,this.clippingGroupContexts=e.clippingGroupContexts,this.shadowPass=e.shadowPass,this.viewMatrix=e.viewMatrix)}projectPlanes(e,t,n){const r=e.length;for(let i=0;i<r;i++){JB.copy(e[i]).applyMatrix4(this.viewMatrix,this.viewNormalMatrix);const r=t[n+i],s=JB.normal;r.x=-s.x,r.y=-s.y,r.z=-s.z,r.w=JB.constant}}updateGlobal(e,t){this.shadowPass=null!==e.overrideMaterial&&e.overrideMaterial.isShadowPassMaterial,this.viewMatrix=t.matrixWorldInverse,this.viewNormalMatrix.getNormalMatrix(this.viewMatrix)}update(e,t){let n=!1;e.version!==this.parentVersion&&(this.intersectionPlanes=Array.from(e.intersectionPlanes),this.unionPlanes=Array.from(e.unionPlanes),this.parentVersion=e.version),this.clipIntersection!==t.clipIntersection&&(this.clipIntersection=t.clipIntersection,this.clipIntersection?this.unionPlanes.length=e.unionPlanes.length:this.intersectionPlanes.length=e.intersectionPlanes.length);const r=t.clippingPlanes,i=r.length;let s,a;if(this.clipIntersection?(s=this.intersectionPlanes,a=e.intersectionPlanes.length):(s=this.unionPlanes,a=e.unionPlanes.length),s.length!==a+i){s.length=a+i;for(let e=0;e<i;e++)s[a+e]=new vt;n=!0}this.projectPlanes(r,s,a),n&&(this.version++,this.cacheKey=`${this.intersectionPlanes.length}:${this.unionPlanes.length}`)}
vendor: 15,710 bytes, line 1
1getGroupContext(e){if(this.shadowPass&&!e.clipShadows)return this;let t=this.clippingGroupContexts.get(e);return void 0===t&&(t=new eU(this),this.clippingGroupContexts.set(e,t)),t.update(this,e),t}get unionClippingCount(){return this.unionPlanes.length}}class tU{constructor(e,t){this.bundleGroup=e,this.camera=t}}const nU=[];class rU{constructor(){this.bundles=new BN}get(e,t){const n=this.bundles;nU[0]=e,nU[1]=t;let r=n.get(nU);return void 0===r&&(r=new tU(e,t),n.set(nU,r)),nU.length=0,r}dispose(){this.bundles=new BN}}class iU{constructor(){this.lightNodes=new WeakMap,this.materialNodes=new Map,this.toneMappingNodes=new Map}fromMaterial(e){if(e.isNodeMaterial)return e;let t=null;const n=this.getMaterialNodeClass(e.type);if(null!==n){t=new n;for(const n in e)t[n]=e[n]}return t}addToneMapping(e,t){this.addType(e,t,this.toneMappingNodes)}getToneMappingFunction(e){return this.toneMappingNodes.get(e)||null}getMaterialNodeClass(e){return this.materialNodes.get(e)||null}addMaterial(e,t){this.addType(e,t,this.materialNodes)}getLightNodeClass(e){return this.lightNodes.get(e)||null}addLight(e,t){this.addClass(e,t,this.lightNodes)}addType(e,t,n){if(n.has(t));else{if("function"!=typeof e)throw new Error(`Node class ${e.name} is not a class.`);if("function"==typeof t||"object"==typeof t)throw new Error(`Base class ${t} is not a class.`);n.set(t,e)}}addClass(e,t,n){if(n.has(t));else{if("function"!=typeof e)throw new Error(`Node class ${e.name} is not a class.`);if("function"!=typeof t)throw new Error(`Base class ${t.name} is not a class.`);n.set(t,e)}}}const sU=new jL,aU=[];class oU extends BN{constructor(){super()}createNode(e=[]){return(new jL).setLights(e)}getNode(e,t){if(e.isQuadMesh)return sU;aU[0]=e,aU[1]=t;let n=this.get(aU);return void 0===n&&(n=this.createNode(),this.set(aU,n)),aU.length=0,n}}class lU extends yt{constructor(e=1,t=1,n={}){super(e,t,n),this.isXRRenderTarget=!0,this.hasExternalTextures=!1,this.autoAllocateDepthBuffer=!0}copy(e){return super.copy(e),this.hasExternalTextures=e.hasExternalTextures,this.autoAllocateDepthBuffer=e.autoAllocateDepthBuffer,this}}const uU=new Ke,cU=new Ke;class hU extends Ue{constructor(e,t=!1){super(),this.enabled=!1,this.isPresenting=!1,this.cameraAutoUpdate=!0,this._renderer=e,this._cameraL=new Br,this._cameraL.viewport=new vt,this._cameraR=new Br,this._cameraR.viewport=new vt,this._cameras=[this._cameraL,this._cameraR],this._cameraXR=new oa,this._currentDepthNear=null,this._currentDepthFar=null,this._controllers=[],this._controllerInputSources=[],this._xrRenderTarget=null,this._layers=[],this._supportsLayers=!1,this._frameBufferTargets=null,this._createXRLayer=mU.bind(this),this._gl=null,this._currentAnimationContext=null,this._currentAnimationLoop=null,this._currentPixelRatio=null,this._currentSize=new Ye,this._onSessionEvent=dU.bind(this),this._onSessionEnd=pU.bind(this),this._onInputSourcesChange=fU.bind(this),this._onAnimationFrame=gU.bind(this),this._referenceSpace=null,this._referenceSpaceType="local-floor",this._customReferenceSpace=null,this._framebufferScaleFactor=1,this._foveation=1,this._session=null,this._glBaseLayer=null,this._glBinding=null,this._glProjLayer=null,this._xrFrame=null,this._useLayers="undefined"!=typeof XRWebGLBinding&&"createProjectionLayer"in XRWebGLBinding.prototype,this._useMultiviewIfPossible=t,this._useMultiview=!1}getController(e){return this._getController(e).getTargetRaySpace()}getControllerGrip(e){return this._getController(e).getGripSpace()}getHand(e){return this._getController(e).getHandSpace()}getFoveation(){if(null!==this._glProjLayer||null!==this._glBaseLayer)return this._foveation}setFoveation(e){this._foveation=e,null!==this._glProjLayer&&(this._glProjLayer.fixedFoveation=e),null!==this._glBaseLayer&&void 0!==this._glBaseLayer.fixedFoveation&&(this._glBaseLayer.fixedFoveation=e)}getFramebufferScaleFactor(){return this._framebufferScaleFactor}setFramebufferScaleFactor(e){this._framebufferScaleFactor=e,this.isPresenting}getReferenceSpaceType(){return this._referenceSpaceType}setReferenceSpaceType(e){this._referenceSpaceType=e,this.isPresenting}getReferenceSpace(){return this._customReferenceSpace||this._referenceSpace}setReferenceSpace(e){this._customReferenceSpace=e}getCamera(){return this._cameraXR}getEnvironmentBlendMode(){if(null!==this._session)return this._session.environmentBlendMode}getFrame(){return this._xrFrame}useMultiview(){return this._useMultiview}createQuadLayer(e,t,n,r,i,s,l,u={}){const c=new Ss(e,t),h=new lU(i,s,{format:F,type:T,depthTexture:new Mi(i,s,u.stencil?I:R,void 0,void 0,void 0,void 0,void 0,void 0,u.stencil?q:k),stencilBuffer:u.stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1});h.autoAllocateDepthBuffer=!0;const A=new Xn({color:16777215,side:0});A.map=h.texture,A.map.offset.y=1,A.map.repeat.y=-1;const d=new Tr(c,A);d.position.copy(n),d.quaternion.copy(r);const p={type:"quad",width:e,height:t,translation:n,quaternion:r,pixelwidth:i,pixelheight:s,plane:d,material:A,rendercall:l,renderTarget:h};if(this._layers.push(p),null!==this._session){p.plane.material=new Xn({color:16777215,side:0}),p.plane.material.blending=5,p.plane.material.blendEquation=a,p.plane.material.blendSrc=o,p.plane.material.blendDst=o,p.xrlayer=this._createXRLayer(p);const e=this._session.renderState.layers;e.unshift(p.xrlayer),this._session.updateRenderState({layers:e})}else h.isXRRenderTarget=!1;return d}createCylinderLayer(e,t,n,r,i,s,l,u,c={}){const h=new Ci(e,e,e*t/n,64,64,!0,Math.PI-t/2,t),A=new lU(s,l,{format:F,type:T,depthTexture:new Mi(s,l,c.stencil?I:R,void 0,void 0,void 0,void 0,void 0,void 0,c.stencil?q:k),stencilBuffer:c.stencil,resolveDepthBuffer:!1,resolveStencilBuffer:!1});A.autoAllocateDepthBuffer=!0;const d=new Xn({color:16777215,side:1});d.map=A.texture,d.map.offset.y=1,d.map.repeat.y=-1;const p=new Tr(h,d);p.position.copy(r),p.quaternion.copy(i);const f={type:"cylinder",radius:e,centralAngle:t,aspectratio:n,translation:r,quaternion:i,pixelwidth:s,pixelheight:l,plane:p,material:d,rendercall:u,renderTarget:A};if(this._layers.push(f),null!==this._session){f.plane.material=new Xn({color:16777215,side:1}),f.plane.material.blending=5,f.plane.material.blendEquation=a,f.plane.material.blendSrc=o,f.plane.material.blendDst=o,f.xrlayer=this._createXRLayer(f);const e=this._session.renderState.layers;e.unshift(f.xrlayer),this._session.updateRenderState({layers:e})}else A.isXRRenderTarget=!1;return p}renderLayers(){const e=new Ke,t=new $e,n=this._renderer,r=this.isPresenting,i=n.getOutputRenderTarget(),s=n._frameBufferTarget;this.isPresenting=!1;const a=new Ye;n.getSize(a);const o=n._quad;for(const r of this._layers)if(r.renderTarget.isXRRenderTarget=null!==this._session,r.renderTarget.hasExternalTextures=r.renderTarget.isXRRenderTarget,r.renderTarget.isXRRenderTarget&&this._supportsLayers){r.xrlayer.transform=new XRRigidTransform(r.plane.getWorldPosition(e),r.plane.getWorldQuaternion(t));const i=this._glBinding.getSubImage(r.xrlayer,this._xrFrame);n.backend.setXRRenderTargetTextures(r.renderTarget,i.colorTexture,void 0),n._setXRLayerSize(r.renderTarget.width,r.renderTarget.height),n.setOutputRenderTarget(r.renderTarget),n.setRenderTarget(null),n._frameBufferTarget=null,this._frameBufferTargets||(this._frameBufferTargets=new WeakMap);const{frameBufferTarget:s,quad:a}=this._frameBufferTargets.get(r.renderTarget)||{frameBufferTarget:null,quad:null};s?(n._frameBufferTarget=s,n._quad=a):(n._quad=new sD(new rC),this._frameBufferTargets.set(r.renderTarget,{frameBufferTarget:n._getFrameBufferTarget(),quad:n._quad})),r.rendercall(),n._frameBufferTarget=null}else n.setRenderTarget(r.renderTarget),r.rendercall();n.setRenderTarget(null),n.setOutputRenderTarget(i),n._frameBufferTarget=s,n._setXRLayerSize(a.x,a.y),n._quad=o,this.isPresenting=r}getSession(){return this._session}async setSession(e){const t=this._renderer,n=t.backend;this._gl=t.getContext();const r=this._gl,i=r.getContextAttributes();if(this._session=e,null!==e){if(!0===n.isWebGPUBackend)throw new Error('THREE.XRManager: XR is currently not supported with a WebGPU backend. Use WebGL by passing "{ forceWebGL: true }" to the constructor of the renderer.');if(e.addEventListener("select",this._onSessionEvent),e.addEventListener("selectstart",this._onSessionEvent),e.addEventListener("selectend",this._onSessionEvent),e.addEventListener("squeeze",this._onSessionEvent),e.addEventListener("squeezestart",this._onSessionEvent),e.addEventListener("squeezeend",this._onSessionEvent),e.addEventListener("end",this._onSessionEnd),e.addEventListener("inputsourceschange",this._onInputSourcesChange),await n.makeXRCompatible(),this._currentPixelRatio=t.getPixelRatio(),t.getSize(this._currentSize),this._currentAnimationContext=t._animation.getContext(),this._currentAnimationLoop=t._animation.getAnimationLoop(),t._animation.stop(),!0===this._useLayers){let n=null,s=null,l=null;t.depth&&(l=t.stencil?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24,n=t.stencil?q:k,s=t.stencil?I:R);const u={colorFormat:r.RGBA8,depthFormat:l,scaleFactor:this._framebufferScaleFactor,clearOnAccess:!1};this._useMultiviewIfPossible&&t.hasFeature("OVR_multiview2")&&(u.textureType="texture-array",this._useMultiview=!0);const c=new XRWebGLBinding(e,r),h=c.createProjectionLayer(u),A=[h];this._glBinding=c,this._glProjLayer=h,t.setPixelRatio(1),t._setXRLayerSize(h.textureWidth,h.textureHeight);const d=this._useMultiview?2:1,p=new Mi(h.textureWidth,h.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,n,d);if(this._xrRenderTarget=new lU(h.textureWidth,h.textureHeight,{format:F,type:T,colorSpace:t.outputColorSpace,depthTexture:p,stencilBuffer:t.stencil,samples:i.antialias?4:0,resolveDepthBuffer:!1===h.ignoreDepthValues,resolveStencilBuffer:!1===h.ignoreDepthValues,depth:this._useMultiview?2:1,multiview:this._useMultiview}),this._xrRenderTarget.hasExternalTextures=!0,this._xrRenderTarget.depth=this._useMultiview?2:1,this._supportsLayers=e.enabledFeatures.includes("layers"),this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType()),this._supportsLayers)for(const e of this._layers)e.plane.material=new Xn({color:16777215,side:"cylinder"===e.type?1:0}),e.plane.material.blending=5,e.plane.material.blendEquation=a,e.plane.material.blendSrc=o,e.plane.material.blendDst=o,e.xrlayer=this._createXRLayer(e),A.unshift(e.xrlayer);e.updateRenderState({layers:A})}else{const n={antialias:t.samples>0,alpha:!0,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:this.getFramebufferScaleFactor()},i=new XRWebGLLayer(e,r,n);this._glBaseLayer=i,e.updateRenderState({baseLayer:i}),t.setPixelRatio(1),t._setXRLayerSize(i.framebufferWidth,i.framebufferHeight),this._xrRenderTarget=new lU(i.framebufferWidth,i.framebufferHeight,{format:F,type:T,colorSpace:t.outputColorSpace,stencilBuffer:t.stencil,resolveDepthBuffer:!1===i.ignoreDepthValues,resolveStencilBuffer:!1===i.ignoreDepthValues}),this._referenceSpace=await e.requestReferenceSpace(this.getReferenceSpaceType())}this.setFoveation(this.getFoveation()),t._animation.setAnimationLoop(this._onAnimationFrame),t._animation.setContext(e),t._animation.start(),this.isPresenting=!0,this.dispatchEvent({type:"sessionstart"})}}updateCamera(e){const t=this._session;if(null===t)return;const n=e.near,r=e.far,i=this._cameraXR,s=this._cameraL,a=this._cameraR;i.near=a.near=s.near=n,i.far=a.far=s.far=r,i.isMultiViewCamera=this._useMultiview,this._currentDepthNear===i.near&&this._currentDepthFar===i.far||(t.updateRenderState({depthNear:i.near,depthFar:i.far}),this._currentDepthNear=i.near,this._currentDepthFar=i.far),s.layers.mask=2|e.layers.mask,a.layers.mask=4|e.layers.mask,i.layers.mask=s.layers.mask|a.layers.mask;const o=e.parent,l=i.cameras;AU(i,o);for(let e=0;e<l.length;e++)AU(l[e],o);2===l.length?function(e,t,n){uU.setFromMatrixPosition(t.matrixWorld),cU.setFromMatrixPosition(n.matrixWorld);const r=uU.distanceTo(cU),i=t.projectionMatrix.elements,s=n.projectionMatrix.elements,a=i[14]/(i[10]-1),o=i[14]/(i[10]+1),l=(i[9]+1)/i[5],u=(i[9]-1)/i[5],c=(i[8]-1)/i[0],h=(s[8]+1)/s[0],A=a*c,d=a*h,p=r/(-c+h),f=p*-c;if(t.matrixWorld.decompose(e.position,e.quaternion,e.scale),e.translateX(f),e.translateZ(p),e.matrixWorld.compose(e.position,e.quaternion,e.scale),e.matrixWorldInverse.copy(e.matrixWorld).invert(),-1===i[10])e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse);else{const t=a+p,n=o+p,i=A-f,s=d+(r-f),c=l*o/n*t,h=u*o/n*t;e.projectionMatrix.makePerspective(i,s,c,h,t,n),e.projectionMatrixInverse.copy(e.projectionMatrix).invert()}}(i,s,a):i.projectionMatrix.copy(s.projectionMatrix),function(e,t,n){null===n?e.matrix.copy(t.matrixWorld):(e.matrix.copy(n.matrixWorld),e.matrix.invert(),e.matrix.multiply(t.matrixWorld)),e.matrix.decompose(e.position,e.quaternion,e.scale),e.updateMatrixWorld(!0),e.projectionMatrix.copy(t.projectionMatrix),e.projectionMatrixInverse.copy(t.projectionMatrixInverse),e.isPerspectiveCamera&&(e.fov=2*Ve*Math.atan(1/e.projectionMatrix.elements[5]),e.zoom=1)}(e,i,o)}_getController(e){let t=this._controllers[e];return void 0===t&&(t=new Gr,this._controllers[e]=t),t}}function AU(e,t){null===t?e.matrixWorld.copy(e.matrix):e.matrixWorld.multiplyMatrices(t.matrixWorld,e.matrix),e.matrixWorldInverse.copy(e.matrixWorld).invert()}function dU(e){const t=this._controllerInputSources.indexOf(e.inputSource);if(-1===t)return;const n=this._controllers[t];if(void 0!==n){const t=this.getReferenceSpace();n.update(e.inputSource,e.frame,t),n.dispatchEvent({type:e.type,data:e.inputSource})}}function pU(){const e=this._session,t=this._renderer;e.removeEventListener("select",this._onSessionEvent),e.removeEventListener("selectstart",this._onSessionEvent),e.removeEventListener("selectend",this._onSessionEvent),e.removeEventListener("squeeze",this._onSessionEvent),e.removeEventListener("squeezestart",this._onSessionEvent),e.removeEventListener("squeezeend",this._onSessionEvent),e.removeEventListener("end",this._onSessionEnd),e.removeEventListener("inputsourceschange",this._onInputSourcesChange);for(let e=0;e<this._controllers.length;e++){const t=this._controllerInputSources[e];null!==t&&(this._controllerInputSources[e]=null,this._controllers[e].disconnect(t))}if(this._currentDepthNear=null,this._currentDepthFar=null,t._resetXRState(),this._session=null,this._xrRenderTarget=null,!0===this._supportsLayers)for(const e of this._layers)e.renderTarget=new lU(e.pixelwidth,e.pixelheight,{format:F,type:T,depthTexture:new Mi(e.pixelwidth,e.pixelheight,e.stencilBuffer?I:R,void 0,void 0,void 0,void 0,void 0,void 0,e.stencilBuffer?q:k),stencilBuffer:e.stencilBuffer,resolveDepthBuffer:!1,resolveStencilBuffer:!1}),e.renderTarget.isXRRenderTarget=!1,e.plane.material=e.material,e.material.map=e.renderTarget.texture,e.material.map.offset.y=1,e.material.map.repeat.y=-1,delete e.xrlayer;this.isPresenting=!1,this._useMultiview=!1,t._animation.stop(),t._animation.setAnimationLoop(this._currentAnimationLoop),t._animation.setContext(this._currentAnimationContext),t._animation.start(),t.setPixelRatio(this._currentPixelRatio),t.setSize(this._currentSize.width,this._currentSize.height,!1),this.dispatchEvent({type:"sessionend"})}function fU(e){const t=this._controllers,n=this._controllerInputSources;for(let r=0;r<e.removed.length;r++){const i=e.removed[r],s=n.indexOf(i);s>=0&&(n[s]=null,t[s].disconnect(i))}for(let r=0;r<e.added.length;r++){const i=e.added[r];let s=n.indexOf(i);if(-1===s){for(let e=0;e<t.length;e++){if(e>=n.length){n.push(i),s=e;break}if(null===n[e]){n[e]=i,s=e;break}}if(-1===s)break}const a=t[s];a&&a.connect(i)}}function mU(e){return"quad"===e.type?this._glBinding.createQuadLayer({transform:new XRRigidTransform(e.translation,e.quaternion),width:e.width/2,height:e.height/2,space
1:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1}):this._glBinding.createCylinderLayer({transform:new XRRigidTransform(e.translation,e.quaternion),radius:e.radius,centralAngle:e.centralAngle,aspectRatio:e.aspectRatio,space:this._referenceSpace,viewPixelWidth:e.pixelwidth,viewPixelHeight:e.pixelheight,clearOnAccess:!1})}function gU(e,t){if(void 0===t)return;const n=this._cameraXR,r=this._renderer,i=r.backend,s=this._glBaseLayer,a=this.getReferenceSpace(),o=t.getViewerPose(a);if(this._xrFrame=t,null!==o){const e=o.views;null!==this._glBaseLayer&&i.setXRTarget(s.framebuffer);let t=!1;e.length!==n.cameras.length&&(n.cameras.length=0,t=!0);for(let r=0;r<e.length;r++){const a=e[r];let o;if(!0===this._useLayers){const e=this._glBinding.getViewSubImage(this._glProjLayer,a);o=e.viewport,0===r&&i.setXRRenderTargetTextures(this._xrRenderTarget,e.colorTexture,this._glProjLayer.ignoreDepthValues&&!this._useMultiview?void 0:e.depthStencilTexture)}else o=s.getViewport(a);let l=this._cameras[r];void 0===l&&(l=new Br,l.layers.enable(r),l.viewport=new vt,this._cameras[r]=l),l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.quaternion,l.scale),l.projectionMatrix.fromArray(a.projectionMatrix),l.projectionMatrixInverse.copy(l.projectionMatrix).invert(),l.viewport.set(o.x,o.y,o.width,o.height),0===r&&(n.matrix.copy(l.matrix),n.matrix.decompose(n.position,n.quaternion,n.scale)),!0===t&&n.cameras.push(l)}r.setOutputRenderTarget(this._xrRenderTarget)}for(let e=0;e<this._controllers.length;e++){const n=this._controllerInputSources[e],r=this._controllers[e];null!==n&&void 0!==r&&r.update(n,t,a)}this._currentAnimationLoop&&this._currentAnimationLoop(e,t),t.detectedPlanes&&this.dispatchEvent({type:"planesdetected",data:t}),this._xrFrame=null}const _U=new jr,vU=new Ye,yU=new vt,xU=new ni,bU=new si,wU=new $t,TU=new vt;class SU{constructor(e=""){this.name=e,this.visibility=0}setVisibility(e){this.visibility|=e}clone(){return Object.assign(new this.constructor,this)}}let MU=class extends SU{constructor(e,t=null){super(e),this.isBuffer=!0,this.bytesPerElement=Float32Array.BYTES_PER_ELEMENT,this._buffer=t}get byteLength(){return(e=this._buffer.byteLength)+(zN-e%zN)%zN;var e}get buffer(){return this._buffer}update(){return!0}};class EU extends MU{constructor(e,t=null){super(e,t),this.isUniformBuffer=!0}}let CU=0;class RU extends EU{constructor(e,t){super("UniformBuffer_"+CU++,e?e.value:null),this.nodeUniform=e,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class NU extends EU{constructor(e){super(e),this.isUniformsGroup=!0,this._values=null,this.uniforms=[]}addUniform(e){return this.uniforms.push(e),this}removeUniform(e){const t=this.uniforms.indexOf(e);return-1!==t&&this.uniforms.splice(t,1),this}get values(){return null===this._values&&(this._values=Array.from(this.buffer)),this._values}get buffer(){let e=this._buffer;if(null===e){const t=this.byteLength;e=new Float32Array(new ArrayBuffer(t)),this._buffer=e}return e}get byteLength(){const e=this.bytesPerElement;let t=0;for(let n=0,r=this.uniforms.length;n<r;n++){const r=this.uniforms[n],i=r.boundary,s=r.itemSize*e,a=t%zN,o=a%i,l=a+o;t+=o,0!==l&&zN-l<s&&(t+=zN-l),r.offset=t/e,t+=s}return Math.ceil(t/zN)*zN}update(){let e=!1;for(const t of this.uniforms)!0===this.updateByType(t)&&(e=!0);return e}updateByType(e){return e.isNumberUniform?this.updateNumber(e):e.isVector2Uniform?this.updateVector2(e):e.isVector3Uniform?this.updateVector3(e):e.isVector4Uniform?this.updateVector4(e):e.isColorUniform?this.updateColor(e):e.isMatrix3Uniform?this.updateMatrix3(e):e.isMatrix4Uniform?this.updateMatrix4(e):void 0}updateNumber(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();return n[i]!==r&&(this._getBufferForType(s)[i]=n[i]=r,t=!0),t}updateVector2(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i+0]!==r.x||n[i+1]!==r.y){const e=this._getBufferForType(s);e[i+0]=n[i+0]=r.x,e[i+1]=n[i+1]=r.y,t=!0}return t}updateVector3(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i+0]!==r.x||n[i+1]!==r.y||n[i+2]!==r.z){const e=this._getBufferForType(s);e[i+0]=n[i+0]=r.x,e[i+1]=n[i+1]=r.y,e[i+2]=n[i+2]=r.z,t=!0}return t}updateVector4(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset,s=e.getType();if(n[i+0]!==r.x||n[i+1]!==r.y||n[i+2]!==r.z||n[i+4]!==r.w){const e=this._getBufferForType(s);e[i+0]=n[i+0]=r.x,e[i+1]=n[i+1]=r.y,e[i+2]=n[i+2]=r.z,e[i+3]=n[i+3]=r.w,t=!0}return t}updateColor(e){let t=!1;const n=this.values,r=e.getValue(),i=e.offset;if(n[i+0]!==r.r||n[i+1]!==r.g||n[i+2]!==r.b){const e=this.buffer;e[i+0]=n[i+0]=r.r,e[i+1]=n[i+1]=r.g,e[i+2]=n[i+2]=r.b,t=!0}return t}updateMatrix3(e){let t=!1;const n=this.values,r=e.getValue().elements,i=e.offset;if(n[i+0]!==r[0]||n[i+1]!==r[1]||n[i+2]!==r[2]||n[i+4]!==r[3]||n[i+5]!==r[4]||n[i+6]!==r[5]||n[i+8]!==r[6]||n[i+9]!==r[7]||n[i+10]!==r[8]){const e=this.buffer;e[i+0]=n[i+0]=r[0],e[i+1]=n[i+1]=r[1],e[i+2]=n[i+2]=r[2],e[i+4]=n[i+4]=r[3],e[i+5]=n[i+5]=r[4],e[i+6]=n[i+6]=r[5],e[i+8]=n[i+8]=r[6],e[i+9]=n[i+9]=r[7],e[i+10]=n[i+10]=r[8],t=!0}return t}updateMatrix4(e){let t=!1;const n=this.values,r=e.getValue().elements,i=e.offset;return!1===function(e,t,n){for(let r=0,i=t.length;r<i;r++)if(e[n+r]!==t[r])return!1;return!0}(n,r,i)&&(this.buffer.set(r,i),function(e,t,n){for(let r=0,i=t.length;r<i;r++)e[n+r]=t[r]}(n,r,i),t=!0),t}_getBufferForType(e){return"int"===e||"ivec2"===e||"ivec3"===e||"ivec4"===e?new Int32Array(this.buffer.buffer):"uint"===e||"uvec2"===e||"uvec3"===e||"uvec4"===e?new Uint32Array(this.buffer.buffer):this.buffer}}let PU=0;class DU extends NU{constructor(e,t){super(e),this.id=PU++,this.groupNode=t,this.isNodeUniformsGroup=!0}}let LU=0;class IU extends SU{constructor(e,t){super(e),this.id=LU++,this.texture=t,this.version=t?t.version:0,this.store=!1,this.generation=null,this.isSampledTexture=!0}needsBindingsUpdate(e){const{texture:t}=this;return e!==this.generation?(this.generation=e,!0):t.isVideoTexture}update(){const{texture:e,version:t}=this;return t!==e.version&&(this.version=e.version,!0)}}class OU extends IU{constructor(e,t,n,r=null){super(e,t?t.value:null),this.textureNode=t,this.groupNode=n,this.access=r}needsBindingsUpdate(e){return this.textureNode.value!==this.texture||super.needsBindingsUpdate(e)}update(){const{textureNode:e}=this;return this.texture!==e.value?(this.texture=e.value,!0):super.update(
1)}}class BU extends OU{constructor(e,t,n,r=null){super(e,t,n,r),this.isSampledCubeTexture=!0}}class UU extends OU{constructor(e,t,n,r=null){super(e,t,n,r),this.isSampledTexture3D=!0}}const FU={textureDimensions:"textureSize",equals:"equal"},kU={low:"lowp",medium:"mediump",high:"highp"},qU={swizzleAssign:!0,storageBuffer:!1},VU={perspective:"smooth",linear:"noperspective"},zU={centroid:"centroid","flat first":"flat","flat either":"flat"},GU="\nprecision highp float;\nprecision highp int;\nprecision highp sampler2D;\nprecision highp sampler3D;\nprecision highp samplerCube;\nprecision highp sampler2DArray;\n\nprecision highp usampler2D;\nprecision highp usampler3D;\nprecision highp usamplerCube;\nprecision highp usampler2DArray;\n\nprecision highp isampler2D;\nprecision highp isampler3D;\nprecision highp isamplerCube;\nprecision highp isampler2DArray;\n\nprecision lowp sampler2DShadow;\nprecision lowp sampler2DArrayShadow;\nprecision lowp samplerCubeShadow;\n";class jU extends CB{constructor(e,t){super(e,t,new QB),this.uniformGroups={},this.transforms=[],this.extensions={},this.builtins={vertex:[],fragment:[],compute:[]}}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==Te}getMethod(e){return FU[e]||e}getOutputStructName(){return""}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),r=[];for(const e of t.inputs)r.push(this.getType(e.type)+" "+e.name);return`${this.getType(t.type)} ${t.name}( ${r.join(", ")} ) {\n\n\t${n.vars}\n\n${n.code}\n\treturn ${n.result};\n\n}`}setupPBO(e){const t=e.value;if(void 0===t.pbo){const e=t.array,n=t.count*t.itemSize,{itemSize:r}=t,i=t.array.constructor.name.toLowerCase().includes("int");let s=i?z:V;2===r?s=i?j:G:3===r?s=i?1032:U:4===r&&(s=i?H:F);const a={Float32Array:N,Uint8Array:T,Uint16Array:E,Uint32Array:R,Int8Array:S,Int16Array:M,Int32Array:C,Uint8ClampedArray:T},o=Math.pow(2,Math.ceil(Math.log2(Math.sqrt(n/r))));let l=Math.ceil(n/r/o);o*l*r<n&&l++;const u=o*l*r,c=new e.constructor(u);c.set(e,0),t.array=c;const h=new Qr(t.array,o,l,s,a[t.array.constructor.name]||N);h.needsUpdate=!0,h.isPBOTexture=!0;const A=new _T(h,null,null);A.setPrecision("high"),t.pboNode=A,t.pbo=A.value,this.getUniformFromNode(t.pboNode,"texture",this.shaderStage,this.context.label)}}getPropertyName(e,t=this.shaderStage){return e.isNodeUniform&&!0!==e.node.isTextureNode&&!0!==e.node.isBufferNode?t.charAt(0)+"_"+e.name:super.getPropertyName(e,t)}generatePBO(e){const{node:t,indexNode:n}=e,r=t.value;this.renderer.backend.has(r)&&(this.renderer.backend.get(r).pbo=r.pbo);const i=this.getUniformFromNode(r.pboNode,"texture",this.shaderStage,this.context.label),s=this.getPropertyName(i);this.increaseUsage(n);const a=n.build(this,"uint"),o=this.getDataFromNode(e);let l=o.propertyName;if(void 0===l){const n=this.getVarFromNode(e);l=this.getPropertyName(n);const i=this.getDataFromNode(t);let u=i.propertySizeName;void 0===u&&(u=l+"Size",this.getVarFromNode(t,u,"uint"),this.addLineFlowCode(`${u} = uint( textureSize( ${s}, 0 ).x )`,e),i.propertySizeName=u);const{itemSize:c}=r,h="."+vv.join("").slice(0,c),A=`ivec2(${a} % ${u}, ${a} / ${u})`,d=this.generateTextureLoad(null,s,A,null,"0");let p="vec4";r.pbo.type===R?p="uvec4":r.pbo.type===C&&(p="ivec4"),this.addLineFlowCode(`${l} = ${p}(${d})${h}`,e),o.propertyName=l}return l}generateTextureLoad(e,t,n,r,i="0"){return r?`texelFetch( ${t}, ivec3( ${n}, ${r} ), ${i} )`:`texelFetch( ${t}, ${n}, ${i} )`}generateTexture(e,t,n,r){return e.isDepthTexture?(r&&(n=`vec4( ${n}, ${r} )`),`texture( ${t}, ${n} ).x`):(r&&(n=`vec3( ${n}, ${r} )`),`texture( ${t}, ${n} )`)}generateTextureLevel(e,t,n,r){return`textureLod( ${t}, ${n}, ${r} )`}generateTextureBias(e,t,n,r){return`texture( ${t}, ${n}, ${r} )`}generateTextureGrad(e,t,n,r){return`textureGrad( ${t}, ${n}, ${r[0]}, ${r[1]} )`}generateTextureCompare(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return i?`texture( ${t}, vec4( ${n}, ${i}, ${r} ) )`:`texture( ${t}, vec3( ${n}, ${r} ) )`}getVars(e){const t=[],n=this.vars[e];if(void 0!==n)for(const e of n)t.push(`${this.getVar(e.type,e.name,e.count)};`);return t.join("\n\t")}getUniforms(e){const t=this.uniforms[e],n=[],r={};for(const i of t){let t=null,s=!1;
vendor: 24,373 bytes, line 1
1if("texture"===i.type||"texture3D"===i.type){const e=i.node.value;let n="";!0!==e.isDataTexture&&!0!==e.isData3DTexture||(e.type===R?n="u":e.type===C&&(n="i")),t="texture3D"===i.type&&!1===e.isArrayTexture?`${n}sampler3D ${i.name};`:e.compareFunction?!0===e.isArrayTexture?`sampler2DArrayShadow ${i.name};`:`sampler2DShadow ${i.name};`:!0===e.isArrayTexture||!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?`${n}sampler2DArray ${i.name};`:`${n}sampler2D ${i.name};`}else if("cubeTexture"===i.type)t=`samplerCube ${i.name};`;else if("buffer"===i.type){const e=i.node,n=this.getType(e.bufferType),r=e.bufferCount,s=r>0?r:"";t=`${e.name} {\n\t${n} ${i.name}[${s}];\n};\n`}else t=`${this.getVectorType(i.type)} ${this.getPropertyName(i,e)};`,s=!0;const a=i.node.precision;if(null!==a&&(t=kU[a]+" "+t),s){t="\t"+t;const e=i.groupNode.name;(r[e]||(r[e]=[])).push(t)}else t="uniform "+t,n.push(t)}let i="";for(const t in r){const n=r[t];i+=this._getGLSLUniformStruct(e+"_"+t,n.join("\n"))+"\n"}return i+=n.join("\n"),i}getTypeFromAttribute(e){let t=super.getTypeFromAttribute(e);if(/^[iu]/.test(t)&&e.gpuType!==C){let n=e;e.isInterleavedBufferAttribute&&(n=e.data);const r=n.array;0==(r instanceof Uint32Array||r instanceof Int32Array)&&(t=t.slice(1))}return t}getAttributes(e){let t="";if("vertex"===e||"compute"===e){const e=this.getAttributesArray();let n=0;for(const r of e)t+=`layout( location = ${n++} ) in ${r.type} ${r.name};\n`}return t}getStructMembers(e){const t=[];for(const n of e.members)t.push(`\t${n.type} ${n.name};`);return t.join("\n")}getStructs(e){const t=[],n=this.structs[e],r=[];for(const e of n)if(e.output)for(const t of e.members)r.push(`layout( location = ${t.index} ) out ${t.type} ${t.name};`);else{let n="struct "+e.name+" {\n";n+=this.getStructMembers(e),n+="\n};\n",t.push(n)}return 0===r.length&&r.push("layout( location = 0 ) out vec4 fragColor;"),"\n"+r.join("\n")+"\n\n"+t.join("\n")}getVaryings(e){let t="";const n=this.varyings;if("vertex"===e||"compute"===e)for(const r of n){"compute"===e&&(r.needsInterpolation=!0);const n=this.getType(r.type);r.needsInterpolation?r.interpolationType?t+=`${VU[r.interpolationType]||r.interpolationType} ${zU[r.interpolationSampling]||""} out ${n} ${r.name};\n`:t+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}out ${n} ${r.name};\n`:t+=`${n} ${r.name};\n`}else if("fragment"===e)for(const e of n)if(e.needsInterpolation){const n=this.getType(e.type);e.interpolationType?t+=`${VU[e.interpolationType]||e.interpolationType} ${zU[e.interpolationSampling]||""} in ${n} ${e.name};\n`:t+=`${n.includes("int")||n.includes("uv")||n.includes("iv")?"flat ":""}in ${n} ${e.name};\n`}for(const n of this.builtins[e])t+=`${n};\n`;return t}getVertexIndex(){return"uint( gl_VertexID )"}getInstanceIndex(){return"uint( gl_InstanceID )"}getInvocationLocalIndex(){return`uint( gl_InstanceID ) % ${this.object.workgroupSize.reduce(((e,t)=>e*t),1)}u`}getDrawIndex(){return this.renderer.backend.extensions.has("WEBGL_multi_draw")?"uint( gl_DrawID )":null}getFrontFacing(){return"gl_FrontFacing"}getFragCoord(){return"gl_FragCoord.xy"}getFragDepth(){return"gl_FragDepth"}enableExtension(e,t,n=this.shaderStage){const r=this.extensions[n]||(this.extensions[n]=new Map);!1===r.has(e)&&r.set(e,{name:e,behavior:t})}getExtensions(e){const t=[];if("vertex"===e){const t=this.renderer.backend.extensions;this.object.isBatchedMesh&&t.has("WEBGL_multi_draw")&&this.enableExtension("GL_ANGLE_multi_draw","require",e)}const n=this.extensions[e];if(void 0!==n)for(const{name:e,behavior:r}of n.values())t.push(`#extension ${e} : ${r}`);return t.join("\n")}getClipDistance(){return"gl_ClipDistance"}isAvailable(e){let t=qU[e];if(void 0===t){let n;switch(t=!1,e){case"float32Filterable":n="OES_texture_float_linear";break;case"clipDistance":n="WEBGL_clip_cull_distance"}if(void 0!==n){const e=this.renderer.backend.extensions;e.has(n)&&(e.get(n),t=!0)}qU[e]=t}return t}isFlipY(){return!0}enableHardwareClipping(e){this.enableExtension("GL_ANGLE_clip_cull_distance","require"),this.builtins.vertex.push(`out float gl_ClipDistance[ ${e} ]`)}enableMultiview(){this.enableExtension("GL_OVR_multiview2","require","fragment"),this.enableExtension("GL_OVR_multiview2","require","vertex"),this.builtins.vertex.push("layout(num_views = 2) in")}registerTransform(e,t){this.transforms.push({varyingName:e,attributeNode:t})}getTransforms(){const e=this.transforms;let t="";for(let n=0;n<e.length;n++){const r=e[n],i=this.getPropertyName(r.attributeNode);i&&(t+=`${r.varyingName} = ${i};\n\t`)}return t}_getGLSLUniformStruct(e,t){return`\nlayout( std140 ) uniform ${e} {\n${t}\n};`}_getGLSLVertexCode(e){return`#version 300 es\n\n${this.getSignature()}\n\n// extensions\n${e.extensions}\n\n// precision\n${GU}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\n\n// attributes\n${e.attributes}\n\n// codes\n${e.codes}\n\nvoid main() {\n\n\t// vars\n\t${e.vars}\n\n\t// transforms\n\t${e.transforms}\n\n\t// flow\n\t${e.flow}\n\n\tgl_PointSize = 1.0;\n\n}\n`}_getGLSLFragmentCode(e){return`#version 300 es\n\n${this.getSignature()}\n\n// extensions\n${e.extensions}\n\n// precision\n${GU}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\n\n// codes\n${e.codes}\n\n// structs\n${e.structs}\n\nvoid main() {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){let n="// code\n\n";n+=this.flowCode[t];const r=this.flowNodes[t],i=r[r.length-1];for(const e of r){const r=this.getFlowData(e),s=e.name;s&&(n.length>0&&(n+="\n"),n+=`\t// flow -> ${s}\n\t`),n+=`${r.code}\n\t`,e===i&&"compute"!==t&&(n+="// result\n\t","vertex"===t?(n+="gl_Position = ",n+=`${r.result};`):"fragment"===t&&(e.outputNode.isOutputStructNode||(n+="fragColor = ",n+=`${r.result};`)))}const s=e[t];s.extensions=this.getExtensions(t),s.uniforms=this.getUniforms(t),s.attributes=this.getAttributes(t),s.varyings=this.getVaryings(t),s.vars=this.getVars(t),s.structs=this.getStructs(t),s.codes=this.getCodes(t),s.transforms=this.getTransforms(t),s.flow=n}null!==this.material?(this.vertexShader=this._getGLSLVertexCode(e.vertex),this.fragmentShader=this._getGLSLFragmentCode(e.fragment)):this.computeShader=this._getGLSLVertexCode(e.compute)}getUniformFromNode(e,t,n,r=null){const i=super.getUniformFromNode(e,t,n,r),s=this.getDataFromNode(e,n,this.globalCache);let a=s.uniformGPU;if(void 0===a){const r=e.groupNode,o=r.name,l=this.getBindGroupArray(o,n);if("texture"===t)a=new OU(i.name,i.node,r),l.push(a);else if("cubeTexture"===t)a=new BU(i.name,i.node,r),l.push(a);else if("texture3D"===t)a=new UU(i.name,i.node,r),l.push(a);else if("buffer"===t){e.name=`NodeBuffer_${e.id}`,i.name=`buffer${e.id}`;const t=new RU(e,r);t.name=e.name,l.push(t),a=t}else{const e=this.uniformGroups[n]||(this.uniformGroups[n]={});let s=e[o];void 0===s&&(s=new DU(n+"_"+o,r),e[o]=s,l.push(s)),a=this.getNodeUniform(i,t),s.addUniform(a)}s.uniformGPU=a}return i}}let HU=null,WU=null;class XU{constructor(e={}){this.parameters=Object.assign({},e),this.data=new WeakMap,this.renderer=null,this.domElement=null,this.timestampQueryPool={render:null,compute:null},this.trackTimestamp=!0===e.trackTimestamp}async init(e){this.renderer=e}get coordinateSystem(){}beginRender(){}finishRender(){}beginCompute(){}finishCompute(){}draw(){}compute(){}createProgram(){}destroyProgram(){}createBindings(){}updateBindings(){}updateBinding(){}createRenderPipeline(){}createComputePipeline(){}needsRenderUpdate(){}getRenderCacheKey(){}createNodeBuilder(){}createSampler(){}destroySampler(){}createDefaultTexture(){}createTexture(){}updateTexture(){}generateMipmaps(){}destroyTexture(){}async copyTextureToBuffer(){}copyTextureToTexture(){}copyFramebufferToTexture(){}createAttribute(){}createIndexAttribute(){}createStorageAttribute(){}updateAttribute(){}destroyAttribute(){}getContext(){}updateSize(){}updateViewport(){}isOccluded(){}async resolveTimestampsAsync(e="render"){if(!this.trackTimestamp)return void at("WebGPURenderer: Timestamp tracking is disabled.");const t=this.timestampQueryPool[e];if(!t)return void at(`WebGPURenderer: No timestamp query pool for type '${e}' found.`);const n=await t.resolveQueriesAsync();return this.renderer.info[e].timestamp=n,n}async waitForGPU(){}async getArrayBufferAsync(){}async hasFeatureAsync(){}hasFeature(){}getMaxAnisotropy(){}getDrawingBufferSize(){return HU=HU||new Ye,this.renderer.getDrawingBufferSize(HU)}setScissorTest(){}getClearColor(){const e=this.renderer;return WU=WU||new mP,e.getClearColor(WU),WU.getRGB(WU),WU}getDomElement(){let e=this.domElement;return null===e&&(e=void 0!==this.parameters.canvas?this.parameters.canvas:it(),"setAttribute"in e&&e.setAttribute("data-engine","three.js r177 webgpu"),this.domElement=e),e}set(e,t){this.data.set(e,t)}get(e){let t=this.data.get(e);return void 0===t&&(t={},this.data.set(e,t)),t}has(e){return this.data.has(e)}delete(e){this.data.delete(e)}dispose(){}}let QU,YU,$U=0;class KU{constructor(e,t){this.buffers=[e.bufferGPU,t],this.type=e.type,this.bufferType=e.bufferType,this.pbo=e.pbo,this.byteLength=e.byteLength,this.bytesPerElement=e.BYTES_PER_ELEMENT,this.version=e.version,this.isInteger=e.isInteger,this.activeBufferIndex=0,this.baseId=e.id}get id(){return`${this.baseId}|${this.activeBufferIndex}`}get bufferGPU(){return this.buffers[this.activeBufferIndex]}get transformBuffer(){return this.buffers[1^this.activeBufferIndex]}switchBuffers(){this.activeBufferIndex^=1}}class ZU{constructor(e){this.backend=e}createAttribute(e,t){const n=this.backend,{gl:r}=n,i=e.array,s=e.usage||r.STATIC_DRAW,a=e.isInterleavedBufferAttribute?e.data:e,o=n.get(a);let l,u=o.bufferGPU;if(void 0===u&&(u=this._createBuffer(r,t,i,s),o.bufferGPU=u,o.bufferType=t,o.version=a.version),i instanceof Float32Array)l=r.FLOAT;else if(i instanceof Uint16Array)l=e.isFloat16BufferAttribute?r.HALF_FLOAT:r.UNSIGNED_SHORT;else if(i instanceof Int16Array)l=r.SHORT;else if(i instanceof Uint32Array)l=r.UNSIGNED_INT;else if(i instanceof Int32Array)l=r.INT;else if(i instanceof Int8Array)l=r.BYTE;else if(i instanceof Uint8Array)l=r.UNSIGNED_BYTE;else{if(!(i instanceof Uint8ClampedArray))throw new Error("THREE.WebGLBackend: Unsupported buffer data format: "+i);l=r.UNSIGNED_BYTE}let c={bufferGPU:u,bufferType:t,type:l,byteLength:i.byteLength,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version,pbo:e.pbo,isInteger:l===r.INT||l===r.UNSIGNED_INT||e.gpuType===C,id:$U++};if(e.isStorageBufferAttribute||e.isStorageInstancedBufferAttribute){const e=this._createBuffer(r,t,i,s);c=new KU(c,e)}n.set(e,c)}updateAttribute(e){const t=this.backend,{gl:n}=t,r=e.array,i=e.isInterleavedBufferAttribute?e.data:e,s=t.get(i),a=s.bufferType,o=e.isInterleavedBufferAttribute?e.data.updateRanges:e.updateRanges;if(n.bindBuffer(a,s.bufferGPU),0===o.length)n.bufferSubData(a,0,r);else{for(let e=0,t=o.length;e<t;e++){const t=o[e];n.bufferSubData(a,t.start*r.BYTES_PER_ELEMENT,r,t.start,t.count)}i.clearUpdateRanges()}n.bindBuffer(a,null),s.version=i.version}destroyAttribute(e){const t=this.backend,{gl:n}=t;e.isInterleavedBufferAttribute&&t.delete(e.data);const r=t.get(e);n.deleteBuffer(r.bufferGPU),t.delete(e)}async getArrayBufferAsync(e){const t=this.backend,{gl:n}=t,r=e.isInterleavedBufferAttribute?e.data:e,{bufferGPU:i}=t.get(r),s=e.array,a=s.byteLength;n.bindBuffer(n.COPY_READ_BUFFER,i);const o=n.createBuffer();n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.bufferData(n.COPY_WRITE_BUFFER,a,n.STREAM_READ),n.copyBufferSubData(n.COPY_READ_BUFFER,n.COPY_WRITE_BUFFER,0,0,a),await t.utils._clientWaitAsync();const l=new e.array.constructor(s.length);return n.bindBuffer(n.COPY_WRITE_BUFFER,o),n.getBufferSubData(n.COPY_WRITE_BUFFER,0,l),n.deleteBuffer(o),n.bindBuffer(n.COPY_READ_BUFFER,null),n.bindBuffer(n.COPY_WRITE_BUFFER,null),l.buffer}_createBuffer(e,t,n,r){const i=e.createBuffer();return e.bindBuffer(t,i),e.bufferData(t,n,r),e.bindBuffer(t,null),i}}class JU{constructor(e){this.backend=e,this.gl=this.backend.gl,this.enabled={},this.currentFlipSided=null,this.currentCullFace=null,this.currentProgram=null,this.currentBlendingEnabled=!1,this.currentBlending=null,this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentPremultipledAlpha=null,this.currentPolygonOffsetFactor=null,this.currentPolygonOffsetUnits=null,this.currentColorMask=null,this.currentDepthFunc=null,this.currentDepthMask=null,this.currentStencilFunc=null,this.currentStencilRef=null,this.currentStencilFuncMask=null,this.currentStencilFail=null,this.currentStencilZFail=null,this.currentStencilZPass=null,this.currentStencilMask=null,this.currentLineWidth=null,this.currentClippingPlanes=0,this.currentVAO=null,this.currentIndex=null,this.currentBoundFramebuffers={},this.currentDrawbuffers=new WeakMap,this.maxTextures=this.gl.getParameter(this.gl.MAX_TEXTURE_IMAGE_UNITS),this.currentTextureSlot=null,this.currentBoundTextures={},this.currentBoundBufferBases={},this._init()}_init(){const e=this.gl;QU={[a]:e.FUNC_ADD,101:e.FUNC_SUBTRACT,102:e.FUNC_REVERSE_SUBTRACT},YU={[o]:e.ZERO,201:e.ONE,202:e.SRC_COLOR,[l]:e.SRC_ALPHA,210:e.SRC_ALPHA_SATURATE,208:e.DST_COLOR,206:e.DST_ALPHA,203:e.ONE_MINUS_SRC_COLOR,[u]:e.ONE_MINUS_SRC_ALPHA,209:e.ONE_MINUS_DST_COLOR,207:e.ONE_MINUS_DST_ALPHA};const t=e.getParameter(e.SCISSOR_BOX),n=e.getParameter(e.VIEWPORT);this.currentScissor=(new vt).fromArray(t),this.currentViewport=(new vt).fromArray(n),this._tempVec4=new vt}enable(e){const{enabled:t}=this;!0!==t[e]&&(this.gl.enable(e),t[e]=!0)}disable(e){const{enabled:t}=this;!1!==t[e]&&(this.gl.disable(e),t[e]=!1)}setFlipSided(e){if(this.currentFlipSided!==e){const{gl:t}=this;e?t.frontFace(t.CW):t.frontFace(t.CCW),this.currentFlipSided=e}}setCullFace(e){const{gl:t}=this;0!==e?(this.enable(t.CULL_FACE),e!==this.currentCullFace&&(1===e?t.cullFace(t.BACK):2===e?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):this.disable(t.CULL_FACE),this.currentCullFace=e}setLineWidth(e){const{currentLineWidth:t,gl:n}=this;e!==t&&(n.lineWidth(e),this.currentLineWidth=e)}setBlending(e,t,n,r,i,s,o,l){const{gl:u}=this;if(0!==e){if(!1===this.currentBlendingEnabled&&(this.enable(u.BLEND),this.currentBlendingEnabled=!0),5===e)i=i||t,s=s||n,o=o||r,t===this.currentBlendEquation&&i===this.currentBlendEquationAlpha||(u.blendEquationSeparate(QU[t],QU[i]),this.currentBlendEquation=t,this.currentBlendEquationAlpha=i),n===this.currentBlendSrc&&r===this.currentBlendDst&&s===this.currentBlendSrcAlpha&&o===this.currentBlendDstAlpha||(u.blendFuncSeparate(YU[n],YU[r],YU[s],YU[o]),this.currentBlendSrc=n,this.currentBlendDst=r,this.currentBlendSrcAlpha=s,this.currentBlendDstAlpha=o),this.currentBlending=e,this.currentPremultipledAlpha=!1;else if(e!==this.currentBlending||l!==this.currentPremultipledAlpha){if(this.currentBlendEquation===a&&this.currentBlendEquationAlpha===a||(u.blendEquation(u.FUNC_ADD),this.currentBlendEquation=a,this.currentBlendEquationAlpha=a),l)switch(e){case 1:u.blendFuncSeparate(u.ONE,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA);break;case 2:u.blendFunc(u.ONE,u.ONE);break;case 3:u.blendFuncSeparate(u.ZERO,u.ONE_MINUS_SRC_COLOR,u.ZERO,u.ONE);break;case 4:u.blendFuncSeparate(u.ZERO,u.SRC_COLOR,u.ZERO,u.SRC_ALPHA);break;default:}else switch(e){case 1:u.blendFuncSeparate(u.SRC_ALPHA,u.ONE_MINUS_SRC_ALPHA,u.ONE,u.ONE_MINUS_SRC_ALPHA);break;case 2:u.blendFunc(u.SRC_ALPHA,u.ONE);break;case 3:u.blendFuncSeparate(u.ZERO,u.ONE_MINUS_SRC_COLOR,u.ZERO,u.ONE);break;case 4:u.blendFunc(u.ZERO,u.SRC_COLOR);break;default:}this.currentBlendSrc=null,this.currentBlendDst=null,this.currentBlendSrcAlpha=null,this.currentBlendDstAlpha=null,this.currentBlending=e,this.currentPremultipledAlpha=l}}else!0===this.currentBlendingEnabled&&(this.disable(u.BLEND),this.currentBlendingEnabled=!1)}setColorMask(e){this.currentColorMask!==e&&(this.gl.colorMask(e,e,e,e),this.currentColorMask=e)}setDepthTest(e){const{gl:t}=this;e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)}setDepthMask(e){this.currentDepthMask!==e&&(this.gl.depthMask(e),this.currentDepthMask=e)}setDepthFunc(e){if(this.currentDepthFunc!==e){const{gl:t}=this;switch(e){case 0:t.depthFunc(t.NEVER);break;case 1:t.depthFunc(t.ALWAYS);break;case 2:t.depthFunc(t.LESS);break;case 3:default:t.depthFunc(t.LEQUAL);break;case 4:t.depthFunc(t.EQUAL);break;case 5:t.depthFunc(t.GEQUAL);break;case 6:t.depthFunc(t.GREATER);break;case 7:t.depthFunc(t.NOTEQUAL)}this.currentDepthFunc=e}}scissor(e,t,n,r){const i=this._tempVec4.set(e,t,n,r);if(!1===this.currentScissor.equals(i)){const{gl:e}=this;e.scissor(i.x,i.y,i.z,i.w),this.currentScissor.copy(i)}}viewport(e,t,n,r){const i=this._tempVec4.set(e,t,n,r);if(!1===this.currentViewport.equals(i)){const{gl:e}=this;e.viewport(i.x,i.y,i.z,i.w),this.currentViewport.copy(i)}}setScissorTest(e){const t=this.gl;e?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST)}setStencilTest(e){const{gl:t}=this;e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)}setStencilMask(e){this.currentStencilMask!==e&&(this.gl.stencilMask(e),this.currentStencilMask=e)}setStencilFunc(e,t,n){this.currentStencilFunc===e&&this.currentStencilRef===t&&this.currentStencilFuncMask===n||(this.gl.stencilFunc(e,t,n),this.currentStencilFunc=e,this.currentStencilRef=t,this.currentStencilFuncMask=n)}setStencilOp(e,t,n){this.currentStencilFail===e&&this.currentStencilZFail===t&&this.currentStencilZPass===n||(this.gl.stencilOp(e,t,n),this.currentStencilFail=e,this.currentStencilZFail=t,this.currentStencilZPass=n)}setMaterial(e,t,n){const{gl:r}=this;2===e.side?this.disable(r.CULL_FACE):this.enable(r.CULL_FACE);let i=1===e.side;t&&(i=!i),this.setFlipSided(i),1===e.blending&&!1===e.transparent?this.setBlending(0):this.setBlending(e.blending,e.blendEquation,e.blendSrc,e.blendDst,e.blendEquationAlpha,e.blendSrcAlpha,e.blendDstAlpha,e.premultipliedAlpha),this.setDepthFunc(e.depthFunc),this.setDepthTest(e.depthTest),this.setDepthMask(e.depthWrite),this.setColorMask(e.colorWrite);const s=e.stencilWrite;if(this.setStencilTest(s),s&&(this.setStencilMask(e.stencilWriteMask),this.setStencilFunc(e.stencilFunc,e.stencilRef,e.stencilFuncMask),this.setStencilOp(e.stencilFail,e.stencilZFail,e.stencilZPass)),this.setPolygonOffset(e.polygonOffset,e.polygonOffsetFactor,e.polygonOffsetUnits),!0===e.alphaToCoverage&&this.backend.renderer.samples>1?this.enable(r.SAMPLE_ALPHA_TO_COVERAGE):this.disable(r.SAMPLE_ALPHA_TO_COVERAGE),n>0&&this.currentClippingPlanes!==n){const e=12288;for(let t=0;t<8;t++)t<n?this.enable(e+t):this.disable(e+t)}}setPolygonOffset(e,t,n){const{gl:r}=this;e?(this.enable(r.POLYGON_OFFSET_FILL),this.currentPolygonOffsetFactor===t&&this.currentPolygonOffsetUnits===n||(r.polygonOffset(t,n),this.currentPolygonOffsetFactor=t,this.currentPolygonOffsetUnits=n)):this.disable(r.POLYGON_OFFSET_FILL)}useProgram(e){return this.currentProgram!==e&&(this.gl.useProgram(e),this.currentProgram=e,!0)}setVertexState(e,t=null){const n=this.gl;return(this.currentVAO!==e||this.currentIndex!==t)&&(n.bindVertexArray(e),null!==t&&n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.currentVAO=e,this.currentIndex=t,!0)}resetVertexState(){const e=this.gl;e.bindVertexArray(null),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null),this.currentVAO=null,this.currentIndex=null}bindFramebuffer(e,t){const{gl:n,currentBoundFramebuffers:r}=this;return r[e]!==t&&(n.bindFramebuffer(e,t),r[e]=t,e===n.DRAW_FRAMEBUFFER&&(r[n.FRAMEBUFFER]=t),e===n.FRAMEBUFFER&&(r[n.DRAW_FRAMEBUFFER]=t),!0)}drawBuffers(e,t){const{gl:n}=this;let r=[],i=!1;if(null!==e.textures){r=this.currentDrawbuffers.get(t),void 0===r&&(r=[],this.currentDrawbuffers.set(t,r));const s=e.textures;if(r.length!==s.length||r[0]!==n.COLOR_ATTACHMENT0){for(let e=0,t=s.length;e<t;e++)r[e]=n.COLOR_ATTACHMENT0+e;r.length=s.length,i=!0}}else r[0]!==n.BACK&&(r[0]=n.BACK,i=!0);i&&n.drawBuffers(r)}activeTexture(e){const{gl:t,currentTextureSlot:n,maxTextures:r}=this;void 0===e&&(e=t.TEXTURE0+r-1),n!==e&&(t.activeTexture(e),this.currentTextureSlot=e)}bindTexture(e,t,n){const{gl:r,currentTextureSlot:i,currentBoundTextures:s,maxTextures:a}=this;void 0===n&&(n=null===i?r.TEXTURE0+a-1:i);let o=s[n];void 0===o&&(o={type:void 0,texture:void 0},s[n]=o),o.type===e&&o.texture===t||(i!==n&&(r.activeTexture(n),this.currentTextureSlot=n),r.bindTexture(e,t),o.type=e,o.texture=t)}bindBufferBase(e,t,n){const{gl:r}=this,i=`${e}-${t}`;return this.currentBoundBufferBases[i]!==n&&(r.bindBufferBase(e,t,n),this.currentBoundBufferBases[i]=n,!0)}unbindTexture(){const{gl:e,currentTextureSlot:t,currentBoundTextures:n}=this,r=n[t];void 0!==r&&void 0!==r.type&&(e.bindTexture(r.type,null),r.type=void 0,r.texture=void 0)}}class eF{constructor(e){this.backend=e,this.gl=this.backend.gl,this.extensions=e.extensions}convert(e,t=""){const{gl:n,extensions:r}=this;let i;const s=ut.getTransfer(t);if(e===T)return n.UNSIGNED_BYTE;if(e===D)return n.UNSIGNED_SHORT_4_4_4_4;if(e===L)return n.UNSIGNED_SHORT_5_5_5_1;if(e===O)return n.UNSIGNED_INT_5_9_9_9_REV;if(e===S)return n.BYTE;if(e===M)return n.SHORT;if(e===E)return n.UNSIGNED_SHORT;if(e===C)return n.INT;if(e===R)return n.UNSIGNED_INT;if(e===N)return n.FLOAT;if(e===P)return n.HALF_FLOAT;if(e===B)return n.ALPHA;if(e===U)return n.RGB;if(e===F)return n.RGBA;if(e===k)return n.DEPTH_COMPONENT;if(e===q)return n.DEPTH_STENCIL;if(e===V)return n.RED;if(e===z)return n.RED_INTEGER;if(e===G)return n.RG;if(e===j)return n.RG_INTEGER;if(e===H)return n.RGBA_INTEGER;if(e===W||e===X||e===Q||e===Y)if(s===Ce){if(i=r.get("WEBGL_compressed_texture_s3tc_srgb"),null===i)return null;if(e===W)return i.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(e===X)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(e===Q)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(e===Y)return i.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(i=r.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(e===W)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(e===X)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(e===Q)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(e===Y)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(e===$||e===K||e===Z||e===J){if(i=r.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(e===$)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(e===K)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(e===Z)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(e===J)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(e===ee||e===te||e===ne){if(i=r.get("WEBGL_compressed_texture_etc"),null===i)return null;if(e===ee||e===te)return s===Ce?i.COMPRESSED_SRGB8_ETC2:i.COMPRESSED_RGB8_ETC2;if(e===ne)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:i.COMPRESSED_RGBA8_ETC2_EAC}if(e===re||e===ie||e===se||e===ae||e===oe||e===le||e===ue||e===ce||e===he||e===Ae||e===de||e===pe||e===fe||e===me){if(i=r.get("WEBGL_compressed_texture_astc"),null===i)return null;if(e===re)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:i.COMPRESSED_RGBA_ASTC_4x4_KHR;if(e===ie)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:i.COMPRESSED_RGBA_ASTC_5x4_KHR;if(e===se)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:i.COMPRESSED_RGBA_ASTC_5x5_KHR;if(e===ae)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:i.COMPRESSED_RGBA_ASTC_6x5_KHR;if(e===oe)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:i.COMPRESSED_RGBA_ASTC_6x6_KHR;if(e===le)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:i.COMPRESSED_RGBA_ASTC_8x5_KHR;if(e===ue)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:i.COMPRESSED_RGBA_ASTC_8x6_KHR;if(e===ce)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:i.COMPRESSED_RGBA_ASTC_8x8_KHR;if(e===he)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:i.COMPRESSED_RGBA_ASTC_10x5_KHR;if(e===Ae)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:i.COMPRESSED_RGBA_ASTC_10x6_KHR;if(e===de)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:i.COMPRESSED_RGBA_ASTC_10x8_KHR;if(e===pe)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:i.COMPRESSED_RGBA_ASTC_10x10_KHR;if(e===fe)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:i.COMPRESSED_RGBA_ASTC_12x10_KHR;if(e===me)return s===Ce?i.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:i.COMPRESSED_RGBA_ASTC_12x12_KHR}if(e===ge){if(i=r.get("EXT_texture_compression_bptc"),null===i)return null;if(e===ge)return s===Ce?i.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:i.COMPRESSED_RGBA_BPTC_UNORM_EXT}if(e===ye||e===xe||e===be||e===we){if(i=r.get("EXT_texture_compression_rgtc"),null===i)return null;
1if(e===ge)return i.COMPRESSED_RED_RGTC1_EXT;if(e===xe)return i.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(e===be)return i.COMPRESSED_RED_GREEN_RGTC2_EXT;if(e===we)return i.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}return e===I?n.UNSIGNED_INT_24_8:void 0!==n[e]?n[e]:null}_clientWaitAsync(){const{gl:e}=this,t=e.fenceSync(e.SYNC_GPU_COMMANDS_COMPLETE,0);return e.flush(),new Promise(((n,r)=>{!function i(){const s=e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0);if(s===e.WAIT_FAILED)return e.deleteSync(t),void r();s!==e.TIMEOUT_EXPIRED?(e.deleteSync(t),n()):requestAnimationFrame(i)}()}))}}let tF,nF,rF,iF=!1;class sF{constructor(e){this.backend=e,this.gl=e.gl,this.extensions=e.extensions,this.defaultTextures={},!1===iF&&(this._init(),iF=!0)}_init(){const e=this.gl;tF={[f]:e.REPEAT,[m]:e.CLAMP_TO_EDGE,[g]:e.MIRRORED_REPEAT},nF={[_]:e.NEAREST,[v]:e.NEAREST_MIPMAP_NEAREST,[y]:e.NEAREST_MIPMAP_LINEAR,[x]:e.LINEAR,[b]:e.LINEAR_MIPMAP_NEAREST,[w]:e.LINEAR_MIPMAP_LINEAR},rF={512:e.NEVER,519:e.ALWAYS,[Ne]:e.LESS,[Pe]:e.LEQUAL,514:e.EQUAL,518:e.GEQUAL,516:e.GREATER,517:e.NOTEQUAL}}getGLTextureType(e){const{gl:t}=this;let n;return n=!0===e.isCubeTexture?t.TEXTURE_CUBE_MAP:!0===e.isArrayTexture||!0===e.isDataArrayTexture||!0===e.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:!0===e.isData3DTexture?t.TEXTURE_3D:t.TEXTURE_2D,n}getInternalFormat(e,t,n,r,i=!1){const{gl:s,extensions:a}=this;if(null!==e&&void 0!==s[e])return s[e];let o=t;if(t===s.RED&&(n===s.FLOAT&&(o=s.R32F),n===s.HALF_FLOAT&&(o=s.R16F),n===s.UNSIGNED_BYTE&&(o=s.R8),n===s.UNSIGNED_SHORT&&(o=s.R16),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),t===s.RED_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.R8UI),n===s.UNSIGNED_SHORT&&(o=s.R16UI),n===s.UNSIGNED_INT&&(o=s.R32UI),n===s.BYTE&&(o=s.R8I),n===s.SHORT&&(o=s.R16I),n===s.INT&&(o=s.R32I)),t===s.RG&&(n===s.FLOAT&&(o=s.RG32F),n===s.HALF_FLOAT&&(o=s.RG16F),n===s.UNSIGNED_BYTE&&(o=s.RG8),n===s.UNSIGNED_SHORT&&(o=s.RG16),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),t===s.RG_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RG8UI),n===s.UNSIGNED_SHORT&&(o=s.RG16UI),n===s.UNSIGNED_INT&&(o=s.RG32UI),n===s.BYTE&&(o=s.RG8I),n===s.SHORT&&(o=s.RG16I),n===s.INT&&(o=s.RG32I)),t===s.RGB){const e=i?Ee:ut.getTransfer(r);n===s.FLOAT&&(o=s.RGB32F),n===s.HALF_FLOAT&&(o=s.RGB16F),n===s.UNSIGNED_BYTE&&(o=s.RGB8),n===s.UNSIGNED_SHORT&&(o=s.RGB16),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I),n===s.UNSIGNED_BYTE&&(o=e===Ce?s.SRGB8:s.RGB8),n===s.UNSIGNED_SHORT_5_6_5&&(o=s.RGB565),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGB4),n===s.UNSIGNED_INT_5_9_9_9_REV&&(o=s.RGB9_E5)}if(t===s.RGB_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGB8UI),n===s.UNSIGNED_SHORT&&(o=s.RGB16UI),n===s.UNSIGNED_INT&&(o=s.RGB32UI),n===s.BYTE&&(o=s.RGB8I),n===s.SHORT&&(o=s.RGB16I),n===s.INT&&(o=s.RGB32I)),t===s.RGBA){const e=i?Ee:ut.getTransfer(r);n===s.FLOAT&&(o=s.RGBA32F),n===s.HALF_FLOAT&&(o=s.RGBA16F),n===s.UNSIGNED_BYTE&&(o=s.RGBA8),n===s.UNSIGNED_SHORT&&(o=s.RGBA16),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I),n===s.UNSIGNED_BYTE&&(o=e===Ce?s.SRGB8_ALPHA8:s.RGBA8),n===s.UNSIGNED_SHORT_4_4_4_4&&(o=s.RGBA4),n===s.UNSIGNED_SHORT_5_5_5_1&&(o=s.RGB5_A1)}return t===s.RGBA_INTEGER&&(n===s.UNSIGNED_BYTE&&(o=s.RGBA8UI),n===s.UNSIGNED_SHORT&&(o=s.RGBA16UI),n===s.UNSIGNED_INT&&(o=s.RGBA32UI),n===s.BYTE&&(o=s.RGBA8I),n===s.SHORT&&(o=s.RGBA16I),n===s.INT&&(o=s.RGBA32I)),t===s.DEPTH_COMPONENT&&(n===s.UNSIGNED_SHORT&&(o=s.DEPTH_COMPONENT16),n===s.UNSIGNED_INT&&(o=s.DEPTH_COMPONENT24),n===s.FLOAT&&(o=s.DEPTH_COMPONENT32F)),t===s.DEPTH_STENCIL&&n===s.UNSIGNED_INT_24_8&&(o=s.DEPTH24_STENCIL8),o!==s.R16F&&o!==s.R32F&&o!==s.RG16F&&o!==s.RG32F&&o!==s.RGBA16F&&o!==s.RGBA32F||a.get("EXT_color_buffer_float"),o}setTextureParameters(e,t){const{gl:n,extensions:r,backend:i}=this,s=ut.getPrimaries(ut.workingColorSpace),a=t.colorSpace===Te?null:ut.getPrimaries(t.colorSpace),o=t.colorSpace
vendor: 3,552 bytes, line 1
1===Te||s===a?n.NONE:n.BROWSER_DEFAULT_WEBGL;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t.flipY),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),n.pixelStorei(n.UNPACK_ALIGNMENT,t.unpackAlignment),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,o),n.texParameteri(e,n.TEXTURE_WRAP_S,tF[t.wrapS]),n.texParameteri(e,n.TEXTURE_WRAP_T,tF[t.wrapT]),e!==n.TEXTURE_3D&&e!==n.TEXTURE_2D_ARRAY||t.isArrayTexture||n.texParameteri(e,n.TEXTURE_WRAP_R,tF[t.wrapR]),n.texParameteri(e,n.TEXTURE_MAG_FILTER,nF[t.magFilter]);const l=void 0!==t.mipmaps&&t.mipmaps.length>0,u=t.minFilter===x&&l?w:t.minFilter;if(n.texParameteri(e,n.TEXTURE_MIN_FILTER,nF[u]),t.compareFunction&&(n.texParameteri(e,n.TEXTURE_COMPARE_MODE,n.COMPARE_REF_TO_TEXTURE),n.texParameteri(e,n.TEXTURE_COMPARE_FUNC,rF[t.compareFunction])),!0===r.has("EXT_texture_filter_anisotropic")){if(t.magFilter===_)return;if(t.minFilter!==y&&t.minFilter!==w)return;if(t.type===N&&!1===r.has("OES_texture_float_linear"))return;if(t.anisotropy>1){const s=r.get("EXT_texture_filter_anisotropic");n.texParameterf(e,s.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(t.anisotropy,i.getMaxAnisotropy()))}}}createDefaultTexture(e){const{gl:t,backend:n,defaultTextures:r}=this,i=this.getGLTextureType(e);let s=r[i];void 0===s&&(s=t.createTexture(),n.state.bindTexture(i,s),t.texParameteri(i,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(i,t.TEXTURE_MAG_FILTER,t.NEAREST),r[i]=s),n.set(e,{textureGPU:s,glTextureType:i,isDefault:!0})}createTexture(e,t){const{gl:n,backend:r}=this,{levels:i,width:s,height:a,depth:o}=t,l=r.utils.convert(e.format,e.colorSpace),u=r.utils.convert(e.type),c=this.getInternalFormat(e.internalFormat,l,u,e.colorSpace,e.isVideoTexture),h=n.createTexture(),A=this.getGLTextureType(e);r.state.bindTexture(A,h),this.setTextureParameters(A,e),e.isArrayTexture||e.isDataArrayTexture||e.isCompressedArrayTexture?n.texStorage3D(n.TEXTURE_2D_ARRAY,i,c,s,a,o):e.isData3DTexture?n.texStorage3D(n.TEXTURE_3D,i,c,s,a,o):e.isVideoTexture||n.texStorage2D(A,i,c,s,a),r.set(e,{textureGPU:h,glTextureType:A,glFormat:l,glType:u,glInternalFormat:c})}copyBufferToTexture(e,t){const{gl:n,backend:r}=this,{textureGPU:i,glTextureType:s,glFormat:a,glType:o}=r.get(t),{width:l,height:u}=t.source.data;n.bindBuffer(n.PIXEL_UNPACK_BUFFER,e),r.state.bindTexture(s,i),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texSubImage2D(s,0,0,0,l,u,a,o,0),n.bindBuffer(n.PIXEL_UNPACK_BUFFER,null),r.state.unbindTexture()}updateTexture(e,t){const{gl:n}=this,{width:r,height:i}=t,{textureGPU:s,glTextureType:a,glFormat:o,glType:l,glInternalFormat:u}=this.backend.get(e);if(!e.isRenderTargetTexture&&void 0!==s)if(this.backend.state.bindTexture(a,s),this.setTextureParameters(a,e),e.isCompressedTexture){const r=e.mipmaps,i=t.image;for(let t=0;t<r.length;t++){const s=r[t];e.isCompressedArrayTexture?e.format!==n.RGBA?null!==o&&n.compressedTexSubImage3D(n.TEXTURE_2D_ARRAY,t,0,0,0,s.width,s.height,i.depth,o,s.data):n.texSubImage3D(n.TEXTURE_2D_ARRAY,t,0,0,0,s.width,s.height,i.depth,o,l,s.data):null!==o&&n.compressedTexSubImage2D(n.TEXTURE_2D,t,0,0,s.width,s.height,o,s.data)}}else if(e.isCubeTexture){const e=t.images;for(let t=0;t<6;t++){const s=aF(e[t]);n.texSubImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+t,0,0,0,r,i,o,l,s)}}else if(e.isDataArrayTexture||e.isArrayTexture){const e=t.image;n.texSubImage3D(n.TEXTURE_2D_ARRAY,0,0,0,0,e.width,e.height,e.depth,o,l,e.data)}else if(e.isData3DTexture){const e=t.image;n.texSubImage3D(n.TEXTURE_3D,0,0,0,0,e.width,e.height,e.depth,o,l,e.data)}
vendor: 6,273 bytes, line 1
1else if(e.isVideoTexture)e.update(),n.texImage2D(a,0,u,o,l,t.image);else{const e=aF(t.image);n.texSubImage2D(a,0,0,0,r,i,o,l,e)}}generateMipmaps(e){const{gl:t,backend:n}=this,{textureGPU:r,glTextureType:i}=n.get(e);n.state.bindTexture(i,r),t.generateMipmap(i)}deallocateRenderBuffers(e){const{gl:t,backend:n}=this;if(e){const r=n.get(e);if(r.renderBufferStorageSetup=void 0,r.framebuffers){for(const e in r.framebuffers)t.deleteFramebuffer(r.framebuffers[e]);delete r.framebuffers}if(r.depthRenderbuffer&&(t.deleteRenderbuffer(r.depthRenderbuffer),delete r.depthRenderbuffer),r.stencilRenderbuffer&&(t.deleteRenderbuffer(r.stencilRenderbuffer),delete r.stencilRenderbuffer),r.msaaFrameBuffer&&(t.deleteFramebuffer(r.msaaFrameBuffer),delete r.msaaFrameBuffer),r.msaaRenderbuffers){for(let e=0;e<r.msaaRenderbuffers.length;e++)t.deleteRenderbuffer(r.msaaRenderbuffers[e]);delete r.msaaRenderbuffers}}}destroyTexture(e){const{gl:t,backend:n}=this,{textureGPU:r,renderTarget:i}=n.get(e);this.deallocateRenderBuffers(i),t.deleteTexture(r),n.delete(e)}copyTextureToTexture(e,t,n=null,r=null,i=0,s=0){const{gl:a,backend:o}=this,{state:l}=this.backend,{textureGPU:u,glTextureType:c,glType:h,glFormat:A}=o.get(t);let d,p,f,m,g,_,v,y,x;l.bindTexture(c,u);const b=e.isCompressedTexture?e.mipmaps[s]:e.image;if(null!==n)d=n.max.x-n.min.x,p=n.max.y-n.min.y,f=n.isBox3?n.max.z-n.min.z:1,m=n.min.x,g=n.min.y,_=n.isBox3?n.min.z:0;else{const t=Math.pow(2,-i);d=Math.floor(b.width*t),p=Math.floor(b.height*t),f=e.isDataArrayTexture||e.isArrayTexture?b.depth:e.isData3DTexture?Math.floor(b.depth*t):1,m=0,g=0,_=0}null!==r?(v=r.x,y=r.y,x=r.z):(v=0,y=0,x=0),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,t.flipY),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),a.pixelStorei(a.UNPACK_ALIGNMENT,t.unpackAlignment);const w=a.getParameter(a.UNPACK_ROW_LENGTH),T=a.getParameter(a.UNPACK_IMAGE_HEIGHT),S=a.getParameter(a.UNPACK_SKIP_PIXELS),M=a.getParameter(a.UNPACK_SKIP_ROWS),E=a.getParameter(a.UNPACK_SKIP_IMAGES);a.pixelStorei(a.UNPACK_ROW_LENGTH,b.width),a.pixelStorei(a.UNPACK_IMAGE_HEIGHT,b.height),a.pixelStorei(a.UNPACK_SKIP_PIXELS,m),a.pixelStorei(a.UNPACK_SKIP_ROWS,g),a.pixelStorei(a.UNPACK_SKIP_IMAGES,_);const C=t.isDataArrayTexture||t.isData3DTexture||t.isArrayTexture;if(e.isRenderTargetTexture||e.isDepthTexture){const n=o.get(e),r=o.get(t),i=o.get(n.renderTarget),s=o.get(r.renderTarget),u=i.framebuffers[n.cacheKey],c=s.framebuffers[r.cacheKey];l.bindFramebuffer(a.READ_FRAMEBUFFER,u),l.bindFramebuffer(a.DRAW_FRAMEBUFFER,c);let h=a.COLOR_BUFFER_BIT;e.isDepthTexture&&(h=a.DEPTH_BUFFER_BIT),a.blitFramebuffer(m,g,d,p,v,y,d,p,h,a.NEAREST),l.bindFramebuffer(a.READ_FRAMEBUFFER,null),l.bindFramebuffer(a.DRAW_FRAMEBUFFER,null)}else C?e.isDataTexture||e.isData3DTexture?a.texSubImage3D(c,s,v,y,x,d,p,f,A,h,b.data):t.isCompressedArrayTexture?a.compressedTexSubImage3D(c,s,v,y,x,d,p,f,A,b.data):a.texSubImage3D(c,s,v,y,x,d,p,f,A,h,b):e.isDataTexture?a.texSubImage2D(c,s,v,y,d,p,A,h,b.data):e.isCompressedTexture?a.compressedTexSubImage2D(c,s,v,y,b.width,b.height,A,b.data):a.texSubImage2D(c,s,v,y,d,p,A,h,b);a.pixelStorei(a.UNPACK_ROW_LENGTH,w),a.pixelStorei(a.UNPACK_IMAGE_HEIGHT,T),a.pixelStorei(a.UNPACK_SKIP_PIXELS,S),a.pixelStorei(a.UNPACK_SKIP_ROWS,M),a.pixelStorei(a.UNPACK_SKIP_IMAGES,E),0===s&&t.generateMipmaps&&a.generateMipmap(c),l.unbindTexture()}copyFramebufferToTexture(e,t,n){const{gl:r}=this,{state:i}=this.backend,{textureGPU:s}=this.backend.get(e),{x:a,y:o,z:l,w:u}=n,c=!0===e.isDepthTexture||t.renderTarget&&t.renderTarget.samples>0,h=t.renderTarget?t.renderTarget.height:this.backend.getDrawingBufferSize().y;if(c){const n=0!==a||0!==o;let c,A;if(!0===e.isDepthTexture?(c=r.DEPTH_BUFFER_BIT,A=r.DEPTH_ATTACHMENT,t.stencil&&(c|=r.STENCIL_BUFFER_BIT)):(c=r.COLOR_BUFFER_BIT,A=r.COLOR_ATTACHMENT0),n){const e=this.backend.get(t.renderTarget),n=e.framebuffers[t.getCacheKey()],A=e.msaaFrameBuffer;i.bindFramebuffer(r.DRAW_FRAMEBUFFER,n),i.bindFramebuffer(r.READ_FRAMEBUFFER,A);const d=h-o-u;r.blitFramebuffer(a,d,a+l,d+u,a,d,a+l,d+u,c,r.NEAREST),i.bindFramebuffer(r.READ_FRAMEBUFFER,n),i.bindTexture(r.TEXTURE_2D,s),r.copyTexSubImage2D(r.TEXTURE_2D,0,0,0,a,d,l,u),i.unbindTexture()}else{const e=r.createFramebuffer();i.bindFramebuffer(r.DRAW_FRAMEBUFFER,e),r.framebufferTexture2D(r.DRAW_FRAMEBUFFER,A,r.TEXTURE_2D,s,0),r.blitFramebuffer(0,0,l,u,0,0,l,u,c,r.NEAREST),r.deleteFramebuffer(e)}}else i.bindTexture(r.TEXTURE_2D,s),r.copyTexSubImage2D(r.TEXTURE_2D,0,0,0,a,h-u-o,l,u),i.unbindTexture();e.generateMipmaps&&this.generateMipmaps(e),this.backend._setFramebuffer(t)}setupRenderBufferStorage(e,t,n,r=!1){const{gl:i}=this,s=t.renderTarget,{depthTexture:a,depthBuffer:o,stencilBuffer:l,width:u,height:c}=s;if(i.bindRenderbuffer(i.RENDERBUFFER,e),o&&!l){let t=i.DEPTH_COMPONENT24;!0===r?this.extensions.get("WEBGL_multisampled_render_to_texture").renderbufferStorageMultisampleEXT(i.RENDERBUFFER,s.samples,t,u,c):n>0?(a&&a.isDepthTexture&&a.type===i.FLOAT&&(t=i.DEPTH_COMPONENT32F),i.renderbufferStorageMultisample(i.RENDERBUFFER,n,t,u,c)):i.renderbufferStorage(i.RENDERBUFFER,t,u,c),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.RENDERBUFFER,e)}else o&&l&&(n>0?i.renderbufferStorageMultisample(i.RENDERBUFFER,n,i.DEPTH24_STENCIL8,u,c):i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,u,c),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.RENDERBUFFER,e))}async copyTextureToBuffer(e,t,n,r,i,s){const{backend:a,gl:o}=this,{textureGPU:l,glFormat:u,glType:c}=this.backend.get(e),h=o.createFramebuffer();o.bindFramebuffer(o.READ_FRAMEBUFFER,h);const A=e.isCubeTexture?o.TEXTURE_CUBE_MAP_POSITIVE_X+s:o.TEXTURE_2D;o.framebufferTexture2D(o.READ_FRAMEBUFFER,o.COLOR_ATTACHMENT0,A,l,0);const d=this._getTypedArrayType(c),p=r*i*this._getBytesPerTexel(c,u),f=o.createBuffer();o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.bufferData(o.PIXEL_PACK_BUFFER,p,o.STREAM_READ),o.readPixels(t,n,r,i,u,c,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),await a.utils._clientWaitAsync();const m=new d(p/d.BYTES_PER_ELEMENT);return o.bindBuffer(o.PIXEL_PACK_BUFFER,f),o.getBufferSubData(o.PIXEL_PACK_BUFFER,0,m),o.bindBuffer(o.PIXEL_PACK_BUFFER,null),o.deleteFramebuffer(h),m}_getTypedArrayType(e){const{gl:t}=this;if(e===t.UNSIGNED_BYTE)return Uint8Array;
vendor: 3,325 bytes, line 1
1if(e===t.UNSIGNED_SHORT_4_4_4_4)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_5_5_1)return Uint16Array;if(e===t.UNSIGNED_SHORT_5_6_5)return Uint16Array;if(e===t.UNSIGNED_SHORT)return Uint16Array;if(e===t.UNSIGNED_INT)return Uint32Array;if(e===t.HALF_FLOAT)return Uint16Array;if(e===t.FLOAT)return Float32Array;throw new Error(`Unsupported WebGL type: ${e}`)}_getBytesPerTexel(e,t){const{gl:n}=this;let r=0;return e===n.UNSIGNED_BYTE&&(r=1),e!==n.UNSIGNED_SHORT_4_4_4_4&&e!==n.UNSIGNED_SHORT_5_5_5_1&&e!==n.UNSIGNED_SHORT_5_6_5&&e!==n.UNSIGNED_SHORT&&e!==n.HALF_FLOAT||(r=2),e!==n.UNSIGNED_INT&&e!==n.FLOAT||(r=4),t===n.RGBA?4*r:t===n.RGB?3*r:t===n.ALPHA?r:void 0}}function aF(e){return e.isDataTexture?e.image.data:"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap||"undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas?e:e.data}class oF{constructor(e){this.backend=e,this.gl=this.backend.gl,this.availableExtensions=this.gl.getSupportedExtensions(),this.extensions={}}get(e){let t=this.extensions[e];return void 0===t&&(t=this.gl.getExtension(e),this.extensions[e]=t),t}has(e){return this.availableExtensions.includes(e)}}class lF{constructor(e){this.backend=e,this.maxAnisotropy=null}getMaxAnisotropy(){if(null!==this.maxAnisotropy)return this.maxAnisotropy;const e=this.backend.gl,t=this.backend.extensions;if(!0===t.has("EXT_texture_filter_anisotropic")){const n=t.get("EXT_texture_filter_anisotropic");this.maxAnisotropy=e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else this.maxAnisotropy=0;return this.maxAnisotropy}}const uF={WEBGL_multi_draw:"WEBGL_multi_draw",WEBGL_compressed_texture_astc:"texture-compression-astc",WEBGL_compressed_texture_etc:"texture-compression-etc2",WEBGL_compressed_texture_etc1:"texture-compression-etc1",WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBKIT_WEBGL_compressed_texture_pvrtc:"texture-compression-pvrtc",WEBGL_compressed_texture_s3tc:"texture-compression-bc",EXT_texture_compression_bptc:"texture-compression-bptc",EXT_disjoint_timer_query_webgl2:"timestamp-query",OVR_multiview2:"OVR_multiview2"};class cF{constructor(e){this.gl=e.gl,this.extensions=e.extensions,this.info=e.renderer.info,this.mode=null,this.index=0,this.type=null,this.object=null}render(e,t){const{gl:n,mode:r,object:i,type:s,info:a,index:o}=this;0!==o?n.drawElements(r,t,s,e):n.drawArrays(r,e,t),a.update(i,t,1)}renderInstances(e,t,n){const{gl:r,mode:i,type:s,index:a,object:o,info:l}=this;0!==n&&(0!==a?r.drawElementsInstanced(i,t,s,e,n):r.drawArraysInstanced(i,e,t,n),l.update(o,t,n))}renderMultiDraw(e,t,n){const{extensions:r,mode:i,object:s,info:a}=this;if(0===n)return;const o=r.get("WEBGL_multi_draw");if(null===o)for(let r=0;r<n;r++)this.render(e[r],t[r]);else{0!==this.index?o.multiDrawElementsWEBGL(i,t,0,this.type,e,0,n):o.multiDrawArraysWEBGL(i,e,0,t,0,n);let r=0;for(let e=0;e<n;e++)r+=t[e];a.update(s,r,1)}}renderMultiDrawInstances(e,t,n,r){const{extensions:i,mode:s,object:a,info:o}=this;if(0===n)return;const l=i.get("WEBGL_multi_draw");if(null===l)for(let i=0;i<n;i++)this.renderInstances(e[i],t[i],r[i]);else{0!==this.index?l.multiDrawElementsInstancedWEBGL(s,t,0,this.type,e,0,r,0,n):l.multiDrawArraysInstancedWE
1BGL(s,e,0,t,0,r,0,n);let i=0;for(let e=0;e<n;e++)i+=t[e]*r[e];o.update(a,i,1)}}}class hF{constructor(e=256){this.trackTimestamp=!0,this.maxQueries=e,this.currentQueryIndex=0,this.queryOffsets=new Map,this.isDisposed=!1,this.lastValue=0,this.pendingResolve=!1}allocateQueriesForContext(){}async resolveQueriesAsync(){}dispose(){}}class AF extends hF{constructor(e,t,n=2048){if(super(n),this.gl=e,this.type=t,this.ext=e.getExtension("EXT_disjoint_timer_query_webgl2")||e.getExtension("EXT_disjoint_timer_query"),this.ext){this.queries=[];for(let t=0;t<this.maxQueries;t++)this.queries.push(e.createQuery());this.activeQuery=null,this.queryStates=new Map}else this.trackTimestamp=!1}allocateQueriesForContext(e){if(!this.trackTimestamp)return null;if(this.currentQueryIndex+2>this.maxQueries)return at(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryStates.set(t,"inactive"),this.queryOffsets.set(e.id,t),t}beginQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null==t)return;if(null!==this.activeQuery)return;const n=this.queries[t];if(n)try{"inactive"===this.queryStates.get(t)&&(this.gl.beginQuery(this.ext.TIME_ELAPSED_EXT,n),this.activeQuery=t,this.queryStates.set(t,"started"))}catch(e){this.activeQuery=null,this.queryStates.set(t,"inactive")}}endQuery(e){if(!this.trackTimestamp||this.isDisposed)return;const t=this.queryOffsets.get(e.id);if(null!=t&&this.activeQuery===t)try{this.gl.endQuery(this.ext.TIME_ELAPSED_EXT),this.queryStates.set(t,"ended"),this.activeQuery=null}catch(e){this.queryStates.set(t,"inactive"),this.activeQuery=null}}async resolveQueriesAsync(){if(!this.trackTimestamp||this.pendingResolve)return this.lastValue;this.pendingResolve=!0;try{const e=[];for(const[t,n]of this.queryStates)if("ended"===n){const n=this.queries[t];e.push(this.resolveQuery(n))}if(0===e.length)return this.lastValue;const t=(await Promise.all(e)).reduce(((e,t)=>e+t),0);return this.lastValue=t,this.currentQueryIndex=0,this.queryOffsets.clear(),this.queryStates.clear(),this.activeQuery=null,t}catch(e){return this.lastValue}finally{this.pendingResolve=!1}}async resolveQuery(e){return new Promise((t=>{if(this.isDisposed)return void t(this.lastValue);let n,r=!1;const i=e=>{r||(r=!0,n&&(clearTimeout(n),n=null),t(e))},s=()=>
1{if(this.isDisposed)i(this.lastValue);else try{if(this.gl.getParameter(this.ext.GPU_DISJOINT_EXT))return void i(this.lastValue);if(!this.gl.getQueryParameter(e,this.gl.QUERY_RESULT_AVAILABLE))return void(n=setTimeout(s,1));const r=this.gl.getQueryParameter(e,this.gl.QUERY_RESULT);t(Number(r)/1e6)}catch(e){t(this.lastValue)}};s()}))}dispose(){if(!this.isDisposed&&(this.isDisposed=!0,this.trackTimestamp)){for(const e of this.queries)this.gl.deleteQuery(e);this.queries=[],this.queryStates.clear(),this.queryOffsets.clear(),this.lastValue=0,this.activeQuery=null}}}const dF=new Ye;class pF extends XU{constructor(e={}){super(e),this.isWebGLBackend=!0,this.attributeUtils=null,this.extensions=null,this.capabilities=null,this.textureUtils=null,this.bufferRenderer=null,this.gl=null,this.state=null,this.utils=null,this.vaoCache={},this.transformFeedbackCache={},this.discard=!1,this.disjoint=null,this.parallel=null,this._currentContext=null,this._knownBindings=new WeakSet,this._supportsInvalidateFramebuffer="undefined"!=typeof navigator&&/OculusBrowser/g.test(navigator.userAgent),this._xrFramebuffer=null}init(e){super.init(e);const t=this.parameters,n={antialias:e.samples>0,alpha:!0,depth:e.depth,stencil:e.stencil},r=void 0!==t.context?t.context:e.domElement.getContext("webgl2",n);function i(t){t.preventDefault();const n={api:"WebGL",message:t.statusMessage||"Unknown reason",reason:null,originalEvent:t};e.onDeviceLost(n)}this._onContextLost=i,e.domElement.addEventListener("webglcontextlost",i,!1),this.gl=r,this.extensions=new oF(this),this.capabilities=new lF(this),this.attributeUtils=new ZU(this),this.textureUtils=new sF(this),this.bufferRenderer=new cF(this),this.state=new JU(this),this.utils=new eF(this),this.extensions.get("EXT_color_buffer_float"),this.extensions.get("WEBGL_clip_cull_distance"),this.extensions.get("OES_texture_float_linear"),this.extensions.get("EXT_color_buffer_half_float"),this.extensions.get("WEBGL_multisampled_render_to_texture"),this.extensions.get("WEBGL_render_shared_exponent"),this.extensions.get("WEBGL_multi_draw"),this.extensions.get("OVR_multiview2"),this.disjoint=this.extensions.get("EXT_disjoint_timer_query_webgl2"),this.parallel=this.extensions.get("KHR_parallel_shader_compile")}get coordinateSystem(){return Oe}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}async waitForGPU(){await this.utils._clientWaitAsync()}async makeXRCompatible(){!0!==this.gl.getContextAttributes().xrCompatible&&await this.gl.makeXRCompatible()}setXRTarget(e){this._xrFramebuffer=e}setXRRenderTargetTextures(e,t,n=null){const r=this.gl;if(this.set(e.texture,{textureGPU:t,glInternalFormat:r.RGBA8}),null!==n){const t=e.stencilBuffer?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24;this.set(e.depthTexture,{textureGPU:n,glInternalFormat:t}),!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!0===e.autoAllocateDepthBuffer&&e.multiview,e.autoAllocateDepthBuffer=!1}}initTimestampQuery(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t]||(this.timestampQueryPool[t]=new AF(this.gl,t,2048));const n=this.timestampQueryPool[t];null!==n.allocateQueriesForContext(e)&&n.beginQuery(e)}prepareTimestampBuffer(e){if(!this.disjoint||!this.trackTimestamp)return;const t=e.isComputeNode?"compute":"render";this.timestampQueryPool[t].endQuery(e)}getContext(){return this.gl}beginRender(e){const{state:t}=this,n=this.get(e);if(e.viewport)this.updateViewport(e);else{const{width:e,height:n}=this.getDrawingBufferSize(dF);t.viewport(0,0,e,n)}if(e.scissor){const{x:n,y:r,width:i,height:s}=e.scissorValue;t.scissor(n,e.height-s-r,i,s)}this.initTimestampQuery(e),n.previousContext=this._currentContext,this._currentContext=e,this._setFramebuffer(e),this.clear(e.clearColor,e.clearDepth,e.clearStencil,e,!1);const r=e.occlusionQueryCount;r>0&&(n.currentOcclusionQueries=n.occlusionQueries,n.currentOcclusionQueryObjects=n.occlusionQueryObjects,n.lastOcclusionObject=null,n.occlusionQueries=new Array(r),n.occlusionQueryObjects=new Array(r),n.occlusionQueryIndex=0)}finishRender(e){const{gl:t,state:n}=this,r=this.get(e),i=r.previousContext;n.resetVertexState();const s=e.occlusionQueryCount;s>0&&(s>r.occlusionQueryIndex&&t.endQuery(t.ANY_SAMPLES_PASSED),this.resolveOccludedAsync(e));const a=e.textures;if(null!==a)for(let e=0;e<a.length;e++){const t=a[e];t.generateMipmaps&&this.generateMipmaps(t)}if(this._currentContext=i,null!==e.textures&&e.renderTarget){const r=this.get(e.renderTarget),{resolveDepthBuffer:i,samples:s}=e.renderTarget;if(s>0&&!1===this._useMultisampledExtension(e.renderTarget)){const i=r.framebuffers[e.getCacheKey()],s=t.COLOR_BUFFER_BIT,a=r.msaaFrameBuffer,o=e.textures;n.bindFramebuffer(t.READ_FRAMEBUFFER,a),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,i);for(let n=0;n<o.length;n++)if(e.scissor){const{x:n,y:i,width:a,height:o}=e.scissorValue,l=e.height-o-i;t.blitFramebuffer(n,l,n+a,l+o,n,l,n+a,l+o,s,t.NEAREST),!0===this._supportsInvalidateFramebuffer&&t.invalidateSubFramebuffer(t.READ_FRAMEBUFFER,r.invalidationArray,n,l,a,o)}else t.blitFramebuffer(0,0,e.width,e.height,0,0,e.width,e.height,s,t.NEAREST),!0===this._supportsInvalidateFramebuffer&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,r.invalidationArray)}else if(!1===i&&r.framebuffers){const i=r.framebuffers[e.getCacheKey()];n.bindFramebuffer(t.DRAW_FRAMEBUFFER,i),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,r.depthInvalidationArray)}}if(null!==i)if(this._setFramebuffer(i),i.viewport)this.updateViewport(i);else{const{width:e,height:t}=this.getDrawingBufferSize(dF);n.viewport(0,0,e,t)}this.prepareTimestampBuffer(e)}resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueries:n,currentOcclusionQueryObjects:r}=t;if(n&&r){const e=new WeakSet,{gl:i}=this;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueries=null;const s=()=>{let a=0;for(let t=0;t<n.length;t++){const s=n[t];null!==s&&i.getQueryParameter(s,i.QUERY_RESULT_AVAILABLE)&&(0===i.getQueryParameter(s,i.QUERY_RESULT)&&e.add(r[t]),n[t]=null,i.deleteQuery(s),a++)}a<n.length?requestAnimationFrame(s):t.occluded=e};s()}}isOccluded(e,t){const n=this.get(e);return n.occluded&&n.occluded.has(t)}updateViewport(e){const{state:t}=this,{x:n,y:r,width:i,height:s}=e.viewportValue;t.viewport(n,e.height-s-r,i,s)}setScissorTest(e){this.state.setScissorTest(e)}getClearColor(){const e=super.getClearColor();return e.r*=e.a,e.g*=e.a,e.b*=e.a,e}clear(e,t,n,r=null,i=!0){const{gl:s,renderer:a}=this;null===r&&(r={textures:null,clearColorValue:this.getClearColor()});let o=0;if(e&&(o|=s.COLOR_BUFFER_BIT),t&&(o|=s.DEPTH_BUFFER_BIT),n&&(o|=s.STENCIL_BUFFER_BIT),0!==o){let l;l=r.clearColorValue?r.clearColorValue:this.getClearColor();const u=a.getClearDepth(),c=a.getClearStencil();if(t&&this.state.setDepthMask(!0),null===r.textures)s.clearColor(l.r,l.g,l.b,l.a),s.clear(o);else{if(i&&this._setFramebuffer(r),e)for(let e=0;e<r.textures.length;
1e++)0===e?s.clearBufferfv(s.COLOR,e,[l.r,l.g,l.b,l.a]):s.clearBufferfv(s.COLOR,e,[0,0,0,1]);t&&n?s.clearBufferfi(s.DEPTH_STENCIL,0,u,c):t?s.clearBufferfv(s.DEPTH,0,[u]):n&&s.clearBufferiv(s.STENCIL,0,[c])}}}beginCompute(e){const{state:t,gl:n}=this;t.bindFramebuffer(n.FRAMEBUFFER,null),this.initTimestampQuery(e)}compute(e,t,n,r){const{state:i,gl:s}=this;!1===this.discard&&(s.enable(s.RASTERIZER_DISCARD),this.discard=!0);const{programGPU:a,transformBuffers:o,attributes:l}=this.get(r),u=this._getVaoKey(l),c=this.vaoCache[u];void 0===c?this._createVao(l):i.setVertexState(c),i.useProgram(a),this._bindUniforms(n);const h=this._getTransformFeedback(o);s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,h),s.beginTransformFeedback(s.POINTS),l[0].isStorageInstancedBufferAttribute?s.drawArraysInstanced(s.POINTS,0,1,t.count):s.drawArrays(s.POINTS,0,t.count),s.endTransformFeedback(),s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,null);for(let e=0;e<o.length;e++){const t=o[e];t.pbo&&this.textureUtils.copyBufferToTexture(t.transformBuffer,t.pbo),t.switchBuffers()}}finishCompute(e){const t=this.gl;this.discard=!1,t.disable(t.RASTERIZER_DISCARD),this.prepareTimestampBuffer(e),this._currentContext&&this._setFramebuffer(this._currentContext)}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.isArrayTexture&&e.camera.isArrayCamera}draw(e){const{object:t,pipeline:n,material:r,context:i,hardwareClippingPlanes:s}=e,{programGPU:a}=this.get(n),{gl:o,state:l}=this,u=this.get(i),c=e.getDrawParameters();if(null===c)return;this._bindUniforms(e.getBindings());const h=t.isMesh&&t.matrixWorld.determinant()<0;l.setMaterial(r,h,s),l.useProgram(a);const A=this.get(e);let d=A.staticVao;if(void 0===d||A.geometryId!==e.geometry.id){const t=this._getVaoKey(e.getAttributes());if(d=this.vaoCache[t],void 0===d){let t;({vaoGPU:d,staticVao:t}=this._createVao(e.getAttributes())),t&&(A.staticVao=d,A.geometryId=e.geometry.id)}}const p=e.getIndex(),f=null!==p?this.get(p).bufferGPU:null;l.setVertexState(d,f);const m=u.lastOcclusionObject;if(m!==t&&void 0!==m){if(null!==m&&!0===m.occlusionTest&&(o.endQuery(o.ANY_SAMPLES_PASSED),u.occlusionQueryIndex++),!0===t.occlusionTest){const e=o.createQuery();o.beginQuery(o.ANY_SAMPLES_PASSED,e),u.occlusionQueries[u.occlusionQueryIndex]=e,u.occlusionQueryObjects[u.occlusionQueryIndex]=t}u.lastOcclusionObject=t}const g=this.bufferRenderer;t.isPoints?g.mode=o.POINTS:t.isLineSegments?g.mode=o.LINES:t.isLine?g.mode=o.LINE_STRIP:t.isLineLoop?g.mode=o.LINE_LOOP:!0===r.wireframe?(l.setLineWidth(r.wireframeLinewidth*this.renderer.getPixelRatio()),g.mode=o.LINES):g.mode=o.TRIANGLES;const{vertexCount:_,instanceCount:v}=c;let{firstVertex:y}=c;if(g.object=t,null!==p){y*=p.array.BYTES_PER_ELEMENT;const e=this.get(p);g.index=p.count,g.type=e.type}else g.index=0;const x=()=>{t.isBatchedMesh?null!==t._multiDrawInstances?(at("THREE.WebGLBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),g.renderMultiDrawInstances(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount,t._multiDrawInstances)):this.hasFeature("WEBGL_multi_draw")?g.renderMultiDraw(t._multiDrawStarts,t._multiDrawCounts,t._multiDrawCount):at("THREE.WebGLRenderer: WEBGL_multi_draw not supported."):v>1?g.renderInstances(y,_,v):g.render(y,_)};if(!0===e.camera.isArrayCamera&&e.camera.cameras.length>0&&!1===e.camera.isMultiViewCamera){const n=this.get(e.camera),r=e.camera.cameras,i=e.getBindingGroup("cameraIndex").bindings[0];if(void 0===n.indexesGPU||n.indexesGPU.length!==r.length){const e=new Uint32Array([0,0,0,0]),t=[];for(let n=0,i=r.length;n<i;n++){const r=o.createBuffer();e[0]=n,o.bindBuffer(o.UNIFORM_BUFFER,r),o.bufferData(o.UNIFORM_BUFFER,e,o.STATIC_DRAW),t.push(r)}n.indexesGPU=t}const s=this.get(i),a=this.renderer.getPixelRatio(),u=this._currentContext.renderTarget,c=this._isRenderCameraDepthArray(this._currentContext),h=this._currentContext.activeCubeFace;if(c){const e=this.get(u.depthTexture);if(e.clearedRenderId!==this.renderer._nodes.nodeFrame.renderId){e.clearedRenderId=this.renderer._nodes.nodeFrame.renderId;const{stencilBuffer:t}=u;for(let e=0,n=r.length;e<n;e++)this.renderer._activeCubeFace=e,this._currentContext.activeCubeFace=e,this._setFramebuffer(this._currentContext),this.clear(!1,!0,t,this._currentContext,!1);this.renderer._activeCubeFace=h,this._currentContext.activeCubeFace=h}}for(let i=0,u=r.length;i<u;i++){const u=r[i];
1if(t.layers.test(u.layers)){c&&(this.renderer._activeCubeFace=i,this._currentContext.activeCubeFace=i,this._setFramebuffer(this._currentContext));const t=u.viewport;if(void 0!==t){const n=t.x*a,r=t.y*a,i=t.width*a,s=t.height*a;l.viewport(Math.floor(n),Math.floor(e.context.height-s-r),Math.floor(i),Math.floor(s))}l.bindBufferBase(o.UNIFORM_BUFFER,s.index,n.indexesGPU[i]),x()}this._currentContext.activeCubeFace=h,this.renderer._activeCubeFace=h}}else x()}needsRenderUpdate(){return!1}getRenderCacheKey(){return""}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e){this.textureUtils.destroyTexture(e)}async copyTextureToBuffer(e,t,n,r,i,s){return this.textureUtils.copyTextureToBuffer(e,t,n,r,i,s)}createSampler(){}destroySampler(){}createNodeBuilder(e,t){return new jU(e,t)}createProgram(e){const t=this.gl,{stage:n,code:r}=e,i="fragment"===n?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);t.shaderSource(i,r),t.compileShader(i),this.set(e,{shaderGPU:i})}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){const n=this.gl,r=e.pipeline,{fragmentProgram:i,vertexProgram:s}=r,a=n.createProgram(),o=this.get(i).shaderGPU,l=this.get(s).shaderGPU;if(n.attachShader(a,o),n.attachShader(a,l),n.linkProgram(a),this.set(r,{programGPU:a,fragmentShader:o,vertexShader:l}),null!==t&&this.parallel){const i=new Promise((t=>{const i=this.parallel,s=()=>{n.getProgramParameter(a,i.COMPLETION_STATUS_KHR)?(this._completeCompile(e,r),t()):requestAnimationFrame(s)};s()}));t.push(i)}else this._completeCompile(e,r)}_handleSource(e,t){const n=e.split("\n"),r=[],i=Math.max(t-6,0),s=Math.min(t+6,n.length);for(let e=i;e<s;e++){const i=e+1;r.push(`${i===t?">":" "} ${i}: ${n[e]}`)}return r.join("\n")}
1_getShaderErrors(e,t,n){const r=e.getShaderParameter(t,e.COMPILE_STATUS),i=e.getShaderInfoLog(t).trim();if(r&&""===i)return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const r=parseInt(s[1]);return n.toUpperCase()+"\n\n"+i+"\n\n"+this._handleSource(e.getShaderSource(t),r)}return i}_logProgramError(e,t,n){if(this.renderer.debug.checkShaderErrors){const r=this.gl;r.getProgramInfoLog(e).trim();if(!1===r.getProgramParameter(e,r.LINK_STATUS))if("function"==typeof this.renderer.debug.onShaderError)this.renderer.debug.onShaderError(r,e,n,t);else{this._getShaderErrors(r,n,"vertex"),this._getShaderErrors(r,t,"fragment")}}}_completeCompile(e,t){const{state:n,gl:r}=this,i=this.get(t),{programGPU:s,fragmentShader:a,vertexShader:o}=i;!1===r.getProgramParameter(s,r.LINK_STATUS)&&this._logProgramError(s,a,o),n.useProgram(s);const l=e.getBindings();this._setupBindings(l,s),this.set(t,{programGPU:s})}createComputePipeline(e,t){const{state:n,gl:r}=this,i={stage:"fragment",code:"#version 300 es\nprecision highp float;\nvoid main() {}"};this.createProgram(i);const{computeProgram:s}=e,a=r.createProgram(),o=this.get(i).shaderGPU,l=this.get(s).shaderGPU,u=s.transforms,c=[],h=[];for(let e=0;e<u.length;e++){const t=u[e];c.push(t.varyingName),h.push(t.attributeNode)}r.attachShader(a,o),r.attachShader(a,l),r.transformFeedbackVaryings(a,c,r.SEPARATE_ATTRIBS),r.linkProgram(a),!1===r.getProgramParameter(a,r.LINK_STATUS)&&this._logProgramError(a,o,l),n.useProgram(a),this._setupBindings(t,a);const A=s.attributes,d=[],p=[];for(let e=0;e<A.length;e++){const t=A[e].node.attribute;d.push(t),this.has(t)||this.attributeUtils.createAttribute(t,r.ARRAY_BUFFER)}for(let e=0;e<h.length;e++){const t=h[e].attribute;this.has(t)||this.attributeUtils.createAttribute(t,r.ARRAY_BUFFER);const n=this.get(t);p.push(n)}this.set(e,{programGPU:a,transformBuffers:p,attributes:d})}createBindings(e,t){if(!1===this._knownBindings.has(t)){this._knownBindings.add(t);let e=0,n=0;for(const r of t){this.set(r,{textures:n,uniformBuffers:e});for(const t of r.bindings)t.isUniformBuffer&&e++,t.isSampledTexture&&n++}}this.updateBindings(e,t)}updateBindings(e){const{gl:t}=this,n=this.get(e);let r=n.uniformBuffers,i=n.textures;for(const n of e.bindings)if(n.isUniformsGroup||n.isUniformBuffer){const e=n.buffer,i=t.createBuffer();t.bindBuffer(t.UNIFORM_BUFFER,i),t.bufferData(t.UNIFORM_BUFFER,e,t.DYNAMIC_DRAW),this.set(n,{index:r++,bufferGPU:i})}else if(n.isSampledTexture){const{textureGPU:e,glTextureType:t}=this.get(n.texture);this.set(n,{index:i++,textureGPU:e,glTextureType:t})}}updateBinding(e){const t=this.gl;if(e.isUniformsGroup||e.isUniformBuffer){const n=this.get(e).bufferGPU,r=e.buffer;t.bindBuffer(t.UNIFORM_BUFFER,n),t.bufferData(t.UNIFORM_BUFFER,r,t.DYNAMIC_DRAW)}}createIndexAttribute(e){const t=this.gl;this.attributeUtils.createAttribute(e,t.ELEMENT_ARRAY_BUFFER)}createAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}createStorageAttribute(e){if(this.has(e))return;const t=this.gl;this.attributeUtils.createAttribute(e,t.ARRAY_BUFFER)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}hasFeature(e){const t=Object.keys(uF).filter((t=>uF[t]===e)),n=this.extensions;for(let e=0;e<t.length;e++)if(n.has(t[e]))return!0;return!1}getMaxAnisotropy(){return this.capabilities.getMaxAnisotropy()}copyTextureToTexture(e,t,n=null,r=null,i=0,s=0){this.textureUtils.copyTextureToTexture(e,t,n,r,i,s)}copyFramebufferToTexture(e,t,n){this.textureUtils.copyFramebufferToTexture(e,t,n)}_setFramebuffer(e){const{gl:t,state:n}=this;let r=null;if(null!==e.textures){const i=e.renderTarget,s=this.get(i),{samples:a,depthBuffer:o,stencilBuffer:l}=i,u=!0===i.isWebGLCubeRenderTarget,c=!0===i.isRenderTarget3D,h=i.depth>1,A=!0===i.isXRRenderTarget,d=!0===A&&!0===i.hasExternalTextures;let p=s.msaaFrameBuffer,f=s.depthRenderbuffer;const m=this.extensions.get("WEBGL_multisampled_render_to_texture"),g=this.extensions.get("OVR_multiview2"),_=this._useMultisampledExtension(i),v=uP(e);let y;if(u?(s.cubeFramebuffers||(s.cubeFramebuffers={}),y=s.cubeFramebuffers[v]):A&&!1===d?y=this._xrFramebuffer:(s.framebuffers||(s.framebuffers={}),y=s.framebuffers[v]),void 0===y){y=t.createFramebuffer(),n.bindFramebuffer(t.FRAMEBUFFER,y);const r=e.textures,o=[];if(u){s.cubeFramebuffers[v]=y;const{textureGPU:e}=this.get(r[0]),n=this.renderer._activeCubeFace;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+n,e,0)}else{s.framebuffers[v]=y;for(let n=0;n<r.length;n++){const s=r[n],o=this.get(s);o.renderTarget=e.renderTarget,o.cacheKey=v;const l=t.COLOR_ATTACHMENT0+n;if(i.multiview)g.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,l,o.textureGPU,0,a,0,2);else if(c||h){const e=this.renderer._activeCubeFace;t.framebufferTextureLayer(t.FRAMEBUFFER,l,o.textureGPU,0,e)}else _?m.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,l,t.TEXTURE_2D,o.textureGPU,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,l,t.TEXTURE_2D,o.textureGPU,0)}n.drawBuffers(e,y)}const A=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(!0===i.autoAllocateDepthBuffer){const n=t.createRenderbuffer();this.textureUtils.setupRenderBufferStorage(n,e,0,_),s.xrDepthRenderbuffer=n,o.push(l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT),t.bindRenderbuffer(t.RENDERBUFFER,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,A,t.RENDERBUFFER,n)}else if(null!==e.depthTexture){o.push(l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT);const n=this.get(e.depthTexture);if(n.renderTarget=e.renderTarget,n.cacheKey=v,i.multiview)g.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,A,n.textureGPU,0,a,0,2);else if(d&&_)m.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,A,t.TEXTURE_2D,n.textureGPU,0,a);else if(e.depthTexture.isArrayTexture){const e=this.renderer._activeCubeFace;t.framebufferTextureLayer(t.FRAMEBUFFER,A,n.textureGPU,0,e)}else t.framebufferTexture2D(t.FRAMEBUFFER,A,t.TEXTURE_2D,n.textureGPU,0)}s.depthInvalidationArray=o}else{if(this._isRenderCameraDepthArray(e)){n.bindFramebuffer(t.FRAMEBUFFER,y);const r=this.renderer._activeCubeFace,i=this.get(e.depthTexture),s=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.framebufferTextureLayer(t.FRAMEBUFFER,s,i.textureGPU,0,r)}if(A||_||i.multiview){n.bindFramebuffer(t.FRAMEBUFFER,y);const r=this.get(e.textures[0]);i.multiview?g.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,r.textureGPU,0,a,0,2):_?m.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r.textureGPU,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r.textureGPU,0);const o=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;if(!0===i.autoAllocateDepthBuffer){const e=s.xrDepthRenderbuffer;t.bindRenderbuffer(t.RENDERBUFFER,e),t.framebufferRenderbuffer(t.FRAMEBUFFER,o,t.RENDERBUFFER,e)}else{const n=this.get(e.depthTexture);i.multiview?g.framebufferTextureMultisampleMultiviewOVR(t.FRAMEBUFFER,o,n.textureGPU,0,a,0,2):_?m.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,o,t.TEXTURE_2D,n.textureGPU,0,a):t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,n.textureGPU,0)}}}if(a>0&&!1===_&&!i.multiview){if(void 0===p){const r=[];p=t.createFramebuffer(),n.bindFramebuffer(t.FRAMEBUFFER,p);const i=[],u=e.textures;for(let n=0;n<u.length;n++){if(i[n]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,i[n]),r.push(t.COLOR_ATTACHMENT0+n),o){const e=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;r.push(e)}const s=e.textures[n],u=this.get(s);t.renderbufferStorageMultisample(t.RENDERBUFFER,a,u.glInternalFormat,e.width,e.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+n,t.RENDERBUFFER,i[n])}
1if(s.msaaFrameBuffer=p,s.msaaRenderbuffers=i,void 0===f){f=t.createRenderbuffer(),this.textureUtils.setupRenderBufferStorage(f,e,a),s.depthRenderbuffer=f;const n=l?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;r.push(n)}s.invalidationArray=r}r=s.msaaFrameBuffer}else r=y}n.bindFramebuffer(t.FRAMEBUFFER,r)}_getVaoKey(e){let t="";for(let n=0;n<e.length;n++)t+=":"+this.get(e[n]).id;return t}_createVao(e){const{gl:t}=this,n=t.createVertexArray();let r="",i=!0;t.bindVertexArray(n);for(let n=0;n<e.length;n++){const s=e[n],a=this.get(s);let o,l;r+=":"+a.id,t.bindBuffer(t.ARRAY_BUFFER,a.bufferGPU),t.enableVertexAttribArray(n),(s.isStorageBufferAttribute||s.isStorageInstancedBufferAttribute)&&(i=!1),!0===s.isInterleavedBufferAttribute?(o=s.data.stride*a.bytesPerElement,l=s.offset*a.bytesPerElement):(o=0,l=0),a.isInteger?t.vertexAttribIPointer(n,s.itemSize,a.type,o,l):t.vertexAttribPointer(n,s.itemSize,a.type,s.normalized,o,l),s.isInstancedBufferAttribute&&!s.isInterleavedBufferAttribute?t.vertexAttribDivisor(n,s.meshPerAttribute):s.isInterleavedBufferAttribute&&s.data.isInstancedInterleavedBuffer&&t.vertexAttribDivisor(n,s.data.meshPerAttribute)}return t.bindBuffer(t.ARRAY_BUFFER,null),this.vaoCache[r]=n,{vaoGPU:n,staticVao:i}}_getTransformFeedback(e){let t="";for(let n=0;n<e.length;n++)t+=":"+e[n].id;let n=this.transformFeedbackCache[t];if(void 0!==n)return n;const{gl:r}=this;n=r.createTransformFeedback(),r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,n);for(let t=0;t<e.length;t++){const n=e[t];r.bindBufferBase(r.TRANSFORM_FEEDBACK_BUFFER,t,n.transformBuffer)}return r.bindTransformFeedback(r.TRANSFORM_FEEDBACK,null),this.transformFeedbackCache[t]=n,n}_setupBindings(e,t){const n=this.gl;for(const r of e)for(const e of r.bindings){const r=this.get(e).index;if(e.isUniformsGroup||e.isUniformBuffer){const i=n.getUniformBlockIndex(t,e.name);n.uniformBlockBinding(t,i,r)}else if(e.isSampledTexture){const i=n.getUniformLocation(t,e.name);n.uniform1i(i,r)}}}_bindUniforms(e){const{gl:t,state:n}=this;for(const r of e)for(const e of r.bindings){const r=this.get(e),i=r.index;e.isUniformsGroup||e.isUniformBuffer?n.bindBufferBase(t.UNIFORM_BUFFER,i,r.bufferGPU):e.isSampledTexture&&n.bindTexture(r.glTextureType,r.textureGPU,t.TEXTURE0+i)}}_useMultisampledExtension(e){return!0===e.multiview||e.samples>0&&!0===this.extensions.has("WEBGL_multisampled_render_to_texture")&&!1!==e.autoAllocateDepthBuffer}dispose(){const e=this.extensions.get("WEBGL_lose_context");e&&e.loseContext(),this.renderer.domElement.removeEventListener("webglcontextlost",this._onContextLost)}}const fF="triangle-strip",mF="never",gF="less",_F="equal",vF="less-equal",yF="greater",xF="not-equal",bF="greater-equal",wF="always",TF="store",SF="load",MF="clear",EF="ccw",CF="uint16",RF="uint32",NF="r8unorm",PF="r8snorm",DF="r8uint",LF="r8sint",IF="r16uint",OF="r16sint",BF="r16float",UF="rg8unorm",FF="rg8snorm",kF="rg8uint",qF="rg8sint",VF="r32uint",zF="r32sint",GF="r32float",jF="rg16uint",HF="rg16sint",WF="rg16float",XF="rgba8unorm",QF="rgba8unorm-srgb",YF="rgba8snorm",$F="rgba8uint",KF="rgba8sint",ZF="bgra8unorm",JF="bgra8unorm-srgb",ek="rgb9e5ufloat",tk="rgb10a2unorm",nk="rgb10a2unorm",rk="rg32uint",ik="rg32sint",sk="rg32float",ak="rgba16uint",ok="rgba16sint",lk="rgba16float",uk="rgba32uint",ck="rgba32sint",hk="rgba32float",Ak="depth24plus",dk="depth24plus-stencil8",pk="depth32float",fk="depth32float-stencil8",mk="bc1-rgba-unorm",gk="bc1-rgba-unorm-srgb",_k="bc2-rgba-unorm",vk="bc2-rgba-unorm-srgb",yk="bc3-rgba-unorm",xk="bc3-rgba-unorm-srgb",bk="etc2-rgb8unorm",wk="etc2-rgb8unorm-srgb",Tk="etc2-rgba8unorm",Sk="etc2-rgba8unorm-srgb",Mk="astc-4x4-unorm",Ek="astc-4x4-unorm-srgb",Ck="astc-5x4-unorm",Rk="astc-5x4-unorm-srgb",Nk="astc-5x5-unorm",Pk="astc-5x5-unorm-srgb",Dk="astc-6x5-unorm",Lk="astc-6x5-unorm-srgb",Ik="astc-6x6-unorm",Ok="astc-6x6-unorm-srgb",Bk="astc-8x5-unorm",Uk="astc-8x5-unorm-srgb",Fk="astc-8x6-unorm",kk="astc-8x6-unorm-srgb",qk="astc-8x8-unorm",Vk="astc-8x8-unorm-srgb",zk="astc-10x5-unorm",Gk="astc-10x5-unorm-srgb",jk="astc-10x6-unorm",Hk="astc-10x6-unorm-srgb",Wk="astc-10x8-unorm",Xk="astc-10x8-unorm-srgb",Qk="astc-10x10-unorm",Yk="astc-10x10-unorm-srgb",$k="astc-12x10-unorm",Kk="astc-12x10-unorm-srgb",Zk="astc-12x12-unorm",Jk="astc-12x12-unorm-srgb",eq="linear",tq="nearest",nq="zero",rq="one",iq="src",sq="one-minus-src",aq="src-alpha",oq="one-minus-src-alpha",lq="add",uq="unfilterable-float",cq="2d",hq="2d-array",Aq="cube",dq="3d",pq="vertex",fq="instance",mq={DepthClipControl:"depth-clip-control",Depth32FloatStencil8:"depth32float-stencil8",TextureCompressionBC:"texture-compression-bc",TextureCompressionETC2:"texture-compression-etc2",TextureCompressionASTC:"texture-compression-astc",TimestampQuery:"timestamp-query",IndirectFirstInstance:"indirect-first-instance",ShaderF16:"shader-f16",RG11B10UFloat:"rg11b10ufloat-renderable",BGRA8UNormStorage:"bgra8unorm-storage",Float32Filterable:"float32-filterable",ClipDistances:"clip-distances",DualSourceBlending:"dual-source-blending",Subgroups:"subgroups"};class gq extends SU{constructor(e,t){super(e),this.texture=t,this.version=t?t.version:0,this.isSampler=!0}}class _q extends gq{constructor(e,t,n){super(e,t?t.value:null),this.textureNode=t,this.groupNode=n}update(){this.texture=this.textureNode.value}}class vq extends MU{constructor(e,t){super(e,t?t.array:null),this.attribute=t,this.isStorageBuffer=!0}}let yq=0;class xq extends vq{constructor(e,t){super("StorageBuffer_"+yq++,e?e.value:null),this.nodeUniform=e,this.access=e?e.access:fv.READ_WRITE,this.groupNode=t}get buffer(){return this.nodeUniform.value}}class bq extends VN{constructor(e){super(),this.device=e,this.mipmapSampler=e.createSampler({minFilter:eq}),this.flipYSampler=e.createSampler({minFilter:tq}),this.transferPipelines={},this.flipYPipelines={}
1,this.mipmapVertexShaderModule=e.createShaderModule({label:"mipmapVertex",code:"\nstruct VarysStruct {\n\t@builtin( position ) Position: vec4<f32>,\n\t@location( 0 ) vTex : vec2<f32>\n};\n\n@vertex\nfn main( @builtin( vertex_index ) vertexIndex : u32 ) -> VarysStruct {\n\n\tvar Varys : VarysStruct;\n\n\tvar pos = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( -1.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 ),\n\t\tvec2<f32>( -1.0, -1.0 ),\n\t\tvec2<f32>( 1.0, -1.0 )\n\t);\n\n\tvar tex = array< vec2<f32>, 4 >(\n\t\tvec2<f32>( 0.0, 0.0 ),\n\t\tvec2<f32>( 1.0, 0.0 ),\n\t\tvec2<f32>( 0.0, 1.0 ),\n\t\tvec2<f32>( 1.0, 1.0 )\n\t);\n\n\tVarys.vTex = tex[ vertexIndex ];\n\tVarys.Position = vec4<f32>( pos[ vertexIndex ], 0.0, 1.0 );\n\n\treturn Varys;\n\n}\n"}),this.mipmapFragmentShaderModule=e.createShaderModule({label:"mipmapFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vTex );\n\n}\n"}),this.flipYFragmentShaderModule=e.createShaderModule({label:"flipYFragment",code:"\n@group( 0 ) @binding( 0 )\nvar imgSampler : sampler;\n\n@group( 0 ) @binding( 1 )\nvar img : texture_2d<f32>;\n\n@fragment\nfn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {\n\n\treturn textureSample( img, imgSampler, vec2( vTex.x, 1.0 - vTex.y ) );\n\n}\n"})}getTransferPipeline(e){let t=this.transferPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`mipmap-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.mipmapFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:fF,stripIndexFormat:RF},layout:"auto"}),this.transferPipelines[e]=t),t}getFlipYPipeline(e){let t=this.flipYPipelines[e];return void 0===t&&(t=this.device.createRenderPipeline({label:`flipY-${e}`,vertex:{module:this.mipmapVertexShaderModule,entryPoint:"main"},fragment:{module:this.flipYFragmentShaderModule,entryPoint:"main",targets:[{format:e}]},primitive:{topology:fF,stripIndexFormat:RF},layout:"auto"}),this.flipYPipelines[e]=t),t}flipY(e,t,n=0){const r=t.format,{width:i,height:s}=t.size,a=this.getTransferPipeline(r),o=this.getFlipYPipeline(r),l=this.device.createTexture({size:{width:i,height:s,depthOrArrayLayers:1},format:r,usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.TEXTURE_BINDING}),u=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:cq,baseArrayLayer:n}),c=l.createView({baseMipLevel:0,mipLevelCount:1,dimension:cq,baseArrayLayer:0}),h=this.device.createCommandEncoder({}),A=(e,t,n)=>{const r=e.getBindGroupLayout(0),i=this.device.createBindGroup({layout:r,entries:[{binding:0,resource:this.flipYSampler},{binding:1,resource:t}]}),s=h.beginRenderPass({colorAttachments:[{view:n,loadOp:MF,storeOp:TF,clearValue:[0,0,0,0]}]});s.setPipeline(e),s.setBindGroup(0,i),s.draw(4,1,0,0),s.end()};A(a,u,c),A(o,c,u),this.device.queue.submit([h.finish()]),l.destroy()}generateMipmaps(e,t,n=0){const r=this.get(e);void 0===r.useCount&&(r.useCount=0,r.layers=[]);const i=r.layers[n]||this._mipmapCreateBundles(e,t,n),s=this.device.createCommandEncoder({});this._mipmapRunBundles(s,i),this.device.queue.submit([s.finish()]),0!==r.useCount&&(r.layers[n]=i),r.useCount++}_mipmapCreateBundles(e,t,n){const r=this.getTransferPipeline(t.format),i=r.getBindGroupLayout(0);let s=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:cq,baseArrayLayer:n});const a=[];for(let o=1;o<t.mipLevelCount;o++){const l=this.device.createBindGroup({layout:i,entries:[{binding:0,resource:this.mipmapSampler},{binding:1,resource:s}]}),u=e.createView({baseMipLevel:o,mipLevelCount:1,dimension:cq,baseArrayLayer:n}),c={colorAttachments:[{view:u,loadOp:MF,storeOp:TF,clearValue:[0,0,0,0]}]},h=this.device.createRenderBundleEncoder({colorFormats:[t.format]});h.setPipeline(r),h.setBindGroup(0,l),h.draw(4,1,0,0),a.push({renderBundles:[h.finish()],passDescriptor:c}),s=u}return a}_mipmapRunBundles(e,t){const n=t.length;for(let r=0;r<n;r++){const n=t[r],i=e.beginRenderPass(n.passDescriptor);i.executeBundles(n.renderBundles),i.end()}}}const wq={512:"never",[Ne]:"less",514:"equal",[Pe]:"less-equal",516:"greater",518:"greater-equal",519:"always",517:"not-equal"},Tq=[0,1,3,2,4,5];class Sq{constructor(e){this.backend=e,this._passUtils=null,this.defaultTexture={},this.defaultCubeTexture={},this.defaultVideoFrame=null,this.colorBuffer=null,this.depthTexture=new Mi,this.depthTexture.name="depthBuffer"}createSampler(e){const t=this.backend,n=t.device,r=t.get(e),i={addressModeU:this._convertAddressMode(e.wrapS),addressModeV:this._convertAddressMode(e.wrapT),addressModeW:this._convertAddressMode(e.wrapR),magFilter:this._convertFilterMode(e.magFilter),minFilter:this._convertFilterMode(e.minFilter),mipmapFilter:this._convertFilterMode(e.minFilter),maxAnisotropy:1};i.magFilter===eq&&i.minFilter===eq&&i.mipmapFilter===eq&&(i.maxAnisotropy=e.anisotropy),e.isDepthTexture&&null!==e.compareFunction&&(i.compare=wq[e.compareFunction]),r.sampler=n.createSampler(i)}createDefaultTexture(e){let t;const n=Mq(e);e.isCubeTexture?t=this._getDefaultCubeTextureGPU(n):e.isVideoTexture?this.backend.get(e).externalTexture=this._getDefaultVideoFrame():t=this._getDefaultTextureGPU(n),this.backend.get(e).texture=t}
1createTexture(e,t={}){const n=this.backend,r=n.get(e);if(r.initialized)throw new Error("WebGPUTextureUtils: Texture already initialized.");void 0===t.needsMipmaps&&(t.needsMipmaps=!1),void 0===t.levels&&(t.levels=1),void 0===t.depth&&(t.depth=1);const{width:i,height:s,depth:a,levels:o}=t;e.isFramebufferTexture&&(t.renderTarget?t.format=this.backend.utils.getCurrentColorFormat(t.renderTarget):t.format=this.backend.utils.getPreferredCanvasFormat());const l=this._getDimension(e),u=e.internalFormat||t.format||Mq(e,n.device);r.format=u;const{samples:c,primarySamples:h,isMSAA:A}=n.utils.getTextureSampleData(e);let d=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC;!0===e.isStorageTexture&&(d|=GPUTextureUsage.STORAGE_BINDING),!0!==e.isCompressedTexture&&!0!==e.isCompressedArrayTexture&&(d|=GPUTextureUsage.RENDER_ATTACHMENT);const p={label:e.name,size:{width:i,height:s,depthOrArrayLayers:a},mipLevelCount:o,sampleCount:h,dimension:l,format:u,usage:d};if(e.isVideoTexture){const t=e.source.data,n=new VideoFrame(t);p.size.width=n.displayWidth,p.size.height=n.displayHeight,n.close(),r.externalTexture=t}else{if(void 0===u)return void this.createDefaultTexture(e);e.isCubeTexture&&(p.textureBindingViewDimension=Aq),r.texture=n.device.createTexture(p)}if(A){const e=Object.assign({},p);e.label=e.label+"-msaa",e.sampleCount=c,r.msaaTexture=n.device.createTexture(e)}r.initialized=!0,r.textureDescriptorGPU=p}destroyTexture(e){const t=this.backend,n=t.get(e);void 0!==n.texture&&n.texture.destroy(),void 0!==n.msaaTexture&&n.msaaTexture.destroy(),t.delete(e)}destroySampler(e){delete this.backend.get(e).sampler}generateMipmaps(e){const t=this.backend.get(e);if(e.isCubeTexture)for(let e=0;e<6;e++)this._generateMipmaps(t.texture,t.textureDescriptorGPU,e);else{const n=e.image.depth||1;for(let e=0;e<n;e++)this._generateMipmaps(t.texture,t.textureDescriptorGPU,e)}}getColorBuffer(){this.colorBuffer&&this.colorBuffer.destroy();const e=this.backend,{width:t,height:n}=e.getDrawingBufferSize();return this.colorBuffer=e.device.createTexture({label:"colorBuffer",size:{width:t,height:n,depthOrArrayLayers:1},sampleCount:e.utils.getSampleCount(e.renderer.samples),format:e.utils.getPreferredCanvasFormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC}),this.colorBuffer}getDepthBuffer(e=!0,t=!1){const n=this.backend,{width:r,height:i}=n.getDrawingBufferSize(),s=this.depthTexture,a=n.get(s).texture;let o,l;if(t?(o=q,l=I):e&&(o=k,l=R),void 0!==a){if(s.image.width===r&&s.image.height===i&&s.format===o&&s.type===l)return a;this.destroyTexture(s)}return s.name="depthBuffer",s.format=o,s.type=l,s.image.width=r,s.image.height=i,this.createTexture(s,{width:r,height:i}),n.get(s).texture}updateTexture(e,t){const n=this.backend.get(e),{textureDescriptorGPU:r}=n;if(!e.isRenderTargetTexture&&void 0!==r){if(e.isDataTexture)this._copyBufferToTexture(t.image,n.texture,r,0,e.flipY);else if(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)for(let i=0;i<t.image.depth;i++)this._copyBufferToTexture(t.image,n.texture,r,i,e.flipY,i);else if(e.isCompressedTexture||e.isCompressedArrayTexture)this._copyCompressedBufferToTexture(e.mipmaps,n.texture,r);else if(e.isCubeTexture)this._copyCubeMapToTexture(t.images,n.texture,r,e.flipY,e.premultiplyAlpha);else if(e.isVideoTexture){const t=e.source.data;n.externalTexture=t}else this._copyImageToTexture(t.image,n.texture,r,0,e.flipY,e.premultiplyAlpha);n.version=e.version,e.onUpdate&&e.onUpdate(e)}}async copyTextureToBuffer(e,t,n,r,i,s){const a=this.backend.device,o=this.backend.get(e),l=o.texture,u=o.textureDescriptorGPU.format,c=this._getBytesPerTexel(u);let h=r*c;h=256*Math.ceil(h/256);const A=a.createBuffer({size:r*i*c,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),d=a.createCommandEncoder();d.copyTextureToBuffer({texture:l,origin:{x:t,y:n,z:s}},{buffer:A,bytesPerRow:h},{width:r,height:i});const p=this._getTypedArrayType(u);return a.queue.submit([d.finish()]),await A.mapAsync(GPUMapMode.READ),new p(A.getMappedRange())}_getDefaultTextureGPU(e){let t=this.defaultTexture[e];if(void 0===t){const n=new _t;n.minFilter=_,n.magFilter=_,this.createTexture(n,{width:1,height:1,format:e}),this.defaultTexture[e]=t=n}return this.backend.get(t).texture}_getDefaultCubeTextureGPU(e){let t=this.defaultTexture[e];if(void 0===t){const n=new kr;n.minFilter=_,n.magFilter=_,this.createTexture(n,{width:1,height:1,depth:6}),this.defaultCubeTexture[e]=t=n}return this.backend.get(t).texture}_getDefaultVideoFrame(){let e=this.defaultVideoFrame;if(null===e){const t={timestamp:0,codedWidth:1,codedHeight:1,format:"RGBA"};
1this.defaultVideoFrame=e=new VideoFrame(new Uint8Array([0,0,0,255]),t)}return e}_copyCubeMapToTexture(e,t,n,r,i){for(let s=0;s<6;s++){const a=e[s],o=!0===r?Tq[s]:s;a.isDataTexture?this._copyBufferToTexture(a.image,t,n,o,r):this._copyImageToTexture(a,t,n,o,r,i)}}_copyImageToTexture(e,t,n,r,i,s){this.backend.device.queue.copyExternalImageToTexture({source:e,flipY:i},{texture:t,mipLevel:0,origin:{x:0,y:0,z:r},premultipliedAlpha:s},{width:e.width,height:e.height,depthOrArrayLayers:1})}_getPassUtils(){let e=this._passUtils;return null===e&&(this._passUtils=e=new bq(this.backend.device)),e}_generateMipmaps(e,t,n=0){this._getPassUtils().generateMipmaps(e,t,n)}_flipY(e,t,n=0){this._getPassUtils().flipY(e,t,n)}_copyBufferToTexture(e,t,n,r,i,s=0){const a=this.backend.device,o=e.data,l=this._getBytesPerTexel(n.format),u=e.width*l;a.queue.writeTexture({texture:t,mipLevel:0,origin:{x:0,y:0,z:r}},o,{offset:e.width*e.height*l*s,bytesPerRow:u},{width:e.width,height:e.height,depthOrArrayLayers:1}),!0===i&&this._flipY(t,n,r)}_copyCompressedBufferToTexture(e,t,n){const r=this.backend.device,i=this._getBlockData(n.format),s=n.size.depthOrArrayLayers>1;for(let a=0;a<e.length;a++){const o=e[a],l=o.width,u=o.height,c=s?n.size.depthOrArrayLayers:1,h=Math.ceil(l/i.width)*i.byteLength,A=h*Math.ceil(u/i.height);for(let e=0;e<c;e++)r.queue.writeTexture({texture:t,mipLevel:a,origin:{x:0,y:0,z:e}},o.data,{offset:e*A,bytesPerRow:h,rowsPerImage:Math.ceil(u/i.height)},{width:Math.ceil(l/i.width)*i.width,height:Math.ceil(u/i.height)*i.height,depthOrArrayLayers:1})}}_getBlockData(e){return e===mk||e===gk?{byteLength:8,width:4,height:4}:e===_k||e===vk||e===yk||e===xk?{byteLength:16,width:4,height:4}:"bc4-r-unorm"===e||"bc4-r-snorm"===e?{byteLength:8,width:4,height:4}:"bc5-rg-unorm"===e||"bc5-rg-snorm"===e||"bc6h-rgb-ufloat"===e||"bc6h-rgb-float"===e||"bc7-rgba-unorm"===e||"bc7-rgba-srgb"===e?{byteLength:16,width:4,height:4}:e===bk||e===wk||"etc2-rgb8a1unorm"===e||"etc2-rgb8a1unorm-srgb"===e?{byteLength:8,width:4,height:4}:e===Tk||e===Sk?{byteLength:16,width:4,height:4}:"eac-r11unorm"===e||"eac-r11snorm"===e?{byteLength:8,width:4,height:4}:"eac-rg11unorm"===e||"eac-rg11snorm"===e||e===Mk||e===Ek?{byteLength:16,width:4,height:4}:e===Ck||e===Rk?{byteLength:16,width:5,height:4}:e===Nk||e===Pk?{byteLength:16,width:5,height:5}:e===Dk||e===Lk?{byteLength:16,width:6,height:5}:e===Ik||e===Ok?{byteLength:16,width:6,height:6}:e===Bk||e===Uk?{byteLength:16,width:8,height:5}:e===Fk||e===kk?{byteLength:16,width:8,height:6}:e===qk||e===Vk?{byteLength:16,width:8,height:8}:e===zk||e===Gk?{byteLength:16,width:10,height:5}:e===jk||e===Hk?{byteLength:16,width:10,height:6}:e===Wk||e===Xk?{byteLength:16,width:10,height:8}:e===Qk||e===Yk?{byteLength:16,width:10,height:10}:e===$k||e===Kk?{byteLength:16,width:12,height:10}:e===Zk||e===Jk?{byteLength:16,width:12,height:12}:void 0}_convertAddressMode(e){let t="clamp-to-edge";return e===f?t="repeat":e===g&&(t="mirror-repeat"),t}_convertFilterMode(e){let t=eq;return e!==_&&e!==v&&e!==y||(t=tq),t}_getBytesPerTexel(e){return e===NF||e===PF||e===DF||e===LF?1:e===IF||e===OF||e===BF||e===UF||e===FF||e===kF||e===qF?2:e===VF||e===zF||e===GF||e===jF||e===HF||e===WF||e===XF||e===QF||e===YF||e===$F||e===KF||e===ZF||e===JF||e===ek||e===tk||e===nk||e===pk||e===Ak||e===dk||e===fk?4:e===rk||e===ik||e===sk||e===ak||e===ok||e===lk?8:e===uk||e===ck||e===hk?16:void 0}_getTypedArrayType(e){return e===DF?Uint8Array:e===LF?Int8Array:e===NF?Uint8Array:e===PF?Int8Array:e===kF?Uint8Array:e===qF?Int8Array:e===UF?Uint8Array:e===FF?Int8Array:e===$F?Uint8Array:e===KF?Int8Array:e===XF?Uint8Array:e===YF?Int8Array:e===IF?Uint16Array:e===OF?Int16Array:e===jF?Uint16Array:e===HF?Int16Array:e===ak?Uint16Array:e===ok?Int16Array:e===BF||e===WF||e===lk?Uint16Array:e===VF?Uint32Array:e===zF?Int32Array:e===GF?Float32Array:e===rk?Uint32Array:e===ik?Int32Array:e===sk?Float32Array:e===uk?Uint32Array:e===ck?Int32Array:e===hk?Float32Array:e===ZF||e===JF?Uint8Array:e===tk||e===ek||e===nk?Uint32Array:e===pk?Float32Array:e===Ak||e===dk?Uint32Array:e===fk?Float32Array:void 0}_getDimension(e){let t;return t=e.isData3DTexture?"3d":"2d",t}}function Mq(e,t=null){const n=e.format,r=e.type,i=e.colorSpace,s=ut.getTransfer(i);let a;if(!0===e.isCompressedTexture||!0===e.isCompressedArrayTexture)switch(n){case X:a=s===Ce?gk:mk;break;case Q:a=s===Ce?vk:_k;break;case Y:a=s===Ce?xk:yk;break;case te:a=s===Ce?wk:bk;break;case ne:a=s===Ce?Sk:Tk;break;case re:a=s===Ce?Ek:Mk;break;case ie:a=s===Ce?Rk:Ck;break;case se:a=s===Ce?Pk:Nk;break;case ae:a=s===Ce?Lk:Dk;break;case oe:a=s===Ce?Ok:Ik;break;case le:a=s===Ce?Uk:Bk;break;case ue:a=s===Ce?kk:Fk;break;case ce:a=s===Ce?Vk:qk;break;case he:a=s===Ce?Gk:zk;break;case Ae:a=s===Ce?Hk:jk;break;case de:a=s===Ce?Xk:Wk;break;case pe:a=s===Ce?Yk:Qk;break;case fe:a=s===Ce?Kk:$k;break;case me:a=s===Ce?Jk:Zk;break;case F:a=s===Ce?QF:XF;break;default:}else switch(n){case F:switch(r){case S:a=YF;break;case M:a=ok;break;case E:a=ak;break;case R:a=uk;break;case C:a=ck;break;case T:a=s===Ce?QF:XF;break;case P:a=lk;break;case N:a=hk;break;default:}break;case U:r===O&&(a=ek);break;case V:switch(r){case S:a=PF;break;case M:a=OF;break;case E:a=IF;break;case R:a=VF;break;case C:a=zF;break;case T:a=NF;break;case P:a=BF;break;case N:a=GF;break;default:}break;case G:switch(r){case S:a=FF;break;case M:a=HF;break;case E:a=jF;break;case R:a=rk;break;case C:a=ik;break;case T:a=UF;break;case P:a=WF;break;case N:a=sk;break;default:}break;case k:switch(r){case E:a="depth16unorm";break;case R:a=Ak;break;case N:a=pk;break;default:}break;case q:switch(r){case I:a=dk;break;case N:t&&t.features.has(mq.Depth32FloatStencil8),a=fk;break;default:}break;case z:switch(r){case C:a=zF;break;case R:a=VF;break;default:}break;case j:switch(r){case C:a=ik;break;case R:a=rk;break;default:}break;case H:switch(r){case C:a=ck;break;case R:a=uk;break;default:}break;default:}return a}const Eq=/^[fn]*\s*([a-z_0-9]+)?\s*\(([\s\S]*?)\)\s*[\-\>]*\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/i,Cq=/([a-z_0-9]+)\s*:\s*([a-z_0-9]+(?:<[\s\S]+?>)?)/gi,Rq={f32:"float",i32:"int",u32:"uint",bool:"bool","vec2<f32>":"vec2","vec2<i32>":"ivec2","vec2<u32>":"uvec2","vec2<bool>":"bvec2",vec2f:"vec2",vec2i:"ivec2",vec2u:"uvec2",vec2b:"bvec2","vec3<f32>":"vec3","vec3<i32>":"ivec3","vec3<u32>":"uvec3","vec3<bool>":"bvec3",vec3f:"vec3",vec3i:"ivec3",vec3u:"uvec3",vec3b:"bvec3","vec4<f32>":"vec4","vec4<i32>":"ivec4","vec4<u32>":"uvec4","vec4<bool>":"bvec4",vec4f:"vec4",vec4i:"ivec4",vec4u:"uvec4",vec4b:"bvec4","mat2x2<f32>":"mat2",mat2x2f:"mat2","mat3x3<f32>":"mat3",mat3x3f:"mat3","mat4x4<f32>
1":"mat4",mat4x4f:"mat4",sampler:"sampler",texture_1d:"texture",texture_2d:"texture",texture_2d_array:"texture",texture_multisampled_2d:"cubeTexture",texture_depth_2d:"depthTexture",texture_depth_2d_array:"depthTexture",texture_depth_multisampled_2d:"depthTexture",texture_depth_cube:"depthTexture",texture_depth_cube_array:"depthTexture",texture_3d:"texture3D",texture_cube:"cubeTexture",texture_cube_array:"cubeTexture",texture_storage_1d:"storageTexture",texture_storage_2d:"storageTexture",texture_storage_2d_array:"storageTexture",texture_storage_3d:"storageTexture"};class Nq extends jB{constructor(e){const{type:t,inputs:n,name:r,inputsCode:i,blockCode:s,outputType:a}=(e=>{const t=(e=e.trim()).match(Eq);if(null!==t&&4===t.length){const n=t[2],r=[];let i=null;for(;null!==(i=Cq.exec(n));)r.push({name:i[1],type:i[2]});const s=[];for(let e=0;e<r.length;e++){const{name:t,type:n}=r[e];let i=n;i.startsWith("ptr")?i="pointer":(i.startsWith("texture")&&(i=n.split("<")[0]),i=Rq[i]),s.push(new NB(i,t))}const a=e.substring(t[0].length),o=t[3]||"void",l=void 0!==t[1]?t[1]:"";return{type:Rq[o]||o,inputs:s,name:l,inputsCode:n,blockCode:a,outputType:o}}throw new Error("FunctionNode: Function is not a WGSL code.")})(e);super(t,n,r),this.inputsCode=i,this.blockCode=s,this.outputType=a}getCode(e=this.name){const t="void"!==this.outputType?"-> "+this.outputType:"";return`fn ${e} ( ${this.inputsCode.trim()} ) ${t}`+this.blockCode}}class Pq extends GB{parseFunction(e){return new Nq(e)}}const Dq="undefined"!=typeof self?self.GPUShaderStage:{VERTEX:1,FRAGMENT:2,COMPUTE:4},Lq={[fv.READ_ONLY]:"read",[fv.WRITE_ONLY]:"write",[fv.READ_WRITE]:"read_write"},Iq={[f]:"repeat",[m]:"clamp",[g]:"mirror"},Oq={vertex:Dq?Dq.VERTEX:1,fragment:Dq?Dq.FRAGMENT:2,compute:Dq?Dq.COMPUTE:4},Bq={instance:!0,swizzleAssign:!1,storageBuffer:!0},Uq={"^^":"tsl_xor"},Fq={float:"f32",int:"i32",uint:"u32",bool:"bool",color:"vec3<f32>",vec2:"vec2<f32>",ivec2:"vec2<i32>",uvec2:"vec2<u32>",bvec2:"vec2<bool>",vec3:"vec3<f32>",ivec3:"vec3<i32>",uvec3:"vec3<u32>",bvec3:"vec3<bool>",vec4:"vec4<f32>",ivec4:"vec4<i32>",uvec4:"vec4<u32>",bvec4:"vec4<bool>",mat2:"mat2x2<f32>",mat3:"mat3x3<f32>",mat4:"mat4x4<f32>"},kq={},qq={tsl_xor:new iL("fn tsl_xor( a : bool, b : bool ) -> bool { return ( a || b ) && !( a && b ); }"),mod_float:new iL("fn tsl_mod_float( x : f32, y : f32 ) -> f32 { return x - y * floor( x / y ); }"),mod_vec2:new iL("fn tsl_mod_vec2( x : vec2f, y : vec2f ) -> vec2f { return x - y * floor( x / y ); }"),mod_vec3:new iL("fn tsl_mod_vec3( x : vec3f, y : vec3f ) -> vec3f { return x - y * floor( x / y ); }"),mod_vec4:new iL("fn tsl_mod_vec4( x : vec4f, y : vec4f ) -> vec4f { return x - y * floor( x / y ); }"),equals_bool:new iL("fn tsl_equals_bool( a : bool, b : bool ) -> bool { return a == b; }"),equals_bvec2:new iL("fn tsl_equals_bvec2( a : vec2f, b : vec2f ) -> vec2<bool> { return vec2<bool>( a.x == b.x, a.y == b.y ); }"),equals_bvec3:new iL("fn tsl_equals_bvec3( a : vec3f, b : vec3f ) -> vec3<bool> { return vec3<bool>( a.x == b.x, a.y == b.y, a.z == b.z ); }"),equals_bvec4:new iL("fn tsl_equals_bvec4( a : vec4f, b : vec4f ) -> vec4<bool> { return vec4<bool>( a.x == b.x, a.y == b.y, a.z == b.z, a.w == b.w ); }"),repeatWrapping_float:new iL("fn tsl_repeatWrapping_float( coord: f32 ) -> f32 { return fract( coord ); }"),mirrorWrapping_float:new iL("fn tsl_mirrorWrapping_float( coord: f32 ) -> f32 { let mirrored = fract( coord * 0.5 ) * 2.0; return 1.0 - abs( 1.0 - mirrored ); }"),clampWrapping_float:new iL("fn tsl_clampWrapping_float( coord: f32 ) -> f32 { return clamp( coord, 0.0, 1.0 ); }"),biquadraticTexture:new iL("\nfn tsl_biquadraticTexture( map : texture_2d<f32>, coord : vec2f, iRes : vec2u, level : u32 ) -> vec4f {\n\n\tlet res = vec2f( iRes );\n\n\tlet uvScaled = coord * res;\n\tlet uvWrapping = ( ( uvScaled % res ) + res ) % res;\n\n\t// https://www.shadertoy.com/view/WtyXRy\n\n\tlet uv = uvWrapping - 0.5;\n\tlet iuv = floor( uv );\n\tlet f = fract( uv );\n\n\tlet rg1 = textureLoad( map, vec2u( iuv + vec2( 0.5, 0.5 ) ) % iRes, level );\n\tlet rg2 = textureLoad( map, vec2u( iuv + vec2( 1.5, 0.5 ) ) % iRes, level );\n\tlet rg3 = textureLoad( map, vec2u( iuv + vec2( 0.5, 1.5 ) ) % iRes, level );\n\tlet rg4 = textureLoad( map, vec2u( iuv + vec2( 1.5, 1.5 ) ) % iRes, level );\n\n\treturn mix( mix( rg1, rg2, f.x ), mix( rg3, rg4, f.x ), f.y );\n\n}\n")},Vq={dFdx:"dpdx",dFdy:"- dpdy",mod_float:"tsl_mod_float",mod_vec2:"tsl_mod_vec2",mod_vec3:"tsl_mod_vec3",mod_vec4:"tsl_mod_vec4",equals_bool:"tsl_equals_bool",equals_bvec2:"tsl_equals_bvec2",equals_bvec3:"tsl_equals_bvec3",equals_bvec4:"tsl_equals_bvec4",inversesqrt:"inverseSqrt",bitcast:"bitcast<f32>"};"undefined"!=typeof navigator&&/Windows/g.test(navigator.userAgent)&&(qq.pow_float=ne
1w iL("fn tsl_pow_float( a : f32, b : f32 ) -> f32 { return select( -pow( -a, b ), pow( a, b ), a > 0.0 ); }"),qq.pow_vec2=new iL("fn tsl_pow_vec2( a : vec2f, b : vec2f ) -> vec2f { return vec2f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ) ); }",[qq.pow_float]),qq.pow_vec3=new iL("fn tsl_pow_vec3( a : vec3f, b : vec3f ) -> vec3f { return vec3f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ) ); }",[qq.pow_float]),qq.pow_vec4=new iL("fn tsl_pow_vec4( a : vec4f, b : vec4f ) -> vec4f { return vec4f( tsl_pow_float( a.x, b.x ), tsl_pow_float( a.y, b.y ), tsl_pow_float( a.z, b.z ), tsl_pow_float( a.w, b.w ) ); }",[qq.pow_float]),Vq.pow_float="tsl_pow_float",Vq.pow_vec2="tsl_pow_vec2",Vq.pow_vec3="tsl_pow_vec3",Vq.pow_vec4="tsl_pow_vec4");let zq="";!0!==("undefined"!=typeof navigator&&/Firefox|Deno/g.test(navigator.userAgent))&&(zq+="diagnostic( off, derivative_uniformity );\n");class Gq extends CB{constructor(e,t){super(e,t,new Pq),this.uniformGroups={},this.builtins={},this.directives={},this.scopedArrays=new Map}needsToWorkingColorSpace(e){return!0===e.isVideoTexture&&e.colorSpace!==Te}_generateTextureSample(e,t,n,r,i=this.shaderStage){return"fragment"===i?r?`textureSample( ${t}, ${t}_sampler, ${n}, ${r} )`:`textureSample( ${t}, ${t}_sampler, ${n} )`:this._generateTextureSampleLevel(e,t,n,"0",r)}_generateVideoSample(e,t,n=this.shaderStage){if("fragment"===n)return`textureSampleBaseClampToEdge( ${e}, ${e}_sampler, vec2<f32>( ${t}.x, 1.0 - ${t}.y ) )`}_generateTextureSampleLevel(e,t,n,r,i){return!1===this.isUnfilterable(e)?`textureSampleLevel( ${t}, ${t}_sampler, ${n}, ${r} )`:this.isFilteredTexture(e)?this.generateFilteredTexture(e,t,n,r):this.generateTextureLod(e,t,n,i,r)}generateWrapFunction(e){const t=`tsl_coord_${Iq[e.wrapS]}S_${Iq[e.wrapT]}_${e.isData3DTexture?"3d":"2d"}T`;let n=kq[t];if(void 0===n){const r=[],i=e.isData3DTexture?"vec3f":"vec2f";let s=`fn ${t}( coord : ${i} ) -> ${i} {\n\n\treturn ${i}(\n`;const a=(e,t)=>{e===f?(r.push(qq.repeatWrapping_float),s+=`\t\ttsl_repeatWrapping_float( coord.${t} )`):e===m?(r.push(qq.clampWrapping_float),s+=`\t\ttsl_clampWrapping_float( coord.${t} )`):e===g?(r.push(qq.mirrorWrapping_float),s+=`\t\ttsl_mirrorWrapping_float( coord.${t} )`):s+=`\t\tcoord.${t}`};a(e.wrapS,"x"),s+=",\n",a(e.wrapT,"y"),e.isData3DTexture&&(s+=",\n",a(e.wrapR,"z")),s+="\n\t);\n\n}\n",kq[t]=n=new iL(s,r)}return n.build(this),t}generateArrayDeclaration(e,t){return`array< ${this.getType(e)}, ${t} >`}generateTextureDimension(e,t,n){const r=this.getDataFromNode(e,this.shaderStage,this.globalCache);void 0===r.dimensionsSnippet&&(r.dimensionsSnippet={});let i=r.dimensionsSnippet[n];if(void 0===r.dimensionsSnippet[n]){let s,a;const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(e),l=o>1;a=e.isData3DTexture?"vec3<u32>":"vec2<u32>",s=l||e.isVideoTexture||e.isStorageTexture?t:`${t}${n?`, u32( ${n} )`:""}`,i=new Sw(new sT(`textureDimensions( ${s} )`,a)),r.dimensionsSnippet[n]=i,(e.isArrayTexture||e.isDataArrayTexture||e.isData3DTexture)&&(r.arrayLayerCount=new Sw(new sT(`textureNumLayers(${t})`,"u32"))),e.isTextureCube&&(r.cubeFaceCount=new Sw(new sT("6u","u32")))}return i.build(this)}generateFilteredTexture(e,t,n,r="0u"){return this._include("biquadraticTexture"),`tsl_biquadraticTexture( ${t}, ${this.generateWrapFunction(e)}( ${n} ), ${this.generateTextureDimension(e,t,r)}, u32( ${r} ) )`}generateTextureLod(e,t,n,r,i="0u"){const s=this.generateWrapFunction(e),a=this.generateTextureDimension(e,t,i),o=e.isData3DTexture?"vec3":"vec2",l=`${o}<u32>( ${s}( ${n} ) * ${o}<f32>( ${a} ) )`;return this.generateTextureLoad(e,t,l,r,i)}generateTextureLoad(e,t,n,r,i="0u"){let s;return!0===e.isVideoTexture?s=`textureLoad( ${t}, ${n} )`:r?s=`textureLoad( ${t}, ${n}, ${r}, u32( ${i} ) )`:(s=`textureLoad( ${t}, ${n}, u32( ${i} ) )`,this.renderer.backend.compatibilityMode&&e.isDepthTexture&&(s+=".x")),s}generateTextureStore(e,t,n,r,i){let s;return s=r?`textureStore( ${t}, ${n}, ${r}, ${i} )`:`textureStore( ${t}, ${n}, ${i} )`,s}isSampleCompare(e){return!0===e.isDepthTexture&&null!==e.compareFunction}isUnfilterable(e){return"float"!==this.getComponentTypeFromTexture(e)||!this.isAvailable("float32Filterable")&&!0===e.isDataTexture&&e.type===N||!1===this.isSampleCompare(e)&&e.minFilter===_&&e.magFilter===_||this.renderer.backend.utils.getTextureSampleData(e).primarySamples>1}generateTexture(e,t,n,r,i=this.shaderStage){let s=null;return s=!0===e.isVideoTexture?this._generateVideoSample(t,n,i):this.isUnfilterable(e)?this.generateTextureLod(e,t,n,r,"0",i):this._generateTextureSample(e,t,n,r,i),s}generateTextureGrad(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return`textureSampleGrad( ${t}, ${t}_sampler, ${n}, ${r[0]}, ${r[1]} )`}generateTextureCompare(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return!0===e.isDepthTexture&&!0===e.isArrayTexture?`textureSampleCompare( ${t}, ${t}_sampler, ${n}, ${i}, ${r} )`:`textureSampleCompare( ${t}, ${t}_sampler, ${n}, ${r} )`}generateTextureLevel(e,t,n,r,i,s=this.shaderStage){let a=null;return a=!0===e.isVideoTexture?this._generateVideoSample(t,n,s):this._generateTextureSampleLevel(e,t,n,r,i),a}generateTextureBias(e,t,n,r,i,s=this.shaderStage){if("fragment"===s)return`textureSampleBias( ${t}, ${t}_sampler, ${n}, ${r} )`}getPropertyName(e,t=this.shaderStage){if(!0===e.isNodeVarying&&!0===e.needsInterpolation){if("vertex"===t)return`varyings.${e.name}`}else if(!0===e.isNodeUniform){const t=e.name,n=e.type;return"texture"===n||"cubeTexture"===n||"storageTexture"===n||"texture3D"===n?t:"buffer"===n||"storageBuffer"===n||"indirectStorageBuffer"===n?this.isCu
vendor: 6,079 bytes, line 1
1stomStruct(e)?t:t+".value":e.groupNode.name+"."+t}return super.getPropertyName(e)}getOutputStructName(){return"output"}getFunctionOperator(e){const t=Uq[e];return void 0!==t?(this._include(t),t):null}getNodeAccess(e,t){return"compute"!==t?fv.READ_ONLY:e.access}getStorageAccess(e,t){return Lq[this.getNodeAccess(e,t)]}getUniformFromNode(e,t,n,r=null){const i=super.getUniformFromNode(e,t,n,r),s=this.getDataFromNode(e,n,this.globalCache);if(void 0===s.uniformGPU){let a;const o=e.groupNode,l=o.name,u=this.getBindGroupArray(l,n);if("texture"===t||"cubeTexture"===t||"storageTexture"===t||"texture3D"===t){let r=null;const s=this.getNodeAccess(e,n);if("texture"===t||"storageTexture"===t?r=new OU(i.name,i.node,o,s):"cubeTexture"===t?r=new BU(i.name,i.node,o,s):"texture3D"===t&&(r=new UU(i.name,i.node,o,s)),r.store=!0===e.isStorageTextureNode,r.setVisibility(Oq[n]),!1===this.isUnfilterable(e.value)&&!1===r.store){const e=new _q(`${i.name}_sampler`,i.node,o);e.setVisibility(Oq[n]),u.push(e,r),a=[e,r]}else u.push(r),a=[r]}else if("buffer"===t||"storageBuffer"===t||"indirectStorageBuffer"===t){const s=new("buffer"===t?RU:xq)(e,o);s.setVisibility(Oq[n]),u.push(s),a=s,i.name=r||"NodeBuffer_"+i.id}else{const e=this.uniformGroups[n]||(this.uniformGroups[n]={});let r=e[l];void 0===r&&(r=new DU(l,o),r.setVisibility(Oq[n]),e[l]=r,u.push(r)),a=this.getNodeUniform(i,t),r.addUniform(a)}s.uniformGPU=a}return i}getBuiltin(e,t,n,r=this.shaderStage){const i=this.builtins[r]||(this.builtins[r]=new Map);return!1===i.has(e)&&i.set(e,{name:e,property:t,type:n}),t}hasBuiltin(e,t=this.shaderStage){return void 0!==this.builtins[t]&&this.builtins[t].has(e)}getVertexIndex(){return"vertex"===this.shaderStage?this.getBuiltin("vertex_index","vertexIndex","u32","attribute"):"vertexIndex"}buildFunctionCode(e){const t=e.layout,n=this.flowShaderNode(e),r=[];for(const e of t.inputs)r.push(e.name+" : "+this.getType(e.type));let i=`fn ${t.name}( ${r.join(", ")} ) -> ${this.getType(t.type)} {\n${n.vars}\n${n.code}\n`;return n.result&&(i+=`\treturn ${n.result};\n`),i+="\n}\n",i}getInstanceIndex(){return"vertex"===this.shaderStage?this.getBuiltin("instance_index","instanceIndex","u32","attribute"):"instanceIndex"}getInvocationLocalIndex(){return this.getBuiltin("local_invocation_index","invocationLocalIndex","u32","attribute")}getSubgroupSize(){return this.enableSubGroups(),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute")}getInvocationSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_invocation_id","invocationSubgroupIndex","u32","attribute")}getSubgroupIndex(){return this.enableSubGroups(),this.getBuiltin("subgroup_id","subgroupIndex","u32","attribute")}getDrawIndex(){return null}getFrontFacing(){return this.getBuiltin("front_facing","isFront","bool")}getFragCoord(){return this.getBuiltin("position","fragCoord","vec4<f32>")+".xy"}getFragDepth(){return"output."+this.getBuiltin("frag_depth","depth","f32","output")}getClipDistance(){return"varyings.hw_clip_distances"}isFlipY(){return!1}enableDirective(e,t=this.shaderStage){(this.directives[t]||(this.directives[t]=new Set)).add(e)}getDirectives(e){const t=[],n=this.directives[e];if(void 0!==n)for(const e of n)t.push(`enable ${e};`);return t.join("\n")}enableSubGroups(){this.enableDirective("subgroups")}enableSubgroupsF16(){this.enableDirective("subgroups-f16")}enableClipDistances(){this.enableDirective("clip_distances")}enableShaderF16(){this.enableDirective("f16")}enableDualSourceBlending(){this.enableDirective("dual_source_blending")}enableHardwareClipping(e){this.enableClipDistances(),this.getBuiltin("clip_distances","hw_clip_distances",`array<f32, ${e} >`,"vertex")}getBuiltins(e){const t=[],n=this.builtins[e];if(void 0!==n)for(const{name:e,property:r,type:i}of n.values())t.push(`@builtin( ${e} ) ${r} : ${i}`);return t.join(",\n\t")}getScopedArray(e,t,n,r){return!1===this.scopedArrays.has(e)&&this.scopedArrays.set(e,{name:e,scope:t,bufferType:n,bufferCount:r}),e}getScopedArrays(e){if("compute"!==e)return;const t=[];for(const{name:e,scope:n,bufferType:r,bufferCount:i}of this.scopedArrays.values()){const s=this.getType(r);t.push(`var<${n}> ${e}: array< ${s}, ${i} >;`)}return t.join("\n")}getAttributes(e){const t=[];if("compute"===e&&(this.getBuiltin("global_invocation_id","globalId","vec3<u32>","attribute"),this.getBuiltin("workgroup_id","workgroupId","vec3<u32>","attribute"),this.getBuiltin("local_invocation_id","localId","vec3<u32>","attribute"),this.getBuiltin("num_workgroups","numWorkgroups","vec3<u32>","attribute"),this.renderer.hasFeature("subgroups")&&(this.enableDirective("subgroups",e),this.getBuiltin("subgroup_size","subgroupSize","u32","attribute"))),"vertex"===e||"compute"===e){const e=this.getBuiltins("attribute");e&&t.push(e);const n=this.getAttributesArray();for(let e=0,r=n.length;e<r;e++){const r=n[e],i=r.name,s=this.getType(r.type);t.push(`@location( ${e} ) ${i} : ${s}`)}}return t.join(",\n\t")}getStructMembers(e){const t=[];for(const n of e.members){const r=e.output?"@location( "+n.index+" ) ":"";let i=this.getType(n.type);n.atomic&&(i="atomic< "+i+" >"),t.push(`\t${r+n.name} : ${i}`)}return e.output&&t.push(`\t${this.getBuiltins("output")}`),t.join(",\n")}getStructs(e){let t="";const n=this.structs[e];if(n.length>0){const e=[];for(const t of n){let n=`struct ${t.name} {\n`;n+=this.getStructMembers(t),n+="\n};",e.push(n)}t="\n"+e.join("\n\n")+"\n"}return t}getVar(e,t,n=null){let r=`var ${t} : `;return r+=null!==n?this.generateArrayDeclaration(e,n):this.getType(e),r}getVars(e){const t=[],n=this.vars[e];if(void 0!==n)for(const e of n)t.push(`\t${this.getVar(e.type,e.name,e.count)};`);return`\n${t.join("\n")}\n`}getVaryings(e){const t=[];if("vertex"===e&&this.getBuiltin("position","Vertex","vec4<f32>","vertex"),"vertex"===e||"fragment"===e){const n=this.varyings,r=this.vars[e];for(let i=0;i<n.length;i++){const s=n[i];if(s.needsInterpolation){let e=`@location( ${i} )`;if(s.interpolationType){const t=null!==s.interpolationSampling?`, ${s.interpolationSampling} )`:" )";e+=` @interpolate( ${s.interpolationType}${t}`}
1else/^(int|uint|ivec|uvec)/.test(s.type)&&(e+=` @interpolate( ${this.renderer.backend.compatibilityMode?"flat, either":"flat"} )`);t.push(`${e} ${s.name} : ${this.getType(s.type)}`)}else"vertex"===e&&!1===r.includes(s)&&r.push(s)}}const n=this.getBuiltins(e);n&&t.push(n);const r=t.join(",\n\t");return"vertex"===e?this._getWGSLStruct("VaryingsStruct","\t"+r):r}isCustomStruct(e){const t=e.value,n=e.node,r=(t.isBufferAttribute||t.isInstancedBufferAttribute)&&null!==n.structTypeNode,i=n.value&&n.value.array&&"number"==typeof n.value.itemSize&&n.value.array.length>n.value.itemSize;return r&&!i}getUniforms(e){const t=this.uniforms[e],n=[],r=[],i=[],s={};for(const i of t){const t=i.groupNode.name,a=this.bindingsIndexes[t];if("texture"===i.type||"cubeTexture"===i.type||"storageTexture"===i.type||"texture3D"===i.type){const t=i.node.value;let r;!1===this.isUnfilterable(t)&&!0!==i.node.isStorageTextureNode&&(this.isSampleCompare(t)?n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler_comparison;`):n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name}_sampler : sampler;`));let s="";const{primarySamples:o}=this.renderer.backend.utils.getTextureSampleData(t);o>1&&(s="_multisampled"),r=!0===t.isCubeTexture?"texture_cube<f32>":!0===t.isDepthTexture?this.renderer.backend.compatibilityMode&&null===t.compareFunction?`texture${s}_2d<f32>`:`texture_depth${s}_2d${!0===t.isArrayTexture?"_array":""}`:!0===t.isArrayTexture||!0===t.isDataArrayTexture||!0===t.isCompressedArrayTexture?"texture_2d_array<f32>":!0===t.isVideoTexture?"texture_external":!0===t.isData3DTexture?"texture_3d<f32>":!0===i.node.isStorageTextureNode?`texture_storage_2d<${Mq(t)}, ${this.getStorageAccess(i.node,e)}>`:`texture${s}_2d<${this.getComponentTypeFromTexture(t).charAt(0)}32>`,n.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var ${i.name} : ${r};`)}else if("buffer"===i.type||"storageBuffer"===i.type||"indirectStorageBuffer"===i.type){const t=i.node,n=this.getType(t.getNodeType(this)),s=t.bufferCount,o=s>0&&"buffer"===i.type?", "+s:"",l=t.isStorageBufferNode?`storage, ${this.getStorageAccess(t,e)}`:"uniform";if(this.isCustomStruct(i))r.push(`@binding( ${a.binding++} ) @group( ${a.group} ) var<${l}> ${i.name} : ${n};`);else{const e=`\tvalue : array< ${t.isAtomic?`atomic<${n}>`:`${n}`}${o} >`;r.push(this._getWGSLStructBinding(i.name,e,l,a.binding++,a.group))}}else{const e=this.getType(this.getVectorType(i.type)),t=i.groupNode.name;(s[t]||(s[t]={index:a.binding++,id:a.group,snippets:[]})).snippets.push(`\t${i.name} : ${e}`)}}for(const e in s){const t=s[e];i.push(this._getWGSLStructBinding(e,t.snippets.join(",\n"),"uniform",t.index,t.id))}let a=n.join("\n");return a+=r.join("\n"),a+=i.join("\n"),a}buildCode(){const e=null!==this.material?{fragment:{},vertex:{}}:{compute:{}};this.sortBindingGroups();for(const t in e){this.shaderStage=t;const n=e[t];n.uniforms=this.getUniforms(t),n.attributes=this.getAttributes(t),n.varyings=this.getVaryings(t),n.structs=this.getStructs(t),n.vars=this.getVars(t),n.codes=this.getCodes(t),n.directives=this.getDirectives(t),n.scopedArrays=this.getScopedArrays(t);let r="// code\n\n";r+=this.flowCode[t];const i=this.flowNodes[t],s=i[i.length-1],a=s.outputNode,o=void 0!==a&&!0===a.isOutputStructNode;for(const e of i){const i=this.getFlowData(e),l=e.name;if(l&&(r.length>0&&(r+="\n"),r+=`\t// flow -> ${l}\n`),r+=`${i.code}\n\t`,e===s&&"compute"!==t)if(r+="// result\n\n\t","vertex"===t)r+=`varyings.Vertex = ${i.result};`;else if("fragment"===t)if(o)n.returnType=a.getNodeType(this),n.structs+="var<private> output : "+n.returnType+";",r+=`return ${i.result};`;else{let e="\t@location(0) color: vec4<f32>";const t=this.getBuiltins("output");t&&(e+=",\n\t"+t),n.returnType="OutputStruct",n.structs+=this._getWGSLStruct("OutputStruct",e),n.structs+="\nvar<private> output : OutputStruct;",r+=`output.color = ${i.result};\n\n\treturn output;`}}n.flow=r}this.shaderStage=null,null!==this.material?(this.vertexShader=this._getWGSLVertexCode(e.vertex),this.fragmentShader=this._getWGSLFragmentCode(e.fragment)):this.computeShader=this._getWGSLComputeCode(e.compute,(this.object.workgroupSize||[64]).join(", "))}getMethod(e,t=null){let n;return null!==t&&(n=this._getWGSLMethod(e+"_"+t)),void 0===n&&(n=this._getWGSLMethod(e)),n||e}getType(e){return Fq[e]||e}isAvailable(e){let t=Bq[e];return void 0===t&&("float32Filterable"===e?t=this.renderer.hasFeature("float32-filterable"):"clipDistance"===e&&(t=this.renderer.hasFeature("clip-distances")),Bq[e]=t),t}_getWGSLMethod(e){return void 0!==qq[e]&&this._include(e),Vq[e]}_include(e){const t=qq[e];return t.build(this),null!==this.currentFunctionNode&&this.currentFunctionNode.includes.push(t),t}
vendor: 5,251 bytes, line 1
1_getWGSLVertexCode(e){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// varyings\n${e.varyings}\nvar<private> varyings : VaryingsStruct;\n\n// codes\n${e.codes}\n\n@vertex\nfn main( ${e.attributes} ) -> VaryingsStruct {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n\treturn varyings;\n\n}\n`}_getWGSLFragmentCode(e){return`${this.getSignature()}\n// global\n${zq}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@fragment\nfn main( ${e.varyings} ) -> ${e.returnType} {\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLComputeCode(e,t){return`${this.getSignature()}\n// directives\n${e.directives}\n\n// system\nvar<private> instanceIndex : u32;\n\n// locals\n${e.scopedArrays}\n\n// structs\n${e.structs}\n\n// uniforms\n${e.uniforms}\n\n// codes\n${e.codes}\n\n@compute @workgroup_size( ${t} )\nfn main( ${e.attributes} ) {\n\n\t// system\n\tinstanceIndex = globalId.x + globalId.y * numWorkgroups.x * u32(${t}) + globalId.z * numWorkgroups.x * numWorkgroups.y * u32(${t});\n\n\t// vars\n\t${e.vars}\n\n\t// flow\n\t${e.flow}\n\n}\n`}_getWGSLStruct(e,t){return`\nstruct ${e} {\n${t}\n};`}_getWGSLStructBinding(e,t,n,r=0,i=0){const s=e+"Struct";return`${this._getWGSLStruct(s,t)}\n@binding( ${r} ) @group( ${i} )\nvar<${n}> ${e} : ${s};`}}class jq{constructor(e){this.backend=e}getCurrentDepthStencilFormat(e){let t;return null!==e.depthTexture?t=this.getTextureFormatGPU(e.depthTexture):e.depth&&e.stencil?t=dk:e.depth&&(t=Ak),t}getTextureFormatGPU(e){return this.backend.get(e).format}getTextureSampleData(e){let t;if(e.isFramebufferTexture)t=1;else if(e.isDepthTexture&&!e.renderTarget){const e=this.backend.renderer,n=e.getRenderTarget();t=n?n.samples:e.samples}else e.renderTarget&&(t=e.renderTarget.samples);t=t||1;const n=t>1&&null!==e.renderTarget&&!0!==e.isDepthTexture&&!0!==e.isFramebufferTexture;return{samples:t,primarySamples:n?1:t,isMSAA:n}}getCurrentColorFormat(e){let t;return t=null!==e.textures?this.getTextureFormatGPU(e.textures[0]):this.getPreferredCanvasFormat(),t}getCurrentColorSpace(e){return null!==e.textures?e.textures[0].colorSpace:this.backend.renderer.outputColorSpace}getPrimitiveTopology(e,t){return e.isPoints?"point-list":e.isLineSegments||e.isMesh&&!0===t.wireframe?"line-list":e.isLine?"line-strip":e.isMesh?"triangle-list":void 0}getSampleCount(e){let t=1;return e>1&&(t=Math.pow(2,Math.floor(Math.log2(e))),2===t&&(t=4)),t}getSampleCountRenderContext(e){return null!==e.textures?this.getSampleCount(e.sampleCount):this.getSampleCount(this.backend.renderer.samples)}getPreferredCanvasFormat(){const e=this.backend.parameters.outputType;if(void 0===e)return navigator.gpu.getPreferredCanvasFormat();if(e===T)return ZF;if(e===P)return lk;throw new Error("Unsupported outputType")}}const Hq=new Map([[Int8Array,["sint8","snorm8"]],[Uint8Array,["uint8","unorm8"]],[Int16Array,["sint16","snorm16"]],[Uint16Array,["uint16","unorm16"]],[Int32Array,["sint32","snorm32"]],[Uint32Array,["uint32","unorm32"]],[Float32Array,["float32"]]]),Wq=new Map([[rr,["float16"]]]),Xq=new Map([[Int32Array,"sint32"],[Int16Array,"sint32"],[Uint32Array,"uint32"],[Uint16Array,"uint32"],[Float32Array,"float32"]]);class Qq{constructor(e){this.backend=e}createAttribute(e,t){const n=this._getBufferAttribute(e),r=this.backend,i=r.get(n);let s=i.buffer;if(void 0===s){const a=r.device;let o=n.array;if(!1===e.normalized)if(o.constructor===Int16Array||o.constructor===Int8Array)o=new Int32Array(o);else if((o.constructor===Uint16Array||o.constructor===Uint8Array)&&(o=new Uint32Array(o),t&GPUBufferUsage.INDEX))for(let e=0;e<o.length;e++)65535===o[e]&&(o[e]=4294967295);if(n.array=o,(n.isStorageBufferAttribute||n.isStorageInstancedBufferAttribute)&&3===n.itemSize){o=new o.constructor(4*n.count);for(let e=0;e<n.count;e++)o.set(n.array.subarray(3*e,3*e+3),4*e);n.itemSize=4,n.array=o,i._force3to4BytesAlignment=!0}const l=o.byteLength,u=l+(4-l%4)%4;s=a.createBuffer({label:n.name,size:u,usage:t,mappedAtCreation:!0}),new o.constructor(s.getMappedRange()).set(o),s.unmap(),i.buffer=s}}updateAttribute(e){const t=this._getBufferAttribute(e),n=this.backend,r=n.device,i=n.get(t),s=n.get(t).buffer;let a=t.array;if(!0===i._force3to4BytesAlignment){a=new a.constructor(4*t.count);for(let e=0;e<t.count;e++)a.set(t.array.subarray(3*e,3*e+3),4*e);t.array=a}const o=this._isTypedArray(a),l=t.updateRanges;if(0===l.length)r.queue.writeBuffer(s,0,a,0);else{const e=o?1:a.BYTES_PER_ELEMENT;for(let t=0,n=l.length;t<n;t++){const n=l[t];let u,c;!0===i._force3to4BytesAlignment?(u=4*Math.floor(n.start/3)*e,c=4*Math.ceil(n.count/3)*e):(u=n.start*e,c=n.count*e);const h=u*(o?a.BYTES_PER_ELEMENT:1);r.queue.writeBuffer(s,h,a,u,c)}t.clearUpdateRanges()}}createShaderVertexBuffers(e){const t=e.getAttributes(),n=new Map;for(let e=0;e<t.length;e++){const r=t[e],i=r.array.BYTES_PER_ELEMENT,s=this._getBufferAttribute(r);let a=n.get(s);if(void 0===a){let e,t;!0===r.isInterleavedBufferAttribute?(e=r.data.stride*i,t=r.data.isInstancedInterleavedBuffer?fq:pq):(e=r.itemSize*i,t=r.isInstancedBufferAttribute?fq:pq),!1!==r.normalized||r.array.constructor!==Int16Array&&r.array.constructor!==Uint16Array||(e=4),a={arrayStri
1de:e,attributes:[],stepMode:t},n.set(s,a)}const o=this._getVertexFormat(r),l=!0===r.isInterleavedBufferAttribute?r.offset*i:0;a.attributes.push({shaderLocation:e,offset:l,format:o})}return Array.from(n.values())}destroyAttribute(e){const t=this.backend;t.get(this._getBufferAttribute(e)).buffer.destroy(),t.delete(e)}async getArrayBufferAsync(e){const t=this.backend,n=t.device,r=t.get(this._getBufferAttribute(e)).buffer,i=r.size,s=n.createBuffer({label:`${e.name}_readback`,size:i,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ}),a=n.createCommandEncoder({label:`readback_encoder_${e.name}`});a.copyBufferToBuffer(r,0,s,0,i);const o=a.finish();n.queue.submit([o]),await s.mapAsync(GPUMapMode.READ);const l=s.getMappedRange(),u=new e.array.constructor(l.slice(0));return s.unmap(),u.buffer}_getVertexFormat(e){const{itemSize:t,normalized:n}=e,r=e.array.constructor,i=e.constructor;let s;if(1===t)s=Xq.get(r);else{const e=(Wq.get(i)||Hq.get(r))[n?1:0];if(e){const n=r.BYTES_PER_ELEMENT*t,i=4*Math.floor((n+3)/4)/r.BYTES_PER_ELEMENT;if(i%1)throw new Error("THREE.WebGPUAttributeUtils: Bad vertex format item size.");s=`${e}x${i}`}}return s}_isTypedArray(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}_getBufferAttribute(e){return e.isInterleavedBufferAttribute&&(e=e.data),e}}class Yq{constructor(e){this.backend=e,this.bindGroupLayoutCache=new WeakMap}createBindingsLayout(e){const t=this.backend,n=t.device,r=[];let i=0;for(const n of e.bindings){const e={binding:i++,visibility:n.visibility};if(n.isUniformBuffer||n.isStorageBuffer){const t={};n.isStorageBuffer&&(4&n.visibility&&(n.access===fv.READ_WRITE||n.access===fv.WRITE_ONLY)?t.type="storage":t.type="read-only-storage"),e.buffer=t}else if(n.isSampler){const r={};n.texture.isDepthTexture&&(null!==n.texture.compareFunction?r.type="comparison":t.compatibilityMode&&(r.type="non-filtering")),e.sampler=r}else if(n.isSampledTexture&&n.texture.isVideoTexture)e.externalTexture={};else if(n.isSampledTexture&&n.store){const t={};t.format=this.backend.get(n.texture).texture.format;const r=n.access;t.access=r===fv.READ_WRITE?"read-write":r===fv.WRITE_ONLY?"write-only":"read-only",e.storageTexture=t}else if(n.isSampledTexture){const r={},{primarySamples:i}=t.utils.getTextureSampleData(n.texture);if(i>1&&(r.multisampled=!0,n.texture.isDepthTexture||(r.sampleType=uq)),n.texture.isDepthTexture)t.compatibilityMode&&null===n.texture.compareFunction?r.sampleType=uq:r.sampleType="depth";else if(n.texture.isDataTexture||n.texture.isDataArrayTexture||n.texture.isData3DTexture){const e=n.texture.type;e===C?r.sampleType="sint":e===R?r.sampleType="uint":e===N&&(this.backend.hasFeature("float32-filterable")?r.sampleType="float":r.sampleType=uq)}n.isSampledCubeTexture?r.viewDimension=Aq:n.texture.isArrayTexture||n.texture.isDataArrayTexture||n.texture.isCompressedArrayTexture?r.viewDimension=hq:n.isSampledTexture3D&&(r.viewDimension=dq),e.texture=r}r.push(e)}return n.createBindGroupLayout({entries:r})}createBindings(e,t,n,r=0){const{backend:i,bindGroupLayoutCache:s}=this,a=i.get(e);let o,l=s.get(e.bindingsReference);void 0===l&&(l=this.createBindingsLayout(e),s.set(e.bindingsReference,l)),n>0&&(void 0===a.groups&&(a.groups=[],a.versions=[]),a.versions[n]===r&&(o=a.groups[n])),void 0===o&&(o=this.createBindGroup(e,l),n>0&&(a.groups[n]=o,a.versions[n]=r)),a.group=o,a.layout=l}updateBinding(e){const t=this.backend,n=t.device,r=e.buffer,i=t.get(e).buffer;n.queue.writeBuffer(i,0,r,0)}createBindGroupIndex(e,t){const n=this.backend.device,r=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,i=e[0],s=n.createBuffer({label:"bindingCameraIndex_"+i,size:16,usage:r});n.queue.writeBuffer(s,0,e,0);const a=[{binding:0,resource:{buffer:s}}];return n.createBindGroup({label:"bindGroupCameraIndex_"+i,layout:t,entries:a})}createBindGroup(e,t){const n=this.backend,r=n.device;let i=0;const s=[];for(const t of e.bindings){if(t.isUniformBuffer){const e=n.get(t);if(void 0===e.buffer){const n=t.byteLength,i=GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST,s=r.createBuffer({label:"bindingBuffer_"+t.name,size:n,usage:i});e.buffer=s}s.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isStorageBuffer){const e=n.get(t);if(void 0===e.buffer){const r=t.attribute;e.buffer=n.get(r).buffer}s.push({binding:i,resource:{buffer:e.buffer}})}else if(t.isSampler){const e=n.get(t.texture);s.push({binding:i,resource:e.sampler})}else if(t.isSampledTexture){const e=n.get(t.texture);let a;if(void 0!==e.externalTexture)a=r.importExternalTexture({source:e.externalTexture});else{const n=t.store?1:e.texture.mipLevelCount,r=`view-${e.texture.width}-${e.texture.height}-${n}`;if(a=e[r],void 0===a){const i="all";let s;s=t.isSampledCubeTexture?Aq:t.isSampledTexture3D?dq:t.texture.isArrayTexture||t.texture.isDataArrayTexture||t.texture.isCompressedArrayTexture?hq:cq,a=e[r]=e.texture.createView({aspect:i,dimension:s,mipLevelCount:n})}}s.push({binding:i,resource:a})}i++}return r.createBindGroup({label:"bindGroup_"+e.name,layout:t,entries:s})}}class $q{constructor(e){this.backend=e,this._activePipelines=new WeakMap}setPipeline(e,t){this._activePipelines.get(e)!==t&&(e.setPipeline(t),this._activePipelines.set(e,t))}
1_getSampleCount(e){return this.backend.utils.getSampleCountRenderContext(e)}createRenderPipeline(e,t){const{object:n,material:r,geometry:i,pipeline:s}=e,{vertexProgram:a,fragmentProgram:o}=s,l=this.backend,u=l.device,c=l.utils,h=l.get(s),A=[];for(const t of e.getBindings()){const e=l.get(t);A.push(e.layout)}const d=l.attributeUtils.createShaderVertexBuffers(e);let p;0===r.blending||1===r.blending&&!1===r.transparent||(p=this._getBlending(r));let f={};!0===r.stencilWrite&&(f={compare:this._getStencilCompare(r),failOp:this._getStencilOperation(r.stencilFail),depthFailOp:this._getStencilOperation(r.stencilZFail),passOp:this._getStencilOperation(r.stencilZPass)});const m=this._getColorWriteMask(r),g=[];if(null!==e.context.textures){const t=e.context.textures;for(let e=0;e<t.length;e++){const n=c.getTextureFormatGPU(t[e]);g.push({format:n,blend:p,writeMask:m})}}else{const t=c.getCurrentColorFormat(e.context);g.push({format:t,blend:p,writeMask:m})}const _=l.get(a).module,v=l.get(o).module,y=this._getPrimitiveState(n,i,r),x=this._getDepthCompare(r),b=c.getCurrentDepthStencilFormat(e.context),w=this._getSampleCount(e.context),T={label:`renderPipeline_${r.name||r.type}_${r.id}`,vertex:Object.assign({},_,{buffers:d}),fragment:Object.assign({},v,{targets:g}),primitive:y,multisample:{count:w,alphaToCoverageEnabled:r.alphaToCoverage&&w>1},layout:u.createPipelineLayout({bindGroupLayouts:A})},S={},M=e.context.depth,E=e.context.stencil;if(!0!==M&&!0!==E||(!0===M&&(S.format=b,S.depthWriteEnabled=r.depthWrite,S.depthCompare=x),!0===E&&(S.stencilFront=f,S.stencilBack={},S.stencilReadMask=r.stencilFuncMask,S.stencilWriteMask=r.stencilWriteMask),!0===r.polygonOffset&&(S.depthBias=r.polygonOffsetUnits,S.depthBiasSlopeScale=r.polygonOffsetFactor,S.depthBiasClamp=0),T.depthStencil=S),null===t)h.pipeline=u.createRenderPipeline(T);else{const e=new Promise((e=>{u.createRenderPipelineAsync(T).then((t=>{h.pipeline=t,e()}))}));t.push(e)}}createBundleEncoder(e,t="renderBundleEncoder"){const n=this.backend,{utils:r,device:i}=n,s=r.getCurrentDepthStencilFormat(e),a={label:t,colorFormats:[r.getCurrentColorFormat(e)],depthStencilFormat:s,sampleCount:this._getSampleCount(e)};return i.createRenderBundleEncoder(a)}createComputePipeline(e,t){const n=this.backend,r=n.device,i=n.get(e.computeProgram).module,s=n.get(e),a=[];for(const e of t){const t=n.get(e);a.push(t.layout)}s.pipeline=r.createComputePipeline({compute:i,layout:r.createPipelineLayout({bindGroupLayouts:a})})}_getBlending(e){let t,n;const r=e.blending,i=e.blendSrc,s=e.blendDst,a=e.blendEquation;if(5===r){const r=null!==e.blendSrcAlpha?e.blendSrcAlpha:i,o=null!==e.blendDstAlpha?e.blendDstAlpha:s,l=null!==e.blendEquationAlpha?e.blendEquationAlpha:a;t={srcFactor:this._getBlendFactor(i),dstFactor:this._getBlendFactor(s),operation:this._getBlendOperation(a)},n={srcFactor:this._getBlendFactor(r),dstFactor:this._getBlendFactor(o),operation:this._getBlendOperation(l)}}else{const i=(e,r,i,s)=>{t={srcFactor:e,dstFactor:r,operation:lq},n={srcFactor:i,dstFactor:s,operation:lq}};if(e.premultipliedAlpha)switch(r){case 1:i(rq,oq,rq,oq);break;case 2:i(rq,rq,rq,rq);break;case 3:i(nq,sq,nq,rq);break;case 4:i(nq,iq,nq,aq)}else switch(r){case 1:i(aq,oq,rq,oq);break;case 2:i(aq,rq,aq,rq);break;case 3:i(nq,sq,nq,rq);break;case 4:i(nq,iq,nq,iq)}}if(void 0!==t&&void 0!==n)return{color:t,alpha:n}}_getBlendFactor(e){let t;switch(e){case o:t=nq;break;case 201:t=rq;break;case 202:t=iq;break;case 203:t=sq;break;case l:t=aq;break;case u:t=oq;break;case 208:t="dst";break;case 209:t="one-minus-dst";break;case 206:t="dst-alpha";break;case 207:t="one-minus-dst-alpha";break;case 210:t="src-alpha-saturated";break;case 211:t="constant";break;case 212:t="one-minus-constant";break;default:}return t}_getStencilCompare(e){let t;switch(e.stencilFunc){case 512:t=mF;break;case 519:t=wF;break;case 513:t=gF;break;case 515:t=vF;break;case 514:t=_F;break;case 518:t=bF;break;case 516:t=yF;break;case 517:t=xF;break;default:}return t}_getStencilOperation(e){let t;switch(e){case Re:t="keep";break;case 0:t="zero";break;case 7681:t="replace";break;case 5386:t="invert";break;case 7682:t="increment-clamp";break;case 7683:t="decrement-clamp";break;case 34055:t="increment-wrap";break;case 34056:t="decrement-wrap";break;default:}return t}_getBlendOperation(e){let t;switch(e){case a:t=lq;break;case 101:t="subtract";break;case 102:t="reverse-subtract";break;case 103:t="min";break;case 104:t="max";break;default:}return t}_getPrimitiveState(e,t,n){const r={},i=this.backend.utils;switch(r.topology=i.getPrimitiveTopology(e,n),null!==t.index&&!0===e.isLine&&!0!==e.isLineSegments&&(r.stripIndexFormat=t.index.array instanceof Uint16Array?CF:RF),n.side){case 0:r.frontFace=EF,r.cullMode="back";break;case 1:r.frontFace=EF,r.cullMode="front";break;case 2:r.frontFace=EF,r.cullMode="none";break;default:}return r}_getColorWriteMask(e){return!0===e.colorWrite?15:0}_getDepthCompare(e){let t;if(!1===e.depthTest)t=wF;else{switch(e.depthFunc){case 0:t=mF;break;case 1:t=wF;break;case 2:t=gF;break;case 3:t=vF;break;case 4:t=_F;break;case 5:t=bF;break;case 6:t=yF;break;case 7:t=xF;break;default:}}return t}}class Kq extends hF{constructor(e,t,n=2048){super(n),this.device=e,this.type=t,this.querySet=this.device.createQuerySet({type:"timestamp",count:this.maxQueries,label:`queryset_global_timestamp_${t}`});const r=8*this.maxQueries;this.resolveBuffer=this.device.createBuffer({label:`buffer_timestamp_resolve_${t}`,size:r,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.resultBuffer=this.device.createBuffer({label:`buffer_timestamp_result_${t}`,size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ})}allocateQueriesForContext(e){if(!this.trackTimestamp||this.isDisposed)return null;if(this.currentQueryIndex+2>this.maxQueries)return at(`WebGPUTimestampQueryPool [${this.type}]: Maximum number of queries exceeded, when using trackTimestamp it is necessary to resolves the queries via renderer.resolveTimestampsAsync( THREE.TimestampQuery.${this.type.toUpperCase()} ).`),null;const t=this.currentQueryIndex;return this.currentQueryIndex+=2,this.queryOffsets.set(e.id,t),t}async resolveQueriesAsync(){if(!this.trackTimestamp||0===this.currentQueryIndex||this.isDisposed)return this.lastValue;if(this.pendingResolve)return this.pendingResolve;this.pendingResolve=this._resolveQueries();try{return await this.pendingResolve}finally{this.pendingResolve=null}}async _resolveQueries(){if(this.isDisposed)return this.lastValue;try{if("unmapped"!==this.resultBuffer.mapState)return this.lastValue;const e=new Map(this.queryOffsets),t=this.currentQueryIndex,n=8*t;this.currentQueryIndex=0,this.queryOffsets.clear();const r=this.device.createCommandEncoder();r.resolveQuerySet(this.querySet,0,t,this.resolveBuffer,0),r.copyBufferToBuffer(this.resolveBuffer,0,this.resultBuffer,0,n);const i=r.finish();if(this.device.queue.submit([i]),"unmapped"!==this.resultBuffer.mapState)return this.lastValue;if(await this.resultBuffer.mapAsync(GPUMapMode.READ,0,n),this.isDisposed)return"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue;const s=new BigUint64Array(this.resultBuffer.getMappedRange(0,n));let a=0;for(const[,t]of e){const e=s[t],n=s[t+1];a+=Number(n-e)/1e6}return this.resultBuffer.unmap(),this.lastValue=a,a}catch(e){return"mapped"===this.resultBuffer.mapState&&this.resultBuffer.unmap(),this.lastValue}}async dispose(){if(!this.isDisposed){if(this.isDisposed=!0,this.pendingResolve)try{await this.pendingResolve}catch(e){}if(this.resultBuffer&&"mapped"===this.resultBuffer.mapState)try{this.resultBuffer.unmap()}catch(e){}this.querySet&&(this.querySet.destroy(),this.querySet=null),this.resolveBuffer&&(this.resolveBuffer.destroy(),this.resolveBuffer=null),this.resultBuffer&&(this.resultBuffer.destroy(),this.resultBuffer=null),this.queryOffsets.clear(),this.pendingResolve=null}}}class Zq extends XU{constructor(e={}){super(e),this.isWebGPUBackend=!0,this.parameters.alpha=void 0===e.alpha||e.alpha,this.parameters.compatibilityMode=void 0!==e.compatibilityMode&&e.compatibilityMode,this.parameters.requiredLimits=void 0===e.requiredLimits?{}:e.requiredLimits,this.compatibilityMode=this.parameters.compatibilityMode,this.device=null,this.context=null,this.colorBuffer=null,this.defaultRenderPassdescriptor=null,this.utils=new jq(this),this.attributeUtils=new Qq(this),this.bindingUtils=new Yq(this),this.pipelineUtils=new $q(this),this.textureUtils=new Sq(this),this.occludedResolveCache=new Map}async init(e){await super.init(e);const t=this.parameters;let n;if(void 0===t.device){const e={powerPreference:t.powerPreference,featureLevel:t.compatibilityMode?"compatibility":void 0},r="undefined"!=typeof navigator?await navigator.gpu.requestAdapter(e):null;if(null===r)throw new Error("WebGPUBackend: Unable to create WebGPU adapter.");const i=Object.values(mq),s=[];for(const e of i)r.features.has(e)&&s.push(e);const a={requiredFeatures:s,requiredLimits:t.requiredLimits};n=await r.requestDevice(a)}else n=t.device;n.lost.then((t=>{const n={api:"WebGPU",message:t.message||"Unknown reason",reason:t.reason||null,originalEvent:t};e.onDeviceLost(n)}));const r=void 0!==t.context?t.context:e.domElement.getContext("webgpu");this.device=n,this.context=r;const i=t.alpha?"premultiplied":"opaque";this.trackTimestamp=this.trackTimestamp&&this.hasFeature(mq.TimestampQuery),this.context.configure({device:this.device,format:this.utils.getPreferredCanvasF
1ormat(),usage:GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,alphaMode:i}),this.updateSize()}get coordinateSystem(){return Be}async getArrayBufferAsync(e){return await this.attributeUtils.getArrayBufferAsync(e)}getContext(){return this.context}_getDefaultRenderPassDescriptor(){let e=this.defaultRenderPassdescriptor;if(null===e){const t=this.renderer;e={colorAttachments:[{view:null}]},!0!==this.renderer.depth&&!0!==this.renderer.stencil||(e.depthStencilAttachment={view:this.textureUtils.getDepthBuffer(t.depth,t.stencil).createView()});const n=e.colorAttachments[0];this.renderer.samples>0?n.view=this.colorBuffer.createView():n.resolveTarget=void 0,this.defaultRenderPassdescriptor=e}const t=e.colorAttachments[0];return this.renderer.samples>0?t.resolveTarget=this.context.getCurrentTexture().createView():t.view=this.context.getCurrentTexture().createView(),e}_isRenderCameraDepthArray(e){return e.depthTexture&&e.depthTexture.image.depth>1&&e.camera.isArrayCamera}_getRenderPassDescriptor(e,t={}){const n=e.renderTarget,r=this.get(n);let i=r.descriptors;if(void 0===i||r.width!==n.width||r.height!==n.height||r.dimensions!==n.dimensions||r.activeMipmapLevel!==e.activeMipmapLevel||r.activeCubeFace!==e.activeCubeFace||r.samples!==n.samples){i={},r.descriptors=i;const e=()=>{n.removeEventListener("dispose",e),this.delete(n)};!1===n.hasEventListener("dispose",e)&&n.addEventListener("dispose",e)}const s=e.getCacheKey();let a=i[s];if(void 0===a){const t=e.textures,o=[];let l;const u=this._isRenderCameraDepthArray(e);for(let r=0;r<t.length;r++){const i=this.get(t[r]),s={label:`colorAttachment_${r}`,baseMipLevel:e.activeMipmapLevel,mipLevelCount:1,baseArrayLayer:e.activeCubeFace,arrayLayerCount:1,dimension:cq};if(n.isRenderTarget3D)l=e.activeCubeFace,s.baseArrayLayer=0,s.dimension=dq,s.depthOrArrayLayers=t[r].image.depth;else if(n.isRenderTarget&&t[r].image.depth>1)if(!0===u){const t=e.camera.cameras;for(let e=0;e<t.length;e++){const t={...s,baseArrayLayer:e,arrayLayerCount:1,dimension:cq},n=i.texture.createView(t);o.push({view:n,resolveTarget:void 0,depthSlice:void 0})}}else s.dimension=hq,s.depthOrArrayLayers=t[r].image.depth;if(!0!==u){const e=i.texture.createView(s);let t,n;void 0!==i.msaaTexture?(t=i.msaaTexture.createView(),n=e):(t=e,n=void 0),o.push({view:t,resolveTarget:n,depthSlice:l})}}if(a={textureViews:o},e.depth){const t=this.get(e.depthTexture),n={};e.depthTexture.isArrayTexture&&(n.dimension=cq,n.arrayLayerCount=1,n.baseArrayLayer=e.activeCubeFace),a.depthStencilView=t.texture.createView(n)}i[s]=a,r.width=n.width,r.height=n.height,r.samples=n.samples,r.activeMipmapLevel=e.activeMipmapLevel,r.activeCubeFace=e.activeCubeFace,r.dimensions=n.dimensions}const o={colorAttachments:[]};for(let e=0;e<a.textureViews.length;e++){const n=a.textureViews[e];let r={r:0,g:0,b:0,a:1};0===e&&t.clearValue&&(r=t.clearValue),o.colorAttachments.push({view:n.view,depthSlice:n.depthSlice,resolveTarget:n.resolveTarget,loadOp:t.loadOp||SF,storeOp:t.storeOp||TF,clearValue:r})}return a.depthStencilView&&(o.depthStencilAttachment={view:a.depthStencilView}),o}beginRender(e){const t=this.get(e),n=this.device,r=e.occlusionQueryCount;let i,s;r>0&&(t.currentOcclusionQuerySet&&t.currentOcclusionQuerySet.destroy(),t.currentOcclusionQueryBuffer&&t.currentOcclusionQueryBuffer.destroy(),t.currentOcclusionQuerySet=t.occlusionQuerySet,t.currentOcclusionQueryBuffer=t.occlusionQueryBuffer,t.currentOcclusionQueryObjects=t.occlusionQueryObjects,i=n.createQuerySet({type:"occlusion",count:r,label:`occlusionQuerySet_${e.id}`}),t.occlusionQuerySet=i,t.occlusionQueryIndex=0,t.occlusionQueryObjects=new Array(r),t.lastOcclusionObject=null),s=null===e.textures?this._getDefaultRenderPassDescriptor():this._getRenderPassDescriptor(e,{loadOp:SF}),this.initTimestampQuery(e,s),s.occlusionQuerySet=i;const a=s.depthStencilAttachment;if(null!==e.textures){const t=s.colorAttachments;for(let n=0;n<t.length;n++){const r=t[n];e.clearColor?(r.clearValue=0===n?e.clearColorValue:{r:0,g:0,b:0,a:1},r.loadOp=MF):r.loadOp=SF,r.storeOp=TF}}else{const t=s.colorAttachments[0];e.clearColor?(t.clearValue=e.clearColorValue,t.loadOp=MF):t.loadOp=SF,t.storeOp=TF}e.depth&&(e.clearDepth?(a.depthClearValue=e.clearDepthValue,a.depthLoadOp=MF):a.depthLoadOp=SF,a.depthStoreOp=TF),e.stencil&&(e.clearStencil?(a.stencilClearValue=e.clearStencilValue,a.stencilLoadOp=MF):a.stencilLoadOp=SF,a.stencilStoreOp=TF);const o=n.createCommandEncoder({label:"renderContext_"+e.id});if(!0===this._isRenderCameraDepthArray(e)){const n=e.camera.cameras;t.layerDescriptors&&t.layerDescriptors.length===n.length?this._updateDepthLayerDescriptors(e,t,n
vendor: 6,598 bytes, line 1
1):this._createDepthLayerDescriptors(e,t,s,n),t.bundleEncoders=[],t.bundleSets=[];for(let r=0;r<n.length;r++){const n=this.pipelineUtils.createBundleEncoder(e,"renderBundleArrayCamera_"+r),i={attributes:{},bindingGroups:[],pipeline:null,index:null};t.bundleEncoders.push(n),t.bundleSets.push(i)}t.currentPass=null}else{const n=o.beginRenderPass(s);if(t.currentPass=n,e.viewport&&this.updateViewport(e),e.scissor){const{x:t,y:r,width:i,height:s}=e.scissorValue;n.setScissorRect(t,r,i,s)}}t.descriptor=s,t.encoder=o,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.renderBundles=[]}_createDepthLayerDescriptors(e,t,n,r){const i=n.depthStencilAttachment;t.layerDescriptors=[];const s=this.get(e.depthTexture);s.viewCache||(s.viewCache=[]);for(let a=0;a<r.length;a++){const r={...n,colorAttachments:[{...n.colorAttachments[0],view:n.colorAttachments[a].view}]};if(n.depthStencilAttachment){const t=a;s.viewCache[t]||(s.viewCache[t]=s.texture.createView({dimension:cq,baseArrayLayer:a,arrayLayerCount:1})),r.depthStencilAttachment={view:s.viewCache[t],depthLoadOp:i.depthLoadOp||MF,depthStoreOp:i.depthStoreOp||TF,depthClearValue:i.depthClearValue||1},e.stencil&&(r.depthStencilAttachment.stencilLoadOp=i.stencilLoadOp,r.depthStencilAttachment.stencilStoreOp=i.stencilStoreOp,r.depthStencilAttachment.stencilClearValue=i.stencilClearValue)}else r.depthStencilAttachment={...i};t.layerDescriptors.push(r)}}_updateDepthLayerDescriptors(e,t,n){for(let r=0;r<n.length;r++){const n=t.layerDescriptors[r];if(n.depthStencilAttachment){const t=n.depthStencilAttachment;e.depth&&(e.clearDepth?(t.depthClearValue=e.clearDepthValue,t.depthLoadOp=MF):t.depthLoadOp=SF),e.stencil&&(e.clearStencil?(t.stencilClearValue=e.clearStencilValue,t.stencilLoadOp=MF):t.stencilLoadOp=SF)}}}finishRender(e){const t=this.get(e),n=e.occlusionQueryCount;t.renderBundles.length>0&&t.currentPass.executeBundles(t.renderBundles),n>t.occlusionQueryIndex&&t.currentPass.endOcclusionQuery();const r=t.encoder;if(!0===this._isRenderCameraDepthArray(e)){const n=[];for(let e=0;e<t.bundleEncoders.length;e++){const r=t.bundleEncoders[e];n.push(r.finish())}for(let i=0;i<t.layerDescriptors.length;i++)if(i<n.length){const s=t.layerDescriptors[i],a=r.beginRenderPass(s);if(e.viewport){const{x:t,y:n,width:r,height:i,minDepth:s,maxDepth:o}=e.viewportValue;a.setViewport(t,n,r,i,s,o)}if(e.scissor){const{x:t,y:n,width:r,height:i}=e.scissorValue;a.setScissorRect(t,n,r,i)}a.executeBundles([n[i]]),a.end()}}else t.currentPass&&t.currentPass.end();if(n>0){const r=8*n;let i=this.occludedResolveCache.get(r);void 0===i&&(i=this.device.createBuffer({size:r,usage:GPUBufferUsage.QUERY_RESOLVE|GPUBufferUsage.COPY_SRC}),this.occludedResolveCache.set(r,i));const s=this.device.createBuffer({size:r,usage:GPUBufferUsage.COPY_DST|GPUBufferUsage.MAP_READ});t.encoder.resolveQuerySet(t.occlusionQuerySet,0,n,i,0),t.encoder.copyBufferToBuffer(i,0,s,0,r),t.occlusionQueryBuffer=s,this.resolveOccludedAsync(e)}if(this.device.queue.submit([t.encoder.finish()]),null!==e.textures){const t=e.textures;for(let e=0;e<t.length;e++){const n=t[e];!0===n.generateMipmaps&&this.textureUtils.generateMipmaps(n)}}}isOccluded(e,t){const n=this.get(e);return n.occluded&&n.occluded.has(t)}async resolveOccludedAsync(e){const t=this.get(e),{currentOcclusionQueryBuffer:n,currentOcclusionQueryObjects:r}=t;if(n&&r){const e=new WeakSet;t.currentOcclusionQueryObjects=null,t.currentOcclusionQueryBuffer=null,await n.mapAsync(GPUMapMode.READ);const i=n.getMappedRange(),s=new BigUint64Array(i);for(let t=0;t<r.length;t++)s[t]===BigInt(0)&&e.add(r[t]);n.destroy(),t.occluded=e}}updateViewport(e){const{currentPass:t}=this.get(e),{x:n,y:r,width:i,height:s,minDepth:a,maxDepth:o}=e.viewportValue;t.setViewport(n,r,i,s,a,o)}getClearColor(){const e=super.getClearColor();return!0===this.renderer.alpha&&(e.r*=e.a,e.g*=e.a,e.b*=e.a),e}clear(e,t,n,r=null){const i=this.device,s=this.renderer;let a,o,l,u,c=[];if(e){const e=this.getClearColor();o={r:e.r,g:e.g,b:e.b,a:e.a}}if(null===r){l=s.depth,u=s.stencil;const t=this._getDefaultRenderPassDescriptor();if(e){c=t.colorAttachments;const e=c[0];e.clearValue=o,e.loadOp=MF,e.storeOp=TF}(l||u)&&(a=t.depthStencilAttachment)}else{l=r.depth,u=r.stencil;const i={loadOp:e?MF:SF,clearValue:e?o:void 0};l&&(i.depthLoadOp=t?MF:SF,i.depthClearValue=t?s.getClearDepth():void 0,i.depthStoreOp=TF),u&&(i.stencilLoadOp=n?MF:SF,i.stencilClearValue=n?s.getClearStencil():void 0,i.stencilStoreOp=TF);const h=this._getRenderPassDescriptor(r,i);c=h.colorAttachments,a=h.depthStencilAttachment}l&&a&&void 0===a.depthLoadOp&&(t?(a.depthLoadOp=MF,a.depthClearValue=s.getClearDepth(),a.depthStoreOp=TF):(a.depthLoadOp=SF,a.depthStoreOp=TF)),u&&a&&void 0===a.stencilLoadOp&&(n?(a.stencilLoadOp=MF,a.stencilClearValue=s.getClearStencil(),a.stencilStoreOp=TF):(a.stencilLoadOp=SF,a.stencilStoreOp=TF));const h=i.createCommandEncoder({label:"clear"});h.beginRenderPass({colorAttachments:c,depthStencilAttachment:a}).end(),i.queue.submit([h.finish()])}beginCompute(e){const t=this.get(e),n={label:"computeGroup_"+e.id};this.initTimestampQuery(e,n),t.cmdEncoderGPU=this.device.createCommandEncoder({label:"computeGroup_"+e.id}),t.passEncoderGPU=t.cmdEncoderGPU.beginComputePass(n)}compute(e,t,n,r){const{passEncoderGPU:i}=this.get(e),s=this.get(r).pipeline;this.pipelineUtils.setPipeline(i,s);for(let e=0,t=n.length;e<t;e++){const t=n[e],r=this.get(t);i.setBindGroup(e,r.group)}const a=this.device.limits.maxComputeWorkgroupsPerDimension,o=this.get(t);void 0===o.dispatchSize&&(o.dispatchSize={x:0,y:1,z:1});const{dispatchSize:l}=o;t.dispatchCount>a?(l.x=Math.min(t.dispatchCount,a),l.y=Math.ceil(t.dispatchCount/a)):l.x=t.dispatchCount,i.dispatchWorkgroups(l.x,l.y,l.z)}finishCompute(e){const t=this.get(e);t.passEncoderGPU.end(),this.device.queue.submit([t.cmdEncoderGPU.finish()])}async waitForGPU(){await this.device.queue.onSubmittedWorkDone()}draw(e,t){const{object:n,material:r,context:i,pipeline:s}=e,a=e.getBindings(),o=this.get(i),l=this.get(s).pipeline,u=e.getIndex(),c=null!==u,h=e.getDrawParameters();if(null===h)return;const A=(t,n)=>{this.pipelineUtils.setPipeline(t,l),n.pipeline=l;const s=n.bindingGroups;for(let e=0,n=a.length;e<n;e++){const n=a[e],r=this.get(n);s[n.index]!==n.id&&(t.setBindGroup(n.index,r.group),s[n.index]=n.id)}if(!0===c&&n.index!==u){const e=this.get(u).buffer,r=u.array instanceof Uint16Array?CF:RF;t.setIndexBuffer(e,r),n.index=u}const h=e.getVertexBuffers();for(let e=0,r=h.length;e<r;e++){const r=h[e];if(n.attributes[e]!==r){const i=this.get(r).buffer;t.setVertexBuffer(e,i),n.attributes[e]=r}}
vendor: 4,109 bytes, line 1
1!0===i.stencil&&!0===r.stencilWrite&&o.currentStencilRef!==r.stencilRef&&(t.setStencilReference(r.stencilRef),o.currentStencilRef=r.stencilRef)},d=(r,i)=>{if(A(r,i),!0===n.isBatchedMesh){const e=n._multiDrawStarts,i=n._multiDrawCounts,s=n._multiDrawCount,a=n._multiDrawInstances;null!==a&&at("THREE.WebGPUBackend: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.");for(let o=0;o<s;o++){const s=a?a[o]:1,l=s>1?0:o;!0===c?r.drawIndexed(i[o],s,e[o]/u.array.BYTES_PER_ELEMENT,0,l):r.draw(i[o],s,e[o],l),t.update(n,i[o],s)}}else if(!0===c){const{vertexCount:i,instanceCount:s,firstVertex:a}=h,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;r.drawIndexedIndirect(e,0)}else r.drawIndexed(i,s,a,0,0);t.update(n,i,s)}else{const{vertexCount:i,instanceCount:s,firstVertex:a}=h,o=e.getIndirect();if(null!==o){const e=this.get(o).buffer;r.drawIndirect(e,0)}else r.draw(i,s,a,0);t.update(n,i,s)}};if(e.camera.isArrayCamera&&e.camera.cameras.length>0){const t=this.get(e.camera),r=e.camera.cameras,s=e.getBindingGroup("cameraIndex");if(void 0===t.indexesGPU||t.indexesGPU.length!==r.length){const e=this.get(s),n=[],i=new Uint32Array([0,0,0,0]);for(let t=0,s=r.length;t<s;t++){i[0]=t;const r=this.bindingUtils.createBindGroupIndex(i,e.layout);n.push(r)}t.indexesGPU=n}const a=this.renderer.getPixelRatio();for(let e=0,l=r.length;e<l;e++){const l=r[e];if(n.layers.test(l.layers)){const n=l.viewport;let r=o.currentPass,u=o.currentSets;o.bundleEncoders&&(r=o.bundleEncoders[e],u=o.bundleSets[e]),n&&r.setViewport(Math.floor(n.x*a),Math.floor(n.y*a),Math.floor(n.width*a),Math.floor(n.height*a),i.viewportValue.minDepth,i.viewportValue.maxDepth),s&&t.indexesGPU&&(r.setBindGroup(s.index,t.indexesGPU[e]),u.bindingGroups[s.index]=s.id),d(r,u)}}}else if(o.currentPass){if(void 0!==o.occlusionQuerySet){const e=o.lastOcclusionObject;e!==n&&(null!==e&&!0===e.occlusionTest&&(o.currentPass.endOcclusionQuery(),o.occlusionQueryIndex++),!0===n.occlusionTest&&(o.currentPass.beginOcclusionQuery(o.occlusionQueryIndex),o.occlusionQueryObjects[o.occlusionQueryIndex]=n),o.lastOcclusionObject=n)}d(o.currentPass,o.currentSets)}}needsRenderUpdate(e){const t=this.get(e),{object:n,material:r}=e,i=this.utils,s=i.getSampleCountRenderContext(e.context),a=i.getCurrentColorSpace(e.context),o=i.getCurrentColorFormat(e.context),l=i.getCurrentDepthStencilFormat(e.context),u=i.getPrimitiveTopology(n,r);let c=!1;return t.material===r&&t.materialVersion===r.version&&t.transparent===r.transparent&&t.blending===r.blending&&t.premultipliedAlpha===r.premultipliedAlpha&&t.blendSrc===r.blendSrc&&t.blendDst===r.blendDst&&t.blendEquation===r.blendEquation&&t.blendSrcAlpha===r.blendSrcAlpha&&t.blendDstAlpha===r.blendDstAlpha&&t.blendEquationAlpha===r.blendEquationAlpha&&t.colorWrite===r.colorWrite&&t.depthWrite===r.depthWrite&&t.depthTest===r.depthTest&&t.depthFunc===r.depthFunc&&t.stencilWrite===r.stencilWrite&&t.stencilFunc===r.stencilFunc&&t.stencilFail===r.stencilFail&&t.stencilZFail===r.stencilZFail&&t.stencilZPass===r.stencilZPass&&t.stencilFuncMask===r.stencilFuncMask&&t.stencilWriteMask===r.stencilWriteMask&&t.side===r.side&&t.alphaToCoverage===r.alphaToCoverage&&t.sampleCount===s&&t.colorSpace===a&&t.colorFormat===o&&t.depthStencilFormat===l&&t.primitiveTopology===u&&t.clippingContextCacheKey===e.clippingContextCacheKey||(t.material=r,t.materialVersion=r.version,t.transparent=r.transparent,t.blending=r.blending,t.premultipliedAlpha=r.premultipliedAlpha,t.blendSrc=r.blendSrc,t.blendDst=r.blendDst,t.blendEquation=r.blendEquation,t.blendSrcAlpha=r.blendSrcAlpha,t.blendDstAlpha=r.blendDstAlpha,t.blendEquationAlpha=r.blendEquationAlpha,t.colorWrite=r.colorWrite,t.depthWrite=r.depthWrite,t.depthTest=r.depthTest,t.depthFunc=r.depthFunc,t.stencilWrite=r.stencilWrite,t.stencilFunc=r.stencilFunc,t.stencilFail=r.stencilFail,t.stencilZFail=r.stencilZFail,t.stencilZPass=r.stencilZPass,t.stencilFuncMask=r.stencilFuncMask,t.stencilWriteMask=r.stencilWriteMask,t.side=r.side,t.alphaToCoverage=r.alphaToCoverage,t.sampleCount=s,t.colorSpace
1=a,t.colorFormat=o,t.depthStencilFormat=l,t.primitiveTopology=u,t.clippingContextCacheKey=e.clippingContextCacheKey,c=!0),c}getRenderCacheKey(e){const{object:t,material:n}=e,r=this.utils,i=e.context;return[n.transparent,n.blending,n.premultipliedAlpha,n.blendSrc,n.blendDst,n.blendEquation,n.blendSrcAlpha,n.blendDstAlpha,n.blendEquationAlpha,n.colorWrite,n.depthWrite,n.depthTest,n.depthFunc,n.stencilWrite,n.stencilFunc,n.stencilFail,n.stencilZFail,n.stencilZPass,n.stencilFuncMask,n.stencilWriteMask,n.side,r.getSampleCountRenderContext(i),r.getCurrentColorSpace(i),r.getCurrentColorFormat(i),r.getCurrentDepthStencilFormat(i),r.getPrimitiveTopology(t,n),e.getGeometryCacheKey(),e.clippingContextCacheKey].join()}createSampler(e){this.textureUtils.createSampler(e)}destroySampler(e){this.textureUtils.destroySampler(e)}createDefaultTexture(e){this.textureUtils.createDefaultTexture(e)}createTexture(e,t){this.textureUtils.createTexture(e,t)}updateTexture(e,t){this.textureUtils.updateTexture(e,t)}generateMipmaps(e){this.textureUtils.generateMipmaps(e)}destroyTexture(e){this.textureUtils.destroyTexture(e)}async copyTextureToBuffer(e,t,n,r,i,s){return this.textureUtils.copyTextureToBuffer(e,t,n,r,i,s)}initTimestampQuery(e,t){if(!this.trackTimestamp)return;const n=e.isComputeNode?"compute":"render";this.timestampQueryPool[n]||(this.timestampQueryPool[n]=new Kq(this.device,n,2048));const r=this.timestampQueryPool[n],i=r.allocateQueriesForContext(e);t.timestampWrites={querySet:r.querySet,beginningOfPassWriteIndex:i,endOfPassWriteIndex:i+1}}createNodeBuilder(e,t){return new Gq(e,t)}createProgram(e){this.get(e).module={module:this.device.createShaderModule({code:e.code,label:e.stage+(""!==e.name?`_${e.name}`:"")}),entryPoint:"main"}}destroyProgram(e){this.delete(e)}createRenderPipeline(e,t){this.pipelineUtils.createRenderPipeline(e,t)}createComputePipeline(e,t){this.pipelineUtils.createComputePipeline(e,t)}beginBundle(e){const t=this.get(e);t._currentPass=t.currentPass,t._currentSets=t.currentSets,t.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.currentPass=this.pipelineUtils.createBundleEncoder(e)}finishBundle(e,t){const n=this.get(e),r=n.currentPass.finish();this.get(t).bundleGPU=r,n.currentSets=n._currentSets,n.currentPass=n._currentPass}addBundle(e,t){this.get(e).renderBundles.push(this.get(t).bundleGPU)}createBindings(e,t,n,r){this.bindingUtils.createBindings(e,t,n,r)}updateBindings(e,t,n,r){this.bindingUtils.createBindings(e,t,n,r)}updateBinding(e){this.bindingUtils.updateBinding(e)}createIndexAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.INDEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}createIndirectStorageAttribute(e){this.attributeUtils.createAttribute(e,GPUBufferUsage.STORAGE|GPUBufferUsage.INDIRECT|GPUBufferUsage.COPY_SRC|GPUBufferUsage.COPY_DST)}updateAttribute(e){this.attributeUtils.updateAttribute(e)}destroyAttribute(e){this.attributeUtils.destroyAttribute(e)}updateSize(){this.colorBuffer=this.textureUtils.getColorBuffer(),this.defaultRenderPassdescriptor=null}getMaxAnisotropy(){return 16}hasFeature(e){return this.device.features.has(e)}copyTextureToTexture(e,t,n=null,r=null,i=0,s=0){let a=0,o=0,l=0,u=0,c=0,h=0,A=e.image.width,d=e.image.height,p=1;null!==n&&(!0===n.isBox3?(u=n.min.x,c=n.min.y,h=n.min.z,A=n.max.x-n.min.x,d=n.max.y-n.min.y,p=n.max.z-n.min.z):(u=n.min.x,c=n.min.y,A=n.max.x-n.min.x,d=n.max.y-n.min.y,p=1)),null!==r&&(a=r.x,o=r.y,l=r.z||0);const f=this.device.createCommandEncoder({label:"copyTextureToTexture_"+e.id+"_"+t.id}),m=this.get(e).texture,g=this.get(t).texture;f.copyTextureToTexture({texture:m,mipLevel:i,origin:{x:u,y:c,z:h}},{texture:g,mipLevel:s,origin:{x:a,y:o,z:l}},[A,d,p]),this.device.queue.submit([f.finish()]),0===s&&t.generateMipmaps&&this.textureUtils.generateMipmaps(t)}copyFramebufferToTexture(e,t,n){const r=this.get(t);let i=null;i=t.renderTarget?e.isDepthTexture?this.get(t.depthTexture).texture:this.get(t.textures[0]).texture:e.isDepthTexture?this.textureUtils.getDepthBuffer(t.depth,t.stencil):this.context.getCurrentTexture();const s=this.get(e).texture;if(i.format!==s.format)return;let a;if(r.currentPass?(r.currentPass.end(),a=r.encoder):a=this.device.createCommandEncoder({label:"copyFramebufferToTexture_"+e.id}),a.copyTextureToTexture({texture:i,origin:[n.x,n.y,0]},{texture:s},[n.z,n.w]),r.currentPass){const{descriptor:e}=r;for(let t=0;t<e.colorAttachments.length;t++)e.colorAttachments[t].loadOp=SF;if(t.depth&&(e.depthStencilAttachment.depthLoadOp=SF),t.stencil&&(e.depthStencilAttachment.stencilLoadOp=SF),r.currentPass=a.beginRenderPass(e),r.currentSets={attributes:{},bindingGroups:[],pipeline:null,index:null},t.viewport&&this.updateViewport(t),t.scissor){const{x:e,y:n,width:i,height:s}=t.scissorValue;
1r.currentPass.setScissorRect(e,n,i,s)}}else this.device.queue.submit([a.finish()]);e.generateMipmaps&&this.textureUtils.generateMipmaps(e)}}class Jq extends Xs{constructor(e,t,n,r,i,s){super(e,t,n,r,i,s),this.iesMap=null}copy(e,t){return super.copy(e,t),this.iesMap=e.iesMap,this}}class eV extends Xs{constructor(e,t,n,r,i,s){super(e,t,n,r,i,s),this.aspect=null}copy(e,t){return super.copy(e,t),this.aspect=e.aspect,this}}class tV extends iU{constructor(){super(),this.addMaterial(LC,"MeshPhongMaterial"),this.addMaterial(gN,"MeshStandardMaterial"),this.addMaterial(vN,"MeshPhysicalMaterial"),this.addMaterial(wN,"MeshToonMaterial"),this.addMaterial(TC,"MeshBasicMaterial"),this.addMaterial(PC,"MeshLambertMaterial"),this.addMaterial(AC,"MeshNormalMaterial"),this.addMaterial(MN,"MeshMatcapMaterial"),this.addMaterial(sC,"LineBasicMaterial"),this.addMaterial(oC,"LineDashedMaterial"),this.addMaterial(PN,"PointsMaterial"),this.addMaterial(RN,"SpriteMaterial"),this.addMaterial(IN,"ShadowMaterial"),this.addLight(wI,Zs),this.addLight(PB,ta),this.addLight(OB,ra),this.addLight(BB,Xs),this.addLight(qB,na),this.addLight(VB,Vs),this.addLight(zB,sa),this.addLight(UB,Jq),this.addLight(kB,eV),this.addToneMapping(QD,1),this.addToneMapping(YD,2),this.addToneMapping($D,3),this.addToneMapping(ZD,4),this.addToneMapping(nL,6),this.addToneMapping(rL,7)}}class nV extends class{constructor(e,t={}){this.isRenderer=!0;const{logarithmicDepthBuffer:n=!1,alpha:r=!0,depth:i=!0,stencil:s=!1,antialias:a=!1,samples:o=0,getFallback:l=null,colorBufferType:u=P,multiview:c=!1}=t;this.domElement=e.getDomElement(),this.backend=e,this.samples=o||!0===a?4:0,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.alpha=r,this.logarithmicDepthBuffer=n,this.outputColorSpace=Se,this.toneMapping=0,this.toneMappingExposure=1,this.sortObjects=!0,this.depth=i,this.stencil=s,this.info=new XN,this.overrideNodes={modelViewMatrix:null,modelNormalViewMatrix:null},this.library=new iU,this.lighting=new oU,this._getFallback=l,this._pixelRatio=1,this._width=this.domElement.width,this._height=this.domElement.height,this._viewport=new vt(0,0,this._width,this._height),this._scissor=new vt(0,0,this._width,this._height),this._scissorTest=!1,this._attributes=null,this._geometries=null,this._nodes=null,this._animation=null,this._bindings=null,this._objects=null,this._pipelines=null,this._bundles=null,this._renderLists=null,this._renderContexts=null,this._textures=null,this._background=null,this._quad=new sD(new rC),this._quad.material.name="Renderer_output",this._currentRenderContext=null,this._opaqueSort=null,this._transparentSort=null,this._frameBufferTarget=null;const h=!0===this.alpha?0:1;this._clearColor=new mP(0,0,0,h),this._clearDepth=1,this._clearStencil=0,this._renderTarget=null,this._activeCubeFace=0,this._activeMipmapLevel=0,this._outputRenderTarget=null,this._mrt=null,this._renderObjectFunction=null,this._currentRenderObjectFunction=null,this._currentRenderBundle=null,this._handleObjectFunction=this._renderObjectDirect,this._isDeviceLost=!1,this.onDeviceLost=this._onDeviceLost,this._colorBufferType=u,this._initialized=!1,this._initPromise=null,this._compilationPromises=null,this.transparent=!0,this.opaque=!0,this.shadowMap={enabled:!1,type:1},this.xr=new hU(this,c),this.debug={checkShaderErrors:!0,onShaderError:null,getShaderAsync:async(e,t,n)=>{await this.compileAsync(e,t);const r=this._renderLists.get(e,t),i=this._renderContexts.get(e,t,this._renderTarget),s=e.overrideMaterial||n.material,a=this._objects.get(n,s,e,t,r.lightsNode,i,i.clippingContext),{fragmentShader:o,vertexShader:l}=a.getNodeBuilderState();return{fragmentShader:o,vertexShader:l}}}}
1async init(){if(this._initialized)throw new Error("Renderer: Backend has already been initialized.");return null!==this._initPromise||(this._initPromise=new Promise((async(e,t)=>{let n=this.backend;try{await n.init(this)}catch(e){if(null===this._getFallback)return void t(e);try{this.backend=n=this._getFallback(e),await n.init(this)}catch(e){return void t(e)}}this._nodes=new ZB(this,n),this._animation=new ON(this._nodes,this.info),this._attributes=new GN(n),this._background=new $O(this,this._nodes),this._geometries=new WN(this._attributes,this.info),this._textures=new fP(this,n,this.info),this._pipelines=new JN(n,this._nodes),this._bindings=new eP(n,this._nodes,this._textures,this._attributes,this._pipelines,this.info),this._objects=new qN(this,this._nodes,this._geometries,this._pipelines,this._bindings,this.info),this._renderLists=new aP(this.lighting),this._bundles=new rU,this._renderContexts=new dP,this._animation.start(),this._initialized=!0,e(this)}))),this._initPromise}get coordinateSystem(){return this.backend.coordinateSystem}async compileAsync(e,t,n=null){if(!0===this._isDeviceLost)return;!1===this._initialized&&await this.init();const r=this._nodes.nodeFrame,i=r.renderId,s=this._currentRenderContext,a=this._currentRenderObjectFunction,o=this._compilationPromises,l=!0===e.isScene?e:_U;null===n&&(n=e);const u=this._renderTarget,c=this._renderContexts.get(n,t,u),h=this._activeMipmapLevel,A=[];this._currentRenderContext=c,this._currentRenderObjectFunction=this.renderObject,this._handleObjectFunction=this._createObjectPipeline,this._compilationPromises=A,r.renderId++,r.update(
vendor: 8,961 bytes, line 1
1),c.depth=this.depth,c.stencil=this.stencil,c.clippingContext||(c.clippingContext=new eU),c.clippingContext.updateGlobal(l,t),l.onBeforeRender(this,e,t,u);const d=this._renderLists.get(e,t);if(d.begin(),this._projectObject(e,t,0,d,c.clippingContext),n!==e&&n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&d.pushLight(e)})),d.finish(),null!==u){this._textures.updateRenderTarget(u,h);const e=this._textures.get(u);c.textures=e.textures,c.depthTexture=e.depthTexture}else c.textures=null,c.depthTexture=null;this._background.update(l,d,c);const p=d.opaque,f=d.transparent,m=d.transparentDoublePass,g=d.lightsNode;!0===this.opaque&&p.length>0&&this._renderObjects(p,t,l,g),!0===this.transparent&&f.length>0&&this._renderTransparents(f,m,t,l,g),r.renderId=i,this._currentRenderContext=s,this._currentRenderObjectFunction=a,this._compilationPromises=o,this._handleObjectFunction=this._renderObjectDirect,await Promise.all(A)}async renderAsync(e,t){!1===this._initialized&&await this.init(),this._renderScene(e,t)}async waitForGPU(){await this.backend.waitForGPU()}set highPrecision(e){!0===e?(this.overrideNodes.modelViewMatrix=nS,this.overrideNodes.modelNormalViewMatrix=rS):this.highPrecision&&(this.overrideNodes.modelViewMatrix=null,this.overrideNodes.modelNormalViewMatrix=null)}get highPrecision(){return this.overrideNodes.modelViewMatrix===nS&&this.overrideNodes.modelNormalViewMatrix===rS}setMRT(e){return this._mrt=e,this}getMRT(){return this._mrt}getColorBufferType(){return this._colorBufferType}_onDeviceLost(e){let t=`THREE.WebGPURenderer: ${e.api} Device Lost:\n\nMessage: ${e.message}`;e.reason&&(t+=`\nReason: ${e.reason}`),this._isDeviceLost=!0}_renderBundle(e,t,n){const{bundleGroup:r,camera:i,renderList:s}=e,a=this._currentRenderContext,o=this._bundles.get(r,i),l=this.backend.get(o);void 0===l.renderContexts&&(l.renderContexts=new Set);const u=r.version!==l.version,c=!1===l.renderContexts.has(a)||u;if(l.renderContexts.add(a),c){this.backend.beginBundle(a),(void 0===l.renderObjects||u)&&(l.renderObjects=[]),this._currentRenderBundle=o;const{transparentDoublePass:e,transparent:c,opaque:h}=s;!0===this.opaque&&h.length>0&&this._renderObjects(h,i,t,n),!0===this.transparent&&c.length>0&&this._renderTransparents(c,e,i,t,n),this._currentRenderBundle=null,this.backend.finishBundle(a,o),l.version=r.version}else{const{renderObjects:e}=l;for(let t=0,n=e.length;t<n;t++){const n=e[t];this._nodes.needsRefresh(n)&&(this._nodes.updateBefore(n),this._nodes.updateForRender(n),this._bindings.updateForRender(n),this._nodes.updateAfter(n))}}this.backend.addBundle(a,o)}render(e,t){if(!1===this._initialized)return this.renderAsync(e,t);this._renderScene(e,t)}_getFrameBufferTarget(){const{currentToneMapping:e,currentColorSpace:t}=this;if(!1==(0!==e)&&!1==(t!==Me))return null;const{width:n,height:r}=this.getDrawingBufferSize(vU),{depth:i,stencil:s}=this;let a=this._frameBufferTarget;null===a&&(a=new yt(n,r,{depthBuffer:i,stencilBuffer:s,type:this._colorBufferType,format:F,colorSpace:Me,generateMipmaps:!1,minFilter:x,magFilter:x,samples:this.samples}),a.isPostProcessingRenderTarget=!0,this._frameBufferTarget=a);const o=this.getOutputRenderTarget();return a.depthBuffer=i,a.stencilBuffer=s,null!==o?a.setSize(o.width,o.height,o.depth):a.setSize(n,r,1),a.viewport.copy(this._viewport),a.scissor.copy(this._scissor),a.viewport.multiplyScalar(this._pixelRatio),a.scissor.multiplyScalar(this._pixelRatio),a.scissorTest=this._scissorTest,a.multiview=null!==o&&o.multiview,a.resolveDepthBuffer=null===o||o.resolveDepthBuffer,a.autoAllocateDepthBuffer=null!==o&&o.autoAllocateDepthBuffer,a}_renderScene(e,t,n=!0){if(!0===this._isDeviceLost)return;const r=n?this._getFrameBufferTarget():null,i=this._nodes.nodeFrame,s=i.renderId,a=this._currentRenderContext,o=this._currentRenderObjectFunction,l=!0===e.isScene?e:_U,u=this._renderTarget||this._outputRenderTarget,c=this._activeCubeFace,h=this._activeMipmapLevel;let A;null!==r?(A=r,this.setRenderTarget(A)):A=u;const d=this._renderContexts.get(e,t,A);this._currentRenderContext=d,this._currentRenderObjectFunction=this._renderObjectFunction||this.renderObject,this.info.calls++,this.info.render.calls++,this.info.render.frameCalls++,i.renderId=this.info.calls;const p=this.coordinateSystem,f=this.xr;if(t.coordinateSystem!==p&&!1===f.isPresenting&&(t.coordinateSystem=p,t.updateProjectionMatrix(),t.isArrayCamera))for(const e of t.cameras)e.coordinateSystem=p,e.updateProjectionMatrix();!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===f.enabled&&!0===f.isPresenting&&(!0===f.cameraAutoUpdate&&f.updateCamera(t),t=f.getCamera());let m=this._viewport,g=this._scissor,_=this._pixelRatio;null!==A&&(m=A.viewport,g=A.scissor,_=1),this.getDrawingBufferSize(vU),yU.set(0,0,vU.width,vU.height);const v=void 0===m.minDepth?0:m.minDepth,y=void 0===m.maxDepth?1:m.maxDepth;d.viewportValue.copy(m).multiplyScalar(_).floor(),d.viewportValue.width>>=h,d.viewportValue.height>>=h,d.viewportValue.minDepth=v,d.viewportValue.maxDepth=y,d.viewport=!1===d.viewportValue.equals(yU),d.scissorValue.copy(g).multiplyScalar(_).floor(),d.scissor=this._scissorTest&&!1===d.scissorValue.equals(yU),d.scissorValue.width>>=h,d.scissorValue.height>>=h,d.clippingContext||(d.clippingContext=new eU),d.clippingContext.updateGlobal(l,t),l.onBeforeRender(this,e,t,A);const x=t.isArrayCamera?bU:xU;t.isArrayCamera||(wU.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),x.setFromProjectionMatrix(wU,p));const b=this._renderLists.get(e,t);if(b.begin(),this._projectObject(e,t,0,b,d.clippingContext),b.finish(),!0===this.sortObjects&&b.sort(this._opaqueSort,this._transparentSort),null!==A){this._textures.updateRenderTarget(A,h);const e=this._textures.get(A);d.textures=e.textures,d.depthTexture=e.depthTexture,d.width=e.width,d.height=e.height,d.renderTarget=A,d.depth=A.depthBuffer,d.stencil=A.stencilBuffer}else d.textures=null,d.depthTexture=null,d.width=this.domElement.width,d.height=this.domElement.height,d.depth=this.depth,d.stencil=this.stencil;d.width>>=h,d.height>>=h,d.activeCubeFace=c,d.activeMipmapLevel=h,d.occlusionQueryCount=b.occlusionQueryCount,this._background.update(l,b,d),d.camera=t,this.backend.beginRender(d);const{bundles:w,lightsNode:T,transparentDoublePass:S,transparent:M,opaque:E}=b;return w.length>0&&this._renderBundles(w,l,T),!0===this.opaque&&E.length>0&&this._renderObjects(E,t,l,T),!0===this.transparent&&M.length>0&&this._renderTransparents(M,S,t,l,T),this.backend.finishRender(d),i.renderId=s,this._currentRenderContext=a,this._currentRenderObjectFunction=o,null!==r&&(this.setRenderTarget(u,c,h),this._renderOutput(A)),l.onAfterRender(this,e,t,A),d}_setXRLayerSize(e,t){this._width=e,this._height=t,this.setViewport(0,0,e,t)}_renderOutput(e){const t=this._quad;this._nodes.hasOutputChange(e.texture)&&(t.material.fragmentNode=this._nodes.getOutputNode(e.texture),t.material.needsUpdate=!0);const n=this.autoClear,r=this.xr.enabled;this.autoClear=!1,this.xr.enabled=!1,this._renderScene(t,t.camera,!1),this.autoClear=n,this.xr.enabled=r}getMaxAnisotropy(){return this.backend.getMaxAnisotropy()}getActiveCubeFace(){return this._activeCubeFace}getActiveMipmapLevel(){return this._activeMipmapLevel}async setAnimationLoop(e){!1===this._initialized&&await this.init(),this._animation.setAnimationLoop(e)}async getArrayBufferAsync(e){return await this.backend.getArrayBufferAsync(e)}getContext(){return this.backend.getContext()}getPixelRatio(){return this._pixelRatio}getDrawingBufferSize(e){return e.set(this._width*this._pixelRatio,this._height*this._pixelRatio).floor()}getSize(e){return e.set(this._width,this._height)}setPixelRatio(e=1){this._pixelRatio!==e&&(this._pixelRatio=e,this.setSize(this._width,this._height,!1))}setDrawingBufferSize(e,t,n){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this._pixelRatio=n,this.domElement.width=Math.floor(e*n),this.domElement.height=Math.floor(t*n),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setSize(e,t,n=!0){this.xr&&this.xr.isPresenting||(this._width=e,this._height=t,this.domElement.width=Math.floor(e*this._pixelRatio),this.domElement.height=Math.floor(t*this._pixelRatio),!0===n&&(this.domElement.style.width=e+"px",this.domElement.style.height=t+"px"),this.setViewport(0,0,e,t),this._initialized&&this.backend.updateSize())}setOpaqueSort(e){this._opaqueSort=e}setTransparentSort(e){this._transparentSort=e}getScissor(e){const t=this._scissor;return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e}setScissor(e,t,n,r){const i=this._scissor;e.isVector4?i.copy(e):i.set(e,t,n,r)}getScissorTest(){return this._scissorTest}setScissorTest(e){this._scissorTest=e,this.backend.setScissorTest(e)}getViewport(e){return e.copy(this._viewport)}setViewport(e,t,n,r,i=0,s=1){const a=this._viewport;e.isVector4?a.copy(e):a.set(e,t,n,r),a.minDepth=i,a.maxDepth=s}getClearColor(e){return e.copy(this._clearColor)}
1setClearColor(e,t=1){this._clearColor.set(e),this._clearColor.a=t}getClearAlpha(){return this._clearColor.a}setClearAlpha(e){this._clearColor.a=e}getClearDepth(){return this._clearDepth}setClearDepth(e){this._clearDepth=e}getClearStencil(){return this._clearStencil}setClearStencil(e){this._clearStencil=e}isOccluded(e){const t=this._currentRenderContext;return t&&this.backend.isOccluded(t,e)}clear(e=!0,t=!0,n=!0){if(!1===this._initialized)return this.clearAsync(e,t,n);const r=this._renderTarget||this._getFrameBufferTarget();let i=null;if(null!==r){this._textures.updateRenderTarget(r);const e=this._textures.get(r);i=this._renderContexts.getForClear(r),i.textures=e.textures,i.depthTexture=e.depthTexture,i.width=e.width,i.height=e.height,i.renderTarget=r,i.depth=r.depthBuffer,i.stencil=r.stencilBuffer,i.clearColorValue=this.backend.getClearColor(),i.activeCubeFace=this.getActiveCubeFace(),i.activeMipmapLevel=this.getActiveMipmapLevel()}this.backend.clear(e,t,n,i),null!==r&&null===this._renderTarget&&this._renderOutput(r)}clearColor(){return this.clear(!0,!1,!1)}clearDepth(){return this.clear(!1,!0,!1)}clearStencil(){return this.clear(!1,!1,!0)}async clearAsync(e=!0,t=!0,n=!0){!1===this._initialized&&await this.init(),this.clear(e,t,n)}async clearColorAsync(){this.clearAsync(!0,!1,!1)}async clearDepthAsync(){this.clearAsync(!1,!0,!1)}async clearStencilAsync(){this.clearAsync(!1,!1,!0)}get currentToneMapping(){return this.isOutputTarget?this.toneMapping:0}get currentColorSpace(){return this.isOutputTarget?this.outputColorSpace:Me}get isOutputTarget(){return this._renderTarget===this._outputRenderTarget||null===this._renderTarget}dispose(){this.info.dispose(),this.backend.dispose(),this._animation.dispose(),this._objects.dispose(),this._pipelines.dispose(),this._nodes.dispose(),this._bindings.dispose(),this._renderLists.dispose(),this._renderContexts.dispose(),this._textures.dispose(),null!==this._frameBufferTarget&&this._frameBufferTarget.dispose(),Object.values(this.backend.timestampQueryPool).forEach((e=>{null!==e&&e.dispose()})),this.setRenderTarget(null),this.setAnimationLoop(null)}setRenderTarget(e,t=0,n=0){this._renderTarget=e,this._activeCubeFace=t,this._activeMipmapLevel=n}getRenderTarget(){return this._renderTarget}setOutputRenderTarget(e){this._outputRenderTarget=e}getOutputRenderTarget(){return this._outputRenderTarget}_resetXRState(){this.backend.setXRTarget(null),this.setOutputRenderTarget(null),this.setRenderTarget(null),this._frameBufferTarget.dispose(),this._frameBufferTarget=null}setRenderObjectFunction(e){this._renderObjectFunction=e}getRenderObjectFunction(){return this._renderObjectFunction}compute(e){if(!0===this._isDeviceLost)return;if(!1===this._initialized)return this.computeAsync(e);const t=this._nodes.nodeFrame,n=t.renderId;this.info.calls++,this.info.compute.calls++,this.info.compute.frameCalls++,t.renderId=this.info.calls;const r=this.backend,i=this._pipelines,s=this._bindings,a=this._nodes,o=Array.isArray(e)?e:[e];if(void 0===o[0]||!0!==o[0].isComputeNode)throw new Error("THREE.Renderer: .compute() expects a ComputeNode.");r.beginCompute(e);for(const t of o){if(!1===i.has(t)){const e=()=>{t.removeEventListener("dispose",e),i.delete(t),s.delete(t),a.delete(t)};t.addEventListener("dispose",e);const n=t.onInitFunction;null!==n&&n.call(t,{renderer:this})}a.updateForCompute(t),s.updateForCompute(t);const n=s.getForCompute(t),o=i.getForCompute(t,n);r.compute(e,t,n,o)}r.finishCompute(e),t.renderId=n}async computeAsync(e){!1===this._initialized&&await this.init(),this.compute(e)}async hasFeatureAsync(e){return!1===this._initialized&&await this.init(),this.backend.hasFeature(e)}async resolveTimestampsAsync(e="render"){return!1===this._initialized&&await this.init(),this.backend.resolveTimestampsAsync(e)}hasFeature(e){return!1!==this._initialized&&this.backend.hasFeature(e)}hasInitialized(){return this._initialized}async initTextureAsync(e){!1===this._initialized&&await this.init(),this._textures.updateTexture(e)}initTexture(e){this._initialized,this._textures.updateTexture(e)}copyFramebufferToTexture(e,t=null){if(null!==t)if(t.isVector2)t=TU.set(t.x,t.y,e.image.width,e.image.height).floor();else{if(!t.isVector4)return;t=TU.copy(t).floor()}else t=TU.set(0,0,e.image.width,e.image.height);let n,r=this._currentRenderContext;null!==r?n=r.renderTarget:(n=this._renderTarget||this._getFrameBufferTarget(),null!==n&&(this._textures.updateRenderTarget(n),r=this._textures.get(n))),this._textures.updateTexture(e,{renderTarget:n}),this.backend.copyFramebufferToTexture(e,r,t)}copyTextureToTexture(e,t,n=null,r=null,i=0,s=0){this._textures.updateTexture(e),this._textures.updateTexture(t),this.backend.copyTextureToTexture(e,t,n,r,i,s)}async readRenderTargetPixelsAsync(e,t,n,r,i,s=0,a=0){return this.backend.copyTextureToBuffer(e.textures[s],t,n,r,i,a)}_projectObject(e,t,n,r,i){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder,e.isClippingGroup&&e.enabled&&(i=i.getGroupContext(e));else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)r.pushLight(e);else if(e.isSprite){const s=t.isArrayCamera?bU:xU;if(!e.frustumCulled||s.intersectsSprite(e,t)){!0===this.sortObjects&&TU.setFromMatrixPosition(e.matrixWorld).applyMatrix4(wU);const{geometry:t,material:s}=e;s.visible&&r.push(e,t,s,n,TU.z,null,i)}}else if(e.isLineLoop);else if(e.isMesh||e.isLine||e.isPoints){const s=t.isArrayCamera?bU:xU;if(!e.frustumCulled||s.intersectsObject(e,t)){const{geometry:t,material:s}=e;if(!0===this.sortObjects&&(null===t.boundingSphere&&t.computeBoundingSphere(),TU.copy(t.boundingSphere.center).applyMatrix4(e.matrixWorld).applyMatrix4(wU)),Array.isArray(s)){const a=t.groups;for(let o=0,l=a.length;o<l;o++){const l=a[o],u=s[l.materialIndex];u&&u.visible&&r.push(e,t,u,n,TU.z,l,i)}}else s.visible&&r.push(e,t,s,n,TU.z,null,i)}}if(!0===e.isBundleGroup&&void 0!==this.backend.beginBundle){const n=r;(r=this._renderLists.get(e,t)).begin(),n.pushBundle({bundleGroup:e,camera:t,renderList:r}),r.finish()}const s=e.children;for(let e=0,a=s.length;e<a;e++)this._projectObject(s[e],t,n,r,i)}
1_renderBundles(e,t,n){for(const r of e)this._renderBundle(r,t,n)}_renderTransparents(e,t,n,r,i){if(t.length>0){for(const{material:e}of t)e.side=1;this._renderObjects(t,n,r,i,"backSide");for(const{material:e}of t)e.side=0;this._renderObjects(e,n,r,i);for(const{material:e}of t)e.side=2}else this._renderObjects(e,n,r,i)}_renderObjects(e,t,n,r,i=null){for(let s=0,a=e.length;s<a;s++){const{object:a,geometry:o,material:l,group:u,clippingContext:c}=e[s];this._currentRenderObjectFunction(a,n,t,o,l,u,r,c,i)}}renderObject(e,t,n,r,i,s,a,o=null,l=null){let u,c,h;if(e.onBeforeRender(this,t,n,r,i,s),!0===i.allowOverride&&null!==t.overrideMaterial){const e=t.overrideMaterial;i.positionNode&&i.positionNode.isNode&&(u=e.positionNode,e.positionNode=i.positionNode),e.alphaTest=i.alphaTest,e.alphaMap=i.alphaMap,e.transparent=i.transparent||i.transmission>0,e.isShadowPassMaterial&&(e.side=null===i.shadowSide?i.side:i.shadowSide,i.depthNode&&i.depthNode.isNode&&(h=e.depthNode,e.depthNode=i.depthNode),i.castShadowNode&&i.castShadowNode.isNode&&(c=e.colorNode,e.colorNode=i.castShadowNode),i.castShadowPositionNode&&i.castShadowPositionNode.isNode&&(u=e.positionNode,e.positionNode=i.castShadowPositionNode)),i=e}!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,this._handleObjectFunction(e,i,t,n,a,s,o,"backSide"),i.side=0,this._handleObjectFunction(e,i,t,n,a,s,o,l),i.side=2):this._handleObjectFunction(e,i,t,n,a,s,o,l),void 0!==u&&(t.overrideMaterial.positionNode=u),void 0!==h&&(t.overrideMaterial.depthNode=h),void 0!==c&&(t.overrideMaterial.colorNode=c),e.onAfterRender(this,t,n,r,i,s)}_renderObjectDirect(e,t,n,r,i,s,a,o){const l=this._objects.get(e,t,n,r,i,this._currentRenderContext,a,o);l.drawRange=e.geometry.drawRange,l.group=s;const u=this._nodes.needsRefresh(l);u&&(this._nodes.updateBefore(l),this._geometries.updateForRender(l),this._nodes.updateForRender(l),this._bindings.updateForRender(l)),this._pipelines.updateForRender(l),null!==this._currentRenderBundle&&(this.backend.get(this._currentRenderBundle).renderObjects.push(l),l.bundle=this._currentRenderBundle.bundleGroup),this.backend.draw(l,this.info),u&&this._nodes.updateAfter(l)}_createObjectPipeline(e,t,n,r,i,s,a,o){const l=this._objects.get(e,t,n,r,i,this._currentRenderContext,a,o);l.drawRange=e.geometry.drawRange,l.group=s,this._nodes.updateBefore(l),this._geometries.updateForRender(l),this._nodes.updateForRender(l),this._bindings.updateForRender(l),this._pipelines.getForRender(l,this._compilationPromises),this._nodes.updateAfter(l)}get compile(){return this.compileAsync}}{constructor(e={}){let t;e.forceWebGL?t=pF:(t=Zq,e.getFallback=()=>new pF(e)),super(new t(e),e),this.library=new tV,this.isWebGPURenderer=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}}QO.BRDF_GGX,QO.BRDF_Lambert,QO.BasicShadowFilter,QO.Break,QO.Continue,QO.DFGApprox,QO.D_GGX,QO.Discard,QO.EPSILON,QO.F_Schlick;const rV=QO.Fn;QO.INFINITY;const iV=QO.If;QO.Switch;const sV=QO.Loop;QO.NodeShaderStage,QO.NodeType,QO.NodeUpdateType,QO.NodeAccess,QO.PCFShadowFilter,QO.PCFSoftShadowFilter,QO.PI,QO.PI2,QO.Return,QO.Schlick_to_F0,QO.ScriptableNodeResources,QO.ShaderNode,QO.TBNViewMatrix,QO.VSMShadowFilter,QO.V_GGX_SmithCorrelated,QO.abs,QO.acesFilmicToneMapping,QO.acos,QO.add,QO.addNodeElement,QO.agxToneMapping,QO.all,QO.alphaT,QO.and,QO.anisotropy,QO.anisotropyB,QO.anisotropyT,QO.any,QO.append,QO.array,QO.arrayBuffer;const aV=QO.asin;QO.assign,QO.atan,QO.atan2,QO.atomicAdd,QO.atomicAnd,QO.atomicFunc,QO.atomicMax,QO.atomicMin,QO.atomicOr,QO.atomicStore,QO.atomicSub,QO.atomicXor,QO.atomicLoad,QO.attenuationColor,QO.attenuationDistance,QO.attribute,QO.attributeArray,QO.backgroundBlurriness,QO.backgroundIntensity,QO.backgroundRotation,QO.batch,QO.billboarding,QO.bitAnd,QO.bitNot,QO.bitOr,QO.bitXor,QO.bitangentGeometry,QO.bitangentLocal,QO.bitangentView,QO.bitangentWorld,QO.bitcast,QO.blendBurn,QO.blendColor,QO.blendDodge,QO.blendOverlay,QO.blendScreen,QO.blur,QO.bool,QO.buffer,QO.bufferAttribute,QO.bumpMap,QO.burn,QO.bvec2,QO.bvec3,QO.bvec4,QO.bypass,QO.cache,QO.call,QO.cameraFar,QO.cameraIndex,QO.cameraNear,QO.cameraNormalMatrix,QO.cameraPosition,QO.cameraProjectionMatrix,QO.cameraProjectionMatrixInverse,QO.cameraViewMatrix,QO.cameraWorldMatrix,QO.cbrt,QO.cdl,QO.ceil,QO.checker,QO.cineonToneMapping,QO.clamp,QO.clearcoat,QO.clearcoatRoughness,QO.code,QO.color,QO.colorSpaceToWorking,QO.colorToDirection,QO.compute,QO.computeSkinning,QO.cond,QO.Const,QO.context,QO.convert,QO.convertColorSpace,QO.convertToTexture;const oV=QO.cos;QO.cross,QO.cubeTexture,QO.dFdx,QO.dFdy,QO.dashSize,QO.debug,QO.decrement,QO.decrementBefore,QO.defaultBuildStages,QO.defaultShaderStages,QO.defined,QO.degrees,QO.deltaTime,QO.densityFog,QO.densityFogFactor,QO.depth,QO.depthPass,QO.difference,QO.diffuseColor,QO.directPointLight,QO.directionToColor,QO.dispersion,QO.distance,QO.div,QO.dodge,QO.dot,QO.drawIndex,QO.dynamicBufferAttribute,QO.element,QO.emissive,QO.equal,QO.equals,QO.equirectUV;const lV=QO.exp;QO.exp2,QO.expression,QO.faceDirection,QO.faceForward,QO.faceforward;const uV=QO.float;QO.floor,QO.fog,QO.fract,QO.frameGroup,QO.frameId,QO.frontFacing,QO.fwidth,QO.gain,QO.gapSize,QO.getConstNodeType,QO.getCurrentStack,QO.getDirection,QO.getDistanceAttenuation,QO.getGeometryRoughness,QO.getNormalFromDepth,QO.getParallaxCorrectNormal,QO.getRoughness,QO.getScreenPosition,QO.getShIrradianceAt,QO.getTextureIndex,QO.getViewPosition,QO.getShadowMaterial,QO.getShadowRenderObjectFunction,QO.glsl,QO.glslFn,QO.grayscale,QO.greaterThan,QO.greaterThanEqual,QO.hash,QO.highpModelNormalViewMatrix,QO.highpModelViewMatrix,QO.hue,QO.increment,QO.incrementBefore,QO.instance;const cV=QO.instanceIndex;QO.instancedArray,QO.instancedBufferAttribute,QO.instancedDynamicBufferAttribute,QO.instancedMesh,QO.int,QO.inverseSqrt,QO.inversesqrt,QO.invocationLocalIndex,QO.invocationSubgroupIndex,QO.ior,QO.iridescence,QO.iridescenceIOR,QO.iridescenceThickness,QO.ivec2,QO.ivec3,QO.ivec4,QO.js,QO.label,QO.length,QO.lengthSq,QO.lessThan,QO.lessThanEqual,QO.lightPosition,QO.lightShadowMatrix,QO.lightTargetDirection,QO.lightTargetPosition,QO.lightViewPosition,QO.lightingContext,QO.lights,QO.linearDepth,QO.linearToneMapping,QO.localId,QO.globalId,QO.log,QO.log2,QO.logarithmicDepthToViewZ,QO.loop,QO.luminance,QO.mediumpModelViewMatrix,QO.mat2,QO.mat3,QO.mat4,QO.matcapUV,QO.materialAO,QO.materialAlphaTest,QO.materialAnisotropy,QO.materialAnisotropyVector,QO.materialAttenuationColor,QO.materialAttenuationDistance,QO.materialClearcoat,QO.materialClearcoatNormal,QO.materialClearcoatRoughness,QO.materialColor,QO.materialDispersion,QO.materialEmissive,QO.materialIOR,QO.materialIridescence,QO.materialIridescenceIOR,QO.materialIridescenceThickness,QO.materialLightMap,QO.materialLineDashOffset,QO.materialLineDashSize,QO.materialLineGapSize,QO.materialLineScale,QO.materialLineWidth,QO.materialMetalness,QO.materialNormal,QO.materialOpacity,QO.materialPointSize,QO.materialReference,QO.materialReflectivity,QO.materialRefractionRatio,QO.materialRotation,QO.materialRoughness,QO.materialSheen,QO.materialSheenRoughness,QO.materialShininess,QO.materialSpecular,QO.materialSpecularColor,QO.materialSpecularIntensity,QO.materialSpecularStrength,QO.materialThickness,QO.materialTransmission,QO.max,QO.maxMipLevel,QO.metalness,QO.min,QO.mix,QO.mixElement,QO.mod,QO.modInt,QO.modelDirection,QO.modelNormalMatrix,QO.modelPosition,QO.modelRadius,QO.modelScale,QO.modelViewMatrix,QO.modelViewPosition,QO.modelViewProjection,QO.modelWorldMatrix,QO.modelWorldMatrixInverse,QO.morphReference,QO.mrt,QO.mul,QO.mx_aastep,QO.mx_cell_noise_float,QO.mx_contrast,QO.mx_fractal_noise_float,QO.mx_fractal_noise_vec2,QO.mx_fractal_noise_vec3,QO.mx_fractal_noise_vec4,QO.mx_hsvtorgb,QO.mx_noise_float,QO.mx_noise_vec3,QO.mx_noise_vec4,QO.mx_ramplr,QO.mx_ramptb,QO.mx_rgbtohsv,QO.mx_safepower,QO.mx_splitlr,QO.mx_splittb,QO.mx_srgb_texture_to_lin_rec709,QO.mx_transform_uv,QO.mx_worley_noise_float,QO.mx_worley_noise_vec2,QO.mx_worley_noise_vec3,QO.namespace;const hV=QO.negate;QO.neutralToneMapping,QO.nodeArray,QO.nodeImmutable,QO.nodeObject,QO.nodeObjects,QO.nodeProxy,QO.normalFlat,QO.normalGeometry,QO.normalLocal,QO.normalMap,QO.normalView,QO.normalWorld,QO.normalize,QO.not,QO.notEqual,QO.numWorkgroups,QO.objectDirection,QO.objectGroup,QO.objectPosition,QO.objectRadius,QO.objectScale,QO.objectViewPosition,QO.objectWorldMatrix,QO.oneMinus,QO.or,QO.orthographicDepthToViewZ,QO.oscSawtooth,QO.oscSine,QO.oscSquare,QO.oscTriangle,QO.output,QO.outputStruct,QO.overlay,QO.overloadingFn,QO.parabola,QO.parallaxDirection,QO.parallaxUV,QO.parameter,QO.pass,QO.passTexture,QO.pcurve,QO.perspectiveDepthToViewZ,QO.pmremTexture,QO.pointUV,QO.pointWidth,QO.positionGeometry,QO.positionLocal,QO.positionPrevious,QO.positionView,QO.positionViewDirection,QO.positionWorld,QO.positionWorldDirection,QO.posterize,QO.pow,QO.pow2,QO.pow3,QO.pow4,QO.premult,QO.property,QO.radians,QO.rand,QO.range,QO.rangeFog,QO.rangeFogFactor,QO.re
vendor: 5,034 bytes, line 1
1ciprocal,QO.lightProjectionUV,QO.reference,QO.referenceBuffer,QO.reflect,QO.reflectVector,QO.reflectView,QO.reflector,QO.refract,QO.refractVector,QO.refractView,QO.reinhardToneMapping,QO.remainder,QO.remap,QO.remapClamp,QO.renderGroup,QO.renderOutput,QO.rendererReference,QO.rotate,QO.rotateUV,QO.roughness,QO.round,QO.rtt,QO.sRGBTransferEOTF,QO.sRGBTransferOETF,QO.sampler,QO.samplerComparison,QO.saturate,QO.saturation,QO.screen,QO.screenCoordinate,QO.screenSize,QO.screenUV,QO.scriptable,QO.scriptableValue,QO.select,QO.setCurrentStack,QO.shaderStages,QO.shadow,QO.pointShadow,QO.shadowPositionWorld,QO.sharedUniformGroup,QO.shapeCircle,QO.sheen,QO.sheenRoughness,QO.shiftLeft,QO.shiftRight,QO.shininess,QO.sign;const AV=QO.sin;QO.sinc,QO.skinning,QO.smoothstep,QO.smoothstepElement,QO.specularColor,QO.specularF90,QO.spherizeUV,QO.split,QO.spritesheetUV;const dV=QO.sqrt;QO.stack,QO.step;const pV=QO.storage;QO.storageBarrier,QO.storageObject,QO.storageTexture,QO.string,QO.struct,QO.sub,QO.subgroupIndex,QO.subgroupSize,QO.tan,QO.tangentGeometry,QO.tangentLocal,QO.tangentView,QO.tangentWorld,QO.temp,QO.texture,QO.texture3D,QO.textureBarrier,QO.textureBicubic,QO.textureCubeUV,QO.textureLoad,QO.textureSize,QO.textureStore,QO.thickness,QO.time,QO.timerDelta,QO.timerGlobal,QO.timerLocal,QO.toneMapping,QO.toneMappingExposure,QO.toonOutlinePass,QO.transformDirection,QO.transformNormal,QO.transformNormalToView,QO.transformedBentNormalView,QO.transformedBitangentView,QO.transformedBitangentWorld,QO.transformedClearcoatNormalView,QO.transformedNormalView,QO.transformedNormalWorld,QO.transformedTangentView,QO.transformedTangentWorld,QO.transmission,QO.transpose,QO.triNoise3D,QO.triplanarTexture,QO.triplanarTextures,QO.trunc,QO.tslFn,QO.uint;const fV=QO.uniform;QO.uniformCubeTexture,QO.uniformArray,QO.uniformGroup,QO.uniformTexture,QO.uniforms,QO.unpremult,QO.userData,QO.uv,QO.uvec2,QO.uvec3,QO.uvec4,QO.Var,QO.varying,QO.varyingProperty,QO.vec2,QO.vec3,QO.vec4,QO.vectorComponents,QO.velocity,QO.vertexColor,QO.vertexIndex,QO.vibrance,QO.viewZToLogarithmicDepth,QO.viewZToOrthographicDepth,QO.viewZToPerspectiveDepth,QO.viewport,QO.viewportBottomLeft,QO.viewportCoordinate,QO.viewportDepthTexture,QO.viewportLinearDepth,QO.viewportMipTexture,QO.viewportResolution,QO.viewportSafeUV,QO.viewportSharedTexture,QO.viewportSize,QO.viewportTexture,QO.viewportTopLeft,QO.viewportUV,QO.wgsl,QO.wgslFn,QO.workgroupArray,QO.workgroupBarrier,QO.workgroupId,QO.workingToColorSpace,QO.xor;const mV=new wt,gV=new Ke;class _V extends aa{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new ir([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new ir([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new ca(t,6,1);return this.setAttribute("instanceStart",new Xr(n,3,0)),this.setAttribute("instanceEnd",new Xr(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new ca(t,6,1);return this.setAttribute("instanceColorStart",new Xr(n,3,0)),this.setAttribute("instanceColorEnd",new Xr(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new Cs(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new wt);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),mV.setFromBufferAttribute(t),this.boundingBox.union(mV))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Vt),null===this.boundingBox&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let r=0;for(let i=0,s=e.count;i<s;i++)gV.fromBufferAttribute(e,i),r=Math.max(r,n.distanceToSquared(gV)),gV.fromBufferAttribute(t,i),r=Math.max(r,n.distanceToSquared(gV));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)}}toJSON(){}}Ta.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Ye(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Sa.line={uniforms:Nr.merge([Ta.common,Ta.fog,Ta
vendor: 9,152 bytes, line 1
1.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tworldStart = start.xyz;\n\t\t\t\tworldEnd = end.xyz;\n\n\t\t\t#else\n\n\t\t\t\tvUv = uv;\n\n\t\t\t#endif\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec3 ndcStart = clipStart.xyz / clipStart.w;\n\t\t\tvec3 ndcEnd = clipEnd.xyz / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd.xy - ndcStart.xy;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\tvec3 worldDir = normalize( end.xyz - start.xyz );\n\t\t\t\tvec3 tmpFwd = normalize( mix( start.xyz, end.xyz, 0.5 ) );\n\t\t\t\tvec3 worldUp = normalize( cross( worldDir, tmpFwd ) );\n\t\t\t\tvec3 worldFwd = cross( worldDir, worldUp );\n\t\t\t\tworldPos = position.y < 0.5 ? start: end;\n\n\t\t\t\t// height offset\n\t\t\t\tfloat hw = linewidth * 0.5;\n\t\t\t\tworldPos.xyz += position.x < 0.0 ? hw * worldUp : - hw * worldUp;\n\n\t\t\t\t// don't extend the line if we're rendering dashes because we\n\t\t\t\t// won't be rendering the endcaps\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t// cap extension\n\t\t\t\t\tworldPos.xyz += position.y < 0.5 ? - hw * worldDir : hw * worldDir;\n\n\t\t\t\t\t// add width to the box\n\t\t\t\t\tworldPos.xyz += worldFwd * hw;\n\n\t\t\t\t\t// endcaps\n\t\t\t\t\tif ( position.y > 1.0 || position.y < 0.0 ) {\n\n\t\t\t\t\t\tworldPos.xyz -= worldFwd * 2.0 * hw;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\t// project the worldpos\n\t\t\t\tvec4 clip = projectionMatrix * worldPos;\n\n\t\t\t\t// shift the depth of the projected points so the line\n\t\t\t\t// segments overlap neatly\n\t\t\t\tvec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;\n\t\t\t\tclip.z = clipPose.z * clip.w;\n\n\t\t\t#else\n\n\t\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\t\t\t\t// undo aspect ratio adjustment\n\t\t\t\tdir.x /= aspect;\n\t\t\t\toffset.x /= aspect;\n\n\t\t\t\t// sign flip\n\t\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t\t// endcaps\n\t\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\t\toffset += - dir;\n\n\t\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\t\toffset += dir;\n\n\t\t\t\t}\n\n\t\t\t\t// adjust for linewidth\n\t\t\t\toffset *= linewidth;\n\n\t\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\t\toffset /= resolution.y;\n\n\t\t\t\t// select end\n\t\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t\t// back to clip space\n\t\t\t\toffset *= clip.w;\n\n\t\t\t\tclip.xy += offset;\n\n\t\t\t#endif\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\t\tuniform float linewidth;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashOffset;\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#ifdef WORLD_UNITS\n\n\t\t\tvarying vec4 worldPos;\n\t\t\tvarying vec3 worldStart;\n\t\t\tvarying vec3 worldEnd;\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t#endif\n\n\t\t#else\n\n\t\t\tvarying vec2 vUv;\n\n\t\t#endif\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {\n\n\t\t\tfloat mua;\n\t\t\tfloat mub;\n\n\t\t\tvec3 p13 = p1 - p3;\n\t\t\tvec3 p43 = p4 - p3;\n\n\t\t\tvec3 p21 = p2 - p1;\n\n\t\t\tfloat d1343 = dot( p13, p43 );\n\t\t\tfloat d4321 = dot( p43, p21 );\n\t\t\tfloat d1321 = dot( p13, p21 );\n\t\t\tfloat d4343 = dot( p43, p43 );\n\t\t\tfloat d2121 = dot( p21, p21 );\n\n\t\t\tfloat denom = d2121 * d4343 - d4321 * d4321;\n\n\t\t\tfloat numer = d1343 * d4321 - d1321 * d4343;\n\n\t\t\tmua = numer / denom;\n\t\t\tmua = clamp( mua, 0.0, 1.0 );\n\t\t\tmub = ( d1343 + d4321 * ( mua ) ) / d4343;\n\t\t\tmub = clamp( mub, 0.0, 1.0 );\n\n\t\t\treturn vec2( mua, mub );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tfloat alpha = opacity;\n\t\t\tvec4 diffuseColor = vec4( diffuse, alpha );\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\t#ifdef WORLD_UNITS\n\n\t\t\t\t// Find the closest points on the view ray and the line segment\n\t\t\t\tvec3 rayEnd = normalize( worldPos.xyz ) * 1e5;\n\t\t\t\tvec3 lineDir = worldEnd - worldStart;\n\t\t\t\tvec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );\n\n\t\t\t\tvec3 p1 = worldStart + lineDir * params.x;\n\t\t\t\tvec3 p2 = rayEnd * params.y;\n\t\t\t\tvec3 delta = p1 - p2;\n\t\t\t\tfloat len = length( delta );\n\t\t\t\tfloat norm = len / linewidth;\n\n\t\t\t\t#ifndef USE_DASH\n\n\t\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t\tfloat dnorm = fwidth( norm );\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tif ( norm > 0.5 ) {\n\n\t\t\t\t\t\t\tdiscard;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t#endif\n\n\t\t\t\t#endif\n\n\t\t\t#else\n\n\t\t\t\t#ifdef USE_ALPHA_TO_COVERAGE\n\n\t\t\t\t\t// artifacts appear on some hardware if a derivative is taken within a conditional\n\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\tfloat len2 = a * a + b * b;\n\t\t\t\t\tfloat dlen = fwidth( len2 );\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\talpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );\n\n\t\t\t\t\t}\n\n\t\t\t\t#else\n\n\t\t\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\t\t\tfloat a = vUv.x;\n\t\t\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, alpha );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};class
vendor: 7,279 bytes, line 1
1vV extends Pr{constructor(e){super({type:"LineMaterial",uniforms:Nr.clone(Sa.line.uniforms),vertexShader:Sa.line.vertexShader,fragmentShader:Sa.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){!0===e!==this.dashed&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(!0===e!==this.alphaToCoverage&&(this.needsUpdate=!0),!0===e?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const yV=new vt,xV=new Ke,bV=new Ke,wV=new vt,TV=new vt,SV=new vt,MV=new Ke,EV=new $t,CV=new class{constructor(e=new Ke,t=new Ke){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){ma.subVectors(e,this.start),ga.subVectors(this.end,this.start);const n=ga.dot(ga);let r=ga.dot(ma)/n;return t&&(r=Ge(r,0,1)),r}closestPointToPoint(e,t,n){const r=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(r).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return(new this.constructor).copy(this)}},RV=new Ke,NV=new wt,PV=new Vt,DV=new vt;let LV,IV;function OV(e,t,n){return DV.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),DV.multiplyScalar(1/DV.w),DV.x=IV/n.width,DV.y=IV/n.height,DV.applyMatrix4(e.projectionMatrixInverse),DV.multiplyScalar(1/DV.w),Math.abs(Math.max(DV.x,DV.y))}class BV extends Tr{constructor(e=new _V,t=new vV({color:16777215*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,r=new Float32Array(2*t.count);for(let e=0,i=0,s=t.count;e<s;e++,i+=2)xV.fromBufferAttribute(t,e),bV.fromBufferAttribute(n,e),r[i]=0===i?0:r[i-1],r[i+1]=r[i]+xV.distanceTo(bV);const i=new ca(r,2,1);return e.setAttribute("instanceDistanceStart",new Xr(i,1,0)),e.setAttribute("instanceDistanceEnd",new Xr(i,1,1)),this}raycast(e,t){const n=this.material.worldUnits,r=e.camera,i=void 0!==e.params.Line2&&e.params.Line2.threshold||0;LV=e.ray;const s=this.matrixWorld,a=this.geometry,o=this.material;let l,u;IV=o.linewidth+i,null===a.boundingSphere&&a.computeBoundingSphere(),PV.copy(a.boundingSphere).applyMatrix4(s),l=n?.5*IV:OV(r,Math.max(r.near,PV.distanceToPoint(LV.origin)),o.resolution),PV.radius+=l,!1!==LV.intersectsSphere(PV)&&(null===a.boundingBox&&a.computeBoundingBox(),NV.copy(a.boundingBox).applyMatrix4(s),u=n?.5*IV:OV(r,Math.max(r.near,NV.distanceToPoint(LV.origin)),o.resolution),NV.expandByScalar(u),!1!==LV.intersectsBox(NV)&&(n?function(e,t){const n=e.matrixWorld,r=e.geometry,i=r.attributes.instanceStart,s=r.attributes.instanceEnd;for(let a=0,o=Math.min(r.instanceCount,i.count);a<o;a++){CV.start.fromBufferAttribute(i,a),CV.end.fromBufferAttribute(s,a),CV.applyMatrix4(n);const r=new Ke,o=new Ke;LV.distanceSqToSegment(CV.start,CV.end,o,r),o.distanceTo(r)<.5*IV&&t.push({point:o,pointOnLine:r,distance:LV.origin.distanceTo(o),object:e,face:null,faceIndex:a,uv:null,uv1:null})}}(this,t):function(e,t,n){const r=t.projectionMatrix,i=e.material.resolution,s=e.matrixWorld,a=e.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,u=Math.min(a.instanceCount,o.count),c=-t.near;LV.at(1,SV),SV.w=1,SV.applyMatrix4(t.matrixWorldInverse),SV.applyMatrix4(r),SV.multiplyScalar(1/SV.w),SV.x*=i.x/2,SV.y*=i.y/2,SV.z=0,MV.copy(SV),EV.multiplyMatrices(t.matrixWorldInverse,s);for(let t=0,a=u;t<a;t++){if(wV.fromBufferAttribute(o,t),TV.fromBufferAttribute(l,t),wV.w=1,TV.w=1,wV.applyMatrix4(EV),TV.applyMatrix4(EV),wV.z>c&&TV.z>c)continue;if(wV.z>c){const e=wV.z-TV.z,t=(wV.z-c)/e;wV.lerp(TV,t)}else if(TV.z>c){const e=TV.z-wV.z,t=(TV.z-c)/e;TV.lerp(wV,t)}wV.applyMatrix4(r),TV.applyMatrix4(r),wV.multiplyScalar(1/wV.w),TV.multiplyScalar(1/TV.w),wV.x*=i.x/2,wV.y*=i.y/2,TV.x*=i.x/2,TV.y*=i.y/2,CV.start.copy(wV),CV.start.z=0,CV.end.copy(TV),CV.end.z=0;const a=CV.closestPointToPointParameter(MV,!0);CV.at(a,RV);const u=Qe.lerp(wV.z,TV.z,a),h=u>=-1&&u<=1,A=MV.distanceTo(RV)<.5*IV;if(h&&A){CV.start.fromBufferAttribute(o,t),CV.end.fromBufferAttribute(l,t),CV.start.applyMatrix4(s),CV.end.applyMatrix4(s);const r=new Ke,i=new Ke;LV.distanceSqToSegment(CV.start,CV.end,i,r),n.push({point:i,pointOnLine:r,distance:LV.origin.distanceTo(i),object:e,face:null,faceIndex:t,uv:null,uv1:null})}}}(this,r,t)))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(yV),this.material.uniforms.resolution.value.set(yV.z,yV.w))}}class UV extends _V{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let r=0;r<t;r+=3)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let r=0;r<t;r++)n[6*r]=e[r].x,n[6*r+1]=e[r].y,n[6*r+2]=e[r].z||0,n[6*r+3]=e[r+1].x,n[6*r+4]=e[r+1].y,n[6*r+5]=e[r+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class FV extends BV{constructor(e=new UV,t=new vV({color:16777215*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}class kV extends ws{constructor(e,t={}){const n=t.font;if(void 0===n)super();else{const r=n.generateShapes(e,t.size);void 0===t.depth&&(t.depth=50),void 0===t.bevelThickness&&(t.bevelThickness=10),void 0===t.bevelSize&&(t.bevelSize=8),void 0===t.bevelEnabled&&(t.bevelEnabled=!1),super(r,t)}
1this.type="TextGeometry"}}function qV(e,t,n,r,i){const s=i.glyphs[e]||i.glyphs["?"];if(!s)return;const a=new _a;let o,l,u,c,h,A,d,p;if(s.o){const e=s._cachedOutline||(s._cachedOutline=s.o.split(" "));for(let i=0,s=e.length;i<s;)switch(e[i++]){case"m":o=e[i++]*t+n,l=e[i++]*t+r,a.moveTo(o,l);break;case"l":o=e[i++]*t+n,l=e[i++]*t+r,a.lineTo(o,l);break;case"q":u=e[i++]*t+n,c=e[i++]*t+r,h=e[i++]*t+n,A=e[i++]*t+r,a.quadraticCurveTo(h,A,u,c);break;case"b":u=e[i++]*t+n,c=e[i++]*t+r,h=e[i++]*t+n,A=e[i++]*t+r,d=e[i++]*t+n,p=e[i++]*t+r,a.bezierCurveTo(h,A,d,p,u,c)}}return{offsetX:s.ha*t,path:a}}function VV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function zV(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function GV(e,t,n,r,i,s,a){try{var o=e[s](a),l=o.value}catch(e){return void n(e)}o.done?t(l):Promise.resolve(l).then(r,i)}function jV(e,t,n){return t=JV(t),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,tz()?Reflect.construct(t,n||[],JV(e).constructor):t.apply(e,n))}function HV(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WV(e,t){return e.get(zV(e,t))}function XV(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function QV(e,t,n){return e.set(zV(e,t),n),n}function YV(e,t,n){if(tz())return Reflect.construct.apply(null,arguments);var r=[null];return r.push.apply(r,t),new(e.bind.apply(e,r))}function $V(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cz(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function KV(e,t,n){return(t=cz(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ZV(){return ZV="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=JV(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},ZV.apply(null,arguments)}function JV(e){return JV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},JV(e)}function ez(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&az(e,t)}function tz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tz=function(){return!!e})()}function nz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rz(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nz(Object(n),!0).forEach((function(t){KV(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nz(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iz(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,r,i,s){var l=r&&r.prototype instanceof o?r:o,u=Object.create(l.prototype);return sz(u,"_invoke",function(n,r,i){var s,o,l,u=0,c=i||[],h=!1,A={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return s=t,o=0,l=e,A.n=n,a}};function d(n,r){for(o=n,l=r,t=0;!h&&u&&!i&&t<c.length;t++){var i,s=c[t],d=A.p,p=s[2];n>
vendor: 5,593 bytes, line 1
13?(i=p===r)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=d&&((i=n<2&&d<s[1])?(o=0,A.v=r,A.n=s[1]):d<p&&(i=n<3||s[0]>r||r>p)&&(s[4]=n,s[5]=r,A.n=p,o=0))}if(i||n>1)return a;throw h=!0,r}return function(i,c,p){if(u>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,p),o=c,l=p;(t=o<2?e:l)||!h;){s||(o?o<3?(o>1&&(A.n=-1),d(o,l)):A.n=l:A.v=l);try{if(u=2,s){if(o||(i="next"),t=s[i]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),o=1);s=e}else if((t=(h=A.n<0)?l:n.call(r,A))!==a)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:h}}}(n,i,s),!0),u}var a={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(sz(t={},r,(function(){return this})),t),h=u.prototype=o.prototype=Object.create(c);function A(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,sz(e,i,"GeneratorFunction")),e.prototype=Object.create(h),e}return l.prototype=u,sz(h,"constructor",u),sz(u,"constructor",l),l.displayName="GeneratorFunction",sz(u,i,"GeneratorFunction"),sz(h),sz(h,i,"Generator"),sz(h,r,(function(){return this})),sz(h,"toString",(function(){return"[object Generator]"})),(iz=function(){return{w:s,m:A}})()}function sz(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}sz=function(e,t,n,r){if(t)i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n;else{function t(t,n){sz(e,t,(function(e){return this._invoke(t,n,e)}))}t("next",0),t("throw",1),t("return",2)}},sz(e,t,n,r)}function az(e,t){return az=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},az(e,t)}function oz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||hz(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lz(e,t,n,r){var i=ZV(JV(e.prototype),t,n);return"function"==typeof i?function(e){return i.apply(n,e)}:i}function uz(e){return function(e){if(Array.isArray(e))return VV(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||hz(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cz(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function hz(e,t){if(e){if("string"==typeof e)return VV(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?VV(e,t):void 0}}var Az=function(e){e instanceof Array?e.forEach(Az):(e.map&&e.map.dispose(),e.dispose())},dz=function(e){e.geometry&&e.geometry.dispose(),e.material&&Az(e.material),e.texture&&e.texture.dispose(),e.children&&e.children.forEach(dz)},pz=function(e){if(e&&e.children)for(;e.children.length;){var t=e.children[0];e.remove(t),dz(t)}};function fz(e,t){var n=new t;return{linkProp:function(t){return{default:n[t](),onChange:function(n,r){r[e][t](n)},triggerUpdate:!1}},linkMethod:function(t){return function(n){for(var r=n[e],i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];var o=r[t].apply(r,s);return o===r?this:o}}}}var mz=100;function gz(){return mz}function _z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-e)*Math.PI/180,i=(90-t)*Math.PI/180,s=mz*(1+n),a=Math.sin(r);return{x:s*a*Math.cos(i),y:s*Math.cos(r),z:s*a*Math.sin(i)}}function vz(e){var t=e.x,n=e.y,r=e.z,i=Math.sqrt(t*t+n*n+r*r),s=Math.acos(n/i),a=Math.atan2(r,t);return{lat:90-180*s/Math.PI,lng:90-180*a/Math.PI-(a<-Math.PI/2?360:0),altitude:i/mz-1}}function yz(e){return e*Math.PI/180}var xz=window.THREE?window.THREE:{BackSide:1,BufferAttribute:er,Color:Gn,Mesh:Tr,ShaderMaterial:Pr},bz=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.color,s=void 0===i?"gold":i,a=r.size,o=void 0===a?2:a,l=r.coefficient,u=void 0===l?.5:l,c=r.power,h=void 0===c?1:c,A=r.hollowRadius,d=void 0===A?0:A,p=r.backside,f=void 0===p||p;HV(this,t),n=jV(this,t);var m=function(e,t){for(var n=e.clone(),r=new Float32Array(3*e.attributes.position.count),i=0,s=r.length;i<s;i++){var a=e.attributes.normal.array[i],o=e.attributes.position.array[i];r[i]=o+a*t}return n.setAttribute("position",new xz.BufferAttribute(r,3)),n}(e,o),g=function(e,t,n,r){return new xz.ShaderMaterial({depthWrite:!1,transparent:!0,vertexShader:"\nuniform float hollowRadius;\n\nvarying vec3 vVertexWorldPosition;\nvarying vec3 vVertexNormal;\nvarying float vCameraDistanceToObjCenter;\nvarying float vVertexAngularDistanceToHollowRadius;\n\nvoid main() { \n vVertexNormal\t= normalize(normalMatrix * normal);
1\n vVertexWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;\n \n vec4 objCenterViewPosition = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n vCameraDistanceToObjCenter = length(objCenterViewPosition);\n \n float edgeAngle = atan(hollowRadius / vCameraDistanceToObjCenter);\n float vertexAngle = acos(dot(normalize(modelViewMatrix * vec4(position, 1.0)), normalize(objCenterViewPosition)));\n vVertexAngularDistanceToHollowRadius = vertexAngle - edgeAngle;\n\n gl_Position\t= projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",fragmentShader:"\nuniform vec3 color;\nuniform float coefficient;\nuniform float power;\nuniform float hollowRadius;\n\nvarying vec3 vVertexNormal;\nvarying vec3 vVertexWorldPosition;\nvarying float vCameraDistanceToObjCenter;\nvarying float vVertexAngularDistanceToHollowRadius;\n\nvoid main() {\n if (vCameraDistanceToObjCenter < hollowRadius) discard; // inside the hollowRadius\n if (vVertexAngularDistanceToHollowRadius < 0.0) discard; // frag position is within the hollow radius\n\n vec3 worldCameraToVertex = vVertexWorldPosition - cameraPosition;\n vec3 viewCameraToVertex\t= (viewMatrix * vec4(worldCameraToVertex, 0.0)).xyz;\n viewCameraToVertex = normalize(viewCameraToVertex);\n float intensity\t= pow(\n coefficient + dot(vVertexNormal, viewCameraToVertex),\n power\n );\n gl_FragColor = vec4(color, intensity);\n}",uniforms:{coefficient:{value:e},color:{value:new xz.Color(t)},power:{value:n},hollowRadius:{value:r}}})}(u,s,h,d);return f&&(g.side=xz.BackSide),n.geometry=m,n.material=g,n}return ez(t,e),$V(t)}(xz.Mesh),wz=window.THREE?window.THREE:{Color:Gn,Group:Vr,LineBasicMaterial:ai,LineSegments:_i,Mesh:Tr,MeshPhongMaterial:Ps,SphereGeometry:Ms,SRGBColorSpace:Se,TextureLoader:ks},Tz=Pu({props:{globeImageUrl:{},bumpImageUrl:{},showGlobe:{default:!0,onChange:function(e,t){t.globeGroup.visible=!!e},triggerUpdate:!1},showGraticules:{default:!1,onChange:function(e,t){t.graticulesObj.visible=!!e},triggerUpdate:!1},showAtmosphere:{default:!0,onChange:function(e,t){t.atmosphereObj&&(t.atmosphereObj.visible=!!e)},triggerUpdate:!1},atmosphereColor:{default:"lightskyblue"},atmosphereAltitude:{default:.15},globeCurvatureResolution:{default:4},globeTileEngineUrl:{onChange:function(e,t){t.tileEngine.tileUrl=e}},globeTileEngineMaxLevel:{default:17,onChange:function(e,t){t.tileEngine.maxLevel=e},triggerUpdate:!1},updatePov:{onChange:function(e,t){t.tileEngine.updatePov(e)},triggerUpdate:!1},onReady:{default:function(){},triggerUpdate:!1}},methods:{globeMaterial:function(e,t){return void 0!==t?(e.globeObj.material=t||e.defaultGlobeMaterial,this):e.globeObj.material},_destructor:function(e){pz(e.globeObj),pz(e.tileEngine),pz(e.graticulesObj)}},stateInit:function(){var e=new wz.MeshPhongMaterial({color:0}),t=new wz.Mesh(void 0,e);t.rotation.y=-Math.PI/2;var n=new uf(mz),r=new wz.Group;return r.__globeObjType="globe",r.add(t),r.add(n),{globeGroup:r,globeObj:t,graticulesObj:new wz.LineSegments(new $f(function(){var e,t,n,r,i,s,a,o,l,u,c,h,A=10,d=A,p=90,f=360,m=2.5;function g(){return{type:"MultiLineString",coordinates:_()}}function _(){return uc(zh(r/p)*p,n,p).map(c).concat(uc(zh(o/f)*f,a,f).map(h)).concat(uc(zh(t/A)*A,e,A).filter((function(e){return Fh(e%p)>Nh})).map(l)).concat(uc(zh(s/d)*d,i,d).filter((function(e){return Fh(e%f)>Nh})).map(u))}return g.lines=function(){return _().map((function(e){return{type:"LineString",coordinates:e}}))},g.outline=function(){return{type:"Polygon",coordinates:[c(r).concat(h(a).slice(1),c(n).reverse().slice(1),h(o).reverse().slice(1))]}},g.extent=function(e){return arguments.length?g.extentMajor(e).extentMinor(e):g.extentMinor()},g.extentMajor=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),o>a&&(e=o,o=a,a=e),g.precision(m)):[[r,o],[n,a]]},g.extentMinor=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],s=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),s>i&&(n=s,s=i,i=n),g.precision(m)):[[t,s],[e,i]]},g.step=function(e){return arguments.length?g.stepMajor(e).stepMinor(e):g.stepMinor()},g.stepMajor=function(e){return arguments.length?(p=+e[0],f=+e[1],g):[p,f]},g.stepMinor=function(e){return arguments.length?(A=+e[0],d=+e[1],g):[A,d]},g.precision=function(A){return arguments.length?(m=+A,l=lp(s,i,90),u=up(t,e,m),c=lp(o,a,90),h=up(r,n,m),g):m},g.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()(),mz,2),new wz.LineBasicMaterial({color:"lightgrey",transparent:!0,opacity:.1})),defaultGlobeMaterial:e,tileEngine:n}},init:function(e,t){pz(e),t.scene=e,t.scene.add(t.globeGroup),t.scene.add(t.graticulesObj),t.ready=!1},update:function(e,t){var n=e.globeObj.material;if(e.tileEngine.visible=!(e.globeObj.visible=!e.globeTileEngineUrl),t.hasOwnProperty("globeCurvatureResolution")){var r;null===(r=e.globeObj.geometry)||void 0===r||r.dispose();var i=Math.max(4,Math.round(360/e.globeCurvatureResolution));e.globeObj.geometry=new wz.SphereGeometry(mz,i,i/2),e.tileEngine.curvatureResolution=e.globeCurvatureResolution}if(t.hasOwnProperty("globeImageUrl")&&(e.globeImageUrl?(new wz.TextureLoader).load(e.globeImageUrl,(function(t){t.colorSpace
1=wz.SRGBColorSpace,n.map=t,n.color=null,n.needsUpdate=!0,!e.ready&&(e.ready=!0)&&setTimeout(e.onReady)})):!n.color&&(n.color=new wz.Color(0))),t.hasOwnProperty("bumpImageUrl")&&(e.bumpImageUrl?e.bumpImageUrl&&(new wz.TextureLoader).load(e.bumpImageUrl,(function(e){n.bumpMap=e,n.needsUpdate=!0})):(n.bumpMap=null,n.needsUpdate=!0)),(t.hasOwnProperty("atmosphereColor")||t.hasOwnProperty("atmosphereAltitude"))&&(e.atmosphereObj&&(e.scene.remove(e.atmosphereObj),pz(e.atmosphereObj)),e.atmosphereColor&&e.atmosphereAltitude)){var s=e.atmosphereObj=new bz(e.globeObj.geometry,{color:e.atmosphereColor,size:mz*e.atmosphereAltitude,hollowRadius:mz,coefficient:.1,power:3.5});s.visible=!!e.showAtmosphere,s.__globeObjType="atmosphere",e.scene.add(s)}e.ready||e.globeImageUrl&&!e.globeTileEngineUrl||(e.ready=!0,e.onReady())}}),Sz=function(e){return isNaN(e)?parseInt(om(e).toHex(),16):e},Mz=function(e){return e&&isNaN(e)?Rc(e).opacity:1},Ez=function(e){var t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=1,s=/^rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.eE+-]+)\s*\)$/.exec(e.trim().toLowerCase());if(s){var a=oz(s.slice(1),4),o=a[0],l=a[1],u=a[2],c=a[3];t=new Gn("rgb(".concat(+o,",").concat(+l,",").concat(+u,")")),i=Math.min(+c,1)}else t=new Gn(e);r&&t.convertLinearToSRGB();var h=t.toArray();return n?[].concat(uz(h),[i]):h},Cz=window.THREE?window.THREE:{BufferAttribute:er};function Rz(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(1===t)return new Cz.BufferAttribute(new n(e),t);for(var r=new Cz.BufferAttribute(new n(e.length*t),t),i=0,s=e.length;i<s;i++)r.set(e[i],i*t);return r}var Nz=new WeakMap,Pz=new WeakMap,Dz=new WeakMap,Lz=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.dataBindAttr,s=void 0===i?"__data":i,a=r.objBindAttr,o=void 0===a?"__threeObj":a,l=r.removeDelay,u=void 0===l?0:l;return HV(this,t),KV(n=jV(this,t),"scene",void 0),XV(n,Nz,void 0),XV(n,Pz,void 0),XV(n,Dz,void 0),n.scene=e,QV(Nz,n,s),QV(Pz,n,o),QV(Dz,n,u),n.onRemoveObj((function(){})),n}return ez(t,e),$V(t,[{key:"onCreateObj",value:function(e){var n=this;return lz(t,"onCreateObj",this)([function(t){var r=e(t);return t[WV(Pz,n)]=r,r[WV(Nz,n)]=t,n.scene.add(r),r}]),this}},{key:"onRemoveObj",value:function(e){var n=this;return lz(t,"onRemoveObj",this)([function(r,i){var s=lz(t,"getData",n)([r]);e(r,i);var a=function(){n.scene.remove(r),pz(r),delete s[WV(Pz,n)]};WV(Dz,n)?setTimeout(a,WV(Dz,n)):a()}]),this}}])}(Zm),Iz=window.THREE?window.THREE:{BufferGeometry:Ar,CylinderGeometry:Ci,Matrix4:$t,Mesh:Tr,MeshLambertMaterial:Ds,Object3D:Tn,Vector3:Ke},Oz=Object.assign({},nm),Bz=Oz.BufferGeometryUtils||Oz,Uz=Pu({props:{pointsData:{default:[]},pointLat:{default:"lat"},pointLng:{default:"lng"},pointColor:{default:function(){return"#ffffaa"}},pointAltitude:{default:.1},pointRadius:{default:.25},pointResolution:{default:12,triggerUpdate:!1},pointsMerge:{default:!1},pointsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjPoint"})},update:function(e,t){var n=rm(e.pointLat),r=rm(e.pointLng),i=rm(e.pointAltitude),s=rm(e.pointRadius),a=rm(e.pointColor),o=new Iz.CylinderGeometry(1,1,1,e.pointResolution);o.applyMatrix4((new Iz.Matrix4).makeRotationX(Math.PI/2)),o.applyMatrix4((new Iz.Matrix4).makeTranslation(0,0,-.5));var l=2*Math.PI*mz/360,u={};if(!e.pointsMerge&&t.hasOwnProperty("pointsMerge")&&pz(e.scene),e.dataMapper.scene=e.pointsMerge?new Iz.Object3D:e.scene,e.dataMapper.onCreateObj((function(){var e=new Iz.Mesh(o);return e.__globeObjType="point",e})).onUpdateObj((function(t,o){var c=function(n){var r=t.__currentTargetD=n,i=r.r,s=r.alt,a=r.lat,o=r.lng;Object.assign(t.position,_z(a,o));var u=e.pointsMerge?new Iz.Vector3(0,0,0):e.scene.localToWorld(new Iz.Vector3(0,0,0));t.lookAt(u),t.scale.x=t.scale.y=Math.min(30,i)*l,t.scale.z=Math.max(s*mz,.1)},h={alt:+i(o),r:+s(o),lat:+n(o),lng:+r(o)},A=t.__currentTargetD||Object.assign({},h,{alt:-.001});if(Object.keys(h).some((function(e){return A[e]!==h[e]}))&&(e.pointsMerge||!e.pointsTransitionDuration||e.pointsTransitionDuration<0?c(h):e.tweenGroup.add(new Fu(A).to(h,e.pointsTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(c).start())),!e.pointsMerge){var d=a(o),p=d?Mz(d):0,f=!!p;t.visible=f,f&&(u.hasOwnProperty(d)||(u[d]=new Iz.MeshLambertMaterial({color:Sz(d),transparent:p<1,opacity:p})),t.material=u[d])}})).digest(e.pointsData),e.pointsMerge){var c=e.pointsData.length?(Bz.mergeGeometries||Bz.mergeBufferGeometries)(e.pointsData.map((function(t){var n=e.dataMapper.getObj(t),r=n.geometry.clone();
vendor: 4,254 bytes, line 1
1n.updateMatrix(),r.applyMatrix4(n.matrix);var i=Ez(a(t));return r.setAttribute("color",Rz(Array(r.getAttribute("position").count).fill(i),4)),r}))):new Iz.BufferGeometry,h=new Iz.Mesh(c,new Iz.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0}));h.__globeObjType="points",h.__data=e.pointsData,e.dataMapper.clear(),pz(e.scene),e.scene.add(h)}}}),Fz=function(){return{uniforms:{dashOffset:{value:0},dashSize:{value:1},gapSize:{value:0},dashTranslate:{value:0}},vertexShader:"\n ".concat(wa.common,"\n ").concat(wa.logdepthbuf_pars_vertex,"\n \n uniform float dashTranslate; \n\n attribute vec4 color;\n varying vec4 vColor;\n \n attribute float relDistance;\n varying float vRelDistance;\n\n void main() {\n // pass through colors and distances\n vColor = color;\n vRelDistance = relDistance + dashTranslate;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n \n ").concat(wa.logdepthbuf_vertex,"\n }\n "),fragmentShader:"\n ".concat(wa.logdepthbuf_pars_fragment,"\n\n uniform float dashOffset; \n uniform float dashSize;\n uniform float gapSize; \n \n varying vec4 vColor;\n varying float vRelDistance;\n \n void main() {\n // ignore pixels in the gap\n if (vRelDistance < dashOffset) discard;\n if (mod(vRelDistance - dashOffset, dashSize + gapSize) > dashSize) discard;\n \n // set px color: [r, g, b, a], interpolated between vertices \n gl_FragColor = vColor; \n \n ").concat(wa.logdepthbuf_fragment,"\n }\n ")}},kz=function(e){return e.uniforms.surfaceRadius={type:"float",value:0},e.vertexShader=("attribute float surfaceRadius;\nvarying float vSurfaceRadius;\nvarying vec3 vPos;\n"+e.vertexShader).replace("void main() {",["void main() {","vSurfaceRadius = surfaceRadius;","vPos = position;"].join("\n")),e.fragmentShader=("uniform float surfaceRadius;\nvarying float vSurfaceRadius;\nvarying vec3 vPos;\n"+e.fragmentShader).replace("void main() {",["void main() {","if (length(vPos) < max(surfaceRadius, vSurfaceRadius)) discard;"].join("\n")),e},qz=function(e){return e.vertexShader="\n attribute float r;\n \n const float PI = 3.1415926535897932384626433832795;\n float toRad(in float a) {\n return a * PI / 180.0;\n }\n \n vec3 Polar2Cartesian(in vec3 c) { // [lat, lng, r]\n float phi = toRad(90.0 - c.x);\n float theta = toRad(90.0 - c.y);\n float r = c.z;\n return vec3( // x,y,z\n r * sin(phi) * cos(theta),\n r * cos(phi),\n r * sin(phi) * sin(theta)\n );\n }\n \n vec2 Cartesian2Polar(in vec3 p) {\n float r = sqrt(p.x * p.x + p.y * p.y + p.z * p.z);\n float phi = acos(p.y / r);\n float theta = atan(p.z, p.x);\n return vec2( // lat,lng\n 90.0 - phi * 180.0 / PI,\n 90.0 - theta * 180.0 / PI - (theta < -PI / 2.0 ? 360.0 : 0.0)\n );\n }\n ".concat(e.vertexShader.replace("}"," \n vec3 pos = Polar2Cartesian(vec3(Cartesian2Polar(position), r));\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);\n }\n "),"\n "),e},Vz=function(e,t){return e.onBeforeCompile=function(n){e.userData.shader=t(n)},e},zz=["stroke"],Gz=window.THREE?window.THREE:{BufferGeometry:Ar,CubicBezierCurve3:qi,Curve:Ri,Group:Vr,Line:pi,Mesh:Tr,NormalBlending:1,ShaderMaterial:Pr,TubeGeometry:Es,Vector3:Ke},jz=ng.default||ng,Hz=Pu({props:{arcsData:{default:[]},arcStartLat:{default:"startLat"},arcStartLng:{default:"startLng"},arcEndLat:{default:"endLat"},arcEndLng:{default:"endLng"},arcColor:{default:function(){return"#ffffaa"}},arcAltitude:{},arcAltitudeAutoScale:{default:.5},arcStroke:{},arcCurveResolution:{default:64,triggerUpdate:!1},arcCircularResolution:{default:6,triggerUpdate:!1},arcDashLength:{default:1},arcDashGap:{default:0},arcDashInitialGap:{default:0},arcDashAnimateTime:{default:0},arcsTransitionDuration:{default:1e3,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.pause()},resumeAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.resume()},_destructor:function(e){var t;e.sharedMaterial.dispose(),null===(t=e.ticker)||void 0===t||t.dis
1pose()}},stateInit:function(e){return{tweenGroup:e.tweenGroup,ticker:new jz,sharedMaterial:new Gz.ShaderMaterial(rz(rz({},Fz()),{},{transparent:!0,blending:Gz.NormalBlending}))}},init:function(e,t){pz(e),t.scene=e,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjArc"}).onCreateObj((function(){var e=new Gz.Group;return e.__globeObjType="arc",e})),t.ticker.onTick.add((function(e,n){t.dataMapper.entries().map((function(e){return oz(e,2)[1]})).filter((function(e){return e.children.length&&e.children[0].material&&e.children[0].__dashAnimateStep})).forEach((function(e){var t=e.children[0],r=t.__dashAnimateStep*n,i=t.material.uniforms.dashTranslate.value%1e9;t.material.uniforms.dashTranslate.value=i+r}))}))},update:function(e){var t=rm(e.arcStartLat),n=rm(e.arcStartLng),r=rm(e.arcEndLat),i=rm(e.arcEndLng),s=rm(e.arcAltitude),a=rm(e.arcAltitudeAutoScale),o=rm(e.arcStroke),l=rm(e.arcColor),u=rm(e.arcDashLength),c=rm(e.arcDashGap),h=rm(e.arcDashInitialGap),A=rm(e.arcDashAnimateTime);e.dataMapper.onUpdateObj((function(d,p){var f=o(p),m=null!=f;if(!d.children.length||m!==("Mesh"===d.children[0].type)){pz(d);var g=m?new Gz.Mesh:new Gz.Line(new Gz.BufferGeometry);g.material=e.sharedMaterial.clone(),d.add(g)}var _=d.children[0];Object.assign(_.material.uniforms,{dashSize:{value:u(p)},gapSize:{value:c(p)},dashOffset:{value:h(p)}});var v=A(p);_.__dashAnimateStep=v>0?1e3/v:0;var y=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=t+1;if(e instanceof Array||e instanceof Function){var s=e instanceof Array?Ch().domain(e.map((function(t,n){return n/(e.length-1)}))).range(e):e;n=function(e){return Ez(s(e),!0,!0)}}else{var a=Ez(e,!0,!0);n=function(){return a}}for(var o=[],l=0,u=i;l<u;l++)for(var c=n(l/(u-1)),h=0;h<r;h++)o.push(c);return Rz(o,4)}(l(p),e.arcCurveResolution,m?e.arcCircularResolution+1:1),x=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,s=e+1;i<s;i++)for(var a=i/(s-1),o=0;o<t;o++)r.push(a);return n&&r.reverse(),Rz(r,1)}(e.arcCurveResolution,m?e.arcCircularResolution+1:1,!0);_.geometry.setAttribute("color",y),_.geometry.setAttribute("relDistance",x);var b=function(t){var n=d.__currentTargetD=t,r=n.stroke,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,zz),s=function(e){var t=e.alt,n=e.altAutoScale,r=e.startLat,i=e.startLng,s=e.endLat,a=function(e){var t=oz(e,3),n=t[0],r=_z(t[1],n,t[2]),i=r.x,s=r.y,a=r.z;return new Gz.Vector3(i,s,a)},o=[i,r],l=[e.endLng,s],u=t;if(null==u&&(u=Jd(o,l)/2*n),u){var c=cp(o,l),h=[.25,.75].map((function(e){return[].concat(uz(c(e)),[1.5*u])})),A=oz(h,2),d=A[0],p=A[1];return YV(Gz.CubicBezierCurve3,uz([o,d,p,l].map(a)))}return function(e,t){var n=e.angleTo(t),r=0===n?function(){return e.clone()}:function(r){return(new Gz.Vector3).addVectors(e.clone().multiplyScalar(Math.sin((1-r)*n)),t.clone().multiplyScalar(Math.sin(r*n))).divideScalar(Math.sin(n))},i=new Gz.Curve;return i.getPoint=r,i}.apply(void 0,uz([[].concat(o,[.001]),[].concat(l,[.001])].map(a)))}(i);m?(_.geometry&&_.geometry.dispose(),_.geometry=new Gz.TubeGeometry(s,e.arcCurveResolution,r/2,e.arcCircularResolution),_.geometry.setAttribute("color",y),_.geometry.setAttribute("relDistance",x)):_.geometry.setFromPoints(s.getPoints(e.arcCurveResolution))},w={stroke:f,alt:s(p),altAutoScale:+a(p),startLat:+t(p),startLng:+n(p),endLat:+r(p),endLng:+i(p)},T=d.__currentTargetD||Object.assign({},w,{altAutoScale:-.001});Object.keys(w).some((function(e){return T[e]!==w[e]}))&&(!e.arcsTransitionDuration||e.arcsTransitionDuration<0?b(w):e.tweenGroup.add(new Fu(T).to(w,e.arcsTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(b).start()))})).digest(e.arcsData)}}),Wz=window.THREE?window.THREE:{BufferGeometry:Ar,DoubleSide:2,Mesh:Tr,MeshLambertMaterial:Ds,Object3D:Tn},Xz=Object.assign({},nm),Qz=Xz.BufferGeometryUtils||Xz,Yz=Pu({props:{hexBinPointsData:{default:[]},hexBinPointLat:{default:"lat"},hexBinPointLng:{default:"lng"},hexBinPointWeight:{default:1}
1,hexBinResolution:{default:4},hexMargin:{default:.2},hexTopCurvatureResolution:{default:5},hexTopColor:{default:function(){return"#ffffaa"}},hexSideColor:{default:function(){return"#ffffaa"}},hexAltitude:{default:function(e){return.01*e.sumWeight}},hexBinMerge:{default:!1},hexTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjHexbin"})},update:function(e,t){var n=rm(e.hexBinPointLat),r=rm(e.hexBinPointLng),i=rm(e.hexBinPointWeight),s=rm(e.hexAltitude),a=rm(e.hexTopColor),o=rm(e.hexSideColor),l=rm(e.hexMargin),u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=(t instanceof Array?t.length?t:[void 0]:[t]).map((function(e){return{keyAccessor:e,isProp:!(e instanceof Function)}})),s=e.reduce((function(e,t){var r=e,s=t;return i.forEach((function(e,t){var a,o=e.keyAccessor;if(e.isProp){var l=s,u=l[o],c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(l,[o].map(m_));a=u,s=c}else a=o(s,t);t+1<i.length?(r.hasOwnProperty(a)||(r[a]={}),r=r[a]):n?(r.hasOwnProperty(a)||(r[a]=[]),r[a].push(s)):r[a]=s})),e}),{});n instanceof Function&&function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;r===i.length?Object.keys(t).forEach((function(e){return t[e]=n(t[e])})):Object.values(t).forEach((function(t){return e(t,r+1)}))}(s);var a=s;return r&&(a=[],function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];n.length===i.length?a.push({keys:n,vals:t}):Object.entries(t).forEach((function(t){var r=p_(t,2),i=r[0],s=r[1];return e(s,[].concat(f_(n),[i]))}))}(s),t instanceof Array&&0===t.length&&1===a.length&&(a[0].keys=[])),a}(e.hexBinPointsData.map((function(t){return rz(rz({},t),{},{h3Idx:z_(n(t),r(t),e.hexBinResolution)})})),"h3Idx"),c=Object.entries(u).map((function(e){var t=oz(e,2),n=t[0],r=t[1];return{h3Idx:n,points:r,sumWeight:r.reduce((function(e,t){return e+ +i(t)}),0)}})),h={};if(!e.hexBinMerge&&t.hasOwnProperty("hexBinMerge")&&pz(e.scene),e.dataMapper.scene=e.hexBinMerge?new Wz.Object3D:e.scene,e.dataMapper.id((function(e){return e.h3Idx})).onCreateObj((function(e){var t=new Wz.Mesh;t.__hexCenter=G_(e.h3Idx),t.__hexGeoJson=j_(e.h3Idx).reverse();var n=t.__hexCenter[1];return t.__hexGeoJson.forEach((function(e){var t=e[0];Math.abs(n-t)>170&&(e[0]+=n>t?360:-360)})),t.__globeObjType="hexbin",t})).onUpdateObj((function(t,n){var r=Math.max(0,Math.min(1,+l(n))),i=oz(t.__hexCenter,2),u=i[0],c=i[1],A=0===r?t.__hexGeoJson:t.__hexGeoJson.map((function(e){var t=oz(e,2),n=t[0],i=t[1];return[[n,c],[i,u]].map((function(e){var t=oz(e,2);return function(e,t,n){return e-(e-t)*n}(t[0],t[1],r)}))})),d=e.hexTopCurvatureResolution;t.geometry&&t.geometry.dispose(),t.geometry=new A_([A],0,mz,!1,!0,!0,d);var p={alt:+s(n)},f=function(e){var n=(t.__currentTargetD=e).alt;t.scale.x=t.scale.y=t.scale.z=1+n;var r=mz/(n+1);t.geometry.setAttribute("surfaceRadius",Rz(Array(t.geometry.getAttribute("position").count).fill(r),1))},m=t.__currentTargetD||Object.assign({},p,{alt:-.001});if(Object.keys(p).some((function(e){return m[e]!==p[e]}))&&(e.hexBinMerge||!e.hexTransitionDuration||e.hexTransitionDuration<0?f(p):e.tweenGroup.add(new Fu(m).to(p,e.hexTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(f).start())),!e.hexBinMerge){var g=o(n),_=a(n);[g,_].forEach((function(e){if(!h.hasOwnProperty(e)){var t=Mz(e);h[e]=Vz(new Wz.MeshLambertMaterial({color:Sz(e),transparent:t<1,opacity:t,side:Wz.DoubleSide}),kz)}})),t.material=[g,_].map((function(e){return h[e]}))}})).digest(c),e.hexBinMerge){var A=c.length?(Qz.mergeGeometries||Qz.mergeBufferGeometries)(c.map((function(t){var n=e.dataMapper.getObj(t),r=n.geometry.toNonIndexed();
1n.updateMatrix(),r.applyMatrix4(n.matrix);var i=Ez(a(t)),s=Ez(o(t)),l=r.getAttribute("position").count,u=r.groups[0].count;return r.setAttribute("color",Rz(uz(new Array(l)).map((function(e,t){return t>=u?i:s})),4)),r}))):new Wz.BufferGeometry,d=new Wz.MeshLambertMaterial({color:16777215,transparent:!0,vertexColors:!0,side:Wz.DoubleSide});d.onBeforeCompile=function(e){d.userData.shader=kz(e)};var p=new Wz.Mesh(A,d);p.__globeObjType="hexBinPoints",p.__data=c,e.dataMapper.clear(),pz(e.scene),e.scene.add(p)}}}),$z=function(e){return e*e},Kz=function(e){return e*Math.PI/180},Zz=Math.sqrt(2*Math.PI),Jz=function(e){var t=oz(e,2),n=t[0],r=t[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=s.lngAccessor,o=void 0===a?function(e){return e[0]}:a,l=s.latAccessor,u=void 0===l?function(e){return e[1]}:l,c=s.weightAccessor,h=void 0===c?function(){return 1}:c,A=s.bandwidth,d=[n,r],p=A*Math.PI/180;return function(e){let t=0;for(let n of e)(n=+n)&&(t+=n);return t}(i.map((function(e){var t=h(e);if(!t)return 0;var n=function(e,t){var n=Math.sqrt,r=Math.cos,i=function(e){return $z(Math.sin(e/2))},s=Kz(e[1]),a=Kz(t[1]),o=Kz(e[0]),l=Kz(t[0]);return 2*Math.asin(n(i(a-s)+r(s)*r(a)*i(l-o)))}(d,[o(e),u(e)]);return function(e,t){return Math.exp(-$z(e/t)/2)/(t*Zz)}(n,p)*t})))},eG=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function a(e){GV(s,r,i,a,o,"next",e)}function o(e){GV(s,r,i,a,o,"throw",e)}a(void 0)}))}}(iz().m((function e(t){var n,r,i,s,a,o,l,u,c,h,A,d,p,f,m,g,_,v,y,x,b,w,T,S,M,E,C,R,N,P,D,L,I,O,B,U,F,k,q,V,z,G,j,H=arguments;return iz().w((function(e){for(;;)switch(e.n){case 0:if(r=H.length>1&&void 0!==H[1]?H[1]:[],s=(i=H.length>2&&void 0!==H[2]?H[2]:{}).lngAccessor,a=void 0===s?function(e){return e[0]}:s,o=i.latAccessor,l=void 0===o?function(e){return e[1]}:o,u=i.weightAccessor,c=void 0===u?function(){return 1}:u,h=i.bandwidth,null!==(n=navigator)&&void 0!==n&&n.gpu){e.n=1;break}return e.a(2,t.map((function(e){return Jz(e,r,{lngAccessor:a,latAccessor:l,weightAccessor:c,bandwidth:h})})));case 1:return A=rV,d=iV,p=fV,m=uV,g=cV,_=sV,v=dV,y=AV,x=oV,b=aV,w=lV,T=hV,S=(f=pV)(new AD(new Float32Array(t.flat().map(Kz)),2),"vec2",t.length),M=f(new AD(new Float32Array(r.map((function(e){return[Kz(a(e)),Kz(l(e)),c(e)]})).flat()),3),"vec3",r.length),E=new AD(t.length,1),C=f(E,"float",t.length),R=m(Math.PI),N=v(R.mul(2)),P=function(e){return e.mul(e)},D=function(e){return P(y(e.div(2)))},L=function(e,t){var n=m(e[1]),r=m(t[1]),i=m(e[0]),s=m(t[0]);return m(2).mul(b(v(D(r.sub(n)).add(x(n).mul(x(r)).mul(D(s.sub(i)))))))},I=function(e,t){return w(T(P(e.div(t)).div(2))).div(t.mul(N))},O=p(Kz(h)),B=p(Kz(4*h)),U=p(r.length),F=A((function(){var e=S.element(g),t=C.element(g);t.assign(0),_(U,(function(n){var r=n.i,i=M.element(r),s=i.z;d(s,(function(){var n=L(i.xy,e.xy);d(n&&n.lessThan(B),(function(){t.addAssign(I(n,O).mul(s))}))}))}))})),k=F().compute(t.length),q=new nV,e.n=2,q.computeAsync(k);case 2:return V=Array,z=Float32Array,e.n=3,q.getArrayBufferAsync(E);case 3:return G=e.v,j=new z(G),e.a(2,V.from.call(V,j))}}),e)})));return function(t){return e.apply(this,arguments)}}(),tG=window.THREE?window.THREE:{Mesh:Tr,MeshLambertMaterial:Ds,SphereGeometry:Ms},nG=function(e){var t=Rc(function(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-14825.05*e)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+707.56*e)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-6838.66*e)))))))+")"}(e));return t.opacity=Math.cbrt(e),t.formatRgb()},rG=Pu({props:{heatmapsData:{default:[]},heatmapPoints:{default:function(e){return e}},heatmapPointLat:{default:function(e){return e[0]}},heatmapPointLng:{default:function(e){return e[1]}},heatmapPointWeight:{default:1},heatmapBandwidth:{default:2.5},heatmapColorFn:{default:function(){return nG}},heatmapColorSaturation:{default:1.5},heatmapBaseAltitude:{default:.01},heatmapTopAltitude:{},heatmapsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjHeatmap"}).onCreateObj((function(){var e=new tG.Mesh(new tG.SphereGeometry(mz),Vz(new tG.MeshLambertMaterial({vertexColors:!0,transparent:!0}),qz));
1return e.__globeObjType="heatmap",e}))},update:function(e){var t=rm(e.heatmapPoints),n=rm(e.heatmapPointLat),r=rm(e.heatmapPointLng),i=rm(e.heatmapPointWeight),s=rm(e.heatmapBandwidth),a=rm(e.heatmapColorFn),o=rm(e.heatmapColorSaturation),l=rm(e.heatmapBaseAltitude),u=rm(e.heatmapTopAltitude);e.dataMapper.onUpdateObj((function(c,h){var A=s(h),d=a(h),p=o(h),f=l(h),m=u(h),g=t(h).map((function(e){var t=n(e),s=r(e),a=_z(t,s);return{x:a.x,y:a.y,z:a.z,lat:t,lng:s,weight:i(e)}})),_=Math.max(.1,A/3.5),v=Math.ceil(360/(_||-1));c.geometry.parameters.widthSegments!==v&&(c.geometry.dispose(),c.geometry=new tG.SphereGeometry(mz,v,v/2));var y=function(e){for(var t=e.itemSize,n=[],r=0;r<e.count;r++)n.push(e.array.slice(r*t,(r+1)*t));return n}(c.geometry.getAttribute("position")),x=y.map((function(e){var t=oz(e,3),n=vz({x:t[0],y:t[1],z:t[2]});return[n.lng,n.lat]}));eG(x,g,{latAccessor:function(e){return e.lat},lngAccessor:function(e){return e.lng},weightAccessor:function(e){return e.weight},bandwidth:A}).then((function(t){var n=uz(new Array(100)).map((function(e,t){return Ez(d(t/99))})),r=function(e){var t=c.__currentTargetD=e,r=t.kdeVals,i=t.topAlt,s=t.saturation,a=function(e){let t;for(const n of e)null!=n&&(t<n||void 0===t&&n>=n)&&(t=n);return t}(r.map(Math.abs))||1e-15,o=Rh([0,a/s],n);c.geometry.setAttribute("color",Rz(r.map((function(e){return o(Math.abs(e))})),4));var l=Ch([0,a],[mz*(1+f),mz*(1+(i||f))]);c.geometry.setAttribute("r",Rz(r.map(l)))},i={kdeVals:t,topAlt:m,saturation:p},s=c.__currentTargetD||Object.assign({},i,{kdeVals:t.map((function(){return 0})),topAlt:m?f:m,saturation:.5});s.kdeVals.length!==t.length&&(s.kdeVals=t.slice()),Object.keys(i).some((function(e){return s[e]!==i[e]}))&&(!e.heatmapsTransitionDuration||e.heatmapsTransitionDuration<0?r(i):e.tweenGroup.add(new Fu(s).to(i,e.heatmapsTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(r).start()))}))})).digest(e.heatmapsData)}}),iG=window.THREE?window.THREE:{DoubleSide:2,Group:Vr,LineBasicMaterial:ai,LineSegments:_i,Mesh:Tr,MeshBasicMaterial:Xn},sG=Pu({props:{polygonsData:{default:[]},polygonGeoJsonGeometry:{default:"geometry"},polygonSideColor:{default:function(){return"#ffffaa"}},polygonSideMaterial:{},polygonCapColor:{default:function(){return"#ffffaa"}},polygonCapMaterial:{},polygonStrokeColor:{},polygonAltitude:{default:.01},polygonCapCurvatureResolution:{default:5},polygonsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjPolygon"}).id((function(e){return e.id})).onCreateObj((function(){var e=new iG.Group;return e.__defaultSideMaterial=Vz(new iG.MeshBasicMaterial({side:iG.DoubleSide,depthWrite:!0}),kz),e.__defaultCapMaterial=new iG.MeshBasicMaterial({side:iG.DoubleSide,depthWrite:!0}),e.add(new iG.Mesh(void 0,[e.__defaultSideMaterial,e.__defaultCapMaterial])),e.add(new iG.LineSegments(void 0,new iG.LineBasicMaterial)),e.__globeObjType="polygon",e}))},update:function(e){var t=rm(e.polygonGeoJsonGeometry),n=rm(e.polygonAltitude),r=rm(e.polygonCapCurvatureResolution),i=rm(e.polygonCapColor),s=rm(e.polygonCapMaterial),a=rm(e.polygonSideColor),o=rm(e.polygonSideMaterial),l=rm(e.polygonStrokeColor),u=[];e.polygonsData.forEach((function(e){var c={data:e,capColor:i(e),capMaterial:s(e),sideColor:a(e),sideMaterial:o(e),strokeColor:l(e),altitude:+n(e),capCurvatureResolution:+r(e)},h=t(e),A=e.__id||"".concat(Math.round(1e9*Math.random()));e.__id=A,"Polygon"===h.type?u.push(rz({id:"".concat(A,"_0"),coords:h.coordinates},c)):"MultiPolygon"===h.type&&u.push.apply(u,uz(h.coordinates.map((function(e,t){return rz({id:"".concat(A,"_").concat(t),coords:e},c)}))))})),e.dataMapper.onUpdateObj((function(t,n){var r=n.coords,i=n.capColor,s=n.capMaterial,a=n.sideColor,o=n.sideMaterial,l=n.strokeColor,u=n.altitude,c=n.capCurvatureResolution,h=oz(t.children,2),A=h[0],d=h[1],p=!!l;d.visible=p;var f=!(!i&&!s),m=!(!a&&!o);(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return function(e,t){return e===t}};return Object.entries(t).every((function(t){var r=oz(t,2),i=r[0],s=r[1];return e.hasOwnProperty(i)&&n(i)(e[i],s)}))})(A.geometry.parameters||{},{polygonGeoJson:r,curvatureResolution:c,closedTop:f,includeSides:m})||(A.geometry&&A.geometry.dispose(),A.geometry=new A_(r,0,mz,!1,f,m,c)
1),!p||d.geometry.parameters&&d.geometry.parameters.geoJson.coordinates===r&&d.geometry.parameters.resolution===c||(d.geometry&&d.geometry.dispose(),d.geometry=new $f({type:"Polygon",coordinates:r},mz,c));var g=m?0:-1,_=f?m?1:0:-1;if(g>=0&&(A.material[g]=o||t.__defaultSideMaterial),_>=0&&(A.material[_]=s||t.__defaultCapMaterial),[[!o&&a,g],[!s&&i,_]].forEach((function(e){var t=oz(e,2),n=t[0],r=t[1];if(n&&!(r<0)){var i=A.material[r],s=Mz(n);i.color.set(Sz(n)),i.transparent=s<1,i.opacity=s}})),p){var v=d.material,y=Mz(l);v.color.set(Sz(l)),v.transparent=y<1,v.opacity=y}var x={alt:u},b=function(e){var n=(t.__currentTargetD=e).alt;A.scale.x=A.scale.y=A.scale.z=1+n,p&&(d.scale.x=d.scale.y=d.scale.z=1+n+1e-4),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return e};if(e.userData.shader)t(e.userData.shader.uniforms);else{var n=e.onBeforeCompile;e.onBeforeCompile=function(e){n(e),t(e.uniforms)}}}(t.__defaultSideMaterial,(function(e){return e.surfaceRadius.value=mz/(n+1)}))},w=t.__currentTargetD||Object.assign({},x,{alt:-.001});Object.keys(x).some((function(e){return w[e]!==x[e]}))&&(!e.polygonsTransitionDuration||e.polygonsTransitionDuration<0||w.alt===x.alt?b(x):e.tweenGroup.add(new Fu(w).to(x,e.polygonsTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(b).start()))})).digest(u)}}),aG=window.THREE?window.THREE:{BufferGeometry:Ar,DoubleSide:2,Mesh:Tr,MeshLambertMaterial:Ds,Vector3:Ke},oG=Object.assign({},nm),lG=oG.BufferGeometryUtils||oG,uG=Pu({props:{hexPolygonsData:{default:[]},hexPolygonGeoJsonGeometry:{default:"geometry"},hexPolygonColor:{default:function(){return"#ffffaa"}},hexPolygonAltitude:{default:.001},hexPolygonResolution:{default:3},hexPolygonMargin:{default:.2},hexPolygonUseDots:{default:!1},hexPolygonCurvatureResolution:{default:5},hexPolygonDotResolution:{default:12},hexPolygonsTransitionDuration:{default:0,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjHexPolygon"}).onCreateObj((function(){var e=new aG.Mesh(void 0,new aG.MeshLambertMaterial({side:aG.DoubleSide}));return e.__globeObjType="hexPolygon",e}))},update:function(e){var t=rm(e.hexPolygonGeoJsonGeometry),n=rm(e.hexPolygonColor),r=rm(e.hexPolygonAltitude),i=rm(e.hexPolygonResolution),s=rm(e.hexPolygonMargin),a=rm(e.hexPolygonUseDots),o=rm(e.hexPolygonCurvatureResolution),l=rm(e.hexPolygonDotResolution);e.dataMapper.onUpdateObj((function(u,c){var h=t(c),A=i(c),d=r(c),p=Math.max(0,Math.min(1,+s(c))),f=a(c),m=o(c),g=l(c),_=n(c),v=Mz(_);u.material.color.set(Sz(_)),u.material.transparent=v<1,u.material.opacity=v;var y={alt:d,margin:p,curvatureResolution:m},x={geoJson:h,h3Res:A},b=u.__currentTargetD||Object.assign({},y,{alt:-.001}),w=u.__currentMemD||x;if(Object.keys(y).some((function(e){return b[e]!==y[e]}))||Object.keys(x).some((function(e){return w[e]!==x[e]}))){u.__currentMemD=x;var T=[];"Polygon"===h.type?H_(h.coordinates,A,!0).forEach((function(e){return T.push(e)})):"MultiPolygon"===h.type&&h.coordinates.forEach((function(e){return H_(e,A,!0).forEach((function(e){return T.push(e)}))}));var S=T.map((function(e){var t=G_(e),n=j_(e).reverse(),r=t[1];return n.forEach((function(e){var t=e[0];Math.abs(r-t)>170&&(e[0]+=r>t?360:-360)})),{h3Idx:e,hexCenter:t,hexGeoJson:n}})),M=function(e){var t=u.__currentTargetD=e,n=t.alt,r=t.margin,i=t.curvatureResolution;u.geometry&&u.geometry.dispose(),u.geometry=S.length?(lG.mergeGeometries||lG.mergeBufferGeometries)(S.map((function(e){var t=oz(e.hexCenter,2),s=t[0],a=t[1];if(f){var o=_z(s,a,n),l=_z(e.hexGeoJson[0][1],e.hexGeoJson[0][0],n),u=.85*(1-r)*new aG.Vector3(o.x,o.y,o.z).distanceTo(new aG.Vector3(l.x,l.y,l.z)),c=new Ei(u,g);return c.rotateX(yz(-s)),c.rotateY(yz(a)),c.translate(o.x,o.y,o.z),c}var h=0===r?e.hexGeoJson:e.hexGeoJson.map((function(e){var t=oz(e,2),n=t[0],i=t[1];return[[n,a],[i,s]].map((function(e){var t=oz(e,2);return function(e,t,n){return e-(e-t)*n}(t[0],t[1],r)}))}));return new A_([h],mz,mz*(1+n),!1,!0,!1,i)}))):new aG.BufferGeometry};!e.hexPolygonsTransitionDuration||e.hexPolygonsTransitionDuration<0?M(y):e.tweenGroup.add(new Fu(b).to(y,e.hexPolygonsTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(M).start())}})).digest(e.hexPolygonsData)}}),cG=window.THREE?window.THREE:{Vector3:Ke};function hG(e,t){var n=Math.max(e.length,t.length),r=$c.apply(void 0,uz([e,t].map((function(e){return e.map((function(e){return[e.x,e.y,e.z]}))}
1)).map((function(e){return function(e,t){var n=e[e.length-1];return[].concat(uz(e),uz(Array(t-e.length).fill(n)))}(e,n)}))));return function(n){return 0===n?e:1===n?t:r(n).map((function(e){var t=oz(e,3),n=t[0],r=t[1],i=t[2];return new cG.Vector3(n,r,i)}))}}var AG=window.THREE?window.THREE:{BufferGeometry:Ar,Color:Gn,Group:Vr,Line:pi,NormalBlending:1,ShaderMaterial:Pr,Vector3:Ke},dG=ng.default||ng,pG=Pu({props:{pathsData:{default:[]},pathPoints:{default:function(e){return e}},pathPointLat:{default:function(e){return e[0]}},pathPointLng:{default:function(e){return e[1]}},pathPointAlt:{default:.001},pathResolution:{default:2},pathColor:{default:function(){return"#ffffaa"}},pathStroke:{},pathDashLength:{default:1},pathDashGap:{default:0},pathDashInitialGap:{default:0},pathDashAnimateTime:{default:0},pathTransitionDuration:{default:1e3,triggerUpdate:!1},rendererSize:{}},methods:{pauseAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.pause()},resumeAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.resume()},_destructor:function(e){var t;null===(t=e.ticker)||void 0===t||t.dispose()}},stateInit:function(e){return{tweenGroup:e.tweenGroup,ticker:new dG,sharedMaterial:new AG.ShaderMaterial(rz(rz({},Fz()),{},{transparent:!0,blending:AG.NormalBlending}))}},init:function(e,t){pz(e),t.scene=e,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjPath"}).onCreateObj((function(){var e=new AG.Group;return e.__globeObjType="path",e})),t.ticker.onTick.add((function(e,n){t.dataMapper.entries().map((function(e){return oz(e,2)[1]})).filter((function(e){return e.children.length&&e.children[0].material&&e.children[0].__dashAnimateStep})).forEach((function(e){var t=e.children[0],r=t.__dashAnimateStep*n;if("Line"===t.type){var i=t.material.uniforms.dashTranslate.value%1e9;t.material.uniforms.dashTranslate.value=i+r}else if("Line2"===t.type){for(var s=t.material.dashOffset-r,a=t.material.dashSize
1+t.material.gapSize;s<=-a;)s+=a;t.material.dashOffset=s}}))}))},update:function(e){var t=rm(e.pathPoints),n=rm(e.pathPointLat),r=rm(e.pathPointLng),i=rm(e.pathPointAlt),s=rm(e.pathStroke),a=rm(e.pathColor),o=rm(e.pathDashLength),l=rm(e.pathDashGap),u=rm(e.pathDashInitialGap),c=rm(e.pathDashAnimateTime);function h(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=t+1;if(e instanceof Array||e instanceof Function){var a=e instanceof Array?Ch().domain(e.map((function(t,n){return n/(e.length-1)}))).range(e):e;n=function(e){return Ez(a(e),i,!0)}}else{var o=Ez(e,i,!0);n=function(){return o}}for(var l=[],u=0,c=s;u<c;u++)for(var h=n(u/(c-1)),A=0;A<r;A++)l.push(h);return Rz(l,i?4:3)}e.dataMapper.onUpdateObj((function(A,d){var p=s(d),f=null!=p;if(!A.children.length||f===("Line"===A.children[0].type)){pz(A);var m=f?new FV(new UV,new vV):new AG.Line(new AG.BufferGeometry,e.sharedMaterial.clone());A.add(m)}var g,_,v=A.children[0],y=function(e,t,n,r,i){var s=function(e,t,n){for(var r=[],i=1;i<=n;i++)r.push(e+(t-e)*i/(n+1));return r};return function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=[],n=null;return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(r){if(n){for(;Math.abs(n[1]-r[1])>180;)n[1]+=360*(n[1]<r[1]?1:-1);var i=Math.sqrt(Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2));if(i>e)for(var a=Math.floor(i/e),o=s(n[0],r[0],a),l=s(n[1],r[1],a),u=s(n[2],r[2],a),c=0,h=o.length;c<h;c++)t.push([o[c],l[c],u[c]])}t.push(n=r)})),t}(e.map((function(e){return[t(e),n(e),r(e)]})),i).map((function(e){var t=oz(e,3),n=_z(t[0],t[1],t[2]),r=n.x,i=n.y,s=n.z;return new AG.Vector3(r,i,s)}))}(t(d),n,r,i,e.pathResolution),x=c(d);if(v.__dashAnimateStep=x>0?1e3/x:0,f){v.material.resolution=e.rendererSize;var b=o(d),w=l(d),T=u(d);v.material.dashed=w>0,v.material.dashed?v.material.defines.USE_DASH="":delete v.material.defines.USE_DASH,v.material.dashed&&(v.material.dashScale=1/(_=0,y.forEach((function(e){g&&(_+=g.distanceTo(e)),g=e})),_),v.material.dashSize=b,v.material.gapSize=w,v.material.dashOffset=-T);var S=a(d);if(S instanceof Array){var M=h(a(d),y.length-1,1,!1);v.geometry.setColors(M.array),v.material.vertexColors=!0}else{var E=S,C=Mz(E);v.material.color=new AG.Color(Sz(E)),v.material.transparent=C<1,v.material.opacity=C,v.material.vertexColors=!1}v.material.needsUpdate=!0}else{Object.assign(v.material.uniforms,{dashSize:{value:o(d)},gapSize:{value:l(d)},dashOffset:{value:u(d)}});var R=h(a(d),y.length),N=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=[],i=0,s=e+1;i<s;i++)for(var a=i/(s-1),o=0;o<t;o++)r.push(a);return n&&r.reverse(),Rz(r,1)}(y.length,1,!0);v.geometry.setAttribute("color",R),v.geometry.setAttribute("relDistance",N)}var P=hG(A.__currentTargetD&&A.__currentTargetD.points||[y[0]],y),D=function(e){var t,n=A.__currentTargetD=e,r=n.stroke,i=n.interpolK,s=A.__currentTargetD.points=P(i);f?(v.geometry.setPositions((t=[]).concat.apply(t,uz(s.map((function(e){return[e.x,e.y,e.z]}))))),v.material.linewidth=r,v.material.dashed&&v.computeLineDistances()):(v.geometry.setFromPoints(s),v.geometry.computeBoundingSphere())},L={stroke:p,interpolK:1},I=Object.assign({},A.__currentTargetD||L,{interpolK:0});Object.keys(L).some((function(e){return I[e]!==L[e]}))&&(!e.pathTransitionDuration||e.pathTransitionDuration<0?D(L):e.tweenGroup.add(new Fu(I).to(L,e.pathTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(D).start()))})).digest(e.pathsData)}}),fG=window.THREE?window.THREE:{Euler:on,Mesh:Tr,MeshLambertMaterial:Ds,SphereGeometry:Ms},mG=Pu({props:{tilesData:{default:[]},tileLat:{default:"lat"},tileLng:{default:"lng"},tileAltitude:{default:.01},tileWidth:{default:1},tileHeight:{default:1},tileUseGlobeProjection:{default:!0},tileMaterial:{default:function(){return new fG.MeshLambertMaterial({color:"#ffbb88",opacity:.4,transparent:!0})}},tileCurvatureResolution:{default:5},tilesTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjTile"}
1).onCreateObj((function(){var e=new fG.Mesh;return e.__globeObjType="tile",e}))},update:function(e){var t=rm(e.tileLat),n=rm(e.tileLng),r=rm(e.tileAltitude),i=rm(e.tileWidth),s=rm(e.tileHeight),a=rm(e.tileUseGlobeProjection),o=rm(e.tileMaterial),l=rm(e.tileCurvatureResolution);e.dataMapper.onUpdateObj((function(u,c){u.material=o(c);var h=a(c),A=l(c),d=function(e){var t=u.__currentTargetD=e,n=t.lat,r=t.lng,i=t.alt,s=t.width,a=t.height,o=gG(r),l=gG(-n);u.geometry&&u.geometry.dispose(),u.geometry=new fG.SphereGeometry(mz*(1+i),Math.ceil(s/(A||-1)),Math.ceil(a/(A||-1)),gG(90-s/2)+(h?o:0),gG(s),gG(90-a/2)+(h?l:0),gG(a)),h||u.setRotationFromEuler(new fG.Euler(l,o,0,"YXZ"))},p={lat:+t(c),lng:+n(c),alt:+r(c),width:+i(c),height:+s(c)},f=u.__currentTargetD||Object.assign({},p,{width:0,height:0});Object.keys(p).some((function(e){return f[e]!==p[e]}))&&(!e.tilesTransitionDuration||e.tilesTransitionDuration<0?d(p):e.tweenGroup.add(new Fu(f).to(p,e.tilesTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(d).start()))})).digest(e.tilesData)}}),gG=function(e){return e*Math.PI/180},_G=window.THREE?window.THREE:{BufferGeometry:Ar,Color:Gn,Points:class extends Tn{constructor(e=new Ar,t=new vi){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,r=this.matrixWorld,i=e.params.Points.threshold,s=n.drawRange;if(null===n.boundingSphere&&n.computeBoundingSphere(),bi.copy(n.boundingSphere),bi.applyMatrix4(r),bi.radius+=i,!1===e.ray.intersectsSphere(bi))return;yi.copy(r).invert(),xi.copy(e.ray).applyMatrix4(yi);const a=i/((this.scale.x+this.scale.y+this.scale.z)/3),o=a*a,l=n.index,u=n.attributes.position;if(null!==l)for(let n=Math.max(0,s.start),i=Math.min(l.count,s.start+s.count);n<i;n++){const i=l.getX(n);wi.fromBufferAttribute(u,i),Ti(wi,i,o,r,e,t,this)}else for(let n=Math.max(0,s.start),i=Math.min(u.count,s.start+s.count);n<i;n++)wi.fromBufferAttribute(u,n),Ti(wi,n,o,r,e,t,this)}updateMorphTargets(){const e=this.geometry.morphAttributes,t=Object.keys(e);if(t.length>0){const n=e[t[0]];if(void 0!==n){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,t=n.length;e<t;e++){const t=n[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[t]=e}}}}},PointsMaterial:vi},vG=Pu({props:{particlesData:{default:[]},particlesList:{default:function(e){return e}},particleLat:{default:"lat"},particleLng:{default:"lng"},particleAltitude:{default:.01},particlesSize:{default:.5},particlesSizeAttenuation:{default:!0},particlesColor:{default:function(){return"white"}},particlesTexture:{}},init:function(e,t){pz(e),t.scene=e,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjParticles"}).onCreateObj((function(){var e=new _G.Points(new _G.BufferGeometry,new _G.PointsMaterial);return e.__globeObjType="particles",e})).onUpdateObj((function(e,n){var r=rm(t.particlesList),i=rm(t.particleLat),s=rm(t.particleLng),a=rm(t.particleAltitude);e.geometry.setAttribute("position",Rz(r(n).map((function(e){return Object.values(_z(i(e),s(e),a(e)))})),3))}))},update:function(e,t){["particlesData","particlesList","particleLat","particleLng","particleAltitude"].some((function(e){return t.hasOwnProperty(e)}))&&e.dataMapper.digest(e.particlesData);var n=rm(e.particlesColor),r=rm(e.particlesSize),i=rm(e.particlesSizeAttenuation),s=rm(e.particlesTexture);e.dataMapper.entries().forEach((function(t){var a=oz(t,2),o=a[0],l=a[1];if(l.material.size=r(o),l.material.sizeAttenuation=i(o),e.particlesTexture)l.material.color=new _G.Color(16777215),l.material.transparent=!1,l.material.alphaTest=.5,l.material.map=s(o);else{var u=n(o),c=Mz(u);l.material.color=new _G.Color(Sz(u)),l.material.transparent=c<1,l.material.opacity=c,l.material.alphaTest=0}}))}}),yG=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;HV(this,t),(e=jV(this,t)).type="CircleLineGeometry",e.parameters={radiu
1s:n,segmentCount:r};for(var i=[],s=0;s<=r;s++){var a=(s/r-.25)*Math.PI*2;i.push({x:Math.cos(a)*n,y:Math.sin(a)*n,z:0})}return e.setFromPoints(i),e}return ez(t,e),$V(t)}((window.THREE?window.THREE:{BufferGeometry:Ar}).BufferGeometry),xG=window.THREE?window.THREE:{Color:Gn,Group:Vr,Line:pi,LineBasicMaterial:ai,Vector3:Ke},bG=ng.default||ng,wG=Pu({props:{ringsData:{default:[]},ringLat:{default:"lat"},ringLng:{default:"lng"},ringAltitude:{default:.0015},ringColor:{default:function(){return"#ffffaa"},triggerUpdate:!1},ringResolution:{default:64,triggerUpdate:!1},ringMaxRadius:{default:2,triggerUpdate:!1},ringPropagationSpeed:{default:1,triggerUpdate:!1},ringRepeatPeriod:{default:700,triggerUpdate:!1}},methods:{pauseAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.pause()},resumeAnimation:function(e){var t;null===(t=e.ticker)||void 0===t||t.resume()},_destructor:function(e){var t;null===(t=e.ticker)||void 0===t||t.dispose()}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjRing",removeDelay:3e4}).onCreateObj((function(){var e=new xG.Group;return e.__globeObjType="ring",e})),t.ticker=new bG,t.ticker.onTick.add((function(e){if(t.ringsData.length){var n=rm(t.ringColor),r=rm(t.ringAltitude),i=rm(t.ringMaxRadius),s=rm(t.ringPropagationSpeed),a=rm(t.ringRepeatPeriod);t.dataMapper.entries().filter((function(e){return oz(e,2)[1]})).forEach((function(o){var l,u,c=oz(o,2),h=c[0],A=c[1];if((A.__nextRingTime||0)<=e){var d=a(h)/1e3;A.__nextRingTime=e+(d<=0?1/0:d);var p,f=new xG.Line(new yG(1,t.ringResolution),new xG.LineBasicMaterial),m=n(h),g=m instanceof Array||m instanceof Function;g?m instanceof Array?(p=Ch().domain(m.map((function(e,t){return t/(m.length-1)}))).range(m),f.material.transparent=m.some((function(e){return Mz(e)<1}))):(p=m,f.material.transparent=!0):(f.material.color=new xG.Color(Sz(m)),l=f.material,u=Mz(m),l.opacity=u,l.transparent=u<1,l.depthWrite=u>=1);var _=mz*(1+r(h)),v=i(h),y=v*Math.PI/180,x=s(h),b=x<=0,w=function(e){var t=e.t,n=(b?1-t:t)*y;if(f.scale.x=f.scale.y=_*Math.sin(n),f.position.z=_*(1-Math.cos(n)),g){var r=p(t);f.material.color=new xG.Color(Sz(r)),f.material.transparent&&(f.material.opacity=Mz(r))}};if(0===x)w({t:0}),A.add(f);else{var T=1e3*Math.abs(v/x);t.tweenGroup.add(new Fu({t:0}).to({t:1},T).onUpdate(w).onStart((function(){return A.add(f)})).onComplete((function(){A.remove(f),dz(f)})).start())}}}))}}))},update:function(e){var t=rm(e.ringLat),n=rm(e.ringLng),r=rm(e.ringAltitude),i=e.scene.localToWorld(new xG.Vector3(0,0,0));e.dataMapper.onUpdateObj((function(e,s){var a=t(s),o=n(s),l=r(s);Object.assign(e.position,_z(a,o,l)),e.lookAt(i)})).digest(e.ringsData)}}),TG=rz(rz({},window.THREE?window.THREE:{BoxGeometry:Mr,CircleGeometry:Ei,DoubleSide:2,Group:Vr,Mesh:Tr,MeshLambertMaterial:Ds,TextGeometry:kV,Vector3:Ke}),{},{Font:class{constructor(e){this.isFont=!0,this.type="Font",this.data=e}generateShapes(e,t=100){const n=[],r=function(e,t,n){const r=Array.from(e),i=t/n.resolution,s=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*i,a=[];let o=0,l=0;for(let e=0;e<r.length;e++){const t=r[e];if("\n"===t)o=0,l-=s;else{const e=qV(t,i,o,l,n);o+=e.offsetX,a.push(e.path)}}return a}(e,t,this.data);for(let e=0,t=r.length;e<t;e++)n.push(...r[e].toShapes());return n}},TextGeometry:kV}),SG=Pu({props:{labelsData:{default:[]},labelLat:{default:"lat"},labelLng:{default:"lng"},labelAltitude:{default:.002},labelText:{default:"text"},labelSize:{default:.5},labelTypeFace:{default:
vendor: 19,979 bytes, line 1
1{glyphs:{0:{x_min:73,x_max:715,ha:792,o:"m 394 -29 q 153 129 242 -29 q 73 479 73 272 q 152 829 73 687 q 394 989 241 989 q 634 829 545 989 q 715 479 715 684 q 635 129 715 270 q 394 -29 546 -29 m 394 89 q 546 211 489 89 q 598 479 598 322 q 548 748 598 640 q 394 871 491 871 q 241 748 298 871 q 190 479 190 637 q 239 211 190 319 q 394 89 296 89 "},1:{x_min:215.671875,x_max:574,ha:792,o:"m 574 0 l 442 0 l 442 697 l 215 697 l 215 796 q 386 833 330 796 q 475 986 447 875 l 574 986 l 574 0 "},2:{x_min:59,x_max:731,ha:792,o:"m 731 0 l 59 0 q 197 314 59 188 q 457 487 199 315 q 598 691 598 580 q 543 819 598 772 q 411 867 488 867 q 272 811 328 867 q 209 630 209 747 l 81 630 q 182 901 81 805 q 408 986 271 986 q 629 909 536 986 q 731 694 731 826 q 613 449 731 541 q 378 316 495 383 q 201 122 235 234 l 731 122 l 731 0 "},3:{x_min:54,x_max:737,ha:792,o:"m 737 284 q 635 55 737 141 q 399 -25 541 -25 q 156 52 248 -25 q 54 308 54 140 l 185 308 q 245 147 185 202 q 395 96 302 96 q 539 140 484 96 q 602 280 602 190 q 510 429 602 390 q 324 454 451 454 l 324 565 q 487 584 441 565 q 565 719 565 617 q 515 835 565 791 q 395 879 466 879 q 255 824 307 879 q 203 661 203 769 l 78 661 q 166 909 78 822 q 387 992 250 992 q 603 921 513 992 q 701 723 701 844 q 669 607 701 656 q 578 524 637 558 q 696 434 655 499 q 737 284 737 369 "},4:{x_min:48,x_max:742.453125,ha:792,o:"m 742 243 l 602 243 l 602 0 l 476 0 l 476 243 l 48 243 l 48 368 l 476 958 l 602 958 l 602 354 l 742 354 l 742 243 m 476 354 l 476 792 l 162 354 l 476 354 "},5:{x_min:54.171875,x_max:738,ha:792,o:"m 738 314 q 626 60 738 153 q 382 -23 526 -23 q 155 47 248 -23 q 54 256 54 125 l 183 256 q 259 132 204 174 q 382 91 314 91 q 533 149 471 91 q 602 314 602 213 q 538 469 602 411 q 386 528 475 528 q 284 506 332 528 q 197 439 237 484 l 81 439 l 159 958 l 684 958 l 684 840 l 254 840 l 214 579 q 306 627 258 612 q 407 643 354 643 q 636 552 540 643 q 738 314 738 457 "},6:{x_min:53,x_max:739,ha:792,o:"m 739 312 q 633 62 739 162 q 400 -31 534 -31 q 162 78 257 -31 q 53 439 53 206 q 178 859 53 712 q 441 986 284 986 q 643 912 559 986 q 732 713 732 833 l 601 713 q 544 830 594 786 q 426 875 494 875 q 268 793 331 875 q 193 517 193 697 q 301 597 240 570 q 427 624 362 624 q 643 540 552 624 q 739 312 739 451 m 603 298 q 540 461 603 400 q 404 516 484 516 q 268 461 323 516 q 207 300 207 401 q 269 137 207 198 q 405 83 325 83 q 541 137 486 83 q 603 298 603 197 "},7:{x_min:58.71875,x_max:730.953125,ha:792,o:"m 730 839 q 469 448 560 641 q 335 0 378 255 l 192 0 q 328 441 235 252 q 593 830 421 630 l 58 830 l 58 958 l 730 958 l 730 839 "},8:{x_min:55,x_max:736,ha:792,o:"m 571 527 q 694 424 652 491 q 736 280 736 358 q 648 71 736 158 q 395 -26 551 -26 q 142 69 238 -26 q 55 279 55 157 q 96 425 55 359 q 220 527 138 491 q 120 615 153 562 q 88 726 88 668 q 171 904 88 827 q 395 986 261 986 q 618 905 529 986 q 702 727 702 830 q 670 616 702 667 q 571 527 638 565 m 394 565 q 519 610 475 565 q 563 717 563 655 q 521 823 563 781 q 392 872 474 872 q 265 824 312 872 q 224 720 224 783 q 265 613 224 656 q 394 565 312 565 m 395 91 q 545 150 488 91 q 597 280 597 204 q 546 408 597 355 q 395 465 492 465 q 244 408 299 465 q 194 280 194 356 q 244 150 194 203 q 395 91 299 91 "},9:{x_min:53,x_max:739,ha:792,o:"m 739 524 q 619 94 739 241 q 362 -32 516 -32 q 150 47 242 -32 q 59 244 59 126 l 191 244 q 246 129 191 176 q 373 82 301 82 q 526 161 466 82 q 597 440 597 255 q 363 334 501 334 q 130 432 216 334 q 53 650 53 521 q 134 880 53 786 q 383 986 226 986 q 659 841 566 986 q 739 524 739 719 m 388 449 q 535 514 480 449 q 585 658 585 573 q 535 805 585 744 q 388 873 480 873 q 242 809 294 873 q 191 658 191 745 q 239 514 191 572 q 388 449 292 449 "},"ο":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 96 88 192 -25 q 0 368 0 201 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 "},S:{x_min:0,x_max:788,ha:890,o:"m 788 291 q 662 54 788 144 q 397 -26 550 -26 q 116 68 226 -26 q 0 337 0 168 l 131 337 q 200 152 131 220 q 384 85 269 85 q 557 129 479 85 q 650 270 650 183 q 490 429 650 379 q 194 513 341 470 q 33 739 33 584 q 142 964 33 881 q 388 1041 242 1041 q 644 957 543 1041 q 756 716 756 867 l 625 716 q 561 874 625 816 q 395 933 497 933 q 243 891 309 933 q 164 759 164 841 q 325 609 164 656 q 625 526 475 568 q 788 291 788 454 "},"¦":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"/":{x_min:183.25,x_max:608.328125,ha:792,o:"m 608 1041 l 266 -129 l 183 -129 l 520 1041 l 608 1041 "},"Τ":{x_min:-.4375,x_max:777.453125,ha:839,o:"m 777 893 l 458 893 l 458 0 l 319 0 l 319 892 l 0 892 l 0 1013 l 777 1013 l 777 893 "},y:{x_min:0,x_max:684.78125,ha:771,o:"m 684 738 l 388 -83 q 311 -216 356 -167 q 173 -279 252 -279 q 97 -266 133 -279 l 97 -149 q 132 -155 109 -151 q 168 -160 155 -160 q 240 -114 213 -160 q 274 -26 248 -98 l 0 738 l 137 737 l 341 139 l 548 737 l 684 738 "},"Î ":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 803 1012 l 803 0 "},"Î":{x_min:-111,x_max:339,ha:361,o:"m 339 800 l 229 800 l 229 925 l 339 925 l 339 800 m -1 800 l -111 800 l -111 925 l -1 925 l -1 800 m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 m 302 1040 l 113 819 l 30 819 l 165 1040 l 302 1040 "},g:{x_min:0,x_max:686,ha:838,o:"m 686 34 q 586 -213 686 -121 q 331 -306 487 -306 q 131 -252 216 -306 q 31 -84 31 -190 l 155 -84 q 228 -174 166 -138 q 345 -207 284 -207 q 514 -109 454 -207 q 564 89 564 -27 q 461 6 521 36 q 335 -23 401 -23 q 88 100 184 -23 q 0 370 0 215 q 87 634 0 522 q 330 758 183 758 q 457 728 398 758 q 564 644 515 699 l 564 737 l 686 737 l 686 34 m 582 367 q 529 560 582 481 q 358 652 468 652 q 189 561 250 652 q 135 369 135 482 q 189 176 135 255 q 361 85 251 85 q 529 176 468 85 q 582 367 582 255 "},"²":{x_min:0,x_max:442,ha:539,o:"m 442 383 l 0 383 q 91 566 0 492 q 260 668 176 617 q 354 798 354 727 q 315 875 354 845 q 227 905 277 905 q 136 869 173 905 q 99 761 99 833 l 14 761 q 82 922 14 864 q 232 974 141 974 q 379 926 316 974 q 442 797 442 878 q 351 635 442 704 q 183 539 321 611 q 92 455 92 491 l 442 455 l 442 383 "},"â":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},"Î":{x_min:0,x_max:819.5625,ha:893,o:"m 819 0 l 650 0 l 294 509 l 139 356 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},"Æ":{x_min:-46.265625,x_max:392,ha:513,o:"m 392 651 l 259 651 l 79 -279 l -46 -278 l 134 651 l 14 651 l 14 751 l 135 751 q 151 948 135 900 q 304 1041 185 1041 q 334 1040 319 1041 q 392 1034 348 1039 l 392 922 q 337 931 360 931 q 271 883 287 931 q 260 793 260 853 l 260 751 l 392 751 l 392 651 "},e:{x_min:0,x_max:714,ha:813,o:"m 714 326 l 140 326 q 200 157 140 227 q 359 87 260 87 q 488 130 431 87 q 561 245 545 174 l 697 245 q 577 48 670 123 q 358 -26 484 -26 q 97 85 195 -26 q 0 363 0 197 q 94 642 0 529 q 358 765 195 765 q 626 627 529 765 q 714 326 714 503 m 576 429 q 507 583 564 522 q 355 650 445 650 q 206 583 266 650 q 140 429 152 522 l 576 429 "},"Ï":{x_min:0,x_max:712,ha:815,o:"m 356 -25 q 94 91 194 -25 q 0 368 0 202 q 92 642 0 533 q 356 761 192 761 q 617 644 517 761 q 712 368 712 533 q 619 91 712 201 q 356 -25 520 -25 m 356 85 q 527 175 465 85 q 583 369 583 255 q 528 562 583 484 q 356 651 466 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 356 85 250 85 m 576 1040 l 387 819 l 303 819 l 438 1040 l 576 1040 "},J:{x_min:0,x_max:588,ha:699,o:"m 588 279 q 287 -26 588 -26 q 58 73 126 -26 q 0 327 0 158 l 133 327 q 160 172 133 227 q 288 96 198 96 q 426 171 391 96 q 449 336 449 219 l 449 1013 l 588 1013 l 588 279 "},"»":{x_min:-1,x_max:503,ha:601,o:"m 503 302 l 280 136 l 281 256 l 429 373 l 281 486 l 280 608 l 503 440 l 503 302 m 221 302 l 0 136 l 0 255 l 145 372 l 0 486 l -1 608 l 221 440 l 221 302 "},"©":{x_min:-3,x_max:1008,ha:1106,o:"m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 741 394 q 661 246 731 302 q 496 190 591 190 q 294 285 369 190 q 228 497 228 370 q 295 714 228 625 q 499 813 370 813 q 656 762 588 813 q 733 625 724 711 l 634 625 q 589 704 629 673 q 498 735 550 735 q 377 666 421 735 q 334 504 334 597 q 374 340 334 408 q 490 272 415 272 q 589 304 549 272 q 638 394 628 337 l 741 394 "},"Ï":{x_min:0,x_max:922,ha:1030,o:"m 687 1040 l 498 819 l 415 819 l 549 1040 l 687 1040 m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 338 0 202 q 45 551 0 444 q 161 737 84 643 l 302 737 q 175 552 219 647 q 124 336 124 446 q 155 179 124 248 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 341 797 257 q 745 555 797 450 q 619 737 705 637 l 760 737 q 874 551 835 640 q 922 339 922 444 "},"^":{x_min:193.0625,x_max:598.609375,ha:792,o:"m 598 772 l 515 772 l 395 931 l 277 772 l 193 772 l 326 1013 l 462 1013 l 598 772 "},"«":{x_min:0,x_max:507.203125,ha:604,o:"m 506 136 l 284 302 l 284 440 l 506 608 l 507 485 l 360 371 l 506 255 l 506 136 m 222 136 l 0 302 l 0 440 l 222 608 l 221 486 l 73 373 l 222 256 l 222 136 "},D:{x_min:0,x_max:828,ha:935,o:"m 389 1013 q 714 867 593 1013 q 828 521 828 729 q 712 161 828 309 q 382 0 587 0 l 0 0 l 0 1013 l 389 1013 m 376 124 q 607 247 523 124 q 681 510 681 355 q 607 771 681 662 q 376 896 522 896 l 139 896 l 139 124 l 376 124 "},"â":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1009.71875,ha:1100,o:"m 1009 738 l 783 0 l 658 0 l 501 567 l 345 0 l 222 0 l 0 738 l 130 738 l 284 174 l 432 737 l 576 738 l 721 173 l 881 737 l 1009 738 "},$:{x_min:0,x_max:700,ha:793,o:"m 664 717 l 542 717 q 490 825 531 785 q 381 872 450 865 l 381 551 q 620 446 540 522 q 700 241 700 370 q 618 45 700 116 q 381 -25 536 -25 l 381 -152 l 307 -152 l 307 -25 q 81 62 162 -25 q 0 297 0 149 l 124 297 q 169 146 124 204 q 307 81 215 89 l 307 441 q 80 536 148 469 q 13 725 13 603 q 96 910 13 839 q 307 982 180 982 l 307 1077 l 381 1077 l 381 982 q 574 917 494 982 q 664 717 664 845 m 307 565 l 307 872 q 187 831 233 872 q 142 724 142 791 q 180 618 142 656 q 307 565 218 580 m 381 76 q 562 237 562 96 q 517 361 562 313 q 381 423 472 409 l 381 76 "},"\\":{x_min:-.015625,x_max:425.0625,ha:522,o:"m 425 -129 l 337 -129 l 0 1041 l 83 1041 l 425 -129 "},"µ":{x_min:0,x_max:697.21875,ha:747,o:"m 697 -4 q 629 -14 658 -14 q 498 97 513 -14 q 422 9 470 41 q 313 -23 374 -23 q 207 4 258 -23 q 119 81 156 32 l 119 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 173 124 246 q 308 83 216 83 q 452 178 402 83 q 493 359 493 255 l 493 738 l 617 738 l 617 214 q 623 136 617 160 q 673 92 637 92 q 697 96 684 92 l 697 -4 "},"Î":{x_min:42,x_max:181,ha:297,o:"m 181 0 l 42 0 l 42 1013 l 181 1013 l 181 0 "},"Î":{x_min:0,x_max:1144.5,ha:1214,o:"m 1144 1012 l 807 416 l 807 0 l 667 0 l 667 416 l 325 1012 l 465 1012 l 736 533 l 1004 1012 l 1144 1012 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"â":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"Î":{x_min:0,x_max:801,ha:915,o:"m 801 0 l 651 0 l 131 822 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 191 l 670 1013 l 801 1013 l 801 0 "},"-":{x_min:8.71875,x_max:350.390625,ha:478,o:"m 350 317 l 8 317 l 8 428 l 350 428 l 350 317 "},Q:{x_min:0,x_max:968,ha:1072,o:"m 954 5 l 887 -79 l 744 35 q 622 -11 687 2 q 483 -26 556 -26 q 127 130 262 -26 q 0 504 0 279 q 127 880 0 728 q 484 1041 262 1041 q 841 884 708 1041 q 968 507 968 735 q 933 293 968 398 q 832 104 899 188 l 954 5 m 723 191 q 802 330 777 248 q 828 499 828 412 q 744 790 828 673 q 483 922 650 922 q 228 791 322 922 q 142 505 142 673 q 227 221 142 337 q 487 91 323 91 q 632 123 566 91 l 520 215 l 587 301 l 723 191 "},"Ï":{x_min:1,x_max:676.28125,ha:740,o:"m 676 460 l 551 460 q 498 595 542 546 q 365 651 448 651 q 199 578 263 651 q 136 401 136 505 q 266 178 136 241 q 508 106 387 142 q 640 -50 640 62 q 625 -158 640 -105 q 583 -278 611 -211 l 465 -278 q 498 -182 490 -211 q 515 -80 515 -126 q 381 12 515 -15 q 134 91 197 51 q 1 388 1 179 q 100 651 1 542 q 354 761 199 761 q 587 680 498 761 q 676 460 676 599 "},M:{x_min:0,x_max:954,ha:1067,o:"m 954 0 l 819 0 l 819 869 l 537 0 l 405 0 l 128 866 l 128 0 l 0 0 l 0 1013 l 200 1013 l 472 160 l 757 1013 l 954 1013 l 954 0 "},"Ψ":{x_min:0,x_max:1006,ha:1094,o:"m 1006 678 q 914 319 1006 429 q 571 200 814 200 l 571 0 l 433 0 l 433 200 q 92 319 194 200 q 0 678 0 429 l 0 1013 l 139 1013 l 139 679 q 191 417 139 492 q 433 326 255 326 l 433 1013 l 571 1013 l 571 326 l 580 326 q 813 423 747 326 q 868 679 868 502 l 868 1013 l 1006 1013 l 1006 678 "},C:{x_min:0,x_max:886,ha:944,o:"m 886 379 q 760 87 886 201 q 455 -26 634 -26 q 112 136 236 -26 q 0 509 0 283 q 118 882 0 737 q 469 1041 245 1041 q 748 955 630 1041 q 879 708 879 859 l 745 708 q 649 862 724 805 q 473 920 573 920 q 219 791 312 920 q 136 509 136 675 q 217 229 136 344 q 470 99 311 99 q 672 179 591 99 q 753 379 753 259 l 886 379 "},"!":{x_min:0,x_max:138,ha:236,o:"m 138 684 q 116 409 138 629 q 105 244 105 299 l 33 244 q 16 465 33 313 q 0 684 0 616 l 0 1013 l 138 1013 l 138 684 m 138 0 l 0 0 l 0 151 l 138 151 l 138 0 "},"{":{x_min:0,x_max:480.5625,ha:578,o:"m 480 -286 q 237 -213 303 -286 q 187 -45 187 -159 q 194 48 187 -15 q 201 141 201 112 q 164 264 201 225 q 0 314 118 314 l 0 417 q 164 471 119 417 q 201 605 201 514 q 199 665 201 644 q 193 772 193 769 q 241 941 193 887 q 480 1015 308 1015 l 480 915 q 336 866 375 915 q 306 742 306 828 q 310 662 306 717 q 314 577 314 606 q 288 452 314 500 q 176 365 256 391 q 289 275 257 337 q 314 143 314 226 q 313 84 314 107 q 310 -11 310 -5 q 339 -131 310 -94 q 480 -182 377 -182 l 480 -286 "},X:{x_min:-.015625,x_max:854.15625,ha:940,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 428 637 l 675 1013 l 836 1013 l 504 520 l 854 0 "},"#":{x_min:0,x_max:963.890625,ha:1061,o:"m 963 690 l 927 590 l 719 590 l 655 410 l 876 410 l 840 310 l 618 310 l 508 -3 l 393 -2 l 506 309 l 329 310 l 215 -2 l 102 -3 l 212 310 l 0 310 l 36 410 l 248 409 l 312 590 l 86 590 l 120 690 l 347 690 l 459 1006 l 573 1006 l 462 690 l 640 690 l 751 1006 l 865 1006 l 754 690 l 963 690 m 606 590 l 425 590 l 362 410 l 543 410 l 606 590 "},"ι":{x_min:42,x_max:284,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 738 l 167 738 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 103 239 101 q 284 112 257 104 l 284 3 "},"Î":{x_min:0,x_max:906.953125,ha:982,o:"m 283 1040 l 88 799 l 5 799 l 145 1040 l 283 1040 m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1012 l 529 1012 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},")":{x_min:0,x_max:318,ha:415,o:"m 318 365 q 257 25 318 191 q 87 -290 197 -141 l 0 -290 q 140 21 93 -128 q 193 360 193 189 q 141 704 193 537 q 0 1024 97 850 l 87 1024 q 257 706 197 871 q 318 365 318 542 "},"ε":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 314 0 265 q 128 390 67 353 q 56 460 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 "},"Î":{x_min:0,x_max:952.78125,ha:1028,o:"m 952 0 l 0 0 l 400 1013 l 551 1013 l 952 0 m 762 124 l 476 867 l 187 124 l 762 124 "},"}":{x_min:0,x_max:481,ha:578,o:"m 481 314 q 318 262 364 314 q 282 136 282 222 q 284 65 282 97 q 293 -58 293 -48 q 241 -217 293 -166 q 0 -286 174 -286 l 0 -182 q 143 -130 105 -182 q 171 -2 171 -93 q 168 81 171 22 q 165 144 165 140 q 188 275 165 229 q 306 365 220 339 q 191 455 224 391 q 165 588 165 505 q 168 681 165 624 q 171 742 171 737 q 141 865 171 827 q 0 915 102 915 l 0 1015 q 243 942 176 1015 q 293 773 293 888 q 287 675 293 741 q 282 590 282 608 q 318 466 282 505 q 481 417 364 417 l 481 314 "},"â°":{x_min:-3,x_max:1672,ha:1821,o:"m 846 0 q 664 76 732 0 q 603 244 603 145 q 662 412 603 344 q 846 489 729 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 846 0 962 0 m 845 103 q 945 143 910 103 q 981 243 981 184 q 947 340 981 301 q 845 385 910 385 q 745 342 782 385 q 709 243 709 300 q 742 147 709 186 q 845 103 781 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 810 382 771 q 241 855 308 855 m 1428 0 q 1246 76 1314 0 q 1185 244 1185 145 q 1244 412 1185 344 q 1428 489 1311 489 q 1610 412 1542 489 q 1672 244 1672 343 q 1612 76 1672 144 q 1428 0 1545 0 m 1427 103 q 1528 143 1492 103 q 1564 243 1564 184 q 1530 340 1564 301 q 1427 385 1492 385 q 1327 342 1364 385 q 1291 243 1291 300 q 1324 147 1291 186 q 1427 103 1363 103 "},a:{x_min:0,x_max:698.609375,ha:794,o:"m 698 0 q 661 -12 679 -7 q 615 -17 643 -17 q 536 12 564 -17 q 500 96 508 41 q 384 6 456 37 q 236 -25 312 -25 q 65 31 130 -25 q 0 194 0 88 q 118 390 0 334 q 328 435 180 420 q 488 483 476 451 q 495 523 495 504 q 442 619 495 584 q 325 654 389 654 q 209 617 257 654 q 152 513 161 580 l 33 513 q 123 705 33 633 q 332 772 207 772 q 528 712 448 772 q 617 531 617 645 l 617 163 q 624 108 617 126 q 664 90 632 90 l 698 94 l 698 0 m 491 262 l 491 372 q 272 329 350 347 q 128 201 128 294 q 166 113 128 144 q 264 83 205 83 q 414 130 346 83 q 491 262 491 183 "},"â":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 334 l 0 334 l 0 410 l 941 410 l 941 334 "},"=":{x_min:8.71875,x_max:780.953125,ha:792,o:"m 780 510 l 8 510 l 8 606 l 780 606 l 780 510 m 780 235 l 8 235 l 8 332 l 780 332 l 780 235 "},N:{x_min:0,x_max:801,ha:914,o:"m 801 0 l 651 0 l 131 823 l 131 0 l 0 0 l 0 1013 l 151 1013 l 670 193 l 670 1013 l 801 1013 l 801 0 "},"Ï":{x_min:0,x_max:712,ha:797,o:"m 712 369 q 620 94 712 207 q 362 -26 521 -26 q 230 2 292 -26 q 119 83 167 30 l 119 -278 l 0 -278 l 0 362 q 91 643 0 531 q 355 764 190 764 q 617 647 517 764 q 712 369 712 536 m 583 366 q 530 559 583 480 q 359 651 469 651 q 190 562 252 651 q 135 370 135 483 q 189 176 135 257 q 359 85 250 85 q 528 175 466 85 q 583 366 583 254 "},"¯":{x_min:0,x_max:941.671875,ha:938,o:"m 941 1033 l 0 1033 l 0 1109 l 941 1109 l 941 1033 "},Z:{x_min:0,x_max:779,ha:849,o:"m 779 0 l 0 0 l 0 113 l 621 896 l 40 896 l 40 1013 l 779 1013 l 778 887 l 171 124 l 779 124 l 779 0 "},u:{x_min:0,x_max:617,ha:729,o:"m 617 0 l 499 0 l 499 110 q 391 10 460 45 q 246 -25 322 -25 q 61 58 127 -25 q 0 258 0 136 l 0 738 l 125 738 l 125 284 q 156 148 125 202 q 273 82 197 82 q 433 165 369 82 q 493 340 493 243 l 493 738 l 617 738 l 617 0 "},k:{x_min:0,x_max:612.484375,ha:697,o:"m 612 738 l 338 465 l 608 0 l 469 0 l 251 382 l 121 251 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 402 l 456 738 l 612 738 "},"Î":{x_min:0,x_max:803,ha:917,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803
vendor: 3,101 bytes, line 1
11013 l 803 0 "},"Î":{x_min:0,x_max:906.953125,ha:985,o:"m 906 0 l 756 0 l 650 303 l 251 303 l 143 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 609 421 l 452 866 l 293 421 l 609 421 "},s:{x_min:0,x_max:604,ha:697,o:"m 604 217 q 501 36 604 104 q 292 -23 411 -23 q 86 43 166 -23 q 0 238 0 114 l 121 237 q 175 122 121 164 q 300 85 223 85 q 415 112 363 85 q 479 207 479 147 q 361 309 479 276 q 140 372 141 370 q 21 544 21 426 q 111 708 21 647 q 298 761 190 761 q 492 705 413 761 q 583 531 583 643 l 462 531 q 412 625 462 594 q 298 657 363 657 q 199 636 242 657 q 143 558 143 608 q 262 454 143 486 q 484 394 479 397 q 604 217 604 341 "},B:{x_min:0,x_max:778,ha:876,o:"m 580 546 q 724 469 670 535 q 778 311 778 403 q 673 83 778 171 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 892 q 691 633 732 693 q 580 546 650 572 m 393 899 l 139 899 l 139 588 l 379 588 q 521 624 462 588 q 592 744 592 667 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 303 635 219 q 559 436 635 389 q 402 477 494 477 l 139 477 l 139 124 l 419 124 "},"â¦":{x_min:0,x_max:614,ha:708,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 m 378 0 l 236 0 l 236 151 l 378 151 l 378 0 m 614 0 l 472 0 l 472 151 l 614 151 l 614 0 "},"?":{x_min:0,x_max:607,ha:704,o:"m 607 777 q 543 599 607 674 q 422 474 482 537 q 357 272 357 391 l 236 272 q 297 487 236 395 q 411 619 298 490 q 474 762 474 691 q 422 885 474 838 q 301 933 371 933 q 179 880 228 933 q 124 706 124 819 l 0 706 q 94 963 0 872 q 302 1044 177 1044 q 511 973 423 1044 q 607 777 607 895 m 370 0 l 230 0 l 230 151 l 370 151 l 370 0 "},H:{x_min:0,x_max:803,ha:915,o:"m 803 0 l 667 0 l 667 475 l 140 475 l 140 0 l 0 0 l 0 1013 l 140 1013 l 140 599 l 667 599 l 667 1013 l 803 1013 l 803 0 "},"ν":{x_min:0,x_max:675,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 738 l 340 147 l 541 738 l 675 738 "},c:{x_min:1,x_max:701.390625,ha:775,o:"m 701 264 q 584 53 681 133 q 353 -26 487 -26 q 91 91 188 -26 q 1 370 1 201 q 92 645 1 537 q 353 761 190 761 q 572 688 479 761 q 690 493 666 615 l 556 493 q 487 606 545 562 q 356 650 428 650 q 186 563 246 650 q 134 372 134 487 q 188 179 134 258 q 359 88 250 88 q 492 136 437 88 q 566 264 548 185 l 701 264 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:660,ha:745,o:"m 471 550 q 610 450 561 522 q 660 280 660 378 q 578 64 660 151 q 367 -22 497 -22 q 239 5 299 -22 q 126 82 178 32 l 126 -278 l 0 -278 l 0 593 q 54 903 0 801 q 318 1042 127 1042 q 519 964 436 1042 q 603 771 603 887 q 567 644
vendor: 15,718 bytes, line 1
1603 701 q 471 550 532 586 m 337 79 q 476 138 418 79 q 535 279 535 198 q 427 437 535 386 q 226 477 344 477 l 226 583 q 398 620 329 583 q 486 762 486 668 q 435 884 486 833 q 312 935 384 935 q 169 861 219 935 q 126 698 126 797 l 126 362 q 170 169 126 242 q 337 79 224 79 "},"Î":{x_min:0,x_max:954,ha:1068,o:"m 954 0 l 819 0 l 819 868 l 537 0 l 405 0 l 128 865 l 128 0 l 0 0 l 0 1013 l 199 1013 l 472 158 l 758 1013 l 954 1013 l 954 0 "},"Î":{x_min:.109375,x_max:1120,ha:1217,o:"m 1120 505 q 994 132 1120 282 q 642 -29 861 -29 q 290 130 422 -29 q 167 505 167 280 q 294 883 167 730 q 650 1046 430 1046 q 999 882 868 1046 q 1120 505 1120 730 m 977 504 q 896 784 977 669 q 644 915 804 915 q 391 785 484 915 q 307 504 307 669 q 391 224 307 339 q 644 95 486 95 q 894 224 803 95 q 977 504 977 339 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Î":{x_min:0,x_max:1158,ha:1275,o:"m 1158 0 l 1022 0 l 1022 475 l 496 475 l 496 0 l 356 0 l 356 1012 l 496 1012 l 496 599 l 1022 599 l 1022 1012 l 1158 1012 l 1158 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"â¢":{x_min:0,x_max:663.890625,ha:775,o:"m 663 529 q 566 293 663 391 q 331 196 469 196 q 97 294 194 196 q 0 529 0 393 q 96 763 0 665 q 331 861 193 861 q 566 763 469 861 q 663 529 663 665 "},"Â¥":{x_min:.1875,x_max:819.546875,ha:886,o:"m 563 561 l 697 561 l 696 487 l 520 487 l 482 416 l 482 380 l 697 380 l 695 308 l 482 308 l 482 0 l 342 0 l 342 308 l 125 308 l 125 380 l 342 380 l 342 417 l 303 487 l 125 487 l 125 561 l 258 561 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 l 563 561 "},"(":{x_min:0,x_max:318.0625,ha:415,o:"m 318 -290 l 230 -290 q 61 23 122 -142 q 0 365 0 190 q 62 712 0 540 q 230 1024 119 869 l 318 1024 q 175 705 219 853 q 125 360 125 542 q 176 22 125 187 q 318 -290 223 -127 "},U:{x_min:0,x_max:796,ha:904,o:"m 796 393 q 681 93 796 212 q 386 -25 566 -25 q 101 95 208 -25 q 0 393 0 211 l 0 1013 l 138 1013 l 138 391 q 204 191 138 270 q 394 107 276 107 q 586 191 512 107 q 656 391 656 270 l 656 1013 l 796 1013 l 796 393 "},"γ":{x_min:.5,x_max:744.953125,ha:822,o:"m 744 737 l 463 54 l 463 -278 l 338 -278 l 338 54 l 154 495 q 104 597 124 569 q 13 651 67 651 l 0 651 l 0 751 l 39 753 q 168 711 121 753 q 242 594 207 676 l 403 208 l 617 737 l 744 737 "},"α":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 728 407 760 q 563 637 524 696 l 563 739 l 685 739 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 96 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 "},F:{x_min:0,x_max:683.328125,ha:717,o:"m 683 888 l 140 888 l 140 583 l 613 583 l 613 458 l 140 458 l 140 0 l 0 0 l 0 1013 l 683 1013 l 683 888 "},"Â":{x_min:0,x_max:705.5625,ha:803,o:"m 705 334 l 0 334 l 0 410 l 705 410 l 705 334 "},":":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Χ":{x_min:0,x_max:854.171875,ha:935,o:"m 854 0 l 683 0 l 423 409 l 166 0 l 0 0 l 347 519 l 18 1013 l 186 1013 l 427 637 l 675 1013 l 836 1013 l 504 521 l 854 0 "},"*":{x_min:116,x_max:674,ha:792,o:"m 674 768 l 475 713 l 610 544 l 517 477 l 394 652 l 272 478 l 178 544 l 314 713 l 116 766 l 153 876 l 341 812 l 342 1013 l 446 1013 l 446 811 l 635 874 l 674 768 "},"â ":{x_min:0,x_max:777,ha:835,o:"m 458 804 l 777 804 l 777 683 l 458 683 l 458 0 l 319 0 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 "},"°":{x_min:0,x_max:347,ha:444,o:"m 173 802 q 43 856 91 802 q 0 977 0 905 q 45 1101 0 1049 q 173 1153 90 1153 q 303 1098 255 1153 q 347 977 347 1049 q 303 856 347 905 q 173 802 256 802 m 173 884 q 238 910 214 884 q 262 973 262 937 q 239 1038 262 1012 q 173 1064 217 1064 q 108 1037 132 1064 q 85 973 85 1010 q 108 910 85 937 q 173 884 132 884 "},V:{x_min:0,x_max:862.71875,ha:940,o:"m 862 1013 l 505 0 l 361 0 l 0 1013 l 143 1013 l 434 165 l 718 1012 l 862 1013 "},"Î":{x_min:0,x_max:734.71875,ha:763,o:"m 723 889 l 9 889 l 9 1013 l 723 1013 l 723 889 m 673 463 l 61 463 l 61 589 l 673 589 l 673 463 m 734 0 l 0 0 l 0 124 l 734 124 l 734 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:.328125,x_max:819.515625,ha:889,o:"m 588 1046 l 460 1046 l 460 1189 l 588 1189 l 588 1046 m 360 1046 l 232 1046 l 232 1189 l 360 1189 l 360 1046 m 819 1012 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1012 l 140 1012 l 411 533 l 679 1012 l 819 1012 "},"â":{x_min:0,x_max:347,ha:454,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 m 347 851 q 310 737 347 784 q 208 669 273 690 l 208 734 q 267 787 250 741 q 280 873 280 821 l 208 873 l 208 1013 l 347 1013 l 347 851 "},"@":{x_min:0,x_max:1260,ha:1357,o:"m 1098 -45 q 877 -160 1001 -117 q 633 -203 752 -203 q 155 -29 327 -203 q 0 360 0 127 q 176 802 0 616 q 687 1008 372 1008 q 1123 854 969 1008 q 1260 517 1260 718 q 1155 216 1260 341 q 868 82 1044 82 q 772 106 801 82 q 737 202 737 135 q 647 113 700 144 q 527 82 594 82 q 367 147 420 82 q 314 312 314 212 q 401 565 314 452 q 639 690 498 690 q 810 588 760 690 l 849 668 l 938 668 q 877 441 900 532 q 833 226 833 268 q 853 182 833 198 q 902 167 873 167 q 1088 272 1012 167 q 1159 512 1159 372 q 1051 793 1159 681 q 687 925 925 925 q 248 747 415 925 q 97 361 97 586 q 226 26 97 159 q 627 -122 370 -122 q 856 -87 737 -122 q 1061 8 976 -53 l 1098 -45 m 786 488 q 738 580 777 545 q 643 615 700 615 q 483 517 548 615 q 425 322 425 430 q 457 203 425 250 q 552 156 490 156 q 722 273 665 156 q 786 488 738 309 "},"Î":{x_min:0,x_max:499,ha:613,o:"m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 m 499 0 l 360 0 l 360 1012 l 499 1012 l 499 0 "},i:{x_min:14,x_max:136,ha:275,o:"m 136 873 l 14 873 l 14 1013 l 136 1013 l 136 873 m 136 0 l 14 0 l 14 737 l 136 737 l 136 0 "},"Î":{x_min:0,x_max:778,ha:877,o:"m 580 545 q 724 468 671 534 q 778 310 778 402 q 673 83 778 170 q 432 0 575 0 l 0 0 l 0 1013 l 411 1013 q 629 957 541 1013 q 732 768 732 891 q 691 632 732 692 q 580 545 650 571 m 393 899 l 139 899 l 139 587 l 379 587 q 521 623 462 587 q 592 744 592 666 q 531 859 592 819 q 393 899 471 899 m 419 124 q 566 169 504 124 q 635 302 635 219 q 559 435 635 388 q 402 476 494 476 l 139 476 l 139 124 l 419 124 "},"Ï
":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 94 617 199 q 308 -24 455 -24 q 76 94 161 -24 q 0 352 0 199 l 0 739 l 126 739 l 126 355 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 355 492 257 l 492 739 l 617 739 l 617 352 "},"]":{x_min:0,x_max:275,ha:372,o:"m 275 -281 l 0 -281 l 0 -187 l 151 -187 l 151 920 l 0 920 l 0 1013 l 275 1013 l 275 -281 "},m:{x_min:0,x_max:1019,ha:1128,o:"m 1019 0 l 897 0 l 897 454 q 860 591 897 536 q 739 660 816 660 q 613 586 659 660 q 573 436 573 522 l 573 0 l 447 0 l 447 455 q 412 591 447 535 q 294 657 372 657 q 165 586 213 657 q 122 437 122 521 l 122 0 l 0 0 l 0 738 l 117 738 l 117 640 q 202 730 150 697 q 316 763 254 763 q 437 730 381 763 q 525 642 494 697 q 621 731 559 700 q 753 763 682 763 q 943 694 867 763 q 1019 512 1019 625 l 1019 0 "},"Ï":{x_min:8.328125,x_max:780.5625,ha:815,o:"m 780 -278 q 715 -294 747 -294 q 616 -257 663 -294 q 548 -175 576 -227 l 379 133 l 143 -277 l 9 -277 l 313 254 l 163 522 q 127 586 131 580 q 36 640 91 640 q 8 637 27 640 l 8 752 l 52 757 q 162 719 113 757 q 236 627 200 690 l 383 372 l 594 737 l 726 737 l 448 250 l 625 -69 q 670 -153 647 -110 q 743 -188 695 -188 q 780 -184 759 -188 l 780 -278 "},"ί":{x_min:42,x_max:326.71875,ha:361,o:"m 284 3 q 233 -10 258 -5 q 182 -15 207 -15 q 85 26 119 -15 q 42 200 42 79 l 42 737 l 167 737 l 168 215 q 172 141 168 157 q 226 101 183 101 q 248 102 239 101 q 284 112 257 104 l 284 3 m 326 1040 l 137 819 l 54 819 l 189 1040 l 326 1040 "},"Î":{x_min:0,x_max:779.171875,ha:850,o:"m 779 0 l 0 0 l 0 113 l 620 896 l 40 896 l 40 1013 l 779 1013 l 779 887 l 170 124 l 779 124 l 779 0 "},R:{x_min:0,x_max:781.953125,ha:907,o:"m 781 0 l 623 0 q 587 242 590 52 q 407 433 585 433 l 138 433 l 138 0 l 0 0 l 0 1013 l 396 1013 q 636 946 539 1013 q 749 731 749 868 q 711 597 749 659 q 608 502 674 534 q 718 370 696 474 q 729 207 722 352 q 781 26 736 62 l 781 0 m 373 551 q 533 594 465 551 q 614 731 614 645 q 532 859 614 815 q 373 896 465 896 l 138 896 l 138 551 l 373 551 "},o:{x_min:0,x_max:713,ha:821,o:"m 357 -25 q 94 91 194 -25 q 0 368 0 202 q 93 642 0 533 q 357 761 193 761 q 618 644 518 761 q 713 368 713 533 q 619 91 713 201 q 357 -25 521 -25 m 357 85 q 528 175 465 85 q 584 369 584 255 q 529 562 584 484 q 357 651 467 651 q 189 560 250 651 q 135 369 135 481 q 187 177 135 257 q 357 85 250 85 "},K:{x_min:0,x_max:819.46875,ha:906,o:"m 819 0 l 649 0 l 294 509 l 139 355 l 139 0 l 0 0 l 0 1013 l 139 1013 l 139 526 l 626 1013 l 809 1013 l 395 600 l 819 0 "},",":{x_min:0,x_max:142,ha:239,o:"m 142 -12 q 105 -132 142 -82 q 0 -205 68 -182 l 0 -138 q 57 -82 40 -124 q 70 0 70 -51 l 0 0 l 0 151 l 142 151 l 142 -12 "},d:{x_min:0,x_max:683,ha:796,o:"m 683 0 l 564 0 l 564 93 q 456 6 516 38 q 327 -25 395 -25 q 87 100 181 -25 q 0 365 0 215 q 90 639 0 525 q 343 763 187 763 q 564 647 486 763 l 564 1013 l 683 1013 l 683 0 m 582 373 q 529 562 582 484 q 361 653 468 653 q 190 561 253 653 q 135 365 135 479 q 189 175 135 254 q 358 85 251 85 q 529 178 468 85 q 582 373 582 258 "},"¨":{x_min:-109,x_max:247,ha:232,o:"m 247 1046 l 119 1046 l 119 1189 l 247 1189 l 247 1046 m 19 1046 l -109 1046 l -109 1189 l 19 1189 l 19 1046 "},E:{x_min:0,x_max:736.109375,ha:789,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},Y:{x_min:0,x_max:820,ha:886,o:"m 820 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 534 l 679 1012 l 820 1013 "},'"':{x_min:0,x_max:299,ha:396,o:"m 299 606 l 203 606 l 203 988 l 299 988 l 299 606 m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"â¹":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"â":{x_min:0,x_max:364,ha:467,o:"m 141 -12 q 104 -132 141 -82 q 0 -205 67 -182 l 0 -138 q 56 -82 40 -124 q 69 0 69 -51 l 0 0 l 0 151 l 141 151 l 141 -12 m 364 -12 q 327 -132 364 -82 q 222 -205 290 -182 l 222 -138 q 279 -82 262 -124 q 292 0 292 -51 l 222 0 l 222 151 l 364 151 l 364 -12 "},"δ":{x_min:1,x_max:710,ha:810,o:"m 710 360 q 616 87 710 196 q 356 -28 518 -28 q 99 82 197 -28 q 1 356 1 192 q 100 606 1 509 q 355 703 199 703 q 180 829 288 754 q 70 903 124 866 l 70 1012 l 643 1012 l 643 901 l 258 901 q 462 763 422 794 q 636 592 577 677 q 710 360 710 485 m 584 365 q 552 501 584 447 q 451 602 521 555 q 372 611 411 611 q 197 541 258 611 q 136 355 136 472 q 190 171 136 245 q 358 85 252 85 q 528 173 465 85 q 584 365 584 252 "},"Î":{x_min:0,x_max:634.71875,ha:714,o:"m 634 234 q 527 38 634 110 q 300 -25 433 -25 q 98 29 183 -25 q 0 204 0 93 q 37 313 0 265 q 128 390 67 352 q 56 459 82 419 q 26 555 26 505 q 114 712 26 654 q 295 763 191 763 q 499 700 416 763 q 589 515 589 631 l 478 515 q 419 618 464 580 q 307 657 374 657 q 207 630 253 657 q 151 547 151 598 q 238 445 151 469 q 389 434 280 434 l 389 331 l 349 331 q 206 315 255 331 q 125 210 125 287 q 183 107 125 145 q 302 76 233 76 q 436 117 379 76 q 509 234 493 159 l 634 234 m 520 1040 l 331 819 l 248 819 l 383 1040 l 520 1040 "},"Ï":{x_min:0,x_max:922,ha:1031,o:"m 922 339 q 856 97 922 203 q 650 -26 780 -26 q 538 9 587 -26 q 461 103 489 44 q 387 12 436 46 q 277 -22 339 -22 q 69 97 147 -22 q 0 339 0 203 q 45 551 0 444 q 161 738 84 643 l 302 738 q 175 553 219 647 q 124 336 124 446 q 155 179 124 249 q 275 88 197 88 q 375 163 341 88 q 400 294 400 219 l 400 572 l 524 572 l 524 294 q 561 135 524 192 q 643 88 591 88 q 762 182 719 88 q 797 342 797 257 q 745 556 797 450 q 619 738 705 638 l 760 738 q 874 551 835 640 q 922 339 922 444 "},"´":{x_min:0,x_max:96,ha:251,o:"m 96 606 l 0 606 l 0 988 l 96 988 l 96 606 "},"±":{x_min:11,x_max:781,ha:792,o:"m 781 490 l 446 490 l 446 255 l 349 255 l 349 490 l 11 490 l 11 586 l 349 586 l 349 819 l 446 819 l 446 586 l 781 586 l 781 490 m 781 21 l 11 21 l 11 115 l 781 115 l 781 21 "},"|":{x_min:343,x_max:449,ha:792,o:"m 449 462 l 343 462 l 343 986 l 449 986 l 449 462 m 449 -242 l 343 -242 l 343 280 l 449 280 l 449 -242 "},"Ï":{x_min:0,x_max:617,ha:725,o:"m 482 800 l 372 800 l 372 925 l 482 925 l 482 800 m 239 800 l 129 800 l 129 925 l 239 925 l 239 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 "},"§":{x_min:0,x_max:593,ha:690,o:"m 593 425 q 554 312 593 369 q 467 233 516 254 q 537 83 537 172 q 459 -74 537 -12 q 288 -133 387 -133 q 115 -69 184 -133 q 47 96 47 -6 l 166 96 q 199 7 166 40 q 288 -26 232 -26 q 371 -5 332 -26 q 420 60 420 21 q 311 201 420 139 q 108 309 210 255 q 0 490 0 383 q 33 602 0 551 q 124 687 66 654 q 75 743 93 712 q 58 812 58 773 q 133 984 58 920 q 300 1043 201 1043 q 458 987 394 1043 q 529 814 529 925 l 411 814 q 370 908 404 877 q 289 939 336 939 q 213 911 246 939 q 180 841 180 883 q 286 720 180 779 q 484 612 480 615 q 593 425 593 534 m 467 409 q 355 544 467 473 q 196 630 228 612 q 146 587 162 609 q 124 525 124 558 q 239 387 124 462 q 398 298 369 315 q 448 345 429 316 q 467 409 467 375 "},b:{x_min:0,x_max:685,ha:783,o:"m 685 372 q 597 99 685 213 q 347 -25 501 -25 q 219 5 277 -25 q 121 93 161 36 l 121 0 l 0 0 l 0 1013 l 121 1013 l 121 634 q 214 723 157 692 q 341 754 272 754 q 591 637 493 754 q 685 372 685 526 m 554 356 q 499 550 554 470 q 328 644 437 644 q 162 556 223 644 q 108 369 108 478 q 160 176 108 256 q 330 83 221 83 q 498 169 435 83 q 554 356 554 245 "},q:{x_min:0,x_max:683,ha:876,o:"m 683 -278 l 564 -278 l 564 97 q 474 8 533 39 q 345 -23 415 -23 q 91 93 188 -23 q 0 364 0 203 q 87 635 0 522 q 337 760 184 760 q 466 727 408 760 q 564 637 523 695 l 564 737 l 683 737 l 683 -278 m 582 375 q 527 564 582 488 q 358 652 466 652 q 190 565 253 652 q 135 377 135 488 q 189 179 135 261 q 361 84 251 84 q 530 179 469 84 q 582 375 582 260 "},"Ω":{x_min:-.171875,x_max:969.5625,ha:1068,o:"m 969 0 l 555 0 l 555 123 q 744 308 675 194 q 814 558 814 423 q 726 812 814 709 q 484 922 633 922 q 244 820 334 922 q 154 567 154 719 q 223 316 154 433 q 412 123 292 199 l 412 0 l 0 0 l 0 124 l 217 124 q 68 327 122 210 q 15 572 15 444 q 144 911 15 781 q 484 1041 274 1041 q 822 909 691 1041 q 953 569 953 777 q 899 326 953 443 q 750 124 846 210 l 969 124 l 969 0 "},"Ï":{x_min:0,x_max:617,ha:725,o:"m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 535 1040 l 346 819 l 262 819 l 397 1040 l 535 1040 "},z:{x_min:-.015625,x_max:613.890625,ha:697,o:"m 613 0 l 0 0 l 0 100 l 433 630 l 20 630 l 20 738 l 594 738 l 593 636 l 163 110 l 613 110 l 613 0 "},"â¢":{x_min:0,x_max:894,ha:1e3,o:"m 389 951 l 229 951 l 229 503 l 160 503 l 160 951 l 0 951 l 0 1011 l 389 1011 l 389 951 m 894 503 l 827 503 l 827 939 l 685 503 l 620 503 l 481 937 l 481 503 l 417 503 l 417 1011 l 517 1011 l 653 580 l 796 1010 l 894 1011 l 894 503 "},"ή":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 721 124 755 q 200 630 193 687 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 m 479 1040 l 290 819 l 207 819 l 341 1040 l 479 1040 "},"Î":{x_min:0,x_max:960,ha:1056,o:"m 960 507 q 833 129 960 280 q 476 -32 698 -32 q 123 129 255 -32 q 0 507 0 28
vendor: 4,390 bytes, line 1
10 q 123 883 0 732 q 476 1045 255 1045 q 832 883 696 1045 q 960 507 960 732 m 817 500 q 733 789 817 669 q 476 924 639 924 q 223 792 317 924 q 142 507 142 675 q 222 222 142 339 q 476 89 315 89 q 730 218 636 89 q 817 500 817 334 m 716 449 l 243 449 l 243 571 l 716 571 l 716 449 "},"®":{x_min:-3,x_max:1008,ha:1106,o:"m 503 532 q 614 562 566 532 q 672 658 672 598 q 614 747 672 716 q 503 772 569 772 l 338 772 l 338 532 l 503 532 m 502 -7 q 123 151 263 -7 q -3 501 -3 294 q 123 851 -3 706 q 502 1011 263 1011 q 881 851 739 1011 q 1008 501 1008 708 q 883 151 1008 292 q 502 -7 744 -7 m 502 60 q 830 197 709 60 q 940 501 940 322 q 831 805 940 681 q 502 944 709 944 q 174 805 296 944 q 65 501 65 680 q 173 197 65 320 q 502 60 294 60 m 788 146 l 678 146 q 653 316 655 183 q 527 449 652 449 l 338 449 l 338 146 l 241 146 l 241 854 l 518 854 q 688 808 621 854 q 766 658 766 755 q 739 563 766 607 q 668 497 713 519 q 751 331 747 472 q 788 164 756 190 l 788 146 "},"~":{x_min:0,x_max:833,ha:931,o:"m 833 958 q 778 753 833 831 q 594 665 716 665 q 402 761 502 665 q 240 857 302 857 q 131 795 166 857 q 104 665 104 745 l 0 665 q 54 867 0 789 q 237 958 116 958 q 429 861 331 958 q 594 765 527 765 q 704 827 670 765 q 729 958 729 874 l 833 958 "},"Î":{x_min:0,x_max:736.21875,ha:778,o:"m 736 0 l 0 0 l 0 1013 l 725 1013 l 725 889 l 139 889 l 139 585 l 677 585 l 677 467 l 139 467 l 139 125 l 736 125 l 736 0 "},"³":{x_min:0,x_max:450,ha:547,o:"m 450 552 q 379 413 450 464 q 220 366 313 366 q 69 414 130 366 q 0 567 0 470 l 85 567 q 126 470 85 504 q 225 437 168 437 q 320 467 280 437 q 360 552 360 498 q 318 632 360 608 q 213 657 276 657 q 195 657 203 657 q 176 657 181 657 l 176 722 q 279 733 249 722 q 334 815 334 752 q 300 881 334 856 q 220 907 267 907 q 133 875 169 907 q 97 781 97 844 l 15 781 q 78 926 15 875 q 220 972 135 972 q 364 930 303 972 q 426 817 426 888 q 344 697 426 733 q 421 642 392 681 q 450 552 450 603 "},"[":{x_min:0,x_max:273.609375,ha:371,o:"m 273 -281 l 0 -281 l 0 1013 l 273 1013 l 273 920 l 124 920 l 124 -187 l 273 -187 l 273 -281 "},L:{x_min:0,x_max:645.828125,ha:696,o:"m 645 0 l 0 0 l 0 1013 l 140 1013 l 140 126 l 645 126 l 645 0 "},"Ï":{x_min:0,x_max:803.390625,ha:894,o:"m 803 628 l 633 628 q 713 368 713 512 q 618 93 713 204 q 357 -25 518 -25 q 94 91 194 -25 q 0 368 0 201 q 94 644 0 533 q 356 761 194 761 q 481 750 398 761 q 608 739 564 739 l 803 739 l 803 628 m 360 85 q 529 180 467 85 q 584 374 584 262 q 527 566 584 490 q 352 651 463 651 q 187 559 247 651 q 135 368 135 478 q 189 175 135 254 q 360 85 251 85 "},"ζ":{x_min:0,x_max:573,ha:642,o:"m 573 -40 q 553 -162 573 -97 q 510 -278 543 -193 l 400 -278 q 441 -187 428 -219 q 462 -90 462 -132 q 378 -14 462 -14 q 108 45 197 -14 q 0 290 0 117 q 108 631 0 462 q 353 901 194 767 l 55 901 l 55 1012 l 561 1012 l 561 924 q 261 669 382 831 q 128 301 128 489 q 243 117 128 149 q 458 98 350 108 q 573 -40 573 80 "},"θ":{x_min:0,x_max:674,ha:778,o:"m 674 496 q 601 160 674 304 q 336 -26 508 -26 q 73 153 165 -26 q 0 485 0 296 q 72 840 0 683 q 343 1045 166 1045 q 605 844 516 1045 q 674 496 674 692 m 546 579 q 498 798 546 691 q 336 935 437 935 q 178 798 237 935 q 126 579 137 701 l 546 579 m 546 475 l 126 475 q 170 233 126 348 q 338 80 230 80 q 504 233 447 80 q 546 475 546 346 "},"Î":{x_min:0,x_max:958,ha:1054,o:"m 485 1042 q 834 883 703 1042 q 958 511 958 735 q 834 136 958 287 q 481 -26 701 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 729 q 485 1042 263 1042 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 670 q 480 913 640 913 q 226 785 321 913 q 142 504 142 671 q 226 224 142 339 q 480 98 319 98 "},"Î":{x_min:0,x_max:705.28125,ha:749,o:"m 705 886 l 140 886 l 140 0 l 0 0 l 0 1012 l 705 1012 l 705 886 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:-3,x_max:1089,ha:1186,o:"m 845 0 q 663 76 731 0 q 602 244 602 145 q 661 412 602 344 q 845 489 728 489 q 1027 412 959 489 q 1089 244 1089 343 q 1029 76 1089 144 q 845 0 962 0 m 844 103 q 945 143 909 103 q 981 243 981 184 q 947 340 981 301 q 844 385 909 385 q 744 342 781 385 q 708 243 708 300 q 741 147 708 186 q 844 103 780 103 m 888 986 l 284 -25 l 199 -25 l 803 986 l 888 986 m 241 468 q 58 545 126 468 q -3 715 -3 615 q 56 881 -3 813 q 238 958 124 958 q 421 881 353 958 q 483 712 483 813 q 423 544 483 612 q 241 468 356 468 m 241 855 q 137 811 175 855 q 100 710 100 768 q 136 612 100 653 q 240 572 172 572 q 344 614 306 572 q 382 713 382 656 q 347 8
vendor: 18,118 bytes, line 1
110 382 771 q 241 855 308 855 "},P:{x_min:0,x_max:726,ha:806,o:"m 424 1013 q 640 931 555 1013 q 726 719 726 850 q 637 506 726 587 q 413 426 548 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 379 889 l 140 889 l 140 548 l 372 548 q 522 589 459 548 q 593 720 593 637 q 528 845 593 801 q 379 889 463 889 "},"Î":{x_min:0,x_max:1078.21875,ha:1118,o:"m 1078 0 l 342 0 l 342 1013 l 1067 1013 l 1067 889 l 481 889 l 481 585 l 1019 585 l 1019 467 l 481 467 l 481 125 l 1078 125 l 1078 0 m 277 1040 l 83 799 l 0 799 l 140 1040 l 277 1040 "},"Î":{x_min:.125,x_max:1136.546875,ha:1235,o:"m 1136 0 l 722 0 l 722 123 q 911 309 842 194 q 981 558 981 423 q 893 813 981 710 q 651 923 800 923 q 411 821 501 923 q 321 568 321 720 q 390 316 321 433 q 579 123 459 200 l 579 0 l 166 0 l 166 124 l 384 124 q 235 327 289 210 q 182 572 182 444 q 311 912 182 782 q 651 1042 441 1042 q 989 910 858 1042 q 1120 569 1120 778 q 1066 326 1120 443 q 917 124 1013 210 l 1136 124 l 1136 0 m 277 1040 l 83 800 l 0 800 l 140 1041 l 277 1040 "},_:{x_min:0,x_max:705.5625,ha:803,o:"m 705 -334 l 0 -334 l 0 -234 l 705 -234 l 705 -334 "},"Ϊ":{x_min:-110,x_max:246,ha:275,o:"m 246 1046 l 118 1046 l 118 1189 l 246 1189 l 246 1046 m 18 1046 l -110 1046 l -110 1189 l 18 1189 l 18 1046 m 136 0 l 0 0 l 0 1012 l 136 1012 l 136 0 "},"+":{x_min:23,x_max:768,ha:792,o:"m 768 372 l 444 372 l 444 0 l 347 0 l 347 372 l 23 372 l 23 468 l 347 468 l 347 840 l 444 840 l 444 468 l 768 468 l 768 372 "},"½":{x_min:0,x_max:1050,ha:1149,o:"m 1050 0 l 625 0 q 712 178 625 108 q 878 277 722 187 q 967 385 967 328 q 932 456 967 429 q 850 484 897 484 q 759 450 798 484 q 721 352 721 416 l 640 352 q 706 502 640 448 q 851 551 766 551 q 987 509 931 551 q 1050 385 1050 462 q 976 251 1050 301 q 829 179 902 215 q 717 68 740 133 l 1050 68 l 1050 0 m 834 985 l 215 -28 l 130 -28 l 750 984 l 834 985 m 224 422 l 142 422 l 142 811 l 0 811 l 0 867 q 104 889 62 867 q 164 973 157 916 l 224 973 l 224 422 "},"Ρ":{x_min:0,x_max:720,ha:783,o:"m 424 1013 q 637 933 554 1013 q 720 723 720 853 q 633 508 720 591 q 413 426 546 426 l 140 426 l 140 0 l 0 0 l 0 1013 l 424 1013 m 378 889 l 140 889 l 140 548 l 371 548 q 521 589 458 548 q 592 720 592 637 q 527 845 592 801 q 378 889 463 889 "},"'":{x_min:0,x_max:139,ha:236,o:"m 139 851 q 102 737 139 784 q 0 669 65 690 l 0 734 q 59 787 42 741 q 72 873 72 821 l 0 873 l 0 1013 l 139 1013 l 139 851 "},"ª":{x_min:0,x_max:350,ha:397,o:"m 350 625 q 307 616 328 616 q 266 631 281 616 q 247 673 251 645 q 190 628 225 644 q 116 613 156 613 q 32 641 64 613 q 0 722 0 669 q 72 826 0 800 q 247 866 159 846 l 247 887 q 220 934 247 916 q 162 953 194 953 q 104 934 129 953 q 76 882 80 915 l 16 882 q 60 976 16 941 q 166 1011 104 1011 q 266 979 224 1011 q 308 891 308 948 l 308 706 q 311 679 308 688 q 331 670 315 670 l 350 672 l 350 625 m 247 757 l 247 811 q 136 790 175 798 q 64 726 64 773 q 83 682 64 697 q 132 667 103 667 q 207 690 174 667 q 247 757 247 718 "},"Î
":{x_min:0,x_max:450,ha:553,o:"m 450 800 l 340 800 l 340 925 l 450 925 l 450 800 m 406 1040 l 212 800 l 129 800 l 269 1040 l 406 1040 m 110 800 l 0 800 l 0 925 l 110 925 l 110 800 "},T:{x_min:0,x_max:777,ha:835,o:"m 777 894 l 458 894 l 458 0 l 319 0 l 319 894 l 0 894 l 0 1013 l 777 1013 l 777 894 "},"Φ":{x_min:0,x_max:915,ha:997,o:"m 527 0 l 389 0 l 389 122 q 110 231 220 122 q 0 509 0 340 q 110 785 0 677 q 389 893 220 893 l 389 1013 l 527 1013 l 527 893 q 804 786 693 893 q 915 509 915 679 q 805 231 915 341 q 527 122 696 122 l 527 0 m 527 226 q 712 310 641 226 q 779 507 779 389 q 712 705 779 627 q 527 787 641 787 l 527 226 m 389 226 l 389 787 q 205 698 275 775 q 136 505 136 620 q 206 308 136 391 q 389 226 276 226 "},"â":{x_min:0,x_max:0,ha:694},j:{x_min:-77.78125,x_max:167,ha:349,o:"m 167 871 l 42 871 l 42 1013 l 167 1013 l 167 871 m 167 -80 q 121 -231 167 -184 q -26 -278 76 -278 l -77 -278 l -77 -164 l -41 -164 q 26 -143 11 -164 q 42 -65 42 -122 l 42 737 l 167 737 l 167 -80 "},"Σ":{x_min:0,x_max:756.953125,ha:819,o:"m 756 0 l 0 0 l 0 107 l 395 523 l 22 904 l 22 1013 l 745 1013 l 745 889 l 209 889 l 566 523 l 187 125 l 756 125 l 756 0 "},"âº":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},"<":{x_min:17.984375,x_max:773.609375,ha:792,o:"m 773 40 l 18 376 l 17 465 l 773 799 l 773 692 l 159 420 l 773 149 l 773 40 "},"£":{x_min:0,x_max:704.484375,ha:801,o:"m 704 41 q 623 -10 664 5 q 543 -26 583 -26 q 359 15 501 -26 q 243 36 288 36 q 158 23 197 36 q 73 -21 119 10 l 6 76 q 125 195 90 150 q 175 331 175 262 q 147 443 175 383 l 0 443 l 0 512 l 108 512 q 43 734 43 623 q 120 929 43 854 q 358 1010 204 1010 q 579 936 487 1010 q 678 729 678 857 l 678 684 l 552 684 q 504 838 552 780 q 362 896 457 896 q 216 852 263 896 q 176 747 176 815 q 199 627 176 697 q 248 512 217 574 l 468 512 l 468 443 l 279 443 q 297 356 297 398 q 230 194 297 279 q 153 107 211 170 q 227 133 190 125 q 293 142 264 142 q 410 119 339 142 q 516 96 482 96 q 579 105 550 96 q 648 142 608 115 l 704 41 "},t:{x_min:0,x_max:367,ha:458,o:"m 367 0 q 312 -5 339 -2 q 262 -8 284 -8 q 145 28 183 -8 q 108 143 108 64 l 108 638 l 0 638 l 0 738 l 108 738 l 108 944 l 232 944 l 232 738 l 367 738 l 367 638 l 232 638 l 232 185 q 248 121 232 140 q 307 102 264 102 q 345 104 330 102 q 367 107 360 107 l 367 0 "},"¬":{x_min:0,x_max:706,ha:803,o:"m 706 411 l 706 158 l 630 158 l 630 335 l 0 335 l 0 411 l 706 411 "},"λ":{x_min:0,x_max:750,ha:803,o:"m 750 -7 q 679 -15 716 -15 q 538 59 591 -15 q 466 214 512 97 l 336 551 l 126 0 l 0 0 l 270 705 q 223 837 247 770 q 116 899 190 899 q 90 898 100 899 l 90 1004 q 152 1011 125 1011 q 298 938 244 1011 q 373 783 326 901 l 605 192 q 649 115 629 136 q 716 95 669 95 l 736 95 q 750 97 745 97 l 750 -7 "},W:{x_min:0,x_max:1263.890625,ha:1351,o:"m 1263 1013 l 995 0 l 859 0 l 627 837 l 405 0 l 265 0 l 0 1013 l 136 1013 l 342 202 l 556 1013 l 701 1013 l 921 207 l 1133 1012 l 1263 1013 "},">":{x_min:18.0625,x_max:774,ha:792,o:"m 774 376 l 18 40 l 18 149 l 631 421 l 18 692 l 18 799 l 774 465 l 774 376 "},v:{x_min:0,x_max:675.15625,ha:761,o:"m 675 738 l 404 0 l 272 0 l 0 738 l 133 737 l 340 147 l 541 737 l 675 738 "},"Ï":{x_min:.28125,x_max:644.5,ha:703,o:"m 644 628 l 382 628 l 382 179 q 388 120 382 137 q 436 91 401 91 q 474 94 447 91 q 504 97 501 97 l 504 0 q 454 -9 482 -5 q 401 -14 426 -14 q 278 67 308 -14 q 260 233 260 118 l 260 628 l 0 628 l 0 739 l 644 739 l 644 628 "},"ξ":{x_min:0,x_max:624.9375,ha:699,o:"m 624 -37 q 608 -153 624 -96 q 563 -278 593 -211 l 454 -278 q 491 -183 486 -200 q 511 -83 511 -126 q 484 -23 511 -44 q 370 1 452 1 q 323 0 354 1 q 283 -1 293 -1 q 84 76 169 -1 q 0 266 0 154 q 56 431 0 358 q 197 538 108 498 q 94 613 134 562 q 54 730 54 665 q 77 823 54 780 q 143 901 101 867 l 27 901 l 27 1012 l 576 1012 l 576 901 l 380 901 q 244 863 303 901 q 178 745 178 820 q 312 600 178 636 q 532 582 380 582 l 532 479 q 276 455 361 479 q 118 281 118 410 q 165 173 118 217 q 274 120 208 133 q 494 101 384 110 q 624 -37 624 76 "},"&":{x_min:-3,x_max:894.25,ha:992,o:"m 894 0 l 725 0 l 624 123 q 471 0 553 40 q 306 -41 390 -41 q 168 -7 231 -41 q 62 92 105 26 q 14 187 31 139 q -3 276 -3 235 q 55 433 -3 358 q 248 581 114 508 q 170 689 196 640 q 137 817 137 751 q 214 985 137 922 q 384 1041 284 1041 q 548 988 483 1041 q 622 824 622 928 q 563 666 622 739 q 431 556 516 608 l 621 326 q 649 407 639 361 q 663 493 653 426 l 781 493 q 703 229 781 352 l 894 0 m 504 818 q 468 908 504 877 q 384 940 433 940 q 293 907 331 940 q 255 818 255 875 q 289 714 255 767 q 363 628 313 678 q 477 729 446 682 q 504 818 504 771 m 556 209 l 314 499 q 179 395 223 449 q 135 283 135 341 q 146 222 135 253 q 183 158 158 192 q 333 80 241 80 q 556 209 448 80 "},"Î":{x_min:0,x_max:862.5,ha:942,o:"m 862 0 l 719 0 l 426 847 l 143 0 l 0 0 l 356 1013 l 501 1013 l 862 0 "},I:{x_min:41,x_max:180,ha:293,o:"m 180 0 l 41 0 l 41 1013 l 180 1013 l 180 0 "},G:{x_min:0,x_max:921,ha:1011,o:"m 921 0 l 832 0 l 801 136 q 655 15 741 58 q 470 -28 568 -28 q 126 133 259 -28 q 0 499 0 284 q 125 881 0 731 q 486 1043 259 1043 q 763 957 647 1043 q 905 709 890 864 l 772 709 q 668 866 747 807 q 486 926 589 926 q 228 795 322 926 q 142 507 142 677 q 228 224 142 342 q 483 94 323 94 q 712 195 625 94 q 796 435 796 291 l 477 435 l 477 549 l 921 549 l 921 0 "},"ΰ":{x_min:0,x_max:617,ha:725,o:"m 524 800 l 414 800 l 414 925 l 524 925 l 524 800 m 183 800 l 73 800 l 73 925 l 183 925 l 183 800 m 617 352 q 540 93 617 199 q 308 -24 455 -24 q 76 93 161 -24 q 0 352 0 199 l 0 738 l 126 738 l 126 354 q 169 185 126 257 q 312 98 220 98 q 451 185 402 98 q 492 354 492 257 l 492 738 l 617 738 l 617 352 m 489 1040 l 300 819 l 216 819 l 351 1040 l 489 1040 "},"`":{x_min:0,x_max:138.890625,ha:236,o:"m 138 699 l 0 699 l 0 861 q 36 974 0 929 q 138 1041 72 1020 l 138 977 q 82 931 95 969 q 69 839 69 893 l 138 839 l 138 699 "},"·":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 "},"Î¥":{x_min:.328125,x_max:819.515625,ha:889,o:"m 819 1013 l 482 416 l 482 0 l 342 0 l 342 416 l 0 1013 l 140 1013 l 411 533 l 679 1013 l 819 1013 "},r:{x_min:0,x_max:355.5625,ha:432,o:"m 355 621 l 343 621 q 179 569 236 621 q 122 411 122 518 l 122 0 l 0 0 l 0 737 l 117 737 l 117 604 q 204 719 146 686 q 355 753 262 753 l 355 621 "},x:{x_min:0,x_max:675,ha:764,o:"m 675 0 l 525 0 l 331 286 l 144 0 l 0 0 l 256 379 l 12 738 l 157 737 l 336 473 l 516 738 l 661 738 l 412 380 l 675 0 "},"μ":{x_min:0,x_max:696.609375,ha:747,o:"m 696 -4 q 628 -14 657 -14 q 498 97 513 -14 q 422 8 470 41 q 313 -24 374 -24 q 207 3 258 -24 q 120 80 157 31 l 120 -278 l 0 -278 l 0 738 l 124 738 l 124 343 q 165 172 124 246 q 308 82 216 82 q 451 177 402 82 q 492 358 492 254 l 492 738 l 616 738 l 616 214 q 623 136 616 160 q 673 92 636 92 q 696 95 684 92 l 696 -4 "},h:{x_min:0,x_max:615,ha:724,o:"m 615 472 l 615 0 l 490 0 l 490 454 q 456 590 490 535 q 338 654 416 654 q 186 588 251 654 q 122 436 122 522 l 122 0 l 0 0 l 0 1013 l 122 1013 l 122 633 q 218 727 149 694 q 362 760 287 760 q 552 676 484 760 q 615 472 615 600 "},".":{x_min:0,x_max:142,ha:239,o:"m 142 0 l 0 0 l 0 151 l 142 151 l 142 0 "},"Ï":{x_min:-2,x_max:878,ha:974,o:"m 496 -279 l 378 -279 l 378 -17 q 101 88 204 -17 q -2 367 -2 194 q 68 626 -2 510 q 283 758 151 758 l 283 646 q 167 537 209 626 q 133 373 133 462 q 192 177 133 254 q 378 93 259 93 l 378 758 q 445 764 426 763 q 476 765 464 765 q 765 659 653 765 q 878 377 878 553 q 771 96 878 209 q 496 -17 665 -17 l 496 -279 m 496 93 l 514 93 q 687 183 623 93 q 746 380 746 265 q 691 569 746 491 q 522 658 629 658 l 496 656 l 496 93 "},";":{x_min:0,x_max:142,ha:239,o:"m 142 585 l 0 585 l 0 738 l 142 738 l 142 585 m 142 -12 q 105 -132 142 -82 q 0 -206 68 -182 l 0 -138 q 58 -82 43 -123 q 68 0 68 -56 l 0 0 l 0 151 l 142 151 l 142 -12 "},f:{x_min:0,x_max:378,ha:472,o:"m 378 638 l 246 638 l 246 0 l 121 0 l 121 638 l 0 638 l 0 738 l 121 738 q 137 935 121 887 q 290 1028 171 1028 q 320 1027 305 1028 q 378 1021 334 1026 l 378 908 q 323 918 346 918 q 257 870 273 918 q 246 780 246 840 l 246 738 l 378 738 l 378 638 "},"â":{x_min:1,x_max:348.21875,ha:454,o:"m 140 670 l 1 670 l 1 830 q 37 943 1 897 q 140 1011 74 990 l 140 947 q 82 900 97 940 q 68 810 68 861 l 140 810 l 140 670 m 348 670 l 209 670 l 209 830 q 245 943 209 897 q 348 1011 282 990 l 348 947 q 290 900 305 940 q 276 810 276 861 l 348 810 l 348 670 "},A:{x_min:.03125,x_max:906.953125,ha:1008,o:"m 906 0 l 756 0 l 648 303 l 251 303 l 142 0 l 0 0 l 376 1013 l 529 1013 l 906 0 m 610 421 l 452 867 l 293 421 l 610 421 "},"â":{x_min:1,x_max:139.890625,ha:236,o:"m 139 670 l 1 670 l 1 830 q 37 943 1 897 q 139 1011 74 990 l 139 947 q 82 900 97 940 q 68 810 68 861 l 139 810 l 139 670 "},"Ï":{x_min:-70,x_max:283,ha:361,o:"m 283 800 l 173 800 l 173 925 l 283 925 l 283 800 m 40 800 l -70 800 l -70 925 l 40 925 l 40 800 m 283 3 q 232 -10 257 -5 q 181 -15 206 -15 q 84 26 118 -15 q 41 200 41 79 l 41 737 l 166 737 l 167 215 q 171 141 167 157 q 225 101 182 101 q 247 103 238 101 q 283 112 256 104 l 283 3 "},"Ï":{x_min:-.21875,x_max:773.21875,ha:857,o:"m 773 -7 l 707 -11 q 575 40 607 -11 q 552 174 552 77 l 552 226 l 552 626 l 222 626 l 222 0 l 97 0 l 97 626 l 0 626 l 0 737 l 773 737 l 773 626 l 676 626 l 676 171 q 695 103 676 117 q 773 90 714 90 l 773 -7 "},"ά":{x_min:0,x_max:765.5625,ha:809,o:"m 765 -4 q 698 -14 726 -14 q 564 97 586 -14 q 466 7 525 40 q 337 -26 407 -26 q 88 98 186 -26 q 0 369 0 212 q 88 637 0 525 q 337 760 184 760 q 465 727 407 760 q 563 637 524 695 l 563 738 l 685 738 l 685 222 q 693 141 685 168 q 748 94 708 94 q 765 95 760 94 l 765 -4 m 584 371 q 531 562 584 485 q 360 653 470 653 q 192 566 254 653 q 135 379 135 489 q 186 181 135 261 q 358 84 247 84 q 528 176 465 84 q 584 371 584 260 m 604 1040 l 415 819 l 332 819 l 466 1040 l 604 1040 "},O:{x_min:0,x_max:958,ha:1057,o:"m 485 1041 q 834 882 702 1041 q 958 512 958 734 q 834 136 958 287 q 481 -26 702 -26 q 126 130 261 -26 q 0 504 0 279 q 127 880 0 728 q 485 1041 263 1041 m 480 98 q 731 225 638 98 q 815 504 815 340 q 733 783 815 669 q 480 912 640 912 q 226 784 321 912 q 142 504 142 670 q 226 224 142 339 q 480 98 319 98 "},n:{x_min:0,x_max:615,ha:724,o:"m 615 463 l 615 0 l 490 0 l 490 454 q 453 592 490 537 q 331 656 410 656 q 178 585 240 656 q 117 421 117 514 l 117 0 l 0 0 l 0 738 l 117 738 l 117 630 q 218 728 150 693 q 359 764 286 764 q 552 675 484 764 q 615 463 615 593 "},l:{x_min:41,x_max:166,ha:279,o:"m 166 0 l 41 0 l 41 1013 l 166 1013 l 166 0 "},"¤":{x_min:40.09375,x_max:728.796875,ha:825,o:"m 728 304 l 649 224 l 512 363 q 383 331 458 331 q 256 363 310 331 l 119 224 l 40 304 l 177 441 q 150 553 150 493 q 184 673 150 621 l 40 818 l 119 898 l 267 749 q 321 766 291 759 q 384 773 351 773 q 447 766 417 773 q 501 749 477 759 l 649 898 l 728 818 l 585 675 q 612 618 604 648 q 621 553 621 587 q 591 441 621 491 l 728 304 m 384 682 q 280 643 318 682 q 243 551 243 604 q 279 461 243 499 q 383 423 316 423 q 487 461 449 423 q 525 553 525 500 q 490 641 525 605 q 384 682 451 682 "},"κ":{x_min:0,x_max:632.328125,ha:679,o:"m 632 0 l 482 0 l 225 384 l 124 288 l 124 0 l 0 0 l 0 738 l 124 738 l 124 446 l 433 738 l 596 738 l 312 466 l 632 0 "},p:{x_min:0,x_max:685,ha:786,o:"m 685 364 q 598 96 685 205 q 350 -23 504 -23 q 121 89 205 -23 l 121 -278 l 0 -278 l 0 738 l 121 738 l 121 633 q 220 726 159 691 q 351 761 280 761 q 598 636 504 761 q 685 364 685 522 m 557 371 q 501 560 557 481 q 330 651 437 651 q 162 559 223 651 q 108 366 108 479 q 162 177 108 254 q 333 87 224 87 q 502 178 441 87 q 557 371 557 258 "},"â¡":{x_min:0,x_max:777,ha:835,o:"m 458 238 l 458 0 l 319 0 l 319 238 l 0 238 l 0 360 l 319 360 l 319 681 l 0 683 l 0 804 l 319 804 l 319 1015 l 458 1013 l 458 804 l 777 804 l 777 683 l 458 683 l 458 360 l 777 360 l 777 238 l 458 238 "},"Ï":{x_min:0,x_max:808,ha:907,o:"m 465 -278 l 341 -278 l 341 -15 q 87 102 180 -15 q 0 378 0 210 l 0 739 l 133 739 l 133 379 q 182 195 133 275 q 341 98 242 98 l 341 922 l 465 922 l 465 98 q 623 195 563 98 q 675 382 675 278 l 675 742 l 808 742 l 808 381 q 720 104 808 213 q 466 -13 627 -13 l 465 -278 "},"η":{x_min:.78125,x_max:697,ha:810,o:"m 697 -278 l 572 -278 l 572 454 q 540 587 572 536 q 425 650 501 650 q 271 579 337 650 q 206 420 206 509 l 206 0 l 81 0 l 81 489 q 73 588 81 562 q 0 644 56 644 l 0 741 q 68 755 38 755 q 158 720 124 755 q 200 630 193 686 q 297 726 234 692 q 434 761 359 761 q 620 692 544 761 q 697 516 697 624 l 697 -278 "}},cssFontWeight:"normal",ascender:1189,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-334,xMin:-111,yMax:1189,xMax:1672},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Regular",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr/",full_font_name:"Helvetiker",font_family_name:"Helvetiker",copyright:"Copyright (c) Îagenta ltd, 2004",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Îagenta ltd:Helvetiker:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Îagenta ltd",font_sub_family_name:"Regular"},descender:-334,familyName:"Helvetiker",lineHeight:1522,underlineThickness:50},
vendor: 647 bytes, line 1
1onChange:function(e,t){t.font=new TG.Font(e)}},labelColor:{default:function(){return"lightgrey"}},labelRotation:{default:0},labelResolution:{default:3},labelIncludeDot:{default:!0},labelDotRadius:{default:.1},labelDotOrientation:{default:function(){return"bottom"}},labelsTransitionDuration:{default:1e3,triggerUpdate:!1}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r;var i=new TG.CircleGeometry(1,32);t.dataMapper=new Lz(e,{objBindAttr:"__threeObjLabel"}).onCreateObj((function(){var e=new TG.MeshLambertMaterial;e.side=2;var t=new TG.Group;t.add(new TG.Mesh(i,e));var n=new TG.Mesh(void 0,e);t.add(n);var r=new TG.Mesh;
1return r.visible=!1,n.add(r),t.__globeObjType="label",t}))},update:function(e){var t=rm(e.labelLat),n=rm(e.labelLng),r=rm(e.labelAltitude),i=rm(e.labelText),s=rm(e.labelSize),a=rm(e.labelRotation),o=rm(e.labelColor),l=rm(e.labelIncludeDot),u=rm(e.labelDotRadius),c=rm(e.labelDotOrientation),h=new Set(["right","top","bottom"]),A=2*Math.PI*mz/360;e.dataMapper.onUpdateObj((function(d,p){var f=oz(d.children,2),m=f[0],g=f[1],_=oz(g.children,1)[0],v=o(p),y=Mz(v);g.material.color.set(Sz(v)),g.material.transparent=y<1,g.material.opacity=y;var x=l(p),b=c(p);!x||!h.has(b)&&(b="bottom");var w=x?+u(p)*A:1e-12;m.scale.x=m.scale.y=w;var T=+s(p)*A;if(g.geometry&&g.geometry.dispose(),g.geometry=new TG.TextGeometry(i(p),{font:e.font,size:T,depth:0,bevelEnabled:!0,bevelThickness:0,bevelSize:0,curveSegments:e.labelResolution}),_.geometry&&_.geometry.dispose(),g.geometry.computeBoundingBox(),_.geometry=YV(TG.BoxGeometry,uz((new TG.Vector3).subVectors(g.geometry.boundingBox.max,g.geometry.boundingBox.min).clampScalar(0,1/0).toArray())),"right"!==b&&g.geometry.center(),x){var S=w+T/2;"right"===b&&(g.position.x=S),g.position.y={right:-T/2,top:S+T/2,bottom:-S-T/2}[b]}var M=function(t){var n=d.__currentTargetD=t,r=n.lat,i=n.lng,s=n.alt,a=n.rot,o=n.scale;Object.assign(d.position,_z(r,i,s)),d.lookAt(e.scene.localToWorld(new TG.Vector3(0,0,0))),d.rotateY(Math.PI),d.rotateZ(-a*Math.PI/180),d.scale.x=d.scale.y=d.scale.z=o},E={lat:+t(p),lng:+n(p),alt:+r(p),rot:+a(p),scale:1},C=d.__currentTargetD||Object.assign({},E,{scale:1e-12});Object.keys(E).some((function(e){return C[e]!==E[e]}))&&(!e.labelsTransitionDuration||e.labelsTransitionDuration<0?M(E):e.tweenGroup.add(new Fu(C).to(E,e.labelsTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(M).start()))})).digest(e.labelsData)}}),MG=rz(rz({},window.THREE?window.THREE:{}),{},{CSS2DObject:class extends Tn{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Ye(.5,.5),this.addEventListener("removed",(function(){this.traverse((function(e){e.element instanceof e.element.ownerDocument.defaultView.Element&&null!==e.element.parentNode&&e.element.remove()}))}))}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}}),EG=Pu({props:{htmlElementsData:{default:[]},htmlLat:{default:"lat"},htmlLng:{default:"lng"},htmlAltitude:{default:0},htmlElement:{},htmlElementVisibilityModifier:{triggerUpdate:!1},htmlTransitionDuration:{default:1e3,triggerUpdate:!1},isBehindGlobe:{onChange:function(){this.updateObjVisibility()},triggerUpdate:!1}},methods:{updateObjVisibility:function(e,t){e.dataMapper&&(t?[t]:e.dataMapper.entries().map((function(e){return oz(e,2)[1]})).filter((function(e){return e}))).forEach((function(t){var n=!e.isBehindGlobe||!e.isBehindGlobe(t.position);e.htmlElementVisibilityModifier?(t.visible=!0,e.htmlElementVisibilityModifier(t.element,n)):t.visible=n}))}},init:function(e,t,n){var r=n.tweenGroup;pz(e),t.scene=e,t.tweenGroup=r,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjHtml"}).onCreateObj((function(e){var n=rm(t.htmlElement)(e),r=new MG.CSS2DObject(n);return r.__globeObjType="html",r}))},update:function(e,t){var n=this,r=rm(e.htmlLat),i=rm(e.htmlLng),s=rm(e.htmlAltitude);t.hasOwnProperty("htmlElement")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj((function(t,a){var o=function(e){var r=t.__currentTargetD=e,i=r.alt,s=r.lat,a=r.lng;Object.assign(t.position,_z(s,a,i)),n.updateObjVisibility(t)},l={lat:+r(a),lng:+i(a),alt:+s(a)};!e.htmlTransitionDuration||e.htmlTransitionDuration<0||!t.__currentTargetD?o(l):e.tweenGroup.add(new Fu(t.__currentTargetD).to(l,e.htmlTransitionDuration).easing(Du.Quadratic.InOut).onUpdate(o).start())})).digest(e.htmlElementsData)}}),CG=window.THREE?window.THREE:{Group:Vr,Mesh:Tr,MeshLambertMaterial:Ds,SphereGeometry:Ms},RG=Pu({props:{objectsData:{default:[]},objectLat:{default:"lat"},objectLng:{default:"lng"},objectAltitude:{default:.01},objectFacesSurface:{default:!0},objectRotation:{}
1,objectThreeObject:{default:new CG.Mesh(new CG.SphereGeometry(1,16,8),new CG.MeshLambertMaterial({color:"#ffffaa",transparent:!0,opacity:.7}))}},init:function(e,t){pz(e),t.scene=e,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjObject"}).onCreateObj((function(e){var n=rm(t.objectThreeObject)(e);t.objectThreeObject===n&&(n=n.clone());var r=new CG.Group;return r.add(n),r.__globeObjType="object",r}))},update:function(e,t){var n=rm(e.objectLat),r=rm(e.objectLng),i=rm(e.objectAltitude),s=rm(e.objectFacesSurface),a=rm(e.objectRotation);t.hasOwnProperty("objectThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj((function(e,t){var o=+n(t),l=+r(t),u=+i(t);Object.assign(e.position,_z(o,l,u)),s(t)?e.setRotationFromEuler(new on(yz(-o),yz(l),0,"YXZ")):e.rotation.set(0,0,0);var c=e.children[0],h=a(t);h&&c.setRotationFromEuler(new on(yz(h.x||0),yz(h.y||0),yz(h.z||0)))})).digest(e.objectsData)}}),NG=Pu({props:{customLayerData:{default:[]},customThreeObject:{},customThreeObjectUpdate:{triggerUpdate:!1}},init:function(e,t){pz(e),t.scene=e,t.dataMapper=new Lz(e,{objBindAttr:"__threeObjCustom"}).onCreateObj((function(e){var n=rm(t.customThreeObject)(e,mz);return n&&(t.customThreeObject===n&&(n=n.clone()),n.__globeObjType="custom"),n}))},update:function(e,t){e.customThreeObjectUpdate||pz(e.scene);var n=rm(e.customThreeObjectUpdate);t.hasOwnProperty("customThreeObject")&&e.dataMapper.clear(),e.dataMapper.onUpdateObj((function(e,t){return n(e,t,mz)})).digest(e.customLayerData)}}),PG=window.THREE?window.THREE:{Camera:Dr,Group:Vr,Vector2:Ye,Vector3:Ke},DG=["globeLayer","pointsLayer","arcsLayer","hexBinLayer","heatmapsLayer","polygonsLayer","hexedPolygonsLayer","pathsLayer","tilesLayer","particlesLayer","ringsLayer","labelsLayer","htmlElementsLayer","objectsLayer","customLayer"],LG=fz("globeLayer",Tz),IG=Object.assign.apply(Object,uz(["globeImageUrl","bumpImageUrl","globeCurvatureResolution","globeTileEngineUrl","globeTileEngineMaxLevel","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude"].map((function(e){return KV({},e,LG.linkProp(e))})))),OG=Object.assign.apply(Object,uz(["globeMaterial"].map((function(e){return KV({},e,LG.linkMethod(e))})))),BG=fz("pointsLayer",Uz),UG=Object.assign.apply(Object,uz(["pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration"].map((function(e){return KV({},e,BG.linkProp(e))})))),FG=fz("arcsLayer",Hz),kG=Object.assign.apply(Object,uz(["arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration"].map((function(e){return KV({},e,FG.linkProp(e))})))),qG=fz("hexBinLayer",Yz),VG=Object.assign.apply(Object,uz(["hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinResolution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration"].map((function(e){return KV({},e,qG.linkProp(e))})))),zG=fz("heatmapsLayer",rG),GG=Object.assign.apply(Object,uz(["heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration"].map((function(e){return KV({},e,zG.linkProp(e))})))),jG=fz("hexedPolygonsLayer",uG),HG=Object.assign.apply(Object,uz(["hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration"].map((function(e){return KV({},e,jG.linkProp(e))})))),WG=fz("polygonsLayer",sG),XG=Object.assign.apply(Object,uz(["polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration"].map((function(e){return KV({},e,WG.linkProp(e))})))),QG=fz("pathsLayer",pG),YG=Object.assign.apply(Object,uz(["pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration"].map((function(e){return KV({},e,QG.linkProp(e))})))),$G=fz("tilesLayer",mG),KG=Object.assign.apply(Object,uz(["tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration"].map((function(e){return KV({},e,$G.linkProp(e))})))),ZG=fz("particlesLayer",vG),JG=Object.assign.apply(Object,uz(["particlesData","particlesList","particleLat","particleLng","particleAltitude","particlesSize","particlesSizeAttenuation","particlesColor","particlesTexture"].map((function(e){return KV({},e,ZG.linkProp(e))})))),ej=fz("ringsLayer",wG),tj=Object.assign.apply(Object,uz(["ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod"].map((function(e){return KV({},e,ej.linkProp(e))})))),nj=fz("labelsLayer",SG),rj=Object.assign.apply(Object,uz(["labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration"].map((function(e){return KV({},e,nj.linkProp(e))})))),ij=fz("htmlElementsLayer",EG),sj=Object.assign.apply(Object,uz(["htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlElementVisibilityModifier","htmlTransitionDuration"].map((function(e){return KV({},e,ij.linkProp(e))})))),aj=fz("objectsLayer",RG),oj=Object.assign.apply(Object,uz(["objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeOb
1ject"].map((function(e){return KV({},e,aj.linkProp(e))})))),lj=fz("customLayer",NG),uj=Object.assign.apply(Object,uz(["customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(e){return KV({},e,lj.linkProp(e))})))),cj=Pu({props:rz(rz(rz(rz(rz(rz(rz(rz(rz(rz(rz(rz(rz(rz(rz({onGlobeReady:{triggerUpdate:!1},rendererSize:{default:new PG.Vector2(window.innerWidth,window.innerHeight),onChange:function(e,t){t.pathsLayer.rendererSize(e)},triggerUpdate:!1}},IG),UG),kG),VG),GG),XG),HG),YG),KG),JG),tj),rj),sj),oj),uj),methods:rz({getGlobeRadius:gz,getCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return _z.apply(void 0,n)},toGeoCoords:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return vz.apply(void 0,n)},setPointOfView:function(e,t){var n,r,i,s,a=t instanceof PG.Camera?t.position:t,o=gz(),l=void 0;e.scene&&a&&(l=function(t){void 0===n&&(n=a.clone().applyMatrix4(e.scene.matrixWorld.clone().invert())),void 0===r&&(r=n.length()),void 0===i&&(i=Math.sqrt(Math.pow(r,2)-Math.pow(o,2))),void 0===s&&(s=Math.acos(i/r));var l=n.distanceTo(t);if(l<i)return!1;var u=t.length();return Math.acos((Math.pow(r,2)+Math.pow(l,2)-Math.pow(u,2))/(2*r*l))<s}),e.layersThatNeedUpdatePov.forEach((function(e){return e.updatePov(t)})),e.layersThatNeedBehindGlobeChecker.forEach((function(e){return e.isBehindGlobe(l)}))},pauseAnimation:function(e){return null!==e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),e.pausableLayers.forEach((function(e){var t;return null===(t=e.pauseAnimation)||void 0===t?void 0:t.call(e)})),this},resumeAnimation:function(e){return null===e.animationFrameRequestId&&this._animationCycle(),e.pausableLayers.forEach((function(e){var t;return null===(t=e.resumeAnimation)||void 0===t?void 0:t.call(e)})),this},_animationCycle:function(e){e.animationFrameRequestId=requestAnimationFrame(this._animationCycle),e.tweenGroup.update()},_destructor:function(e){this.pauseAnimation(),e.destructableLayers.forEach((function(e){return e._destructor()}))}},OG),stateInit:function(){var e=new Iu,t={tweenGroup:e},n={globeLayer:Tz(t),pointsLayer:Uz(t),arcsLayer:Hz(t),hexBinLayer:Yz(t),heatmapsLayer:rG(t),polygonsLayer:sG(t),hexedPolygonsLayer:uG(t),pathsLayer:pG(t),tilesLayer:mG(t),particlesLayer:vG(t),ringsLayer:wG(t),labelsLayer:SG(t),htmlElementsLayer:EG(t),objectsLayer:RG(t),customLayer:NG(t)};return rz(rz({tweenGroup:e},n),{},{layersThatNeedUpdatePov:Object.values(n).filter((function(e){return e.hasOwnProperty("updatePov")})),layersThatNeedBehindGlobeChecker:Object.values(n).filter((function(e){return e.hasOwnProperty("isBehindGlobe")})),destructableLayers:Object.values(n).filter((function(e){return e.hasOwnProperty("_destructor")})),pausableLayers:Object.values(n).filter((function(e){return e.hasOwnProperty("pauseAnimation")}))})},init:function(e,t,n){var r=n.animateIn,i=void 0===r||r,s=n.waitForGlobeReady,a=void 0===s||s;pz(e),t.scene=e,t.scene.visible=!1,DG.forEach((function(e){var n=new PG.Group;t.scene.add(n),t[e](n)}));var o=function(){if(i){t.scene.scale.set(1e-6,1e-6,1e-6),t.tweenGroup.add(new Fu({k:1e-6}).to({k:1},600).easing(Du.Quadratic.Out).onUpdate((function(e){var n=e.k;return t.scene.scale.set(n,n,n)})).start());var e=new PG.Vector3(0,1,0);t.tweenGroup.add(new Fu({rot:2*Math.PI}).to({rot:0},1200).easing(Du.Quintic.Out).onUpdate((function(n){var r=n.rot;return t.scene.setRotationFromAxisAngle(e,r)})).start())}t.scene.visible=!0,t.onGlobeReady&&t.onGlobeReady()};a?t.globeLayer.onReady(o):o(),this._animationCycle()},update:function(e){}}),hj=function(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(n){function r(){var n;HV(this,r);for(var i=arguments.length,s=new Array(i),a=0;a<i;a++)s[a]=arguments[a];return(n=jV(this,r,[].concat(s))).__kapsuleInstance=YV(e,[].concat(uz(t?[n]:[]),s)),n}return ez(r,n),$V(r)}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object);return Object.keys(e()).forEach((function(e){return n.prototype[e]=function(){var t,n=(t=this.__kapsuleInstance)[e].apply(t,arguments);return n===this.__kapsuleInstance?this:n}})),n}(cj,(window.THREE?window.THREE:{Group:Vr}).Group,!0);const Aj={type:"change"},dj={type:"start"},pj={type:"end"},fj=1e-6,mj=-1,gj=new Ye,_j=new Ye,vj=new Ke,yj=new Ke,xj=new Ke,bj=new $e,wj=new Ke,Tj=new Ke,Sj=new Ke,Mj=new Ke;
vendor: 16,787 bytes, line 1
1class Ej extends va{constructor(e,t=null){super(e,t),this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2},this.target=new Ke,this.state=mj,this.keyState=mj,this._lastPosition=new Ke,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new Ke,this._movePrev=new Ye,this._moveCurr=new Ye,this._lastAxis=new Ke,this._zoomStart=new Ye,this._zoomEnd=new Ye,this._panStart=new Ye,this._panEnd=new Ye,this._pointers=[],this._pointerPositions={},this._onPointerMove=Rj.bind(this),this._onPointerDown=Cj.bind(this),this._onPointerUp=Nj.bind(this),this._onPointerCancel=Pj.bind(this),this._onContextMenu=Fj.bind(this),this._onMouseWheel=Uj.bind(this),this._onKeyDown=Lj.bind(this),this._onKeyUp=Dj.bind(this),this._onTouchStart=kj.bind(this),this._onTouchMove=qj.bind(this),this._onTouchEnd=Vj.bind(this),this._onMouseDown=Ij.bind(this),this._onMouseMove=Oj.bind(this),this._onMouseUp=Bj.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,null!==t&&(this.connect(t),this.handleResize()),this.update()}connect(e){super.connect(e),window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>fj&&(this.dispatchEvent(Aj),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera&&(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>fj||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(Aj),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom))}reset(){this.state=mj,this.keyState=mj,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(Aj),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(_j.copy(this._panEnd).sub(this._panStart),_j.lengthSq()){if(this.object.isOrthographicCamera){const e=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,t=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;_j.x*=e,_j.y*=t}_j.multiplyScalar(this._eye.length()*this.panSpeed),yj.copy(this._eye).cross(this.object.up).setLength(_j.x),yj.add(vj.copy(this.object.up).setLength(_j.y)),this.object.position.add(yj),this.target.add(yj),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(_j.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){Mj.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let e=Mj.length();e?(this._eye.copy(this.object.position).sub(this.target),wj.copy(this._eye).normalize(),Tj.copy(this.object.up).normalize(),Sj.crossVectors(Tj,wj).normalize(),Tj.setLength(this._moveCurr.y-this._movePrev.y),Sj.setLength(this._moveCurr.x-this._movePrev.x),Mj.copy(Tj.add(Sj)),xj.crossVectors(Mj,this._eye).normalize(),e*=this.rotateSpeed,bj.setFromAxisAngle(xj,e),this._eye.applyQuaternion(bj),this.object.up.applyQuaternion(bj),this._lastAxis.copy(xj),this._lastAngle=e):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),bj.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(bj),this.object.up.applyQuaternion(bj)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let e;4===this.state?(e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera&&(this.object.zoom=Qe.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix())):(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,1!==e&&e>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera&&(this.object.zoom=Qe.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix())),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(e,t){return gj.set((e-this.screen.left)/this.screen.width,(t-this.screen.top)/this.screen.height),gj}_getMouseOnCircle(e,t){return gj.set((e-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-t))/this.screen.width),gj}_addPointer(e){this._pointers.push(e)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId==e.pointerId)return void this._pointers.splice(t,1)}_trackPointer(e){let t=this._pointerPositions[e.pointerId];void 0===t&&(t=new Ye,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[t.pointerId]}_checkDistances(){this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function Cj(e){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(e),"touch"===e.pointerType?this._onTouchStart(e):this._onMouseDown(e))}function Rj(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchMove(e):this._onMouseMove(e))}function Nj(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchEnd(e):this._onMouseUp(),this._removePointer(e),0===this._pointers.length&&(this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function Pj(e){this._removePointer(e)}function Dj(){!1!==this.enabled&&(this.keyState=mj,window.addEventListener("keydown",this._onKeyDown))}function Lj(e){!1!==this.enabled&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===mj&&(e.code!==this.keys[0]||this.noRotate?e.code!==this.keys[1]||this.noZoom?e.code!==this.keys[2]||this.noPan||(this.keyState=2):this.keyState=1:this.keyState=0))}function Ij(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case 1:this.state=1;break;case 0:this.state=0;break;case 2:this.state=2;break;default:this.state=mj}const n=this.keyState!==mj?this.keyState:this.state;0!==n||this.noRotate?1!==n||this.noZoom?2!==n||this.noPan||(this._panStart.copy(this._getMouseOnScreen(e.pageX,e.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this._getMouseOnScreen(e.pageX,e.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr)),this.dispatchEvent(dj)}function Oj(e){const t=this.keyState!==mj?this.keyState:this.state;0!==t||this.noRotate?1!==t||this.noZoom?2!==t||this.noPan||this._panEnd.copy(this._getMouseOnScreen(e.pageX,e.pageY)):this._zoomEnd.copy(this._getMouseOnScreen(e.pageX,e.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)))}function Bj(){this.state=mj,this.dispatchEvent(pj)}function Uj(e){if(!1!==this.enabled&&!0!==this.noZoom){switch(e.preventDefault(),e.deltaMode){case 2:this._zoomStart.y-=.025*e.deltaY;break;case 1:this._zoomStart.y-=.01*e.deltaY;break;default:this._zoomStart.y-=25e-5*e.deltaY}this.dispatchEvent(dj),this.dispatchEvent(pj)}}function Fj(e){!1!==this.enabled&&e.preventDefault()}function kj(e){if(this._trackPointer(e),1===this._pointers.length)this.state=3,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);else{this.state=4;const e=this._pointers[0].pageX-this._pointers[1].pageX,t=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(e*e+t*t);const n=(this._pointers[0].pageX+this._pointers[1].pageX)/2,r=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(n,r)),this._panEnd.copy(this._panStart)}this.dispatchEvent(dj)}function qj(e){if(this._trackPointer(e),1===this._pointers.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY));else{const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y;this._touchZoomDistanceEnd=Math.sqrt(n*n+r*r);const i=(e.pageX+t.x)/2,s=(e.pageY+t.y)/2;this._panEnd.copy(this._getMouseOnScreen(i,s))}}function Vj(e){switch(this._pointers.length){case 0:this.state=mj;break;case 1:this.state=3,this._moveCurr.copy(this._getMouseOnCircle(e.pageX,e.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=4;for(let t=0;t<this._pointers.length;t++)if(this._pointers[t].pointerId!==e.pointerId){const e=this._pointerPositions[this._pointers[t].pointerId];this._moveCurr.copy(this._getMouseOnCircle(e.x,e.y)),this._movePrev.copy(this._moveCurr);break}}this.dispatchEvent(pj)}const zj={type:"change"},Gj={type:"start"},jj={type:"end"},Hj=new Yt,Wj=new Jr,Xj=Math.cos(70*Qe.DEG2RAD),Qj=new Ke,Yj=2*Math.PI,$j=-1,Kj=1e-6;class Zj extends va{constructor(e,t=null){super(e,t),this.state=$j,this.target=new Ke,this.cursor=new Ke,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=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.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:0,MIDDLE:1,RIGHT:2},this.touches={ONE:0,TWO:2},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new Ke,this._lastQuaternion=new $e,this._lastTargetPosition=new Ke,this._quat=(new $e).setFromUnitVectors(e.up,new Ke(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new pa,this._sphericalDelta=new pa,this._scale=1,this._panOffset=new Ke,this._rotateStart=new Ye,this._rotateEnd=new Ye,this._rotateDelta=new Ye,this._panStart=new Ye,this._panEnd=new Ye,this._panDelta=new Ye,this._dollyStart=new Ye,this._dollyEnd=new Ye,this._dollyDelta=new Ye,this._dollyDirection=new Ke,this._mouse=new Ye,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=eH.bind(this),this._onPointerDown=Jj.bind(this),this._onPointerUp=tH.bind(this),this._onContextMenu=lH.bind(this),this._onMouseWheel=iH.bind(this),this._onKeyDown=sH.bind(this),this._onTouchStart=aH.bind(this),this._onTouchMove=oH.bind(this),this._onMouseDown=nH.bind(this),this._onMouseMove=rH.bind(this),this._interceptControlDown=uH.bind(this),this._interceptControlUp=cH.bind(this),null!==this.domElement&&this.connect(this.domElement),this.update()}connect(e){super.connect(e),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(e){e.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=e}stopListenToKeyEvents(){null!==this._domElementKeyEvents&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(zj),this.update(),this.state=$j}update(e=null){const t=this.object.position;Qj.copy(t).sub(this.target),Qj.applyQuaternion(this._quat),this._spherical.setFromVector3(Qj),this.autoRotate&&this.state===$j&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let n=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(n)&&isFinite(r)&&(n<-Math.PI?n+=Yj:n>Math.PI&&(n-=Yj),r<-Math.PI?r+=Yj:r>Math.PI&&(r-=Yj),this._spherical.theta=n<=r?Math.max(n,Math.min(r,this._spherical.theta)):this._spherical.theta>(n+r)/2?Math.max(n,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),!0===this.enableDamping?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radiu
vendor: 24,449 bytes, line 1
1s=this._clampDistance(this._spherical.radius);else{const e=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=e!=this._spherical.radius}if(Qj.setFromSpherical(this._spherical),Qj.applyQuaternion(this._quatInverse),t.copy(this.target).add(Qj),this.object.lookAt(this.target),!0===this.enableDamping?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){const t=Qj.length();e=this._clampDistance(t*this._scale);const n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),i=!!n}else if(this.object.isOrthographicCamera){const t=new Ke(this._mouse.x,this._mouse.y,0);t.unproject(this.object);const n=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=n!==this.object.zoom;const r=new Ke(this._mouse.x,this._mouse.y,0);r.unproject(this.object),this.object.position.sub(r).add(t),this.object.updateMatrixWorld(),e=Qj.length()}else this.zoomToCursor=!1;null!==e&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Hj.origin.copy(this.object.position),Hj.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Hj.direction))<Xj?this.object.lookAt(this.target):(Wj.setFromNormalAndCoplanarPoint(this.object.up,this.target),Hj.intersectPlane(Wj,this.target))))}else if(this.object.isOrthographicCamera){const e=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),e!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,!!(i||this._lastPosition.distanceToSquared(this.object.position)>Kj||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Kj||this._lastTargetPosition.distanceToSquared(this.target)>Kj)&&(this.dispatchEvent(zj),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0)}_getAutoRotationAngle(e){return null!==e?Yj/60*this.autoRotateSpeed*e:Yj/60/60*this.autoRotateSpeed}_getZoomScale(e){const t=Math.abs(.01*e);return Math.pow(.95,this.zoomSpeed*t)}_rotateLeft(e){this._sphericalDelta.theta-=e}_rotateUp(e){this._sphericalDelta.phi-=e}_panLeft(e,t){Qj.setFromMatrixColumn(t,0),Qj.multiplyScalar(-e),this._panOffset.add(Qj)}_panUp(e,t){!0===this.screenSpacePanning?Qj.setFromMatrixColumn(t,1):(Qj.setFromMatrixColumn(t,0),Qj.crossVectors(this.object.up,Qj)),Qj.multiplyScalar(e),this._panOffset.add(Qj)}_pan(e,t){const n=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;Qj.copy(r).sub(this.target);let i=Qj.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*e*i/n.clientHeight,this.object.matrix),this._panUp(2*t*i/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(e*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(t*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):this.enablePan=!1}_dollyOut(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=e:this.enableZoom=!1}_dollyIn(e){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=e:this.enableZoom=!1}_updateZoomParameters(e,t){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),r=e-n.left,i=t-n.top,s=n.width,a=n.height;this._mouse.x=r/s*2-1,this._mouse.y=-i/a*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(e){return Math.max(this.minDistance,Math.min(this.maxDistance,e))}_handleMouseDownRotate(e){this._rotateStart.set(e.clientX,e.clientY)}_handleMouseDownDolly(e){this._updateZoomParameters(e.clientX,e.clientX),this._dollyStart.set(e.clientX,e.clientY)}_handleMouseDownPan(e){this._panStart.set(e.clientX,e.clientY)}_handleMouseMoveRotate(e){this._rotateEnd.set(e.clientX,e.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Yj*this._rotateDelta.x/t.clientHeight),this._rotateUp(Yj*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(e){this._dollyEnd.set(e.clientX,e.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(e){this._panEnd.set(e.clientX,e.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(e){this._updateZoomParameters(e.clientX,e.clientY),e.deltaY<0?this._dollyIn(this._getZoomScale(e.deltaY)):e.deltaY>0&&this._dollyOut(this._getZoomScale(e.deltaY)),this.update()}_handleKeyDown(e){let t=!1;switch(e.code){case this.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(Yj*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),t=!0;break;case this.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateUp(-Yj*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),t=!0;break;case this.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(Yj*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),t=!0;break;case this.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?this.enableRotate&&this._rotateLeft(-Yj*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),this.update())}_handleTouchStartRotate(e){if(1===this._pointers.length)this._rotateStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateStart.set(n,r)}}_handleTouchStartPan(e){if(1===this._pointers.length)this._panStart.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panStart.set(n,r)}}_handleTouchStartDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enablePan&&this._handleTouchStartPan(e)}_handleTouchStartDollyRotate(e){this.enableZoom&&this._handleTouchStartDolly(e),this.enableRotate&&this._handleTouchStartRotate(e)}_handleTouchMoveRotate(e){if(1==this._pointers.length)this._rotateEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._rotateEnd.set(n,r)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const t=this.domElement;this._rotateLeft(Yj*this._rotateDelta.x/t.clientHeight),this._rotateUp(Yj*this._rotateDelta.y/t.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(e){if(1===this._pointers.length)this._panEnd.set(e.pageX,e.pageY);else{const t=this._getSecondPointerPosition(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);this._panEnd.set(n,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(e){const t=this._getSecondPointerPosition(e),n=e.pageX-t.x,r=e.pageY-t.y,i=Math.sqrt(n*n+r*r);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);this._updateZoomParameters(s,a)}_handleTouchMoveDollyPan(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enablePan&&this._handleTouchMovePan(e)}_handleTouchMoveDollyRotate(e){this.enableZoom&&this._handleTouchMoveDolly(e),this.enableRotate&&this._handleTouchMoveRotate(e)}_addPointer(e){this._pointers.push(e.pointerId)}_removePointer(e){delete this._pointerPositions[e.pointerId];for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return void this._pointers.splice(t,1)}_isTrackingPointer(e){for(let t=0;t<this._pointers.length;t++)if(this._pointers[t]==e.pointerId)return!0;return!1}_trackPointer(e){let t=this._pointerPositions[e.pointerId];void 0===t&&(t=new Ye,this._pointerPositions[e.pointerId]=t),t.set(e.pageX,e.pageY)}_getSecondPointerPosition(e){const t=e.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[t]}_customWheelEvent(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return e.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function Jj(e){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(e.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._isTrackingPointer(e)||(this._addPointer(e),"touch"===e.pointerType?this._onTouchStart(e):this._onMouseDown(e)))}function eH(e){!1!==this.enabled&&("touch"===e.pointerType?this._onTouchMove(e):this._onMouseMove(e))}function tH(e){switch(this._removePointer(e),this._pointers.length){case 0:this.domElement.releasePointerCapture(e.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(jj),this.state=$j;break;case 1:const t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y})}}function nH(e){let t;switch(e.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case 1:if(!1===this.enableZoom)return;this._handleMouseDownDolly(e),this.state=1;break;case 0:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=2}else{if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=0}break;case 2:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=0}else{if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=2}break;default:this.state=$j}this.state!==$j&&this.dispatchEvent(Gj)}function rH(e){switch(this.state){case 0:if(!1===this.enableRotate)return;this._handleMouseMoveRotate(e);break;case 1:if(!1===this.enableZoom)return;this._handleMouseMoveDolly(e);break;case 2:if(!1===this.enablePan)return;this._handleMouseMovePan(e)}}function iH(e){!1!==this.enabled&&!1!==this.enableZoom&&this.state===$j&&(e.preventDefault(),this.dispatchEvent(Gj),this._handleMouseWheel(this._customWheelEvent(e)),this.dispatchEvent(jj))}function sH(e){!1!==this.enabled&&this._handleKeyDown(e)}function aH(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case 0:if(!1===this.enableRotate)return;this._handleTouchStartRotate(e),this.state=3;break;case 1:if(!1===this.enablePan)return;this._handleTouchStartPan(e),this.state=4;break;default:this.state=$j}break;case 2:switch(this.touches.TWO){case 2:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchStartDollyPan(e),this.state=5;break;case 3:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchStartDollyRotate(e),this.state=6;break;default:this.state=$j}break;default:this.state=$j}this.state!==$j&&this.dispatchEvent(Gj)}function oH(e){switch(this._trackPointer(e),this.state){case 3:if(!1===this.enableRotate)return;this._handleTouchMoveRotate(e),this.update();break;case 4:if(!1===this.enablePan)return;this._handleTouchMovePan(e),this.update();break;case 5:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchMoveDollyPan(e),this.update();break;case 6:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchMoveDollyRotate(e),this.update();break;default:this.state=$j}}function lH(e){!1!==this.enabled&&e.preventDefault()}function uH(e){"Control"===e.key&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function cH(e){"Control"===e.key&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}const hH={type:"change"},AH=1e-6,dH=new $e;class pH extends va{constructor(e,t=null){super(e,t),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new Ke(0,0,0),this._rotationVector=new Ke(0,0,0),this._lastQuaternion=new $e,this._lastPosition=new Ke,this._status=0,this._onKeyDown=fH.bind(this),this._onKeyUp=mH.bind(this),this._onPointerMove=_H.bind(this),this._onPointerDown=gH.bind(this),this._onPointerUp=vH.bind(this),this._onPointerCancel=yH.bind(this),this._onContextMenu=xH.bind(this),null!==t&&this.connect(t)}connect(e){super.connect(e),window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(e){if(!1===this.enabled)return;const t=this.object,n=e*this.movementSpeed,r=e*this.rollSpeed;t.translateX(this._moveVector.x*n),t.translateY(this._moveVector.y*n),t.translateZ(this._moveVector.z*n),dH.set(this._rotationVector.x*r,this._rotationVector.y*r,this._rotationVector.z*r,1).normalize(),t.quaternion.multiply(dH),(this._lastPosition.distanceToSquared(t.position)>AH||8*(1-this._lastQuaternion.dot(t.quaternion))>AH)&&(this.dispatchEvent(hH),this._lastQuaternion.copy(t.quaternion),this._lastPosition.copy(t.position))}_updateMovementVector(){const e=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-e+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function fH(e){if(!e.altKey&&!1!==this.enabled){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1}this._updateMovementVector(),this._updateRotationVector()}}function mH(e){if(!1!==this.enabled){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0}this._updateMovementVector(),this._updateRotationVector()}}function gH(e){if(!1!==this.enabled)if(this.dragToLook)this._status++;else{switch(e.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1}this._updateMovementVector()}}function _H(e){if(!1!==this.enabled&&(!this.dragToLook||this._status>0)){const t=this._getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this._moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this._moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this._updateRotationVector()}}function vH(e){if(!1!==this.enabled){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(e.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0}this._updateMovementVector()}this._updateRotationVector()}}function yH(){!1!==this.enabled&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function xH(e){!1!==this.enabled&&e.preventDefault()}const bH={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class wH{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){}dispose(){}}const TH=new Js(-1,1,1,-1,0,1),SH=new class extends Ar{constructor(){super(),this.setAttribute("position",new ir([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new ir([0,2,0,0,2,0],2))}};class MH{constructor(e){this._mesh=new Tr(SH,e)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,TH)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class EH extends wH{constructor(e,t="tDiffuse"){super(),this.textureID=t,this.uniforms=null,this.material=null,e instanceof Pr?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=Nr.clone(e.uniforms),this.material=new Pr({name:void 0!==e.name?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this._fsQuad=new MH(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this._fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this._fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this._fsQuad.render(e))}dispose(){this.material.dispose(),this._fsQuad.dispose()}}class CH extends wH{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),i=e.state;let s,a;i.buffers.color.setMask(!1),i.buffers.depth.setMask(!1),i.buffers.color.setLocked(!0),i.buffers.depth.setLocked(!0),this.inverse?(s=0,a=1):(s=1,a=0),i.buffers.stencil.setTest(!0),i.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),i.buffers.stencil.setFunc(r.ALWAYS,s,4294967295),i.buffers.stencil.setClear(a),i.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),i.buffers.color.setLocked(!1),i.buffers.depth.setLocked(!1),i.buffers.color.setMask(!0),i.buffers.depth.setMask(!0),i.buffers.stencil.setLocked(!1),i.buffers.stencil.setFunc(r.EQUAL,1,4294967295),i.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),i.buffers.stencil.setLocked(!0)}}class RH extends wH{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class NH{constructor(e,t){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),void 0===t){const n=e.getSize(new Ye);this._width=n.width,this._height=n.height,(t=new xt(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:P})).texture.name="EffectComposer.rt1"}else this._width=t.width,this._height=t.height;this.renderTarget1=t,this.renderTarget2=t.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new EH(bH),this.copyPass.material.blending=0,this.clock=new la}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let t=0,r=this.passes.length;t<r;t++){const r=this.passes[t];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(t),r.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),r.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==CH&&(r instanceof CH?n=!0:r instanceof RH&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(e){if(void 0===e){const t=this.renderer.getSize(new Ye);this._pixelRatio=this.renderer.getPixelRatio(),this._width=t.width,this._height=t.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let e=0;e<this.passes.length;e++)this.passes[e].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class PH extends wH{constructor(e,t,n=null,r=null,i=null){super(),this.scene=e,this.camera=t,this.overrideMaterial=n,this.clearColor=r,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new Gn}render(e,t,n){const r=e.autoClear;let i,s;e.autoClear=!1,null!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor,e.getClearAlpha())),null!==this.clearAlpha&&
vendor: 4,585 bytes, line 1
1(i=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),null!==this.clearColor&&e.setClearColor(this._oldClearColor),null!==this.clearAlpha&&e.setClearAlpha(i),null!==this.overrideMaterial&&(this.scene.overrideMaterial=s),e.autoClear=r}}function DH(){return DH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DH.apply(null,arguments)}function LH(e,t){return LH=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},LH(e,t)}function IH(e){return IH=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},IH(e)}function OH(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(OH=function(){return!!e})()}function BH(e){var t="function"==typeof Map?new Map:void 0;return BH=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(OH())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&LH(i,n.prototype),i}(e,arguments,IH(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),LH(n,e)},BH(e)}var UH={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invali
1d argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function FH(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=t[0],s=[];for(r=1;r<t.length;r+=1)s.push(t[r]);
vendor: 2,464 bytes, line 1
1return s.forEach((function(e){i=i.replace(/%[a-z]/,e)})),i}var kH=function(e){function t(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];n=e.call(this,FH.apply(void 0,[UH[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,LH(e,t)}(t,e),t}(BH(Error));function qH(e){return Math.round(255*e)}function VH(e,t,n){return qH(e)+","+qH(t)+","+qH(n)}function zH(e,t,n,r){if(void 0===r&&(r=VH),0===t)return r(n,n,n);var i=(e%360+360)%360/60,s=(1-Math.abs(2*n-1))*t,a=s*(1-Math.abs(i%2-1)),o=0,l=0,u=0;i>=0&&i<1?(o=s,l=a):i>=1&&i<2?(o=a,l=s):i>=2&&i<3?(l=s,u=a):i>=3&&i<4?(l=a,u=s):i>=4&&i<5?(o=a,u=s):i>=5&&i<6&&(o=s,u=a);var c=n-s/2;return r(o+c,l+c,u+c)}var GH={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee9
10",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},jH=/^#[a-fA-F0-9]{6}$/,HH=/^#[a-fA-F0-9]{8}$/,WH=/^#[a-fA-F0-9]{3}$/,XH=/^#[a-fA-F0-9]{4}$/,QH=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,YH=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,$H=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,KH=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function ZH(e){if("string"!=typeof e)throw new kH(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return GH[t]?"#"+GH[t]:e}(e);if(t.match(jH))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(HH)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alph
vendor: 1,110 bytes, line 1
1a:n}}if(t.match(WH))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(XH)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var i=QH.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10)};var s=YH.exec(t.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var a=$H.exec(t);if(a){var o="rgb("+zH(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",l=QH.exec(o);if(!l)throw new kH(4,t,o);return{red:parseInt(""+l[1],10),green:parseInt(""+l[2],10),blue:parseInt(""+l[3],10)}}var u=KH.exec(t.substring(0,50));if(u){var c="rgb("+zH(parseInt(""+u[1],10),parseInt(""+u[2],10)/100,parseInt(""+u[3],10)/100)+")",h=QH.exec(c);if(!h)throw new kH(4,t,c);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alph
1a:parseFloat(""+u[4])>1?parseFloat(""+u[4])/100:parseFloat(""+u[4])}}throw new kH(5)}function JH(e){return function(e){var t,n=e.red/255,r=e.green/255,i=e.blue/255,s=Math.max(n,r,i),a=Math.min(n,r,i),o=(s+a)/2;if(s===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:o,alpha:e.alpha}:{hue:0,saturation:0,lightness:o};var l=s-a,u=o>.5?l/(2-s-a):l/(s+a);switch(s){case n:t=(r-i)/l+(r<i?6:0);break;case r:t=(i-n)/l+2;break;default:t=(n-r)/l+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:u,lightness:o,alpha:e.alpha}:{hue:t,saturation:u,lightness:o}}(ZH(e))}var eW=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function tW(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function nW(e){return tW(Math.round(255*e))}function rW(e,t,n){return eW("#"+nW(e)+nW(t)+nW(n))}function iW(e,t,n){return zH(e,t,n,rW)}function sW(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return eW("#"+tW(e)+tW(t)+tW(n));if("object"==typeof e&&void 0===t&&void 0===n)return eW("#"+tW(e.red)+tW(e.green)+tW(e.blue));throw new kH(6)}function aW(e,t,n,r){if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?sW(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new kH(7)}function oW(e){if("object"!=typeof e)throw new kH(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return aW(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return sW(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return function(e,t,n,r){if("object"==typeof e)return e.alpha>=1?iW(e.hue,e.saturation,e.lightness):"rgba("+zH(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new kH(2)}(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return function(e,t,n){if("object"==typeof e)return iW(e.hue,e.saturation,e.lightness);throw new kH(1)}(e);throw new kH(8)}function lW(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):lW(e,t,r)}}function uW(e){return lW(e,e.length,[])}function cW(e,t,n){return Math.max(e,Math.min(t,n))}uW((function(e,t){if("transparent"===t)return t;var n=JH(t);return oW(DH({},n,{hue:n.hue+parseFloat(e)}))})),uW((function(e,t){if("transparent"===t)return t;var n=JH(t);return oW(DH({},n,{lightness:cW(0,1,n.lightness-parseFloat(e))}))})),uW((function(e,t){if("transparent"===t)return t;var n=JH(t);return oW(DH({},n,{saturation:cW(0,1,n.saturation-parseFloat(e))}))})),uW((function(e,t){if("transparent"===t)return t;var n=JH(t);return oW(DH({},n,{lightness:cW(0,1,n.lightness+parseFloat(e))}))}));var hW=uW((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=ZH(t),i=DH({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),s=ZH(n),a=DH({},s,{alpha:"number"==typeof s.alpha?s.alpha:1}),o=i.alpha-a.alpha,l=2*parseFloat(e)-1,u=((l*o==-1?l:l+o)/(1+l*o)+1)/2,c=1-u;return aW({red:Math.floor(i.red*u+a.red*c),green:Math.floor(i.green*u+a.green*c),blue:Math.floor(i.blue*u+a.blue*c),alpha:i.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})})),AW=hW,dW=uW((function(e,t){if("transparent"===t)return t;var n=ZH(t);return aW(DH({},n,{alpha:cW(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))})),pW=dW;uW((function(e,t){if("transparent"===t)return t;var n=JH(t);return oW(DH({},n,{saturation:cW(0,1,n.saturation+parseFloat(e))}))})),uW((function(e,t){return"transparent"===t?t:oW(DH({},JH(t),{hue:parseFloat(e)}))})),uW((function(e,t){return"transparent"===t?t:oW(DH({},JH(t),{lightness:parseFloat(e)}))})),uW((function(e,t){return"transparent"===t?t:oW(DH({},JH(t),{saturation:parseFloat(e)}))})),uW((function(e,t){return"transparent"===t?t:AW(parseFloat(e),"rgb(0, 0, 0)",t)})),uW((function(e,t){return"transparent"===t?t:AW(parseFloat(e),"rgb(255, 255, 255)",t)})),uW((function(e,t){if("transparent"===t)return t;var n=ZH(t);return aW(DH({}
vendor: 4,965 bytes, line 1
1,n,{alpha:cW(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));var fW="http://www.w3.org/1999/xhtml",mW={svg:"http://www.w3.org/2000/svg",xhtml:fW,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function gW(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),mW.hasOwnProperty(t)?{space:mW[t],local:e}:e}function _W(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fW&&t.documentElement.namespaceURI===fW?t.createElement(e):t.createElementNS(n,e)}}function vW(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function yW(e){var t=gW(e);return(t.local?vW:_W)(t)}function xW(){}function bW(e){return null==e?xW:function(){return this.querySelector(e)}}function wW(){return[]}function TW(e){return function(t){return t.matches(e)}}var SW=Array.prototype.find;function MW(){return this.firstElementChild}var EW=Array.prototype.filter;function CW(){return Array.from(this.children)}function RW(e){return new Array(e.length)}function NW(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function PW(e,t,n,r,i,s){for(var a,o=0,l=t.length,u=s.length;o<u;++o)(a=t[o])?(a.__data__=s[o],r[o]=a):n[o]=new NW(e,s[o]);for(;o<l;++o)(a=t[o])&&(i[o]=a)}function DW(e,t,n,r,i,s,a){var o,l,u,c=new Map,h=t.length,A=s.length,d=new Array(h);for(o=0;o<h;++o)(l=t[o])&&(d[o]=u=a.call(l,l.__data__,o,t)+"",c.has(u)?i[o]=l:c.set(u,l));for(o=0;o<A;++o)u=a.call(e,s[o],o,s)+"",(l=c.get(u))?(r[o]=l,l.__data__=s[o],c.delete(u)):n[o]=new NW(e,s[o]);for(o=0;o<h;++o)(l=t[o])&&c.get(d[o])===l&&(i[o]=l)}function LW(e){return e.__data__}function IW(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function OW(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function BW(e){return function(){this.removeAttribute(e)}}function UW(e){return function(){this.removeAttributeNS(e.space,e.local)}}function FW(e,t){return function(){this.setAttribute(e,t)}}function kW(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function qW(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function VW(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function zW(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function GW(e){return function(){this.style.removeProperty(e)}}function jW(e,t,n){return function(){this.style.setProperty(e,t,n)}}function HW(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function WW(e){return function(){delete this[e]}}function XW(e,t){return function(){this[e]=t}}function QW(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function YW(e){return e.trim().split(/^|\s+/)}function $W(e){return e.classList||new KW(e)}function KW(e){this._node=e,this._names=YW(e.getAttribute("class")||"")}function ZW(e,t){for(var n=$W(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function JW(e,t){for(var n=$W(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function eX(e){return function(){ZW(this,e)}}function tX(e){return function(){JW(this,e)}}function nX(e,t){return function(){(t.apply(this,arguments)?ZW:JW)(this,e)}}function rX(){this.textContent=""}function iX(e){return function(){this.textContent=e}}function sX(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function aX(){this.innerHTML=""}function oX(e){return function(){this.innerHTML=e}}function lX(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function uX(){this.nextSibling&&this.parentNode.appendChild(this)}function cX(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hX(){return null}function AX(){var e=this.parentNode;e&&e.removeChild(this)}function dX(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function pX(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function fX(e){return function(){var t=this.__on;if(t){for(var n,r=0,i=-1,s=t.length;r<s;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++i]=n:this.removeEventListener(n.type,n.listener,n.options);++i?t.length=i:delete this.__on}}}function mX(e,t,n){return function(){var r,i=this.__on,s=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(i)for(var a=0,o=i.length;a<o;++a)if((r=i[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=s,r.options=n),void(r.value=t);this.addEventListener(e.type,s,n),r={type:e.type,name:e.name,value:t,listener:s,options:n},i?i.push(r):this.__on=[r]}}
vendor: 6,479 bytes, line 1
1function gX(e,t,n){var r=zW(e),i=r.CustomEvent;"function"==typeof i?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function _X(e,t){return function(){return gX(this,e,t)}}function vX(e,t){return function(){return gX(this,e,t.apply(this,arguments))}}NW.prototype={constructor:NW,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},KW.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var yX=[null];function xX(e,t){this._groups=e,this._parents=t}xX.prototype={constructor:xX,select:function(e){"function"!=typeof e&&(e=bW(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s,a,o=t[i],l=o.length,u=r[i]=new Array(l),c=0;c<l;++c)(s=o[c])&&(a=e.call(s,s.__data__,c,o))&&("__data__"in s&&(a.__data__=s.__data__),u[c]=a);return new xX(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}(e):function(e){return null==e?wW:function(){return this.querySelectorAll(e)}}(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a,o=t[s],l=o.length,u=0;u<l;++u)(a=o[u])&&(r.push(e.call(a,a.__data__,u,o)),i.push(a));return new xX(r,i)},selectChild:function(e){return this.select(null==e?MW:function(e){return function(){return SW.call(this.children,e)}}("function"==typeof e?e:TW(e)))},selectChildren:function(e){return this.selectAll(null==e?CW:function(e){return function(){return EW.call(this.children,e)}}("function"==typeof e?e:TW(e)))},filter:function(e){"function"!=typeof e&&(e=function(e){return function(){return this.matches(e)}}(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s,a=t[i],o=a.length,l=r[i]=[],u=0;u<o;++u)(s=a[u])&&e.call(s,s.__data__,u,a)&&l.push(s);return new xX(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,LW);var n=t?DW:PW,r=this._parents,i=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var s=i.length,a=new Array(s),o=new Array(s),l=new Array(s),u=0;u<s;++u){var c=r[u],h=i[u],A=h.length,d=IW(e.call(c,c&&c.__data__,u,r)),p=d.length,f=o[u]=new Array(p),m=a[u]=new Array(p);n(c,h,f,m,l[u]=new Array(A),d,t);for(var g,_,v=0,y=0;v<p;++v)if(g=f[v]){for(v>=y&&(y=v+1);!(_=m[y])&&++y<p;);g._next=_||null}}return(a=new xX(a,r))._enter=o,a._exit=l,a},enter:function(){return new xX(this._enter||this._groups.map(RW),this._parents)},exit:function(){return new xX(this._exit||this._groups.map(RW),this._parents)},join:function(e,t,n){var r=this.enter(),i=this,s=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(i=t(i))&&(i=i.selection()),null==n?s.remove():n(s),r&&i?r.merge(i).order():i},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),o=new Array(i),l=0;l<a;++l)for(var u,c=n[l],h=r[l],A=c.length,d=o[l]=new Array(A),p=0;p<A;++p)(u=c[p]||h[p])&&(d[p]=u);for(;l<i;++l)o[l]=n[l];return new xX(o,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,i=e[t],s=i.length-1,a=i[s];--s>=0;)(r=i[s])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=OW);for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a,o=n[s],l=o.length,u=i[s]=new Array(l),c=0;c<l;++c)(a=o[c])&&(u[c]=a);u.sort(t)}return new xX(i,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i,s=t[n],a=0,o=s.length;a<o;++a)(i=s[a])&&e.call(i,i.__data__,a,s);return this},attr:function(e,t){var n=gW(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?UW:BW:"function"==typeof t?n.local?VW:qW:n.local?kW:FW)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?GW:"function"==typeof t?HW:jW)(e,t,null==n?"":n)):function(e,t){return e.style.getPropertyValue(t)||zW(e).getComputedStyle(e,null).getPropertyValue(t)}(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?WW:"function"==typeof t?QW:XW)(e,t)):this.node()[e]},classed:function(e,t){var n=YW(e+"");if(arguments.length<2){for(var r=$W(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof t?nX:t?eX:tX)(n,t))},text:function(e){return arguments.length?this.each(null==e?rX:("function"==typeof e?sX:iX)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?aX:("function"==typeof e?lX:oX)(e)):this.node().innerHTML},raise:function(){return this.each(uX)},lower:function(){return this.each(cX)},append:function(e){var t="function"==typeof e?e:yW(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:yW(e),r=null==t?hX:"function"==typeof t?t:bW(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(AX)},clone:function(e){return this.select(e?pX:dX)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,i,s=function(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}(e+""),a=s.length;
1if(!(arguments.length<2)){for(o=t?mX:fX,r=0;r<a;++r)this.each(o(s[r],t,n));return this}var o=this.node().__on;if(o)for(var l,u=0,c=o.length;u<c;++u)for(r=0,l=o[u];r<a;++r)if((i=s[r]).type===l.type&&i.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?vX:_X)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,i=e[t],s=0,a=i.length;s<a;++s)(r=i[s])&&(yield r)}};var bX,wX,TX,SX,MX,EX,CX,RX,NX,PX,DX,LX,IX={},OX=[],BX=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,UX=Array.isArray;function FX(e,t){for(var n in t)e[n]=t[n];return e}function kX(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function qX(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++TX:i,__i:-1,__u:0};return null==i&&null!=wX.vnode&&wX.vnode(s),s}function VX(e){return e.children}function zX(e,t){this.props=e,this.context=t}function GX(e,t){if(null==t)return e.__?GX(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?GX(e):null}function jX(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return jX(e)}}function HX(e){(!e.__d&&(e.__d=!0)&&MX.push(e)&&!WX.__r++||EX!=wX.debounceRendering)&&((EX=wX.debounceRendering)||CX)(WX)}function WX(){for(var e,t,n,r,i,s,a,o=1;MX.length;)MX.length>o&&MX.sort(RX),e=MX.shift(),o=MX.length,e.__d&&(n=void 0,i=(r=(t=e).__v).__e,s=[],a=[],t.__P&&((n=FX({},r)).__v=r.__v+1,wX.vnode&&wX.vnode(n),JX(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,s,null==i?GX(r):i,!!(32&r.__u),a),n.__v=r.__v,n.__.__k[n.__i]=n,eQ(s,n,a),n.__e!=i&&jX(n)));WX.__r=0}function XX(e,t,n,r,i,s,a,o,l,u,c){var h,A,d,p,f,m,g=r&&r.__k||OX,_=t.length;for(l=function(e,t,n,r,i){var s,a,o,l,u,c=n.length,h=c,A=0;for(e.__k=new Array(i),s=0;s<i;s++)null!=(a=t[s])&&"boolean"!=typeof a&&"function"!=typeof a?(l=s+A,(a=e.__k[s]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?qX(null,a,null,null,null):UX(a)?qX(VX,{children:a},null,null,null):null==a.constructor&&a.__b>0?qX(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,o=null,-1!=(u=a.__i=YX(a,n,l,h))&&(h--,(o=n[u])&&(o.__u|=2)),null==o||null==o.__v?(-1==u&&(i>c?A--:i<c&&A++),"function"!=typeof a.type&&(a.__u|=4)):u!=l&&(u==l-1?A--:u==l+1?A++:(u>l?A--:A++,a.__u|=4))):e.__k[s]=null;if(h)for(s=0;s<c;s++)null!=(o=n[s])&&!(2&o.__u)&&(o.__e==r&&(r=GX(o)),rQ(o,o));return r}(n,t,g,l,_),h=0;h<_;h++)null!=(d=n.__k[h])&&(A=-1==d.__i?IX:g[d.__i]||IX,d.__i=h,m=JX(e,d,A,i,s,a,o,l,u,c),p=d.__e,d.ref&&A.ref!=d.ref&&(A.ref&&nQ(A.ref,null,d),c.push(d.ref,d.__c||p,d)),null==f&&null!=p&&(f=p),4&d.__u||A.__k===d.__k?l=QX(d,l,e):"function"==typeof d.type&&void 0!==m?l=m:p&&(l=p.nextSibling),d.__u&=-7);return n.__e=f,l}function QX(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=QX(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=GX(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function YX(e,t,n,r){var i,s,a=e.key,o=e.type,l=t[n];if(null===l&&null==e.key||l&&a==l.key&&o==l.type&&!(2&l.__u))return n;if(r>(null==l||2&l.__u?0:1))for(i=n-1,s=n+1;i>=0||s<t.length;){if(i>=0){if((l=t[i])&&!(2&l.__u)&&a==l.key&&o==l.type)return i;i--}if(s<t.length){if((l=t[s])&&!(2&l.__u)&&a==l.key&&o==l.type)return s;s++}}return-1}function $X(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||BX.test(t)?n:n+"px"}function KX(e,t,n,r,i){var s,a;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||$X(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||$X(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])s=t!=(t=t.replace(NX,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=PX,e.addEventListener(t,s?LX:DX,s)):e.removeEventListener(t,s?LX:DX,s);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function ZX(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=PX++;else if(t.t<n.u)return;return n(wX.event?wX.event(t):t)}}}function JX(e,t,n,r,i,s,a,o,l,u){var c,h,A,d,p,f,m,g,_,v,y,x,b,w,T,S,M,E=t.type;if(null!=t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[o=t.__e=n.__e]),(c=wX.__b)&&c(t);
vendor: 4,440 bytes, line 1
1e:if("function"==typeof E)try{if(g=t.props,_="prototype"in E&&E.prototype.render,v=(c=E.contextType)&&r[c.__c],y=c?v?v.props.value:c.__:r,n.__c?m=(h=t.__c=n.__c).__=h.__E:(_?t.__c=h=new E(g,y):(t.__c=h=new zX(g,y),h.constructor=E,h.render=iQ),v&&v.sub(h),h.props=g,h.state||(h.state={}),h.context=y,h.__n=r,A=h.__d=!0,h.__h=[],h._sb=[]),_&&null==h.__s&&(h.__s=h.state),_&&null!=E.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=FX({},h.__s)),FX(h.__s,E.getDerivedStateFromProps(g,h.__s))),d=h.props,p=h.state,h.__v=t,A)_&&null==E.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),_&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(_&&null==E.getDerivedStateFromProps&&g!==d&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,y),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,y)||t.__v==n.__v){for(t.__v!=n.__v&&(h.props=g,h.state=h.__s,h.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[],h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,y),_&&null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(d,p,f)}))}if(h.context=y,h.props=g,h.__P=e,h.__e=!1,b=wX.__r,w=0,_){for(h.state=h.__s,h.__d=!1,b&&b(t),c=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do{h.__d=!1,b&&b(t),c=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++w<25);h.state=h.__s,null!=h.getChildContext&&(r=FX(FX({},r),h.getChildContext())),_&&!A&&null!=h.getSnapshotBeforeUpdate&&(f=h.getSnapshotBeforeUpdate(d,p)),S=c,null!=c&&c.type===VX&&null==c.key&&(S=tQ(c.props.children)),o=XX(e,UX(S)?S:[S],t,n,r,i,s,a,o,l,u),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),m&&(h.__E=h.__=null)}catch(e){if(t.__v=null,l||null!=s)if(e.then){for(t.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;s[s.indexOf(o)]=null,t.__e=o}else for(M=s.length;M--;)kX(s[M]);else t.__e=n.__e,t.__k=n.__k;wX.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):o=t.__e=function(e,t,n,r,i,s,a,o,l){var u,c,h,A,d,p,f,m=n.props,g=t.props,_=t.type;if("svg"==_?i="http://www.w3.org/2000/svg":"math"==_?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=s)for(u=0;u<s.length;u++)if((d=s[u])&&"setAttribute"in d==!!_&&(_?d.localName==_:3==d.nodeType)){e=d,s[u]=null;break}if(null==e){if(null==_)return document.createTextNode(g);e=document.createElementNS(i,_,g.is&&g),o&&(wX.__m&&wX.__m(t,s),o=!1),s=null}if(null==_)m===g||o&&e.data==g||(e.data=g);else{if(s=s&&bX.call(e.childNodes),m=n.props||IX,!o&&null!=s)for(m={},u=0;u<e.attributes.length;u++)m[(d=e.attributes[u]).name]=d.value;for(u in m)if(d=m[u],"children"==u);else if("dangerouslySetInnerHTML"==u)h=d;else if(!(u in g)){if("value"==u&&"defaultValue"in g||"checked"==u&&"defaultChecked"in g)continue;KX(e,u,null,d,i)}for(u in g)d=g[u],"children"==u?A=d:"dangerouslySetInnerHTML"==u?c=d:"value"==u?p=d:"checked"==u?f=d:o&&"function"!=typeof d||m[u]===d||KX(e,u,d,m[u],i);if(c)o||h&&(c.__html==h.__html||c.__html==e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(h&&(e.innerHTML=""),XX("template"==t.type?e.content:e,UX(A)?A:[A],t,n,r,"foreignObject"==_?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:n.__k&&GX(n,0),o,l),null!=s)for(u=s.length;u--;)kX(s[u]);o||(u="value","progress"==_&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[u]||"progress"==_&&!p||"option"==_&&p!=m[u])&&KX(e,u,p,m[u],i),u="checked",null!=f&&f!=e[u]&&KX(e,u,f,m[u],i))}return e}(n.__e,t,n,r,i,s,a,l,u);return(c=wX.diffed)&&c(t),128&t.__u?void 0:o}function eQ(e,t,n){for(var r=0;r<n.length;r++)nQ(n[r],n[++r],n[++r]);wX.__c&&wX.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){wX.__e(e,t.__v)}}))}function tQ(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:UX(e)?e.map(tQ):FX({},e)}function nQ(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){wX.__e(e,n)}}function rQ(e,t,n){var r,i;if(wX.unmount&&wX.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||nQ(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){wX.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&rQ(r[i],t,n||"function"!=typeof e.type);n||kX(e.__e),e.__c=e.__=e.__e=void 0}
vendor: 2,982 bytes, line 1
1function iQ(e,t,n){return this.constructor(e,n)}function sQ(e,t,n){var r,i,s,a,o=FX({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==s?r=t[s]:"ref"==s?i=t[s]:o[s]=void 0===t[s]&&null!=a?a[s]:t[s];return arguments.length>2&&(o.children=arguments.length>3?bX.call(arguments,2):n),qX(e.type,o,r||e.key,i||e.ref,null)}function aQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function oQ(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return aQ(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?aQ(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cQ(e){return cQ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cQ(e)}bX=OX.slice,wX={__e:function(e,t,n,r){for(var i,s,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},TX=0,SX=function(e){return null!=e&&null==e.constructor},zX.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=FX({},this.state),"function"==typeof e&&(e=e(FX({},n),this.props)),e&&FX(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),HX(this))},zX.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),HX(this))},zX.prototype.render=VX,MX=[],CX="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,RX=function(e,t){return e.__v.__b-t.__v.__b},WX.__r=0,NX=/(PointerCapture)$|Capture$/i,PX=0,DX=ZX(!1),LX=ZX(!0);var hQ=function(e){if("object"!==cQ(e))return e;var t,n=sQ(e);return n.props&&(n.props=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lQ(Object(n),!0).forEach((function(t){oQ(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lQ(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.props),null!=n&&null!==(t=n.props)&&void 0!==t&&t.children&&(n.props.children=Array.isArray(n.props.children)?n.props.children.map(hQ):hQ(n.props.children))),n};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".float-tooltip-kap {\n position: absolute;\n width: max-content; /* prevent shrinking near right edge */\n max-width: max(50%, 150px);\n padding: 3px 5px;\n border-radius: 3px;\n font: 12px sans-serif;\n color: #eee;\n background: rgba(0,0,0,0.6);\n pointer-events: none;\n}\n");var AQ=Pu({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).style,r=void 0===n?{}:n,i=function(e){return"string"==typeof e?new xX([[document.querySelector(e)]],[document.documentElement]):new xX([[e]],yX)}(e&&"object"===cQ(e)&&e.node&&"function"==typeof e.node?e.node():e);"static"===i.style("position")&&i.style("position","relative"),t.tooltipEl=i.append("div").attr("class","float-tooltip-kap"),Object.entries(r).forEach((function(e){var n=uQ(e,2),r=n[0],i=n[1];return t.tooltipEl.style(r,i)})),t.tooltipEl.style("left","-10000px").style("display","none");var s="tooltip-".concat(Math.round(1e12*Math.random()));t.mouseInside=!1,i.on("mousemove.".concat(s),(function(e){t.mouseInside=!0;var n=function(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}(e),r=i.node(),s=r.offsetWidth,a=r.offsetHeight,o=[null===t.offsetX||void 0===t.offsetX?"-".concat(n[0]/s*100,"%"):"number"==typeof t.offsetX?"calc(-50% + ".concat(t.offsetX,"px)"):t.offsetX,null===t.offsetY||void 0===t.offsetY?a>130&&a-n[1]<100?"calc(-100% - 6px)":"21px":"number"==typeof t.offsetY?t.offsetY<0?"calc(-100% - ".concat(Math.abs(t.offsetY),"px)"):"".concat(t.offsetY,"px"):t.offsetY];t.tooltipEl.style("left",n[0]+"px").style("top",n[1]+"px").style("transform","translate(".concat(o.join(","),")")),t.content&&t.tooltipEl.style("display","inline")})),i.on("mouseover.".concat(s),(function(){t.mouseInside=!0,t.content&&t.tooltipEl.style("display","inline")})),i.on("mouseout.".concat(s),(function(){t.mouseInside=!1,t.tooltipEl.style("display","none")}))},update:function(e){var t,n;e.tooltipEl.style("display",e.content&&e.mouseInside?"inline":"none"),e.content?e.content instanceof HTMLElement?(e.tooltipEl.text(""),e.tooltipEl.append((function(){return e.content}))):"string"==typeof e.content?e.tooltipEl.html(e.content):function(e){return SX(sQ(e))}(e.content)?(e.tooltipEl.text(""),t=e.content,delete(n=e.tooltipEl.node()).__k,function(e,t,n){var r,i,s;t==document&&(t=document.documentElement),wX.__&&wX.__(e,t),r=t.__k,i=[],s=[],JX(t,e=t.__k=function(e,t,n){var r,i,s,a={};for(s in t)"key"==s?r=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?bX.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return qX(e,a,r,i,null)}(VX,null,[e]),r||IX,IX,t.namespaceURI,r?null:t.firstChild?bX.call(t.childNodes):null,i,r?r.__e:t.firstChild,!1,s),eQ(i,e,s)}(hQ(t),n)):e.tooltipEl.style("display","none"):e.tooltipEl.text("")}});function dQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pQ(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s,a,o=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,0===t);else for(;!(l=(r=s.call(n)).done)&&(o.push(r.value),o.length!==t);l=!0);}catch(e){u=!0,i=e}
vendor: 5,363 bytes, line 1
1finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return o}}(e,t)||gQ(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mQ(e){return function(e){if(Array.isArray(e))return dQ(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||gQ(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gQ(e,t){if(e){if("string"==typeof e)return dQ(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dQ(e,t):void 0}}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if("undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".scene-nav-info {\n position: absolute;\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");var _Q=window.THREE?window.THREE:{WebGLRenderer:class{constructor(e={}){const{canvas:t=it(),context:n=null,depth:r=!0,stencil:i=!1,alpha:s=!1,antialias:a=!1,premultipliedAlpha:o=!0,preserveDrawingBuffer:l=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:c=!1,reverseDepthBuffer:h=!1}=e;let A;if(this.isWebGLRenderer=!0,null!==n){if("undefined"!=typeof WebGLRenderingContext&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");A=n.getContextAttributes().alpha}else A=s;const d=new Uint32Array(4),p=new Int32Array(4);let f=null,m=null;const g=[],_=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=0,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const v=this;let y=!1;this._outputColorSpace=Se;let x=0,b=0,S=null,M=-1,C=null;const N=new vt,O=new vt;let B=null;const U=new Gn(0);let F=0,k=t.width,q=t.height,V=1,G=null,W=null;const X=new vt(0,0,k,q),Q=new vt(0,0,k,q);let Y=!1;const $=new ni;let K=!1,Z=!1;const J=new $t,ee=new $t,te=new Ke,ne=new vt,re={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let ie=!1;function se(){return null===S?V:1}let ae,oe,le,ue,ce,he,Ae,de,pe,fe,me,ge,_e,ve,ye,xe,be,we,Te,Ee,Ce,Re,Ne,Pe,De=n;function Le(e,n){return t.getContext(e,n)}try{const e={alpha:!0,depth:r,stencil:i,antialias:a,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:u,failIfMajorPerformanceCaveat:c};if("setAttribute"in t&&t.setAttribute("data-engine","three.js r177"),t.addEventListener("webglcontextlost",Be,!1),t.addEventListener("webglcontextrestored",Ue,!1),t.addEventListener("webglcontextcreationerror",Fe,!1),null===De){const t="webgl2";if(De=Le(t,e),null===De)throw Le(t)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(e){throw e}function Ie(){ae=new Za(De),ae.init(),Re=new Ql(De,ae),oe=new Da(De,ae,e,Re),le=new Wl(De,ae),oe.reverseDepthBuffer&&h&&le.buffers.depth.setReversed(!0),ue=new to(De),ce=new Ll,he=new Xl(De,ae,le,ce,oe,Re,ue),Ae=new Ia(v),de=new Ka(v),pe=new ba(De),Ne=new Na(De,pe),fe=new Ja(De,pe,ue,Ne),me=new ro(De,fe,pe,ue),Te=new no(De,oe,he),xe=new La(ce),ge=new Dl(v,Ae,de,ae,oe,Ne,xe),_e=new Jl(v,ce),ve=new Ul,ye=new Gl(ae),we=new Ra(v,Ae,de,le,me,A,o),be=new jl(v,me,oe),Pe=new eu(De,ue,oe,le),Ee=new Pa(De,ae,ue),Ce=new eo(De,ae,ue),ue.programs=ge.programs,v.capabilities=oe,v.extensions=ae,v.properties=ce,v.renderLists=ve,v.shadowMap=be,v.state=le,v.info=ue}Ie();const Oe=new $l(v,De);function Be(e){e.preventDefault(),y=!0}function Ue(){y=!1;const e=ue.autoReset,t=be.enabled,n=be.autoUpdate,r=be.needsUpdate,i=be.type;Ie(),ue.autoReset=e,be.enabled=t,be.autoUpdate=n,be.needsUpdate=r,be.type=i}function Fe(e){}function ke(e){const t=e.target;t.removeEventListener("dispose",ke),function(e){(function(e){const t=ce.get(e).programs;void 0!==t&&(t.forEach((function(e){ge.releaseProgram(e)})),e.isShaderMaterial&&ge.releaseShaderCache(e))})(e),ce.remove(e)}(t)}function qe(e,t,n){!0===e.transparent&&2===e.side&&!1===e.forceSinglePass?(e.side=1,e.needsUpdate=!0,$e(e,t,n),e.side=0,e.needsUpdate=!0,$e(e,t,n),e.side=2):$e(e,t,n)}this.xr=Oe,this.getContext=function(){return De},this.getContextAttributes=function(){return De.getContextAttributes()},this.forceContextLoss=function(){const e=ae.get("WEBGL_lose_context");e&&e.loseContext()},this.forceContextRestore=function(){const e=ae.get("WEBGL_lose_context");e&&e.restoreContext()},this.getPixelRatio=function(){return V},this.setPixelRatio=function(e){void 0!==e&&(V=e,this.setSize(k,q,!1))}
vendor: 1,519 bytes, line 1
1,this.getSize=function(e){return e.set(k,q)},this.setSize=function(e,n,r=!0){Oe.isPresenting||(k=e,q=n,t.width=Math.floor(e*V),t.height=Math.floor(n*V),!0===r&&(t.style.width=e+"px",t.style.height=n+"px"),this.setViewport(0,0,e,n))},this.getDrawingBufferSize=function(e){return e.set(k*V,q*V).floor()},this.setDrawingBufferSize=function(e,n,r){k=e,q=n,V=r,t.width=Math.floor(e*r),t.height=Math.floor(n*r),this.setViewport(0,0,e,n)},this.getCurrentViewport=function(e){return e.copy(N)},this.getViewport=function(e){return e.copy(X)},this.setViewport=function(e,t,n,r){e.isVector4?X.set(e.x,e.y,e.z,e.w):X.set(e,t,n,r),le.viewport(N.copy(X).multiplyScalar(V).round())},this.getScissor=function(e){return e.copy(Q)},this.setScissor=function(e,t,n,r){e.isVector4?Q.set(e.x,e.y,e.z,e.w):Q.set(e,t,n,r),le.scissor(O.copy(Q).multiplyScalar(V).round())},this.getScissorTest=function(){return Y},this.setScissorTest=function(e){le.setScissorTest(Y=e)},this.setOpaqueSort=function(e){G=e},this.setTransparentSort=function(e){W=e},this.getClearColor=function(e){return e.copy(we.getClearColor())},this.setClearColor=function(){we.setClearColor(...arguments)},this.getClearAlpha=function(){return we.getClearAlpha()},this.setClearAlpha=function(){we.setClearAlpha(...arguments)},this.clear=function(e=!0,t=!0,n=!0){let r=0;if(e){let e=!1;if(null!==S){const t=S.texture.format;e=t===H||t===j||t===z}if(e){const e=S.texture.type,t=e===T||e===R||e===E||e===I||e===D||e===L,n=we.getClearColor(),r=we.getClearAlpha(),i=n.r,s=n.g,a=n.b;
vendor: 2,119 bytes, line 1
1t?(d[0]=i,d[1]=s,d[2]=a,d[3]=r,De.clearBufferuiv(De.COLOR,0,d)):(p[0]=i,p[1]=s,p[2]=a,p[3]=r,De.clearBufferiv(De.COLOR,0,p))}else r|=De.COLOR_BUFFER_BIT}t&&(r|=De.DEPTH_BUFFER_BIT),n&&(r|=De.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),De.clear(r)},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(){t.removeEventListener("webglcontextlost",Be,!1),t.removeEventListener("webglcontextrestored",Ue,!1),t.removeEventListener("webglcontextcreationerror",Fe,!1),we.dispose(),ve.dispose(),ye.dispose(),ce.dispose(),Ae.dispose(),de.dispose(),me.dispose(),Ne.dispose(),Pe.dispose(),ge.dispose(),Oe.dispose(),Oe.removeEventListener("sessionstart",ze),Oe.removeEventListener("sessionend",Ge),je.stop()},this.renderBufferDirect=function(e,t,n,r,i,s){null===t&&(t=re);const a=i.isMesh&&i.matrixWorld.determinant()<0,o=function(e,t,n,r,i){!0!==t.isScene&&(t=re),he.resetTextureUnits();const s=t.fog,a=r.isMeshStandardMaterial?t.environment:null,o=null===S?v.outputColorSpace:!0===S.isXRRenderTarget?S.texture.colorSpace:Me,l=(r.isMeshStandardMaterial?de:Ae).get(r.envMap||a),u=!0===r.vertexColors&&!!n.attributes.color&&4===n.attributes.color.itemSize,c=!!n.attributes.tangent&&(!!r.normalMap||r.anisotropy>0),h=!!n.morphAttributes.position,A=!!n.morphAttributes.normal,d=!!n.morphAttributes.color;let p=0;r.toneMapped&&(null!==S&&!0!==S.isXRRenderTarget||(p=v.toneMapping));const f=n.morphAttributes.position||n.morphAttributes.normal||n.morphAttributes.color,g=void 0!==f?f.length:0,_=ce.get(r),y=m.state.lights;if(!0===K&&(!0===Z||e!==C)){const t=e===C&&r.id===M;xe.setState(r,e,t)}let x=!1;r.version===_.__version?_.needsLights&&_.lightsStateVersion!==y.state.version||_.outputColorSpace!==o||i.isBatchedMesh&&!1===_.batching?x=!0:i.isBatchedMesh||!0!==_.batching?i.isBatchedMesh&&!0===_.batchingColor&&null===i.colorTexture||i.isBatchedMesh&&!1===_.batchingColor&&null!==i.colorTexture||i.isInstancedMesh&&!1===_.instancing?x=!0:i.isInstancedMesh||!0!==_.instancing?i.isSkinnedMesh&&
vendor: 6,747 bytes, line 1
1!1===_.skinning?x=!0:i.isSkinnedMesh||!0!==_.skinning?i.isInstancedMesh&&!0===_.instancingColor&&null===i.instanceColor||i.isInstancedMesh&&!1===_.instancingColor&&null!==i.instanceColor||i.isInstancedMesh&&!0===_.instancingMorph&&null===i.morphTexture||i.isInstancedMesh&&!1===_.instancingMorph&&null!==i.morphTexture||_.envMap!==l||!0===r.fog&&_.fog!==s?x=!0:void 0===_.numClippingPlanes||_.numClippingPlanes===xe.numPlanes&&_.numIntersection===xe.numIntersection?(_.vertexAlphas!==u||_.vertexTangents!==c||_.morphTargets!==h||_.morphNormals!==A||_.morphColors!==d||_.toneMapping!==p||_.morphTargetsCount!==g)&&(x=!0):x=!0:x=!0:x=!0:x=!0:(x=!0,_.__version=r.version);let b=_.currentProgram;!0===x&&(b=$e(r,t,i));let w=!1,T=!1,E=!1;const R=b.getUniforms(),N=_.uniforms;if(le.useProgram(b.program)&&(w=!0,T=!0,E=!0),r.id!==M&&(M=r.id,T=!0),w||C!==e){le.buffers.depth.getReversed()?(J.copy(e.projectionMatrix),function(e){const t=e.elements;t[2]=.5*t[2]+.5*t[3],t[6]=.5*t[6]+.5*t[7],t[10]=.5*t[10]+.5*t[11],t[14]=.5*t[14]+.5*t[15]}(J),function(e){const t=e.elements;-1===t[11]?(t[10]=-t[10]-1,t[14]=-t[14]):(t[10]=-t[10],t[14]=1-t[14])}(J),R.setValue(De,"projectionMatrix",J)):R.setValue(De,"projectionMatrix",e.projectionMatrix),R.setValue(De,"viewMatrix",e.matrixWorldInverse);const t=R.map.cameraPosition;void 0!==t&&t.setValue(De,te.setFromMatrixPosition(e.matrixWorld)),oe.logarithmicDepthBuffer&&R.setValue(De,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),(r.isMeshPhongMaterial||r.isMeshToonMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial)&&R.setValue(De,"isOrthographic",!0===e.isOrthographicCamera),C!==e&&(C=e,T=!0,E=!0)}if(i.isSkinnedMesh){R.setOptional(De,i,"bindMatrix"),R.setOptional(De,i,"bindMatrixInverse");const e=i.skeleton;e&&(null===e.boneTexture&&e.computeBoneTexture(),R.setValue(De,"boneTexture",e.boneTexture,he))}i.isBatchedMesh&&(R.setOptional(De,i,"batchingTexture"),R.setValue(De,"batchingTexture",i._matricesTexture,he),R.setOptional(De,i,"batchingIdTexture"),R.setValue(De,"batchingIdTexture",i._indirectTexture,he),R.setOptional(De,i,"batchingColorTexture"),null!==i._colorsTexture&&R.setValue(De,"batchingColorTexture",i._colorsTexture,he));const P=n.morphAttributes;if(void 0===P.position&&void 0===P.normal&&void 0===P.color||Te.update(i,n,b),(T||_.receiveShadow!==i.receiveShadow)&&(_.receiveShadow=i.receiveShadow,R.setValue(De,"receiveShadow",i.receiveShadow)),r.isMeshGouraudMaterial&&null!==r.envMap&&(N.envMap.value=l,N.flipEnvMap.value=l.isCubeTexture&&!1===l.isRenderTargetTexture?-1:1),r.isMeshStandardMaterial&&null===r.envMap&&null!==t.environment&&(N.envMapIntensity.value=t.environmentIntensity),T&&(R.setValue(De,"toneMappingExposure",v.toneMappingExposure),_.needsLights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.lightProbe.needsUpdate=t,e.directionalLights.needsUpdate=t,e.directionalLightShadows.needsUpdate=t,e.pointLights.needsUpdate=t,e.pointLightShadows.needsUpdate=t,e.spotLights.needsUpdate=t,e.spotLightShadows.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(N,E),s&&!0===r.fog&&_e.refreshFogUniforms(N,s),_e.refreshMaterialUniforms(N,r,V,q,m.state.transmissionRenderTarget[e.id]),ul.upload(De,Ze(_),N,he)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(ul.upload(De,Ze(_),N,he),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&R.setValue(De,"center",i.center),R.setValue(De,"modelViewMatrix",i.modelViewMatrix),R.setValue(De,"normalMatrix",i.normalMatrix),R.setValue(De,"modelMatrix",i.matrixWorld),r.isShaderMaterial||r.isRawShaderMaterial){const e=r.uniformsGroups;for(let t=0,n=e.length;t<n;t++){const n=e[t];Pe.update(n,b),Pe.bind(n,b)}}return b}(e,t,n,r,i);le.setMaterial(r,a);let l=n.index,u=1;if(!0===r.wireframe){if(l=fe.getWireframeAttribute(n),void 0===l)return;u=2}const c=n.drawRange,h=n.attributes.position;let A=c.start*u,d=(c.start+c.count)*u;null!==s&&(A=Math.max(A,s.start*u),d=Math.min(d,(s.start+s.count)*u)),null!==l?(A=Math.max(A,0),d=Math.min(d,l.count)):null!=h&&(A=Math.max(A,0),d=Math.min(d,h.count));const p=d-A;if(p<0||p===1/0)return;let f;Ne.setup(i,r,o,n,l);let g=Ee;if(null!==l&&(f=pe.get(l),g=Ce,g.setIndex(f)),i.isMesh)!0===r.wireframe?(le.setLineWidth(r.wireframeLinewidth*se()),g.setMode(De.LINES)):g.setMode(De.TRIANGLES);else if(i.isLine){let e=r.linewidth;void 0===e&&(e=1),le.setLineWidth(e*se()),i.isLineSegments?g.setMode(De.LINES):i.isLineLoop?g.setMode(De.LINE_LOOP):g.setMode(De.LINE_STRIP)}else i.isPoints?g.setMode(De.POINTS):i.isSprite&&g.setMode(De.TRIANGLES);if(i.isBatchedMesh)if(null!==i._multiDrawInstances)at("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),g.renderMultiDrawInstances(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount,i._multiDrawInstances);else if(ae.get("WEBGL_multi_draw"))g.renderMultiDraw(i._multiDrawStarts,i._multiDrawCounts,i._multiDrawCount);else{const e=i._multiDrawStarts,t=i._multiDrawCounts,n=i._multiDrawCount,s=l?pe.get(l).bytesPerElement:1,a=ce.get(r).currentProgram.getUniforms();for(let r=0;r<n;r++)a.setValue(De,"_gl_DrawID",r),g.render(e[r]/s,t[r])}else if(i.isInstancedMesh)g.renderInstances(A,p,i.count);else if(n.isInstancedBufferGeometry){const e=void 0!==n._maxInstanceCount?n._maxInstanceCount:1/0,t=Math.min(n.instanceCount,e);g.renderInstances(A,p,t)}else g.render(A,p)},this.compile=function(e,t,n=null){null===n&&(n=e),m=ye.get(n),m.init(t),_.push(m),n.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),e!==n&&e.traverseVisible((function(e){e.isLight&&e.layers.test(t.layers)&&(m.pushLight(e),e.castShadow&&m.pushShadow(e))})),m.setupLights();const r=new Set;return e.traverse((function(e){if(!(e.isMesh||e.isPoints||e.isLine||e.isSprite))return;const t=e.material;if(t)if(Array.isArray(t))for(let i=0;i<t.length;i++){const s=t[i];qe(s,n,e),r.add(s)}else qe(t,n,e),r.add(t)})),m=_.pop(),r},this.compileAsync=function(e,t,n=null){const r=this.compile(e,t,n);return new Promise((t=>{function n(){r.forEach((function(e){ce.get(e).currentProgram.isReady()&&r.delete(e)})),0!==r.size?setTimeout(n,10):t(e)}null!==ae.get("KHR_parallel_shader_compile")?n():setTimeout(n,10)}))};let Ve=null;function ze(){je.stop()}function Ge(){je.start()}const je=new xa;function He(e,t,n,r){if(!1===e.visible)return;if(e.layers.test(t.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(t);else if(e.isLight)m.pushLight(e),e.castShadow&&m.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||$.intersectsSprite(e)){r&&ne.setFromMatrixPosition(e.matrixWorld).applyMatrix4(ee);const t=me.update(e),i=e.material;
vendor: 5,206 bytes, line 1
1i.visible&&f.push(e,t,i,n,ne.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(!e.frustumCulled||$.intersectsObject(e))){const t=me.update(e),i=e.material;if(r&&(void 0!==e.boundingSphere?(null===e.boundingSphere&&e.computeBoundingSphere(),ne.copy(e.boundingSphere.center)):(null===t.boundingSphere&&t.computeBoundingSphere(),ne.copy(t.boundingSphere.center)),ne.applyMatrix4(e.matrixWorld).applyMatrix4(ee)),Array.isArray(i)){const r=t.groups;for(let s=0,a=r.length;s<a;s++){const a=r[s],o=i[a.materialIndex];o&&o.visible&&f.push(e,t,o,n,ne.z,a)}}else i.visible&&f.push(e,t,i,n,ne.z,null)}const i=e.children;for(let e=0,s=i.length;e<s;e++)He(i[e],t,n,r)}function We(e,t,n,r){const i=e.opaque,s=e.transmissive,a=e.transparent;m.setupLightsView(n),!0===K&&xe.setGlobalState(v.clippingPlanes,n),r&&le.viewport(N.copy(r)),i.length>0&&Qe(i,t,n),s.length>0&&Qe(s,t,n),a.length>0&&Qe(a,t,n),le.buffers.depth.setTest(!0),le.buffers.depth.setMask(!0),le.buffers.color.setMask(!0),le.setPolygonOffset(!1)}function Xe(e,t,n,r){if(null!==(!0===n.isScene?n.overrideMaterial:null))return;void 0===m.state.transmissionRenderTarget[r.id]&&(m.state.transmissionRenderTarget[r.id]=new xt(1,1,{generateMipmaps:!0,type:ae.has("EXT_color_buffer_half_float")||ae.has("EXT_color_buffer_float")?P:T,minFilter:w,samples:4,stencilBuffer:i,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:ut.workingColorSpace}));const s=m.state.transmissionRenderTarget[r.id],a=r.viewport||N;s.setSize(a.z*v.transmissionResolutionScale,a.w*v.transmissionResolutionScale);const o=v.getRenderTarget();v.setRenderTarget(s),v.getClearColor(U),F=v.getClearAlpha(),F<1&&v.setClearColor(16777215,.5),v.clear(),ie&&we.render(n);const l=v.toneMapping;v.toneMapping=0;const u=r.viewport;if(void 0!==r.viewport&&(r.viewport=void 0),m.setupLightsView(r),!0===K&&xe.setGlobalState(v.clippingPlanes,r),Qe(e,n,r),he.updateMultisampleRenderTarget(s),he.updateRenderTargetMipmap(s),!1===ae.has("WEBGL_multisampled_render_to_texture")){let e=!1;for(let i=0,s=t.length;i<s;i++){const s=t[i],a=s.object,o=s.geometry,l=s.material,u=s.group;if(2===l.side&&a.layers.test(r.layers)){const t=l.side;l.side=1,l.needsUpdate=!0,Ye(a,n,r,o,l,u),l.side=t,l.needsUpdate=!0,e=!0}}!0===e&&(he.updateMultisampleRenderTarget(s),he.updateRenderTargetMipmap(s))}v.setRenderTarget(o),v.setClearColor(U,F),void 0!==u&&(r.viewport=u),v.toneMapping=l}function Qe(e,t,n){const r=!0===t.isScene?t.overrideMaterial:null;for(let i=0,s=e.length;i<s;i++){const s=e[i],a=s.object,o=s.geometry,l=s.group;let u=s.material;!0===u.allowOverride&&null!==r&&(u=r),a.layers.test(n.layers)&&Ye(a,t,n,o,u,l)}}function Ye(e,t,n,r,i,s){e.onBeforeRender(v,t,n,r,i,s),e.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,e.matrixWorld),e.normalMatrix.getNormalMatrix(e.modelViewMatrix),i.onBeforeRender(v,t,n,r,e,s),!0===i.transparent&&2===i.side&&!1===i.forceSinglePass?(i.side=1,i.needsUpdate=!0,v.renderBufferDirect(n,t,r,i,e,s),i.side=0,i.needsUpdate=!0,v.renderBufferDirect(n,t,r,i,e,s),i.side=2):v.renderBufferDirect(n,t,r,i,e,s),e.onAfterRender(v,t,n,r,i,s)}function $e(e,t,n){!0!==t.isScene&&(t=re);const r=ce.get(e),i=m.state.lights,s=m.state.shadowsArray,a=i.state.version,o=ge.getParameters(e,i.state,s,t,n),l=ge.getProgramCacheKey(o);let u=r.programs;r.environment=e.isMeshStandardMaterial?t.environment:null,r.fog=t.fog,r.envMap=(e.isMeshStandardMaterial?de:Ae).get(e.envMap||r.environment),r.envMapRotation=null!==r.environment&&null===e.envMap?t.environmentRotation:e.envMapRotation,void 0===u&&(e.addEventListener("dispose",ke),u=new Map,r.programs=u);let c=u.get(l);if(void 0!==c){if(r.currentProgram===c&&r.lightsStateVersion===a)return Je(e,o),c}else o.uniforms=ge.getUniforms(e),e.onBeforeCompile(o,v),c=ge.acquireProgram(o,l),u.set(l,c),r.uniforms=o.uniforms;const h=r.uniforms;return(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(h.clippingPlanes=xe.uniform),Je(e,o),r.needsLights=function(e){return e.isMeshLambertMaterial||e.isMeshToonMaterial||e.isMeshPhongMaterial||e.isMeshStandardMaterial||e.isShadowMaterial||e.isShaderMaterial&&!0===e.lights}(e),r.lightsStateVersion=a,r.needsLights&&(h.ambientLightColor.value=i.state.ambient,h.lightProbe.value=i.state.probe,h.directionalLights.value=i.state.directional,h.directionalLightShadows.value=i.state.directionalShadow,h.spotLights.value=i.state.spot,h.spotLightShadows.value=i.state.spotShadow,h.rectAreaLights.value=i.state.rectArea,h.ltc_1.value=i.state.rectAreaLTC1,h.ltc_2.value=i.state.rectAreaLTC2,h.pointLights.value=i.state.point,h.pointLightShadows.value=i.state.pointShadow,h.hemisphereLights.value=i.state.hemi,h.directionalShadowMap.value=i.state.directionalShadowMap,h.directionalShadowMatrix.value=i.state.directionalShadowMatrix,h.spotShadowMap.value=i.state.spotShadowMap,h.spotLightMatrix.value=i.state.spotLightMatrix,h.spotLightMap.value=i.state.spotLightMap,h.pointShadowMap.value=i.state.pointShadowMap,h.pointShadowMatrix.value=i.state.pointShadowMatrix),r.currentProgram=c,r.uniformsList=null,c}function Ze(e){if(null===e.uniformsList){const t=e.currentProgram.getUniforms();e.uniformsList=ul.seqWithValue(t.seq,e.uniforms)}return e.uniformsList}function Je(e,t){const n=ce.get(e);
vendor: 4,767 bytes, line 1
1n.outputColorSpace=t.outputColorSpace,n.batching=t.batching,n.batchingColor=t.batchingColor,n.instancing=t.instancing,n.instancingColor=t.instancingColor,n.instancingMorph=t.instancingMorph,n.skinning=t.skinning,n.morphTargets=t.morphTargets,n.morphNormals=t.morphNormals,n.morphColors=t.morphColors,n.morphTargetsCount=t.morphTargetsCount,n.numClippingPlanes=t.numClippingPlanes,n.numIntersection=t.numClipIntersection,n.vertexAlphas=t.vertexAlphas,n.vertexTangents=t.vertexTangents,n.toneMapping=t.toneMapping}je.setAnimationLoop((function(e){Ve&&Ve(e)})),"undefined"!=typeof self&&je.setContext(self),this.setAnimationLoop=function(e){Ve=e,Oe.setAnimationLoop(e),null===e?je.stop():je.start()},Oe.addEventListener("sessionstart",ze),Oe.addEventListener("sessionend",Ge),this.render=function(e,t){if(void 0!==t&&!0!==t.isCamera)return;if(!0===y)return;if(!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),!0===Oe.enabled&&!0===Oe.isPresenting&&(!0===Oe.cameraAutoUpdate&&Oe.updateCamera(t),t=Oe.getCamera()),!0===e.isScene&&e.onBeforeRender(v,e,t,S),m=ye.get(e,_.length),m.init(t),_.push(m),ee.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),$.setFromProjectionMatrix(ee),Z=this.localClippingEnabled,K=xe.init(this.clippingPlanes,Z),f=ve.get(e,g.length),f.init(),g.push(f),!0===Oe.enabled&&!0===Oe.isPresenting){const e=v.xr.getDepthSensingMesh();null!==e&&He(e,t,-1/0,v.sortObjects)}He(e,t,0,v.sortObjects),f.finish(),!0===v.sortObjects&&f.sort(G,W),ie=!1===Oe.enabled||!1===Oe.isPresenting||!1===Oe.hasDepthSensing(),ie&&we.addToRenderList(f,e),this.info.render.frame++,!0===K&&xe.beginShadows();const n=m.state.shadowsArray;be.render(n,e,t),!0===K&&xe.endShadows(),!0===this.info.autoReset&&this.info.reset();const r=f.opaque,i=f.transmissive;if(m.setupLights(),t.isArrayCamera){const n=t.cameras;if(i.length>0)for(let t=0,s=n.length;t<s;t++)Xe(r,i,e,n[t]);ie&&we.render(e);for(let t=0,r=n.length;t<r;t++){const r=n[t];We(f,e,r,r.viewport)}}else i.length>0&&Xe(r,i,e,t),ie&&we.render(e),We(f,e,t);null!==S&&0===b&&(he.updateMultisampleRenderTarget(S),he.updateRenderTargetMipmap(S)),!0===e.isScene&&e.onAfterRender(v,e,t),Ne.resetDefaultState(),M=-1,C=null,_.pop(),_.length>0?(m=_[_.length-1],!0===K&&xe.setGlobalState(v.clippingPlanes,m.state.camera)):m=null,g.pop(),f=g.length>0?g[g.length-1]:null},this.getActiveCubeFace=function(){return x},this.getActiveMipmapLevel=function(){return b},this.getRenderTarget=function(){return S},this.setRenderTargetTextures=function(e,t,n){const r=ce.get(e);r.__autoAllocateDepthBuffer=!1===e.resolveDepthBuffer,!1===r.__autoAllocateDepthBuffer&&(r.__useRenderToTexture=!1),ce.get(e.texture).__webglTexture=t,ce.get(e.depthTexture).__webglTexture=r.__autoAllocateDepthBuffer?void 0:n,r.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(e,t){const n=ce.get(e);n.__webglFramebuffer=t,n.__useDefaultFramebuffer=void 0===t};const et=De.createFramebuffer();this.setRenderTarget=function(e,t=0,n=0){S=e,x=t,b=n;let r=!0,i=null,s=!1,a=!1;if(e){const o=ce.get(e);if(void 0!==o.__useDefaultFramebuffer)le.bindFramebuffer(De.FRAMEBUFFER,null),r=!1;else if(void 0===o.__webglFramebuffer)he.setupRenderTarget(e);else if(o.__hasExternalTextures)he.rebindTextures(e,ce.get(e.texture).__webglTexture,ce.get(e.depthTexture).__webglTexture);else if(e.depthBuffer){const t=e.depthTexture;if(o.__boundDepthTexture!==t){if(null!==t&&ce.has(t)&&(e.width!==t.image.width||e.height!==t.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");he.setupDepthRenderbuffer(e)}}const l=e.texture;(l.isData3DTexture||l.isDataArrayTexture||l.isCompressedArrayTexture)&&(a=!0);const u=ce.get(e).__webglFramebuffer;e.isWebGLCubeRenderTarget?(i=Array.isArray(u[t])?u[t][n]:u[t],s=!0):i=e.samples>0&&!1===he.useMultisampledRTT(e)?ce.get(e).__webglMultisampledFramebuffer:Array.isArray(u)?u[n]:u,N.copy(e.viewport),O.copy(e.scissor),B=e.scissorTest}else N.copy(X).multiplyScalar(V).floor(),O.copy(Q).multiplyScalar(V).floor(),B=Y;if(0!==n&&(i=et),le.bindFramebuffer(De.FRAMEBUFFER,i)&&r&&le.drawBuffers(e,i),le.viewport(N),le.scissor(O),le.setScissorTest(B),s){const r=ce.get(e.texture);De.framebufferTexture2D(De.FRAMEBUFFER,De.COLOR_ATTACHMENT0,De.TEXTURE_CUBE_MAP_POSITIVE_X+t,r.__webglTexture,n)}else if(a){const r=ce.get(e.texture),i=t;De.framebufferTextureLayer(De.FRAMEBUFFER,De.COLOR_ATTACHMENT0,r.__webglTexture,n,i)}else if(null!==e&&0!==n){const t=ce.get(e.texture);De.framebufferTexture2D(De.FRAMEBUFFER,De.COLOR_ATTACHMENT0,De.TEXTURE_2D,t.__webglTexture,n)}M=-1},this.readRenderTargetPixels=function(e,t,n,r,i,s,a,o=0){if(!e||!e.isWebGLRenderTarget)return;let l=ce.get(e).__webglFramebuffer;
vendor: 6,856 bytes, line 1
1if(e.isWebGLCubeRenderTarget&&void 0!==a&&(l=l[a]),l){le.bindFramebuffer(De.FRAMEBUFFER,l);try{const a=e.textures[o],l=a.format,u=a.type;if(!oe.textureFormatReadable(l))return;if(!oe.textureTypeReadable(u))return;t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i&&(e.textures.length>1&&De.readBuffer(De.COLOR_ATTACHMENT0+o),De.readPixels(t,n,r,i,Re.convert(l),Re.convert(u),s))}finally{const e=null!==S?ce.get(S).__webglFramebuffer:null;le.bindFramebuffer(De.FRAMEBUFFER,e)}}},this.readRenderTargetPixelsAsync=async function(e,t,n,r,i,s,a,o=0){if(!e||!e.isWebGLRenderTarget)throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let l=ce.get(e).__webglFramebuffer;if(e.isWebGLCubeRenderTarget&&void 0!==a&&(l=l[a]),l){if(t>=0&&t<=e.width-r&&n>=0&&n<=e.height-i){le.bindFramebuffer(De.FRAMEBUFFER,l);const a=e.textures[o],u=a.format,c=a.type;if(!oe.textureFormatReadable(u))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!oe.textureTypeReadable(c))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const h=De.createBuffer();De.bindBuffer(De.PIXEL_PACK_BUFFER,h),De.bufferData(De.PIXEL_PACK_BUFFER,s.byteLength,De.STREAM_READ),e.textures.length>1&&De.readBuffer(De.COLOR_ATTACHMENT0+o),De.readPixels(t,n,r,i,Re.convert(u),Re.convert(c),0);const A=null!==S?ce.get(S).__webglFramebuffer:null;le.bindFramebuffer(De.FRAMEBUFFER,A);const d=De.fenceSync(De.SYNC_GPU_COMMANDS_COMPLETE,0);return De.flush(),await function(e,t,n){return new Promise((function(n,r){setTimeout((function i(){switch(e.clientWaitSync(t,e.SYNC_FLUSH_COMMANDS_BIT,0)){case e.WAIT_FAILED:r();break;case e.TIMEOUT_EXPIRED:setTimeout(i,4);break;default:n()}}),4)}))}(De,d),De.bindBuffer(De.PIXEL_PACK_BUFFER,h),De.getBufferSubData(De.PIXEL_PACK_BUFFER,0,s),De.deleteBuffer(h),De.deleteSync(d),s}throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")}},this.copyFramebufferToTexture=function(e,t=null,n=0){const r=Math.pow(2,-n),i=Math.floor(e.image.width*r),s=Math.floor(e.image.height*r),a=null!==t?t.x:0,o=null!==t?t.y:0;he.setTexture2D(e,0),De.copyTexSubImage2D(De.TEXTURE_2D,n,0,0,a,o,i,s),le.unbindTexture()};const tt=De.createFramebuffer(),nt=De.createFramebuffer();this.copyTextureToTexture=function(e,t,n=null,r=null,i=0,s=null){let a,o,l,u,c,h,A,d,p;null===s&&(0!==i?(at("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),s=i,i=0):s=0);const f=e.isCompressedTexture?e.mipmaps[s]:e.image;if(null!==n)a=n.max.x-n.min.x,o=n.max.y-n.min.y,l=n.isBox3?n.max.z-n.min.z:1,u=n.min.x,c=n.min.y,h=n.isBox3?n.min.z:0;else{const t=Math.pow(2,-i);a=Math.floor(f.width*t),o=Math.floor(f.height*t),l=e.isDataArrayTexture?f.depth:e.isData3DTexture?Math.floor(f.depth*t):1,u=0,c=0,h=0}null!==r?(A=r.x,d=r.y,p=r.z):(A=0,d=0,p=0);const m=Re.convert(t.format),g=Re.convert(t.type);let _;t.isData3DTexture?(he.setTexture3D(t,0),_=De.TEXTURE_3D):t.isDataArrayTexture||t.isCompressedArrayTexture?(he.setTexture2DArray(t,0),_=De.TEXTURE_2D_ARRAY):(he.setTexture2D(t,0),_=De.TEXTURE_2D),De.pixelStorei(De.UNPACK_FLIP_Y_WEBGL,t.flipY),De.pixelStorei(De.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),De.pixelStorei(De.UNPACK_ALIGNMENT,t.unpackAlignment);const v=De.getParameter(De.UNPACK_ROW_LENGTH),y=De.getParameter(De.UNPACK_IMAGE_HEIGHT),x=De.getParameter(De.UNPACK_SKIP_PIXELS),b=De.getParameter(De.UNPACK_SKIP_ROWS),w=De.getParameter(De.UNPACK_SKIP_IMAGES);De.pixelStorei(De.UNPACK_ROW_LENGTH,f.width),De.pixelStorei(De.UNPACK_IMAGE_HEIGHT,f.height),De.pixelStorei(De.UNPACK_SKIP_PIXELS,u),De.pixelStorei(De.UNPACK_SKIP_ROWS,c),De.pixelStorei(De.UNPACK_SKIP_IMAGES,h);const T=e.isDataArrayTexture||e.isData3DTexture,S=t.isDataArrayTexture||t.isData3DTexture;if(e.isDepthTexture){const n=ce.get(e),r=ce.get(t),f=ce.get(n.__renderTarget),m=ce.get(r.__renderTarget);le.bindFramebuffer(De.READ_FRAMEBUFFER,f.__webglFramebuffer),le.bindFramebuffer(De.DRAW_FRAMEBUFFER,m.__webglFramebuffer);for(let n=0;n<l;n++)T&&(De.framebufferTextureLayer(De.READ_FRAMEBUFFER,De.COLOR_ATTACHMENT0,ce.get(e).__webglTexture,i,h+n),De.framebufferTextureLayer(De.DRAW_FRAMEBUFFER,De.COLOR_ATTACHMENT0,ce.get(t).__webglTexture,s,p+n)),De.blitFramebuffer(u,c,a,o,A,d,a,o,De.DEPTH_BUFFER_BIT,De.NEAREST);le.bindFramebuffer(De.READ_FRAMEBUFFER,null),le.bindFramebuffer(De.DRAW_FRAMEBUFFER,null)}else if(0!==i||e.isRenderTargetTexture||ce.has(e)){const n=ce.get(e),r=ce.get(t);le.bindFramebuffer(De.READ_FRAMEBUFFER,tt),le.bindFramebuffer(De.DRAW_FRAMEBUFFER,nt);for(let e=0;e<l;e++)T?De.framebufferTextureLayer(De.READ_FRAMEBUFFER,De.COLOR_ATTACHMENT0,n.__webglTexture,i,h+e):De.framebufferTexture2D(De.READ_FRAMEBUFFER,De.COLOR_ATTACHMENT0,De.TEXTURE_2D,n.__webglTexture,i),S?De.framebufferTextureLayer(De.DRAW_FRAMEBUFFER,De.COLOR_ATTACHMENT0,r.__webglTexture,s,p+e):De.framebufferTexture2D(De.DRAW_FRAMEBUFFER,De.COLOR_ATTACHMENT0,De.TEXTURE_2D,r.__webglTexture,s),0!==i?De.blitFramebuffer(u,c,a,o,A,d,a,o,De.COLOR_BUFFER_BIT,De.NEAREST):S?De.copyTexSubImage3D(_,s,A,d,p+e,u,c,a,o):De.copyTexSubImage2D(_,s,A,d,u,c,a,o);le.bindFramebuffer(De.READ_FRAMEBUFFER,null),le.bindFramebuffer(De.DRAW_FRAMEBUFFER,null)}else S?e.isDataTexture||e.isData3DTexture?De.texSubImage3D(_,s,A,d,p,a,o,l,m,g,f.data):t.isCompressedArrayTexture?De.compressedTexSubImage3D(_,s,A,d,p,a,o,l,m,f.data):De.texSubImage3D(_,s,A,d,p,a,o,l,m,g,f):e.isDataTexture?De.texSubImage2D(De.TEXTURE_2D,s,A,d,a,o,m,g,f.data):e.isCompressedTexture?De.compressedTexSubImage2D(De.TEXTURE_2D,s,A,d,f.width,f.height,m,f.data):De.texSubImage2D(De.TEXTURE_2D,s,A,d,a,o,m,g,f);De.pixelStorei(De.UNPACK_ROW_LENGTH,v),De.pixelStorei(De.UNPACK_IMAGE_HEIGHT,y),De.pixelStorei(De.UNPACK_SKIP_PIXELS,x),De.pixelStorei(De.UNPACK_SKIP_ROWS,b),De.pixelStorei(De.UNPACK_SKIP_IMAGES,w),0===s&&t.generateMipmaps&&De.generateMipmap(_),le.unbindTexture()},this.copyTextureToTexture3D=function(e,t,n=null,r=null,i=0){return at('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(e,t,n,r,i)},this.initRenderTarget=function(e){void 0===ce.get(e).__webglFramebuffer&&he.setupRenderTarget(e)},this.initTexture=function(e){e.isCubeTexture?he.setTextureCube(e,0):e.isData3DTexture?he.setTexture3D(e,0):e.isDataArrayTexture||e.isCompressedArrayTexture?he.setTexture2DArray(e,0):he.setTexture2D(e,0),le.unbindTexture()},this.resetState=function(){x=0,b=0,S=null,le.reset(),Ne.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Oe}get outputColorSpace(){return this._outputColorSpace}
1set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=ut._getDrawingBufferColorSpace(e),t.unpackColorSpace=ut._getUnpackColorSpace()}},Scene:jr,PerspectiveCamera:Br,Raycaster:class{constructor(e,t,n=0,r=1/0){this.ray=new Yt(e,t),this.near=n,this.far=r,this.camera=null,this.layers=new ln,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera&&(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t)}setFromXRController(e){return ha.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(ha),this}intersectObject(e,t=!0,n=[]){return da(e,this,n,t),n.sort(Aa),n}intersectObjects(e,t=!0,n=[]){for(let r=0,i=e.length;r<i;r++)da(e[r],this,n,t);return n.sort(Aa),n}},SRGBColorSpace:Se,TextureLoader:ks,Vector2:Ye,Vector3:Ke,Box3:wt,Color:Gn,Mesh:Tr,SphereGeometry:Ms,MeshBasicMaterial:Xn,BackSide:1,Clock:la},vQ=Pu({props:{width:{default:window.innerWidth,onChange:function(e,t,n){isNaN(e)&&(t.width=n)}},height:{default:window.innerHeight,onChange:function(e,t,n){isNaN(e)&&(t.height=n)}},viewOffset:{default:[0,0]},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null,t.tooltip&&t.tooltip.content(null)},triggerUpdate:!1},pointerRaycasterThrottleMs:{default:50,triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},pointsHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised){e.controls.enabled&&e.controls.update&&e.controls.update(Math.min(1,e.clock.getDelta())),e.postProcessingComposer?e.postProcessingComposer.render():e.renderer.render(e.scene,e.camera),e.extraRenderers.forEach((function(t){return t.render(e.scene,e.camera)}));var t=+new Date;if(e.enablePointerInteraction&&t-e.lastRaycasterCheck>=e.pointerRaycasterThrottleMs){e.lastRaycasterCheck=t;var n=null;if(e.hoverDuringDrag||!e.isPointerDragging){var r=this.intersectingObjects(e.pointerPos.x,e.pointerPos.y);e.hoverOrderComparator&&r.sort((function(t,n){return e.hoverOrderComparator(t.object,n.object)}));var i=r.find((function(t){return e.hoverFilter(t.object)}))||null;n=i?i.object:null,e.intersection=i||null}n!==e.hoverObj&&(e.onHover(n,e.hoverObj,e.intersection),e.tooltip.content(n&&rm(e.tooltipContent)(n,e.intersection)||null),e.hoverObj=n)}e.tweenGroup.update()}return this},getPointerPos:function(e){var t=e.pointerPos;return{x:t.x,y:t.y}},cameraPosition:function(e,t,n,r){var i=e.camera;if(t&&e.initialised){var s=t,a=n||{x:0,y:0,z:0};if(r){var o=Object.assign({},i.position),l=h();e.tweenGroup.add(new Fu(o).to(s,r).easing(Du.Quadratic.Out).onUpdate(u).start()),e.tweenGroup.add(new Fu(l).to(a,r/3).easing(Du.Quadratic.Out).onUpdate(c).start())}else u(s),c(a);return this}return Object.assign({},i.position,{lookAt:h()});function u(e){var t=e.x,n=e.y,r=e.z;void 0!==t&&(i.position.x=t),void 0!==n&&(i.position.y=n),void 0!==r&&(i.position.z=r)}function c(t){var n=new _Q.Vector3(t.x,t.y,t.z);e.controls.target?e.controls.target=n:i.lookAt(n)}function h(){return Object.assign(new _Q.Vector3(0,0,-1e3).applyQuaternion(i.quaternion).add(i.position))}},zoomToFit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,i=new Array(r>3?r-3:0),s=3;s<r;s++)i[s-3]=arguments[s];return this.fitToBbox(this.getBbox.apply(this,i),t,n)},fitToBbox:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,i=e.camera;if(t){var s=new _Q.Vector3(0,0,0),a=2*Math.max.apply(Math,mQ(Object.entries(t).map((function(e){var t=fQ(e,2),n=t[0],r=t[1];return Math.max.apply(Math,mQ(r.map((function(e){return Math.abs(s[n]-e)}))))})))),o=(1-2*r/e.height)*i.fov,l=a/Math.atan(o*Math.PI/180),u=l/i.aspect,c=Math.max(l,u);if(c>0){var h=s.clone().sub(i.position).normalize().multiplyScalar(-c);this.cameraPosition(h,s,n)}}return this},getBbox:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},n=new _Q.Box3(new _Q.Vector3(0,0,0),new _Q.Vector3(0,0,0)),r=e.objects.filter(t);return r.length?(r.forEach((function(e){return n.expandByObject(e)})),Object.assign.apply(Object,mQ(["x","y","z"].map((function(e){return pQ({},e,[n.min[e],n.max[e]])}))))):null},getScreenCoords:function(e,t,n,r){var i=new _Q.Vector3(t,n,r);
1return i.project(this.camera()),{x:(i.x+1)*e.width/2,y:-(i.y-1)*e.height/2}},getSceneCoords:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=new _Q.Vector2(t/e.width*2-1,-n/e.height*2+1),s=new _Q.Raycaster;return s.setFromCamera(i,e.camera),Object.assign({},s.ray.at(r,new _Q.Vector3))},intersectingObjects:function(e,t,n){var r=new _Q.Vector2(t/e.width*2-1,-n/e.height*2+1),i=new _Q.Raycaster;return i.params.Line.threshold=e.lineHoverPrecision,i.params.Points.threshold=e.pointsHoverPrecision,i.setFromCamera(r,e.camera),i.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls}},stateInit:function(){return{scene:new _Q.Scene,camera:new _Q.PerspectiveCamera,clock:new _Q.Clock,tweenGroup:new Iu,lastRaycasterCheck:0}},init:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.controlType,i=void 0===r?"trackball":r,s=n.useWebGPU,a=void 0!==s&&s,o=n.rendererConfig,l=void 0===o?{}:o,u=n.extraRenderers,c=void 0===u?[]:u,h=n.waitForLoadComplete,A=void 0===h||h;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.tooltip=new AQ(t.container),t.pointerPos=new _Q.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(e){return t.container.addEventListener(e,(function(n){if("pointerdown"===e&&(t.isPointerPressed=!0),!t.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||t.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(e){return Math.abs(e)>1})))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var r=(i=t.container.getBoundingClientRect(),s=window.pageXOffset||document.documentElement.scrollLeft,a=window.pageYOffset||document.documentElement.scrollTop,{top:i.top+a,left:i.left+s});t.pointerPos.x=n.pageX-r.left,t.pointerPos.y=n.pageY-r.top}var i,s,a}),{passive:!0})})),t.container.addEventListener("pointerup",(function(e){t.isPointerPressed&&(t.isPointerPressed=!1,t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag)||requestAnimationFrame((function(){0===e.button&&t.onClick(t.hoverObj||null,e,t.intersection),2===e.button&&t.onRightClick&&t.onRightClick(t.hoverObj||null,e,t.intersection)})))}),{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",(function(e){t.onRightClick&&e.preventDefault()})),t.renderer=new(a?nV:_Q.WebGLRenderer)(Object.assign({antialias:!0,alpha:!0},l)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=c,t.extraRenderers.forEach((function(e){e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.pointerEvents="none",t.container.appendChild(e.domElement)})),t.postProcessingComposer=new NH(t.renderer),t.postProcessingComposer.addPass(new PH(t.scene,t.camera)),t.controls=new{trackball:Ej,orbit:Zj,fly:pH}[i](t.camera,t.renderer.domElement),"fly"===i&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",(function(){t.controlsEngaged=!0})),t.controls.addEventListener("change",(function(){t.controlsEngaged&&(t.controlsDragging=!0)})),t.controls.addEventListener("end",(function(){t.controlsEngaged=!1,t.controlsDragging=!1}))),[t.renderer,t.postProcessingComposer].concat(mQ(t.extraRenderers)).forEac
1h((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new _Q.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!A,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))){var n,r=e.width,i=e.height;e.container.style.width="".concat(r,"px"),e.container.style.height="".concat(i,"px"),[e.renderer,e.postProcessingComposer].concat(mQ(e.extraRenderers)).forEach((function(e){return e.setSize(r,i)})),e.camera.aspect=r/i;var s=e.viewOffset.slice(0,2);s.some((function(e){return e}))&&(n=e.camera).setViewOffset.apply(n,[r,i].concat(mQ(s),[r,i])),e.camera.updateProjectionMatrix()}if(t.hasOwnProperty("viewOffset")){var a,o=e.width,l=e.height,u=e.viewOffset.slice(0,2);u.some((function(e){return e}))?(a=e.camera).setViewOffset.apply(a,[o,l].concat(mQ(u),[o,l])):e.camera.clearViewOffset()}if(t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=Math.min(e.controls.maxDistance,e.skyRadius)),e.camera.far=2.5*e.skyRadius,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new _Q.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var c=ZH(e.backgroundColor).alpha;void 0===c&&(c=1),e.renderer.setClearColor(new _Q.Color(pW(1,e.backgroundColor)),c)}function h(){e.loadComplete=e.scene.visible=!0}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?(new _Q.TextureLoader).load(e.backgroundImageUrl,(function(t){t.colorSpace=_Q.SRGBColorSpace,e.skysphere.material=new _Q.MeshBasicMaterial({map:t,side:_Q.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&h()})):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&h())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("lights")&&((t.lights||[]).forEach((function(t){return e.scene.remove(t)})),e.lights.forEach((function(t){return e.scene.add(t)}))),t.hasOwnProperty("objects")&&((t.objects||[]).forEach((function(t){return e.scene.remove(t)})),e.objects.forEach((function(t){return e.scene.add(t)})))}});function yQ(e,t){var n=new t;return n._destructor&&n._destructor(),{linkProp:function(t){return{default:n[t](),onChange:function(n,r){r[e][t](n)},triggerUpdate:!1}},linkMethod:function(t){return function(n){for(var r=n[e],i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];var o=r[t].apply(r,s);return o===r?this:o}}}}var xQ=["rendererConfig","waitForGlobeReady"],bQ=r(r({},window.THREE?window.THREE:{AmbientLight:na,DirectionalLight:ta,Vector2:Ye,REVISION:s}),{},{CSS2DRenderer:class{constructor(e={}){const t=this;let n,r,i,s;const a={objects:new WeakMap},o=void 0!==e.element?e.element:document.createElement("div");function l(e){e.isCSS2DObject&&(e.element.style.display="none");for(let t=0,n=e.children.length;t<n;t++)l(e.children[t])}function u(e,n,r){if(!1!==e.visible){if(e.isCSS2DObject){tu.setFromMatrixPosition(e.matrixWorld),tu.applyMatrix4(ru);const l=tu.z>=-1&&tu.z<=1&&!0===e.layers.test(r.layers),u=e.element;u.style.display=!0===l?"":"none",!0===l&&(e.onBeforeRender(t,n,r),u.style.transform="translate("+-100*e.center.x+"%,"+-100*e.center.y+"%)translate("+(tu.x*i+i)+"px,"+(-tu.y*s+s)+"px)",u.parentNode!==o&&o.appendChild(u),e.onAfterRender(t,n,r));const h={distanceToCameraSquared:c(r,e)};a.objects.set(e,h)}for(let t=0,i=e.children.length;t<i;t++)u(e.children[t],n,r)}else l(e)}function c(e,t){return iu.setFromMatrixPosition(e.matrixWorld),su.setFromMatrixPosition(t.matrixWorld),iu.distanceToSquared(su)}o.style.overflow="hidden",this.domElement=o,this.getSize=function(){return{width:n,height:r}},this.render=function(e,t){!0===e.matrixWorldAutoUpdate&&e.updateMatrixWorld(),null===t.parent&&!0===t.matrixWorldAutoUpdate&&t.updateMatrixWorld(),nu.copy(t.matrixWorldInverse),ru.multiplyMatrices(t.projectionMatrix,nu),u(e,e,t),function(e){const t=function(e){const t=[];return e.traverseVisible((function(e){e.isCSS2DObject&&t.push(e)})),t}(e).sort((function(e,t){return e.renderOrder!==t.renderOrder?t.renderOrder-e.renderOrder:a.objects.get(e).distanceToCameraSquared-a.objects.get(t).distanceToCameraSquared})),n=t.length;for(let e=0,r=t.length;e<r;e++)t[e].element.style.zIndex=n-e}(e)},this.setSize=function(e,t){n=e,r=t,i=n/2,s=r/2,o.style.width=e+"px",o.style.height=t+"px"}}}}),wQ=yQ("globe",hj),TQ=Object.assign.apply(Object,i(["globeImageUrl","bumpImageUrl","globeTileEngineUrl","globeTileEngineMaxLevel","globeCurvatureResolution","showGlobe","showGraticules","showAtmosphere","atmosphereColor","atmosphereAltitude","onGlobeReady","pointsData","pointLat","pointLng","pointColor","pointAltitude","pointRadius","pointResolution","pointsMerge","pointsTransitionDuration","arcsData","arcStartLat","arcStartLng","arcEndLat","arcEndLng","arcColor","arcAltitude","arcAltitudeAutoScale","arcStroke","arcCurveResolution","arcCircularResolution","arcDashLength","arcDashGap","arcDashInitialGap","arcDashAnimateTime","arcsTransitionDuration","polygonsData","polygonGeoJsonGeometry","polygonCapColor","polygonCapMaterial","polygonSideColor","polygonSideMaterial","polygonStrokeColor","polygonAltitude","polygonCapCurvatureResolution","polygonsTransitionDuration","pathsData","pathPoints","pathPointLat","pathPointLng","pathPointAlt","pathResolution","pathColor","pathStroke","pathDashLength","pathDashGap","pathDashInitialGap","pathDashAnimateTime","pathTransitionDuration","heatmapsData","heatmapPoints","heatmapPointLat","heatmapPointLng","heatmapPointWeight","heatmapBandwidth","heatmapColorFn","heatmapColorSaturation","heatmapBaseAltitude","heatmapTopAltitude","heatmapsTransitionDuration","hexBinPointsData","hexBinPointLat","hexBinPointLng","hexBinPointWeight","hexBinRes
1olution","hexMargin","hexTopCurvatureResolution","hexTopColor","hexSideColor","hexAltitude","hexBinMerge","hexTransitionDuration","hexPolygonsData","hexPolygonGeoJsonGeometry","hexPolygonColor","hexPolygonAltitude","hexPolygonResolution","hexPolygonMargin","hexPolygonUseDots","hexPolygonCurvatureResolution","hexPolygonDotResolution","hexPolygonsTransitionDuration","tilesData","tileLat","tileLng","tileAltitude","tileWidth","tileHeight","tileUseGlobeProjection","tileMaterial","tileCurvatureResolution","tilesTransitionDuration","particlesData","particlesList","particleLat","particleLng","particleAltitude","particlesSize","particlesSizeAttenuation","particlesColor","particlesTexture","ringsData","ringLat","ringLng","ringAltitude","ringColor","ringResolution","ringMaxRadius","ringPropagationSpeed","ringRepeatPeriod","labelsData","labelLat","labelLng","labelAltitude","labelRotation","labelText","labelSize","labelTypeFace","labelColor","labelResolution","labelIncludeDot","labelDotRadius","labelDotOrientation","labelsTransitionDuration","htmlElementsData","htmlLat","htmlLng","htmlAltitude","htmlElement","htmlElementVisibilityModifier","htmlTransitionDuration","objectsData","objectLat","objectLng","objectAltitude","objectRotation","objectFacesSurface","objectThreeObject","customLayerData","customThreeObject","customThreeObjectUpdate"].map((function(e){return t({},e,wQ.linkProp(e))})))),SQ=Object.assign.apply(Object,i(["globeMaterial","getGlobeRadius","getCoords","toGeoCoords"].map((function(e){return t({},e,wQ.linkMethod(e))})))),MQ=yQ("renderObjs",vQ),EQ=Object.assign.apply(Object,i(["width","height","backgroundColor","backgroundImageUrl","enablePointerInteraction"].map((function(e){return t({},e,MQ.linkProp(e))})))),CQ=Object.assign.apply(Object,i(["lights","postProcessingComposer"].map((function(e){return t({},e,MQ.linkMethod(e))})))),RQ=Pu({props:r(r({onZoom:{triggerUpdate:!1},onGlobeClick:{triggerUpdate:!1},onGlobeRightClick:{triggerUpdate:!1},pointLabel:{default:"name",triggerUpdate:!1},onPointClick:{triggerUpdate:!1},onPointRightClick:{triggerUpdate:!1},onPointHover:{triggerUpdate:!1},arcLabel:{default:"name",triggerUpdate:!1},onArcClick:{triggerUpdate:!1},onArcRightClick:{triggerUpdate:!1},onArcHover:{triggerUpdate:!1},polygonLabel:{default:"name",triggerUpdate:!1},onPolygonClick:{triggerUpdate:!1},onPolygonRightClick:{triggerUpdate:!1},onPolygonHover:{triggerUpdate:!1},pathLabel:{default:"name",triggerUpdate:!1},onPathClick:{triggerUpdate:!1},onPathRightClick:{triggerUpdate:!1},onPathHover:{triggerUpdate:!1},onHeatmapClick:{triggerUpdate:!1},onHeatmapRightClick:{triggerUpdate:!1},onHeatmapHover:{triggerUpdate:!1},hexLabel:{triggerUpdate:!1},onHexClick:{triggerUpdate:!1},onHexRightClick:{triggerUpdate:!1},onHexHover:{triggerUpdate:!1},hexPolygonLabel:{triggerUpdate:!1},onHexPolygonClick:{triggerUpdate:!1},onHexPolygonRightClick:{triggerUpdate:!1},onHexPolygonHover:{triggerUpdate:!1},tileLabel:{default:"name",triggerUpdate:!1},onTileClick:{triggerUpdate:!1},onTileRightClick:{triggerUpdate:!1},onTileHover:{triggerUpdate:!1},particleLabel:{default:"name",triggerUpdate:!1},onParticleClick:{triggerUpdate:!1},onParticleRightClick:{triggerUpdate:!1},onParticleHover:{triggerUpdate:!1},labelLabel:{triggerUpdate:!1},onLabelClick:{triggerUpdate:!1},onLabelRightClick:{triggerUpdate:!1},onLabelHover:{triggerUpdate:!1},objectLabel:{default:"name",triggerUpdate:!1},onObjectClick:{triggerUpdate:!1},onObjectRightClick:{triggerUpdate:!1},onObjectHover:{triggerUpdate:!1},customLayerLabel:{default:"name",triggerUpdate:!1},onCustomLayerClick:{triggerUpdate:!1},onCustomLayerRightClick:{triggerUpdate:!1},onCustomLayerHover:{triggerUpdate:!1},pointerEventsFilter:{default:function(){return!0},triggerUpdate:!1},lineHoverPrecision:{default:.2,triggerUpdate:!1,onChange:function(e,t){t.renderObjs.lineHoverPrecision(e),t.renderObjs.pointsHoverPrecision(e)}},globeOffset:{default:[0,0],triggerUpdate:!1,onChange:function(e,t){return Array.isArray(e)&&2===e.length&&t.renderObjs.viewOffset(e.map((function(e){return-e})))}}},TQ),EQ),methods:r(r({pauseAnimation:function(e){var t;return null!==e.animationFrameRequestId&&(cancelAnimationFrame(e.animationFrameRequestId),e.animationFrameRequestId=null),null===(t=e.globe)||void 0===t||t.pauseAnimation(),this},resumeAnimation:function(e){var t;return null===e.animationFrameRequestId&&this._animationCycle(),null===(t=e.globe)||void 0===t||t.resumeAnimation(),this},_animationCycle:function(e){e.renderObjs.tick(),e.tweenGroup.update(),e.animationFrameRequestId=requestAnimationFrame(this._animationCycle)}
1,pointOfView:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.globe.toGeoCoords(e.renderObjs.cameraPosition());if(void 0===t.lat&&void 0===t.lng&&void 0===t.altitude)return r;var i=Object.assign({},r,t);if(["lat","lng","altitude"].forEach((function(e){return i[e]=+i[e]})),n){for(;r.lng-i.lng>180;)r.lng-=360;for(;r.lng-i.lng<-180;)r.lng+=360;e.tweenGroup.add(new Fu(r).to(i,n).easing(Du.Cubic.InOut).onUpdate(s).start())}else s(i);return this;function s(t){var n=t.lat,r=t.lng,i=t.altitude;e.renderObjs.cameraPosition(e.globe.getCoords(n,r,i)),e.globe.setPointOfView(e.renderObjs.camera())}},getScreenCoords:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=(t=e.globe).getCoords.apply(t,r);return e.renderObjs.getScreenCoords(s.x,s.y,s.z)},toGlobeCoords:function(e,t,n){var r=e.renderObjs.intersectingObjects(t,n).find((function(e){return"globe"===(e.object.__globeObjType||e.object.parent.__globeObjType)}));if(!r)return null;var i=e.globe.toGeoCoords(r.point);return{lat:i.lat,lng:i.lng}},scene:function(e){return e.renderObjs.scene()},camera:function(e){return e.renderObjs.camera()},renderer:function(e){return e.renderObjs.renderer()},controls:function(e){return e.renderObjs.controls()},_destructor:function(e){e.globe._destructor(),this.pauseAnimation(),this.pointsData([]),this.arcsData([]),this.polygonsData([]),this.pathsData([]),this.heatmapsData([]),this.hexBinPointsData([]),this.hexPolygonsData([]),this.tilesData([]),this.particlesData([]),this.labelsData([]),this.htmlElementsData([]),this.objectsData([]),this.customLayerData([])}},SQ),CQ),stateInit:function(e){var t=e.rendererConfig,n=e.waitForGlobeReady,i=void 0===n||n,s=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,xQ),a=new hj(r({waitForGlobeReady:i},s));return{globe:a,renderObjs:vQ({controlType:"orbit",rendererConfig:t,waitForLoadComplete:i,extraRenderers:[new bQ.CSS2DRenderer]}).skyRadius(500*a.getGlobeRadius()).showNavInfo(!1).objects([a]).lights([new bQ.AmbientLight(13421772,Math.PI),new bQ.DirectionalLight(16777215,.6*Math.PI)]),tweenGroup:new Iu}},init:function(e,t){var n=this;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.style.position="relative";var r=document.createElement("div");t.container.appendChild(r),t.renderObjs(r),t.globe.rendererSize(t.renderObjs.renderer().getSize(new bQ.Vector2)),this.pointOfView({altitude:2.5});var i=t.globe.getGlobeRadius(),s=t.renderObjs.controls();t.renderObjs.camera().near=.05,s.minDistance=i+Math.max(.001,1.1*t.renderObjs.camera().near),s.maxDistance=100*i,s.enablePan=!1,s.enableDamping=!0,s.dampingFactor=.1,s.rotateSpeed=.3,s.zoomSpeed=.3,s.zoomToCursor=!0,s.addEventListener("change",(function(){s.target.setScalar(0);var e=n.pointOfView();s.rotateSpeed=.3*e.altitude,s.zoomSpeed=.5*Math.sqrt(e.altitude),t.globe.setPointOfVie
1w(t.renderObjs.camera()),t.onZoom&&t.onZoom(e)}));var a=function(e){for(var t=e;t&&!t.hasOwnProperty("__globeObjType");)t=t.parent;return t},o={point:function(e){return e},arc:function(e){return e},polygon:function(e){return e.data},path:function(e){return e},heatmap:function(e){return e},hexbin:function(e){return e},hexPolygon:function(e){return e},tile:function(e){return e},particles:function(e,t){return!t||!t.hasOwnProperty("index")||e.length<=t.index?e:e[t.index]},label:function(e){return e},object:function(e){return e},custom:function(e){return e}};bQ.REVISION<155&&(t.renderObjs.renderer().useLegacyLights=!1),t.renderObjs.hoverFilter((function(e){var n=a(e);if(!n)return!1;var r=n.__globeObjType;if("globe"!==r&&!o.hasOwnProperty(r))return!1;var i=o.hasOwnProperty(r)&&n.__data?o[r](n.__data):null;return(!["points","hexBinPoints"].some((function(e){return e===r}))||!Array.isArray(i))&&t.pointerEventsFilter(n,i)})).tooltipContent((function(e,n){var r={point:t.pointLabel,arc:t.arcLabel,polygon:t.polygonLabel,path:t.pathLabel,hexbin:t.hexLabel,hexPolygon:t.hexPolygonLabel,tile:t.tileLabel,particles:t.particleLabel,label:t.labelLabel,object:t.objectLabel,custom:t.customLayerLabel},i=a(e),s=i&&i.__globeObjType;return i&&s&&r.hasOwnProperty(s)&&o.hasOwnProperty(s)&&rm(r[s])(o[s](i.__data,n))||""})).onHover((function(e,n,r){var i={point:t.onPointHover,arc:t.onArcHover,polygon:t.onPolygonHover,path:t.onPathHover,heatmap:t.onHeatmapHover,hexbin:t.onHexHover,hexPolygon:t.onHexPolygonHover,tile:t.onTileHover,particles:t.onParticleHover,label:t.onLabelHover,object:t.onObjectHover,custom:t.onCustomLayerHover},s={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,particles:t.onParticleClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},l=a(e);if(l&&!i.hasOwnProperty(l.__globeObjType)&&(l=null),l!==t.hoverObj){var u=t.hoverObj?t.hoverObj.__globeObjType:null,c=t.hoverData,h=l?l.__globeObjType:null,A=l?o[h](l.__data,r):null;u&&u!==h&&i[u]&&i[u](null,c||null),h&&i[h]&&i[h](A,u===h?c:null),t.renderObjs.renderer().domElement.classList[h&&s[h]?"add":"remove"]("clickable"),t.hoverObj=l,t.hoverData=A}})).onClick((function(e,r,i){if(e){var s={globe:t.onGlobeClick,point:t.onPointClick,arc:t.onArcClick,polygon:t.onPolygonClick,path:t.onPathClick,heatmap:t.onHeatmapClick,hexbin:t.onHexClick,hexPolygon:t.onHexPolygonClick,tile:t.onTileClick,particles:t.onParticleClick,label:t.onLabelClick,object:t.onObjectClick,custom:t.onCustomLayerClick},l=a(e),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var c=[r],h=null!=i&&i.isVector3?i:null==i?void 0:i.point;if("globe"===u){var A=n.toGeoCoords(h),d=A.lat,p=A.lng;c.unshift({lat:d,lng:p})}else c.push(n.toGeoCoords(h));o.hasOwnProperty(u)&&c.unshift(o[u](l.__data,i)),s[u].apply(s,c)}}})).onRightClick((function(e,r,i){if(e){var s={globe:t.onGlobeRightClick,point:t.onPointRightClick,arc:t.onArcRightClick,polygon:t.onPolygonRightClick,path:t.onPathRightClick,heatmap:t.onHeatmapRightClick,hexbin:t.onHexRightClick,hexPolygon:t.onHexPolygonRightClick,tile:t.onTileRightClick,particles:t.onParticleRightClick,label:t.onLabelRightClick,object:t.onObjectRightClick,custom:t.onCustomLayerRightClick},l=a(e),u=l.__globeObjType;if(l&&s.hasOwnProperty(u)&&s[u]){var c=[r],h=null!=i&&i.isVector3?i:null==i?void 0:i.point;if("globe"===u){var A=n.toGeoCoords(h),d=A.lat,p=A.lng;c.unshift({lat:d,lng:p})}else c.push(n.toGeoCoords(h));o.hasOwnProperty(u)&&c.unshift(o[u](l.__data,i)),s[u].apply(s,c)}}})),this._animationCycle()}});return RQ}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.