vendor: 25,568 bytes, lines 1-5
1(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(a){if(a.ep)return;a.ep=!0;const s=r(a);fetch(a.href,s)}})();/** 2 * @license 3 * Copyright 2010-2023 Three.js Authors 4 * SPDX-License-Identifier: MIT 5 */const SO="158",kp={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Hp={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o$=0,g3=1,l$=2,BW=1,c$=2,Zh=3,RA=0,fs=1,os=2,mA=0,yg=1,v3=2,_3=3,y3=4,h$=5,_f=100,u$=101,d$=102,E3=103,w3=104,A$=200,f$=201,p$=202,m$=203,$2=204,eD=205,g$=206,v$=207,_$=208,y$=209,E$=210,w$=211,b$=212,S$=213,C$=214,T$=0,M$=1,x$=2,KS=3,R$=4,B$=5,I$=6,D$=7,CO=0,P$=1,L$=2,gA=0,O$=1,N$=2,U$=3,F$=4,k$=5,IW=300,Xg=301,qg=302,tD=303,iD=304,FT=306,py=1e3,Ha=1001,rD=1002,Ua=1003,b3=1004,ZM=1005,pa=1006,H$=1007,Zg=1008,vA=1009,G$=1010,z$=1011,TO=1012,DW=1013,Xd=1014,rc=1015,yu=1016,PW=1017,LW=1018,Yf=1020,Q$=1021,ol=1023,V$=1024,W$=1025,Kf=1026,Jg=1027,OW=1028,NW=1029,j$=1030,UW=1031,FW=1033,JM=33776,$M=33777,ex=33778,tx=33779,S3=35840,C3=35841,T3=35842,M3=35843,Y$=36196,x3=37492,R3=37496,B3=37808,I3=37809,D3=37810,P3=37811,L3=37812,O3=37813,N3=37814,U3=37815,F3=37816,k3=37817,H3=37818,G3=37819,z3=37820,Q3=37821,ix=36492,V3=36494,W3=36495,K$=36283,j3=36284,Y3=36285,K3=36286,kW=3e3,Xf=3001,X$=3200,q$=3201,MO=0,Z$=1,Io="",Fa="srgb",fc="srgb-linear",xO="display-p3",kT="display-p3-linear",XS="linear",Ur="srgb",qS="rec709",ZS="p3",Gp=7680,X3=519,J$=512,$$=513,eee=514,tee=515,iee=516,ree=517,nee=518,aee=519,nD=35044,q3="300 es",aD=1035,Eu=2e3,JS=2001;class Tp{addEventListener(i,r){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[i]===void 0&&(n[i]=[]),n[i].indexOf(r)===-1&&n[i].push(r)}hasEventListener(i,r){if(this._listeners===void 0)return!1;const n=this._listeners;return n[i]!==void 0&&n[i].indexOf(r)!==-1}removeEventListener(i,r){if(this._listeners===void 0)return;const a=this._listeners[i];if(a!==void 0){const s=a.indexOf(r);s!==-1&&a.splice(s,1)}}dispatchEvent(i){if(this._listeners===void 0)return;const n=this._listeners[i.type];if(n!==void 0){i.target=this;const a=n.slice(0);for(let s=0,o=a.length;s<o;s++)a[s].call(this,i);i.target=null}}}const es=["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 Z3=1234567;const Eg=Math.PI/180,$g=180/Math.PI;function Bu(){const t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(es[t&255]+es[t>>8&255]+es[t>>16&255]+es[t>>24&255]+"-"+es[i&255]+es[i>>8&255]+"-"+es[i>>16&15|64]+es[i>>24&255]+"-"+es[r&63|128]+es[r>>8&255]+"-"+es[r>>16&255]+es[r>>24&255]+es[n&255]+es[n>>8&255]+es[n>>16&255]+es[n>>24&255]).toLowerCase()}function ma(t,i,r){return Math.max(i,Math.min(r,t))}function RO(t,i){return(t%i+i)%i}function see(t,i,r,n,a){return n+(t-i)*(a-n)/(r-i)}function oee(t,i,r){return t!==i?(r-t)/(i-t):0}function P_(t,i,r){return(1-r)*t+r*i}function lee(t,i,r,n){return P_(t,i,1-Math.exp(-r*n))}function cee(t,i=1){return i-Math.abs(RO(t,i*2)-i)}function hee(t,i,r){return t<=i?0:t>=r?1:(t=(t-i)/(r-i),t*t*(3-2*t))}function uee(t,i,r){return t<=i?0:t>=r?1:(t=(t-i)/(r-i),t*t*t*(t*(t*6-15)+10))}function dee(t,i){return t+Math.floor(Math.random()*(i-t+1))}function Aee(t,i){return t+Math.random()*(i-t)}function fee(t){return t*(.5-Math.random())}function pee(t){t!==void 0&&(Z3=t);let i=Z3+=1831565813;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296}function mee(t){return t*Eg}function gee(t){return t*$g}function sD(t){return(t&t-1)===0&&t!==0}function vee(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function $S(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function _ee(t,i,r,n,a){const s=Math.cos,o=Math.sin,l=s(r/2),c=o(r/2),h=s((i+n)/2),u=o((i+n)/2),d=s((i-n)/2),A=o((i-n)/2),f=s((n-i)/2),m=o((n-i)/2);switch(a){case"XYX":t.set(l*u,c*d,c*A,l*h);break;case"YZY":t.set(c*A,l*u,c*d,l*h);break;case"ZXZ":t.set(c*d,c*A,l*u,l*h);break;case"XZX":t.set(l*u,c*m,c*f,l*h);break;case"YXY":t.set(c*f,l*u,c*m,l*h);break;case"ZYZ":t.set(c*m,c*f,l*u,l*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function Kc(t,i){switch(i.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function mr(t,i){switch(i.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const yee={DEG2RAD:Eg,RAD2DEG:$g,generateUUID:Bu,clamp:ma,euclideanModulo:RO,mapLinear:see,inverseLerp:oee,lerp:P_,damp:lee,pingpong:cee,smoothstep:hee,smootherstep:uee,randInt:dee,randFloat:Aee,randFloatSpread:fee,seededRandom:pee,degToRad:mee,radToDeg:gee,isPowerOfTwo:sD,ceilPowerOfTwo:vee,floorPowerOfTwo:$S,setQuaternionFromProperEuler:_ee,normalize:mr,denormalize:Kc};class Jt{constructor(i=0,r=0){Jt.prototype.isVector2=!0,this.x=i,this.y=r}get width(){return this.x}set width(i){this.x=i}get height(){return this.y}set height(i){this.y=i}set(i,r){return this.x=i,this.y=r,this}setScalar(i){return this.x=i,this.y=i,this}setX(i){return this.x=i,this}setY(i){return this.y=i,this}setComponent(i,r){switch(i){case 0:this.x=r;break;case 1:this.y=r;break;default:throw new Error("index is out of range: "+i)}return this}getComponent(i){switch(i){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+i)}}clone(){return new this.constructor(this.x,this.y)}copy(i){return this.x=i.x,this.y=i.y,this}add(i){return this.x+=i.x,this.y+=i.y,this}addScalar(i){return this.x+=i,this.y+=i,this}addVectors(i,r){return this.x=i.x+r.x,this.y=i.y+r.y,this}addScaledVector(i,r){return this.x+=i.x*r,this.y+=i.y*r,this}sub(i){return this.x-=i.x,this.y-=i.y,this}subScalar(i){return this.x-=i,this.y-=i,this}subVectors(i,r){return this.x=i.x-r.x,this.y=i.y-r.y,this}multiply(i){return this.x*=i.x,this.y*=i.y,this}multiplyScalar(i){return this.x*=i,this.y*=i,this}divide(i){return this.x/=i.x,this.y/=i.y,this}divideScalar(i){return this.multiplyScalar(1/i)}applyMatrix3(i){const r=this.x,n=this.y,a=i.elements;return this.x=a[0]*r+a[3]*n+a[6],this.y=a[1]*r+a[4]*n+a[7],this}min(i){return this.x=Math.min(this.x,i.x),this.y=Math.min(this.y,i.y),this}max(i){return this.x=Math.max(this.x,i.x),this.y=Math.max(this.y,i.y),this}clamp(i,r){return this.x=Math.max(i.x,Math.min(r.x,this.x)),this.y=Math.max(i.y,Math.min(r.y,this.y)),this}clampScalar(i,r){return this.x=Math.max(i,Math.min(r,this.x)),this.y=Math.max(i,Math.min(r,this.y)),this}clampLength(i,r){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(i,Math.min(r,n)))}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(i){return this.x*i.x+this.y*i.y}cross(i){return this.x*i.y-this.y*i.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(i){const r=Math.sqrt(this.lengthSq()*i.lengthSq());if(r===0)return Math.PI/2;const n=this.dot(i)/r;return Math.acos(ma(n,-1,1))}distanceTo(i){return Math.sqrt(this.distanceToSquared(i))}distanceToSquared(i){const r=this.x-i.x,n=this.y-i.y;return r*r+n*n}manhattanDistanceTo(i){return Math.abs(this.x-i.x)+Math.abs(this.y-i.y)}setLength(i){return this.normalize().multiplyScalar(i)}lerp(i,r){return this.x+=(i.x-this.x)*r,this.y+=(i.y-this.y)*r,this}lerpVectors(i,r,n){return this.x=i.x+(r.x-i.x)*n,this.y=i.y+(r.y-i.y)*n,this}equals(i){return i.x===this.x&&i.y===this.y}fromArray(i,r=0){return this.x=i[r],this.y=i[r+1],this}toArray(i=[],r=0){return i[r]=this.x,i[r+1]=this.y,i}fromBufferAttribute(i,r){return this.x=i.getX(r),this.y=i.getY(r),this}rotateAround(i,r){const n=Math.cos(r),a=Math.sin(r),s=this.x-i.x,o=this.y-i.y;return this.x=s*n-o*a+i.x,this.y=s*a+o*n+i.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Di{constructor(i,r,n,a,s,o,l,c,h){Di.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],i!==void 0&&this.set(i,r,n,a,s,o,l,c,h)}set(i,r,n,a,s,o,l,c,h){const u=this.elements;return u[0]=i,u[1]=a,u[2]=l,u[3]=r,u[4]=s,u[5]=c,u[6]=n,u[7]=o,u[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(i){const r=this.elements,n=i.elements;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],this}extractBasis(i,r,n){return i.setFromMatrix3Column(this,0),r.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(i){const r=i.elements;return this.set(r[0],r[4],r[8],r[1],r[5],r[9],r[2],r[6],r[10]),this}multiply(i){return this.multiplyMatrices(this,i)}premultiply(i){return this.multiplyMatrices(i,this)}multiplyMatrices(i,r){const n=i.elements,a=r.elements,s=this.elements,o=n[0],l=n[3],c=n[6],h=n[1],u=n[4],d=n[7],A=n[2],f=n[5],m=n[8],g=a[0],p=a[3],v=a[6],_=a[1],y=a[4],w=a[7],b=a[2],E=a[5],M=a[8];return s[0]=o*g+l*_+c*b,s[3]=o*p+l*y+c*E,s[6]=o*v+l*w+c*M,s[1]=h*g+u*_+d*b,s[4]=h*p+u*y+d*E,s[7]=h*v+u*w+d*M,s[2]=A*g+f*_+m*b,s[5]=A*p+f*y+m*E,s[8]=A*v+f*w+m*M,this}multiplyScalar(i){const r=this.elements;return r[0]*=i,r[3]*=i,r[6]*=i,r[1]*=i,r[4]*=i,r[7]*=i,r[2]*=i,r[5]*=i,r[8]*=i,this}determinant(){const i=this.elements,r=i[0],n=i[1],a=i[2],s=i[3],o=i[4],l=i[5],c=i[6],h=i[7],u=i[8];return r*o*u-r*l*h-n*s*u+n*l*c+a*s*h-a*o*c}invert(){const i=this.elements,r=i[0],n=i[1],a=i[2],s=i[3],o=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=u*o-l*h,A=l*c-u*s,f=h*s-o*c,m=r*d+n*A+a*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const g=1/m;return i[0]=d*g,i[1]=(a*h-u*n)*g,i[2]=(l*n-a*o)*g,i[3]=A*g,i[4]=(u*r-a*c)*g,i[5]=(a*s-l*r)*g,i[6]=f*g,i[7]=(n*c-h*r)*g,i[8]=(o*r-n*s)*g,this}transpose(){let i;const r=this.elements;return i=r[1],r[1]=r[3],r[3]=i,i=r[2],r[2]=r[6],r[6]=i,i=r[5],r[5]=r[7],r[7]=i,this}getNormalMatrix(i){return this.setFromMatrix4(i).invert().transpose()}transposeIntoArray(i){const r=this.elements;return i[0]=r[0],i[1]=r[3],i[2]=r[6],i[3]=r[1],i[4]=r[4],i[5]=r[7],i[6]=r[2],i[7]=r[5],i[8]=r[8],this}setUvTransform(i,r,n,a,s,o,l){const c=Math.cos(s),h=Math.sin(s);return this.set(n*c,n*h,-n*(c*o+h*l)+o+i,-a*h,a*c,-a*(-h*o+c*l)+l+r,0,0,1),this}scale(i,r){return this.premultiply(rx.makeScale(i,r)),this}rotate(i){return this.premultiply(rx.makeRotation(-i)),this}translate(i,r){return this.premultiply(rx.makeTranslation(i,r)),this}makeTranslation(i,r){return i.isVector2?this.set(1,0,i.x,0,1,i.y,0,0,1):this.set(1,0,i,0,1,r,0,0,1),this}makeRotation(i){const r=Math.cos(i),n=Math.sin(i);return this.set(r,-n,0,n,r,0,0,0,1),this}makeScale(i,r){return this.set(i,0,0,0,r,0,0,0,1),this}equals(i){const r=this.elements,n=i.elements;for(let a=0;a<9;a++)if(r[a]!==n[a])return!1;return!0}fromArray(i,r=0){for(let n=0;n<9;n++)this.elements[n]=i[n+r];return this}toArray(i=[],r=0){const n=this.elements;return i[r]=n[0],i[r+1]=n[1],i[r+2]=n[2],i[r+3]=n[3],i[r+4]=n[4],i[r+5]=n[5],i[r+6]=n[6],i[r+7]=n[7],i[r+8]=n[8],i}clone(){return new this.constructor().fromArray(this.elements)}}const rx=new Di;function HW(t){for(let i=t.length-1;i>=0;--i)if(t[i]>=65535)return!0;return!1}const Eee={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function g1(t,i){return new Eee[t](i)}function my(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function wee(){const t=my("canvas");return t.style.display="block",t}const J3={};function L_(t){t in J3||(J3[t]=!0,console.warn(t))}const $3=new Di().set(.8224621,.177538,0,.0331941,.9668058,0,.0170827,.0723974,.9105199),eF=new Di().set(1.2249401,-.2249404,0,-.0420569,1.0420571,0,-.0196376,-.0786361,1.0982735),v1={[fc]:{transfer:XS,primaries:qS,toReference:t=>t,fromReference:t=>t},[Fa]:{transfer:Ur,primaries:qS,toReference:t=>t.convertSRGBToLinear(),fromReference:t=>t.convertLinearToSRGB()},[kT]:{transfer:XS,primaries:ZS,toReference:t=>t.applyMatrix3(eF),fromReference:t=>t.applyMatrix3($3)},[xO]:{transfer:Ur,primaries:ZS,toReference:t=>t.convertSRGBToLinear().applyMatrix3(eF),fromReference:t=>t.applyMatrix3($3).convertLinearToSRGB()}},bee=new Set([fc,kT]),vr={enabled:!0,_workingColorSpace:fc,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(t){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!t},get workingColorSpace(){return this._workingColorSpace},set workingColorSpace(t){if(!bee.has(t))throw new Error(`Unsupported working color space, "${t}".`);this._workingColorSpace=t},convert:function(t,i,r){if(this.enabled===!1||i===r||!i||!r)return t;const n=v1[i].toReference,a=v1[r].fromReference;return a(n(t))},fromWorkingColorSpace:function(t,i){return this.convert(t,this._workingColorSpace,i)},toWorkingColorSpace:function(t,i){return this.convert(t,i,this._workingColorSpace)},getPrimaries:function(t){return v1[t].primaries},getTransfer:function(t){return t===Io?XS:v1[t].transfer}};function wg(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function nx(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let zp;class GW{static getDataURL(i){if(/^data:/i.test(i.src)||typeof HTMLCanvasElement>"u")return i.src;let r;if(i instanceof HTMLCanvasElement)r=i;else{zp===void 0&&(zp=my("canvas")),zp.width=i.width,zp.height=i.height;const n=zp.getContext("2d");i instanceof ImageData?n.putImageData(i,0,0):n.drawImage(i,0,0,i.width,i.height),r=zp}return r.width>2048||r.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",i),r.toDataURL("image/jpeg",.6)):r.toDataURL("image/png")}static sRGBToLinear(i){if(typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap){const r=my("canvas");r.width=i.width,r.height=i.height;const n=r.getContext("2d");n.drawImage(i,0,0,i.width,i.height);const a=n.getImageData(0,0,i.width,i.height),s=a.data;for(let o=0;o<s.length;o++)s[o]=wg(s[o]/255)*255;return n.putImageData(a,0,0),r}else if(i.data){const r=i.data.slice(0);for(let n=0;n<r.length;n++)r instanceof Uint8Array||r instanceof Uint8ClampedArray?r[n]=Math.floor(wg(r[n]/255)*255):r[n]=wg(r[n]);return{data:r,width:i.width,height:i.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),i}}let See=0;class zW{constructor(i=null){this.isSource=!0,Object.defineProperty(this,"id",{value:See++}),this.uuid=Bu(),this.data=i,this.version=0}set needsUpdate(i){i===!0&&this.version++}toJSON(i){const r=i===void 0||typeof i=="string";if(!r&&i.images[this.uuid]!==void 0)return i.images[this.uuid];const n={uuid:this.uuid,url:""},a=this.data;if(a!==null){let s;if(Array.isArray(a)){s=[];for(let o=0,l=a.length;o<l;o++)a[o].isDataTexture?s.push(ax(a[o].image)):s.push(ax(a[o]))}else s=ax(a);n.url=s}return r||(i.images[this.uuid]=n),n}}function ax(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?GW.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Cee=0;class ps extends Tp{constructor(i=ps.DEFAULT_IMAGE,r=ps.DEFAULT_MAPPING,n=Ha,a=Ha,s=pa,o=Zg,l=ol,c=vA,h=ps.DEFAULT_ANISOTROPY,u=Io){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Cee++}),this.uuid=Bu(),this.name="",this.source=new zW(i),this.mipmaps=[],this.mapping=r,this.channel=0,this.wrapS=n,this.wrapT=a,this.magFilter=s,this.minFilter=o,this.anisotropy=h,this.format=l,this.internalFormat=null,this.type=c,this.offset=new Jt(0,0),this.repeat=new Jt(1,1),this.center=new Jt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Di,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,typeof u=="string"?this.colorSpace=u:(L_("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=u===Xf?Fa:Io),this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(i=null){this.source.data=i}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(i){return this.name=i.name,this.source=i.source,this.mipmaps=i.mipmaps.slice(0),this.mapping=i.mapping,this.channel=i.channel,this.wrapS=i.wrapS,this.wrapT=i.wrapT,this.magFilter=i.magFilter,this.minFilter=i.minFilter,this.anisotropy=i.anisotropy,this.format=i.format,this.internalFormat=i.internalFormat,this.type=i.type,this.offset.copy(i.offset),this.repeat.copy(i.repeat),this.center.copy(i.center),this.rotation=i.rotation,this.matrixAutoUpdate=i.matrixAutoUpdate,this.matrix.copy(i.matrix),this.generateMipmaps=i.generateMipmaps,this.premultiplyAlpha=i.premultiplyAlpha,this.flipY=i.flipY,this.unpackAlignment=i.unpackAlignment,this.colorSpace=i.colorSpace,this.userData=JSON.parse(JSON.stringify(i.userData)),this.needsUpdate=!0,this}toJSON(i){const r=i===void 0||typeof i=="string";if(!r&&i.textures[this.uuid]!==void 0)return i.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(i).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),r||(i.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(i){if(this.mapping!==IW)return i;if(i.applyMatrix3(this.matrix),i.x<0||i.x>1)switch(this.wrapS){case py:i.x=i.x-Math.floor(i.x);break;case Ha:i.x=i.x<0?0:1;break;case rD:Math.abs(Math.floor(i.x)%2)===1?i.x=Math.ceil(i.x)-i.x:i.x=i.x-Math.floor(i.x);break}if(i.y<0||i.y>1)switch(this.wrapT){case py:i.y=i.y-Math.floor(i.y);break;case Ha:i.y=i.y<0?0:1;break;case rD:Math.abs(Math.floor(i.y)%2)===1?i.y=Math.ceil(i.y)-i.y:i.y=i.y-Math.floor(i.y);break}return this.flipY&&(i.y=1-i.y),i}set needsUpdate(i){i===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return L_("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Fa?Xf:kW}set encoding(i){L_("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=i===Xf?Fa:Io}}ps.DEFAULT_IMAGE=null;ps.DEFAULT_MAPPING=IW;ps.DEFAULT_ANISOTROPY=1;class Yr{constructor(i=0,r=0,n=0,a=1){Yr.prototype.isVector4=!0,this.x=i,this.y=r,this.z=n,this.w=a}get width(){return this.z}set width(i){this.z=i}get height(){return this.w}set height(i){this.w=i}set(i,r,n,a){return this.x=i,this.y=r,this.z=n,this.w=a,this}setScalar(i){return this.x=i,this.y=i,this.z=i,this.w=i,this}setX(i){return this.x=i,this}setY(i){return this.y=i,this}setZ(i){return this.z=i,this}setW(i){return this.w=i,this}setComponent(i,r){switch(i){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;case 3:this.w=r;break;default:throw new Error("index is out of range: "+i)}return this}getComponent(i){switch(i){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: "+i)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(i){return this.x=i.x,this.y=i.y,this.z=i.z,this.w=i.w!==void 0?i.w:1,this}add(i){return this.x+=i.x,this.y+=i.y,this.z+=i.z,this.w+=i.w,this}addScalar(i){return this.x+=i,this.y+=i,this.z+=i,this.w+=i,this}addVectors(i,r){return this.x=i.x+r.x,this.y=i.y+r.y,this.z=i.z+r.z,this.w=i.w+r.w,this}addScaledVector(i,r){return this.x+=i.x*r,this.y+=i.y*r,this.z+=i.z*r,this.w+=i.w*r,this}sub(i){return this.x-=i.x,this.y-=i.y,this.z-=i.z,this.w-=i.w,this}subScalar(i){return this.x-=i,this.y-=i,this.z-=i,this.w-=i,this}subVectors(i,r){return this.x=i.x-r.x,this.y=i.y-r.y,this.z=i.z-r.z,this.w=i.w-r.w,this}multiply(i){return this.x*=i.x,this.y*=i.y,this.z*=i.z,this.w*=i.w,this}multiplyScalar(i){return this.x*=i,this.y*=i,this.z*=i,this.w*=i,this}applyMatrix4(i){const r=this.x,n=this.y,a=this.z,s=this.w,o=i.elements;return this.x=o[0]*r+o[4]*n+o[8]*a+o[12]*s,this.y=o[1]*r+o[5]*n+o[9]*a+o[13]*s,this.z=o[2]*r+o[6]*n+o[10]*a+o[14]*s,this.w=o[3]*r+o[7]*n+o[11]*a+o[15]*s,this}divideScalar(i){return this.multiplyScalar(1/i)}setAxisAngleFromQuaternion(i){this.w=2*Math.acos(i.w);const r=Math.sqrt(1-i.w*i.w);return r<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=i.x/r,this.y=i.y/r,this.z=i.z/r),this}setAxisAngleFromRotationMatrix(i){let r,n,a,s;const c=i.elements,h=c[0],u=c[4],d=c[8],A=c[1],f=c[5],m=c[9],g=c[2],p=c[6],v=c[10];if(Math.abs(u-A)<.01&&Math.abs(d-g)<.01&&Math.abs(m-p)<.01){if(Math.abs(u+A)<.1&&Math.abs(d+g)<.1&&Math.abs(m+p)<.1&&Math.abs(h+f+v-3)<.1)return this.set(1,0,0,0),this;r=Math.PI;const y=(h+1)/2,w=(f+1)/2,b=(v+1)/2,E=(u+A)/4,M=(d+g)/4,S=(m+p)/4;return y>w&&y>b?y<.01?(n=0,a=.707106781,s=.707106781):(n=Math.sqrt(y),a=E/n,s=M/n):w>b?w<.01?(n=.707106781,a=0,s=.707106781):(a=Math.sqrt(w),n=E/a,s=S/a):b<.01?(n=.707106781,a=.707106781,s=0):(s=Math.sqrt(b),n=M/s,a=S/s),this.set(n,a,s,r),this}let _=Math.sqrt((p-m)*(p-m)+(d-g)*(d-g)+(A-u)*(A-u));return Math.abs(_)<.001&&(_=1),this.x=(p-m)/_,this.y=(d-g)/_,this.z=(A-u)/_,this.w=Math.acos((h+f+v-1)/2),this}min(i){return this.x=Math.min(this.x,i.x),this.y=Math.min(this.y,i.y),this.z=Math.min(this.z,i.z),this.w=Math.min(this.w,i.w),this}max(i){return this.x=Math.max(this.x,i.x),this.y=Math.max(this.y,i.y),this.z=Math.max(this.z,i.z),this.w=Math.max(this.w,i.w),this}clamp(i,r){return this.x=Math.max(i.x,Math.min(r.x,this.x)),this.y=Math.max(i.y,Math.min(r.y,this.y)),this.z=Math.max(i.z,Math.min(r.z,this.z)),this.w=Math.max(i.w,Math.min(r.w,this.w)),this}clampScalar(i,r){return this.x=Math.max(i,Math.min(r,this.x)),this.y=Math.max(i,Math.min(r,this.y)),this.z=Math.max(i,Math.min(r,this.z)),this.w=Math.max(i,Math.min(r,this.w)),this}clampLength(i,r){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(i,Math.min(r,n)))}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}
vendor: 1,739 bytes, line 5
5roundToZero(){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(i){return this.x*i.x+this.y*i.y+this.z*i.z+this.w*i.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(i){return this.normalize().multiplyScalar(i)}lerp(i,r){return this.x+=(i.x-this.x)*r,this.y+=(i.y-this.y)*r,this.z+=(i.z-this.z)*r,this.w+=(i.w-this.w)*r,this}lerpVectors(i,r,n){return this.x=i.x+(r.x-i.x)*n,this.y=i.y+(r.y-i.y)*n,this.z=i.z+(r.z-i.z)*n,this.w=i.w+(r.w-i.w)*n,this}equals(i){return i.x===this.x&&i.y===this.y&&i.z===this.z&&i.w===this.w}fromArray(i,r=0){return this.x=i[r],this.y=i[r+1],this.z=i[r+2],this.w=i[r+3],this}toArray(i=[],r=0){return i[r]=this.x,i[r+1]=this.y,i[r+2]=this.z,i[r+3]=this.w,i}fromBufferAttribute(i,r){return this.x=i.getX(r),this.y=i.getY(r),this.z=i.getZ(r),this.w=i.getW(r),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 Tee extends Tp{constructor(i=1,r=1,n={}){super(),this.isRenderTarget=!0,this.width=i,this.height=r,this.depth=1,this.scissor=new Yr(0,0,i,r),this.scissorTest=!1,this.viewport=new Yr(0,0,i,r);const a={width:i,height:r,depth:1};n.encoding!==void 0&&(L_("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace
vendor: 4,607 bytes, line 5
5=n.encoding===Xf?Fa:Io),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:pa,depthBuffer:!0,stencilBuffer:!1,depthTexture:null,samples:0},n),this.texture=new ps(a,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps,this.texture.internalFormat=n.internalFormat,this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.depthTexture=n.depthTexture,this.samples=n.samples}setSize(i,r,n=1){(this.width!==i||this.height!==r||this.depth!==n)&&(this.width=i,this.height=r,this.depth=n,this.texture.image.width=i,this.texture.image.height=r,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,i,r),this.scissor.set(0,0,i,r)}clone(){return new this.constructor().copy(this)}copy(i){this.width=i.width,this.height=i.height,this.depth=i.depth,this.scissor.copy(i.scissor),this.scissorTest=i.scissorTest,this.viewport.copy(i.viewport),this.texture=i.texture.clone(),this.texture.isRenderTargetTexture=!0;const r=Object.assign({},i.texture.image);return this.texture.source=new zW(r),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,i.depthTexture!==null&&(this.depthTexture=i.depthTexture.clone()),this.samples=i.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ap extends Tee{constructor(i=1,r=1,n={}){super(i,r,n),this.isWebGLRenderTarget=!0}}class QW extends ps{constructor(i=null,r=1,n=1,a=1){super(null),this.isDataArrayTexture=!0,this.image={data:i,width:r,height:n,depth:a},this.magFilter=Ua,this.minFilter=Ua,this.wrapR=Ha,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Mee extends ps{constructor(i=null,r=1,n=1,a=1){super(null),this.isData3DTexture=!0,this.image={data:i,width:r,height:n,depth:a},this.magFilter=Ua,this.minFilter=Ua,this.wrapR=Ha,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class sp{constructor(i=0,r=0,n=0,a=1){this.isQuaternion=!0,this._x=i,this._y=r,this._z=n,this._w=a}static slerpFlat(i,r,n,a,s,o,l){let c=n[a+0],h=n[a+1],u=n[a+2],d=n[a+3];const A=s[o+0],f=s[o+1],m=s[o+2],g=s[o+3];if(l===0){i[r+0]=c,i[r+1]=h,i[r+2]=u,i[r+3]=d;return}if(l===1){i[r+0]=A,i[r+1]=f,i[r+2]=m,i[r+3]=g;return}if(d!==g||c!==A||h!==f||u!==m){let p=1-l;const v=c*A+h*f+u*m+d*g,_=v>=0?1:-1,y=1-v*v;if(y>Number.EPSILON){const b=Math.sqrt(y),E=Math.atan2(b,v*_);p=Math.sin(p*E)/b,l=Math.sin(l*E)/b}const w=l*_;if(c=c*p+A*w,h=h*p+f*w,u=u*p+m*w,d=d*p+g*w,p===1-l){const b=1/Math.sqrt(c*c+h*h+u*u+d*d);c*=b,h*=b,u*=b,d*=b}}i[r]=c,i[r+1]=h,i[r+2]=u,i[r+3]=d}static multiplyQuaternionsFlat(i,r,n,a,s,o){const l=n[a],c=n[a+1],h=n[a+2],u=n[a+3],d=s[o],A=s[o+1],f=s[o+2],m=s[o+3];return i[r]=l*m+u*d+c*f-h*A,i[r+1]=c*m+u*A+h*d-l*f,i[r+2]=h*m+u*f+l*A-c*d,i[r+3]=u*m-l*d-c*A-h*f,i}get x(){return this._x}set x(i){this._x=i,this._onChangeCallback()}get y(){return this._y}set y(i){this._y=i,this._onChangeCallback()}get z(){return this._z}set z(i){this._z=i,this._onChangeCallback()}get w(){return this._w}set w(i){this._w=i,this._onChangeCallback()}set(i,r,n,a){return this._x=i,this._y=r,this._z=n,this._w=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(i){return this._x=i.x,this._y=i.y,this._z=i.z,this._w=i.w,this._onChangeCallback(),this}setFromEuler(i,r){const n=i._x,a=i._y,s=i._z,o=i._order,l=Math.cos,c=Math.sin,h=l(n/2),u=l(a/2),d=l(s/2),A=c(n/2),f=c(a/2),m=c(s/2);switch(o){case"XYZ":this._x=A*u*d+h*f*m,this._y=h*f*d-A*u*m,this._z=h*u*m+A*f*d,this._w=h*u*d-A*f*m;break;case"YXZ":this._x=A*u*d+h*f*m,this._y=h*f*d-A*u*m,this._z=h*u*m-A*f*d,this._w=h*u*d+A*f*m;break;case"ZXY":this._x=A*u*d-h*f*m,this._y=h*f*d+A*u*m,this._z=h*u*m+A*f*d,this._w=h*u*d-A*f*m;break;case"ZYX":this._x=A*u*d-h*f*m,this._y=h*f*d+A*u*m,this._z=h*u*m-A*f*d,this._w=h*u*d+A*f*m;break;case"YZX":this._x=A*u*d+h*f*m,this._y=h*f*d+A*u*m,this._z=h*u*m-A*f*d,this._w=h*u*d-A*f*m;break;case"XZY":this._x=A*u*d-h*f*m,this._y=h*f*d-A*u*m,this._z=h*u*m+A*f*d,this._w=h*u*d+A*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return r!==!1&&this._onChangeCallback(),this}setFromAxisAngle(i,r){const n=r/2,a=Math.sin(n);return this._x=i.x*a,this._y=i.y*a,this._z=i.z*a,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(i){const r=i.elements,n=r[0],a=r[4],s=r[8],o=r[1],l=r[5],c=r[9],h=r[2],u=r[6],d=r[10],A=n+l+d;if(A>0){const f=.5/Math.sqrt(A+1);this._w=.25/f,this._x=(u-c)*f,this._y=(s-h)*f,this._z=(o-a)*f}else if(n>l&&n>d){const f=2*Math.sqrt(1+n-l-d);
vendor: 33,835 bytes, line 5
5this._w=(u-c)/f,this._x=.25*f,this._y=(a+o)/f,this._z=(s+h)/f}else if(l>d){const f=2*Math.sqrt(1+l-n-d);this._w=(s-h)/f,this._x=(a+o)/f,this._y=.25*f,this._z=(c+u)/f}else{const f=2*Math.sqrt(1+d-n-l);this._w=(o-a)/f,this._x=(s+h)/f,this._y=(c+u)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(i,r){let n=i.dot(r)+1;return n<Number.EPSILON?(n=0,Math.abs(i.x)>Math.abs(i.z)?(this._x=-i.y,this._y=i.x,this._z=0,this._w=n):(this._x=0,this._y=-i.z,this._z=i.y,this._w=n)):(this._x=i.y*r.z-i.z*r.y,this._y=i.z*r.x-i.x*r.z,this._z=i.x*r.y-i.y*r.x,this._w=n),this.normalize()}angleTo(i){return 2*Math.acos(Math.abs(ma(this.dot(i),-1,1)))}rotateTowards(i,r){const n=this.angleTo(i);if(n===0)return this;const a=Math.min(1,r/n);return this.slerp(i,a),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(i){return this._x*i._x+this._y*i._y+this._z*i._z+this._w*i._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 i=this.length();return i===0?(this._x=0,this._y=0,this._z=0,this._w=1):(i=1/i,this._x=this._x*i,this._y=this._y*i,this._z=this._z*i,this._w=this._w*i),this._onChangeCallback(),this}multiply(i){return this.multiplyQuaternions(this,i)}premultiply(i){return this.multiplyQuaternions(i,this)}multiplyQuaternions(i,r){const n=i._x,a=i._y,s=i._z,o=i._w,l=r._x,c=r._y,h=r._z,u=r._w;return this._x=n*u+o*l+a*h-s*c,this._y=a*u+o*c+s*l-n*h,this._z=s*u+o*h+n*c-a*l,this._w=o*u-n*l-a*c-s*h,this._onChangeCallback(),this}slerp(i,r){if(r===0)return this;if(r===1)return this.copy(i);const n=this._x,a=this._y,s=this._z,o=this._w;let l=o*i._w+n*i._x+a*i._y+s*i._z;if(l<0?(this._w=-i._w,this._x=-i._x,this._y=-i._y,this._z=-i._z,l=-l):this.copy(i),l>=1)return this._w=o,this._x=n,this._y=a,this._z=s,this;const c=1-l*l;if(c<=Number.EPSILON){const f=1-r;return this._w=f*o+r*this._w,this._x=f*n+r*this._x,this._y=f*a+r*this._y,this._z=f*s+r*this._z,this.normalize(),this._onChangeCallback(),this}const h=Math.sqrt(c),u=Math.atan2(h,l),d=Math.sin((1-r)*u)/h,A=Math.sin(r*u)/h;return this._w=o*d+this._w*A,this._x=n*d+this._x*A,this._y=a*d+this._y*A,this._z=s*d+this._z*A,this._onChangeCallback(),this}slerpQuaternions(i,r,n){return this.copy(i).slerp(r,n)}random(){const i=Math.random(),r=Math.sqrt(1-i),n=Math.sqrt(i),a=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(r*Math.cos(a),n*Math.sin(s),n*Math.cos(s),r*Math.sin(a))}equals(i){return i._x===this._x&&i._y===this._y&&i._z===this._z&&i._w===this._w}fromArray(i,r=0){return this._x=i[r],this._y=i[r+1],this._z=i[r+2],this._w=i[r+3],this._onChangeCallback(),this}toArray(i=[],r=0){return i[r]=this._x,i[r+1]=this._y,i[r+2]=this._z,i[r+3]=this._w,i}fromBufferAttribute(i,r){return this._x=i.getX(r),this._y=i.getY(r),this._z=i.getZ(r),this._w=i.getW(r),this}toJSON(){return this.toArray()}_onChange(i){return this._onChangeCallback=i,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class we{constructor(i=0,r=0,n=0){we.prototype.isVector3=!0,this.x=i,this.y=r,this.z=n}set(i,r,n){return n===void 0&&(n=this.z),this.x=i,this.y=r,this.z=n,this}setScalar(i){return this.x=i,this.y=i,this.z=i,this}setX(i){return this.x=i,this}setY(i){return this.y=i,this}setZ(i){return this.z=i,this}setComponent(i,r){switch(i){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;default:throw new Error("index is out of range: "+i)}return this}getComponent(i){switch(i){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+i)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(i){return this.x=i.x,this.y=i.y,this.z=i.z,this}add(i){return this.x+=i.x,this.y+=i.y,this.z+=i.z,this}addScalar(i){return this.x+=i,this.y+=i,this.z+=i,this}addVectors(i,r){return this.x=i.x+r.x,this.y=i.y+r.y,this.z=i.z+r.z,this}addScaledVector(i,r){return this.x+=i.x*r,this.y+=i.y*r,this.z+=i.z*r,this}sub(i){return this.x-=i.x,this.y-=i.y,this.z-=i.z,this}subScalar(i){return this.x-=i,this.y-=i,this.z-=i,this}subVectors(i,r){return this.x=i.x-r.x,this.y=i.y-r.y,this.z=i.z-r.z,this}multiply(i){return this.x*=i.x,this.y*=i.y,this.z*=i.z,this}multiplyScalar(i){return this.x*=i,this.y*=i,this.z*=i,this}multiplyVectors(i,r){return this.x=i.x*r.x,this.y=i.y*r.y,this.z=i.z*r.z,this}applyEuler(i){return this.applyQuaternion(tF.setFromEuler(i))}applyAxisAngle(i,r){return this.applyQuaternion(tF.setFromAxisAngle(i,r))}applyMatrix3(i){const r=this.x,n=this.y,a=this.z,s=i.elements;return this.x=s[0]*r+s[3]*n+s[6]*a,this.y=s[1]*r+s[4]*n+s[7]*a,this.z=s[2]*r+s[5]*n+s[8]*a,this}applyNormalMatrix(i){return this.applyMatrix3(i).normalize()}applyMatrix4(i){const r=this.x,n=this.y,a=this.z,s=i.elements,o=1/(s[3]*r+s[7]*n+s[11]*a+s[15]);return this.x=(s[0]*r+s[4]*n+s[8]*a+s[12])*o,this.y=(s[1]*r+s[5]*n+s[9]*a+s[13])*o,this.z=(s[2]*r+s[6]*n+s[10]*a+s[14])*o,this}applyQuaternion(i){const r=this.x,n=this.y,a=this.z,s=i.x,o=i.y,l=i.z,c=i.w,h=2*(o*a-l*n),u=2*(l*r-s*a),d=2*(s*n-o*r);return this.x=r+c*h+o*d-l*u,this.y=n+c*u+l*h-s*d,this.z=a+c*d+s*u-o*h,this}project(i){return this.applyMatrix4(i.matrixWorldInverse).applyMatrix4(i.projectionMatrix)}unproject(i){return this.applyMatrix4(i.projectionMatrixInverse).applyMatrix4(i.matrixWorld)}transformDirection(i){const r=this.x,n=this.y,a=this.z,s=i.elements;return this.x=s[0]*r+s[4]*n+s[8]*a,this.y=s[1]*r+s[5]*n+s[9]*a,this.z=s[2]*r+s[6]*n+s[10]*a,this.normalize()}divide(i){return this.x/=i.x,this.y/=i.y,this.z/=i.z,this}divideScalar(i){return this.multiplyScalar(1/i)}min(i){return this.x=Math.min(this.x,i.x),this.y=Math.min(this.y,i.y),this.z=Math.min(this.z,i.z),this}max(i){return this.x=Math.max(this.x,i.x),this.y=Math.max(this.y,i.y),this.z=Math.max(this.z,i.z),this}clamp(i,r){return this.x=Math.max(i.x,Math.min(r.x,this.x)),this.y=Math.max(i.y,Math.min(r.y,this.y)),this.z=Math.max(i.z,Math.min(r.z,this.z)),this}clampScalar(i,r){return this.x=Math.max(i,Math.min(r,this.x)),this.y=Math.max(i,Math.min(r,this.y)),this.z=Math.max(i,Math.min(r,this.z)),this}clampLength(i,r){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(i,Math.min(r,n)))}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}round(){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(i){return this.x*i.x+this.y*i.y+this.z*i.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(i){return this.normalize().multiplyScalar(i)}lerp(i,r){return this.x+=(i.x-this.x)*r,this.y+=(i.y-this.y)*r,this.z+=(i.z-this.z)*r,this}lerpVectors(i,r,n){return this.x=i.x+(r.x-i.x)*n,this.y=i.y+(r.y-i.y)*n,this.z=i.z+(r.z-i.z)*n,this}cross(i){return this.crossVectors(this,i)}crossVectors(i,r){const n=i.x,a=i.y,s=i.z,o=r.x,l=r.y,c=r.z;return this.x=a*c-s*l,this.y=s*o-n*c,this.z=n*l-a*o,this}projectOnVector(i){const r=i.lengthSq();if(r===0)return this.set(0,0,0);const n=i.dot(this)/r;return this.copy(i).multiplyScalar(n)}projectOnPlane(i){return sx.copy(this).projectOnVector(i),this.sub(sx)}reflect(i){return this.sub(sx.copy(i).multiplyScalar(2*this.dot(i)))}angleTo(i){const r=Math.sqrt(this.lengthSq()*i.lengthSq());if(r===0)return Math.PI/2;const n=this.dot(i)/r;return Math.acos(ma(n,-1,1))}distanceTo(i){return Math.sqrt(this.distanceToSquared(i))}distanceToSquared(i){const r=this.x-i.x,n=this.y-i.y,a=this.z-i.z;return r*r+n*n+a*a}manhattanDistanceTo(i){return Math.abs(this.x-i.x)+Math.abs(this.y-i.y)+Math.abs(this.z-i.z)}setFromSpherical(i){return this.setFromSphericalCoords(i.radius,i.phi,i.theta)}setFromSphericalCoords(i,r,n){const a=Math.sin(r)*i;return this.x=a*Math.sin(n),this.y=Math.cos(r)*i,this.z=a*Math.cos(n),this}setFromCylindrical(i){return this.setFromCylindricalCoords(i.radius,i.theta,i.y)}setFromCylindricalCoords(i,r,n){return this.x=i*Math.sin(r),this.y=n,this.z=i*Math.cos(r),this}setFromMatrixPosition(i){const r=i.elements;return this.x=r[12],this.y=r[13],this.z=r[14],this}setFromMatrixScale(i){const r=this.setFromMatrixColumn(i,0).length(),n=this.setFromMatrixColumn(i,1).length(),a=this.setFromMatrixColumn(i,2).length();return this.x=r,this.y=n,this.z=a,this}setFromMatrixColumn(i,r){return this.fromArray(i.elements,r*4)}setFromMatrix3Column(i,r){return this.fromArray(i.elements,r*3)}setFromEuler(i){return this.x=i._x,this.y=i._y,this.z=i._z,this}setFromColor(i){return this.x=i.r,this.y=i.g,this.z=i.b,this}equals(i){return i.x===this.x&&i.y===this.y&&i.z===this.z}fromArray(i,r=0){return this.x=i[r],this.y=i[r+1],this.z=i[r+2],this}toArray(i=[],r=0){return i[r]=this.x,i[r+1]=this.y,i[r+2]=this.z,i}fromBufferAttribute(i,r){return this.x=i.getX(r),this.y=i.getY(r),this.z=i.getZ(r),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const i=(Math.random()-.5)*2,r=Math.random()*Math.PI*2,n=Math.sqrt(1-i**2);return this.x=n*Math.cos(r),this.y=n*Math.sin(r),this.z=i,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const sx=new we,tF=new sp;class B0{constructor(i=new we(1/0,1/0,1/0),r=new we(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=i,this.max=r}set(i,r){return this.min.copy(i),this.max.copy(r),this}setFromArray(i){this.makeEmpty();for(let r=0,n=i.length;r<n;r+=3)this.expandByPoint(Ol.fromArray(i,r));return this}setFromBufferAttribute(i){this.makeEmpty();for(let r=0,n=i.count;r<n;r++)this.expandByPoint(Ol.fromBufferAttribute(i,r));return this}setFromPoints(i){this.makeEmpty();for(let r=0,n=i.length;r<n;r++)this.expandByPoint(i[r]);return this}setFromCenterAndSize(i,r){const n=Ol.copy(r).multiplyScalar(.5);return this.min.copy(i).sub(n),this.max.copy(i).add(n),this}setFromObject(i,r=!1){return this.makeEmpty(),this.expandByObject(i,r)}clone(){return new this.constructor().copy(this)}copy(i){return this.min.copy(i.min),this.max.copy(i.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(i){return this.isEmpty()?i.set(0,0,0):i.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(i){return this.isEmpty()?i.set(0,0,0):i.subVectors(this.max,this.min)}expandByPoint(i){return this.min.min(i),this.max.max(i),this}expandByVector(i){return this.min.sub(i),this.max.add(i),this}expandByScalar(i){return this.min.addScalar(-i),this.max.addScalar(i),this}expandByObject(i,r=!1){i.updateWorldMatrix(!1,!1);const n=i.geometry;if(n!==void 0){const s=n.getAttribute("position");if(r===!0&&s!==void 0&&i.isInstancedMesh!==!0)for(let o=0,l=s.count;o<l;o++)i.isMesh===!0?i.getVertexPosition(o,Ol):Ol.fromBufferAttribute(s,o),Ol.applyMatrix4(i.matrixWorld),this.expandByPoint(Ol);else i.boundingBox!==void 0?(i.boundingBox===null&&i.computeBoundingBox(),_1.copy(i.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),_1.copy(n.boundingBox)),_1.applyMatrix4(i.matrixWorld),this.union(_1)}const a=i.children;for(let s=0,o=a.length;s<o;s++)this.expandByObject(a[s],r);return this}containsPoint(i){return!(i.x<this.min.x||i.x>this.max.x||i.y<this.min.y||i.y>this.max.y||i.z<this.min.z||i.z>this.max.z)}containsBox(i){return this.min.x<=i.min.x&&i.max.x<=this.max.x&&this.min.y<=i.min.y&&i.max.y<=this.max.y&&this.min.z<=i.min.z&&i.max.z<=this.max.z}getParameter(i,r){return r.set((i.x-this.min.x)/(this.max.x-this.min.x),(i.y-this.min.y)/(this.max.y-this.min.y),(i.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(i){return!(i.max.x<this.min.x||i.min.x>this.max.x||i.max.y<this.min.y||i.min.y>this.max.y||i.max.z<this.min.z||i.min.z>this.max.z)}intersectsSphere(i){return this.clampPoint(i.center,Ol),Ol.distanceToSquared(i.center)<=i.radius*i.radius}intersectsPlane(i){let r,n;return i.normal.x>0?(r=i.normal.x*this.min.x,n=i.normal.x*this.max.x):(r=i.normal.x*this.max.x,n=i.normal.x*this.min.x),i.normal.y>0?(r+=i.normal.y*this.min.y,n+=i.normal.y*this.max.y):(r+=i.normal.y*this.max.y,n+=i.normal.y*this.min.y),i.normal.z>0?(r+=i.normal.z*this.min.z,n+=i.normal.z*this.max.z):(r+=i.normal.z*this.max.z,n+=i.normal.z*this.min.z),r<=-i.constant&&n>=-i.constant}intersectsTriangle(i){if(this.isEmpty())return!1;this.getCenter(uv),y1.subVectors(this.max,uv),Qp.subVectors(i.a,uv),Vp.subVectors(i.b,uv),Wp.subVectors(i.c,uv),ad.subVectors(Vp,Qp),sd.subVectors(Wp,Vp),KA.subVectors(Qp,Wp);let r=[0,-ad.z,ad.y,0,-sd.z,sd.y,0,-KA.z,KA.y,ad.z,0,-ad.x,sd.z,0,-sd.x,KA.z,0,-KA.x,-ad.y,ad.x,0,-sd.y,sd.x,0,-KA.y,KA.x,0];return!ox(r,Qp,Vp,Wp,y1)||(r=[1,0,0,0,1,0,0,0,1],!ox(r,Qp,Vp,Wp,y1))?!1:(E1.crossVectors(ad,sd),r=[E1.x,E1.y,E1.z],ox(r,Qp,Vp,Wp,y1))}clampPoint(i,r){return r.copy(i).clamp(this.min,this.max)}distanceToPoint(i){return this.clampPoint(i,Ol).distanceTo(i)}getBoundingSphere(i){return this.isEmpty()?i.makeEmpty():(this.getCenter(i.center),i.radius=this.getSize(Ol).length()*.5),i}intersect(i){return this.min.max(i.min),this.max.min(i.max),this.isEmpty()&&this.makeEmpty(),this}union(i){return this.min.min(i.min),this.max.max(i.max),this}applyMatrix4(i){return this.isEmpty()?this:(Mh[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(i),Mh[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(i),Mh[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(i),Mh[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(i),Mh[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(i),Mh[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(i),Mh[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(i),Mh[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(i),this.setFromPoints(Mh),this)}translate(i){return this.min.add(i),this.max.add(i),this}equals(i){return i.min.equals(this.min)&&i.max.equals(this.max)}}const Mh=[new we,new we,new we,new we,new we,new we,new we,new we],Ol=new we,_1=new B0,Qp=new we,Vp=new we,Wp=new we,ad=new we,sd=new we,KA=new we,uv=new we,y1=new we,E1=new we,XA=new we;function ox(t,i,r,n,a){for(let s=0,o=t.length-3;s<=o;s+=3){XA.fromArray(t,s);const l=a.x*Math.abs(XA.x)+a.y*Math.abs(XA.y)+a.z*Math.abs(XA.z),c=i.dot(XA),h=r.dot(XA),u=n.dot(XA);if(Math.max(-Math.max(c,h,u),Math.min(c,h,u))>l)return!1}return!0}const xee=new B0,dv=new we,lx=new we;class I0{constructor(i=new we,r=-1){this.center=i,this.radius=r}set(i,r){return this.center.copy(i),this.radius=r,this}setFromPoints(i,r){const n=this.center;r!==void 0?n.copy(r):xee.setFromPoints(i).getCenter(n);let a=0;for(let s=0,o=i.length;s<o;s++)a=Math.max(a,n.distanceToSquared(i[s]));return this.radius=Math.sqrt(a),this}copy(i){return this.center.copy(i.center),this.radius=i.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(i){return i.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(i){return i.distanceTo(this.center)-this.radius}intersectsSphere(i){const r=this.radius+i.radius;return i.center.distanceToSquared(this.center)<=r*r}intersectsBox(i){return i.intersectsSphere(this)}intersectsPlane(i){return Math.abs(i.distanceToPoint(this.center))<=this.radius}clampPoint(i,r){const n=this.center.distanceToSquared(i);return r.copy(i),n>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r}getBoundingBox(i){return this.isEmpty()?(i.makeEmpty(),i):(i.set(this.center,this.center),i.expandByScalar(this.radius),i)}applyMatrix4(i){return this.center.applyMatrix4(i),this.radius=this.radius*i.getMaxScaleOnAxis(),this}translate(i){return this.center.add(i),this}expandByPoint(i){if(this.isEmpty())return this.center.copy(i),this.radius=0,this;dv.subVectors(i,this.center);const r=dv.lengthSq();if(r>this.radius*this.radius){const n=Math.sqrt(r),a=(n-this.radius)*.5;this.center.addScaledVector(dv,a/n),this.radius+=a}return this}union(i){return i.isEmpty()?this:this.isEmpty()?(this.copy(i),this):(this.center.equals(i.center)===!0?this.radius=Math.max(this.radius,i.radius):(lx.subVectors(i.center,this.center).setLength(i.radius),this.expandByPoint(dv.copy(i.center).add(lx)),this.expandByPoint(dv.copy(i.center).sub(lx))),this)}equals(i){return i.center.equals(this.center)&&i.radius===this.radius}clone(){return new this.constructor().copy(this)}}const xh=new we,cx=new we,w1=new we,od=new we,hx=new we,b1=new we,ux=new we;class uE{constructor(i=new we,r=new we(0,0,-1)){this.origin=i,this.direction=r}set(i,r){return this.origin.copy(i),this.direction.copy(r),this}copy(i){return this.origin.copy(i.origin),this.direction.copy(i.direction),this}at(i,r){return r.copy(this.origin).addScaledVector(this.direction,i)}lookAt(i){return this.direction.copy(i).sub(this.origin).normalize(),this}recast(i){return this.origin.copy(this.at(i,xh)),this}closestPointToPoint(i,r){r.subVectors(i,this.origin);const n=r.dot(this.direction);return n<0?r.copy(this.origin):r.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(i){return Math.sqrt(this.distanceSqToPoint(i))}distanceSqToPoint(i){const r=xh.subVectors(i,this.origin).dot(this.direction);return r<0?this.origin.distanceToSquared(i):(xh.copy(this.origin).addScaledVector(this.direction,r),xh.distanceToSquared(i))}distanceSqToSegment(i,r,n,a){cx.copy(i).add(r).multiplyScalar(.5),w1.copy(r).sub(i).normalize(),od.copy(this.origin).sub(cx);const s=i.distanceTo(r)*.5,o=-this.direction.dot(w1),l=od.dot(this.direction),c=-od.dot(w1),h=od.lengthSq(),u=Math.abs(1-o*o);let d,A,f,m;if(u>0)if(d=o*c-l,A=o*l-c,m=s*u,d>=0)if(A>=-m)if(A<=m){const g=1/u;d*=g,A*=g,f=d*(d+o*A+2*l)+A*(o*d+A+2*c)+h}else A=s,d=Math.max(0,-(o*A+l)),f=-d*d+A*(A+2*c)+h;else A=-s,d=Math.max(0,-(o*A+l)),f=-d*d+A*(A+2*c)+h;else A<=-m?(d=Math.max(0,-(-o*s+l)),A=d>0?-s:Math.min(Math.max(-s,-c),s),f=-d*d+A*(A+2*c)+h):A<=m?(d=0,A=Math.min(Math.max(-s,-c),s),f=A*(A+2*c)+h):(d=Math.max(0,-(o*s+l)),A=d>0?s:Math.min(Math.max(-s,-c),s),f=-d*d+A*(A+2*c)+h);else A=o>0?-s:s,d=Math.max(0,-(o*A+l)),f=-d*d+A*(A+2*c)+h;return n&&n.copy(this.origin).addScaledVector(this.direction,d),a&&a.copy(cx).addScaledVector(w1,A),f}intersectSphere(i,r){xh.subVectors(i.center,this.origin);const n=xh.dot(this.direction),a=xh.dot(xh)-n*n,s=i.radius*i.radius;if(a>s)return null;const o=Math.sqrt(s-a),l=n-o,c=n+o;return c<0?null:l<0?this.at(c,r):this.at(l,r)}intersectsSphere(i){return this.distanceSqToPoint(i.center)<=i.radius*i.radius}distanceToPlane(i){const r=i.normal.dot(this.direction);if(r===0)return i.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(i.normal)+i.constant)/r;return n>=0?n:null}intersectPlane(i,r){const n=this.distanceToPlane(i);return n===null?null:this.at(n,r)}intersectsPlane(i){const r=i.distanceToPoint(this.origin);return r===0||i.normal.dot(this.direction)*r<0}intersectBox(i,r){let n,a,s,o,l,c;const h=1/this.direction.x,u=1/this.direction.y,d=1/this.direction.z,A=this.origin;return h>=0?(n=(i.min.x-A.x)*h,a=(i.max.x-A.x)*h):(n=(i.max.x-A.x)*h,a=(i.min.x-A.x)*h),u>=0?(s=(i.min.y-A.y)*u,o=(i.max.y-A.y)*u):(s=(i.max.y-A.y)*u,o=(i.min.y-A.y)*u),n>o||s>a||((s>n||isNaN(n))&&(n=s),(o<a||isNaN(a))&&(a=o),d>=0?(l=(i.min.z-A.z)*d,c=(i.max.z-A.z)*d):(l=(i.max.z-A.z)*d,c=(i.min.z-A.z)*d),n>c||l>a)||((l>n||n!==n)&&(n=l),(c<a||a!==a)&&(a=c),a<0)?null:this.at(n>=0?n:a,r)}intersectsBox(i){return this.intersectBox(i,xh)!==null}intersectTriangle(i,r,n,a,s){hx.subVectors(r,i),b1.subVectors(n,i),ux.crossVectors(hx,b1);let o=this.direction.dot(ux),l;if(o>0){if(a)return null;l=1}else if(o<0)l=-1,o=-o;else return null;od.subVectors(this.origin,i);const c=l*this.direction.dot(b1.crossVectors(od,b1));if(c<0)return null;const h=l*this.direction.dot(hx.cross(od));if(h<0||c+h>o)return null;const u=-l*od.dot(ux);return u<0?null:this.at(u/o,s)}applyMatrix4(i){return this.origin.applyMatrix4(i),this.direction.transformDirection(i),this}equals(i){return i.origin.equals(this.origin)&&i.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class _t{constructor(i,r,n,a,s,o,l,c,h,u,d,A,f,m,g,p){_t.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],i!==void 0&&this.set(i,r,n,a,s,o,l,c,h,u,d,A,f,m,g,p)}set(i,r,n,a,s,o,l,c,h,u,d,A,f,m,g,p){const v=this.elements;return v[0]=i,v[4]=r,v[8]=n,v[12]=a,v[1]=s,v[5]=o,v[9]=l,v[13]=c,v[2]=h,v[6]=u,v[10]=d,v[14]=A,v[3]=f,v[7]=m,v[11]=g,v[15]=p,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(i){const r=this.elements,n=i.elements;return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r[9]=n[9],r[10]=n[10],r[11]=n[11],r[12]=n[12],r[13]=n[13],r[14]=n[14],r[15]=n[15],this}copyPosition(i){const r=this.elements,n=i.elements;return r[12]=n[12],r[13]=n[13],r[14]=n[14],this}setFromMatrix3(i){const r=i.elements;return this.set(r[0],r[3],r[6],0,r[1],r[4],r[7],0,r[2],r[5],r[8],0,0,0,0,1),this}extractBasis(i,r,n){return i.setFromMatrixColumn(this,0),r.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(i,r,n){return this.set(i.x,r.x,n.x,0,i.y,r.y,n.y,0,i.z,r.z,n.z,0,0,0,0,1),this}extractRotation(i){const r=this.elements,n=i.elements,a=1/jp.setFromMatrixColumn(i,0).length(),s=1/jp.setFromMatrixColumn(i,1).length(),o=1/jp.setFromMatrixColumn(i,2).length();return r[0]=n[0]*a,r[1]=n[1]*a,r[2]=n[2]*a,r[3]=0,r[4]=n[4]*s,r[5]=n[5]*s,r[6]=n[6]*s,r[7]=0,r[8]=n[8]*o,r[9]=n[9]*o,r[10]=n[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromEuler(i){const r=this.elements,n=i.x,a=i.y,s=i.z,o=Math.cos(n),l=Math.sin(n),c=Math.cos(a),h=Math.sin(a),u=Math.cos(s),d=Math.sin(s);if(i.order==="XYZ"){const A=o*u,f=o*d,m=l*u,g=l*d;r[0]=c*u,r[4]=-c*d,r[8]=h,r[1]=f+m*h,r[5]=A-g*h,r[9]=-l*c,r[2]=g-A*h,r[6]=m+f*h,r[10]=o*c}else if(i.order==="YXZ"){const A=c*u,f=c*d,m=h*u,g=h*d;r[0]=A+g*l,r[4]=m*l-f,r[8]=o*h,r[1]=o*d,r[5]=o*u,r[9]=-l,r[2]=f*l-m,r[6]=g+A*l,r[10]=o*c}else if(i.order==="ZXY"){const A=c*u,f=c*d,m=h*u,g=h*d;r[0]=A-g*l,r[4]=-o*d,r[8]=m+f*l,r[1]=f+m*l,r[5]=o*u,r[9]=g-A*l,r[2]=-o*h,r[6]=l,r[10]=o*c}else if(i.order==="ZYX"){const A=o*u,f=o*d,m=l*u,g=l*d;r[0]=c*u,r[4]=m*h-f,r[8]=A*h+g,r[1]=c*d,r[5]=g*h+A,r[9]=f*h-m,r[2]=-h,r[6]=l*c,r[10]=o*c}else if(i.order==="YZX"){const A=o*c,f=o*h,m=l*c,g=l*h;r[0]=c*u,r[4]=g-A*d,r[8]=m*d+f,r[1]=d,r[5]=o*u,r[9]=-l*u,r[2]=-h*u,r[6]=f*d+m,r[10]=A-g*d}else if(i.order==="XZY"){const A=o*c,f=o*h,m=l*c,g=l*h;r[0]=c*u,r[4]=-d,r[8]=h*u,r[1]=A*d+g,r[5]=o*u,r[9]=f*d-m,r[2]=m*d-f,r[6]=l*u,r[10]=g*d+A}return r[3]=0,r[7]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromQuaternion(i){return this.compose(Ree,i,Bee)}lookAt(i,r,n){const a=this.elements;return yo.subVectors(i,r),yo.lengthSq()===0&&(yo.z=1),yo.normalize(),ld.crossVectors(n,yo),ld.lengthSq()===0&&(Math.abs(n.z)===1?yo.x+=1e-4:yo.z+=1e-4,yo.normalize(),ld.crossVectors(n,yo)),ld.normalize(),S1.crossVectors(yo,ld),a[0]=ld.x,a[4]=S1.x,a[8]=yo.x,a[1]=ld.y,a[5]=S1.y,a[9]=yo.y,a[2]=ld.z,a[6]=S1.z,a[10]=yo.z,this}multiply(i){return this.multiplyMatrices(this,i)}premultiply(i){return this.multiplyMatrices(i,this)}multiplyMatrices(i,r){const n=i.elements,a=r.elements,s=this.elements,o=n[0],l=n[4],c=n[8],h=n[12],u=n[1],d=n[5],A=n[9],f=n[13],m=n[2],g=n[6],p=n[10],v=n[14],_=n[3],y=n[7],w=n[11],b=n[15],E=a[0],M=a[4],S=a[8],T=a[12],C=a[1],x=a[5],R=a[9],L=a[13],I=a[2],F=a[6],Y=a[10],D=a[14],U=a[3],j=a[7],J=a[11],z=a[15];return s[0]=o*E+l*C+c*I+h*U,s[4]=o*M+l*x+c*F+h*j,s[8]=o*S+l*R+c*Y+h*J,s[12]=o*T+l*L+c*D+h*z,s[1]=u*E+d*C+A*I+f*U,s[5]=u*M+d*x+A*F+f*j,s[9]=u*S+d*R+A*Y+f*J,s[13]=u*T+d*L+A*D+f*z,s[2]=m*E+g*C+p*I+v*U,s[6]=m*M+g*x+p*F+v*j,s[10]=m*S+g*R+p*Y+v*J,s[14]=m*T+g*L+p*D+v*z,s[3]=_*E+y*C+w*I+b*U,s[7]=_*M+y*x+w*F+b*j,s[11]=_*S+y*R+w*Y+b*J,s[15]=_*T+y*L+w*D+b*z,this}multiplyScalar(i){const r=this.elements;return r[0]*=i,r[4]*=i,r[8]*=i,r[12]*=i,r[1]*=i,r[5]*=i,r[9]*=i,r[13]*=i,r[2]*=i,r[6]*=i,r[10]*=i,r[14]*=i,r[3]*=i,r[7]*=i,r[11]*=i,r[15]*=i,this}determinant(){const i=this.elements,r=i[0],n=i[4],a=i[8],s=i[12],o=i[1],l=i[5],c=i[9],h=i[13],u=i[2],d=i[6],A=i[10],f=i[14],m=i[3],g=i[7],p=i[11],v=i[15];return m*(+s*c*d-a*h*d-s*l*A+n*h*A+a*l*f-n*c*f)+g*(+r*c*f-r*h*A+s*o*A-a*o*f+a*h*u-s*c*u)+p*(+r*h*d-r*l*f-s*o*d+n*o*f+s*l*u-n*h*u)+v*(-a*l*u-r*c*d+r*l*A+a*o*d-n*o*A+n*c*u)}transpose(){const i=this.elements;let r;return r=i[1],i[1]=i[4],i[4]=r,r=i[2],i[2]=i[8],i[8]=r,r=i[6],i[6]=i[9],i[9]=r,r=i[3],i[3]=i[12],i[12]=r,r=i[7],i[7]=i[13],i[13]=r,r=i[11],i[11]=i[14],i[14]=r,this}setPosition(i,r,n){const a=this.elements;return i.isVector3?(a[12]=i.x,a[13]=i.y,a[14]=i.z):(a[12]=i,a[13]=r,a[14]=n),this}invert(){const i=this.elements,r=i[0],n=i[1],a=i[2],s=i[3],o=i[4],l=i[5],c=i[6],h=i[7],u=i[8],d=i[9],A=i[10],f=i[11],m=i[12],g=i[13],p=i[14],v=i[15],_=d*p*h-g*A*h+g*c*f-l*p*f-d*c*v+l*A*v,y=m*A*h-u*p*h-m*c*f+o*p*f+u*c*v-o*A*v,w=u*g*h-m*d*h+m*l*f-o*g*f-u*l*v+o*d*v,b=m*d*c-u*g*c-m*l*A+o*g*A+u*l*p-o*d*p,E=r*_+n*y+a*w+s*b;if(E===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const M=1/E;return i[0]=_*M,i[1]=(g*A*s-d*p*s-g*a*f+n*p*f+d*a*v-n*A*v)*M,i[2]=(l*p*s-g*c*s+g*a*h-n*p*h-l*a*v+n*c*v)*M,i[3]=(d*c*s-l*A*s-d*a*h+n*A*h+l*a*f-n*c*f)*M,i[4]=y*M,i[5]=(u*p*s-m*A*s+m*a*f-r*p*f-u*a*v+r*A*v)*M,i[6]=(m*c*s-o*p*s-m*a*h+r*p*h+o*a*v-r*c*v)*M,i[7]=(o*A*s-u*c*s+u*a*h-r*A*h-o*a*f+r*c*f)*M,i[8]=w*M,i[9]=(m*d*s-u*g*s-m*n*f+r*g*f+u*n*v-r*d*v)*M,i[10]=(o*g*s-m*l*s+m*n*h-r*g*h-o*n*v+r*l*v)*M,i[11]=(u*l*s-o*d*s-u*n*h+r*d*h+o*n*f-r*l*f)*M,i[12]=b*M,i[13]=(u*g*a-m*d*a+m*n*A-r*g*A-u*n*p+r*d*p)*M,i[14]=(m*l*a-o*g*a-m*n*c+r*g*c+o*n*p-r*l*p)*M,i[15]=(o*d*a-u*l*a+u*n*c-r*d*c-o*n*A+r*l*A)*M,this}scale(i){const r=this.elements,n=i.x,a=i.y,s=i.z;return r[0]*=n,r[4]*=a,r[8]*=s,r[1]*=n,r[5]*=a,r[9]*=s,r[2]*=n,r[6]*=a,r[10]*=s,r[3]*=n,r[7]*=a,r[11]*=s,this}getMaxScaleOnAxis(){const i=this.elements,r=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],n=i[4]*i[4]+i[5]*i[5]+i[6]*i[6],a=i[8]*i[8]+i[9]*i[9]+i[10]*i[10];return Math.sqrt(Math.max(r,n,a))}makeTranslation(i,r,n){return i.isVector3?this.set(1,0,0,i.x,0,1,0,i.y,0,0,1,i.z,0,0,0,1):this.set(1,0,0,i,0,1,0,r,0,0,1,n,0,0,0,1),this}makeRotationX(i){const r=Math.cos(i),n=Math.sin(i);return this.set(1,0,0,0,0,r,-n,0,0,n,r,0,0,0,0,1),this}makeRotationY(i){const r=Math.cos(i),n=Math.sin(i);return this.set(r,0,n,0,0,1,0,0,-n,0,r,0,0,0,0,1),this}makeRotationZ(i){const r=Math.cos(i),n=Math.sin(i);return this.set(r,-n,0,0,n,r,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(i,r){const n=Math.cos(r),a=Math.sin(r),s=1-n,o=i.x,l=i.y,c=i.z,h=s*o,u=s*l;return this.set(h*o+n,h*l-a*c,h*c+a*l,0,h*l+a*c,u*l+n,u*c-a*o,0,h*c-a*l,u*c+a*o,s*c*c+n,0,0,0,0,1),this}makeScale(i,r,n){return this.set(i,0,0,0,0,r,0,0,0,0,n,0,0,0,0,1),this}makeShear(i,r,n,a,s,o){return this.set(1,n,s,0,i,1,o,0,r,a,1,0,0,0,0,1),this}compose(i,r,n){const a=this.elements,s=r._x,o=r._y,l=r._z,c=r._w,h=s+s,u=o+o,d=l+l,A=s*h,f=s*u,m=s*d,g=o*u,p=o*d,v=l*d,_=c*h,y=c*u,w=c*d,b=n.x,E=n.y,M=n.z;return a[0]=(1-(g+v))*b,a[1]=(f+w)*b,a[2]=(m-y)*b,a[3]=0,a[4]=(f-w)*E,a[5]=(1-(A+v))*E,a[6]=(p+_)*E,a[7]=0,a[8]=(m+y)*M,a[9]=(p-_)*M,a[10]=(1-(A+g))*M,a[11]=0,a[12]=i.x,a[13]=i.y,a[14]=i.z,a[15]=1,this}decompose(i,r,n){const a=this.elements;let s=jp.set(a[0],a[1],a[2]).length();const o=jp.set(a[4],a[5],a[6]).length(),l=jp.set(a[8],a[9],a[10]).length();this.determinant()<0&&(s=-s),i.x=a[12],i.y=a[13],i.z=a[14],Nl.copy(this);const h=1/s,u=1/o,d=1/l;return Nl.elements[0]*=h,Nl.elements[1]*=h,Nl.elements[2]*=h,Nl.elements[4]*=u,Nl.elements[5]*=u,Nl.elements[6]*=u,Nl.elements[8]*=d,Nl.elements[9]*=d,Nl.elements[10]*=d,r.setFromRotationMatrix(Nl),n.x=s,n.y=o,n.z=l,this}makePerspective(i,r,n,a,s,o,l=Eu){const c=this.elements,h=2*s/(r-i),u=2*s/(n-a),d=(r+i)/(r-i),A=(n+a)/(n-a);let f,m;if(l===Eu)f=-(o+s)/(o-s),m=-2*o*s/(o-s);else if(l===JS)f=-o/(o-s),m=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+l);return c[0]=h,c[4]=0,c[8]=d,c[12]=0,c[1]=0,c[5]=u,c[9]=A,c[13]=0,c[2]=0,c[6]=0,c[10]=f,c[14]=m,c[3]=0,c[7]=0,c[11]=-1,c[15]=0,this}makeOrthographic(i,r,n,a,s,o,l=Eu){const c=this.elements,h=1/(r-i),u=1/(n-a),d=1/(o-s),A=(r+i)*h,f=(n+a)*u;let m,g;if(l===Eu)m=(o+s)*d,g=-2*d;else if(l===JS)m=s*d,g=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+l);return c[0]=2*h,c[4]=0,c[8]=0,c[12]=-A,c[1]=0,c[5]=2*u,c[9]=0,c[13]=-f,c[2]=0,c[6]=0,c[10]=g,c[14]=-m,c[3]=0,c[7]=0,c[11]=0,c[15]=1,this}equals(i){const r=this.elements,n=i.elements;for(let a=0;a<16;a++)if(r[a]!==n[a])return!1;return!0}fromArray(i,r=0){for(let n=0;n<16;n++)this.elements[n]=i[n+r];return this}toArray(i=[],r=0){const n=this.elements;return i[r]=n[0],i[r+1]=n[1],i[r+2]=n[2],i[r+3]=n[3],i[r+4]=n[4],i[r+5]=n[5],i[r+6]=n[6],i[r+7]=n[7],i[r+8]=n[8],i[r+9]=n[9],i[r+10]=n[10],i[r+11]=n[11],i[r+12]=n[12],i[r+13]=n[13],i[r+14]=n[14],i[r+15]=n[15],i}}const jp=new we,Nl=new _t,Ree=new we(0,0,0),Bee=new we(1,1,1),ld=new we,S1=new we,yo=new we,iF=new _t,rF=new sp;class HT{constructor(i=0,r=0,n=0,a=HT.DEFAULT_ORDER){this.isEuler=!0,this._x=i,this._y=r,this._z=n,this._order=a}get x(){return this._x}set x(i){this._x=i,this._onChangeCallback()}get y(){return this._y}set y(i){this._y=i,this._onChangeCallback()}get z(){return this._z}set z(i){this._z=i,this._onChangeCallback()}get order(){return this._order}set order(i){this._order=i,this._onChangeCallback()}set(i,r,n,a=this._order){return this._x=i,this._y=r,this._z=n,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(i){return this._x=i._x,this._y=i._y,this._z=i._z,this._order=i._order,this._onChangeCallback(),this}setFromRotationMatrix(i,r=this._order,n=!0){const a=i.elements,s=a[0],o=a[4],l=a[8],c=a[1],h=a[5],u=a[9],d=a[2],A=a[6],f=a[10];switch(r){case"XYZ":this._y=Math.asin(ma(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,f),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(A,h),this._z=0);break;case"YXZ":this._x=Math.asin(-ma(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(l,f),this._z=Math.atan2(c,h)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(ma(A,-1,1)),Math.abs(A)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-o,h)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-ma(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(A,f),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-o,h));break;case"YZX":this._z=Math.asin(ma(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-u,h),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(l,f));break;case"XZY":this._z=Math.asin(-ma(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(A,h),this._y=Math.atan2(l,s)):(this._x=Math.atan2(-u,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+r)}return this._order=r,n===!0&&this._onChangeCallback(),this}setFromQuaternion(i,r,n){return iF.makeRotationFromQuaternion(i),this.setFromRotationMatrix(iF,r,n)}setFromVector3(i,r=this._order){return this.set(i.x,i.y,i.z,r)}reorder(i){return rF.setFromEuler(this),this.setFromQuaternion(rF,i)}equals(i){return i._x===this._x&&i._y===this._y&&i._z===this._z&&i._order===this._order}fromArray(i){return this._x=i[0],this._y=i[1],this._z=i[2],i[3]!==void 0&&(this._order=i[3]),this._onChangeCallback(),this}toArray(i=[],r=0){return i[r]=this._x,i[r+1]=this._y,i[r+2]=this._z,i[r+3]=this._order,i}_onChange(i){return this._onChangeCallback=i,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}HT.DEFAULT_ORDER="XYZ";class BO{constructor(){this.mask=1}set(i){this.mask=(1<<i|0)>>>0}enable(i){this.mask|=1<<i|0}enableAll(){this.mask=-1}toggle(i){this.mask^=1<<i|0}disable(i){this.mask&=~(1<<i|0)}disableAll(){this.mask=0}test(i){return(this.mask&i.mask)!==0}isEnabled(i){return(this.mask&(1<<i|0))!==0}}let Iee=0;const nF=new we,Yp=new sp,Rh=new _t,C1=new we,Av=new we,Dee=new we,Pee=new sp,aF=new we(1,0,0),sF=new we(0,1,0),oF=new we(0,0,1),Lee={type:"added"},Oee={type:"removed"};class $r extends Tp{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Iee++}),this.uuid=Bu(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=$r.DEFAULT_UP.clone();const i=new we,r=new HT,n=new sp,a=new we(1,1,1);function s(){n.setFromEuler(r,!1)}function o(){r.setFromQuaternion(n,void 0,!1)}r._onChange(s),n._onChange(o),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:i},rotation:{configurable:!0,enumerable:!0,value:r},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new _t},normalMatrix:{value:new Di}}),this.matrix=new _t,this.matrixWorld=new _t,this.matrixAutoUpdate=$r.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=$r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new BO,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(i){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(i),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(i){return this.quaternion.premultiply(i),this}setRotationFromAxisAngle(i,r){this.quaternion.setFromAxisAngle(i,r)}setRotationFromEuler(i){this.quaternion.setFromEuler(i,!0)}
5setRotationFromMatrix(i){this.quaternion.setFromRotationMatrix(i)}setRotationFromQuaternion(i){this.quaternion.copy(i)}rotateOnAxis(i,r){return Yp.setFromAxisAngle(i,r),this.quaternion.multiply(Yp),this}rotateOnWorldAxis(i,r){return Yp.setFromAxisAngle(i,r),this.quaternion.premultiply(Yp),this}rotateX(i){return this.rotateOnAxis(aF,i)}rotateY(i){return this.rotateOnAxis(sF,i)}rotateZ(i){return this.rotateOnAxis(oF,i)}translateOnAxis(i,r){return nF.copy(i).applyQuaternion(this.quaternion),this.position.add(nF.multiplyScalar(r)),this}translateX(i){return this.translateOnAxis(aF,i)}translateY(i){return this.translateOnAxis(sF,i)}translateZ(i){return this.translateOnAxis(oF,i)}localToWorld(i){return this.updateWorldMatrix(!0,!1),i.applyMatrix4(this.matrixWorld)}worldToLocal(i){return this.updateWorldMatrix(!0,!1),i.applyMatrix4(Rh.copy(this.matrixWorld).invert())}lookAt(i,r,n){i.isVector3?C1.copy(i):C1.set(i,r,n);const a=this.parent;this.updateWorldMatrix(!0,!1),Av.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Rh.lookAt(Av,C1,this.up):Rh.lookAt(C1,Av,this.up),this.quaternion.setFromRotationMatrix(Rh),a&&(Rh.extractRotation(a.matrixWorld),Yp.setFromRotationMatrix(Rh),this.quaternion.premultiply(Yp.invert()))}add(i){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.add(arguments[r]);return this}return i===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",i),this):(i&&i.isObject3D?(i.parent!==null&&i.parent.remove(i),i.parent=this,this.children.push(i),i.dispatchEvent(Lee)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",i),this)}remove(i){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const r=this.children.indexOf(i);return r!==-1&&(i.parent=null,this.children.splice(r,1),i.dispatchEvent(Oee)),this}removeFromParent(){const i=this.parent;return i!==null&&i.remove(this),this}clear(){return this.remove(...this.children)}attach(i){return this.updateWorldMatrix(!0,!1),Rh.copy(this.matrixWorld).invert(),i.parent!==null&&(i.parent.updateWorldMatrix(!0,!1),Rh.multiply(i.parent.matrixWorld)),i.applyMatrix4(Rh),this.add(i),i.updateWorldMatrix(!1,!0),this}getObjectById(i){return this.getObjectByProperty("id",i)}getObjectByName(i){return this.getObjectByProperty("name",i)}getObjectByProperty(i,r){if(this[i]===r)return this;for(let n=0,a=this.children.length;n<a;n++){const o=this.children[n].getObjectByProperty(i,r);if(o!==void 0)return o}}getObjectsByProperty(i,r){let n=[];this[i]===r&&n.push(this);for(let a=0,s=this.children.length;a<s;a++){const o=this.children[a].getObjectsByProperty(i,r);o.length>0&&(n=n.concat(o))}return n}getWorldPosition(i){return this.updateWorldMatrix(!0,!1),i.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(i){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Av,i,Dee),i}getWorldScale(i){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Av,Pee,i),i}getWorldDirection(i){this.updateWorldMatrix(!0,!1);const r=this.matrixWorld.elements;return i.set(r[8],r[9],r[10]).normalize()}raycast(){}traverse(i){i(this);const r=this.children;for(let n=0,a=r.length;n<a;n++)r[n].traverse(i)}traverseVisible(i){if(this.visible===!1)return;i(this);const r=this.children;for(let n=0,a=r.length;n<a;n++)r[n].traverseVisible(i)}traverseAncestors(i){const r=this.parent;r!==null&&(i(r),r.traverseAncestors(i))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(i){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,i=!0);const r=this.children;for(let n=0,a=r.length;n<a;n++){const s=r[n];(s.matrixWorldAutoUpdate===!0||i===!0)&&s.updateMatrixWorld(i)}}updateWorldMatrix(i,r){const n=this.parent;if(i===!0&&n!==null&&n.matrixWorldAutoUpdate===!0&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 10,103 bytes, line 5
5):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),r===!0){const a=this.children;for(let s=0,o=a.length;s<o;s++){const l=a[s];l.matrixWorldAutoUpdate===!0&&l.updateWorldMatrix(!1,!0)}}}toJSON(i){const r=i===void 0||typeof i=="string",n={};r&&(i={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const a={};a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),this.frustumCulled===!1&&(a.frustumCulled=!1),this.renderOrder!==0&&(a.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON()));function s(l,c){return l[c.uuid]===void 0&&(l[c.uuid]=c.toJSON(i)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(i).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(i).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=s(i.geometries,this.geometry);const l=this.geometry.parameters;if(l!==void 0&&l.shapes!==void 0){const c=l.shapes;if(Array.isArray(c))for(let h=0,u=c.length;h<u;h++){const d=c[h];s(i.shapes,d)}else s(i.shapes,c)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(i.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const l=[];for(let c=0,h=this.material.length;c<h;c++)l.push(s(i.materials,this.material[c]));a.material=l}else a.material=s(i.materials,this.material);if(this.children.length>0){a.children=[];for(let l=0;l<this.children.length;l++)a.children.push(this.children[l].toJSON(i).object)}if(this.animations.length>0){a.animations=[];for(let l=0;l<this.animations.length;l++){const c=this.animations[l];a.animations.push(s(i.animations,c))}}if(r){const l=o(i.geometries),c=o(i.materials),h=o(i.textures),u=o(i.images),d=o(i.shapes),A=o(i.skeletons),f=o(i.animations),m=o(i.nodes);l.length>0&&(n.geometries=l),c.length>0&&(n.materials=c),h.length>0&&(n.textures=h),u.length>0&&(n.images=u),d.length>0&&(n.shapes=d),A.length>0&&(n.skeletons=A),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=a,n;function o(l){const c=[];for(const h in l){const u=l[h];delete u.metadata,c.push(u)}return c}}clone(i){return new this.constructor().copy(this,i)}copy(i,r=!0){if(this.name=i.name,this.up.copy(i.up),this.position.copy(i.position),this.rotation.order=i.rotation.order,this.quaternion.copy(i.quaternion),this.scale.copy(i.scale),this.matrix.copy(i.matrix),this.matrixWorld.copy(i.matrixWorld),this.matrixAutoUpdate=i.matrixAutoUpdate,this.matrixWorldNeedsUpdate=i.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=i.matrixWorldAutoUpdate,this.layers.mask=i.layers.mask,this.visible=i.visible,this.castShadow=i.castShadow,this.receiveShadow=i.receiveShadow,this.frustumCulled=i.frustumCulled,this.renderOrder=i.renderOrder,this.animations=i.animations.slice(),this.userData=JSON.parse(JSON.stringify(i.userData)),r===!0)for(let n=0;n<i.children.length;n++){const a=i.children[n];this.add(a.clone())}return this}}$r.DEFAULT_UP=new we(0,1,0);$r.DEFAULT_MATRIX_AUTO_UPDATE=!0;$r.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Ul=new we,Bh=new we,dx=new we,Ih=new we,Kp=new we,Xp=new we,lF=new we,Ax=new we,fx=new we,px=new we;let T1=!1;class Bo{constructor(i=new we,r=new we,n=new we){this.a=i,this.b=r,this.c=n}static getNormal(i,r,n,a){a.subVectors(n,r),Ul.subVectors(i,r),a.cross(Ul);const s=a.lengthSq();return s>0?a.multiplyScalar(1/Math.sqrt(s)):a.set(0,0,0)}static getBarycoord(i,r,n,a,s){Ul.subVectors(a,r),Bh.subVectors(n,r),dx.subVectors(i,r);const o=Ul.dot(Ul),l=Ul.dot(Bh),c=Ul.dot(dx),h=Bh.dot(Bh),u=Bh.dot(dx),d=o*h-l*l;if(d===0)return s.set(-2,-1,-1);const A=1/d,f=(h*c-l*u)*A,m=(o*u-l*c)*A;return s.set(1-f-m,m,f)}static containsPoint(i,r,n,a){return this.getBarycoord(i,r,n,a,Ih),Ih.x>=0&&Ih.y>=0&&Ih.x+Ih.y<=1}static getUV(i,r,n,a,s,o,l,c){return T1===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),T1=!0),this.getInterpolation(i,r,n,a,s,o,l,c)}static getInterpolation(i,r,n,a,s,o,l,c){return this.getBarycoord(i,r,n,a,Ih),c.setScalar(0),c.addScaledVector(s,Ih.x),c.addScaledVector(o,Ih.y),c.addScaledVector(l,Ih.z),c}static isFrontFacing(i,r,n,a){return Ul.subVectors(n,r),Bh.subVectors(i,r),Ul.cross(Bh).dot(a)<0}set(i,r,n){return this.a.copy(i),this.b.copy(r),this.c.copy(n),this}setFromPointsAndIndices(i,r,n,a){return this.a.copy(i[r]),this.b.copy(i[n]),this.c.copy(i[a]),this}setFromAttributeAndIndices(i,r,n,a){return this.a.fromBufferAttribute(i,r),this.b.fromBufferAttribute(i,n),this.c.fromBufferAttribute(i,a),this}clone(){return new this.constructor().copy(this)}copy(i){return this.a.copy(i.a),this.b.copy(i.b),this.c.copy(i.c),this}getArea(){return Ul.subVectors(this.c,this.b),Bh.subVectors(this.a,this.b),Ul.cross(Bh).length()*.5}getMidpoint(i){return i.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(i){return Bo.getNormal(this.a,this.b,this.c,i)}getPlane(i){return i.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(i,r){return Bo.getBarycoord(i,this.a,this.b,this.c,r)}getUV(i,r,n,a,s){return T1===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),T1=!0),Bo.getInterpolation(i,this.a,this.b,this.c,r,n,a,s)}getInterpolation(i,r,n,a,s){return Bo.getInterpolation(i,this.a,this.b,this.c,r,n,a,s)}containsPoint(i){return Bo.containsPoint(i,this.a,this.b,this.c)}isFrontFacing(i){return Bo.isFrontFacing(this.a,this.b,this.c,i)}intersectsBox(i){return i.intersectsTriangle(this)}closestPointToPoint(i,r){const n=this.a,a=this.b,s=this.c;let o,l;Kp.subVectors(a,n),Xp.subVectors(s,n),Ax.subVectors(i,n);const c=Kp.dot(Ax),h=Xp.dot(Ax);if(c<=0&&h<=0)return r.copy(n);fx.subVectors(i,a);const u=Kp.dot(fx),d=Xp.dot(fx);if(u>=0&&d<=u)return r.copy(a);const A=c*d-u*h;if(A<=0&&c>=0&&u<=0)return o=c/(c-u),r.copy(n).addScaledVector(Kp,o);px.subVectors(i,s);const f=Kp.dot(px),m=Xp.dot(px);if(m>=0&&f<=m)return r.copy(s);const g=f*h-c*m;if(g<=0&&h>=0&&m<=0)return l=h/(h-m),r.copy(n).addScaledVector(Xp,l);const p=u*m-f*d;if(p<=0&&d-u>=0&&f-m>=0)return lF.subVectors(s,a),l=(d-u)/(d-u+(f-m)),r.copy(a).addScaledVector(lF,l);const v=1/(p+g+A);return o=g*v,l=A*v,r.copy(n).addScaledVector(Kp,o).addScaledVector(Xp,l)}equals(i){return i.a.equals(this.a)&&i.b.equals(this.b)&&i.c.equals(this.c)}}const VW={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},cd={h:0,s:0,l:0},M1={h:0,s:0,l:0};function mx(t,i,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(i-t)*6*r:r<1/2?i:r<2/3?t+(i-t)*6*(2/3-r):t}class Kt{constructor(i,r,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(i,r,n)}set(i,r,n){if(r===void 0&&n===void 0){const a=i;a&&a.isColor?this.copy(a):typeof a=="number"?this.setHex(a):typeof a=="str
5ing"&&this.setStyle(a)}else this.setRGB(i,r,n);return this}setScalar(i){return this.r=i,this.g=i,this.b=i,this}setHex(i,r=Fa){return i=Math.floor(i),this.r=(i>>16&255)/255,this.g=(i>>8&255)/255,this.b=(i&255)/255,vr.toWorkingColorSpace(this,r),this}setRGB(i,r,n,a=vr.workingColorSpace){return this.r=i,this.g=r,this.b=n,vr.toWorkingColorSpace(this,a),this}setHSL(i,r,n,a=vr.workingColorSpace){if(i=RO(i,1),r=ma(r,0,1),n=ma(n,0,1),r===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+r):n+r-n*r,o=2*n-s;this.r=mx(o,s,i+1/3),this.g=mx(o,s,i),this.b=mx(o,s,i-1/3)}return vr.toWorkingColorSpace(this,a),this}setStyle(i,r=Fa){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+i+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(i)){let s;const o=a[1],l=a[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,r);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,r);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(l))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,r);break;default:console.warn("THREE.Color: Unknown color model "+i)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(i)){const s=a[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,r);if(o===6)return this.setHex(parseInt(s,16),r);console.warn("THREE.Color: Invalid hex color "+i)}else if(i&&i.length>0)return this.setColorName(i,r);return this}setColorName(i,r=Fa){const n=VW[i.toLowerCase()];return n!==void 0?this.setHex(n,r):console.warn("THREE.Color: Unknown color "+i),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(i){return this.r=i.r,this.g=i.g,this.b=i.b,this}copySRGBToLinear(i){return this.r=wg(i.r),this.g=wg(i.g),this.b=wg(i.b),this}copyLinearToSRGB(i){return this.r=nx(i.r),this.g=nx(i.g),this.b=nx(i.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(i=Fa){return vr.fromWorkingColorSpace(ts.copy(this),i),Math.round(ma(ts.r*255,0,255))*65536+Math.round(ma(ts.g*255,0,255))*256+Math.round(ma(ts.b*255,0,255))}getHexString(i=Fa){return("000000"+this.getHex(i).toString(16)).slice(-6)}getHSL(i,r=vr.workingColorSpace){vr.fromWorkingColorSpace(ts.copy(this),r);const n=ts.r,a=ts.g,s=ts.b,o=Math.max(n,a,s),l=Math.min(n,a,s);let c,h;const u=(l+o)/2;if(l===o)c=0,h=0;else{const d=o-l;switch(h=u<=.5?d/(o+l):d/(2-o-l),o){case n:c=(a-s)/d+(a<s?6:0);break;case a:c=(s-n)/d+2;break;case s:c=(n-a)/d+4;break}c/=6}return i.h=c,i.s=h,i.l=u,i}getRGB(i,r=vr.workingColorSpace){return vr.fromWorkingColorSpace(ts.copy(this),r),i.r=ts.r,i.g=ts.g,i.b=ts.b,i}getStyle(i=Fa){vr.fromWorkingColorSpace(ts.copy(this),i);const r=ts.r,n=ts.g,a=ts.b;return i!==Fa?`color(${i} ${r.toFixed(3)} ${n.toFixed(3)} ${a.toFixed(3)})`:`rgb(${Math.round(r*255)},${Math.round(n*255)},${Math.round(a*255)})`}offsetHSL(i,r,n){return this.getHSL(cd),this.setHSL(cd.h+i,cd.s+r,cd.l+n)}add(i){return this.r+=i.r,this.g+=i.g,this.b+=i.b,this}addColors(i,r){return this.r=i.r+r.r,this.g=i.g+r.g,this.b=i.b+r.b,this}addScalar(i){return this.r+=i,this.g+=i,this.b+=i,this}sub(i){return this.r=Math.max(0,this.r-i.r),this.g=Math.max(0,this.g-i.g),this.b=Math.max(0,this.b-i.b),this}multiply(i){return this.r*=i.r,this.g*=i.g,this.b*=i.b,this}multiplyScalar(i){return this.r*=i,this.g*=i,this.b*=i,this}lerp(i,r){return this.r+=(i.r-this.r)*r,this.g+=(i.g-this.g)*r,this.b+=(i.b-this.b)*r,this}lerpColors(i,r,n){return this.r=i.r+(r.r-i.r)*n,this.g=i.g+(r.g-i.g)*n,this.b=i.b+(r.b-i.b)*n,this}lerpHSL(i,r){this.getHSL(cd),i.getHSL(M1);const n=P_(cd.h,M1.h,r),a=P_(cd.s,M1.s,r),s=P_(cd.l,M1.l,r);return this.setHSL(n,a,s),this}setFromVector3(i){return this.r=i.x,this.g=i.y,this.b=i.z,this}applyMatrix3(i){const r=this.r,n=this.g,a=this.b,s=i.elements;return this.r=s[0]*r+s[3]*n+s[6]*a,this.g=s[1]*r+s[4]*n+s[7]*a,this.b=s[2]*r+s[5]*n+s[8]*a,this}equals(i){return i.r===this.r&&i.g===this.g&&i.b===this.b}fromArray(i,r=0){return this.r=i[r],this.g=i[r+1],this.b=i[r+2],this}toArray(i=[],r=0){return i[r]=this.r,i[r+1]=this.g,i[r+2]=this.b,i}fromBufferAttribute(i,r){return this.r=i.getX(r),this.g=i.getY(r),this.b=i.getZ(r),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const ts=new Kt;Kt.NAMES=VW;let Nee=0;class Ku extends Tp{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Nee++}),this.uuid=Bu(),this.name="",this.type="Material",this.blending=yg,this.side=RA,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=$2,this.blendDst=eD,this.blendEquation=_f,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Kt(0,0,0),this.blendAlpha=0,this.depthFunc=KS,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=X3,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Gp,this.stencilZFail=Gp,this.stencilZPass=Gp,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(i){this._alphaTest>0!=i>0&&this.version++,this._alphaTest=i}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(i){if(i!==void 0)for(const r in i){const n=i[r];if(n===void 0){console.warn(`THREE.Material: parameter '${r}' has value of undefined.`);continue}const a=this[r];if(a===void 0){console.warn(`THREE.Material: '${r}' is not a property of THREE.${this.type}.`);continue}a&&a.isColor?a.set(n):a&&a.isVector3&&n&&n.isVector3?a.copy(n):this[r]=n}}toJSON(i){const r=i===void 0||typeof i=="string";r&&(i={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};
vendor: 12,185 bytes, line 5
5n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(i).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(i).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(i).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(i).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(i).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(i).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(i).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(i).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(i).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(i).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(i).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(i).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(i).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(i).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(i).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(i).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(i).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(i).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(i).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(i).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(i).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(i).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(i).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(i).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==yg&&(n.blending=this.blending),this.side!==RA&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==$2&&(n.blendSrc=this.blendSrc),this.blendDst!==eD&&(n.blendDst=this.blendDst),this.blendEquation!==_f&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==KS&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==X3&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Gp&&(n.stencilFail=this.stencilFail),this.stencilZFail!==Gp&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==Gp&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function a(s){const o=[];for(const l in s){const c=s[l];delete c.metadata,o.push(c)}return o}if(r){const s=a(i.textures),o=a(i.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(i){this.name=i.name,this.blending=i.blending,this.side=i.side,this.vertexColors=i.vertexColors,this.opacity=i.opacity,this.transparent=i.transparent,this.blendSrc=i.blendSrc,this.blendDst=i.blendDst,this.blendEquation=i.blendEquation,this.blendSrcAlpha=i.blendSrcAlpha,this.blendDstAlpha=i.blendDstAlpha,this.blendEquationAlpha=i.blendEquationAlpha,this.blendColor.copy(i.blendColor),this.blendAlpha=i.blendAlpha,this.depthFunc=i.depthFunc,this.depthTest=i.depthTest,this.depthWrite=i.depthWrite,this.stencilWriteMask=i.stencilWriteMask,this.stencilFunc=i.stencilFunc,this.stencilRef=i.stencilRef,this.stencilFuncMask=i.stencilFuncMask,this.stencilFail=i.stencilFail,this.stencilZFail=i.stencilZFail,this.stencilZPass=i.stencilZPass,this.stencilWrite=i.stencilWrite;const r=i.clippingPlanes;let n=null;if(r!==null){const a=r.length;n=new Array(a);for(let s=0;s!==a;++s)n[s]=r[s].clone()}return this.clippingPlanes=n,this.clipIntersection=i.clipIntersection,this.clipShadows=i.clipShadows,this.shadowSide=i.shadowSide,this.colorWrite=i.colorWrite,this.precision=i.precision,this.polygonOffset=i.polygonOffset,this.polygonOffsetFactor=i.polygonOffsetFactor,this.polygonOffsetUnits=i.polygonOffsetUnits,this.dithering=i.dithering,this.alphaTest=i.alphaTest,this.alphaHash=i.alphaHash,this.alphaToCoverage=i.alphaToCoverage,this.premultipliedAlpha=i.premultipliedAlpha,this.forceSinglePass=i.forceSinglePass,this.visible=i.visible,this.toneMapped=i.toneMapped,this.userData=JSON.parse(JSON.stringify(i.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(i){i===!0&&this.version++}}class GT extends Ku{constructor(i){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Kt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=CO,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(i)}copy(i){return super.copy(i),this.color.copy(i.color),this.map=i.map,this.lightMap=i.lightMap,this.lightMapIntensity=i.lightMapIntensity,this.aoMap=i.aoMap,this.aoMapIntensity=i.aoMapIntensity,this.specularMap=i.specularMap,this.alphaMap=i.alphaMap,this.envMap=i.envMap,this.combine=i.combine,this.reflectivity=i.reflectivity,this.refractionRatio=i.refractionRatio,this.wireframe=i.wireframe,this.wireframeLinewidth=i.wireframeLinewidth,this.wireframeLinecap=i.wireframeLinecap,this.wireframeLinejoin=i.wireframeLinejoin,this.fog=i.fog,this}}const fu=Uee();function Uee(){const t=new ArrayBuffer(4),i=new Float32Array(t),r=new Uint32Array(t),n=new Uint32Array(512),a=new Uint32Array(512);for(let c=0;c<256;++c){const h=c-127;h<-27?(n[c]=0,n[c|256]=32768,a[c]=24,a[c|256]=24):h<-14?(n[c]=1024>>-h-14,n[c|256]=1024>>-h-14|32768,a[c]=-h-1,a[c|256]=-h-1):h<=15?(n[c]=h+15<<10,n[c|256]=h+15<<10|32768,a[c]=13,a[c|256]=13):h<128?(n[c]=31744,n[c|256]=64512,a[c]=24,a[c|256]=24):(n[c]=31744,n[c|256]=64512,a[c]=13,a[c|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let c=1;c<1024;++c){let h=c<<13,u=0;for(;!(h&8388608);)h<<=1,u-=8388608;h&=-8388609,u+=947912704,s[c]=h|u}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(l[c]=1024);return{floatView:i,uint32View:r,baseTable:n,shiftTable:a,mantissaTable:s,exponentTable:o,offsetTable:l}}function Fee(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=ma(t,-65504,65504),fu.floatView[0]=t;const i=fu.uint32View[0],r=i>>23&511;return fu.baseTable[r]+((i&8388607)>>fu.shiftTable[r])}function kee(t){const i=t>>10;return fu.uint32View[0]=fu.mantissaTable[fu.offsetTable[i]+(t&1023)]+fu.exponentTable[i],fu.floatView[0]}const cF={toHalfFloat:Fee,fromHalfFloat:kee},Mn=new we,x1=new Jt;class ks{constructor(i,r,n=!1){if(Array.isArray(i))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=i,this.itemSize=r,this.count=i!==void 0?i.length/r:0,this.normalized=n,this.usage=nD,this.updateRange={offset:0,count:-1},this.gpuType=rc,this.version=0}onUploadCallback(){}set needsUpdate(i){i===!0&&this.version++}setUsage(i){return this.usage=i,this}
vendor: 4,215 bytes, line 5
5copy(i){return this.name=i.name,this.array=new i.array.constructor(i.array),this.itemSize=i.itemSize,this.count=i.count,this.normalized=i.normalized,this.usage=i.usage,this.gpuType=i.gpuType,this}copyAt(i,r,n){i*=this.itemSize,n*=r.itemSize;for(let a=0,s=this.itemSize;a<s;a++)this.array[i+a]=r.array[n+a];return this}copyArray(i){return this.array.set(i),this}applyMatrix3(i){if(this.itemSize===2)for(let r=0,n=this.count;r<n;r++)x1.fromBufferAttribute(this,r),x1.applyMatrix3(i),this.setXY(r,x1.x,x1.y);else if(this.itemSize===3)for(let r=0,n=this.count;r<n;r++)Mn.fromBufferAttribute(this,r),Mn.applyMatrix3(i),this.setXYZ(r,Mn.x,Mn.y,Mn.z);return this}applyMatrix4(i){for(let r=0,n=this.count;r<n;r++)Mn.fromBufferAttribute(this,r),Mn.applyMatrix4(i),this.setXYZ(r,Mn.x,Mn.y,Mn.z);return this}applyNormalMatrix(i){for(let r=0,n=this.count;r<n;r++)Mn.fromBufferAttribute(this,r),Mn.applyNormalMatrix(i),this.setXYZ(r,Mn.x,Mn.y,Mn.z);return this}transformDirection(i){for(let r=0,n=this.count;r<n;r++)Mn.fromBufferAttribute(this,r),Mn.transformDirection(i),this.setXYZ(r,Mn.x,Mn.y,Mn.z);return this}set(i,r=0){return this.array.set(i,r),this}getComponent(i,r){let n=this.array[i*this.itemSize+r];return this.normalized&&(n=Kc(n,this.array)),n}setComponent(i,r,n){return this.normalized&&(n=mr(n,this.array)),this.array[i*this.itemSize+r]=n,this}getX(i){let r=this.array[i*this.itemSize];return this.normalized&&(r=Kc(r,this.array)),r}setX(i,r){return this.normalized&&(r=mr(r,this.array)),this.array[i*this.itemSize]=r,this}getY(i){let r=this.array[i*this.itemSize+1];return this.normalized&&(r=Kc(r,this.array)),r}setY(i,r){return this.normalized&&(r=mr(r,this.array)),this.array[i*this.itemSize+1]=r,this}getZ(i){let r=this.array[i*this.itemSize+2];return this.normalized&&(r=Kc(r,this.array)),r}setZ(i,r){return this.normalized&&(r=mr(r,this.array)),this.array[i*this.itemSize+2]=r,this}getW(i){let r=this.array[i*this.itemSize+3];return this.normalized&&(r=Kc(r,this.array)),r}setW(i,r){return this.normalized&&(r=mr(r,this.array)),this.array[i*this.itemSize+3]=r,this}setXY(i,r,n){return i*=this.itemSize,this.normalized&&(r=mr(r,this.array),n=mr(n,this.array)),this.array[i+0]=r,this.array[i+1]=n,this}setXYZ(i,r,n,a){return i*=this.itemSize,this.normalized&&(r=mr(r,this.array),n=mr(n,this.array),a=mr(a,this.array)),this.array[i+0]=r,this.array[i+1]=n,this.array[i+2]=a,this}setXYZW(i,r,n,a,s){return i*=this.itemSize,this.normalized&&(r=mr(r,this.array),n=mr(n,this.array),a=mr(a,this.array),s=mr(s,this.array)),this.array[i+0]=r,this.array[i+1]=n,this.array[i+2]=a,this.array[i+3]=s,this}onUpload(i){return this.onUploadCallback=i,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const i={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(i.name=this.name),this.usage!==nD&&(i.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(i.updateRange=this.updateRange),i}}class WW extends ks{constructor(i,r,n){super(new Uint16Array(i),r,n)}}class jW extends ks{constructor(i,r,n){super(new Uint32Array(i),r,n)}}class Lo extends ks{constructor(i,r,n){super(new Float32Array(i),r,n)}}let Hee=0;const Fo=new _t,gx=new $r,qp=new we,Eo=new B0,fv=new B0,na=new we;class po extends Tp{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Hee++}),this.uuid=Bu(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(i){return Array.isArray(i)?this.index=new(HW(i)?jW:WW)(i,1):this.index=i,this}getAttribute(i){return this.attributes[i]}setAttribute(i,r){return this.attributes[i]=r,this}deleteAttribute(i){return delete this.attributes[i],this}hasAttribute(i){return this.attributes[i]!==void 0}addGroup(i,r,n=0){this.groups.push({start:i,count:r,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(i,r){this.drawRange.start=i,this.drawRange.count=r}applyMatrix4(i){const r=this.attributes.position;
vendor: 1,473 bytes, line 5
5r!==void 0&&(r.applyMatrix4(i),r.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const s=new Di().getNormalMatrix(i);n.applyNormalMatrix(s),n.needsUpdate=!0}const a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(i),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(i){return Fo.makeRotationFromQuaternion(i),this.applyMatrix4(Fo),this}rotateX(i){return Fo.makeRotationX(i),this.applyMatrix4(Fo),this}rotateY(i){return Fo.makeRotationY(i),this.applyMatrix4(Fo),this}rotateZ(i){return Fo.makeRotationZ(i),this.applyMatrix4(Fo),this}translate(i,r,n){return Fo.makeTranslation(i,r,n),this.applyMatrix4(Fo),this}scale(i,r,n){return Fo.makeScale(i,r,n),this.applyMatrix4(Fo),this}lookAt(i){return gx.lookAt(i),gx.updateMatrix(),this.applyMatrix4(gx.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(qp).negate(),this.translate(qp.x,qp.y,qp.z),this}setFromPoints(i){const r=[];for(let n=0,a=i.length;n<a;n++){const s=i[n];r.push(s.x,s.y,s.z||0)}return this.setAttribute("position",new Lo(r,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new B0);const i=this.attributes.position,r=this.morphAttributes.position;if(i&&i.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
5se".',this),this.boundingBox.set(new we(-1/0,-1/0,-1/0),new we(1/0,1/0,1/0));return}if(i!==void 0){if(this.boundingBox.setFromBufferAttribute(i),r)for(let n=0,a=r.length;n<a;n++){const s=r[n];Eo.setFromBufferAttribute(s),this.morphTargetsRelative?(na.addVectors(this.boundingBox.min,Eo.min),this.boundingBox.expandByPoint(na),na.addVectors(this.boundingBox.max,Eo.max),this.boundingBox.expandByPoint(na)):(this.boundingBox.expandByPoint(Eo.min),this.boundingBox.expandByPoint(Eo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new I0);const i=this.attributes.position,r=this.morphAttributes.position;if(i&&i.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
5se".',this),this.boundingSphere.set(new we,1/0);return}if(i){const n=this.boundingSphere.center;if(Eo.setFromBufferAttribute(i),r)for(let s=0,o=r.length;s<o;s++){const l=r[s];fv.setFromBufferAttribute(l),this.morphTargetsRelative?(na.addVectors(Eo.min,fv.min),Eo.expandByPoint(na),na.addVectors(Eo.max,fv.max),Eo.expandByPoint(na)):(Eo.expandByPoint(fv.min),Eo.expandByPoint(fv.max))}Eo.getCenter(n);let a=0;for(let s=0,o=i.count;s<o;s++)na.fromBufferAttribute(i,s),a=Math.max(a,n.distanceToSquared(na));if(r)for(let s=0,o=r.length;s<o;s++){const l=r[s],c=this.morphTargetsRelative;for(let h=0,u=l.count;h<u;h++)na.fromBufferAttribute(l,h),c&&(qp.fromBufferAttribute(i,h),na.add(qp)),a=Math.max(a,n.distanceToSquared(na))}this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const i=this.index,r=this.attributes;if(i===null||r.position===void 0||r.normal===void 0||r.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=i.array,a=r.position.array,s=r.normal.array,o=r.uv.array,l=a.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ks(new Float32Array(4*l),4));const c=this.getAttribute("tangent").array,h=[],u=[];for(let C=0;C<l;C++)h[C]=new we,u[C]=new we;const d=new we,A=new we,f=new we,m=new Jt,g=new Jt,p=new Jt,v=new we,_=new we;function y(C,x,R){d.fromArray(a,C*3),A.fromArray(a,x*3),f.fromArray(a,R*3),m.fromArray(o,C*2),g.fromArray(o,x*2),p.fromArray(o,R*2),A.sub(d),f.sub(d),g.sub(m),p.sub(m);const L=1/(g.x*p.y-p.x*g.y);isFinite(L)&&(v.copy(A).multiplyScalar(p.y).addScaledVector(f,-g.y).multiplyScalar(L),_.copy(f).multiplyScalar(g.x).addScaledVector(A,-p.x).multiplyScalar(L),h[C].add(v),h[x].add(v),h[R].add(v),u[C].add(_),u[x].add(_),u[R].add(_))}let w=this.groups;w.length===0&&(w=[{start:0,count:n.length}]);for(let C=0,x=w.length;C<x;++C){const R=w[C],L=R.start,I=R.count;for(let F=L,Y=L+I;F<Y;F+=3)y(n[F+0],n[F+1],n[F+2])}const b=new we,E=new we,M=new we,S=new we;function T(C){M.fromArray(s,C*3),S.copy(M);const x=h[C];b.copy(x),b.sub(M.multiplyScalar(M.dot(x))).normalize(),E.crossVectors(S,x);const L=E.dot(u[C])<0?-1:1;c[C*4]=b.x,c[C*4+1]=b.y,c[C*4+2]=b.z,c[C*4+3]=L}for(let C=0,x=w.length;C<x;++C){const R=w[C],L=R.start,I=R.count;for(let F=L,Y=L+I;F<Y;F+=3)T(n[F+0]),T(n[F+1]),T(n[F+2])}}computeVertexNormals(){const i=this.index,r=this.getAttribute("position");if(r!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ks(new Float32Array(r.count*3),3),this.setAttribute("normal",n);else for(let A=0,f=n.count;A<f;A++)n.setXYZ(A,0,0,0);const a=new we,s=new we,o=new we,l=new we,c=new we,h=new we,u=new we,d=new we;if(i)for(let A=0,f=i.count;A<f;A+=3){const m=i.getX(A+0),g=i.getX(A+1),p=i.getX(A+2);a.fromBufferAttribute(r,m),s.fromBufferAttribute(r,g),o.fromBufferAttribute(r,p),u.subVectors(o,s),d.subVectors(a,s),u.cross(d),l.fromBufferAttribute(n,m),c.fromBufferAttribute(n,g),h.fromBufferAttribute(n,p),l.add(u),c.add(u),h.add(u),n.setXYZ(m,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z),n.setXYZ(p,h.x,h.y,h.z)}else for(let A=0,f=r.count;A<f;A+=3)a.fromBufferAttribute(r,A+0),s.fromBufferAttribute(r,A+1),o.fromBufferAttribute(r,A+2),u.subVectors(o,s),d.subVectors(a,s),u.cross(d),n.setXYZ(A+0,u.x,u.y,u.z),n.setXYZ(A+1,u.x,u.y,u.z),n.setXYZ(A+2,u.x,u.y,u.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const i=this.attributes.normal;for(let r=0,n=i.count;r<n;r++)na.fromBufferAttribute(i,r),na.normalize(),i.setXYZ(r,na.x,na.y,na.z)}toNonIndexed(){function i(l,c){const h=l.array,u=l.itemSize,d=l.normalized,A=new h.constructor(c.length*u);let f=0,m=0;for(let g=0,p=c.length;g<p;g++){l.isInterleavedBufferAttribute?f=c[g]*l.data.stride+l.offset:f=c[g]*u;for(let v=0;v<u;v++)A[m++]=h[f++]}return new ks(A,u,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const r=new po,n=this.index.array,a=this.attributes;for(const l in a){const c=a[l],h=i(c,n);r.setAttribute(l,h)}const s=this.morphAttributes;for(const l in s){const c=[],h=s[l];for(let u=0,d=h.length;u<d;
vendor: 20,551 bytes, lines 5-44
5u++){const A=h[u],f=i(A,n);c.push(f)}r.morphAttributes[l]=c}r.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let l=0,c=o.length;l<c;l++){const h=o[l];r.addGroup(h.start,h.count,h.materialIndex)}return r}toJSON(){const i={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),Object.keys(this.userData).length>0&&(i.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const h in c)c[h]!==void 0&&(i[h]=c[h]);return i}i.data={attributes:{}};const r=this.index;r!==null&&(i.data.index={type:r.array.constructor.name,array:Array.prototype.slice.call(r.array)});const n=this.attributes;for(const c in n){const h=n[c];i.data.attributes[c]=h.toJSON(i.data)}const a={};let s=!1;for(const c in this.morphAttributes){const h=this.morphAttributes[c],u=[];for(let d=0,A=h.length;d<A;d++){const f=h[d];u.push(f.toJSON(i.data))}u.length>0&&(a[c]=u,s=!0)}s&&(i.data.morphAttributes=a,i.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(i.data.groups=JSON.parse(JSON.stringify(o)));const l=this.boundingSphere;return l!==null&&(i.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),i}clone(){return new this.constructor().copy(this)}copy(i){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const r={};this.name=i.name;const n=i.index;n!==null&&this.setIndex(n.clone(r));const a=i.attributes;for(const h in a){const u=a[h];this.setAttribute(h,u.clone(r))}const s=i.morphAttributes;for(const h in s){const u=[],d=s[h];for(let A=0,f=d.length;A<f;A++)u.push(d[A].clone(r));this.morphAttributes[h]=u}this.morphTargetsRelative=i.morphTargetsRelative;const o=i.groups;for(let h=0,u=o.length;h<u;h++){const d=o[h];this.addGroup(d.start,d.count,d.materialIndex)}const l=i.boundingBox;l!==null&&(this.boundingBox=l.clone());const c=i.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=i.drawRange.start,this.drawRange.count=i.drawRange.count,this.userData=i.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const hF=new _t,qA=new uE,R1=new I0,uF=new we,Zp=new we,Jp=new we,$p=new we,vx=new we,B1=new we,I1=new Jt,D1=new Jt,P1=new Jt,dF=new we,AF=new we,fF=new we,L1=new we,O1=new we;class Kr extends $r{constructor(i=new po,r=new GT){super(),this.isMesh=!0,this.type="Mesh",this.geometry=i,this.material=r,this.updateMorphTargets()}copy(i,r){return super.copy(i,r),i.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=i.morphTargetInfluences.slice()),i.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},i.morphTargetDictionary)),this.material=Array.isArray(i.material)?i.material.slice():i.material,this.geometry=i.geometry,this}updateMorphTargets(){const r=this.geometry.morphAttributes,n=Object.keys(r);if(n.length>0){const a=r[n[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=a.length;s<o;s++){const l=a[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}getVertexPosition(i,r){const n=this.geometry,a=n.attributes.position,s=n.morphAttributes.position,o=n.morphTargetsRelative;r.fromBufferAttribute(a,i);const l=this.morphTargetInfluences;if(s&&l){B1.set(0,0,0);for(let c=0,h=s.length;c<h;c++){const u=l[c],d=s[c];u!==0&&(vx.fromBufferAttribute(d,i),o?B1.addScaledVector(vx,u):B1.addScaledVector(vx.sub(r),u))}r.add(B1)}return r}raycast(i,r){const n=this.geometry,a=this.material,s=this.matrixWorld;a!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),R1.copy(n.boundingSphere),R1.applyMatrix4(s),qA.copy(i.ray).recast(i.near),!(R1.containsPoint(qA.origin)===!1&&(qA.intersectSphere(R1,uF)===null||qA.origin.distanceToSquared(uF)>(i.far-i.near)**2))&&(hF.copy(s).invert(),qA.copy(i.ray).applyMatrix4(hF),!(n.boundingBox!==null&&qA.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(i,r,qA)))}_computeIntersections(i,r,n){let a;const s=this.geometry,o=this.material,l=s.index,c=s.attributes.position,h=s.attributes.uv,u=s.attributes.uv1,d=s.attributes.normal,A=s.groups,f=s.drawRange;if(l!==null)if(Array.isArray(o))for(let m=0,g=A.length;m<g;m++){const p=A[m],v=o[p.materialIndex],_=Math.max(p.start,f.start),y=Math.min(l.count,Math.min(p.start+p.count,f.start+f.count));for(let w=_,b=y;w<b;w+=3){const E=l.getX(w),M=l.getX(w+1),S=l.getX(w+2);a=N1(this,v,i,n,h,u,d,E,M,S),a&&(a.faceIndex=Math.floor(w/3),a.face.materialIndex=p.materialIndex,r.push(a))}}else{const m=Math.max(0,f.start),g=Math.min(l.count,f.start+f.count);for(let p=m,v=g;p<v;p+=3){const _=l.getX(p),y=l.getX(p+1),w=l.getX(p+2);a=N1(this,o,i,n,h,u,d,_,y,w),a&&(a.faceIndex=Math.floor(p/3),r.push(a))}}else if(c!==void 0)if(Array.isArray(o))for(let m=0,g=A.length;m<g;m++){const p=A[m],v=o[p.materialIndex],_=Math.max(p.start,f.start),y=Math.min(c.count,Math.min(p.start+p.count,f.start+f.count));for(let w=_,b=y;w<b;w+=3){const E=w,M=w+1,S=w+2;a=N1(this,v,i,n,h,u,d,E,M,S),a&&(a.faceIndex=Math.floor(w/3),a.face.materialIndex=p.materialIndex,r.push(a))}}else{const m=Math.max(0,f.start),g=Math.min(c.count,f.start+f.count);for(let p=m,v=g;p<v;p+=3){const _=p,y=p+1,w=p+2;a=N1(this,o,i,n,h,u,d,_,y,w),a&&(a.faceIndex=Math.floor(p/3),r.push(a))}}}}function Gee(t,i,r,n,a,s,o,l){let c;if(i.side===fs?c=n.intersectTriangle(o,s,a,!0,l):c=n.intersectTriangle(a,s,o,i.side===RA,l),c===null)return null;O1.copy(l),O1.applyMatrix4(t.matrixWorld);const h=r.ray.origin.distanceTo(O1);return h<r.near||h>r.far?null:{distance:h,point:O1.clone(),object:t}}function N1(t,i,r,n,a,s,o,l,c,h){t.getVertexPosition(l,Zp),t.getVertexPosition(c,Jp),t.getVertexPosition(h,$p);const u=Gee(t,i,r,n,Zp,Jp,$p,L1);if(u){a&&(I1.fromBufferAttribute(a,l),D1.fromBufferAttribute(a,c),P1.fromBufferAttribute(a,h),u.uv=Bo.getInterpolation(L1,Zp,Jp,$p,I1,D1,P1,new Jt)),s&&(I1.fromBufferAttribute(s,l),D1.fromBufferAttribute(s,c),P1.fromBufferAttribute(s,h),u.uv1=Bo.getInterpolation(L1,Zp,Jp,$p,I1,D1,P1,new Jt),u.uv2=u.uv1),o&&(dF.fromBufferAttribute(o,l),AF.fromBufferAttribute(o,c),fF.fromBufferAttribute(o,h),u.normal=Bo.getInterpolation(L1,Zp,Jp,$p,dF,AF,fF,new we),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const d={a:l,b:c,c:h,normal:new we,materialIndex:0};Bo.getNormal(Zp,Jp,$p,d.normal),u.face=d}return u}class dE extends po{constructor(i=1,r=1,n=1,a=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:i,height:r,depth:n,widthSegments:a,heightSegments:s,depthSegments:o};const l=this;a=Math.floor(a),s=Math.floor(s),o=Math.floor(o);const c=[],h=[],u=[],d=[];let A=0,f=0;m("z","y","x",-1,-1,n,r,i,o,s,0),m("z","y","x",1,-1,n,r,-i,o,s,1),m("x","z","y",1,1,i,n,r,a,o,2),m("x","z","y",1,-1,i,n,-r,a,o,3),m("x","y","z",1,-1,i,r,n,a,s,4),m("x","y","z",-1,-1,i,r,-n,a,s,5),this.setIndex(c),this.setAttribute("position",new Lo(h,3)),this.setAttribute("normal",new Lo(u,3)),this.setAttribute("uv",new Lo(d,2));function m(g,p,v,_,y,w,b,E,M,S,T){const C=w/M,x=b/S,R=w/2,L=b/2,I=E/2,F=M+1,Y=S+1;let D=0,U=0;const j=new we;for(let J=0;J<Y;J++){const z=J*x-L;for(let $=0;$<F;$++){const te=$*C-R;j[g]=te*_,j[p]=z*y,j[v]=I,h.push(j.x,j.y,j.z),j[g]=0,j[p]=0,j[v]=E>0?1:-1,u.push(j.x,j.y,j.z),d.push($/M),d.push(1-J/S),D+=1}}for(let J=0;J<S;J++)for(let z=0;z<M;z++){const $=A+z+F*J,te=A+z+F*(J+1),ae=A+(z+1)+F*(J+1),ve=A+(z+1)+F*J;c.push($,te,ve),c.push(te,ae,ve),U+=6}l.addGroup(f,U,T),f+=U,A+=D}}copy(i){return super.copy(i),this.parameters=Object.assign({},i.parameters),this}static fromJSON(i){return new dE(i.width,i.height,i.depth,i.widthSegments,i.heightSegments,i.depthSegments)}}function e0(t){const i={};for(const r in t){i[r]={};for(const n in t[r]){const a=t[r][n];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture||a.isQuaternion)?a.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),i[r][n]=null):i[r][n]=a.clone():Array.isArray(a)?i[r][n]=a.slice():i[r][n]=a}}return i}function Ts(t){const i={};for(let r=0;r<t.length;r++){const n=e0(t[r]);for(const a in n)i[a]=n[a]}return i}function zee(t){const i=[];for(let r=0;r<t.length;r++)i.push(t[r].clone());return i}function YW(t){return t.getRenderTarget()===null?t.outputColorSpace:vr.workingColorSpace}const Qee={clone:e0,merge:Ts};var Vee=`void main() { 6 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 7}`,Wee=`void main() { 8 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 9}`;class co extends Ku{constructor(i){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Vee,this.fragmentShader=Wee,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,i!==void 0&&this.setValues(i)}copy(i){return super.copy(i),this.fragmentShader=i.fragmentShader,this.vertexShader=i.vertexShader,this.uniforms=e0(i.uniforms),this.uniformsGroups=zee(i.uniformsGroups),this.defines=Object.assign({},i.defines),this.wireframe=i.wireframe,this.wireframeLinewidth=i.wireframeLinewidth,this.fog=i.fog,this.lights=i.lights,this.clipping=i.clipping,this.extensions=Object.assign({},i.extensions),this.glslVersion=i.glslVersion,this}toJSON(i){const r=super.toJSON(i);r.glslVersion=this.glslVersion,r.uniforms={};for(const a in this.uniforms){const o=this.uniforms[a].value;o&&o.isTexture?r.uniforms[a]={type:"t",value:o.toJSON(i).uuid}:o&&o.isColor?r.uniforms[a]={type:"c",value:o.getHex()}:o&&o.isVector2?r.uniforms[a]={type:"v2",value:o.toArray()}:o&&o.isVector3?r.uniforms[a]={type:"v3",value:o.toArray()}:o&&o.isVector4?r.uniforms[a]={type:"v4",value:o.toArray()}:o&&o.isMatrix3?r.uniforms[a]={type:"m3",value:o.toArray()}:o&&o.isMatrix4?r.uniforms[a]={type:"m4",value:o.toArray()}:r.uniforms[a]={value:o}}Object.keys(this.defines).length>0&&(r.defines=this.defines),r.vertexShader=this.vertexShader,r.fragmentShader=this.fragmentShader,r.lights=this.lights,r.clipping=this.clipping;const n={};for(const a in this.extensions)this.extensions[a]===!0&&(n[a]=!0);return Object.keys(n).length>0&&(r.extensions=n),r}}class KW extends $r{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new _t,this.projectionMatrix=new _t,this.projectionMatrixInverse=new _t,this.coordinateSystem=Eu}copy(i,r){return super.copy(i,r),this.matrixWorldInverse.copy(i.matrixWorldInverse),this.projectionMatrix.copy(i.projectionMatrix),this.projectionMatrixInverse.copy(i.projectionMatrixInverse),this.coordinateSystem=i.coordinateSystem,this}getWorldDirection(i){return super.getWorldDirection(i).negate()}updateMatrixWorld(i){super.updateMatrixWorld(i),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(i,r){super.updateWorldMatrix(i,r),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class Rr extends KW{constructor(i=50,r=1,n=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=i,this.zoom=1,this.near=n,this.far=a,this.focus=10,this.aspect=r,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(i,r){return super.copy(i,r),this.fov=i.fov,this.zoom=i.zoom,this.near=i.near,this.far=i.far,this.focus=i.focus,this.aspect=i.aspect,this.view=i.view===null?null:Object.assign({},i.view),this.filmGauge=i.filmGauge,this.filmOffset=i.filmOffset,this}setFocalLength(i){const r=.5*this.getFilmHeight()/i;this.fov=$g*2*Math.atan(r),this.updateProjectionMatrix()}getFocalLength(){const i=Math.tan(Eg*.5*this.fov);return .5*this.getFilmHeight()/i}getEffectiveFOV(){return $g*2*Math.atan(Math.tan(Eg*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(i,r,n,a,s,o){this.aspect=i/r,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=i,this.view.fullHeight=r,this.view.offsetX=n,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const i=this.near;let r=i*Math.tan(Eg*.5*this.fov)/this.zoom,n=2*r,a=this.aspect*n,s=-.5*a;const o=this.view;if(this.view!==null&&this.view.enabled){const c=o.fullWidth,h=o.fullHeight;s+=o.offsetX*a/c,r-=o.offsetY*n/h,a*=o.width/c,n*=o.height/h}const l=this.filmOffset;l!==0&&(s+=i*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+a,r,r-n,i,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(i){const r=super.toJSON(i);return r.object.fov=this.fov,r.object.zoom=this.zoom,r.object.near=this.near,r.object.far=this.far,r.object.focus=this.focus,r.object.aspect=this.aspect,this.view!==null&&(r.object.view=Object.assign({},this.view)),r.object.filmGauge=this.filmGauge,r.object.filmOffset=this.filmOffset,r}}const em=-90,tm=1;class jee extends $r{constructor(i,r,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new Rr(em,tm,i,r);a.layers=this.layers,this.add(a);const s=new Rr(em,tm,i,r);s.layers=this.layers,this.add(s);const o=new Rr(em,tm,i,r);o.layers=this.layers,this.add(o);const l=new Rr(em,tm,i,r);l.layers=this.layers,this.add(l);const c=new Rr(em,tm,i,r);c.layers=this.layers,this.add(c);const h=new Rr(em,tm,i,r);h.layers=this.layers,this.add(h)}updateCoordinateSystem(){const i=this.coordinateSystem,r=this.children.concat(),[n,a,s,o,l,c]=r;for(const h of r)this.remove(h);if(i===Eu)n.up.set(0,1,0),n.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),l.up.set(0,1,0),l.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(i===JS)n.up.set(0,-1,0),n.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),l.up.set(0,-1,0),l.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+i);for(const h of r)this.add(h),h.updateMatrixWorld()}update(i,r){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:a}=this;this.coordinateSystem!==i.coordinateSystem&&(this.coordinateSystem=i.coordinateSystem,this.updateCoordinateSystem());const[s,o,l,c,h,u]=this.children,d=i.getRenderTarget(),A=i.getActiveCubeFace(),f=i.getActiveMipmapLevel(),m=i.xr.enabled;i.xr.enabled=!1;const g=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,i.setRenderTarget(n,0,a),i.render(r,s),i.setRenderTarget(n,1,a),i.render(r,o),i.setRenderTarget(n,2,a),i.render(r,l),i.setRenderTarget(n,3,a),i.render(r,c),i.setRenderTarget(n,4,a),i.render(r,h),n.texture.generateMipmaps=g,i.setRenderTarget(n,5,a),i.render(r,u),i.setRenderTarget(d,A,f),i.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class XW extends ps{constructor(i,r,n,a,s,o,l,c,h,u){i=i!==void 0?i:[],r=r!==void 0?r:Xg,super(i,r,n,a,s,o,l,c,h,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(i){this.image=i}}class Yee extends ap{constructor(i=1,r={}){super(i,i,r),this.isWebGLCubeRenderTarget=!0;const n={width:i,height:i,depth:1},a=[n,n,n,n,n,n];r.encoding!==void 0&&(L_("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),r.colorSpace=r.encoding===Xf?Fa:Io),this.texture=new XW(a,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:pa}fromEquirectangularTexture(i,r){this.texture.type=r.type,this.texture.colorSpace=r.colorSpace,this.texture.generateMipmaps=r.generateMipmaps,this.texture.minFilter=r.minFilter,this.texture.magFilter=r.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` 10 11 varying vec3 vWorldDirection; 12 13 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 14 15 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 16 17 } 18 19 void main() { 20 21 vWorldDirection = transformDirection( position, modelMatrix ); 22 23 #include <begin_vertex> 24 #include <project_vertex> 25 26 } 27 `,fragmentShader:` 28 29 uniform sampler2D tEquirect; 30 31 varying vec3 vWorldDirection; 32 33 #include <common> 34 35 void main() { 36 37 vec3 direction = normalize( vWorldDirection ); 38 39 vec2 sampleUV = equirectUv( direction ); 40 41 gl_FragColor = texture2D( tEquirect, sampleUV ); 42 43 } 44 `},a=new dE(5,5,5),s=new co({name:"CubemapFromEquirect",uniforms:e0(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:fs,blending:mA});s.uniforms.tEquirect.value=r;const o=new Kr(a,s),l=r.minFilter;return r.minFilter===Zg&&(r.minFilter=pa),new jee(1,10,this).update(i,o),r.minFilter=l,o.geometry.dispose(),o.material.dispose(),this}clear(i,r,n,a){const s=i.getRenderTarget();for(let o=0;o<6;o++)i.setRenderTarget(this,o),i.clear(r,n,a);i.setRenderTarget(s)}}const _x=new we,Kee=new we,Xee=new Di;class Ld{constructor(i=new we(1,0,0),r=0){this.isPlane=!0,this.normal=i,this.constant=r}set(i,r){return this.normal.copy(i),this.constant=r,this}setComponents(i,r,n,a){return this.normal.set(i,r,n),this.constant=a,this}setFromNormalAndCoplanarPoint(i,r){return this.normal.copy(i),this.constant=-r.dot(this.normal),this}setFromCoplanarPoints(i,r,n){const a=_x.subVectors(n,r).cross(Kee.subVectors(i,r)).normalize();return this.setFromNormalAndCoplanarPoint(a,i),this}copy(i){return this.normal.copy(i.normal),this.constant=i.constant,this}normalize(){const i=1/this.normal.length();return this.normal.multiplyScalar(i),this.constant*=i,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(i){return this.normal.dot(i)+this.constant}distanceToSphere(i){return this.distanceToPoint(i.center)-i.radius}projectPoint(i,r){return r.copy(i).addScaledVector(this.normal,-this.distanceToPoint(i))}intersectLine(i,r){const n=i.delta(_x),a=this.normal.dot(n);if(a===0)return this.distanceToPoint(i.start)===0?r.copy(i.start):null;const s=-(i.start.dot(this.normal)+this.constant)/a;return s<0||s>1?null:r.copy(i.start).addScaledVector(n,s)}intersectsLine(i){const r=this.distanceToPoint(i.start),n=this.distanceToPoint(i.end);return r<0&&n>0||n<0&&r>0}intersectsBox(i){return i.intersectsPlane(this)}intersectsSphere(i){return i.intersectsPlane(this)}coplanarPoint(i){return i.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(i,r){const n=r||Xee.getNormalMatrix(i),a=this.coplanarPoint(_x).applyMatrix4(i),s=this.normal.applyMatrix3(n).normalize();return this.constant=-a.dot(s),this}translate(i){return this.constant-=i.dot(this.normal),this}equals(i){return i.normal.equals(this.normal)&&i.constant===this.constant}clone(){return new this.constructor().copy(this)}}const ZA=new I0,U1=new we;class IO{constructor(i=new Ld,r=new Ld,n=new Ld,a=new Ld,s=new Ld,o=new Ld){this.planes=[i,r,n,a,s,o]}set(i,r,n,a,s,o){const l=this.planes;return l[0].copy(i),l[1].copy(r),l[2].copy(n),l[3].copy(a),l[4].copy(s),l[5].copy(o),this}copy(i){const r=this.planes;for(let n=0;n<6;n++)r[n].copy(i.planes[n]);return this}setFromProjectionMatrix(i,r=Eu){const n=this.planes,a=i.elements,s=a[0],o=a[1],l=a[2],c=a[3],h=a[4],u=a[5],d=a[6],A=a[7],f=a[8],m=a[9],g=a[10],p=a[11],v=a[12],_=a[13],y=a[14],w=a[15];if(n[0].setComponents(c-s,A-h,p-f,w-v).normalize(),n[1].setComponents(c+s,A+h,p+f,w+v).normalize(),n[2].setComponents(c+o,A+u,p+m,w+_).normalize(),n[3].setComponents(c-o,A-u,p-m,w-_).normalize(),n[4].setComponents(c-l,A-d,p-g,w-y).normalize(),r===Eu)n[5].setComponents(c+l,A+d,p+g,w+y).normalize();else if(r===JS)n[5].setComponents(l,d,g,y).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+r);return this}intersectsObject(i){if(i.boundingSphere!==void 0)i.boundingSphere===null&&i.computeBoundingSphere(),ZA.copy(i.boundingSphere).applyMatrix4(i.matrixWorld);else{const r=i.geometry;r.boundingSphere===null&&r.computeBoundingSphere(),ZA.copy(r.boun
vendor: 5,475 bytes, lines 44-98
44dingSphere).applyMatrix4(i.matrixWorld)}return this.intersectsSphere(ZA)}intersectsSprite(i){return ZA.center.set(0,0,0),ZA.radius=.7071067811865476,ZA.applyMatrix4(i.matrixWorld),this.intersectsSphere(ZA)}intersectsSphere(i){const r=this.planes,n=i.center,a=-i.radius;for(let s=0;s<6;s++)if(r[s].distanceToPoint(n)<a)return!1;return!0}intersectsBox(i){const r=this.planes;for(let n=0;n<6;n++){const a=r[n];if(U1.x=a.normal.x>0?i.max.x:i.min.x,U1.y=a.normal.y>0?i.max.y:i.min.y,U1.z=a.normal.z>0?i.max.z:i.min.z,a.distanceToPoint(U1)<0)return!1}return!0}containsPoint(i){const r=this.planes;for(let n=0;n<6;n++)if(r[n].distanceToPoint(i)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function qW(){let t=null,i=!1,r=null,n=null;function a(s,o){r(s,o),n=t.requestAnimationFrame(a)}return{start:function(){i!==!0&&r!==null&&(n=t.requestAnimationFrame(a),i=!0)},stop:function(){t.cancelAnimationFrame(n),i=!1},setAnimationLoop:function(s){r=s},setContext:function(s){t=s}}}function qee(t,i){const r=i.isWebGL2,n=new WeakMap;function a(h,u){const d=h.array,A=h.usage,f=t.createBuffer();t.bindBuffer(u,f),t.bufferData(u,d,A),h.onUploadCallback();let m;if(d instanceof Float32Array)m=t.FLOAT;else if(d instanceof Uint16Array)if(h.isFloat16BufferAttribute)if(r)m=t.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else m=t.UNSIGNED_SHORT;else if(d instanceof Int16Array)m=t.SHORT;else if(d instanceof Uint32Array)m=t.UNSIGNED_INT;else if(d instanceof Int32Array)m=t.INT;else if(d instanceof Int8Array)m=t.BYTE;else if(d instanceof Uint8Array)m=t.UNSIGNED_BYTE;else if(d instanceof Uint8ClampedArray)m=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:f,type:m,bytesPerElement:d.BYTES_PER_ELEMENT,version:h.version}}function s(h,u,d){const A=u.array,f=u.updateRange;t.bindBuffer(d,h),f.count===-1?t.bufferSubData(d,0,A):(r?t.bufferSubData(d,f.offset*A.BYTES_PER_ELEMENT,A,f.offset,f.count):t.bufferSubData(d,f.offset*A.BYTES_PER_ELEMENT,A.subarray(f.offset,f.offset+f.count)),f.count=-1),u.onUploadCallback()}function o(h){return h.isInterleavedBufferAttribute&&(h=h.data),n.get(h)}function l(h){h.isInterleavedBufferAttribute&&(h=h.data);const u=n.get(h);u&&(t.deleteBuffer(u.buffer),n.delete(h))}function c(h,u){if(h.isGLBufferAttribute){const A=n.get(h);(!A||A.version<h.version)&&n.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}h.isInterleavedBufferAttribute&&(h=h.data);const d=n.get(h);d===void 0?n.set(h,a(h,u)):d.version<h.version&&(s(d.buffer,h,u),d.version=h.version)}return{get:o,remove:l,update:c}}class DO extends po{constructor(i=1,r=1,n=1,a=1){super(),this.type="PlaneGeometry",this.parameters={width:i,height:r,widthSegments:n,heightSegments:a};const s=i/2,o=r/2,l=Math.floor(n),c=Math.floor(a),h=l+1,u=c+1,d=i/l,A=r/c,f=[],m=[],g=[],p=[];for(let v=0;v<u;v++){const _=v*A-o;for(let y=0;y<h;y++){const w=y*d-s;m.push(w,-_,0),g.push(0,0,1),p.push(y/l),p.push(1-v/c)}}for(let v=0;v<c;v++)for(let _=0;_<l;_++){const y=_+h*v,w=_+h*(v+1),b=_+1+h*(v+1),E=_+1+h*v;f.push(y,w,E),f.push(w,b,E)}this.setIndex(f),this.setAttribute("position",new Lo(m,3)),this.setAttribute("normal",new Lo(g,3)),this.setAttribute("uv",new Lo(p,2))}copy(i){return super.copy(i),this.parameters=Object.assign({},i.parameters),this}static fromJSON(i){return new DO(i.width,i.height,i.widthSegments,i.heightSegments)}}var Zee=`#ifdef USE_ALPHAHASH 45 if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard; 46#endif`,Jee=`#ifdef USE_ALPHAHASH 47 const float ALPHA_HASH_SCALE = 0.05; 48 float hash2D( vec2 value ) { 49 return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) ); 50 } 51 float hash3D( vec3 value ) { 52 return hash2D( vec2( hash2D( value.xy ), value.z ) ); 53 } 54 float getAlphaHashThreshold( vec3 position ) { 55 float maxDeriv = max( 56 length( dFdx( position.xyz ) ), 57 length( dFdy( position.xyz ) ) 58 ); 59 float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv ); 60 vec2 pixScales = vec2( 61 exp2( floor( log2( pixScale ) ) ), 62 exp2( ceil( log2( pixScale ) ) ) 63 ); 64 vec2 alpha = vec2( 65 hash3D( floor( pixScales.x * position.xyz ) ), 66 hash3D( floor( pixScales.y * position.xyz ) ) 67 ); 68 float lerpFactor = fract( log2( pixScale ) ); 69 float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y; 70 float a = min( lerpFactor, 1.0 - lerpFactor ); 71 vec3 cases = vec3( 72 x * x / ( 2.0 * a * ( 1.0 - a ) ), 73 ( x - 0.5 * a ) / ( 1.0 - a ), 74 1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) ) 75 ); 76 float threshold = ( x < ( 1.0 - a ) ) 77 ? ( ( x < a ) ? cases.x : cases.y ) 78 : cases.z; 79 return clamp( threshold , 1.0e-6, 1.0 ); 80 } 81#endif`,$ee=`#ifdef USE_ALPHAMAP 82 diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g; 83#endif`,ete=`#ifdef USE_ALPHAMAP 84 uniform sampler2D alphaMap; 85#endif`,tte=`#ifdef USE_ALPHATEST 86 if ( diffuseColor.a < alphaTest ) discard; 87#endif`,ite=`#ifdef USE_ALPHATEST 88 uniform float alphaTest; 89#endif`,rte=`#ifdef USE_AOMAP 90 float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0; 91 reflectedLight.indirectDiffuse *= ambientOcclusion; 92 #if defined( USE_CLEARCOAT ) 93 clearcoatSpecularIndirect *= ambientOcclusion; 94 #endif 95 #if defined( USE_SHEEN ) 96 sheenSpecularIndirect *= ambientOcclusion; 97 #endif 98 #if defined( USE_ENVMAP ) && defined( STANDARD )
99 float dotNV = saturate( dot( geometryNormal, geometryViewDir ) ); 100 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 101 #endif 102#endif`,nte=`#ifdef USE_AOMAP 103 uniform sampler2D aoMap; 104 uniform float aoMapIntensity; 105#endif`,ate=`vec3 transformed = vec3( position ); 106#ifdef USE_ALPHAHASH 107 vPosition = vec3( position ); 108#endif`,ste=`vec3 objectNormal = vec3( normal ); 109#ifdef USE_TANGENT 110 vec3 objectTangent = vec3( tangent.xyz ); 111#endif`,ote=`float G_BlinnPhong_Implicit( ) { 112 return 0.25; 113} 114float D_BlinnPhong( const in float shininess, const in float dotNH ) { 115 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 116} 117vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 118 vec3 halfDir = normalize( lightDir + viewDir ); 119 float dotNH = saturate( dot( normal, halfDir ) ); 120 float dotVH = saturate( dot( viewDir, halfDir ) ); 121 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 122 float G = G_BlinnPhong_Implicit( ); 123 float D = D_BlinnPhong( shininess, dotNH ); 124 return F * ( G * D ); 125} // validated`,lte=`#ifdef USE_IRIDESCENCE 126 const mat3 XYZ_TO_REC709 = mat3( 127 3.2404542, -0.9692660, 0.0556434, 128 -1.5371385, 1.8760108, -0.2040259, 129 -0.4985314, 0.0415560, 1.0572252 130 ); 131 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 132 vec3 sqrtF0 = sqrt( fresnel0 ); 133 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 134 } 135 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 136 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 137 } 138 float IorToFresnel0( float transmittedIor, float incidentIor ) { 139 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 140 } 141 vec3 evalSensitivity( float OPD, vec3 shift ) { 142 float phase = 2.0 * PI * OPD * 1.0e-9; 143 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 144 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 145 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 146 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 147 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 148 xyz /= 1.0685e-7; 149 vec3 rgb = XYZ_TO_REC709 * xyz; 150 return rgb; 151 } 152 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 153 vec3 I; 154 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 155 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 156 float cosTheta2Sq = 1.0 - sinTheta2Sq; 157 if ( cosTheta2Sq < 0.0 ) { 158 return vec3( 1.0 ); 159 } 160 float cosTheta2 = sqrt( cosTheta2Sq ); 161 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR ); 162 float R12 = F_Schlick( R0, 1.0, cosTheta1 );
163 float T121 = 1.0 - R12; 164 float phi12 = 0.0; 165 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 166 float phi21 = PI - phi12; 167 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 168 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 169 vec3 phi23 = vec3( 0.0 ); 170 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 171 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 172 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 173 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 174 vec3 phi = vec3( phi21 ) + phi23; 175 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 176 vec3 r123 = sqrt( R123 ); 177 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 178 vec3 C0 = R12 + Rs; 179 I = C0; 180 vec3 Cm = Rs - T121; 181 for ( int m = 1; m <= 2; ++ m ) { 182 Cm *= r123; 183 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 184 I += Cm * Sm; 185 } 186 return max( I, vec3( 0.0 ) ); 187 } 188#endif`,cte=`#ifdef USE_BUMPMAP 189 uniform sampler2D bumpMap; 190 uniform float bumpScale; 191 vec2 dHdxy_fwd() { 192 vec2 dSTdx = dFdx( vBumpMapUv ); 193 vec2 dSTdy = dFdy( vBumpMapUv ); 194 float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x; 195 float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll; 196 float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll; 197 return vec2( dBx, dBy ); 198 } 199 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 200 vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) ); 201 vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) ); 202 vec3 vN = surf_norm; 203 vec3 R1 = cross( vSigmaY, vN ); 204 vec3 R2 = cross( vN, vSigmaX ); 205 float fDet = dot( vSigmaX, R1 ) * faceDirection; 206 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 207 return normalize( abs( fDet ) * surf_norm - vGrad ); 208 } 209#endif`,hte=`#if NUM_CLIPPING_PLANES > 0 210 vec4 plane; 211 #pragma unroll_loop_start 212 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 213 plane = clippingPlanes[ i ]; 214 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 215 } 216 #pragma unroll_loop_end 217 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 218 bool clipped = true; 219 #pragma unroll_loop_start 220 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 221 plane = clippingPlanes[ i ]; 222 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 223 } 224 #pragma unroll_loop_end 225 if ( clipped ) discard; 226 #endif 227#endif`,ute=`#if NUM_CLIPPING_PLANES > 0 228 varying vec3 vClipPosition; 229 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 230#endif`,dte=`#if NUM_CLIPPING_PLANES > 0 231 varying vec3 vClipPosition; 232#endif`,Ate=`#if NUM_CLIPPING_PLANES > 0 233 vClipPosition = - mvPosition.xyz; 234#endif`,fte=`#if defined( USE_COLOR_ALPHA ) 235 diffuseColor *= vColor; 236#elif defined( USE_COLOR ) 237 diffuseColor.rgb *= vColor; 238#endif`,pte=`#if defined( USE_COLOR_ALPHA ) 239 varying vec4 vColor; 240#elif defined( USE_COLOR ) 241 varying vec3 vColor; 242#endif`,mte=`#if defined( USE_COLOR_ALPHA ) 243 varying vec4 vColor; 244#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 245 varying vec3 vColor; 246#endif`,gte=`#if defined( USE_COLOR_ALPHA ) 247 vColor = vec4( 1.0 ); 248#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 249 vColor = vec3( 1.0 ); 250#endif 251#ifdef USE_COLOR 252 vColor *= color; 253#endif 254#ifdef USE_INSTANCING_COLOR 255 vColor.xyz *= instanceColor.xyz; 256#endif`,vte=`#define PI 3.141592653589793 257#define PI2 6.283185307179586 258#define PI_HALF 1.5707963267948966 259#define RECIPROCAL_PI 0.3183098861837907 260#define RECIPROCAL_PI2 0.15915494309189535 261#define EPSILON 1e-6 262#ifndef saturate 263#define saturate( a ) clamp( a, 0.0, 1.0 ) 264#endif 265#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 266float pow2( const in float x ) { return x*x; } 267vec3 pow2( const in vec3 x ) { return x*x; } 268float pow3( const in float x ) { return x*x*x; } 269float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 270float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 271float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 272highp float rand( const in vec2 uv ) { 273 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 274 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 275 return fract( sin( sn ) * c ); 276} 277#ifdef HIGH_PRECISION 278 float precisionSafeLength( vec3 v ) { return length( v ); } 279#else 280 float precisionSafeLength( vec3 v ) { 281 float maxComponent = max3( abs( v ) ); 282 return length( v / maxComponent ) * maxComponent; 283 } 284#endif 285struct IncidentLight { 286 vec3 color; 287 vec3 direction; 288 bool visible; 289}; 290struct ReflectedLight { 291 vec3 directDiffuse; 292 vec3 directSpecular; 293 vec3 indirectDiffuse; 294 vec3 indirectSpecular; 295}; 296#ifdef USE_ALPHAHASH 297 varying vec3 vPosition; 298#endif 299vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 300 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 301} 302vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 303 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 304} 305mat3 transposeMat3( const in mat3 m ) { 306 mat3 tmp; 307 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 308 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 309 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 310 return tmp; 311} 312float luminance( const in vec3 rgb ) { 313 const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); 314 return dot( weights, rgb ); 315} 316bool isPerspectiveMatrix( mat4 m ) { 317 return m[ 2 ][ 3 ] == - 1.0; 318} 319vec2 equirectUv( in vec3 dir ) { 320 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 321 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 322 return vec2( u, v ); 323}
324vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 325 return RECIPROCAL_PI * diffuseColor; 326} 327vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 328 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 329 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 330} 331float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 332 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 333 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 334} // validated`,_te=`#ifdef ENVMAP_TYPE_CUBE_UV 335 #define cubeUV_minMipLevel 4.0 336 #define cubeUV_minTileSize 16.0 337 float getFace( vec3 direction ) { 338 vec3 absDirection = abs( direction ); 339 float face = - 1.0; 340 if ( absDirection.x > absDirection.z ) { 341 if ( absDirection.x > absDirection.y ) 342 face = direction.x > 0.0 ? 0.0 : 3.0; 343 else 344 face = direction.y > 0.0 ? 1.0 : 4.0; 345 } else { 346 if ( absDirection.z > absDirection.y ) 347 face = direction.z > 0.0 ? 2.0 : 5.0; 348 else 349 face = direction.y > 0.0 ? 1.0 : 4.0; 350 } 351 return face; 352 } 353 vec2 getUV( vec3 direction, float face ) { 354 vec2 uv; 355 if ( face == 0.0 ) { 356 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 357 } else if ( face == 1.0 ) { 358 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 359 } else if ( face == 2.0 ) { 360 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 361 } else if ( face == 3.0 ) { 362 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 363 } else if ( face == 4.0 ) { 364 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 365 } else { 366 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 367 } 368 return 0.5 * ( uv + 1.0 ); 369 } 370 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 371 float face = getFace( direction ); 372 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 373 mipInt = max( mipInt, cubeUV_minMipLevel ); 374 float faceSize = exp2( mipInt ); 375 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 376 if ( face > 2.0 ) { 377 uv.y += faceSize; 378 face -= 3.0; 379 } 380 uv.x += face * faceSize; 381 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 382 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 383 uv.x *= CUBEUV_TEXEL_WIDTH; 384 uv.y *= CUBEUV_TEXEL_HEIGHT; 385 #ifdef texture2DGradEXT 386 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 387 #else 388 return texture2D( envMap, uv ).rgb; 389 #endif 390 } 391 #define cubeUV_r0 1.0 392 #define cubeUV_v0 0.339 393 #define cubeUV_m0 - 2.0 394 #define cubeUV_r1 0.8 395 #define cubeUV_v1 0.276 396 #define cubeUV_m1 - 1.0 397 #define cubeUV_r4 0.4 398 #define cubeUV_v4 0.046 399 #define cubeUV_m4 2.0 400 #define cubeUV_r5 0.305 401 #define cubeUV_v5 0.016 402 #define cubeUV_m5 3.0 403 #define cubeUV_r6 0.21 404 #define cubeUV_v6 0.0038 405 #define cubeUV_m6 4.0 406 float roughnessToMip( float roughness ) { 407 float mip = 0.0; 408 if ( roughness >= cubeUV_r1 ) { 409 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 410 } else if ( roughness >= cubeUV_r4 ) { 411 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 412 } else if ( roughness >= cubeUV_r5 ) { 413 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 414 } else if ( roughness >= cubeUV_r6 ) { 415 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 416 } else { 417 mip = - 2.0 * log2( 1.16 * roughness ); } 418 return mip; 419 } 420 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 421 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 422 float mipF = fract( mip ); 423 float mipInt = floor( mip ); 424 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 425 if ( mipF == 0.0 ) { 426 return vec4( color0, 1.0 ); 427 } else { 428 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 429 return vec4( mix( color0, color1, mipF ), 1.0 ); 430 } 431 } 432#endif`,yte=`vec3 transformedNormal = objectNormal; 433#ifdef USE_INSTANCING 434 mat3 m = mat3( instanceMatrix ); 435 transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); 436 transformedNormal = m * transformedNormal; 437#endif 438transformedNormal = normalMatrix * transformedNormal; 439#ifdef FLIP_SIDED 440 transformedNormal = - transformedNormal; 441#endif 442#ifdef USE_TANGENT 443 vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; 444 #ifdef FLIP_SIDED 445 transformedTangent = - transformedTangent; 446 #endif 447#endif`,Ete=`#ifdef USE_DISPLACEMENTMAP 448 uniform sampler2D displacementMap; 449 uniform float displacementScale; 450 uniform float displacementBias; 451#endif`,wte=`#ifdef USE_DISPLACEMENTMAP 452 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
452placementBias ); 453#endif`,bte=`#ifdef USE_EMISSIVEMAP 454 vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); 455 totalEmissiveRadiance *= emissiveColor.rgb; 456#endif`,Ste=`#ifdef USE_EMISSIVEMAP 457 uniform sampler2D emissiveMap; 458#endif`,Cte="gl_FragColor = linearToOutputTexel( gl_FragColor );",Tte=` 459const mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3( 460 vec3( 0.8224621, 0.177538, 0.0 ), 461 vec3( 0.0331941, 0.9668058, 0.0 ), 462 vec3( 0.0170827, 0.0723974, 0.9105199 ) 463); 464const mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3( 465 vec3( 1.2249401, - 0.2249404, 0.0 ), 466 vec3( - 0.0420569, 1.0420571, 0.0 ), 467 vec3( - 0.0196376, - 0.0786361, 1.0982735 ) 468); 469vec4 LinearSRGBToLinearDisplayP3( in vec4 value ) { 470 return vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a ); 471} 472vec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) { 473 return vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a ); 474} 475vec4 LinearTransferOETF( in vec4 value ) { 476 return value; 477} 478vec4 sRGBTransferOETF( in vec4 value ) { 479 return 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 ); 480} 481vec4 LinearToLinear( in vec4 value ) { 482 return value; 483} 484vec4 LinearTosRGB( in vec4 value ) { 485 return sRGBTransferOETF( value ); 486}`,Mte=`#ifdef USE_ENVMAP 487 #ifdef ENV_WORLDPOS 488 vec3 cameraToFrag; 489 if ( isOrthographic ) { 490 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 491 } else { 492 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 493 } 494 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 495 #ifdef ENVMAP_MODE_REFLECTION 496 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 497 #else 498 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 499 #endif 500 #else 501 vec3 reflectVec = vReflect; 502 #endif 503 #ifdef ENVMAP_TYPE_CUBE 504 vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 505 #else 506 vec4 envColor = vec4( 0.0 ); 507 #endif 508 #ifdef ENVMAP_BLENDING_MULTIPLY 509 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 510 #elif defined( ENVMAP_BLENDING_MIX ) 511 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 512 #elif defined( ENVMAP_BLENDING_ADD ) 513 outgoingLight += envColor.xyz * specularStrength * reflectivity; 514 #endif 515#endif`,xte=`#ifdef USE_ENVMAP 516 uniform float envMapIntensity; 517 uniform float flipEnvMap; 518 #ifdef ENVMAP_TYPE_CUBE 519 uniform samplerCube envMap; 520 #else 521 uniform sampler2D envMap; 522 #endif 523 524#endif`,Rte=`#ifdef USE_ENVMAP 525 uniform float reflectivity; 526 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 527 #define ENV_WORLDPOS 528 #endif 529 #ifdef ENV_WORLDPOS 530 varying vec3 vWorldPosition; 531 uniform float refractionRatio; 532 #else 533 varying vec3 vReflect; 534 #endif 535#endif`,Bte=`#ifdef USE_ENVMAP 536 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 537 #define ENV_WORLDPOS 538 #endif 539 #ifdef ENV_WORLDPOS 540 541 varying vec3 vWorldPosition; 542 #else 543 varying vec3 vReflect; 544 uniform float refractionRatio; 545 #endif 546#endif`,Ite=`#ifdef USE_ENVMAP 547 #ifdef ENV_WORLDPOS 548 vWorldPosition = worldPosition.xyz; 549 #else 550 vec3 cameraToVertex; 551 if ( isOrthographic ) { 552 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 553 } else {
554 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 555 } 556 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 557 #ifdef ENVMAP_MODE_REFLECTION 558 vReflect = reflect( cameraToVertex, worldNormal ); 559 #else 560 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 561 #endif 562 #endif 563#endif`,Dte=`#ifdef USE_FOG 564 vFogDepth = - mvPosition.z; 565#endif`,Pte=`#ifdef USE_FOG 566 varying float vFogDepth; 567#endif`,Lte=`#ifdef USE_FOG 568 #ifdef FOG_EXP2 569 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 570 #else 571 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 572 #endif 573 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 574#endif`,Ote=`#ifdef USE_FOG 575 uniform vec3 fogColor; 576 varying float vFogDepth; 577 #ifdef FOG_EXP2 578 uniform float fogDensity; 579 #else 580 uniform float fogNear; 581 uniform float fogFar; 582 #endif 583#endif`,Nte=`#ifdef USE_GRADIENTMAP 584 uniform sampler2D gradientMap; 585#endif 586vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 587 float dotNL = dot( normal, lightDirection ); 588 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 589 #ifdef USE_GRADIENTMAP 590 return vec3( texture2D( gradientMap, coord ).r ); 591 #else 592 vec2 fw = fwidth( coord ) * 0.5; 593 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 594 #endif 595}`,Ute=`#ifdef USE_LIGHTMAP 596 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 597 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 598 reflectedLight.indirectDiffuse += lightMapIrradiance; 599#endif`,Fte=`#ifdef USE_LIGHTMAP 600 uniform sampler2D lightMap; 601 uniform float lightMapIntensity; 602#endif`,kte=`LambertMaterial material; 603material.diffuseColor = diffuseColor.rgb; 604material.specularStrength = specularStrength;`,Hte=`varying vec3 vViewPosition; 605struct LambertMaterial { 606 vec3 diffuseColor; 607 float specularStrength; 608}; 609void 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 ) { 610 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 611 vec3 irradiance = dotNL * directLight.color; 612 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 613} 614void 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 ) { 615 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 616} 617#define RE_Direct RE_Direct_Lambert 618#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Gte=`uniform bool receiveShadow; 619uniform vec3 ambientLightColor; 620#if defined( USE_LIGHT_PROBES ) 621 uniform vec3 lightProbe[ 9 ]; 622#endif 623vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 624 float x = normal.x, y = normal.y, z = normal.z; 625 vec3 result = shCoefficients[ 0 ] * 0.886227; 626 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 627 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 628 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 629 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 630 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 631 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 632 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 633 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 634 return result; 635} 636vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 637 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 638 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 639 return irradiance; 640} 641vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 642 vec3 irradiance = ambientLightColor; 643 return irradiance; 644} 645float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 646 #if defined ( LEGACY_LIGHTS ) 647 if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { 648 return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); 649 } 650 return 1.0; 651 #else 652 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 653 if ( cutoffDistance > 0.0 ) { 654 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 655 } 656 return distanceFalloff; 657 #endif 658} 659float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 660 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 661} 662#if NUM_DIR_LIGHTS > 0 663 struct DirectionalLight { 664 vec3 direction; 665 vec3 color; 666 }; 667 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 668 void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) { 669 light.color = directionalLight.color; 670 light.direction = directionalLight.direction; 671 light.visible = true; 672 } 673#endif 674#if NUM_POINT_LIGHTS > 0 675 struct PointLight { 676 vec3 position; 677 vec3 color; 678 float distance; 679 float decay; 680 }; 681 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 682 void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) { 683 vec3 lVector = pointLight.position - geometryPosition; 684 light.direction = normalize( lVector ); 685 float lightDistance = length( lVector ); 686 light.color = pointLight.color; 687 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 688 light.visible = ( light.color != vec3( 0.0 ) ); 689 } 690#endif
691#if NUM_SPOT_LIGHTS > 0 692 struct SpotLight { 693 vec3 position; 694 vec3 direction; 695 vec3 color; 696 float distance; 697 float decay; 698 float coneCos; 699 float penumbraCos; 700 }; 701 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 702 void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) { 703 vec3 lVector = spotLight.position - geometryPosition; 704 light.direction = normalize( lVector ); 705 float angleCos = dot( light.direction, spotLight.direction ); 706 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 707 if ( spotAttenuation > 0.0 ) { 708 float lightDistance = length( lVector ); 709 light.color = spotLight.color * spotAttenuation; 710 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 711 light.visible = ( light.color != vec3( 0.0 ) ); 712 } else { 713 light.color = vec3( 0.0 ); 714 light.visible = false; 715 } 716 } 717#endif 718#if NUM_RECT_AREA_LIGHTS > 0 719 struct RectAreaLight { 720 vec3 color; 721 vec3 position; 722 vec3 halfWidth; 723 vec3 halfHeight; 724 }; 725 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 726 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 727#endif 728#if NUM_HEMI_LIGHTS > 0 729 struct HemisphereLight { 730 vec3 direction; 731 vec3 skyColor; 732 vec3 groundColor; 733 }; 734 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 735 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 736 float dotNL = dot( normal, hemiLight.direction ); 737 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 738 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 739 return irradiance; 740 } 741#endif`,zte=`#ifdef USE_ENVMAP 742 vec3 getIBLIrradiance( const in vec3 normal ) { 743 #ifdef ENVMAP_TYPE_CUBE_UV 744 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 745 vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); 746 return PI * envMapColor.rgb * envMapIntensity; 747 #else 748 return vec3( 0.0 ); 749 #endif 750 } 751 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 752 #ifdef ENVMAP_TYPE_CUBE_UV 753 vec3 reflectVec = reflect( - viewDir, normal ); 754 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 755 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 756 vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); 757 return envMapColor.rgb * envMapIntensity; 758 #else 759 return vec3( 0.0 ); 760 #endif 761 } 762 #ifdef USE_ANISOTROPY 763 vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { 764 #ifdef ENVMAP_TYPE_CUBE_UV 765 vec3 bentNormal = cross( bitangent, viewDir ); 766 bentNormal = normalize( cross( bentNormal, bitangent ) ); 767 bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); 768 return getIBLRadiance( viewDir, bentNormal, roughness ); 769 #else 770 return vec3( 0.0 ); 771 #endif 772 } 773 #endif 774#endif`,Qte=`ToonMaterial material; 775material.diffuseColor = diffuseColor.rgb;`,Vte=`varying vec3 vViewPosition; 776struct ToonMaterial { 777 vec3 diffuseColor; 778}; 779void 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 ) { 780 vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color; 781 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 782} 783void 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 ) { 784 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 785} 786#define RE_Direct RE_Direct_Toon 787#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Wte=`BlinnPhongMaterial material; 788material.diffuseColor = diffuseColor.rgb; 789material.specularColor = specular; 790material.specularShininess = shininess; 791material.specularStrength = specularStrength;`,jte=`varying vec3 vViewPosition; 792struct BlinnPhongMaterial { 793 vec3 diffuseColor; 794 vec3 specularColor; 795 float specularShininess; 796 float specularStrength; 797}; 798void 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 ) {
799 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 800 vec3 irradiance = dotNL * directLight.color; 801 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 802 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength; 803} 804void 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 ) { 805 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 806} 807#define RE_Direct RE_Direct_BlinnPhong 808#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Yte=`PhysicalMaterial material; 809material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 810vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) ); 811float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 812material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 813material.roughness = min( material.roughness, 1.0 ); 814#ifdef IOR 815 material.ior = ior; 816 #ifdef USE_SPECULAR 817 float specularIntensityFactor = specularIntensity; 818 vec3 specularColorFactor = specularColor; 819 #ifdef USE_SPECULAR_COLORMAP 820 specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; 821 #endif 822 #ifdef USE_SPECULAR_INTENSITYMAP 823 specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; 824 #endif 825 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 826 #else 827 float specularIntensityFactor = 1.0; 828 vec3 specularColorFactor = vec3( 1.0 ); 829 material.specularF90 = 1.0; 830 #endif 831 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 832#else 833 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 834 material.specularF90 = 1.0; 835#endif 836#ifdef USE_CLEARCOAT 837 material.clearcoat = clearcoat; 838 material.clearcoatRoughness = clearcoatRoughness; 839 material.clearcoatF0 = vec3( 0.04 ); 840 material.clearcoatF90 = 1.0; 841 #ifdef USE_CLEARCOATMAP 842 material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; 843 #endif 844 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 845 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; 846 #endif 847 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 848 material.clearcoatRoughness += geometryRoughness; 849 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 850#endif 851#ifdef USE_IRIDESCENCE 852 material.iridescence = iridescence; 853 material.iridescenceIOR = iridescenceIOR; 854 #ifdef USE_IRIDESCENCEMAP 855 material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; 856 #endif 857 #ifdef USE_IRIDESCENCE_THICKNESSMAP 858 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; 859 #else 860 material.iridescenceThickness = iridescenceThicknessMaximum; 861 #endif 862#endif 863#ifdef USE_SHEEN 864 material.sheenColor = sheenColor; 865 #ifdef USE_SHEEN_COLORMAP 866 material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; 867 #endif 868 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 869 #ifdef USE_SHEEN_ROUGHNESSMAP 870 material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; 871 #endif 872#endif 873#ifdef USE_ANISOTROPY 874 #ifdef USE_ANISOTROPYMAP 875 mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); 876 vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; 877 vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; 878 #else 879 vec2 anisotropyV = anisotropyVector; 880 #endif 881 material.anisotropy = length( anisotropyV ); 882 anisotropyV /= material.anisotropy; 883 material.anisotropy = saturate( material.anisotropy ); 884 material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
885 material.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y; 886 material.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y; 887#endif`,Kte=`struct PhysicalMaterial { 888 vec3 diffuseColor; 889 float roughness; 890 vec3 specularColor; 891 float specularF90
vendor: 14,563 bytes, lines 891-1187
891; 892 #ifdef USE_CLEARCOAT 893 float clearcoat; 894 float clearcoatRoughness; 895 vec3 clearcoatF0; 896 float clearcoatF90; 897 #endif 898 #ifdef USE_IRIDESCENCE 899 float iridescence; 900 float iridescenceIOR; 901 float iridescenceThickness; 902 vec3 iridescenceFresnel; 903 vec3 iridescenceF0; 904 #endif 905 #ifdef USE_SHEEN 906 vec3 sheenColor; 907 float sheenRoughness; 908 #endif 909 #ifdef IOR 910 float ior; 911 #endif 912 #ifdef USE_TRANSMISSION 913 float transmission; 914 float transmissionAlpha; 915 float thickness; 916 float attenuationDistance; 917 vec3 attenuationColor; 918 #endif 919 #ifdef USE_ANISOTROPY 920 float anisotropy; 921 float alphaT; 922 vec3 anisotropyT; 923 vec3 anisotropyB; 924 #endif 925}; 926vec3 clearcoatSpecularDirect = vec3( 0.0 ); 927vec3 clearcoatSpecularIndirect = vec3( 0.0 ); 928vec3 sheenSpecularDirect = vec3( 0.0 ); 929vec3 sheenSpecularIndirect = vec3(0.0 ); 930vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 931 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 932 float x2 = x * x; 933 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 934 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 935} 936float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 937 float a2 = pow2( alpha ); 938 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 939 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 940 return 0.5 / max( gv + gl, EPSILON ); 941} 942float D_GGX( const in float alpha, const in float dotNH ) { 943 float a2 = pow2( alpha ); 944 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 945 return RECIPROCAL_PI * a2 / pow2( denom ); 946} 947#ifdef USE_ANISOTROPY 948 float 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 ) { 949 float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); 950 float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); 951 float v = 0.5 / ( gv + gl ); 952 return saturate(v); 953 } 954 float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { 955 float a2 = alphaT * alphaB; 956 highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); 957 highp float v2 = dot( v, v ); 958 float w2 = a2 / v2; 959 return RECIPROCAL_PI * a2 * pow2 ( w2 ); 960 } 961#endif 962#ifdef USE_CLEARCOAT 963 vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { 964 vec3 f0 = material.clearcoatF0; 965 float f90 = material.clearcoatF90; 966 float roughness = material.clearcoatRoughness; 967 float alpha = pow2( roughness ); 968 vec3 halfDir = normalize( lightDir + viewDir ); 969 float dotNL = saturate( dot( normal, lightDir ) ); 970 float dotNV = saturate( dot( normal, viewDir ) ); 971 float dotNH = saturate( dot( normal, halfDir ) ); 972 float dotVH = saturate( dot( viewDir, halfDir ) ); 973 vec3 F = F_Schlick( f0, f90, dotVH ); 974 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 975 float D = D_GGX( alpha, dotNH ); 976 return F * ( V * D ); 977 } 978#endif 979vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { 980 vec3 f0 = material.specularColor; 981 float f90 = material.specularF90; 982 float roughness = material.roughness; 983 float alpha = pow2( roughness ); 984 vec3 halfDir = normalize( lightDir + viewDir ); 985 float dotNL = saturate( dot( normal, lightDir ) ); 986 float dotNV = saturate( dot( normal, viewDir ) ); 987 float dotNH = saturate( dot( normal, halfDir ) ); 988 float dotVH = saturate( dot( viewDir, halfDir ) ); 989 vec3 F = F_Schlick( f0, f90, dotVH ); 990 #ifdef USE_IRIDESCENCE 991 F = mix( F, material.iridescenceFresnel, material.iridescence ); 992 #endif 993 #ifdef USE_ANISOTROPY 994 float dotTL = dot( material.anisotropyT, lightDir ); 995 float dotTV = dot( material.anisotropyT, viewDir ); 996 float dotTH = dot( material.anisotropyT, halfDir ); 997 float dotBL = dot( material.anisotropyB, lightDir ); 998 float dotBV = dot( material.anisotropyB, viewDir ); 999 float dotBH = dot( material.anisotropyB, halfDir ); 1000 float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); 1001 float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); 1002 #else 1003 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 1004 float D = D_GGX( alpha, dotNH ); 1005 #endif 1006 return F * ( V * D ); 1007} 1008vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 1009 const float LUT_SIZE = 64.0; 1010 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 1011 const float LUT_BIAS = 0.5 / LUT_SIZE; 1012 float dotNV = saturate( dot( N, V ) ); 1013 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 1014 uv = uv * LUT_SCALE + LUT_BIAS; 1015 return uv; 1016} 1017float LTC_ClippedSphereFormFactor( const in vec3 f ) { 1018 float l = length( f ); 1019 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 1020} 1021vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 1022 float x = dot( v1, v2 ); 1023 float y = abs( x ); 1024 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 1025 float b = 3.4175940 + ( 4.1616724 + y ) * y; 1026 float v = a / b; 1027 float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 1028 return cross( v1, v2 ) * theta_sintheta; 1029} 1030vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 1031 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 1032 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 1033 vec3 lightNormal = cross( v1, v2 ); 1034 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 1035 vec3 T1, T2; 1036 T1 = normalize( V - N * dot( V, N ) ); 1037 T2 = - cross( N, T1 ); 1038 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 1039 vec3 coords[ 4 ]; 1040 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 1041 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 1042 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 1043 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 1044 coords[ 0 ] = normalize( coords[ 0 ] ); 1045 coords[ 1 ] = normalize( coords[ 1 ] ); 1046 coords[ 2 ] = normalize( coords[ 2 ] ); 1047 coords[ 3 ] = normalize( coords[ 3 ] ); 1048 vec3 vectorFormFactor = vec3( 0.0 ); 1049 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 1050 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 1051 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 1052 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 1053 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 1054 return vec3( result ); 1055} 1056#if defined( USE_SHEEN ) 1057float D_Charlie( float roughness, float dotNH ) { 1058 float alpha = pow2( roughness ); 1059 float invAlpha = 1.0 / alpha; 1060 float cos2h = dotNH * dotNH; 1061 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 1062 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 1063} 1064float V_Neubelt( float dotNV, float dotNL ) { 1065 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 1066} 1067vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 1068 vec3 halfDir = normalize( lightDir + viewDir ); 1069 float dotNL = saturate( dot( normal, lightDir ) ); 1070 float dotNV = saturate( dot( normal, viewDir ) ); 1071 float dotNH = saturate( dot( normal, halfDir ) ); 1072 float D = D_Charlie( sheenRoughness, dotNH ); 1073 float V = V_Neubelt( dotNV, dotNL ); 1074 return sheenColor * ( D * V ); 1075} 1076#endif 1077float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1078 float dotNV = saturate( dot( normal, viewDir ) ); 1079 float r2 = roughness * roughness; 1080 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 1081 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 1082 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 1083 return saturate( DG * RECIPROCAL_PI ); 1084} 1085vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 1086 float dotNV = saturate( dot( normal, viewDir ) ); 1087 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 1088 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 1089 vec4 r = roughness * c0 + c1; 1090 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 1091 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 1092 return fab; 1093} 1094vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 1095 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1096 return specularColor * fab.x + specularF90 * fab.y; 1097} 1098#ifdef USE_IRIDESCENCE 1099void 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 ) { 1100#else 1101void 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 ) { 1102#endif 1103 vec2 fab = DFGApprox( normal, viewDir, roughness ); 1104 #ifdef USE_IRIDESCENCE 1105 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 1106 #else 1107 vec3 Fr = specularColor; 1108 #endif 1109 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 1110 float Ess = fab.x + fab.y; 1111 float Ems = 1.0 - Ess; 1112 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 1113 singleScatter += FssEss; 1114 multiScatter += Fms * Ems; 1115} 1116#if NUM_RECT_AREA_LIGHTS > 0 1117 void 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 ) { 1118 vec3 normal = geometryNormal; 1119 vec3 viewDir = geometryViewDir; 1120 vec3 position = geometryPosition; 1121 vec3 lightPos = rectAreaLight.position; 1122 vec3 halfWidth = rectAreaLight.halfWidth; 1123 vec3 halfHeight = rectAreaLight.halfHeight; 1124 vec3 lightColor = rectAreaLight.color; 1125 float roughness = material.roughness; 1126 vec3 rectCoords[ 4 ]; 1127 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 1128 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 1129 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 1130 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 1131 vec4 t1 = texture2D( ltc_1, uv ); 1132 vec4 t2 = texture2D( ltc_2, uv ); 1133 mat3 mInv = mat3( 1134 vec3( t1.x, 0, t1.y ), 1135 vec3( 0, 1, 0 ), 1136 vec3( t1.z, 0, t1.w ) 1137 ); 1138 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 1139 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 1140 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 1141 } 1142#endif 1143void 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 ) { 1144 float dotNL = saturate( dot( geometryNormal, directLight.direction ) ); 1145 vec3 irradiance = dotNL * directLight.color; 1146 #ifdef USE_CLEARCOAT 1147 float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) ); 1148 vec3 ccIrradiance = dotNLcc * directLight.color; 1149 clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material ); 1150 #endif 1151 #ifdef USE_SHEEN 1152 sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness ); 1153 #endif 1154 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material ); 1155 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1156} 1157void 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 ) { 1158 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 1159} 1160void 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) { 1161 #ifdef USE_CLEARCOAT 1162 clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 1163 #endif 1164 #ifdef USE_SHEEN 1165 sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness ); 1166 #endif 1167 vec3 singleScattering = vec3( 0.0 ); 1168 vec3 multiScattering = vec3( 0.0 ); 1169 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 1170 #ifdef USE_IRIDESCENCE 1171 computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 1172 #else 1173 computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 1174 #endif 1175 vec3 totalScattering = singleScattering + multiScattering; 1176 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 1177 reflectedLight.indirectSpecular += radiance * singleScattering; 1178 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 1179 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 1180} 1181#define RE_Direct RE_Direct_Physical 1182#define RE_Direct_RectArea RE_Direct_RectArea_Physical 1183#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 1184#define RE_IndirectSpecular RE_IndirectSpecular_Physical 1185float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 1186 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 1187}`,
1187Xte=` 1188vec3 geometryPosition = - vViewPosition; 1189vec3 geometryNormal = normal; 1190vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 1191vec3 geometryClearcoatNormal = vec3( 0.0 ); 1192#ifdef USE_CLEARCOAT 1193 geometryClearcoatNormal = clearcoatNormal; 1194#endif 1195#ifdef USE_IRIDESCENCE 1196 float dotNVi = saturate( dot( normal, geometryViewDir ) ); 1197 if ( material.iridescenceThickness == 0.0 ) { 1198 material.iridescence = 0.0; 1199 } else { 1200 material.iridescence = saturate( material.iridescence ); 1201 } 1202 if ( material.iridescence > 0.0 ) { 1203 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 1204 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 1205 } 1206#endif 1207IncidentLight directLight; 1208#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 1209 PointLight pointLight; 1210 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 1211 PointLightShadow pointLightShadow; 1212 #endif 1213 #pragma unroll_loop_start 1214 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 1215 pointLight = pointLights[ i ]; 1216 getPointLightInfo( pointLight, geometryPosition, directLight ); 1217 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 1218 pointLightShadow = pointLightShadows[ i ]; 1219 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 1220 #endif 1221 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1222 } 1223 #pragma unroll_loop_end 1224#endif 1225#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 1226 SpotLight spotLight; 1227 vec4 spotColor; 1228 vec3 spotLightCoord; 1229 bool inSpotLightMap; 1230 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 1231 SpotLightShadow spotLightShadow; 1232 #endif 1233 #pragma unroll_loop_start 1234 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 1235 spotLight = spotLights[ i ]; 1236 getSpotLightInfo( spotLight, geometryPosition, directLight ); 1237 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1238 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 1239 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1240 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 1241 #else 1242 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 1243 #endif 1244 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 1245 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 1246 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 1247 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 1248 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 1249 #endif 1250 #undef SPOT_LIGHT_MAP_INDEX 1251 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1252 spotLightShadow = spotLightShadows[ i ]; 1253 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1254 #endif 1255 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1256 } 1257 #pragma unroll_loop_end 1258#endif 1259#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 1260 DirectionalLight directionalLight; 1261 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 1262 DirectionalLightShadow directionalLightShadow; 1263 #endif 1264 #pragma unroll_loop_start 1265 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 1266 directionalLight = directionalLights[ i ]; 1267 getDirectionalLightInfo( directionalLight, directLight ); 1268 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 1269 directionalLightShadow = directionalLightShadows[ i ]; 1270 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1271 #endif 1272 RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1273 } 1274 #pragma unroll_loop_end 1275#endif 1276#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 1277 RectAreaLight rectAreaLight; 1278 #pragma unroll_loop_start 1279 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 1280 rectAreaLight = rectAreaLights[ i ]; 1281 RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1282 } 1283 #pragma unroll_loop_end 1284#endif 1285#if defined( RE_IndirectDiffuse ) 1286 vec3 iblIrradiance = vec3( 0.0 ); 1287 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 1288 #if defined( USE_LIGHT_PROBES ) 1289 irradiance += getLightProbeIrradiance( lightProbe, geometryNormal ); 1290 #endif 1291 #if ( NUM_HEMI_LIGHTS > 0 ) 1292 #pragma unroll_loop_start 1293 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 1294 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal ); 1295 } 1296 #pragma unroll_loop_end 1297 #endif 1298#endif 1299#if defined( RE_IndirectSpecular ) 1300 vec3 radiance = vec3( 0.0 ); 1301 vec3 clearcoatRadiance = vec3( 0.0 ); 1302#endif`,qte=`#if defined( RE_IndirectDiffuse ) 1303 #ifdef USE_LIGHTMAP 1304 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 1305 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 1306 irradiance += lightMapIrradiance; 1307 #endif 1308 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 1309 iblIrradiance += getIBLIrradiance( geometryNormal ); 1310 #endif 1311#endif 1312#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 1313 #ifdef USE_ANISOTROPY 1314 radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy ); 1315 #else 1316 radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness ); 1317 #endif 1318 #ifdef USE_CLEARCOAT 1319 clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness ); 1320 #endif 1321#endif`,Zte=`#if defined( RE_IndirectDiffuse ) 1322 RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1323#endif 1324#if defined( RE_IndirectSpecular ) 1325 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight ); 1326#endif`,Jte=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 1327 gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 1328#endif`,$te=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 1329 uniform float logDepthBufFC; 1330 varying float vFragDepth; 1331 varying float vIsPerspective; 1332#endif`,eie=`#ifdef USE_LOGDEPTHBUF 1333 #ifdef USE_LOGDEPTHBUF_EXT 1334 varying float vFragDepth; 1335 varying float vIsPerspective; 1336 #else 1337 uniform float logDepthBufFC; 1338 #endif 1339#endif`,tie=`#ifdef USE_LOGDEPTHBUF 1340 #ifdef USE_LOGDEPTHBUF_EXT 1341 vFragDepth = 1.0 + gl_Position.w; 1342 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 1343 #else 1344 if ( isPerspectiveMatrix( projectionMatrix ) ) { 1345 gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; 1346 gl_Position.z *= gl_Position.w; 1347 } 1348 #endif 1349#endif`,iie=`#ifdef USE_MAP 1350 vec4 sampledDiffuseColor = texture2D( map, vMapUv ); 1351 #ifdef DECODE_VIDEO_TEXTURE 1352 sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); 1353 1354 #endif 1355 diffuseColor *= sampledDiffuseColor; 1356#endif`,rie=`#ifdef USE_MAP 1357 uniform sampler2D map; 1358#endif`,nie=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1359 #if defined( USE_POINTS_UV ) 1360 vec2 uv = vUv; 1361 #else 1362 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 1363 #endif 1364#endif 1365#ifdef USE_MAP 1366 diffuseColor *= texture2D( map, uv ); 1367#endif 1368#ifdef USE_ALPHAMAP 1369 diffuseColor.a *= texture2D( alphaMap, uv ).g; 1370#endif`,aie=`#if defined( USE_POINTS_UV ) 1371 varying vec2 vUv; 1372#else 1373 #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 1374 uniform mat3 uvTransform; 1375 #endif 1376#endif 1377#ifdef USE_MAP 1378 uniform sampler2D map; 1379#endif 1380#ifdef USE_ALPHAMAP 1381 uniform sampler2D alphaMap; 1382#endif`,sie=`float metalnessFactor = metalness; 1383#ifdef USE_METALNESSMAP 1384 vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); 1385 metalnessFactor *= texelMetalness.b; 1386#endif`,oie=`#ifdef USE_METALNESSMAP 1387 uniform sampler2D metalnessMap; 1388#endif`,lie=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) 1389 vColor *= morphTargetBaseInfluence; 1390 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1391 #if defined( USE_COLOR_ALPHA ) 1392 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 1393 #elif defined( USE_COLOR ) 1394 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 1395 #endif 1396 } 1397#endif`,cie=`#ifdef USE_MORPHNORMALS 1398 objectNormal *= morphTargetBaseInfluence; 1399 #ifdef MORPHTARGETS_TEXTURE 1400 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1401 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 1402 } 1403 #else 1404 objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; 1405 objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; 1406 objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; 1407 objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; 1408 #endif 1409#endif`,hie=`#ifdef USE_MORPHTARGETS 1410 uniform float morphTargetBaseInfluence; 1411 #ifdef MORPHTARGETS_TEXTURE 1412 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 1413 uniform sampler2DArray morphTargetsTexture; 1414 uniform ivec2 morphTargetsTextureSize; 1415 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 1416 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 1417 int y = texelIndex / morphTargetsTextureSize.x; 1418 int x = texelIndex - y * morphTargetsTextureSize.x; 1419 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 1420 return texelFetch( morphTargetsTexture, morphUV, 0 ); 1421 } 1422 #else 1423 #ifndef USE_MORPHNORMALS 1424 uniform float morphTargetInfluences[ 8 ]; 1425 #else 1426 uniform float morphTargetInfluences[ 4 ]; 1427 #endif 1428 #endif 1429#endif`,uie=`#ifdef USE_MORPHTARGETS 1430 transformed *= morphTargetBaseInfluence; 1431 #ifdef MORPHTARGETS_TEXTURE 1432 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 1433 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 1434 } 1435 #else 1436 transformed += morphTarget0 * morphTargetInfluences[ 0 ]; 1437 transformed += morphTarget1 * morphTargetInfluences[ 1 ]; 1438 transformed += morphTarget2 * morphTargetInfluences[ 2 ]; 1439 transformed += morphTarget3 * morphTargetInfluences[ 3 ]; 1440 #ifndef USE_MORPHNORMALS 1441 transformed += morphTarget4 * morphTargetInfluences[ 4 ]; 1442 transformed += morphTarget5 * morphTargetInfluences[ 5 ]; 1443 transformed += morphTarget6 * morphTargetInfluences[ 6 ]; 1444 transformed += morphTarget7 * morphTargetInfluences[ 7 ]; 1445 #endif 1446 #endif 1447#endif`,die=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 1448#ifdef FLAT_SHADED 1449 vec3 fdx = dFdx( vViewPosition ); 1450 vec3 fdy = dFdy( vViewPosition ); 1451 vec3 normal = normalize( cross( fdx, fdy ) ); 1452#else 1453 vec3 normal = normalize( vNormal ); 1454 #ifdef DOUBLE_SIDED 1455 normal *= faceDirection; 1456 #endif 1457#endif 1458#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) 1459 #ifdef USE_TANGENT 1460 mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1461 #else 1462 mat3 tbn = getTangentFrame( - vViewPosition, normal, 1463 #if defined( USE_NORMALMAP ) 1464 vNormalMapUv 1465 #elif defined( USE_CLEARCOAT_NORMALMAP ) 1466 vClearcoatNormalMapUv 1467 #else 1468 vUv 1469 #endif 1470 ); 1471 #endif 1472 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1473 tbn[0] *= faceDirection; 1474 tbn[1] *= faceDirection; 1475 #endif 1476#endif 1477#ifdef USE_CLEARCOAT_NORMALMAP 1478 #ifdef USE_TANGENT 1479 mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); 1480 #else 1481 mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); 1482 #endif 1483 #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) 1484 tbn2[0] *= faceDirection; 1485 tbn2[1] *= faceDirection; 1486 #endif 1487#endif 1488vec3 nonPerturbedNormal = normal;`,Aie=`#ifdef USE_NORMALMAP_OBJECTSPACE 1489 normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1490 #ifdef FLIP_SIDED 1491 normal = - normal; 1492 #endif 1493 #ifdef DOUBLE_SIDED 1494 normal = normal * faceDirection; 1495 #endif 1496 normal = normalize( normalMatrix * normal ); 1497#elif defined( USE_NORMALMAP_TANGENTSPACE ) 1498 vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; 1499 mapN.xy *= normalScale; 1500 normal = normalize( tbn * mapN ); 1501#elif defined( USE_BUMPMAP )
1502 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 1503#endif`,fie=`#ifndef FLAT_SHADED 1504 varying vec3 vNormal; 1505 #ifdef USE_TANGENT 1506 varying vec3 vTangent; 1507 varying vec3 vBitangent; 1508 #endif 1509#endif`,pie=`#ifndef FLAT_SHADED 1510 varying vec3 vNormal; 1511 #ifdef USE_TANGENT 1512 varying vec3 vTangent; 1513 varying vec3 vBitangent; 1514 #endif 1515#endif`,mie=`#ifndef FLAT_SHADED 1516 vNormal = normalize( transformedNormal ); 1517 #ifdef USE_TANGENT 1518 vTangent = normalize( transformedTangent ); 1519 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 1520 #endif 1521#endif`,gie=`#ifdef USE_NORMALMAP 1522 uniform sampler2D normalMap; 1523 uniform vec2 normalScale; 1524#endif 1525#ifdef USE_NORMALMAP_OBJECTSPACE 1526 uniform mat3 normalMatrix; 1527#endif 1528#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) 1529 mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { 1530 vec3 q0 = dFdx( eye_pos.xyz ); 1531 vec3 q1 = dFdy( eye_pos.xyz ); 1532 vec2 st0 = dFdx( uv.st ); 1533 vec2 st1 = dFdy( uv.st ); 1534 vec3 N = surf_norm; 1535 vec3 q1perp = cross( q1, N ); 1536 vec3 q0perp = cross( N, q0 ); 1537 vec3 T = q1perp * st0.x + q0perp * st1.x; 1538 vec3 B = q1perp * st0.y + q0perp * st1.y; 1539 float det = max( dot( T, T ), dot( B, B ) ); 1540 float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); 1541 return mat3( T * scale, B * scale, N ); 1542 } 1543#endif`,vie=`#ifdef USE_CLEARCOAT 1544 vec3 clearcoatNormal = nonPerturbedNormal; 1545#endif`,_ie=`#ifdef USE_CLEARCOAT_NORMALMAP 1546 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; 1547 clearcoatMapN.xy *= clearcoatNormalScale; 1548 clearcoatNormal = normalize( tbn2 * clearcoatMapN ); 1549#endif`,yie=`#ifdef USE_CLEARCOATMAP 1550 uniform sampler2D clearcoatMap; 1551#endif 1552#ifdef USE_CLEARCOAT_NORMALMAP 1553 uniform sampler2D clearcoatNormalMap; 1554 uniform vec2 clearcoatNormalScale; 1555#endif 1556#ifdef USE_CLEARCOAT_ROUGHNESSMAP 1557 uniform sampler2D clearcoatRoughnessMap; 1558#endif`,Eie=`#ifdef USE_IRIDESCENCEMAP 1559 uniform sampler2D iridescenceMap; 1560#endif 1561#ifdef USE_IRIDESCENCE_THICKNESSMAP 1562 uniform sampler2D iridescenceThicknessMap; 1563#endif`,wie=`#ifdef OPAQUE 1564diffuseColor.a = 1.0; 1565#endif 1566#ifdef USE_TRANSMISSION 1567diffuseColor.a *= material.transmissionAlpha; 1568#endif 1569gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,bie=`vec3 packNormalToRGB( const in vec3 normal ) { 1570 return normalize( normal ) * 0.5 + 0.5; 1571} 1572vec3 unpackRGBToNormal( const in vec3 rgb ) { 1573 return 2.0 * rgb.xyz - 1.0; 1574} 1575const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; 1576const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); 1577const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); 1578const float ShiftRight8 = 1. / 256.; 1579vec4 packDepthToRGBA( const in float v ) { 1580 vec4 r = vec4( fract( v * PackFactors ), v ); 1581 r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; 1582} 1583float unpackRGBAToDepth( const in vec4 v ) { 1584 return dot( v, UnpackFactors ); 1585} 1586vec2 packDepthToRG( in highp float v ) { 1587 return packDepthToRGBA( v ).yx; 1588} 1589float unpackRGToDepth( const in highp vec2 v ) { 1590 return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); 1591} 1592vec4 pack2HalfToRGBA( vec2 v ) { 1593 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 1594 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 1595} 1596vec2 unpackRGBATo2Half( vec4 v ) { 1597 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 1598} 1599float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 1600 return ( viewZ + near ) / ( near - far ); 1601} 1602float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { 1603 return depth * ( near - far ) - near; 1604} 1605float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 1606 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 1607} 1608float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { 1609 return ( near * far ) / ( ( far - near ) * depth - far ); 1610}`,Sie=`#ifdef PREMULTIPLIED_ALPHA 1611 gl_FragColor.rgb *= gl_FragColor.a; 1612#endif`,Cie=`vec4 mvPosition = vec4( transformed, 1.0 ); 1613#ifdef USE_INSTANCING 1614 mvPosition = instanceMatrix * mvPosition; 1615#endif 1616mvPosition = modelViewMatrix * mvPosition; 1617gl_Position = projectionMatrix * mvPosition;`,Tie=`#ifdef DITHERING 1618 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 1619#endif`,Mie=`#ifdef DITHERING 1620 vec3 dithering( vec3 color ) { 1621 float grid_position = rand( gl_FragCoord.xy ); 1622 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 1623 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 1624 return color + dither_shift_RGB; 1625 } 1626#endif`,xie=`float roughnessFactor = roughness; 1627#ifdef USE_ROUGHNESSMAP 1628 vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); 1629 roughnessFactor *= texelRoughness.g; 1630#endif`,Rie=`#ifdef USE_ROUGHNESSMAP 1631 uniform sampler2D roughnessMap;
1632#endif`,Bie=`#if NUM_SPOT_LIGHT_COORDS > 0 1633 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1634#endif 1635#if NUM_SPOT_LIGHT_MAPS > 0 1636 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 1637#endif 1638#ifdef USE_SHADOWMAP 1639 #if NUM_DIR_LIGHT_SHADOWS > 0 1640 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 1641 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1642 struct DirectionalLightShadow { 1643 float shadowBias; 1644 float shadowNormalBias; 1645 float shadowRadius; 1646 vec2 shadowMapSize; 1647 }; 1648 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1649 #endif 1650 #if NUM_SPOT_LIGHT_SHADOWS > 0 1651 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 1652 struct SpotLightShadow { 1653 float shadowBias; 1654 float shadowNormalBias; 1655 float shadowRadius; 1656 vec2 shadowMapSize; 1657 }; 1658 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1659 #endif 1660 #if NUM_POINT_LIGHT_SHADOWS > 0 1661 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 1662 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1663 struct PointLightShadow { 1664 float shadowBias; 1665 float shadowNormalBias; 1666 float shadowRadius; 1667 vec2 shadowMapSize; 1668 float shadowCameraNear; 1669 float shadowCameraFar; 1670 }; 1671 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1672 #endif 1673 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 1674 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 1675 } 1676 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 1677 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 1678 } 1679 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 1680 float occlusion = 1.0; 1681 vec2 distribution = texture2DDistribution( shadow, uv ); 1682 float hard_shadow = step( compare , distribution.x ); 1683 if (hard_shadow != 1.0 ) { 1684 float distance = compare - distribution.x ; 1685 float variance = max( 0.00000, distribution.y * distribution.y ); 1686 float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); 1687 } 1688 return occlusion; 1689 } 1690 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 1691 float shadow = 1.0; 1692 shadowCoord.xyz /= shadowCoord.w; 1693 shadowCoord.z += shadowBias; 1694 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 1695 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 1696 if ( frustumTest ) { 1697 #if defined( SHADOWMAP_TYPE_PCF ) 1698 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1699 float dx0 = - texelSize.x * shadowRadius; 1700 float dy0 = - texelSize.y * shadowRadius; 1701 float dx1 = + texelSize.x * shadowRadius; 1702 float dy1 = + texelSize.y * shadowRadius; 1703 float dx2 = dx0 / 2.0; 1704 float dy2 = dy0 / 2.0; 1705 float dx3 = dx1 / 2.0; 1706 float dy3 = dy1 / 2.0; 1707 shadow = ( 1708 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 1709 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 1710 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 1711 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 1712 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 1713 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 1714 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 1715 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 1716 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 1717 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 1718 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 1719 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 1720 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 1721 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 1722 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 1723 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 1724 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 1725 ) * ( 1.0 / 17.0 ); 1726 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 1727 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 1728 float dx = texelSize.x; 1729 float dy = texelSize.y; 1730 vec2 uv = shadowCoord.xy;
1731 vec2 f = fract( uv * shadowMapSize + 0.5 ); 1732 uv -= f * texelSize; 1733 shadow = ( 1734 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 1735 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 1736 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 1737 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 1738 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 1739 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 1740 f.x ) + 1741 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 1742 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 1743 f.x ) + 1744 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 1745 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 1746 f.y ) + 1747 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 1748 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 1749 f.y ) + 1750 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 1751 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 1752 f.x ), 1753 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 1754 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 1755 f.x ), 1756 f.y ) 1757 ) * ( 1.0 / 9.0 ); 1758 #elif defined( SHADOWMAP_TYPE_VSM ) 1759 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 1760 #else 1761 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 1762 #endif 1763 } 1764 return shadow; 1765 } 1766 vec2 cubeToUV( vec3 v, float texelSizeY ) { 1767 vec3 absV = abs( v ); 1768 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 1769 absV *= scaleToCube; 1770 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 1771 vec2 planar = v.xy; 1772 float almostATexel = 1.5 * texelSizeY; 1773 float almostOne = 1.0 - almostATexel; 1774 if ( absV.z >= almostOne ) { 1775 if ( v.z > 0.0 ) 1776 planar.x = 4.0 - v.x; 1777 } else if ( absV.x >= almostOne ) { 1778 float signX = sign( v.x ); 1779 planar.x = v.z * signX + 2.0 * signX; 1780 } else if ( absV.y >= almostOne ) { 1781 float signY = sign( v.y ); 1782 planar.x = v.x + 2.0 * signY + 2.0; 1783 planar.y = v.z * signY - 2.0; 1784 } 1785 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 1786 } 1787 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 1788 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 1789 vec3 lightToPosition = shadowCoord.xyz; 1790 float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 1791 vec3 bd3D = normalize( lightToPosition ); 1792 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 1793 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 1794 return ( 1795 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 1796 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 1797 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 1798 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 1799 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 1800 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 1801 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 1802 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 1803 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 1804 ) * ( 1.0 / 9.0 ); 1805 #else 1806 return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 1807 #endif 1808 } 1809#endif`,Iie=`#if NUM_SPOT_LIGHT_COORDS > 0 1810 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 1811 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 1812#endif 1813#ifdef USE_SHADOWMAP 1814 #if NUM_DIR_LIGHT_SHADOWS > 0 1815 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 1816 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 1817 struct DirectionalLightShadow { 1818 float shadowBias; 1819 float shadowNormalBias; 1820 float shadowRadius; 1821 vec2 shadowMapSize; 1822 }; 1823 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 1824 #endif
1825 #if NUM_SPOT_LIGHT_SHADOWS > 0 1826 struct SpotLightShadow { 1827 float shadowBias; 1828 float shadowNormalBias; 1829 float shadowRadius; 1830 vec2 shadowMapSize; 1831 }; 1832 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 1833 #endif 1834 #if NUM_POINT_LIGHT_SHADOWS > 0 1835 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 1836 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 1837 struct PointLightShadow { 1838 float shadowBias; 1839 float shadowNormalBias; 1840 float shadowRadius; 1841 vec2 shadowMapSize; 1842 float shadowCameraNear; 1843 float shadowCameraFar; 1844 }; 1845 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 1846 #endif 1847#endif`,Die=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 1848 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 1849 vec4 shadowWorldPosition; 1850#endif 1851#if defined( USE_SHADOWMAP ) 1852 #if NUM_DIR_LIGHT_SHADOWS > 0 1853 #pragma unroll_loop_start 1854 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1855 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 1856 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 1857 } 1858 #pragma unroll_loop_end 1859 #endif 1860 #if NUM_POINT_LIGHT_SHADOWS > 0 1861 #pragma unroll_loop_start 1862 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1863 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 1864 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 1865 } 1866 #pragma unroll_loop_end 1867 #endif 1868#endif 1869#if NUM_SPOT_LIGHT_COORDS > 0 1870 #pragma unroll_loop_start 1871 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 1872 shadowWorldPosition = worldPosition; 1873 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 1874 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 1875 #endif 1876 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 1877 } 1878 #pragma unroll_loop_end 1879#endif`,Pie=`float getShadowMask() { 1880 float shadow = 1.0; 1881 #ifdef USE_SHADOWMAP 1882 #if NUM_DIR_LIGHT_SHADOWS > 0 1883 DirectionalLightShadow directionalLight; 1884 #pragma unroll_loop_start 1885 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 1886 directionalLight = directionalLightShadows[ i ]; 1887 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 1888 } 1889 #pragma unroll_loop_end 1890 #endif 1891 #if NUM_SPOT_LIGHT_SHADOWS > 0 1892 SpotLightShadow spotLight; 1893 #pragma unroll_loop_start 1894 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 1895 spotLight = spotLightShadows[ i ]; 1896 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 1897 } 1898 #pragma unroll_loop_end 1899 #endif 1900 #if NUM_POINT_LIGHT_SHADOWS > 0 1901 PointLightShadow pointLight; 1902 #pragma unroll_loop_start 1903 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 1904 pointLight = pointLightShadows[ i ]; 1905 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 1906 } 1907 #pragma unroll_loop_end 1908 #endif 1909 #endif 1910 return shadow; 1911}`,Lie=`#ifdef USE_SKINNING 1912 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 1913 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 1914 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 1915 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 1916#endif`,Oie=`#ifdef USE_SKINNING 1917 uniform mat4 bindMatrix; 1918 uniform mat4 bindMatrixInverse; 1919 uniform highp sampler2D boneTexture; 1920 uniform int boneTextureSize; 1921 mat4 getBoneMatrix( const in float i ) { 1922 float j = i * 4.0; 1923 float x = mod( j, float( boneTextureSize ) ); 1924 float y = floor( j / float( boneTextureSize ) ); 1925 float dx = 1.0 / float( boneTextureSize ); 1926 float dy = 1.0 / float( boneTextureSize ); 1927 y = dy * ( y + 0.5 ); 1928 vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); 1929 vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); 1930 vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); 1931 vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); 1932 mat4 bone = mat4( v1, v2, v3, v4 ); 1933 return bone; 1934 } 1935#endif`,Nie=`#ifdef USE_SKINNING 1936 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 1937 vec4 skinned = vec4( 0.0 ); 1938 skinned += boneMatX * skinVertex * skinWeight.x; 1939 skinned += boneMatY * skinVertex * skinWeight.y; 1940 skinned += boneMatZ * skinVertex * skinWeight.z; 1941 skinned += boneMatW * skinVertex * skinWeight.w; 1942 transformed = ( bindMatrixInverse * skinned ).xyz; 1943#endif`,Uie=`#ifdef USE_SKINNING 1944 mat4 skinMatrix = mat4( 0.0 ); 1945 skinMatrix += skinWeight.x * boneMatX; 1946 skinMatrix += skinWeight.y * boneMatY; 1947 skinMatrix += skinWeight.z * boneMatZ; 1948 skinMatrix += skinWeight.w * boneMatW; 1949 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 1950 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 1951 #ifdef USE_TANGENT 1952 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 1953 #endif 1954#endif`,Fie=`float specularStrength; 1955#ifdef USE_SPECULARMAP 1956 vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); 1957 specularStrength = texelSpecular.r; 1958#else 1959 specularStrength = 1.0; 1960#endif`,kie=`#ifdef USE_SPECULARMAP 1961 uniform sampler2D specularMap; 1962#endif`,Hie=`#if defined( TONE_MAPPING ) 1963 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 1964#endif`,Gie=`#ifndef saturate 1965#define saturate( a ) clamp( a, 0.0, 1.0 ) 1966#endif 1967uniform float toneMappingExposure; 1968vec3 LinearToneMapping( vec3 color ) { 1969 return saturate( toneMappingExposure * color ); 1970} 1971vec3 ReinhardToneMapping( vec3 color ) { 1972 color *= toneMappingExposure; 1973 return saturate( color / ( vec3( 1.0 ) + color ) ); 1974} 1975vec3 OptimizedCineonToneMapping( vec3 color ) { 1976 color *= toneMappingExposure; 1977 color = max( vec3( 0.0 ), color - 0.004 ); 1978 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 1979} 1980vec3 RRTAndODTFit( vec3 v ) { 1981 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 1982 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 1983 return a / b; 1984} 1985vec3 ACESFilmicToneMapping( vec3 color ) { 1986 const mat3 ACESInputMat = mat3( 1987 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 1988 vec3( 0.04823, 0.01566, 0.83777 ) 1989 ); 1990 const mat3 ACESOutputMat = mat3( 1991 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 1992 vec3( -0.07367, -0.00605, 1.07602 ) 1993 ); 1994 color *= toneMappingExposure / 0.6; 1995 color = ACESInputMat * color; 1996 color = RRTAndODTFit( color ); 1997 color = ACESOutputMat * color; 1998 return saturate( color ); 1999} 2000vec3 CustomToneMapping( vec3 color ) { return color; }`,zie=`#ifdef USE_TRANSMISSION 2001 material.transmission = transmission; 2002 material.transmissionAlpha = 1.0; 2003 material.thickness = thickness; 2004 material.attenuationDistance = attenuationDistance; 2005 material.attenuationColor = attenuationColor; 2006 #ifdef USE_TRANSMISSIONMAP 2007 material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; 2008 #endif 2009 #ifdef USE_THICKNESSMAP 2010 material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; 2011 #endif 2012 vec3 pos = vWorldPosition; 2013 vec3 v = normalize( cameraPosition - pos ); 2014 vec3 n = inverseTransformDirection( normal, viewMatrix ); 2015 vec4 transmitted = getIBLVolumeRefraction( 2016 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 2017 pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, 2018 material.attenuationColor, material.attenuationDistance ); 2019 material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); 2020 totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); 2021#endif`,Qie=`#ifdef USE_TRANSMISSION 2022 uniform float transmission; 2023 uniform float thickness; 2024 uniform float attenuationDistance; 2025 uniform vec3 attenuationColor; 2026 #ifdef USE_TRANSMISSIONMAP 2027 uniform sampler2D transmissionMap; 2028 #endif 2029 #ifdef USE_THICKNESSMAP 2030 uniform sampler2D thicknessMap; 2031 #endif 2032 uniform vec2 transmissionSamplerSize; 2033 uniform sampler2D transmissionSamplerMap; 2034 uniform mat4 modelMatrix; 2035 uniform mat4 projectionMatrix; 2036 varying vec3 vWorldPosition; 2037 float w0( float a ) { 2038 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 2039 } 2040 float w1( float a ) { 2041 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 2042 } 2043 float w2( float a ){ 2044 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 2045 } 2046 float w3( float a ) { 2047 return ( 1.0 / 6.0 ) * ( a * a * a ); 2048 } 2049 float g0( float a ) { 2050 return w0( a ) + w1( a ); 2051 } 2052 float g1( float a ) { 2053 return w2( a ) + w3( a ); 2054 } 2055 float h0( float a ) { 2056 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 2057 } 2058 float h1( float a ) { 2059 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 2060 } 2061 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 2062 uv = uv * texelSize.zw + 0.5; 2063 vec2 iuv = floor( uv ); 2064 vec2 fuv = fract( uv ); 2065 float g0x = g0( fuv.x ); 2066 float g1x = g1( fuv.x ); 2067 float h0x = h0( fuv.x ); 2068 float h1x = h1( fuv.x ); 2069 float h0y = h0( fuv.y ); 2070 float h1y = h1( fuv.y ); 2071 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2072 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 2073 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2074 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 2075 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 2076 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 2077 } 2078 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 2079 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 2080 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 2081 vec2 fLodSizeInv = 1.0 / fLodSize; 2082 vec2 cLodSizeInv = 1.0 / cLodSize; 2083 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 2084 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 2085 return mix( fSample, cSample, fract( lod ) ); 2086 } 2087 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 2088 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 2089 vec3 modelScale; 2090 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 2091 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 2092 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 2093 return normalize( refractionVector ) * thickness * modelScale; 2094 } 2095 float applyIorToRoughness( const in float roughness, const in float ior ) { 2096 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 2097 } 2098 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 2099 float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 2100 return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); 2101 } 2102 vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 2103 if ( isinf( attenuationDistance ) ) { 2104 return vec3( 1.0 ); 2105 } else { 2106 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 2107 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; 2108 } 2109 } 2110 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 2111 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 2112 const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, 2113 const in vec3 attenuationColor, const in float attenuationDistance ) { 2114 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 2115 vec3 refractedRayExit = position + transmissionRay; 2116 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 2117 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 2118 refractionCoords += 1.0; 2119 refractionCoords /= 2.0; 2120 vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 2121 vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); 2122 vec3 attenuatedColor = transmittance * transmittedLight.rgb; 2123 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 2124 float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; 2125 return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); 2126 } 2127#endif`,Vie=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2128 varying vec2 vUv; 2129#endif 2130#ifdef USE_MAP 2131 varying vec2 vMapUv; 2132#endif 2133#ifdef USE_ALPHAMAP
2134 varying vec2 vAlphaMapUv; 2135#endif 2136#ifdef USE_LIGHTMAP 2137 varying vec2 vLightMapUv; 2138#endif 2139#ifdef USE_AOMAP 2140 varying vec2 vAoMapUv; 2141#endif 2142#ifdef USE_BUMPMAP 2143 varying vec2 vBumpMapUv; 2144#endif 2145#ifdef USE_NORMALMAP 2146 varying vec2 vNormalMapUv; 2147#endif 2148#ifdef USE_EMISSIVEMAP 2149 varying vec2 vEmissiveMapUv; 2150#endif 2151#ifdef USE_METALNESSMAP 2152 varying vec2 vMetalnessMapUv; 2153#endif 2154#ifdef USE_ROUGHNESSMAP 2155 varying vec2 vRoughnessMapUv; 2156#endif 2157#ifdef USE_ANISOTROPYMAP 2158 varying vec2 vAnisotropyMapUv; 2159#endif 2160#ifdef USE_CLEARCOATMAP 2161 varying vec2 vClearcoatMapUv; 2162#endif 2163#ifdef USE_CLEARCOAT_NORMALMAP 2164 varying vec2 vClearcoatNormalMapUv; 2165#endif 2166#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2167 varying vec2 vClearcoatRoughnessMapUv; 2168#endif 2169#ifdef USE_IRIDESCENCEMAP 2170 varying vec2 vIridescenceMapUv; 2171#endif 2172#ifdef USE_IRIDESCENCE_THICKNESSMAP 2173 varying vec2 vIridescenceThicknessMapUv; 2174#endif 2175#ifdef USE_SHEEN_COLORMAP 2176 varying vec2 vSheenColorMapUv; 2177#endif 2178#ifdef USE_SHEEN_ROUGHNESSMAP 2179 varying vec2 vSheenRoughnessMapUv; 2180#endif 2181#ifdef USE_SPECULARMAP 2182 varying vec2 vSpecularMapUv; 2183#endif 2184#ifdef USE_SPECULAR_COLORMAP 2185 varying vec2 vSpecularColorMapUv; 2186#endif 2187#ifdef USE_SPECULAR_INTENSITYMAP 2188 varying vec2 vSpecularIntensityMapUv; 2189#endif 2190#ifdef USE_TRANSMISSIONMAP 2191 uniform mat3 transmissionMapTransform; 2192 varying vec2 vTransmissionMapUv; 2193#endif 2194#ifdef USE_THICKNESSMAP 2195 uniform mat3 thicknessMapTransform; 2196 varying vec2 vThicknessMapUv; 2197#endif`,Wie=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2198 varying vec2 vUv; 2199#endif 2200#ifdef USE_MAP 2201 uniform mat3 mapTransform; 2202 varying vec2 vMapUv; 2203#endif 2204#ifdef USE_ALPHAMAP 2205 uniform mat3 alphaMapTransform; 2206 varying vec2 vAlphaMapUv; 2207#endif 2208#ifdef USE_LIGHTMAP 2209 uniform mat3 lightMapTransform; 2210 varying vec2 vLightMapUv; 2211#endif 2212#ifdef USE_AOMAP 2213 uniform mat3 aoMapTransform; 2214 varying vec2 vAoMapUv; 2215#endif 2216#ifdef USE_BUMPMAP 2217 uniform mat3 bumpMapTransform; 2218 varying vec2 vBumpMapUv; 2219#endif 2220#ifdef USE_NORMALMAP 2221 uniform mat3 normalMapTransform; 2222 varying vec2 vNormalMapUv; 2223#endif 2224#ifdef USE_DISPLACEMENTMAP 2225 uniform mat3 displacementMapTransform; 2226 varying vec2 vDisplacementMapUv; 2227#endif 2228#ifdef USE_EMISSIVEMAP 2229 uniform mat3 emissiveMapTransform; 2230 varying vec2 vEmissiveMapUv; 2231#endif 2232#ifdef USE_METALNESSMAP 2233 uniform mat3 metalnessMapTransform; 2234 varying vec2 vMetalnessMapUv; 2235#endif 2236#ifdef USE_ROUGHNESSMAP 2237 uniform mat3 roughnessMapTransform; 2238 varying vec2 vRoughnessMapUv; 2239#endif 2240#ifdef USE_ANISOTROPYMAP 2241 uniform mat3 anisotropyMapTransform; 2242 varying vec2 vAnisotropyMapUv; 2243#endif 2244#ifdef USE_CLEARCOATMAP 2245 uniform mat3 clearcoatMapTransform; 2246 varying vec2 vClearcoatMapUv; 2247#endif 2248#ifdef USE_CLEARCOAT_NORMALMAP 2249 uniform mat3 clearcoatNormalMapTransform; 2250 varying vec2 vClearcoatNormalMapUv; 2251#endif 2252#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2253 uniform mat3 clearcoatRoughnessMapTransform; 2254 varying vec2 vClearcoatRoughnessMapUv; 2255#endif 2256#ifdef USE_SHEEN_COLORMAP 2257 uniform mat3 sheenColorMapTransform; 2258 varying vec2 vSheenColorMapUv; 2259#endif 2260#ifdef USE_SHEEN_ROUGHNESSMAP 2261 uniform mat3 sheenRoughnessMapTransform; 2262 varying vec2 vSheenRoughnessMapUv; 2263#endif 2264#ifdef USE_IRIDESCENCEMAP 2265 uniform mat3 iridescenceMapTransform; 2266 varying vec2 vIridescenceMapUv; 2267#endif 2268#ifdef USE_IRIDESCENCE_THICKNESSMAP 2269 uniform mat3 iridescenceThicknessMapTransform; 2270 varying vec2 vIridescenceThicknessMapUv; 2271#endif 2272#ifdef USE_SPECULARMAP 2273 uniform mat3 specularMapTransform; 2274 varying vec2 vSpecularMapUv; 2275#endif 2276#ifdef USE_SPECULAR_COLORMAP 2277 uniform mat3 specularColorMapTransform; 2278 varying vec2 vSpecularColorMapUv; 2279#endif 2280#ifdef USE_SPECULAR_INTENSITYMAP 2281 uniform mat3 specularIntensityMapTransform; 2282 varying vec2 vSpecularIntensityMapUv; 2283#endif 2284#ifdef USE_TRANSMISSIONMAP 2285 uniform mat3 transmissionMapTransform; 2286 varying vec2 vTransmissionMapUv; 2287#endif 2288#ifdef USE_THICKNESSMAP 2289 uniform mat3 thicknessMapTransform; 2290 varying vec2 vThicknessMapUv; 2291#endif`,jie=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) 2292 vUv = vec3( uv, 1 ).xy; 2293#endif 2294#ifdef USE_MAP 2295 vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; 2296#endif 2297#ifdef USE_ALPHAMAP 2298 vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; 2299#endif 2300#ifdef USE_LIGHTMAP 2301 vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; 2302#endif 2303#ifdef USE_AOMAP 2304 vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; 2305#endif 2306#ifdef USE_BUMPMAP 2307 vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; 2308#endif 2309#ifdef USE_NORMALMAP 2310 vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; 2311#endif 2312#ifdef USE_DISPLACEMENTMAP 2313 vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; 2314#endif 2315#ifdef USE_EMISSIVEMAP 2316 vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; 2317#endif 2318#ifdef USE_METALNESSMAP 2319 vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; 2320#endif 2321#ifdef USE_ROUGHNESSMAP 2322 vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; 2323#endif 2324#ifdef USE_ANISOTROPYMAP 2325 vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; 2326#endif 2327#ifdef USE_CLEARCOATMAP 2328 vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; 2329#endif 2330#ifdef USE_CLEARCOAT_NORMALMAP 2331 vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; 2332#endif 2333#ifdef USE_CLEARCOAT_ROUGHNESSMAP 2334 vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; 2335#endif
2336#ifdef USE_IRIDESCENCEMAP 2337 vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; 2338#endif 2339#ifdef USE_IRIDESCENCE_THICKNESSMAP 2340 vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; 2341#endif 2342#ifdef USE_SHEEN_COLORMAP 2343 vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; 2344#endif 2345#ifdef USE_SHEEN_ROUGHNESSMAP 2346 vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; 2347#endif 2348#ifdef USE_SPECULARMAP 2349 vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; 2350#endif 2351#ifdef USE_SPECULAR_COLORMAP 2352 vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; 2353#endif 2354#ifdef USE_SPECULAR_INTENSITYMAP 2355 vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; 2356#endif 2357#ifdef USE_TRANSMISSIONMAP 2358 vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; 2359#endif 2360#ifdef USE_THICKNESSMAP 2361 vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; 2362#endif`,Yie=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 2363 vec4 worldPosition = vec4( transformed, 1.0 ); 2364 #ifdef USE_INSTANCING 2365 worldPosition = instanceMatrix * worldPosition; 2366 #endif 2367 worldPosition = modelMatrix * worldPosition; 2368#endif`;const Kie=`varying vec2 vUv; 2369uniform mat3 uvTransform; 2370void main() { 2371 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 2372 gl_Position = vec4( position.xy, 1.0, 1.0 ); 2373}`,Xie=`uniform sampler2D t2D; 2374uniform float backgroundIntensity; 2375varying vec2 vUv; 2376void main() { 2377 vec4 texColor = texture2D( t2D, vUv ); 2378 #ifdef DECODE_VIDEO_TEXTURE 2379 texColor = 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 ); 2380 #endif 2381 texColor.rgb *= backgroundIntensity; 2382 gl_FragColor = texColor; 2383 #include <tonemapping_fragment> 2384 #include <colorspace_fragment> 2385}`,qie=`varying vec3 vWorldDirection; 2386#include <common> 2387void main() { 2388 vWorldDirection = transformDirection( position, modelMatrix ); 2389 #include <begin_vertex> 2390 #include <project_vertex> 2391 gl_Position.z = gl_Position.w; 2392}`,Zie=`#ifdef ENVMAP_TYPE_CUBE 2393 uniform samplerCube envMap; 2394#elif defined( ENVMAP_TYPE_CUBE_UV ) 2395 uniform sampler2D envMap; 2396#endif 2397uniform float flipEnvMap; 2398uniform float backgroundBlurriness; 2399uniform float backgroundIntensity; 2400varying vec3 vWorldDirection; 2401#include <cube_uv_reflection_fragment> 2402void main() { 2403 #ifdef ENVMAP_TYPE_CUBE 2404 vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 2405 #elif defined( ENVMAP_TYPE_CUBE_UV ) 2406 vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); 2407 #else 2408 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 2409 #endif 2410 texColor.rgb *= backgroundIntensity; 2411 gl_FragColor = texColor; 2412 #include <tonemapping_fragment> 2413 #include <colorspace_fragment> 2414}`,Jie=`varying vec3 vWorldDirection; 2415#include <common> 2416void main() { 2417 vWorldDirection = transformDirection( position, modelMatrix ); 2418 #include <begin_vertex> 2419 #include <project_vertex> 2420 gl_Position.z = gl_Position.w; 2421}`,$ie=`uniform samplerCube tCube; 2422uniform float tFlip; 2423uniform float opacity; 2424varying vec3 vWorldDirection; 2425void main() { 2426 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 2427 gl_FragColor = texColor; 2428 gl_FragColor.a *= opacity; 2429 #include <tonemapping_fragment> 2430 #include <colorspace_fragment> 2431}`,ere=`#include <common> 2432#include <uv_pars_vertex> 2433#include <displacementmap_pars_vertex> 2434#include <morphtarget_pars_vertex> 2435#include <skinning_pars_vertex> 2436#include <logdepthbuf_pars_vertex> 2437#include <clipping_planes_pars_vertex> 2438varying vec2 vHighPrecisionZW; 2439void main() { 2440 #include <uv_vertex> 2441 #include <skinbase_vertex> 2442 #ifdef USE_DISPLACEMENTMAP 2443 #include <beginnormal_vertex> 2444 #include <morphnormal_vertex> 2445 #include <skinnormal_vertex> 2446 #endif 2447 #include <begin_vertex> 2448 #include <morphtarget_vertex> 2449 #include <skinning_vertex> 2450 #include <displacementmap_vertex> 2451 #include <project_vertex> 2452 #include <logdepthbuf_vertex> 2453 #include <clipping_planes_vertex> 2454 vHighPrecisionZW = gl_Position.zw; 2455}`,tre=`#if DEPTH_PACKING == 3200 2456 uniform float opacity; 2457#endif 2458#include <common> 2459#include <packing> 2460#include <uv_pars_fragment> 2461#include <map_pars_fragment> 2462#include <alphamap_pars_fragment> 2463#include <alphatest_pars_fragment> 2464#include <alphahash_pars_fragment> 2465#include <logdepthbuf_pars_fragment> 2466#include <clipping_planes_pars_fragment> 2467varying vec2 vHighPrecisionZW; 2468void main() { 2469 #include <clipping_planes_fragment> 2470 vec4 diffuseColor = vec4( 1.0 ); 2471 #if DEPTH_PACKING == 3200 2472 diffuseColor.a = opacity; 2473 #endif 2474 #include <map_fragment> 2475 #include <alphamap_fragment> 2476 #include <alphatest_fragment> 2477 #include <alphahash_fragment> 2478 #include <logdepthbuf_fragment> 2479 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 2480 #if DEPTH_PACKING == 3200 2481 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 2482 #elif DEPTH_PACKING == 3201 2483 gl_FragColor = packDepthToRGBA( fragCoordZ ); 2484 #endif 2485}`,ire=`#define DISTANCE 2486varying vec3 vWorldPosition; 2487#include <common> 2488#include <uv_pars_vertex> 2489#include <displacementmap_pars_vertex> 2490#include <morphtarget_pars_vertex> 2491#include <skinning_pars_vertex> 2492#include <clipping_planes_pars_vertex> 2493void main() { 2494 #include <uv_vertex> 2495 #include <skinbase_vertex> 2496 #ifdef USE_DISPLACEMENTMAP 2497 #include <beginnormal_vertex> 2498 #include <morphnormal_vertex> 2499 #include <skinnormal_vertex> 2500 #endif 2501 #include <begin_vertex> 2502 #include <morphtarget_vertex> 2503 #include <skinning_vertex> 2504 #include <displacementmap_vertex> 2505 #include <project_vertex> 2506 #include <worldpos_vertex> 2507 #include <clipping_planes_vertex> 2508 vWorldPosition = worldPosition.xyz; 2509}`,rre=`#define DISTANCE 2510uniform vec3 referencePosition; 2511uniform float nearDistance; 2512uniform float farDistance; 2513varying vec3 vWorldPosition; 2514#include <common> 2515#include <packing> 2516#include <uv_pars_fragment> 2517#include <map_pars_fragment> 2518#include <alphamap_pars_fragment> 2519#include <alphatest_pars_fragment> 2520#include <alphahash_pars_fragment> 2521#include <clipping_planes_pars_fragment> 2522void main () { 2523 #include <clipping_planes_fragment> 2524 vec4 diffuseColor = vec4( 1.0 ); 2525 #include <map_fragment> 2526 #include <alphamap_fragment> 2527 #include <alphatest_fragment> 2528 #include <alphahash_fragment> 2529 float dist = length( vWorldPosition - referencePosition ); 2530 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 2531 dist = saturate( dist ); 2532 gl_FragColor = packDepthToRGBA( dist ); 2533}`,nre=`varying vec3 vWorldDirection; 2534#include <common> 2535void main() { 2536 vWorldDirection = transformDirection( position, modelMatrix ); 2537 #include <begin_vertex> 2538 #include <project_vertex> 2539}`,are=`uniform sampler2D tEquirect; 2540varying vec3 vWorldDirection; 2541#include <common> 2542void main() { 2543 vec3 direction = normalize( vWorldDirection ); 2544 vec2 sampleUV = equirectUv( direction ); 2545 gl_FragColor = texture2D( tEquirect, sampleUV ); 2546 #include <tonemapping_fragment> 2547 #include <colorspace_fragment> 2548}`,sre=`uniform float scale; 2549attribute float lineDistance; 2550varying float vLineDistance; 2551#include <common> 2552#include <uv_pars_vertex> 2553#include <color_pars_vertex> 2554#include <fog_pars_vertex> 2555#include <morphtarget_pars_vertex> 2556#include <logdepthbuf_pars_vertex> 2557#include <clipping_planes_pars_vertex> 2558void main() { 2559 vLineDistance = scale * lineDistance; 2560 #include <uv_vertex> 2561 #include <color_vertex> 2562 #include <morphcolor_vertex> 2563 #include <begin_vertex> 2564 #include <morphtarget_vertex> 2565 #include <project_vertex> 2566 #include <logdepthbuf_vertex> 2567 #include <clipping_planes_vertex> 2568 #include <fog_vertex> 2569}`,ore=`uniform vec3 diffuse; 2570uniform float opacity; 2571uniform float dashSize; 2572uniform float totalSize; 2573varying float vLineDistance; 2574#include <common> 2575#include <color_pars_fragment> 2576#include <uv_pars_fragment> 2577#include <map_pars_fragment> 2578#include <fog_pars_fragment> 2579#include <logdepthbuf_pars_fragment> 2580#include <clipping_planes_pars_fragment> 2581void main() { 2582 #include <clipping_planes_fragment> 2583 if ( mod( vLineDistance, totalSize ) > dashSize ) { 2584 discard; 2585 } 2586 vec3 outgoingLight = vec3( 0.0 ); 2587 vec4 diffuseColor = vec4( diffuse, opacity ); 2588 #include <logdepthbuf_fragment> 2589 #include <map_fragment> 2590 #include <color_fragment> 2591 outgoingLight = diffuseColor.rgb; 2592 #include <opaque_fragment> 2593 #include <tonemapping_fragment> 2594 #include <colorspace_fragment> 2595 #include <fog_fragment> 2596 #include <premultiplied_alpha_fragment> 2597}`,lre=`#include <common> 2598#include <uv_pars_vertex> 2599#include <envmap_pars_vertex> 2600#include <color_pars_vertex> 2601#include <fog_pars_vertex> 2602#include <morphtarget_pars_vertex> 2603#include <skinning_pars_vertex> 2604#include <logdepthbuf_pars_vertex> 2605#include <clipping_planes_pars_vertex> 2606void main() { 2607 #include <uv_vertex> 2608 #include <color_vertex> 2609 #include <morphcolor_vertex> 2610 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 2611 #include <beginnormal_vertex> 2612 #include <morphnormal_vertex> 2613 #include <skinbase_vertex> 2614 #include <skinnormal_vertex> 2615 #include <defaultnormal_vertex> 2616 #endif 2617 #include <begin_vertex> 2618 #include <morphtarget_vertex> 2619 #include <skinning_vertex> 2620 #include <project_vertex> 2621 #include <logdepthbuf_vertex> 2622 #include <clipping_planes_vertex> 2623 #include <worldpos_vertex> 2624 #include <envmap_vertex> 2625 #include <fog_vertex> 2626}`,cre=`uniform vec3 diffuse; 2627uniform float opacity; 2628#ifndef FLAT_SHADED 2629 varying vec3 vNormal; 2630#endif 2631#include <common> 2632#include <dithering_pars_fragment> 2633#include <color_pars_fragment> 2634#include <uv_pars_fragment> 2635#include <map_pars_fragment> 2636#include <alphamap_pars_fragment> 2637#include <alphatest_pars_fragment> 2638#include <alphahash_pars_fragment> 2639#include <aomap_pars_fragment> 2640#include <lightmap_pars_fragment> 2641#include <envmap_common_pars_fragment> 2642#include <envmap_pars_fragment> 2643#include <fog_pars_fragment> 2644#include <specularmap_pars_fragment> 2645#include <logdepthbuf_pars_fragment> 2646#include <clipping_planes_pars_fragment> 2647void main() { 2648 #include <clipping_planes_fragment> 2649 vec4 diffuseColor = vec4( diffuse, opacity ); 2650 #include <logdepthbuf_fragment> 2651 #include <map_fragment> 2652 #include <color_fragment> 2653 #include <alphamap_fragment> 2654 #include <alphatest_fragment> 2655 #include <alphahash_fragment> 2656 #include <specularmap_fragment> 2657 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2658 #ifdef USE_LIGHTMAP 2659 vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); 2660 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 2661 #else 2662 reflectedLight.indirectDiffuse += vec3( 1.0 ); 2663 #endif 2664 #include <aomap_fragment> 2665 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 2666 vec3 outgoingLight = reflectedLight.indirectDiffuse; 2667 #include <envmap_fragment> 2668 #include <opaque_fragment> 2669 #include <tonemapping_fragment> 2670 #include <colorspace_fragment> 2671 #include <fog_fragment> 2672 #include <premultiplied_alpha_fragment> 2673 #include <dithering_fragment> 2674}`,hre=`#define LAMBERT 2675varying vec3 vViewPosition; 2676#include <common> 2677#include <uv_pars_vertex> 2678#include <displacementmap_pars_vertex> 2679#include <envmap_pars_vertex> 2680#include <color_pars_vertex> 2681#include <fog_pars_vertex> 2682#include <normal_pars_vertex> 2683#include <morphtarget_pars_vertex> 2684#include <skinning_pars_vertex> 2685#include <shadowmap_pars_vertex> 2686#include <logdepthbuf_pars_vertex> 2687#include <clipping_planes_pars_vertex> 2688void main() { 2689 #include <uv_vertex> 2690 #include <color_vertex> 2691 #include <morphcolor_vertex> 2692 #include <beginnormal_vertex> 2693 #include <morphnormal_vertex> 2694 #include <skinbase_vertex> 2695 #include <skinnormal_vertex> 2696 #include <defaultnormal_vertex> 2697 #include <normal_vertex> 2698 #include <begin_vertex> 2699 #include <morphtarget_vertex> 2700 #include <skinning_vertex> 2701 #include <displacementmap_vertex> 2702 #include <project_vertex> 2703 #include <logdepthbuf_vertex> 2704 #include <clipping_planes_vertex> 2705 vViewPosition = - mvPosition.xyz; 2706 #include <worldpos_vertex> 2707 #include <envmap_vertex> 2708 #include <shadowmap_vertex> 2709 #include <fog_vertex> 2710}`,ure=`#define LAMBERT 2711uniform vec3 diffuse; 2712uniform vec3 emissive; 2713uniform float opacity; 2714#include <common> 2715#include <packing> 2716#include <dithering_pars_fragment> 2717#include <color_pars_fragment> 2718#include <uv_pars_fragment> 2719#include <map_pars_fragment> 2720#include <alphamap_pars_fragment> 2721#include <alphatest_pars_fragment> 2722#include <alphahash_pars_fragment> 2723#include <aomap_pars_fragment> 2724#include <lightmap_pars_fragment> 2725#include <emissivemap_pars_fragment> 2726#include <envmap_common_pars_fragment> 2727#include <envmap_pars_fragment> 2728#include <fog_pars_fragment> 2729#include <bsdfs> 2730#include <lights_pars_begin> 2731#include <normal_pars_fragment> 2732#include <lights_lambert_pars_fragment> 2733#include <shadowmap_pars_fragment> 2734#include <bumpmap_pars_fragment> 2735#include <normalmap_pars_fragment> 2736#include <specularmap_pars_fragment> 2737#include <logdepthbuf_pars_fragment> 2738#include <clipping_planes_pars_fragment> 2739void main() { 2740 #include <clipping_planes_fragment> 2741 vec4 diffuseColor = vec4( diffuse, opacity ); 2742 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2743 vec3 totalEmissiveRadiance = emissive; 2744 #include <logdepthbuf_fragment> 2745 #include <map_fragment> 2746 #include <color_fragment> 2747 #include <alphamap_fragment> 2748 #include <alphatest_fragment> 2749 #include <alphahash_fragment> 2750 #include <specularmap_fragment> 2751 #include <normal_fragment_begin> 2752 #include <normal_fragment_maps> 2753 #include <emissivemap_fragment> 2754 #include <lights_lambert_fragment> 2755 #include <lights_fragment_begin> 2756 #include <lights_fragment_maps> 2757 #include <lights_fragment_end> 2758 #include <aomap_fragment> 2759 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 2760 #include <envmap_fragment> 2761 #include <opaque_fragment> 2762 #include <tonemapping_fragment> 2763 #include <colorspace_fragment> 2764 #include <fog_fragment> 2765 #include <premultiplied_alpha_fragment> 2766 #include <dithering_fragment> 2767}`,dre=`#define MATCAP 2768varying vec3 vViewPosition; 2769#include <common> 2770#include <uv_pars_vertex> 2771#include <color_pars_vertex> 2772#include <displacementmap_pars_vertex> 2773#include <fog_pars_vertex> 2774#include <normal_pars_vertex> 2775#include <morphtarget_pars_vertex> 2776#include <skinning_pars_vertex> 2777#include <logdepthbuf_pars_vertex> 2778#include <clipping_planes_pars_vertex> 2779void main() { 2780 #include <uv_vertex> 2781 #include <color_vertex> 2782 #include <morphcolor_vertex> 2783 #include <beginnormal_vertex> 2784 #include <morphnormal_vertex> 2785 #include <skinbase_vertex> 2786 #include <skinnormal_vertex> 2787 #include <defaultnormal_vertex> 2788 #include <normal_vertex> 2789 #include <begin_vertex> 2790 #include <morphtarget_vertex> 2791 #include <skinning_vertex> 2792 #include <displacementmap_vertex> 2793 #include <project_vertex> 2794 #include <logdepthbuf_vertex> 2795 #include <clipping_planes_vertex> 2796 #include <fog_vertex> 2797 vViewPosition = - mvPosition.xyz; 2798}`,Are=`#define MATCAP 2799uniform vec3 diffuse; 2800uniform float opacity; 2801uniform sampler2D matcap; 2802varying vec3 vViewPosition; 2803#include <common> 2804#include <dithering_pars_fragment> 2805#include <color_pars_fragment> 2806#include <uv_pars_fragment> 2807#include <map_pars_fragment> 2808#include <alphamap_pars_fragment> 2809#include <alphatest_pars_fragment> 2810#include <alphahash_pars_fragment> 2811#include <fog_pars_fragment> 2812#include <normal_pars_fragment> 2813#include <bumpmap_pars_fragment> 2814#include <normalmap_pars_fragment> 2815#include <logdepthbuf_pars_fragment> 2816#include <clipping_planes_pars_fragment> 2817void main() { 2818 #include <clipping_planes_fragment> 2819 vec4 diffuseColor = vec4( diffuse, opacity ); 2820 #include <logdepthbuf_fragment> 2821 #include <map_fragment> 2822 #include <color_fragment> 2823 #include <alphamap_fragment> 2824 #include <alphatest_fragment> 2825 #include <alphahash_fragment> 2826 #include <normal_fragment_begin> 2827 #include <normal_fragment_maps> 2828 vec3 viewDir = normalize( vViewPosition ); 2829 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 2830 vec3 y = cross( viewDir, x ); 2831 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 2832 #ifdef USE_MATCAP
2833 vec4 matcapColor = texture2D( matcap, uv ); 2834 #else 2835 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 2836 #endif 2837 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 2838 #include <opaque_fragment> 2839 #include <tonemapping_fragment> 2840 #include <colorspace_fragment> 2841 #include <fog_fragment> 2842 #include <premultiplied_alpha_fragment> 2843 #include <dithering_fragment> 2844}`,fre=`#define NORMAL 2845#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 2846 varying vec3 vViewPosition; 2847#endif 2848#include <common> 2849#include <uv_pars_vertex> 2850#include <displacementmap_pars_vertex> 2851#include <normal_pars_vertex> 2852#include <morphtarget_pars_vertex> 2853#include <skinning_pars_vertex> 2854#include <logdepthbuf_pars_vertex> 2855#include <clipping_planes_pars_vertex> 2856void main() { 2857 #include <uv_vertex> 2858 #include <beginnormal_vertex> 2859 #include <morphnormal_vertex> 2860 #include <skinbase_vertex> 2861 #include <skinnormal_vertex> 2862 #include <defaultnormal_vertex> 2863 #include <normal_vertex> 2864 #include <begin_vertex> 2865 #include <morphtarget_vertex> 2866 #include <skinning_vertex> 2867 #include <displacementmap_vertex> 2868 #include <project_vertex> 2869 #include <logdepthbuf_vertex> 2870 #include <clipping_planes_vertex> 2871#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 2872 vViewPosition = - mvPosition.xyz; 2873#endif 2874}`,pre=`#define NORMAL 2875uniform float opacity; 2876#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) 2877 varying vec3 vViewPosition; 2878#endif 2879#include <packing> 2880#include <uv_pars_fragment> 2881#include <normal_pars_fragment> 2882#include <bumpmap_pars_fragment> 2883#include <normalmap_pars_fragment> 2884#include <logdepthbuf_pars_fragment> 2885#include <clipping_planes_pars_fragment> 2886void main() { 2887 #include <clipping_planes_fragment> 2888 #include <logdepthbuf_fragment> 2889 #include <normal_fragment_begin> 2890 #include <normal_fragment_maps> 2891 gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); 2892 #ifdef OPAQUE 2893 gl_FragColor.a = 1.0; 2894 #endif 2895}`,mre=`#define PHONG 2896varying vec3 vViewPosition; 2897#include <common> 2898#include <uv_pars_vertex> 2899#include <displacementmap_pars_vertex> 2900#include <envmap_pars_vertex> 2901#include <color_pars_vertex> 2902#include <fog_pars_vertex> 2903#include <normal_pars_vertex> 2904#include <morphtarget_pars_vertex> 2905#include <skinning_pars_vertex> 2906#include <shadowmap_pars_vertex> 2907#include <logdepthbuf_pars_vertex> 2908#include <clipping_planes_pars_vertex> 2909void main() { 2910 #include <uv_vertex> 2911 #include <color_vertex> 2912 #include <morphcolor_vertex> 2913 #include <beginnormal_vertex> 2914 #include <morphnormal_vertex> 2915 #include <skinbase_vertex> 2916 #include <skinnormal_vertex> 2917 #include <defaultnormal_vertex> 2918 #include <normal_vertex> 2919 #include <begin_vertex> 2920 #include <morphtarget_vertex> 2921 #include <skinning_vertex> 2922 #include <displacementmap_vertex> 2923 #include <project_vertex> 2924 #include <logdepthbuf_vertex> 2925 #include <clipping_planes_vertex> 2926 vViewPosition = - mvPosition.xyz; 2927 #include <worldpos_vertex> 2928 #include <envmap_vertex> 2929 #include <shadowmap_vertex> 2930 #include <fog_vertex> 2931}`,gre=`#define PHONG 2932uniform vec3 diffuse; 2933uniform vec3 emissive; 2934uniform vec3 specular; 2935uniform float shininess; 2936uniform float opacity; 2937#include <common> 2938#include <packing> 2939#include <dithering_pars_fragment> 2940#include <color_pars_fragment> 2941#include <uv_pars_fragment> 2942#include <map_pars_fragment> 2943#include <alphamap_pars_fragment> 2944#include <alphatest_pars_fragment> 2945#include <alphahash_pars_fragment> 2946#include <aomap_pars_fragment> 2947#include <lightmap_pars_fragment> 2948#include <emissivemap_pars_fragment> 2949#include <envmap_common_pars_fragment> 2950#include <envmap_pars_fragment> 2951#include <fog_pars_fragment> 2952#include <bsdfs> 2953#include <lights_pars_begin> 2954#include <normal_pars_fragment> 2955#include <lights_phong_pars_fragment> 2956#include <shadowmap_pars_fragment> 2957#include <bumpmap_pars_fragment> 2958#include <normalmap_pars_fragment> 2959#include <specularmap_pars_fragment> 2960#include <logdepthbuf_pars_fragment> 2961#include <clipping_planes_pars_fragment> 2962void main() { 2963 #include <clipping_planes_fragment> 2964 vec4 diffuseColor = vec4( diffuse, opacity ); 2965 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 2966 vec3 totalEmissiveRadiance = emissive; 2967 #include <logdepthbuf_fragment> 2968 #include <map_fragment> 2969 #include <color_fragment> 2970 #include <alphamap_fragment> 2971 #include <alphatest_fragment> 2972 #include <alphahash_fragment> 2973 #include <specularmap_fragment> 2974 #include <normal_fragment_begin> 2975 #include <normal_fragment_maps> 2976 #include <emissivemap_fragment> 2977 #include <lights_phong_fragment> 2978 #include <lights_fragment_begin> 2979 #include <lights_fragment_maps> 2980 #include <lights_fragment_end> 2981 #include <aomap_fragment> 2982 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 2983 #include <envmap_fragment> 2984 #include <opaque_fragment> 2985 #include <tonemapping_fragment> 2986 #include <colorspace_fragment> 2987 #include <fog_fragment> 2988 #include <premultiplied_alpha_fragment> 2989 #include <dithering_fragment> 2990}`,vre=`#define STANDARD 2991varying vec3 vViewPosition; 2992#ifdef USE_TRANSMISSION 2993 varying vec3 vWorldPosition; 2994#endif 2995#include <common> 2996#include <uv_pars_vertex> 2997#include <displacementmap_pars_vertex> 2998#include <color_pars_vertex> 2999#include <fog_pars_vertex> 3000#include <normal_pars_vertex> 3001#include <morphtarget_pars_vertex> 3002#include <skinning_pars_vertex> 3003#include <shadowmap_pars_vertex> 3004#include <logdepthbuf_pars_vertex> 3005#include <clipping_planes_pars_vertex> 3006void main() { 3007 #include <uv_vertex> 3008 #include <color_vertex> 3009 #include <morphcolor_vertex> 3010 #include <beginnormal_vertex> 3011 #include <morphnormal_vertex> 3012 #include <skinbase_vertex> 3013 #include <skinnormal_vertex> 3014 #include <defaultnormal_vertex> 3015 #include <normal_vertex> 3016 #include <begin_vertex> 3017 #include <morphtarget_vertex> 3018 #include <skinning_vertex> 3019 #include <displacementmap_vertex> 3020 #include <project_vertex> 3021 #include <logdepthbuf_vertex> 3022 #include <clipping_planes_vertex> 3023 vViewPosition = - mvPosition.xyz; 3024 #include <worldpos_vertex> 3025 #include <shadowmap_vertex> 3026 #include <fog_vertex> 3027#ifdef USE_TRANSMISSION 3028 vWorldPosition = worldPosition.xyz; 3029#endif 3030}`,_re=`#define STANDARD 3031#ifdef PHYSICAL 3032 #define IOR 3033 #define USE_SPECULAR 3034#endif 3035uniform vec3 diffuse; 3036uniform vec3 emissive; 3037uniform float roughness; 3038uniform float metalness; 3039uniform float opacity; 3040#ifdef IOR 3041 uniform float ior; 3042#endif 3043#ifdef USE_SPECULAR 3044 uniform float specularIntensity; 3045 uniform vec3 specularColor; 3046 #ifdef USE_SPECULAR_COLORMAP 3047 uniform sampler2D specularColorMap; 3048 #endif 3049 #ifdef USE_SPECULAR_INTENSITYMAP 3050 uniform sampler2D specularIntensityMap; 3051 #endif 3052#endif 3053#ifdef USE_CLEARCOAT 3054 uniform float clearcoat; 3055 uniform float clearcoatRoughness; 3056#endif
3057#ifdef USE_IRIDESCENCE 3058 uniform float iridescence; 3059 uniform float iridescenceIOR; 3060 uniform float iridescenceThicknessMinimum; 3061 uniform float iridescenceThicknessMaximum; 3062#endif 3063#ifdef USE_SHEEN 3064 uniform vec3 sheenColor; 3065 uniform float sheenRoughness; 3066 #ifdef USE_SHEEN_COLORMAP 3067 uniform sampler2D sheenColorMap; 3068 #endif 3069 #ifdef USE_SHEEN_ROUGHNESSMAP 3070 uniform sampler2D sheenRoughnessMap; 3071 #endif 3072#endif 3073#ifdef USE_ANISOTROPY 3074 uniform vec2 anisotropyVector; 3075 #ifdef USE_ANISOTROPYMAP 3076 uniform sampler2D anisotropyMap; 3077 #endif 3078#endif 3079varying vec3 vViewPosition; 3080#include <common> 3081#include <packing> 3082#include <dithering_pars_fragment> 3083#include <color_pars_fragment> 3084#include <uv_pars_fragment> 3085#include <map_pars_fragment> 3086#include <alphamap_pars_fragment> 3087#include <alphatest_pars_fragment> 3088#include <alphahash_pars_fragment> 3089#include <aomap_pars_fragment> 3090#include <lightmap_pars_fragment> 3091#include <emissivemap_pars_fragment> 3092#include <iridescence_fragment> 3093#include <cube_uv_reflection_fragment> 3094#include <envmap_common_pars_fragment> 3095#include <envmap_physical_pars_fragment> 3096#include <fog_pars_fragment> 3097#include <lights_pars_begin> 3098#include <normal_pars_fragment> 3099#include <lights_physical_pars_fragment> 3100#include <transmission_pars_fragment> 3101#include <shadowmap_pars_fragment> 3102#include <bumpmap_pars_fragment> 3103#include <normalmap_pars_fragment> 3104#include <clearcoat_pars_fragment> 3105#include <iridescence_pars_fragment> 3106#include <roughnessmap_pars_fragment> 3107#include <metalnessmap_pars_fragment> 3108#include <logdepthbuf_pars_fragment> 3109#include <clipping_planes_pars_fragment> 3110void main() { 3111 #include <clipping_planes_fragment> 3112 vec4 diffuseColor = vec4( diffuse, opacity ); 3113 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3114 vec3 totalEmissiveRadiance = emissive; 3115 #include <logdepthbuf_fragment> 3116 #include <map_fragment> 3117 #include <color_fragment> 3118 #include <alphamap_fragment> 3119 #include <alphatest_fragment> 3120 #include <alphahash_fragment> 3121 #include <roughnessmap_fragment> 3122 #include <metalnessmap_fragment> 3123 #include <normal_fragment_begin> 3124 #include <normal_fragment_maps> 3125 #include <clearcoat_normal_fragment_begin> 3126 #include <clearcoat_normal_fragment_maps> 3127 #include <emissivemap_fragment> 3128 #include <lights_physical_fragment> 3129 #include <lights_fragment_begin> 3130 #include <lights_fragment_maps> 3131 #include <lights_fragment_end> 3132 #include <aomap_fragment> 3133 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 3134 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 3135 #include <transmission_fragment> 3136 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 3137 #ifdef USE_SHEEN 3138 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 3139 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect; 3140 #endif 3141 #ifdef USE_CLEARCOAT 3142 float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) ); 3143 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 3144 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat; 3145 #endif 3146 #include <opaque_fragment> 3147 #include <tonemapping_fragment> 3148 #include <colorspace_fragment> 3149 #include <fog_fragment> 3150 #include <premultiplied_alpha_fragment> 3151 #include <dithering_fragment> 3152}`,yre=`#define TOON 3153varying vec3 vViewPosition; 3154#include <common> 3155#include <uv_pars_vertex> 3156#include <displacementmap_pars_vertex> 3157#include <color_pars_vertex> 3158#include <fog_pars_vertex> 3159#include <normal_pars_vertex> 3160#include <morphtarget_pars_vertex> 3161#include <skinning_pars_vertex> 3162#include <shadowmap_pars_vertex> 3163#include <logdepthbuf_pars_vertex> 3164#include <clipping_planes_pars_vertex> 3165void main() { 3166 #include <uv_vertex> 3167 #include <color_vertex> 3168 #include <morphcolor_vertex> 3169 #include <beginnormal_vertex> 3170 #include <morphnormal_vertex> 3171 #include <skinbase_vertex> 3172 #include <skinnormal_vertex> 3173 #include <defaultnormal_vertex> 3174 #include <normal_vertex> 3175 #include <begin_vertex> 3176 #include <morphtarget_vertex> 3177 #include <skinning_vertex> 3178 #include <displacementmap_vertex> 3179 #include <project_vertex> 3180 #include <logdepthbuf_vertex> 3181 #include <clipping_planes_vertex> 3182 vViewPosition = - mvPosition.xyz; 3183 #include <worldpos_vertex> 3184 #include <shadowmap_vertex> 3185 #include <fog_vertex> 3186}`,Ere=`#define TOON 3187uniform vec3 diffuse; 3188uniform vec3 emissive; 3189uniform float opacity; 3190#include <common> 3191#include <packing> 3192#include <dithering_pars_fragment> 3193#include <color_pars_fragment> 3194#include <uv_pars_fragment> 3195#include <map_pars_fragment> 3196#include <alphamap_pars_fragment> 3197#include <alphatest_pars_fragment> 3198#include <alphahash_pars_fragment> 3199#include <aomap_pars_fragment> 3200#include <lightmap_pars_fragment> 3201#include <emissivemap_pars_fragment> 3202#include <gradientmap_pars_fragment> 3203#include <fog_pars_fragment> 3204#include <bsdfs> 3205#include <lights_pars_begin> 3206#include <normal_pars_fragment> 3207#include <lights_toon_pars_fragment> 3208#include <shadowmap_pars_fragment> 3209#include <bumpmap_pars_fragment> 3210#include <normalmap_pars_fragment> 3211#include <logdepthbuf_pars_fragment> 3212#include <clipping_planes_pars_fragment> 3213void main() { 3214 #include <clipping_planes_fragment> 3215 vec4 diffuseColor = vec4( diffuse, opacity ); 3216 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 3217 vec3 totalEmissiveRadiance = emissive; 3218 #include <logdepthbuf_fragment> 3219 #include <map_fragment> 3220 #include <color_fragment> 3221 #include <alphamap_fragment> 3222 #include <alphatest_fragment> 3223 #include <alphahash_fragment> 3224 #include <normal_fragment_begin> 3225 #include <normal_fragment_maps> 3226 #include <emissivemap_fragment> 3227 #include <lights_toon_fragment> 3228 #include <lights_fragment_begin> 3229 #include <lights_fragment_maps> 3230 #include <lights_fragment_end> 3231 #include <aomap_fragment> 3232 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 3233 #include <opaque_fragment> 3234 #include <tonemapping_fragment> 3235 #include <colorspace_fragment> 3236 #include <fog_fragment> 3237 #include <premultiplied_alpha_fragment> 3238 #include <dithering_fragment> 3239}`,wre=`uniform float size; 3240uniform float scale; 3241#include <common> 3242#include <color_pars_vertex> 3243#include <fog_pars_vertex> 3244#include <morphtarget_pars_vertex> 3245#include <logdepthbuf_pars_vertex> 3246#include <clipping_planes_pars_vertex> 3247#ifdef USE_POINTS_UV 3248 varying vec2 vUv; 3249 uniform mat3 uvTransform; 3250#endif 3251void main() { 3252 #ifdef USE_POINTS_UV 3253 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 3254 #endif 3255 #include <color_vertex> 3256 #include <morphcolor_vertex> 3257 #include <begin_vertex> 3258 #include <morphtarget_vertex> 3259 #include <project_vertex> 3260 gl_PointSize = size; 3261 #ifdef USE_SIZEATTENUATION 3262 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3263 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 3264 #endif 3265 #include <logdepthbuf_vertex> 3266 #include <clipping_planes_vertex> 3267 #include <worldpos_vertex> 3268 #include <fog_vertex> 3269}`,bre=`uniform vec3 diffuse; 3270uniform float opacity; 3271#include <common> 3272#include <color_pars_fragment> 3273#include <map_particle_pars_fragment> 3274#include <alphatest_pars_fragment> 3275#include <alphahash_pars_fragment> 3276#include <fog_pars_fragment> 3277#include <logdepthbuf_pars_fragment> 3278#include <clipping_planes_pars_fragment> 3279void main() { 3280 #include <clipping_planes_fragment> 3281 vec3 outgoingLight = vec3( 0.0 ); 3282 vec4 diffuseColor = vec4( diffuse, opacity ); 3283 #include <logdepthbuf_fragment> 3284 #include <map_particle_fragment> 3285 #include <color_fragment> 3286 #include <alphatest_fragment> 3287 #include <alphahash_fragment> 3288 outgoingLight = diffuseColor.rgb; 3289 #include <opaque_fragment> 3290 #include <tonemapping_fragment> 3291 #include <colorspace_fragment> 3292 #include <fog_fragment> 3293 #include <premultiplied_alpha_fragment> 3294}`,Sre=`#include <common> 3295#include <fog_pars_vertex> 3296#include <morphtarget_pars_vertex> 3297#include <skinning_pars_vertex> 3298#include <logdepthbuf_pars_vertex> 3299#include <shadowmap_pars_vertex> 3300void main() { 3301 #include <beginnormal_vertex> 3302 #include <morphnormal_vertex> 3303 #include <skinbase_vertex> 3304 #include <skinnormal_vertex> 3305 #include <defaultnormal_vertex> 3306 #include <begin_vertex> 3307 #include <morphtarget_vertex> 3308 #include <skinning_vertex> 3309 #include <project_vertex> 3310 #include <logdepthbuf_vertex> 3311 #include <worldpos_vertex> 3312 #include <shadowmap_vertex> 3313 #include <fog_vertex> 3314}`,Cre=`uniform vec3 color; 3315uniform float opacity; 3316#include <common> 3317#include <packing> 3318#include <fog_pars_fragment> 3319#include <bsdfs> 3320#include <lights_pars_begin> 3321#include <logdepthbuf_pars_fragment> 3322#include <shadowmap_pars_fragment> 3323#include <shadowmask_pars_fragment> 3324void main() { 3325 #include <logdepthbuf_fragment> 3326 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 3327 #include <tonemapping_fragment> 3328 #include <colorspace_fragment> 3329 #include <fog_fragment> 3330}`,Tre=`uniform float rotation; 3331uniform vec2 center; 3332#include <common> 3333#include <uv_pars_vertex> 3334#include <fog_pars_vertex> 3335#include <logdepthbuf_pars_vertex> 3336#include <clipping_planes_pars_vertex> 3337void main() { 3338 #include <uv_vertex> 3339 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 3340 vec2 scale; 3341 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 3342 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 3343 #ifndef USE_SIZEATTENUATION 3344 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 3345 if ( isPerspective ) scale *= - mvPosition.z; 3346 #endif 3347 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 3348 vec2 rotatedPosition; 3349 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 3350 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 3351 mvPosition.xy += rotatedPosition; 3352 gl_Position = projectionMatrix * mvPosition; 3353 #include <logdepthbuf_vertex> 3354 #include <clipping_planes_vertex> 3355 #include <fog_vertex> 3356}`,Mre=`uniform vec3 diffuse; 3357uniform float opacity; 3358#include <common> 3359#include <uv_pars_fragment> 3360#include <map_pars_fragment> 3361#include <alphamap_pars_fragment> 3362#include <alphatest_pars_fragment> 3363#include <alphahash_pars_fragment> 3364#include <fog_pars_fragment> 3365#include <logdepthbuf_pars_fragment> 3366#include <clipping_planes_pars_fragment> 3367void main() { 3368 #include <clipping_planes_fragment> 3369 vec3 outgoingLight = vec3( 0.0 ); 3370 vec4 diffuseColor = vec4( diffuse, opacity ); 3371 #include <logdepthbuf_fragment> 3372 #include <map_fragment> 3373 #include <alphamap_fragment> 3374 #include <alphatest_fragment> 3375 #include <alphahash_fragment> 3376 outgoingLight = diffuseColor.rgb; 3377 #include <opaque_fragment> 3378 #include <tonemapping_fragment> 3379 #include <colorspace_fragment> 3380 #include <fog_fragment> 3381}`,Mi={alphahash_fragment:Zee,alphahash_pars_fragment:Jee,alphamap_fragment:$ee,alphamap_pars_fragment:ete,alphatest_fragment:tte,alphatest_pars_fragment:ite,aomap_fragment:rte,aomap_pars_fragment:nte,begin_vertex:ate,beginnormal_vertex:ste,bsdfs:ote,iridescence_fragment:lte,bumpmap_pars_fragment:cte,clipping_planes_fragment:hte,clipping_planes_pars_fragment:ute,clipping_planes_pars_vertex:dte,clipping_planes_vertex:Ate,color_fragment:fte,color_pars_fragment:pte,color_pars_vertex:mte,color_vertex:gte,common:vte,cube_uv_reflection_fragment:_te,defaultnormal_vertex:yte,displacementmap_pars_vertex:Ete,displacementmap_vertex:wte,emissivemap_fragment:bte,emissivemap_pars_fragment:Ste,colorspace_fragment:Cte,colorspace_pars_fragment:Tte,envmap_fragment:Mte,envmap_common_pars_fragment:xte,envmap_pars_fragment:Rte,envmap_pars_vertex:Bte,envmap_physical_pars_fragment:zte,envmap_vertex:Ite,fog_vertex:Dte,fog_pars_vertex:Pte,fog_fragment:Lte,fog_pars_fragment:Ote,gradientmap_pars_fragment:Nte,lightmap_fragment:Ute,lightmap_pars_fragment:Fte,lights_lambert_fragment:kte,lights_lambert_pars_fragment:Hte,lights_pars_begin:Gte,lights_toon_fragment:Qte,lights_toon_pars_fragment:Vte,lights_phong_fragment:Wte,lights_phong_pars_fragment:jte,lights_physical_fragment:Yte,lights_physical_pars_fragment:Kte,lights_fragment_begin:Xte,lights_fragment_maps:qte,lights_fragment_end:Zte,logdepthbuf_fragment:Jte,logdepthbuf_pars_fragment:$te,logdepthbuf_pars_vertex:eie,logdepthbuf_vertex:tie,map_fragment:iie,map_pars_fragment:rie,map_particle_fragment:nie,map_particle_pars_fragment:aie,metalnessmap_fragment:sie,metalnessmap_pars_fragment:oie,morphcolor_vertex:lie,morphnormal_vertex:cie,morphtarget_pars_vertex:hie,morphtarget_vertex:uie,n
vendor: 4,312 bytes, line 3381
3381ormal_fragment_begin:die,normal_fragment_maps:Aie,normal_pars_fragment:fie,normal_pars_vertex:pie,normal_vertex:mie,normalmap_pars_fragment:gie,clearcoat_normal_fragment_begin:vie,clearcoat_normal_fragment_maps:_ie,clearcoat_pars_fragment:yie,iridescence_pars_fragment:Eie,opaque_fragment:wie,packing:bie,premultiplied_alpha_fragment:Sie,project_vertex:Cie,dithering_fragment:Tie,dithering_pars_fragment:Mie,roughnessmap_fragment:xie,roughnessmap_pars_fragment:Rie,shadowmap_pars_fragment:Bie,shadowmap_pars_vertex:Iie,shadowmap_vertex:Die,shadowmask_pars_fragment:Pie,skinbase_vertex:Lie,skinning_pars_vertex:Oie,skinning_vertex:Nie,skinnormal_vertex:Uie,specularmap_fragment:Fie,specularmap_pars_fragment:kie,tonemapping_fragment:Hie,tonemapping_pars_fragment:Gie,transmission_fragment:zie,transmission_pars_fragment:Qie,uv_pars_fragment:Vie,uv_pars_vertex:Wie,uv_vertex:jie,worldpos_vertex:Yie,background_vert:Kie,background_frag:Xie,backgroundCube_vert:qie,backgroundCube_frag:Zie,cube_vert:Jie,cube_frag:$ie,depth_vert:ere,depth_frag:tre,distanceRGBA_vert:ire,distanceRGBA_frag:rre,equirect_vert:nre,equirect_frag:are,linedashed_vert:sre,linedashed_frag:ore,meshbasic_vert:lre,meshbasic_frag:cre,meshlambert_vert:hre,meshlambert_frag:ure,meshmatcap_vert:dre,meshmatcap_frag:Are,meshnormal_vert:fre,meshnormal_frag:pre,meshphong_vert:mre,meshphong_frag:gre,meshphysical_vert:vre,meshphysical_frag:_re,meshtoon_vert:yre,meshtoon_frag:Ere,points_vert:wre,points_frag:bre,shadow_vert:Sre,shadow_frag:Cre,sprite_vert:Tre,sprite_frag:Mre},wt={common:{diffuse:{value:new Kt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Di},alphaMap:{value:null},alphaMapTransform:{value:new Di},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Di}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Di}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Di}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Di},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Di},normalScale:{value:new Jt(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Di},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Di}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Di}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Di}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Kt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Kt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Di},alphaTest:{value:0},uvTransform:{value:new Di}},sprite:{diffuse:{value:new Kt(16777215)},opacity:{value:1},center:{value:new Jt(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Di},alphaMap:{value:null},alphaMapTransform:{value:new Di},alphaTest:{value:0}}}
vendor: 5,182 bytes, line 3381
3381,Vc={basic:{uniforms:Ts([wt.common,wt.specularmap,wt.envmap,wt.aomap,wt.lightmap,wt.fog]),vertexShader:Mi.meshbasic_vert,fragmentShader:Mi.meshbasic_frag},lambert:{uniforms:Ts([wt.common,wt.specularmap,wt.envmap,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.fog,wt.lights,{emissive:{value:new Kt(0)}}]),vertexShader:Mi.meshlambert_vert,fragmentShader:Mi.meshlambert_frag},phong:{uniforms:Ts([wt.common,wt.specularmap,wt.envmap,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.fog,wt.lights,{emissive:{value:new Kt(0)},specular:{value:new Kt(1118481)},shininess:{value:30}}]),vertexShader:Mi.meshphong_vert,fragmentShader:Mi.meshphong_frag},standard:{uniforms:Ts([wt.common,wt.envmap,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.roughnessmap,wt.metalnessmap,wt.fog,wt.lights,{emissive:{value:new Kt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Mi.meshphysical_vert,fragmentShader:Mi.meshphysical_frag},toon:{uniforms:Ts([wt.common,wt.aomap,wt.lightmap,wt.emissivemap,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.gradientmap,wt.fog,wt.lights,{emissive:{value:new Kt(0)}}]),vertexShader:Mi.meshtoon_vert,fragmentShader:Mi.meshtoon_frag},matcap:{uniforms:Ts([wt.common,wt.bumpmap,wt.normalmap,wt.displacementmap,wt.fog,{matcap:{value:null}}]),vertexShader:Mi.meshmatcap_vert,fragmentShader:Mi.meshmatcap_frag},points:{uniforms:Ts([wt.points,wt.fog]),vertexShader:Mi.points_vert,fragmentShader:Mi.points_frag},dashed:{uniforms:Ts([wt.common,wt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Mi.linedashed_vert,fragmentShader:Mi.linedashed_frag},depth:{uniforms:Ts([wt.common,wt.displacementmap]),vertexShader:Mi.depth_vert,fragmentShader:Mi.depth_frag},normal:{uniforms:Ts([wt.common,wt.bumpmap,wt.normalmap,wt.displacementmap,{opacity:{value:1}}]),vertexShader:Mi.meshnormal_vert,fragmentShader:Mi.meshnormal_frag},sprite:{uniforms:Ts([wt.sprite,wt.fog]),vertexShader:Mi.sprite_vert,fragmentShader:Mi.sprite_frag},background:{uniforms:{uvTransform:{value:new Di},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Mi.background_vert,fragmentShader:Mi.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:Mi.backgroundCube_vert,fragmentShader:Mi.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Mi.cube_vert,fragmentShader:Mi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Mi.equirect_vert,fragmentShader:Mi.equirect_frag},distanceRGBA:{uniforms:Ts([wt.common,wt.displacementmap,{referencePosition:{value:new we},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Mi.distanceRGBA_vert,fragmentShader:Mi.distanceRGBA_frag},shadow:{uniforms:Ts([wt.lights,wt.fog,{color:{value:new Kt(0)},opacity:{value:1}}]),vertexShader:Mi.shadow_vert,fragmentShader:Mi.shadow_frag}};Vc.physical={uniforms:Ts([Vc.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Di},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Di},clearcoatNormalScale:{value:new Jt(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Di},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Di},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Di},sheen:{value:0},sheenColor:{value:new Kt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Di},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Di},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Di},transmissionSamplerSize:{value:new Jt},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Di},attenuationDistance:{value:0},attenuationColor:{value:new Kt(0)},specularColor:{value:new Kt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Di},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Di},anisotropyVector:{value:new Jt},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Di}}]),vertexShader:Mi.meshphysical_vert,fragmentShader:Mi.meshphysical_frag};const F1={r:0,b:0,g:0};function xre(t,i,r,n,a,s,o){const l=new Kt(0);let c=s===!0?0:1,h,u,d=null,A=0,f=null;function m(p,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?r:i).get(y)),y===null?g(l,c):y&&y.isColor&&(g(y,1),_=!0);const w=t.xr.getEnvironmentBlendMode();w==="additive"?n.buffers.color.setClear(0,0,0,1,o):w==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,o),(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===FT)?(u===void 0&&(u=new Kr(new dE(1,1,1),new co({name:"Backgroun
3381dCubeMaterial",uniforms:e0(Vc.backgroundCube.uniforms),vertexShader:Vc.backgroundCube.vertexShader,fragmentShader:Vc.backgroundCube.fragmentShader,side:fs,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(b,E,M){this.matrixWorld.copyPosition(M.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=vr.getTransfer(y.colorSpace)!==Ur,(d!==y||A!==y.version||f!==t.toneMapping)&&(u.material.needsUpdate=!0,d=y,A=y.version,f=t.toneMapping),u.layers.enableAll(),p.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(h===void 0&&(h=new Kr(new DO(2,2),new co({name:"BackgroundMaterial",uniforms:e0(Vc.background.uniforms),vertexShader:Vc.background.vertexShader,fragmentShader:Vc.background.fragmentShader,side:RA,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(h)),h.material.uniforms.t2D.value=y,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=vr.getTransfer(y.colorSpace)!==Ur,y.matrixAutoUpdate===!0&&y.updateMatrix(),h.material.uniforms.uvTransform.value.copy(y.matrix),(d!==y||A!==y.version||f!==t.toneMapping)&&(h.material.needsUpdate=!0,d=y,A=y.version,f=t.toneMapping),h.layers.enableAll(),p.unshift(h,h.geometry,h.material,0,0,null))}function g(p,v){p.getRGB(F1,YW(t)),n.buffers.color.setClear(F1.r,F1.g,F1.b,v,o)}return{getClearColor:function(){return l},setClearColor:function(p,v=1){l.set(p),c=v,g(l,c)},getClearAlpha:function(){return c},setClearAlpha:function(p){c=p,g(l,c)},render:m}}function Rre(t,i,r,n){const a=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:i.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,l={},c=p(null);let h=c,u=!1;function d(I,F,Y,D,U){let j=!1;if(o){const J=g(D,Y,F);h!==J&&(h=J,f(h.object)),j=v(I,D,Y,U),j&&_(I,D,Y,U)}else{const J=F.wireframe===!0;(h.geometry!==D.id||h.program!==Y.id||h.wireframe!==J)&&(h.geometry=D.id,h.program=Y.id,h.wireframe=J,j=!0)}U!==null&&r.update(U,t.ELEMENT_ARRAY_BUFFER),(j||u)&&(u=!1,S(I,F,Y,D),U!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,r.get(U).buffer))}function A(){return n.isWebGL2?t.createVertexArray():s.createVertexArrayOES()}function f(I){return n.isWebGL2?t.bindVertexArray(I):s.bindVertexArrayOES(I)}function m(I){return n.isWebGL2?t.deleteVertexArray(I):s.deleteVertexArrayOES(I)}function g(I,F,Y){const D=Y.wireframe===!0;let U=l[I.id];U===void 0&&(U={},l[I.id]=U);let j=U[F.id];j===void 0&&(j={},U[F.id]=j);let J=j[D];return J===void 0&&(J=p(A()),j[D]=J),J}function p(I){const F=[],Y=[],D=[];for(let U=0;U<a;U++)F[U]=0,Y[U]=0,D[U]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:F,enabledAttributes:Y,attributeDivisors:D,object:I,attributes:{},index:null}}function v(I,F,Y,D){const U=h.attributes,j=F.attributes;let J=0;const z=Y.getAttributes();for(const $ in z)if(z[$].location>=0){const ae=U[$];let ve=j[$];if(ve===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(ve=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(ve=I.instanceColor)),ae===void 0||ae.attribute!==ve||ve&&ae.data!==ve.data)return!0;J++}return h.attributesNum!==J||h.index!==D}function _(I,F,Y,D){const U={},j=F.attributes;let J=0;const z=Y.getAttributes();for(const $ in z)if(z[$].location>=0){let ae=j[$];ae===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(ae=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(ae=I.instanceColor));const ve={};ve.attribute=ae,ae&&ae.data&&(ve.data=ae.data),U[$]=ve,J++}h.attributes=U,h.attributesNum=J,h.index=D}function y(){const I=h.newAttributes;for(let F=0,Y=I.length;F<Y;F++)I[F]=0}function w(I){b(I,0)}function b(I,F){const Y=h.newAttributes,D=h.enabledAttributes,U=h.attributeDivisors;Y[I]=1,D[I]===0&&(t.enableVertexAttribArray(I),D[I]=1),U[I]!==F&&((n.isWebG
3381L2?t:i.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](I,F),U[I]=F)}function E(){const I=h.newAttributes,F=h.enabledAttributes;for(let Y=0,D=F.length;Y<D;Y++)F[Y]!==I[Y]&&(t.disableVertexAttribArray(Y),F[Y]=0)}function M(I,F,Y,D,U,j,J){J===!0?t.vertexAttribIPointer(I,F,Y,U,j):t.vertexAttribPointer(I,F,Y,D,U,j)}function S(I,F,Y,D){if(n.isWebGL2===!1&&(I.isInstancedMesh||D.isInstancedBufferGeometry)&&i.get("ANGLE_instanced_arrays")===null)return;y();const U=D.attributes,j=Y.getAttributes(),J=F.defaultAttributeValues;for(const z in j){const $=j[z];if($.location>=0){let te=U[z];if(te===void 0&&(z==="instanceMatrix"&&I.instanceMatrix&&(te=I.instanceMatrix),z==="instanceColor"&&I.instanceColor&&(te=I.instanceColor)),te!==void 0){const ae=te.normalized,ve=te.itemSize,oe=r.get(te);if(oe===void 0)continue;const K=oe.buffer,X=oe.type,N=oe.bytesPerElement,k=n.isWebGL2===!0&&(X===t.INT||X===t.UNSIGNED_INT||te.gpuType===DW);if(te.isInterleavedBufferAttribute){const Z=te.data,V=Z.str
vendor: 5,920 bytes, line 3381
3381ide,re=te.offset;if(Z.isInstancedInterleavedBuffer){for(let Ae=0;Ae<$.locationSize;Ae++)b($.location+Ae,Z.meshPerAttribute);I.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=Z.meshPerAttribute*Z.count)}else for(let Ae=0;Ae<$.locationSize;Ae++)w($.location+Ae);t.bindBuffer(t.ARRAY_BUFFER,K);for(let Ae=0;Ae<$.locationSize;Ae++)M($.location+Ae,ve/$.locationSize,X,ae,V*N,(re+ve/$.locationSize*Ae)*N,k)}else{if(te.isInstancedBufferAttribute){for(let Z=0;Z<$.locationSize;Z++)b($.location+Z,te.meshPerAttribute);I.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let Z=0;Z<$.locationSize;Z++)w($.location+Z);t.bindBuffer(t.ARRAY_BUFFER,K);for(let Z=0;Z<$.locationSize;Z++)M($.location+Z,ve/$.locationSize,X,ae,ve*N,ve/$.locationSize*Z*N,k)}}else if(J!==void 0){const ae=J[z];if(ae!==void 0)switch(ae.length){case 2:t.vertexAttrib2fv($.location,ae);break;case 3:t.vertexAttrib3fv($.location,ae);break;case 4:t.vertexAttrib4fv($.location,ae);break;default:t.vertexAttrib1fv($.location,ae)}}}}E()}function T(){R();for(const I in l){const F=l[I];for(const Y in F){const D=F[Y];for(const U in D)m(D[U].object),delete D[U];delete F[Y]}delete l[I]}}function C(I){if(l[I.id]===void 0)return;const F=l[I.id];for(const Y in F){const D=F[Y];for(const U in D)m(D[U].object),delete D[U];delete F[Y]}delete l[I.id]}function x(I){for(const F in l){const Y=l[F];if(Y[I.id]===void 0)continue;const D=Y[I.id];for(const U in D)m(D[U].object),delete D[U];delete Y[I.id]}}function R(){L(),u=!0,h!==c&&(h=c,f(h.object))}function L(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:d,reset:R,resetDefaultState:L,dispose:T,releaseStatesOfGeometry:C,releaseStatesOfProgram:x,initAttributes:y,enableAttribute:w,disableUnusedAttributes:E}}function Bre(t,i,r,n){const a=n.isWebGL2;let s;function o(h){s=h}function l(h,u){t.drawArrays(s,h,u),r.update(u,s,1)}function c(h,u,d){if(d===0)return;let A,f;if(a)A=t,f="drawArraysInstanced";else if(A=i.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",A===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}A[f](s,h,u,d),r.update(u,s,d)}this.setMode=o,this.render=l,this.renderInstances=c}function Ire(t,i,r){let n;function a(){if(n!==void 0)return n;if(i.has("EXT_texture_filter_anisotropic")===!0){const M=i.get("EXT_texture_filter_anisotropic");n=t.getParameter(M.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(M){if(M==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";M="mediump"}return M==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&t.constructor.name==="WebGL2RenderingContext";let l=r.precision!==void 0?r.precision:"highp";const c=s(l);c!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",c,"instead."),l=c);const h=o||i.has("WEBGL_draw_buffers"),u=r.logarithmicDepthBuffer===!0,d=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),A=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),f=t.getParameter(t.MAX_TEXTURE_SIZE),m=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),g=t.getParameter(t.MAX_VERTEX_ATTRIBS),p=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),v=t.getParameter(t.MAX_VARYING_VECTORS),_=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),y=A>0,w=o||i.has("OES_texture_float"),b=y&&w,E=o?t.getParameter(t.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:h,getMaxAnisotropy:a,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:A,maxTextureSize:f,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:p,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:w,floatVertexTextures:b,maxSamples:E}}function Dre(t){const i=this;let r=null,n=0,a=!1,s=!1;const o=new Ld,l=new Di,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,A){const f=d.length!==0||A||n!==0||a;return a=A,n=d.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,A){r=u(d,A,0)},this.setState=function(d,A,f){const m=d.clippingPlanes,g=d.clipIntersection,p=d.clipShadows,v=t.get(d);if(!a||m===null||m.length===0||s&&!p)s?u(null):h();else{const _=s?0:n,y=_*4;let w=v.clippingState||null;c.value=w,w=u(m,A,y,f);for(let b=0;b!==y;++b)w[b]=r[b];v.clippingState=w,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function h(){c.value!==r&&(c.value=r,c.needsUpdate=n>0),i.numPlanes=n,i.numIntersection=0}function u(d,A,f,m){const g=d!==null?d.length:0;let p=null;if(g!==0){if(p=c.value,m!==!0||p===null){const v=f+g*4,_=A.matrixWorldInverse;l.getNormalMatrix(_),(p===null||p.length<v)&&(p=new Float32Array(v));for(let y=0,w=f;y!==g;++y,w+=4)o.copy(d[y]).applyMatrix4(_,l),o.normal.toArray(p,w),p[w+3]=o.constant}c.value=p,c.needsUpdate=!0}return i.numPlanes=g,i.numIntersection=0,p}}function Pre(t){let i=new WeakMap;function r(o,l){return l===tD?o.mapping=Xg:l===iD&&(o.mapping=qg),o}function n(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){const l=o.mapping;if(l===tD||l===iD)if(i.has(o)){const c=i.get(o).texture;return r(c,o.mapping)}else{const c=o.image;if(c&&c.height>0){const h=new Yee(c.height/2);return h.fromEquirectangularTexture(t,o),i.set(o,h),o.addEventListener("dispose",a),r(h.texture,o.mapping)}else return null}}return o}function a(o){const l=o.target;l.removeEventListener("dispose",a);const c=i.get(l);c!==void 0&&(i.delete(l),c.dispose())}function s(){i=new WeakMap}return{get:n,dispose:s}}class ZW extends KW{constructor(i=-1,r=1,n=1,a=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
3381phicCamera",this.zoom=1,this.view=null,this.left=i,this.right=r,this.top=n,this.bottom=a,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(i,r){return super.copy(i,r),this.left=i.left,this.right=i.right,this.top=i.top,this.bottom=i.bottom,this.near=i.near,this.far=i.far,this.zoom=i.zoom,this.view=i.view===null?null:Object.assign({},i.view),this}setViewOffset(i,r,n,a,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=i,this.view.fullHeight=r,this.view.offsetX=n,this.view.offsetY=a,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const i=(this.right-this.left)/(2*this.zoom),r=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,a=(this.top+this.bottom)/2;let s=n-i,o=n+i,l=a+r,c=a-r;if(this.view!==null&&this.view.enabled){const h=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=h*this.view.offsetX,o=s+h*this.view.width,l-=u*this.view.offsetY,c=l-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,l,c,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(i){const r=super.toJSON(i);return r.object.zoom=this.zoom,r.object.left=this.left,r.object.right=this.right,r.object.top=this.top,r.object.bottom=this.bottom,r.object.near=this.near,r.object.far=this.far,this.view!==null&&(r.object.view=Object.assign({},this.view)),r}}const sg=4,pF=[.125,.215,.35,.446,.526,.582],yf=20,yx=new ZW,mF=new Kt;let Ex=null,wx=0,bx=0;const ff=(1+Math.sqrt(5))/2,im=1/ff,gF=[new we(1,1,1),new we(-1,1,1),new we(1,1,-1),new we(-1,1,-1),new we(0,ff,im),new we(0,ff,-im),new we(im,0,ff),new we(-im,0,ff),new we(ff,im,0),new we(-ff,im,0)];class vF{constructor(i){this._renderer=i,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(i,r=0,n=.1,a=100){Ex=this._renderer.getRenderTarget(),wx=this._renderer.getActiveCubeFace(),bx=this._renderer.getActiveMipmapLevel(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(i,n,a,s),r>0&&this._blur(s,0,0,r),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(i,r=null){return this._fromTexture(i,r)}fromCubemap(i,r=null){return this._fromTexture(i,r)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=EF(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=yF(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(i){this._lodMax=Math.floor(Math.log2(i)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let i=0;i<this._lodPlanes.length;i++)this._lodPlanes[i].dispose()}_cleanup(i){this._renderer.setRenderTarget(Ex,wx,bx),i.scissorTest=!1,k1(i,0,0,i.width,i.height)}_fromTexture(i,r){i.mapping===Xg||i.mapping===qg?this._setSize(i.image.length===0?16:i.image[0].width||i.image[0].image.width):this._setSize(i.image.width/4),Ex=this._renderer.getRenderTarget(),wx=this._renderer.getActiveCubeFace(),bx=this._renderer.getActiveMipmapLevel();const n=r||this._allocateTargets();return this._textureToCubeUV(i,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const i=3*Math.max(this._cubeSize,112),r=4*this._cubeSize,n={magFilter:pa,minFilter:pa,generateMipmaps:!1,type:yu,format:ol,colorSpace:fc,depthBuffer:!1},a=_F(i,r,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==i||this._pingPongRenderTarget.height!==r){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=_F(i,r,n);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Lre(s)),this._blurMaterial=Ore(s,i,r)}return a}_compileMaterial(i){const r=new Kr(this._lodPlanes[0],i);this._renderer.compile(r,yx)}_sceneToCubeUV(i,r,n,a){const l=new Rr(90,1,r,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],u=this._renderer,d=u.autoClear,A=u.toneMapping;u.getClearColor(mF),u.toneMapping=gA,u.autoClear=!1;
vendor: 5,409 bytes, lines 3381-3456
3381const f=new GT({name:"PMREM.Background",side:fs,depthWrite:!1,depthTest:!1}),m=new Kr(new dE,f);let g=!1;const p=i.background;p?p.isColor&&(f.color.copy(p),i.background=null,g=!0):(f.color.copy(mF),g=!0);for(let v=0;v<6;v++){const _=v%3;_===0?(l.up.set(0,c[v],0),l.lookAt(h[v],0,0)):_===1?(l.up.set(0,0,c[v]),l.lookAt(0,h[v],0)):(l.up.set(0,c[v],0),l.lookAt(0,0,h[v]));const y=this._cubeSize;k1(a,_*y,v>2?y:0,y,y),u.setRenderTarget(a),g&&u.render(m,l),u.render(i,l)}m.geometry.dispose(),m.material.dispose(),u.toneMapping=A,u.autoClear=d,i.background=p}_textureToCubeUV(i,r){const n=this._renderer,a=i.mapping===Xg||i.mapping===qg;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=EF()),this._cubemapMaterial.uniforms.flipEnvMap.value=i.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=yF());const s=a?this._cubemapMaterial:this._equirectMaterial,o=new Kr(this._lodPlanes[0],s),l=s.uniforms;l.envMap.value=i;const c=this._cubeSize;k1(r,0,0,3*c,2*c),n.setRenderTarget(r),n.render(o,yx)}_applyPMREM(i){const r=this._renderer,n=r.autoClear;r.autoClear=!1;for(let a=1;a<this._lodPlanes.length;a++){const s=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),o=gF[(a-1)%gF.length];this._blur(i,a-1,a,s,o)}r.autoClear=n}_blur(i,r,n,a,s){const o=this._pingPongRenderTarget;this._halfBlur(i,o,r,n,a,"latitudinal",s),this._halfBlur(o,i,n,n,a,"longitudinal",s)}_halfBlur(i,r,n,a,s,o,l){const c=this._renderer,h=this._blurMaterial;o!=="latitudinal"&&o!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const u=3,d=new Kr(this._lodPlanes[a],h),A=h.uniforms,f=this._sizeLods[n]-1,m=isFinite(s)?Math.PI/(2*f):2*Math.PI/(2*yf-1),g=s/m,p=isFinite(s)?1+Math.floor(u*g):yf;p>yf&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${p} samples when the maximum is set to ${yf}`);const v=[];let _=0;for(let M=0;M<yf;++M){const S=M/g,T=Math.exp(-S*S/2);v.push(T),M===0?_+=T:M<p&&(_+=2*T)}for(let M=0;M<v.length;M++)v[M]=v[M]/_;A.envMap.value=i.texture,A.samples.value=p,A.weights.value=v,A.latitudinal.value=o==="latitudinal",l&&(A.poleAxis.value=l);const{_lodMax:y}=this;A.dTheta.value=m,A.mipInt.value=y-n;const w=this._sizeLods[a],b=3*w*(a>y-sg?a-y+sg:0),E=4*(this._cubeSize-w);k1(r,b,E,3*w,2*w),c.setRenderTarget(r),c.render(d,yx)}}function Lre(t){const i=[],r=[],n=[];let a=t;const s=t-sg+1+pF.length;for(let o=0;o<s;o++){const l=Math.pow(2,a);r.push(l);let c=1/l;o>t-sg?c=pF[o-t+sg-1]:o===0&&(c=0),n.push(c);const h=1/(l-2),u=-h,d=1+h,A=[u,u,d,u,d,d,u,u,d,d,u,d],f=6,m=6,g=3,p=2,v=1,_=new Float32Array(g*m*f),y=new Float32Array(p*m*f),w=new Float32Array(v*m*f);for(let E=0;E<f;E++){const M=E%3*2/3-1,S=E>2?0:-1,T=[M,S,0,M+2/3,S,0,M+2/3,S+1,0,M,S,0,M+2/3,S+1,0,M,S+1,0];_.set(T,g*m*E),y.set(A,p*m*E);const C=[E,E,E,E,E,E];w.set(C,v*m*E)}const b=new po;b.setAttribute("position",new ks(_,g)),b.setAttribute("uv",new ks(y,p)),b.setAttribute("faceIndex",new ks(w,v)),i.push(b),a>sg&&a--}return{lodPlanes:i,sizeLods:r,sigmas:n}}function _F(t,i,r){const n=new ap(t,i,r);return n.texture.mapping=FT,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function k1(t,i,r,n,a){t.viewport.set(i,r,n,a),t.scissor.set(i,r,n,a)}function Ore(t,i,r){const n=new Float32Array(yf),a=new we(0,1,0);return new co({name:"SphericalGaussianBlur",defines:{n:yf,CUBEUV_TEXEL_WIDTH:1/i,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:PO(),fragmentShader:` 3382 3383 precision mediump float; 3384 precision mediump int; 3385 3386 varying vec3 vOutputDirection; 3387 3388 uniform sampler2D envMap; 3389 uniform int samples; 3390 uniform float weights[ n ]; 3391 uniform bool latitudinal; 3392 uniform float dTheta; 3393 uniform float mipInt; 3394 uniform vec3 poleAxis; 3395 3396 #define ENVMAP_TYPE_CUBE_UV 3397 #include <cube_uv_reflection_fragment> 3398 3399 vec3 getSample( float theta, vec3 axis ) { 3400 3401 float cosTheta = cos( theta ); 3402 // Rodrigues' axis-angle rotation 3403 vec3 sampleDirection = vOutputDirection * cosTheta 3404 + cross( axis, vOutputDirection ) * sin( theta ) 3405 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 3406 3407 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 3408 3409 } 3410 3411 void main() { 3412 3413 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 3414 3415 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 3416 3417 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 3418 3419 } 3420 3421 axis = normalize( axis ); 3422 3423 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 3424 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 3425 3426 for ( int i = 1; i < n; i++ ) { 3427 3428 if ( i >= samples ) { 3429 3430 break; 3431 3432 } 3433 3434 float theta = dTheta * float( i ); 3435 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 3436 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 3437 3438 } 3439 3440 } 3441 `,blending:mA,depthTest:!1,depthWrite:!1})}function yF(){return new co({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:PO(),fragmentShader:` 3442 3443 precision mediump float; 3444 precision mediump int; 3445 3446 varying vec3 vOutputDirection; 3447 3448 uniform sampler2D envMap; 3449 3450 #include <common> 3451 3452 void main() { 3453 3454 vec3 outputDirection = normalize( vOutputDirection ); 3455 vec2 uv = equirectUv( outputDirection ); 3456
3457 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 3458 3459 } 3460 `,blending:mA,depthTest:!1,depthWrite:!1})}function EF(){return new co({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:PO(),fragmentShader:` 3461 3462 precision mediump float; 3463 precision mediump int; 3464 3465 uniform float flipEnvMap; 3466 3467 varying vec3 vOutputDirection; 3468 3469 uniform samplerCube envMap; 3470 3471 void main() { 3472 3473 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 3474 3475 } 3476 `,blending:mA,depthTest:!1,depthWrite:!1})}function PO(){return` 3477 3478 precision mediump float; 3479 precision mediump int; 3480 3481 attribute float faceIndex; 3482 3483 varying vec3 vOutputDirection; 3484 3485 // RH coordinate system; PMREM face-indexing convention 3486 vec3 getDirection( vec2 uv, float face ) { 3487 3488 uv = 2.0 * uv - 1.0; 3489 3490 vec3 direction = vec3( uv, 1.0 ); 3491 3492 if ( face == 0.0 ) { 3493 3494 direction = direction.zyx; // ( 1, v, u ) pos x 3495 3496 } else if ( face == 1.0 ) { 3497 3498 direction = direction.xzy; 3499 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 3500 3501 } else if ( face == 2.0 ) { 3502 3503 direction.x *= -1.0; // ( -u, v, 1 ) pos z 3504 3505 } else if ( face == 3.0 ) { 3506 3507 direction = direction.zyx; 3508 direction.xz *= -1.0; // ( -1, v, -u ) neg x 3509 3510 } else if ( face == 4.0 ) { 3511 3512 direction = direction.xzy; 3513 direction.xy *= -1.0; // ( -u, -1, v ) neg y 3514 3515 } else if ( face == 5.0 ) { 3516 3517 direction.z *= -1.0; // ( u, v, -1 ) neg z 3518 3519 } 3520 3521 return direction; 3522 3523 } 3524 3525 void main() { 3526 3527 vOutputDirection = getDirection( uv, faceIndex ); 3528 gl_Position = vec4( position, 1.0 ); 3529 3530 } 3531 `}function Nre(t){let i=new WeakMap,r=null;function n(l){if(l&&l.isTexture){const c=l.mapping,h=c===tD||c===iD,u=c===Xg||c===qg;if(h||u)if(l.isRenderTargetTexture&&l.needsPMREMUpdate===!0){l.needsPMREMUpdate=!1;let d=i.get(l);return r===null&&(r=new vF(t)),d=h?r.fromEquirectangular(l,d):r.fromCubemap(l,d),i.set(l,d),d.texture}else{if(i.has(l))return i.get(l).texture;{const d=l.image;if(h&&d&&d.height>0||u&&d&&a(d)){r===null&&(r=new vF(t));const A=h?r.fromEquirectangular(l):r.fromCubemap(l);return i.set(l,A),l.addEventListener("dispose",s),A.texture}else return null}}}return l}function a(l){let c=0;const h=6;for(let u=0;u<h;u++)l[u]!==void 0&&c++;return c===h}function s(l){const c=l.target;c.removeEventListener("dispose",s);const h=i.get(c);h!==void 0&&(i.delete(c),h.dispose())}function o(){i=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:n,dispose:o}}function Ure(t){const i={};function r(n){if(i[n]!==void 0)return i[n];let a;switch(n){case"WEBGL_depth_texture":a=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":a=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":a=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:a=t.getExtension(n)}return i[n]=a,a}return{has:function(n){return r(n)!==null},init:function(n){n.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(n){const a=r(n);return a===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),a}}}function Fre(t,i,r,n){const a={},s=new WeakMap;function o(d){const A=d.target;A.index!==null&&i.remove(A.index);for(const m in A.attributes)i.remove(A.attributes[m]);for(const m in A.morphAttributes){const g=A.morphAttributes[m];for(let p=0,v=g.length;p<v;p++)i.remove(g[p])}A.removeEventListener("dispose",o),delete a[A.id];const f=s.get(A);
3531f&&(i.remove(f),s.delete(A)),n.releaseStatesOfGeometry(A),A.isInstancedBufferGeometry===!0&&delete A._maxInstanceCount,r.memory.geometries--}function l(d,A){return a[A.id]===!0||(A.addEventListener("dispose",o),a[A.id]=!0,r.memory.geometries++),A}function c(d){const A=d.attributes;for(const m in A)i.update(A[m],t.ARRAY_BUFFER);const f=d.morphAttributes;for(const m in f){const g=f[m];for(let p=0,v=g.length;p<v;p++)i.update(g[p],t.ARRAY_BUFFER)}}function h(d){const A=[],f=d.index,m=d.attributes.position;let g=0;if(f!==null){const _=f.array;g=f.version;for(let y=0,w=_.length;y<w;y+=3){const b=_[y+0],E=_[y+1],M=_[y+2];A.push(b,E,E,M,M,b)}}else if(m!==void 0){const _=m.array;g=m.version;for(let y=0,w=_.length/3-1;y<w;y+=3){const b=y+0,E=y+1,M=y+2;A.push(b,E,E,M,M,b)}}else return;const p=new(HW(A)?jW:WW)(A,1);p.version=g;const v=s.get(d);v&&i.remove(v),s.set(d,p)}function u(d){const A=s.get(d);if(A){const f=d.index;f!==null&&A.version<f.version&&h(d)}else h(d);return s.get(d)}return{get:l,update:c,getWireframeAttribute:u}}function kre(t,i,r,n){const a=n.isWebGL2;let s;function o(A){s=A}let l,c;function h(A){l=A.type,c=A.bytesPerElement}function u(A,f){t.drawElements(s,f,l,A*c),r.update(f,s,1)}function d(A,f,m){if(m===0)return;let g,p;if(a)g=t,p="drawElementsInstanced";else if(g=i.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",g===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}g[p](s,f,l,A*c,m),r.update(f,s,m)}this.setMode=o,this.setIndex=h,this.render=u,this.renderInstances=d}function Hre(t){const i={geometries:0,textures:0},r={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,l){switch(r.calls++,o){case t.TRIANGLES:r.triangles+=l*(s/3);break;case t.LINES:r.lines+=l*(s/2);break;case t.LINE_STRIP:r.lines+=l*(s-1);break;case t.LINE_LOOP:r.lines+=l*s;break;case t.POINTS:r.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function a(){r.calls=0,r.triangles=0,r.points=0,r.lines=0}return{memory:i,render:r,programs:null,autoReset:!0,reset:a,update:n}}function Gre(t,i){return t[0]-i[0]}function zre(t,i){return Math.abs(i[1])-Math.abs(t[1])}function Qre(t,i,r){const n={},a=new Float32Array(8),s=new WeakMap,o=new Yr,l=[];for(let h=0;h<8;h++)l[h]=[h,0];function c(h,u,d){const A=h.morphTargetInfluences;
vendor: 5,942 bytes, line 3531
3531if(i.isWebGL2===!0){const f=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,m=f!==void 0?f.length:0;let g=s.get(u);if(g===void 0||g.count!==m){let I=function(){R.dispose(),s.delete(u),u.removeEventListener("dispose",I)};g!==void 0&&g.texture.dispose();const _=u.morphAttributes.position!==void 0,y=u.morphAttributes.normal!==void 0,w=u.morphAttributes.color!==void 0,b=u.morphAttributes.position||[],E=u.morphAttributes.normal||[],M=u.morphAttributes.color||[];let S=0;_===!0&&(S=1),y===!0&&(S=2),w===!0&&(S=3);let T=u.attributes.position.count*S,C=1;T>i.maxTextureSize&&(C=Math.ceil(T/i.maxTextureSize),T=i.maxTextureSize);const x=new Float32Array(T*C*4*m),R=new QW(x,T,C,m);R.type=rc,R.needsUpdate=!0;const L=S*4;for(let F=0;F<m;F++){const Y=b[F],D=E[F],U=M[F],j=T*C*4*F;for(let J=0;J<Y.count;J++){const z=J*L;_===!0&&(o.fromBufferAttribute(Y,J),x[j+z+0]=o.x,x[j+z+1]=o.y,x[j+z+2]=o.z,x[j+z+3]=0),y===!0&&(o.fromBufferAttribute(D,J),x[j+z+4]=o.x,x[j+z+5]=o.y,x[j+z+6]=o.z,x[j+z+7]=0),w===!0&&(o.fromBufferAttribute(U,J),x[j+z+8]=o.x,x[j+z+9]=o.y,x[j+z+10]=o.z,x[j+z+11]=U.itemSize===4?o.w:1)}}g={count:m,texture:R,size:new Jt(T,C)},s.set(u,g),u.addEventListener("dispose",I)}let p=0;for(let _=0;_<A.length;_++)p+=A[_];const v=u.morphTargetsRelative?1:1-p;d.getUniforms().setValue(t,"morphTargetBaseInfluence",v),d.getUniforms().setValue(t,"morphTargetInfluences",A),d.getUniforms().setValue(t,"morphTargetsTexture",g.texture,r),d.getUniforms().setValue(t,"morphTargetsTextureSize",g.size)}else{const f=A===void 0?0:A.length;let m=n[u.id];if(m===void 0||m.length!==f){m=[];for(let y=0;y<f;y++)m[y]=[y,0];n[u.id]=m}for(let y=0;y<f;y++){const w=m[y];w[0]=y,w[1]=A[y]}m.sort(zre);for(let y=0;y<8;y++)y<f&&m[y][1]?(l[y][0]=m[y][0],l[y][1]=m[y][1]):(l[y][0]=Number.MAX_SAFE_INTEGER,l[y][1]=0);l.sort(Gre);const g=u.morphAttributes.position,p=u.morphAttributes.normal;let v=0;for(let y=0;y<8;y++){const w=l[y],b=w[0],E=w[1];b!==Number.MAX_SAFE_INTEGER&&E?(g&&u.getAttribute("morphTarget"+y)!==g[b]&&u.setAttribute("morphTarget"+y,g[b]),p&&u.getAttribute("morphNormal"+y)!==p[b]&&u.setAttribute("morphNormal"+y,p[b]),a[y]=E,v+=E):(g&&u.hasAttribute("morphTarget"+y)===!0&&u.deleteAttribute("morphTarget"+y),p&&u.hasAttribute("morphNormal"+y)===!0&&u.deleteAttribute("morphNormal"+y),a[y]=0)}const _=u.morphTargetsRelative?1:1-v;d.getUniforms().setValue(t,"morphTargetBaseInfluence",_),d.getUniforms().setValue(t,"morphTargetInfluences",a)}}return{update:c}}function Vre(t,i,r,n){let a=new WeakMap;function s(c){const h=n.render.frame,u=c.geometry,d=i.get(c,u);if(a.get(d)!==h&&(i.update(d),a.set(d,h)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),a.get(c)!==h&&(r.update(c.instanceMatrix,t.ARRAY_BUFFER),c.instanceColor!==null&&r.update(c.instanceColor,t.ARRAY_BUFFER),a.set(c,h))),c.isSkinnedMesh){const A=c.skeleton;a.get(A)!==h&&(A.update(),a.set(A,h))}return d}function o(){a=new WeakMap}function l(c){const h=c.target;h.removeEventListener("dispose",l),r.remove(h.instanceMatrix),h.instanceColor!==null&&r.remove(h.instanceColor)}return{update:s,dispose:o}}const JW=new ps,$W=new QW,e9=new Mee,t9=new XW,wF=[],bF=[],SF=new Float32Array(16),CF=new Float32Array(9),TF=new Float32Array(4);function D0(t,i,r){const n=t[0];if(n<=0||n>0)return t;const a=i*r;let s=wF[a];if(s===void 0&&(s=new Float32Array(a),wF[a]=s),i!==0){n.toArray(s,0);for(let o=1,l=0;o!==i;++o)l+=r,t[o].toArray(s,l)}return s}function $n(t,i){if(t.length!==i.length)return!1;for(let r=0,n=t.length;r<n;r++)if(t[r]!==i[r])return!1;return!0}function ea(t,i){for(let r=0,n=i.length;r<n;r++)t[r]=i[r]}function zT(t,i){let r=bF[i];r===void 0&&(r=new Int32Array(i),bF[i]=r);for(let n=0;n!==i;++n)r[n]=t.allocateTextureUnit();return r}function Wre(t,i){const r=this.cache;r[0]!==i&&(t.uniform1f(this.addr,i),r[0]=i)}function jre(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y)&&(t.uniform2f(this.addr,i.x,i.y),r[0]=i.x,r[1]=i.y);else{if($n(r,i))return;t.uniform2fv(this.addr,i),ea(r,i)}}function Yre(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z)&&(t.uniform3f(this.addr,i.x,i.y,i.z),r[0]=i.x,r[1]=i.y,r[2]=i.z);else if(i.r!==void 0)(r[0]!==i.r||r[1]!==i.g||r[2]!==i.b)&&(t.uniform3f(this.addr,i.r,i.g,i.b),r[0]=i.r,r[1]=i.g,r[2]=i.b);else{if($n(r,i))return;t.uniform3fv(this.addr,i),ea(r,i)}}function Kre(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z||r[3]!==i.w)&&(t.uniform4f(this.addr,i.x,i.y,i.z,i.w),r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=i.w);else{if($n(r,i))return;t.uniform4fv(this.addr,i),ea(r,i)}}function Xre(t,i){const r=this.cache,n=i.elements;if(n===void 0){if($n(r,i))return;t.uniformMatrix2fv(this.addr,!1,i),ea(r,i)}else{if($n(r,n))return;TF.set(n),t.uniformMatrix2fv(this.addr,!1,TF),ea(r,n)}}function qre(t,i){const r=this.cache,n=i.elements;if(n===void 0){if($n(r,i))return;t.uniformMatrix3fv(this.addr,!1,i),ea(r,i)}else{if($n(r,n))return;CF.set(n),t.uniformMatrix3fv(this.addr,!1,CF),ea(r,n)}}function Zre(t,i){const r=this.cache,n=i.elements;if(n===void 0){if($n(r,i))return;t.uniformMatrix4fv(this.addr,!1,i),ea(r,i)}else{if($n(r,n))return;SF.set(n),t.uniformMatrix4fv(this.addr,!1,SF),ea(r,n)}}function Jre(t,i){const r=this.cache;r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i)}function $re(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y)&&(t.uniform2i(this.addr,i.x,i.y),r[0]=i.x,r[1]=i.y);else{if($n(r,i))return;t.uniform2iv(this.addr,i),ea(r,i)}}function ene(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z)&&(t.uniform3i(this.addr,i.x,i.y,i.z),r[0]=i.x,r[1]=i.y,r[2]=i.z);else{if($n(r,i))return;t.uniform3iv(this.addr,i),ea(r,i)}}function tne(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z||r[3]!==i.w)&&(t.uniform4i(this.addr,i.x,i.y,i.z,i.w),r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=i.w);else{if($n(r,i))return;t.uniform4iv(this.addr,i),ea(r,i)}}
vendor: 17,960 bytes, lines 3531-3550
3531function ine(t,i){const r=this.cache;r[0]!==i&&(t.uniform1ui(this.addr,i),r[0]=i)}function rne(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y)&&(t.uniform2ui(this.addr,i.x,i.y),r[0]=i.x,r[1]=i.y);else{if($n(r,i))return;t.uniform2uiv(this.addr,i),ea(r,i)}}function nne(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z)&&(t.uniform3ui(this.addr,i.x,i.y,i.z),r[0]=i.x,r[1]=i.y,r[2]=i.z);else{if($n(r,i))return;t.uniform3uiv(this.addr,i),ea(r,i)}}function ane(t,i){const r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z||r[3]!==i.w)&&(t.uniform4ui(this.addr,i.x,i.y,i.z,i.w),r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=i.w);else{if($n(r,i))return;t.uniform4uiv(this.addr,i),ea(r,i)}}function sne(t,i,r){const n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTexture2D(i||JW,a)}function one(t,i,r){const n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTexture3D(i||e9,a)}function lne(t,i,r){const n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTextureCube(i||t9,a)}function cne(t,i,r){const n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTexture2DArray(i||$W,a)}function hne(t){switch(t){case 5126:return Wre;case 35664:return jre;case 35665:return Yre;case 35666:return Kre;case 35674:return Xre;case 35675:return qre;case 35676:return Zre;case 5124:case 35670:return Jre;case 35667:case 35671:return $re;case 35668:case 35672:return ene;case 35669:case 35673:return tne;case 5125:return ine;case 36294:return rne;case 36295:return nne;case 36296:return ane;case 35678:case 36198:case 36298:case 36306:case 35682:return sne;case 35679:case 36299:case 36307:return one;case 35680:case 36300:case 36308:case 36293:return lne;case 36289:case 36303:case 36311:case 36292:return cne}}function une(t,i){t.uniform1fv(this.addr,i)}function dne(t,i){const r=D0(i,this.size,2);t.uniform2fv(this.addr,r)}function Ane(t,i){const r=D0(i,this.size,3);t.uniform3fv(this.addr,r)}function fne(t,i){const r=D0(i,this.size,4);t.uniform4fv(this.addr,r)}function pne(t,i){const r=D0(i,this.size,4);t.uniformMatrix2fv(this.addr,!1,r)}function mne(t,i){const r=D0(i,this.size,9);t.uniformMatrix3fv(this.addr,!1,r)}function gne(t,i){const r=D0(i,this.size,16);t.uniformMatrix4fv(this.addr,!1,r)}function vne(t,i){t.uniform1iv(this.addr,i)}function _ne(t,i){t.uniform2iv(this.addr,i)}function yne(t,i){t.uniform3iv(this.addr,i)}function Ene(t,i){t.uniform4iv(this.addr,i)}function wne(t,i){t.uniform1uiv(this.addr,i)}function bne(t,i){t.uniform2uiv(this.addr,i)}function Sne(t,i){t.uniform3uiv(this.addr,i)}function Cne(t,i){t.uniform4uiv(this.addr,i)}function Tne(t,i,r){const n=this.cache,a=i.length,s=zT(r,a);$n(n,s)||(t.uniform1iv(this.addr,s),ea(n,s));for(let o=0;o!==a;++o)r.setTexture2D(i[o]||JW,s[o])}function Mne(t,i,r){const n=this.cache,a=i.length,s=zT(r,a);$n(n,s)||(t.uniform1iv(this.addr,s),ea(n,s));for(let o=0;o!==a;++o)r.setTexture3D(i[o]||e9,s[o])}function xne(t,i,r){const n=this.cache,a=i.length,s=zT(r,a);$n(n,s)||(t.uniform1iv(this.addr,s),ea(n,s));for(let o=0;o!==a;++o)r.setTextureCube(i[o]||t9,s[o])}function Rne(t,i,r){const n=this.cache,a=i.length,s=zT(r,a);$n(n,s)||(t.uniform1iv(this.addr,s),ea(n,s));for(let o=0;o!==a;++o)r.setTexture2DArray(i[o]||$W,s[o])}function Bne(t){switch(t){case 5126:return une;case 35664:return dne;case 35665:return Ane;case 35666:return fne;case 35674:return pne;case 35675:return mne;case 35676:return gne;case 5124:case 35670:return vne;case 35667:case 35671:return _ne;case 35668:case 35672:return yne;case 35669:case 35673:return Ene;case 5125:return wne;case 36294:return bne;case 36295:return Sne;case 36296:return Cne;case 35678:case 36198:case 36298:case 36306:case 35682:return Tne;case 35679:case 36299:case 36307:return Mne;case 35680:case 36300:case 36308:case 36293:return xne;case 36289:case 36303:case 36311:case 36292:return Rne}}class Ine{constructor(i,r,n){this.id=i,this.addr=n,this.cache=[],this.setValue=hne(r.type)}}class Dne{constructor(i,r,n){this.id=i,this.addr=n,this.cache=[],this.size=r.size,this.setValue=Bne(r.type)}}class Pne{constructor(i){this.id=i,this.seq=[],this.map={}}setValue(i,r,n){const a=this.seq;for(let s=0,o=a.length;s!==o;++s){const l=a[s];l.setValue(i,r[l.id],n)}}}const Sx=/(\w+)(\])?(\[|\.)?/g;function MF(t,i){t.seq.push(i),t.map[i.id]=i}function Lne(t,i,r){const n=t.name,a=n.length;for(Sx.lastIndex=0;;){const s=Sx.exec(n),o=Sx.lastIndex;let l=s[1];const c=s[2]==="]",h=s[3];if(c&&(l=l|0),h===void 0||h==="["&&o+2===a){MF(r,h===void 0?new Ine(l,t,i):new Dne(l,t,i));break}else{let d=r.map[l];d===void 0&&(d=new Pne(l),MF(r,d)),r=d}}}class mS{constructor(i,r){this.seq=[],this.map={};const n=i.getProgramParameter(r,i.ACTIVE_UNIFORMS);for(let a=0;a<n;++a){const s=i.getActiveUniform(r,a),o=i.getUniformLocation(r,s.name);Lne(s,o,this)}}setValue(i,r,n,a){const s=this.map[r];s!==void 0&&s.setValue(i,n,a)}setOptional(i,r,n){const a=r[n];a!==void 0&&this.setValue(i,n,a)}static upload(i,r,n,a){for(let s=0,o=r.length;s!==o;++s){const l=r[s],c=n[l.id];c.needsUpdate!==!1&&l.setValue(i,c.value,a)}}static seqWithValue(i,r){const n=[];for(let a=0,s=i.length;a!==s;++a){const o=i[a];o.id in r&&n.push(o)}return n}}function xF(t,i,r){const n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),n}const One=37297;let Nne=0;function Une(t,i){const r=t.split(` 3532`),n=[],a=Math.max(i-6,0),s=Math.min(i+6,r.length);for(let o=a;o<s;o++){const l=o+1;n.push(`${l===i?">":" "} ${l}: ${r[o]}`)}return n.join(` 3533`)}function Fne(t){const i=vr.getPrimaries(vr.workingColorSpace),r=vr.getPrimaries(t);let n;switch(i===r?n="":i===ZS&&r===qS?n="LinearDisplayP3ToLinearSRGB":i===qS&&r===ZS&&(n="LinearSRGBToLinearDisplayP3"),t){case fc:case kT:return[n,"LinearTransferOETF"];case Fa:case xO:return[n,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",t),[n,"LinearTransferOETF"]}}function RF(t,i,r){const n=t.getShaderParameter(i,t.COMPILE_STATUS),a=t.getShaderInfoLog(i).trim();if(n&&a==="")return"";const s=/ERROR: 0:(\d+)/.exec(a);if(s){const o=parseInt(s[1]);return r.toUpperCase()+` 3534 3535`+a+` 3536 3537`+Une(t.getShaderSource(i),o)}else return a}function kne(t,i){const r=Fne(i);return`vec4 ${t}( vec4 value ) { return ${r[0]}( ${r[1]}( value ) ); }`}function Hne(t,i){let r;switch(i){case O$:r="Linear";break;case N$:r="Reinhard";break;case U$:r="OptimizedCineon";break;case F$:r="ACESFilmic";break;case k$:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",i),r="Linear"}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function Gne(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.normalMapTangentSpace||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(s_).join(` 3538`)}function zne(t){const i=[];for(const r in t){const n=t[r];n!==!1&&i.push("#define "+r+" "+n)}return i.join(` 3539`)}function Qne(t,i){const r={},n=t.getProgramParameter(i,t.ACTIVE_ATTRIBUTES);for(let a=0;a<n;a++){const s=t.getActiveAttrib(i,a),o=s.name;let l=1;s.type===t.FLOAT_MAT2&&(l=2),s.type===t.FLOAT_MAT3&&(l=3),s.type===t.FLOAT_MAT4&&(l=4),r[o]={type:s.type,location:t.getAttribLocation(i,o),locationSize:l}}return r}function s_(t){return t!==""}function BF(t,i){const r=i.numSpotLightShadows+i.numSpotLightMaps-i.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,i.numDirLights).replace(/NUM_SPOT_LIGHTS/g,i.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,i.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,i.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,i.numPointLights).replace(/NUM_HEMI_LIGHTS/g,i.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,i.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,i.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,i.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,i.numPointLightShadows)}function IF(t,i){return t.replace(/NUM_CLIPPING_PLANES/g,i.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,i.numClippingPlanes-i.numClipIntersection)}const Vne=/^[ \t]*#include +<([\w\d./]+)>/gm;function oD(t){return t.replace(Vne,jne)}const Wne=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function jne(t,i){let r=Mi[i];if(r===void 0){const n=Wne.get(i);if(n!==void 0)r=Mi[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',i,n);else throw new Error("Can not resolve #include <"+i+">")}return oD(r)}const Yne=/#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 DF(t){return t.replace(Yne,Kne)}function Kne(t,i,r,n){let a="";for(let s=parseInt(i);s<parseInt(r);s++)a+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return a}function PF(t){let i="precision "+t.precision+` float; 3540precision `+t.precision+" int;";return t.precision==="highp"?i+=` 3541#define HIGH_PRECISION`:t.precision==="mediump"?i+=` 3542#define MEDIUM_PRECISION`:t.precision==="lowp"&&(i+=` 3543#define LOW_PRECISION`),i}function Xne(t){let i="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===BW?i="SHADOWMAP_TYPE_PCF":t.shadowMapType===c$?i="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===Zh&&(i="SHADOWMAP_TYPE_VSM"),i}function qne(t){let i="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Xg:case qg:i="ENVMAP_TYPE_CUBE";break;case FT:i="ENVMAP_TYPE_CUBE_UV";break}return i}function Zne(t){let i="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case qg:i="ENVMAP_MODE_REFRACTION";break}return i}function Jne(t){let i="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case CO:i="ENVMAP_BLENDING_MULTIPLY";break;case P$:i="ENVMAP_BLENDING_MIX";break;case L$:i="ENVMAP_BLENDING_ADD";break}return i}function $ne(t){const i=t.envMapCubeUVHeight;if(i===null)return null;const r=Math.log2(i)-2,n=1/i;return{texelWidth:1/(3*Math.max(Math.pow(2,r),7*16)),texelHeight:n,maxMip:r}}function eae(t,i,r,n){const a=t.getContext(),s=r.defines;let o=r.vertexShader,l=r.fragmentShader;const c=Xne(r),h=qne(r),u=Zne(r),d=Jne(r),A=$ne(r),f=r.isWebGL2?"":Gne(r),m=zne(s),g=a.createProgram();let p,v,_=r.glslVersion?"#version "+r.glslVersion+` 3544`:"";r.isRawShaderMaterial?(p=["#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,m].filter(s_).join(` 3545`),p.length>0&&(p+=` 3546`),v=[f,"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,m].filter(s_).join(` 3547`),v.length>0&&(v+=` 3548`)):(p=[PF(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,m,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.displacementMap?"#define USE_DISPLACEMENTMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.mapUv?"#define MAP_UV "+r.mapUv:"",r.alphaMapUv?"#define ALPHAMAP_UV "+r.alphaMapUv:"",r.lightMapUv?"#define LIGHTMAP_UV "+r.lightMapUv:"",r.aoMapUv?"#define AOMAP_UV "+r.aoMapUv:"",r.emissiveMapUv?"#define EMISSIVEMAP_UV "+r.emissiveMapUv:"",r.bumpMapUv?"#define BUMPMAP_UV "+r.bumpMapUv:"",r.normalMapUv?"#define NORMALMAP_UV "+r.normalMapUv:"",r.displacementMapUv?"#define DISPLACEMENTMAP_UV "+r.displacementMapUv:"",r.metalnessMapUv?"#define METALNESSMAP_UV "+r.metalnessMapUv:"",r.roughnessMapUv?"#define ROUGHNESSMAP_UV "+r.roughnessMapUv:"",r.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+r.anisotropyMapUv:"",r.clearcoatMapUv?"#define CLEARCOATMAP_UV "+r.clearcoatMapUv:"",r.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+r.clearcoatNormalMapUv:"",r.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+r.clearcoatRoughnessMapUv:"",r.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+r.iridescenceMapUv:"",r.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+r.iridescenceThicknessMapUv:"",r.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+r.sheenColorMapUv:"",r.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+r.sheenRoughnessMapUv:"",r.specularMapUv?"#define SPECULARMAP_UV "+r.specularMapUv:"",r.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+r.specularColorMapUv:"",r.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+r.specularIntensityMapUv:"",r.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+r.transmissionMapUv:"",r.thicknessMapUv?"#define THICKNESSMAP_UV "+r.thicknessMapUv:"",r.vertexTangents&&r.flatShading===!1?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&r.flatShading===!1?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 3549`].filter(s_).join(` 3550`),v=[f,PF(r),"#define SHADER_TYPE "+r.shaderType,"#define SHADER_NAME "+r.shaderName,m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+u:"",r.envMap?"#define "+d:"",A?"#define CUBEUV_TEXEL_WIDTH "+A.texelWidth:"",A?"#define CUBEUV_TEXEL_HEIGHT "+A.texelHeight:"",A?"#define CUBEUV_MAX_MIP "+A.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",r.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.anisotropy?"#define USE_ANISOTROPY":"",r.anisotropyMap?"#define USE_ANISOTROPYMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IR
3550IDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",r.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.alphaHash?"#define USE_ALPHAHASH":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.vertexTangents&&r.flatShading===!1?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUv1s?"#define USE_UV1":"",r.vertexUv2s?"#define USE_UV2":"",r.vertexUv3s?"#define USE_UV3":"",r.pointsUvs?"#define USE_POINTS_UV":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.numLightProbes>0?"#define USE_LIGHT_PROBES":"",r.useLegacyLights?"#define LEGACY_LIGHTS":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==gA?"#define TONE_MAPPING":"",r.toneMapping!==gA?Mi.tonemapping_pars_fragment:"",r.toneMapping!==gA?Hne("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",Mi.colorspace_pars_fragment,kne("linearToOutputTexel",r.outputColorSpace),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"",` 3551`].filter(s_).join(` 3552`)),o=oD(o),o=BF(o,r),o=IF(o,r),l=oD(l),l=BF(l,r),l=IF(l,r),o=DF(o),l=DF(l),r.isWebGL2&&r.isRawShaderMaterial!==!0&&(_=`#version 300 es 3553`,p=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` 3554`)+` 3555`+p,v=["precision mediump sampler2DArray;","#define varying in",r.glslVersion===q3?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===q3?"":"#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(` 3556`)+` 3557`+v);const y=_+p+o,w=_+v+l,b=xF(a,a.VERTEX_SHADER,y),E=xF(a,a.FRAGMENT_SHADER,w);a.attachShader(g,b),a.attachShader(g,E),r.index0AttributeName!==void 0?a.bindAttribLocation(g,0,r.index0AttributeName):r.morphTargets===!0&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g);function M(x){if(t.debug.checkShaderErrors){const R=a.getProgramInfoLog(g).trim(),L=a.getShaderInfoLog(b).trim(),I=a.getShaderInfoLog(E).trim();let F=!0,Y=!0;if(a.getProgramParameter(g,a.LINK_STATUS)===!1)if(F=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(a,g,b,E);else{const D=RF(a,b,"vertex"),U=RF(a,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(g,a.VALIDATE_STATUS)+` 3558 3559Program Info Log: `+R+` 3560`+D+` 3561`+U)}else R!==""?console.warn("THREE.WebGLProgram: Program Info Log:",R):(L===""||I==="")&&(Y=!1);Y&&(x.diagnostics={runnable:F,programLog:R,vertexShader:{log:L,prefix:p},fragmentShader:{log:I,prefix:v}})}a.deleteShader(b),a.deleteShader(E),S=new mS(a,g),T=Qne(a,g)}let S;this.getUniforms=function(){return S===void 0&&M(this),S};let T;this.getAttributes=function(){return T===void 0&&M(this),T};let C=r.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return C===!1&&(C=a.getProgramParameter(g,One)),C},this.destroy=function(){n.releaseStatesOfProgram(this),a.deleteProgram(g),this.program=void 0},this.type=r.shaderType,this.name=r.shaderName,this.id=Nne++,this.cacheKey=i,this.usedTimes=1,this.program=g,this.vertexShader=b,this.fragmentShader=E,this}let tae=0;class iae{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(i){const r=i.vertexShader,n=i.fragmentShader,a=this._getShaderStage(r),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(i);return o.has(a)===!1&&(o.add(a),a.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(i){const r=this.materialCache.get(i);for(const n of r)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(i),this}getVertexShaderID(i){return this._getShaderStage(i.vertexShader).id}getFragmentShaderID(i){return this._getShaderStage(i.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(i){const r=this.materialCache;let n=r.get(i);return n===void 0&&(n=new Set,r.set(i,n)),n}_getShaderStage(i){const r=this.shaderCache;let n=r.get(i);return n===void 0&&(n=new rae(i),r.set(i,n)),n}}class rae{constructor(i){this.id=tae++,this.code=i,this.usedTimes=0}}function nae(t,i,r,n,a,s,o){const l=new BO,c=new iae,h=[],u=a.isWebGL2,d=a.logarithmicDepthBuffer,A=a.vertexTextures;let f=a.precision;const m={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 g(T){return T===0?"uv":`uv${T}`}function p(T,C,x,R,L){const I=R.fog,F=L.geometry,Y=T.isMeshStandardMaterial?R.environment:null,D=(T.isMeshStandardMaterial?r:i).get(T.envMap||Y),U=D&&D.mapping===FT?D.image.height:null,j=m[T.type];T.precision!==null&&(f=a.getMaxPrecision(T.precision),f!==T.precision&&console.warn("THREE.WebGLProgram.getParameters:",T.precision,"not supported, using",f,"instead."));const J=F.morphAttributes.position||F.morphAttributes.normal||F.morphAttributes.color,z=J!==void 0?J.length:0;let $=0;F.morphAttributes.position!==void 0&&($=1),F.morphAttributes.normal!==void 0&&($=2),F.morphAttributes.color!==void 0&&($=3);let te,ae,ve,oe;if(j){const oi=Vc[j];te=oi.vertexShader,ae=oi.fragmentShader}else te=T.vertexShader,ae=T.fragmentShader,c.update(T),ve=c.getVertexShaderID(T),oe=c.getFragmentShaderID(T);const K=t.getRenderTarget(),X=L.isInstancedMesh===!0,N=!!T.map,k=!!T.matcap,Z=!!D,V=!!T.aoMap,re=!!T.lightMap,Ae=!!T.bumpMap,pe=!!T.normalMap,ce=!!T.displacementMap,_e=!!T.emissiveMap,me=!!T.metalnessMap,le=!!T.roughnessMap,De=T.anisotropy>0,Ve=T.clearcoat>0,se=T.iridescence>0,P=T.sheen>0,H=T.transmission>0,ye=De&&!!T.anisotropyMap,Q=Ve&&!!T.clearcoatMap,Be=Ve&&!!T.clearcoatNormalMap,Le=Ve&&!!T.clearcoatRoughnessMap,Ke=se&&!!T.iridescenceMap,Re=se&&!!T.iridescenceThicknessMap,Xe=P&&!!T.sheenColorMap,fe=P&&!!T.sheenRoughnessMap,Ge=!!T.specularMap,Pe=!!T.specularColorMap,rt=!!T.specularIntensityMap,Ze=H&&!!T.transmissionMap,pt=H&&!!T.thicknessMap,At=!!T.gradientMap,Se=!!T.alphaMap,xe=T.alphaTest>0,de=!!T.alphaHash,Qe=!!T.extensions,We=!!F.attributes.uv1,He=!!F.attributes.uv2,ct=!!F.attributes.uv3;let St=gA;return T.toneMapped&&(K===null||K.isXRRenderTarget===!0)&&(St=t.toneMapping),{isWebG
3561L2:u,shaderID:j,shaderType:T.type,shaderName:T.name,vertexShader:te,fragmentShader:ae,defines:T.defines,customVertexShaderID:ve,customFragmentShaderID:oe,isRawShaderMaterial:T.isRawShaderMaterial===!0,glslVersion:T.glslVersion,precision:f,instancing:X,instancingColor:X&&L.instanceColor!==null,supportsVertexTextures:A,outputColorSpace:K===null?t.outputColorSpace:K.isXRRenderTarget===!0?K.texture.colorSpace:fc,map:N,matcap:k,envMap:Z,envMapMode:Z&&D.mapping,envMapCubeUVHeight:U,aoMap:V,lightMap:re,bumpMap:Ae,normalMap:pe,displacementMap:A&&ce,emissiveMap:_e,normalMapObjectSpace:pe&&T.normalMapType===Z$,normalMapTangentSpace:pe&&T.normalMapType===MO,metalnessMap:me,roughnessMap:le,anisotropy:De,anisotropyMap:ye,clearcoat:Ve,clearcoatMap:Q,clearcoatNormalMap:Be,clearcoatRoughnessMap:Le,iridescence:se,iridescenceMap:Ke,iridescenceThicknessMap:Re,sheen:P,sheenColorMap:Xe,sheenRoughnessMap:fe,specularMap:Ge,specularColorMap:Pe,specularIntensityMap:rt,transmission:H,transmissionMap:Ze,thicknessMap:pt,gradientMap:At,opaque:T.transparent===!1&&T.blending===yg,alphaMap:Se,alphaTest:xe,alphaHash:de,combine:T.combine,mapUv:N&&g(T.map.channel),aoMapUv:V&&g(T.aoMap.channel),lightMapUv:re&&g(T.lightMap.channel),bumpMapUv:Ae&&g(T.bumpMap.channel),normalMapUv:pe&&g(T.normalMap.channel),displacementMapUv:ce&&g(T.displacementMap.channel),emissiveMapUv:_e&&g(T.emissiveMap.channel),metalnessMapUv:me&&g(T.metalnessMap.channel),roughnessMapUv:le&&g(T.roughnessMap.channel),anisotropyMapUv:ye&&g(T.anisotropyMap.channel),clearcoatMapUv:Q&&g(T.clearcoatMap.channel),clearcoatNormalMapUv:Be&&g(T.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Le&&g(T.clearcoatRoughnessMap.channel),iridescenceMapUv:Ke&&g(T.iridescenceMap.channel),iridescenceThicknessMapUv:Re&&g(T.iridescenceThicknessMap.channel),sheenColorMapUv:Xe&&g(T.sheenColorMap.channel),sheenRoughnessMapUv:fe&&g(T.sheenRoughnessMap.channel),specularMapUv:Ge&&g(T.specularMap.channel),specularColorMapUv:Pe&&g(T.specularColorMap.channel),specularIntensityMapUv:rt&&g(T.specularIntensityMap.channel),transmissionMapUv:Ze&&g(T.transmissionMap.channel),thicknessMapUv:pt&&g(T.thicknessMap.channel),alphaMapUv:Se&&g(T.alphaMap.channel),vertexTangents:!!F.attributes.tangent&&(pe||De),vertexColors:T.vertexColors,vertexAlphas:T.vertexColors===!0&&!!F.attributes.color&&F.attributes.color.itemSize===4,vertexUv1s:We,vertexUv2s:He,vertexUv3s:ct,pointsUvs:L.isPoints===!0&&!!F.attributes.uv&&(N||Se),fog:!!I,useFog:T.fog===!0,fogExp2:I&&I.isFogExp2,flatShading:T.flatShading===!0,sizeAttenuation:T.sizeAttenuation===!0,logarithmicDepthBuffer:d,skinning:L.isSkinnedMesh===!0,morphTargets:F.morphAttributes.position!==void 0,morphNormals:F.morphAttributes.normal!==void 0,morphColors:F.morphAttributes.color!==void 0,morphTargetsCount:z,morphTextureStride:$,numDirLights:C.directional.length,numPointLights:C.point.length,numSpotLights:C.spot.length,numSpotLightMaps:C.spotLightMap.length,numRectAreaLights:C.rectArea.length,numHemiLights:C.hemi.length,numDirLightShadows:C.directionalShadowMap.length,numPointLightShadows:C.pointShadowMap.length,numSpotLightShadows:C.spotShadowMap.length,numSpotLightShadowsWithMaps:C.numSpotLightShadowsWithMaps,numLightProbes:C.numLightProbes,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:T.dithering,shadowMapEnabled:t.shadowMap.enabled&&x.length>0,shadowMapType:t.shadowMap.type,toneMapping:St,useLegacyLights:t._useLegacyLights,decodeVideoTexture:N&&T.map.isVideoTexture===!0&&vr.getTransfer(T.map.colorSpace)===Ur,premultipliedAlpha:T.premultipliedAlpha,doubleSided:T.side===os,flipSided:T.side===fs,useDepthPacking:T.depthPacking>=0,depthPacking:T.depthPacking||0,index0AttributeName:T.index0AttributeName,extensionDerivatives:Qe&&T.extensions.derivatives===!0,extensionFragDepth:Qe&&T.extensions.fragDepth===!0,extensionDrawBuffers:Qe&&T.extensions.drawBuffers===!0,extensionShaderTextureLOD:Qe&&T.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:T.customProgramCacheKey()}}function v(T){const C=[];if(T.shaderID?C.push(T.shaderID):(C.push(T.customVertexShaderID),C.push(T.customFragmentShaderID)),T.defines!==void 0)for(const x in T.defines)C.push(x),C.push(T.defines[x]);return T.isRawShaderMaterial===!1&&(_(C,T),y(C,T),C.push(t.outputColorSpace)),C.push(T.customProgramCacheKey),C.join()}function _(T,C){T.push(C.precision),T.push(C.outputColorSpace),T.push(C.envMapMode),T.push(C.envMapCubeUVHeight),T.push(C.mapUv),T.push(C.alphaMapUv),T.push(C.lightMapUv),T.push(C.aoMapUv),T.push(C.bumpMapUv),T.push(C.normalMapUv),T.push(C.displacementMapUv),T.push(C.emissiveMapUv),T.push(C.metalnessMapUv),T.push(C.roughnessMapUv),T.push(C.anisotropyMapUv),T.push(C.clearcoatMapUv),T.push(C.clearcoatNormalMapUv),T.push(C.clearcoatRoughnessMapUv),T.push(C.iridescenceMapUv),T.push(C.iridescenceThicknessMapUv),T.push(C.sheenColorMapUv),T.push(C.sheenRoughnessMapUv),T.push(C.specularMapUv),T.push(C.specularColorMapUv),T.push(C.specularIntensityMapUv),T.push(C.transmissionMapUv),T.push(C.thicknessMapUv),T.push(C.combine),T.push(C.fogExp2),T.push(C.sizeAttenuation),T.push(C.morphTargetsCount),T.push(C.morphAttributeCount),T.push(C.numDirLights),T.push(C.numPointLights),T.push(C.numSpotLights),T.push(C.numSpotLightMaps),T.push(C.numHemiLights),T.push(C.numRectAreaLights),T.push(C.numDirLightShadows),T.push(C.numPointLightShadows),T.push(C.numSpotLightShadows),T.push(C.numSpotLightShadowsWithMaps),T.push(C.numLightProbes),T.push(C.shadowMapType),T.push(C.toneMapping),T.push(C.numClippingPlanes),T.push(C.numClipIntersection),T.push(C.depthPacking)}function y(T,C){l.disableAll(),C.isWebGL2&&l.enable(0),C.supportsVertexTextures&&l.enable(1),C.instancing&&l.enable(2),C.instancingColor&&l.enable(3),C.matcap&&l.enable(4),C.envMap&&l.enable(5),C.normalMapObjectSpace&&l.enable(6),C.normalMapTangentSpace&&l.enable(7),C.clearcoat&&l.enable(8),C.iridescence&&l.enable(9),C.alph
vendor: 18,216 bytes, lines 3561-3589
3561aTest&&l.enable(10),C.vertexColors&&l.enable(11),C.vertexAlphas&&l.enable(12),C.vertexUv1s&&l.enable(13),C.vertexUv2s&&l.enable(14),C.vertexUv3s&&l.enable(15),C.vertexTangents&&l.enable(16),C.anisotropy&&l.enable(17),C.alphaHash&&l.enable(18),T.push(l.mask),l.disableAll(),C.fog&&l.enable(0),C.useFog&&l.enable(1),C.flatShading&&l.enable(2),C.logarithmicDepthBuffer&&l.enable(3),C.skinning&&l.enable(4),C.morphTargets&&l.enable(5),C.morphNormals&&l.enable(6),C.morphColors&&l.enable(7),C.premultipliedAlpha&&l.enable(8),C.shadowMapEnabled&&l.enable(9),C.useLegacyLights&&l.enable(10),C.doubleSided&&l.enable(11),C.flipSided&&l.enable(12),C.useDepthPacking&&l.enable(13),C.dithering&&l.enable(14),C.transmission&&l.enable(15),C.sheen&&l.enable(16),C.opaque&&l.enable(17),C.pointsUvs&&l.enable(18),C.decodeVideoTexture&&l.enable(19),T.push(l.mask)}function w(T){const C=m[T.type];let x;if(C){const R=Vc[C];x=Qee.clone(R.uniforms)}else x=T.uniforms;return x}function b(T,C){let x;for(let R=0,L=h.length;R<L;R++){const I=h[R];if(I.cacheKey===C){x=I,++x.usedTimes;break}}return x===void 0&&(x=new eae(t,C,T,s),h.push(x)),x}function E(T){if(--T.usedTimes===0){const C=h.indexOf(T);h[C]=h[h.length-1],h.pop(),T.destroy()}}function M(T){c.remove(T)}function S(){c.dispose()}return{getParameters:p,getProgramCacheKey:v,getUniforms:w,acquireProgram:b,releaseProgram:E,releaseShaderCache:M,programs:h,dispose:S}}function aae(){let t=new WeakMap;function i(s){let o=t.get(s);return o===void 0&&(o={},t.set(s,o)),o}function r(s){t.delete(s)}function n(s,o,l){t.get(s)[o]=l}function a(){t=new WeakMap}return{get:i,remove:r,update:n,dispose:a}}function sae(t,i){return t.groupOrder!==i.groupOrder?t.groupOrder-i.groupOrder:t.renderOrder!==i.renderOrder?t.renderOrder-i.renderOrder:t.material.id!==i.material.id?t.material.id-i.material.id:t.z!==i.z?t.z-i.z:t.id-i.id}function LF(t,i){return t.groupOrder!==i.groupOrder?t.groupOrder-i.groupOrder:t.renderOrder!==i.renderOrder?t.renderOrder-i.renderOrder:t.z!==i.z?i.z-t.z:t.id-i.id}function OF(){const t=[];let i=0;const r=[],n=[],a=[];function s(){i=0,r.length=0,n.length=0,a.length=0}function o(d,A,f,m,g,p){let v=t[i];return v===void 0?(v={id:d.id,object:d,geometry:A,material:f,groupOrder:m,renderOrder:d.renderOrder,z:g,group:p},t[i]=v):(v.id=d.id,v.object=d,v.geometry=A,v.material=f,v.groupOrder=m,v.renderOrder=d.renderOrder,v.z=g,v.group=p),i++,v}function l(d,A,f,m,g,p){const v=o(d,A,f,m,g,p);f.transmission>0?n.push(v):f.transparent===!0?a.push(v):r.push(v)}function c(d,A,f,m,g,p){const v=o(d,A,f,m,g,p);f.transmission>0?n.unshift(v):f.transparent===!0?a.unshift(v):r.unshift(v)}function h(d,A){r.length>1&&r.sort(d||sae),n.length>1&&n.sort(A||LF),a.length>1&&a.sort(A||LF)}function u(){for(let d=i,A=t.length;d<A;d++){const f=t[d];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:r,transmissive:n,transparent:a,init:s,push:l,unshift:c,finish:u,sort:h}}function oae(){let t=new WeakMap;function i(n,a){const s=t.get(n);let o;return s===void 0?(o=new OF,t.set(n,[o])):a>=s.length?(o=new OF,s.push(o)):o=s[a],o}function r(){t=new WeakMap}return{get:i,dispose:r}}function lae(){const t={};return{get:function(i){if(t[i.id]!==void 0)return t[i.id];let r;switch(i.type){case"DirectionalLight":r={direction:new we,color:new Kt};break;case"SpotLight":r={position:new we,direction:new we,color:new Kt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new we,color:new Kt,distance:0,decay:0};break;case"HemisphereLight":r={direction:new we,skyColor:new Kt,groundColor:new Kt};break;case"RectAreaLight":r={color:new Kt,position:new we,halfWidth:new we,halfHeight:new we};break}return t[i.id]=r,r}}}function cae(){const t={};return{get:function(i){if(t[i.id]!==void 0)return t[i.id];let r;switch(i.type){case"DirectionalLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Jt};break;case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Jt};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Jt,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[i.id]=r,r}}}let hae=0;function uae(t,i){return(i.castShadow?2:0)-(t.castShadow?2:0)+(i.map?1:0)-(t.map?1:0)}function dae(t,i){const r=new lae,n=cae(),a={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 u=0;u<9;u++)a.probe.push(new we);const s=new we,o=new _t,l=new _t;function c(u,d){let A=0,f=0,m=0;for(let R=0;R<9;R++)a.probe[R].set(0,0,0);let g=0,p=0,v=0,_=0,y=0,w=0,b=0,E=0,M=0,S=0,T=0;u.sort(uae);const C=d===!0?Math.PI:1;for(let R=0,L=u.length;R<L;R++){const I=u[R],F=I.color,Y=I.intensity,D=I.distance,U=I.shadow&&I.shadow.map?I.shadow.map.texture:null;if(I.isAmbientLight)A+=F.r*Y*C,f+=F.g*Y*C,m+=F.b*Y*C;else if(I.isLightProbe){for(let j=0;j<9;j++)a.probe[j].addScaledVector(I.sh.coefficients[j],Y);T++}else if(I.isDirectionalLight){const j=r.get(I);if(j.color.copy(I.color).multiplyScalar(I.intensity*C),I.castShadow){const J=I.shadow,z=n.get(I);z.shadowBias=J.bias,z.shadowNormalBias=J.normalBias,z.shadowRadius=J.radius,z.shadowMapSize=J.mapSize,a.directionalShadow[g]=z,a.directionalShadowMap[g]=U,a.directionalShadowMatrix[g]=I.shadow.matrix,w++}a.directional[g]=j,g++}else if(I.isSpotLight){const j=r.get(I);j.position.setFromMatrixPosition(I.matrixWorld),j.color.copy(F).multiplyScalar(Y*C),j.distance=D,j.coneCos=Math.cos(I.angle),j.penumbraCos=Math.cos(I.angle*(1-I.penumbra)),j.decay=I.decay,a.spot[v]=j;const J=I.shadow;if(I.map&&(a.spotLightMap[M]=I.map,M++,J.updateMatrices(I),I.castShadow&&S++),a.spotLightMatrix[v]=J.matrix,I.castShadow){const z=n.get(I);z.shadowBias=J.bias,z.shadowNormalBias=J.normalBias,z.shadowRadius=J.radius,z.shadowMapSize=J.mapSize,a.spotShadow[v]=z,a.spotShadowMap[v]=U,E++}v++}else if(I.isRectAreaLight){const j=r.get(I);j.color.copy(F).multiplyScalar(Y),j.halfWidth.set(I.width*.5,0,0),j.halfHeight.set(0,I.height*.5,0),a.rectArea[_]=j,_++}else if(I.isPointLight){const j=r.get(I);if(j.color.copy(I.color).multiplyScalar(I.intensity*C),j.distance=I.distance,j.decay=I.decay,I.castShadow){const J=I.shadow,z=n.get(I);z.shadowBias=J.bias,z.shadowNormalBias=J.normalBias,z.shadowRadius=J.radius,z.shadowMapSize=J.mapSize,z.shadowCameraNear=J.camera.near,z.shadowCameraFar=J.camera.far,a.pointShadow[p]=z,a.pointShadowMap[p]=U,a.pointShadowMatrix[p]=I.shadow.matrix,b++}a.point[p]=j,p++}else if(I.isHemisphereLight){const j=r.get(I);j.skyColor.copy(I.color).multiplyScalar(Y*C),j.groundColor.copy(I.groundColor).multiplyScalar(Y*C),a.hemi[y]=j,y++}}_>0&&(i.isWebGL2||t.has("OES_texture_float_linear")===!0?(a.rectAreaLTC1=wt.LTC_FLOAT_1,a.rectAreaLTC2=wt.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(a.rectAreaLTC1=wt.LTC_HALF_1,a.rectAreaLTC2=wt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),a.ambient[0]=A,a.ambient[1]=f,a.ambient[2]=m;const x=a.hash;(x.directionalLength!==g||x.pointLength!==p||x.spotLength!==v||x.rectAreaLength!==_||x.hemiLength!==y||x.numDirectionalShadows!==w||x.numPointShadows!==b||x.numSpotShadows!==E||x.numSpotMaps!==M||x.numLightProbes!==T)&&(a.directional.length=g,a.spot.length=v,a.rectArea.length=_,a.point.length=p,a.hemi.length=y,a.directionalShadow.length=w,a.directionalShadowMap.length=w,a.pointShadow.length=b,a.pointShadowMap.length=b,a.spotShadow.length=E,a.spotShadowMap.length=E,a.directionalShadowMatrix.length=w,a.pointShadowMatrix.length=b,a.spotLightMatrix.length=E+M-S,a.spotLightMap.length=M,a.numSpotLightShadowsWithMaps=S,a.numLightProbes=T,x.directionalLength=g,x.pointLength=p,x.spotLength=v,x.rectAreaLength=_,x.hemiLength=y,x.numDirectionalShadows=w,x.numPointShadows=b,x.numSpotShadows=E,x.numSpotMaps=M,x.numLightProbes=T,a.version=hae++)}function h(u,d){let A=0,f=0,m=0,g=0,p=0;const v=d.matrixWorldInverse;for(let _=0,y=u.length;_<y;_++){const w=u[_];if(w.isDirectionalLight){const b=a.directional[A];b.direction.setFromMatrixPosition(w.matrixWorld),s.setFromMatrixPosition(w.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(v),A++}else if(w.isSpotLight){const b=a.spot[m];b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(v),b.direction.setFromMatrixPosition(w.matrixWorld),s.setFromMatrixPosition(w.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(v),m++}else if(w.isRectAreaLight){const b=a.rectArea[g];b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(v),l.identity(),o.copy(w.matrixWorld),o.premultiply(v),l.extractRotation(o),b.halfWidth.set(w.width*.5,0,0),b.halfHeight.set(0,w.height*.5,0),b.halfWidth.applyMatrix4(l),b.halfHeight.applyMatrix4(l),g++}else if(w.isPointLight){const b=a.point[f];b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(v),f++}else if(w.isHemisphereLight){const b=a.hemi[p];b.direction.setFromMatrixPosition(w.matrixWorld),b.direction.transformDirection(v),p++}}}return{setup:c,setupView:h,state:a}}function NF(t,i){const r=new dae(t,i),n=[],a=[];function s(){n.length=0,a.length=0}function o(d){n.push(d)}function l(d){a.push(d)}function c(d){r.setup(n,d)}function h(d){r.setupView(n,d)}return{init:s,state:{lightsArray:n,shadowsArray:a,lights:r},setupLights:c,setupLightsView:h,pushLight:o,pushShadow:l}}function Aae(t,i){let r=new WeakMap;function n(s,o=0){const l=r.get(s);let c;return l===void 0?(c=new NF(t,i),r.set(s,[c])):o>=l.length?(c=new NF(t,i),l.push(c)):c=l[o],c}function a(){r=new WeakMap}return{get:n,dispose:a}}class fae extends Ku{constructor(i){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=X$,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(i)}copy(i){return super.copy(i),this.depthPacking=i.depthPacking,this.map=i.map,this.alphaMap=i.alphaMap,this.displacementMap=i.displacementMap,this.displacementScale=i.displacementScale,this.displacementBias=i.displacementBias,this.wireframe=i.wireframe,this.wireframeLinewidth=i.wireframeLinewidth,this}}class pae extends Ku{constructor(i){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(i)}copy(i){return super.copy(i),this.map=i.map,this.alphaMap=i.alphaMap,this.displacementMap=i.displacementMap,this.displacementScale=i.displacementScale,this.displacementBias=i.displacementBias,this}}const mae=`void main() { 3562 gl_Position = vec4( position, 1.0 ); 3563}`,gae=`uniform sampler2D shadow_pass; 3564uniform vec2 resolution; 3565uniform float radius; 3566#include <packing> 3567void main() { 3568 const float samples = float( VSM_SAMPLES ); 3569 float mean = 0.0; 3570 float squared_mean = 0.0; 3571 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 3572 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 3573 for ( float i = 0.0; i < samples; i ++ ) { 3574 float uvOffset = uvStart + i * uvStride; 3575 #ifdef HORIZONTAL_PASS 3576 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 3577 mean += distribution.x; 3578 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 3579 #else 3580 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 3581 mean += depth; 3582 squared_mean += depth * depth; 3583 #endif 3584 } 3585 mean = mean / samples; 3586 squared_mean = squared_mean / samples; 3587 float std_dev = sqrt( squared_mean - mean * mean ); 3588 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 3589}`;function vae(t,i,r){let n=new IO;const a=new Jt,s=new Jt,o=new Yr,l=new fae({depthPacking:q$}),c=new pae,h={},u=r.maxTextureSize,d={[RA]:fs,[fs]:RA,[os]:os},A=new co({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Jt},radius:{value:4}},vertexShader:mae,fragmentShader:gae}),f=A.clone();f.defines.HORIZONTAL_PASS=1;const m=new po;m.setAttribute("position",new ks(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const g=new Kr(m,A),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=BW;let v=this.type;this.render=function(b,E,M){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||b.length===0)return;const S=t.getRenderTarget(),T=t.getActiveCubeFace(),C=t.getActiveMipmapLevel(),x=t.state;x.setBlending(mA),x.buffers.color.setClear(1,1,1,1),x.buffers.depth.setTest(!0),x.setScissorTest(!1);const R=v!==Zh&&this.type===Zh,L=v===Zh&&this.type!==Zh;for(let I=0,F=b.length;I<F;I++){const Y=b[I],D=Y.shadow;if(D===void 0){console.warn("THREE.WebGLShadowMap:",Y,"has no shadow.");continue}if(D.autoUpdate===!1&&D.needsUpdate===!1)continue;a.copy(D.mapSize);const U=D.getFrameExtents();if(a.multiply(U),s.copy(D.mapSize),(a.x>u||a.y>u)&&(a.x>u&&(s.x=Math.floor(u/U.x),a.x=s.x*U.x,D.mapSize.x=s.x),a.y>u&&(s.y=Math.floor(u/U.y),a.y=s.y*U.y,D.mapSize.y=s.y)),D.map===null||R===!0||L===!0){const J=this.type!==Zh?{minFilter:Ua,magFilter:Ua}:{};D.map!==null&&D.map.dispose(),D.map=new ap(a.x,a.y,J),D.map.texture.name=Y.name+".shadowMap",D.camera.updateProjectionMatrix()}t.setRenderTarget(D.map),t.clear();const j=D.getViewportCount();for(let J=0;J<j;J++){const z=D.getViewport(J);o.set(s.x*z.x,s.y*z.y,s.x*z.z,s.y*z.w),x.viewport(o),D.updateMatrices(Y,J),n=D.getFrustum(),w(E,M,D.camera,Y,this.type)}D.isPointLightShadow!==!0&&this.type===Zh&&_(D,M),D.needsUpdate=!1}v=this.type,p.needsUpdate=!1,t.setRenderTarget(S,T,C)};function _(b,E){const M=i.update(g);A.defines.VSM_SAMPLES!==b.blurSamples&&(A.defines.VSM_SAMPLES=b.blurSamples,f.defines.VSM_SAMPLES=b.blurSamples,A.needsUpdate=!0,f.needsUpdate=!0),b.mapPass===null&&(b.mapPass=new ap(a.x,a.y)),A.uniforms.shadow_pass.value=b.map.texture,A.uniforms.resolution.value=b.mapSize,A.uniforms.radius.value=b.radius,t.setRenderTarget(b.mapPass),t.clear(),t.renderBufferDirect(E,null,M,A,g,null),f.uniforms.shadow_pass.value=b.mapPass.texture,f.uniforms.resolution.value=b.mapSize,f.uniforms.radius.value=b.radius,t.setRenderTarget(b.map),t.clear(),t.renderBufferDirect(E,null,M,f,g,null)}function y(b,E,M,S){let T=null;const C=M.isPointLight===!0?b.customDistanceMaterial:b.customDepthMaterial;if(C!==void 0)T=C;else if(T=M.isPointLight===!0?c:l,t.localClippingEnabled&&E.clipShadows===!0&&Array.isArray(E.clippingPlanes)&&E.clippingPlanes.length!==0||E.displacementMap&&E.displacementScale!==0||E.alphaMap&&E.alphaTest>0||E.map&&E.alphaTest>0){const x=T.uuid,R=E.uuid;let L=h[x];L===void 0&&(L={},h[x]=L);let I=L[R];I===void 0&&(I=T.clone(),L[R]=I),T=I}if(T.visible=E.visible,T.wireframe=E.wireframe,S===Zh?T.side=E.shadowSide!==null?E.shadowSide:E.side:T.side=E.shadowSide!==null?E.shadowSide:d[E.side],T.alphaMap=E.alphaMap,T.alphaTest=E.alphaTest,T.map=E.map,T.clipShadows=E.clipShadows,T.clippingPlanes=E.clippingPlanes,T.clipIntersection=E.clipIntersection,T.displacementMap=E.displacementMap,T.displacementScale=E.displacementScale,T.displacementBias=E.displacementBias,T.wireframeLinewidth=E.wireframeLinewidth,T.linewidth=E.linewidth,M.isPointLight===!0&&T.isMeshDistanceMaterial===!0){const x=t.properties.get(T);x.light=M}return T}function w(b,E,M,S,T){if(b.visible===!1)return;if(b.layers.test(E.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&T===Zh)&&(!b.frustumCulled||n.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(M.matrixWorldInverse,b.matrixWorld);const R=i.update(b),L=b.material;if(Array.isArray(L)){const I=R.groups;for(let F=0,Y=I.length;F<Y;F++){const D=I[F],U=L[D.materialIndex];if(U&&U.visible){const j=y(b,U,S,T);t.renderBufferDirect(M,null,R,j,b,D)}}}else if(L.visible){const I=y(b,L,S,T);t.renderBufferDirect(M,null,R,I,b,null)}}const x=b.children;for(let R=0,L=x.length;R<L;R++)w(x[R],E,M,S,T)}}function _ae(t,i,r){const n=r.isWebGL2;function a(){let de=!1;const Qe=new Yr;let We=null;const He=new Yr(0,0,0,0);return{setMask:function(ct){We!==ct&&!de&&(t.colorMask(ct,ct,ct,ct),We=ct)},setLocked:function(ct){de=ct},setClear:function(ct,St,si,oi,Ir){Ir===!0&&(ct*=oi,St*=oi,si*=oi),Qe.set(ct,St,si,oi),He.equals(Qe)===!1&&(t.clearColor(ct,St,si,oi),He.copy(Qe))},reset:function(){de=!1,We=null,He.set(-1,0,0,0)}}}function s(){let de=!1,Qe=null,We=null,He=null;return{setTest:function(ct){ct?N(t.DEPTH_TEST):k(t.DEPTH_TEST)},setMask:function(ct){Qe!==ct&&!de&&(t.depthMask(ct),Qe=ct)},setFunc:function(ct){if(We!==ct){switch(ct){case T$:t.depthFunc(t.NEVER);break;case M$:t.depthFunc(t.ALWAYS);break;case x$:t.depthFunc(t.LESS);break;case KS:t.depthFunc(t.LEQUAL);break;case R$:t.depthFunc(t.EQUAL);break;case B$:t.depthFunc(t.GEQUAL);break;case I$:t.depthFunc(t.GREATER);break;case D$:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}We=ct}},setLocked:function(ct){de=ct},setClear:function(ct){He!==ct&&(t.clearDepth(ct),He=ct)},reset:function(){de=!1,Qe=null,We=null,He=null}}}function o(){let de=!1,Qe=null,We=null,He=null,ct=null,St=null,si=null,oi=null,Ir=null;return{setTest:function(bi){de||(bi?N(t.STENCIL_TEST):k(t.STENCIL_TEST))},setMask:function(bi){Qe!==bi&&!de&&(t.stencilMask(bi),Qe=bi)},setFunc:function(bi,Qr,$a){(We!==bi||He!==Qr||ct!==$a)&&(t.stencilFunc(bi,Qr,$a),We=bi,He=Qr,ct=$a)},setOp:function(bi,Qr,$a){(St!==bi||si!==Qr||oi!==$a)&&(t.stencilOp(bi,Qr,$a),St=bi,si=Qr,oi=$a)},setLocked:function(bi){de=bi},setClear:function(bi){Ir!==bi&&(t.clearStencil(bi),Ir=bi)},reset:function(){de=!1,Qe=null,We=null,He=null,ct=null,St=null,si=null,oi=null,Ir=null}}}const l=new a,c=new s,h=new o,u=new WeakMap,d=new WeakMap;let A={},f={},m=new WeakMap,g=[],p=null,v=!1,_=null,y=null,w=null,b=null,E=null,M=null,S=null,T=new Kt(0,0,0),C=0,x=!1,R=null,
vendor: 7,328 bytes, line 3589
3589L=null,I=null,F=null,Y=null;const D=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let U=!1,j=0;const J=t.getParameter(t.VERSION);J.indexOf("WebGL")!==-1?(j=parseFloat(/^WebGL (\d)/.exec(J)[1]),U=j>=1):J.indexOf("OpenGL ES")!==-1&&(j=parseFloat(/^OpenGL ES (\d)/.exec(J)[1]),U=j>=2);let z=null,$={};const te=t.getParameter(t.SCISSOR_BOX),ae=t.getParameter(t.VIEWPORT),ve=new Yr().fromArray(te),oe=new Yr().fromArray(ae);function K(de,Qe,We,He){const ct=new Uint8Array(4),St=t.createTexture();t.bindTexture(de,St),t.texParameteri(de,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(de,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let si=0;si<We;si++)n&&(de===t.TEXTURE_3D||de===t.TEXTURE_2D_ARRAY)?t.texImage3D(Qe,0,t.RGBA,1,1,He,0,t.RGBA,t.UNSIGNED_BYTE,ct):t.texImage2D(Qe+si,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,ct);return St}const X={};X[t.TEXTURE_2D]=K(t.TEXTURE_2D,t.TEXTURE_2D,1),X[t.TEXTURE_CUBE_MAP]=K(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),n&&(X[t.TEXTURE_2D_ARRAY]=K(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),X[t.TEXTURE_3D]=K(t.TEXTURE_3D,t.TEXTURE_3D,1,1)),l.setClear(0,0,0,1),c.setClear(1),h.setClear(0),N(t.DEPTH_TEST),c.setFunc(KS),me(!1),le(g3),N(t.CULL_FACE),ce(mA);function N(de){A[de]!==!0&&(t.enable(de),A[de]=!0)}function k(de){A[de]!==!1&&(t.disable(de),A[de]=!1)}function Z(de,Qe){return f[de]!==Qe?(t.bindFramebuffer(de,Qe),f[de]=Qe,n&&(de===t.DRAW_FRAMEBUFFER&&(f[t.FRAMEBUFFER]=Qe),de===t.FRAMEBUFFER&&(f[t.DRAW_FRAMEBUFFER]=Qe)),!0):!1}function V(de,Qe){let We=g,He=!1;if(de)if(We=m.get(Qe),We===void 0&&(We=[],m.set(Qe,We)),de.isWebGLMultipleRenderTargets){const ct=de.texture;if(We.length!==ct.length||We[0]!==t.COLOR_ATTACHMENT0){for(let St=0,si=ct.length;St<si;St++)We[St]=t.COLOR_ATTACHMENT0+St;We.length=ct.length,He=!0}}else We[0]!==t.COLOR_ATTACHMENT0&&(We[0]=t.COLOR_ATTACHMENT0,He=!0);else We[0]!==t.BACK&&(We[0]=t.BACK,He=!0);He&&(r.isWebGL2?t.drawBuffers(We):i.get("WEBGL_draw_buffers").drawBuffersWEBGL(We))}function re(de){return p!==de?(t.useProgram(de),p=de,!0):!1}const Ae={[_f]:t.FUNC_ADD,[u$]:t.FUNC_SUBTRACT,[d$]:t.FUNC_REVERSE_SUBTRACT};if(n)Ae[E3]=t.MIN,Ae[w3]=t.MAX;else{const de=i.get("EXT_blend_minmax");de!==null&&(Ae[E3]=de.MIN_EXT,Ae[w3]=de.MAX_EXT)}const pe={[A$]:t.ZERO,[f$]:t.ONE,[p$]:t.SRC_COLOR,[$2]:t.SRC_ALPHA,[E$]:t.SRC_ALPHA_SATURATE,[_$]:t.DST_COLOR,[g$]:t.DST_ALPHA,[m$]:t.ONE_MINUS_SRC_COLOR,[eD]:t.ONE_MINUS_SRC_ALPHA,[y$]:t.ONE_MINUS_DST_COLOR,[v$]:t.ONE_MINUS_DST_ALPHA,[w$]:t.CONSTANT_COLOR,[b$]:t.ONE_MINUS_CONSTANT_COLOR,[S$]:t.CONSTANT_ALPHA,[C$]:t.ONE_MINUS_CONSTANT_ALPHA};function ce(de,Qe,We,He,ct,St,si,oi,Ir,bi){if(de===mA){v===!0&&(k(t.BLEND),v=!1);return}if(v===!1&&(N(t.BLEND),v=!0),de!==h$){if(de!==_||bi!==x){if((y!==_f||E!==_f)&&(t.blendEquation(t.FUNC_ADD),y=_f,E=_f),bi)switch(de){case yg:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case v3:t.blendFunc(t.ONE,t.ONE);break;case _3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case y3:t.blendFuncSeparate(t.ZERO,t.SRC_COLOR,t.ZERO,t.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",de);break}else switch(de){case yg:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case v3:t.blendFunc(t.SRC_ALPHA,t.ONE);break;case _3:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case y3:t.blendFunc(t.ZERO,t.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",de);break}w=null,b=null,M=null,S=null,T.set(0,0,0),C=0,_=de,x=bi}return}ct=ct||Qe,St=St||We,si=si||He,(Qe!==y||ct!==E)&&(t.blendEquationSeparate(Ae[Qe],Ae[ct]),y=Qe,E=ct),(We!==w||He!==b||St!==M||si!==S)&&(t.blendFuncSeparate(pe[We],pe[He],pe[St],pe[si]),w=We,b=He,M=St,S=si),(oi.equals(T)===!1||Ir!==C)&&(t.blendColor(oi.r,oi.g,oi.b,Ir),T.copy(oi),C=Ir),_=de,x=!1}function _e(de,Qe){de.side===os?k(t.CULL_FACE):N(t.CULL_FACE);let We=de.side===fs;Qe&&(We=!We),me(We),de.blending===yg&&de.transparent===!1?ce(mA):ce(de.blending,de.blendEquation,de.blendSrc,de.blendDst,de.blendEquationAlpha,de.blendSrcAlpha,de.blendDstAlpha,de.blendColor,de.blendAlpha,de.premultipliedAlpha),c.setFunc(de.depthFunc),c.setTest(de.depthTest),c.setMask(de.depthWrite),l.setMask(de.colorWrite);const He=de.stencilWrite;h.setTest(He),He&&(h.setMask(de.stencilWriteMask),h.setFunc(de.stencilFunc,de.stencilRef,de.stencilFuncMask),h.setOp(de.stencilFail,de.stencilZFail,de.stencilZPass)),Ve(de.polygonOffset,de.polygonOffsetFactor,de.polygonOffsetUnits),de.alphaToCoverage===!0?N(t.SAMPLE_ALPHA_TO_COVERAGE):k(t.SAMPLE_ALPHA_TO_COVERAGE)}function me(de){R!==de&&(de?t.frontFace(t.CW):t.frontFace(t.CCW),R=de)}function le(de){de!==o$?(N(t.CULL_FACE),de!==L&&(de===g3?t.cullFace(t.BACK):de===l$?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):k(t.CULL_FACE),L=de}function De(de){de!==I&&(U&&t.lineWidth(de),I=de)}function Ve(de,Qe,We){de?(N(t.POLYGON_OFFSET_FILL),(F!==Qe||Y!==We)&&(t.polygonOffset(Qe,We),F=Qe,Y=We)):k(t.POLYGON_OFFSET_FILL)}function se(de){de?N(t.SCISSOR_TEST):k(t.SCISSOR_TEST)}function P(de){de===void 0&&(de=t.TEXTURE0+D-1),z!==de&&(t.activeTexture(de),z=de)}function H(de,Qe,We){We===void 0&&(z===null?We=t.TEXTURE0+D-1:We=z);let He=$[We];He===void 0&&(He={type:void 0,texture:void 0},$[We]=He),(He.type!==de||He.texture!==Qe)&&(z!==We&&(t.activeTexture(We),z=We),t.bindTexture(de,Qe||X[de]),He.type=de,He.texture=Qe)}function ye(){const de=$[z];de!==void 0&&de.type!==void 0&&(t.bindTexture(de.type,null),de.type=void 0,de.texture=void 0)}function Q(){try{t.compressedTexImage2D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Be(){try{t.compressedTexImage3D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Le(){try{t.texSubImage2D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Ke(){try{t.texSubImage3D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Re(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Xe(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function fe(){try{t.texStorage2D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Ge(){try{t.texStorage3D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Pe(){try{t.texImage2D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function rt(){try{t.texImage3D.apply(t,arguments)}catch(de){console.error("THREE.WebGLState:",de)}}function Ze(de){ve.equals(de)===!1&&(t.scissor(de.x,de.y,de.z,de.w),ve.copy(de))}function pt(de){oe.equals(de)===!1&&(t.viewport(de.x,de.y,de.z,de.w),oe.copy(de))}function At(de,Qe){let We=d.get(Qe);We===void 0&&(We=new WeakMap,d.set(Qe,We));let He=We.get(de);He===void 0&&(He=t.getUniformBlockIndex(Qe,de.name),We.set(de,He))}function Se(de,Qe){const He=d.get(Qe).get(de);u.get(Qe)!==He&&(t.uniformBlockBinding(Qe,He,de.__bindingPointIndex),u.set(Qe,He))}function xe(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor
3589(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),n===!0&&(t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),A={},z=null,$={},f={},m=new WeakMap,g=[],p=null,v=!1,_=null,y=null,w=null,b=null,E=null,M=null,S=null,T=new Kt(0,0,0),C=0,x=!1,R=null,L=null,I=null,F=null,Y=null,ve.set(0,0,t.canvas.width,t.canvas.height),oe.set(0,0,t.canvas.width,t.canvas.height),l.reset(),c.reset(),h.reset()}return{buffers:{color:l,depth:c,stencil:h},enable:N,disable:k,bindFramebuffer:Z,drawBuffers:V,useProgram:re,setBlending:ce,setMaterial:_e,setFlipSided:me,setCullFace:le,setLineWidth:De,setPolygonOffset:Ve,setScissorTest:se,activeTexture:P,bindTexture:H,unbindTexture:ye,compressedTexImage2D:Q,compressedTexImage3D:Be,texImage2D:Pe,texImage3D:rt,updateUBOMapping:At,uniformBlockBinding:Se,texStorage2D:fe,texStorage3D:Ge,texSubImage2D:Le,texSubImage3D:Ke,compressedTexSubImage2D:Re,compressedTexSubImage3D:Xe,scissor:Ze,viewport:pt,reset:xe}}function yae(t,i,r,n,a,s,o){const l=a.isWebGL2,c=a.maxTextures,h=a.maxCubemapSize,u=a.maxTextureSize,d=a.maxSamples,A=i.has("WEBGL_multisampled_render_to_texture")?i.get("WEBGL_multisampled_render_to_texture"):null,f=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap;let g;const p=new WeakMap;let v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(P,H){return v?new OffscreenCanvas(P,H):my("canvas")}function y(P,H,ye,Q){let Be=1;if((P.width>Q||P.height>Q)&&(Be=Q/Math.max(P.width,P.height)),Be<1||H===!0)if(typeof HTMLImageElement<"u"&&P instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&P instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&P instanceof ImageBitmap){const Le=H?$S:Math.floor,Ke=Le(Be*P.width),Re=Le(Be*P.height);g===void 0&&(g=_(Ke,Re));const Xe=ye?_(Ke,Re):g;return Xe.width=Ke,Xe.height=Re,Xe.getContext("2d").drawImage(P,0,0,Ke,Re),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+P.width+"x"+P.height+") to ("+Ke+"x"+Re+")."),Xe}else return"data"in P&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+P.width+"x"+P.height+")."),P;return P}function w(P){return sD(P.width)&&sD(P.height)}function b(P){return l?!1:P.wrapS!==Ha||P.wrapT!==Ha||P.minFilter!==Ua&&P.minFilter!==pa}function E(P,H){return P.generateMipmaps&&H&&P.minFilter!==Ua&&P.minFilter!==pa}function M(P){t.generateMipmap(P)}function S(P,H,ye,Q,Be=!1){if(l===!1)return H;if(P!==null){if(t[P]!==void 0)return t[P];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+P+"'")}let Le=H;if(H===t.RED&&(ye===t.FLOAT&&(Le=t.R32F),ye===t.HALF_FLOAT&&(Le=t.R16F),ye===t.UNSIGNED_BYTE&&(Le=t.R8)),H===t.RED_INTEGER&&(ye===t.UNSIGNED_BYTE&&(Le=t.R8UI),ye===t.UNSIGNED_SHORT&&(Le=t.R16UI),ye===t.UNSIGNED_INT&&(Le=t.R32UI),ye===t.BYTE&&(Le=t.R8I),ye===t.SHORT&&(Le=t.R16I),ye===t.INT&&(Le=t.R32I)),H===t.RG&&(ye===t.FLOAT&&(Le=t.RG32F),ye===t.HALF_FLOAT&&(Le=t.RG16F),ye===t.UNSIGNED_BYTE&&(Le=t.RG8)),H===t.RGBA){const Ke=Be?XS:vr.getTransfer(Q);ye===t.FLOAT&&(Le=t.RGBA32F),ye===t.HALF_FLOAT&&(Le=t.RGBA16F),ye===t.UNSIGNED_BYTE&&(Le=Ke===Ur?t.SRGB8_ALPHA8:t.RGBA8),ye===t.UNSIGNED_SHORT_4_4_4_4&&(Le=t.RGBA4),ye===t.UNSIGNED_SHORT_5_5_5_1&&(Le=t.RGB5_A1)}return(Le===t.R16F||Le===t.R32F||Le===t.RG16F||Le===t.RG32F||Le===t.RGBA16F||Le===t.RGBA32F)&&i.get("EXT_color_buffer_float"),Le}function T(P,H,ye){return E(P,ye)===!0||P.isFramebufferTexture&&P.minFilter!==Ua&&P.minFilter!==pa?Math.log2(Math.max(H.width,H.height))+1:P.mipmaps!==void 0&&P.mipmaps.length>0?P.mipmaps.length:P.isCompressedTexture&&Array.isArray(P.image)?H.mipmaps.length:1}function C(P){return P===Ua||P===b3||P===ZM?t.NEAREST:t.LINEAR}function x(P){const H=P.target;H.removeEventListener("dispose",x),L(H),H.isVideoTexture&&m.delete(H)}function R(P){const H=P.target;H.removeEventListener("dispose",R),F(H)}function L(P){const H=n.get(P);if(H.__webglInit===void 0)return;const ye=P.source,Q=p.get(ye);if(Q){const Be=Q[H.__cacheKey];Be.usedTimes--,Be.usedTimes===0&&I(P),Object.keys(Q).length===0&&p.delete(ye)}n.remove(P)}function I(P){const H=n.get(P);t.deleteTexture(H.__webglTexture);const ye=P.source,Q=p.get(ye);delete Q[H.__cacheKey],o.memory.textures--}function F(P){const H=P.texture,ye=n.get(P),Q=n.get(H);if(Q.__webglTexture!==void 0&&(t.deleteTexture(Q.__webglTexture),o.memory.textures--),P.depthTexture&&P.depthTexture.dispose(),P.isWebGLCubeRen
3589derTarget)for(let Be=0;Be<6;Be++){if(Array.isArray(ye.__webglFramebuffer[Be]))for(let Le=0;Le<ye.__webglFramebuffer[Be].length;Le++)t.deleteFramebuffer(ye.__webglFramebuffer[Be][Le]);else t.deleteFramebuffer(ye.__webglFramebuffer[Be]);ye.__webglDepthbuffer&&t.deleteRenderbuffer(ye.__webglDepthbuffer[Be])}else{if(Array.isArray(ye.__webglFramebuffer))for(let Be=0;Be<ye.__webglFramebuffer.length;Be++)t.deleteFramebuffer(ye.__webglFramebuffer[Be]);else t.deleteFramebuffer(ye.__webglFramebuffer);if(ye.__webglDepthbuffer&&t.deleteRenderbuffer(ye.__webglDepthbuffer),ye.__webglMultisampledFramebuffer&&t.deleteFramebuffer(ye.__webglMultisampledFramebuffer),ye.__webglColorRenderbuffer)for(let Be=0;Be<ye.__webglColorRenderbuffer.length;Be++)ye.__webglColorRenderbuffer[Be]&&t.deleteRenderbuffer(ye.__webglColorRenderbuffer[Be]);ye.__webglDepthRenderbuffer&&t.deleteRenderbuffer(ye.__webglDepthRenderbuffer)}if(P.isWebGLMultipleRenderTargets)for(let Be=0,Le=H.length;Be<Le;Be++){const Ke=n.get(H[Be]);Ke.__webglTexture&&(t.deleteTexture(Ke.__webglTexture),o.memory.textures--),n.remove(H[Be])}n.remove(H),n.remove(P)}let Y=0;function D(){Y=0}function U(){const P=Y;return P>=c&&console.warn("THREE.WebGLTextures: Trying to use "+P+" texture units while this GPU supports only "+c),Y+=1,P}function j(P){const H=[];return H.push(P.wrapS),H.push(P.wrapT),H.push(P.wrapR||0),H.push(P.magFilter),H.push(P.minFilter),H.push(P.anisotropy),H.push(P.internalFormat),H.push(P.format),H.push(P.type),H.push(P.generateMipmaps),H.push(P.premultiplyAlpha),H.push(P.flipY),H.push(P.unpackAlignment),H.push(P.colorSpace),H.join()}function J(P,H){const ye=n.get(P);if(P.isVideoTexture&&Ve(P),P.isRenderTargetTexture===!1&&P.version>0&&ye.__version!==P.version){const Q=P.image;if(Q===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Q.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{N(ye,P,H);return}}r.bindTexture(t.TEXTURE_2D,ye.__webglTexture,t.TEXTURE0+H)}function z(P,H){const ye=n.get(P);if(P.version>0&&ye.__version!==P.version){N(ye,P,H);return}r.bindTexture(t.TEXTURE_2D_ARRAY,ye.__webglTexture,t.TEXTURE0+H)}function $(P,H){const ye=n.get(P);if(P.version>0&&ye.__version!==P.version){N(ye,P,H);return}r.bindTexture(t.TEXTURE_3D,ye.__webglTexture,t.TEXTURE0+H)}function te(P,H){const ye=n.get(P);if(P.version>0&&ye.__version!==P.version){k(ye,P,H);return}r.bindTexture(t.TEXTURE_CUBE_MAP,ye.__webglTexture,t.TEXTURE0+H)}const ae={[py]:t.REPEAT,[Ha]:t.CLAMP_TO_EDGE,[rD]:t.MIRRORED_REPEAT},ve={[Ua]:t.NEAREST,[b3]:t.NEAREST_MIPMAP_NEAREST,[ZM]:t.NEAREST_MIPMAP_LINEAR,[pa]:t.LINEAR,[H$]:t.LINEAR_MIPMAP_NEAREST,[Zg]:t.LINEAR_MIPMAP_LINEAR},oe={[J$]:t.NEVER,[aee]:t.ALWAYS,[$$]:t.LESS,[tee]:t.LEQUAL,[eee]:t.EQUAL,[nee]:t.GEQUAL,[iee]:t.GREATER,[ree]:t.NOTEQUAL};function K(P,H,ye){if(ye?(t.texParameteri(P,t.TEXTURE_WRAP_S,ae[H.wrapS]),t.texParameteri(P,t.TEXTURE_WRAP_T,ae[H.wrapT]),(P===t.TEXTURE_3D||P===t.TEXTURE_2D_ARRAY)&&t.texParameteri(P,t.TEXTURE_WRAP_R,ae[H.wrapR]),t.texParameteri(P,t.TEXTURE_MAG_FILTER,ve[H.magFilter]),t.texParameteri(P,t.TEXTURE_MIN_FILTER,ve[H.minFilter])):(t.texParameteri(P,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(P,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),(P===t.TEXTURE_3D||P===t.TEXTURE_2D_ARRAY)&&t.texParameteri(P,t.TEXTURE_WRAP_R,t.CLAMP_TO_EDGE),(H.wrapS!==Ha||H.wrapT!==Ha)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(P,t.TEXTURE_MAG_FILTER,C(H.magFilter)),t.texParameteri(P,t.TEXTURE_MIN_FILTER,C(H.minFilter)),H.minFilter!==Ua&&H.minFilter!==pa&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),H.compareFunction&&(t.texParameteri(P,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(P,t.TEXTURE_COMPARE_FUNC,oe[H.compareFunction])),i.has("EXT_texture_filter_anisotropic")===!0){const Q=i.get("EXT_texture_filter_anisotropic");
3589if(H.magFilter===Ua||H.minFilter!==ZM&&H.minFilter!==Zg||H.type===rc&&i.has("OES_texture_float_linear")===!1||l===!1&&H.type===yu&&i.has("OES_texture_half_float_linear")===!1)return;(H.anisotropy>1||n.get(H).__currentAnisotropy)&&(t.texParameterf(P,Q.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(H.anisotropy,a.getMaxAnisotropy())),n.get(H).__currentAnisotropy=H.anisotropy)}}function X(P,H){let ye=!1;P.__webglInit===void 0&&(P.__webglInit=!0,H.addEventListener("dispose",x));const Q=H.source;let Be=p.get(Q);Be===void 0&&(Be={},p.set(Q,Be));const Le=j(H);if(Le!==P.__cacheKey){Be[Le]===void 0&&(Be[Le]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,ye=!0),Be[Le].usedTimes++;const Ke=Be[P.__cacheKey];Ke!==void 0&&(Be[P.__cacheKey].usedTimes--,Ke.usedTimes===0&&I(H)),P.__cacheKey=Le,P.__webglTexture=Be[Le].texture}return ye}function N(P,H,ye){let Q=t.TEXTURE_2D;(H.isDataArrayTexture||H.isCompressedArrayTexture)&&(Q=t.TEXTURE_2D_ARRAY),H.isData3DTexture&&(Q=t.TEXTURE_3D);const Be=X(P,H),Le=H.source;r.bindTexture(Q,P.__webglTexture,t.TEXTURE0+ye);const Ke=n.get(Le);if(Le.version!==Ke.__version||Be===!0){r.activeTexture(t.TEXTURE0+ye);
3589const Re=vr.getPrimaries(vr.workingColorSpace),Xe=H.colorSpace===Io?null:vr.getPrimaries(H.colorSpace),fe=H.colorSpace===Io||Re===Xe?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,H.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,H.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,fe);const Ge=b(H)&&w(H.image)===!1;let Pe=y(H.image,Ge,!1,u);Pe=se(H,Pe);const rt=w(Pe)||l,Ze=s.convert(H.format,H.colorSpace);let pt=s.convert(H.type),At=S(H.internalFormat,Ze,pt,H.colorSpace,H.isVideoTexture);K(Q,H,rt);let Se;const xe=H.mipmaps,de=l&&H.isVideoTexture!==!0,Qe=Ke.__version===void 0||Be===!0,We=T(H,Pe,rt);if(H.isDepthTexture)At=t.DEPTH_COMPONENT,l?H.type===rc?At=t.DEPTH_COMPONENT32F:H.type===Xd?At=t.DEPTH_COMPONENT24:H.type===Yf?At=t.DEPTH24_STENCIL8:At=t.DEPTH_COMPONENT16:H.type===rc&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),H.format===Kf&&At===t.DEPTH_COMPONENT&&H.type!==TO&&H.type!==Xd&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),H.type=Xd,pt=s.convert(H.type)),H.format===Jg&&At===t.DEPTH_COMPONENT&&(At=t.DEPTH_STENCIL,H.type!==Yf&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),H.type=Yf,pt=s.convert(H.type))),Qe&&(de?r.texStorage2D(t.TEXTURE_2D,1,At,Pe.width,Pe.height):r.texImage2D(t.TEXTURE_2D,0,At,Pe.width,Pe.height,0,Ze,pt,null));else if(H.isDataTexture)if(xe.length>0&&rt){de&&Qe&&r.texStorage2D(t.TEXTURE_2D,We,At,xe[0].width,xe[0].height);for(let He=0,ct=xe.length;He<ct;He++)Se=xe[He],de?r.texSubImage2D(t.TEXTURE_2D,He,0,0,Se.width,Se.height,Ze,pt,Se.data):r.texImage2D(t.TEXTURE_2D,He,At,Se.width,Se.height,0,Ze,pt,Se.data);H.generateMipmaps=!1}else de?(Qe&&r.texStorage2D(t.TEXTURE_2D,We,At,Pe.width,Pe.height),r.texSubImage2D(t.TEXTURE_2D,0,0,0,Pe.width,Pe.height,Ze,pt,Pe.data)):r.texImage2D(t.TEXTURE_2D,0,At,Pe.width,Pe.height,0,Ze,pt,Pe.data);else if(H.isCompressedTexture)if(H.isCompressedArrayTexture){de&&Qe&&r.texStorage3D(t.TEXTURE_2D_ARRAY,We,At,xe[0].width,xe[0].height,Pe.depth);for(let He=0,ct=xe.length;He<ct;He++)Se=xe[He],H.format!==ol?Ze!==null?de?r.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,He,0,0,0,Se.width,Se.height,Pe.depth,Ze,Se.data,0,0):r.compressedTexImage3D(t.TEXTURE_2D_ARRAY,He,At,Se.width,Se.height,Pe.depth,0,Se.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):de?r.texSubImage3D(t.TEXTURE_2D_ARRAY,He,0,0,0,Se.width,Se.height,Pe.depth,Ze,pt,Se.data):r.texImage3D(t.TEXTURE_2D_ARRAY,He,At,Se.width,Se.height,Pe.depth,0,Ze,pt,Se.data)}else{de&&Qe&&r.texStorage2D(t.TEXTURE_2D,We,At,xe[0].width,xe[0].height);for(let He=0,ct=xe.length;He<ct;He++)Se=xe[He],H.format!==ol?Ze!==null?de?r.compressedTexSubImage2D(t.TEXTURE_2D,He,0,0,Se.width,Se.height,Ze,Se.data):r.compressedTexImage2D(t.TEXTURE_2D,He,At,Se.width,Se.height,0,Se.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):de?r.texSubImage2D(t.TEXTURE_2D,He,0,0,Se.width,Se.height,Ze,pt,Se.data):r.texImage2D(t.TEXTURE_2D,He,At,Se.width,Se.height,0,Ze,pt,Se.data)}else if(H.isDataArrayTexture)de?(Qe&&r.texStorage3D(t.TEXTURE_2D_ARRAY,We,At,Pe.width,Pe.height,Pe.depth),r.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Pe.width,Pe.height,Pe.depth,Ze,pt,Pe.data)):r.texImage3D(t.TEXTURE_2D_ARRAY,0,At,Pe.width,Pe.height,Pe.depth,0,Ze,pt,Pe.data);else if(H.isData3DTexture)de?(Qe&&r.texStorage3D(t.TEXTURE_3D,We,At,Pe.width,Pe.height,Pe.depth),r.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Pe.width,Pe.height,Pe.depth,Ze,pt,Pe.data)):r.texImage3D(t.TEXTURE_3D,0,At,Pe.width,Pe.height,Pe.depth,0,Ze,pt,Pe.data);else if(H.isFramebufferTexture){if(Qe)if(de)r.texStorage2D(t.TEXTURE_2D,We,At,Pe.width,Pe.height);else{let He=Pe.width,ct=Pe.height;for(let St=0;St<We;St++)r.texImage2D(t.TEXTURE_2D,St,At,He,ct,0,Ze,pt,null),He>>=1,ct>>=1}}else if(xe.length>0&&rt){de&&Qe&&r.texStorage2D(t.TEXTURE_2D,We,At,xe[0].width,xe[0].height);for(let He=0,ct=xe.length;He<ct;He++)Se=xe[He],de?r.texSubImage2D(t.TEXTURE_2D,He,0,0,Ze,pt,Se):r.texImage2D(t.TEXTURE_2D,He,At,Ze,pt,Se);H.generateMipmaps=!1}else de?(Qe&&r.texStorage2D(t.TEXTURE_2D,We,At,Pe.width,Pe.height),r.texSubImage2D(t.TEXTURE_2D,0,0,0,Ze,pt,Pe)):r.texImage2D(t.TEXTURE_2D,0,At,Ze,pt,Pe);E(H,rt)&&M(Q),Ke.__version=Le.version,H.onUpdate&&H.onUpdate(H)}P.__version=H.version}function k(P,H,ye){if(H.image.length!==6)return;const Q=X(P,H),Be=H.source;r.bindTexture(t.TEXTURE_CUBE_MAP,P.__webglTexture,t.TEXTURE0+ye);const Le=n.get(Be);
3589if(Be.version!==Le.__version||Q===!0){r.activeTexture(t.TEXTURE0+ye);const Ke=vr.getPrimaries(vr.workingColorSpace),Re=H.colorSpace===Io?null:vr.getPrimaries(H.colorSpace),Xe=H.colorSpace===Io||Ke===Re?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,H.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,H.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,Xe);const fe=H.isCompressedTexture||H.image[0].isCompressedTexture,Ge=H.image[0]&&H.image[0].isDataTexture,Pe=[];for(let He=0;He<6;He++)!fe&&!Ge?Pe[He]=y(H.image[He],!1,!0,h):Pe[He]=Ge?H.image[He].image:H.image[He],Pe[He]=se(H,Pe[He]);const rt=Pe[0],Ze=w(rt)||l,pt=s.convert(H.format,H.colorSpace),At=s.convert(H.type),Se=S(H.internalFormat,pt,At,H.colorSpace),xe=l&&H.isVideoTexture!==!0,de=Le.__version===void 0||Q===!0;let Qe=T(H,rt,Ze);K(t.TEXTURE_CUBE_MAP,H,Ze);let We;if(fe){xe&&de&&r.texStorage2D(t.TEXTURE_CUBE_MAP,Qe,Se,rt.width,rt.height);for(let He=0;He<6;He++){We=Pe[He].mipmaps;for(let ct=0;ct<We.length;ct++){const St=We[ct];H.format!==ol?pt!==null?xe?r.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct,0,0,St.width,St.height,pt,St.data):r.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct,Se,St.width,St.height,0,St.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):xe?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct,0,0,St.width,St.height,pt,At,St.data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct,Se,St.width,St.height,0,pt,At,St.data)}}}else{We=H.mipmaps,xe&&de&&(We.length>0&&Qe++,r.texStorage2D(t.TEXTURE_CUBE_MAP,Qe,Se,Pe[0].width,Pe[0].height));for(let He=0;He<6;He++)if(Ge){xe?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,0,0,Pe[He].width,Pe[He].height,pt,At,Pe[He].data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,Se,Pe[He].width,Pe[He].height,0,pt,At,Pe[He].data);for(let ct=0;ct<We.length;ct++){const si=We[ct].image[He].image;xe?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct+1,0,0,si.width,si.height,pt,At,si.data):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct+1,Se,si.width,si.height,0,pt,At,si.data)}}else{xe?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,0,0,pt,At,Pe[He]):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,0,Se,pt,At,Pe[He]);for(let ct=0;ct<We.length;ct++){const St=We[ct];xe?r.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct+1,0,0,pt,At,St.image[He]):r.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+He,ct+1,Se,pt,At,St.image[He])}}}E(H,Ze)&&M(t.TEXTURE_CUBE_MAP),Le.__version=Be.version,H.onUpdate&&H.onUpdate(H)}P.__version=H.version}function Z(P,H,ye,Q,Be,Le){const Ke=s.convert(ye.format,ye.colorSpace),Re=s.convert(ye.type),Xe=S(ye.internalFormat,Ke,Re,ye.colorSpace);if(!n.get(H).__hasExternalTextures){const Ge=Math.max(1,H.width>>Le),Pe=Math.max(1,H.height>>Le);Be===t.TEXTURE_3D||Be===t.TEXTURE_2D_ARRAY?r.texImage3D(Be,Le,Xe,Ge,Pe,H.depth,0,Ke,Re,null):r.texImage2D(Be,Le,Xe,Ge,Pe,0,Ke,Re,null)}r.bindFramebuffer(t.FRAMEBUFFER,P),De(H)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Q,Be,n.get(ye).__webglTexture,0,le(H)):(Be===t.TEXTURE_2D||Be>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Be<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Q,Be,n.get(ye).__webglTexture,Le),r.bindFramebuffer(t.FRAMEBUFFER,null)}function V(P,H,ye){if(t.bindRenderbuffer(t.RENDERBUFFER,P),H.depthBuffer&&!H.stencilBuffer){let Q=l===!0?t.DEPTH_COMPONENT24:t.DEPTH_COMPONENT16;if(ye||De(H)){const Be=H.depthTexture;Be&&Be.isDepthTexture&&(Be.type===rc?Q=t.DEPTH_COMPONENT32F:Be.type===Xd&&(Q=t.DEPTH_COMPONENT24));const Le=le(H);De(H)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Le,Q,H.width,H.height):t.renderbufferStorageMultisample(t.RENDERBUFFER,Le,Q,H.width,H.height)}else t.renderbufferStorage(t.RENDERBUFFER,Q,H.width,H.height);t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,P)}else if(H.depthBuffer&&H.stencilBuffer){const Q=le(H);ye&&De(H)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,Q,t.DEPTH24_STENCIL8,H.width,H.height):De(H)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,Q,t.DEPTH24_STENCIL8,H.width,H.height):t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,H.width,H.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,P)}else{const Q=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let Be=0;Be<Q.length;Be++){const Le=Q[Be],Ke=s.convert(Le.format,Le.colorSpace),Re=s.convert(Le.type),Xe=S(Le.internalFormat,Ke,Re,Le.colorSpace),fe=le(H);ye&&De(H)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,fe,Xe,H.width,H.height):De(H)?A.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,fe,Xe,H.width,H.height):t.renderbufferStorage(t.RENDERBUFFER,Xe,H.width,H.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}
3589function re(P,H){if(H&&H.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(t.FRAMEBUFFER,P),!(H.depthTexture&&H.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(H.depthTexture).__webglTexture||H.depthTexture.image.width!==H.width||H.depthTexture.image.height!==H.height)&&(H.depthTexture.image.width=H.width,H.depthTexture.image.height=H.height,H.depthTexture.needsUpdate=!0),J(H.depthTexture,0);const Q=n.get(H.depthTexture).__webglTexture,Be=le(H);if(H.depthTexture.format===Kf)De(H)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Q,0,Be):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Q,0);else if(H.depthTexture.format===Jg)De(H)?A.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Q,0,Be):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Q,0);else throw new Error("Unknown depthTexture format")}function Ae(P){const H=n.get(P),ye=P.isWebGLCubeRenderTarget===!0;if(P.depthTexture&&!H.__autoAllocateDepthBuffer){if(ye)throw new Error("target.depthTexture not supported in Cube render targets");re(H.__webglFramebuffer,P)}else if(ye){H.__webglDepthbuffer=[];for(let Q=0;Q<6;Q++)r.bindFramebuffer(t.FRAMEBUFFER,H.__webglFramebuffer[Q]),H.__webglDepthbuffer[Q]=t.createRenderbuffer(),V(H.__webglDepthbuffer[Q],P,!1)}else r.bindFramebuffer(t.FRAMEBUFFER,H.__webglFramebuffer),H.__webglDepthbuffer=t.createRenderbuffer(),V(H.__webglDepthbuffer,P,!1);r.bindFramebuffer(t.FRAMEBUFFER,null)}function pe(P,H,ye){const Q=n.get(P);H!==void 0&&Z(Q.__webglFramebuffer,P,P.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),ye!==void 0&&Ae(P)}function ce(P){const H=P.texture,ye=n.get(P),Q=n.get(H);P.addEventListener("dispose",R),P.isWebGLMultipleRenderTargets!==!0&&(Q.__webglTexture===void 0&&(Q.__webglTexture=t.createTexture()),Q.__version=H.version,o.memory.textures++);const Be=P.isWebGLCubeRenderTarget===!0,Le=P.isWebGLMultipleRenderTargets===!0,Ke=w(P)||l;if(Be){ye.__webglFramebuffer=[];for(let Re=0;Re<6;Re++)if(l&&H.mipmaps&&H.mipmaps.length>0){ye.__webglFramebuffer[Re]=[];for(let Xe=0;Xe<H.mipmaps.length;Xe++)ye.__webglFramebuffer[Re][Xe]=t.createFramebuffer()}else ye.__webglFramebuffer[Re]=t.createFramebuffer()}else{if(l&&H.mipmaps&&H.mipmaps.length>0){ye.__webglFramebuffer=[];for(let Re=0;Re<H.mipmaps.length;Re++)ye.__webglFramebuffer[Re]=t.createFramebuffer()}else ye.__webglFramebuffer=t.createFramebuffer();if(Le)if(a.drawBuffers){const Re=P.texture;for(let Xe=0,fe=Re.length;Xe<fe;Xe++){const Ge=n.get(Re[Xe]);Ge.__webglTexture===void 0&&(Ge.__webglTexture=t.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(l&&P.samples>0&&De(P)===!1){const Re=Le?H:[H];ye.__webglMultisampledFramebuffer=t.createFramebuffer(),ye.__webglColorRenderbuffer=[],r.bindFramebuffer(t.FRAMEBUFFER,ye.__webglMultisampledFramebuffer);for(let Xe=0;Xe<Re.length;Xe++){const fe=Re[Xe];ye.__webglColorRenderbuffer[Xe]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,ye.__webglColorRenderbuffer[Xe]);const Ge=s.convert(fe.format,fe.colorSpace),Pe=s.convert(fe.type),rt=S(fe.internalFormat,Ge,Pe,fe.colorSpace,P.isXRRenderTarget===!0),Ze=le(P);t.renderbufferStorageMultisample(t.RENDERBUFFER,Ze,rt,P.width,P.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+Xe,t.RENDERBUFFER,ye.__webglColorRenderbuffer[Xe])}t.bindRenderbuffer(t.RENDERBUFFER,null),P.depthBuffer&&(ye.__webglDepthRenderbuffer=t.createRenderbuffer(),V(ye.__webglDepthRenderbuffer,P,!0)),r.bindFramebuffer(t.FRAMEBUFFER,null)}}if(Be){r.bindTexture(t.TEXTURE_CUBE_MAP,Q.__webglTexture),K(t.TEXTURE_CUBE_MAP,H,Ke);for(let Re=0;Re<6;Re++)if(l&&H.mipmaps&&H.mipmaps.length>0)for(let Xe=0;Xe<H.mipmaps.length;Xe++)Z(ye.__webglFramebuffer[Re][Xe],P,H,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Re,Xe);else Z(ye.__webglFramebuffer[Re],P,H,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+Re,0);E(H,Ke)&&M(t.TEXTURE_CUBE_MAP),r.unbindTexture()}else if(Le){const Re=P.texture;for(let Xe=0,fe=Re.length;Xe<fe;Xe++){const Ge=Re[Xe],Pe=n.get(Ge);r.bindTexture(t.TEXTURE_2D,Pe.__webglTexture),K(t.TEXTURE_2D,Ge,Ke),Z(ye.__webglFramebuffer,P,Ge,t.COLOR_ATTACHMENT0+Xe,t.TEXTURE_2D,0),E(Ge,Ke)&&M(t.TEXTURE_2D)}r.unbindTexture()}else{let Re=t.TEXTURE_2D;if((P.isWebGL3DRenderTarget||P.isWebGLArrayRenderTarget)&&(l?Re=P.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),r.bindTexture(Re,Q.__webglTexture),K(Re,H,Ke),l&&H.mipmaps&&H.mipmaps.length>0)for(let Xe=0;Xe<H.mipmaps.length;Xe++)Z(ye.__webglFramebuffer[Xe],P,H,t.COLOR_ATTACHMENT0,Re,Xe);else Z(ye.__webglFramebuffer,P,H,t.COLOR_ATTACHMENT0,Re,0);E(H,Ke)&&M(Re),r.unbindTexture()}P.depthBuffer&&Ae(P)}function _e(P){const H=w(P)||l,ye=P.isWebGLMultipleRenderTargets===!0?P.texture:[P.texture];for(let Q=0,Be=ye.length;Q<Be;Q++){const Le=ye[Q];
3589if(E(Le,H)){const Ke=P.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:t.TEXTURE_2D,Re=n.get(Le).__webglTexture;r.bindTexture(Ke,Re),M(Ke),r.unbindTexture()}}}function me(P){if(l&&P.samples>0&&De(P)===!1){const H=P.isWebGLMultipleRenderTargets?P.texture:[P.texture],ye=P.width,Q=P.height;let Be=t.COLOR_BUFFER_BIT;const Le=[],Ke=P.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Re=n.get(P),Xe=P.isWebGLMultipleRenderTargets===!0;if(Xe)for(let fe=0;fe<H.length;fe++)r.bindFramebuffer(t.FRAMEBUFFER,Re.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+fe,t.RENDERBUFFER,null),r.bindFramebuffer(t.FRAMEBUFFER,Re.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+fe,t.TEXTURE_2D,null,0);r.bindFramebuffer(t.READ_FRAMEBUFFER,Re.__webglMultisampledFramebuffer),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,Re.__webglFramebuffer);for(let fe=0;fe<H.length;fe++){Le.push(t.COLOR_ATTACHMENT0+fe),P.depthBuffer&&Le.push(Ke);const Ge=Re.__ignoreDepthValues!==void 0?Re.__ignoreDepthValues:!1;if(Ge===!1&&(P.depthBuffer&&(Be|=t.DEPTH_BUFFER_BIT),P.stencilBuffer&&(Be|=t.STENCIL_BUFFER_BIT)),Xe&&t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Re.__webglColorRenderbuffer[fe]),Ge===!0&&(t.invalidateFramebuffer(t.READ_FRAMEBUFFER,[Ke]),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[Ke])),Xe){const Pe=n.get(H[fe]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Pe,0)}t.blitFramebuffer(0,0,ye,Q,0,0,ye,Q,Be,t.NEAREST),f&&t.invalidateFramebuffer(t.READ_FRAMEBUFFER,Le)}if(r.bindFramebuffer(t.READ_FRAMEBUFFER,null),r.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),Xe)for(let fe=0;fe<H.length;fe++){r.bindFramebuffer(t.FRAMEBUFFER,Re.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+fe,t.RENDERBUFFER,Re.__webglColorRenderbuffer[fe]);const Ge=n.get(H[fe]).__webglTexture;r.bindFramebuffer(t.FRAMEBUFFER,Re.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+fe,t.TEXTURE_2D,Ge,0)}r.bindFramebuffer(t.DRAW_FRAMEBUFFER,Re.__webglMultisampledFramebuffer)}}function le(P){return Math.min(d,P.samples)}function De(P){const H=n.get(P);return l&&P.samples>0&&i.has("WEBGL_multisampled_render_to_texture")===!0&&H.__useRenderToTexture!==!1}function Ve(P){const H=o.render.frame;m.get(P)!==H&&(m.set(P,H),P.update())}function se(P,H){const ye=P.colorSpace,Q=P.format,Be=P.type;return P.isCompressedTexture===!0||P.isVideoTexture===!0||P.format===aD||ye!==fc&&ye!==Io&&(vr.getTransfer(ye)===Ur?l===!1?i.has("EXT_sRGB")===!0&&Q===ol?(P.format=aD,P.minFilter=pa,P.generateMipmaps=!1):H=GW.sRGBToLinear(H):(Q!==ol||Be!==vA)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ye)),H}this.allocateTextureUnit=U,this.resetTextureUnits=D,this.setTexture2D=J,this.setTexture2DArray=z,this.setTexture3D=$,this.setTextureCube=te,this.rebindTextures=pe,this.setupRenderTarget=ce,this.updateRenderTargetMipmap=_e,this.updateMultisampleRenderTarget=me,this.setupDepthRenderbuffer=Ae,this.setupFrameBufferTexture=Z,this.useMultisampledRTT=De}function Eae(t,i,r){const n=r.isWebGL2;function a(s,o=Io){let l;const c=vr.getTransfer(o);if(s===vA)return t.UNSIGNED_BYTE;if(s===PW)return t.UNSIGNED_SHORT_4_4_4_4;if(s===LW)return t.UNSIGNED_SHORT_5_5_5_1;if(s===G$)return t.BYTE;if(s===z$)return t.SHORT;if(s===TO)return t.UNSIGNED_SHORT;if(s===DW)return t.INT;if(s===Xd)return t.UNSIGNED_INT;if(s===rc)return t.FLOAT;if(s===yu)return n?t.HALF_FLOAT:(l=i.get("OES_texture_half_float"),l!==null?l.HALF_FLOAT_OES:null);if(s===Q$)return t.ALPHA;if(s===ol)return t.RGBA;if(s===V$)return t.LUMINANCE;if(s===W$)return t.LUMINANCE_ALPHA;if(s===Kf)return t.DEPTH_COMPONENT;if(s===Jg)return t.DEPTH_STENCIL;if(s===aD)return l=i.get("EXT_sRGB"),l!==null?l.SRGB_ALPHA_EXT:null;if(s===OW)return t.RED;if(s===NW)return t.RED_INTEGER;if(s===j$)return t.RG;if(s===UW)return t.RG_INTEGER;if(s===FW)return t.RGBA_INTEGER;if(s===JM||s===$M||s===ex||s===tx)if(c===Ur)if(l=i.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(s===JM)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===$M)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===ex)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===tx)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=i.get("WEBGL_compressed_texture_s3tc"),l!==null){if(s===JM)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===$M)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===ex)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===tx)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===S3||s===C3||s===T3||s===M3)if(l=i.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(s===S3)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===C3)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===T3)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===M3)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Y$)return l=i.get("WEBGL_compressed_texture_etc1"),l!==null?l.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===x3||s===R3)if(l=i.get("WEBGL_compressed_texture_etc"),l!==null){if(s===x3)return c===Ur?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(s===R3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===B3||s===I3||s===D3||s===P3||s===L3||s===O3||s===N3||s===U3||s===F3||s===k3||s===H3||s===G3||s===z3||s===Q3)if(l=i.get("WEBGL_compressed_texture_astc"),l!==null){if(s===B3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===I3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===D3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===P3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===L3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===O3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===N3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===U3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===F3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===k3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===H3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===G3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===z3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===Q3)return c===Ur?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===ix||s===V3||s===W3)if(l=i.get("EXT_texture_compression_bptc"),l!==null){if(s===ix)return c===Ur?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(s===V3)return l.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(s===W3)return l.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(s===K$||s===j3||s===Y3||s===K3)if(l=i.get("EXT_texture_compression_rgtc"),l!==null){if(s===ix)return l.COMPRESSED_RED_RGT
vendor: 10,987 bytes, line 3589
3589C1_EXT;if(s===j3)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===Y3)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===K3)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===Yf?n?t.UNSIGNED_INT_24_8:(l=i.get("WEBGL_depth_texture"),l!==null?l.UNSIGNED_INT_24_8_WEBGL:null):t[s]!==void 0?t[s]:null}return{convert:a}}class wae extends Rr{constructor(i=[]){super(),this.isArrayCamera=!0,this.cameras=i}}class H1 extends $r{constructor(){super(),this.isGroup=!0,this.type="Group"}}const bae={type:"move"};class Cx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new H1,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new H1,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new we,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new we),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new H1,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new we,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new we),this._grip}dispatchEvent(i){return this._targetRay!==null&&this._targetRay.dispatchEvent(i),this._grip!==null&&this._grip.dispatchEvent(i),this._hand!==null&&this._hand.dispatchEvent(i),this}connect(i){if(i&&i.hand){const r=this._hand;if(r)for(const n of i.hand.values())this._getHandJoint(r,n)}return this.dispatchEvent({type:"connected",data:i}),this}disconnect(i){return this.dispatchEvent({type:"disconnected",data:i}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(i,r,n){let a=null,s=null,o=null;const l=this._targetRay,c=this._grip,h=this._hand;if(i&&r.session.visibilityState!=="visible-blurred"){if(h&&i.hand){o=!0;for(const g of i.hand.values()){const p=r.getJointPose(g,n),v=this._getHandJoint(h,g);p!==null&&(v.matrix.fromArray(p.transform.matrix),v.matrix.decompose(v.position,v.rotation,v.scale),v.matrixWorldNeedsUpdate=!0,v.jointRadius=p.radius),v.visible=p!==null}const u=h.joints["index-finger-tip"],d=h.joints["thumb-tip"],A=u.position.distanceTo(d.position),f=.02,m=.005;h.inputState.pinching&&A>f+m?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:i.handedness,target:this})):!h.inputState.pinching&&A<=f-m&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:i.handedness,target:this}))}else c!==null&&i.gripSpace&&(s=r.getPose(i.gripSpace,n),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));l!==null&&(a=r.getPose(i.targetRaySpace,n),a===null&&s!==null&&(a=s),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1,this.dispatchEvent(bae)))}return l!==null&&(l.visible=a!==null),c!==null&&(c.visible=s!==null),h!==null&&(h.visible=o!==null),this}_getHandJoint(i,r){if(i.joints[r.jointName]===void 0){const n=new H1;n.matrixAutoUpdate=!1,n.visible=!1,i.joints[r.jointName]=n,i.add(n)}return i.joints[r.jointName]}}class Sae extends ps{constructor(i,r,n,a,s,o,l,c,h,u){if(u=u!==void 0?u:Kf,u!==Kf&&u!==Jg)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===Kf&&(n=Xd),n===void 0&&u===Jg&&(n=Yf),super(null,a,s,o,l,c,u,n,h),this.isDepthTexture=!0,this.image={width:i,height:r},this.magFilter=l!==void 0?l:Ua,this.minFilter=c!==void 0?c:Ua,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(i){return super.copy(i),this.compareFunction=i.compareFunction,this}toJSON(i){const r=super.toJSON(i);return this.compareFunction!==null&&(r.compareFunction=this.compareFunction),r}}class Cae extends Tp{constructor(i,r){super();const n=this;let a=null,s=1,o=null,l="local-floor",c=1,h=null,u=null,d=null,A=null,f=null,m=null;const g=r.getContextAttributes();let p=null,v=null;const _=[],y=[],w=new Rr;w.layers.enable(1),w.viewport=new Yr;const b=new Rr;b.layers.enable(2),b.viewport=new Yr;const E=[w,b],M=new wae;M.layers.enable(1),M.layers.enable(2);let S=null,T=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(z){let $=_[z];return $===void 0&&($=new Cx,_[z]=$),$.getTargetRaySpace()},this.getControllerGrip=function(z){let $=_[z];return $===void 0&&($=new Cx,_[z]=$),$.getGripSpace()},this.getHand=function(z){let $=_[z];return $===void 0&&($=new Cx,_[z]=$),$.getHandSpace()};function C(z){const $=y.indexOf(z.inputSource);if($===-1)return;const te=_[$];te!==void 0&&(te.update(z.inputSource,z.frame,h||o),te.dispatchEvent({type:z.type,data:z.inputSource}))}function x(){a.removeEventListener("select",C),a.removeEventListener("selectstart",C),a.removeEventListener("selectend",C),a.removeEventListener("squeeze",C),a.removeEventListener("squeezestart",C),a.removeEventListener("squeezeend",C),a.removeEventListener("end",x),a.removeEventListener("inputsourceschange",R);for(let z=0;z<_.length;z++){const $=y[z];$!==null&&(y[z]=null,_[z].disconnect($))}S=null,T=null,i.setRenderTarget(p),f=null,A=null,d=null,a=null,v=null,J.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(z){s=z,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(z){l=z,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return h||o},this.setReferenceSpace=function(z){h=z},this.getBaseLayer=function(){return A!==null?A:f},this.getBinding=function(){return d},this.getFrame=function(){return m},this.getSession=function(){return a},this.setSession=async function(z){if(a=z,a!==null){if(p=i.getRenderTarget(),a.addEventListener("select",C),a.addEventListener("selectstart",C),a.addEventListener("selectend",C),a.addEventListener("squeeze",C),a.addEventListener("squeezestart",C),a.addEventListener("squeezeend",C),a.addEventListener("end",x),a.addEventListener("inputsourceschange",R),g.xrCompatible!==!0&&await r.makeXRCompatible(),a.renderState.layers===void 0||i.capabilities.isWebGL2===!1){const $={antialias:a.renderState.layers===void 0?g.antialias:!0,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:s};f=new XRWebGLLayer(a,r,$),a.updateRenderState({baseLayer:f}),v=new ap(f.framebufferWidth,f.framebufferHeight,{format:ol,type:vA,colorSpace:i.outputColorSpace,stencilBuffer:g.stencil})}else{let $=null,te=null,ae=null;g.depth&&(ae=g.stencil?r.DEPTH24_STENCIL8:r.DEPTH_COMPONENT24,$=g.stencil?Jg:Kf,te=g.stencil?Yf:Xd);const ve={colorFormat:r.RGBA8,depthFormat:ae,scaleFactor:s};d=new XRWebGLBinding(a,r),A=d.createProjectionLayer(ve),a.updateRenderState({layers:[A]}),v=new ap(A.textureWidth,A.textureHeight,{format:ol,type:vA,depthTexture:new Sae(A.textureWidth,A.textureHeight,te,void 0,void 0,void 0,void 0,void 0,void 0,$),stencilBuffer:g.stencil,colorSpace:i.outputColorSpace,samples:g.antialias?4:0});const oe=i.properties.get(v);oe.__ignoreDepthValues=A.ignoreDepthValues}v.isXRRenderTarget=!0,this.setFoveation(c),h=null,o=await a.requestReferenceSpace(l),J.setContext(a),J.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(a!==null)return a.environmentBlendMode};function R(z){for(let $=0;$<z.removed.length;$++){const te=z.removed[$],ae=y.indexOf(te);ae>=0&&(y[ae]=null,_[ae].disconnect(te))}for(let $=0;$<z.added.length;$++){const te=z.added[$];let ae=y.indexOf(te);if(ae===-1){for(let oe=0;oe<_.length;oe++)if(oe>=y.length){y.push(te),ae=oe;break}else if(y[oe]===null){y[oe]=te,ae=oe;break}if(ae===-1)break}const ve=_[ae];ve&&ve.connect(te)}}const L=new we,I=new we;function F(z,$,te){L.setFromMatrixPosition($.matrixWorld),I.setFromMatrixPosition(te.matrixWorld);const ae=L.distanceTo(I),ve=$.projectionMatrix.elements,oe=te.projectionMatrix.elements,K=ve[14]/(ve[10]-1),X=ve[14]/(ve[10]+1),N=(ve[9]+1)/ve[5],k=(ve[9]-1)/ve[5],Z=(ve[8]-1)/ve[0],V=(oe[8]+1)/oe[0],re=K*Z,Ae=K*V,pe=ae/(-Z+V),ce=pe*-Z;$.matrixWorld.decompose(z.position,z.quaternion,z.scale),z.translateX(ce),z.translateZ(pe),z.matrixWorld.compose(z.position,z.quaternion,z.scale),z.matrixWorldInverse.copy(z.matrixWorld).invert();const _e=K+pe,me=X+pe,le=re-ce,De=Ae+(ae-ce),Ve=N*X/me*_e,se=k*X/me*_e;z.projectionMatrix.makePerspective(le,De,Ve,se,_e,me),z.projectionMatrixInverse.copy(z.projectionMatrix).invert()}function Y(z,$){$===null?z.matrixWorld.copy(z.matrix):z.matrixWorld.multiplyMatrices($.matrixWorld,z.matrix),z.matrixWorldInverse.copy(z.matrixWorld).invert()}this.updateCamera=function(z){if(a===null)return;M.near=b.near=w.near=z.near,M.far=b.far=w.far=z.far,(S!==M.near||T!==M.far)&&(a.updateRenderState({depthNear:M.near,depthFar:M.far}),S=M.near,T=M.far);const $=z.parent,te=M.cameras;Y(M,$);for(let ae=0;ae<te.length;ae++)Y(te[ae],$);te.length===2?F(M,w,b):M.projectionMatrix.copy(w.projectionMatrix),D(z,M,$)};function D(z,$,te){te===null?z.matrix.copy($.matrixWorld):(z.matrix.copy(te.matrixWorld),z.matrix.invert(),z.matrix.multiply($.matrixWorld)),z.matrix.decompose(z.position,z.quaternion,z.scale),z.updateMatrixWorld(!0),z.projectionMatrix.copy($.projectionMatrix),z.projectionMatrixInverse.copy($.projectionMatrixInverse),z.isPerspectiveCamera&&(z.fov=$g*2*Math.atan(1/z.projectionMatrix.elements[5]),z.zoom=1)}this.getCamera=function(){return M},this.getFoveation=function(){if(!(A===null&&f===null))return c},this.setFoveation=function(z){c=z,A!==null&&(A.fixedFoveation=z),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=z)};let U=null;function j(z,$){if(u=$.getViewerPose(h||o),m=$,u!==null){const te=u.views;f!==null&&(i.setRenderTargetFramebuffer(v,f.framebuffer),i.setRenderTarget(v));let ae=!1;te.length!==M.cameras.length&&(M.cameras.length=0,ae=!0);for(let ve=0;ve<te.length;ve++){const oe=te[ve];let K=null;if(f!==null)K=f.getViewport(oe);else{const N=d.getViewSubImage(A,oe);K=N.viewport,ve===0&&(i.setRenderTargetTextures(v,N.colorTexture,A.ignoreDepthValues?void 0:N.depthStencilTexture),i.setRenderTarget(v))}let X=E[ve];X===void 0&&(X=new Rr,X.layers.enable(ve),X.viewport=new Yr,E[ve]=X),X.matrix.fromArray(oe.transform.matrix),X.matrix.decompose(X.position,
3589X.quaternion,X.scale),X.projectionMatrix.fromArray(oe.projectionMatrix),X.projectionMatrixInverse.copy(X.projectionMatrix).invert(),X.viewport.set(K.x,K.y,K.width,K.height),ve===0&&(M.matrix.copy(X.matrix),M.matrix.decompose(M.position,M.quaternion,M.scale)),ae===!0&&M.cameras.push(X)}}for(let te=0;te<_.length;te++){const ae=y[te],ve=_[te];ae!==null&&ve!==void 0&&ve.update(ae,$,h||o)}U&&U(z,$),$.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:$}),m=null}const J=new qW;J.setAnimationLoop(j),this.setAnimationLoop=function(z){U=z},this.dispose=function(){}}}function Tae(t,i){function r(p,v){p.matrixAutoUpdate===!0&&p.updateMatrix(),v.value.copy(p.matrix)}function n(p,v){v.color.getRGB(p.fogColor.value,YW(t)),v.isFog?(p.fogNear.value=v.near,p.fogFar.value=v.far):v.isFogExp2&&(p.fogDensity.value=v.density)}function a(p,v,_,y,w){v.isMeshBasicMaterial||v.isMeshLambertMaterial?s(p,v):v.isMeshToonMaterial?(s(p,v),d(p,v)):v.isMeshPhongMaterial?(s(p,v),u(p,v)):v.isMeshStandardMaterial?(s(p,v),A(p,v),v.isMeshPhysicalMaterial&&f(p,v,w)):v.isMeshMatcapMaterial?(s(p,v),m(p,v)):v.isMeshDepthMaterial?s(p,v):v.isMeshDistanceMaterial?(s(p,v),g(p,v)):v.isMeshNormalMaterial?s(p,v):v.isLineBasicMaterial?(o(p,v),v.isLineDashedMaterial&&l(p,v)):v.isPointsMaterial?c(p,v,_,y):v.isSpriteMaterial?h(p,v):v.isShadowMaterial?(p.color.value.copy(v.color),p.opacity.value=v.opacity):v.isShaderMaterial&&(v.uniformsNeedUpdate=!1)}function s(p,v){p.opacity.value=v.opacity,v.color&&p.diffuse.value.copy(v.color),v.emissive&&p.emissive.value.copy(v.emissive).multiplyScalar(v.emissiveIntensity),v.map&&(p.map.value=v.map,r(v.map,p.mapTransform)),v.alphaMap&&(p.alphaMap.value=v.alphaMap,r(v.alphaMap,p.alphaMapTransform)),v.bumpMap&&(p.bumpMap.value=v.bumpMap,r(v.bumpMap,p.bumpMapTransform),p.bumpScale.value=v.bumpScale,v.side===fs&&(p.bumpScale.value*=-1)),v.normalMap&&(p.normalMap.value=v.normalMap,r(v.normalMap,p.normalMapTransform),p.normalScale.value.copy(v.normalScale),v.side===fs&&p.normalScale.value.negate()),v.displacementMap&&(p.displacementMap.value=v.displacementMap,r(v.displacementMap,p.displacementMapTransform),p.displacementScale.value=v.displacementScale,p.displacementBias.value=v.displacementBias),v.emissiveMap&&(p.emissiveMap.value=v.emissiveMap,r(v.emissiveMap,p.emissiveMapTransform)),v.specularMap&&(p.specularMap.value=v.specularMap,r(v.specularMap,p.specularMapTransform)),v.alphaTest>0&&(p.alphaTest.value=v.alphaTest);const _=i.get(v).envMap;if(_&&(p.envMap.value=_,p.flipEnvMap.value=_.isCubeTexture&&_.isRenderTargetTexture===!1?-1:1,p.reflectivity.value=v.reflectivity,p.ior.value=v.ior,p.refractionRatio.value=v.refractionRatio),v.lightMap){p.lightMap.value=v.lightMap;const y=t._useLegacyLights===!0?Math.PI:1;p.lightMapIntensity.value=v.lightMapIntensity*y,r(v.lightMap,p.lightMapTransform)}v.aoMap&&(p.aoMap.value=v.aoMap,p.aoMapIntensity.value=v.aoMapIntensity,r(v.aoMap,p.aoMapTransform))}function o(p,v){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,v.map&&(p.map.value=v.map,r(v.map,p.mapTransform))}function l(p,v){p.dashSize.value=v.dashSize,p.totalSize.value=v.dashSize+v.gapSize,p.scale.value=v.scale}function c(p,v,_,y){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,p.size.value=v.size*_,p.scale.value=y*.5,v.map&&(p.map.value=v.map,r(v.map,p.uvTransform)),v.alphaMap&&(p.alphaMap.value=v.alphaMap,r(v.alphaMap,p.alphaMapTransform)),v.alphaTest>0&&(p.alphaTest.value=v.alphaTest)}function h(p,v){p.diffuse.value.copy(v.color),p.opacity.value=v.opacity,p.rotation.value=v.rotation,v.map&&(p.map.value=v.map,r(v.map,p.mapTransform)),v.alphaMap&&(p.alphaMap.value=v.alphaMap,r(v.alphaMap,p.alphaMapTransform)),v.alphaTest>0&&(p.alphaTest.value=v.alphaTest)}function u(p,v){p.specular.value.copy(v.specular),p.shininess.value=Math.max(v.shininess,1e-4)}function d(p,v){v.gradientMap&&(p.gradientMap.value=v.gradientMap)}function A(p,v){p.metalness.value=v.metalness,v.metalnessMap&&(p.metalnessMap.value=v.metalnessMap,r(v.metalnessMap,p.metalnessMapTransform)),p.roughness.value=v.roughness,v.roughnessMap&&(p.roughnessMap.value=v.roughnessMap,r(v.roughnessMap,p.roughnessMapTransform)),i.get(v).envMap&&(p.envMapIntensity.value=v.envMapIntensity)}function f(p,v,_){p.ior.value=v.ior,v.sheen>0&&(p.sheenColor.value.copy(v.sheenColor).multiplyScalar(v.sheen),p.sheenRoughness.value=v.sheenRoughness,v.sheenColorMap&&(p.sheenColorMap.value=v.sheenColorMap,r(v.sheenColorMap,p.sheenColorMapTransform)),v.sheenRoughnessMap&&(p.sheenRoughnessMap.value=v.sheenRoughnessMap,r(v.sheenRoughnessMap,p.sheenRoughnessMapTransform))),v.clearcoat>0&&(p.clearcoat.value=v.clearcoat,p.clearcoatRoughness.value=v.clearcoatRoughness,v.clearcoatMap&&(p.clearcoatMap.value=v.clearcoatMap,r(v.clearcoatMap,p.clearcoatMapTransform)),v.clearcoatRoughnessMap&&(p.clearcoatRoughnessMap.value=v.clearcoatRoughnessMap,r(v.clearcoatRoughnessMap,p.clearcoatRoughnessMapTransform)),v.clearcoatNormalMap&&(p.clearcoatNormalMap.value=v.clearcoatNormalMap,r(v.clearcoatNormalMap,p.clearcoatNormalMapTransform),p.clearcoatNormalScale.value.copy(v.clearcoatNormalScale),v.side===fs&&p.clearcoatNormalScale.value.negate())),v.iridescence>0&&(p.iridescence.value=v.iridescence,p.iridescenceIOR.value=v.iridescenceIOR,p.iridescenceThicknessMinimum.value=v.iridescenceThicknessRange[0],p.iridescenceThicknessMaximum.value=v.iridescenceThicknessRange[1],v.iridescenceMap&&(p.iridescenceMap.value=v.iridescenceMap,r(v.iridescenceMap,p.iridescenceMapTransform)),v.iridescenceThicknessMap&&(p.iridescenceThicknessMap.value=v.iridescenceThicknessMap,r(v.iridescenceThicknessMap,p.iridescenceThicknessMapTransform))),v.transmission>0&&(p.transmission.value=v.transmission,p.transmissionSamplerMap.value=_.texture,p.transmissionSamplerSize.value.set(_.width,_.height),v.transmissionMap&&(p.transmissionMap.value=v.transmissionMap,r(v.transmissionMap,p.transmissionMapTransform)),p.thickness.value=v.thickness,v.thicknessMap&&(p.thicknessMap.value=v.thicknessMap,r(v.thicknessMap,p.thicknessMapTransform)),p.attenuationDistance.value=v.attenuationDistance,p.attenuationColor.value.copy(v.attenuationColor)),v.anisotropy>0&&(p.anisotropyVector.value.set(v.anisotropy*Math.cos(v.anisotropyRotation),v.anisotropy*Math.sin(v.anisotropyRotation)),v.anisotropyMap&&(p.anisotropyMap.value=v.anisotropyMap,r(v.anisotropyMap,p.anisotropyMapTransform))),p.specularIntensity.value=v.specularIntensity,p.specularColor.value.copy(v.specularColor),v.specularColorMap&&(p.specularColorMap.value=v.specularColorMap,r(v.specularColorMap,p.specularColorMapTransform)),v.specularIntensityMap&&(p.specularIntensityMap.value=v.specularIntensityMap,r(v.specularIntensityMap,p.specularIntensityMapTransform))}function m(p,v){v.matcap&&(p.matcap.value=v.matcap)}function g(p,v){const _=i.get(v).light;p.referencePosition.value.setFromMatrixPosition(_.matrixWorld),p.nearDistance.value=_.shadow.camera.near,p.farDistance.value=_.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:a}}function Mae(t,i,r,n){let a={},s={},o=[];const l=r.isWebGL2?t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS):0;function c(_,y){const w=y.program;n.uniformBlockBinding(_,w)}function h(_,y){let w=a[_.id];w===void 0&&(m(_),w=u(_),a[_.id]=w,_.addEventListener("dispose",p));const b=y.program;n.updateUBOMapping(_,b);const E=i.render.frame;s[_.id]!==E&&(A(_),s[_.id]=E)}function u(_){const y=d();_.__bindingPointIndex=y;const w=t.createBuffer(),b=_.__size,E=_.usage;return t.bindBuffer(t.UNIFORM_BUFFER,w),t.bufferData(t.UNIFORM_BUFFER,b,E),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,y,w),w}function d(){for(let _=0;_<l;_++)if(o.indexOf(_)===-1)return o.push(_),_;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function A(_){const y=a[_.id],w=_.uniforms,b=_.__cache;t.bindBuffer(t.UNIFORM_BUFFER,y);for(let E=0,M=w.length;E<M;E++){const S=w[E];if(f(S,E,b)===!0){const T=S.__offset,C=Array.isArray(S.value)?S.value:[S.value];let x=0;for(let R=0;R<C.length;R++){const L=C[R],I=g(L);typeof L=="number"?(S.__data[0]=L,t.bufferSubData(t.UNIFORM_BUFFER,T+x,S.__data)):L.isMatrix3?(S.__data[0]=L.elements[0],S.__data[1]=L.elements[1],S.__data[2]=L.elements[2],S.__data[3]=L.elements[0],S.__data[4]=L.elements[3],S.__data[5]=L.elements[4],S.__data[6]=L.elements[5],S.__data[7]=L.elements[0],S.__data[8]=L.elements[6],S.__data[9]=L.elements[7],S.__data[10]=L.elements[8],S.__data[11]=L.elements[0]):(L.toArray(S.__data,x),x+=I.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,T,S.__data)}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function f(_,y,w){const b=_.value;if(w[y]===void 0){if(typeof b=="number")w[y]=b;else{const E=Array.isArray(b)?b:[b],M=[];for(let S=0;S<E.length;S++)M.push(E[S].clone());w[y]=M}return!0}else if(typeof b=="number"){if(w[y]!==b)return w[y]=b,!0}else{const E=Array.isArray(w[y])?w[y]:[w[y]],M=Array.isArray(b)?b:[b];for(let S=0;S<E.length;S++){const T=E[S];if(T.equals(M[S])===!1)return T.copy(M[S]),!0}}return!1}function m(_){const y=_.uniforms;let w=0;const b=16;let E=0;for(let M=0,S=y.length;M<S;M++){const T=y[M],C={boundary:0,storage:0},x=Array.isArray(T.value)?T.value:[T.value];for(let R=0,L=x.length;R<L;R++){const I=x[R],F=g(I);C.boundary+=F.boundary,C.storage+=F.storage}if(T.__data=new Float32Array(C.storage/Float32Array.BYTES_PER_ELEMENT),T.__offset=w,M>0){E=w%b;const R=b-E;E!==0&&R-C.boundary<0&&(w+=b-E,T.__offset=w)}w+=C.storage}return E=w%b,E>0&&(w+=b-E),_.__size=w,_.__cache={},this}function g(_){const y={boundary:0,storage:0};return typeof _=="number"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?c
3589onsole.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function p(_){const y=_.target;y.removeEventListener("dispose",p);const w=o.indexOf(y.__bindingPointIndex);o.splice(w,1),t.deleteBuffer(a[y.id]),delete a[y.id],delete s[y.id]}function v(){for(const _ in a)t.deleteBuffer(a[_]);o=[],a={},s={}}return{bind:c,update:h,dispose:v}}class Qs{constructor(i={}){const{canvas:r=wee(),context:n=null,depth:a=!0,stencil:s=!0,alpha:o=!1,antialias:l=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:h=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:d=!1}=i;this.isWebGLRenderer=!0;let A;n!==null?A=n.getContextAttributes().alpha:A=o;const f=new Uint32Array(4),m=new Int32Array(4);let g=null,p=null;const v=[],_=[];this.domElement=r,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._outputColorSpace=Fa,this._useLegacyLights=!1,this.toneMapping=gA,this.toneMappingExposure=1;const y=this;let w=!1,b=0,E=0,M=null,S=-1,T=null;const C=new Yr,x=new Yr;let R=null;const L=new Kt(0);let I=0,F=r.width,Y=r.height,D=1,U=null,j=null;const J=new Yr(0,0,F,Y),z=new Yr(0,0,F,Y);let $=!1;const te=new IO;let ae=!1,ve=!1,oe=null;const K=new _t,X=new Jt,N=new we,k={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Z(){return M===null?D:1}let V=n;function re(G,ue){for(let he=0;he<G.length;he++){const be=G[he],Ce=r.getContext(be,ue);if(Ce!==null)return Ce}return null}try{const G={alpha:!0,depth:a,stencil:s,antialias:l,premultipliedAlpha:c,preserveDrawingBuffer:h,powerPreference:u,failIfMajorPerformanceCaveat:d};if("setAttribute"in r&&r.setAttribute("data-engine",`three.js r${SO}`),r.addEventListener("webglcontextlost",xe,!1),r.addEventListener("webglcontextrestored",de,!1),r.addEventListener("webglcontextcreationerror",Qe,!1),V===null){const ue=["webgl2","webgl","experimental-webgl"];if(y.isWebGL1Renderer===!0&&ue.shift(),V=re(ue,G),V===null)throw re(ue)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}typeof WebGLRenderingContext<"u"&&V instanceof WebGLRenderingContext&&console.warn("THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163."),V.getShaderPrecisionFormat===void 0&&(V.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(G){throw console.error("THREE.WebGLRenderer: "+G.message),G}let Ae,pe,ce,_e,me,le,De,Ve,se,P,H,ye,Q,Be,Le,Ke,Re,Xe,fe,Ge,Pe,rt,Ze,pt;function At(){Ae=new Ure(V),pe=new Ire(V,Ae,i),Ae.init(pe),rt=new Eae(V,Ae,pe),ce=new _ae(V,Ae,pe),_e=new Hre(V),me=new aae,le=new yae(V,Ae,ce,me,pe,rt,_e),De=new Pre(y),Ve=new Nre(y),se=new qee(V,pe),Ze=new Rre(V,Ae,se,pe),P=new Fre(V,se,_e,Ze),H=new Vre(V,P,se,_e),fe=new Qre(V,pe,le),Ke=new Dre(me),ye=new nae(y,De,Ve,Ae,pe,Ze,Ke),Q=new Tae(y,me),Be=new oae,Le=new Aae(Ae,pe),Xe=new xre(y,De,Ve,ce,H,A,c),Re=new vae(y,H,pe),pt=new Mae(V,_e,pe,ce),Ge=new Bre(V,Ae,_e,pe),Pe=new kre(V,Ae,_e,pe),_e.programs=ye.programs,y.capabilities=pe,y.extensions=Ae,y.properties=me,y.renderLists=Be,y.shadowMap=Re,y.state=ce,y.info=_e}At();const Se=new Cae(y,V);this.xr=Se,this.getContext=function(){return V},this.getContextAttributes=function(){return V.getContextAttributes()},this.forceContextLoss=function(){const G=Ae.get("WEBGL_lose_context");G&&G.loseContext()},this.forceContextRestore=function(){const G=Ae.get("WEBGL_lose_context");G&&G.restoreContext()},this.getPixelRatio=function(){return D},this.setPixelRatio=function(G){G!==void 0&&(D=G,this.setSize(F,Y,!1))},this.getSize=function(G){return G.set(F,Y)},this.setSize=function(G,ue,he=!0){if(Se.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}F=G,Y=ue,r.width=Math.floor(G*D),r.height=Math.floor(ue*D),he===!0&&(r.style.width=G+"px",r.style.height=ue+"px"),this.setViewport(0,0,G,ue)},this.getDrawingBufferSize=function(G){return G.set(F*D,Y*D).floor()},this.setDrawingBufferSize=function(G,ue,he){F=G,Y=ue,D=he,r.width=Math.floor(G*he),r.height=Math.floor(ue*he),this.setViewport(0,0,G,ue)},this.getCurrentViewport=function(G){return G.copy(C)},this.getViewport=function(G){return G.copy(J)},this.setViewport=function(G,ue,he,be){G.isVector4?J.set(G.x,G.y,G.z,G.w):J.set(G,ue,he,be),ce.viewport(C.copy(J).multiplyScalar(D).floor())}
vendor: 13,711 bytes, line 3589
3589,this.getScissor=function(G){return G.copy(z)},this.setScissor=function(G,ue,he,be){G.isVector4?z.set(G.x,G.y,G.z,G.w):z.set(G,ue,he,be),ce.scissor(x.copy(z).multiplyScalar(D).floor())},this.getScissorTest=function(){return $},this.setScissorTest=function(G){ce.setScissorTest($=G)},this.setOpaqueSort=function(G){U=G},this.setTransparentSort=function(G){j=G},this.getClearColor=function(G){return G.copy(Xe.getClearColor())},this.setClearColor=function(){Xe.setClearColor.apply(Xe,arguments)},this.getClearAlpha=function(){return Xe.getClearAlpha()},this.setClearAlpha=function(){Xe.setClearAlpha.apply(Xe,arguments)},this.clear=function(G=!0,ue=!0,he=!0){let be=0;if(G){let Ce=!1;if(M!==null){const Fe=M.texture.format;Ce=Fe===FW||Fe===UW||Fe===NW}if(Ce){const Fe=M.texture.type,Ue=Fe===vA||Fe===Xd||Fe===TO||Fe===Yf||Fe===PW||Fe===LW,qe=Xe.getClearColor(),tt=Xe.getClearAlpha(),Je=qe.r,dt=qe.g,nt=qe.b;Ue?(f[0]=Je,f[1]=dt,f[2]=nt,f[3]=tt,V.clearBufferuiv(V.COLOR,0,f)):(m[0]=Je,m[1]=dt,m[2]=nt,m[3]=tt,V.clearBufferiv(V.COLOR,0,m))}else be|=V.COLOR_BUFFER_BIT}ue&&(be|=V.DEPTH_BUFFER_BIT),he&&(be|=V.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),V.clear(be)},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(){r.removeEventListener("webglcontextlost",xe,!1),r.removeEventListener("webglcontextrestored",de,!1),r.removeEventListener("webglcontextcreationerror",Qe,!1),Be.dispose(),Le.dispose(),me.dispose(),De.dispose(),Ve.dispose(),H.dispose(),Ze.dispose(),pt.dispose(),ye.dispose(),Se.dispose(),Se.removeEventListener("sessionstart",Ir),Se.removeEventListener("sessionend",bi),oe&&(oe.dispose(),oe=null),Qr.stop()};function xe(G){G.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),w=!0}function de(){console.log("THREE.WebGLRenderer: Context Restored."),w=!1;const G=_e.autoReset,ue=Re.enabled,he=Re.autoUpdate,be=Re.needsUpdate,Ce=Re.type;At(),_e.autoReset=G,Re.enabled=ue,Re.autoUpdate=he,Re.needsUpdate=be,Re.type=Ce}function Qe(G){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",G.statusMessage)}function We(G){const ue=G.target;ue.removeEventListener("dispose",We),He(ue)}function He(G){ct(G),me.remove(G)}function ct(G){const ue=me.get(G).programs;ue!==void 0&&(ue.forEach(function(he){ye.releaseProgram(he)}),G.isShaderMaterial&&ye.releaseShaderCache(G))}this.renderBufferDirect=function(G,ue,he,be,Ce,Fe){ue===null&&(ue=k);const Ue=Ce.isMesh&&Ce.matrixWorld.determinant()<0,qe=W(G,ue,he,be,Ce);ce.setMaterial(be,Ue);let tt=he.index,Je=1;if(be.wireframe===!0){if(tt=P.getWireframeAttribute(he),tt===void 0)return;Je=2}const dt=he.drawRange,nt=he.attributes.position;let mt=dt.start*Je,bt=(dt.start+dt.count)*Je;Fe!==null&&(mt=Math.max(mt,Fe.start*Je),bt=Math.min(bt,(Fe.start+Fe.count)*Je)),tt!==null?(mt=Math.max(mt,0),bt=Math.min(bt,tt.count)):nt!=null&&(mt=Math.max(mt,0),bt=Math.min(bt,nt.count));const Rt=bt-mt;if(Rt<0||Rt===1/0)return;Ze.setup(Ce,be,qe,he,tt);let Si,q=Ge;if(tt!==null&&(Si=se.get(tt),q=Pe,q.setIndex(Si)),Ce.isMesh)be.wireframe===!0?(ce.setLineWidth(be.wireframeLinewidth*Z()),q.setMode(V.LINES)):q.setMode(V.TRIANGLES);else if(Ce.isLine){let ee=be.linewidth;ee===void 0&&(ee=1),ce.setLineWidth(ee*Z()),Ce.isLineSegments?q.setMode(V.LINES):Ce.isLineLoop?q.setMode(V.LINE_LOOP):q.setMode(V.LINE_STRIP)}else Ce.isPoints?q.setMode(V.POINTS):Ce.isSprite&&q.setMode(V.TRIANGLES);if(Ce.isInstancedMesh)q.renderInstances(mt,Rt,Ce.count);else if(he.isInstancedBufferGeometry){const ee=he._maxInstanceCount!==void 0?he._maxInstanceCount:1/0,Te=Math.min(he.instanceCount,ee);q.renderInstances(mt,Rt,Te)}else q.render(mt,Rt)};function St(G,ue,he){G.transparent===!0&&G.side===os&&G.forceSinglePass===!1?(G.side=fs,G.needsUpdate=!0,Oe(G,ue,he),G.side=RA,G.needsUpdate=!0,Oe(G,ue,he),G.side=os):Oe(G,ue,he)}this.compile=function(G,ue,he=null){he===null&&(he=G),p=Le.get(he),p.init(),_.push(p),he.traverseVisible(function(Ce){Ce.isLight&&Ce.layers.test(ue.layers)&&(p.pushLight(Ce),Ce.castShadow&&p.pushShadow(Ce))}),G!==he&&G.traverseVisible(function(Ce){Ce.isLight&&Ce.layers.test(ue.layers)&&(p.pushLight(Ce),Ce.castShadow&&p.pushShadow(Ce))}),p.setupLights(y._useLegacyLights);const be=new Set;return G.traverse(function(Ce){const Fe=Ce.material;if(Fe)if(Array.isArray(Fe))for(let Ue=0;Ue<Fe.length;Ue++){const qe=Fe[Ue];St(qe,he,Ce),be.add(qe)}else St(Fe,he,Ce),be.add(Fe)}),_.pop(),p=null,be},this.compileAsync=function(G,ue,he=null){const be=this.compile(G,ue,he);return new Promise(Ce=>{function Fe(){if(be.forEach(function(Ue){me.get(Ue).currentProgram.isReady()&&be.delete(Ue)}),be.size===0){Ce(G);return}setTimeout(Fe,10)}Ae.get("KHR_parallel_shader_compile")!==null?Fe():setTimeout(Fe,10)})};let si=null;function oi(G){si&&si(G)}function Ir(){Qr.stop()}function bi(){Qr.start()}const Qr=new qW;Qr.setAnimationLoop(oi),typeof self<"u"&&Qr.setContext(self),this.setAnimationLoop=function(G){si=G,Se.setAnimationLoop(G),G===null?Qr.stop():Qr.start()},Se.addEventListener("sessionstart",Ir),Se.addEventListener("sessionend",bi),this.render=function(G,ue){if(ue!==void 0&&ue.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(w===!0)return;G.matrixWorldAutoUpdate===!0&&G.updateMatrixWorld(),ue.parent===null&&ue.matrixWorldAutoUpdate===!0&&ue.updateMatrixWorld(),Se.enabled===!0&&Se.isPresenting===!0&&(Se.cameraAutoUpdate===!0&&Se.updateCamera(ue),ue=Se.getCamera()),G.isScene===!0&&G.onBeforeRender(y,G,ue,M),p=Le.get(G,_.length),p.init(),_.push(p),K.multiplyMatrices(ue.projectionMatrix,ue.matrixWorldInverse),te.setFromProjectionMatrix(K),ve=this.localClippingEnabled,ae=Ke.init(this.clippingPlanes,ve),g=Be.get(G,v.length),g.init(),v.push(g),$a(G,ue,0,y.sortObjects),g.finish(),y.sortObjects===!0&&g.sort(U,j),this.info.render.frame++,ae===!0&&Ke.beginShadows();const he=p.state.shadowsArray;if(Re.render(he,G,ue),ae===!0&&Ke.endShadows(),this.info.autoReset===!0&&this.info.reset(),Xe.render(g,G),p.setupLights(y._useLegacyLights),ue.isArrayCamera){const be=ue.cameras;for(let Ce=0,Fe=be.length;Ce<Fe;Ce++){const Ue=be[Ce];Ll(g,G,Ue,Ue.viewport)}}else Ll(g,G,ue);M!==null&&(le.updateMultisampleRenderTarget(M),le.updateRenderTargetMipmap(M)),G.isScene===!0&&G.onAfterRender(y,G,ue),Ze.resetDefaultState(),S=-1,T=null,_.pop(),_.length>0?p=_[_.length-1]:p=null,v.pop(),v.length>0?g=v[v.length-1]:g=null};function $a(G,ue,he,be){if(G.visible===!1)return;if(G.layers.test(ue.layers)){if(G.isGroup)he=G.renderOrder;else if(G.isLOD)G.autoUpdate===!0&&G.update(ue);else if(G.isLight)p.pushLight(G),G.castShadow&&p.pushShadow(G);else if(G.isSprite){if(!G.frustumCulled||te.intersectsSprite(G)){be&&N.setFromMatrixPosition(G.matrixWorld).applyMatrix4(K);const Ue=H.update(G),qe=G.material;qe.visible&&g.push(G,Ue,qe,he,N.z,null)}}else if((G.isMesh||G.isLine||G.isPoints)&&(!G.frustumCulled||te.intersectsObject(G))){const Ue=H.update(G),qe=G.material;if(be&&(G.boundingSphere!==void 0?(G.boundingSphere===null&&G.computeBoundingSphere(),N.copy(G.boundingSphere.center)):(Ue.boundingSphere===null&&Ue.computeBoundingSphere(),N.copy(Ue.boundingSphere.center)),N.applyMatrix4(G.matrixWorld).applyMatrix4(K)),Array.isArray(qe)){const tt=Ue.groups;for(let Je=0,dt=tt.length;Je<dt;Je++){const nt=tt[Je],mt=qe[nt.materialIndex];mt&&mt.visible&&g.push(G,Ue,mt,he,N.z,nt)}}else qe.visible&&g.push(G,Ue,qe,he,N.z,null)}}const Fe=G.children;for(let Ue=0,qe=Fe.length;Ue<qe;Ue++)$a(Fe[Ue],ue,he,be)}function Ll(G,ue,he,be){const Ce=G.opaque,Fe=G.transmissive,Ue=G.transparent;p.setupLightsView(he),ae===!0&&Ke.setGlobalState(y.clippingPlanes,he),Fe.length>0&&Th(Ce,Fe,ue,he),be&&ce.viewport(C.copy(be)),Ce.length>0&&ge(Ce,ue,he),Fe.length>0&&ge(Fe,ue,he),Ue.length>0&&ge(Ue,ue,he),ce.buffers.depth.setTest(!0),ce.buffers.depth.setMask(!0),ce.buffers.color.setMask(!0),ce.setPolygonOffset(!1)}function Th(G,ue,he,be){if((he.isScene===!0?he.overrideMaterial:null)!==null)return;const Fe=pe.isWebGL2;oe===null&&(oe=new ap(1,1,{generateMipmaps:!0,type:Ae.has("EXT_color_buffer_half_float")?yu:vA,minFilter:Zg,samples:Fe?4:0})),y.getDrawingBufferSize(X),Fe?oe.setSize(X.x,X.y):oe.setSize($S(X.x),$S(X.y));const Ue=y.getRenderTarget();y.setRenderTarget(oe),y.getClearColor(L),I=y.getClearAlpha(),I<1&&y.setClearColor(16777215,.5),y.clear();const qe=y.toneMapping;y.toneMapping=gA,ge(G,he,be),le.updateMultisampleRenderTarget(oe),le.updateRenderTargetMipmap(oe);let tt=!1;for(let Je=0,dt=ue.length;Je<dt;Je++){const nt=ue[Je],mt=nt.object,bt=nt.geometry,Rt=nt.material,Si=nt.group;if(Rt.side===os&&mt.layers.test(be.layers)){const q=Rt.side;Rt.side=fs,Rt.needsUpdate=!0,ze(mt,he,be,bt,Rt,Si),Rt.side=q,Rt.needsUpdate=!0,tt=!0}}tt===!0&&(le.updateMultisampleRenderTarget(oe),le.updateRenderTargetMipmap(oe)),y.setRenderTarget(Ue),y.setClearColor(L,I),y.toneMapping=qe}function ge(G,ue,he){const be=ue.isScene===!0?ue.overrideMaterial:null;for(let Ce=0,Fe=G.length;Ce<Fe;Ce++){const Ue=G[Ce],qe=Ue.object,tt=Ue.geometry,Je=be===null?Ue.material:be,dt=Ue.group;qe.layers.test(he.layers)&&ze(qe,ue,he,tt,Je,dt)}}function ze(G,ue,he,be,Ce,Fe){G.onBeforeRender(y,ue,he,be,Ce,Fe),G.modelViewMatrix.multiplyMatrices(he.matrixWorldInverse,G.matrixWorld),G.normalMatrix.getNormalMatrix(G.modelViewMatrix),Ce.onBeforeRender(y,ue,he,be,G,Fe),Ce.transparent===!0&&Ce.side===os&&Ce.forceSinglePass===!1?(Ce.side=fs,Ce.needsUpdate=!0,y.renderBufferDirect(he,ue,be,Ce,G,Fe),Ce.side=RA,Ce.needsUpdate=!0,y.renderBufferDirect(he,ue,be,Ce,G,Fe),Ce.side=os):y.renderBufferDirect(he,ue,be,Ce,G,Fe),G.onAfterRender(y,ue,he,be,Ce,Fe)}function Oe(G,ue,he){ue.isScene!==!0&&(ue=k);const be=me.get(G),Ce=p.state.lights,Fe=p.state.shadowsArray,Ue=Ce.state.version,qe=ye.getParameters(G,Ce.state,Fe,ue,he),tt=ye.getProgramCacheKey(qe);let Je=be.programs;be.environment=G.isMeshStandardMaterial?ue.environment:null,be.fog=ue.fog,be.envMap=(G.isMeshStandardMaterial?Ve:De).get(G.envMap||be.environment),Je===void 0&&(G.addEventListener("dispose",We),Je=new Map,be.programs=Je);let dt=Je.get(tt);if(dt!==void 0){if(be.currentProgram===dt&&be.lightsStateVersion===Ue)return it(G,qe),dt}else qe.uniforms=ye.getUniforms(G),G.onBuild(he,qe,y),G.onBeforeCompile(qe,y),dt=ye.acquireProgram(qe,tt),Je.set(tt,dt),be.uniforms=qe.uniforms;const nt=be.uniforms;return(!G.isShaderMaterial&&!G.isRawShaderMaterial||G.clipping===!0)&&(nt.clippingPlanes=Ke.uniform),it(G,qe),be.needsLights=Ee(G),be.lightsStateVersion=Ue,be.needsLights&&(nt.ambientLightColor.value=Ce.state.ambient,nt.lightProbe.value=Ce.state.probe,nt.directionalLights.value=Ce.state.directional,nt.directionalLightShadows.value=Ce.state.directionalShadow,nt.spotLights.value=Ce.state.spot,nt.spotLightShadows.value=Ce.state.spotShadow,nt.rectAreaLights.value=Ce.state.rectArea,nt.ltc_1.value=Ce.state.rectAreaLTC1,nt.ltc_2.value=Ce.state.rectAreaLTC2,nt.pointLights.value=Ce.state.point,nt.pointLightShadows.value=Ce.state.pointShadow,nt.hemisphereLights.value=Ce.state.hemi,nt.directionalShadowMap.value=Ce.state.directionalShadowMap,nt.directionalShadowMatrix.value=Ce.state.directionalShadowMatrix,nt.spotShadowMap.value=Ce.state.spotShadowMap,nt.spotLightMatrix.value=Ce.state.spotLightMatrix,nt.spotLightMap.value=Ce.state.spotLightMap,nt.pointShadowMap.value=Ce.state.pointShadowMap,nt.pointShadowMatrix.value=Ce.state.pointShadowMatrix),be.currentProgram=dt,be.uniformsList=null,dt}function Ne(G){if(G.uniformsList===null){const ue=G.currentProgram.getUniforms();G.uniformsList=mS.seqWithValue(ue.seq,G.uniforms)}return G.uniformsList}function it(G,ue){const he=me.get(G);he.outputColorSpace=ue.outputColorSpace,he.instancing=ue.instancing,he.instancingColor=ue.instancingColor,he.skinning=ue.skinning,he.morphTargets=ue.morphTargets,he.morphNormals=ue.morphNormals,he.morphColors=ue.morphColors,he.morphTargetsCount=ue.morphTargetsCount,he.numClippingPlanes=ue.numClippingPlanes,he.numIntersection=ue.numClipIntersection,he.vertexAlphas=ue.vertexAlphas,he.vertexTangents=ue.vertexTangents,he.toneMapping=ue.toneMapping}function W(G,ue,he,be,Ce){ue.isScene!==!0&&(ue=k),le.resetTextureUnits();const Fe=ue.fog,Ue=be.isMeshStandardMaterial?ue.environment:null,qe=M===null?y.outputColorSpace:M.isXRRenderTarget===!0?M.texture.colorSpace:fc,tt=(be.isMeshStandardMaterial?Ve:De).get(be.envMap||Ue),Je=be.vertexColors===!0&&!!he.attributes.color&&he.attributes.color.itemSize===4,dt=!!he.attributes.tangent&&(!!be.normalMap||be.anisotropy>0),nt=!!he.morphAttributes.position,mt=!!he.morphAttributes.normal,bt=!!he.morphAttributes.color;let Rt=gA;be.toneMapped&&(M===null||M.isXRRenderTarget===!0)&&(Rt=y.toneMapping);const Si=he.morphAttributes.position||he.morphAttributes.normal||he.morphAttributes.color,q=Si!==void 0?Si.length:0,ee=me.get(be),Te=p.state.lights;if(ae===!0&&(ve===!0||G!==T)){const pr=G===T&&be.id===S;Ke.setState(be,G,pr)}let ie=!1;be.version===ee.__version?(ee.needsLights&&ee.lightsStateVersion!==Te.state.version||ee.outputColorSpace!==qe||Ce.isInstancedMesh&&ee.instancing===!1||!Ce.isInstancedMesh&&ee.instancing===!0||Ce.isSkinnedMesh&&ee.skinning===!1||!Ce.isSkinnedMesh&&ee.skinning===!0||Ce.isInstancedMesh&&ee.instancingColor===!0&&Ce.instanceColor===null||Ce.isInstancedMesh&&ee.instancingColor===!1&&Ce.instanceColor!==null||ee.envMap!==tt||be.fog===!0&&ee.fog!==Fe||ee.numClippingPlanes!==void 0&&(ee.numClippingPlanes!==Ke.numPlanes||ee.numIntersection!==Ke.numIntersection)||ee.vertexAlphas!==Je||ee.vertexTangents!==dt||ee.morphTargets!==nt||ee.morphNormals!==mt||ee.morphColors!==bt||ee.toneMapping!==Rt||pe.isWebGL2===!0&&ee.morphTargetsCount!==q)&&(ie=!0):(ie=!0,ee.__version=be.ver
3589sion);let Ie=ee.currentProgram;ie===!0&&(Ie=Oe(be,ue,Ce));let lt=!1,zi=!1,Pi=!1;const di=Ie.getUniforms(),dn=ee.uniforms;if(ce.useProgram(Ie.program)&&(lt=!0,zi=!0,Pi=!0),be.id!==S&&(S=be.id,zi=!0),lt||T!==G){di.setValue(V,"projectionMatrix",G.projectionMatrix),di.setValue(V,"viewMatrix",G.matrixWorldInverse);const pr=di.map.cameraPosition;pr!==void 0&&pr.setValue(V,N.setFromMatrixPosition(G.matrixWorld)),pe.logarithmicDepthBuffer&&di.setValue(V,"logDepthBufFC",2/(Math.log(G.far+1)/Math.LN2)),(be.isMeshPhongMaterial||be.isMeshToonMaterial||be.isMeshLambertMaterial||be.isMeshBasicMaterial||be.isMeshStandardMaterial||be.isShaderMaterial)&&di.setValue(V,"isOrthographic",G.isOrthographicCamera===!0),T!==G&&(T=G,zi=!0,Pi=!0)}if(Ce.isSkinnedMesh){di.setOptional(V,Ce,"bindMatrix"),di.setOptional(V,Ce,"bindMatrixInverse");const pr=Ce.skeleton;pr&&(pe.floatVertexTextures?(pr.boneTexture===null&&pr.computeBoneTexture(),di.setValue(V,"boneTexture",pr.boneTexture,le),di.setValue(V,"boneTextureSize",pr.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const Ws=he.morphAttributes;if((Ws.position!==void 0||Ws.normal!==void 0||Ws.color!==void 0&&pe.isWebGL2===!0)&&fe.update(Ce,he,Ie),(zi||ee.receiveShadow!==Ce.receiveShadow)&&(ee.receiveShadow=Ce.receiveShadow,di.setValue(V,"receiveShadow",Ce.receiveShadow)),be.isMeshGouraudMaterial&&be.envMap!==null&&(dn.envMap.value=tt,dn.flipEnvMap.value=tt.isCubeTexture&&tt.isRenderTargetTexture===!1?-1:1),zi&&(di.setValue(V,"toneMappingExposure",y.toneMappingExposure),ee.needsLights&&ne(dn,Pi),Fe&&be.fog===!0&&Q.refreshFogUniforms(dn,Fe),Q.refreshMaterialUniforms(dn,be,D,Y,oe),mS.upload(V,Ne(ee),dn,le)),be.isShaderMaterial&&be.uniformsNeedUpdate===!0&&(mS.upload(V,Ne(ee),dn,le),be.uniformsNeedUpdate=!1),be.isSpriteMaterial&&di.setValue(V,"center",Ce.center),di.setValue(V,"modelViewMatrix",Ce.modelViewMatrix),di.setValue(V,"normalMatrix",Ce.normalMatrix),di.setValue(V,"modelMatrix",Ce.matrixWorld),be.isShaderMaterial||be.isRawShaderMaterial){const pr=be.uniformsGroups;for(let nd=0,s$=pr.length;nd<s$;nd++)if(pe.isWebGL2){const m3=pr[nd];pt.update(m3,Ie),pt.bind(m3,Ie)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return Ie}function ne(G,ue){G.ambientLightColor.needsUpdate=ue,G.lightProbe.needsUpdate=ue,G.directionalLights.needsUpdate=ue,G.directionalLightShadows.needsUpdate=ue,G.pointLights.needsUpdate=ue,G.pointLightShadows.needsUpdate=ue,G.spotLights.needsUpdate=ue,G.spotLightShadows.needsUpdate=ue,G.rectAreaLights.needsUpdate=ue,G.hemisphereLights.needsUpdate=ue}function Ee(G){return G.isMeshLambertMaterial||G.isMeshToonMaterial||G.isMeshPhongMaterial||G.isMeshStandardMaterial||G.isShadowMaterial||G.isShaderMaterial&&G.lights===!0}this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return E},this.getRenderTarget=function(){return M},this.setRenderTargetTextures=function(G,ue,he){me.get(G.texture).__webglTexture=ue,me.get(G.depthTexture).__webglTexture=he;const be=me.get(G);be.__hasExternalTextures=!0,be.__hasExternalTextures&&(be.__autoAllocateDepthBuffer=he===void 0,be.__autoAllocateDepthBuffer||Ae.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),be.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(G,ue){const he=me.get(G);he.__webglFramebuffer=ue,he.__useDefaultFramebuffer=ue===void 0},this.setRenderTarget=function(G,ue=0,he=0){M=G,b=ue,E=he;let be=!0,Ce=null,Fe=!1,Ue=!1;if(G){const tt=me.get(G);tt.__useDefaultFramebuffer!==void 0?(ce.bindFramebuffer(V.FRAMEBUFFER,null),be=!1):tt.__webglFramebuffer===void 0?le.setupRenderTarget(G):tt.__hasExternalTextures&&le.rebindTextures(G,me.get(G.texture).__webglTexture,me.get(G.depthTexture).__webglTexture);const Je=G.texture;(Je.isData3DTexture||Je.isDataArrayTexture||Je.isCompressedArrayTexture)&&(Ue=!0);const dt=me.get(G).__webglFramebuffer;
3589G.isWebGLCubeRenderTarget?(Array.isArray(dt[ue])?Ce=dt[ue][he]:Ce=dt[ue],Fe=!0):pe.isWebGL2&&G.samples>0&&le.useMultisampledRTT(G)===!1?Ce=me.get(G).__webglMultisampledFramebuffer:Array.isArray(dt)?Ce=dt[he]:Ce=dt,C.copy(G.viewport),x.copy(G.scissor),R=G.scissorTest}else C.copy(J).multiplyScalar(D).floor(),x.copy(z).multiplyScalar(D).floor(),R=$;if(ce.bindFramebuffer(V.FRAMEBUFFER,Ce)&&pe.drawBuffers&&be&&ce.drawBuffers(G,Ce),ce.viewport(C),ce.scissor(x),ce.setScissorTest(R),Fe){const tt=me.get(G.texture);V.framebufferTexture2D(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,V.TEXTURE_CUBE_MAP_POSITIVE_X+ue,tt.__webglTexture,he)}else if(Ue){const tt=me.get(G.texture),Je=ue||0;V.framebufferTextureLayer(V.FRAMEBUFFER,V.COLOR_ATTACHMENT0,tt.__webglTexture,he||0,Je)}S=-1},this.readRenderTargetPixels=function(G,ue,he,be,Ce,Fe,Ue){if(!(G&&G.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let qe=me.get(G).__webglFramebuffer;if(G.isWebGLCubeRenderTarget&&Ue!==void 0&&(qe=qe[Ue]),qe){ce.bindFramebuffer(V.FRAMEBUFFER,qe);try{const tt=G.texture,Je=tt.format,dt=tt.type;if(Je!==ol&&rt.convert(Je)!==V.getParameter(V.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const nt=dt===yu&&(Ae.has("EXT_color_buffer_half_float")||pe.isWebGL2&&Ae.has("EXT_color_buffer_float"));if(dt!==vA&&rt.convert(dt)!==V.getParameter(V.IMPLEMENTATION_COLOR_READ_TYPE)&&!(dt===rc&&(pe.isWebGL2||Ae.has("OES_texture_float")||Ae.has("WEBGL_color_buffer_float")))&&!nt){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ue>=0&&ue<=G.width-be&&he>=0&&he<=G.height-Ce&&V.readPixels(ue,he,be,Ce,rt.convert(Je),rt.convert(dt),Fe)}finally{const tt=M!==null?me.get(M).__webglFramebuffer:null;ce.bindFramebuffer(V.FRAMEBUFFER,tt)}}},this.copyFramebufferToTexture=function(G,ue,he=0){const be=Math.pow(2,-he),Ce=Math.floor(ue.image.width*be),Fe=Math.floor(ue.image.height*be);le.setTexture2D(ue,0),V.copyTexSubImage2D(V.TEXTURE_2D,he,0,0,G.x,G.y,Ce,Fe),ce.unbindTexture()},this.copyTextureToTexture=function(G,ue,he,be=0){const Ce=ue.image.width,Fe=ue.image.height,Ue=rt.convert(he.format),qe=rt.convert(he.type);le.setTexture2D(he,0),V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,he.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,he.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,he.unpackAlignment),ue.isDataTexture?V.texSubImage2D(V.TEXTURE_2D,be,G.x,G.y,Ce,Fe,Ue,qe,ue.image.data):ue.isCompressedTexture?V.compressedTexSubImage2D(V.TEXTURE_2D,be,G.x,G.y,ue.mipmaps[0].width,ue.mipmaps[0].height,Ue,ue.mipmaps[0].data):V.texSubImage2D(V.TEXTURE_2D,be,G.x,G.y,Ue,qe,ue.image),be===0&&he.generateMipmaps&&V.generateMipmap(V.TEXTURE_2D),ce.unbindTexture()},this.copyTextureToTexture3D=function(G,ue,he,be,Ce=0){if(y.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const Fe=G.max.x-G.min.x+1,Ue=G.max.y-G.min.y+1,qe=G.max.z-G.min.z+1,tt=rt.convert(be.format),Je=rt.convert(be.type);let dt;if(be.isData3DTexture)le.setTexture3D(be,0),dt=V.TEXTURE_3D;else if(be.isDataArrayTexture)le.setTexture2DArray(be,0),dt=V.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}V.pixelStorei(V.UNPACK_FLIP_Y_WEBGL,be.flipY),V.pixelStorei(V.UNPACK_PREMULTIPLY_ALPHA_WEBGL,be.premultiplyAlpha),V.pixelStorei(V.UNPACK_ALIGNMENT,be.unpackAlignment);const nt=V.getParameter(V.UNPACK_ROW_LENGTH),mt=V.getParameter(V.UNPACK_IMAGE_HEIGHT),bt=V.getParameter(V.UNPACK_SKIP_PIXELS),Rt=V.getParameter(V.UNPACK_SKIP_ROWS),Si=V.getParameter(V.UNPACK_SKIP_IMAGES),q=he.isCompressedTexture?he.mipmaps[0]:he.image;V.pixelStorei(V.UNPACK_ROW_LENGTH,q.width),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,q.height),V.pixelStorei(V.UNPACK_SKIP_PIXELS,G.min.x),V.pixelStorei(V.UNPACK_SKIP_ROWS,G.min.y),V.pixelStorei(V.UNPACK_SKIP_IMAGES,G.min.z),he.isDataTexture||he.isData3DTexture?V.texSubImage3D(dt,Ce,ue.x,ue.y,ue.z,Fe,Ue,qe,tt,Je,q.data):he.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),V.compressedTexSubImage3D(dt,Ce,ue.x,ue.y,ue.z,Fe,Ue,qe,tt,q.data)):V.texSubImage3D(dt,Ce,ue.x,ue.y,ue.z,Fe,Ue,qe,tt,Je,q),V.pixelStorei(V.UNPACK_ROW_LENGTH,nt),V.pixelStorei(V.UNPACK_IMAGE_HEIGHT,mt),V.pixelStorei(V.UNPACK_SKIP_PIXELS,bt),V.pixelStorei(V.UNPACK_SKIP_ROWS,Rt),V.pixelStorei(V.UNPACK_SKIP_IMAGES,Si),Ce===0&&be.generateMipmaps&&V.generateMipmap(dt),ce.unbindTexture()},this.initTexture=function(G){G.isCubeTexture?le.setTextureCube(G,0):G.isData3DTexture?le.setTexture3D(G,0):G.isDataArrayTexture||G.isCompressedArrayTexture?le.setTexture2DArray(G,0):le.setTexture2D(G,0),ce.unbindTexture()},this.resetState=function(){b=0,E=0,M=null,ce.reset(),Ze.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return Eu}get outputColorSpace(){return this._outputColorSpace}
vendor: 42,495 bytes, lines 3589-3594
3589set outputColorSpace(i){this._outputColorSpace=i;const r=this.getContext();r.drawingBufferColorSpace=i===xO?"display-p3":"srgb",r.unpackColorSpace=vr.workingColorSpace===kT?"display-p3":"srgb"}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(i){console.warn("THREE.WebGLRenderer: The property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!i}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Fa?Xf:kW}set outputEncoding(i){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=i===Xf?Fa:fc}get useLegacyLights(){return console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights}set useLegacyLights(i){console.warn("THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733."),this._useLegacyLights=i}}class xae extends Qs{}xae.prototype.isWebGL1Renderer=!0;class mo extends $r{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(i,r){return super.copy(i,r),i.background!==null&&(this.background=i.background.clone()),i.environment!==null&&(this.environment=i.environment.clone()),i.fog!==null&&(this.fog=i.fog.clone()),this.backgroundBlurriness=i.backgroundBlurriness,this.backgroundIntensity=i.backgroundIntensity,i.overrideMaterial!==null&&(this.overrideMaterial=i.overrideMaterial.clone()),this.matrixAutoUpdate=i.matrixAutoUpdate,this}toJSON(i){const r=super.toJSON(i);return this.fog!==null&&(r.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(r.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(r.object.backgroundIntensity=this.backgroundIntensity),r}}class i9{constructor(i,r){this.isInterleavedBuffer=!0,this.array=i,this.stride=r,this.count=i!==void 0?i.length/r:0,this.usage=nD,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Bu()}onUploadCallback(){}set needsUpdate(i){i===!0&&this.version++}setUsage(i){return this.usage=i,this}copy(i){return this.array=new i.array.constructor(i.array),this.count=i.count,this.stride=i.stride,this.usage=i.usage,this}copyAt(i,r,n){i*=this.stride,n*=r.stride;for(let a=0,s=this.stride;a<s;a++)this.array[i+a]=r.array[n+a];return this}set(i,r=0){return this.array.set(i,r),this}clone(i){i.arrayBuffers===void 0&&(i.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Bu()),i.arrayBuffers[this.array.buffer._uuid]===void 0&&(i.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const r=new this.array.constructor(i.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(r,this.stride);return n.setUsage(this.usage),n}onUpload(i){return this.onUploadCallback=i,this}toJSON(i){return i.arrayBuffers===void 0&&(i.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Bu()),i.arrayBuffers[this.array.buffer._uuid]===void 0&&(i.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 _s=new we;class t0{constructor(i,r,n,a=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=i,this.itemSize=r,this.offset=n,this.normalized=a}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(i){this.data.needsUpdate=i}applyMatrix4(i){for(let r=0,n=this.data.count;r<n;r++)_s.fromBufferAttribute(this,r),_s.applyMatrix4(i),this.setXYZ(r,_s.x,_s.y,_s.z);return this}applyNormalMatrix(i){for(let r=0,n=this.count;r<n;r++)_s.fromBufferAttribute(this,r),_s.applyNormalMatrix(i),this.setXYZ(r,_s.x,_s.y,_s.z);return this}transformDirection(i){for(let r=0,n=this.count;r<n;r++)_s.fromBufferAttribute(this,r),_s.transformDirection(i),this.setXYZ(r,_s.x,_s.y,_s.z);return this}setX(i,r){return this.normalized&&(r=mr(r,this.array)),this.data.array[i*this.data.stride+this.offset]=r,this}setY(i,r){return this.normalized&&(r=mr(r,this.array)),this.data.array[i*this.data.stride+this.offset+1]=r,this}setZ(i,r){return this.normalized&&(r=mr(r,this.array)),this.data.array[i*this.data.stride+this.offset+2]=r,this}setW(i,r){return this.normalized&&(r=mr(r,this.array)),this.data.array[i*this.data.stride+this.offset+3]=r,this}getX(i){let r=this.data.array[i*this.data.stride+this.offset];return this.normalized&&(r=Kc(r,this.array)),r}getY(i){let r=this.data.array[i*this.data.stride+this.offset+1];return this.normalized&&(r=Kc(r,this.array)),r}getZ(i){let r=this.data.array[i*this.data.stride+this.offset+2];return this.normalized&&(r=Kc(r,this.array)),r}getW(i){let r=this.data.array[i*this.data.stride+this.offset+3];return this.normalized&&(r=Kc(r,this.array)),r}setXY(i,r,n){return i=i*this.data.stride+this.offset,this.normalized&&(r=mr(r,this.array),n=mr(n,this.array)),this.data.array[i+0]=r,this.data.array[i+1]=n,this}setXYZ(i,r,n,a){return i=i*this.data.stride+this.offset,this.normalized&&(r=mr(r,this.array),n=mr(n,this.array),a=mr(a,this.array)),this.data.array[i+0]=r,this.data.array[i+1]=n,this.data.array[i+2]=a,this}setXYZW(i,r,n,a,s){return i=i*this.data.stride+this.offset,this.normalized&&(r=mr(r,this.array),n=mr(n,this.array),a=mr(a,this.array),s=mr(s,this.array)),this.data.array[i+0]=r,this.data.array[i+1]=n,this.data.array[i+2]=a,this.data.array[i+3]=s,this}clone(i){if(i===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const r=[];for(let n=0;n<this.count;n++){const a=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)r.push(this.data.array[a+s])}return new ks(new this.array.constructor(r),this.itemSize,this.normalized)}else return i.interleavedBuffers===void 0&&(i.interleavedBuffers={}),i.interleavedBuffers[this.data.uuid]===void 0&&(i.interleavedBuffers[this.data.uuid]=this.data.clone(i)),new t0(i.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(i){if(i===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const r=[];for(let n=0;n<this.count;n++){const a=n*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)r.push(this.data.array[a+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:r,normalized:this.normalized}}else return i.interleavedBuffers===void 0&&(i.interleavedBuffers={}),i.interleavedBuffers[this.data.uuid]===void 0&&(i.interleavedBuffers[this.data.uuid]=this.data.toJSON(i)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class r9 extends Ku{constructor(i){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Kt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(i)}copy(i){return super.copy(i),this.color.copy(i.color),this.map=i.map,this.alphaMap=i.alphaMap,this.rotation=i.rotation,this.sizeAttenuation=i.sizeAttenuation,this.fog=i.fog,this}}let rm;const pv=new we,nm=new we,am=new we,sm=new Jt,mv=new Jt,n9=new _t,G1=new we,gv=new we,z1=new we,UF=new Jt,Tx=new Jt,FF=new Jt;class Rae extends $r{constructor(i=new r9){if(super(),this.isSprite=!0,this.type="Sprite",rm===void 0){rm=new po;const r=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new i9(r,5);rm.setIndex([0,1,2,0,2,3]),rm.setAttribute("position",new t0(n,3,0,!1)),rm.setAttribute("uv",new t0(n,2,3,!1))}this.geometry=rm,this.material=i,this.center=new Jt(.5,.5)}raycast(i,r){i.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),nm.setFromMatrixScale(this.matrixWorld),n9.copy(i.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(i.camera.matrixWorldInverse,this.matrixWorld),am.setFromMatrixPosition(this.modelViewMatrix),i.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&nm.multiplyScalar(-am.z);const n=this.material.rotation;let a,s;n!==0&&(s=Math.cos(n),a=Math.sin(n));const o=this.center;Q1(G1.set(-.5,-.5,0),am,o,nm,a,s),Q1(gv.set(.5,-.5,0),am,o,nm,a,s),Q1(z1.set(.5,.5,0),am,o,nm,a,s),UF.set(0,0),Tx.set(1,0),FF.set(1,1);let l=i.ray.intersectTriangle(G1,gv,z1,!1,pv);if(l===null&&(Q1(gv.set(-.5,.5,0),am,o,nm,a,s),Tx.set(0,1),l=i.ray.intersectTriangle(G1,z1,gv,!1,pv),l===null))return;const c=i.ray.origin.distanceTo(pv);c<i.near||c>i.far||r.push({distance:c,point:pv.clone(),uv:Bo.getInterpolation(pv,G1,gv,z1,UF,Tx,FF,new Jt),face:null,object:this})}copy(i,r){return super.copy(i,r),i.center!==void 0&&this.center.copy(i.center),this.material=i.material,this}}function Q1(t,i,r,n,a,s){sm.subVectors(t,r).addScalar(.5).multiply(n),a!==void 0?(mv.x=s*sm.x-a*sm.y,mv.y=a*sm.x+s*sm.y):mv.copy(sm),t.copy(i),t.x+=mv.x,t.y+=mv.y,t.applyMatrix4(n9)}class Bae extends ps{constructor(i=null,r=1,n=1,a,s,o,l,c,h=Ua,u=Ua,d,A){super(null,o,l,c,h,u,a,s,d,A),this.isDataTexture=!0,this.image={data:i,width:r,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Iae extends ks{constructor(i,r,n,a=1){super(i,r,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=a}copy(i){return super.copy(i),this.meshPerAttribute=i.meshPerAttribute,this}toJSON(){const i=super.toJSON();return i.meshPerAttribute=this.meshPerAttribute,i.isInstancedBufferAttribute=!0,i}}class Xu extends Ku{constructor(i){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Kt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(i)}copy(i){return super.copy(i),this.color.copy(i.color),this.map=i.map,this.linewidth=i.linewidth,this.linecap=i.linecap,this.linejoin=i.linejoin,this.fog=i.fog,this}}const kF=new we,HF=new we,GF=new _t,Mx=new uE,V1=new I0;class a9 extends $r{constructor(i=new po,r=new Xu){super(),this.isLine=!0,this.type="Line",this.geometry=i,this.material=r,this.updateMorphTargets()}copy(i,r){return super.copy(i,r),this.material=Array.isArray(i.material)?i.material.slice():i.material,this.geometry=i.geometry,this}computeLineDistances(){const i=this.geometry;if(i.index===null){const r=i.attributes.position,n=[0];for(let a=1,s=r.count;a<s;a++)kF.fromBufferAttribute(r,a-1),HF.fromBufferAttribute(r,a),n[a]=n[a-1],n[a]+=kF.distanceTo(HF);i.setAttribute("lineDistance",new Lo(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(i,r){const n=this.geometry,a=this.matrixWorld,s=i.params.Line.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),V1.copy(n.boundingSphere),V1.applyMatrix4(a),V1.radius+=s,i.ray.intersectsSphere(V1)===!1)return;GF.copy(a).invert(),Mx.copy(i.ray).applyMatrix4(GF);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=l*l,h=new we,u=new we,d=new we,A=new we,f=this.isLineSegments?2:1,m=n.index,p=n.attributes.position;if(m!==null){const v=Math.max(0,o.start),_=Math.min(m.count,o.start+o.count);for(let y=v,w=_-1;y<w;y+=f){const b=m.getX(y),E=m.getX(y+1);if(h.fromBufferAttribute(p,b),u.fromBufferAttribute(p,E),Mx.distanceSqToSegment(h,u,A,d)>c)continue;A.applyMatrix4(this.matrixWorld);const S=i.ray.origin.distanceTo(A);S<i.near||S>i.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else{const v=Math.max(0,o.start),_=Math.min(p.count,o.start+o.count);for(let y=v,w=_-1;y<w;y+=f){if(h.fromBufferAttribute(p,y),u.fromBufferAttribute(p,y+1),Mx.distanceSqToSegment(h,u,A,d)>c)continue;A.applyMatrix4(this.matrixWorld);const E=i.ray.origin.distanceTo(A);E<i.near||E>i.far||r.push({distance:E,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const r=this.geometry.morphAttributes,n=Object.keys(r);if(n.length>0){const a=r[n[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=a.length;s<o;s++){const l=a[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}}const zF=new we,QF=new we;class Mp extends a9{constructor(i,r){super(i,r),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const i=this.geometry;if(i.index===null){const r=i.attributes.position,n=[];for(let a=0,s=r.count;a<s;a+=2)zF.fromBufferAttribute(r,a),QF.fromBufferAttribute(r,a+1),n[a]=a===0?0:n[a-1],n[a+1]=n[a]+zF.distanceTo(QF);i.setAttribute("lineDistance",new Lo(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class lD extends Ku{constructor(i){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Kt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(i)}copy(i){return super.copy(i),this.color.copy(i.color),this.map=i.map,this.alphaMap=i.alphaMap,this.size=i.size,this.sizeAttenuation=i.sizeAttenuation,this.fog=i.fog,this}}const VF=new _t,cD=new uE,W1=new I0,j1=new we;class Dae extends $r{constructor(i=new po,r=new lD){super(),this.isPoints=!0,this.type="Points",this.geometry=i,this.material=r,this.updateMorphTargets()}copy(i,r){return super.copy(i,r),this.material=Array.isArray(i.material)?i.material.slice():i.material,this.geometry=i.geometry,this}raycast(i,r){const n=this.geometry,a=this.matrixWorld,s=i.params.Points.threshold,o=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),W1.copy(n.boundingSphere),W1.applyMatrix4(a),W1.radius+=s,i.ray.intersectsSphere(W1)===!1)return;VF.copy(a).invert(),cD.copy(i.ray).applyMatrix4(VF);const l=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=l*l,h=n.index,d=n.attributes.position;if(h!==null){const A=Math.max(0,o.start),f=Math.min(h.count,o.start+o.count);for(let m=A,g=f;m<g;m++){const p=h.getX(m);j1.fromBufferAttribute(d,p),WF(j1,p,c,a,i,r,this)}}else{const A=Math.max(0,o.start),f=Math.min(d.count,o.start+o.count);for(let m=A,g=f;m<g;m++)j1.fromBufferAttribute(d,m),WF(j1,m,c,a,i,r,this)}}updateMorphTargets(){const r=this.geometry.morphAttributes,n=Object.keys(r);if(n.length>0){const a=r[n[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=a.length;s<o;s++){const l=a[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[l]=s}}}}}function WF(t,i,r,n,a,s,o){const l=cD.distanceSqToPoint(t);if(l<r){const c=new we;cD.closestPointToPoint(t,c),c.applyMatrix4(n);const h=a.ray.origin.distanceTo(c);if(h<a.near||h>a.far)return;s.push({distance:h,distanceToRay:Math.sqrt(l),point:c,index:i,face:null,object:o})}}class Pae extends ps{constructor(i,r,n,a,s,o,l,c,h){super(i,r,n,a,s,o,l,c,h),this.isCanvasTexture=!0,this.needsUpdate=!0}}const Y1=new we,K1=new we,xx=new we,X1=new Bo;class xp extends po{constructor(i=null,r=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:i,thresholdAngle:r},i!==null){const a=Math.pow(10,4),s=Math.cos(Eg*r),o=i.getIndex(),l=i.getAttribute("position"),c=o?o.count:l.count,h=[0,0,0],u=["a","b","c"],d=new Array(3),A={},f=[];for(let m=0;m<c;m+=3){o?(h[0]=o.getX(m),h[1]=o.getX(m+1),h[2]=o.getX(m+2)):(h[0]=m,h[1]=m+1,h[2]=m+2);const{a:g,b:p,c:v}=X1;if(g.fromBufferAttribute(l,h[0]),p.fromBufferAttribute(l,h[1]),v.fromBufferAttribute(l,h[2]),X1.getNormal(xx),d[0]=`${Math.round(g.x*a)},${Math.round(g.y*a)},${Math.round(g.z*a)}`,d[1]=`${Math.round(p.x*a)},${Math.round(p.y*a)},${Math.round(p.z*a)}`,d[2]=`${Math.round(v.x*a)},${Math.round(v.y*a)},${Math.round(v.z*a)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let _=0;_<3;_++){const y=(_+1)%3,w=d[_],b=d[y],E=X1[u[_]],M=X1[u[y]],S=`${w}_${b}`,T=`${b}_${w}`;T in A&&A[T]?(xx.dot(A[T].normal)<=s&&(f.push(E.x,E.y,E.z),f.push(M.x,M.y,M.z)),A[T]=null):S in A||(A[S]={index0:h[_],index1:h[y],normal:xx.clone()})}}for(const m in A)if(A[m]){const{index0:g,index1:p}=A[m];Y1.fromBufferAttribute(l,g),K1.fromBufferAttribute(l,p),f.push(Y1.x,Y1.y,Y1.z),f.push(K1.x,K1.y,K1.z)}this.setAttribute("position",new Lo(f,3))}}copy(i){return super.copy(i),this.parameters=Object.assign({},i.parameters),this}}class QT extends po{constructor(i=1,r=32,n=16,a=0,s=Math.PI*2,o=0,l=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:i,widthSegments:r,heightSegments:n,phiStart:a,phiLength:s,thetaStart:o,thetaLength:l},r=Math.max(3,Math.floor(r)),n=Math.max(2,Math.floor(n));const c=Math.min(o+l,Math.PI);let h=0;const u=[],d=new we,A=new we,f=[],m=[],g=[],p=[];for(let v=0;v<=n;v++){const _=[],y=v/n;let w=0;v===0&&o===0?w=.5/r:v===n&&c===Math.PI&&(w=-.5/r);for(let b=0;b<=r;b++){const E=b/r;d.x=-i*Math.cos(a+E*s)*Math.sin(o+y*l),d.y=i*Math.cos(o+y*l),d.z=i*Math.sin(a+E*s)*Math.sin(o+y*l),m.push(d.x,d.y,d.z),A.copy(d).normalize(),g.push(A.x,A.y,A.z),p.push(E+w,1-y),_.push(h++)}u.push(_)}for(let v=0;v<n;v++)for(let _=0;_<r;_++){const y=u[v][_+1],w=u[v][_],b=u[v+1][_],E=u[v+1][_+1];(v!==0||o>0)&&f.push(y,w,E),(v!==n-1||c<Math.PI)&&f.push(w,b,E)}this.setIndex(f),this.setAttribute("position",new Lo(m,3)),this.setAttribute("normal",new Lo(g,3)),this.setAttribute("uv",new Lo(p,2))}copy(i){return super.copy(i),this.parameters=Object.assign({},i.parameters),this}static fromJSON(i){return new QT(i.radius,i.widthSegments,i.heightSegments,i.phiStart,i.phiLength,i.thetaStart,i.thetaLength)}}class s9 extends Ku{constructor(i){super(),this.isMeshStandardMaterial=!0,this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Kt(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 Kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=MO,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(i)}copy(i){return super.copy(i),this.defines={STANDARD:""},this.color.copy(i.color),this.roughness=i.roughness,this.metalness=i.metalness,this.map=i.map,this.lightMap=i.lightMap,this.lightMapIntensity=i.lightMapIntensity,this.aoMap=i.aoMap,this.aoMapIntensity=i.aoMapIntensity,this.emissive.copy(i.emissive),this.emissiveMap=i.emissiveMap,this.emissiveIntensity=i.emissiveIntensity,this.bumpMap=i.bumpMap,this.bumpScale=i.bumpScale,this.normalMap=i.normalMap,this.normalMapType=i.normalMapType,this.normalScale.copy(i.normalScale),this.displacementMap=i.displacementMap,this.displacementScale=i.displacementScale,this.displacementBias=i.displacementBias,this.roughnessMap=i.roughnessMap,this.metalnessMap=i.metalnessMap,this.alphaMap=i.alphaMap,this.envMap=i.envMap,this.envMapIntensity=i.envMapIntensity,this.wireframe=i.wireframe,this.wireframeLinewidth=i.wireframeLinewidth,this.wireframeLinecap=i.wireframeLinecap,this.wireframeLinejoin=i.wireframeLinejoin,this.flatShading=i.flatShading,this.fog=i.fog,this}}class Lae extends s9{constructor(i){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 Jt(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return ma(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(r){this.ior=(1+.4*r)/(1-.4*r)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Kt(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 Kt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Kt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(i)}get anisotropy(){return this._anisotropy}set anisotropy(i){this._anisotropy>0!=i>0&&this.version++,this._anisotropy=i}get clearcoat(){return this._clearcoat}set clearcoat(i){this._clearcoat>0!=i>0&&this.version++,this._clearcoat=i}get iridescence(){return this._iridescence}set iridescence(i){this._iridescence>0!=i>0&&this.version++,this._iridescence=i}get sheen(){return this._sheen}set sheen(i){this._sheen>0!=i>0&&this.version++,this._sheen=i}get transmission(){return this._transmission}set transmission(i){this._transmission>0!=i>0&&this.version++,this._transmission=i}copy(i){return super.copy(i),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=i.anisotropy,this.anisotropyRotation=i.anisotropyRotation,this.anisotropyMap=i.anisotropyMap,this.clearcoat=i.clearcoat,this.clearcoatMap=i.clearcoatMap,this.clearcoatRoughness=i.clearcoatRoughness,this.clearcoatRoughnessMap=i.clearcoatRoughnessMap,this.clearcoatNormalMap=i.clearcoatNormalMap,this.clearcoatNormalScale.copy(i.clearcoatNormalScale),this.ior=i.ior,this.iridescence=i.iridescence,this.iridescenceMap=i.iridescenceMap,this.iridescenceIOR=i.iridescenceIOR,this.iridescenceThicknessRange=[...i.iridescenceThicknessRange],this.iridescenceThicknessMap=i.iridescenceThicknessMap,this.sheen=i.sheen,this.sheenColor.copy(i.sheenColor),this.sheenColorMap=i.sheenColorMap,this.sheenRoughness=i.sheenRoughness,this.sheenRoughnessMap=i.sheenRoughnessMap,this.transmission=i.transmission,this.transmissionMap=i.transmissionMap,this.thickness=i.thickness,this.thicknessMap=i.thicknessMap,this.attenuationDistance=i.attenuationDistance,this.attenuationColor.copy(i.attenuationColor),this.specularIntensity=i.specularIntensity,this.specularIntensityMap=i.specularIntensityMap,this.specularColor.copy(i.specularColor),this.specularColorMap=i.specularColorMap,this}}class vs extends Ku{constructor(i){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Kt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Kt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=MO,this.normalScale=new Jt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=CO,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(i)}copy(i){return super.copy(i),this.color.copy(i.color),this.map=i.map,this.lightMap=i.lightMap,this.lightMapIntensity=i.lightMapIntensity,this.aoMap=i.aoMap,this.aoMapIntensity=i.aoMapIntensity,this.emissive.copy(i.emissive),this.emissiveMap=i.emissiveMap,this.emissiveIntensity=i.emissiveIntensity,this.bumpMap=i.bumpMap,this.bumpScale=i.bumpScale,this.normalMap=i.normalMap,this.normalMapType=i.normalMapType,this.normalScale.copy(i.normalScale),this.displacementMap=i.displacementMap,this.displacementScale=i.displacementScale,this.displacementBias=i.displacementBias,this.specularMap=i.specularMap,this.alphaMap=i.alphaMap,this.envMap=i.envMap,this.combine=i.combine,this.reflectivity=i.reflectivity,this.refractionRatio=i.refractionRatio,this.wireframe=i.wireframe,this.wireframeLinewidth=i.wireframeLinewidth,this.wireframeLinecap=i.wireframeLinecap,this.wireframeLinejoin=i.wireframeLinejoin,this.flatShading=i.flatShading,this.fog=i.fog,this}}const eC={enabled:!1,files:{},add:function(t,i){this.enabled!==!1&&(this.files[t]=i)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class Oae{constructor(i,r,n){const a=this;let s=!1,o=0,l=0,c;const h=[];this.onStart=void 0,this.onLoad=i,this.onProgress=r,this.onError=n,this.itemStart=function(u){l++,s===!1&&a.onStart!==void 0&&a.onStart(u,o,l),s=!0},this.itemEnd=function(u){o++,a.onProgress!==void 0&&a.onProgress(u,o,l),o===l&&(s=!1,a.onLoad!==void 0&&a.onLoad())},this.itemError=function(u){a.onError!==void 0&&a.onError(u)},this.resolveURL=function(u){return c?c(u):u},this.setURLModifier=function(u){return c=u,this},this.addHandler=function(u,d){return h.push(u,d),this},this.removeHandler=function(u){const d=h.indexOf(u);return d!==-1&&h.splice(d,2),this},this.getHandler=function(u){for(let d=0,A=h.length;d<A;d+=2){const f=h[d],m=h[d+1];if(f.global&&(f.lastIndex=0),f.test(u))return m}return null}}}const Nae=new Oae;class BA{constructor(i){this.manager=i!==void 0?i:Nae,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(i,r){const n=this;return new Promise(function(a,s){n.load(i,a,r,s)})}parse(){}setCrossOrigin(i){return this.crossOrigin=i,this}setWithCredentials(i){return this.withCredentials=i,this}setPath(i){return this.path=i,this}setResourcePath(i){return this.resourcePath=i,this}setRequestHeader(i){return this.requestHeader=i,this}}BA.DEFAULT_MATERIAL_NAME="__DEFAULT";const Dh={};class Uae extends Error{constructor(i,r){super(i),this.response=r}}class O_ extends BA{constructor(i){super(i)}load(i,r,n,a){i===void 0&&(i=""),this.path!==void 0&&(i=this.path+i),i=this.manager.resolveURL(i);const s=eC.get(i);if(s!==void 0)return this.manager.itemStart(i),setTimeout(()=>{r&&r(s),this.manager.itemEnd(i)},0),s;if(Dh[i]!==void 0){Dh[i].push({onLoad:r,onProgress:n,onError:a});return}Dh[i]=[],Dh[i].push({onLoad:r,onProgress:n,onError:a});const o=new Request(i,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),l=this.mimeType,c=this.responseType;fetch(o).then(h=>{if(h.status===200||h.status===0){if(h.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||h.body===void 0||h.body.getReader===void 0)return h;const u=Dh[i],d=h.body.getReader(),A=h.headers.get("Content-Length")||h.headers.get("X-File-Size"),f=A?parseInt(A):0,m=f!==0;let g=0;const p=new ReadableStream({start(v){_();function _(){d.read().then(({done:y,value:w})=>{if(y)v.close();else{g+=w.byteLength;const b=new ProgressEvent("progress",{lengthComputable:m,loaded:g,total:f});for(let E=0,M=u.length;E<M;E++){const S=u[E];S.onProgress&&S.onProgress(b)}v.enqueue(w),_()}})}}});return new Response(p)}else throw new Uae(`fetch for "${h.url}" responded with ${h.status}: ${h.statusText}`,h)}).then(h=>{switch(c){case"arraybuffer":return h.arrayBuffer();case"blob":return h.blob();case"document":return h.text().then(u=>new DOMParser().parseFromString(u,l));case"json":return h.json();default:if(l===void 0)return h.text();{const d=/charset="?([^;"\s]*)"?/i.exec(l),A=d&&d[1]?d[1].toLowerCase():void 0,f=new TextDecoder(A);return h.arrayBuffer().then(m=>f.decode(m))}}}).then(h=>{eC.add(i,h);const u=Dh[i];delete Dh[i];for(let d=0,A=u.length;d<A;d++){const f=u[d];f.onLoad&&f.onLoad(h)}}).catch(h=>{const u=Dh[i];if(u===void 0)throw this.manager.itemError(i),h;delete Dh[i];for(let d=0,A=u.length;d<A;d++){const f=u[d];f.onError&&f.onError(h)}this.manager.itemError(i)}).finally(()=>{this.manager.itemEnd(i)}),this.manager.itemStart(i)}setResponseType(i){return this.responseType=i,this}setMimeType(i){return this.mimeType=i,this}}class Fae extends BA{constructor(i){super(i)}load(i,r,n,a){this.path!==void 0&&(i=this.path+i),i=this.manager.resolveURL(i);const s=this,o=eC.get(i);if(o!==void 0)return s.manager.itemStart(i),setTimeout(function(){r&&r(o),s.manager.itemEnd(i)},0),o;const l=my("img");function c(){u(),eC.add(i,this),r&&r(this),s.manager.itemEnd(i)}function h(d){u(),a&&a(d),s.manager.itemError(i),s.manager.itemEnd(i)}function u(){l.removeEventListener("load",c,!1),l.removeEventListener("error",h,!1)}return l.addEventListener("load",c,!1),l.addEventListener("error",h,!1),i.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(l.crossOrigin=this.crossOrigin),s.manager.itemStart(i),l.src=i,l}}class kae extends BA{constructor(i){super(i)}load(i,r,n,a){const s=this,o=new Bae,l=new O_(this.manager);return l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),l.setPath(this.path),l.setWithCredentials(s.withCredentials),l.load(i,function(c){let h;try{h=s.parse(c)}catch(u){if(a!==void 0)a(u);else{console.error(u);return}}h.image!==void 0?o.image=h.image:h.data!==void 0&&(o.image.width=h.width,o.image.height=h.height,o.image.data=h.data),o.wrapS=h.wrapS!==void 0?h.wrapS:Ha,o.wrapT=h.wrapT!==void 0?h.wrapT:Ha,o.magFilter=h.magFilter!==void 0?h.magFilter:pa,o.minFilter=h.minFilter!==void 0?h.minFilter:pa,o.anisotropy=h.anisotropy!==void 0?h.anisotropy:1,h.colorSpace!==void 0?o.colorSpace=h.colorSpace:h.encoding!==void 0&&(o.encoding=h.encoding),h.flipY!==void 0&&(o.flipY=h.flipY),h.format!==void 0&&(o.format=h.format),h.type!==void 0&&(o.type=h.type),h.mipmaps!==void 0&&(o.mipmaps=h.mipmaps,o.minFilter=Zg),h.mipmapCount===1&&(o.minFilter=pa),h.generateMipmaps!==void 0&&(o.generateMipmaps=h.generateMipmaps),o.needsUpdate=!0,r&&r(o,h)},n,a),o}}class LO extends BA{constructor(i){super(i)}load(i,r,n,a){const s=new ps,o=new Fae(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(i,function(l){s.image=l,s.needsUpdate=!0,r!==void 0&&r(s)},n,a),s}}class AE extends $r{constructor(i,r=1){super(),this.isLight=!0,this.type="Light",this.color=new Kt(i),this.intensity=r}dispose(){}copy(i,r){return super.copy(i,r),this.color.copy(i.color),this.intensity=i.intensity,this}toJSON(i){const r=super.toJSON(i);return r.object.color=this.color.getHex(),r.object.intensity=this.intensity,this.groundColor!==void 0&&(r.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(r.object.distance=this.distance),this.angle!==void 0&&(r.object.angle=this.angle),this.decay!==void 0&&(r.object.decay=this.decay),this.penumbra!==void 0&&(r.object.penumbra=this.penumbra),this.shadow!==void 0&&(r.object.shadow=this.shadow.toJSON()),r}}const Rx=new _t,jF=new we,YF=new we;class OO{constructor(i){this.camera=i,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Jt(512,512),this.map=null,this.mapPass=null,this.matrix=new _t,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new IO,this._frameExtents=new Jt(1,1),this._viewportCount=1,this._viewports=[new Yr(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(i){const r=this.camera,n=this.matrix;jF.setFromMatrixPosition(i.matrixWorld),r.position.copy(jF),YF.setFromMatrixPosition(i.target.matrixWorld),r.lookAt(YF),r.updateMatrixWorld(),Rx.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Rx),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(Rx)}getViewport(i){return this._viewports[i]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(i){return this.camera=i.camera.clone(),this.bias=i.bias,this.radius=i.radius,this.mapSize.copy(i.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const i={};return this.bias!==0&&(i.bias=this.bias),this.normalBias!==0&&(i.normalBias=this.normalBias),this.radius!==1&&(i.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(i.mapSize=this.mapSize.toArray()),i.camera=this.camera.toJSON(!1).object,delete i.camera.matrix,i}}class Hae extends OO{constructor(){super(new Rr(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(i){const r=this.camera,n=$g*2*i.angle*this.focus,a=this.mapSize.width/this.mapSize.height,s=i.distance||r.far;(n!==r.fov||a!==r.aspect||s!==r.far)&&(r.fov=n,r.aspect=a,r.far=s,r.updateProjectionMatrix()),super.updateMatrices(i)}copy(i){return super.copy(i),this.focus=i.focus,this}}class Gae extends AE{constructor(i,r,n=0,a=Math.PI/3,s=0,o=2){super(i,r),this.isSpotLight=!0,this.type="SpotLight",this.position.copy($r.DEFAULT_UP),this.updateMatrix(),this.target=new $r,this.distance=n,this.angle=a,this.penumbra=s,this.decay=o,this.map=null,this.shadow=new Hae}get power(){return this.intensity*Math.PI}set power(i){this.intensity=i/Math.PI}dispose(){this.shadow.dispose()}copy(i,r){return super.copy(i,r),this.distance=i.distance,this.angle=i.angle,this.penumbra=i.penumbra,this.decay=i.decay,this.target=i.target.clone(),this.shadow=i.shadow.clone(),this}}const KF=new _t,vv=new we,Bx=new we;class zae extends OO{constructor(){super(new Rr(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Jt(4,2),this._viewportCount=6,this._viewports=[new Yr(2,1,1,1),new Yr(0,1,1,1),new Yr(3,1,1,1),new Yr(1,1,1,1),new Yr(3,0,1,1),new Yr(1,0,1,1)],this._cubeDirections=[new we(1,0,0),new we(-1,0,0),new we(0,0,1),new we(0,0,-1),new we(0,1,0),new we(0,-1,0)],this._cubeUps=[new we(0,1,0),new we(0,1,0),new we(0,1,0),new we(0,1,0),new we(0,0,1),new we(0,0,-1)]}updateMatrices(i,r=0){const n=this.camera,a=this.matrix,s=i.distance||n.far;s!==n.far&&(n.far=s,n.updateProjectionMatrix()),vv.setFromMatrixPosition(i.matrixWorld),n.position.copy(vv),Bx.copy(n.position),Bx.add(this._cubeDirections[r]),n.up.copy(this._cubeUps[r]),n.lookAt(Bx),n.updateMatrixWorld(),a.makeTranslation(-vv.x,-vv.y,-vv.z),KF.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(KF)}}class Qae extends AE{constructor(i,r,n=0,a=2){super(i,r),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=a,this.shadow=new zae}get power(){return this.intensity*4*Math.PI}set power(i){this.intensity=i/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(i,r){return super.copy(i,r),this.distance=i.distance,this.decay=i.decay,this.shadow=i.shadow.clone(),this}}class Vae extends OO{constructor(){super(new ZW(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class zr extends AE{constructor(i,r){super(i,r),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy($r.DEFAULT_UP),this.updateMatrix(),this.target=new $r,this.shadow=new Vae}dispose(){this.shadow.dispose()}copy(i){return super.copy(i),this.target=i.target.clone(),this.shadow=i.shadow.clone(),this}}class Il extends AE{constructor(i,r){super(i,r),this.isAmbientLight=!0,this.type="AmbientLight"}}class Wae extends AE{constructor(i,r,n=10,a=10){super(i,r),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=a}get power(){return this.intensity*this.width*this.height*Math.PI}set power(i){this.intensity=i/(this.width*this.height*Math.PI)}copy(i){return super.copy(i),this.width=i.width,this.height=i.height,this}toJSON(i){const r=super.toJSON(i);return r.object.width=this.width,r.object.height=this.height,r}}class jae extends po{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(i){return super.copy(i),this.instanceCount=i.instanceCount,this}toJSON(){const i=super.toJSON();return i.instanceCount=this.instanceCount,i.isInstancedBufferGeometry=!0,i}}class Yae extends BA{constructor(i){super(i)}load(i,r,n,a){const s=this,o=new O_(s.manager);o.setPath(s.path),o.setRequestHeader(s.requestHeader),o.setWithCredentials(s.withCredentials),o.load(i,function(l){try{r(s.parse(JSON.parse(l)))}catch(c){a?a(c):console.error(c),s.manager.itemError(i)}},n,a)}parse(i){const r={},n={};function a(f,m){if(r[m]!==void 0)return r[m];const p=f.interleavedBuffers[m],v=s(f,p.buffer),_=g1(p.type,v),y=new i9(_,p.stride);return y.uuid=p.uuid,r[m]=y,y}function s(f,m){if(n[m]!==void 0)return n[m];const p=f.arrayBuffers[m],v=new Uint32Array(p).buffer;return n[m]=v,v}const o=i.isInstancedBufferGeometry?new jae:new po,l=i.data.index;if(l!==void 0){const f=g1(l.type,l.array);o.setIndex(new ks(f,1))}const c=i.data.attributes;for(const f in c){const m=c[f];let g;if(m.isInterleavedBufferAttribute){const p=a(i.data,m.data);g=new t0(p,m.itemSize,m.offset,m.normalized)}else{const p=g1(m.type,m.array),v=m.isInstancedBufferAttribute?Iae:ks;g=new v(p,m.itemSize,m.normalized)}m.name!==void 0&&(g.name=m.name),m.usage!==void 0&&g.setUsage(m.usage),m.updateRange!==void 0&&(g.updateRange.offset=m.updateRange.offset,g.updateRange.count=m.updateRange.count),o.setAttribute(f,g)}const h=i.data.morphAttributes;if(h)for(const f in h){const m=h[f],g=[];for(let p=0,v=m.length;p<v;p++){const _=m[p];let y;if(_.isInterleavedBufferAttribute){const w=a(i.data,_.data);y=new t0(w,_.itemSize,_.offset,_.normalized)}else{const w=g1(_.type,_.array);y=new ks(w,_.itemSize,_.normalized)}_.name!==void 0&&(y.name=_.name),g.push(y)}o.morphAttributes[f]=g}i.data.morphTargetsRelative&&(o.morphTargetsRelative=!0);const d=i.data.groups||i.data.drawcalls||i.data.offsets;if(d!==void 0)for(let f=0,m=d.length;f!==m;++f){const g=d[f];o.addGroup(g.start,g.count,g.materialIndex)}const A=i.data.boundingSphere;if(A!==void 0){const f=new we;A.center!==void 0&&f.fromArray(A.center),o.boundingSphere=new I0(f,A.radius)}return i.name&&(o.name=i.name),i.userData&&(o.userData=i.userData),o}}class Dl{constructor(i,r,n=0,a=1/0){this.ray=new uE(i,r),this.near=n,this.far=a,this.camera=null,this.layers=new BO,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(i,r){this.ray.set(i,r)}setFromCamera(i,r){r.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(r.matrixWorld),this.ray.direction.set(i.x,i.y,.5).unproject(r).sub(this.ray.origin).normalize(),this.camera=r):r.isOrthographicCamera?(this.ray.origin.set(i.x,i.y,(r.near+r.far)/(r.near-r.far)).unproject(r),this.ray.direction.set(0,0,-1).transformDirection(r.matrixWorld),this.camera=r):console.error("THREE.Raycaster: Unsupported camera type: "+r.type)}intersectObject(i,r=!0,n=[]){return hD(i,this,n,r),n.sort(XF),n}intersectObjects(i,r=!0,n=[]){for(let a=0,s=i.length;a<s;a++)hD(i[a],this,n,r);return n.sort(XF),n}}function XF(t,i){return t.distance-i.distance}function hD(t,i,r,n){if(t.layers.test(i.layers)&&t.raycast(i,r),n===!0){const a=t.children;for(let s=0,o=a.length;s<o;s++)hD(a[s],i,r,!0)}}class qF{constructor(i=1,r=0,n=0){return this.radius=i,this.phi=r,this.theta=n,this}set(i,r,n){return this.radius=i,this.phi=r,this.theta=n,this}copy(i){return this.radius=i.radius,this.phi=i.phi,this.theta=i.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(i){return this.setFromCartesianCoords(i.x,i.y,i.z)}setFromCartesianCoords(i,r,n){return this.radius=Math.sqrt(i*i+r*r+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(i,n),this.phi=Math.acos(ma(r/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:SO}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=SO);/*! 3590fflate - fast JavaScript compression/decompression 3591<https://101arrowz.github.io/fflate> 3592Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE 3593version 0.6.9 3594*/var ZF=function(t){return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))};try{URL.revokeObjectURL(ZF(""))}catch{ZF=function(i){return"data:application/javascript;charset=UTF-8,"+encodeURI(i)}}var ll=Uint8Array,qd=Uint16Array,uD=Uint32Array,o9=new ll([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),l9=new ll([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Kae=new ll([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c9=function(t,i){for(var r=new qd(31),n=0;n<31;++n)r[n]=i+=1<<t[n-1];for(var a=new uD(r[30]),n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)a[s]=s-r[n]<<5|n;return[r,a]},h9=c9(o9,2),u9=h9[0],Xae=h9[1];u9[28]=258,Xae[258]=28;var qae=c9(l9,0),Zae=qae[0],dD=new qd(32768);for(var kr=0;kr<32768;++kr){var hd=(kr&43690)>>>1|(kr&21845)<<1;hd=(hd&52428)>>>2|(hd&13107)<<2,hd=(hd&61680)>>>4|(hd&3855)<<4,dD[kr]=((hd&65280)>>>8|(hd&255)<<8)>>>1}var N_=function(t,i,r){for(var n=t.length,a=0,s=new qd(i);a<n;++a)++s[t[a]-1];var o=new qd(i);for(a=0;a<i;++a)o[a]=o[a-1]+s[a-1]<<1;var l;if(r){l=new qd(1<<i);var c=15-i;for(a=0;a<n;++a)if(t[a])for(var h=a<<4|t[a],u=i-t[a],d=o[t[a]-1]++<<u,A=d|(1<<u)-1;d<=A;++d)l[dD[d]>>>c]=h}else for(l=new qd(n),a=0;a<n;++a)t[a]&&(l[a]=dD[o[t[a]-1]++]>>>15-t[a]);return l},fE=new ll(288);for(var kr=0;kr<144;++kr)fE[kr]=8;for(var kr=144;kr<256;++kr)fE[kr]=9;for(var kr=256;kr<280;++kr)fE[kr]=7;for(var kr=280;kr<288;++kr)fE[kr]=8;var d9=new ll(32);for(var kr=0;kr<32;++kr)d9[kr]=5;var Jae=N_(fE,9,1),$ae=N_(d9,5,1),Ix=function(t){for(var i=t[0],r=1;r<t.length;++r)t[r]>i&&(i=t[r]);return i},Fl=function(t,i,r){var n=i/8|0;return(t[n]|t[n+1]<<8)>>(i&7)&r},Dx=function(t,i){var r=i/8|0;return(t[r]|t[r+1]<<8|t[r+2]<<16)>>(i&7)},ese=function(t){return(t/8|0)+(t&7&&1)},tse=function(t,i,r){(i==null||i<0)&&(i=0),(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof qd?qd:t instanceof uD?uD:ll)(r-i);return n.set(t.subarray(i,r)),n},ise=function(t,i,r){var n=t.length;if(!n||r&&!r.l&&n<5)return i||new ll(0);var a=!i||r,s=!r||r.i;r||(r={}),i||(i=new ll(n*3));var o=function(oe){var K=i.length;if(oe>K){var X=new ll(Math.max(K*2,oe));X.set(i),i=X}},l=r.f||0,c=r.p||0,h=r.b||0,u=r.l,d=r.d,A=r.m,f=r.n,m=n*8;do{if(!u){r.f=l=Fl(t,c,1);var g=Fl(t,c+1,3);if(c+=3,g)if(g==1)u=Jae,d=$ae,A=9,f=5;else if(g==2){var y=Fl(t,c,31)+257,w=Fl(t,c+10,15)+4,b=y+Fl(t,c+5,31)+1;c+=14;for(var E=new ll(b),M=new ll(19),S=0;S<w;++S)M[Kae[S]]=Fl(t,c+S*3,7);c+=w*3;
3594for(var T=Ix(M),C=(1<<T)-1,x=N_(M,T,1),S=0;S<b;){var R=x[Fl(t,c,C)];c+=R&15;var p=R>>>4;if(p<16)E[S++]=p;else{var L=0,I=0;for(p==16?(I=3+Fl(t,c,3),c+=2,L=E[S-1]):p==17?(I=3+Fl(t,c,7),c+=3):p==18&&(I=11+Fl(t,c,127),c+=7);I--;)E[S++]=L}}var F=E.subarray(0,y),Y=E.subarray(y);A=Ix(F),f=Ix(Y),u=N_(F,A,1),d=N_(Y,f,1)}else throw"invalid block type";else{var p=ese(c)+4,v=t[p-4]|t[p-3]<<8,_=p+v;if(_>n){if(s)throw"unexpected EOF";break}a&&o(h+v),i.set(t.subarray(p,_),h),r.b=h+=v,r.p=c=_*8;continue}if(c>m){if(s)throw"unexpected EOF";break}}a&&o(h+131072);for(var D=(1<<A)-1,U=(1<<f)-1,j=c;;j=c){var L=u[Dx(t,c)&D],J=L>>>4;if(c+=L&15,c>m){if(s)throw"unexpected EOF";break}if(!L)throw"invalid length/literal";if(J<256)i[h++]=J;else if(J==256){j=c,u=null;break}else{var z=J-254;if(J>264){var S=J-257,$=o9[S];z=Fl(t,c,(1<<$)-1)+u9[S],c+=$}var te=d[Dx(t,c)&U],ae=te>>>4;if(!te)throw"invalid distance";c+=te&15;var Y=Zae[ae];if(ae>3){var $=l9[ae];Y+=Dx(t,c)&(1<<$)-1,c+=$}if(c>m){if(s)throw"unexpected EOF";break}a&&o(h+131072);for(var ve=h+z;h<ve;h+=4)i[h]=i[h-Y],i[h+1]=i[h+1-Y],i[h+2]=i[h+2-Y],i[h+3]=i[h+3-Y];h=ve}}r.l=u,r.p=j,r.b=h,u&&(l=1,r.m=A,r.d=d,r.n=f)}while(!l);return h==i.length?i:tse(i,0,h)},rse=new ll(0),nse=function(t){if((t[0]&15)!=8||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(t[1]&32)throw"invalid zlib data: preset dictionaries not supported"};function q1(t,i){return ise((nse(t),t.subarray(2,-4)),i)}var ase=typeof TextDecoder<"u"&&new TextDecoder,sse=0;try{ase.decode(rse,{stream:!0}),sse=1}catch{}class ose extends kae{constructor(i){super(i),this.type=yu}parse(i){const T=Math.pow(2.7182818,2.2);function C(W,ne){let Ee=0;for(let ue=0;ue<65536;++ue)(ue==0||W[ue>>3]&1<<(ue&7))&&(ne[Ee++]=ue);const G=Ee-1;for(;Ee<65536;)ne[Ee++]=0;return G}function x(W){for(let ne=0;ne<16384;ne++)W[ne]={},W[ne].len=0,W[ne].lit=0,W[ne].p=null}const R={l:0,c:0,lc:0};function L(W,ne,Ee,G,ue){for(;Ee<W;)ne=ne<<8|rt(G,ue),Ee+=8;Ee-=W,R.l=ne>>Ee&(1<<W)-1,R.c=ne,R.lc=Ee}const I=new Array(59);function F(W){for(let Ee=0;Ee<=58;++Ee)I[Ee]=0;for(let Ee=0;Ee<65537;++Ee)I[W[Ee]]+=1;let ne=0;for(let Ee=58;Ee>0;--Ee){const G=ne+I[Ee]>>1;I[Ee]=ne,ne=G}for(let Ee=0;Ee<65537;++Ee){const G=W[Ee];G>0&&(W[Ee]=G|I[G]++<<6)}}function Y(W,ne,Ee,G,ue,he){const be=ne;let Ce=0,Fe=0;for(;G<=ue;G++){if(be.value-ne.value>Ee)return!1;L(6,Ce,Fe,W,be);const Ue=R.l;if(Ce=R.c,Fe=R.lc,he[G]=Ue,Ue==63){if(be.value-ne.value>Ee)throw new Error("Something wrong with hufUnpackEncTable");L(8,Ce,Fe,W,be);let qe=R.l+6;if(Ce=R.c,Fe=R.lc,G+qe>ue+1)throw new Error("Something wrong with hufUnpackEncTable");for(;qe--;)he[G++]=0;G--}else if(Ue>=59){let qe=Ue-59+2;if(G+qe>ue+1)throw new Error("Something wrong with hufUnpackEncTable");for(;qe--;)he[G++]=0;G--}}F(he)}function D(W){return W&63}function U(W){return W>>6}function j(W,ne,Ee,G){for(;ne<=Ee;ne++){const ue=U(W[ne]),he=D(W[ne]);if(ue>>he)throw new Error("Invalid table entry");if(he>14){const be=G[ue>>he-14];if(be.len)throw new Error("Invalid table entry");if(be.lit++,be.p){const Ce=be.p;be.p=new Array(be.lit);for(let Fe=0;Fe<be.lit-1;++Fe)be.p[Fe]=Ce[Fe]}else be.p=new Array(1);be.p[be.lit-1]=ne}else if(he){let be=0;for(let Ce=1<<14-he;Ce>0;Ce--){const Fe=G[(ue<<14-he)+be];if(Fe.len||Fe.p)throw new Error("Invalid table entry");Fe.len=he,Fe.lit=ne,be++}}}return!0}const J={c:0,lc:0};function z(W,ne,Ee,G){W=W<<8|rt(Ee,G),ne+=8,J.c=W,J.lc=ne}const $={c:0,lc:0};function te(W,ne,Ee,G,ue,he,be,Ce,Fe){if(W==ne){G<8&&(z(Ee,G,ue,he),Ee=J.c,G=J.lc),G-=8;let Ue=Ee>>G;if(Ue=new Uint8Array([Ue])[0],Ce.value+Ue>Fe)return!1;const qe=be[Ce.value-1];for(;Ue-- >0;)be[Ce.value++]=qe}else if(Ce.value<Fe)be[Ce.value++]=W;else return!1;$.c=Ee,$.lc=G}function ae(W){return W&65535}function ve(W){const ne=ae(W);return ne>32767?ne-65536:ne}const oe={a:0,b:0};function K(W,ne){const Ee=ve(W),ue=ve(ne),he=Ee+(ue&1)+(ue>>1),be=he,Ce=he-ue;oe.a=be,oe.b=Ce}function X(W,ne){const Ee=ae(W),G=ae(ne),ue=Ee-(G>>1)&65535,he=G+ue-32768&65535;oe.a=he,oe.b=ue}function N(W,ne,Ee,G,ue,he,be){const Ce=be<16384,Fe=Ee>ue?ue:Ee;let Ue=1,qe,tt;for(;Ue<=Fe;)Ue<<=1;for(Ue>>=1,qe=Ue,Ue>>=1;Ue>=1;){tt=0;const Je=tt+he*(ue-qe),dt=he*Ue,nt=he*qe,mt=G*Ue,bt=G*qe;let Rt,Si,q,ee;for(;tt<=Je;tt+=nt){let Te=tt;const ie=tt+G*(Ee-qe);for(;Te<=ie;Te+=bt){const Ie=Te+mt,lt=Te+dt,zi=lt+mt;Ce?(K(W[Te+ne],W[lt+ne]),Rt=oe.a,q=oe.b,K(W[Ie+ne],W[zi+ne]),Si=oe.a,ee=oe.b,K(Rt,Si),W[Te+ne]=oe.a,W[Ie+ne]=oe.b,K(q,ee),W[lt+ne]=oe.a,W[zi+ne]=oe.b):(X(W[Te+ne],W[lt+ne]),Rt=oe.a,q=oe.b,X(W[Ie+ne],W[zi+ne]),Si=oe.a,ee=oe.b,X(Rt,Si),W[Te+ne]=oe.a,W[Ie+ne]=oe.b,X(q,ee),W[lt+ne]=oe.a,W[zi+ne]=oe.b)}if(Ee&Ue){const Ie=Te+dt;Ce?K(W[Te+ne],W[Ie+ne]):X(W[Te+ne],W[Ie+ne]),Rt=oe.a,W[Ie+ne]=oe.b,W[Te+ne]=Rt}}if(ue&Ue){let Te=tt;const ie=tt+G*(Ee-qe);for(;Te<=ie;Te+=bt){const Ie=Te+mt;Ce?K(W[Te+ne],W[Ie+ne]):X(W[Te+ne],W[Ie+ne]),Rt=oe.a,W[Ie+ne]=oe.b,W[Te+ne]=Rt}}qe=Ue,Ue>>=1}return tt}function k(W,ne,Ee,G,ue,he,be,Ce,Fe){let Ue=0,qe=0;const tt=be,Je=Math.trunc(G.value+(ue+7)/8);for(;G.value<Je;)for(z(Ue,qe,Ee,G),Ue=J.c,qe=J.lc;qe>=14;){const nt=Ue>>qe-14&16383,mt=ne[nt];if(mt.len)qe-=mt.len,te(mt.lit,he,Ue,qe,Ee,G,Ce,Fe,tt),Ue=$.c,qe=$.lc;else{if(!mt.p)throw new Error("hufDecode issues");let bt;for(bt=0;bt<mt.lit;bt++){const Rt=D(W[mt.p[bt]]);for(;qe<Rt&&G.value<Je;)z(Ue,qe,Ee,G),Ue=J.c,qe=J.lc;if(qe>=Rt&&U(W[mt.p[bt]])==(Ue>>qe-Rt&(1<<Rt)-1)){qe-=Rt,te(mt.p[bt],he,Ue,qe,Ee,G,Ce,Fe,tt),Ue=$.c,qe=$.lc;break}}if(bt==mt.lit)throw new Error("hufDecode issues")}}const dt=8-ue&7;for(Ue>>=dt,qe-=dt;qe>0;){const nt=ne[Ue<<14-qe&16383];if(nt.len)qe-=nt.len,te(nt.lit,he,Ue,qe,Ee,G,Ce,Fe,tt),Ue=$.c,qe=$.lc;else throw new Error("hufDecode issues")}return!0}function Z(W,ne,Ee,G,ue,he){const be={value:0},Ce=Ee.value,Fe=Pe(ne,Ee),Ue=Pe(ne,Ee);Ee.value+=4;const qe=Pe(ne,Ee);if(Ee.value+=4,Fe<0||Fe>=65537||Ue<0||Ue>=65537)throw new Error("Something wrong with HUF_ENCSIZE");const tt=new Array(65537),Je=new Array(16384);x(Je);const dt=G-(Ee.value-Ce);if(Y(W,Ee,dt,Fe,Ue,tt),qe>8*(G-(Ee.value-Ce)))throw new Error("Something wrong with hufUncompress");j(tt,Fe,Ue,Je),k(tt,Je,W,Ee,qe,Ue,he,ue,be)}function V(W,ne,Ee){for(let G=0;G<Ee;++G)ne[G]=W[ne[G]]}function re(W){for(let ne=1;ne<W.length;ne++){const Ee=W[ne-1]+W[ne]-128;W[ne]=Ee}}function Ae(W,ne){let Ee=0,G=Math.floor((W.length+1)/2),ue=0;const he=W.length-1;for(;!(ue>he||(ne[ue++]=W[Ee++],ue>he));)ne[ue++]=W[G++]}function pe(W){let ne=W.byteLength;const Ee=new Array;let G=0;const ue=new DataView(W);for(;ne>0;){const he=ue.getInt8(G++);if(he<0){const be=-he;ne-=be+1;for(let Ce=0;Ce<be;Ce++)Ee.push(ue.getUint8(G++))}else{const be=he;ne-=2;const Ce=ue.getUint8(G++);for(let Fe=0;Fe<be+1;Fe++)Ee.push(Ce)}}return Ee}
vendor: 6,972 bytes, line 3594
3594function ce(W,ne,Ee,G,ue,he){let be=new DataView(he.buffer);const Ce=Ee[W.idx[0]].width,Fe=Ee[W.idx[0]].height,Ue=3,qe=Math.floor(Ce/8),tt=Math.ceil(Ce/8),Je=Math.ceil(Fe/8),dt=Ce-(tt-1)*8,nt=Fe-(Je-1)*8,mt={value:0},bt=new Array(Ue),Rt=new Array(Ue),Si=new Array(Ue),q=new Array(Ue),ee=new Array(Ue);for(let ie=0;ie<Ue;++ie)ee[ie]=ne[W.idx[ie]],bt[ie]=ie<1?0:bt[ie-1]+tt*Je,Rt[ie]=new Float32Array(64),Si[ie]=new Uint16Array(64),q[ie]=new Uint16Array(tt*64);for(let ie=0;ie<Je;++ie){let Ie=8;ie==Je-1&&(Ie=nt);let lt=8;for(let Pi=0;Pi<tt;++Pi){Pi==tt-1&&(lt=dt);for(let di=0;di<Ue;++di)Si[di].fill(0),Si[di][0]=ue[bt[di]++],_e(mt,G,Si[di]),me(Si[di],Rt[di]),le(Rt[di]);De(Rt);for(let di=0;di<Ue;++di)Ve(Rt[di],q[di],Pi*64)}let zi=0;for(let Pi=0;Pi<Ue;++Pi){const di=Ee[W.idx[Pi]].type;for(let dn=8*ie;dn<8*ie+Ie;++dn){zi=ee[Pi][dn];for(let Ws=0;Ws<qe;++Ws){const pr=Ws*64+(dn&7)*8;be.setUint16(zi+0*2*di,q[Pi][pr+0],!0),be.setUint16(zi+1*2*di,q[Pi][pr+1],!0),be.setUint16(zi+2*2*di,q[Pi][pr+2],!0),be.setUint16(zi+3*2*di,q[Pi][pr+3],!0),be.setUint16(zi+4*2*di,q[Pi][pr+4],!0),be.setUint16(zi+5*2*di,q[Pi][pr+5],!0),be.setUint16(zi+6*2*di,q[Pi][pr+6],!0),be.setUint16(zi+7*2*di,q[Pi][pr+7],!0),zi+=8*2*di}}if(qe!=tt)for(let dn=8*ie;dn<8*ie+Ie;++dn){const Ws=ee[Pi][dn]+8*qe*2*di,pr=qe*64+(dn&7)*8;for(let nd=0;nd<lt;++nd)be.setUint16(Ws+nd*2*di,q[Pi][pr+nd],!0)}}}const Te=new Uint16Array(Ce);be=new DataView(he.buffer);for(let ie=0;ie<Ue;++ie){Ee[W.idx[ie]].decoded=!0;const Ie=Ee[W.idx[ie]].type;if(Ee[ie].type==2)for(let lt=0;lt<Fe;++lt){const zi=ee[ie][lt];for(let Pi=0;Pi<Ce;++Pi)Te[Pi]=be.getUint16(zi+Pi*2*Ie,!0);for(let Pi=0;Pi<Ce;++Pi)be.setFloat32(zi+Pi*2*Ie,xe(Te[Pi]),!0)}}}function _e(W,ne,Ee){let G,ue=1;for(;ue<64;)G=ne[W.value],G==65280?ue=64:G>>8==255?ue+=G&255:(Ee[ue]=G,ue++),W.value++}function me(W,ne){ne[0]=xe(W[0]),ne[1]=xe(W[1]),ne[2]=xe(W[5]),ne[3]=xe(W[6]),ne[4]=xe(W[14]),ne[5]=xe(W[15]),ne[6]=xe(W[27]),ne[7]=xe(W[28]),ne[8]=xe(W[2]),ne[9]=xe(W[4]),ne[10]=xe(W[7]),ne[11]=xe(W[13]),ne[12]=xe(W[16]),ne[13]=xe(W[26]),ne[14]=xe(W[29]),ne[15]=xe(W[42]),ne[16]=xe(W[3]),ne[17]=xe(W[8]),ne[18]=xe(W[12]),ne[19]=xe(W[17]),ne[20]=xe(W[25]),ne[21]=xe(W[30]),ne[22]=xe(W[41]),ne[23]=xe(W[43]),ne[24]=xe(W[9]),ne[25]=xe(W[11]),ne[26]=xe(W[18]),ne[27]=xe(W[24]),ne[28]=xe(W[31]),ne[29]=xe(W[40]),ne[30]=xe(W[44]),ne[31]=xe(W[53]),ne[32]=xe(W[10]),ne[33]=xe(W[19]),ne[34]=xe(W[23]),ne[35]=xe(W[32]),ne[36]=xe(W[39]),ne[37]=xe(W[45]),ne[38]=xe(W[52]),ne[39]=xe(W[54]),ne[40]=xe(W[20]),ne[41]=xe(W[22]),ne[42]=xe(W[33]),ne[43]=xe(W[38]),ne[44]=xe(W[46]),ne[45]=xe(W[51]),ne[46]=xe(W[55]),ne[47]=xe(W[60]),ne[48]=xe(W[21]),ne[49]=xe(W[34]),ne[50]=xe(W[37]),ne[51]=xe(W[47]),ne[52]=xe(W[50]),ne[53]=xe(W[56]),ne[54]=xe(W[59]),ne[55]=xe(W[61]),ne[56]=xe(W[35]),ne[57]=xe(W[36]),ne[58]=xe(W[48]),ne[59]=xe(W[49]),ne[60]=xe(W[57]),ne[61]=xe(W[58]),ne[62]=xe(W[62]),ne[63]=xe(W[63])}function le(W){const ne=.5*Math.cos(.7853975),Ee=.5*Math.cos(3.14159/16),G=.5*Math.cos(3.14159/8),ue=.5*Math.cos(3*3.14159/16),he=.5*Math.cos(5*3.14159/16),be=.5*Math.cos(3*3.14159/8),Ce=.5*Math.cos(7*3.14159/16),Fe=new Array(4),Ue=new Array(4),qe=new Array(4),tt=new Array(4);for(let Je=0;Je<8;++Je){const dt=Je*8;Fe[0]=G*W[dt+2],Fe[1]=be*W[dt+2],Fe[2]=G*W[dt+6],Fe[3]=be*W[dt+6],Ue[0]=Ee*W[dt+1]+ue*W[dt+3]+he*W[dt+5]+Ce*W[dt+7],Ue[1]=ue*W[dt+1]-Ce*W[dt+3]-Ee*W[dt+5]-he*W[dt+7],Ue[2]=he*W[dt+1]-Ee*W[dt+3]+Ce*W[dt+5]+ue*W[dt+7],Ue[3]=Ce*W[dt+1]-he*W[dt+3]+ue*W[dt+5]-Ee*W[dt+7],qe[0]=ne*(W[dt+0]+W[dt+4]),qe[3]=ne*(W[dt+0]-W[dt+4]),qe[1]=Fe[0]+Fe[3],qe[2]=Fe[1]-Fe[2],tt[0]=qe[0]+qe[1],tt[1]=qe[3]+qe[2],tt[2]=qe[3]-qe[2],tt[3]=qe[0]-qe[1],W[dt+0]=tt[0]+Ue[0],W[dt+1]=tt[1]+Ue[1],W[dt+2]=tt[2]+Ue[2],W[dt+3]=tt[3]+Ue[3],W[dt+4]=tt[3]-Ue[3],W[dt+5]=tt[2]-Ue[2],W[dt+6]=tt[1]-Ue[1],W[dt+7]=tt[0]-Ue[0]}for(let Je=0;Je<8;++Je)Fe[0]=G*W[16+Je],Fe[1]=be*W[16+Je],Fe[2]=G*W[48+Je],Fe[3]=be*W[48+Je],Ue[0]=Ee*W[8+Je]+ue*W[24+Je]+he*W[40+Je]+Ce*W[56+Je],Ue[1]=ue*W[8+Je]-Ce*W[24+Je]-Ee*W[40+Je]-he*W[56+Je],Ue[2]=he*W[8+Je]-Ee*W[24+Je]+Ce*W[40+Je]+ue*W[56+Je],Ue[3]=Ce*W[8+Je]-he*W[24+Je]+ue*W[40+Je]-Ee*W[56+Je],qe[0]=ne*(W[Je]+W[32+Je]),qe[3]=ne*(W[Je]-W[32+Je]),qe[1]=Fe[0]+Fe[3],qe[2]=Fe[1]-Fe[2],tt[0]=qe[0]+qe[1],tt[1]=qe[3]+qe[2],tt[2]=qe[3]-qe[2],tt[3]=qe[0]-qe[1],W[0+Je]=tt[0]+Ue[0],W[8+Je]=tt[1]+Ue[1],W[16+Je]=tt[2]+Ue[2],W[24+Je]=tt[3]+Ue[3],W[32+Je]=tt[3]-Ue[3],W[40+Je]=tt[2]-Ue[2],W[48+Je]=tt[1]-Ue[1],W[56+Je]=tt[0]-Ue[0]}function De(W){for(let ne=0;ne<64;++ne){const Ee=W[0][ne],G=W[1][ne],ue=W[2][ne];W[0][ne]=Ee+1.5747*ue,W[1][ne]=Ee-.1873*G-.4682*ue,W[2][ne]=Ee+1.8556*G}}function Ve(W,ne,Ee){for(let G=0;G<64;++G)ne[Ee+G]=cF.toHalfFloat(se(W[G]))}function se(W){return W<=1?Math.sign(W)*Math.pow(Math.abs(W),2.2):Math.sign(W)*Math.pow(T,Math.abs(W)-1)}function P(W){return new DataView(W.array.buffer,W.offset.value,W.size)}function H(W){const ne=W.viewer.buffer.slice(W.offset.value,W.offset.value+W.size),Ee=new Uint8Array(pe(ne)),G=new Uint8Array(Ee.length);return re(Ee),Ae(Ee,G),new DataView(G.buffer)}function ye(W){const ne=W.array.slice(W.offset.value,W.offset.value+W.size),Ee=q1(ne),G=new Uint8Array(Ee.length);return re(Ee),Ae(Ee,G),new DataView(G.buffer)}function Q(W){const ne=W.viewer,Ee={value:W.offset.value},G=new Uint16Array(W.width*W.scanlineBlockSize*(W.channels*W.type)),ue=new Uint8Array(8192);let he=0;const be=new Array(W.channels);for(let nt=0;nt<W.channels;nt++)be[nt]={},be[nt].start=he,be[nt].end=be[nt].start,be[nt].nx=W.width,be[nt].ny=W.lines,be[nt].size=W.type,he+=be[nt].nx*be[nt].ny*be[nt].size;const Ce=de(ne,Ee),Fe=de(ne,Ee);if(Fe>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(Ce<=Fe)for(let nt=0;nt<Fe-Ce+1;nt++)ue[nt+Ce]=Ze(ne,Ee);const Ue=new Uint16Array(65536),qe=C(ue,Ue),tt=Pe(ne,Ee);Z(W.array,ne,Ee,tt,G,he);for(let nt=0;nt<W.channels;++nt){const mt=be[nt];for(let bt=0;bt<be[nt].size;++bt)N(G,mt.start+bt,mt.nx,mt.size,mt.ny,mt.nx*mt.size,qe)}V(Ue,G,he);let Je=0;const dt=new Uint8Array(G.buffer.byteLength);for(let nt=0;nt<W.lines;nt++)for(let mt=0;mt<W.channels;mt++){const bt=be[mt],Rt=bt.nx*bt.size,Si=new Uint8Array(G.buffer,bt.end*2,Rt*2);dt.set(Si,Je),Je+=Rt*2,bt.end+=Rt}return new DataView(dt.buffer)}function Be(W){const ne=W.array.slice(W.offset.value,W.offset.value+W.size),Ee=q1(ne),G=W.lines*W.channels*W.width,ue=W.type==1?new Uint16Array(G):new Uint32Array(G);let he=0,be=0;const Ce=new Array(4);for(let Fe=0;Fe<W.lines;Fe++)for(let Ue=0;Ue<W.channels;Ue++){let qe=0;switch(W.type){case 1:Ce[0]=he,Ce[1]=Ce[0]+W.width,he=Ce[1]+W.width;for(let tt=0;tt<W.width;++tt){const Je=Ee[Ce[0]++]<<8|Ee[Ce[1]++];qe+=Je,ue[be]=qe,be++}break;case 2:Ce[0]=he,Ce[1]=Ce[0]+W.width,Ce[2]=Ce[1]+W.width,he=Ce[2]+W.width;for(let tt=0;tt<W.width;++tt){const Je=Ee[Ce[0]++]<<24|Ee[Ce[1]++]<<16|Ee[Ce[2]++]<<8;qe+=Je,ue[be]=qe,be++}break}}return new DataView(ue.buffer)}function Le(W){const ne=W.viewer,Ee={value:W.offset.value},G=new Uint8Array(W.width*W.lines*(W.channels*W.type*2)),ue={ver
3594sion:pt(ne,Ee),unknownUncompressedSize:pt(ne,Ee),unknownCompressedSize:pt(ne,Ee),acCompressedSize:pt(ne,Ee),dcCompressedSize:pt(ne,Ee),rleCompressedSize:pt(ne,Ee),rleUncompressedSize:pt(ne,Ee),rleRawSize:pt(ne,Ee),totalAcUncompressedCount:pt(ne,Ee),totalDcUncompressedCount:pt(ne,Ee),acCompression:pt(ne,Ee)};if(ue.version<2)throw new Error("EXRLoader.parse: "+ze.compression+" version "+ue.version+" is unsupported");const he=new Array;let be=de(ne,Ee)-2;for(;be>0;){const mt=Ke(ne.buffer,Ee),bt=Ze(ne,Ee),Rt=bt>>2&3,Si=(bt>>4)-1,q=new Int8Array([Si])[0],ee=Ze(ne,Ee);he.push({name:mt,index:q,type:ee,compression:Rt}),be-=mt.length+3}const Ce=ze.channels,Fe=new Array(W.channels);for(let mt=0;mt<W.channels;++mt){const bt=Fe[mt]={},Rt=Ce[mt];bt.name=Rt.name,bt.compression=0,bt.decoded=!1,bt.type=Rt.pixelType,bt.pLinear=Rt.pLinear,bt.width=W.width,bt.height=W.lines}const Ue={idx:new Array(3)};for(let mt=0;mt<W.channels;++mt){const bt=Fe[mt];for(let Rt=0;Rt<he.length;++Rt){const Si=he[Rt];bt.name==Si.name&&(bt.compression=Si.compression,Si.index>=0&&(Ue.idx[Si.index]=mt),bt.offset=mt)}}let qe,tt,Je;if(ue.acCompressedSize>0)switch(ue.acCompression){case 0:qe=new Uint16Array(ue.totalAcUncompressedCount),Z(W.array,ne,Ee,ue.acCompressedSize,qe,ue.totalAcUncompressedCount);break;case 1:const mt=W.array.slice(Ee.value,Ee.value+ue.totalAcUncompressedCount),bt=q1(mt);qe=new Uint16Array(bt.buffer),Ee.value+=ue.totalAcUncompressedCount;break}if(ue.dcCompressedSize>0){const mt={array:W.array,offset:Ee,size:ue.dcCompressedSize};tt=new Uint16Array(ye(mt).buffer),Ee.value+=ue.dcCompressedSize}if(ue.rleRawSize>0){const mt=W.array.slice(Ee.value,Ee.value+ue.rleCompressedSize),bt=q1(mt);Je=pe(bt.buffer),Ee.value+=ue.rleCompressedSize}let dt=0;const nt=new Array(Fe.length);for(let mt=0;mt<nt.length;++mt)nt[mt]=new Array;for(let mt=0;mt<W.lines;++mt)for(let bt=0;bt<Fe.length;++bt)nt[bt].push(dt),dt+=Fe[bt].width*W.type*2;ce(Ue,nt,Fe,qe,tt,G);for(let mt=0;mt<Fe.length;++mt){const bt=Fe[mt];if(!bt.decoded)switch(bt.compression){case 2:let Rt=0,Si=0;for(let q=0;q<W.lines;++q){let ee=nt[mt][Rt];for(let Te=0;Te<bt.width;++Te){for(let ie=0;ie<2*bt.type;++ie)G[ee++]=Je[Si+ie*bt.width*bt.height];Si++}Rt++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(G.buffer)}function Ke(W,ne){const Ee=new Uint8Array(W);let G=0;for(;Ee[ne.value+G]!=0;)G+=1;const ue=new TextDecoder().decode(Ee.slice(ne.value,ne.value+G));return ne.value=ne.value+G+1,ue}function Re(W,ne,Ee){const G=new TextDecoder().decode(new Uint8Array(W).slice(ne.value,ne.value+Ee));return ne.value=ne.value+Ee,G}function Xe(W,ne){const Ee=Ge(W,ne),G=Pe(W,ne);return[Ee,G]}function fe(W,ne){const Ee=Pe(W,ne),G=Pe(W,ne);return[Ee,G]}function Ge(W,ne){const Ee=W.getInt32(ne.value,!0);return ne.value=ne.value+4,Ee}function Pe(W,ne){const Ee=W.getUint32(ne.value,!0);return ne.value=ne.value+4,Ee}function rt(W,ne){const Ee=W[ne.value];return ne.value=ne.value+1,Ee}function Ze(W,ne){const Ee=W.getUint8(ne.value);return ne.value=ne.value+1,Ee}const pt=function(W,ne){let Ee;return"getBigInt64"in DataView.prototype?Ee=Number(W.getBigInt64(ne.value,!0)):Ee=W.getUint32(ne.value+4,!0)+Number(W.getUint32(ne.value,!0)<<32),ne.value+=8,Ee};function At(W,ne){const Ee=W.getFloat32(ne.value,!0);return ne.value+=4,Ee}function Se(W,ne){return cF.toHalfFloat(At(W,ne))}function xe(W){const ne=(W&31744)>>10,Ee=W&1023;return(W>>15?-1:1)*(ne?ne===31?Ee?NaN:1/0:Math.pow(2,ne-15)*(1+Ee/1024):6103515625e-14*(Ee/1024))}function de(W,ne){const Ee=W.getUint16(ne.value,!0);return ne.value+=2,Ee}function Qe(W,ne){return xe(de(W,ne))}function We(W,ne,Ee,G){const ue=Ee.value,he=[];for(;Ee.value<ue+G-1;){const be=Ke(ne,Ee),Ce=Ge(W,Ee),Fe=Ze(W,Ee);Ee.value+=3;const Ue=Ge(W,Ee),qe=Ge(W,Ee);he.push({name:be,pixelType:Ce,pLinear:Fe,xSampling:Ue,ySampling:qe})}return Ee.value+=1,he}function He(W,ne){const Ee=At(W,ne),G=At(W,ne),ue=At(W,ne),he=At(W,ne),be=At(W,ne),Ce=At(W,ne),Fe=At(W,ne),Ue=At(W,ne);return{redX:Ee,redY:G,greenX:ue,greenY:he,blueX:be,blueY:Ce,whiteX:Fe,whiteY:Ue}}function ct(W,ne){const Ee=["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"],G=Ze(W,ne);return Ee[G]}function St(W,ne){const Ee=Pe(W,ne),G=Pe(W,ne),ue=Pe(W,ne),he=Pe(W,ne);return{xMin:Ee,yMin:G,xMax:ue,yMax:he}}function si(W,ne){const Ee=["INCREASING_Y"],G=Ze(W,ne);return Ee[G]}function oi(W,ne){const Ee=At(W,ne),G=At(W,ne);return[Ee,G]}function Ir(W,ne){const Ee=At(W,ne),G=At(W,ne),ue=At(W,ne);return[Ee,G,ue]}function bi(W,ne,Ee,G,ue){if(G==="string"||G==="stringvector"||G==="iccProfile")return Re(ne,Ee,ue);if(G==="chlist")return We(W,ne,Ee,ue);if(G==="chromaticities")return He(W,Ee);
3594if(G==="compression")return ct(W,Ee);if(G==="box2i")return St(W,Ee);if(G==="lineOrder")return si(W,Ee);if(G==="float")return At(W,Ee);if(G==="v2f")return oi(W,Ee);if(G==="v3f")return Ir(W,Ee);if(G==="int")return Ge(W,Ee);if(G==="rational")return Xe(W,Ee);if(G==="timecode")return fe(W,Ee);if(G==="preview")return Ee.value+=ue,"skipped";Ee.value+=ue}function Qr(W,ne,Ee){const G={};if(W.getUint32(0,!0)!=20000630)throw new Error("THREE.EXRLoader: Provided file doesn't appear to be in OpenEXR format.");G.version=W.getUint8(4);const ue=W.getUint8(5);G.spec={singleTile:!!(ue&2),longName:!!(ue&4),deepFormat:!!(ue&8),multiPart:!!(ue&16)},Ee.value=8;let he=!0;for(;he;){const be=Ke(ne,Ee);if(be==0)he=!1;else{const Ce=Ke(ne,Ee),Fe=Pe(W,Ee),Ue=bi(W,ne,Ee,Ce,Fe);Ue===void 0?console.warn(`THREE.EXRLoader: Skipped unknown header attribute type '${Ce}'.`):G[be]=Ue}}if(ue&-5)throw console.error("THREE.EXRHeader:",G),new Error("THREE.EXRLoader: Provided file is currently unsupported.");return G}function $a(W,ne,Ee,G,ue){const he={size:0,viewer:ne,array:Ee,offset:G,width:W.dataWindow.xMax-W.dataWindow.xMin+1,height:W.dataWindow.yMax-W.dataWindow.yMin+1,channels:W.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:W.channels[0].pixelType,uncompress:null,getter:null,format:null,colorSpace:fc};switch(W.compression){case"NO_COMPRESSION":he.lines=1,he.uncompress=P;break;case"RLE_COMPRESSION":he.lines=1,he.uncompress=H;break;case"ZIPS_COMPRESSION":he.lines=1,he.uncompress=ye;break;case"ZIP_COMPRESSION":he.lines=16,he.uncompress=ye;break;case"PIZ_COMPRESSION":he.lines=32,he.uncompress=Q;break;case"PXR24_COMPRESSION":he.lines=16,he.uncompress=Be;break;case"DWAA_COMPRESSION":he.lines=32,he.uncompress=Le;break;case"DWAB_COMPRESSION":he.lines=256,he.uncompress=Le;break;default:throw new Error("EXRLoader.parse: "+W.compression+" is unsupported")}if(he.scanlineBlockSize=he.lines,he.type==1)switch(ue){case rc:he.getter=Qe,he.inputSize=2;break;case yu:he.getter=de,he.inputSize=2;break}else if(he.type==2)switch(ue){case rc:he.getter=At,he.inputSize=4;break;case yu:he.getter=Se,he.inputSize=4}else throw new Error("EXRLoader.parse: unsupported pixelType "+he.type+" for "+W.compression+".");he.blockCount=(W.dataWindow.yMax+1)/he.scanlineBlockSize;for(let Ce=0;Ce<he.blockCount;Ce++)pt(ne,G);he.outputChannels=he.channels==3?4:he.channels;const be=he.width*he.height*he.outputChannels;switch(ue){case rc:he.byteArray=new Float32Array(be),he.channels<he.outputChannels&&he.byteArray.fill(1,0,be);break;case yu:he.byteArray=new Uint16Array(be),he.channels<he.outputChannels&&he.byteArray.fill(15360,0,be);break;default:console.error("THREE.EXRLoader: unsupported type: ",ue);break}return he.bytesPerLine=he.width*he.inputSize*he.channels,he.outputChannels==4?(he.format=ol,he.colorSpace=fc):(he.format=OW,he.colorSpace=Io),he}const Ll=new DataView(i),Th=new Uint8Array(i),ge={value:0},ze=Qr(Ll,i,ge),Oe=$a(ze,Ll,Th,ge,this.type),Ne={value:0},it={R:0,G:1,B:2,A:3,Y:0};for(let W=0;W<Oe.height/Oe.scanlineBlockSize;W++){const ne=Pe(Ll,ge);Oe.size=Pe(Ll,ge),Oe.lines=ne+Oe.scanlineBlockSize>Oe.height?Oe.height-ne:Oe.scanlineBlockSize;const G=Oe.size<Oe.lines*Oe.bytesPerLine?Oe.uncompress(Oe):P(Oe);ge.value+=Oe.size;for(let ue=0;ue<Oe.scanlineBlockSize;ue++){const he=ue+W*Oe.scanlineBlockSize;if(he>=Oe.height)break;for(let be=0;be<Oe.channels;be++){const Ce=it[ze.channels[be].name];for(let Fe=0;Fe<Oe.width;Fe++){Ne.value=(ue*(Oe.channels*Oe.width)+be*Oe.width+Fe)*Oe.inputSize;const Ue=(Oe.height-1-he)*(Oe.width*Oe.outputChannels)+Fe*Oe.outputChannels+Ce;Oe.byteArray[Ue]=Oe.getter(G,Ne)}}}}return{header:ze,width:Oe.width,height:Oe.height,data:Oe.byteArray,format:Oe.format,colorSpace:Oe.colorSpace,type:this.type}}setDataType(i){return this.type=i,this}load(i,r,n,a){function s(o,l){o.colorSpace=l.colorSpace,o.minFilter=pa,o.magFilter=pa,o.generateMipmaps=!1,o.flipY=!1,r&&r(o,l)}return super.load(i,s,n,a)}}const Px=new WeakMap;class lse extends BA{constructor(i){super(i),this.libraryPath="",this.libraryPending=null,this.libraryBinary=null,this.libraryConfig={},this.url="",this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.workerConfig={},this.materials=[],this.warnings=[]}setLibraryPath(i){return this.libraryPath=i,this}setWorkerLimit(i){return this.workerLimit=i,this}load(i,r,n,a){const s=new O_(this.manager);s.setPath(this.path),s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),this.url=i,s.load(i,o=>{if(Px.has(o))return Px.get(o).promise.then(r).catch(a);this.decodeObjects(o,i).then(l=>{l.userData.warnings=this.warnings,r(l)}).catch(l=>a(l))},n,a)}debug(){console.log("Task load: ",this.workerPool.map(i=>i._taskLoad))}decodeObjects(i,r){let n,a;const s=i.byteLength,o=this._getWorker(s).then(l=>(n=l,a=this.workerNextTaskID++,new Promise((c,h)=>{n._callbacks[a]={resolve:c,reject:h},n.postMessage({type:"decode",id:a,buffer:i},[i])}))).then(l=>this._createGeometry(l.data)).catch(l=>{throw l});return o.catch(()=>!0).then(()=>{n&&a&&this._releaseTask(n,a)}),Px.set(i,{url:r,promise:o}),o}parse(i,r,n){this.decodeObjects(i,"").then(a=>{a.userData.warnings=this.warnings,r(a)}).catch(a=>n(a))}_compareMaterials(i){const r={};r.name=i.name,r.color={},r.color.r=i.color.r,r.color.g=i.color.g,r.color.b=i.color.b,r.type=i.type;const n=JSON.stringify(r);for(let a=0;a<this.materials.length;a++){const s=this.materials[a],o={};if(o.name=s.name,o.color={},o.color.r=s.color.r,o.color.g=s.color.g,o.color.b=s.color.b,o.type=s.type,JSON.stringify(o)===n)return s}return this.materials.push(i),i}_createMaterial(i,r){if(i===void 0)return new s9({color:new Kt(1,1,1),metalness:.8,name:BA.DEFAULT_MATERIAL_NAME,side:os});let n=new Lae({color:new Kt(i.diffuseColor.r/255,i.diffuseColor.g/255,i.diffuseColor.b/255),emissive:new Kt(i.emissionColor.r,i.emissionColor.g,i.emissionColor.b),flatShading:i.disableLighting,ior:i.indexOfRefraction,name:i.name,reflectivity:i.reflectivity,opacity:1-i.transparency,side:os,specularColor:i.specularColor,transparent:i.transparency>0});if(n.userData.id=i.id,i.pbrSupported){const s=i.pbr;n.anisotropy=s.anisotropy,n.anisotropyRotation=s.anisotropicRotation,n.color=new Kt(s.baseColor.r,s.baseColor.g,s.baseColor.b),n.clearCoat=s.clearCoat,n.clearCoatRoughness=s.clearCoatRoughness,n.metalness=s.metallic,n.transmission=1-s.opacity,n.roughness=s.roughness,n.sheen=s.sheen,n.specularIntensity=s.specular,n.thickness=s.subsurface}i.pbrSupported&&i.pbr.opacity===0&&i.transparency===1&&(n.opacity=.2,n.transmission=1);const a=new LO;for(let s=0;s<i.textures.length;s++){const o=i.textures[s];if(o.image!==null){const l=a.load(o.image);switch(o.type){case"Bump":n.bumpMap=l;break;case"Diffuse":n.map=l;break;case"Emap":n.envMap=l;break;case"Opacity":n.transmissionMap=l;break;case"Transparency":n.alphaMap=l,n.transparent=!0;break;case"PBR_Alpha":n.alphaMap=l,n.transparent=!0;break;case"PBR_AmbientOcclusion":n.aoMap=l;break;case"PBR_Anisotropic":n.anisotropyMap=l;break;case"PBR_BaseColor":n.map=l;break;case"PBR_Clearcoat":n.clearcoatMap=l;break;case"PBR_ClearcoatBump":n.clearcoatNormalMap=l;break;case"PBR_ClearcoatRoughness":n.clearcoatRoughnessMap=l;break;case"PBR_Displacement":n.displacementMap=l;break;case"PBR_Emission":n.emissiveMap=l;break;case"PBR_Metallic":n.metalnessMap=l;break;case"PBR_Roughness":n.roughnessMap=l;break;
3594case"PBR_Sheen":n.sheenColorMap=l;break;case"PBR_Specular":n.specularColorMap=l;break;case"PBR_Subsurface":n.thicknessMap=l;break;default:this.warnings.push({message:`THREE.3DMLoader: No conversion exists for 3dm ${o.type}.`,type:"no conversion"});break}l.wrapS=o.wrapU===0?py:Ha,l.wrapT=o.wrapV===0?py:Ha,o.repeat&&l.repeat.set(o.repeat[0],o.repeat[1])}}return r&&new ose().load(r.image,function(s){s.mapping=THREE.EquirectangularReflectionMapping,n.envMap=s}),n}_createGeometry(i){const r=new $r,n=[],a=[],s=[];r.userData.layers=i.layers,r.userData.groups=i.groups,r.userData.settings=i.settings,r.userData.settings.renderSettings=i.renderSettings,r.userData.objectType="File3dm",r.userData.materials=null,r.name=this.url;let o=i.objects;const l=i.materials;for(let c=0;c<o.length;c++){const h=o[c],u=h.attributes;switch(h.objectType){case"InstanceDefinition":a.push(h);break;case"InstanceReference":s.push(h);break;default:let d;switch(u.materialSource.name){case"ObjectMaterialSource_MaterialFromLayer":u.layerIndex>=0?d=i.layers[u.layerIndex].renderMaterialIndex:d=null;break;case"ObjectMaterialSource_MaterialFromObject":u.materialIndex>=0?d=u.materialIndex:d=null;break}let A;if(d>=0){const g=l[d];A=this._createMaterial(g,i.renderEnvironment)}else A=this._createMaterial();A=this._compareMaterials(A);const f=this._createObject(h,A);if(f===void 0)continue;const m=i.layers[u.layerIndex];f.visible=m?i.layers[u.layerIndex].visible:!0,u.isInstanceDefinitionObject?n.push(f):r.add(f);break}}for(let c=0;c<a.length;c++){const h=a[c];o=[];for(let u=0;u<h.attributes.objectIds.length;u++){const d=h.attributes.objectIds[u];for(let A=0;A<n.length;A++){const f=n[A].userData.attributes.id;d===f&&o.push(n[A])}}for(let u=0;u<s.length;u++){const d=s[u];if(d.geometry.parentIdefId===h.attributes.id){const A=new $r,f=d.geometry.xform.array,m=new _t;m.set(...f),A.applyMatrix4(m);for(let g=0;g<o.length;g++)A.add(o[g].clone(!0));r.add(A)}}}return r.userData.materials=this.materials,r.name="",r}_createObject(i,r){const n=new Yae,a=i.attributes;let s,o,l,c;switch(i.objectType){case"Point":case"PointSet":s=n.parse(i.geometry),s.attributes.hasOwnProperty("color")?o=new lD({vertexColors:!0,sizeAttenuation:!1,size:2}):(l=a.drawColor,c=new Kt(l.r/255,l.g/255,l.b/255),o=new lD({color:c,sizeAttenuation:!1,size:2})),o=this._compareMaterials(o);const h=new Dae(s,o);return h.userData.attributes=a,h.userData.objectType=i.objectType,a.name&&(h.name=a.name),h;case"Mesh":case"Extrusion":case"SubD":case"Brep":if(i.geometry===null)return;s=n.parse(i.geometry),s.attributes.hasOwnProperty("color")&&(r.vertexColors=!0),r===null&&(r=this._createMaterial(),r=this._compareMaterials(r));const u=new Kr(s,r);return u.castShadow=a.castsShadows,u.receiveShadow=a.receivesShadows,u.userData.attributes=a,u.userData.objectType=i.objectType,a.name&&(u.name=a.name),u;case"Curve":s=n.parse(i.geometry),l=a.drawColor,c=new Kt(l.r/255,l.g/255,l.b/255),o=new Xu({color:c}),o=this._compareMaterials(o);const d=new a9(s,o);return d.userData.attributes=a,d.userData.objectType=i.objectType,a.name&&(d.name=a.name),d;case"TextDot":s=i.geometry;const A=document.createElement("canvas").getContext("2d"),f=`${s.fontHeight}px ${s.fontFace}`;A.font=f;const m=A.measureText(s.text).width+10,g=s.fontHeight+10,p=window.devicePixelRatio;A.canvas.width=m*p,A.canvas.height=g*p,A.canvas.style.width=m+"px",A.canvas.style.height=g+"px",A.setTransform(p,0,0,p,0,0),A.font=f,A.textBaseline="middle",A.textAlign="center",c=a.drawColor,A.fillStyle=`rgba(${c.r},${c.g},${c.b},${c.a})`,A.fillRect(0,0,m,g),A.fillStyle="white",A.fillText(s.text,m/2,g/2);const v=new Pae(A.canvas);v.minFilter=pa,v.wrapS=Ha,v.wrapT=Ha,o=new r9({map:v,depthTest:!1});const _=new Rae(o);return _.position.set(s.point[0],s.point[1],s.point[2]),_.scale.set(m/10,g/10,1),_.userData.attributes=a,_.userData.objectType=i.objectType,a.name&&(_.name=a.name),_;case"Light":s=i.geometry;let y;switch(s.lightStyle.name){case"LightStyle_WorldPoint":y=new Qae,y.castShadow=a.castsShadows,y.position.set(s.location[0],s.location[1],s.location[2]),y.shadow.normalBias=.1;break;case"LightStyle_WorldSpot":y=new Gae,y.castShadow=a.castsShadows,y.position.set(s.location[0],s.location[1],s.location[2]),y.target.position.set(s.direction[0],s.direction[1],s.direction[2]),y.angle=s.spotAngleRadians,y.shadow.normalBias=.1;break;case"LightStyle_WorldRectangular":y=new Wae;const w=Math.abs(s.width[2]),b=Math.abs(s.length[0]);y.position.set(s.location[0]-b/2,s.location[1],s.location[2]-w/2),y.height=b,y.width=w,y.lookAt(s.direction[0],s.direction[1],s.direction[2]);break;case"LightStyle_WorldDirectional":y=new zr,y.castShadow=a.castsShadows,y.position.set(s.location[0],s.location[1],s.location[2]),y.target.position.set(s.direction[0],s.direction[1],s.direction[2]),y.shadow.normalBias=.1;break}return y&&(y.intensity=s.intensity,l=s.diffuse,c=new Kt(l.r/255,l.g/255,l.b/255),y.color=c,y.userData.attributes=a,y.userData.objectType=i.objectType),y}}_initLibrary(){if(!this.libraryPending){const i=new O_(this.manager);i.setPath(this.libraryPath);const r=new Promise((s,o)=>{i.load("rhino3dm.js",s,void 0,o)}),n=new O_(this.manager);n.setPath(this.libraryPath),n.setResponseType("arraybuffer");const a=new Promise((s,o)=>
3594{n.load("rhino3dm.wasm",s,void 0,o)});this.libraryPending=Promise.all([r,a]).then(([s,o])=>{this.libraryConfig.wasmBinary=o;const l=cse.toString(),c=["/* rhino3dm.js */",s,"/* worker */",l.substring(l.indexOf("{")+1,l.lastIndexOf("}"))].join(` 3595`);this.workerSourceURL=URL.createObjectURL(new Blob([c]))})}return this.libraryPending}_getWorker(i){return this._initLibrary().then(()=>{if(this.workerPool.length<this.workerLimit){const n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",libraryConfig:this.libraryConfig}),n.onmessage=a=>{const s=a.data;switch(s.type){case"warning":this.warnings.push(s.data),console.warn(s.data);break;case"decode":n._callbacks[s.id].resolve(s);break;case"error":n._callbacks[s.id].reject(s);break;default:console.error('THREE.Rhino3dmLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,a){return n._taskLoad>a._taskLoad?-1:1});const r=this.workerPool[this.workerPool.length-1];return r._taskLoad+=i,r})}_releaseTask(i,r){i._taskLoad-=i._taskCosts[r],delete i._callbacks[r],delete i._taskCosts[r]}dispose(){for(let i=0;i<this.workerPool.length;++i)this.workerPool[i].terminate();return this.workerPool.length=0,this}}function cse(){let t,i,r,n;onmessage=function(u){const d=u.data;switch(d.type){case"init":i=d.libraryConfig;const A=i.wasmBinary;let f;t=new Promise(function(g){f={wasmBinary:A,onRuntimeInitialized:g},rhino3dm(f)}).then(()=>{r=f});break;case"decode":n=d.id;const m=d.buffer;t.then(()=>{try{const g=a(r,m);self.postMessage({type:"decode",id:d.id,data:g})}catch(g){self.postMessage({type:"error",id:d.id,error:g})}});break}};function a(u,d){const A=new Uint8Array(d),f=u.File3dm.fromByteArray(A),m=[],g=[],p=[],v=[],_=[],y=[],w=[],b=f.objects(),E=b.count;for(let F=0;F<E;F++){const Y=b.get(F),D=l(Y,f);Y.delete(),D&&m.push(D)}for(let F=0;F<f.instanceDefinitions().count;F++){const Y=f.instanceDefinitions().get(F),D=c(Y);D.objectIds=Y.getObjectIds(),m.push({geometry:null,attributes:D,objectType:"InstanceDefinition"})}const M=[u.TextureType.Diffuse,u.TextureType.Bump,u.TextureType.Transparency,u.TextureType.Opacity,u.TextureType.Emap],S=[u.TextureType.PBR_BaseColor,u.TextureType.PBR_Subsurface,u.TextureType.PBR_SubsurfaceScattering,u.TextureType.PBR_SubsurfaceScatteringRadius,u.TextureType.PBR_Metallic,u.TextureType.PBR_Specular,u.TextureType.PBR_SpecularTint,u.TextureType.PBR_Roughness,u.TextureType.PBR_Anisotropic,u.TextureType.PBR_Anisotropic_Rotation,u.TextureType.PBR_Sheen,u.TextureType.PBR_SheenTint,u.TextureType.PBR_Clearcoat,u.TextureType.PBR_ClearcoatBump,u.TextureType.PBR_ClearcoatRoughness,u.TextureType.PBR_OpacityIor,u.TextureType.PBR_OpacityRoughness,u.TextureType.PBR_Emission,u.TextureType.PBR_AmbientOcclusion,u.TextureType.PBR_Displacement];for(let F=0;F<f.materials().count;F++){const Y=f.materials().get(F);let D=c(Y);const U=[];U.push(...s(Y,M,f)),D.pbrSupported=Y.physicallyBased().supported,D.pbrSupported&&(U.push(...s(Y,S,f)),D.pbr=c(Y.physicallyBased())),D.textures=U,g.push(D),Y.delete()}for(let F=0;F<f.layers().count;F++){const Y=f.layers().get(F),D=c(Y);p.push(D),Y.delete()}for(let F=0;F<f.views().count;F++){const Y=f.views().get(F),D=c(Y);v.push(D),Y.delete()}for(let F=0;F<f.namedViews().count;F++){const Y=f.namedViews().get(F),D=c(Y);_.push(D),Y.delete()}for(let F=0;F<f.groups().count;F++){const Y=f.groups().get(F),D=c(Y);y.push(D),Y.delete()}const T=c(f.settings()),C=f.strings().count;for(let F=0;F<C;F++)w.push(f.strings().get(F));const x=f.settings().renderSettings().renderEnvironments.reflectionId,R=f.renderContent();let L=null;for(let F=0;F<R.count;F++){const Y=R.get(F);switch(Y.kind){case"environment":if(Y.id!==x)break;const j=Y.findChild("texture").fileName;for(let J=0;J<f.embeddedFiles().count;J++){const z=f.embeddedFiles().get(J).fileName;j===z&&(L={type:"renderEnvironment",image:"data:image/png;base64,"+f.getEmbeddedFileAsBase64(j),name:j})}break}}const I={ambientLight:f.settings().renderSettings().ambientLight,backgroundColorTop:f.settings().renderSettings().backgroundColorTop,backgroundColorBottom:f.settings().renderSettings().backgroundColorBottom,useHiddenLights:f.settings().renderSettings().useHiddenLights,depthCue:f.settings().renderSettings().depthCue,flatShade:f.settings().renderSettings().flatShade,renderBackFaces:f.settings().renderSettings().renderBackFaces,renderPoints:f.settings().renderSettings().renderPoints,renderCurves:f.settings().renderSettings().renderCurves,renderIsoParams:f.settings().renderSettings().renderIsoParams,renderMeshEdges:f.settings().renderSettings().renderMeshEdges,renderAnnotations:f.settings().renderSettings().renderAnnotations,useViewportSize:f.settings().renderSettings().useViewportSize,scaleBackgroun
3595dToFit:f.settings().renderSettings().scaleBackgroundToFit,transparentBackground:f.settings().renderSettings().transparentBackground,imageDpi:f.settings().renderSettings().imageDpi,shadowMapLevel:f.settings().renderSettings().shadowMapLevel,namedView:f.settings().renderSettings().namedView,snapShot:f.settings().renderSettings().snapShot,specificViewport:f.settings().renderSettings().specificViewport,groundPlane:c(f.settings().renderSettings().groundPlane),safeFrame:c(f.settings().renderSettings().safeFrame),dithering:c(f.settings().renderSettings().dithering),skylight:c(f.settings().renderSettings().skylight),linearWorkflow:c(f.settings().renderSettings().linearWorkflow),renderChannels:c(f.settings().renderSettings().renderChannels),sun:c(f.settings().renderSettings().sun),renderEnvironments:c(f.settings().renderSettings().renderEnvironments),postEffects:c(f.settings().renderSettings().postEffects)};return f.delete(),{objects:m,materials:g,layers:p,views:v,namedViews:_,groups:y,strings:w,settings:T,renderSettings:I,renderEnvironment:L}}function s(u,d,A){const f=[];for(let m=0;m<d.length;m++){const g=u.getTexture(d[m]);if(g){let p=d[m].constructor.name;p=p.substring(12,p.length);const v=o(g,p,A);f.push(v),g.delete()}}return f}function o(u,d,A){const f={type:d},m=A.getEmbeddedFileAsBase64(u.fileName);f.wrapU=u.wrapU,f.wrapV=u.wrapV,f.wrapW=u.wrapW;const g=u.uvwTransform.toFloatArray(!0);return f.repeat=[g[0],g[5]],m?f.image="data:image/png;base64,"+m:(self.postMessage({type:"warning",id:n,data:{message:`THREE.3DMLoader: Image for ${d} texture not embedded in file.`,type:"missing resource"}}),f.image=null),f}function l(u,d){const A=u.geometry(),f=u.attributes();let m=A.objectType,g,p,v,_,y;switch(m){case r.ObjectType.Curve:const w=h(A,100);v={},p={},_={},v.itemSize=3,v.type="Float32Array",v.array=[];for(let T=0;T<w.length;T++)v.array.push(w[T][0]),v.array.push(w[T][1]),v.array.push(w[T][2]);p.position=v,_.attributes=p,g={data:_};break;case r.ObjectType.Point:const b=A.location;v={};const E={};p={},_={},v.itemSize=3,v.type="Float32Array",v.array=[b[0],b[1],b[2]];const M=f.drawColor(d);E.itemSize=3,E.type="Float32Array",E.array=[M.r/255,M.g/255,M.b/255],p.position=v,p.color=E,_.attributes=p,g={data:_};break;case r.ObjectType.PointSet:case r.ObjectType.Mesh:g=A.toThreejsJSON();break;case r.ObjectType.Brep:const S=A.faces();y=new r.Mesh;for(let T=0;T<S.count;T++){const C=S.get(T),x=C.getMesh(r.MeshType.Any);x&&(y.append(x),x.delete()),C.delete()}y.faces().count>0&&(y.compact(),g=y.toThreejsJSON(),S.delete()),y.delete();break;case r.ObjectType.Extrusion:y=A.getMesh(r.MeshType.Any),y&&(g=y.toThreejsJSON(),y.delete());break;case r.ObjectType.TextDot:g=c(A);break;case r.ObjectType.Light:g=c(A),g.lightStyle.name==="LightStyle_WorldLinear"&&self.postMessage({type:"warning",id:n,data:{message:`THREE.3DMLoader: No conversion exists for ${m.constructor.name} ${g.lightStyle.name}`,type:"no conversion",guid:f.id}});break;case r.ObjectType.InstanceReference:g=c(A),g.xform=c(A.xform),g.xform.array=A.xform.toFloatArray(!0);break;case r.ObjectType.SubD:A.subdivide(3),y=r.Mesh.createFromSubDControlNet(A),y&&(g=y.toThreejsJSON(),y.delete());break;default:self.postMessage({type:"warning",id:n,data:{message:`THREE.3DMLoader: Conversion not implemented for ${m.constructor.name}`,type:"not implemented",guid:f.id}});break}if(g)return p=c(f),p.geometry=c(A),f.groupCount>0&&(p.groupIds=f.getGroupList()),f.userStringCount>0&&(p.userStrings=f.getUserStrings()),A.userStringCount>0&&(p.geometry.userStrings=A.getUserStrings()),f.decals().count>0&&self.postMessage({type:"warning",id:n,data:{message:"THREE.3DMLoader: No conversion exists for the decals associated with this object.",type:"no conversion",guid:f.id}}),p.drawColor=f.drawColor(d),m=m.constructor.name,m=m.substring(11,m.length),{geometry:g,attributes:p,objectType:m};self.postMessage({type:"warning",id:n,data:{message:`THREE.3DMLoader: ${m.constructor.name} has no associated mesh geometry.`,type:"missing mesh",guid:f.id}})}function c(u){const d={};for(const A in u){const f=u[A];typeof f!="function"&&(typeof f=="object"&&f!==null&&f.hasOwnProperty("constructor")?d[A]={name:f.constructor.name,value:f.value}:typeof f=="object"&&f!==null?d[A]=c(f):d[A]=f)}return d}function h(u,d){let A=d,f=[];const m=[];
3595if(u instanceof r.LineCurve)return[u.pointAtStart,u.pointAtEnd];if(u instanceof r.PolylineCurve){A=u.pointCount;for(let v=0;v<A;v++)f.push(u.point(v));return f}if(u instanceof r.PolyCurve){const v=u.segmentCount;for(let _=0;_<v;_++){const y=u.segmentCurve(_),w=h(y,A);f=f.concat(w),y.delete()}return f}if(u instanceof r.ArcCurve&&(A=Math.floor(u.angleDegrees/5),A=A<2?2:A),u instanceof r.NurbsCurve&&u.degree===1){const v=u.tryGetPolyline();for(let _=0;_<v.count;_++)f.push(v.get(_));return v.delete(),f}const g=u.domain,p=A-1;for(let v=0;v<A;v++){const _=g[0]+v/p*(g[1]-g[0]);if(_===g[0]||_===g[1]){m.push(_);continue}const y=u.tangentAt(_),w=u.tangentAt(m.slice(-1)[0]),b=y[0]*y[0]+y[1]*y[1]+y[2]*y[2],E=w[0]*w[0]+w[1]*w[1]+w[2]*w[2],M=Math.sqrt(b*E);let S;if(M===0)S=Math.PI/2;else{const T=(y.x*w.x+y.y*w.y+y.z*w.z)/M;S=Math.acos(Math.max(-1,Math.min(1,T)))}S<.1||m.push(_)}return f=m.map(v=>u.pointAt(v)),f}}const JF={type:"change"},Lx={type:"start"},$F={type:"end"},Z1=new uE,e4=new Ld,hse=Math.cos(70*yee.DEG2RAD);class A9 extends Tp{constructor(i,r){super(),this.object=i,this.domElement=r,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new we,this.cursor=new we,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.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:kp.ROTATE,MIDDLE:kp.DOLLY,RIGHT:kp.PAN},this.touches={ONE:Hp.ROTATE,TWO:Hp.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(fe){fe.addEventListener("keydown",H),this._domElementKeyEvents=fe},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",H),this._domElementKeyEvents=null},this.saveState=function(){n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=function(){n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(JF),n.update(),s=a.NONE},this.update=function(){const fe=new we,Ge=new sp().setFromUnitVectors(i.up,new we(0,1,0)),Pe=Ge.clone().invert(),rt=new we,Ze=new sp,pt=new we,At=2*Math.PI;return function(xe=null){const de=n.object.position;fe.copy(de).sub(n.target),fe.applyQuaternion(Ge),l.setFromVector3(fe),n.autoRotate&&s===a.NONE&&x(T(xe)),n.enableDamping?(l.theta+=c.theta*n.dampingFactor,l.phi+=c.phi*n.dampingFactor):(l.theta+=c.theta,l.phi+=c.phi);let Qe=n.minAzimuthAngle,We=n.maxAzimuthAngle;isFinite(Qe)&&isFinite(We)&&(Qe<-Math.PI?Qe+=At:Qe>Math.PI&&(Qe-=At),We<-Math.PI?We+=At:We>Math.PI&&(We-=At),Qe<=We?l.theta=Math.max(Qe,Math.min(We,l.theta)):l.theta=l.theta>(Qe+We)/2?Math.max(Qe,l.theta):Math.min(We,l.theta)),l.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,l.phi)),l.makeSafe(),n.enableDamping===!0?n.target.addScaledVector(u,n.dampingFactor):n.target.add(u),n.target.sub(n.cursor),n.target.clampLength(n.minTargetRadius,n.maxTargetRadius),n.target.add(n.cursor),n.zoomToCursor&&E||n.object.isOrthographicCamera?l.radius=j(l.radius):l.radius=j(l.radius*h),fe.setFromSpherical(l),fe.applyQuaternion(Pe),de.copy(n.target).add(fe),n.object.lookAt(n.target),n.enableDamping===!0?(c.theta*=1-n.dampingFactor,c.phi*=1-n.dampingFactor,u.multiplyScalar(1-n.dampingFactor)):(c.set(0,0,0),u.set(0,0,0));let He=!1;if(n.zoomToCursor&&E){let ct=null;if(n.object.isPerspectiveCamera){const St=fe.length();ct=j(St*h);const si=St-ct;n.object.position.addScaledVector(w,si),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){const St=new we(b.x,b.y,0);St.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/h)),n.object.updateProjectionMatrix(),He=!0;const si=new we(b.x,b.y,0);si.unproject(n.object),n.object.position.sub(si).add(St),n.object.updateMatrixWorld(),ct=fe.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;ct!==null&&(this.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(ct).add(n.object.position):(Z1.origin.copy(n.object.position),Z1.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(Z1.direction))<
3595hse?i.lookAt(n.target):(e4.setFromNormalAndCoplanarPoint(n.object.up,n.target),Z1.intersectPlane(e4,n.target))))}else n.object.isOrthographicCamera&&(n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/h)),n.object.updateProjectionMatrix(),He=!0);return h=1,E=!1,He||rt.distanceToSquared(n.object.position)>o||8*(1-Ze.dot(n.object.quaternion))>o||pt.distanceToSquared(n.target)>0?(n.dispatchEvent(JF),rt.copy(n.object.position),Ze.copy(n.object.quaternion),pt.copy(n.target),He=!1,!0):!1}}(),this.dispose=function(){n.domElement.removeEventListener("contextmenu",Be),n.domElement.removeEventListener("pointerdown",me),n.domElement.removeEventListener("pointercancel",De),n.domElement.removeEventListener("wheel",P),n.domElement.removeEventListener("pointermove",le),n.domElement.removeEventListener("pointerup",De),n._domElementKeyEvents!==null&&(n._domElementKeyEvents.removeEventListener("keydown",H),n._domElementKeyEvents=null)};const n=this,a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let s=a.NONE;const o=1e-6,l=new qF,c=new qF;let h=1;const u=new we,d=new Jt,A=new Jt,f=new Jt,m=new Jt,g=new Jt,p=new Jt,v=new Jt,_=new Jt,y=new Jt,w=new we,b=new Jt;let E=!1;const M=[],S={};function T(fe){return fe!==null?2*Math.PI/60*n.autoRotateSpeed*fe:2*Math.PI/60/60*n.autoRotateSpeed}function C(){return Math.pow(.95,n.zoomSpeed)}function x(fe){c.theta-=fe}function R(fe){c.phi-=fe}const L=function(){const fe=new we;return function(Pe,rt){fe.setFromMatrixColumn(rt,0),fe.multiplyScalar(-Pe),u.add(fe)}}(),I=function(){const fe=new we;return function(Pe,rt){n.screenSpacePanning===!0?fe.setFromMatrixColumn(rt,1):(fe.setFromMatrixColumn(rt,0),fe.crossVectors(n.object.up,fe)),fe.multiplyScalar(Pe),u.add(fe)}}(),F=function(){const fe=new we;return function(Pe,rt){const Ze=n.domElement;if(n.object.isPerspectiveCamera){const pt=n.object.position;fe.copy(pt).sub(n.target);let At=fe.length();At*=Math.tan(n.object.fov/2*Math.PI/180),L(2*Pe*At/Ze.clientHeight,n.object.matrix),I(2*rt*At/Ze.clientHeight,n.object.matrix)}else n.object.isOrthographicCamera?(L(Pe*(n.object.right-n.object.left)/n.object.zoom/Ze.clientWidth,n.object.matrix),I(rt*(n.object.top-n.object.bottom)/n.object.zoom/Ze.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}}();function Y(fe){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?h/=fe:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function D(fe){n.object.isPerspectiveCamera||n.object.isOrthographicCamera?h*=fe:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function U(fe){if(!n.zoomToCursor)return;E=!0;const Ge=n.domElement.getBoundingClientRect(),Pe=fe.clientX-Ge.left,rt=fe.clientY-Ge.top,Ze=Ge.width,pt=Ge.height;b.x=Pe/Ze*2-1,b.y=-(rt/pt)*2+1,w.set(b.x,b.y,1).unproject(n.object).sub(n.object.position).normalize()}function j(fe){return Math.max(n.minDistance,Math.min(n.maxDistance,fe))}function J(fe){d.set(fe.clientX,fe.clientY)}function z(fe){U(fe),v.set(fe.clientX,fe.clientY)}function $(fe){m.set(fe.clientX,fe.clientY)}function te(fe){A.set(fe.clientX,fe.clientY),f.subVectors(A,d).multiplyScalar(n.rotateSpeed);const Ge=n.domElement;x(2*Math.PI*f.x/Ge.clientHeight),R(2*Math.PI*f.y/Ge.clientHeight),d.copy(A),n.update()}function ae(fe){_.set(fe.clientX,fe.clientY),y.subVectors(_,v),y.y>0?Y(C()):y.y<0&&D(C()),v.copy(_),n.update()}function ve(fe){g.set(fe.clientX,fe.clientY),p.subVectors(g,m).multiplyScalar(n.panSpeed),F(p.x,p.y),m.copy(g),n.update()}function oe(fe){U(fe),fe.deltaY<0?D(C()):fe.deltaY>0&&Y(C()),n.update()}function K(fe){let Ge=!1;switch(fe.code){case n.keys.UP:fe.ctrlKey||fe.metaKey||fe.shiftKey?R(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(0,n.keyPanSpeed),Ge=!0;break;case n.keys.BOTTOM:fe.ctrlKey||fe.metaKey||fe.shiftKey?R(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(0,-n.keyPanSpeed),Ge=!0;break;case n.keys.LEFT:fe.ctrlKey||fe.metaKey||fe.shiftKey?x(2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(n.keyPanSpeed,0),Ge=!0;break;case n.keys.RIGHT:fe.ctrlKey||fe.metaKey||fe.shiftKey?x(-2*Math.PI*n.rotateSpeed/n.domElement.clientHeight):F(-n.keyPanSpeed,0),Ge=!0;break}Ge&&(fe.preventDefault(),n.update())}function X(){if(M.length===1)d.set(M[0].pageX,M[0].pageY);else{const fe=.5*(M[0].pageX+M[1].pageX),Ge=.5*(M[0].pageY+M[1].pageY);d.set(fe,Ge)}}function N(){if(M.length===1)m.set(M[0].pageX,M[0].pageY);else{const fe=.5*(M[0].pageX+M[1].pageX),Ge=.5*(M[0].pageY+M[1].pageY);m.set(fe,Ge)}}function k(){const fe=M[0].pageX-M[1].pageX,Ge=M[0].pageY-M[1].pageY,Pe=Math.sqrt(fe*fe+Ge*Ge);v.set(0,Pe)}
3595function Z(){n.enableZoom&&k(),n.enablePan&&N()}function V(){n.enableZoom&&k(),n.enableRotate&&X()}function re(fe){if(M.length==1)A.set(fe.pageX,fe.pageY);else{const Pe=Xe(fe),rt=.5*(fe.pageX+Pe.x),Ze=.5*(fe.pageY+Pe.y);A.set(rt,Ze)}f.subVectors(A,d).multiplyScalar(n.rotateSpeed);const Ge=n.domElement;x(2*Math.PI*f.x/Ge.clientHeight),R(2*Math.PI*f.y/Ge.clientHeight),d.copy(A)}function Ae(fe){if(M.length===1)g.set(fe.pageX,fe.pageY);else{const Ge=Xe(fe),Pe=.5*(fe.pageX+Ge.x),rt=.5*(fe.pageY+Ge.y);g.set(Pe,rt)}p.subVectors(g,m).multiplyScalar(n.panSpeed),F(p.x,p.y),m.copy(g)}function pe(fe){const Ge=Xe(fe),Pe=fe.pageX-Ge.x,rt=fe.pageY-Ge.y,Ze=Math.sqrt(Pe*Pe+rt*rt);_.set(0,Ze),y.set(0,Math.pow(_.y/v.y,n.zoomSpeed)),Y(y.y),v.copy(_)}function ce(fe){n.enableZoom&&pe(fe),n.enablePan&&Ae(fe)}function _e(fe){n.enableZoom&&pe(fe),n.enableRotate&&re(fe)}function me(fe){n.enabled!==!1&&(M.length===0&&(n.domElement.setPointerCapture(fe.pointerId),n.domElement.addEventListener("pointermove",le),n.domElement.addEventListener("pointerup",De)),Le(fe),fe.pointerType==="touch"?ye(fe):Ve(fe))}function le(fe){n.enabled!==!1&&(fe.pointerType==="touch"?Q(fe):se(fe))}function De(fe){Ke(fe),M.length===0&&(n.domElement.releasePointerCapture(fe.pointerId),n.domElement.removeEventListener("pointermove",le),n.domElement.removeEventListener("pointerup",De)),n.dispatchEvent($F),s=a.NONE}function Ve(fe){let Ge;switch(fe.button){case 0:Ge=n.mouseButtons.LEFT;break;case 1:Ge=n.mouseButtons.MIDDLE;break;case 2:Ge=n.mouseButtons.RIGHT;break;default:Ge=-1}switch(Ge){case kp.DOLLY:if(n.enableZoom===!1)return;z(fe),s=a.DOLLY;break;case kp.ROTATE:if(fe.ctrlKey||fe.metaKey||fe.shiftKey){if(n.enablePan===!1)return;$(fe),s=a.PAN}else{if(n.enableRotate===!1)return;J(fe),s=a.ROTATE}break;case kp.PAN:if(fe.ctrlKey||fe.metaKey||fe.shiftKey){if(n.enableRotate===!1)return;J(fe),s=a.ROTATE}else{if(n.enablePan===!1)return;$(fe),s=a.PAN}break;default:s=a.NONE}s!==a.NONE&&n.dispatchEvent(Lx)}function se(fe){switch(s){case a.ROTATE:if(n.enableRotate===!1)return;te(fe);break;case a.DOLLY:if(n.enableZoom===!1)return;ae(fe);break;case a.PAN:if(n.enablePan===!1)return;ve(fe);break}}function P(fe){n.enabled===!1||n.enableZoom===!1||s!==a.NONE||(fe.preventDefault(),n.dispatchEvent(Lx),oe(fe),n.dispatchEvent($F))}function H(fe){n.enabled===!1||n.enablePan===!1||K(fe)}function ye(fe){switch(Re(fe),M.length){case 1:switch(n.touches.ONE){case Hp.ROTATE:if(n.enableRotate===!1)return;X(),s=a.TOUCH_ROTATE;break;case Hp.PAN:if(n.enablePan===!1)return;N(),s=a.TOUCH_PAN;break;default:s=a.NONE}break;case 2:switch(n.touches.TWO){case Hp.DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;Z(),s=a.TOUCH_DOLLY_PAN;break;case Hp.DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;V(),s=a.TOUCH_DOLLY_ROTATE;break;default:s=a.NONE}break;default:s=a.NONE}s!==a.NONE&&n.dispatchEvent(Lx)}function Q(fe){switch(Re(fe),s){case a.TOUCH_ROTATE:if(n.enableRotate===!1)return;re(fe),n.update();break;case a.TOUCH_PAN:if(n.enablePan===!1)return;Ae(fe),n.update();break;case a.TOUCH_DOLLY_PAN:if(n.enableZoom===!1&&n.enablePan===!1)return;ce(fe),n.update();break;case a.TOUCH_DOLLY_ROTATE:if(n.enableZoom===!1&&n.enableRotate===!1)return;_e(fe),n.update();break;default:s=a.NONE}}function Be(fe){n.enabled!==!1&&fe.preventDefault()}function Le(fe){M.push(fe)}function Ke(fe){delete S[fe.pointerId];for(let Ge=0;Ge<M.length;Ge++)if(M[Ge].pointerId==fe.pointerId){M.splice(Ge,1);return}}function Re(fe){let Ge=S[fe.pointerId];Ge===void 0&&(Ge=new Jt,S[fe.pointerId]=Ge),Ge.set(fe.pageX,fe.pageY)}function Xe(fe){const Ge=fe.pointerId===M[0].pointerId?M[1]:M[0];return S[Ge.pointerId]}n.domElement.addEventListener("contextmenu",Be),n.domElement.addEventListener("pointerdown",me),n.domElement.addEventListener("pointercancel",De),n.domElement.addEventListener("wheel",P,{passive:!1}),this.update()}}/*! 3596 * html2canvas 1.4.1 <https://html2canvas.hertzen.com> 3597 * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com> 3598 * Released under MIT License 3599 *//*! ***************************************************************************** 3600Copyright (c) Microsoft Corporation. 3601 3602Permission to use, copy, modify, and/or distribute this software for any 3603purpose with or without fee is hereby granted. 3604 3605THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 3606REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 3607AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 3608INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 3609LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 3610OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 3611PERFORMANCE OF THIS SOFTWARE. 3612***************************************************************************** */var AD=function(t,i){return AD=Object.
vendor: 4,962 bytes, line 3612
3612setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},AD(t,i)};function yc(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");AD(t,i);function r(){this.constructor=t}t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}function jo(t,i,r,n){function a(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function l(u){try{h(n.next(u))}catch(d){o(d)}}function c(u){try{h(n.throw(u))}catch(d){o(d)}}function h(u){u.done?s(u.value):a(u.value).then(l,c)}h((n=n.apply(t,i||[])).next())})}function So(t,i){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(h){return function(u){return c([h,u])}}function c(h){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(s=h[0]&2?a.return:h[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,h[1])).done)return s;switch(a=0,s&&(h=[h[0]&2,s.value]),h[0]){case 0:case 1:s=h;break;case 4:return r.label++,{value:h[1],done:!1};case 5:r.label++,a=h[1],h=[0];continue;case 7:h=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(h[0]===6||h[0]===2)){r=0;continue}if(h[0]===3&&(!s||h[1]>s[0]&&h[1]<s[3])){r.label=h[1];break}if(h[0]===6&&r.label<s[1]){r.label=s[1],s=h;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(h);break}s[2]&&r.ops.pop(),r.trys.pop();continue}h=i.call(t,r)}catch(u){h=[6,u],a=0}finally{n=s=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}var op=function(){function t(i,r,n,a){this.left=i,this.top=r,this.width=n,this.height=a}return t.prototype.add=function(i,r,n,a){return new t(this.left+i,this.top+r,this.width+n,this.height+a)},t.fromClientRect=function(i,r){return new t(r.left+i.windowBounds.left,r.top+i.windowBounds.top,r.width,r.height)},t.fromDOMRectList=function(i,r){var n=Array.from(r).find(function(a){return a.width!==0});return n?new t(n.left+i.windowBounds.left,n.top+i.windowBounds.top,n.width,n.height):t.EMPTY},t.EMPTY=new t(0,0,0,0),t}(),NO=function(t,i){return op.fromClientRect(t,i.getBoundingClientRect())},VT=function(t){for(var i=[],r=0,n=t.length;r<n;){var a=t.charCodeAt(r++);if(a>=55296&&a<=56319&&r<n){var s=t.charCodeAt(r++);(s&64512)===56320?i.push(((a&1023)<<10)+(s&1023)+65536):(i.push(a),r--)}else i.push(a)}return i},_n=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var r=t.length;if(!r)return"";for(var n=[],a=-1,s="";++a<r;){var o=t[a];o<=65535?n.push(o):(o-=65536,n.push((o>>10)+55296,o%1024+56320)),(a+1===r||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},t4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",use=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var J1=0;J1<t4.length;J1++)use[t4.charCodeAt(J1)]=J1;var i4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o_=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var $1=0;$1<i4.length;$1++)o_[i4.charCodeAt($1)]=$1;var dse=function(t){var i=t.length*.75,r=t.length,n,a=0,s,o,l,c;t[t.length-1]==="="&&(i--,t[t.length-2]==="="&&i--);var h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(i):new Array(i),u=Array.isArray(h)?h:new Uint8Array(h);for(n=0;n<r;n+=4)s=o_[t.charCodeAt(n)],o=o_[t.charCodeAt(n+1)],l=o_[t.charCodeAt(n+2)],c=o_[t.charCodeAt(n+3)],u[a++]=s<<2|o>>4,u[a++]=(o&15)<<4|l>>2,u[a++]=(l&3)<<6|c&63;return h},Ase=function(t){for(var i=t.length,r=[],n=0;n<i;n+=2)r.push(t[n+1]<<8|t[n]);return r},fse=function(t){for(var i=t.length,r=[],n=0;n<i;n+=4)r.push(t[n+3]<<24|t[n+2]<<16|t[n+1]<<8|t[n]);return r},qf=5,UO=6+5,Ox=2,pse=UO-qf,f9=65536>>qf,mse=1<<qf,Nx=mse-1,gse=1024>>qf,vse=f9+gse,_se=vse,yse=32,Ese=_se+yse,wse=65536>>UO,bse=1<<pse,Sse=bse-1,r4=function(t,i,r){return t.slice?t.slice(i,r):new Uint16Array(Array.prototype.slice.call(t,i,r))},Cse=function(t,i,r){return t.slice?t.slice(i,r):new Uint32Array(Array.prototype.slice.call(t,i,r))},Tse=function(t,i){var r=dse(t),n=Array.isArray(r)?fse(r):new Uint32Array(r),a=Array.isArray(r)?Ase(r):new Uint16Array(r),s=24,o=r4(a,s/2,n[4]/2),l=n[5]===2?r4(a,(s+n[4])/2):Cse(n,Math.ceil((s+n[4])/4));return new Mse(n[0],n[1],n[2],n[3],o,l)},Mse=function(){function t(i,r,n,a,s,o){this.initialValue=i,this.errorValue=r,this.highStart=n,this.highValueIndex=a,this.index=s,this.data=o}return t.prototype.get=function(i){var r;if(i>=0){if(i<55296||i>56319&&i<=65535)return r=this.index[i>>qf],r=(r<<Ox)+(i&Nx),this.data[r];if(i<=65535)return r=this.index[f9+(i-55296>>qf)],r=(r<<Ox)+(i&Nx),this.data[r];if(i<this.highStart)return r=Ese-wse+(i>
3612>UO),r=this.index[r],r+=i>>qf&Sse,r=this.index[r],r=(r<<Ox)+(i&Nx),this.data[r];if(i<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),n4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xse=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var ew=0;ew<n4.length;ew++)xse[n4.charCodeAt(ew)]=ew;var Rse
vendor: 52,892 bytes, line 3612
3612="KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA==",
vendor: 3,185 bytes, line 3612
3612a4=50,Bse=1,p9=2,m9=3,Ise=4,Dse=5,s4=7,g9=8,o4=9,Zd=10,fD=11,l4=12,pD=13,Pse=14,l_=15,mD=16,tw=17,_v=18,Lse=19,c4=20,gD=21,yv=22,Ux=23,om=24,Co=25,c_=26,h_=27,lm=28,Ose=29,Ef=30,Nse=31,iw=32,rw=33,vD=34,_D=35,yD=36,gy=37,ED=38,gS=39,vS=40,Fx=41,v9=42,Use=43,Fse=[9001,65288],_9="!",Li="Ã",nw="÷",wD=Tse(Rse),Ph=[Ef,yD],bD=[Bse,p9,m9,Dse],y9=[Zd,g9],h4=[h_,c_],kse=bD.concat(y9),u4=[ED,gS,vS,vD,_D],Hse=[l_,pD],Gse=function(t,i){i===void 0&&(i="strict");var r=[],n=[],a=[];return t.forEach(function(s,o){var l=wD.get(s);if(l>a4?(a.push(!0),l-=a4):a.push(!1),["normal","auto","loose"].indexOf(i)!==-1&&[8208,8211,12316,12448].indexOf(s)!==-1)return n.push(o),r.push(mD);if(l===Ise||l===fD){if(o===0)return n.push(o),r.push(Ef);var c=r[o-1];return kse.indexOf(c)===-1?(n.push(n[o-1]),r.push(c)):(n.push(o),r.push(Ef))}if(n.push(o),l===Nse)return r.push(i==="strict"?gD:gy);if(l===v9||l===Ose)return r.push(Ef);if(l===Use)return s>=131072&&s<=196605||s>=196608&&s<=262141?r.push(gy):r.push(Ef);r.push(l)}),[n,r,a]},kx=function(t,i,r,n){var a=n[r];if(Array.isArray(t)?t.indexOf(a)!==-1:t===a)for(var s=r;s<=n.length;){s++;var o=n[s];if(o===i)return!0;if(o!==Zd)break}if(a===Zd)for(var s=r;s>0;){s--;var l=n[s];if(Array.isArray(t)?t.indexOf(l)!==-1:t===l)for(var c=r;c<=n.length;){c++;var o=n[c];if(o===i)return!0;if(o!==Zd)break}if(l!==Zd)break}return!1},d4=function(t,i){for(var r=t;r>=0;){var n=i[r];if(n===Zd)r--;else return n}return 0},zse=function(t,i,r,n,a){if(r[n]===0)return Li;var s=n-1;if(Array.isArray(a)&&a[s]===!0)return Li;var o=s-1,l=s+1,c=i[s],h=o>=0?i[o]:0,u=i[l];if(c===p9&&u===m9)return Li;if(bD.indexOf(c)!==-1)return _9;if(bD.indexOf(u)!==-1||y9.indexOf(u)!==-1)return Li;if(d4(s,i)===g9)return nw;if(wD.get(t[s])===fD||(c===iw||c===rw)&&wD.get(t[l])===fD||c===s4||u===s4||c===o4||[Zd,pD,l_].indexOf(c)===-1&&u===o4||[tw,_v,Lse,om,lm].indexOf(u)!==-1||d4(s,i)===yv||kx(Ux,yv,s,i)||kx([tw,_v],gD,s,i)||kx(l4,l4,s,i))return Li;if(c===Zd)return nw;if(c===Ux||u===Ux)return Li;if(u===mD||c===mD)return nw;if([pD,l_,gD].indexOf(u)!==-1||c===Pse||h===yD&&Hse.indexOf(c)!==-1||c===lm&&u===yD||u===c4||Ph.indexOf(u)!==-1&&c===Co||Ph.indexOf(c)!==-1&&u===Co||c===h_&&[gy,iw,rw].indexOf(u)!==-1||[gy,iw,rw].indexOf(c)!==-1&&u===c_||Ph.indexOf(c)!==-1&&h4.indexOf(u)!==-1||h4.indexOf(c)!==-1&&Ph.indexOf(u)!==-1||[h_,c_].indexOf(c)!==-1&&(u===Co||[yv,l_].indexOf(u)!==-1&&i[l+1]===Co)||[yv,l_].indexOf(c)!==-1&&u===Co||c===Co&&[Co,lm,om].indexOf(u)!==-1)return Li;if([Co,lm,om,tw,_v].indexOf(u)!==-1)for(var d=s;d>=0;){var A=i[d];if(A===Co)return Li;if([lm,om].indexOf(A)!==-1)d--;else break}if([h_,c_].indexOf(u)!==-1)for(var d=[tw,_v].indexOf(c)!==-1?o:s;d>=0;){var A=i[d];if(A===Co)return Li;if([lm,om].indexOf(A)!==-1)d--;else break}if(ED===c&&[ED,gS,vD,_D].indexOf(u)!==-1||[gS,vD].indexOf(c)!==-1&&[gS,vS].indexOf(u)!==-1||[vS,_D].indexOf(c)!==-1&&u===vS||u4.indexOf(c)!==-1&&[c4,c_].indexOf(u)!==-1||u4.indexOf(u)!==-1&&c===h_||Ph.indexOf(c)!==-1&&Ph.indexOf(u)!==-1||c===om&&Ph.indexOf(u)!==-1||Ph.concat(Co).indexOf(c)!==-1&&u===yv&&Fse.indexOf(t[l])===-1||Ph.concat(Co).indexOf(u)!==-1&&c===_v)return Li;if(c===Fx&&u===Fx){for(var f=r[s],m=1;f>0&&(f--,i[f]===Fx);)m++;
vendor: 13,226 bytes, line 3612
3612if(m%2!==0)return Li}return c===iw&&u===rw?Li:nw},Qse=function(t,i){i||(i={lineBreak:"normal",wordBreak:"normal"});var r=Gse(t,i.lineBreak),n=r[0],a=r[1],s=r[2];(i.wordBreak==="break-all"||i.wordBreak==="break-word")&&(a=a.map(function(l){return[Co,Ef,v9].indexOf(l)!==-1?gy:l}));var o=i.wordBreak==="keep-all"?s.map(function(l,c){return l&&t[c]>=19968&&t[c]<=40959}):void 0;return[n,a,o]},Vse=function(){function t(i,r,n,a){this.codePoints=i,this.required=r===_9,this.start=n,this.end=a}return t.prototype.slice=function(){return _n.apply(void 0,this.codePoints.slice(this.start,this.end))},t}(),Wse=function(t,i){var r=VT(t),n=Qse(r,i),a=n[0],s=n[1],o=n[2],l=r.length,c=0,h=0;return{next:function(){if(h>=l)return{done:!0,value:null};for(var u=Li;h<l&&(u=zse(r,s,a,++h,o))===Li;);if(u!==Li||h===l){var d=new Vse(r,u,c,h);return c=h,{value:d,done:!1}}return{done:!0,value:null}}}},jse=1,Yse=2,pE=4,A4=8,tC=10,f4=47,U_=92,Kse=9,Xse=32,aw=34,Ev=61,qse=35,Zse=36,Jse=37,sw=39,ow=40,wv=41,$se=95,Js=45,eoe=33,toe=60,ioe=62,roe=64,noe=91,aoe=93,soe=61,ooe=123,lw=63,loe=125,p4=124,coe=126,hoe=128,m4=65533,Hx=42,Mf=43,uoe=44,doe=58,Aoe=59,vy=46,foe=0,poe=8,moe=11,goe=14,voe=31,_oe=127,Cc=-1,E9=48,w9=97,b9=101,yoe=102,Eoe=117,woe=122,S9=65,C9=69,T9=70,boe=85,Soe=90,ns=function(t){return t>=E9&&t<=57},Coe=function(t){return t>=55296&&t<=57343},cm=function(t){return ns(t)||t>=S9&&t<=T9||t>=w9&&t<=yoe},Toe=function(t){return t>=w9&&t<=woe},Moe=function(t){return t>=S9&&t<=Soe},xoe=function(t){return Toe(t)||Moe(t)},Roe=function(t){return t>=hoe},cw=function(t){return t===tC||t===Kse||t===Xse},iC=function(t){return xoe(t)||Roe(t)||t===$se},g4=function(t){return iC(t)||ns(t)||t===Js},Boe=function(t){return t>=foe&&t<=poe||t===moe||t>=goe&&t<=voe||t===_oe},Od=function(t,i){return t!==U_?!1:i!==tC},hw=function(t,i,r){return t===Js?iC(i)||Od(i,r):iC(t)?!0:!!(t===U_&&Od(t,i))},Gx=function(t,i,r){return t===Mf||t===Js?ns(i)?!0:i===vy&&ns(r):ns(t===vy?i:t)},Ioe=function(t){var i=0,r=1;(t[i]===Mf||t[i]===Js)&&(t[i]===Js&&(r=-1),i++);for(var n=[];ns(t[i]);)n.push(t[i++]);var a=n.length?parseInt(_n.apply(void 0,n),10):0;t[i]===vy&&i++;for(var s=[];ns(t[i]);)s.push(t[i++]);var o=s.length,l=o?parseInt(_n.apply(void 0,s),10):0;(t[i]===C9||t[i]===b9)&&i++;var c=1;(t[i]===Mf||t[i]===Js)&&(t[i]===Js&&(c=-1),i++);for(var h=[];ns(t[i]);)h.push(t[i++]);var u=h.length?parseInt(_n.apply(void 0,h),10):0;return r*(a+l*Math.pow(10,-o))*Math.pow(10,c*u)},Doe={type:2},Poe={type:3},Loe={type:4},Ooe={type:13},Noe={type:8},Uoe={type:21},Foe={type:9},koe={type:10},Hoe={type:11},Goe={type:12},zoe={type:14},uw={type:23},Qoe={type:1},Voe={type:25},Woe={type:24},joe={type:26},Yoe={type:27},Koe={type:28},Xoe={type:29},qoe={type:31},SD={type:32},M9=function(){function t(){this._value=[]}return t.prototype.write=function(i){this._value=this._value.concat(VT(i))},t.prototype.read=function(){for(var i=[],r=this.consumeToken();r!==SD;)i.push(r),r=this.consumeToken();return i},t.prototype.consumeToken=function(){var i=this.consumeCodePoint();switch(i){case aw:return this.consumeStringToken(aw);case qse:var r=this.peekCodePoint(0),n=this.peekCodePoint(1),a=this.peekCodePoint(2);if(g4(r)||Od(n,a)){var s=hw(r,n,a)?Yse:jse,o=this.consumeName();return{type:5,value:o,flags:s}}break;case Zse:if(this.peekCodePoint(0)===Ev)return this.consumeCodePoint(),Ooe;break;case sw:return this.consumeStringToken(sw);case ow:return Doe;case wv:return Poe;case Hx:if(this.peekCodePoint(0)===Ev)return this.consumeCodePoint(),zoe;break;case Mf:if(Gx(i,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(i),this.consumeNumericToken();break;case uoe:return Loe;case Js:var l=i,c=this.peekCodePoint(0),h=this.peekCodePoint(1);if(Gx(l,c,h))return this.reconsumeCodePoint(i),this.consumeNumericToken();if(hw(l,c,h))return this.reconsumeCodePoint(i),this.consumeIdentLikeToken();if(c===Js&&h===ioe)return this.consumeCodePoint(),this.consumeCodePoint(),Woe;break;case vy:if(Gx(i,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(i),this.consumeNumericToken();break;case f4:if(this.peekCodePoint(0)===Hx)for(this.consumeCodePoint();;){var u=this.consumeCodePoint();if(u===Hx&&(u=this.consumeCodePoint(),u===f4))return this.consumeToken();if(u===Cc)return this.consumeToken()}break;case doe:return joe;case Aoe:return Yoe;case toe:if(this.peekCodePoint(0)===eoe&&this.peekCodePoint(1)===Js&&this.peekCodePoint(2)===Js)return this.consumeCodePoint(),this.consumeCodePoint(),Voe;break;case roe:var d=this.peekCodePoint(0),A=this.peekCodePoint(1),f=this.peekCodePoint(2);if(hw(d,A,f)){var o=this.consumeName();return{type:7,value:o}}break;case noe:return Koe;case U_:if(Od(i,this.peekCodePoint(0)))return this.reconsumeCodePoint(i),this.consumeIdentLikeToken();break;case aoe:return Xoe;case soe:if(this.peekCodePoint(0)===Ev)return this.consumeCodePoint(),Noe;break;case ooe:return Hoe;case loe:return Goe;case Eoe:case boe:var m=this.peekCodePoint(0),g=this.peekCodePoint(1);return m===Mf&&(cm(g)||g===lw)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(i),this.consumeIdentLikeToken();case p4:if(this.peekCodePoint(0)===Ev)return this.consumeCodePoint(),Foe;if(this.peekCodePoint(0)===p4)return this.consumeCodePoint(),Uoe;break;case coe:if(this.peekCodePoint(0)===Ev)return this.consumeCodePoint(),koe;break;case Cc:return SD}return cw(i)?(this.consumeWhiteSpace(),qoe):ns(i)?(this.reconsumeCodePoint(i),this.consumeNumericToken()):iC(i)?(this.reconsumeCodePoint(i),this.consumeIdentLikeToken()):{type:6,value:_n(i)}},t.prototype.consumeCodePoint=function(){var i=this._value.shift();return typeof i>"u"?-1:i},t.prototype.reconsumeCodePoint=function(i){this._value.unshift(i)},t.prototype.peekCodePoint=function(i){return i>=this._value.length?-1:this._value[i]},t.prototype.consumeUnicodeRangeToken=function(){for(var i=[],r=this.consumeCodePoint();cm(r)&&i.length<6;)i.push(r),r=this.consumeCodePoint();for(var n=!1;r===lw&&i.length<6;)i.push(r),r=this.consumeCodePoint(),n=!0;if(n){var a=parseInt(_n.apply(void 0,i.map(function(c){return c===lw?E9:c})),16),s=parseInt(_n.apply(void 0,i.map(function(c){return c===lw?T9:c})),16);return{type:30,start:a,end:s}}var o=parseInt(_n.apply(void 0,i),16);if(this.peekCodePoint(0)===Js&&cm(this.peekCodePoint(1))){this.consumeCodePoint(),r=this.consumeCodePoint();for(var l=[];cm(r)&&l.length<6;)l.push(r),r=this.consumeCodePoint();var s=parseInt(_n.apply(void 0,l),16);return{type:30,start:o,end:s}}else return{type:30,start:o,end:o}},t.prototype.consumeIdentLikeToken=function(){var i=this.consumeName();return i.toLowerCase()==="url"&&this.peekCodePoint(0)===ow?(this.consumeCodePoint(),this.consumeUrlToken()):this.peekCodePoint(0)===ow?(this.consumeCodePoint(),{type:19,value:i}):{type:20,value:i}},t.prototype.consumeUrlToken=function(){var i=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===Cc)return{type:22,value:""};var r=this.peekCodePoint(0);if(r===sw||r===aw){var n=this.consumeStringToken(this.consumeCodePoint());return n.type===0&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===Cc||this.peekCodePoint(0)===wv)?(this.consumeCodePoint(),{type:22,value:n.value}):(this.consumeBadUrlRemnants(),uw)}for(;;){var a=this.consumeCodePoint();if(a===Cc||a===wv)return{type:22,value:_n.apply(void 0,i)};if(cw(a))return this.consumeWhiteSpace(),this.peekCodePoint(0)===Cc||this.peekCodePoint(0)===wv?(this.consumeCodePoint(),{type:22,value:_n.apply(void 0,i)}):(this.consumeBadUrlRemnants(),uw);if(a===aw||a===sw||a===ow||Boe(a))return this.consumeBadUrlRemnants(),uw;if(a===U_)if(Od(a,this.peekCodePoint(0)))i.push(this.consumeEscapedCodePoint());else return this.consumeBadUrlRemnants(),uw;else i.push(a)}},t.prototype.consumeWhiteSpace=function(){for(;cw(this.peekCodePoint(0));)this.consumeCodePoint()},t.prototype.consumeBadUrlRemnants=function(){for(;;){var i=this.consumeCodePoint();if(i===wv||i===Cc)return;Od(i,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},t.prototype.consumeStringSlice=function(i){for(var r=5e4,n="";i>0;){var a=Math.min(r,i);n+=_n.apply(void 0,this._value.splice(0,a)),i-=a}return this._value.shift(),n},t.prototype.consumeStringToken=function(i){var r="",n=0;do{var a=this._value[n];if(a===Cc||a===void 0||a===i)return r+=this.consumeStringSlice(n),{type:0,value:r};if(a===tC)return this._value.splice(0,n),Qoe;if(a===U_){var s=this._value[n+1];s!==Cc&&s!==void 0&&(s===tC?(r+=this.consumeStringSlice(n),n=-1,this._value.shift()):Od(a,s)&&(r+=this.consumeStringSlice(n),r+=_n(this.consumeEscapedCodePoint()),n=-1))}n++}while(!0)},t.prototype.consumeNumber=function(){var i=[],r=pE,n=this.peekCodePoint(0);for((n===Mf||n===Js)&&i.push(this.consumeCodePoint());ns(this.peekCodePoint(0));)i.push(this.consumeCodePoint());n=this.peekCodePoint(0);var a=this.peekCodePoint(1);if(n===vy&&ns(a))for(i.push(this.consumeCodePoint(),this.consumeCodePoint()),r=A4;ns(this.peekCodePoint(0));)i.push(this.consumeCodePoint());n=this.peekCodePoint(0),a=this.peekCodePoint(1);var s=this.peekCodePoint(2);if((n===C9||n===b9)&&((a===Mf||a===Js)&&ns(s)||ns(a)))for(i.push(this.consumeCodePoint(),this.consumeCodePoint()),r=A4;ns(this.peekCodePoint(0));)i.push(this.consumeCodePoint());return[Ioe(i),r]},t.prototype.consumeNumericToken=function(){var i=this.consumeNumber(),r=i[0],n=i[1],a=this.peekCodePoint(0),s=this.peekCodePoint(1),o=this.peekCodePoint(2);if(hw(a,s,o)){var l=this.consumeName();return{type:15,number:r,flags:n,unit:l}}return a===Jse?(this.consumeCodePoint(),{type:16,number:r,flags:n}):{type:17,number:r,flags:n}},t.prototype.consumeEscapedCodePoint=function(){var i=this.consumeCodePoint();if(cm(i)){for(var r=_n(i);cm(this.peekCodePoint(0))&&r.length<6;)r+=_n(this.consumeCodePoint());cw(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(r,16);return n===0||Coe(n)||n>1114111?m4:n}return i===Cc?m4:i},t.prototype.consumeName=function(){for(var i="";;){var r=this.consumeCodePoint();if(g4(r))i+=_n(r);else if(Od(r,this.peekCodePoint(0)))i+=_n(this.consumeEscapedCodePoint());else return this.reconsumeCodePoint(r),i}},t}(),x9=function(){function t(i){this._tokens=i}return t.create=function(i){var r=new M9;return r.write(i),new t(r.read())},t.parseValue=function(i){return t.create(i).parseComponentValue()},t.parseValues=function(i){return t.create(i).parseComponentValues()},t.prototype.parseComponentValue=function(){for(var i=this.consumeToken();i.type===31;)i=this.consumeToken();if(i.type===32)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(i);var r=this.consumeComponentValue();do i=this.consumeToken();while(i.type===31);if(i.type===32)return r;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},t.prototype.parseComponentValues=function(){for(var i=[];;){var r=this.consumeComponentValue();if(r.type===32)return i;i.push(r),i.push()}},t.prototype.consumeComponentValue=function(){var i=this.consumeToken();switch(i.type){case 11:case 28:case 2:return this.consumeSimpleBlock(i.type);case 19:return this.consumeFunction(i)}return i},t.prototype.consumeSimpleBlock=function(i){for(var r={type:i,values:[]},n=this.consumeToken();;){if(n.type===32||Zoe(n,i))return r;this.reconsumeToken(n),r.values.push(this.consumeComponentValue()),n=this.consumeToken()}},t.prototype.consumeFunction=function(i){for(var r={name:i.value,values:[],type:18};;){var n=this.consumeToken();if(n.type===32||n.type===3)return r;this.reconsumeToken(n),r.values.push(this.consumeComponentValue())}},t.prototype.consumeToken=function(){var i=this._tokens.shift();return typeof i>"u"?SD:i},t.prototype.reconsumeToken=function(i){this._tokens.unshift(i)},t}(),mE=function(t){return t.type===15},WT=function(t){return t.type===17},hn=function(t){return t.type===20},CD=function(t,i){return hn(t)&&t.value===i},jT=function(t){return t.type!==31&&t.type!==4},yh=function(t){var i=[],r=[];return t.forEach(function(n){if(n.type===4){if(r.length===0)throw new Error("Error parsing function args, zero tokens for arg");i.push(r),r=[];return}n.type!==31&&r.push(n)}),r.length&&i.push(r),i},Zoe=function(t,i){return i===11&&t.type===12||i===28&&t.type===29?!0:i===2&&t.type===3},IA=function(t){return t.type===17||t.type===15},In=function(t){return t.type===16||IA(t)},R9=function(t){return t.length>1?[t[0],t[1]]:[t[0]]},Qa={type:17,number:0,flags:pE},FO={type:16,number:50,flags:pE},Jd={type:16,number:100,flags:pE},u_=function(t,i,r){var n=t[0],a=t[1];return[Lr(n,i),Lr(typeof a<"u"?a:n,r)]},Lr=function(t,i){if(t.type===16)return t.number/100*i;if(mE(t))switch(t.unit){case"rem":case"em":return 16*t.number;case"px":default:return t.number}return t.number},B9="deg",I9="grad",D9="rad",P9="turn",YT={name:"angle",parse:function(t,i){if(i.type===15)switch(i.unit){case B9:return Math.PI*i.number/180;case I9:return Math.PI/200*i.number;case D9:return i.number;case P9:return Math.PI*2*i.number}throw new Error("Unsupported angle type")}},L9=function(t){return t.type===15&&(t.unit===B9||t.unit===I9||t.unit===D9||t.unit===P9)},O9=function(t){var i=t.filter(hn).map(function(r){return r.value}).join(" ");switch(i){case"to bottom right":case"to right bottom":case"left top":case"top left"
vendor: 13,924 bytes, line 3612
3612:return[Qa,Qa];case"to top":case"bottom":return cl(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[Qa,Jd];case"to right":case"left":return cl(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[Jd,Jd];case"to bottom":case"top":return cl(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[Jd,Qa];case"to left":case"right":return cl(270)}return 0},cl=function(t){return Math.PI*t/180},_A={name:"color",parse:function(t,i){if(i.type===18){var r=Joe[i.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported color function "'+i.name+'"');return r(t,i.values)}if(i.type===5){if(i.value.length===3){var n=i.value.substring(0,1),a=i.value.substring(1,2),s=i.value.substring(2,3);return $d(parseInt(n+n,16),parseInt(a+a,16),parseInt(s+s,16),1)}if(i.value.length===4){var n=i.value.substring(0,1),a=i.value.substring(1,2),s=i.value.substring(2,3),o=i.value.substring(3,4);return $d(parseInt(n+n,16),parseInt(a+a,16),parseInt(s+s,16),parseInt(o+o,16)/255)}if(i.value.length===6){var n=i.value.substring(0,2),a=i.value.substring(2,4),s=i.value.substring(4,6);return $d(parseInt(n,16),parseInt(a,16),parseInt(s,16),1)}if(i.value.length===8){var n=i.value.substring(0,2),a=i.value.substring(2,4),s=i.value.substring(4,6),o=i.value.substring(6,8);return $d(parseInt(n,16),parseInt(a,16),parseInt(s,16),parseInt(o,16)/255)}}if(i.type===20){var l=_y[i.value.toUpperCase()];if(typeof l<"u")return l}return _y.TRANSPARENT}},bg=function(t){return(255&t)===0},oa=function(t){var i=255&t,r=255&t>>8,n=255&t>>16,a=255&t>>24;return i<255?"rgba("+a+","+n+","+r+","+i/255+")":"rgb("+a+","+n+","+r+")"},$d=function(t,i,r,n){return(t<<24|i<<16|r<<8|Math.round(n*255)<<0)>>>0},v4=function(t,i){if(t.type===17)return t.number;if(t.type===16){var r=i===3?1:255;return i===3?t.number/100*r:Math.round(t.number/100*r)}return 0},_4=function(t,i){var r=i.filter(jT);if(r.length===3){var n=r.map(v4),a=n[0],s=n[1],o=n[2];return $d(a,s,o,1)}if(r.length===4){var l=r.map(v4),a=l[0],s=l[1],o=l[2],c=l[3];return $d(a,s,o,c)}return 0};function zx(t,i,r){return r<0&&(r+=1),r>=1&&(r-=1),r<1/6?(i-t)*r*6+t:r<1/2?i:r<2/3?(i-t)*6*(2/3-r)+t:t}var y4=function(t,i){var r=i.filter(jT),n=r[0],a=r[1],s=r[2],o=r[3],l=(n.type===17?cl(n.number):YT.parse(t,n))/(Math.PI*2),c=In(a)?a.number/100:0,h=In(s)?s.number/100:0,u=typeof o<"u"&&In(o)?Lr(o,1):1;if(c===0)return $d(h*255,h*255,h*255,1);var d=h<=.5?h*(c+1):h+c-h*c,A=h*2-d,f=zx(A,d,l+1/3),m=zx(A,d,l),g=zx(A,d,l-1/3);return $d(f*255,m*255,g*255,u)},Joe={hsl:y4,hsla:y4,rgb:_4,rgba:_4},E4=function(t,i){return _A.parse(t,x9.create(i).parseComponentValue())},_y={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},$oe={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(t,i){return i.map(function(r){if(hn(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ele={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},KT=function(t,i){var r=_A.parse(t,i[0]),n=i[1];return n&&In(n)?{color:r,stop:n}:{color:r,stop:null}},w4=function(t,i){var r=t[0],n=t[t.length-1];r.stop===null&&(r.stop=Qa),n.stop===null&&(n.stop=Jd);for(var a=[],s=0,o=0;o<t.length;o++){var l=t[o].stop;if(l!==null){var c=Lr(l,i);c>s?a.push(c):a.push(s),s=c}else a.push(null)}for(var h=null,o=0;o<a.length;o++){var u=a[o];if(u===null)h===null&&(h=o);else if(h!==null){for(var d=o-h,A=a[h-1],f=(u-A)/(d+1),m=1;m<=d;m++)a[h+m-1]=f*m;h=null}}return t.map(function(g,p){var v=g.color;return{color:v,stop:Math.max(Math.min(1,a[p]/i),0)}})},tle=function(t,i,r){var n=i/2,a=r/2,s=Lr(t[0],i)-n,o=a-Lr(t[1],r);return(Math.atan2(o,s)+Math.PI*2)%(Math.PI*2)},ile=function(t,i,r){var n=typeof t=="number"?t:tle(t,i,r),a=Math.abs(i*Math.sin(n))+Math.abs(r*Math.cos(n)),s=i/2,o=r/2,l=a/2,c=Math.sin(n-Math.PI/2)*l,h=Math.cos(n-Math.PI/2)*l;return[a,s-h,s+h,o-c,o+c]},Xl=function(t,i){return Math.sqrt(t*t+i*i)},b4=function(t,i,r,n,a){var s=[[0,0],[0,i],[t,0],[t,i]];return s.reduce(function(o,l){var c=l[0],h=l[1],u=Xl(r-c,n-h);return(a?u<o.optimumDistance:u>o.optimumDistance)?{optimumCorner:l,optimumDistance:u}:o},{optimumDistance:a?1/0:-1/0,optimumCorner:null}).optimumCorner},rle=function(t,i,r,n,a){var s=0,o=0;switch(t.size){case 0:t.shape===0?s=o=Math.min(Math.abs(i),Math.abs(i-n),Math.abs(r),Math.abs(r-a)):t.shape===1&&(s=Math.min(Math.abs(i),Math.abs(i-n)),o=Math.min(Math.abs(r),Math.abs(r-a)));break;case 2:if(t.shape===0)s=o=Math.min(Xl(i,r),Xl(i,r-a),Xl(i-n,r),Xl(i-n,r-a));else if(t.shape===1){var l=Math.min(Math.abs(r),Math.abs(r-a))/Math.min(Math.abs(i),Math.abs(i-n)),c=b4(n,a,i,r,!0),h=c[0],u=c[1];s=Xl(h-i,(u-r)/l),o=l*s}break;case 1:t.shape===0?s=o=Math.max(Math.abs(i),Math.abs(i-n),Math.abs(r),Math.abs(r-a)):t.shape===1&&(s=Math.max(Math.abs(i),Math.abs(i-n)),o=Math.max(Math.abs(r),Math.abs(r-a)));break;case 3:if(t.shape===0)s=o=Math.max(Xl(i,r),Xl(i,r-a),Xl(i-n,r),Xl(i-n,r-a));else if(t.shape===1){var l=Math.max(Math.abs(r),Math.abs(r-a))/Math.max(Math.abs(i),Math.abs(i-n)),d=b4(n,a,i,r,!1),h=d[0],u=d[1];s=Xl(h-i,(u-r)/l),o=l*s}break}return Array.isArray(t.size)&&(s=Lr(t.size[0],n),o=t.size.length===2?Lr(t.size[1],a):s),[s,o]},nle=function(t,i){var r=cl(180),n=[];return yh(i).forEach(function(a,s){if(s===0){var o=a[0];if(o.type===20&&o.value==="to"){r=O9(a);return}else if(L9(o)){r=YT.parse(t,o);return}}var l=KT(t,a);n.push(l)}),{angle:r,stops:n,type:1}},dw=function(t,i){var r=cl(180),n=[];return yh(i).forEach(function(a,s){if(s===0){var o=a[0];if(o.type===20&&["top","left","right","bottom"].indexOf(o.value)!==-1){r=O9(a);return}else if(L9(o)){r=(YT.parse(t,o)+cl(270))%cl(360);return}}var l=KT(t,a);n.push(l)}),{angle:r,stops:n,type:1}},ale=function(t,i){var r=cl(180),n=[],a=1,s=0,o=3,l=[];return yh(i).forEach(function(c,h){var u=c[0];if(h===0){if(hn(u)&&u.value==="linear"){a=1;return}else if(hn(u)&&u.value==="radial"){a=2;return}}if(u.type===18){if(u.name==="from"){var d=_A.parse(t,u.values[0]);n.push({stop:Qa,color:d})}else if(u.name==="to"){var d=_A.parse(t,u.values[0]);n.push({stop:Jd,color:d})}else if(u.name==="color-stop"){var A=u.values.filter(jT);if(A.length===2){var d=_A.parse(t,A[1]),f=A[0];WT(f)&&n.push({stop:{type:16,number:f.number*100,flags:f.flags},color:d})}}}}),a===1?{angle:(r+cl(180))%cl(360),stops:n,type:a}:{size:o,shape:s,stops:n,position:l,type:a}},N9="closest-side",U9="farthest-side",F9="closest-corner",k9="farthest-corner",H9="circle",G9="ellipse",z9="cover",Q9="contain",sle=function(t,i){var r=0,n=3,a=[],s=[];return yh(i).forEach(function(o,l){var c=!0;if(l===0){var h=!1;c=o.reduce(function(d,A){if(h)if(hn(A))switch(A.value){case"center":return s.push(FO),d;case"top":case"left":return s.push(Qa),d;case"right":case"bottom":return s.push(Jd),d}else(In(A)||IA(A))&&s.push(A);else if(hn(A))switch(A.value){case H9:return r=0,!1;case G9:return r=1,!1;case"at":return h=!0,!1;case N9:return n=0,!1;case z9:case U9:return n=1,!1;case Q9:case F9:return n=2,!1;case k9:return n=3,!1}else if(IA(A)||In(A))return Array.isArray(n)||(n=[]),n.push(A),!1;return d},c)}if(c){var u=KT(t,o);a.push(u)}}),{size:n,shape:r,stops:a,position:s,type:2}},Aw=function(t,i){var r=0,n=3,a=[],s=[];return yh(i).forEach(function(o,l){var c=!0;if(l===0?c=o.reduce(function(u,d){if(hn(d))switch(d.value){case"center":return s.push(FO),!1;case"top":case"left":return s.push(Qa),!1;case"right":case"bottom":return s.push(Jd),!1}else if(In(d)||IA(d))return s.push(d),!1;return u},c):l===1&&(c=o.reduce(function(u,d){if(hn(d))switch(d.value){case H9:return r=0,!1;case G9:return r=1,!1;case Q9:case N9:return n=0,!1;case U9:return n=1,!1;case F9:return n=2,!1;case z9:case k9:return n=3,!1}else if(IA(d)||In(d))return Array.isArray(n)||(n=[]),n.push(d),!1;return u},c)),c){var h=KT(t,o);a.push(h)}}),{size:n,shape:r,stops:a,position:s,type:2}},ole=function(t){return t.type===1},lle=function(t){return t.type===2},kO={name:"image",parse:function(t,i){if(i.type===22){var r={url:i.value,type:0};return t.cache.addImage(i.value),r}if(i.type===18){var n=V9[i.name];if(typeof n>"u")throw new Error('Attempting to parse an unsupported image function "'+i.name+'"');return n(t,i.values)}throw new Error("Unsupported image type "+i.type)}};function cle(t){return!(t.type===20&&t.value==="none")&&(t.type!==18||!!V9[t.name])}var V9={"linear-gradient":nle,"-moz-linear-gradient":dw,"-ms-linear-gradient":dw,"-o-linear-gradient":dw,"-webkit-linear-gradient":dw,"radial-gradient":sle,"-moz-radial-gradient":Aw,"-ms-radial-gradient":Aw,"-o-radial-gradient":Aw,"-webkit-radial-gradient":Aw,"-webkit-gradient":ale},hle={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,i){if(i.length===0)return[];var r=i[0];return r.type===20&&r.value==="none"?[]:i.filter(function(n){return jT(n)&&cle(n)}).map(function(n){return kO.parse(t,n)})}},ule={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(t,i){return i.map(function(r){if(hn(r))switch(r.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},dle={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(t,i){return yh(i).map(function(r){return r.filter(In)}).map(R9)}},Ale={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(t,i){return yh(i).map(function(r){return r.filter(hn).map(function(n){return n.value}).join(" ")}).map(fle)}},fle=function(t){switch(t){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;case"repeat":default:return 0}},Sg;(function(t){t.AUTO="auto",t.CONTAIN="contain",t.COVER="cover"})(Sg||(Sg={}));var ple={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(t,i){return yh(i).map(function(r){return r.filter(mle)})}},mle=function(t){return hn(t)||In(t)},XT=function(t){return{name:"border-"+t+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},gle=XT("top"),vle=XT("right"),_le=XT("bottom"),yle=XT("left"),qT=function(t){return{name:"border-radius-"+t,initialValue:"0 0",prefix:!1,type:1,parse:function(i,r){return R9(r.filter(In))}}},Ele=qT("top-left"),wle=qT("top-right"),ble=qT("bottom-right"),Sle=qT("bottom-left"),ZT=function(t){return{name:"border-"+t+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(i,r){switch(r){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},Cle=ZT("top"),Tle=ZT("right"),Mle=ZT("bottom"),xle=ZT("left"),JT=function(t){return{name:"border-"+t+"-width",initialValue:"0",type:0,prefix:!1,parse:function(i,r){return mE(r)?r.number:0}}},Rle=JT("top"),Ble=JT("right"),Ile=JT("bottom"),Dle=JT("left"),Ple={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Lle={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(t,i){switch(i){case"rtl":return 1;case"ltr":default:return 0}}}
vendor: 14,762 bytes, line 3612
3612,Ole={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(t,i){return i.filter(hn).reduce(function(r,n){return r|Nle(n.value)},0)}},Nle=function(t){switch(t){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Ule={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(t,i){switch(i){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Fle={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(t,i){return i.type===20&&i.value==="normal"?0:i.type===17||i.type===15?i.number:0}},rC;(function(t){t.NORMAL="normal",t.STRICT="strict"})(rC||(rC={}));var kle={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,i){switch(i){case"strict":return rC.STRICT;case"normal":default:return rC.NORMAL}}},Hle={name:"line-height",initialValue:"normal",prefix:!1,type:4},S4=function(t,i){return hn(t)&&t.value==="normal"?1.2*i:t.type===17?i*t.number:In(t)?Lr(t,i):i},Gle={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(t,i){return i.type===20&&i.value==="none"?null:kO.parse(t,i)}},zle={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(t,i){switch(i){case"inside":return 0;case"outside":default:return 1}}},Qle={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(t,i){switch(i){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":return 22;case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;case"none":default:return-1}}},$T=function(t){return{name:"margin-"+t,initialValue:"0",prefix:!1,type:4}},Vle=$T("top"),Wle=$T("right"),jle=$T("bottom"),Yle=$T("left"),Kle={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(t,i){return i.filter(hn).map(function(r){switch(r.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;case"visible":default:return 0}})}},Xle={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(t,i){switch(i){case"break-word":return"break-word";case"normal":default:return"normal"}}},eM=function(t){return{name:"padding-"+t,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},qle=eM("top"),Zle=eM("right"),Jle=eM("bottom"),$le=eM("left"),ece={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(t,i){switch(i){case"right":return 2;case"center":case"justify":return 1;case"left":default:return 0}}},tce={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(t,i){switch(i){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},ice={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,i){return i.length===1&&CD(i[0],"none")?[]:yh(i).map(function(r){for(var n={color:_y.TRANSPARENT,offsetX:Qa,offsetY:Qa,blur:Qa},a=0,s=0;s<r.length;s++){var o=r[s];IA(o)?(a===0?n.offsetX=o:a===1?n.offsetY=o:n.blur=o,a++):n.color=_A.parse(t,o)}return n})}},rce={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(t,i){switch(i){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},nce={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(t,i){if(i.type===20&&i.value==="none")return null;if(i.type===18){var r=oce[i.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported transform function "'+i.name+'"');return r(i.values)}return null}},ace=function(t){var i=t.filter(function(r){return r.type===17}).map(function(r){return r.number});return i.length===6?i:null},sce=function(t){var i=t.filter(function(c){return c.type===17}).map(function(c){return c.number}),r=i[0],n=i[1];i[2],i[3];var a=i[4],s=i[5];i[6],i[7],i[8],i[9],i[10],i[11];var o=i[12],l=i[13];return i[14],i[15],i.length===16?[r,n,a,s,o,l]:null},oce={matrix:ace,matrix3d:sce},C4={type:16,number:50,flags:pE},lce=[C4,C4],cce={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(t,i){var r=i.filter(In);return r.length!==2?lce:[r[0],r[1]]}},hce={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(t,i){switch(i){case"hidden":return 1;case"collapse":return 2;case"visible":default:return 0}}},F_;(function(t){t.NORMAL="normal",t.BREAK_ALL="break-all",t.KEEP_ALL="keep-all"})(F_||(F_={}));var uce={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(t,i){switch(i){case"break-all":return F_.BREAK_ALL;case"keep-all":return F_.KEEP_ALL;case"normal":default:return F_.NORMAL}}},dce={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(t,i){if(i.type===20)return{auto:!0,order:0};if(WT(i))return{auto:!1,order:i.number};throw new Error("Invalid z-index number parsed")}},W9={name:"time",parse:function(t,i){if(i.type===15)switch(i.unit.toLowerCase()){case"s":return 1e3*i.number;case"ms":return i.number}throw new Error("Unsupported time type")}},Ace={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(t,i){return WT(i)?i.number:1}},fce={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},pce={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(t,i){return i.filter(hn).map(function(r){switch(r.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(r){return r!==0})}},mce={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(t,i){var r=[],n=[];return i.forEach(function(a){switch(a.type){case 20:case 0:r.push(a.value);break;case 17:r.push(a.number.toString());break;case 4:n.push(r.join(" ")),r.length=0;break}}),r.length&&n.push(r.join(" ")),n.map(function(a){return a.indexOf(" ")===-1?a:"'"+a+"'"})}},gce={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},vce={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(t,i){if(WT(i))return i.number;if(hn(i))switch(i.value){case"bold":return 700;case"normal":default:return 400}return 400}},_ce={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(t,i){return i.filter(hn).map(function(r){return r.value})}},yce={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(t,i){switch(i){case"oblique":return"oblique";case"italic":return"italic";case"normal":default:return"normal"}}},jn=function(t,i){return(t&i)!==0},Ece={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(t,i){return i.filter(mE).map(function(r){return W9.parse(t,r)})}},wce={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(t,i){return i.length===1&&CD(i[0],"none")?[]:yh(i).map(function(r){for(var n={color:255,offsetX:Qa,offsetY:Qa,blur:Qa,spread:Qa,inset:!1},a=0,s=0;s<r.length;s++){var o=r[s];CD(o,"inset")?n.inset=!0:IA(o)?(a===0?n.offsetX=o:a===1?n.offsetY=o:a===2?n.blur=o:n.spread=o,a++):n.color=_A.parse(t,o)}return n})}},bce={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(t,i){var r=[0,1,2],n=[];return i.filter(hn).forEach(function(a){switch(a.value){case"stroke":n.push(1);break;case"fill":n.push(0);break;case"markers":n.push(2);break}}),r.forEach(function(a){n.indexOf(a)===-1&&n.push(a)}),n}},Sce={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Cce={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(t,i){return mE(i)?i.number:0}},Tce=function(){function t(i,r){var n,a;this.animationDuration=Bt(i,Ece,r.animationDuration),this.backgroundClip=Bt(i,$oe,r.backgroundClip),this.backgroundColor=Bt(i,ele,r.backgroundColor),this.backgroundImage=Bt(i,hle,r.backgroundImage),this.backgroundOrigin=Bt(i,ule,r.backgroundOrigin),this.backgroundPosition=Bt(i,dle,r.backgroundPosition),this.backgroundRepeat=Bt(i,Ale,r.backgroundRepeat),this.backgroundSize=Bt(i,ple,r.backgroundSize),this.borderTopColor=Bt(i,gle,r.borderTopColor),this.borderRightColor=Bt(i,vle,r.borderRightColor),this.borderBottomColor=Bt(i,_le,r.borderBottomColor),this.borderLeftColor=Bt(i,yle,r.borderLeftColor),this.borderTopLeftRadius=Bt(i,Ele,r.borderTopLeftRadius),this.borderTopRightRadius=Bt(i,wle,r.borderTopRightRadius),this.borderBottomRightRadius=Bt(i,ble,r.borderBottomRightRadius),this.borderBottomLeftRadius=Bt(i,Sle,r.borderBottomLeftRadius),this.borderTopStyle=Bt(i,Cle,r.borderTopStyle),this.borderRightStyle=Bt(i,Tle,r.borderRightStyle),this.borderBottomStyle=Bt(i,Mle,r.borderBottomStyle),this.borderLeftStyle=Bt(i,xle,r.borderLeftStyle),this.borderTopWidth=Bt(i,Rle,r.borderTopWidth),this.borderRightWidth=Bt(i,Ble,r.borderRightWidth),this.borderBottomWidth=Bt(i,Ile,r.borderBottomWidth),this.borderLeftWidth=Bt(i,Dle,r.borderLeftWidth),this.boxShadow=Bt(i,wce,r.boxShadow),this.color=Bt(i,Ple,r.color),this.direction=Bt(i,Lle,r.direction),this.display=Bt(i,Ole,r.display),this.float=Bt(i,Ule,r.cssFloat),this.fontFamily=Bt(i,mce,r.fontFamily),this.fontSize=Bt(i,gce,r.fontSize),this.fontStyle=Bt(i,yce,r.fontStyle),this.fontVariant=Bt(i,_ce,r.fontVariant),this.fontWeight=Bt(i,vce,r.fontWeight),this.letterSpacing=Bt(i,Fle,r.letterSpacing),this.lineBreak=Bt(i,kle,r.lineBreak),this.lineHeight=Bt(i,Hle,r.lineHeight),this.listStyleImage=Bt(i,Gle,r.listStyleImage),this.listStylePosition=Bt(i,zle,r.listStylePosition),this.listStyleType=Bt(i,Qle,r.listStyleType),this.marginTop=Bt(i,Vle,r.marginTop),this.marginRight=Bt(i,Wle,r.marginRight),this.marginBottom=Bt(i,jle,r.marginBottom),this.marginLeft=Bt(i,Yle,r.marginLeft),this.opacity=Bt(i,Ace,r.opacity);var s=Bt(i,Kle,r.overflow);this.overflowX=s[0],this.overflowY=s[s.length>1?1:0],this.overflowWrap=Bt(i,Xle,r.overflowWrap),this.paddingTop=Bt(i,qle,r.paddingTop),this.paddingRight=Bt(i,Zle,r.paddingRight),this.paddingBottom=Bt(i,Jle,r.paddingBottom),this.paddingLeft=Bt(i,$le,r.paddingLeft),this.paintOrder=Bt(i,bce,r.paintOrder),this.position=Bt(i,tce,r.position),this.textAlign=Bt(i,ece,r.textAlign),this.textDecorationColor=Bt(i,fce,(n=r.textDecorationColor)!==null&&n!==void 0?n:r.color),this.textDecorationLine=Bt(i,pce,(a=r.textDecorationLine)!==null&&a!==void 0?a:r.textDecoration),this.textShadow=Bt(i,ice,r.textShadow),this.textTransform=Bt(i,rce,r.textTransform),this.transform=Bt(i,nce,r.transform),this.transformOrigin=Bt(i,cce,r.transformOrigin),this.visibility=Bt(i,hce,r.visibility),this.webkitTextStrokeColor=Bt(i,Sce,r.webkitTextStrokeColor),this.webkitTextStrokeWidth=Bt(i,Cce,r.webkitTextStrokeWidth),this.wordBreak=Bt(i,uce,r.wordBreak),this.zIndex=Bt(i,dce,r.zIndex)}return t.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&this.visibility===0},t.prototype.isTransparent=function(){return bg(this.backgroundColor)},t.prototype.isTransformed=function(){return this.transform!==null},t.prototype.isPositioned=function(){return this.position!==0},t.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},t.prototype.isFloating=function(){return this.float!==0},t.prototype.isInlineLevel=function(){return jn(this.display,4)||jn(this.display,33554432)||jn(this.display,268435456)||jn(this.display,536870912)||jn(this.display,67108864)||jn(this.display,134217728)},t}(),Bt=function(t,i,r){var n=new M9,a=r!==null&&typeof r<"u"?r.toString():i.initialValue;n.write(a);var s=new x9(n.read());switch(i.type){case 2:var o=s.parseComponentValue();return i.parse(t,hn(o)?o.value:i.initialValue);case 0:return i.parse(t,s.parseComponentValue());case 1:return i.parse(t,s.parseComponentValues());case 4:return s.parseComponentValue();case 3:switch(i.format){case"angle":return YT.parse(t,s.parseComponentValue());case"color":return _A.parse(t,s.parseComponentValue());case"image":return kO.parse(t,s.parseComponentValue());case"length":var l=s.parseComponentValue();return IA(l)?l:Qa;case"length-percentage":var c=s.parseComponentValue();return In(c)?c:Qa;case"time":return W9.parse(t,s.parseComponentValue())}break}},Mce="data-html2canvas-debug",xce=function(t){var i=t.getAttribute(Mce);switch(i){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}},T4=function(t,i){var r=xce(t);return r===1||i===r},Eh=function(){function t(i,r){if(this.context=i,this.textNodes=[],this.elements=[],this.flags=0,T4(r,3))debugger;this.styles=new Tce(i,window.getComputedStyle(r,null)),xhe(r)&&(this.styles.animationDuration.some(function(n){return n>0})&&(r.style.animationDuration="0s"),this.styles.transform!==null&&(r.style.transform="none")),this.bounds=NO(this.context,r),T4(r,4)&&(this.flags|=16)}return t}(),Rce
vendor: 26,160 bytes, line 3612
3612="AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA=",
3612M4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
vendor: 1,671 bytes, line 3612
3612+/",d_=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var fw=0;fw<M4.length;fw++)d_[M4.charCodeAt(fw)]=fw;var Bce=function(t){var i=t.length*.75,r=t.length,n,a=0,s,o,l,c;t[t.length-1]==="="&&(i--,t[t.length-2]==="="&&i--);var h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(i):new Array(i),u=Array.isArray(h)?h:new Uint8Array(h);for(n=0;n<r;n+=4)s=d_[t.charCodeAt(n)],o=d_[t.charCodeAt(n+1)],l=d_[t.charCodeAt(n+2)],c=d_[t.charCodeAt(n+3)],u[a++]=s<<2|o>>4,u[a++]=(o&15)<<4|l>>2,u[a++]=(l&3)<<6|c&63;return h},Ice=function(t){for(var i=t.length,r=[],n=0;n<i;n+=2)r.push(t[n+1]<<8|t[n]);return r},Dce=function(t){for(var i=t.length,r=[],n=0;n<i;n+=4)r.push(t[n+3]<<24|t[n+2]<<16|t[n+1]<<8|t[n]);return r},Zf=5,HO=6+5,Qx=2,Pce=HO-Zf,j9=65536>>Zf,Lce=1<<Zf,Vx=Lce-1,Oce=1024>>Zf,Nce=j9+Oce,Uce=Nce,Fce=32,kce=Uce+Fce,Hce=65536>>HO,Gce=1<<Pce,zce=Gce-1,x4=function(t,i,r){return t.slice?t.slice(i,r):new Uint16Array(Array.prototype.slice.call(t,i,r))},Qce=function(t,i,r){return t.slice?t.slice(i,r):new Uint32Array(Array.prototype.slice.call(t,i,r))},Vce=function(t,i){var r=Bce(t),n=Array.isArray(r)?Dce(r):new Uint32Array(r),a=Array.isArray(r)?Ice(r):new Uint16Array(r),s=24,o=x4(a,s/2,n[4]/2),l=n[5]===2?x4(a,(s+n[4])/2):Qce(n,Math.ceil((s+n[4])/4));return new Wce(n[0],n[1],n[2],n[3],o,l)},Wce=function(){function t(i,r,n,a,s,o){this.initialValue=i,this.errorValue=r,this.highStart=n,this.highValueIndex=a,this.index=s,this.data=o}return t.prototype.get=function(i){var r;if(i>=0){if(i<55296||i>56319&&i<=65535)return r=this.index[i>>Zf],r=(r<<Qx)+(i&Vx),this.data[r];if(i<=65535)return r=this.index[j9+(i-55296>>
vendor: 44,221 bytes, line 3612
3612Zf)],r=(r<<Qx)+(i&Vx),this.data[r];if(i<this.highStart)return r=kce-Hce+(i>>HO),r=this.index[r],r+=i>>Zf&zce,r=this.index[r],r=(r<<Qx)+(i&Vx),this.data[r];if(i<=1114111)return this.data[this.highValueIndex]}return this.errorValue},t}(),R4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jce=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var pw=0;pw<R4.length;pw++)jce[R4.charCodeAt(pw)]=pw;var Yce=1,Wx=2,jx=3,B4=4,I4=5,Kce=7,D4=8,Yx=9,Kx=10,P4=11,L4=12,O4=13,N4=14,Xx=15,Xce=function(t){for(var i=[],r=0,n=t.length;r<n;){var a=t.charCodeAt(r++);if(a>=55296&&a<=56319&&r<n){var s=t.charCodeAt(r++);(s&64512)===56320?i.push(((a&1023)<<10)+(s&1023)+65536):(i.push(a),r--)}else i.push(a)}return i},qce=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(String.fromCodePoint)return String.fromCodePoint.apply(String,t);var r=t.length;if(!r)return"";for(var n=[],a=-1,s="";++a<r;){var o=t[a];o<=65535?n.push(o):(o-=65536,n.push((o>>10)+55296,o%1024+56320)),(a+1===r||n.length>16384)&&(s+=String.fromCharCode.apply(String,n),n.length=0)}return s},Zce=Vce(Rce),Yo="Ã",qx="÷",Jce=function(t){return Zce.get(t)},$ce=function(t,i,r){var n=r-2,a=i[n],s=i[r-1],o=i[r];if(s===Wx&&o===jx)return Yo;if(s===Wx||s===jx||s===B4||o===Wx||o===jx||o===B4)return qx;if(s===D4&&[D4,Yx,P4,L4].indexOf(o)!==-1||(s===P4||s===Yx)&&(o===Yx||o===Kx)||(s===L4||s===Kx)&&o===Kx||o===O4||o===I4||o===Kce||s===Yce)return Yo;if(s===O4&&o===N4){for(;a===I4;)a=i[--n];if(a===N4)return Yo}if(s===Xx&&o===Xx){for(var l=0;a===Xx;)l++,a=i[--n];if(l%2===0)return Yo}return qx},ehe=function(t){var i=Xce(t),r=i.length,n=0,a=0,s=i.map(Jce);return{next:function(){if(n>=r)return{done:!0,value:null};for(var o=Yo;n<r&&(o=$ce(i,s,++n))===Yo;);if(o!==Yo||n===r){var l=qce.apply(null,i.slice(a,n));return a=n,{value:l,done:!1}}return{done:!0,value:null}}}},the=function(t){for(var i=ehe(t),r=[],n;!(n=i.next()).done;)n.value&&r.push(n.value.slice());return r},ihe=function(t){var i=123;if(t.createRange){var r=t.createRange();if(r.getBoundingClientRect){var n=t.createElement("boundtest");n.style.height=i+"px",n.style.display="block",t.body.appendChild(n),r.selectNode(n);var a=r.getBoundingClientRect(),s=Math.round(a.height);if(t.body.removeChild(n),s===i)return!0}}return!1},rhe=function(t){var i=t.createElement("boundtest");i.style.width="50px",i.style.display="block",i.style.fontSize="12px",i.style.letterSpacing="0px",i.style.wordSpacing="0px",t.body.appendChild(i);var r=t.createRange();i.innerHTML=typeof"".repeat=="function"?"👨".repeat(10):"";var n=i.firstChild,a=VT(n.data).map(function(c){return _n(c)}),s=0,o={},l=a.every(function(c,h){r.setStart(n,s),r.setEnd(n,s+c.length);var u=r.getBoundingClientRect();s+=c.length;var d=u.x>o.x||u.y>o.y;return o=u,h===0?!0:d});return t.body.removeChild(i),l},nhe=function(){return typeof new Image().crossOrigin<"u"},ahe=function(){return typeof new XMLHttpRequest().responseType=="string"},she=function(t){var i=new Image,r=t.createElement("canvas"),n=r.getContext("2d");if(!n)return!1;i.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(i,0,0),r.toDataURL()}catch{return!1}return!0},U4=function(t){return t[0]===0&&t[1]===255&&t[2]===0&&t[3]===255},ohe=function(t){var i=t.createElement("canvas"),r=100;i.width=r,i.height=r;var n=i.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,r,r);var a=new Image,s=i.toDataURL();a.src=s;var o=TD(r,r,0,0,a);return n.fillStyle="red",n.fillRect(0,0,r,r),F4(o).then(function(l){n.drawImage(l,0,0);var c=n.getImageData(0,0,r,r).data;n.fillStyle="red",n.fillRect(0,0,r,r);var h=t.createElement("div");return h.style.backgroundImage="url("+s+")",h.style.height=r+"px",U4(c)?F4(TD(r,r,0,0,h)):Promise.reject(!1)}).then(function(l){return n.drawImage(l,0,0),U4(n.getImageData(0,0,r,r).data)}).catch(function(){return!1})},TD=function(t,i,r,n,a){var s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),l=document.createElementNS(s,"foreignObject");return o.setAttributeNS(null,"width",t.toString()),o.setAttributeNS(null,"height",i.toString()),l.setAttributeNS(null,"width","100%"),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"x",r.toString()),l.setAttributeNS(null,"y",n.toString()),l.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(l),l.appendChild(a),o},F4=function(t){return new Promise(function(i,r){var n=new Image;n.onload=function(){return i(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})},To={get SUPPORT_RANGE_BOUNDS(){var t=ihe(document);return Object.defineProperty(To,"SUPPORT_RANGE_BOUNDS",{value:t}),t},get SUPPORT_WORD_BREAKING(){var t=To.SUPPORT_RANGE_BOUNDS&&rhe(document);return Object.defineProperty(To,"SUPPORT_WORD_BREAKING",{value:t}),t},get SUPPORT_SVG_DRAWING(){var t=she(document);return Object.defineProperty(To,"SUPPORT_SVG_DRAWING",{value:t}),t},get SUPPORT_FOREIGNOBJECT_DRAWING(){var t=typeof Array.from=="function"&&typeof window.fetch=="function"?ohe(document):Promise.resolve(!1);return Object.defineProperty(To,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:t}),t},get SUPPORT_CORS_IMAGES(){var t=nhe();return Object.defineProperty(To,"SUPPORT_CORS_IMAGES",{value:t}),t},get SUPPORT_RESPONSE_TYPE(){var t=ahe();return Object.defineProperty(To,"SUPPORT_RESPONSE_TYPE",{value:t}),t},get SUPPORT_CORS_XHR(){var t="withCredentials"in new XMLHttpRequest;return Object.defineProperty(To,"SUPPORT_CORS_XHR",{value:t}),t},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var t=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(To,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:t}),t}},k_=function(){function t(i,r){this.text=i,this.bounds=r}return t}(),lhe=function(t,i,r,n){var a=uhe(i,r),s=[],o=0;return a.forEach(function(l){if(r.textDecorationLine.length||l.trim().length>0)if(To.SUPPORT_RANGE_BOUNDS){var c=k4(n,o,l.length).getClientRects();if(c.length>1){var h=GO(l),u=0;h.forEach(function(A){s.push(new k_(A,op.fromDOMRectList(t,k4(n,u+o,A.length).getClientRects()))),u+=A.length})}else s.push(new k_(l,op.fromDOMRectList(t,c)))}else{var d=n.splitText(l.length);s.push(new k_(l,che(t,n))),n=d}else To.SUPPORT_RANGE_BOUNDS||(n=n.splitText(l.length));o+=l.length}),s},che=function(t,i){var r=i.ownerDocument;if(r){var n=r.createElement("html2canvaswrapper");n.appendChild(i.cloneNode(!0));var a=i.parentNode;if(a){a.replaceChild(n,i);var s=NO(t,n);return n.firstChild&&a.replaceChild(n.firstChild,n),s}}return op.EMPTY},k4=function(t,i,r){var n=t.ownerDocument;if(!n)throw new Error("Node has no owner document");var a=n.createRange();return a.setStart(t,i),a.setEnd(t,i+r),a},GO=function(t){if(To.SUPPORT_NATIVE_TEXT_SEGMENTATION){var i=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(i.segment(t)).map(function(r){return r.segment})}return the(t)},hhe=function(t,i){if(To.SUPPORT_NATIVE_TEXT_SEGMENTATION){var r=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(r.segment(t)).map(function(n){return n.segment})}return Ahe(t,i)},uhe=function(t,i){return i.letterSpacing!==0?GO(t):hhe(t,i)},dhe=[32,160,4961,65792,65793,4153,4241],Ahe=function(t,i){for(var r=Wse(t,{lineBreak:i.lineBreak,wordBreak:i.overflowWrap==="break-word"?"break-word":i.wordBreak}),n=[],a,s=function(){if(a.value){var o=a.value.slice(),l=VT(o),c="";l.forEach(function(h){dhe.indexOf(h)===-1?c+=_n(h):(c.length&&n.push(c),n.push(_n(h)),c="")}),c.length&&n.push(c)}};!(a=r.next()).done;)s();return n},fhe=function(){function t(i,r,n){this.text=phe(r.data,n.textTransform),this.textBounds=lhe(i,this.text,n,r)}return t}(),phe=function(t,i){switch(i){case 1:return t.toLowerCase();case 3:return t.replace(mhe,ghe);case 2:return t.toUpperCase();default:return t}},mhe=/(^|\s|:|-|\(|\))([a-z])/g,ghe=function(t,i,r){return t.length>0?i+r.toUpperCase():t},Y9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a.src=n.currentSrc||n.src,a.intrinsicWidth=n.naturalWidth,a.intrinsicHeight=n.naturalHeight,a.context.cache.addImage(a.src),a}return i}(Eh),K9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a.canvas=n,a.intrinsicWidth=n.width,a.intrinsicHeight=n.height,a}return i}(Eh),X9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this,s=new XMLSerializer,o=NO(r,n);return n.setAttribute("width",o.width+"px"),n.setAttribute("height",o.height+"px"),a.svg="data:image/svg+xml,"+encodeURIComponent(s.serializeToString(n)),a.intrinsicWidth=n.width.baseVal.value,a.intrinsicHeight=n.height.baseVal.value,a.context.cache.addImage(a.svg),a}return i}(Eh),q9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a.value=n.value,a}return i}(Eh),MD=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a.start=n.start,a.reversed=typeof n.reversed=="boolean"&&n.reversed===!0,a}return i}(Eh),vhe=[{type:15,flags:0,unit:"px",number:3}],_he=[{type:16,flags:0,number:50}],yhe=function(t){return t.width>t.height?new op(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width<t.height?new op(t.left,t.top+(t.height-t.width)/2,t.width,t.width):t},Ehe=function(t){var i=t.type===whe?new Array(t.value.length+1).join("â¢"):t.value;return i.length===0?t.placeholder||"":i},nC="checkbox",aC="radio",whe="password",H4=707406591,zO=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;switch(a.type=n.type.toLowerCase(),a.checked=n.checked,a.value=Ehe(n),(a.type===nC||a.type===aC)&&(a.styles.backgroundColor=3739148031,a.styles.borderTopColor=a.styles.borderRightColor=a.styles.borderBottomColor=a.styles.borderLeftColor=2779096575,a.styles.borderTopWidth=a.styles.borderRightWidth=a.styles.borderBottomWidth=a.styles.borderLeftWidth=1,a.styles.borderTopStyle=a.styles.borderRightStyle=a.styles.borderBottomStyle=a.styles.borderLeftStyle=1,a.styles.backgroundClip=[0],a.styles.backgroundOrigin=[0],a.bounds=yhe(a.bounds)),a.type){case nC:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=vhe;break;case aC:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=_he;break}return a}return i}(Eh),Z9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this,s=n.options[n.selectedIndex||0];return a.value=s&&s.text||"",a}return i}(Eh),J9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a.value=n.value,a}return i}(Eh),$9=function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;a.src=n.src,a.width=parseInt(n.width,10)||0,a.height=parseInt(n.height,10)||0,a.backgroundColor=a.styles.backgroundColor;try{if(n.contentWindow&&n.contentWindow.document&&n.contentWindow.document.documentElement){a.tree=She(r,n.contentWindow.document.documentElement);var s=n.contentWindow.document.documentElement?E4(r,getComputedStyle(n.contentWindow.document.documentElement).backgroundColor):_y.TRANSPARENT,o=n.contentWindow.document.body?E4(r,getComputedStyle(n.contentWindow.document.body).backgroundColor):_y.TRANSPARENT;a.backgroundColor=bg(s)?bg(o)?a.styles.backgroundColor:o:s}}catch{}return a}return i}(Eh),bhe=["OL","UL","MENU"],_S=function(t,i,r,n){for(var a=i.firstChild,s=void 0;a;a=s)if(s=a.nextSibling,Mhe(a)&&a.data.trim().length>0)r.textNodes.push(new fhe(t,a,r.styles));else if(tj(a))if(Uhe(a)&&a.assignedNodes)a.assignedNodes().forEach(function(l){return _S(t,l,r,n)});else{var o=ej(t,a);o.styles.isVisible()&&(Che(a,o,n)?o.flags|=4:The(o.styles)&&(o.flags|=2),bhe.indexOf(a.tagName)!==-1&&(o.flags|=8),r.elements.push(o),a.slot,a.shadowRoot?_S(t,a.shadowRoot,o,n):!rj(a)&&!ij(a)&&!nj(a)&&_S(t,a,o,n))}},ej=function(t,i){return Ohe(i)?new Y9(t,i):Lhe(i)?new K9(t,i):ij(i)?new X9(t,i):Bhe(i)?new q9(t,i):Ihe(i)?new MD(t,i):Dhe(i)?new zO(t,i):nj(i)?new Z9(t,i):rj(i)?new J9(t,i):Nhe(i)?new $9(t,i):new Eh(t,i)},She=function(t,i){var r=ej(t,i);return r.flags|=4,_S(t,i,r,r),r},Che=function(t,i,r){return i.styles.isPositionedWithZIndex()||i.styles.opacity<1||i.styles.isTransformed()||Phe(t)&&r.styles.isTransparent()},The=function(t){return t.isPositioned()||t.isFloating()},Mhe=function(t){return t.nodeType===Node.TEXT_NODE},tj=function(t){return t.nodeType===Node.ELEMENT_NODE},xhe=function(t){return tj(t)&&typeof t.style<"u"&&!Rhe(t)},Rhe=function(t){return typeof t.className=="object"},Bhe=function(t){return t.tagName==="LI"},Ihe=function(t){return t.tagName==="OL"},Dhe=function(t){return t.tagName==="INPUT"},ij=function(t){return t.tagName==="svg"},Phe=function(t){return t.tagName==="BODY"},Lhe=function(t){return t.tagName==="CANVAS"},Ohe=function(t){return t.tagName==="IMG"},Nhe=function(t){return t.tagName==="IFRAME"},rj=function(t){return t.tagName==="TEXTAREA"},nj=function(t){return t.tagName==="SELECT"},Uhe=function(t){return t.tagName==="SLOT"},G4={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},z4={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ","Õ
","Õ","Õ","Õ","Õ","Õ","Ô¿","Ô¾","Ô½","Ô¼","Ô»","Ôº","Ô¹","Ô¸","Ô·","Ô¶","Ôµ","Ô´","Ô³","Ô²","Ô±"]},Fhe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["×׳","×׳","×׳","×׳","×׳","×׳","×׳","×׳","×׳","×׳","ת","ש","ר","×§","צ","פ","×¢","ס","× ","×","×","×","××","××","××","××","××","×","×","×","×","×","×","×","×","×","×"]},khe={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["áµ","á°","á¯","á´","á®","á","á¬","á«","áª","á©","á¨","á§","á¦","á¥","á¤","á³","á¢","á¡","á ","á","á","á","á²","á","á","á","á","á","á","á±","á","á","á","á","á","á","á"]},hm=function(t,i,r,n,a,s){return t<i||t>r?QO(t,a,s.length>0):n.integers.reduce(function(o,l,c){for(;t>=l;)t-=l,o+=n.values[c];return o},"")+s},aj=function(t,i,r,n){var a="";do r||t--,a=n(t)+a,t/=i;while(t*i>=i);return a},An=function(t,i,r,n,a){var s=r-i+1;return(t<0?"-":"")+(aj(Math.abs(t),s,n,function(o){return _n(Math.floor(o%s)+i)})+a)},JA=function(t,i,r){r===void 0&&(r=". ");var n=i.length;return aj(Math.abs(t),n,!1,function(a){return i[Math.floor(a%n)]})+r},qm=1,Bd=2,Id=4,A_=8,Lh=function(t,i,r,n,a,s){if(t<-9999||t>9999)return QO(t,4,a.length>0);var o=Math.abs(t),l=a;if(o===0)return i[0]+l;for(var c=0;o>0&&c<=4;c++){var h=o%10;h===0&&jn(s,qm)&&l!==""?l=i[h]+l:h>1||h===1&&c===0||h===1&&c===1&&jn(s,Bd)||h===1&&c===1&&jn(s,Id)&&t>100||h===1&&c>1&&jn(s,A_)?l=i[h]+(c>0?r[c-1]:"")+l:h===1&&c>0&&(l=r[c-1]+l),o=Math.floor(o/10)}return(t<0?n:"")+l},Q4="åç¾åè¬",V4="æ¾ä½°ä»è¬",W4="ãã¤ãã¹",Zx="ë§ì´ëì¤",QO=function(t,i,r){var n=r?". ":"",a=r?"ã":"",s=r?", ":"",o=r?" ":"";switch(i){case 0:return"â¢"+o;case 1:return"â¦"+o;case 2:return"â¾"+o;case 5:var l=An(t,48,57,!0,n);return l.length<4?"0"+l:l;case 4:return JA(t,"ãä¸äºä¸åäºå
ä¸å
«ä¹",a);case 6:return hm(t,1,3999,G4,3,n).toLowerCase();case 7:return hm(t,1,3999,G4,3,n);case 8:return An(t,945,969,!1,n);case 9:return An(t,97,122,!1,n);case 10:return An(t,65,90,!1,n);case 11:return An(t,1632,1641,!0,n);case 12:case 49:return hm(t,1,9999,z4,3,n);case 35:return hm(t,1,9999,z4,3,n).toLowerCase();case 13:return An(t,2534,2543,!0,n);case 14:case 30:return An(t,6112,6121,!0,n);case 15:return JA(t,"åä¸å¯
å¯è¾°å·³åæªç³é
æäº¥",a);case 16:return JA(t,"ç²ä¹ä¸ä¸æå·±åºè¾å£¬ç¸",a);case 17:case 48:return Lh(t,"é¶ä¸äºä¸åäºå
ä¸å
«ä¹",Q4,"è² ",a,Bd|Id|A_);case 47:return Lh(t,"é¶å£¹è²³åèä¼é¸ææç",V4,"è² ",a,qm|Bd|Id|A_);case 42:return Lh(t,"é¶ä¸äºä¸åäºå
ä¸å
«ä¹",Q4,"è´",a,Bd|Id|A_);case 41:return Lh(t,"é¶å£¹è´°åèä¼éææç",V4,"è´",a,qm|Bd|Id|A_);case 26:return Lh(t,"ãä¸äºä¸åäºå
ä¸å
«ä¹","åç¾åä¸",W4,a,0);case 25:return Lh(t,"é¶å£±å¼ååä¼å
ä¸å
«ä¹","æ¾ç¾åä¸",W4,a,qm|Bd|Id);case 31:return Lh(t,"ìì¼ì´ì¼ì¬ì¤ì¡ì¹ í구","ìë°±ì²ë§",Zx,s,qm|Bd|Id);case 33:return Lh(t,"é¶ä¸äºä¸åäºå
ä¸å
«ä¹","åç¾åè¬",Zx,s,0);case 32:return Lh(t,"é¶å£¹è²³ååäºå
ä¸å
«ä¹","æ¾ç¾å",Zx,s,qm|Bd|Id);case 18:return An(t,2406,2415,!0,n);case 20:return hm(t,1,19999,khe,3,n);case 21:return An(t,2790,2799,!0,n);case 22:return An(t,2662,2671,!0,n);case 22:return hm(t,1,10999,Fhe,3,n);case 23:return JA(t,"ããããããããããããããããã¡ã¤ã¦ã¨ãªã«ã¬ãã®ã¯ã²ãµã¸ã»ã¾ã¿ãããããããããããããããã");case 24:return JA(t,"ããã¯ã«ã»ã¸ã¨ã¡ãã¬ããããããããã¤ããªããããã®ãããã¾ããµããã¦ãããããã¿ããã²ããã");case 27:return An(t,3302,3311,!0,n);case 28:return JA(t,"ã¢ã¤ã¦ã¨ãªã«ãã¯ã±ã³ãµã·ã¹ã»ã½ã¿ããããããããããããããããã ã¡ã¢ã¤ã¦ã¨ã©ãªã«ã¬ãã¯ã°ã±ã²ã³",a);case 29:return JA(t,"ã¤ããããããããªãã«ã²ã¯ã«ã¨ã¿ã¬ã½ãããã©ã ã¦ã°ããªã¯ã¤ãã±ãã³ã¨ãã¢ãµãã¦ã¡ãã·ã±ãã¢ã»ã¹",a);case 34:return An(t,3792,3801,!0,n);case 37:return An(t,6160,6169,!0,n);case 38:return An(t,4160,4169,!0,n);case 39:return An(t,2918,2927,!0,n);case 40:return An(t,1776,1785,!0,n);case 43:return An(t,3046,3055,!0,n);case 44:return An(t,3174,3183,!0,n);case 45:return An(t,3664,3673,!0,n);case 46:return An(t,3872,3881,!0,n);case 3:default:return An(t,48,57,!0,n)}},j4;(function(t){t[t.BEFORE=0]="BEFORE",t[t.AFTER=1]="AFTER"})(j4||(j4={}));var Hhe=function(){function t(){}return t.getOrigin=function(i){var r=t._link;return r?(r.href=i,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},t.isSameOrigin=function(i){return t.getOrigin(i)===t._origin},t.setContext=function(i){t._link=i.document.createElement("a"),t._origin=t.getOrigin(i.location.href)},t._origin="about:blank",t}(),Mt=function(){function t(i,r){this.type=0,this.x=i,this.y=r}return t.prototype.add=function(i,r){return new t(this.x+i,this.y+r)},t}(),um=function(t,i,r){return new Mt(t.x+(i.x-t.x)*r,t.y+(i.y-t.y)*r)},mw=function(){function t(i,r,n,a){this.type=1,this.start=i,this.startControl=r,this.endControl=n,this.end=a}return t.prototype.subdivide=function(i,r){var n=um(this.start,this.startControl,i),a=um(this.startControl,this.endControl,i),s=um(this.endControl,this.end,i),o=um(n,a,i),l=um(a,s,i),c=um(o,l,i);return r?new t(this.start,n,o,c):new t(c,l,s,this.end)},t.prototype.add=function(i,r){return new t(this.start.add(i,r),this.startControl.add(i,r),this.endControl.add(i,r),this.end.add(i,r))},t.prototype.reverse=function(){return new t(this.end,this.endControl,this.startControl,this.start)},t}(),$o=function(t){return t.type===1},Ghe=function(){function t(i){var r=i.styles,n=i.bounds,a=u_(r.borderTopLeftRadius,n.width,n.height),s=a[0],o=a[1],l=u_(r.borderTopRightRadius,n.width,n.height),c=l[0],h=l[1],u=u_(r.borderBottomRightRadius,n.width,n.height),d=u[0],A=u[1],f=u_(r.borderBottomLeftRadius,n.width,n.height),m=f[0],g=f[1],p=[];p.push((s+c)/n.width),p.push((m+d)/n.width),p.push((o+g)/n.height),p.push((h+A)/n.height);var v=Math.max.apply(Math,p);v>1&&(s/=v,o/=v,c/=v,h/=v,d/=v,A/=v,m/=v,g/=v);var _=n.width-c,y=n.height-A,w=n.width-d,b=n.height-g,E=r.borderTopWidth,M=r.borderRightWidth,S=r.borderBottomWidth,T=r.borderLeftWidth,C=Lr(r.paddingTop,i.bounds.width),x=Lr(r.paddingRight,i.bounds.width),R=Lr(r.paddingBottom,i.bounds.width),L=Lr(r.paddingLeft,i.bounds.width);this.topLeftBorderDoubleOuterBox=s>0||o>0?Vr(n.left+T/3,n.top+E/3,s-T/3,o-E/3,ar.TOP_LEFT):new Mt(n.left+T/3,n.top+E/3),this.topRightBorderDoubleOuterBox=s>0||o>0?Vr(n.left+_,n.top+E/3,c-M/3,h-E/3,ar.TOP_RIGHT):new Mt(n.left+n.width-M/3,n.top+E/3),this.bottomRightBorderDoubleOuterBox=d>0||A>0?Vr(n.left+w,n.top+y,d-M/3,A-S/3,ar.BOTTOM_RIGHT):new Mt(n.left+n.width-M/3,n.top+n.height-S/3),this.bottomLeftBorderDoubleOuterBox=m>0||g>0?Vr(n.left+T/3,n.top+b,m-T/3,g-S/3,ar.BOTTOM_LEFT):new Mt(n.left+T/3,n.top+n.height-S/3),this.topLeftBorderDoubleInnerBox=s>0||o>0?Vr(n.left+T*2/3,n.top+E*2/3,s-T*2/3,o-E*2/3,ar.TOP_LEFT):new Mt(n.left+T*2/3,n.top+E*2/3),this.topRightBorderDoubleInnerBox=s>0||o>0?Vr(n.left+_,n.top+E*2/3,c-M*2/3,h-E*2/3,ar.TOP_RIGHT):new Mt(n.left+n.width-M*2/3,n.top+E*2/3),this.bottomRightBorderDoubleInnerBox=d>0||A>0?Vr(n.left+w,n.top+y,d-M*2/3,A-S*2/3,ar.BOTTOM_RIGHT):new Mt(n.left+n.width-M*2/3,n.top+n.height-S*2/3),this.bottomLeftBorderDoubleInnerBox=m>0||g>0?Vr(n.left+T*2/3,n.top+b,m-T*2/3,g-S*2/3,ar.BOTTOM_LEFT):new Mt(n.left+T*2/3,n.top+n.height-S*2/3),this.topLeftBorderStroke=s>0||o>0?Vr(n.left+T/2,n.top+E/2,s-T/2,o-E/2,ar.TOP_LEFT):new Mt(n.left+T/2,n.top+E/2),this.topRightBorderStroke=s>0||o>0?Vr(n.left+_,n.top+E/2,c-M/2,h-E/2,ar.TOP_RIGHT):new Mt(n.left+n.width-M/2,n.top+E/2),this.bottomRightBorderStroke=d>0||A>0?Vr(n.left+w,n.top+y,d-M/2,A-S/2,ar.BOTTOM_RIGHT):new Mt(n.left+n.width-M/2,n.top+n.height-S/2),this.bottomLeftBorderStroke=m>0||g>0?Vr(n.left+T/2,n.top+b,m-T/2,g-S/2,ar.BOTTOM_LEFT):new Mt(n.left+T/2,n.top+n.height-S/2),this.topLeftBorderBox=s>0||o>0?Vr(n.left,n.top,s,o,ar.TOP_LEFT):new Mt(n.left,n.top),this.topRightBorderBox=c>0||h>0?Vr(n.left+_,n.top,c,h,ar.TOP_RIGHT):new Mt(n.left+n.width,n.top),this.bottomRightBorderBox=d>0||A>0?Vr(n.left+w,n.top+y,d,A,ar.BOTTOM_RIGHT):new Mt(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=m>0||g>0?Vr(n.left,n.top+b,m,g,ar.BOTTOM_LEFT):new Mt(n.left,n.top+n.height),this.topLeftPaddingBox=s>0||o>0?Vr(n.left+T,n.top+E,Math.max(0,s-T),Math.max(0,o-E),ar.TOP_LEFT):new Mt(n.left+T,n.top+E),this.topRightPaddingBox=c>0||h>0?Vr(n.left+Math.min(_,n.width-M),n.top+E,_>n.width+M?0:Math.max(0,c-M),Math.max(0,h-E),ar.TOP_RIGHT):new Mt(n.left+n.width-M,n.top+E),this.bottomRightPaddingBox=d>0||A>0?Vr(n.left+Math.min(w,n.width-T),n.top+Math.min(y,n.height-S),Math.max(0,d-M),Math.max(0,A-S),ar.BOTTOM_RIGHT):new Mt(n.left+n.width-M,n.top+n.height-S),this.bottomLeftPaddingBox=m>0||g>0?Vr(n.left+T,n.top+Math.min(b,n.height-S),Math.max(0,m-T),Math.max(0,g-S),ar.BOTTOM_LEFT):new Mt(n.left+T,n.top+n.height-S),this.topLeftContentBox=s>0||o>0?Vr(n.left+T+L,n.top+E+C,Math.max(0,s-(T+L)),Math.max(0,o-(E+C)),ar.TOP_LEFT):new Mt(n.left+T+L,n.top+E+C),this.topRightContentBox=c>0||h>0?Vr(n.left+Math.min(_,n.width+T+L),n.top+E+C,_>n.width+T+L?0:c-T+L,h-(E+C),ar.TOP_RIGHT):new Mt(n.left+n.width-(M+x),n.top+E+C),this.bottomRightContentBox=d>0||A>0?Vr(n.left+Math.min(w,n.width-(T+L)),n.top+Math.min(y,n.height+E+C),Math.max(0,d-(M+x)),A-(S+R),ar.BOTTOM_RIGHT):new Mt(n.left+n.width-(M+x),n.top+n.height-(S+R)),this.bottomLeftContentBox=m>0||g>0?Vr(n.left+T+L,n.top+b,Math.max(0,m-(T+L)),g-(S+R),ar.BOTTOM_LEFT):new Mt(n.left+T+L,n.top+n.height-(S+R))}return t}(),ar;(function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=1]="TOP_RIGHT",t[t.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",t[t.BOTTOM_LEFT=3]="BOTTOM_LEFT"})(ar||(ar={}));var Vr=function(t,i,r,n,a){var s=4*((Math.sqrt(2)-1)/3),o=r*s,l=n*s,c=t+r,h=i+n;switch(a){case ar.TOP_LEFT:return new mw(new Mt(t,h),new Mt(t,h-l),new Mt(c-o,i),new Mt(c,i));case ar.TOP_RIGHT:return new mw(new Mt(t,i),new Mt(t+o,i),new Mt(c,h-l),new Mt(c,h));case ar.BOTTOM_RIGHT:return new mw(new Mt(c,i),new Mt(c,i+l),new Mt(t+o,h),new Mt(t,h));case ar.BOTTOM_LEFT:default:return new mw(new Mt(c,h),new Mt(c-o,h),new Mt(t,i+l),new Mt(t,i))}},sC=function(t){return[t.topLeftBorderBox,t.topRightBorderBox,t.bottomRightBorderBox,t.bottomLeftBorderBox]},zhe=function(t){return[t.topLeftContentBox,t.topRightContentBox,t.bottomRightContentBox,t.bottomLeftContentBox]},oC=function(t){return[t.topLeftPaddingBox,t.topRightPaddingBox,t.bottomRightPaddingBox,t.bottomLeftPaddingBox]},Qhe=function(){function t(i,r,n){this.offsetX=i,this.offsetY=r,this.matrix=n,this.type=0,this.target=6}return t}(),gw=function(){function t(i,r){this.path=i,this.target=r,this.type=1}return t}(),Vhe=function(){function t(i){this.opacity=i,this.type=2,this.target=6}return t}(),Whe=function(t){return t.type===0},sj=function(t){return t.type===1},jhe=function(t){return t.type===2},Y4=function(t,i){return t.length===i.length?t.some(function(r,n){return r===i[n]}):!1},Yhe=function(t,i,r,n,a){return t.map(function(s,o){switch(o){case 0:return s.add(i,r);case 1:return s.add(i+n,r);case 2:return s.add(i+n,r+a);case 3:return s.add(i,r+a)}return s})},oj=function(){function t(i){this.element=i,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]}return t}(),lj=function(){function t(i,r){if(this.container=i,this.parent=r,this.effects=[],this.curves=new Ghe(this.container),this.container.styles.opacity<1&&this.effects.push(new Vhe(this.container.styles.opacity)),this.container.styles.transform!==null){var n=this.container.bounds.left+this.container.styles.transformOrigin[0].number,a=this.container.bounds.top+this.container.styles.transformOrigin[1].number,s=this.container.styles.transform;this.effects.push(new Qhe(n,a,s))}if(this.container.styles.overflowX!==0){var o=sC(this.curves),l=oC(this.curves);Y4(o,l)?this.effects.push(new gw(o,6)):(this.effects.push(new gw(o,2)),this.effects.push(new gw(l,4)))}}return t.prototype.getEffects=function(i){for(var r=[2,3].indexOf(this.container.styles.position)===-1,n=this.parent,a=this.effects.slice(0);n;){var s=n.effects.filter(function(c){return!sj(c)});if(r||n.container.styles.position!==0||!n.parent){if(a.unshift.apply(a,s),r=[2,3].indexOf(n.container.styles.position)===-1,n.container.styles.overflowX!==0){var o=sC(n.curves),l=oC(n.curves);Y4(o,l)||a.unshift(new gw(l,6))}}else a.unshift.apply(a,s);n=n.parent}return a.filter(function(c){return jn(c.target,i)})},t}(),xD=function(t,i,r,n){t.container.elements.forEach(function(a){var s=jn(a.flags,4),o=jn(a.flags,2),l=new lj(a,t);jn(a.styles.display,2048)&&n.push(l);var c=jn(a.flags,8)?[]:n;if(s||o){var h=s||a.styles.isPositioned()?r:i,u=new oj(l);if(a.styles.isPositioned()||a.styles.opacity<1||a.styles.isTransformed()){var d=a.styles.zIndex.order;if(d<0){var A=0;h.negativeZIndex.some(function(m,g){return d>m.element.container.styles.zIndex.order?(A=g,!1):A>0}),h.negativeZIndex.splice(A,0,u)}else if(d>0){var f=0;h.positiveZIndex.some(function(m,g){return d>=m.element.container.styles.zIndex.order?(f=g+1,!1):f>0}),h.positiveZIndex.splice(f,0,u)}else h.zeroOrAutoZIndexOrTransformedOrOpacity.push(u)}else a.styles.isFloating()?h.nonPositionedFloats.push(u):h.nonPositionedInlineLevel.push(u);xD(l,u,s?u:r,c)}else a.styles.isInlineLevel()?i.inlineLevel.push(l):i.nonInlineLevel.push(l),xD(l,i,r,c);jn(a.flags,8)&&cj(a,c)})},cj=function(t,i){for(var r=t instanceof MD?t.start:1,n=t instanceof MD?t.reversed:!1,a=0;a<i.length;a++){var s=i[a];s.container instanceof q9&&typeof s.container.value=="number"&&s.container.value!==0&&(r=s.container.value),s.listValue=QO(r,s.container.styles.listStyleType,!0),r+=n?-1:1}},Khe=function(t){var i=new lj(t,null),r=new oj(i),n=[];return xD(i,r,r,n),cj(i.container,n),r},K4=function(t,i){switch(i){case 0:return hl(t.topLeftBorderBox,t.topLeftPaddingBox,t.topRightBorderBox,t.topRightPaddingBox);case 1:return hl(t.topRightBorderBox,t.topRightPaddingBox,t.bottomRightBorderBox,t.bottomRightPaddingBox);case 2:return hl(t.bottomRightBorderBox,t.bottomRightPaddingBox,t.bottomLeftBorderBox,t.bottomLeftPaddingBox);case 3:default:return hl(t.bottomLeftBorderBox,t.bottomLeftPaddingBox,t.topLeftBorderBox,t.topLeftPaddingBox)}},Xhe=function(t,i){switch(i){case 0:return hl(t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox,t.topRightBorderBox,t.topRightBorderDoubleOuterBox);case 1:return hl(t.topRightBorderBox,t.topRightBorderDoubleOuterBox,t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox);case 2:return hl(t.bottomRightBorderBox,t.bottomRightBorderDoubleOuterBox,t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox);case 3:default:return hl(t.bottomLeftBorderBox,t.bottomLeftBorderDoubleOuterBox,t.topLeftBorderBox,t.topLeftBorderDoubleOuterBox)}},qhe=function(t,i){switch(i){case 0:return hl(t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox,t.topRightBorderDoubleInnerBox,t.topRightPaddingBox);case 1:return hl(t.topRightBorderDoubleInnerBox,t.topRightPaddingBox,t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox);case 2:return hl(t.bottomRightBorderDoubleInnerBox,t.bottomRightPaddingBox,t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox);case 3:default:return hl(t.bottomLeftBorderDoubleInnerBox,t.bottomLeftPaddingBox,t.topLeftBorderDoubleInnerBox,t.topLeftPaddingBox)}},Zhe=function(t,i){switch(i){case 0:return vw(t.topLeftBorderStroke,t.topRightBorderStroke);case 1:return vw(t.topRightBorderStroke,t.bottomRightBorderStroke);case 2:return vw(t.bottomRightBorderStroke,t.bottomLeftBorderStroke);case 3:default:return vw(t.bottomLeftBorderStroke,t.topLeftBorderStroke)}},vw=function(t,i){var r=[];return $o(t)?r.push(t.subdivide(.5,!1)):r.push(t),$o(i)?r.push(i.subdivide(.5,!0)):r.push(i),r},hl=function(t,i,r,n){var a=[];return $o(t)?a.push(t.subdivide(.5,!1)):a.push(t),$o(r)?a.push(r.subdivide(.5,!0)):a.push(r),$o(n)?a.push(n.subdivide(.5,!0).reverse()):a.push(n),$o(i)?a.push(i.subdivide(.5,!1).reverse()):a.push(i),a},hj=function(t){var i=t.bounds,r=t.styles;return i.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},lC=function(t){var i=t.styles,r=t.bounds,n=Lr(i.paddingLeft,r.width),a=Lr(i.paddingRight,r.width),s=Lr(i.paddingTop,r.width),o=Lr(i.paddingBottom,r.width);return r.add(n+i.borderLeftWidth,s+i.borderTopWidth,-(i.borderRightWidth+i.borderLeftWidth+n+a),-(i.borderTopWidth+i.borderBottomWidth+s+o))},Jhe=function(t,i){return t===0?i.bounds:t===2?lC(i):hj(i)},$he=function(t,i){return t===0?i.bounds:t===2?lC(i):hj(i)},Jx=function(t,i,r){var n=Jhe(Zm(t.styles.backgroundOrigin,i),t),a=$he(Zm(t.styles.backgroundClip,i),t),s=eue(Zm(t.styles.backgroundSize,i),r,n),o=s[0],l=s[1],c=u_(Zm(t.styles.backgroundPosition,i),n.width-o,n.height-l),h=tue(Zm(t.styles.backgroundRepeat,i),c,s,n,a),u=Math.round(n.left+c[0]),d=Math.round(n.top+c[1]);return[h,u,d,o,l]},dm=function(t){return hn(t)&&t.value===Sg.AUTO},_w=function(t){return typeof t=="number"},eue=function(t,i,r){var n=i[0],a=i[1],s=i[2],o=t[0],l=t[1];if(!o)return[0,0];if(In(o)&&l&&In(l))return[Lr(o,r.width),Lr(l,r.height)];var c=_w(s);if(hn(o)&&(o.value===Sg.CONTAIN||o.value===Sg.COVER)){if(_w(s)){var h=r.width/r.height;return h<s!=(o.value===Sg.COVER)?[r.width,r.width/s]:[r.height*s,r.height]}return[r.width,r.height]}var u=_w(n),d=_w(a),A=u||d;if(dm(o)&&(!l||dm(l))){if(u&&d)return[n,a];if(!c&&!A)return[r.width,r.height];if(A&&c){var f=u?n:a*s,m=d?a:n/s;return[f,m]}var g=u?n:r.width,p=d?a:r.height;return[g,p]}if(c){var v=0,_=0;return In(o)?v=Lr(o,r.width):In(l)&&(_=Lr(l,r.height)),dm(o)?v=_*s:(!l||dm(l))&&(_=v/s),[v,_]}var y=null,w=null;if(In(o)?y=Lr(o,r.width):l&&In(l)&&(w=Lr(l,r.height)),y!==null&&(!l||dm(l))&&(w=u&&d?y/n*a:r.height),w!==null&&dm(o)&&(y=u&&d?w/a*n:r.width),y!==null&&w!==null)return[y,w];throw new Error("Unable to calculate background-size for element")},Zm=function(t,i){var r=t[i];return typeof r>"u"?t[0]:r},tue=function(t,i,r,n,a){var s=i[0],o=i[1],l=r[0],c=r[1];switch(t){case 2:return[new Mt(Math.round(n.left),Math.round(n.top+o)),new Mt(Math.round(n.left+n.width),Math.round(n.top+o)),new Mt(Math.round(n.left+n.width),Math.round(c+n.top+o)),new Mt(Math.round(n.left),Math.round(c+n.top+o))];case 3:return[new Mt(Math.round(n.left+s),Math.round(n.top)),new Mt(Math.round(n.left+s+l),Math.round(n.top)),new Mt(Math.round(n.left+s+l),Math.round(n.height+n.top)),new Mt(Math.round(n.left+s),Math.round(n.height+n.top))];case 1:return[new Mt(Math.round(n.left+s),Math.round(n.top+o)),new Mt(Math.round(n.left+s+l),Math.round(n.top+o)),new Mt(Math.round(n.left+s+l),Math.round(n.top+o+c)),new Mt(Math.round(n.left+s),Math.round(n.top+o+c))];default:return[new Mt(Math.round(a.left),Math.round(a.top)),new Mt(Math.round(a.left+a.width),Math.round(a.top)),new Mt(Math.round(a.left+a.width),Math.round(a.height+a.top)),new Mt(Math.round(a.left),Math.round(a.height+a.top))]}},iue="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",X4="Hidden Text",rue=function(){function t(i){this._data={},this._document=i}return t.prototype.parseMetrics=function(i,r){var n=this._document.createElement("div"),a=this._document.createElement("img"),s=this._document.createElement("span"),o=this._document.body;n.style.visibility="hidden",n.style.fontFamily=i,n.style.fontSize=r,n.style.margin="0",n.style.padding="0",n.style.whiteSpace="nowrap",o.appendChild(n),a.src=iue,a.width=1,a.height=1,a.style.margin="0",a.style.padding="0",a.style.verticalAlign="baseline",s.style.fontFamily=i,s.style.fontSize=r,s.style.margin="0",s.style.padding="0",s.appendChild(this._document.createTextNode(X4)),n.appendChild(s),n.appendChild(a);var l=a.offsetTop-s.offsetTop+2;n.removeChild(s),n.appendChild(this._document.createTextNode(X4)),n.style.lineHeight="normal",a.style.verticalAlign="super";var c=a.offsetTop-n.offsetTop+2;return o.removeChild(n),{baseline:l,middle:c}},t.prototype.getMetrics=function(i,r){var n=i+" "+r;return typeof this._data[n]>"u"&&(this._data[n]=this.parseMetrics(i,r)),this._data[n]},t}(),uj=function(){function t(i,r){this.context=i,this.options=r}return t}(),nue=1e4;(function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a._activeEffects=[],a.canvas=n.canvas?n.canvas:document.createElement("canvas"),a.ctx=a.canvas.getContext("2d"),n.canvas||(a.canvas.width=Math.floor(n.width*n.scale),a.canvas.height=Math.floor(n.height*n.scale),a.canvas.style.width=n.width+"px",a.canvas.style.height=n.height+"px"),a.fontMetrics=new rue(document),a.ctx.scale(a.options.scale,a.options.scale),a.ctx.translate(-n.x,-n.y),a.ctx.textBaseline="bottom",a._activeEffects=[],a.context.logger.debug("Canvas renderer initialized ("+n.width+"x"+n.height+") with scale "+n.scale),a}return i.prototype.applyEffects=function(r){for(var n=this;this._activeEffects.length;)this.popEffect();r.forEach(function(a){return n.applyEffect(a)})},i.prototype.applyEffect=function(r){this.ctx.save(),jhe(r)&&(this.ctx.globalAlpha=r.opacity),Whe(r)&&(this.ctx.translate(r.offsetX,r.offsetY),this.ctx.transform(r.matrix[0],r.matrix[1],r.matrix[2],r.matrix[3],r.matrix[4],r.matrix[5]),this.ctx.translate(-r.offsetX,-r.offsetY)),sj(r)&&(this.path(r.path),this.ctx.clip()),this._activeEffects.push(r)},i.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},i.prototype.renderStack=function(r){return jo(this,void 0,void 0,function(){var n;return So(this,function(a){switch(a.label){case 0:return n=r.element.container.styles,n.isVisible()?[4,this.renderStackContent(r)]:[3,2];case 1:a.sent(),a.label=2;case 2:return[2]}})})},i.prototype.renderNode=function(r){return jo(this,void 0,void 0,function(){return So(this,function(n){switch(n.label){case 0:if(jn(r.container.flags,16))debugger;return r.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(r)]:[3,3];case 1:return n.sent(),[4,this.renderNodeContent(r)];case 2:n.sent(),n.label=3;case 3:return[2]}})})},i.prototype.renderTextWithLetterSpacing=function(r,n,a){var s=this;if(n===0)this.ctx.fillText(r.text,r.bounds.left,r.bounds.top+a);else{var o=GO(r.text);o.reduce(function(l,c){return s.ctx.fillText(c,l,r.bounds.top+a),l+s.ctx.measureText(c).width},r.bounds.left)}},i.prototype.createFontStyle=function(r){var n=r.fontVariant.filter(function(o){return o==="normal"||o==="small-caps"}).join(""),a=cue(r.fontFamily).join(", "),s=mE(r.fontSize)?""+r.fontSize.number+r.fontSize.unit:r.fontSize.number+"px";return[[r.fontStyle,n,r.fontWeight,s,a].join(" "),a,s]},i.prototype.renderTextNode=function(r,n){return jo(this,void 0,void 0,function(){var a,s,o,l,c,h,u,d,A=this;return So(this,function(f){return a=this.createFontStyle(n),s=a[0],o=a[1],l=a[2],this.ctx.font=s,this.ctx.direction=n.direction===1?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",c=this.fontMetrics.getMetrics(o,l),h=c.baseline,u=c.middle,d=n.paintOrder,r.textBounds.forEach(function(m){d.forEach(function(g){switch(g){case 0:A.ctx.fillStyle=oa(n.color),A.renderTextWithLetterSpacing(m,n.letterSpacing,h);var p=n.textShadow;p.length&&m.text.trim().length&&(p.slice(0).reverse().forEach(function(v){A.ctx.shadowColor=oa(v.color),A.ctx.shadowOffsetX=v.offsetX.number*A.options.scale,A.ctx.shadowOffsetY=v.offsetY.number*A.options.scale,A.ctx.shadowBlur=v.blur.number,A.renderTextWithLetterSpacing(m,n.letterSpacing,h)}),A.ctx.shadowColor="",A.ctx.shadowOffsetX=0,A.ctx.shadowOffsetY=0,A.ctx.shadowBlur=0),n.textDecorationLine.length&&(A.ctx.fillStyle=oa(n.textDecorationColor||n.color),n.textDecorationLine.forEach(function(v){switch(v){case 1:A.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top+h),m.bounds.width,1);break;case 2:A.ctx.fillRect(m.bounds.left,Math.round(m.bounds.top),m.bounds.width,1);break;case 3:A.ctx.fillRect(m.bounds.left,Math.ceil(m.bounds.top+u),m.bounds.width,1);break}}));break;case 1:n.webkitTextStrokeWidth&&m.text.trim().length&&(A.ctx.strokeStyle=oa(n.webkitTextStrokeColor),A.ctx.lineWidth=n.webkitTextStrokeWidth,A.ctx.lineJoin=window.chrome?"miter":"round",A.ctx.strokeText(m.text,m.bounds.left,m.bounds.top+h)),A.ctx.strokeStyle="",A.ctx.lineWidth=0,A.ctx.lineJoin="miter";break}})}),[2]})})},i.prototype.renderReplacedElement=function(r,n,a){if(a&&r.intrinsicWidth>0&&r.intrinsicHeight>0){var s=lC(r),o=oC(n);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(a,0,0,r.intrinsicWidth,r.intrinsicHeight,s.left,s.top,s.width,s.height),this.ctx.restore()}},i.prototype.renderNodeContent=function(r){return jo(this,void 0,void 0,function(){var n,a,s,o,l,c,_,_,h,u,d,A,w,f,m,b,g,p,v,_,y,w,b;return So(this,function(E){switch(E.label){case 0:this.applyEffects(r.getEffects(4)),n=r.container,a=r.curves,s=n.styles,o=0,l=n.textNodes,E.label=1;case 1:return o<l.length?(c=l[o],[4,this.renderTextNode(c,s)]):[3,4];case 2:E.sent(),E.label=3;case 3:return o++,[3,1];case 4:if(!(n instanceof Y9))return[3,8];E.label=5;case 5:return E.trys.push([5,7,,8]),[4,this.context.cache.match(n.src)];case 6:return _=E.sent(),this.renderReplacedElement(n,a,_),[3,8];case 7:return E.sent(),this.context.logger.error("Error loading image "+n.src),[3,8];case 8:if(n instanceof K9&&this.renderReplacedElement(n,a,n.canvas),!(n instanceof X9))return[3,12];E.label=9;case 9:return E.trys.push([9,11,,12]),[4,this.context.cache.match(n.svg)];case 10:return _=E.sent(),this.renderReplacedElement(n,a,_),[3,12];case 11:return E.sent(),this.context.logger.error("Error loading svg "+n.svg.substring(0,255)),[3,12];case 12:return n instanceof $9&&n.tree?(h=new i(this.context,{scale:this.options.scale,backgroundColor:n.backgroundColor,x:0,y:0,width:n.width,height:n.height}),[4,h.render(n.tree)]):[3,14];case 13:u=E.sent(),n.width&&n.height&&this.ctx.drawImage(u,0,0,n.width,n.height,n.bounds.left,n.bounds.top,n.bounds.width,n.bounds.height),E.label=14;case 14:if(n instanceof zO&&(d=Math.min(n.bounds.width,n.bounds.height),n.type===nC?n.checked&&(this.ctx.save(),this.path([new Mt(n.bounds.left+d*.39363,n.bounds.top+d*.79),new Mt(n.bounds.left+d*.16,n.bounds.top+d*.5549),new Mt(n.bounds.left+d*.27347,n.bounds.top+d*.44071),new Mt(n.bounds.left+d*.39694,n.bounds.top+d*.5649),new Mt(n.bounds.left+d*.72983,n.bounds.top+d*.23),new Mt(n.bounds.left+d*.84,n.bounds.top+d*.34085),new Mt(n.bounds.left+d*.39363,n.bounds.top+d*.79)]),this.ctx.fillStyle=oa(H4),this.ctx.fill(),this.ctx.restore()):n.type===aC&&n.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.bounds.left+d/2,n.bounds.top+d/2,d/4,0,Math.PI*2,!0),this.ctx.fillStyle=oa(H4),this.ctx.fill(),this.ctx.restore())),aue(n)&&n.value.length){switch(A=this.createFontStyle(s),w=A[0],f=A[1],m=this.fontMetrics.getMetrics(w,f).baseline,this.ctx.font=w,this.ctx.fillStyle=oa(s.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=oue(n.styles.textAlign),b=lC(n),g=0,n.styles.textAlign){case 1:g+=b.width/2;break;case 2:g+=b.width;break}p=b.add(g,0,0,-b.height/2+1),this.ctx.save(),this.path([new Mt(b.left,b.top),new Mt(b.left+b.width,b.top),new Mt(b.left+b.width,b.top+b.height),new Mt(b.left,b.top+b.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new k_(n.value,p),s.letterSpacing,m),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!jn(n.styles.display,2048))return[3,20];if(n.styles.listStyleImage===null)return[3,19];if(v=n.styles.listStyleImage,v.type!==0)return[3,18];_=void 0,y=v.url,E.label=15;case 15:return E.trys.push([15,17,,18]),[4,this.context.cache.match(y)];case 16:return _=E.sent(),this.ctx.drawImage(_,n.bounds.left-(_.width+10),n.bounds.top),[3,18];case 17:return E.sent(),this.context.logger.error("Error loading list-style-image "+y),[3,18];case 18:return[3,20];case 19:r.listValue&&n.styles.listStyleType!==-1&&(w=this.createFontStyle(s)[0],this.ctx.font=w,this.ctx.fillStyle=oa(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",b=new op(n.bounds.left,n.bounds.top+Lr(n.styles.paddingTop,n.bounds.width),n.bounds.width,S4(s.lineHeight,s.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new k_(r.listValue,b),s.letterSpacing,S4(s.lineHeight,s.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),E.label=20;case 20:return[2]}})})},i.prototype.renderStackContent=function(r){return jo(this,void 0,void 0,function(){var n,a,v,s,o,v,l,c,v,h,u,v,d,A,v,f,m,v,g,p,v;return So(this,function(_){switch(_.label){case 0:if(jn(r.element.container.flags,16))debugger;return[4,this.renderNodeBackgroundAndBorders(r.element)];case 1:_.sent(),n=0,a=r.negativeZIndex,_.label=2;case 2:return n<a.length?(v=a[n],[4,this.renderStack(v)]):[3,5];case 3:_.sent(),_.label=4;case 4:return n++,[3,2];case 5:return[4,this.renderNodeContent(r.element)];case 6:_.sent(),s=0,o=r.nonInlineLevel,_.label=7;case 7:return s<o.length?(v=o[s],[4,this.renderNode(v)]):[3,10];case 8:_.sent(),_.label=9;case 9:return s++,[3,7];case 10:l=0,c=r.nonPositionedFloats,_.label=11;case 11:return l<c.length?(v=c[l],[4,this.renderStack(v)]):[3,14];case 12:_.sent(),_.label=13;case 13:return l++,[3,11];case 14:h=0,u=r.nonPositionedInlineLevel,_.label=15;case 15:return h<u.length?(v=u[h],[4,this.renderStack(v)]):[3,18];case 16:_.sent(),_.label=17;case 17:return h++,[3,15];case 18:d=0,A=r.inlineLevel,_.label=19;case 19:return d<A.length?(v=A[d],[4,this.renderNode(v)]):[3,22];case 20:_.sent(),_.label=21;case 21:return d++,[3,19];case 22:f=0,m=r.zeroOrAutoZIndexOrTransformedOrOpacity,_.label=23;case 23:return f<m.length?(v=m[f],[4,this.renderStack(v)]):[3,26];case 24:_.sent(),_.label=25;case 25:return f++,[3,23];case 26:g=0,p=r.positiveZIndex,_.label=27;case 27:return g<p.length?(v=p[g],[4,this.renderStack(v)]):[3,30];case 28:_.sent(),_.label=29;case 29:return g++,[3,27];case 30:return[2]}})})},i.prototype.mask=function(r){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(r.slice(0).reverse()),this.ctx.closePath()},i.prototype.path=function(r){this.ctx.beginPath(),this.formatPath(r),this.ctx.closePath()},i.prototype.formatPath=function(r){var n=this;r.forEach(function(a,s){var o=$o(a)?a.start:a;s===0?n.ctx.moveTo(o.x,o.y):n.ctx.lineTo(o.x,o.y),$o(a)&&n.ctx.bezierCurveTo(a.startControl.x,a.startControl.y,a.endControl.x,a.endControl.y,a.end.x,a.end.y)})},i.prototype.renderRepeat=function(r,n,a,s){this.path(r),this.ctx.fillStyle=n,this.ctx.translate(a,s),this.ctx.fill(),this.ctx.translate(-a,-s)},i.prototype.resizeImage=function(r,n,a){var s;if(r.width===n&&r.height===a)return r;var o=(s=this.canvas.ownerDocument)!==null&&s!==void 0?s:document,l=o.createElement("canvas");l.width=Math.max(1,n),l.height=Math.max(1,a);var c=l.getContext("2d");return c.drawImage(r,0,0,r.width,r.height,0,0,n,a),l}
vendor: 8,414 bytes, line 3612
3612,i.prototype.renderBackgroundImage=function(r){return jo(this,void 0,void 0,function(){var n,a,s,o,l,c;return So(this,function(h){switch(h.label){case 0:n=r.styles.backgroundImage.length-1,a=function(u){var d,A,f,C,Y,D,L,I,S,m,C,Y,D,L,I,g,p,v,_,y,w,b,E,M,S,T,C,x,R,L,I,F,Y,D,U,j,J,z,$,te,ae,ve;return So(this,function(oe){switch(oe.label){case 0:if(u.type!==0)return[3,5];d=void 0,A=u.url,oe.label=1;case 1:return oe.trys.push([1,3,,4]),[4,s.context.cache.match(A)];case 2:return d=oe.sent(),[3,4];case 3:return oe.sent(),s.context.logger.error("Error loading background-image "+A),[3,4];case 4:return d&&(f=Jx(r,n,[d.width,d.height,d.width/d.height]),C=f[0],Y=f[1],D=f[2],L=f[3],I=f[4],S=s.ctx.createPattern(s.resizeImage(d,L,I),"repeat"),s.renderRepeat(C,S,Y,D)),[3,6];case 5:ole(u)?(m=Jx(r,n,[null,null,null]),C=m[0],Y=m[1],D=m[2],L=m[3],I=m[4],g=ile(u.angle,L,I),p=g[0],v=g[1],_=g[2],y=g[3],w=g[4],b=document.createElement("canvas"),b.width=L,b.height=I,E=b.getContext("2d"),M=E.createLinearGradient(v,y,_,w),w4(u.stops,p).forEach(function(K){return M.addColorStop(K.stop,oa(K.color))}),E.fillStyle=M,E.fillRect(0,0,L,I),L>0&&I>0&&(S=s.ctx.createPattern(b,"repeat"),s.renderRepeat(C,S,Y,D))):lle(u)&&(T=Jx(r,n,[null,null,null]),C=T[0],x=T[1],R=T[2],L=T[3],I=T[4],F=u.position.length===0?[FO]:u.position,Y=Lr(F[0],L),D=Lr(F[F.length-1],I),U=rle(u,Y,D,L,I),j=U[0],J=U[1],j>0&&J>0&&(z=s.ctx.createRadialGradient(x+Y,R+D,0,x+Y,R+D,j),w4(u.stops,j*2).forEach(function(K){return z.addColorStop(K.stop,oa(K.color))}),s.path(C),s.ctx.fillStyle=z,j!==J?($=r.bounds.left+.5*r.bounds.width,te=r.bounds.top+.5*r.bounds.height,ae=J/j,ve=1/ae,s.ctx.save(),s.ctx.translate($,te),s.ctx.transform(1,0,0,ae,0,0),s.ctx.translate(-$,-te),s.ctx.fillRect(x,ve*(R-te)+te,L,I*ve),s.ctx.restore()):s.ctx.fill())),oe.label=6;case 6:return n--,[2]}})},s=this,o=0,l=r.styles.backgroundImage.slice(0).reverse(),h.label=1;case 1:return o<l.length?(c=l[o],[5,a(c)]):[3,4];case 2:h.sent(),h.label=3;case 3:return o++,[3,1];case 4:return[2]}})})},i.prototype.renderSolidBorder=function(r,n,a){return jo(this,void 0,void 0,function(){return So(this,function(s){return this.path(K4(a,n)),this.ctx.fillStyle=oa(r),this.ctx.fill(),[2]})})},i.prototype.renderDoubleBorder=function(r,n,a,s){return jo(this,void 0,void 0,function(){var o,l;return So(this,function(c){switch(c.label){case 0:return n<3?[4,this.renderSolidBorder(r,a,s)]:[3,2];case 1:return c.sent(),[2];case 2:return o=Xhe(s,a),this.path(o),this.ctx.fillStyle=oa(r),this.ctx.fill(),l=qhe(s,a),this.path(l),this.ctx.fill(),[2]}})})},i.prototype.renderNodeBackgroundAndBorders=function(r){return jo(this,void 0,void 0,function(){var n,a,s,o,l,c,h,u,d=this;return So(this,function(A){switch(A.label){case 0:return this.applyEffects(r.getEffects(2)),n=r.container.styles,a=!bg(n.backgroundColor)||n.backgroundImage.length,s=[{style:n.borderTopStyle,color:n.borderTopColor,width:n.borderTopWidth},{style:n.borderRightStyle,color:n.borderRightColor,width:n.borderRightWidth},{style:n.borderBottomStyle,color:n.borderBottomColor,width:n.borderBottomWidth},{style:n.borderLeftStyle,color:n.borderLeftColor,width:n.borderLeftWidth}],o=sue(Zm(n.backgroundClip,0),r.curves),a||n.boxShadow.length?(this.ctx.save(),this.path(o),this.ctx.clip(),bg(n.backgroundColor)||(this.ctx.fillStyle=oa(n.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(r.container)]):[3,2];case 1:A.sent(),this.ctx.restore(),n.boxShadow.slice(0).reverse().forEach(function(f){d.ctx.save();var m=sC(r.curves),g=f.inset?0:nue,p=Yhe(m,-g+(f.inset?1:-1)*f.spread.number,(f.inset?1:-1)*f.spread.number,f.spread.number*(f.inset?-2:2),f.spread.number*(f.inset?-2:2));f.inset?(d.path(m),d.ctx.clip(),d.mask(p)):(d.mask(m),d.ctx.clip(),d.path(p)),d.ctx.shadowOffsetX=f.offsetX.number+g,d.ctx.shadowOffsetY=f.offsetY.number,d.ctx.shadowColor=oa(f.color),d.ctx.shadowBlur=f.blur.number,d.ctx.fillStyle=f.inset?oa(f.color):"rgba(0,0,0,1)",d.ctx.fill(),d.ctx.restore()}),A.label=2;case 2:l=0,c=0,h=s,A.label=3;case 3:return c<h.length?(u=h[c],u.style!==0&&!bg(u.color)&&u.width>0?u.style!==2?[3,5]:[4,this.renderDashedDottedBorder(u.color,u.width,l,r.curves,2)]:[3,11]):[3,13];case 4:return A.sent(),[3,11];case 5:return u.style!==3?[3,7]:[4,this.renderDashedDottedBorder(u.color,u.width,l,r.curves,3)];case 6:return A.sent(),[3,11];case 7:return u.style!==4?[3,9]:[4,this.renderDoubleBorder(u.color,u.width,l,r.curves)];case 8:return A.sent(),[3,11];case 9:return[4,this.renderSolidBorder(u.color,l,r.curves)];case 10:A.sent(),A.label=11;case 11:l++,A.label=12;case 12:return c++,[3,3];case 13:return[2]}})})},i.prototype.renderDashedDottedBorder=function(r,n,a,s,o){return jo(this,void 0,void 0,function(){var l,c,h,u,d,A,f,m,g,p,v,_,y,w,b,E,b,E;return So(this,function(M){return this.ctx.save(),l=Zhe(s,a),c=K4(s,a),o===2&&(this.path(c),this.ctx.clip()),$o(c[0])?(h=c[0].start.x,u=c[0].start.y):(h=c[0].x,u=c[0].y),$o(c[1])?(d=c[1].end.x,A=c[1].end.y):(d=c[1].x,A=c[1].y),a===0||a===2?f=Math.abs(h-d):f=Math.abs(u-A),this.ctx.beginPath(),o===3?this.formatPath(l):this.formatPath(c.slice(0,2)),m=n<3?n*3:n*2,g=n<3?n*2:n,o===3&&(m=n,g=n),p=!0,f<=m*2?p=!1:f<=m*2+g?(v=f/(2*m+g),m*=v,g*=v):(_=Math.floor((f+g)/(m+g)),y=(f-_*m)/(_-1),w=(f-(_+1)*m)/_,g=w<=0||Math.abs(g-y)<Math.abs(g-w)?y:w),p&&(o===3?this.ctx.setLineDash([0,m+g]):this.ctx.setLineDash([m,g])),o===3?(this.ctx.lineCap="round",this.ctx.lineWidth=n):this.ctx.lineWidth=n*2+1.1,this.ctx.strokeStyle=oa(r),this.ctx.stroke(),this.ctx.setLineDash([]),o===2&&($o(c[0])&&(b=c[3],E=c[0],this.ctx.beginPath(),this.formatPath([new Mt(b.end.x,b.end.y),new Mt(E.start.x,E.start.y)]),this.ctx.stroke()),$o(c[1])&&(b=c[1],E=c[2],this.ctx.beginPath(),this.formatPath([new Mt(b.end.x,b.end.y),new Mt(E.start.x,E.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},i.prototype.render=function(r){return jo(this,void 0,void 0,function(){var n;return So(this,function(a){switch(a.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=oa(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=Khe(r),[4,this.renderStack(n)];case 1:return a.sent(),this.applyEffects([]),[2,this.canvas]}})})},i})(uj);var aue=function(t){return t instanceof J9||t instanceof Z9?!0:t instanceof zO&&t.type!==aC&&t.type!==nC},sue=function(t,i){switch(t){case 0:return sC(i);case 2:return zhe(i);case 1:default:return oC(i)}},oue=function(t){switch(t){case 1:return"center";case 2:return"right";case 0:default:return"left"}},lue=["-apple-system","system-ui"],cue=function(t){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?t.filter(function(i){return lue.indexOf(i)===-1}):t};(function(t){yc(i,t);function i(r,n){var a=t.call(this,r,n)||this;return a.canvas=n.canvas?n.canvas:document.createElement("canvas"),a.ctx=a.canvas.getContext("2d"),a.options=n,a.canvas.width=Math.floor(n.width*n.scale),a.canvas.height=Math.floor(n.height*n.scale),a.canvas.style.width=n.width+"px",a.canvas.style.height=n.height+"px",a.ctx.scale(a.options.scale,a.options.scale),a.ctx.translate(-n.x,-n.y),a.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+n.width+"x"+n.height+" at "+n.x+","+n.y+") with scale "+n.scale),a}return i.prototype.render=function(r){return jo(this,void 0,void 0,function(){var n,a;return So(this,function(s){switch(s.label){case 0:return n=TD(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,r),[4,hue(n)];case 1:return a=s.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=oa(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(a,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},i})(uj);var hue=function(t){return new Promise(function(i,r){var n=new Image;n.onload=function(){i(n)},n.onerror=r,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(new XMLSerializer().serializeToString(t))})};typeof window<"u"&&Hhe.setContext(window);function q4(t,i){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);i&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function It(t){for(var i=1;i<arguments.length;i++){var r=arguments[i]!=null?arguments[i]:{};
3612i%2?q4(Object(r),!0).forEach(function(n){st(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function yy(t){return yy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},yy(t)}function rr(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function Z4(t,i){for(var r=0;r<i.length;r++){var n=i[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function nr(t,i,r){return i&&Z4(t.prototype,i),r&&Z4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function st(t,i,r){return i in t?Object.defineProperty(t,i,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[i]=r,t}function uue(t,i){if(t==null)return{};var r,n,a=function(o,l){if(o==null)return{};var c,h,u={},d=Object.keys(o);for(h=0;h<d.length;h++)c=d[h],l.indexOf(c)>=0||(u[c]=o[c]);return u}(t,i);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)r=s[n],i.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function Bs(t,i){return function(r){if(Array.isArray(r))return r}(t)||function(r,n){var a=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a!=null){var s,o,l=[],c=!0,h=!1;try{for(a=a.call(r);!(c=(s=a.next()).done)&&(l.push(s.value),!n||l.length!==n);c=!0);}catch(u){h=!0,o=u}finally{try{c||a.return==null||a.return()}finally{if(h)throw o}}return l}}(t,i)||VO(t,i)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 3613In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Iu(t){return function(i){if(Array.isArray(i))return RD(i)}(t)||function(i){if(typeof Symbol<"u"&&i[Symbol.iterator]!=null||i["@@iterator"]!=null)return Array.from(i)}(t)||VO(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 3614In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function VO(t,i){if(t){if(typeof t=="string")return RD(t,i);var r=Object.prototype.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?RD(t,i):void 0}}function RD(t,i){(i==null||i>t.length)&&(i=t.length);for(var r=0,n=new Array(i);r<i;r++)n[r]=t[r];return n}function wl(t,i){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=VO(t))||i&&t&&typeof t.length=="number"){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 3615In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var c=r.next();return o=c.done,c},e:function(c){l=!0,s=c},f:function(){try{o||r.return==null||r.return()}finally{if(l)throw s}}}}var Zl={DEBUG:!1,LIB_VERSION:"1.151.0"},due=Array.isArray,dj=Object.prototype,Aj=dj.hasOwnProperty,tM=dj.toString,Xn=due||function(t){return tM.call(t)==="[object Array]"},uc=function(t){return typeof t=="function"},Ga=function(t){return t===Object(t)&&!Xn(t)},yS=function(t){if(Ga(t)){for(var i in t)if(Aj.call(t,i))return!1;return!0}return!1},Qt=function(t){return t===void 0},cs=function(t){return tM.call(t)=="[object String]"},J4=function(t){return cs(t)&&t.trim().length===0},qu=function(t){return t===null},pl=function(t){return Qt(t)||qu(t)},el=function(t){return tM.call(t)=="[object Number]"},og=function(t){return tM.call(t)==="[object Boolean]"},Aue=function(t){return t instanceof FormData},je=typeof window<"u"?window:void 0,ao=typeof globalThis<"u"?globalThis:je,fj=Array.prototype,$4=fj.forEac
3615h,ek=fj.indexOf,wu=ao==null?void 0:ao.navigator,Ot=ao==null?void 0:ao.document,Xs=ao==null?void 0:ao.location,BD=ao==null?void 0:ao.fetch,ID=ao!=null&&ao.XMLHttpRequest&&"withCredentials"in new ao.XMLHttpRequest?ao.XMLHttpRequest:void 0,tk=ao==null?void 0:ao.AbortController,yn=wu==null?void 0:wu.userAgent,an=je??{},ik="[PostHog.js]",ft={_log:function(t){if(je&&(Zl.DEBUG||an.POSTHOG_DEBUG)&&!Qt(je.console)&&je.console){for(var i=("__rrweb_original__"in je.console[t])?je.console[t].__rrweb_original__:je.console[t],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];i.apply(void 0,[ik].concat(n))}},info:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];ft._log.apply(ft,["log"].concat(i))},warn:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];ft._log.apply(ft,["warn"].concat(i))},error:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];ft._log.apply(ft,["error"].concat(i))},critical:function(){for(var t,i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];(t=console).error.apply(t,[ik].concat(r))},uninitializedWarning:function(t){ft.error("You must initialize PostHog before calling ".concat(t))}},cC={},iM=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Cg(t,i,r){if(Xn(t)){if($4&&t.forEach===$4)t.forEach(i,r);else if("length"in t&&t.length===+t.length){for(var n=0,a=t.length;n<a;n++)if(n in t&&i.call(r,t[n],n)===cC)return}}}function xr(t,i,r){if(!pl(t)){if(Xn(t))return Cg(t,i,r);if(Aue(t)){var n,a=wl(t.entries());try{for(a.s();!(n=a.n()).done;){var s=n.value;if(i.call(r,s[1],s[0])===cC)return}}catch(l){a.e(l)}finally{a.f()}}else for(var o in t)if(Aj.call(t,o)&&i.call(r,t[o],o)===cC)return}}var Is=function(t){for(var i=arguments.length,r=new Array(i>1?i-1:0),n=1;n<i;n++)r[n-1]=arguments[n];return Cg(r,function(a){for(var s in a)a[s]!==void 0&&(t[s]=a[s])}),t};function ki(t,i){return t.indexOf(i)!==-1}function ES(t){for(var i=Object.keys(t),r=i.length,n=new Array(r);r--;)n[r]=[i[r],t[i[r]]];return n}var pj=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},rk=function(t){try{return t()}catch{return}},fue=function(t){return function(){try{for(var i=arguments.length,r=new Array(i),n=0;n<i;n++)r[n]=arguments[n];return t.apply(this,r)}catch(a){ft.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ft.critical(a)}}},DD=function(t){var i={};return xr(t,function(r,n){cs(r)&&r.length>0&&(i[n]=r)}),i},PD=function(t){return t.replace(/^\$/,"")};function pue(t,i){return r=t,n=function(s){return cs(s)&&!qu(i)?s.slice(0,i):s},a=new Set,function s(o,l){return o!==Object(o)?n?n(o,l):o:a.has(o)?void 0:(a.add(o),Xn(o)?(c=[],Cg(o,function(h){c.push(s(h))})):(c={},xr(o,function(h,u){a.has(h)||(c[u]=s(h,u))})),c);var c}(r);var r,n,a}var Jl,mue=function(t){var i,r,n,a,s="";for(i=r=0,n=(t=(t+"").replace(/\r\n/g,` 3616`).replace(/\r/g,` 3617`)).length,a=0;a<n;a++){var o=t.charCodeAt(a),l=null;o<128?r++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),qu(l)||(r>i&&(s+=t.substring(i,r)),s+=l,i=r=a+1)}return r>i&&(s+=t.substring(i,t.length)),s},pu=function(){function t(i){return i&&(i.preventDefault=t.preventDefault,i.stopPropagation=t.stopPropagation),i}return t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0},function(i,r,n,a,s){if(i)if(i.addEventListener&&!a)i.addEventListener(r,n,!!s);else{var o="on"+r,l=i[o];i[o]=function(c,h,u){return function(d){if(d=d||t(je==null?void 0:je.event)){var A,f=!0;uc(u)&&(A=u(d));var m=h.call(c,d);return A!==!1&&m!==!1||(f=!1),f}}}(i,n,l)}else ft.error("No valid element provided to register_event")}}();function mj(t,i){for(var r=0;r<t.length;r++)if(i(t[r]))return t[r]}(function(t){t.GZipJS="gzip-js",t.Base64="base64"})(Jl||(Jl={}));var gj="$people_distinct_id",f_="__alias",p_="__timers",nk="$autocapture_disabled_server_side",LD="$heatmaps_enabled_server_side",ak="$exception_capture_enabled_server_side",sk="$exception_capture_endpoint",ok="$web_vitals_enabled_server_side",OD="$session_recording_enabled_server_side",lk="$console_log_recording_enabled_server_side",ck="$session_recording_network_payload_capture",hk="$session_recording_canvas_recording",uk="$replay_sample_rate",dk="$replay_minimum_duration",hC="$sesid",H_="$session_is_sampled",lg="$enabled_feature_flags",ND="$early_access_features",cg="$stored_person_properties",Nd="$stored_group_properties",UD="$surveys",yw="$surveys_activated",uC="$flag_call_reported",iu="$user_state",FD="$client_session_props",kD="$capture_rate_limit",HD="$initial_campaign_params",GD="$initial_referrer_info",Ak="$initial_person_info",dC="$epp",zD="__POSTHOG_TOOLBAR__",gue=[gj,f_,"__cmpns",p_,OD,LD,hC,lg,iu,ND,Nd,cg,UD,uC,FD,kD,HD,GD,dC],$x="$active_feature_flags",Ew="$override_feature_flags",fk="$feature_flag_payloads",pk=function(t){var i,r={},n=wl(ES(t||{}));try{for(n.s();!(i=n.n()).done;){var a=Bs(i.value,2),s=a[0],o=a[1];o&&(r[s]=o)}}catch(l){n.e(l)}finally{n.f()}return r},vue=function(){function t(i){rr(this,t),this.instance=i,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return nr(t,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var i=this.instance.get_property(lg),r=this.instance.get_property(Ew);if(!r)return i||{};for(var n=Is({},i),a=Object.keys(r),s=0;s<a.length;s++)n[a[s]]=r[a[s]];return this._override_warning||(ft.warn(" Overriding feature flags!",{enabledFlags:i,overriddenFlags:r,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(fk)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(i){this.$anon_distinct_id=i}},{key:"setReloadingPaused",value:function(i){this.reloadFeatureFlagsInAction=i}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var i=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!i.reloadFeatureFlagsInAction&&i.reloadFeatureFlagsQueued&&(i.reloadFeatureFlagsQueued=!1,i._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var i=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var r=this.instance.config.token,n=this.instance.get_property(cg),a=this.instance.get_property(Nd),s={token:r,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:a,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:s,compression:this.instance.config.disable_compression?void 0:Jl.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(o){var l;i.setReloadingPaused(!1);var c=!0;o.statusCode===200&&(i.$anon_distinct_id=void 0,c=!1),i.receivedFeatureFlags((l=o.json)!==null&&l!==void 0?l:{},c),i._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,a=this.getFlagVariants()[i],s="".concat(a),o=this.instance.get_property(uC)||{};return(r.send_event||!("send_event"in r))&&(!(i in o)||!o[i].includes(s))&&(Xn(o[i])?o[i].push(s):o[i]=[s],(n=this.instance.persistence)===null||n===void 0||n.register(st({},uC,o)),this.instance.capture("$feature_flag_called",{$feature_flag:i,$feature_flag_response:a})),a}ft.warn('getFeatureFlag for key "'+i+`" failed. Feature flags didn't load in time.`)}},{key:"getFeatureFlagPayload",value:function(i){return this.getFlagPayloads()[i]}},{key:"isFeatureEnabled",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(i,r);
3617ft.warn('isFeatureEnabled for key "'+i+`" failed. Feature flags didn't load in time.`)}},{key:"addFeatureFlagsHandler",value:function(i){this.featureFlagEventHandlers.push(i)}},{key:"removeFeatureFlagsHandler",value:function(i){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(r){return r!==i})}},{key:"receivedFeatureFlags",value:function(i,r){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),a=this.getFlagPayloads();(function(s,o){var l,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},u=s.featureFlags,d=s.featureFlagPayloads;if(u)if(Xn(u)){var A,f={};if(u)for(var m=0;m<u.length;m++)f[u[m]]=!0;o&&o.register((st(A={},$x,u),st(A,lg,f),A))}else{var g=u,p=d;s.errorsWhileComputingFlags&&(g=It(It({},c),g),p=It(It({},h),p)),o&&o.register((st(l={},$x,Object.keys(pk(g))),st(l,lg,g||{}),st(l,fk,p||{}),l))}})(i,this.instance.persistence,n,a),this._fireFeatureFlagsCallbacks(r)}}},{key:"override",value:function(i){if(!this.instance.__loaded||!this.instance.persistence)return ft.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,i===!1)this.instance.persistence.unregister(Ew);else if(Xn(i)){for(var r={},n=0;n<i.length;n++)r[i[n]]=!0;this.instance.persistence.register(st({},Ew,r))}else this.instance.persistence.register(st({},Ew,i))}},{key:"onFeatureFlags",value:function(i){var r=this;if(this.addFeatureFlagsHandler(i),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),a=n.flags,s=n.flagVariants;i(a,s)}return function(){return r.removeFeatureFlagsHandler(i)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(i,r){var n,a,s=st({},"$feature_enrollment/".concat(i),r);this.instance.capture("$feature_enrollment_update",{$feature_flag:i,$feature_enrollment:r,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=It(It({},this.getFlagVariants()),{},st({},i,r));(n=this.instance.persistence)===null||n===void 0||n.register((st(a={},$x,Object.keys(pk(o))),st(a,lg,o),a)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(i){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],a=this.instance.get_property(ND);if(a&&!n)return i(a);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(s){var o;if(s.json){var l=s.json.earlyAccessFeatures;return(o=r.instance.persistence)===null||o===void 0||o.register(st({},ND,l)),i(l)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var i=this.getFlags(),r=this.getFlagVariants();return{flags:i.filter(function(n){return r[n]}),flagVariants:Object.keys(r).filter(function(n){return r[n]}).reduce(function(n,a){return n[a]=r[a],n},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(i){var r=this._prepareFeatureFlagsForCallbacks(),n=r.flags,a=r.flagVariants;this.featureFlagEventHandlers.forEach(function(s){return s(n,a,{errorsLoading:i})})}},{key:"setPersonPropertiesForFlags",value:function(i){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(cg)||{};this.instance.register(st({},cg,It(It({},n),i))),r&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(cg)}},{key:"setGroupPropertiesForFlags",value:function(i){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],n=this.instance.get_property(Nd)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(function(a){n[a]=It(It({},n[a]),i[a]),delete i[a]}),this.instance.register(st({},Nd,It(It({},n),i))),r&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(i){if(i){var r=this.instance.get_property(Nd)||{};this.instance.register(st({},Nd,It(It({},r),{},st({},i,{}))))}else this.instance.unregister(Nd)}}]),t}();Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return el(t)&&isFinite(t)&&Math.floor(t)===t});var mk="0123456789abcdef",_ue=function(){function t(i){if(rr(this,t),this.bytes=i,i.length!==16)throw new TypeError("not 128-bit length")}return nr(t,[{key:"toString",value:function(){for(var i="",r=0;r<this.bytes.length;r++)i=i+mk.charAt(this.bytes[r]>>>4)+mk.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(i+="-");if(i.length!==36)throw new Error("Invalid UUIDv7 was generated");return i}},{key:"clone",value:function(){return new t(this.bytes.slice(0))}},{key:"equals",value:function(i){return this.compareTo(i)===0}},{key:"compareTo",value:function(i){for(var r=0;r<16;r++){var n=this.bytes[r]-i.bytes[r];if(n!==0)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(i,r,n,a){if(!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(a)||i<0||r<0||n<0||a<0||i>0xffffffffffff||r>4095||n>1073741823||a>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);
3617return s[0]=i/Math.pow(2,40),s[1]=i/Math.pow(2,32),s[2]=i/Math.pow(2,24),s[3]=i/Math.pow(2,16),s[4]=i/Math.pow(2,8),s[5]=i,s[6]=112|r>>>8,s[7]=r,s[8]=128|n>>>24,s[9]=n>>>16,s[10]=n>>>8,s[11]=n,s[12]=a>>>24,s[13]=a>>>16,s[14]=a>>>8,s[15]=a,new t(s)}}]),t}(),yue=function(){function t(){rr(this,t),st(this,"timestamp",0),st(this,"counter",0),st(this,"random",new Eue)}return nr(t,[{key:"generate",value:function(){var i=this.generateOrAbort();if(Qt(i)){this.timestamp=0;var r=this.generateOrAbort();if(Qt(r))throw new Error("Could not generate UUID after timestamp reset");return r}return i}},{key:"generateOrAbort",value:function(){var i=Date.now();if(i>this.timestamp)this.timestamp=i,this.resetCounter();else{if(!(i+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return _ue.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),t}(),vj=function(t){if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var i=0;i<t.length;i++)t[i]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};je&&!Qt(je.crypto)&&crypto.getRandomValues&&(vj=function(t){return crypto.getRandomValues(t)});var gk,Eue=function(){function t(){rr(this,t),st(this,"buffer",new Uint32Array(8)),st(this,"cursor",1/0)}return nr(t,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(vj(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),t}(),eA=function(){return wue().toString()},wue=function(){return(gk||(gk=new yue)).generate()},bue="Thu, 01 Jan 1970 00:00:00 GMT",bv="",Sue=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Cue(t,i){if(i){var r=function(a){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ot;if(bv)return bv;if(!s||["localhost","127.0.0.1"].includes(a))return"";for(var o=a.split("."),l=Math.min(o.length,8),c="dmn_chk_"+eA(),h=new RegExp("(^|;)\\s*"+c+"=1");!bv&&l--;){var u=o.slice(l).join("."),d=c+"=1;domain=."+u;s.cookie=d,h.test(s.cookie)&&(s.cookie=d+";expires="+bue,bv=u)}return bv}(t);if(!r){var n=function(a){var s=a.match(Sue);return s?s[0]:""}(t);n!==r&&ft.info("Warning: cookie subdomain discovery mismatch",n,r),r=n}return r?"; domain=."+r:""}return""}var Ba,Du={is_supported:function(){return!!Ot},error:function(t){ft.error("cookieStore error: "+t)},get:function(t){if(Ot){try{for(var i=t+"=",r=Ot.cookie.split(";").filter(function(s){return s.length}),n=0;n<r.length;n++){for(var a=r[n];a.charAt(0)==" ";)a=a.substring(1,a.length);if(a.indexOf(i)===0)return decodeURIComponent(a.substring(i.length,a.length))}}catch{}return null}},parse:function(t){var i;try{i=JSON.parse(Du.get(t))||{}}catch{}return i},set:function(t,i,r,n,a){if(Ot)try{var s="",o="",l=Cue(Ot.location.hostname,n);if(r){var c=new Date;c.setTime(c.getTime()+24*r*60*60*1e3),s="; expires="+c.toUTCString()}a&&(o="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(i))+s+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&ft.warn("cookieStore warning: large cookie, len="+h.length),Ot.cookie=h,h}catch{return}},remove:function(t,i){try{Du.set(t,"",-1,i)}catch{return}}},eR=null,Wn={is_supported:function(){if(!qu(eR))return eR;var t=!0;if(Qt(je))t=!1;else try{var i="__mplssupport__";Wn.set(i,"xyz"),Wn.get(i)!=='"xyz"'&&(t=!1),Wn.remove(i)}catch{t=!1}return t||ft.error("localStorage unsupported; falling back to cookie store"),eR=t,t},error:function(t){ft.error("localStorage error: "+t)},get:function(t){try{return je==null?void 0:je.localStorage.getItem(t)}catch(i){Wn.error(i)}return null},parse:function(t){try{return JSON.parse(Wn.get(t))||{}}catch{}return null},set:function(t,i){try{je==null||je.localStorage.setItem(t,JSON.stringify(i))}catch(r){Wn.error(r)}},remove:function(t){try{je==null||je.localStorage.removeItem(t)}catch(i){Wn.error(i)}}},Tue=["distinct_id",hC,H_,dC],ww=It(It({},Wn),{},{parse:function(t){try{var i={};try{i=Du.parse(t)||{}}catch{}var r=Is(i,JSON.parse(Wn.get(t)||"{}"));return Wn.set(t,r),r}catch{}return null},set:function(t,i,r,n,a){try{Wn.set(t,i);var s={};Tue.forEach(function(o){i[o]&&(s[o]=i[o])}),Object.keys(s).length&&Du.set(t,s,r,n,a)}catch(o){Wn.error(o)}},remove:function(t,i){try{je==null||je.localStorage.removeItem(t),Du.remove(t,i)}catch(r){Wn.error(r)}}}),bw={},Mue={is_supported:function(){return!0},error:function(t){ft.error("memoryStorage error: "+t)},get:function(t){return bw[t]||null},parse:function(t){return bw[t]||null},set:function(t,i){bw[t]=i},remove:function(t){delete bw[t]}},$A=null,Na={is_supported:function(){if(!qu($A))return $A;if($A=!0,Qt(je))$A=!1;else try{var t="__support__";Na.set(t,"xyz"),Na.get(t)!=='"xyz"'&&($A=!1),Na.remove(t)}catch{$A=!1}return $A},error:function(t){ft.error("sessionStorage error: ",t)},get:function(t){try{return je==null?void 0:je.sessionStorage.getItem(t)}catch(i){Na.error(i)}return null},parse:function(t){try{return JSON.parse(Na.get(t))||null}catch{}return null},set:function(t,i){try{je==null||je.sessionStorage.setItem(t,JSON.stringify(i))}catch(r){Na.error(r)}},remove:function(t){try{je==null||je.sessionStorage.removeItem(t)}catch(i){Na.error(i)}}},xue=["localhost","127.0.0.1"],G_=function(t){var i=Ot==null?void 0:Ot.createElement("a");return Qt(i)?null:(i.href=t,i)},AC=function(t,i){return!!function(r){try{new RegExp(r)}catch{return!1}return!0}(i)&&new RegExp(i).test(t)},Rue=function(t){var i,r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",a=[];return xr(t,function(s,o){Qt(s)||Qt(o)||o==="undefined"||(i=encodeURIComponent(function(l){return l instanceof File}(s)?s.name:s.toString()),r=encodeURIComponent(o),a[a.length]=r+"="+i)}),a.join(n)},vk=function(t,i){for(var r,n=((t.split("#")[0]||"").split("?")[1]||"").split("&"),a=0;a<n.length;a++){var s=n[a].split("=");if(s[0]===i){r=s;break}}if(!Xn(r)||r.length<2)return"";var o=r[1];try{o=decodeURIComponent(o)}catch{ft.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},fC=function(t,i){var r=t.match(new RegExp(i+"=([^&]*)"));return r?r[1]:null},ml="Mobile",pC="iOS",eh="Android",Ey="Tablet",_j=eh+" "+Ey,yj="iPad",Ej="Apple",wj=Ej+" Watch",wy="Safari",i0="BlackBerry",bj="Samsung",Sj=bj+"Browser",Cj=bj+" Internet",yA="Chrome",Bue=yA+" OS",Tj=yA+" "+pC,WO="Internet Explorer",Mj=WO+" "+ml,jO="Opera",Iue=jO+" Mini",YO="Edge",xj="Microsoft "+YO,Tg="Firefox",Rj=Tg+" "+pC,by="Nintendo",Sy="PlayStation",Mg="Xbox",Bj=eh+" "+ml,Ij=ml+" "+wy,m_="Windows",QD=m_+" Phone",_k="Nokia",VD="Ouya",Dj="Generic",Due=Dj+" "+ml.toLowerCase(),Pj=Dj+" "+Ey.toLowerCase(),WD="Konqueror",Cs="(\\d+(\\.\\d+)?)",tR=new RegExp("Version/"+Cs),Pue=new RegExp(Mg,"i"),Lue=new RegExp(Sy+" \\w+","i"),Oue=new RegExp(by+" \\w+","i"),KO=new RegExp(i0+"|PlayBook|BB10","i"),Nue={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Uue=function(t,i){return i&&ki(i,Ej)||function(r){return ki(r,wy)&&!ki(r,yA)&&!ki(r,eh)}(t)},yk=function(t,i){return i=i||"",ki(t," OPR/")&&ki(t,"Mini")?Iue:ki(t," OPR/")?jO:KO.test(t)?i0:ki(t,"IE"+ml)||ki(t,"WPDesktop")?Mj:ki(t,Sj)?Cj:ki(t,YO)||ki(t,"Edg/")?xj:ki(t,"FBIOS")?"Facebook "+ml:ki(t,"UCWEB")||ki(t,"UCBrowser")?"UC Browser":ki(t,"CriOS")?Tj:ki(t,"CrMo")?yA:ki(t,eh)&&ki(t,wy)?Bj:ki(t,yA)?yA:ki(t,"FxiOS")?Rj:ki(t.toLowerCase(),WD.toLowerCase())?WD:Uue(t,i)?ki(t,ml)?Ij:wy:ki(t,Tg)?Tg:ki(t,"MSIE")||ki(t,"Trident/")?WO:ki(t,"Gecko")?Tg:""},Fue=(st(Ba={},Mj,[new RegExp("rv:"+Cs)]),st(Ba,xj,[new RegExp(YO+"?\\/"+Cs)]),st(Ba,yA,[new RegExp("("+yA+"|CrMo)\\/"+Cs)]),st(Ba,Tj,[new RegExp("CriOS\\/"+Cs)]),st(Ba,"UC Browser",[new RegExp("(UCBrowser|UCWEB)\\/"+Cs)]),st(Ba,wy,[tR]),st(Ba,Ij,[tR]),st(Ba,jO,[new RegExp("(Opera|OPR)\\/"+Cs)]),st(Ba,Tg,[new RegExp(Tg+"\\/"+Cs)]),st(Ba,Rj,[new RegExp("FxiOS\\/"+Cs)]),st(Ba,WD,[new RegExp("Konqueror[:/]?"+Cs,"i")]),st(Ba,i0,[new RegExp(i0+" "+Cs),tR]),st(Ba,Bj,[new RegExp("android\\s"+Cs,"i")]),st(Ba,Cj,[new RegExp(Sj+"\\/"+Cs)]),st(Ba,WO,[new RegExp("(rv:|MSIE )"+Cs)]),st(Ba,"Mozilla",[new RegExp("rv:"+Cs)]),Ba),Ek=[[new RegExp(Mg+"; "+Mg+" (.*?)[);]","i"),function(t){return[Mg,t&&t[1]||""]}],[new RegExp(by,"i"),[by,""]],[new RegExp(Sy,"i"),[Sy,""]],[KO,[i0,""]],[new RegExp(m_,"i"),function(t,i){if(/Phone/.test(i)||/WPDesktop/.test(i))return[QD,""];if(new RegExp(ml).test(i)&&!/IEMobile\b/.test(i))return[m_+" "+ml,""];
3617var r=/Windows NT ([0-9.]+)/i.exec(i);if(r&&r[1]){var n=r[1],a=Nue[n]||"";return/arm/i.test(i)&&(a="RT"),[m_,a]}return[m_,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(t){if(t&&t[3]){var i=[t[3],t[4],t[5]||"0"];return[pC,i.join(".")]}return[pC,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(t){var i="";return t&&t.length>=3&&(i=Qt(t[2])?t[3]:t[2]),["watchOS",i]}],[new RegExp("("+eh+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+eh+")","i"),function(t){if(t&&t[2]){var i=[t[2],t[3],t[4]||"0"];return[eh,i.join(".")]}return[eh,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(t){var i=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];i[1]=r.join(".")}return i}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Bue,""]],[/Linux|debian/i,["Linux",""]]],wk=function(t){return Oue.test(t)?by:Lue.test(t)?Sy:Pue.test(t)?Mg:new RegExp(VD,"i").test(t)?VD:new RegExp("("+QD+"|WPDesktop)","i").test(t)?QD:/iPad/.test(t)?yj:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?wj:KO.test(t)?i0:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(_k,"i").test(t)?_k:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(ml).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?eh:_j:eh:new RegExp("(pda|"+ml+")","i").test(t)?Due:new RegExp(Ey,"i").test(t)&&!new RegExp(Ey+" pc","i").test(t)?Pj:""},Sw="https?://(.*)",kue=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid","rdt_cid"],ha={campaignParams:function(t){return Ot?this._campaignParamsFromUrl(Ot.URL,t):{}},_campaignParamsFromUrl:function(t,i){var r=kue.concat(i||[]),n={};return xr(r,function(a){var s=vk(t,a);s&&(n[a]=s)}),n},_searchEngine:function(t){return t?t.search(Sw+"google.([^/?]*)")===0?"google":t.search(Sw+"bing.com")===0?"bing":t.search(Sw+"yahoo.com")===0?"yahoo":t.search(Sw+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(t){var i=ha._searchEngine(t),r=i!="yahoo"?"q":"p",n={};if(!qu(i)){n.$search_engine=i;var a=Ot?vk(Ot.referrer,r):"";a.length&&(n.ph_keyword=a)}return n},searchInfo:function(){var t=Ot==null?void 0:Ot.referrer;return t?this._searchInfoFromReferrer(t):{}},browser:yk,browserVersion:function(t,i){var r=yk(t,i),n=Fue[r];if(Qt(n))return null;for(var a=0;a<n.length;a++){var s=n[a],o=t.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(t){for(var i=0;i<Ek.length;i++){var r=Bs(Ek[i],2),n=r[0],a=r[1],s=n.exec(t),o=s&&(uc(a)?a(s,t):a);if(o)return o}return["",""]},device:wk,deviceType:function(t){var i=wk(t);return i===yj||i===_j||i==="Kobo"||i==="Kindle Fire"||i===Pj?Ey:i===by||i===Mg||i===Sy||i===VD?"Console":i===wj?"Wearable":i?ml:"Desktop"},referrer:function(){return(Ot==null?void 0:Ot.referrer)||"$direct"},referringDomain:function(){var t;return Ot!=null&&Ot.referrer&&((t=G_(Ot.referrer))===null||t===void 0?void 0:t.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:Xs==null?void 0:Xs.href}},initialPersonPropsFromInfo:function(t){var i,r=t.r,n=t.u,a={$initial_referrer:r,$initial_referring_domain:r==null?void 0:r=="$direct"?"$direct":(i=G_(r))===null||i===void 0?void 0:i.host};
3617if(n){a.$initial_current_url=n;var s=G_(n);a.$initial_host=s==null?void 0:s.host,a.$initial_pathname=s==null?void 0:s.pathname,xr(this._campaignParamsFromUrl(n),function(o,l){a["$initial_"+PD(l)]=o})}return r&&xr(this._searchInfoFromReferrer(r),function(o,l){a["$initial_"+PD(l)]=o}),a},properties:function(){if(!yn)return{};var t=Bs(ha.os(yn),2),i=t[0],r=t[1];return Is(DD({$os:i,$os_version:r,$browser:ha.browser(yn,navigator.vendor),$device:ha.device(yn),$device_type:ha.deviceType(yn)}),{$current_url:Xs==null?void 0:Xs.href,$host:Xs==null?void 0:Xs.host,$pathname:Xs==null?void 0:Xs.pathname,$raw_user_agent:yn.length>1e3?yn.substring(0,997)+"...":yn,$browser_version:ha.browserVersion(yn,navigator.vendor),$browser_language:ha.browserLanguage(),$screen_height:je==null?void 0:je.screen.height,$screen_width:je==null?void 0:je.screen.width,$viewport_height:je==null?void 0:je.innerHeight,$viewport_width:je==null?void 0:je.innerWidth,$lib:"web",$lib_version:Zl.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:pj()/1e3})},people_properties:function(){if(!yn)return{};var t=Bs(ha.os(yn),2),i=t[0],r=t[1];return Is(DD({$os:i,$os_version:r,$browser:ha.browser(yn,navigator.vendor)}),{$browser_version:ha.browserVersion(yn,navigator.vendor)})}},Hue=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],iR=function(){function t(i){rr(this,t),this.config=i,this.props={},this.campaign_params_saved=!1,this.name=function(r){var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"}(i),this.storage=this.buildStorage(i),this.load(),this.update_config(i,i),this.save()}return nr(t,[{key:"buildStorage",value:function(i){Hue.indexOf(i.persistence.toLowerCase())===-1&&(ft.critical("Unknown persistence type "+i.persistence+"; falling back to localStorage+cookie"),i.persistence="localStorage+cookie");var r=i.persistence.toLowerCase();return r==="localstorage"&&Wn.is_supported()?Wn:r==="localstorage+cookie"&&ww.is_supported()?ww:r==="sessionstorage"&&Na.is_supported()?Na:r==="memory"?Mue:r==="cookie"?Du:ww.is_supported()?ww:Du}},{key:"properties",value:function(){var i={};return xr(this.props,function(r,n){if(n===lg&&Ga(r))for(var a=Object.keys(r),s=0;s<a.length;s++)i["$feature/".concat(a[s])]=r[a[s]];else l=n,c=!1,(qu(o=gue)?c:ek&&o.indexOf===ek?o.indexOf(l)!=-1:(xr(o,function(h){if(c||(c=h===l))return cC}),c))||(i[n]=r);var o,l,c}),i}},{key:"load",value:function(){if(!this.disabled){var i=this.storage.parse(this.name);i&&(this.props=Is({},i))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(i,r,n){var a=this;if(Ga(i)){Qt(r)&&(r="None"),this.expire_days=Qt(n)?this.default_expiry:n;var s=!1;if(xr(i,function(o,l){a.props.hasOwnProperty(l)&&a.props[l]!==r||(a.props[l]=o,s=!0)}),s)return this.save(),!0}return!1}},{key:"register",value:function(i,r){var n=this;if(Ga(i)){this.expire_days=Qt(r)?this.default_expiry:r;var a=!1;if(xr(i,function(s,o){i.hasOwnProperty(o)&&n.props[o]!==s&&(n.props[o]=s,a=!0)}),a)return this.save(),!0}return!1}},{key:"unregister",value:function(i){i in this.props&&(delete this.props[i],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ha.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(ha.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once(ha.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[HD]||this.props[GD]||this.register_once(st({},Ak,ha.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return DD({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var i=this,r={};xr([GD,HD],function(s){var o=i.props[s];o&&xr(o,function(l,c){r["$initial_"+PD(c)]=l})});var n=this.props[Ak];if(n){var a=ha.initialPersonPropsFromInfo(n);Is(r,a)}return r}},{key:"safe_merge",value:function(i){return xr(this.props,function(r,n){n in i||(i[n]=r)}),i}},{key:"update_config",value:function(i,r){if(this.default_expiry=this.expire_days=i.cookie_expiration,this.set_disabled(i.disable_persistence),this.set_cross_subdomain(i.cross_subdomain_cookie),this.set_secure(i.secure_cookie),i.persistence!==r.persistence){var n=this.buildStorage(i),a=this.props;this.clear(),this.storage=n,this.props=a,this.save()}}},{key:"set_disabled",value:function(i){this.disabled=i,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(i){i!==this.cross_subdomain&&(this.cross_subdomain=i,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(i){i!==this.secure&&(this.secure=i,this.remove(),this.save())}},{key:"set_event_timer",value:function(i,r){var n=this.props[p_]||{};n[i]=r,this.props[p_]=n,this.save()}},{key:"remove_event_timer",value:function(i){var r=(this.props[p_]||{})[i];return Qt(r)||(delete this.props[p_][i],this.save()),r}},{key:"get_property",value:function(i){return this.props[i]}},{key:"set_property",value:function(i,r){this.props[i]=r,this.save()}}]),t}();function jD(t){return JSON.stringify(t,(i=[],function(r,n){if(Ga(n)){for(;i.length>0&&i.at(-1)!==this;)i.pop();return i.includes(n)?"[Circular]":(i.push(n),n)}return n})).length;var i}var Gue=2,zue=4;function YD(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(t.size>=i&&t.data.length>1){var r=Math.floor(t.data.length/2),n=t.data.slice(0,r),a=t.data.slice(r);return[YD({size:jD(n),data:n,sessionId:t.sessionId,windowId:t.windowId}),YD({size:jD(a),data:a,sessionId:t.sessionId,windowId:t.windowId})].flatMap(function(s){return s})}return[t]}var wS=function(t){return t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t}(wS||{}),Jh=function(t){return t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.In
3617put=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t}(Jh||{});function XO(t){return t?iM(t).split(/\s+/):[]}function bk(t){var i=je==null?void 0:je.location.href;return!!(i&&t&&t.some(function(r){return i.match(r)}))}function mC(t){var i="";switch(yy(t.className)){case"string":i=t.className;break;case"object":i=("baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:i=""}return XO(i)}function Lj(t){return pl(t)?null:iM(t).split(/(\s+)/).filter(function(i){return xg(i)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function gC(t){var i="";return XD(t)&&!Fj(t)&&t.childNodes&&t.childNodes.length&&xr(t.childNodes,function(r){var n;Oj(r)&&r.textContent&&(i+=(n=Lj(r.textContent))!==null&&n!==void 0?n:"")}),iM(i)}function qO(t){return!!t&&t.nodeType===1}function EA(t,i){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===i.toLowerCase()}function Oj(t){return!!t&&t.nodeType===3}function Nj(t){return!!t&&t.nodeType===11}var KD=["a","button","form","input","select","textarea","label"];function Uj(t){var i=t.parentNode;return!(!i||!qO(i))&&i}function Que(t,i){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;if(!je||!t||EA(t,"html")||!qO(t)||r!=null&&r.url_allowlist&&!bk(r.url_allowlist)||r!=null&&r.url_ignorelist&&bk(r.url_ignorelist))return!1;if(r!=null&&r.dom_event_allowlist){var s=r.dom_event_allowlist;if(s&&!s.some(function(f){return i.type===f}))return!1}for(var o=!1,l=[t],c=!0,h=t;h.parentNode&&!EA(h,"body");)if(Nj(h.parentNode))l.push(h.parentNode.host),h=h.parentNode.host;else{if(!(c=Uj(h)))break;if(n||KD.indexOf(c.tagName.toLowerCase())>-1)o=!0;else{var u=je.getComputedStyle(c);u&&u.getPropertyValue("cursor")==="pointer"&&(o=!0)}l.push(c),h=c}if(!function(f,m){var g=m==null?void 0:m.element_allowlist;if(Qt(g))return!0;var p,v=wl(f);try{var _=function(){var w=p.value;if(g.some(function(b){return w.tagName.toLowerCase()===b}))return{v:!0}};for(v.s();!(p=v.n()).done;){var y=_();if(yy(y)==="object")return y.v}}catch(w){v.e(w)}finally{v.f()}return!1}(l,r)||!function(f,m){var g=m==null?void 0:m.css_selector_allowlist;if(Qt(g))return!0;var p,v=wl(f);try{var _=function(){var w=p.value;if(g.some(function(b){return w.matches(b)}))return{v:!0}};for(v.s();!(p=v.n()).done;){var y=_();if(yy(y)==="object")return y.v}}catch(w){v.e(w)}finally{v.f()}return!1}(l,r))return!1;var d=je.getComputedStyle(t);if(d&&d.getPropertyValue("cursor")==="pointer"&&i.type==="click")return!0;var A=t.tagName.toLowerCase();switch(A){case"html":return!1;case"form":return(a||["submit"]).indexOf(i.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(i.type)>=0;default:return o?(a||["click"]).indexOf(i.type)>=0:(a||["click"]).indexOf(i.type)>=0&&(KD.indexOf(A)>-1||t.getAttribute("contenteditable")==="true")}}function XD(t){for(var i=t;i.parentNode&&!EA(i,"body");i=i.parentNode){var r=mC(i);if(ki(r,"ph-sensitive")||ki(r,"ph-no-capture"))return!1}if(ki(mC(t),"ph-include"))return!0;var n=t.type||"";if(cs(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var a=t.name||t.id||"";return!(cs(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function Fj(t){return!!(EA(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||EA(t,"select")||EA(t,"textarea")||t.getAttribute("contenteditable")==="true")}var kj="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Vue=new RegExp("^(?:".concat(kj,")$")),Wue=new RegExp(kj),Hj="\\d{3}-?\\d{2}-?\\d{4}",jue=new RegExp("^(".concat(Hj,")$")),Yue=new RegExp("(".concat(Hj,")"));function xg(t){var i=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(pl(t)||cs(t)&&(t=iM(t),(i?Vue:Wue).test((t||"").replace(/[- ]/g,""))||(i?jue:Yue).test(t)))}function Sk(t){var i=gC(t);return xg(i="".concat(i," ").concat(Gj(t)).trim())?i:""}function Gj(t){var i="";return t&&t.childNodes&&t.childNodes.length&&xr(t.childNodes,function(r){var n;if(r&&((n=r.tagName)===null||n===void 0?void 0:n.toLowerCase())==="span")try{var a=gC(r);i="".concat(i," ").concat(a).trim(),r.childNodes&&r.childNodes.length&&(i="".concat(i," ").concat(Gj(r)).trim())}catch(s){ft.error(s)}}),i}function Kue(t){return function(i){var r=i.map(function(n){var a,s,o="";if(n.tag_name&&(o+=n.tag_name),n.attr_class){n.attr_class.sort();var l,c=wl(n.attr_class);try{for(c.s();!(l=c.n()).done;){var h=l.value;o+=".".concat(h.replace(/"/g,""))}}catch(A){c.e(A)}finally{c.f()}}
3617var u=It(It(It(It({},n.text?{text:n.text}:{}),{},{"nth-child":(a=n.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(s=n.nth_of_type)!==null&&s!==void 0?s:0},n.href?{href:n.href}:{}),n.attr_id?{attr_id:n.attr_id}:{}),n.attributes),d={};return ES(u).sort(function(A,f){var m=Bs(A,1)[0],g=Bs(f,1)[0];return m.localeCompare(g)}).forEach(function(A){var f=Bs(A,2),m=f[0],g=f[1];return d[Ck(m.toString())]=Ck(g.toString())}),o+=":",o+=ES(u).map(function(A){var f=Bs(A,2),m=f[0],g=f[1];return"".concat(m,'="').concat(g,'"')}).join("")});return r.join(";")}(function(i){return i.map(function(r){var n,a,s={text:(n=r.$el_text)===null||n===void 0?void 0:n.slice(0,400),tag_name:r.tag_name,href:(a=r.attr__href)===null||a===void 0?void 0:a.slice(0,2048),attr_class:Xue(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return ES(r).filter(function(o){return Bs(o,1)[0].indexOf("attr__")===0}).forEach(function(o){var l=Bs(o,2),c=l[0],h=l[1];return s.attributes[c]=h}),s})}(t))}function Ck(t){return t.replace(/"|\\"/g,'\\"')}function Xue(t){var i=t.attr__class;return i?Xn(i)?i:XO(i):void 0}var qD="[SessionRecording]",ZD="redacted",Cw={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(t){return t},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},que=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Zue=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],Jue=["/s/","/e/","/i/"];function Tk(t,i,r,n){if(pl(t))return t;var a=(i==null?void 0:i["content-length"])||function(s){return new Blob([s]).size}(t);return cs(a)&&(a=parseInt(a)),a>r?qD+" ".concat(n," body too large to record (").concat(a," bytes)"):t}function Mk(t,i){if(pl(t))return t;var r=t;return xg(r,!1)||(r=qD+" "+i+" body "+ZD),xr(Zue,function(n){var a,s;(a=r)!==null&&a!==void 0&&a.length&&((s=r)===null||s===void 0?void 0:s.indexOf(n))!==-1&&(r=qD+" "+i+" body "+ZD+" as might contain: "+n)}),r}var ru,$ue=function(t,i){var r,n,a,s={payloadSizeLimitBytes:Cw.payloadSizeLimitBytes,performanceEntryTypeToObserve:Iu(Cw.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(Iu(i.payloadHostDenyList||[]),Iu(Cw.payloadHostDenyList))},o=t.session_recording.recordHeaders!==!1&&i.recordHeaders,l=t.session_recording.recordBody!==!1&&i.recordBody,c=t.capture_performance!==!1&&i.recordPerformance,h=(r=s,a=Math.min(1e6,(n=r.payloadSizeLimitBytes)!==null&&n!==void 0?n:1e6),function(A){return A!=null&&A.requestBody&&(A.requestBody=Tk(A.requestBody,A.requestHeaders,a,"Request")),A!=null&&A.responseBody&&(A.responseBody=Tk(A.responseBody,A.responseHeaders,a,"Response")),A}),u=function(A){return h(function(g){var p=G_(g.name);if(!(p&&p.pathname&&Jue.some(function(v){return p.pathname.indexOf(v)===0})))return g}((m=(f=A).requestHeaders,pl(m)||xr(Object.keys(m??{}),function(g){que.includes(g.toLowerCase())&&(m[g]=ZD)}),f)));var f,m},d=uc(t.session_recording.maskNetworkRequestFn);return d&&uc(t.session_recording.maskCapturedNetworkRequestFn)&&ft.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(t.session_recording.maskCapturedNetworkRequestFn=function(A){var f=t.session_recording.maskNetworkRequestFn({url:A.name});return It(It({},A),{},{name:f==null?void 0:f.url})}),s.maskRequestFn=uc(t.session_recording.maskCapturedNetworkRequestFn)?function(A){var f,m,g,p=u(A);return p&&(f=(m=(g=t.session_recording).maskCapturedNetworkRequestFn)===null||m===void 0?void 0:m.call(g,p))!==null&&f!==void 0?f:void 0}:function(A){return function(f){if(!Qt(f))return f.requestBody=Mk(f.requestBody,"Request"),f.responseBody=Mk(f.responseBody,"Response"),f}(u(A))},It(It(It({},Cw),s),{},{recordHeaders:o,recordBody:l,recordPerformance:c,recordInitialRequests:c})},ede=nr(function t(i){var r,n,a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};rr(this,t),st(this,"bucketSize",100),st(this,"refillRate",10),st(this,"mutationBuckets",{}),st(this,"loggedTracker",{}),st(this,"refillBuckets",function(){Object.keys(a.mutationBuckets).forEac
3617h(function(o){a.mutationBuckets[o]=a.mutationBuckets[o]+a.refillRate,a.mutationBuckets[o]>=a.bucketSize&&delete a.mutationBuckets[o]})}),st(this,"getNodeOrRelevantParent",function(o){var l=a.rrweb.mirror.getNode(o);if((l==null?void 0:l.nodeName)!=="svg"&&l instanceof Element){var c=l.closest("svg");if(c)return[a.rrweb.mirror.getId(c),c]}return[o,l]}),st(this,"numberOfChanges",function(o){var l,c,h,u,d,A,f,m;return((l=(c=o.removes)===null||c===void 0?void 0:c.length)!==null&&l!==void 0?l:0)+((h=(u=o.attributes)===null||u===void 0?void 0:u.length)!==null&&h!==void 0?h:0)+((d=(A=o.texts)===null||A===void 0?void 0:A.length)!==null&&d!==void 0?d:0)+((f=(m=o.adds)===null||m===void 0?void 0:m.length)!==null&&f!==void 0?f:0)}),st(this,"throttleMutations",function(o){if(o.type!==3||o.data.source!==0)return o;var l=o.data,c=a.numberOfChanges(l);l.attributes&&(l.attributes=l.attributes.filter(function(u){var d,A,f,m=Bs(a.getNodeOrRelevantParent(u.id),2),g=m[0],p=m[1];return a.mutationBuckets[g]===0?!1:(a.mutationBuckets[g]=(d=a.mutationBuckets[g])!==null&&d!==void 0?d:a.bucketSize,a.mutationBuckets[g]=Math.max(a.mutationBuckets[g]-1,0),a.mutationBuckets[g]===0&&(a.loggedTracker[g]||(a.loggedTracker[g]=!0,(A=(f=a.options).onBlockedNode)===null||A===void 0||A.call(f,g,p))),u)}));var h=a.numberOfChanges(l);return h!==0||c===h?o:void 0}),this.rrweb=i,this.options=s,this.refillRate=(r=this.options.refillRate)!==null&&r!==void 0?r:this.refillRate,this.bucketSize=(n=this.options.bucketSize)!==null&&n!==void 0?n:this.bucketSize,setInterval(function(){a.refillBuckets()},1e3)}),tde=3e5,ide=[Jh.MouseMove,Jh.MouseInteraction,Jh.Scroll,Jh.ViewportResize,Jh.Input,Jh.TouchMove,Jh.MediaInteraction,Jh.Drag],xk=function(t){return{rrwebMethod:t,enqueuedAt:Date.now(),attempt:1}},ko="[SessionRecording]",rde=function(){function t(i){var r=this;if(rr(this,t),st(this,"queuedRRWebEvents",[]),st(this,"isIdle",!1),st(this,"_linkedFlagSeen",!1),st(this,"_lastActivityTimestamp",Date.now()),st(this,"_linkedFlag",null),st(this,"_forceAllowLocalhostNetworkCapture",!1),st(this,"_samplingSessionListener",null),this.instance=i,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,je==null||je.addEventListener("beforeunload",function(){r._flushBuffer()}),je==null||je.addEventListener("offline",function(){r._tryAddCustomEvent("browser offline",{})}),je==null||je.addEventListener("online",function(){r._tryAddCustomEvent("browser online",{})}),je==null||je.addEventListener("visibilitychange",function(){if(Ot!=null&&Ot.visibilityState){var o="window "+Ot.visibilityState;r._tryAddCustomEvent(o,{})}}),!this.instance.sessionManager)throw ft.error(ko+" started without valid sessionManager"),new Error(ko+" started without valid sessionManager. This is a bug.");var n=this.sessionManager.checkAndGetSessionAndWindowId(),a=n.sessionId,s=n.windowId;this.sessionId=a,this.windowId=s,this.buffer=this.clearBuffer(),this._setupSampling()}return nr(t,[{key:"rrwebRecord",get:function(){var i;return an==null||(i=an.rrweb)===null||i===void 0?void 0:i.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw new Error(ko+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var i;return((i=this.instance.config.session_recording)===null||i===void 0?void 0:i.full_snapshot_interval_millis)||tde}},{key:"isSampled",get:function(){var i=this.instance.get_property(H_);return og(i)?i:null}},{key:"sessionDuration",get:function(){var i,r,n=(i=this.buffer)===null||i===void 0?void 0:i.data[((r=this.buffer)===null||r===void 0?void 0:r.data.length)-1],a=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-a:null}},{key:"isRecordingEnabled",get:function(){var i=!!this.instance.get_property(OD),r=!this.instance.config.disable_session_recording;return je&&i&&r}},{key:"isConsoleLogCaptureEnabled",get:function(){var i=!!this.instance.get_property(lk),r=this.instance.config.enable_recording_console_log;return r??i}},{key:"canvasRecording",get:function(){var i=this.instance.get_property(hk);return i&&i.fps&&i.quality?{enabled:i.enabled,fps:i.fps,quality:i.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var i,r,n=this.instance.get_property(ck),a={recordHeaders:(i=this.instance.config.session_recording)===null||i===void 0?void 0:i.recordHeaders,recordBody:(r=this.instance.config.session_recording)===null||r===void 0?void 0:r.recordBody},s=(a==null?void 0:a.recordHeaders)||(n==null?void 0:n.recordHeaders),o=(a==null?void 0:a.recordBody)||(n==null?void 0:n.recordBody),l=Ga(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,c=!!(og(l)?l:n!=null&&n.capturePerformance);return s||o||c?{recordHeaders:s,recordBody:o,recordPerformance:c}:void 0}},{key:"sampleRate",get:function(){var i=this.instance.get_property(uk);return el(i)?i:null}},{key:"minimumDuration",get:function(){var i=this.instance.get_property(dk);return el(i)?i:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?pl(this._linkedFlag)||this._linkedFlagSeen?og(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),ft.info(ko+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,ft.info(ko+" stopped"))}},{key:"makeSamplingDecision",value:function(i){var r,n=this.sessionId!==i,a=this.sampleRate;if(el(a)){var s,o=this.isSampled,l=n||!og(o);l?s=Math.random()<a:s=o,!s&&l&&ft.warn(ko+" Sample rate (".concat(a,") has determined that this sessionId (").concat(i,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:a}),(r=this.instance.persistence)===null||r===void 0||r.register(st({},H_,s))}else{var c;(c=this.instance.persistence)===null||c===void 0||c.register(st({},H_,null))}}},{key:"afterDecideResponse",value:function(i){var r,n,a,s=this;if(this._persistDecideResponse(i),this._linkedFlag=((r=i.sessionRecording)===null||r===void 0?void 0:r.linkedFlag)||null,(n=i.sessionRecording)!==null&&n!==void 0&&n.endpoint&&(this._endpoint=(a=i.sessionRecording)===null||a===void 0?void 0:a.endpoint),this._setupSampling(),!pl(this._linkedFlag)){var o=cs(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,l=cs(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(c,h){var u=Ga(h)&&o in h,d=l?h[o]===l:u;if(d){var A={linkedFlag:o,linkedVariant:l},f="linked flag matched";ft.info(ko+" "+f,A),s._tryAddCustomEvent(f,A)}s._linkedFlagSeen=d})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var i=this;el(this.sampleRate)&&qu(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(r){i.makeSamplingDecision(r)}))}},{key:"_persistDecideResponse",value:function(i){if(this.instance.persistence){var r=this.instance.persistence,n=function(){var a,s,o,l,c,h,u,d,A=(a=i.sessionRecording)===null||a===void 0?void 0:a.sampleRate,f=pl(A)?null:parseFloat(A),m=(s=i.sessionRecording)===null||s===void 0?void 0:s.minimumDurationMilliseconds;r.register((st(d={},OD,!!i.sessionRecording),st(d,lk,(o=i.sessionRecording)===null||o===void 0?void 0:o.consoleLogRecordingEnabled),st(d,ck,It({capturePerformance:i.capturePerformance},(l=i.sessionRecording)===null||l===void 0?void 0:l.networkPayloadCapture)),st(d,hk,{enabled:(c=i.sessionRecording)===null||c===void 0?void 0:c.recordCanvas,fps:(h=i.sessionRecording)===null||h===void 0?void 0:h.canvasFps,quality:(u=i.sessionRecording)===null||u===void 0?void 0:u.canvasQuality}),st(d,uk,f),st(d,dk,Qt(m)?null:m),d))};n(),this.sessionManager.onSessionId(n)}}},{key:"log",value:function(i){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(r=this.instance.sessionRecording)===null||r===void 0||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(i)]}},timestamp:pj()})}},{key:"_startCapture",value:function(){var i=this;Qt(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(Zl.LIB_VERSION),function(r){if(r)return ft.error(ko+" could not load recorder.js",r);i._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(i){var r;return i.type===3&&ide.indexOf((r=i.data)===null||r===void 0?void 0:r.source)!==-1}},{key:"_updateWindowAndSessionIds",value:function(i){var r=this.isInteractiveEvent(i);r||this.isIdle||i.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var n=!1;if(r&&(this._lastActivityTimestamp=i.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:i.type}),n=!0)),!this.isIdle){var a=this.sessionManager.checkAndGetSessionAndWindowId(!r,i.timestamp),s=a.windowId,o=a.sessionId,l=this.sessionId!==o,c=this.windowId!==s;this.windowId=s,this.sessionId=o,(n||[Gue,zue].indexOf(i.type)===-1&&(c||l||Qt(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(i){try{return i.rrwebMethod(),!0}catch(r){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:i.enqueuedAt||Date.now(),attempt:i.attempt++,rrwebMethod:i.rrwebMethod}
3617):ft.warn(ko+" could not emit queued rrweb event.",r,i),!1}}},{key:"_tryAddCustomEvent",value:function(i,r){var n=this;return this._tryRRWebMethod(xk(function(){return n.rrwebRecord.addCustomEvent(i,r)}))}},{key:"_tryTakeFullSnapshot",value:function(){var i=this;return this._tryRRWebMethod(xk(function(){return i.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var i,r=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this.instance.config.session_recording,s=0,o=Object.entries(a||{});s<o.length;s++){var l=Bs(o[s],2),c=l[0],h=l[1];c in n&&(n[c]=h)}if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=(i=this.mutationRateLimiter)!==null&&i!==void 0?i:new ede(this.rrwebRecord,{onBlockedNode:function(d,A){var f="Too many mutations on node '".concat(d,"'. Rate limiting. This could be due to SVG animations or something similar");ft.info(f,{node:A}),r.log(ko+" "+f,"warn")}});var u=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(It({emit:function(d){r.onRRwebEmit(d)},plugins:u},n)),this.instance._addCaptureHook(function(d){try{if(d==="$pageview"){var A=je?r._maskUrl(je.location.href):"";if(!A)return;r._tryAddCustomEvent("$pageview",{href:A})}}catch(f){ft.error("Could not add $pageview to rrweb session",f)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:u.map(function(d){return d==null?void 0:d.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else ft.error(ko+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var i=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var r=this.fullSnapshotIntervalMillis;r&&(this._fullSnapshotTimer=setInterval(function(){i._tryTakeFullSnapshot()},r))}}},{key:"_gatherRRWebPlugins",value:function(){var i=[];return an.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&i.push(an.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&uc(an.getRecordNetworkPlugin)&&(!xue.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(an.getRecordNetworkPlugin($ue(this.instance.config,this.networkPayloadCapture))):ft.info(ko+" NetworkCapture not started because we are on localhost.")),i}},{key:"onRRwebEmit",value:function(i){if(this._processQueuedEvents(),i&&Ga(i)){if(i.type===wS.Meta){var r=this._maskUrl(i.data.href);if(this._lastHref=r,!r)return;i.data.href=r}else this._pageViewFallBack();i.type===wS.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(i):i;if(n){var a=function(l){var c=l;if(c&&Ga(c)&&c.type===6&&Ga(c.data)&&c.data.plugin==="rrweb/console@1"){c.data.payload.payload.length>10&&(c.data.payload.payload=c.data.payload.payload.slice(0,10),c.data.payload.payload.push("...[truncated]"));for(var h=[],u=0;u<c.data.payload.payload.length;u++)c.data.payload.payload[u]&&c.data.payload.payload[u].length>2e3?h.push(c.data.payload.payload[u].slice(0,2e3)+"...[truncated]"):h.push(c.data.payload.payload[u]);return c.data.payload.payload=h,l}return l}(n),s=jD(a);if(this._updateWindowAndSessionIds(a),!this.isIdle||a.type===wS.Custom){var o={$snapshot_bytes:s,$snapshot_data:a,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(o):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&je){var i=this._maskUrl(je.location.href);this._lastHref!==i&&(this._tryAddCustomEvent("$url_changed",{href:i}),this._lastHref=i)}}},{key:"_processQueuedEvents",value:function(){var i=this;if(this.queuedRRWebEvents.length){var r=Iu(this.queuedRRWebEvents);this.queuedRRWebEvents=[],r.forEach(function(n){Date.now()-n.enqueuedAt<=2e3&&i._tryRRWebMethod(n)})}}},{key:"_maskUrl",value:function(i){var r=this.instance.config.session_recording;
3617if(r.maskNetworkRequestFn){var n,a={url:i};return(n=a=r.maskNetworkRequestFn(a))===null||n===void 0?void 0:n.url}return i}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var i=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var r=this.minimumDuration,n=this.sessionDuration,a=el(n)&&n>=0,s=el(r)&&a&&n<r;return this.status==="buffering"||s?(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&YD(this.buffer).forEach(function(o){i._captureSnapshot({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId})}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(i){var r,n=this,a=2+(((r=this.buffer)===null||r===void 0?void 0:r.data.length)||0);(this.buffer.size+i.$snapshot_bytes+a>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=i.$snapshot_bytes,this.buffer.data.push(i.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){n._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(i){this.instance.capture("$snapshot",i,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings"})}}]),t}(),nde=function(){function t(i){rr(this,t),this.instance=i,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return nr(t,[{key:"call",value:function(){var i=this,r={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(cg),group_properties:this.instance.get_property(Nd),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:r,compression:this.instance.config.disable_compression?void 0:Jl.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(n){return i.parseDecideResponse(n.json)}})}},{key:"parseDecideResponse",value:function(i){var r=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!i;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(i??{},n),n)ft.error("Failed to fetch feature flags from PostHog.");else{if(!Ot||!Ot.body)return ft.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){r.parseDecideResponse(i)},500);if(this.instance._afterDecideResponse(i),i.siteApps)if(this.instance.config.opt_in_site_apps){var a,s=wl(i.siteApps);try{var o=function(){var l=a.value,c=l.id,h=l.url,u=r.instance.requestRouter.endpointFor("api",h);an["__$$ph_site_app_".concat(c)]=r.instance,r.instance.requestRouter.loadScript(u,function(d){if(d)return ft.error("Error while initializing PostHog app with config id ".concat(c),d)})};for(s.s();!(a=s.n()).done;)o()}catch(l){s.e(l)}finally{s.f()}}else i.siteApps.length>0&&ft.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}]),t}(),ade=je!=null&&je.location?fC(je.location.hash,"__posthog")||fC(location.hash,"state"):null,Rk="_postHogToolbarParams";(function(t){t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED"})(ru||(ru={}));var sde=function(){function t(i){rr(this,t),this.instance=i}return nr(t,[{key:"setToolbarState",value:function(i){an.ph_toolbar_state=i}},{key:"getToolbarState",value:function(){var i;return(i=an.ph_toolbar_state)!==null&&i!==void 0?i:ru.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var i,r,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!je||!Ot)return!1;n=(i=n)!==null&&i!==void 0?i:je.location,s=(r=s)!==null&&r!==void 0?r:je.history;try{if(!a){try{je.localStorage.setItem("test","test"),je.localStorage.removeItem("test")}catch{return!1}a=je==null?void 0:je.localStorage}var o,l=ade||fC(n.hash,"__posthog")||fC(n.hash,"state"),c=l?rk(function(){return JSON.parse(atob(decodeURIComponent(l)))})||rk(function(){return JSON.parse(decodeURIComponent(l))}):null;return c&&c.action==="ph_authorize"?((o=c).source="url",o&&Object.keys(o).length>0&&(c.desiredHash?n.hash=c.desiredHash:s?s.replaceState(s.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(a.getItem(Rk)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}},{key:"_callLoadToolbar",value:function(i){(an.ph_load_toolbar||an.ph_load_editor)(i,this.instance)}},{key:"loadToolbar",value:function(i){var r=this,n=!(Ot==null||!Ot.getElementById(zD));if(!je||n)return!1;var a=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=It(It({token:this.instance.config.token},i),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},a?{instrument:!1}:{});if(je.localStorage.setItem(Rk,JSON.stringify(It(It({},s),{},{source:void 0}))),this.getToolbarState()===ru.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===ru.UNINITIALIZED){this.setToolbarState(ru.LOADING);var o=3e5,l=Math.floor(Date.now()/o)*o;this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(l),function(c){if(c)return ft.error("Failed to load toolbar",c),void r.setToolbarState(ru.UNINITIALIZED);r.setToolbarState(ru.LOADED),r._callLoadToolbar(s)}),pu(je,"turbolinks:load",function(){r.setToolbarState(ru.UNINITIALIZED),r.loadToolbar(s)})}return!0}},{key:"_loadEditor",value:function(i){return this.loadToolbar(i)}},{key:"maybeLoadEditor",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(i,r,n)}}]),t}(),ode=function(){function t(i){rr(this,t),st(this,"isPaused",!0),st(this,"queue",[]),st(this,"flushTimeoutMs",3e3),this.sendRequest=i}return nr(t,[{key:"enqueue",value:function(i){this.queue.push(i),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var i=this;this.clearFlushTimeout();var r=this.queue.length>0?this.formatQueue():{},n=Object.values(r);[].concat(Iu(n.filter(function(a){return a.url.indexOf("/e")===0})),Iu(n.filter(function(a){return a.url.indexOf("/e")!==0}))).map(function(a){i.sendRequest(It(It({},a),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var i=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(i.clearFlushTimeout(),i.queue.length>0){var r=i.formatQueue(),n=function(s){var o=r[s],l=new Date().getTime();o.data&&Xn(o.data)&&xr(o.data,function(c){c.offset=Math.abs(c.timestamp-l),delete c.timestamp}),i.sendRequest(o)};for(var a in r)n(a)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var i={};return xr(this.queue,function(r){var n,a=r,s=(a?a.batchKey:null)||a.url;Qt(i[s])&&(i[s]=It(It({},a),{},{data:[]})),(n=i[s].data)===null||n===void 0||n.push(a.data)}),this.queue=[],i}}]),t}(),Oo=Uint8Array,Ns=Uint16Array,r0=Uint32Array,ZO=new Oo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),JO=new Oo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Bk=new Oo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),zj=function(t,i){for(var r=new Ns(31),n=0;n<31;++n)r[n]=i+=1<<t[n-1];var a=new r0(r[30]);for(n=1;n<30;++n)for(var s=r[n];s<r[n+1];++s)a[s]=s-r[n]<<5|n;return[r,a]},Qj=zj(ZO,2),lde=Qj[0],JD=Qj[1];lde[28]=258,JD[258]=28;for(var Ik=zj(JO,0)[1],$D=new Ns(32768),Hr=0;Hr<32768;++Hr){var ef=(43690&Hr)>>>1|(21845&Hr)<<1;ef=(61680&(ef=(52428&ef)>>>2|(13107&ef)<<2))>>>4|(3855&ef)<<4,$D[Hr]=((65280&ef)>>>8|(255&ef)<<8)>>>1}var z_=function(t,i,r){for(var n=t.length,a=0,s=new Ns(i);a<n;++a)++s[t[a]-1];var o,l=new Ns(i);for(a=0;a<i;++a)l[a]=l[a-1]+s[a-1]<<1;if(r){o=new Ns(1<<i);var c=15-i;for(a=0;a<n;++a)if(t[a])for(var h=a<<4|t[a],u=i-t[a],d=l[t[a]-1]++<<u,A=d|(1<<u)-1;d<=A;++d)o[$D[d]>>>c]=h}else for(o=new Ns(n),a=0;a<n;++a)o[a]=$D[l[t[a]-1]++]>>>15-t[a];return o},lp=new Oo(288);for(Hr=0;Hr<144;++Hr)lp[Hr]=8;for(Hr=144;Hr<256;++Hr)lp[Hr]=9;for(Hr=256;Hr<280;++Hr)lp[Hr]=7;for(Hr=280;Hr<288;++Hr)lp[Hr]=8;var vC=new Oo(32);for(Hr=0;Hr<32;++Hr)vC[Hr]=5;var cde=z_(lp,9,0),hde=z_(vC,5,0),Vj=function(t){return(t/8>>
vendor: 4,422 bytes, line 3617
36170)+(7&t&&1)},Wj=function(t,i,r){(i==null||i<0)&&(i=0),(r==null||r>t.length)&&(r=t.length);var n=new(t instanceof Ns?Ns:t instanceof r0?r0:Oo)(r-i);return n.set(t.subarray(i,r)),n},Oh=function(t,i,r){r<<=7&i;var n=i/8>>0;t[n]|=r,t[n+1]|=r>>>8},Sv=function(t,i,r){r<<=7&i;var n=i/8>>0;t[n]|=r,t[n+1]|=r>>>8,t[n+2]|=r>>>16},rR=function(t,i){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var a=r.length,s=r.slice();if(!a)return[new Oo(0),0];if(a==1){var o=new Oo(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort(function(b,E){return b.f-E.f}),r.push({s:-1,f:25001});var l=r[0],c=r[1],h=0,u=1,d=2;for(r[0]={s:-1,f:l.f+c.f,l,r:c};u!=a-1;)l=r[r[h].f<r[d].f?h++:d++],c=r[h!=u&&r[h].f<r[d].f?h++:d++],r[u++]={s:-1,f:l.f+c.f,l,r:c};var A=s[0].s;for(n=1;n<a;++n)s[n].s>A&&(A=s[n].s);var f=new Ns(A+1),m=ude(r[u-1],f,0);if(m>i){n=0;var g=0,p=m-i,v=1<<p;for(s.sort(function(b,E){return f[E.s]-f[b.s]||b.f-E.f});n<a;++n){var _=s[n].s;if(!(f[_]>i))break;g+=v-(1<<m-f[_]),f[_]=i}for(g>>>=p;g>0;){var y=s[n].s;f[y]<i?g-=1<<i-f[y]++-1:++n}for(;n>=0&&g;--n){var w=s[n].s;f[w]==i&&(--f[w],++g)}m=i}return[new Oo(f),m]},ude=function t(i,r,n){return i.s==-1?Math.max(t(i.l,r,n+1),t(i.r,r,n+1)):r[i.s]=n},Dk=function(t){for(var i=t.length;i&&!t[--i];);for(var r=new Ns(++i),n=0,a=t[0],s=1,o=function(c){r[n++]=c},l=1;l<=i;++l)if(t[l]==a&&l!=i)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[l]}return[r.subarray(0,n),i]},Cv=function(t,i){for(var r=0,n=0;n<i.length;++n)r+=t[n]*i[n];return r},bS=function(t,i,r){var n=r.length,a=Vj(i+2);t[a]=255&n,t[a+1]=n>>>8,t[a+2]=255^t[a],t[a+3]=255^t[a+1];for(var s=0;s<n;++s)t[a+s+4]=r[s];return 8*(a+4+n)},Pk=function(t,i,r,n,a,s,o,l,c,h,u){Oh(i,u++,r),++a[256];for(var d=rR(a,15),A=d[0],f=d[1],m=rR(s,15),g=m[0],p=m[1],v=Dk(A),_=v[0],y=v[1],w=Dk(g),b=w[0],E=w[1],M=new Ns(19),S=0;S<_.length;++S)M[31&_[S]]++;for(S=0;S<b.length;++S)M[31&b[S]]++;for(var T=rR(M,7),C=T[0],x=T[1],R=19;R>4&&!C[Bk[R-1]];--R);var L,I,F,Y,D=h+5<<3,U=Cv(a,lp)+Cv(s,vC)+o,j=Cv(a,A)+Cv(s,g)+o+14+3*R+Cv(M,C)+(2*M[16]+3*M[17]+7*M[18]);if(D<=U&&D<=j)return bS(i,u,t.subarray(c,c+h));if(Oh(i,u,1+(j<U)),u+=2,j<U){L=z_(A,f,0),I=A,F=z_(g,p,0),Y=g;var J=z_(C,x,0);for(Oh(i,u,y-257),Oh(i,u+5,E-1),Oh(i,u+10,R-4),u+=14,S=0;S<R;++S)Oh(i,u+3*S,C[Bk[S]]);u+=3*R;for(var z=[_,b],$=0;$<2;++$){var te=z[$];for(S=0;S<te.length;++S){var ae=31&te[S];Oh(i,u,J[ae]),u+=C[ae],ae>15&&(Oh(i,u,te[S]>>>5&127),u+=te[S]>>>12)}}}else L=cde,I=lp,F=hde,Y=vC;for(S=0;S<l;++S)if(n[S]>255){ae=n[S]>>>18&31,Sv(i,u,L[ae+257]),u+=I[ae+257],ae>7&&(Oh(i,u,n[S]>>>23&31),u+=ZO[ae]);var ve=31&n[S];Sv(i,u,F[ve]),u+=Y[ve],ve>3&&(Sv(i,u,n[S]>>>5&8191),u+=JO[ve])}else Sv(i,u,L[n[S]]),u+=I[n[S]];return Sv(i,u,L[256]),u+I[256]},dde=new r0([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Ade=new Oo(0),fde=function(){for(var t=new r0(256),i=0;i<256;++i){for(var r=i,n=9;--n;)r=(1&r&&3988292384)^r>>>1;t[i]=r}return t}(),pde=function(t,i,r,n,a){return function(s,o,l,c,h,u){var d=s.length,A=new Oo(c+d+5*(1+Math.floor(d/7e3))+h),f=A.subarray(c,A.length-h),m=0;if(!o||d<8)for(var g=0;g<=d;g+=65535){var p=g+65535;p<d?m=bS(f,m,s.subarray(g,p)):(f[g]=u,m=bS(f,m,s.subarray(g,d)))}else{for(var v=dde[o-1],_=v>>>13,y=8191&v,w=(1<<l)-1,b=new Ns(32768),E=new Ns(w+1),M=Math.ceil(l/3),S=2*M,T=function(_e){return(s[_e]^s[_e+1]<<M^s[_e+2]<<S)&w},C=new r0(25e3),x=new Ns(288),R=new Ns(32),L=0,I=0,F=(g=0,0),Y=0,D=0;g<d;++g){var U=T(g),j=32767&g,J=E[U];if(b[j]=J,E[U]=j,Y<=g){var z=d-g;if((L>7e3||F>24576)&&z>423){m=Pk(s,f,0,C,x,R,I,F,D,g-D,m),F=L=I=0,D=g;for(var $=0;$<286;++$)x[$]=0;for($=0;$<30;++$)R[$]=0}var te=2,ae=0,ve=y,oe=j-J&32767;if(z>2&&U==T(g-oe))for(var K=Math.min(_,z)-1,X=Math.min(32767,g),N=Math.min(258,z);oe<=X&&--ve&&j!=J;){if(s[g+te]==s[g+te-oe]){for(var k=0;k<N&&s[g+k]==s[g+k-oe];++k);if(k>te){if(te=k,ae=oe,k>K)break;var Z=Math.min(oe,k-2),V=0;for($=0;$<Z;++$){var re=g-oe+$+32768&32767,Ae=re-b[re]+32768&32767;Ae>V&&(V=Ae,J=re)}}}oe+=(j=J)-(J=b[j])+32768&32767}if(ae){C[F++]=268435456|JD[te]<<18|Ik[ae];var pe=31&JD[te],ce=31&Ik[ae];I+=ZO[pe]+JO[ce],++x[257+pe],++R[ce],Y=g+te,++L}else C[F++]=s[g],++x[s[g]]}}m=Pk(s,f,u,C,x,R,I,F,D,g-D,m),u||(m=bS(f,m,Ade))}return Wj(A,0,c+Vj(m)+h)}(t,i.level==null?6:i.level,i.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,r,n,!
3617a)},nR=function(t,i,r){for(;r;++i)t[i]=r,r>>>=8};function mde(t,i){i===void 0&&(i={});var r=function(){var l=4294967295;return{p:function(c){for(var h=l,u=0;u<c.length;++u)h=fde[255&h^c[u]]^h>>>8;l=h},d:function(){return 4294967295^l}}}(),n=t.length;r.p(t);var a,s=pde(t,i,10+((a=i).filename&&a.filename.length+1||0),8),o=s.length;return function(l,c){var h=c.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=c.level<2?4:c.level==9?2:0,l[9]=3,c.mtime!=0&&nR(l,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),h){l[3]=8;for(var u=0;u<=h.length;++u)l[u+10]=h.charCodeAt(u)}}(s,i),nR(s,o-8,r.d()),nR(s,o-4,n),s}var gde=!!ID||!!BD,Lk="text/plain",_C=function(t,i){var r=Bs(t.split("?"),2),n=r[0],a=r[1],s=It({},i);a==null||a.split("&").forEach(function(l){var c=Bs(l.split("="),1)[0];delete s[c]});var o=Rue(s);return o=o?(a?a+"&":"")+o:a,"".concat(n,"?").concat(o)},vde=function(t){return"data="+encodeURIComponent(typeof t=="string"?t:JSON.stringify(t))},aR=function(t){var i=t.data,r=t.compression;if(i){if(r===Jl.GZipJS){var n=mde(function(s,o){var l=s.length;if(!o&&typeof TextEncoder<"u")return new TextEncoder().encode(s);for(var c=new Oo(s.length+(s.length>>>1)),h=0,u=function(m){c[h++]=m},d=0;d<l;++d){if(h+5>c.length){var A=new Oo(h+8+(l-d<<1));A.set(c),c=A}var f=s.charCodeAt(d);f<128||o?u(f):f<2048?(u(192|f>>>6),u(128|63&f)):f>55295&&f<57344?(u(240|(f=65536+(1047552&f)|1023&s.charCodeAt(++d))>>>18),u(128|f>>>12&63),u(128|f>>>6&63),u(128|63&f)):(u(224|f>>>12),u(128|f>>>6&63),u(128|63&f))}return Wj(c,0,h)}(JSON.stringify(i)),{mtime:0});return{contentType:Lk,body:new Blob([n],{type:Lk})}}if(r===Jl.Base64){var a=function(s){var o,l,c,h,u,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",A=0,f=0,m="",g=[];if(!s)return s;s=mue(s);do o=(u=s.charCodeAt(A++)<<16|s.charCodeAt(A++)<<8|s.charCodeAt(A++))>>18&63,l=u>>12&63,c=u>>6&63,h=63&u,g[f++]=d.charAt(o)+d.charAt(l)+d.charAt(c)+d.charAt(h);while(A<s.length);switch(m=g.join(""),s.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"="}return m}(JSON.stringify(i));return{contentType:"application/x-www-form-urlencoded",body:vde(a)}}return{contentType:"application/json",body:JSON.stringify(i)}}},Q_=[];ID&&Q_.push({transport:"XHR",method:function(t){var i,r=new ID;r.open(t.method||"GET",t.url,!0);var n=(i=aR(t))!==null&&i!==void 0?i:{},a=n.contentType,s=n.body;xr(t.headers,function(o,l){r.setRequestHeader(l,o)}),a&&r.setRequestHeader("Content-Type",a),t.timeout&&(r.timeout=t.timeout),r.withCredentials=!0,r.onreadystatechange=function(){if(r.readyState===4){var o,l={statusCode:r.status,text:r.responseText};if(r.status===200)try{l.json=JSON.parse(r.responseText)}catch{}(o=t.callback)===null||o===void 0||o.call(t,l)}},r.send(s)}}),BD&&Q_.push({transport:"fetch",method:function(t){var i,r,n=(i=aR(t))!==null&&i!==void 0?i:{},a=n.contentType,s=n.body,o=new Headers;xr(o,function(u,d){o.append(d,u)}),a&&o.append("Content-Type",a);var l=t.url,c=null;if(tk){var h=new tk;c={signal:h.signal,timeout:setTimeout(function(){return h.abort()},t.timeout)}}BD(l,{method:(t==null?void 0:t.method)||"GET",headers:o,keepalive:t.method==="POST",body:s,signal:(r=c)===null||r===void 0?void 0:r.signal}).then(function(u){return u.text().then(function(d){var A,f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(m){ft.error(m)}(A=t.callback)===null||A===void 0||A.call(t,f)})}).catch(function(u){var d;ft.error(u),(d=t.callback)===null||d===void 0||d.call(t,{statusCode:0,text:u})}).finally(function(){return c?clearTimeout(c.timeout):null})}}),wu!=null&&wu.sendBeacon&&Q_.push({transport:"sendBeacon",method:function(t){var i=_C(t.url,{beacon:"1"});try{var r,n=(r=aR(t))!==null&&r!==void 0?r:{},a=n.contentType,s=n.body,o=typeof s=="string"?new Blob([s],{type:a}):s;wu.sendBeacon(i,o)}catch{}}});var _de=["retriesPerformedSoFar"],xf,yde=function(){function t(i){var r=this;rr(this,t),st(this,"isPolling",!1),st(this,"pollIntervalMs",3e3),st(this,"queue",[]),this.instance=i,this.queue=[],this.areWeOnline=!0,!Qt(je)&&"onLine"in je.navigator&&(this.areWeOnline=je.navigator.onLine,je.addEventListener("online",function(){r.areWeOnline=!0,r.flush()}),je.addEventListener("offline",function(){r.areWeOnline=!1}))}
3617return nr(t,[{key:"retriableRequest",value:function(i){var r=this,n=i.retriesPerformedSoFar,a=uue(i,_de);el(n)&&n>0&&(a.url=_C(a.url,{retry_count:n})),this.instance._send_request(It(It({},a),{},{callback:function(s){var o;s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?r.enqueue(It({retriesPerformedSoFar:n},a)):(o=a.callback)===null||o===void 0||o.call(a,s)}}))}},{key:"enqueue",value:function(i){var r=i.retriesPerformedSoFar||0;i.retriesPerformedSoFar=r+1;var n=function(o){var l=3e3*Math.pow(2,o),c=l/2,h=Math.min(18e5,l),u=(Math.random()-.5)*(h-c);return Math.ceil(h+u)}(r),a=Date.now()+n;this.queue.push({retryAt:a,requestOptions:i});var s="Enqueued failed request for retry in ".concat(n);navigator.onLine||(s+=" (Browser is offline)"),ft.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var i=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){i.areWeOnline&&i.queue.length>0&&i.flush(),i.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var i=Date.now(),r=[],n=this.queue.filter(function(l){return l.retryAt<i||(r.push(l),!1)});if(this.queue=r,n.length>0){var a,s=wl(n);try{for(s.s();!(a=s.n()).done;){var o=a.value.requestOptions;this.retriableRequest(o)}}catch(l){s.e(l)}finally{s.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var i,r=wl(this.queue);try{for(r.s();!(i=r.n()).done;){var n=i.value.requestOptions;try{this.instance._send_request(It(It({},n),{},{transport:"sendBeacon"}))}catch(a){ft.error(a)}}}catch(a){r.e(a)}finally{r.f()}this.queue=[]}}]),t}(),Tw=1800,Ede=function(){function t(i,r,n,a){var s;rr(this,t),st(this,"_sessionIdChangedHandlers",[]),this.config=i,this.persistence=r,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||eA,this._windowIdGenerator=a||eA;var o=i.persistence_name||i.token,l=i.session_idle_timeout_seconds||Tw;if(el(l)?l>Tw?ft.warn("session_idle_timeout_seconds cannot be greater than 30 minutes. Using 30 minutes instead."):l<60&&ft.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(ft.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),l=Tw),this._sessionTimeoutMs=1e3*Math.min(Math.max(l,60),Tw),this._window_id_storage_key="ph_"+o+"_window_id",this._primary_window_exists_storage_key="ph_"+o+"_primary_window_exists",this._canUseSessionStorage()){var c=Na.parse(this._window_id_storage_key),h=Na.parse(this._primary_window_exists_storage_key);c&&!h?this._windowId=c:Na.remove(this._window_id_storage_key),Na.set(this._primary_window_exists_storage_key,!0)}if((s=this.config.bootstrap)!==null&&s!==void 0&&s.sessionID)try{var u=function(d){var A=d.replace(/-/g,"");if(A.length!==32)throw new Error("Not a valid UUID");if(A[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(A.substring(0,12),16)}(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),u)}catch(d){ft.error("Invalid sessionID in bootstrap",d)}this._listenToReloadWindow()}return nr(t,[{key:"onSessionId",value:function(i){var r=this;return Qt(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(i),this._sessionId&&i(this._sessionId,this._windowId),function(){r._sessionIdChangedHandlers=r._sessionIdChangedHandlers.filter(function(n){return n!==i})}}},{key:"_canUseSessionStorage",value:function(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Na.is_supported()}},{key:"_setWindowId",value:function(i){i!==this._windowId&&(this._windowId=i,this._canUseSessionStorage()&&Na.set(this._window_id_storage_key,i))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?Na.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(i,r,n){i===this._sessionId&&r===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=r,this._sessionId=i,this.persistence.register(st({},hC,[r,i,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var i=this.persistence.props[hC];return Xn(i)&&i.length===2&&i.push(i[0]),i||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var i=this;je==null||je.addEventListener("beforeunload",function(){i._canUseSessionStorage()&&Na.remove(i._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var i=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||new Date().getTime(),n=Bs(this._getSessionId(),3),a=n[0],s=n[1],o=n[2],l=this._getWindowId(),c=o&&o>0&&Math.abs(r-o)>864e5,h=!1,u=!s,d=!i&&Math.abs(r-a)>this._sessionTimeoutMs;u||d||c?(s=this._sessionIdGenerator(),l=this._windowIdGenerator(),ft.info("[SessionId] new session ID generated",{sessionId:s,windowId:l,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:c}}),o=r,h=!0):l||(l=this._windowIdGenerator(),h=!0);
3617var A=a===0||!i||c?r:a,f=o===0?new Date().getTime():o;return this._setWindowId(l),this._setSessionId(s,A,f),h&&this._sessionIdChangedHandlers.forEach(function(m){return m(s,l)}),{sessionId:s,windowId:l,sessionStartTimestamp:f}}}]),t}();(function(t){t.US="us",t.EU="eu",t.CUSTOM="custom"})(xf||(xf={}));var Ok="i.posthog.com",wde=function(){function t(i){rr(this,t),st(this,"_regionCache",{}),this.instance=i}return nr(t,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var i,r=(i=this.instance.config.ui_host)===null||i===void 0?void 0:i.replace(/\/$/,"");return r==="https://app.posthog.com"?"https://us.posthog.com":r}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=xf.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=xf.EU:this._regionCache[this.apiHost]=xf.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(r&&(r=r[0]==="/"?r:"/".concat(r)),i==="ui")return(this.uiHost||this.apiHost.replace(".".concat(Ok),".posthog.com"))+r;if(this.region===xf.CUSTOM)return this.apiHost+r;var n=Ok+r;switch(i){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}},{key:"loadScript",value:function(i,r){if(this.instance.config.disable_external_dependency_loading)return ft.warn("".concat(i," was requested but loading of external scripts is disabled.")),r("Loading of external scripts is disabled");var n=i[0]==="/"?this.endpointFor("assets",i):i,a=function(){if(!Ot)return r("document not found");var s=Ot.createElement("script");s.type="text/javascript",s.src=n,s.onload=function(c){return r(void 0,c)},s.onerror=function(c){return r(c)};var o,l=Ot.querySelectorAll("body > script");l.length>0?(o=l[0].parentNode)===null||o===void 0||o.insertBefore(s,l[0]):Ot.body.appendChild(s)};Ot!=null&&Ot.body?a():Ot==null||Ot.addEventListener("DOMContentLoaded",a)}}]),t}(),eP="/e/",Mw="[Exception Capture]",bde=function(){function t(i){var r,n,a=this;rr(this,t),st(this,"originalOnUnhandledRejectionHandler",void 0),st(this,"startCapturing",function(){var s;if(je&&a.isEnabled&&!a.hasHandlers&&((s=je.onerror)===null||s===void 0||!s.__POSTHOG_INSTRUMENTED__)){var o=je.posthogErrorWrappingFunctions.wrapOnError,l=je.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(o&&l)try{a.unwrapOnError=o(a.captureException.bind(a)),a.unwrapUnhandledRejection=l(a.captureException.bind(a))}catch(c){ft.error(Mw+" failed to start",c),a.stopCapturing()}else ft.error(Mw+" failed to load error wrapping functions - cannot start")}}),this.instance=i,this.remoteEnabled=!((r=this.instance.persistence)===null||r===void 0||!r.props[ak]),this._endpoint=((n=this.instance.persistence)===null||n===void 0?void 0:n.props[sk])||eP,this.startIfEnabled()}return nr(t,[{key:"endpoint",get:function(){return this._endpoint}},{key:"isEnabled",get:function(){var i;return(i=this.remoteEnabled)!==null&&i!==void 0&&i}},{key:"isCapturing",get:function(){var i;return!(je==null||(i=je.onerror)===null||i===void 0||!i.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(ft.info(Mw+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(i){this.hasHandlers&&i(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.
3617js?v=".concat(Zl.LIB_VERSION)),function(r){if(r)return ft.error(Mw+" failed to load script",r);i()})}},{key:"stopCapturing",value:function(){var i,r;(i=this.unwrapOnError)===null||i===void 0||i.call(this),(r=this.unwrapUnhandledRejection)===null||r===void 0||r.call(this)}},{key:"afterDecideResponse",value:function(i){var r=i.autocaptureExceptions;this.remoteEnabled=!!r||!1,this._endpoint=Ga(r)&&r.endpoint||eP,this.instance.persistence&&(this.instance.persistence.register(st({},ak,this.remoteEnabled)),this.instance.persistence.register(st({},sk,this._endpoint))),this.startIfEnabled()}},{key:"captureException",value:function(i){var r=this.instance.requestRouter.endpointFor("ui");i.$exception_personURL="".concat(r,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.sendExceptionEvent(i)}},{key:"sendExceptionEvent",value:function(i){this.instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}]),t}(),jj="posthog-js";function Yj(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=i.organization,n=i.projectId,a=i.prefix,s=i.severityAllowList,o=s===void 0?["error"]:s;return function(l){var c,h,u,d,A,f;if(!(o==="*"||o.includes(l.level))||!t.__loaded)return l;l.tags||(l.tags={});var m=t.requestRouter.endpointFor("ui","/project/".concat(t.config.token,"/person/").concat(t.get_distinct_id()));l.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var g=((c=l.exception)===null||c===void 0?void 0:c.values)||[],p={$exception_message:((h=g[0])===null||h===void 0?void 0:h.value)||l.message,$exception_type:(u=g[0])===null||u===void 0?void 0:u.type,$exception_personURL:m,$exception_level:l.level,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((d=g[0])===null||d===void 0?void 0:d.value)||l.message,$sentry_exception_type:(A=g[0])===null||A===void 0?void 0:A.type,$sentry_tags:l.tags,$level:l.level};return r&&n&&(p.$sentry_url=(a||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+l.event_id),t.capture("$exception",p,{_url:((f=t.exceptionObserver)===null||f===void 0?void 0:f.endpoint)||eP}),l}}var Sde=nr(function t(i,r,n,a,s){rr(this,t),this.name=jj,this.setupOnce=function(o){o(Yj(i,{organization:r,projectId:n,prefix:a,severityAllowList:s}))}});function Cde(t,i){var r=t.config.segment;if(!r)return i();(function(n,a){var s=n.config.segment;if(!s)return a();var o=function(c){var h=function(){return c.anonymousId()||eA()};n.config.get_device_id=h,c.id()&&(n.register({distinct_id:c.id(),$device_id:h()}),n.persistence.set_property(iu,"identified")),a()},l=s.user();"then"in l&&uc(l.then)?l.then(function(c){return o(c)}):o(l)})(t,function(){r.register(function(n){Promise&&Promise.resolve||ft.warn("This browser does not have Promise support, and can not use the segment integration");var a=function(s,o){var l;if(!o)return s;s.event.userId||s.event.anonymousId===n.get_distinct_id()||n.reset(),s.event.userId&&s.event.userId!==n.get_distinct_id()&&(n.register({distinct_id:s.event.userId}),n.reloadFeatureFlags());var c=n._calculate_event_properties(o,(l=s.event.properties)!==null&&l!==void 0?l:{});return s.event.properties=Object.assign({},c,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(s){return a(s,s.event.event)},page:function(s){return a(s,"$pageview")},identify:function(s){return a(s,"$identify")},screen:function(s){return a(s,"$screen")}}}(t)).then(function(){i()})})}var Nk,yC,ql,Tde=function(){function t(i){rr(this,t),this._instance=i}return nr(t,[{key:"doPageView",value:function(){var i,r=this._previousScrollProperties();return this._currentPath=(i=je==null?void 0:je.location.pathname)!==null&&i!==void 0?i:"",this._instance.scrollManager.resetContext(),r}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var i=this._currentPath,r=this._instance.scrollManager.getContext();if(!i||!r)return{};var n=r.maxScrollHeight,a=r.lastScrollY,s=r.maxScrollY,o=r.maxContentHeight,l=r.lastContentY,c=r.maxContentY;return Qt(n)||Qt(a)||Qt(s)||Qt(o)||Qt(l)||Qt(c)?{}:(n=Math.ceil(n),a=Math.ceil(a),s=Math.ceil(s),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),{$prev_pageview_pathname:i,$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:n<=1?1:xw(a/n,0,1),$prev_pageview_max_scroll:s,$prev_pageview_max_scroll_percentage:n<=1?1:xw(s/n,0,1),$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:o<=1?1:xw(l/o,0,1),$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:o<=1?1:xw(c/o,0,1)})}}]),t}();function xw(t,i,r){return Math.max(i,Math.min(t,r))}(function(t){t.Popover="popover",t.API="api",t.Widget="widget"})(Nk||(Nk={})),function(t){t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link"}(yC||(yC={})),function(t){t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question"}(ql||(ql={}));var Kj=function(){function t(){rr(this,t),st(this,"events",{}),this.events={}}return nr(t,[{key:"on",value:function(i,r){var n=this;return this.events[i]||(this.events[i]=[]),this.events[i].push(r),function(){n.events[i]=n.events[i].filter(function(a){return a!==r})}}},{key:"emit",value:function(i,r){var n,a=wl(this.events[i]||[]);try{for(a.s();!(n=a.n()).done;)(0,n.value)(r)}catch(l){a.e(l)}finally{a.f()}var s,o=wl(this.events["*"]||[]);try{for(o.s();!(s=o.n()).done;)(0,s.value)(i,r)}catch(l){o.e(l)}finally{o.f()}}}]),t}(),Mde=function(){function t(i){var r=this;rr(this,t),st(this,"_debugEventEmitter",new Kj),st(this,"checkStep",function(n,a){return r.checkStepEvent(n,a)&&r.checkStepUrl(n,a)&&r.checkStepElement(n,a)}),st(this,"checkStepEvent",function(n,a){return a==null||!a.event||(n==null?void 0:n.event)===(a==null?void 0:a.event)}),this.instance=i,this.actionEvents=new Set,this.actionRegistry=new Set}return nr(t,[{key:"init",value:function(){var i,r=this;if(!Qt((i=this.instance)===null||i===void 0?void 0:i._addCaptureHook)){var n;(n=this.instance)===null||n===void 0||n._addCaptureHook(function(a,s){r.on(a,s)})}}},{key:"register",value:function(i){var r,n,a=this;if(!Qt((r=this.instance)===null||r===void 0?void 0:r._addCaptureHook)&&(i.forEach(function(l){var c,h;(c=a.actionRegistry)===null||c===void 0||c.add(l),(h=l.steps)===null||h===void 0||h.forEach(function(u){var d;(d=a.actionEvents)===null||d===void 0||d.add((u==null?void 0:u.event)||"")})}),(n=this.instance)!==null&&n!==void 0&&n.autocapture)){var s,o=new Set;
3617i.forEach(function(l){var c;(c=l.steps)===null||c===void 0||c.forEach(function(h){h!=null&&h.selector&&o.add(h==null?void 0:h.selector)})}),(s=this.instance)===null||s===void 0||s.autocapture.setElementSelectors(o)}}},{key:"on",value:function(i,r){var n,a=this;r!=null&&i.length!=0&&(this.actionEvents.has(i)||this.actionEvents.has(r==null?void 0:r.event))&&this.actionRegistry&&((n=this.actionRegistry)===null||n===void 0?void 0:n.size)>0&&this.actionRegistry.forEach(function(s){a.checkAction(r,s)&&a._debugEventEmitter.emit("actionCaptured",s.name)})}},{key:"_addActionHook",value:function(i){this.onAction("actionCaptured",function(r){return i(r)})}},{key:"checkAction",value:function(i,r){if((r==null?void 0:r.steps)==null)return!1;var n,a=wl(r.steps);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(this.checkStep(i,s))return!0}}catch(o){a.e(o)}finally{a.f()}return!1}},{key:"onAction",value:function(i,r){return this._debugEventEmitter.on(i,r)}},{key:"checkStepUrl",value:function(i,r){if(r!=null&&r.url){var n,a=i==null||(n=i.properties)===null||n===void 0?void 0:n.$current_url;if(!a||typeof a!="string"||!t.matchString(a,r==null?void 0:r.url,(r==null?void 0:r.url_matching)||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(i,r){if((r!=null&&r.href||r!=null&&r.tag_name||r!=null&&r.text)&&!this.getElementsList(i).some(function(s){return!(r!=null&&r.href&&!t.matchString(s.href||"",r==null?void 0:r.href,(r==null?void 0:r.href_matching)||"exact"))&&(r==null||!r.tag_name||s.tag_name===(r==null?void 0:r.tag_name))&&!(r!=null&&r.text&&!t.matchString(s.text||"",r==null?void 0:r.text,(r==null?void 0:r.text_matching)||"exact")&&!t.matchString(s.$el_text||"",r==null?void 0:r.text,(r==null?void 0:r.text_matching)||"exact"))}))return!1;if(r!=null&&r.selector){var n,a=i==null||(n=i.properties)===null||n===void 0?void 0:n.$element_selectors;if(!a||!a.includes(r==null?void 0:r.selector))return!1}return!0}},{key:"getElementsList",value:function(i){return(i==null?void 0:i.properties.$elements)==null?[]:i==null?void 0:i.properties.$elements}}],[{key:"matchString",value:function(i,r,n){switch(n){case"regex":return!!je&&AC(i,r);case"exact":return r===i;case"contains":var a=t.escapeStringRegexp(r).replace(/_/g,".").replace(/%/g,".*");return AC(i,a);default:return!1}}},{key:"escapeStringRegexp",value:function(i){return i.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),t}(),tP=function(){function t(i){rr(this,t),this.instance=i,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return nr(t,[{key:"register",value:function(i){var r;Qt((r=this.instance)===null||r===void 0?void 0:r._addCaptureHook)||(this.setupEventBasedSurveys(i),this.setupActionBasedSurveys(i))}},{key:"setupActionBasedSurveys",value:function(i){var r=this,n=i.filter(function(a){var s,o,l,c;return((s=a.conditions)===null||s===void 0?void 0:s.actions)&&((o=a.conditions)===null||o===void 0||(l=o.actions)===null||l===void 0||(c=l.values)===null||c===void 0?void 0:c.length)>0});n.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new Mde(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(function(a){r.onAction(a)})),n.forEach(function(a){var s,o,l,c,h,u,d,A,f,m;a.conditions&&(s=a.conditions)!==null&&s!==void 0&&s.actions&&(o=a.conditions)!==null&&o!==void 0&&(l=o.actions)!==null&&l!==void 0&&l.values&&((c=a.conditions)===null||c===void 0||(h=c.actions)===null||h===void 0||(u=h.values)===null||u===void 0?void 0:u.length)>0&&((d=r.actionMatcher)===null||d===void 0||d.register(a.conditions.actions.values),(A=a.conditions)===null||A===void 0||(f=A.actions)===null||f===void 0||(m=f.values)===null||m===void 0||m.forEach(function(g){if(g&&g.name){var p=r.actionToSurveys.get(g.name);p&&p.push(a.id),r.actionToSurveys.set(g.name,p||[a.id])}}))}))}},{key:"setupEventBasedSurveys",value:function(i){var r,n=this;i.filter(function(a){var s,o,l,c;return((s=a.conditions)===null||s===void 0?void 0:s.events)&&((o=a.conditions)===null||o===void 0||(l=o.events)===null||l===void 0||(c=l.values)===null||c===void 0?void 0:c.length)>0}).length!==0&&((r=this.instance)===null||r===void 0||r._addCaptureHook(function(a,s){n.onEvent(a,s)}
3617),i.forEach(function(a){var s,o,l;(s=a.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(l=o.values)===null||l===void 0||l.forEach(function(c){if(c&&c.name){var h=n.eventToSurveys.get(c.name);h&&h.push(a.id),n.eventToSurveys.set(c.name,h||[a.id])}})}))}},{key:"onEvent",value:function(i,r){var n,a,s=((n=this.instance)===null||n===void 0||(a=n.persistence)===null||a===void 0?void 0:a.props[yw])||[];if(t.SURVEY_SHOWN_EVENT_NAME==i&&r&&s.length>0){var o,l=r==null||(o=r.properties)===null||o===void 0?void 0:o.$survey_id;if(l){var c=s.indexOf(l);c>=0&&(s.splice(c,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(i)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(i)||[]))}},{key:"onAction",value:function(i){var r,n,a=((r=this.instance)===null||r===void 0||(n=r.persistence)===null||n===void 0?void 0:n.props[yw])||[];this.actionToSurveys.has(i)&&this._updateActivatedSurveys(a.concat(this.actionToSurveys.get(i)||[]))}},{key:"_updateActivatedSurveys",value:function(i){var r,n;(r=this.instance)===null||r===void 0||(n=r.persistence)===null||n===void 0||n.register(st({},yw,Iu(new Set(i))))}},{key:"getSurveys",value:function(){var i,r,n=(i=this.instance)===null||i===void 0||(r=i.persistence)===null||r===void 0?void 0:r.props[yw];return n||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),t}();st(tP,"SURVEY_SHOWN_EVENT_NAME","survey shown");var sR="[Surveys]",xde={icontains:function(t){return!!je&&je.location.href.toLowerCase().indexOf(t.toLowerCase())>-1},not_icontains:function(t){return!!je&&je.location.href.toLowerCase().indexOf(t.toLowerCase())===-1},regex:function(t){return!!je&&AC(je.location.href,t)},not_regex:function(t){return!!je&&!AC(je.location.href,t)},exact:function(t){return(je==null?void 0:je.location.href)===t},is_not:function(t){return(je==null?void 0:je.location.href)!==t}},Rde=function(){function t(i){rr(this,t),this.instance=i,this._surveyEventReceiver=null}return nr(t,[{key:"afterDecideResponse",value:function(i){this._decideServerResponse=!!i.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var i=this,r=an==null?void 0:an.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||r||(this._surveyEventReceiver==null&&(this._surveyEventReceiver=new tP(this.instance)),this.instance.requestRouter.loadScript("/static/surveys.js",function(n){if(n)return ft.error(sR,"Could not load surveys script",n);an.extendPostHogWithSurveys(i.instance)}))}},{key:"getSurveys",value:function(i){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return i([]);this._surveyEventReceiver==null&&(this._surveyEventReceiver=new tP(this.instance));var a=this.instance.get_property(UD);if(a&&!n)return i(a);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(s){var o;if(s.statusCode!==200||!s.json)return i([]);var l,c=s.json.surveys||[],h=c.filter(function(u){var d,A,f,m,g,p,v,_,y,w,b,E;return((d=u.conditions)===null||d===void 0?void 0:d.events)&&((A=u.conditions)===null||A===void 0||(f=A.events)===null||f===void 0?void 0:f.values)&&((m=u.conditions)===null||m===void 0||(g=m.events)===null||g===void 0||(p=g.values)===null||p===void 0?void 0:p.length)>0||((v=u.conditions)===null||v===void 0?void 0:v.actions)&&((_=u.conditions)===null||_===void 0||(y=_.actions)===null||y===void 0?void 0:y.values)&&((w=u.conditions)===null||w===void 0||(b=w.actions)===null||b===void 0||(E=b.values)===null||E===void 0?void 0:E.length)>0});return h.length>0&&((l=r._surveyEventReceiver)===null||l===void 0||l.register(h)),(o=r.instance.persistence)===null||o===void 0||o.register(st({},UD,c)),i(c)}})}},{key:"getActiveMatchingSurveys",value:function(i){var r=this,n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys(function(a){var s,o=a.filter(function(h){return!(!h.start_date||h.end_date)}).filter(function(h){var u,d,A,f;if(!h.conditions)return!0;var m=(u=h.conditions)===null||u===void 0||!u.url||xde[(d=(A=h.conditions)===null||A===void 0?void 0:A.urlMatchType)!==null&&d!==void 0?d:"icontains"](h.conditions.url),g=(f=h.conditions)===null||f===void 0||!f.selector||(Ot==null?void 0:Ot.querySelector(h.conditions.selector));return m&&g}),l=(s=r._surveyEventReceiver)===null||s===void 0?void 0:s.getSurveys(),c=o.filter(function(h){var u,d,A,f,m,g,p,v,_,y;if(!h.linked_flag_key&&!h.targeting_flag_key&&!h.internal_targeting_flag_key)return!0;var w=!h.linked_flag_key||r.instance.featureFlags.isFeatureEnabled(h.linked_flag_key),b=!h.targeting_flag_key||r.instance.featureFlags.isFeatureEnabled(h.targeting_flag_key),E=((u=h.conditions)===null||u===void 0?void 0:u.events)&&((d=h.conditions)===null||d===void 0||(A=d.events)===null||A===void 0?void 0:A.values)&&((f=h.conditions)===null||f===void 0||(m=f.events)===null||m===void 0?void 0:m.values.length)>0,M=((g=h.conditions)===null||g===void 0?void 0:g.actions)&&((p=h.conditions)===null||p===void 0||(v=p.actions)===null||v===void 0?void 0:v.values)&&((_=h.conditions)===null||_===void 0||(y=_.actions)===null||y===void 0?void 0:y.values.length)>0,S=!E&&!M||(l==null?void 0:l.includes(h.id)),T=r._canActivateRepeatedly(h),C=!(h.internal_targeting_flag_key&&!T)||r.instance.featureFlags.isFeatureEnabled(h.internal_targeting_flag_key);return w&&b&&C&&S});return i(c)},n)}},{key:"getNextSurveyStep",value:function(i,r,n){var a,s=i.questions[r],o=r+1;if((a=s.branching)===null||a===void 0||!a.type)return r===i.questions.length-1?ql.End:o;if(s.branching.type===ql.End)return ql.End;if(s.branching.type===ql.SpecificQuestion){if(Number.isInteger(s.branching.index))return s.branching.index}
3617else if(s.branching.type===ql.ResponseBased){if(s.type===yC.SingleChoice){var l,c,h=s.choices.indexOf("".concat(n));if((l=s.branching)!==null&&l!==void 0&&(c=l.responseValues)!==null&&c!==void 0&&c.hasOwnProperty(h)){var u=s.branching.responseValues[h];return Number.isInteger(u)?u:u===ql.End?ql.End:o}}else if(s.type===yC.Rating){var d,A;if(typeof n!="number"||!Number.isInteger(n))throw new Error("The response type must be an integer");var f=function(g,p){if(p===3){if(g<1||g>3)throw new Error("The response must be in range 1-3");return g===1?"negative":g===2?"neutral":"positive"}if(p===5){if(g<1||g>5)throw new Error("The response must be in range 1-5");return g<=2?"negative":g===3?"neutral":"positive"}if(p===10){if(g<0||g>10)throw new Error("The response must be in range 0-10");return g<=6?"detractors":g<=8?"passives":"promoters"}throw new Error("The scale must be one of: 3, 5, 10")}(n,s.scale);if((d=s.branching)!==null&&d!==void 0&&(A=d.responseValues)!==null&&A!==void 0&&A.hasOwnProperty(f)){var m=s.branching.responseValues[f];return Number.isInteger(m)?m:m===ql.End?ql.End:o}}return o}return ft.warn(sR,"Falling back to next question index due to unexpected branching type"),o}},{key:"_canActivateRepeatedly",value:function(i){return pl(an.__PosthogExtensions__.canActivateRepeatedly)&&ft.warn(sR,"canActivateRepeatedly is not defined, must init before calling"),an.__PosthogExtensions__.canActivateRepeatedly(i)}}]),t}(),Bde=function(){function t(i){var r,n,a=this;rr(this,t),st(this,"serverLimits",{}),st(this,"lastEventRateLimited",!1),st(this,"checkForLimiting",function(s){var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(function(l){ft.info("[RateLimiter] ".concat(l||"events"," is quota limited.")),a.serverLimits[l]=new Date().getTime()+6e4})}catch(l){return void ft.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(l==null?void 0:l.message,'"'),{text:o})}}),this.instance=i,this.captureEventsPerSecond=((r=i.config.rate_limiting)===null||r===void 0?void 0:r.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((n=i.config.rate_limiting)===null||n===void 0?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return nr(t,[{key:"clientRateLimitContext",value:function(){var i,r,n,a=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(i=(r=this.instance.persistence)===null||r===void 0?void 0:r.get_property(kD))!==null&&i!==void 0?i:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var l=o.tokens<1;return l||a||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||a||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,(n=this.instance.persistence)===null||n===void 0||n.set_property(kD,o),{isRateLimited:l,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(i){var r=this.serverLimits[i||"events"]||!1;return r!==!1&&new Date().getTime()<r}}]),t}(),Ide=function(){return It({initialPathName:(Xs==null?void 0:Xs.pathname)||"",referringDomain:ha.referringDomain()},ha.campaignParams())},Dde=function(){function t(i,r,n){var a=this;rr(this,t),st(this,"_onSessionIdCallback",function(s){var o=a._getStoredProps();if(!o||o.sessionId!==s){var l={sessionId:s,props:a._sessionSourceParamGenerator()};a._persistence.register(st({},FD,l))}}),this._sessionIdManager=i,this._persistence=r,this._sessionSourceParamGenerator=n||Ide,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return nr(t,[{key:"_getStoredProps",value:function(){return this._persistence.props[FD]}},{key:"getSessionProps",value:function(){var i,r=(i=this._getStoredProps())===null||i===void 0?void 0:i.props;return r?{$client_session_initial_referring_host:r.referringDomain,$client_session_initial_pathname:r.initialPathName,$client_session_initial_utm_source:r.utm_source,$client_session_initial_utm_campaign:r.utm_campaign,$client_session_initial_utm_medium:r.utm_medium,$client_session_initial_utm_content:r.utm_content,$client_session_initial_utm_term:r.utm_term}:{}}}]),t}(),Pde=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hub
3617spot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],Uk=function(t,i){if(!t)return!1;var r=t.toLowerCase();return Pde.concat(i||[]).some(function(n){var a=n.toLowerCase();return r.indexOf(a)!==-1})},Xj=function(){function t(){rr(this,t),this.clicks=[]}return nr(t,[{key:"isRageClick",value:function(i,r,n){var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(i-a.x)+Math.abs(r-a.y)<30&&n-a.timestamp<1e3){if(this.clicks.push({x:i,y:r,timestamp:n}),this.clicks.length===3)return!0}else this.clicks=[{x:i,y:r,timestamp:n}];return!1}}]),t}();function Fk(t){var i;return t.id===zD||!((i=t.closest)===null||i===void 0||!i.call(t,"#"+zD))}var Lde=function(){function t(i){var r,n=this;rr(this,t),st(this,"rageclicks",new Xj),st(this,"_enabledServerSide",!1),st(this,"_initialized",!1),st(this,"_flushInterval",null),this.instance=i,this._enabledServerSide=!((r=this.instance.persistence)===null||r===void 0||!r.props[LD]),je==null||je.addEventListener("beforeunload",function(){n.flush()})}return nr(t,[{key:"flushIntervalMilliseconds",get:function(){var i=5e3;return Ga(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(i=this.instance.config.capture_heatmaps.flush_interval_milliseconds),i}},{key:"isEnabled",get:function(){return Qt(this.instance.config.capture_heatmaps)?Qt(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}},{key:"startIfEnabled",value:function(){if(this.isEnabled){if(this._initialized)return;ft.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var i;clearInterval((i=this._flushInterval)!==null&&i!==void 0?i:void 0),this.getAndClearBuffer()}}},{key:"afterDecideResponse",value:function(i){var r=!!i.heatmaps;this.instance.persistence&&this.instance.persistence.register(st({},LD,r)),this._enabledServerSide=r,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var i=this.buffer;return this.buffer=void 0,i}},{key:"_setupListeners",value:function(){var i=this;je&&Ot&&(pu(Ot,"click",function(r){return i._onClick(r||(je==null?void 0:je.event))},!1,!0),pu(Ot,"mousemove",function(r){return i._onMouseMove(r||(je==null?void 0:je.event))},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(i,r){var n=this.instance.scrollManager.scrollY(),a=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=function(l,c,h){for(var u=l;u&&!EA(u,"body");){if(u===h)return!1;if(ki(c,je==null?void 0:je.getComputedStyle(u).position))return!0;u=Uj(u)}return!1}(i.target,["fixed","sticky"],s);return{x:i.clientX+(o?0:a),y:i.clientY+(o?0:n),target_fixed:o,type:r}}},{key:"_onClick",value:function(i){var r;if(!Fk(i.target)){var n=this._getProperties(i,"click");(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(i.clientX,i.clientY,new Date().getTime())&&this._capture(It(It({},n),{},{type:"rageclick"})),this._capture(n)}}},{key:"_onMouseMove",value:function(i){var r=this;Fk(i.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){r._capture(r._getProperties(i,"mousemove"))},500))}},{key:"_capture",value:function(i){if(je){var r=je.location.href;this.buffer=this.buffer||{},this.buffer[r]||(this.buffer[r]=[]),this.buffer[r].push(i)}}},{key:"flush",value:function(){this.buffer&&!yS(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),t}(),Ode=function(){function t(i){var r=this;rr(this,t),st(this,"_updateScrollData",function(){var n,a,s,o;r.context||(r.context={});var l=r.scrollElement(),c=r.scrollY(),h=l?Math.max(0,l.scrollHeight-l.clientHeight):0,u=c+((l==null?void 0:l.clientHeight)||0),d=(l==null?void 0:l.scrollHeight)||0;r.context.lastScrollY=Math.ceil(c),r.context.maxScrollY=Math.max(c,(n=r.context.maxScrollY)!==null&&n!==void 0?n:0),r.context.maxScrollHeight=Math.max(h,(a=r.context.maxScrollHeight)!==null&&a!==void 0?a:0),r.context.lastContentY=u,r.context.maxContentY=Math.max(u,(s=r.context.maxContentY)!==null&&s!==void 0?s:0),r.context.maxContentHeight=Math.max(d,(o=r.context.maxContentHeight)!==null&&o!==void 0?o:0)}),this.instance=i}return nr(t,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var i=this.context;return setTimeout(this._updateScrollData,0),i}},{key:"startMeasuringScrollPosition",value:function(){je==null||je.addEventListener("scroll",this._updateScrollData,!0),je==null||je.addEventListener("scrollend",this._updateScrollData,!0),je==null||je.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return je==null?void 0:je.document.documentElement;var i,r=wl(Xn(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(r.s();!(i=r.n()).done;){var n=i.value,a=je==null?void 0:je.document.querySelector(n);if(a)return a}}catch(s){r.e(s)}finally{r.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var i=this.scrollElement();return i&&i.scrollTop||0}return je&&(je.scrollY||je.pageYOffset||je.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var i=this.scrollElement();return i&&i.scrollLeft||0}return je&&(je.scrollX||je.pageXOffset||je.document.documentElement.scrollLeft)||0}}]),t}(),oR="$copy_autocapture";function lR(t,i){return i.length>t?i.slice(0,t)+"...":i}var Ud,Nde=function(){function t(i){rr(this,t),st(this,"_initialized",!1),st(this,"_isDisabledServerSide",null),st(this,"rageclicks",new Xj),st(this,"_elementsC
3617hainAsString",!1),this.instance=i,this._elementSelectors=null}return nr(t,[{key:"config",get:function(){var i,r,n=Ga(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(i=n.url_allowlist)===null||i===void 0?void 0:i.map(function(a){return new RegExp(a)}),n.url_ignorelist=(r=n.url_ignorelist)===null||r===void 0?void 0:r.map(function(a){return new RegExp(a)}),n}},{key:"_addDomEventHandlers",value:function(){var i=this;if(this.isBrowserSupported()){if(je&&Ot){var r=function(a){a=a||(je==null?void 0:je.event);try{i._captureEvent(a)}catch(s){ft.error("Failed to capture event",s)}},n=function(a){a=a||(je==null?void 0:je.event),i._captureEvent(a,oR)};pu(Ot,"submit",r,!1,!0),pu(Ot,"change",r,!1,!0),pu(Ot,"click",r,!1,!0),this.config.capture_copied_text&&(pu(Ot,"copy",n,!1,!0),pu(Ot,"cut",n,!1,!0))}}else ft.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(i){i.elementsChainAsString&&(this._elementsC
3617hainAsString=i.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(st({},nk,!!i.autocapture_opt_out)),this._isDisabledServerSide=!!i.autocapture_opt_out,this.startIfEnabled()}},{key:"setElementSelectors",value:function(i){this._elementSelectors=i}},{key:"getElementSelectors",value:function(i){var r,n=[];return(r=this._elementSelectors)===null||r===void 0||r.forEach(function(a){var s=Ot==null?void 0:Ot.querySelectorAll(a);s==null||s.forEach(function(o){i===o&&n.push(a)})}),n}},{key:"isEnabled",get:function(){var i,r,n=(i=this.instance.persistence)===null||i===void 0?void 0:i.props[nk],a=this._isDisabledServerSide;if(qu(a)&&!og(n)&&!this.instance.config.advanced_disable_decide)return!1;var s=(r=this._isDisabledServerSide)!==null&&r!==void 0?r:!!n;return!!this.instance.config.autocapture&&!s}},{key:"_previousElementSibling",value:function(i){if(i.previousElementSibling)return i.previousElementSibling;var r=i;do r=r.previousSibling;while(r&&!qO(r));return r}},{key:"_getAugmentPropertiesFromElement",value:function(i){if(!XD(i))return{};var r={};return xr(i.attributes,function(n){if(n.name&&n.name.indexOf("data-ph-capture-attribute")===0){var a=n.name.replace("data-ph-capture-attribute-",""),s=n.value;a&&s&&xg(s)&&(r[a]=s)}}),r}},{key:"_getPropertiesFromElement",value:function(i,r,n){var a,s=i.tagName.toLowerCase(),o={tag_name:s};KD.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=lR(1024,Sk(i)):o.$el_text=lR(1024,gC(i)));var l=mC(i);l.length>0&&(o.classes=l.filter(function(A){return A!==""}));var c=(a=this.config)===null||a===void 0?void 0:a.element_attribute_ignorelist;xr(i.attributes,function(A){var f;if((!Fj(i)||["name","id","class","aria-label"].indexOf(A.name)!==-1)&&(c==null||!c.includes(A.name))&&!r&&xg(A.value)&&(f=A.name,!cs(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var m=A.value;A.name==="class"&&(m=XO(m).join(" ")),o["attr__"+A.name]=lR(1024,m)}});for(var h=1,u=1,d=i;d=this._previousElementSibling(d);)h++,d.tagName===i.tagName&&u++;return o.nth_child=h,o.nth_of_type=u,o}},{key:"_getDefaultProperties",value:function(i){return{$event_type:i,$ce_version:1}}},{key:"_getEventTarget",value:function(i){return Qt(i.target)?i.srcElement||null:(r=i.target)!==null&&r!==void 0&&r.shadowRoot?i.composedPath()[0]||null:i.target||null;var r}},{key:"_captureEvent",value:function(i){var r=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var a,s=this._getEventTarget(i);Oj(s)&&(s=s.parentNode||null),n==="$autocapture"&&i.type==="click"&&i instanceof MouseEvent&&this.instance.config.rageclick&&(a=this.rageclicks)!==null&&a!==void 0&&a.isRageClick(i.clientX,i.clientY,new Date().getTime())&&this._captureEvent(i,"$rageclick");var o=n===oR;if(s&&Que(s,i,this.config,o,o?["copy","cut"]:void 0)){for(var l,c,h=[s],u=s;u.parentNode&&!EA(u,"body");)Nj(u.parentNode)?(h.push(u.parentNode.host),u=u.parentNode.host):(h.push(u.parentNode),u=u.parentNode);var d,A,f=[],m={},g=!1;if(xr(h,function(T){var C=XD(T);T.tagName.toLowerCase()==="a"&&(d=T.getAttribute("href"),d=C&&xg(d)&&d),ki(mC(T),"ph-no-capture")&&(g=!0),f.push(r._getPropertiesFromElement(T,r.instance.config.mask_all_element_attributes,r.instance.config.mask_all_text));var x=r._getAugmentPropertiesFromElement(T);Is(m,x)}),this.instance.config.mask_all_text||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?f[0].$el_text=Sk(s):f[0].$el_text=gC(s)),d){var p,v;f[0].attr__href=d;var _=(p=G_(d))===null||p===void 0?void 0:p.host,y=je==null||(v=je.location)===null||v===void 0?void 0:v.host;_&&y&&_!==y&&(A=d)}if(g)return!1;
3617var w=Is(this._getDefaultProperties(i.type),this._elementsChainAsString?{$elements_chain:Kue(f)}:{$elements:f},(l=f[0])!==null&&l!==void 0&&l.$el_text?{$el_text:(c=f[0])===null||c===void 0?void 0:c.$el_text}:{},A&&i.type==="click"?{$external_click_url:A}:{},m),b=this.getElementSelectors(s);if(b&&b.length>0&&(w.$element_selectors=b),n===oR){var E,M=Lj(je==null||(E=je.getSelection())===null||E===void 0?void 0:E.toString()),S=i.type||"clipboard";if(!M)return!1;w.$selected_content=M,w.$copy_type=S}return this.instance.capture(n,w),!0}}}},{key:"isBrowserSupported",value:function(){return uc(Ot==null?void 0:Ot.querySelectorAll)}}]),t}(),Ude=function(){function t(i){var r=this;rr(this,t),st(this,"_restoreXHRPatch",void 0),st(this,"_restoreFetchPatch",void 0),st(this,"_startCapturing",function(){Qt(r._restoreXHRPatch)&&an.postHogTracingHeadersPatchFns._patchXHR(r.instance.sessionManager),Qt(r._restoreFetchPatch)&&an.postHogTracingHeadersPatchFns._patchFetch(r.instance.sessionManager)}),this.instance=i}return nr(t,[{key:"_loadScript",value:function(i){an.postHogTracingHeadersPatchFns&&i(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(Zl.LIB_VERSION),function(r){if(r)return ft.error("[TRACING-HEADERS] failed to load script",r);i()})}},{key:"startIfEnabledOrStop",value:function(){var i,r;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((i=this._restoreXHRPatch)===null||i===void 0||i.call(this),(r=this._restoreFetchPatch)===null||r===void 0||r.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),t}();(function(t){t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED"})(Ud||(Ud={}));var Fde=function(){function t(i){rr(this,t),this.instance=i}return nr(t,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?Ud.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===Ud.DENIED||this.consent===Ud.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(i){this.storage.set(this.storageKey,i?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var i=this.instance.config,r=i.token;return(i.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+r}},{key:"storedConsent",get:function(){var i=this.storage.get(this.storageKey);return i==="1"?Ud.GRANTED:i==="0"?Ud.DENIED:Ud.PENDING}},{key:"storage",get:function(){if(!this._storage){var i=this.config.opt_out_capturing_persistence_type;this._storage=i==="localStorage"?Wn:Du;var r=i==="localStorage"?Du:Wn;r.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(r.get(this.storageKey)==="1"),r.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!mj([wu==null?void 0:wu.doNotTrack,wu==null?void 0:wu.msDoNotTrack,an.doNotTrack],function(i){return ki([!0,1,"1","yes"],i)})}}]),t}(),kk=9e5,tf="[Web Vitals]",kde=function(){function t(i){var r,n=this;rr(this,t),st(this,"_enabledServerSide",!1),st(this,"_initialized",!1),st(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),st(this,"_flushToCapture",function(){clearTimeout(n._delayedFlushTimer),n.buffer.metrics.length!==0&&(n.instance.capture("$web_vitals",n.buffer.metrics.reduce(function(a,s){var o;return It(It({},a),{},(st(o={},"$web_vitals_".concat(s.name,"_event"),It({},s)),st(o,"$web_vitals_".concat(s.name,"_value"),s.value),o))},{})),n.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),st(this,"_addToBuffer",function(a){var s,o=(s=n.instance.sessionManager)===null||s===void 0?void 0:s.checkAndGetSessionAndWindowId(!0);if(Qt(o))ft.error(tf+"Could not read session ID. Dropping metrics!");else{n.buffer=n.buffer||{};var l=n._currentURL();Qt(l)||(pl(a==null?void 0:a.name)||pl(a==null?void 0:a.value)?ft.error(tf+"Invalid metric received",a):n._maxAllowedValue&&a.value>=n._maxAllowedValue?ft.error(tf+"Ignoring metric with value >= "+n._maxAllowedValue,a):(n.buffer.url!==l&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,8e3)),Qt(n.buffer.url)&&(n.buffer.url=l),n.buffer.firstMetricTimestamp=Qt(n.buffer.firstMetricTimestamp)?Date.now():n.buffer.firstMetricTimestamp,n.buffer.metrics.push(It(It({},a),{},{$current_url:l,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),n.buffer.metrics.length===4&&n._flushToCapture()))}}),st(this,"_startCapturing",function(){var a=an.postHogWebVitalsCallbacks,s=a.onLCP,o=a.onCLS,l=a.onFCP,c=a.onINP;s&&o&&l&&c?(s(n._addToBuffer),o(n._addToBuffer),l(n._addToBuffer),c(n._addToBuffer),n._initialized=!0):ft.error(tf+"web vitals callbacks not loaded - not starting")}),this.instance=i,this._enabledServerSide=!((r=this.instance.persistence)===null||r===void 0||!r.props[ok]),this.startIfEnabled()}return nr(t,[{key:"_maxAllowedValue",get:function(){var i=Ga(this.instance.config.capture_performance)&&el(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:kk;return 0<i&&i<=6e4?kk:i}},{key:"isEnabled",get:function(){var i=Ga(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return og(i)?i:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(ft.info(tf+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(i){var r=Ga(i.capturePerformance)&&!!i.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(st({},ok,r)),this._enabledServerSide=r,this.startIfEnabled()}},{key:"loadScript",value:function(i){je.postHogWebVitalsCallbacks&&i(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/web-vitals.js?v=".concat(Zl.LIB_VERSION)),function(r){r?ft.error(tf+" failed to load script",r):i()})}},{key:"_currentURL",value:function(){var i=je?je.location.href:void 0;return i||ft.error(tf+"Could not determine current URL"),i}}]),t}(),V_={},Hk=function(){},Jm="posthog",qj=!gde&&(yn==null?void 0:yn.indexOf("MSIE"))===-1&&(yn==null?void 0:yn.indexOf("Mozilla"))===-1,Gk=function(){var t,i,r;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:(i=Ot==null?void 0:Ot.location,r=i==null?void 0:i.hostname,!!cs(r)&&r.split(".").slice(-2).join(".")!=="herokuapp.com"),persistence:"localStorage+cookie",persistence_name:"",loaded:Hk,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Xs&&cs(Xs==null?void 0:Xs.search)&&Xs.search.indexOf("__posthog_debug=true")!==-1||!1,verbose
3617:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:(je==null||(t=je.location)===null||t===void 0?void 0:t.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(n){var a="Bad HTTP status: "+n.statusCode+" "+n.text;ft.error(a)},get_device_id:function(n){return n},_onCapture:Hk,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},zk=function(t){var i={};Qt(t.process_person)||(i.person_profiles=t.process_person),Qt(t.xhr_headers)||(i.request_headers=t.xhr_headers),Qt(t.cookie_name)||(i.persistence_name=t.cookie_name),Qt(t.disable_cookie)||(i.disable_persistence=t.disable_cookie);var r=Is({},i,t);return Xn(t.property_blacklist)&&(Qt(t.property_denylist)?r.property_denylist=t.property_blacklist:Xn(t.property_denylist)?r.property_denylist=[].concat(Iu(t.property_blacklist),Iu(t.property_denylist)):ft.error("Invalid value for property_denylist config: "+t.property_denylist)),r},Hde=function(){function t(){rr(this,t),st(this,"__forceAllowLocalhost",!1)}return nr(t,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(i){ft.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=i}}]),t}(),Zj=function(){function t(){var i=this;rr(this,t),st(this,"webPerformance",new Hde),st(this,"_internalEventEmitter",new Kj),this.config=Gk(),this.decideEndpointWasHit=!1,this.SentryIntegration=Sde,this.sentryIntegration=function(r){return function(n,a){var s=Yj(n,a);return{name:jj,processEvent:function(o){return s(o)}}}(i,r)},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new vue(this),this.toolbar=new sde(this),this.scrollManager=new Ode(this),this.pageViewManager=new Tde(this),this.surveys=new Rde(this),this.rateLimiter=new Bde(this),this.requestRouter=new wde(this),this.consent=new Fde(this),this.people={set:function(r,n,a){var s=cs(r)?st({},r,n):r;i.setPersonProperties(s),a==null||a({})},set_once:function(r,n,a){var s=cs(r)?st({},r,n):r;i.setPersonProperties(void 0,s),a==null||a({})}},this.on("eventCaptured",function(r){return ft.info("send",r)})}return nr(t,[{key:"init",value:function(i,r,n){if(n&&n!==Jm){var a,s=(a=V_[n])!==null&&a!==void 0?a:new t;return s._init(i,r,n),V_[n]=s,V_[Jm][n]=s,s}return this._init(i,r,n)}},{key:"_init",value:function(i){var r,n,a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(Qt(i)||J4(i))return ft.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return ft.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(Is({},Gk(),zk(s),{name:o,token:i})),this.config.on_xhr_error&&ft.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:Jl.Base64,this.persistence=new iR(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new iR(It(It({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new ode(function(p){return a._send_retriable_request(p)}),this._retryQueue=new yde(this),this.__request_queue=[],this.sessionManager=new Ede(this.config,this.persistence),this.sessionPropsManager=new Dde(this.sessionManager,this.persistence),new Ude(this).startIfEnabledOrStop(),this.sessionRecording=new rde(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Nde(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Lde(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new kde(this),this.exceptionObserver=new bde(this),this.exceptionObserver.startIfEnabled(),Zl.DEBUG=Zl.DEBUG||this.config.debug,Zl.DEBUG&&console.log("[PostHog.js] Starting in debug mode",this),this._sync_opt_out_with_persistence(),((r=s.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var l,c,h=this.config.get_device_id(eA()),u=(l=s.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?h:s.bootstrap.distinctID;this.persistence.set_property(iu,(c=s.bootstrap)!==null&&c!==void 0&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:u})}if(this._hasBootstrappedFeatureFlags()){var d,A,f=Object.keys(((d=s.bootstrap)===null||d===void 0?void 0:d.featureFlags)||{}).filter(function(p){var v,_;return!((v=s.bootstrap)===null||v===void 0||(_=v.featureFlags)===null||_===void 0||!_[p])}).reduce(function(p,v){var _,y;return p[v]=((_=s.bootstrap)===null||_===void 0||(y=_.featureFlags)===null||y===void 0?void 0:y[v])||!1,p},{}),m=Object.keys(((A=s.bootstrap)===null||A===void 0?void 0:A.featureFlagPayloads)||{}).filter(function(p){return f[p]}).reduce(function(p,v){var _,y,w,b;return(_=s.bootstrap)!==null&&_!==void 0&&(y=_.featureFlagPayloads)!==null&&y!==void 0&&y[v]&&(p[v]=(w=s.bootstrap)===null||w===void 0||(b=w.featureFlagPayloads)===null||b===void 0?void 0:b[v]),p},{});this.featureFlags.receivedFeatureFlags({featureFlags:f,featureFlagPayloads:m})}if(!this.get_distinct_id()){var g=this.config.get_device_id(eA());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(iu,"anonymous")}return je==null||(n=je.addEventListener)===null||n===void 0||n.call(je,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?Cde(this,function(){return a._loaded()}):this._loaded(),uc(this.config._onCapture)&&this.on("eventCaptured",function(p){return a.config._onCapture(p.event,p)}),this}},{key:"_afterDecideResponse",value:function(i){var r,n,a,s,o,l,c;this.compression=void 0,i.supportedCompression&&!this.config.disable_compression&&(this.compression=ki(i.supportedCompression,Jl.GZipJS)?Jl.GZipJS:ki(i.supportedCompression,Jl.Base64)?Jl.Base64:void 0),(r=i.analytics)!==null&&r!==void 0&&r.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint),(n=this.sessionRecording)===null||n===void 0||n.afterDecideResponse(i),(a=this.autocapture)===null||a===void 0||a.afterDecideResponse(i),(s=this.heatmaps)===null||s===void 0||s.afterDecideResponse(i),(o=this.surveys)===null||o===void 0||o.afterDecideResponse(i),(l=this.webVitalsAutocapture)===null||l===void 0||l.afterDecideResponse(i),(c=this.exceptionObserver)===null||c===void 0||c.afterDecideResponse(i)}},{key:"_loaded",value:function(){var i=this,r=this.config.advanced_disable_decide;r||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(n){ft.critical("`loaded` function failed",n)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){Ot&&i.capture("$pageview",{title:Ot.title},{send_instantly:!0})},1),r||(new nde(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var i;this.has_opted_out_capturing()||this.config.request_batching&&((i=this._requestQueue)===null||i===void 0||i.enable())}},{key:"_dom_loaded",value:function(){var i=this;this.has_opted_out_capturing()||Cg(this.__request_queue,function(r){return i._send_retriable_request(r)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var i,r;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(i=this._requestQueue)===null||i===void 0||i.unload(),(r=this._retryQueue)===null||r===void 0||r.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(i){var r=this;this.__loaded&&(qj?this.__request_queue.push(i):this.rateLimiter.isServerRateLimited(i.batchKey)||(i.transport=i.transport||this.config.api_transport,i.url=_C(i.url,{ip:this.config.ip?1:0}),i.headers=this.config.request_headers,i.compression=i.compression==="best-available"?this.compression:i.compression,function(n){var a,s,o,l=It({},n);l.timeout=l.timeout||6e4,l.url=_C(l.url,{_:new Date().getTime().toString(),ver:Zl.LIB_VERSION,compression:l.compression});var c=(a=l.transport)!==null&&a!==void 0?a:"XHR",h=(s=(o=mj(Q_,function(u){return u.transport===c}))===null||o===void 0?void 0:o.method)!==null&&s!==void 0?s:Q_[0].method;if(!h)throw new Error("No available transport method");h(l)}(It(It({},i),{},{callback:function(n){var a,s,o;r.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((s=(o=r.config).on_request_error)===null||s===void 0||s.call(o,n)),(a=i.callback)===null||a===void 0||a.call(i,n)}}))))}},{key:"_send_retriable_request",value:function(i){this._retryQueue?this._retryQueue.retriableRequest(i):this._send_request(i)}},{key:"_execute_array",value:function(i){var r,n=this,a=[],s=[],o=[];Cg(i,function(c){c&&(r=c[0],Xn(r)?o.push(c):uc(c)?c.call(n):Xn(c)&&r==="al
3617ias"?a.push(c):Xn(c)&&r.indexOf("capture")!==-1&&uc(n[r])?o.push(c):s.push(c))});var l=function(c,h){Cg(c,function(u){if(Xn(u[0])){var d=h;xr(u,function(A){d=d[A[0]].apply(d,A.slice(1))})}else this[u[0]].apply(this,u.slice(1))},h)};l(a,this),l(s,this),l(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var i,r;return((i=this.config.bootstrap)===null||i===void 0?void 0:i.featureFlags)&&Object.keys((r=this.config.bootstrap)===null||r===void 0?void 0:r.featureFlags).length>0||!1}},{key:"push",value:function(i){this._execute_array([i])}},{key:"capture",value:function(i,r,n){var a;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return ft.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut())if(!Qt(i)&&cs(i)){if(!yn||this.config.opt_out_useragent_filter||!Uk(yn,this.config.custom_blocked_useragents)){var s=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o={uuid:eA(),event:i,properties:this._calculate_event_properties(i,r||{})};s&&(o.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),n!=null&&n.$set&&(o.$set=n==null?void 0:n.$set);var l=this._calculate_set_once_properties(n==null?void 0:n.$set_once);l&&(o.$set_once=l),(o=pue(o,n!=null&&n._noTruncate?null:this.config.properties_string_max_length)).timestamp=(n==null?void 0:n.timestamp)||new Date,Qt(n==null?void 0:n.timestamp)||(o.properties.$event_time_override_provided=!0,o.properties.$event_time_override_system_time=new Date);var c=It(It({},o.properties.$set),o.$set);yS(c)||this.setPersonPropertiesForFlags(c),this._internalEventEmitter.emit("eventCaptured",o);var h={method:"POST",url:(a=n==null?void 0:n._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:o,compression:"best-available",batchKey:n==null?void 0:n._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this._send_retriable_request(h):this._requestQueue.enqueue(h),o}ft.critical("This capture call is ignored due to client rate limiting.")}}else ft.error("No event name provided to posthog.capture")}},{key:"_addCaptureHook",value:function(i){this.on("eventCaptured",function(r){return i(r.event,r)})}},{key:"_calculate_event_properties",value:function(i,r){if(!this.persistence||!this.sessionPersistence)return r;var n=this.persistence.remove_event_timer(i),a=It({},r);if(a.token=this.config.token,i==="$snapshot"){var s=It(It({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=s.distinct_id,(!cs(a.distinct_id)&&!el(a.distinct_id)||J4(a.distinct_id))&&ft.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var o=ha.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),c=l.sessionId,h=l.windowId;a.$session_id=c,a.$window_id=h}if(this.requestRouter.region===xf.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&(i==="$pageview"||i==="$pageleave"||i==="$autocapture")){var u=this.sessionPropsManager.getSessionProps();a=Is(a,u)}if(!this.config.disable_scroll_properties){var d={};i==="$pageview"?d=this.pageViewManager.doPageView():i==="$pageleave"&&(d=this.pageViewManager.doPageLeave()),a=Is(a,d)}if(i==="$pageview"&&Ot&&(a.title=Ot.title),!Qt(n)){var A=new Date().getTime()-n;a.$duration=parseFloat((A/1e3).toFixed(3))}yn&&this.config.opt_out_useragent_filter&&(a.$browser_type=Uk(yn,this.config.custom_blocked_useragents)?"bot":"browser"),(a=Is({},o,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Xn(this.config.property_denylist)?xr(this.config.property_denylist,function(m){delete a[m]}):ft.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var f=this.config.sanitize_properties;return f&&(a=f(a,i)),a.$process_person_profile=this._hasPersonProcessing(),a}},{key:"_calculate_set_once_properties",value:function(i){if(!this.persistence||!this._hasPersonProcessing())return i;var r=Is({},this.persistence.get_initial_props(),i||{});return yS(r)?void 0:r}},{key:"register",value:function(i,r){var n;(n=this.persistence)===null||n===void 0||n.register(i,r)}},{key:"register_once",value:function(i,r,n){var a;(a=this.persistence)===null||a===void 0||a.register_once(i,r,n)}},{key:"register_for_session",value:function(i){var r;(r=this.sessionPersistence)===null||r===void 0||r.register(i)}},{key:"unregister",value:function(i){var r;(r=this.persistence)===null||r===void 0||r.unregister(i)}},{key:"unregister_for_session",value:function(i){var r;(r=this.sessionPersistence)===null||r===void 0||r.unregister(i)}},{key:"_register_single",value:function(i,r){this.register(st({},i,r))}},{key:"getFeatureFlag",value:function(i,r){return this.featureFlags.getFeatureFlag(i,r)}},{key:"getFeatureFlagPayload",value:function(i){var r=this.featureFlags.getFeatureFlagPayload(i);try{return JSON.parse(r)}catch{return r}}},{key:"isFeatureEnabled",value:function(i,r){return this.featureFlags.isFeatureEnabled(i,r)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(i,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(i,r)}},{key:"getEarlyAccessFeatures",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(i,r)}},{key:"on",value:function(i,r){return this._internalEventEmitter.on(i,r)}},{key:"onFeatureFlags",value:function(i){return this.featureFlags.onFeatureFlags(i)}},{key:"onSessionId",value:function(i){var r,n;return(r=(n=this.sessionManager)===null||n===void 0?void 0:n.onSessionId(i))!==null&&r!==void 0?r:function(){}}},{key:"getSurveys",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(i,r)}},{key:"getActiveMatchingSurveys",value:function(i){var r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(i,r)}},{key:"getNextSurveyStep",value:function(i,r,n){return this.surveys.getNextSurveyStep(i,r,n)}},{key:"identify",value:function(i,r,n){if(!this.__loaded||!this.persistence)return ft.uninitializedWarning("posthog.identify");if(el(i)&&(i=i.toString(),ft.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),i){if(["distinct_id","distinctid"].includes(i.toLowerCase()))ft.critical('The string "'.concat(i,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
3617ot a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:i}),!this.get_property("$device_id")){var s=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}i!==a&&i!==this.get_property(f_)&&(this.unregister(f_),this.register({distinct_id:i}));var o=(this.persistence.get_property(iu)||"anonymous")==="anonymous";i!==a&&o?(this.persistence.set_property(iu,"identified"),this.setPersonPropertiesForFlags(r||{},!1),this.capture("$identify",{distinct_id:i,$anon_distinct_id:a},{$set:r||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(a)):(r||n)&&this.setPersonProperties(r,n),i!==a&&(this.reloadFeatureFlags(),this.unregister(uC))}}else ft.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(i,r){(i||r)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(i||{}),this.capture("$set",{$set:i||{},$set_once:r||{}}))}},{key:"group",value:function(i,r,n){if(i&&r){if(this._requirePersonProcessing("posthog.group")){var a=this.getGroups();a[i]!==r&&this.resetGroupPropertiesForFlags(i),this.register({$groups:It(It({},a),{},st({},i,r))}),n&&(this.capture("$groupidentify",{$group_type:i,$group_key:r,$group_set:n}),this.setGroupPropertiesForFlags(st({},i,n))),a[i]===r||n||this.reloadFeatureFlags()}}else ft.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(i){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(i,r)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(i){var r=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(i,r)}},{key:"resetGroupPropertiesForFlags",value:function(i){this.featureFlags.resetGroupPropertiesForFlags(i)}},{key:"reset",value:function(i){var r,n,a,s;if(!this.__loaded)return ft.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");this.consent.reset(),(r=this.persistence)===null||r===void 0||r.clear(),(n=this.sessionPersistence)===null||n===void 0||n.clear(),(a=this.persistence)===null||a===void 0||a.set_property(iu,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId();var l=this.config.get_device_id(eA());this.register_once({distinct_id:l,$device_id:i?l:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var i,r;return(i=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&i!==void 0?i:""}},{key:"get_session_replay_url",value:function(i){if(!this.sessionManager)return"";var r=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=r.sessionId,a=r.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(i!=null&&i.withTimestamp&&a){var o,l=(o=i.timestampLookBack)!==null&&o!==void 0?o:10;if(!a)return s;var c=Math.max(Math.floor((new Date().getTime()-a)/1e3)-l,0);s+="?t=".concat(c)}return s}},{key:"alias",value:function(i,r){return i===this.get_property(gj)?(ft.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Qt(r)&&(r=this.get_distinct_id()),i!==r?(this._register_single(f_,i),this.capture("$create_alias",{alias:i,distinct_id:r})):(ft.warn("alias matches current distinct_id - skipping api call."),this.identify(i),-1)):void 0}},{key:"set_config",value:function(i){var r,n,a,s,o=It({},this.config);Ga(i)&&(Is(this.config,zk(i)),(r=this.persistence)===null||r===void 0||r.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"?this.persistence:new iR(It(It({},this.config),{},{persistence:"sessionStorage"})),Wn.is_supported()&&Wn.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Zl.DEBUG=!0),(n=this.sessionRecording)===null||n===void 0||n.startIfEnabledOrStop(),(a=this.autocapture)===null||a===void 0||a.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(i){if(i!=null&&i.sampling){var r,n,a=(r=this.sessionManager)===null||r===void 0?void 0:r.checkAndGetSessionAndWindowId();(n=this.persistence)===null||n===void 0||n.register(st({},H_,!0)),ft.info("Session recording started with sampling override for session: ",a==null?void 0:a.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var i;return!((i=this.sessionRecording)===null||i===void 0||!i.started)}},{key:"loadToolbar",value:function(i){return this.toolbar.loadToolbar(i)}},{key:"get_property",value:function(i){var r;return(r=this.persistence)===null||r===void 0?void 0:r.props[i]}},{key:"getSessionProperty",value:function(i){var r;return(r=this.sessionPersistence)===null||r===void 0?void 0:r.props[i]}},{key:"toString",value:function(){var i,r=(i=this.config.name)!==null&&i!==void 0?i:Jm;return r!==Jm&&(r=Jm+"."+r),r}},{key:"_isIdentified",value:function(){var i,r;return((i=this.persistence)===null||i===void 0?void 0:i.get_property(iu))==="identified"||((r=this.sessionPersistence)===null||r===void 0?void 0:r.get_property(iu))==="identified"}},{key:"_hasPersonProcessing",value:function(){var i,r,n,a;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&yS(this.getGroups())&&((i=this.persistence)===null||i===void 0||(r=i.props)===null||r===void 0||!r[f_])&&((n=this.persistence)===null||n===void 0||(a=n.props)===null||a===void 0||!a[dC]))}},{key:"_shouldCapturePageleave",value:function(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(i){return this.config.person_profiles==="never"?(ft.error(i+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(dC,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var i,r,n,a,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,l=this.config.disable_persistence||s&&!!o;((i=this.persistence)===null||i===void 0?void 0:i.disabled)!==l&&((n=this.persistence)===null||n===void 0||n.set_disabled(l)),((r=this.sessionPersistence)===null||r===void 0?void 0:r.disabled)!==l&&((a=this.sessionPersistence)===null||a===void 0||a.set_disabled(l))}},{key:"opt_in_capturing",value:function(i){var r;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(Qt(i==null?void 0:i.captureEventName)||i!=null&&i.captureEventName)&&this.capture((r=i==null?void 0:i.captureEventName)!==null&&r!==void 0?r:"$opt_in",i==null?void 0:i.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(i){i===!1?(je==null||je.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(je==null||je.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),t}();(function(t,i){for(var r=0;r<i.length;r++)t.prototype[i[r]]=fue(t.prototype[i[r]])})(Zj,["identify"]);var Qk,rM=(Qk=V_[Jm]=new Zj,function(){function t(){t.done||(t.done=!0,qj=!1,xr(V_,function(i){i._dom_loaded()}))}Ot!=null&&Ot.addEventListener&&(Ot.readyState==="complete"?t():Ot.addEventListener("DOMContentLoaded",t,!1)),je&&pu(je,"load",t,!0)}(),Qk),Cy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gde(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}
3617function zde(t){if(t.__esModule)return t;var i=t.default;if(typeof i=="function"){var r=function n(){return this instanceof n?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};r.prototype=i.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var Qde=typeof self=="object"?self.FormData:window.FormData;const gE=Gde(Qde);var cR={};const Vde={},Wde=Object.freeze(Object.defineProperty({__proto__:null,default:Vde},Symbol.toStringTag,{value:"Module"})),ir=zde(Wde);var Wr={},Vk;function vE(){return Vk||(Vk=1,Wr.CLIENT_LONG_PASSWORD=1,Wr.CLIENT_FOUND_ROWS=2,Wr.CLIENT_LONG_FLAG=4,Wr.CLIENT_CONNECT_WITH_DB=8,Wr.CLIENT_NO_SCHEMA=16,Wr.CLIENT_COMPRESS=32,Wr.CLIENT_ODBC=64,Wr.CLIENT_LOCAL_FILES=128,Wr.CLIENT_IGNORE_SPACE=256,Wr.CLIENT_PROTOCOL_41=512,Wr.CLIENT_INTERACTIVE=1024,Wr.CLIENT_SSL=2048,Wr.CLIENT_IGNORE_SIGPIPE=4096,Wr.CLIENT_TRANSACTIONS=8192,Wr.CLIENT_RESERVED=16384,Wr.CLIENT_SECURE_CONNECTION=32768,Wr.CLIENT_MULTI_STATEMENTS=65536,Wr.CLIENT_MULTI_RESULTS=131072,Wr.CLIENT_PS_MULTI_RESULTS=262144,Wr.CLIENT_PLUGIN_AUTH=524288,Wr.CLIENT_SSL_VERIFY_SERVER_CERT=1073741824,Wr.CLIENT_REMEMBER_OPTIONS=2147483648),Wr}var hR={},Wk;function Jj(){return Wk||(Wk=1,function(t){t.BIG5_CHINESE_CI=1,t.LATIN2_CZECH_CS=2,t.DEC8_SWEDISH_CI=3,t.CP850_GENERAL_CI=4,t.LATIN1_GERMAN1_CI=5,t.HP8_ENGLISH_CI=6,t.KOI8R_GENERAL_CI=7,t.LATIN1_SWEDISH_CI=8,t.LATIN2_GENERAL_CI=9,t.SWE7_SWEDISH_CI=10,t.ASCII_GENERAL_CI=11,t.UJIS_JAPANESE_CI=12,t.SJIS_JAPANESE_CI=13,t.CP1251_BULGARIAN_CI=14,t.LATIN1_DANISH_CI=15,t.HEBREW_GENERAL_CI=16,t.TIS620_THAI_CI=18,t.EUCKR_KOREAN_CI=19,t.LATIN7_ESTONIAN_CS=20,t.LATIN2_HUNGARIAN_CI=21,t.KOI8U_GENERAL_CI=22,t.CP1251_UKRAINIAN_CI=23,t.GB2312_CHINESE_CI=24,t.GREEK_GENERAL_CI=25,t.CP1250_GENERAL_CI=26,t.LATIN2_CROATIAN_CI=27,t.GBK_CHINESE_CI=28,t.CP1257_LITHUANIAN_CI=29,t.LATIN5_TURKISH_CI=30,t.LATIN1_GERMAN2_CI=31,t.ARMSCII8_GENERAL_CI=32,t.UTF8_GENERAL_CI=33,t.CP1250_CZECH_CS=34,t.UCS2_GENERAL_CI=35,t.CP866_GENERAL_CI=36,t.KEYBCS2_GENERAL_CI=37,t.MACCE_GENERAL_CI=38,t.MACROMAN_GENERAL_CI=39,t.CP852_GENERAL_CI=40,t.LATIN7_GENERAL_CI=41,t.LATIN7_GENERAL_CS=42,t.MACCE_BIN=43,t.CP1250_CROATIAN_CI=44,t.UTF8MB4_GENERAL_CI=45,t.UTF8MB4_BIN=46,t.LATIN1_BIN=47,t.LATIN1_GENERAL_CI=48,t.LATIN1_GENERAL_CS=49,t.CP1251_BIN=50,t.CP1251_GENERAL_CI=51,t.CP1251_GENERAL_CS=52,t.MACROMAN_BIN=53,t.UTF16_GENERAL_CI=54,t.UTF16_BIN=55,t.UTF16LE_GENERAL_CI=56,t.CP1256_GENERAL_CI=57,t.CP1257_BIN=58,t.CP1257_GENERAL_CI=59,t.UTF32_GENERAL_CI=60,t.UTF32_BIN=61,t.UTF16LE_BIN=62,t.BINARY=63,t.ARMSCII8_BIN=64,t.ASCII_BIN=65,t.CP1250_BIN=66,t.CP1256_BIN=67,t.CP866_BIN=68,t.DEC8_BIN=69,t.GREEK_BIN=70,t.HEBREW_BIN=71,t.HP8_BIN=72,t.KEYBCS2_BIN=73,t.KOI8R_BIN=74,t.KOI8U_BIN=75,t.LATIN2_BIN=77,t.LATIN5_BIN=78,t.LATIN7_BIN=79,t.CP850_BIN=80,t.CP852_BIN=81,t.SWE7_BIN=82,t.UTF8_BIN=83,t.BIG5_BIN=84,t.EUCKR_BIN=85,t.GB2312_BIN=86,t.GBK_BIN=87,t.SJIS_BIN=88,t.TIS620_BIN=89,t.UCS2_BIN=90,t.UJIS_BIN=91,t.GEOSTD8_GENERAL_CI=92,t.GEOSTD8_BIN=93,t.LATIN1_SPANISH_CI=94,t.CP932_JAPANESE_CI=95,t.CP932_BIN=96,t.EUCJPMS_JAPANESE_CI=97,t.EUCJPMS_BIN=98,t.CP1250_POLISH_CI=99,t.UTF16_UNICODE_CI=101,t.UTF16_ICELANDIC_CI=102,t.UTF16_LATVIAN_CI=103,t.UTF16_ROMANIAN_CI=104,t.UTF16_SLOVENIAN_CI=105,t.UTF16_POLISH_CI=106,t.UTF16_ESTONIAN_CI=107,t.UTF16_SPANISH_CI=108,t.UTF16_SWEDISH_CI=109,t.UTF16_TURKISH_CI=110,t.UTF16_CZECH_CI=111,t.UTF16_DANISH_CI=112,t.UTF16_LITHUANIAN_CI=113,t.UTF16_SLOVAK_CI=114,t.UTF16_SPANISH2_CI=115,t.UTF16_ROMAN_CI=116,t.UTF16_PERSIAN_CI=117,t.UTF16_ESPERANTO_CI=118,t.UTF16_HUNGARIAN_CI=119,t.UTF16_SINHALA_CI=120,t.UTF16_GERMAN2_CI=121,t.UTF16_CROATIAN_MYSQL561_CI=122,t.UTF16_UNICODE_520_CI=123,t.UTF16_VIETNAMESE_CI=124,t.UCS2_UNICODE_CI=128,t.UCS2_ICELANDIC_CI=129,t.UCS2_LATVIAN_CI=130,t.UCS2_ROMANIAN_CI=131,t.UCS2_SLOVENIAN_CI=132,t.UCS2_POLISH_CI=133,t.UCS2_ESTONIAN_CI=134,t.UCS2_SPANISH_CI=135,t.UCS2_SWEDISH_CI=136,t.UCS2_TURKISH_CI=137,t.UCS2_CZECH_CI=138,t.UCS2_DANISH_CI=139,t.UCS2_LITHUANIAN_CI=140,t.UCS2_SLOVAK_CI=141,t.UCS2_SPANISH2_CI=142,t.UCS2_ROMAN_CI=143,t.UCS2_PERSIAN_CI=144,t.UCS2_ESPERANTO_CI=145,t.UCS2_HUNGARIAN_CI=146,t.UCS2_SINHALA_CI=147,t.UCS2_GERMAN2_CI=148,t.UCS2_CROATIAN_MYSQL561_CI=149,t.UCS2_UNICODE_520_CI=150,t.UCS2_VIETNAMESE_CI=151,t.UCS2_GENERAL_MYSQL500_CI=159,t.UTF32_UNICODE_CI=160,t.UTF32_ICELANDIC_CI=161,t.UTF32_LATVIAN_CI=162,t.UTF32_ROMANIAN_CI=163,t.UTF32_SLOVENIAN_CI=164,t.UTF32_POLISH_CI=165,t.UTF32_ESTONIAN_CI=166,t.UTF32_SPANISH_CI=167,t.UTF32_SWEDISH_CI=168,t.UTF32_TURKISH_CI=169,t.UTF32_CZECH_CI=170,t.UTF32_DANISH_CI=171,t.UTF32_LITHUANIAN_CI=172,t.UTF32_SLOVAK_CI=173,t.UTF32_SPANISH2_CI=174,t.UTF32_ROMAN_CI=175,t.UTF32_PERSIAN_CI=176,t.UTF32_ESPERANTO_CI=177,t.UTF32_HUNGARIAN_CI=178,t.UTF32_SINHALA_CI=179,t.UTF32_GERMAN2_CI=180,t.UTF32_CROATIAN_MYSQL561_CI=181,t.UTF32_UNICODE_520_CI=182,t.UTF32_VIETNAMESE_CI=183,t.UTF8_UNICODE_CI=192,t.UTF8_ICELANDIC_CI=193,t.UTF8_LATVIAN_CI=194,t.UTF8_ROMANIAN_CI=195,t.UTF8_SLOVENIAN_CI=196,t.UTF8_POLISH_CI=197,t.UTF8_ESTONIAN_CI=198,t.UTF8_SPANISH_CI=199,t.UTF8_SWEDISH_CI=200,t.UTF8_TURKISH_CI=201,t.UTF8_CZECH_CI=202,t.UTF8_DANISH_CI=203,t.UTF8_LITHUANIAN_CI=204,t.UTF8_SLOVAK_CI=205,t.UTF8_SPANISH2_CI=206,t.UTF8_ROMAN_CI=207,t.UTF8_PERSIAN_CI=208,t.UTF8_ESPERANTO_CI=209,t.UTF8_HUNGARIAN_CI=210,t.UTF8_SINHALA_CI=211,t.UTF8_GERMAN2_CI=212,t.UTF8_CROATIAN_MYSQL561_CI=213,t.UTF8_UNICODE_520_CI=214,t.UTF8_VIETNAMESE_CI=215,t.UTF8_GENERAL_MYSQL500_CI=223,t.UTF8MB4_UNICODE_CI=224,t.UTF8MB4_ICELANDIC_CI=225,t.UTF8MB4_LATVIAN_CI=226,t.UTF8MB4_ROMANIAN_CI=227,t.UTF8MB4_SLOVENIAN_CI=228,t.UTF8MB4_POLISH_CI=229,t.UTF8MB4_ESTONIAN_CI=230,t.UTF8MB4_SPANISH_CI=231,t.UTF8MB4_SWEDISH_CI=232,t.UTF8MB4_TURKISH_CI=233,t.UTF8MB4_CZECH_CI=234,t.UTF8MB4_DANISH_CI=235,t.UTF8MB4_LITHUANIAN_CI=236,t.UTF8MB4_SLOVAK_CI=237,t.UTF8MB4_SPANISH2_CI=238,t.UTF8MB4_ROMAN_CI=239,t.UTF8MB4_PERSIAN_CI=240,t.UTF8MB4_ESPERANTO_CI=241,t.
3617UTF8MB4_HUNGARIAN_CI=242,t.UTF8MB4_SINHALA_CI=243,t.UTF8MB4_GERMAN2_CI=244,t.UTF8MB4_CROATIAN_MYSQL561_CI=245,t.UTF8MB4_UNICODE_520_CI=246,t.UTF8MB4_VIETNAMESE_CI=247,t.UTF8_GENERAL50_CI=253,t.ARMSCII8=t.ARMSCII8_GENERAL_CI,t.ASCII=t.ASCII_GENERAL_CI,t.BIG5=t.BIG5_CHINESE_CI,t.BINARY=t.BINARY,t.CP1250=t.CP1250_GENERAL_CI,t.CP1251=t.CP1251_GENERAL_CI,t.CP1256=t.CP1256_GENERAL_CI,t.CP1257=t.CP1257_GENERAL_CI,t.CP866=t.CP866_GENERAL_CI,t.CP850=t.CP850_GENERAL_CI,t.CP852=t.CP852_GENERAL_CI,t.CP932=t.CP932_JAPANESE_CI,t.DEC8=t.DEC8_SWEDISH_CI,t.EUCJPMS=t.EUCJPMS_JAPANESE_CI,t.EUCKR=t.EUCKR_KOREAN_CI,t.GB2312=t.GB2312_CHINESE_CI,t.GBK=t.GBK_CHINESE_CI,t.GEOSTD8=t.GEOSTD8_GENERAL_CI,t.GREEK=t.GREEK_GENERAL_CI,t.HEBREW=t.HEBREW_GENERAL_CI,t.HP8=t.HP8_ENGLISH_CI,t.KEYBCS2=t.KEYBCS2_GENERAL_CI,t.KOI8R=t.KOI8R_GENERAL_CI,t.KOI8U=t.KOI8U_GENERAL_CI,t.LATIN1=t.LATIN1_SWEDISH_CI,t.LATIN2=t.LATIN2_GENERAL_CI,t.LATIN5=t.LATIN5_TURKISH_CI,t.LATIN7=t.LATIN7_GENERAL_CI,t.MACCE=t.MACCE_GENERAL_CI,t.MACROMAN=t.MACROMAN_GENERAL_CI,t.SJIS=t.SJIS_JAPANESE_CI,t.SWE7=t.SWE7_SWEDISH_CI,t.TIS620=t.TIS620_THAI_CI,t.UCS2=t.UCS2_GENERAL_CI,t.UJIS=t.UJIS_JAPANESE_CI,t.UTF16=t.UTF16_GENERAL_CI,t.UTF16LE=t.UTF16LE_GENERAL_CI,t.UTF8=t.UTF8_GENERAL_CI,t.UTF8MB4=t.UTF8MB4_GENERAL_CI,t.UTF32=t.UTF32_GENERAL_CI}(hR)),hR}var uR={},jk;function jde(){return jk||(jk=1,function(t){t["Amazon RDS"]={ca:[`-----BEGIN CERTIFICATE----- 3618MIIDQzCCAqygAwIBAgIJAOd1tlfiGoEoMA0GCSqGSIb3DQEBBQUAMHUxCzAJBgNV 3619BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdTZWF0dGxlMRMw 3620EQYDVQQKEwpBbWF6b24uY29tMQwwCgYDVQQLEwNSRFMxHDAaBgNVBAMTE2F3cy5h 3621bWF6b24uY29tL3Jkcy8wHhcNMTAwNDA1MjI0NDMxWhcNMTUwNDA0MjI0NDMxWjB1 3622MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHU2Vh 3623dHRsZTETMBEGA1UEChMKQW1hem9uLmNvbTEMMAoGA1UECxMDUkRTMRwwGgYDVQQD 3624ExNhd3MuYW1hem9uLmNvbS9yZHMvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB 3625gQDKhXGU7tizxUR5WaFoMTFcxNxa05PEjZaIOEN5ctkWrqYSRov0/nOMoZjqk8bC 3626med9vPFoQGD0OTakPs0jVe3wwmR735hyVwmKIPPsGlaBYj1O6llIpZeQVyupNx56 3627UzqtiLaDzh1KcmfqP3qP2dInzBfJQKjiRudo1FWnpPt33QIDAQABo4HaMIHXMB0G 3628A1UdDgQWBBT/H3x+cqSkR/ePSIinPtc4yWKe3DCBpwYDVR0jBIGfMIGcgBT/H3x+ 3629cqSkR/ePSIinPtc4yWKe3KF5pHcwdTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldh 3630c2hpbmd0b24xEDAOBgNVBAcTB1NlYXR0bGUxEzARBgNVBAoTCkFtYXpvbi5jb20x 3631DDAKBgNVBAsTA1JEUzEcMBoGA1UEAxMTYXdzLmFtYXpvbi5jb20vcmRzL4IJAOd1 3632tlfiGoEoMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAvguZy/BDT66x 3633GfgnJlyQwnFSeVLQm9u/FIvz4huGjbq9dqnD6h/Gm56QPFdyMEyDiZWaqY6V08lY 3634LTBNb4kcIc9/6pc0/ojKciP5QJRm6OiZ4vgG05nF4fYjhU7WClUx7cxq1fKjNc2J 3635UCmmYqgiVkAGWRETVo+byOSDZ4swb10= 3636-----END CERTIFICATE----- 3637`,`-----BEGIN CERTIFICATE-----
3638MIID9DCCAtygAwIBAgIBQjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3639EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3640GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3641GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUwOTExMzFaFw0y 3642MDAzMDUwOTExMzFaMIGKMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3643bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3644cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEbMBkGA1UEAwwSQW1hem9uIFJE 3645UyBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuD8nrZ8V 3646u+VA8yVlUipCZIKPTDcOILYpUe8Tct0YeQQr0uyl018StdBsa3CjBgvwpDRq1HgF 3647Ji2N3+39+shCNspQeE6aYU+BHXhKhIIStt3r7gl/4NqYiDDMWKHxHq0nsGDFfArf 3648AOcjZdJagOMqb3fF46flc8k2E7THTm9Sz4L7RY1WdABMuurpICLFE3oHcGdapOb9 3649T53pQR+xpHW9atkcf3pf7gbO0rlKVSIoUenBlZipUlp1VZl/OD/E+TtRhDDNdI2J 3650P/DSMM3aEsq6ZQkfbz/Ilml+Lx3tJYXUDmp+ZjzMPLk/+3beT8EhrwtcG3VPpvwp 3651BIOqsqVVTvw/CwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw 3652AwEB/zAdBgNVHQ4EFgQUTgLurD72FchM7Sz1BcGPnIQISYMwHwYDVR0jBBgwFoAU 3653TgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQEFBQADggEBAHZcgIio8pAm 3654MjHD5cl6wKjXxScXKtXygWH2BoDMYBJF9yfyKO2jEFxYKbHePpnXB1R04zJSWAw5 36552EUuDI1pSBh9BA82/5PkuNlNeSTB3dXDD2PEPdzVWbSKvUB8ZdooV+2vngL0Zm4r 365647QPyd18yPHrRIbtBtHR/6CwKevLZ394zgExqhnekYKIqqEX41xsUV0Gm6x4vpjf 36572u6O/+YE2U+qyyxHE5Wd5oqde0oo9UUpFETJPVb6Q2cEeQib8PBAyi0i6KnF+kIV 3658A9dY7IHSubtCK/i8wxMVqfd5GtbA8mmpeJFwnDvm9rBEsHybl08qlax9syEwsUYr 3659/40NawZfTUU= 3660-----END CERTIFICATE----- 3661`,`-----BEGIN CERTIFICATE----- 3662MIIEBjCCAu6gAwIBAgIJAMc0ZzaSUK51MA0GCSqGSIb3DQEBCwUAMIGPMQswCQYD 3663VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi 3664MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h 3665em9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkw 3666ODIyMTcwODUwWhcNMjQwODIyMTcwODUwWjCBjzELMAkGA1UEBhMCVVMxEDAOBgNV 3667BAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoMGUFtYXpv 3668biBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxIDAeBgNV 3669BAMMF0FtYXpvbiBSRFMgUm9vdCAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEFAAOC 3670AQ8AMIIBCgKCAQEArXnF/E6/Qh+ku3hQTSKPMhQQlCpoWvnIthzX6MK3p5a0eXKZ 3671oWIjYcNNG6UwJjp4fUXl6glp53Jobn+tWNX88dNH2n8DVbppSwScVE2LpuL+94vY 36720EYE/XxN7svKea8YvlrqkUBKyxLxTjh+U/KrGOaHxz9v0l6ZNlDbuaZw3qIWdD/I 36736aNbGeRUVtpM6P+bWIoxVl/caQylQS6CEYUk+CpVyJSkopwJlzXT07tMoDL5WgX9 3674O08KVgDNz9qP/IGtAcRduRcNioH3E9v981QO1zt/Gpb2f8NqAjUUCUZzOnij6mx9 3675McZ+9cWX88CRzR0vQODWuZscgI08NvM69Fn2SQIDAQABo2MwYTAOBgNVHQ8BAf8E 3676BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUc19g2LzLA5j0Kxc0LjZa 3677pmD/vB8wHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJKoZIhvcN 3678AQELBQADggEBAHAG7WTmyjzPRIM85rVj+fWHsLIvqpw6DObIjMWokpliCeMINZFV 3679ynfgBKsf1ExwbvJNzYFXW6dihnguDG9VMPpi2up/ctQTN8tm9nDKOy08uNZoofMc 3680NUZxKCEkVKZv+IL4oHoeayt8egtv3ujJM6V14AstMQ6SwvwvA93EP/Ug2e4WAXHu 3681cbI1NAbUgVDqp+DRdfvZkgYKryjTWd/0+1fS8X1bBZVWzl7eirNVnHbSH2ZDpNuY 36820SBd8dj5F6ld3t58ydZbrTHze7JJOd8ijySAp4/kiu9UfZWuTPABzDa/DSdz9Dk/ 3683zPW4CXXvhLmE02TA9/HeCw3KEHIwicNuEfw= 3684-----END CERTIFICATE----- 3685`,`-----BEGIN CERTIFICATE----- 3686MIIEATCCAumgAwIBAgIBRDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3687EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3688GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3689GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMDZaFw0y 3690MDAzMDUyMjAzMDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3691bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3692cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE 3693UyBhcC1ub3J0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 3694ggEBAMmM2B4PfTXCZjbZMWiDPyxvk/eeNwIRJAhfzesiGUiLozX6CRy3rwC1ZOPV 3695AcQf0LB+O8wY88C/cV+d4Q2nBDmnk+Vx7o2MyMh343r5rR3Na+4izd89tkQVt0WW 3696vO21KRH5i8EuBjinboOwAwu6IJ+HyiQiM0VjgjrmEr/YzFPL8MgHD/YUHehqjACn 3697C0+B7/gu7W4qJzBL2DOf7ub2qszGtwPE+qQzkCRDwE1A4AJmVE++/FLH2Zx78Egg 3698fV1sUxPtYgjGH76VyyO6GNKM6rAUMD/q5mnPASQVIXgKbupr618bnH+SWHFjBqZq 3699HvDGPMtiiWII41EmGUypyt5AbysCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG 3700A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFIiKM0Q6n1K4EmLxs3ZXxINbwEwR 3701MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA 3702A4IBAQBezGbE9Rw/k2e25iGjj5n8r+M3dlye8ORfCE/dijHtxqAKasXHgKX8I9Tw 3703JkBiGWiuzqn7gO5MJ0nMMro1+gq29qjZnYX1pDHPgsRjUX8R+juRhgJ3JSHijRbf 37044qNJrnwga7pj94MhcLq9u0f6dxH6dXbyMv21T4TZMTmcFduf1KgaiVx1PEyJjC6r 3705M+Ru+A0eM+jJ7uCjUoZKcpX8xkj4nmSnz9NMPog3wdOSB9cAW7XIc5mHa656wr7I 3706WJxVcYNHTXIjCcng2zMKd1aCcl2KSFfy56sRfT7J5Wp69QSr+jq8KM55gw8uqAwi 3707VPrXn2899T1rcTtFYFP16WXjGuc0 3708-----END CERTIFICATE----- 3709`,`-----BEGIN CERTIFICATE----- 3710MIIEATCCAumgAwIBAgIBTDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3711EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3712GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3713GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTExMDYwMDA1NDZaFw0y 3714MDAzMDUwMDA1NDZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3715bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl
3716cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE 3717UyBhcC1ub3J0aGVhc3QtMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 3718ggEBAKSwd+RVUzTRH0FgnbwoTK8TMm/zMT4+2BvALpAUe6YXbkisg2goycWuuWLg 3719jOpFBB3GtyvXZnkqi7MkDWUmj1a2kf8l2oLyoaZ+Hm9x/sV+IJzOqPvj1XVUGjP6 3720yYYnPJmUYqvZeI7fEkIGdFkP2m4/sgsSGsFvpD9FK1bL1Kx2UDpYX0kHTtr18Zm/ 37211oN6irqWALSmXMDydb8hE0FB2A1VFyeKE6PnoDj/Y5cPHwPPdEi6/3gkDkSaOG30 3722rWeQfL3pOcKqzbHaWTxMphd0DSL/quZ64Nr+Ly65Q5PRcTrtr55ekOUziuqXwk+o 37239QpACMwcJ7ROqOznZTqTzSFVXFECAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG 3724A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFM6Nox/QWbhzWVvzoJ/y0kGpNPK+ 3725MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA 3726A4IBAQCTkWBqNvyRf3Y/W21DwFx3oT/AIWrHt0BdGZO34tavummXemTH9LZ/mqv9 3727aljt6ZuDtf5DEQjdsAwXMsyo03ffnP7doWm8iaF1+Mui77ot0TmTsP/deyGwukvJ 3728tkxX8bZjDh+EaNauWKr+CYnniNxCQLfFtXYJsfOdVBzK3xNL+Z3ucOQRhr2helWc 3729CDQgwfhP1+3pRVKqHvWCPC4R3fT7RZHuRmZ38kndv476GxRntejh+ePffif78bFI 37303rIZCPBGobrrUMycafSbyXteoGca/kA+/IqrAPlk0pWQ4aEL0yTWN2h2dnjoD7oX 3731byIuL/g9AGRh97+ssn7D6bDRPTbW 3732-----END CERTIFICATE----- 3733`,`-----BEGIN CERTIFICATE----- 3734MIIEATCCAumgAwIBAgIBRTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3735EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3736GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3737GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMTlaFw0y 3738MDAzMDUyMjAzMTlaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3739bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3740cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE 3741UyBhcC1zb3V0aGVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 3742ggEBANaXElmSEYt/UtxHFsARFhSUahTf1KNJzR0Dmay6hqOXQuRVbKRwPd19u5vx 3743DdF1sLT7D69IK3VDnUiQScaCv2Dpu9foZt+rLx+cpx1qiQd1UHrvqq8xPzQOqCdC 3744RFStq6yVYZ69yfpfoI67AjclMOjl2Vph3ftVnqP0IgVKZdzeC7fd+umGgR9xY0Qr 3745Ubhd/lWdsbNvzK3f1TPWcfIKQnpvSt85PIEDJir6/nuJUKMtmJRwTymJf0i+JZ4x 37467dJa341p2kHKcHMgOPW7nJQklGBA70ytjUV6/qebS3yIugr/28mwReflg3TJzVDl 3747EOvi6pqbqNbkMuEwGDCmEQIVqgkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG 3748A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFAu93/4k5xbWOsgdCdn+/KdiRuit 3749MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA 3750A4IBAQBlcjSyscpPjf5+MgzMuAsCxByqUt+WFspwcMCpwdaBeHOPSQrXNqX2Sk6P 3751kth6oCivA64trWo8tFMvPYlUA1FYVD5WpN0kCK+P5pD4KHlaDsXhuhClJzp/OP8t 3752pOyUr5109RHLxqoKB5J5m1XA7rgcFjnMxwBSWFe3/4uMk/+4T53YfCVXuc6QV3i7 3753I/2LAJwFf//pTtt6fZenYfCsahnr2nvrNRNyAxcfvGZ/4Opn/mJtR6R/AjvQZHiR 3754bkRNKF2GW0ueK5W4FkZVZVhhX9xh1Aj2Ollb+lbOqADaVj+AT3PoJPZ3MPQHKCXm 3755xwG0LOLlRr/TfD6li1AfOVTAJXv9 3756-----END CERTIFICATE----- 3757`,`-----BEGIN CERTIFICATE----- 3758MIIEATCCAumgAwIBAgIBRjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3759EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3760GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3761GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMjRaFw0y 3762MDAzMDUyMjAzMjRaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3763bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3764cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE 3765UyBhcC1zb3V0aGVhc3QtMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 3766ggEBAJqBAJutz69hFOh3BtLHZTbwE8eejGGKayn9hu98YMDPzWzGXWCmW+ZYWELA 3767cY3cNWNF8K4FqKXFr2ssorBYim1UtYFX8yhydT2hMD5zgQ2sCGUpuidijuPA6zaq 3768Z3tdhVR94f0q8mpwpv2zqR9PcqaGDx2VR1x773FupRPRo7mEW1vC3IptHCQlP/zE 37697jQiLl28bDIH2567xg7e7E9WnZToRnhlYdTaDaJsHTzi5mwILi4cihSok7Shv/ME 3770hnukvxeSPUpaVtFaBhfBqq055ePq9I+Ns4KGreTKMhU0O9fkkaBaBmPaFgmeX/XO 3771n2AX7gMouo3mtv34iDTZ0h6YCGkCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG 3772A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFIlQnY0KHYWn1jYumSdJYfwj/Nfw 3773MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA 3774A4IBAQA0wVU6/l41cTzHc4azc4CDYY2Wd90DFWiH9C/mw0SgToYfCJ/5Cfi0NT/Y 3775PRnk3GchychCJgoPA/k9d0//IhYEAIiIDjyFVgjbTkKV3sh4RbdldKVOUB9kumz/ 3776ZpShplsGt3z4QQiVnKfrAgqxWDjR0I0pQKkxXa6Sjkicos9LQxVtJ0XA4ieG1E7z 3777zJr+6t80wmzxvkInSaWP3xNJK9azVRTrgQZQlvkbpDbExl4mNTG66VD3bAp6t3Wa 3778B49//uDdfZmPkqqbX+hsxp160OH0rxJppwO3Bh869PkDnaPEd/Pxw7PawC+li0gi 3779NRV8iCEx85aFxcyOhqn0WZOasxee 3780-----END CERTIFICATE----- 3781`,`-----BEGIN CERTIFICATE----- 3782MIID/zCCAuegAwIBAgIBRzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3783EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3784GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3785GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzFaFw0y 3786MDAzMDUyMjAzMzFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3787bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3788cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE 3789UyBldS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB 3790AQDFtP2dhSLuaPOI4ZrrPWsK4OY9ocQBp3yApH1KJYmI9wpQKZG/KCH2E6Oo7JAw 3791QORU519r033T+FO2Z7pFPlmz1yrxGXyHpJs8ySx3Yo5S8ncDCdZJCLmtPiq/hahg 37925/0ffexMFUCQaYicFZsrJ/cStdxUV+tSw2JQLD7UxS9J97LQWUPyyG+ZrjYVTVq+ 3793zudnFmNSe4QoecXMhAFTGJFQXxP7nhSL9Ao5FGgdXy7/JWeWdQIAj8ku6cBDKPa6
3794Y6kP+ak+In+Lye8z9qsCD/afUozfWjPR2aA4JoIZVF8dNRShIMo8l0XfgfM2q0+n 3795ApZWZ+BjhIO5XuoUgHS3D2YFAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNV 3796HRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRm4GsWIA/M6q+tK8WGHWDGh2gcyTAf 3797BgNVHSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOC 3798AQEAHpMmeVQNqcxgfQdbDIi5UIy+E7zZykmtAygN1XQrvga9nXTis4kOTN6g5/+g 3799HCx7jIXeNJzAbvg8XFqBN84Quqgpl/tQkbpco9Jh1HDs558D5NnZQxNqH5qXQ3Mm 3800uPgCw0pYcPOa7bhs07i+MdVwPBsX27CFDtsgAIru8HvKxY1oTZrWnyIRo93tt/pk 3801WuItVMVHjaQZVfTCow0aDUbte6Vlw82KjUFq+n2NMSCJDiDKsDDHT6BJc4AJHIq3 3802/4Z52MSC9KMr0yAaaoWfW/yMEj9LliQauAgwVjArF4q78rxpfKTG9Rfd8U1BZANP 38037FrFMN0ThjfA1IvmOYcgskY5bQ== 3804-----END CERTIFICATE----- 3805`,`-----BEGIN CERTIFICATE----- 3806MIID/DCCAuSgAwIBAgIBSDANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3807EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3808GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3809GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzMzVaFw0y 3810MDAzMDUyMjAzMzVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3811bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3812cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 3813UyBldS13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx 3814PdbqQ0HKRj79Pmocxvjc+P6i4Ux24kgFIl+ckiir1vzkmesc3a58gjrMlCksEObt 3815Yihs5IhzEq1ePT0gbfS9GYFp34Uj/MtPwlrfCBWG4d2TcrsKRHr1/EXUYhWqmdrb 3816RhX8XqoRhVkbF/auzFSBhTzcGGvZpQ2KIaxRcQfcXlMVhj/pxxAjh8U4F350Fb0h 3817nX1jw4/KvEreBL0Xb2lnlGTkwVxaKGSgXEnOgIyOFdOQc61vdome0+eeZsP4jqeR 3818TGYJA9izJsRbe2YJxHuazD+548hsPlM3vFzKKEVURCha466rAaYAHy3rKur3HYQx 3819Yt+SoKcEz9PXuSGj96ejAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 3820Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBTebg//h2oeXbZjQ4uuoiuLYzuiPDAfBgNV 3821HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA 3822TikPaGeZasTPw+4RBemlsyPAjtFFQLo7ddaFdORLgdEysVf8aBqndvbA6MT/v4lj 3823GtEtUdF59ZcbWOrVm+fBZ2h/jYJ59dYF/xzb09nyRbdMSzB9+mkSsnOMqluq5y8o 3824DY/PfP2vGhEg/2ZncRC7nlQU1Dm8F4lFWEiQ2fi7O1cW852Vmbq61RIfcYsH/9Ma 3825kpgk10VZ75b8m3UhmpZ/2uRY+JEHImH5WpcTJ7wNiPNJsciZMznGtrgOnPzYco8L 3826cDleOASIZifNMQi9PKOJKvi0ITz0B/imr8KBsW0YjZVJ54HMa7W1lwugSM7aMAs+ 3827E3Sd5lS+SHwWaOCHwhOEVA== 3828-----END CERTIFICATE----- 3829`,`-----BEGIN CERTIFICATE----- 3830MIID/DCCAuSgAwIBAgIBSTANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3831EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3832GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3833GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDBaFw0y 3834MDAzMDUyMjAzNDBaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3835bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3836cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 3837UyBzYS1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCU 3838X4OBnQ5xA6TLJAiFEI6l7bUWjoVJBa/VbMdCCSs2i2dOKmqUaXu2ix2zcPILj3lZ 3839GMk3d/2zvTK/cKhcFrewHUBamTeVHdEmynhMQamqNmkM4ptYzFcvEUw1TGxHT4pV 3840Q6gSN7+/AJewQvyHexHo8D0+LDN0/Wa9mRm4ixCYH2CyYYJNKaZt9+EZfNu+PPS4 38418iB0TWH0DgQkbWMBfCRgolLLitAZklZ4dvdlEBS7evN1/7ttBxUK6SvkeeSx3zBl 3842ww3BlXqc3bvTQL0A+RRysaVyFbvtp9domFaDKZCpMmDFAN/ntx215xmQdrSt+K3F 3843cXdGQYHx5q410CAclGnbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 3844Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT6iVWnm/uakS+tEX2mzIfw+8JL0zAfBgNV 3845HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA 3846FmDD+QuDklXn2EgShwQxV13+txPRuVdOSrutHhoCgMwFWCMtPPtBAKs6KPY7Guvw 3847DpJoZSehDiOfsgMirjOWjvfkeWSNvKfjWTVneX7pZD9W5WPnsDBvTbCGezm+v87z 3848b+ZM2ZMo98m/wkMcIEAgdSKilR2fuw8rLkAjhYFfs0A7tDgZ9noKwgHvoE4dsrI0 3849KZYco6DlP/brASfHTPa2puBLN9McK3v+h0JaSqqm5Ro2Bh56tZkQh8AWy/miuDuK 38503+hNEVdxosxlkM1TPa1DGj0EzzK0yoeerXuH2HX7LlCrrxf6/wdKnjR12PMrLQ4A 3851pCqkcWw894z6bV9MAvKe6A== 3852-----END CERTIFICATE----- 3853`,`-----BEGIN CERTIFICATE----- 3854MIID/DCCAuSgAwIBAgIBQzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3855EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3856GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3857GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMTU0MDRaFw0y 3858MDAzMDUyMTU0MDRaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3859bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3860cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 3861UyB1cy1lYXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDI 3862UIuwh8NusKHk1SqPXcP7OqxY3S/M2ZyQWD3w7Bfihpyyy/fc1w0/suIpX3kbMhAV 38632ESwged2/2zSx4pVnjp/493r4luhSqQYzru78TuPt9bhJIJ51WXunZW2SWkisSaf 3864USYUzVN9ezR/bjXTumSUQaLIouJt3OHLX49s+3NAbUyOI8EdvgBQWD68H1epsC0n 3865CI5s+pIktyOZ59c4DCDLQcXErQ+tNbDC++oct1ANd/q8p9URonYwGCGOBy7sbCYq 38669eVHh1Iy2M+SNXddVOGw5EuruvHoCIQyOz5Lz4zSuZA9dRbrfztNOpezCNYu6NKM 3867n+hzcvdiyxv77uNm8EaxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 3868Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQSQG3TmMe6Sa3KufaPBa72v4QFDzAfBgNV 3869HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA
3870L/mOZfB3187xTmjOHMqN2G2oSKHBKiQLM9uv8+97qT+XR+TVsBT6b3yoPpMAGhHA 3871Pc7nxAF5gPpuzatx0OTLPcmYucFmfqT/1qA5WlgCnMNtczyNMH97lKFTNV7Njtek 3872jWEzAEQSyEWrkNpNlC4j6kMYyPzVXQeXUeZTgJ9FNnVZqmvfjip2N22tawMjrCn5 38737KN/zN65EwY2oO9XsaTwwWmBu3NrDdMbzJnbxoWcFWj4RBwanR1XjQOVNhDwmCOl 3874/1Et13b8CPyj69PC8BOVU6cfTSx8WUVy0qvYOKHNY9Bqa5BDnIL3IVmUkeTlM1mt 3875enRpyBj+Bk9rh/ICdiRKmA== 3876-----END CERTIFICATE----- 3877`,`-----BEGIN CERTIFICATE----- 3878MIID/DCCAuSgAwIBAgIBSjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3879EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3880GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3881GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNDVaFw0y 3882MDAzMDUyMjAzNDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3883bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3884cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 3885UyB1cy13ZXN0LTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDE 3886Dhw+uw/ycaiIhhyu2pXFRimq0DlB8cNtIe8hdqndH8TV/TFrljNgR8QdzOgZtZ9C 3887zzQ2GRpInN/qJF6slEd6wO+6TaDBQkPY+07TXNt52POFUhdVkhJXHpE2BS7Xn6J7 38887RFAOeG1IZmc2DDt+sR1BgXzUqHslQGfFYNS0/MBO4P+ya6W7IhruB1qfa4HiYQS 3889dbe4MvGWnv0UzwAqdR7OF8+8/5c58YXZIXCO9riYF2ql6KNSL5cyDPcYK5VK0+Q9 3890VI6vuJHSMYcF7wLePw8jtBktqAFE/wbdZiIHhZvNyiNWPPNTGUmQbaJ+TzQEHDs5 38918en+/W7JKnPyBOkxxENbAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 3892Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBS0nw/tFR9bCjgqWTPJkyy4oOD8bzAfBgNV 3893HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA 3894CXGAY3feAak6lHdqj6+YWjy6yyUnLK37bRxZDsyDVXrPRQaXRzPTzx79jvDwEb/H 3895Q/bdQ7zQRWqJcbivQlwhuPJ4kWPUZgSt3JUUuqkMsDzsvj/bwIjlrEFDOdHGh0mi 3896eVIngFEjUXjMh+5aHPEF9BlQnB8LfVtKj18e15UDTXFa+xJPFxUR7wDzCfo4WI1m 3897sUMG4q1FkGAZgsoyFPZfF8IVvgCuGdR8z30VWKklFxttlK0eGLlPAyIO0CQxPQlo 3898saNJrHf4tLOgZIWk+LpDhNd9Et5EzvJ3aURUsKY4pISPPF5WdvM9OE59bERwUErd 3899nuOuQWQeeadMceZnauRzJQ== 3900-----END CERTIFICATE----- 3901`,`-----BEGIN CERTIFICATE----- 3902MIID/DCCAuSgAwIBAgIBSzANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 3903EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3904GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3905GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNTAyMDUyMjAzNTBaFw0y 3906MDAzMDUyMjAzNTBaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3907bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3908cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 3909UyB1cy13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDM 3910H58SR48U6jyERC1vYTnub34smf5EQVXyzaTmspWGWGzT31NLNZGSDFaa7yef9kdO 3911mzJsgebR5tXq6LdwlIoWkKYQ7ycUaadtVKVYdI40QcI3cHn0qLFlg2iBXmWp/B+i 3912Z34VuVlCh31Uj5WmhaBoz8t/GRqh1V/aCsf3Wc6jCezH3QfuCjBpzxdOOHN6Ie2v 3913xX09O5qmZTvMoRBAvPkxdaPg/Mi7fxueWTbEVk78kuFbF1jHYw8U1BLILIAhcqlq 3914x4u8nl73t3O3l/soNUcIwUDK0/S+Kfqhwn9yQyPlhb4Wy3pfnZLJdkyHldktnQav 39159TB9u7KH5Lk0aAYslMLxAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 3916Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBT8roM4lRnlFHWMPWRz0zkwFZog1jAfBgNV 3917HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQUFAAOCAQEA 3918JwrxwgwmPtcdaU7O7WDdYa4hprpOMamI49NDzmE0s10oGrqmLwZygcWU0jT+fJ+Y 3919pJe1w0CVfKaeLYNsOBVW3X4ZPmffYfWBheZiaiEflq/P6t7/Eg81gaKYnZ/x1Dfa 3920sUYkzPvCkXe9wEz5zdUTOCptDt89rBR9CstL9vE7WYUgiVVmBJffWbHQLtfjv6OF 3921NMb0QME981kGRzc2WhgP71YS2hHd1kXtsoYP1yTu4vThSKsoN4bkiHsaC1cRkLoy 39220fFA4wpB3WloMEvCDaUvvH1LZlBXTNlwi9KtcwD4tDxkkBt4tQczKLGpQ/nF/W9n 39238YDWk3IIc1sd0bkZqoau2Q== 3924-----END CERTIFICATE----- 3925`,`-----BEGIN CERTIFICATE----- 3926MIID/TCCAuWgAwIBAgIBTTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx 3927EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3928GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3929GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA1MDMyMTI5MjJaFw0y 3930MDAzMDUyMTI5MjJaMIGQMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3931bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3932cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEhMB8GA1UEAwwYQW1hem9uIFJE 3933UyBhcC1zb3V0aC0xIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA 393406eWGLE0TeqL9kyWOLkS8q0fXO97z+xyBV3DKSB2lg2GkgBz3B98MkmkeB0SZy3G 3935Ce4uCpCPbFKiFEdiUclOlhZsrBuCeaimxLM3Ig2wuenElO/7TqgaYHYUbT3d+VQW 3936GUbLn5GRZJZe1OAClYdOWm7A1CKpuo+cVV1vxbY2nGUQSJPpVn2sT9gnwvjdE60U 3937JGYU/RLCTm8zmZBvlWaNIeKDnreIc4rKn6gUnJ2cQn1ryCVleEeyc3xjYDSrjgdn 3938FLYGcp9mphqVT0byeQMOk0c7RHpxrCSA0V5V6/CreFV2LteK50qcDQzDSM18vWP/ 3939p09FoN8O7QrtOeZJzH/lmwIDAQABo2YwZDAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0T 3940AQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQU2i83QHuEl/d0keXF+69HNJph7cMwHwYD 3941VR0jBBgwFoAUTgLurD72FchM7Sz1BcGPnIQISYMwDQYJKoZIhvcNAQELBQADggEB 3942ACqnH2VjApoDqoSQOky52QBwsGaj+xWYHW5Gm7EvCqvQuhWMkeBuD6YJmMvNyA9G 3943I2lh6/o+sUk/RIsbYbxPRdhNPTOgDR9zsNRw6qxaHztq/CEC+mxDCLa3O1hHBaDV 3944BmB3nCZb93BvO0EQSEk7aytKq/f+sjyxqOcs385gintdHGU9uM7gTZHnU9vByJsm 3945/TL07Miq67X0NlhIoo3jAk+xHaeKJdxdKATQp0448P5cY20q4b8aMk1twcNaMvCP 3946dG4M5doaoUA8OQ/0ukLLae/LBxLeTw04q1/a2SyFaVUX2Twbb1S3xVWwLA8vsyGr 3947igXx7B5GgP+IHb6DTjPJAi0= 3948-----END CERTIFICATE----- 3949`,`-----BEGIN CERTIFICATE----- 3950MIID/DCCAuSgAwIBAgIBTjANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx 3951EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3952GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 3953GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA4MTExOTU4NDVaFw0y 3954MDAzMDUxOTU4NDVaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3955bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3956cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 3957UyB1cy1lYXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCp 3958WnnUX7wM0zzstccX+4iXKJa9GR0a2PpvB1paEX4QRCgfhEdQWDaSqyrWNgdVCKkt 39591aQkWu5j6VAC2XIG7kKoonm1ZdBVyBLqW5lXNywlaiU9yhJkwo8BR+/OqgE+PLt/ 3960EO1mlN0PQudja/XkExCXTO29TG2j7F/O7hox6vTyHNHc0H88zS21uPuBE+jivViS 3961yzj/BkyoQ85hnkues3f9R6gCGdc+J51JbZnmgzUkvXjAEuKhAm9JksVOxcOKUYe5 3962ERhn0U9zjzpfbAITIkul97VVa5IxskFFTHIPJbvRKHJkiF6wTJww/tc9wm+fSCJ1 3963+DbQTGZgkQ3bJrqRN29/AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 3964Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBSAHQzUYYZbepwKEMvGdHp8wzHnfDAfBgNV 3965HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA 3966MbaEzSYZ+aZeTBxf8yi0ta8K4RdwEJsEmP6IhFFQHYUtva2Cynl4Q9tZg3RMsybT 39679mlnSQQlbN/wqIIXbkrcgFcHoXG9Odm/bDtUwwwDaiEhXVfeQom3G77QHOWMTCGK 3968qadwuh5msrb17JdXZoXr4PYHDKP7j0ONfAyFNER2+uecblHfRSpVq5UeF3L6ZJb8 3969fSw/GtAV6an+/0r+Qm+PiI2H5XuZ4GmRJYnGMhqWhBYrY7p3jtVnKcsh39wgfUnW 3970AvZEZG/yhFyAZW0Essa39LiL5VSq14Y1DOj0wgnhSY/9WHxaAo1HB1T9OeZknYbD 3971fl/EGSZ0TEvZkENrXcPlVA== 3972-----END CERTIFICATE----- 3973`,`-----BEGIN CERTIFICATE----- 3974MIID/zCCAuegAwIBAgIBTzANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx 3975EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 3976GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx
3977GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjA5MTUwMDEwMTFaFw0y 3978MDAzMDUwMDEwMTFaMIGSMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 3979bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 3980cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEjMCEGA1UEAwwaQW1hem9uIFJE 3981UyBjYS1jZW50cmFsLTEgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB 3982AQCZYI/iQ6DrS3ny3t1EwX1wAD+3LMgh7Fd01EW5LIuaK2kYIIQpsVKhxLCit/V5 3983AGc/1qiJS1Qz9ODLTh0Na6bZW6EakRzuHJLe32KJtoFYPC7Z09UqzXrpA/XL+1hM 3984P0ZmCWsU7Nn/EmvfBp9zX3dZp6P6ATrvDuYaVFr+SA7aT3FXpBroqBS1fyzUPs+W 3985c6zTR6+yc4zkHX0XQxC5RH6xjgpeRkoOajA/sNo7AQF7KlWmKHbdVF44cvvAhRKZ 3986XaoVs/C4GjkaAEPTCbopYdhzg+KLx9eB2BQnYLRrIOQZtRfbQI2Nbj7p3VsRuOW1 3987tlcks2w1Gb0YC6w6SuIMFkl1AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNV 3988HRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBToYWxE1lawl6Ks6NsvpbHQ3GKEtzAf 3989BgNVHSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOC 3990AQEAG/8tQ0ooi3hoQpa5EJz0/E5VYBsAz3YxA2HoIonn0jJyG16bzB4yZt4vNQMA 3991KsNlQ1uwDWYL1nz63axieUUFIxqxl1KmwfhsmLgZ0Hd2mnTPIl2Hw3uj5+wdgGBg 3992agnAZ0bajsBYgD2VGQbqjdk2Qn7Fjy3LEWIvGZx4KyZ99OJ2QxB7JOPdauURAtWA 3993DKYkP4LLJxtj07DSzG8kuRWb9B47uqUD+eKDIyjfjbnzGtd9HqqzYFau7EX3HVD9 39949Qhnjl7bTZ6YfAEZ3nH2t3Vc0z76XfGh47rd0pNRhMV+xpok75asKf/lNh5mcUrr 3995VKwflyMkQpSbDCmcdJ90N2xEXQ== 3996-----END CERTIFICATE----- 3997`,`-----BEGIN CERTIFICATE----- 3998MIID/DCCAuSgAwIBAgIBUDANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx 3999EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 4000GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 4001GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNjEwMTAxNzQ0NDJaFw0y 4002MDAzMDUxNzQ0NDJaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 4003bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 4004cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 4005UyBldS13ZXN0LTIgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDO 4006cttLJfubB4XMMIGWNfJISkIdCMGJyOzLiMJaiWB5GYoXKhEl7YGotpy0qklwW3BQ 4007a0fmVdcCLX+dIuVQ9iFK+ZcK7zwm7HtdDTCHOCKeOh2IcnU4c/VIokFi6Gn8udM6 4008N/Zi5M5OGpVwLVALQU7Yctsn3c95el6MdVx6mJiIPVu7tCVZn88Z2koBQ2gq9P4O 4009Sb249SHFqOb03lYDsaqy1NDsznEOhaRBw7DPJFpvmw1lA3/Y6qrExRI06H2VYR2i 40107qxwDV50N58fs10n7Ye1IOxTVJsgEA7X6EkRRXqYaM39Z76R894548WHfwXWjUsi 4011MEX0RS0/t1GmnUQjvevDAgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 4012Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBQBxmcuRSxERYCtNnSr5xNfySokHjAfBgNV 4013HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA 4014UyCUQjsF3nUAABjfEZmpksTuUo07aT3KGYt+EMMFdejnBQ0+2lJJFGtT+CDAk1SD 4015RSgfEBon5vvKEtlnTf9a3pv8WXOAkhfxnryr9FH6NiB8obISHNQNPHn0ljT2/T+I 4016Y6ytfRvKHa0cu3V0NXbJm2B4KEOt4QCDiFxUIX9z6eB4Kditwu05OgQh6KcogOiP 4017JesWxBMXXGoDC1rIYTFO7szwDyOHlCcVXJDNsTJhc32oDWYdeIbW7o/5I+aQsrXZ 4018C96HykZcgWzz6sElrQxUaT3IoMw/5nmw4uWKKnZnxgI9bY4fpQwMeBZ96iHfFxvH 4019mqfEEuC7uUoPofXdBp2ObQ== 4020-----END CERTIFICATE----- 4021`,`-----BEGIN CERTIFICATE----- 4022MIIECjCCAvKgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZMxCzAJBgNVBAYTAlVT 4023MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4024DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4025MSQwIgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwHhcNMTcwNTE5 4026MjIzMTE5WhcNMjIwNTE4MTIwMDAwWjCBkzELMAkGA1UEBhMCVVMxEzARBgNVBAgM 4027Cldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBX
4028ZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJDAiBgNVBAMM 4029G0FtYXpvbiBSRFMgdXMtZ292LXdlc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD 4030ggEPADCCAQoCggEBAM8YZLKAzzOdNnoi7Klih26Zkj+OCpDfwx4ZYB6f8L8UoQi5 40318z9ZtIwMjiJ/kO08P1yl4gfc7YZcNFvhGruQZNat3YNpxwUpQcr4mszjuffbL4uz 4032+/8FBxALdqCVOJ5Q0EVSfz3d9Bd1pUPL7ARtSpy7bn/tUPyQeI+lODYO906C0TQ3 4033b9bjOsgAdBKkHfjLdsknsOZYYIzYWOJyFJJa0B11XjDUNBy/3IuC0KvDl6At0V5b 40348M6cWcKhte2hgjwTYepV+/GTadeube1z5z6mWsN5arOAQUtYDLH6Aztq9mCJzLHm 4035RccBugnGl3fRLJ2VjioN8PoGoN9l9hFBy5fnFgsCAwEAAaNmMGQwDgYDVR0PAQH/ 4036BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEG7+br8KkvwPd5g 403771Rvh2stclJbMB8GA1UdIwQYMBaAFEkQz6S4NS5lOYKcDjBSuCcVpdzjMA0GCSqG 4038SIb3DQEBCwUAA4IBAQBMA327u5ABmhX+aPxljoIbxnydmAFWxW6wNp5+rZrvPig8 4039zDRqGQWWr7wWOIjfcWugSElYtf/m9KZHG/Z6+NG7nAoUrdcd1h/IQhb+lFQ2b5g9 4040sVzQv/H2JNkfZA8fL/Ko/Tm/f9tcqe0zrGCtT+5u0Nvz35Wl8CEUKLloS5xEb3k5 40417D9IhG3fsE3vHWlWrGCk1cKry3j12wdPG5cUsug0vt34u6rdhP+FsM0tHI15Kjch 4042RuUCvyQecy2ZFNAa3jmd5ycNdL63RWe8oayRBpQBxPPCbHfILxGZEdJbCH9aJ2D/ 4043l8oHIDnvOLdv7/cBjyYuvmprgPtu3QEkbre5Hln/ 4044-----END CERTIFICATE----- 4045`,`-----BEGIN CERTIFICATE----- 4046MIID/DCCAuSgAwIBAgIBUTANBgkqhkiG9w0BAQsFADCBijELMAkGA1UEBhMCVVMx 4047EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 4048GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 4049GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzA4MjUyMTM5MjZaFw0y 4050MDAzMDUyMTM5MjZaMIGPMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 4051bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 4052cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEgMB4GA1UEAwwXQW1hem9uIFJE 4053UyBldS13ZXN0LTMgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+ 4054xmlEC/3a4cJH+UPwXCE02lC7Zq5NHd0dn6peMeLN8agb6jW4VfSY0NydjRj2DJZ8 4055K7wV6sub5NUGT1NuFmvSmdbNR2T59KX0p2dVvxmXHHtIpQ9Y8Aq3ZfhmC5q5Bqgw 4056tMA1xayDi7HmoPX3R8kk9ktAZQf6lDeksCvok8idjTu9tiSpDiMwds5BjMsWfyjZ 4057d13PTGGNHYVdP692BSyXzSP1Vj84nJKnciW8tAqwIiadreJt5oXyrCXi8ekUMs80 4058cUTuGm3aA3Q7PB5ljJMPqz0eVddaiIvmTJ9O3Ez3Du/HpImyMzXjkFaf+oNXf/Hx 4059/EW5jCRR6vEiXJcDRDS7AgMBAAGjZjBkMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMB 4060Af8ECDAGAQH/AgEAMB0GA1UdDgQWBBRZ9mRtS5fHk3ZKhG20Oack4cAqMTAfBgNV 4061HSMEGDAWgBROAu6sPvYVyEztLPUFwY+chAhJgzANBgkqhkiG9w0BAQsFAAOCAQEA 4062F/u/9L6ExQwD73F/bhCw7PWcwwqsK1mypIdrjdIsu0JSgwWwGCXmrIspA3n3Dqxq 4063sMhAJD88s9Em7337t+naar2VyLO63MGwjj+vA4mtvQRKq8ScIpiEc7xN6g8HUMsd 4064gPG9lBGfNjuAZsrGJflrko4HyuSM7zHExMjXLH+CXcv/m3lWOZwnIvlVMa4x0Tz0 4065A4fklaawryngzeEjuW6zOiYCzjZtPlP8Fw0SpzppJ8VpQfrZ751RDo4yudmPqoPK 40665EUe36L8U+oYBXnC5TlYs9bpVv9o5wJQI5qA9oQE2eFWxF1E0AyZ4V5sgGUBStaX 4067BjDDWul0wSo7rt1Tq7XpnA== 4068-----END CERTIFICATE----- 4069`,`-----BEGIN CERTIFICATE----- 4070MIIEATCCAumgAwIBAgIBTjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UEBhMCVVMx 4071EzARBgNVBAgMCldhc2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoM 4072GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 4073GzAZBgNVBAMMEkFtYXpvbiBSRFMgUm9vdCBDQTAeFw0xNzEyMDEwMDU1NDJaFw0y 4074MDAzMDUwMDU1NDJaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2FzaGluZ3Rv 4075bjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNl 4076cywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1hem9uIFJE 4077UyBhcC1ub3J0aGVhc3QtMyBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 4078ggEBAMZtQNnm/XT19mTa10ftHLzg5UhajoI65JHv4TQNdGXdsv+CQdGYU49BJ9Eu 40793bYgiEtTzR2lQe9zGMvtuJobLhOWuavzp7IixoIQcHkFHN6wJ1CvqrxgvJfBq6Hy 4080EuCDCiU+PPDLUNA6XM6Qx3IpHd1wrJkjRB80dhmMSpxmRmx849uFafhN+P1QybsM 4081TI0o48VON2+vj+mNuQTyLMMP8D4odSQHjaoG+zyJfJGZeAyqQyoOUOFEyQaHC3TT 40823IDSNCQlpxb9LerbCoKu79WFBBq3CS5cYpg8/fsnV2CniRBFFUumBt5z4dhw9RJU 4083qlUXXO1ZyzpGd+c5v6FtrfXtnIUCAwEAAaNmMGQwDgYDVR0PAQH/BAQDAgEGMBIG 4084A1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFETv7ELNplYy/xTeIOInl6nzeiHg 4085MB8GA1UdIwQYMBaAFE4C7qw+9hXITO0s9QXBj5yECEmDMA0GCSqGSIb3DQEBBQUA 4086A4IBAQCpKxOQcd0tEKb3OtsOY8q/MPwTyustGk2Rt7t9G68idADp8IytB7M0SDRo 4087wWZqynEq7orQVKdVOanhEWksNDzGp0+FPAf/KpVvdYCd7ru3+iI+V4ZEp2JFdjuZ 4088Zz0PIjS6AgsZqE5Ri1J+NmfmjGZCPhsHnGZiBaenX6K5VRwwwmLN6xtoqrrfR5zL 4089QfBeeZNJG6KiM3R/DxJ5rAa6Fz+acrhJ60L7HprhB7SFtj1RCijau3+ZwiGmUOMr 4090yKlMv+VgmzSw7o4Hbxy1WVrA6zQsTHHSGf+vkQn2PHvnFMUEu/ZLbTDYFNmTLK91 4091K6o4nMsEvhBKgo4z7H1EqqxXhvN2 4092-----END CERTIFICATE----- 4093`,`-----BEGIN CERTIFICATE----- 4094MIIEDjCCAvagAwIBAgIJAMM61RQn3/kdMA0GCSqGSIb3DQEBCwUAMIGTMQswCQYD 4095VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi 4096MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h 4097em9uIFJEUzEkMCIGA1UEAwwbQW1hem9uIFJEUyBHb3ZDbG91ZCBSb290IENBMB4X 4098DTE3MDUxOTIyMjkxMVoXDTIyMDUxODIyMjkxMVowgZMxCzAJBgNVBAYTAlVTMRAw 4099DgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQKDBlB 4100bWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSQw 4101IgYDVQQDDBtBbWF6b24gUkRTIEdvdkNsb3VkIFJvb3QgQ0EwggEiMA0GCSqGSIb3 4102DQEBAQUAA4IBDwAwggEKAoIBAQDGS9bh1FGiJPT+GRb3C5aKypJVDC1H2gbh6n3u
4103j8cUiyMXfmm+ak402zdLpSYMaxiQ7oL/B3wEmumIpRDAsQrSp3B/qEeY7ipQGOfh 4104q2TXjXGIUjiJ/FaoGqkymHRLG+XkNNBtb7MRItsjlMVNELXECwSiMa3nJL2/YyHW 4105nTr1+11/weeZEKgVbCUrOugFkMXnfZIBSn40j6EnRlO2u/NFU5ksK5ak2+j8raZ7 4106xW7VXp9S1Tgf1IsWHjGZZZguwCkkh1tHOlHC9gVA3p63WecjrIzcrR/V27atul4m 4107tn56s5NwFvYPUIx1dbC8IajLUrepVm6XOwdQCfd02DmOyjWJAgMBAAGjYzBhMA4G 4108A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRJEM+kuDUu 4109ZTmCnA4wUrgnFaXc4zAfBgNVHSMEGDAWgBRJEM+kuDUuZTmCnA4wUrgnFaXc4zAN 4110BgkqhkiG9w0BAQsFAAOCAQEAcfA7uirXsNZyI2j4AJFVtOTKOZlQwqbyNducnmlg 4111/5nug9fAkwM4AgvF5bBOD1Hw6khdsccMwIj+1S7wpL+EYb/nSc8G0qe1p/9lZ/mZ 4112ff5g4JOa26lLuCrZDqAk4TzYnt6sQKfa5ZXVUUn0BK3okhiXS0i+NloMyaBCL7vk 4113kDwkHwEqflRKfZ9/oFTcCfoiHPA7AdBtaPVr0/Kj9L7k+ouz122huqG5KqX0Zpo8 4114S0IGvcd2FZjNSNPttNAK7YuBVsZ0m2nIH1SLp//00v7yAHIgytQwwB17PBcp4NXD 4115pCfTa27ng9mMMC2YLqWQpW4TkqjDin2ZC+5X/mbrjzTvVg== 4116-----END CERTIFICATE----- 4117`,`-----BEGIN CERTIFICATE----- 4118MIIEBzCCAu+gAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwgZQxCzAJBgNVBAYTAlVT 4119MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4120DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4121MSUwIwYDVQQDDBxBbWF6b24gUkRTIGFwLWVhc3QtMSBSb290IENBMB4XDTE5MDIx 4122NzAyNDcwMFoXDTIyMDYwMTEyMDAwMFowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQI 4123DApXYXNoaW5ndG9uMRAwDgYDVQQHDAdTZWF0dGxlMSIwIAYDVQQKDBlBbWF6b24g 4124V2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRTMSAwHgYDVQQD 4125DBdBbWF6b24gUkRTIGFwLWVhc3QtMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4126ADCCAQoCggEBAOcJAUofyJuBuPr5ISHi/Ha5ed8h3eGdzn4MBp6rytPOg9NVGRQs 4127O93fNGCIKsUT6gPuk+1f1ncMTV8Y0Fdf4aqGWme+Khm3ZOP3V1IiGnVq0U2xiOmn 4128SQ4Q7LoeQC4lC6zpoCHVJyDjZ4pAknQQfsXb77Togdt/tK5ahev0D+Q3gCwAoBoO 4129DHKJ6t820qPi63AeGbJrsfNjLKiXlFPDUj4BGir4dUzjEeH7/hx37na1XG/3EcxP 4130399cT5k7sY/CR9kctMlUyEEUNQOmhi/ly1Lgtihm3QfjL6K9aGLFNwX35Bkh9aL2 4131F058u+n8DP/dPeKUAcJKiQZUmzuen5n57x8CAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4132AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFlqgF4FQlb9yP6c+Q3E 4133O3tXv+zOMB8GA1UdIwQYMBaAFK9T6sY/PBZVbnHcNcQXf58P4OuPMA0GCSqGSIb3 4134DQEBCwUAA4IBAQDeXiS3v1z4jWAo1UvVyKDeHjtrtEH1Rida1eOXauFuEQa5tuOk 4135E53Os4haZCW4mOlKjigWs4LN+uLIAe1aFXGo92nGIqyJISHJ1L+bopx/JmIbHMCZ 41360lTNJfR12yBma5VQy7vzeFku/SisKwX0Lov1oHD4MVhJoHbUJYkmAjxorcIHORvh 4137I3Vj5XrgDWtLDPL8/Id/roul/L+WX5ir+PGScKBfQIIN2lWdZoqdsx8YWqhm/ikL 4138C6qNieSwcvWL7C03ri0DefTQMY54r5wP33QU5hJ71JoaZI3YTeT0Nf+NRL4hM++w 4139Q0veeNzBQXg1f/JxfeA39IDIX1kiCf71tGlT 4140-----END CERTIFICATE----- 4141`,`-----BEGIN CERTIFICATE----- 4142MIIEDDCCAvSgAwIBAgICcEUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4143MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4144DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4145MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNjU2 4146MjBaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4147aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4148ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h 4149em9uIFJEUyBhcC1ub3J0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF 4150AAOCAQ8AMIIBCgKCAQEAndtkldmHtk4TVQAyqhAvtEHSMb6pLhyKrIFved1WO3S7 4151+I+bWwv9b2W/ljJxLq9kdT43bhvzonNtI4a1LAohS6bqyirmk8sFfsWT3akb+4Sx 41521sjc8Ovc9eqIWJCrUiSvv7+cS7ZTA9AgM1PxvHcsqrcUXiK3Jd/Dax9jdZE1e15s 4153BEhb2OEPE+tClFZ+soj8h8Pl2Clo5OAppEzYI4LmFKtp1X/BOf62k4jviXuCSst3 4154UnRJzE/CXtjmN6oZySVWSe0rQYuyqRl6//9nK40cfGKyxVnimB8XrrcxUN743Vud 4155QQVU0Esm8OVTX013mXWQXJHP2c0aKkog8LOga0vobQIDAQABo2YwZDAOBgNVHQ8B 4156Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQULmoOS1mFSjj+ 4157snUPx4DgS3SkLFYwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ 4158KoZIhvcNAQELBQADggEBAAkVL2P1M2/G9GM3DANVAqYOwmX0Xk58YBHQu6iiQg4j 4159b4Ky/qsZIsgT7YBsZA4AOcPKQFgGTWhe9pvhmXqoN3RYltN8Vn7TbUm/ZVDoMsrM 4160gwv0+TKxW1/u7s8cXYfHPiTzVSJuOogHx99kBW6b2f99GbP7O1Sv3sLq4j6lVvBX 4161Fiacf5LAWC925nvlTzLlBgIc3O9xDtFeAGtZcEtxZJ4fnGXiqEnN4539+nqzIyYq 4162nvlgCzyvcfRAxwltrJHuuRu6Maw5AGcd2Y0saMhqOVq9KYKFKuD/927BTrbd2JVf 41632sGWyuPZPCk3gq+5pCjbD0c6DkhcMGI6WwxvM5V/zSM= 4164-----END CERTIFICATE----- 4165`,`-----BEGIN CERTIFICATE----- 4166MIIEDDCCAvSgAwIBAgICOFAwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4167MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4168DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4169MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAxNzQ2 4170MjFaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4171aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4172ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h 4173em9uIFJEUyBhcC1ub3J0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF 4174AAOCAQ8AMIIBCgKCAQEAzU72e6XbaJbi4HjJoRNjKxzUEuChKQIt7k3CWzNnmjc5 41758I1MjCpa2W1iw1BYVysXSNSsLOtUsfvBZxi/1uyMn5ZCaf9aeoA9UsSkFSZBjOCN 4176DpKPCmfV1zcEOvJz26+1m8WDg+8Oa60QV0ou2AU1tYcw98fOQjcAES0JXXB80P2s 41773UfkNcnDz+l4k7j4SllhFPhH6BQ4lD2NiFAP4HwoG6FeJUn45EPjzrydxjq6v5Fc 4178cQ8rGuHADVXotDbEhaYhNjIrsPL+puhjWfhJjheEw8c4whRZNp6gJ/b6WEes/ZhZ 4179h32DwsDsZw0BfRDUMgUn8TdecNexHUw8vQWeC181hwIDAQABo2YwZDAOBgNVHQ8B 4180Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwW9bWgkWkr0U 4181lrOsq2kvIdrECDgwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ 4182KoZIhvcNAQELBQADggEBAEugF0Gj7HVhX0ehPZoGRYRt3PBuI2YjfrrJRTZ9X5wc
41839T8oHmw07mHmNy1qqWvooNJg09bDGfB0k5goC2emDiIiGfc/kvMLI7u+eQOoMKj6 4184mkfCncyRN3ty08Po45vTLBFZGUvtQmjM6yKewc4sXiASSBmQUpsMbiHRCL72M5qV 4185obcJOjGcIdDTmV1BHdWT+XcjynsGjUqOvQWWhhLPrn4jWe6Xuxll75qlrpn3IrIx 4186CRBv/5r7qbcQJPOgwQsyK4kv9Ly8g7YT1/vYBlR3cRsYQjccw5ceWUj2DrMVWhJ4 4187prf+E3Aa4vYmLLOUUvKnDQ1k3RGNu56V0tonsQbfsaM= 4188-----END CERTIFICATE----- 4189`,`-----BEGIN CERTIFICATE----- 4190MIIEDDCCAvSgAwIBAgICOYIwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4191MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4192DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4193MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTcyMDA1 4194MjlaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4195aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4196ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h 4197em9uIFJEUyBhcC1ub3J0aGVhc3QtMyAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF 4198AAOCAQ8AMIIBCgKCAQEA4dMak8W+XW8y/2F6nRiytFiA4XLwePadqWebGtlIgyCS 4199kbug8Jv5w7nlMkuxOxoUeD4WhI6A9EkAn3r0REM/2f0aYnd2KPxeqS2MrtdxxHw1 4200xoOxk2x0piNSlOz6yog1idsKR5Wurf94fvM9FdTrMYPPrDabbGqiBMsZZmoHLvA3 4201Z+57HEV2tU0Ei3vWeGIqnNjIekS+E06KhASxrkNU5vi611UsnYZlSi0VtJsH4UGV 4202LhnHl53aZL0YFO5mn/fzuNG/51qgk/6EFMMhaWInXX49Dia9FnnuWXwVwi6uX1Wn 42037kjoHi5VtmC8ZlGEHroxX2DxEr6bhJTEpcLMnoQMqwIDAQABo2YwZDAOBgNVHQ8B 4204Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUsUI5Cb3SWB8+ 4205gv1YLN/ABPMdxSAwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ 4206KoZIhvcNAQELBQADggEBAJAF3E9PM1uzVL8YNdzb6fwJrxxqI2shvaMVmC1mXS+w 4207G0zh4v2hBZOf91l1EO0rwFD7+fxoI6hzQfMxIczh875T6vUXePKVOCOKI5wCrDad 4208zQbVqbFbdhsBjF4aUilOdtw2qjjs9JwPuB0VXN4/jY7m21oKEOcnpe36+7OiSPjN 4209xngYewCXKrSRqoj3mw+0w/+exYj3Wsush7uFssX18av78G+ehKPIVDXptOCP/N7W 42108iKVNeQ2QGTnu2fzWsGUSvMGyM7yqT+h1ILaT//yQS8er511aHMLc142bD4D9VSy 4211DgactwPDTShK/PXqhvNey9v/sKXm4XatZvwcc8KYlW4= 4212-----END CERTIFICATE----- 4213`,`-----BEGIN CERTIFICATE----- 4214MIIECDCCAvCgAwIBAgICVIYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4215MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4216DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4217MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDQxNzEz 4218MDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4219aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4220ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h 4221em9uIFJEUyBhcC1zb3V0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 4222DwAwggEKAoIBAQDUYOz1hGL42yUCrcsMSOoU8AeD/3KgZ4q7gP+vAz1WnY9K/kim 4223eWN/2Qqzlo3+mxSFQFyD4MyV3+CnCPnBl9Sh1G/F6kThNiJ7dEWSWBQGAB6HMDbC 4224BaAsmUc1UIz8sLTL3fO+S9wYhA63Wun0Fbm/Rn2yk/4WnJAaMZcEtYf6e0KNa0LM 4225p/kN/70/8cD3iz3dDR8zOZFpHoCtf0ek80QqTich0A9n3JLxR6g6tpwoYviVg89e 4226qCjQ4axxOkWWeusLeTJCcY6CkVyFvDAKvcUl1ytM5AiaUkXblE7zDFXRM4qMMRdt
4227lPm8d3pFxh0fRYk8bIKnpmtOpz3RIctDrZZxAgMBAAGjZjBkMA4GA1UdDwEB/wQE 4228AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBT99wKJftD3jb4sHoHG 4229i3uGlH6W6TAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG 42309w0BAQsFAAOCAQEAZ17hhr3dII3hUfuHQ1hPWGrpJOX/G9dLzkprEIcCidkmRYl+ 4231hu1Pe3caRMh/17+qsoEErmnVq5jNY9X1GZL04IZH8YbHc7iRHw3HcWAdhN8633+K 4232jYEB2LbJ3vluCGnCejq9djDb6alOugdLMJzxOkHDhMZ6/gYbECOot+ph1tQuZXzD 4233tZ7prRsrcuPBChHlPjmGy8M9z8u+kF196iNSUGC4lM8vLkHM7ycc1/ZOwRq9aaTe 4234iOghbQQyAEe03MWCyDGtSmDfr0qEk+CHN+6hPiaL8qKt4s+V9P7DeK4iW08ny8Ox 4235AVS7u0OK/5+jKMAMrKwpYrBydOjTUTHScocyNw== 4236-----END CERTIFICATE----- 4237`,`-----BEGIN CERTIFICATE----- 4238MIIEDDCCAvSgAwIBAgICY4kwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4239MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4240DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4241MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTMyMDEx 4242NDJaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4243aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4244ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h 4245em9uIFJEUyBhcC1zb3V0aGVhc3QtMSAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF 4246AAOCAQ8AMIIBCgKCAQEAr5u9OuLL/OF/fBNUX2kINJLzFl4DnmrhnLuSeSnBPgbb 4247qddjf5EFFJBfv7IYiIWEFPDbDG5hoBwgMup5bZDbas+ZTJTotnnxVJTQ6wlhTmns 4248eHECcg2pqGIKGrxZfbQhlj08/4nNAPvyYCTS0bEcmQ1emuDPyvJBYDDLDU6AbCB5 42496Z7YKFQPTiCBblvvNzchjLWF9IpkqiTsPHiEt21sAdABxj9ityStV3ja/W9BfgxH
4250wzABSTAQT6FbDwmQMo7dcFOPRX+hewQSic2Rn1XYjmNYzgEHisdUsH7eeXREAcTw 425161TRvaLH8AiOWBnTEJXPAe6wYfrcSd1pD0MXpoB62wIDAQABo2YwZDAOBgNVHQ8B 4252Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUytwMiomQOgX5 4253Ichd+2lDWRUhkikwHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ 4254KoZIhvcNAQELBQADggEBACf6lRDpfCD7BFRqiWM45hqIzffIaysmVfr+Jr+fBTjP 4255uYe/ba1omSrNGG23bOcT9LJ8hkQJ9d+FxUwYyICQNWOy6ejicm4z0C3VhphbTPqj 4256yjpt9nG56IAcV8BcRJh4o/2IfLNzC/dVuYJV8wj7XzwlvjysenwdrJCoLadkTr1h 4257eIdG6Le07sB9IxrGJL9e04afk37h7c8ESGSE4E+oS4JQEi3ATq8ne1B9DQ9SasXi 4258IRmhNAaISDzOPdyLXi9N9V9Lwe/DHcja7hgLGYx3UqfjhLhOKwp8HtoZORixAmOI 4259HfILgNmwyugAbuZoCazSKKBhQ0wgO0WZ66ZKTMG8Oho= 4260-----END CERTIFICATE----- 4261`,`-----BEGIN CERTIFICATE----- 4262MIIEDDCCAvSgAwIBAgICEkYwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4263MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4264DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4265MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxOTUz 4266NDdaFw0yNDA4MjIxNzA4NTBaMIGZMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4267aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4268ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEqMCgGA1UEAwwhQW1h 4269em9uIFJEUyBhcC1zb3V0aGVhc3QtMiAyMDE5IENBMIIBIjANBgkqhkiG9w0BAQEF 4270AAOCAQ8AMIIBCgKCAQEAufodI2Flker8q7PXZG0P0vmFSlhQDw907A6eJuF/WeMo 4271GHnll3b4S6nC3oRS3nGeRMHbyU2KKXDwXNb3Mheu+ox+n5eb/BJ17eoj9HbQR1cd 4272gEkIciiAltf8gpMMQH4anP7TD+HNFlZnP7ii3geEJB2GGXSxgSWvUzH4etL67Zmn 4273TpGDWQMB0T8lK2ziLCMF4XAC/8xDELN/buHCNuhDpxpPebhct0T+f6Arzsiswt2j 42747OeNeLLZwIZvVwAKF7zUFjC6m7/VmTQC8nidVY559D6l0UhhU0Co/txgq3HVsMOH 4275PbxmQUwJEKAzQXoIi+4uZzHFZrvov/nDTNJUhC6DqwIDAQABo2YwZDAOBgNVHQ8B 4276Af8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUwaZpaCme+EiV 4277M5gcjeHZSTgOn4owHwYDVR0jBBgwFoAUc19g2LzLA5j0Kxc0LjZapmD/vB8wDQYJ 4278KoZIhvcNAQELBQADggEBAAR6a2meCZuXO2TF9bGqKGtZmaah4pH2ETcEVUjkvXVz 4279sl+ZKbYjrun+VkcMGGKLUjS812e7eDF726ptoku9/PZZIxlJB0isC/0OyixI8N4M 4280NsEyvp52XN9QundTjkl362bomPnHAApeU0mRbMDRR2JdT70u6yAzGLGsUwMkoNnw 42811VR4XKhXHYGWo7KMvFrZ1KcjWhubxLHxZWXRulPVtGmyWg/MvE6KF+2XMLhojhUL 4282+9jB3Fpn53s6KMx5tVq1x8PukHmowcZuAF8k+W4gk8Y68wIwynrdZrKRyRv6CVtR 4283FZ8DeJgoNZT3y/GT254VqMxxfuy2Ccb/RInd16tEvVk= 4284-----END CERTIFICATE----- 4285`,`-----BEGIN CERTIFICATE----- 4286MIIECjCCAvKgAwIBAgICEzUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4287MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4288DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4289MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTAyMDUy 4290MjVaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4291aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4292ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h 4293em9uIFJEUyBjYS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD 4294ggEPADCCAQoCggEBAOxHqdcPSA2uBjsCP4DLSlqSoPuQ/X1kkJLusVRKiQE2zayB 4295viuCBt4VB9Qsh2rW3iYGM+usDjltGnI1iUWA5KHcvHszSMkWAOYWLiMNKTlg6LCp 4296XnE89tvj5dIH6U8WlDvXLdjB/h30gW9JEX7S8supsBSci2GxEzb5mRdKaDuuF/0O 4297qvz4YE04pua3iZ9QwmMFuTAOYzD1M72aOpj+7Ac+YLMM61qOtU+AU6MndnQkKoQi 4298qmUN2A9IFaqHFzRlSdXwKCKUA4otzmz+/N3vFwjb5F4DSsbsrMfjeHMo6o/nb6Nh 4299YDb0VJxxPee6TxSuN7CQJ2FxMlFUezcoXqwqXD0CAwEAAaNmMGQwDgYDVR0PAQH/ 4300BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFDGGpon9WfIpsggE 4301CxHq8hZ7E2ESMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG 4302SIb3DQEBCwUAA4IBAQAvpeQYEGZvoTVLgV9rd2+StPYykMsmFjWQcyn3dBTZRXC2 4303lKq7QhQczMAOhEaaN29ZprjQzsA2X/UauKzLR2Uyqc2qOeO9/YOl0H3qauo8C/W9 4304r8xqPbOCDLEXlOQ19fidXyyEPHEq5WFp8j+fTh+s8WOx2M7IuC0ANEetIZURYhSp 4305xl9XOPRCJxOhj7JdelhpweX0BJDNHeUFi0ClnFOws8oKQ7sQEv66d5ddxqqZ3NVv 4306RbCvCtEutQMOUMIuaygDlMn1anSM8N7Wndx8G6+Uy67AnhjGx7jw/0YPPxopEj6x 4307JXP8j0sJbcT9K/9/fPVLNT25RvQ/93T2+IQL4Ca2 4308-----END CERTIFICATE----- 4309`,`-----BEGIN CERTIFICATE----- 4310MIIECjCCAvKgAwIBAgICV2YwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4311MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4312DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4313MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExOTM2 4314MjBaFw0yNDA4MjIxNzA4NTBaMIGXMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4315aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4316ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEoMCYGA1UEAwwfQW1h 4317em9uIFJEUyBldS1jZW50cmFsLTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQAD 4318ggEPADCCAQoCggEBAMEx54X2pHVv86APA0RWqxxRNmdkhAyp2R1cFWumKQRofoFv 4319n+SPXdkpIINpMuEIGJANozdiEz7SPsrAf8WHyD93j/ZxrdQftRcIGH41xasetKGl 4320I67uans8d+pgJgBKGb/Z+B5m+UsIuEVekpvgpwKtmmaLFC/NCGuSsJoFsRqoa6Gh 4321m34W6yJoY87UatddCqLY4IIXaBFsgK9Q/wYzYLbnWM6ZZvhJ52VMtdhcdzeTHNW0 43225LGuXJOF7Ahb4JkEhoo6TS2c0NxB4l4MBfBPgti+O7WjR3FfZHpt18A6Zkq6A2u6
4323D/oTSL6c9/3sAaFTFgMyL3wHb2YlW0BPiljZIqECAwEAAaNmMGQwDgYDVR0PAQH/ 4324BAQDAgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFOcAToAc6skWffJa 4325TnreaswAfrbcMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqG 4326SIb3DQEBCwUAA4IBAQA1d0Whc1QtspK496mFWfFEQNegLh0a9GWYlJm+Htcj5Nxt 4327DAIGXb+8xrtOZFHmYP7VLCT5Zd2C+XytqseK/+s07iAr0/EPF+O2qcyQWMN5KhgE 4328cXw2SwuP9FPV3i+YAm11PBVeenrmzuk9NrdHQ7TxU4v7VGhcsd2C++0EisrmquWH 4329mgIfmVDGxphwoES52cY6t3fbnXmTkvENvR+h3rj+fUiSz0aSo+XZUGHPgvuEKM/W 4330CBD9Smc9CBoBgvy7BgHRgRUmwtABZHFUIEjHI5rIr7ZvYn+6A0O6sogRfvVYtWFc 4331qpyrW1YX8mD0VlJ8fGKM3G+aCOsiiPKDV/Uafrm+ 4332-----END CERTIFICATE----- 4333`,`-----BEGIN CERTIFICATE----- 4334MIIECDCCAvCgAwIBAgICGAcwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4335MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4336DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4337MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIxODE5 4338NDRaFw0yNDA4MjIxNzA4NTBaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4339aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4340ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzEmMCQGA1UEAwwdQW1h 4341em9uIFJEUyBldS1ub3J0aC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 4342DwAwggEKAoIBAQCiIYnhe4UNBbdBb/nQxl5giM0XoVHWNrYV5nB0YukA98+TPn9v 4343Aoj1RGYmtryjhrf01Kuv8SWO+Eom95L3zquoTFcE2gmxCfk7bp6qJJ3eHOJB+QUO 4344XsNRh76fwDzEF1yTeZWH49oeL2xO13EAx4PbZuZpZBttBM5zAxgZkqu4uWQczFEs 4345JXfla7z2fvWmGcTagX10O5C18XaFroV0ubvSyIi75ue9ykg/nlFAeB7O0Wxae88e 4346uhiBEFAuLYdqWnsg3459NfV8Yi1GnaitTym6VI3tHKIFiUvkSiy0DAlAGV2iiyJE 4347q+DsVEO4/hSINJEtII4TMtysOsYPpINqeEzRAgMBAAGjZjBkMA4GA1UdDwEB/wQE 4348AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBRR0UpnbQyjnHChgmOc 4349hnlc0PogzTAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG 43509w0BAQsFAAOCAQEAKJD4xVzSf4zSGTBJrmamo86jl1NHQxXUApAZuBZEc8tqC6TI 4351T5CeoSr9CMuVC8grYyBjXblC4OsM5NMvmsrXl/u5C9dEwtBFjo8mm53rOOIm1fxl 4352I1oYB/9mtO9ANWjkykuLzWeBlqDT/i7ckaKwalhLODsRDO73vRhYNjsIUGloNsKe 4353pxw3dzHwAZx4upSdEVG4RGCZ1D0LJ4Gw40OfD69hfkDfRVVxKGrbEzqxXRvovmDc 4354tKLdYZO/6REoca36v4BlgIs1CbUXJGLSXUwtg7YXGLSVBJ/U0+22iGJmBSNcoyUN 4355cjPFD9JQEhDDIYYKSGzIYpvslvGc4T5ISXFiuQ== 4356-----END CERTIFICATE----- 4357`,`-----BEGIN CERTIFICATE----- 4358MIIEBzCCAu+gAwIBAgICYpgwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4359MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4360DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4361MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTExNzMx 4362NDhaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4363aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4364ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h 4365em9uIFJEUyBldS13ZXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4366ADCCAQoCggEBAMk3YdSZ64iAYp6MyyKtYJtNzv7zFSnnNf6vv0FB4VnfITTMmOyZ 4367LXqKAT2ahZ00hXi34ewqJElgU6eUZT/QlzdIu359TEZyLVPwURflL6SWgdG01Q5X 4368O++7fSGcBRyIeuQWs9FJNIIqK8daF6qw0Rl5TXfu7P9dBc3zkgDXZm2DHmxGDD69 43697liQUiXzoE1q2Z9cA8+jirDioJxN9av8hQt12pskLQumhlArsMIhjhHRgF03HOh5 4370tvi+RCfihVOxELyIRTRpTNiIwAqfZxxTWFTgfn+gijTmd0/1DseAe82aYic8JbuS 4371EMbrDduAWsqrnJ4GPzxHKLXX0JasCUcWyMECAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4372AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPLtsq1NrwJXO13C9eHt 4373sLY11AGwMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3 4374DQEBCwUAA4IBAQAnWBKj5xV1A1mYd0kIgDdkjCwQkiKF5bjIbGkT3YEFFbXoJlSP 43750lZZ/hDaOHI8wbLT44SzOvPEEmWF9EE7SJzkvSdQrUAWR9FwDLaU427ALI3ngNHy 4376lGJ2hse1fvSRNbmg8Sc9GBv8oqNIBPVuw+AJzHTacZ1OkyLZrz1c1QvwvwN2a+Jd 4377vH0V0YIhv66llKcYDMUQJAQi4+8nbRxXWv6Gq3pvrFoorzsnkr42V3JpbhnYiK+9 4378nRKd4uWl62KRZjGkfMbmsqZpj2fdSWMY1UGyN1k+kDmCSWYdrTRDP0xjtIocwg+A 4379J116n4hV/5mbA0BaPiS2krtv17YAeHABZcvz 4380-----END CERTIFICATE----- 4381`,`-----BEGIN CERTIFICATE----- 4382MIIEBzCCAu+gAwIBAgICZIEwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4383MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4384DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4385MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTIyMTMy 4386MzJaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4387aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4388ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h 4389em9uIFJEUyBldS13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4390ADCCAQoCggEBALGiwqjiF7xIjT0Sx7zB3764K2T2a1DHnAxEOr+/EIftWKxWzT3u 4391PFwS2eEZcnKqSdRQ+vRzonLBeNLO4z8aLjQnNbkizZMBuXGm4BqRm1Kgq3nlLDQn 43927YqdijOq54SpShvR/8zsO4sgMDMmHIYAJJOJqBdaus2smRt0NobIKc0liy7759KB 43936kmQ47Gg+kfIwxrQA5zlvPLeQImxSoPi9LdbRoKvu7Iot7SOa+jGhVBh3VdqndJX 43947tm/saj4NE375csmMETFLAOXjat7zViMRwVorX4V6AzEg1vkzxXpA9N7qywWIT5Y
4395fYaq5M8i6vvLg0CzrH9fHORtnkdjdu1y+0MCAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4396AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFOhOx1yt3Z7mvGB9jBv 43972ymdZwiOMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3 4398DQEBCwUAA4IBAQBehqY36UGDvPVU9+vtaYGr38dBbp+LzkjZzHwKT1XJSSUc2wqM 4399hnCIQKilonrTIvP1vmkQi8qHPvDRtBZKqvz/AErW/ZwQdZzqYNFd+BmOXaeZWV0Q 4400oHtDzXmcwtP8aUQpxN0e1xkWb1E80qoy+0uuRqb/50b/R4Q5qqSfJhkn6z8nwB10 44017RjLtJPrK8igxdpr3tGUzfAOyiPrIDncY7UJaL84GFp7WWAkH0WG3H8Y8DRcRXOU 4402mqDxDLUP3rNuow3jnGxiUY+gGX5OqaZg4f4P6QzOSmeQYs6nLpH0PiN00+oS1BbD 4403bpWdZEttILPI+vAYkU4QuBKKDjJL6HbSd+cn 4404-----END CERTIFICATE----- 4405`,`-----BEGIN CERTIFICATE----- 4406MIIEBzCCAu+gAwIBAgICJDQwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4407MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4408DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4409MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTgxNzAz 4410MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4411aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4412ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h 4413em9uIFJEUyBldS13ZXN0LTMgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4414ADCCAQoCggEBAL9bL7KE0n02DLVtlZ2PL+g/BuHpMYFq2JnE2RgompGurDIZdjmh 44151pxfL3nT+QIVMubuAOy8InRfkRxfpxyjKYdfLJTPJG+jDVL+wDcPpACFVqoV7Prg 4416pVYEV0lc5aoYw4bSeYFhdzgim6F8iyjoPnObjll9mo4XsHzSoqJLCd0QC+VG9Fw2 4417q+GDRZrLRmVM2oNGDRbGpGIFg77aRxRapFZa8SnUgs2AqzuzKiprVH5i0S0M6dWr 4418i+kk5epmTtkiDHceX+dP/0R1NcnkCPoQ9TglyXyPdUdTPPRfKCq12dftqll+u4mV 4419ARdN6WFjovxax8EAP2OAUTi1afY+1JFMj+sCAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4420AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFLfhrbrO5exkCVgxW0x3 4421Y2mAi8lNMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3 4422DQEBCwUAA4IBAQAigQ5VBNGyw+OZFXwxeJEAUYaXVoP/qrhTOJ6mCE2DXUVEoJeV 4423SxScy/TlFA9tJXqmit8JH8VQ/xDL4ubBfeMFAIAo4WzNWDVoeVMqphVEcDWBHsI1 4424AETWzfsapRS9yQekOMmxg63d/nV8xewIl8aNVTHdHYXMqhhik47VrmaVEok1UQb3 4425O971RadLXIEbVd9tjY5bMEHm89JsZDnDEw1hQXBb67Elu64OOxoKaHBgUH8AZn/2 4426zFsL1ynNUjOhCSAA15pgd1vjwc0YsBbAEBPcHBWYBEyME6NLNarjOzBl4FMtATSF 4427wWCKRGkvqN8oxYhwR2jf2rR5Mu4DWkK5Q8Ep 4428-----END CERTIFICATE----- 4429`,`-----BEGIN CERTIFICATE----- 4430MIIEEjCCAvqgAwIBAgIJANew34ehz5l8MA0GCSqGSIb3DQEBCwUAMIGVMQswCQYD 4431VQQGEwJVUzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEi 4432MCAGA1UECgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1h 4433em9uIFJEUzEmMCQGA1UEAwwdQW1hem9uIFJEUyBtZS1zb3V0aC0xIFJvb3QgQ0Ew 4434HhcNMTkwNTEwMjE0ODI3WhcNMjQwNTA4MjE0ODI3WjCBlTELMAkGA1UEBhMCVVMx 4435EDAOBgNVBAcMB1NlYXR0bGUxEzARBgNVBAgMCldhc2hpbmd0b24xIjAgBgNVBAoM 4436GUFtYXpvbiBXZWIgU2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMx 4437JjAkBgNVBAMMHUFtYXpvbiBSRFMgbWUtc291dGgtMSBSb290IENBMIIBIjANBgkq 4438hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp7BYV88MukcY+rq0r79+C8UzkT30fEfT 4439aPXbx1d6M7uheGN4FMaoYmL+JE1NZPaMRIPTHhFtLSdPccInvenRDIatcXX+jgOk 4440UA6lnHQ98pwN0pfDUyz/Vph4jBR9LcVkBbe0zdoKKp+HGbMPRU0N2yNrog9gM5O8 4441gkU/3O2csJ/OFQNnj4c2NQloGMUpEmedwJMOyQQfcUyt9CvZDfIPNnheUS29jGSw 4442ERpJe/AENu8Pxyc72jaXQuD+FEi2Ck6lBkSlWYQFhTottAeGvVFNCzKszCntrtqd 4443rdYUwurYsLTXDHv9nW2hfDUQa0mhXf9gNDOBIVAZugR9NqNRNyYLHQIDAQABo2Mw 4444YTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU54cf 4445DjgwBx4ycBH8+/r8WXdaiqYwHwYDVR0jBBgwFoAU54cfDjgwBx4ycBH8+/r8WXda 4446iqYwDQYJKoZIhvcNAQELBQADggEBAIIMTSPx/dR7jlcxggr+O6OyY49Rlap2laKA 4447eC/XI4ySP3vQkIFlP822U9Kh8a9s46eR0uiwV4AGLabcu0iKYfXjPkIprVCqeXV7 4448ny9oDtrbflyj7NcGdZLvuzSwgl9SYTJp7PVCZtZutsPYlbJrBPHwFABvAkMvRtDB 4449hitIg4AESDGPoCl94sYHpfDfjpUDMSrAMDUyO6DyBdZH5ryRMAs3lGtsmkkNUrso 4450aTW6R05681Z0mvkRdb+cdXtKOSuDZPoe2wJJIaz3IlNQNSrB5TImMYgmt6iAsFhv 44513vfTSTKrZDNTJn4ybG6pq1zWExoXsktZPylJly6R3RBwV6nwqBM= 4452-----END CERTIFICATE----- 4453`,`-----BEGIN CERTIFICATE----- 4454MIIEBzCCAu+gAwIBAgICQ2QwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4455MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4456DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4457MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MDUxODQ2 4458MjlaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4459aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4460ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h 4461em9uIFJEUyBzYS1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4462ADCCAQoCggEBAMMvR+ReRnOzqJzoaPipNTt1Z2VA968jlN1+SYKUrYM3No+Vpz0H
4463M6Tn0oYB66ByVsXiGc28ulsqX1HbHsxqDPwvQTKvO7SrmDokoAkjJgLocOLUAeld 44645AwvUjxGRP6yY90NV7X786MpnYb2Il9DIIaV9HjCmPt+rjy2CZjS0UjPjCKNfB8J 4465bFjgW6GGscjeyGb/zFwcom5p4j0rLydbNaOr9wOyQrtt3ZQWLYGY9Zees/b8pmcc 4466Jt+7jstZ2UMV32OO/kIsJ4rMUn2r/uxccPwAc1IDeRSSxOrnFKhW3Cu69iB3bHp7 4467JbawY12g7zshE4I14sHjv3QoXASoXjx4xgMCAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4468AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFI1Fc/Ql2jx+oJPgBVYq 4469ccgP0pQ8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3 4470DQEBCwUAA4IBAQB4VVVabVp70myuYuZ3vltQIWqSUMhkaTzehMgGcHjMf9iLoZ/I 447193KiFUSGnek5cRePyS9wcpp0fcBT3FvkjpUdCjVtdttJgZFhBxgTd8y26ImdDDMR 44724+BUuhI5msvjL08f+Vkkpu1GQcGmyFVPFOy/UY8iefu+QyUuiBUnUuEDd49Hw0Fn 4473/kIPII6Vj82a2mWV/Q8e+rgN8dIRksRjKI03DEoP8lhPlsOkhdwU6Uz9Vu6NOB2Q 4474Ls1kbcxAc7cFSyRVJEhh12Sz9d0q/CQSTFsVJKOjSNQBQfVnLz1GwO/IieUEAr4C 4475jkTntH0r1LX5b/GwN4R887LvjAEdTbg1his7 4476-----END CERTIFICATE----- 4477`,`-----BEGIN CERTIFICATE----- 4478MIIEBzCCAu+gAwIBAgICJVUwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4479MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4480DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4481MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTkxODE2 4482NTNaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4483aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4484ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h 4485em9uIFJEUyB1cy1lYXN0LTEgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4486ADCCAQoCggEBAM3i/k2u6cqbMdcISGRvh+m+L0yaSIoOXjtpNEoIftAipTUYoMhL 4487InXGlQBVA4shkekxp1N7HXe1Y/iMaPEyb3n+16pf3vdjKl7kaSkIhjdUz3oVUEYt 4488i8Z/XeJJ9H2aEGuiZh3kHixQcZczn8cg3dA9aeeyLSEnTkl/npzLf//669Ammyhs 4489XcAo58yvT0D4E0D/EEHf2N7HRX7j/TlyWvw/39SW0usiCrHPKDLxByLojxLdHzso 4490QIp/S04m+eWn6rmD+uUiRteN1hI5ncQiA3wo4G37mHnUEKo6TtTUh+sd/ku6a8HK 4491glMBcgqudDI90s1OpuIAWmuWpY//8xEG2YECAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4492AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFPqhoWZcrVY9mU7tuemR 4493RBnQIj1jMB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3 4494DQEBCwUAA4IBAQB6zOLZ+YINEs72heHIWlPZ8c6WY8MDU+Be5w1M+BK2kpcVhCUK 4495PJO4nMXpgamEX8DIiaO7emsunwJzMSvavSPRnxXXTKIc0i/g1EbiDjnYX9d85DkC 4496E1LaAUCmCZBVi9fIe0H2r9whIh4uLWZA41oMnJx/MOmo3XyMfQoWcqaSFlMqfZM4 44970rNoB/tdHLNuV4eIdaw2mlHxdWDtF4oH+HFm+2cVBUVC1jXKrFv/euRVtsTT+A6i 4498h2XBHKxQ1Y4HgAn0jACP2QSPEmuoQEIa57bEKEcZsBR8SDY6ZdTd2HLRIApcCOSF 4499MRM8CKLeF658I0XgF8D5EsYoKPsA+74Z+jDH 4500-----END CERTIFICATE----- 4501`,`-----BEGIN CERTIFICATE----- 4502MIIECDCCAvCgAwIBAgIDAIVCMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV 4503UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE 4504CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE 4505UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTEzMTcw 4506NjQxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh 4507c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg 4508U2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJTAjBgNVBAMMHEFt 4509YXpvbiBSRFMgdXMtZWFzdC0yIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 4510DwAwggEKAoIBAQDE+T2xYjUbxOp+pv+gRA3FO24+1zCWgXTDF1DHrh1lsPg5k7ht 45112KPYzNc+Vg4E+jgPiW0BQnA6jStX5EqVh8BU60zELlxMNvpg4KumniMCZ3krtMUC 4512au1NF9rM7HBh+O+DYMBLK5eSIVt6lZosOb7bCi3V6wMLA8YqWSWqabkxwN4w0vXI 45138lu5uXXFRemHnlNf+yA/4YtN4uaAyd0ami9+klwdkZfkrDOaiy59haOeBGL8EB/c 4514dbJJlguHH5CpCscs3RKtOOjEonXnKXldxarFdkMzi+aIIjQ8GyUOSAXHtQHb3gZ4 4515nS6Ey0CMlwkB8vUObZU9fnjKJcL5QCQqOfwvAgMBAAGjZjBkMA4GA1UdDwEB/wQE 4516AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBQUPuRHohPxx4VjykmH 45176usGrLL1ETAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG 45189w0BAQsFAAOCAQEAUdR9Vb3y33Yj6X6KGtuthZ08SwjImVQPtknzpajNE5jOJAh8 4519quvQnU9nlnMO85fVDU1Dz3lLHGJ/YG1pt1Cqq2QQ200JcWCvBRgdvH6MjHoDQpqZ 4520HvQ3vLgOGqCLNQKFuet9BdpsHzsctKvCVaeBqbGpeCtt3Hh/26tgx0rorPLw90A2 4521V8QSkZJjlcKkLa58N5CMM8Xz8KLWg3MZeT4DmlUXVCukqK2RGuP2L+aME8dOxqNv 4522OnOz1zrL5mR2iJoDpk8+VE/eBDmJX40IJk6jBjWoxAO/RXq+vBozuF5YHN1ujE92 4523tO8HItgTp37XT8bJBAiAnt5mxw+NLSqtxk2QdQ== 4524-----END CERTIFICATE----- 4525`,`-----BEGIN CERTIFICATE----- 4526MIIECDCCAvCgAwIBAgIDAIkHMA0GCSqGSIb3DQEBCwUAMIGPMQswCQYDVQQGEwJV 4527UzEQMA4GA1UEBwwHU2VhdHRsZTETMBEGA1UECAwKV2FzaGluZ3RvbjEiMCAGA1UE 4528CgwZQW1hem9uIFdlYiBTZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJE 4529UzEgMB4GA1UEAwwXQW1hem9uIFJEUyBSb290IDIwMTkgQ0EwHhcNMTkwOTA2MTc0 4530MDIxWhcNMjQwODIyMTcwODUwWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldh 4531c2hpbmd0b24xEDAOBgNVBAcMB1NlYXR0bGUxIjAgBgNVBAoMGUFtYXpvbiBXZWIg 4532U2VydmljZXMsIEluYy4xEzARBgNVBAsMCkFtYXpvbiBSRFMxJTAjBgNVBAMMHEFt
4533YXpvbiBSRFMgdXMtd2VzdC0xIDIwMTkgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IB 4534DwAwggEKAoIBAQDD2yzbbAl77OofTghDMEf624OvU0eS9O+lsdO0QlbfUfWa1Kd6 45350WkgjkLZGfSRxEHMCnrv4UPBSK/Qwn6FTjkDLgemhqBtAnplN4VsoDL+BkRX4Wwq 4536/dSQJE2b+0hm9w9UMVGFDEq1TMotGGTD2B71eh9HEKzKhGzqiNeGsiX4VV+LJzdH 4537uM23eGisNqmd4iJV0zcAZ+Gbh2zK6fqTOCvXtm7Idccv8vZZnyk1FiWl3NR4WAgK 4538AkvWTIoFU3Mt7dIXKKClVmvssG8WHCkd3Xcb4FHy/G756UZcq67gMMTX/9fOFM/v 4539l5C0+CHl33Yig1vIDZd+fXV1KZD84dEJfEvHAgMBAAGjZjBkMA4GA1UdDwEB/wQE 4540AwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBR+ap20kO/6A7pPxo3+ 4541T3CfqZpQWjAfBgNVHSMEGDAWgBRzX2DYvMsDmPQrFzQuNlqmYP+8HzANBgkqhkiG 45429w0BAQsFAAOCAQEAHCJky2tPjPttlDM/RIqExupBkNrnSYnOK4kr9xJ3sl8UF2DA 4543PAnYsjXp3rfcjN/k/FVOhxwzi3cXJF/2Tjj39Bm/OEfYTOJDNYtBwB0VVH4ffa/6 4544tZl87jaIkrxJcreeeHqYMnIxeN0b/kliyA+a5L2Yb0VPjt9INq34QDc1v74FNZ17 45454z8nr1nzg4xsOWu0Dbjo966lm4nOYIGBRGOKEkHZRZ4mEiMgr3YLkv8gSmeitx57 4546Z6dVemNtUic/LVo5Iqw4n3TBS0iF2C1Q1xT/s3h+0SXZlfOWttzSluDvoMv5PvCd 4547pFjNn+aXLAALoihL1MJSsxydtsLjOBro5eK0Vw== 4548-----END CERTIFICATE----- 4549`,`-----BEGIN CERTIFICATE----- 4550MIIEBzCCAu+gAwIBAgICUYkwDQYJKoZIhvcNAQELBQAwgY8xCzAJBgNVBAYTAlVT 4551MRAwDgYDVQQHDAdTZWF0dGxlMRMwEQYDVQQIDApXYXNoaW5ndG9uMSIwIAYDVQQK 4552DBlBbWF6b24gV2ViIFNlcnZpY2VzLCBJbmMuMRMwEQYDVQQLDApBbWF6b24gUkRT 4553MSAwHgYDVQQDDBdBbWF6b24gUkRTIFJvb3QgMjAxOSBDQTAeFw0xOTA5MTYxODIx 4554MTVaFw0yNDA4MjIxNzA4NTBaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECAwKV2Fz 4555aGluZ3RvbjEQMA4GA1UEBwwHU2VhdHRsZTEiMCAGA1UECgwZQW1hem9uIFdlYiBT 4556ZXJ2aWNlcywgSW5jLjETMBEGA1UECwwKQW1hem9uIFJEUzElMCMGA1UEAwwcQW1h 4557em9uIFJEUyB1cy13ZXN0LTIgMjAxOSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP 4558ADCCAQoCggEBANCEZBZyu6yJQFZBJmSUZfSZd3Ui2gitczMKC4FLr0QzkbxY+cLa 4559uVONIOrPt4Rwi+3h/UdnUg917xao3S53XDf1TDMFEYp4U8EFPXqCn/GXBIWlU86P 4560PvBN+gzw3nS+aco7WXb+woTouvFVkk8FGU7J532llW8o/9ydQyDIMtdIkKTuMfho 4561OiNHSaNc+QXQ32TgvM9A/6q7ksUoNXGCP8hDOkSZ/YOLiI5TcdLh/aWj00ziL5bj 4562pvytiMZkilnc9dLY9QhRNr0vGqL0xjmWdoEXz9/OwjmCihHqJq+20MJPsvFm7D6a 45632NKybR9U+ddrjb8/iyLOjURUZnj5O+2+OPcCAwEAAaNmMGQwDgYDVR0PAQH/BAQD 4564AgEGMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFEBxMBdv81xuzqcK5TVu 4565pHj+Aor8MB8GA1UdIwQYMBaAFHNfYNi8ywOY9CsXNC42WqZg/7wfMA0GCSqGSIb3 4566DQEBCwUAA4IBAQBZkfiVqGoJjBI37aTlLOSjLcjI75L5wBrwO39q+B4cwcmpj58P 45673sivv+jhYfAGEbQnGRzjuFoyPzWnZ1DesRExX+wrmHsLLQbF2kVjLZhEJMHF9eB7 4568GZlTPdTzHErcnuXkwA/OqyXMpj9aghcQFuhCNguEfnROY9sAoK2PTfnTz9NJHL+Q 4569UpDLEJEUfc0GZMVWYhahc0x38ZnSY2SKacIPECQrTI0KpqZv/P+ijCEcMD9xmYEb 4570jL4en+XKS1uJpw5fIU5Sj0MxhdGstH6S84iAE5J3GM3XHklGSFwwqPYvuTXvANH6 4571uboynxRgSae59jIlAK6Jrr6GWMwQRbgcaAlW 4572-----END CERTIFICATE----- 4573`]}}(uR)),uR}var dR,Yk;function $O(){if(Yk)return dR;Yk=1;var t=ir.parse,i=vE(),r=Jj(),n=null;dR=a;function a(s){typeof s=="string"&&(s=a.parseUrl(s)),this.host=s.host||"localhost",this.port=s.port||3306,this.localAddress=s.localAddress,this.socketPath=s.socketPath,this.user=s.user||void 0,this.password=s.password||void 0,this.database=s.database,this.connectTimeout=s.connectTimeout===void 0?10*1e3:s.connectTimeout,this.insecureAuth=s.insecureAuth||!1,this.supportBigNumbers=s.supportBigNumbers||!1,this.bigNumberStrings=s.bigNumberStrings||!1,this.dateStrings=s.dateStrings||!1,this.debug=s.debug,this.trace=s.trace!==!1,this.stringifyObjects=s.stringifyObjects||!1,this.timezone=s.timezone||"local",this.flags=s.flags||"",this.queryFormat=s.queryFormat,this.pool=s.pool||void 0,this.ssl=typeof s.ssl=="string"?a.getSSLProfile(s.ssl):s.ssl||!1,this.localInfile=s.localInfile===void 0?!0:s.localInfile,this.multipleStatements=s.multipleStatements||!1,this.typeCast=s.typeCast===void 0?!0:s.typeCast,this.timezone[0]===" "&&(this.timezone="+"+this.timezone.substr(1)),this.ssl&&(this.ssl.rejectUnauthorized=this.ssl.rejectUnauthorized!==!1),this.maxPacketSize=0,this.charsetNumber=s.charset?a.getCharsetNumber(s.charset):s.charsetNumber||r.UTF8_GENERAL_CI;var o=a.getDefaultFlags(s);this.clientFlags=a.mergeFlags(o,s.flags)}return a.mergeFlags=function(o,l){var c=a.parseFlagList(o),h=a.parseFlagList(l);for(var u in h)c[u]!==!1&&(c[u]=h[u]);var d=0;for(var u in c)c[u]&&(d|=i["CLIENT_"+u]||0);return d},a.getCharsetNumber=function(o){var l=r[o.toUpperCase()];if(l===void 0)throw new TypeError("Unknown charset '"+o+"'");return l},a.getDefaultFlags=function(o){var l=["-COMPRESS","-CONNECT_ATTRS","+CONNECT_WITH_DB","+FOUND_ROWS","+IGNORE_SIGPIPE","+IGNORE_SPACE","+LOCAL_FILES","+LONG_FLAG","+LONG_PASSWORD","+MULTI_RESULTS","+ODBC","-PLUGIN_AUTH","+PROTOCOL_41","+PS_MULTI_RESULTS","+RESERVED","+SECURE_CONNECTION","+TRANSACTIONS"];return o&&o.localInfile!==void 0&&!o.localInfile&&l.push("-LOCAL_FILES"),o&&o.multipleStatements&&l.push("+MULTI_STATEMENTS"),l},a.getSSLProfile=function(o){n||(n=jde());var l=n[o];if(l===void 0)throw new TypeError("Unknown SSL profile '"+o+"'");return l},a.parseFlagList=function(o){var l=Object.create(null);if(!o)return l;for(var c=Array.isArray(o)?o:String(o||"").toUpperCase().split(/\s*,+\s*/),h=0;h<c.length;h++){var u=c[h],d=1,A=u[0];A!==void 0&&(A!=="-"&&A!=="+"&&(d=0,A="+"),l[u.substr(d)]=A==="+")}return l},a.parseUrl=function(s){s=t(s,!0);var o={host:s.hostname,port:s.port,database:s.pathname.substr(1)};if(s.auth){var l=s.auth.split(":");o.user=l.shift(),o.password=l.join(":")}
vendor: 4,606 bytes, line 4573
4573if(s.query)for(var c in s.query){var h=s.query[c];try{o[c]=JSON.parse(h)}catch{o[c]=h}}return o},dR}var AR,Kk;function Yde(){if(Kk)return AR;Kk=1,AR=t;function t(i,r){this.length=i,this.number=r}return AR}var fR={exports:{}},Xk;function Kde(){return Xk||(Xk=1,function(t){(function(i){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,s=Math.floor,o="[BigNumber Error] ",l=o+"Number primitive has more than 15 significant digits: ",c=1e14,h=14,u=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],A=1e7,f=1e9;function m(E){var M,S,T,C=te.prototype={constructor:te,toString:null,valueOf:null},x=new te(1),R=20,L=4,I=-7,F=21,Y=-1e7,D=1e7,U=!1,j=1,J=0,z={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"Â ",suffix:""},$="0123456789abcdefghijklmnopqrstuvwxyz";function te(N,k){var Z,V,re,Ae,pe,ce,_e,me,le=this;if(!(le instanceof te))return new te(N,k);if(k==null){if(N&&N._isBigNumber===!0){le.s=N.s,!N.c||N.e>D?le.c=le.e=null:N.e<Y?le.c=[le.e=0]:(le.e=N.e,le.c=N.c.slice());return}if((ce=typeof N=="number")&&N*0==0){if(le.s=1/N<0?(N=-N,-1):1,N===~~N){for(Ae=0,pe=N;pe>=10;pe/=10,Ae++);Ae>D?le.c=le.e=null:(le.e=Ae,le.c=[N]);return}me=String(N)}else{if(!n.test(me=String(N)))return T(le,me,ce);le.s=me.charCodeAt(0)==45?(me=me.slice(1),-1):1}(Ae=me.indexOf("."))>-1&&(me=me.replace(".","")),(pe=me.search(/e/i))>0?(Ae<0&&(Ae=pe),Ae+=+me.slice(pe+1),me=me.substring(0,pe)):Ae<0&&(Ae=me.length)}else{if(_(k,2,$.length,"Base"),k==10)return le=new te(N),K(le,R+le.e+1,L);if(me=String(N),ce=typeof N=="number"){if(N*0!=0)return T(le,me,ce,k);if(le.s=1/N<0?(me=me.slice(1),-1):1,te.DEBUG&&me.replace(/^0\.0*|\./,"").length>15)throw Error(l+N)}else le.s=me.charCodeAt(0)===45?(me=me.slice(1),-1):1;for(Z=$.slice(0,k),Ae=pe=0,_e=me.length;pe<_e;pe++)if(Z.indexOf(V=me.charAt(pe))<0){if(V=="."){if(pe>Ae){Ae=_e;continue}}else if(!re&&(me==me.toUpperCase()&&(me=me.toLowerCase())||me==me.toLowerCase()&&(me=me.toUpperCase()))){re=!0,pe=-1,Ae=0;continue}return T(le,String(N),ce,k)}ce=!1,me=S(me,k,10,le.s),(Ae=me.indexOf("."))>-1?me=me.replace(".",""):Ae=me.length}for(pe=0;me.charCodeAt(pe)===48;pe++);for(_e=me.length;me.charCodeAt(--_e)===48;);if(me=me.slice(pe,++_e)){if(_e-=pe,ce&&te.DEBUG&&_e>15&&(N>u||N!==s(N)))throw Error(l+le.s*N);if((Ae=Ae-pe-1)>D)le.c=le.e=null;else if(Ae<Y)le.c=[le.e=0];else{if(le.e=Ae,le.c=[],pe=(Ae+1)%h,Ae<0&&(pe+=h),pe<_e){for(pe&&le.c.push(+me.slice(0,pe)),_e-=h;pe<_e;)le.c.push(+me.slice(pe,pe+=h));pe=h-(me=me.slice(pe)).length}else pe-=_e;for(;pe--;me+="0");le.c.push(+me)}}else le.c=[le.e=0]}te.clone=m,te.ROUND_UP=0,te.ROUND_DOWN=1,te.ROUND_CEIL=2,te.ROUND_FLOOR=3,te.ROUND_HALF_UP=4,te.ROUND_HALF_DOWN=5,te.ROUND_HALF_EVEN=6,te.ROUND_HALF_CEIL=7,te.ROUND_HALF_FLOOR=8,te.EUCLID=9,te.config=te.set=function(N){var k,Z;if(N!=null)if(typeof N=="object"){if(N.hasOwnProperty(k="DECIMAL_PLACES")&&(Z=N[k],_(Z,0,f,k),R=Z),N.hasOwnProperty(k="ROUNDING_MODE")&&(Z=N[k],_(Z,0,8,k),L=Z),N.hasOwnProperty(k="EXPONENTIAL_AT")&&(Z=N[k],Z&&Z.pop?(_(Z[0],-f,0,k),_(Z[1],0,f,k),I=Z[0],F=Z[1]):(_(Z,-f,f,k),I=-(F=Z<0?-Z:Z))),N.hasOwnProperty(k="RANGE"))if(Z=N[k],Z&&Z.pop)_(Z[0],-f,-1,k),_(Z[1],1,f,k),Y=Z[0],D=Z[1];else if(_(Z,-f,f,k),Z)Y=-(D=Z<0?-Z:Z);else throw Error(o+k+" cannot be zero: "+Z);if(N.hasOwnProperty(k="CRYPTO"))if(Z=N[k],Z===!!Z)if(Z)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))U=Z;else throw U=!Z,Error(o+"crypto unavailable");else U=Z;else throw Error(o+k+" not true or false: "+Z);if(N.hasOwnProperty(k="MODULO_MODE")&&(Z=N[k],_(Z,0,9,k),j=Z),N.hasOwnProperty(k="POW_PRECISION")&&(Z=N[k],_(Z,0,f,k),J=Z),N.hasOwnProperty(k="FORMAT"))if(Z=N[k],typeof Z=="object")z=Z;else throw Error(o+k+" not an object: "+Z);if(N.hasOwnProperty(k="ALPHABET"))if(Z=N[k],typeof Z=="string"&&!/^.$|[+-.\s]|(.).*\1/.test(Z))$=Z;else throw Error(o+k+" invalid: "+Z)}else throw Error(o+"Object expected: "+N);return{DECIMAL_PLACES:R,ROUNDING_MODE:L,EXPONENTIAL_AT:[I,F],RANGE:[Y,D],CRYPTO:U,MODULO_MODE:j,POW_PRECISION:J,FORMAT:z,ALPHABET:$}},te.isBigNumber=function(N){if(!N||N._isBigNumber!==!0)return!1;if(!te.DEBUG)return!0;var k,Z,V=N.c,re=N.e,Ae=N.s;e:if({}.toString.call(V)=="[object Array]"){if((Ae===1||Ae===-1)&&re>=-f&&re<=f&&re===s(re)){if(V[0]===0){if(re===0&&V.length===1)return!0;break e}if(k=(re+1)%h,k<1&&(k+=h),String(V[0]).length==k){for(k=0;k<V.length;k++)if(Z=V[k],Z<0||Z>=c||Z!==s(Z))break e;if(Z!==0)return!0}}}else if(V===null&&re===null&&(Ae===null||Ae===1||Ae===-1))return!0;throw Error(o+"Invalid BigNumber: "+N)}
vendor: 4,123 bytes, line 4573
4573,te.maximum=te.max=function(){return ve(arguments,C.lt)},te.minimum=te.min=function(){return ve(arguments,C.gt)},te.random=function(){var N=9007199254740992,k=Math.random()*N&2097151?function(){return s(Math.random()*N)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Z){var V,re,Ae,pe,ce,_e=0,me=[],le=new te(x);if(Z==null?Z=R:_(Z,0,f),pe=a(Z/h),U)if(crypto.getRandomValues){for(V=crypto.getRandomValues(new Uint32Array(pe*=2));_e<pe;)ce=V[_e]*131072+(V[_e+1]>>>11),ce>=9e15?(re=crypto.getRandomValues(new Uint32Array(2)),V[_e]=re[0],V[_e+1]=re[1]):(me.push(ce%1e14),_e+=2);_e=pe/2}else if(crypto.randomBytes){for(V=crypto.randomBytes(pe*=7);_e<pe;)ce=(V[_e]&31)*281474976710656+V[_e+1]*1099511627776+V[_e+2]*4294967296+V[_e+3]*16777216+(V[_e+4]<<16)+(V[_e+5]<<8)+V[_e+6],ce>=9e15?crypto.randomBytes(7).copy(V,_e):(me.push(ce%1e14),_e+=7);_e=pe/7}else throw U=!1,Error(o+"crypto unavailable");if(!U)for(;_e<pe;)ce=k(),ce<9e15&&(me[_e++]=ce%1e14);for(pe=me[--_e],Z%=h,pe&&Z&&(ce=d[h-Z],me[_e]=s(pe/ce)*ce);me[_e]===0;me.pop(),_e--);if(_e<0)me=[Ae=0];else{for(Ae=-1;me[0]===0;me.splice(0,1),Ae-=h);for(_e=1,ce=me[0];ce>=10;ce/=10,_e++);_e<h&&(Ae-=h-_e)}return le.e=Ae,le.c=me,le}}(),te.sum=function(){for(var N=1,k=arguments,Z=new te(k[0]);N<k.length;)Z=Z.plus(k[N++]);return Z},S=function(){var N="0123456789";function k(Z,V,re,Ae){for(var pe,ce=[0],_e,me=0,le=Z.length;me<le;){for(_e=ce.length;_e--;ce[_e]*=V);for(ce[0]+=Ae.indexOf(Z.charAt(me++)),pe=0;pe<ce.length;pe++)ce[pe]>re-1&&(ce[pe+1]==null&&(ce[pe+1]=0),ce[pe+1]+=ce[pe]/re|0,ce[pe]%=re)}return ce.reverse()}return function(Z,V,re,Ae,pe){var ce,_e,me,le,De,Ve,se,P,H=Z.indexOf("."),ye=R,Q=L;for(H>=0&&(le=J,J=0,Z=Z.replace(".",""),P=new te(V),Ve=P.pow(Z.length-H),J=le,P.c=k(b(p(Ve.c),Ve.e,"0"),10,re,N),P.e=P.c.length),se=k(Z,V,re,pe?(ce=$,N):(ce=N,$)),me=le=se.length;se[--le]==0;se.pop());if(!se[0])return ce.charAt(0);if(H<0?--me:(Ve.c=se,Ve.e=me,Ve.s=Ae,Ve=M(Ve,P,ye,Q,re),se=Ve.c,De=Ve.r,me=Ve.e),_e=me+ye+1,H=se[_e],le=re/2,De=De||_e<0||se[_e+1]!=null,De=Q<4?(H!=null||De)&&(Q==0||Q==(Ve.s<0?3:2)):H>le||H==le&&(Q==4||De||Q==6&&se[_e-1]&1||Q==(Ve.s<0?8:7)),_e<1||!se[0])Z=De?b(ce.charAt(1),-ye,ce.charAt(0)):ce.charAt(0);else{if(se.length=_e,De)for(--re;++se[--_e]>re;)se[_e]=0,_e||(++me,se=[1].concat(se));for(le=se.length;!se[--le];);for(H=0,Z="";H<=le;Z+=ce.charAt(se[H++]));Z=b(Z,me,ce.charAt(0))}return Z}}(),M=function(){function N(V,re,Ae){var pe,ce,_e,me,le=0,De=V.length,Ve=re%A,se=re/A|0;for(V=V.slice();De--;)_e=V[De]%A,me=V[De]/A|0,pe=se*_e+me*Ve,ce=Ve*_e+pe%A*A+le,le=(ce/Ae|0)+(pe/A|0)+se*me,V[De]=ce%Ae;return le&&(V=[le].concat(V)),V}function k(V,re,Ae,pe){var ce,_e;if(Ae!=pe)_e=Ae>pe?1:-1;else for(ce=_e=0;ce<Ae;ce++)if(V[ce]!=re[ce]){_e=V[ce]>re[ce]?1:-1;break}return _e}function Z(V,re,Ae,pe){for(var ce=0;Ae--;)V[Ae]-=ce,ce=V[Ae]<re[Ae]?1:0,V[Ae]=ce*pe+V[Ae]-re[Ae];for(;!V[0]&&V.length>1;V.splice(0,1));}return function(V,re,Ae,pe,ce){var _e,me,le,De,Ve,se,P,H,ye,Q,Be,Le,Ke,Re,Xe,fe,Ge,Pe=V.s==re.s?1:-1,rt=V.c,Ze=re.c;if(!rt||!rt[0]||!Ze||!Ze[0])return new te(!V.s||!re.s||(rt?Ze&&rt[0]==Ze[0]:!Ze)?NaN:rt&&rt[0]==0||!Ze?Pe*0:Pe/0);for(H=new te(Pe),ye=H.c=[],me=V.e-re.e,Pe=Ae+me+1,ce||(ce=c,me=g(V.e/h)-g(re.e/h),Pe=Pe/h|0),le=0;Ze[le]==(rt[le]||0);le++);if(Ze[le]>(rt[le]||0)&&me--,Pe<0)ye.push(1),De=!0;else{for(Re=rt.length,fe=Ze.length,le=0,Pe+=2,Ve=s(ce/(Ze[0]+1)),Ve>1&&(Ze=N(Ze,Ve,ce),rt=N(rt,Ve,ce),fe=Ze.length,Re=rt.length),Ke=fe,Q=rt.slice(0,fe),Be=Q.length;Be<fe;Q[Be++]=0);Ge=Ze.slice(),Ge=[0].concat(Ge),Xe=Ze[0],Ze[1]>=ce/2&&Xe++;do{if(Ve=0,_e=k(Ze,Q,fe,Be),_e<0){if(Le=Q[0],fe!=Be&&(Le=Le*ce+(Q[1]||0)),Ve=s(Le/Xe),Ve>1)for(Ve>=ce&&(Ve=ce-1),se=N(Ze,Ve,ce),P=se.length,Be=Q.length;k(se,Q,P,Be)==1;)Ve--,Z(se,fe<P?Ge:Ze,P,ce),P=se.length,_e=1;else Ve==0&&(_e=Ve=1),se=Ze.slice(),P=se.length;if(P<Be&&(se=[0].concat(se)),Z(Q,se,Be,ce),Be=Q.length,_e==-1)for(;k(Ze,Q,fe,Be)<1;)Ve++,Z(Q,fe<Be?Ge:Ze,Be,ce),Be=Q.length}else _e===0&&(Ve++,Q=[0]);ye[le++]=Ve,Q[0]?Q[Be++]=rt[Ke]||0:(Q=[rt[Ke]],Be=1)}while((Ke++<Re||Q[0]!=null)&&Pe--);De=Q[0]!=null,ye[0]||ye.splice(0,1)}
vendor: 10,745 bytes, line 4573
4573if(ce==c){for(le=1,Pe=ye[0];Pe>=10;Pe/=10,le++);K(H,Ae+(H.e=le+me*h-1)+1,pe,De)}else H.e=me,H.r=+De;return H}}();function ae(N,k,Z,V){var re,Ae,pe,ce,_e;if(Z==null?Z=L:_(Z,0,8),!N.c)return N.toString();if(re=N.c[0],pe=N.e,k==null)_e=p(N.c),_e=V==1||V==2&&(pe<=I||pe>=F)?w(_e,pe):b(_e,pe,"0");else if(N=K(new te(N),k,Z),Ae=N.e,_e=p(N.c),ce=_e.length,V==1||V==2&&(k<=Ae||Ae<=I)){for(;ce<k;_e+="0",ce++);_e=w(_e,Ae)}else if(k-=pe,_e=b(_e,Ae,"0"),Ae+1>ce){if(--k>0)for(_e+=".";k--;_e+="0");}else if(k+=Ae-ce,k>0)for(Ae+1==ce&&(_e+=".");k--;_e+="0");return N.s<0&&re?"-"+_e:_e}function ve(N,k){for(var Z,V=1,re=new te(N[0]);V<N.length;V++)if(Z=new te(N[V]),Z.s)k.call(re,Z)&&(re=Z);else{re=Z;break}return re}function oe(N,k,Z){for(var V=1,re=k.length;!k[--re];k.pop());for(re=k[0];re>=10;re/=10,V++);return(Z=V+Z*h-1)>D?N.c=N.e=null:Z<Y?N.c=[N.e=0]:(N.e=Z,N.c=k),N}T=function(){var N=/^(-?)0([xbo])(?=\w[\w.]*$)/i,k=/^([^.]+)\.$/,Z=/^\.([^.]+)$/,V=/^-?(Infinity|NaN)$/,re=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(Ae,pe,ce,_e){var me,le=ce?pe:pe.replace(re,"");if(V.test(le))Ae.s=isNaN(le)?null:le<0?-1:1;else{if(!ce&&(le=le.replace(N,function(De,Ve,se){return me=(se=se.toLowerCase())=="x"?16:se=="b"?2:8,!_e||_e==me?Ve:De}),_e&&(me=_e,le=le.replace(k,"$1").replace(Z,"0.$1")),pe!=le))return new te(le,me);if(te.DEBUG)throw Error(o+"Not a"+(_e?" base "+_e:"")+" number: "+pe);Ae.s=null}Ae.c=Ae.e=null}}();function K(N,k,Z,V){var re,Ae,pe,ce,_e,me,le,De=N.c,Ve=d;if(De){e:{for(re=1,ce=De[0];ce>=10;ce/=10,re++);if(Ae=k-re,Ae<0)Ae+=h,pe=k,_e=De[me=0],le=_e/Ve[re-pe-1]%10|0;else if(me=a((Ae+1)/h),me>=De.length)if(V){for(;De.length<=me;De.push(0));_e=le=0,re=1,Ae%=h,pe=Ae-h+1}else break e;else{for(_e=ce=De[me],re=1;ce>=10;ce/=10,re++);Ae%=h,pe=Ae-h+re,le=pe<0?0:_e/Ve[re-pe-1]%10|0}if(V=V||k<0||De[me+1]!=null||(pe<0?_e:_e%Ve[re-pe-1]),V=Z<4?(le||V)&&(Z==0||Z==(N.s<0?3:2)):le>5||le==5&&(Z==4||V||Z==6&&(Ae>0?pe>0?_e/Ve[re-pe]:0:De[me-1])%10&1||Z==(N.s<0?8:7)),k<1||!De[0])return De.length=0,V?(k-=N.e+1,De[0]=Ve[(h-k%h)%h],N.e=-k||0):De[0]=N.e=0,N;if(Ae==0?(De.length=me,ce=1,me--):(De.length=me+1,ce=Ve[h-Ae],De[me]=pe>0?s(_e/Ve[re-pe]%Ve[pe])*ce:0),V)for(;;)if(me==0){for(Ae=1,pe=De[0];pe>=10;pe/=10,Ae++);for(pe=De[0]+=ce,ce=1;pe>=10;pe/=10,ce++);Ae!=ce&&(N.e++,De[0]==c&&(De[0]=1));break}else{if(De[me]+=ce,De[me]!=c)break;De[me--]=0,ce=1}for(Ae=De.length;De[--Ae]===0;De.pop());}N.e>D?N.c=N.e=null:N.e<Y&&(N.c=[N.e=0])}return N}function X(N){var k,Z=N.e;return Z===null?N.toString():(k=p(N.c),k=Z<=I||Z>=F?w(k,Z):b(k,Z,"0"),N.s<0?"-"+k:k)}return C.absoluteValue=C.abs=function(){var N=new te(this);return N.s<0&&(N.s=1),N},C.comparedTo=function(N,k){return v(this,new te(N,k))},C.decimalPlaces=C.dp=function(N,k){var Z,V,re,Ae=this;if(N!=null)return _(N,0,f),k==null?k=L:_(k,0,8),K(new te(Ae),N+Ae.e+1,k);if(!(Z=Ae.c))return null;if(V=((re=Z.length-1)-g(this.e/h))*h,re=Z[re])for(;re%10==0;re/=10,V--);return V<0&&(V=0),V},C.dividedBy=C.div=function(N,k){return M(this,new te(N,k),R,L)},C.dividedToIntegerBy=C.idiv=function(N,k){return M(this,new te(N,k),0,1)},C.exponentiatedBy=C.pow=function(N,k){var Z,V,re,Ae,pe,ce,_e,me,le,De=this;if(N=new te(N),N.c&&!N.isInteger())throw Error(o+"Exponent not an integer: "+X(N));if(k!=null&&(k=new te(k)),ce=N.e>14,!De.c||!De.c[0]||De.c[0]==1&&!De.e&&De.c.length==1||!N.c||!N.c[0])return le=new te(Math.pow(+X(De),ce?2-y(N):+X(N))),k?le.mod(k):le;if(_e=N.s<0,k){if(k.c?!k.c[0]:!k.s)return new te(NaN);V=!_e&&De.isInteger()&&k.isInteger(),V&&(De=De.mod(k))}else{if(N.e>9&&(De.e>0||De.e<-1||(De.e==0?De.c[0]>1||ce&&De.c[1]>=24e7:De.c[0]<8e13||ce&&De.c[0]<=9999975e7)))return Ae=De.s<0&&y(N)?-0:0,De.e>-1&&(Ae=1/Ae),new te(_e?1/Ae:Ae);J&&(Ae=a(J/h+2))}for(ce?(Z=new te(.5),_e&&(N.s=1),me=y(N)):(re=Math.abs(+X(N)),me=re%2),le=new te(x);;){if(me){if(le=le.times(De),!le.c)break;Ae?le.c.length>Ae&&(le.c.length=Ae):V&&(le=le.mod(k))}if(re){if(re=s(re/2),re===0)break;me=re%2}else if(N=N.times(Z),K(N,N.e+1,1),N.e>14)me=y(N);else{if(re=+X(N),re===0)break;me=re%2}De=De.times(De),Ae?De.c&&De.c.length>Ae&&(De.c.length=Ae):V&&(De=De.mod(k))}return V?le:(_e&&(le=x.div(le)),k?le.mod(k):Ae?K(le,J,L,pe):le)},C.integerValue=function(N){var k=new te(this);return N==null?N=L:_(N,0,8),K(k,k.e+1,N)},C.isEqualTo=C.eq=function(N,k){return v(this,new te(N,k))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(N,k){return v(this,new te(N,k))>0},C.isGreaterThanOrEqualTo=C.gte=function(N,k){return(k=v(this,new te(N,k)))===1||k===0},C.isInteger=function(){return!!this.c&&g(this.e/h)>this.c.length-2},C.isLessThan=C.lt=function(N,k){return v(this,new te(N,k))<0},C.isLessThanOrEqualTo=C.lte=function(N,k){return(k=v(this,new te(N,k)))===-1||k===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(N,k){var Z,V,re,Ae,pe=this,ce=pe.s;if(N=new te(N,k),k=N.s,!ce||!k)return new te(NaN);if(ce!=k)return N.s=-k,pe.plus(N);var _e=pe.e/h,me=N.e/h,le=pe.c,De=N.c;if(!_e||!me){if(!le||!De)return le?(N.s=-k,N):new te(De?pe:NaN);if(!le[0]||!De[0])return De[0]?(N.s=-k,N):new te(le[0]?pe:L==3?-0:0)}if(_e=g(_e),me=g(me),le=le.slice(),ce=_e-me){for((Ae=ce<0)?(ce=-ce,re=le):(me=_e,re=De),re.reverse(),k=ce;k--;re.push(0));re.reverse()}else for(V=(Ae=(ce=le.length)<(k=De.length))?ce:k,ce=k=0;k<V;k++)if(le[k]!=De[k]){Ae=le[k]<De[k];break}if(Ae&&(re=le,le=De,De=re,N.s=-N.s),k=(V=De.length)-(Z=le.length),k>0)for(;k--;le[Z++]=0);for(k=c-1;V>ce;){if(le[--V]<De[V]){for(Z=V;Z&&!le[--Z];le[Z]=k);--le[Z],le[V]+=c}le[V]-=De[V]}for(;le[0]==0;le.splice(0,1),--me);return le[0]?oe(N,le,me):(N.s=L==3?-1:1,N.c=[N.e=0],N)},C.modulo=C.mod=function(N,k){var Z,V,re=this;return N=new te(N,k),!re.c||!N.s||N.c&&!N.c[0]?new te(NaN):!N.c||re.c&&!re.c[0]?new te(re):(j==9?(V=N.s,N.s=1,Z=M(re,N,0,3),N.s=V,Z.s*=V):Z=M(re,N,0,j),N=re.minus(Z.times(N)),!N.c[0]&&j==1&&(N.s=re.s),N)},C.multipliedBy=C.times=function(N,k){var Z,V,re,Ae,pe,ce,_e,me,le,De,Ve,se,P,H,ye,Q=this,Be=Q.c,Le=(N=new te(N,k)).c;if(!Be||!Le||!Be[0]||!Le[0])return!Q.s||!N.s||Be&&!Be[0]&&!Le||Le&&!Le[0]&&!Be?N.c=N.e=N.s=null:(N.s*=Q.s,!Be||!Le?N.c=N.e=null:(N.c=[0],N.e=0)),N;for(V=g(Q.e/h)+g(N.e/h),N.s*=Q.s,_e=Be.length,De=Le.length,_e<De&&(P=Be,Be=Le,Le=P,re=_e,_e=De,De=re),re=_e+De,P=[];re--;P.push(0));for(H=c,ye=A,re=De;--re>=0;){for(Z=0,Ve=Le[re]%ye,se=Le[re]/ye|0,pe=_e,Ae=re+pe;Ae>re;)me=Be[--pe]%ye,le=Be[pe]/ye|0,ce=se*me+le*Ve,me=Ve*me+ce%ye*ye+P[Ae]+Z,Z=(me/H|0)+(ce/ye|0)+se*le,P[Ae--]=me%H;P[Ae]=Z}return Z?++V:P.splice(0,1),oe(N,P,V)},C.negated=function(){var N=new te(this);return N.s=-N.s||null,N},C.plus=function(N,k){var Z,V=this,re=V.s;if(N=new te(N,k),k=N.s,!re||!k)return new te(NaN);if(re!=k)return N.s=-k,V.minus(N);var Ae=V.e/h,pe=N.e/h,ce=V.c,_e=N.c;if(!Ae||!pe){if(!ce||!_e)return new te(re/0);if(!ce[0]||!_e[0])return _e[0]?N:new te(ce[0]?V:re*0)}if(Ae=g(Ae),pe=g(pe),ce=ce.slice(),re=Ae-pe){for(re>0?(pe=Ae,Z=_e):(re=-re,Z=ce),Z.reverse();re--;Z.push(0));Z.reverse()}for(re=ce.length,k=_e.length,re-k<0&&(Z=_e,_e=ce,ce=Z,k=re),re=0;k;)re=(ce[--k]=ce[k]+_e[k]+re)/c|0,ce[k]=c===ce[k]?0:ce[k]%c;return re&&(ce=[re].concat(ce),++pe),oe(N,ce,pe)},C.precision=C.sd=function(N,k){var Z,V,re,Ae=this;if(N!=null&&N!==!!N)return _(N,1,f),k==null?k=L:_(k,0,8),K(new te(Ae),N,k);if(!(Z=Ae.c))return null;if(re=Z.length-1,V=re*h+1,re=Z[re]){for(;re%10==0;re/=10,V--);for(re=Z[0];re>=10;re/=10,V++);}return N&&Ae.e+1>V&&(V=Ae.e+1),V},C.shiftedBy=function(N){return _(N,-u,u),this.times("1e"+N)},C.squareRoot=C.sqrt=function(){var N,k,Z,V,re,Ae=this,pe=Ae.c,ce=Ae.s,_e=Ae.e,me=R+4,le=new te("0.5");if(ce!==1||!pe||!pe[0])return new te(!ce||ce<0&&(!pe||pe[0])?NaN:pe?Ae:1/0);if(ce=Math.sqrt(+X(Ae)),ce==0||ce==1/0?(k=p(pe),(k.length+_e)%2==0&&(k+="0"),ce=Math.sqrt(+k),_e=g((_e+1)/2)-(_e<0||_e%2),ce==1/0?k="1e"+_e:(k=ce.toExponential(),k=k.slice(0,k.indexOf("e")+1)+_e),Z=new te(k)):Z=new te(ce+""),Z.c[0]){for(_e=Z.e,ce=_e+me,ce<3&&(ce=0);;)if(re=Z,Z=le.times(re.plus(M(Ae,re,me,1))),p(re.c).slice(0,ce)===(k=p(Z.c)).slice(0,ce))if(Z.e<_e&&--ce,k=k.slice(ce-3,ce+1),k=="9999"||!V&&k=="4999"){if(!V&&(K(re,re.e+R+2,0),re.times(re).eq(Ae))){Z=re;break}me+=4,ce+=4,V=1}else{(!+k||!+k.slice(1)&&k.charAt(0)=="5")&&(K(Z,Z.e+R+2,1),N=!Z.times(Z).eq(Ae));break}}return K(Z,Z.e+R+1,L,N)},C.toExponential=function(N,k){return N!=null&&(_(N,0,f),N++),ae(this,N,k,1)},C.toFixed=function(N,k){return N!=null&&(_(N,0,f),N=N+this.e+1),ae(this,N,k)},C.toFormat=function(N,k,Z){var V,re=this;if(Z==null)N!=null&&k&&typeof k=="object"?(Z=k,k=null):N&&typeof N=="object"?(Z=N,N=k=null):Z=z;else if(typeof Z!="object")throw Error(o+"Argument not an object: "+Z);if(V=re.toFixed(N,k),re.c){var Ae,pe=V.split("."),ce=+Z.groupSize,_e=+Z.secondaryGroupSize,me=Z.groupSeparator||"",le=pe[0],De=pe[1],Ve=re.s<0,se=Ve?le.slice(1):le,P=se.length;if(_e&&(Ae=ce,ce=_e,_e=Ae,P-=Ae),ce>0&&P>0){for(Ae=P%ce||ce,le=se.substr(0,Ae);Ae<P;Ae+=ce)le+=me+se.substr(Ae,ce);_e>0&&(le+=me+se.slice(Ae)),Ve&&(le="-"+le)}V=De?le+(Z.decimalSeparator||"")+((_e=+Z.fractionGroupSize)?De.replace(new RegExp("\\d{"+_e+"}\\B","g"),"$&"+(Z.fractionGroupSeparator||"")):De):le}return(Z.prefix||"")+V+(Z.suffix||"")},C.toFraction=function(N){var k,Z,V,re,Ae,pe,ce,_e,me,le,De,Ve,se=this,P=se.c;if(N!=null&&(ce=new te(N),!ce.isInteger()&&(ce.c||ce.s!==1)||ce.lt(x)))throw Error(o+"Argument "+(ce.isInteger()?"out of range: ":"not an integer: ")+X(ce));if(!P)return new te(se);for(k=new te(x),me=Z=new te(x),V=_e=new te(x),Ve=p(P),Ae=k.e=Ve.length-se.e-1,k.c[0]=d[(pe=Ae%h)<0?h+pe:pe],N=!N||ce.comparedTo(k)>0?Ae>0?k:me:ce,pe=D,D=1/0,ce=new te(Ve),_e.c[0]=0;le=M(ce,k,0,1),re=Z.plus(le.times(V)),re.comparedTo(N)!=1;)Z=V,V=re,me=_e.plus(le.times(re=me)),_e=re,k=ce.minus(le.times(re=k)),ce=re;return re=M(N.minus(Z),V,0,1),_e=_e.plus(re.times(me)),Z=Z.plus(re.times(V)),_e.s=me.s=se.s,Ae=Ae*2,De=M(me,V,Ae,L).minus(se).abs().comparedTo(M(_e,Z,Ae,L).minus(se).abs())<1?[me,V]:[_e,Z],D=pe,De},C.toNumber=function(){return+X(this)},C.toPrecision=function(N,k){return N!=null&&_(N,1,f),ae(this,N,k,2)},C.toString=function(N){var k,Z=this,V=Z.s,re=Z.e;return re===null?V?(k="Infinity",V<0&&(k="-"+k)):k="NaN":(N==null?k=re<=I||re>=F?w(p(Z.c),re):b(p(Z.c),re,"0"):N===10?(Z=K(new te(Z),R+re+1,L),k=b(p(Z.c),Z.e,"0")):(_(N,2,$.length,"Base"),k=S(b(p(Z.c),re,"0"),10,N,V,!0)),V<0&&Z.c[0]&&(k="-"+k)),k},C.valueOf=C.toJSON=function(){return X(this)},C._isBigNumber=!0,E!=null&&te.set(E),te}function g(E){var M=E|0;return E>0||E===M?M:M-1}function p(E){for(var M,S,T=1,C=E.length,x=E[0]+"";T<C;){for(M=E[T++]+"",S=h-M.length;S--;M="0"+M);x+=M}for(C=x.length;x.charCodeAt(--C)===48;);return x.slice(0,C+1||1)}function v(E,M){var S,T,C=E.c,x=M.c,R=E.s,L=M.s,I=E.e,F=M.e;
4573if(!R||!L)return null;if(S=C&&!C[0],T=x&&!x[0],S||T)return S?T?0:-L:R;if(R!=L)return R;if(S=R<0,T=I==F,!C||!x)return T?0:!C^S?1:-1;if(!T)return I>F^S?1:-1;for(L=(I=C.length)<(F=x.length)?I:F,R=0;R<L;R++)if(C[R]!=x[R])return C[R]>x[R]^S?1:-1;return I==F?0:I>F^S?1:-1}function _(E,M,S,T){if(E<M||E>S||E!==s(E))throw Error(o+(T||"Argument")+(typeof E=="number"?E<M||E>S?" out of range: ":" not an integer: ":" not a primitive number: ")+String(E))}function y(E){var M=E.c.length-1;return g(E.e/h)==M&&E.c[M]%2!=0}function w(E,M){return(E.length>1?E.charAt(0)+"."+E.slice(1):E)+(M<0?"e":"e+")+M}function b(E,M,S){var T,C;if(M<0){for(C=S+".";++M;C+=S);E=C+E}else if(T=E.length,++M>T){for(C=S,M-=T;--M;C+=S);E+=C}else M<T&&(E=E.slice(0,M)+"."+E.slice(M));return E}r=m(),r.default=r.BigNumber=r,t.exports?t.exports=r:(i||(i=typeof self<"u"&&self?self:window),i.BigNumber=r)})(Cy)}(fR)),fR.exports}var Rw={exports:{}},qk;function Zu(){return qk||(qk=1,function(t,i){var r=ir,n=r.Buffer;function a(o,l){for(var c in o)l[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(a(r,i),i.Buffer=s);function s(o,l,c){return n(o,l,c)}a(n,s),s.from=function(o,l,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,l,c)},s.alloc=function(o,l,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var h=n(o);return l!==void 0?typeof c=="string"?h.fill(l,c):h.fill(l):h.fill(0),h},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}}(Rw,Rw.exports)),Rw.exports}var pR,Zk;function Xde(){if(Zk)return pR;Zk=1,pR=t;function t(){this.bufs=[],this.size=0}return t.prototype.shift=function(){var r=this.bufs.shift();return r&&(this.size-=r.length),r},t.prototype.push=function(r){!r||!r.length||(this.bufs.push(r),this.size+=r.length)},pR}var mR,Jk;function qde(){if(Jk)return mR;Jk=1;var t=Yde(),i=Kde(),r=Zu().Buffer,n=Xde(),a=Math.pow(2,24)-1,s=Math.pow(2,32),o=4;mR=l;function l(c){c=c||{},this._supportBigNumbers=c.config&&c.config.supportBigNumbers,this._buffer=r.alloc(0),this._nextBuffers=new n,this._longPacketBuffers=new n,this._offset=0,this._packetEnd=null,this._packetHeader=null,this._packetOffset=null,this._onError=c.onError||function(h){throw h},this._onPacket=c.onPacket||function(){},this._nextPacketNumber=0,this._encoding="utf-8",this._paused=!1}return l.prototype.write=function(h){for(this._nextBuffers.push(h);!this._paused;){var u=this._tryReadPacketHeader();if(!u||!this._combineNextBuffers(u.length))break;this._parsePacket(u)}},l.prototype.append=function(h){if(!(!h||h.length===0)){for(var u=this._buffer.length,d=this._packetOffset===null?this._offset:this._packetOffset,A=u-d,f=null,m=h instanceof Array||Array.isArray(h)?h:[h],g=0,p=0,v=0;v<m.length;v++)g+=m[v].length;if(A!==0){f=r.allocUnsafe(A+g),p=0,p+=this._buffer.copy(f,0,d,u);for(var v=0;v<m.length;v++)p+=m[v].copy(f,p)}else if(m.length>1){f=r.allocUnsafe(g),p=0;for(var v=0;v<m.length;v++)p+=m[v].copy(f,p)}else f=m[0];this._buffer=f,this._offset=this._offset-d,this._packetEnd=this._packetEnd!==null?this._packetEnd-d:null,this._packetOffset=this._packetOffset!==null?this._packetOffset-d:null}},l.prototype.pause=function(){this._paused=!0},l.prototype.resume=function(){this._paused=!1,process.nextTick(this.write.bind(this))},l.prototype.peak=function(h){return this._buffer[this._offset+(h>>>0)]},l.prototype.parseUnsignedNumber=function(h){if(h===1)return this._buffer[this._offset++];var u=this._buffer,d=this._offset+h-1,A=0;if(h>4){var f=new Error("parseUnsignedNumber: Supports only up to 4 bytes");throw f.offset=this._offset-this._packetOffset-1,f.code="PARSER_UNSIGNED_TOO_LONG",f}for(;d>=this._offset;)A=(A<<8|u[d])>>>0,d--;return this._offset+=h,A},l.prototype.parseLengthCodedString=function(){var c=this.parseLengthCodedNumber();return c===null?null:this.parseString(c)},l.prototype.parseLengthCodedBuffer=function(){var c=this.parseLengthCodedNumber();return c===null?null:this.parseBuffer(c)},l.prototype.parseLengthCodedNumber=function(){if(this._offset>=this._buffer.length){var h=new Error("Parser: read past end");throw h.offset=this._offset-this._packetOffset,h.code="PARSER_READ_PAST_END",h}var u=this._buffer[this._offset++];if(u<=250)return u;switch(u){case 251:return null;case 252:return this.parseUnsignedNumber(2);case 253:return this.parseUnsignedNumber(3);case 254:break;default:var h=new Error("Unexpected first byte"+(u?": 0x"+u.toString(16):""));throw h.offset=this._offset-this._packetOffset-1,h.code="PARSER_BAD_LENGTH_BYTE",h}var d=this.parseUnsignedNumber(4),A=this.parseUnsignedNumber(4),f;if(A>>>21){if(f=i(s).times(A).plus(d).toString(),this._supportBigNumbers)return f;var h=new Error('parseLengthCodedNumber: JS precision range exceeded, number is >= 53 bit: "'+f+'"');throw h.offset=this._offset-this._packetOffset-8,h.code="PARSER_JS_PRECISION_RANGE_EXCEEDED",h}return f=d+s*A,f},l.prototype.parseFiller=function(c){return this.parseBuffer(c)},l.prototype.parseNullTerminatedBuffer=function(){var c=this._nullByteOffset(),h=this._buffer.slice(this._offset,c);return this._offset=c+1,h},l.prototype.parseNullTerminatedString=function(){var c=this._nullByteOffset(),h=this._buffer.toString(this._encoding,this._offset,c);return this._offset=c+1,h},l.prototype._nullByteOffset=function(){for(var c=this._offset;this._buffer[c]!==0;)if(c++,c>=this._buffer.length){var h=new Error("Offset of null terminated string not found.");throw h.offset=this._offset-this._packetOffset,h.code="PARSER_MISSING_NULL_BYTE",h}return c},l.prototype.parsePacketTerminatedBuffer=function(){var h=this._packetEnd-this._offset;return this.parseBuffer(h)},l.prototype.parsePacketTerminatedString=function(){var c=this._packetEnd-this._offset;return this.parseString(c)},l.prototype.parseBuffer=function(c){var h=r.alloc(c);return this._buffer.copy(h,0,this._offset,this._offset+c),this._offset+=c,h},l.prototype.parseString=function(c){var h=this._offset,u=h+c,d=this._buffer.toString(this._encoding,h,u);return this._offset=u,d},l.prototype.parseGeometryValue=function(){var c=this.parseLengthCodedBuffer(),h=4;if(c===null||!c.length)return null;function u(){var d=null,A=c.readUInt8(h);h+=1;var f=A?c.readUInt32LE(h):c.readUInt32BE(h);switch(h+=4,f){case 1:var m=A?c.readDoubleLE(h):c.readDoubleBE(h);h+=8;var g=A?c.readDoubleLE(h):c.readDoubleBE(h);h+=8,d={x:m,y:g};break;case 2:var p=A?c.readUInt32LE(h):c.readUInt32BE(h);h+=4,d=[];for(var v=p;v>0;v--){var m=A?c.readDoubleLE(h):c.readDoubleBE(h);h+=8;var g=A?c.readDoubleLE(h):c.readDoubleBE(h);h+=8,d.push({x:m,y:g})}break;case 3:var _=A?c.readUInt32LE(h):c.readUInt32BE(h);h+=4,d=[];for(var v=_;v>0;v--){var p=A?c.readUInt32LE(h):c.readUInt32BE(h);h+=4;for(var y=[],w=p;w>0;w--){var m=A?c.readDoubleLE(h):c.readDoubleBE(h);h+=8;var g=A?c.readDoubleLE(h):c.readDoubleBE(h);h+=8,y.push({x:m,y:g})}d.push(y)}break;
4573case 4:case 5:case 6:case 7:var b=A?c.readUInt32LE(h):c.readUInt32BE(h);h+=4;for(var d=[],v=b;v>0;v--)d.push(u());break}return d}return u()},l.prototype.reachedPacketEnd=function(){return this._offset===this._packetEnd},l.prototype.incrementPacketNumber=function(){var c=this._nextPacketNumber;return this._nextPacketNumber=(this._nextPacketNumber+1)%256,c},l.prototype.resetPacketNumber=function(){this._nextPacketNumber=0},l.prototype.packetLength=function(){return this._packetHeader?this._packetHeader.length+this._longPacketBuffers.size:null},l.prototype._combineNextBuffers=function(h){var u=this._buffer.length-this._offset;if(u>=h)return!0;if(u+this._nextBuffers.size<h)return!1;for(var d=[],A=h-u;A>0;){var f=this._nextBuffers.shift();d.push(f),A-=f.length}return this.append(d),!0},l.prototype._combineLongPacketBuffers=function(){if(this._longPacketBuffers.size){for(var h=this._buffer.length-this._offset,u=this._buffer.length-this._packetEnd,d=null,A=r.allocUnsafe(h+this._longPacketBuffers.size),f=0;d=this._longPacketBuffers.shift();)f+=d.copy(A,f);this._buffer.copy(A,f,this._offset),this._buffer=A,this._offset=0,this._packetEnd=this._buffer.length-u,this._packetOffset=0}},l.prototype._parsePacket=function(h){if(this._packetEnd=this._offset+h.length,this._packetOffset=this._offset,h.length===a){this._longPacketBuffers.push(this._buffer.slice(this._packetOffset,this._packetEnd)),this._advanceToNextPacket();return}this._combineLongPacketBuffers();var u=!0;try{this._onPacket(h),u=!1}catch(d){if(!d||typeof d.code!="string"||d.code.substr(0,7)!=="PARSER_")throw d;this._onError(d),u=!1}finally{this._advanceToNextPacket(),u&&process.nextTick(this.write.bind(this))}},l.prototype._tryReadPacketHeader=function(){if(this._packetHeader)return this._packetHeader;if(!this._combineNextBuffers(o))return null;if(this._packetHeader=new t(this.parseUnsignedNumber(3),this.parseUnsignedNumber(1)),this._packetHeader.number!==this._nextPacketNumber){var h=new Error("Packets out of order. Got: "+this._packetHeader.number+" Expected: "+this._nextPacketNumber);h.code="PROTOCOL_PACKETS_OUT_OF_ORDER",h.fatal=!0,this._onError(h)}return this.incrementPacketNumber(),this._packetHeader},l.prototype._advanceToNextPacket=function(){this._offset=this._packetEnd,this._packetHeader=null,this._packetEnd=null,this._packetOffset=null},mR}var Nh={},Nr={},gR,$k;function Zde(){if($k)return gR;$k=1,gR=t;function t(i){i=i||{},this.status=254,this.authMethodName=i.authMethodName,this.authMethodData=i.authMethodData}return t.prototype.parse=function(r){this.status=r.parseUnsignedNumber(1),this.authMethodName=r.parseNullTerminatedString(),this.authMethodData=r.parsePacketTerminatedBuffer()},t.prototype.write=function(r){r.writeUnsignedNumber(1,this.status),r.writeNullTerminatedString(this.authMethodName),r.writeBuffer(this.authMethodData)},gR}var vR,eH;function Jde(){if(eH)return vR;eH=1,vR=t;function t(i){i=i||{},this.data=i.data}return t.prototype.parse=function(r){this.data=r.parsePacketTerminatedBuffer()},t.prototype.write=function(r){r.writeBuffer(this.data)},vR}var _R,tH;function $de(){if(tH)return _R;tH=1;var t=Zu().Buffer;_R=i;function i(r){r=r||{},this.clientFlags=r.clientFlags,this.maxPacketSize=r.maxPacketSize,this.charsetNumber=r.charsetNumber,this.filler=void 0,this.user=r.user,this.scrambleBuff=r.scrambleBuff,this.database=r.database,this.protocol41=r.protocol41}return i.prototype.parse=function(r){this.protocol41?(this.clientFlags=r.parseUnsignedNumber(4),this.maxPacketSize=r.parseUnsignedNumber(4),this.charsetNumber=r.parseUnsignedNumber(1),this.filler=r.parseFiller(23),this.user=r.parseNullTerminatedString(),this.scrambleBuff=r.parseLengthCodedBuffer(),this.database=r.parseNullTerminatedString()):(this.clientFlags=r.parseUnsignedNumber(2),this.maxPacketSize=r.parseUnsignedNumber(3),this.user=r.parseNullTerminatedString(),this.scrambleBuff=r.parseBuffer(8),this.database=r.parseLengthCodedBuffer())},i.prototype.write=function(r){this.protocol41?(r.writeUnsignedNumber(4,this.clientFlags),r.writeUnsignedNumber(4,this.maxPacketSize),r.writeUnsignedNumber(1,this.charsetNumber),r.writeFiller(23),r.writeNullTerminatedString(this.user),r.writeLengthCodedBuffer(this.scrambleBuff),r.writeNullTerminatedString(this.database)):(r.writeUnsignedNumber(2,this.clientFlags),r.writeUnsignedNumber(3,this.maxPacketSize),r.writeNullTerminatedString(this.user),r.writeBuffer(this.scrambleBuff),this.database&&this.database.length&&(r.writeFiller(1),r.writeBuffer(t.from(this.database))))},_R}var yR,iH;function eAe(){if(iH)return yR;iH=1,yR=t;function t(i){i=i||{},this.command=17,this.user=i.user,this.scrambleBuff=i.scrambleBuff,this.database=i.database,this.charsetNumber=i.charsetNumber}return t.prototype.parse=function(i){this.command=i.parseUnsignedNumber(1),this.user=i.parseNullTerminatedString(),this.scrambleBuff=i.parseLengthCodedBuffer(),this.database=i.parseNullTerminatedString(),this.charsetNumber=i.parseUnsignedNumber(1)},t.prototype.write=function(i){i.writeUnsignedNumber(1,this.command),i.writeNullTerminatedString(this.user),i.writeLengthCodedBuffer(this.scrambleBuff),i.writeNullTerminatedString(this.database),i.writeUnsignedNumber(2,this.charsetNumber)},yR}var ER,rH;function tAe(){if(rH)return ER;rH=1,ER=t;function t(){this.command=14}return t.prototype.write=function(i){i.writeUnsignedNumber(1,this.command)},t.prototype.parse=function(i){this.command=i.parseUnsignedNumber(1)},ER}var wR,nH;function iAe(){if(nH)return wR;nH=1,wR=t;function t(i){this.command=3,this.sql=i}return t.prototype.write=function(i){i.writeUnsignedNumber(1,this.command),i.writeString(this.sql)},t.prototype.parse=function(i){this.command=i.parseUnsignedNumber(1),this.sql=i.parsePacketTerminatedString()},wR}var bR,aH;function rAe(){if(aH)return bR;aH=1,bR=t;function t(){this.command=1}return t.prototype.parse=function(r){this.command=r.parseUnsignedNumber(1)},t.prototype.write=function(r){r.writeUnsignedNumber(1,this.command)},bR}var SR,sH;function nAe(){if(sH)return SR;sH=1,SR=t;function t(){this.command=9}return t.prototype.write=function(i){i.writeUnsignedNumber(1,this.command)},t.prototype.parse=function(i){this.command=i.parseUnsignedNumber(1)},SR}var CR,oH;function aAe(){if(oH)return CR;oH=1,CR=t;function t(){}return t.prototype.parse=function(){},t.prototype.write=function(){},CR}var TR,lH;function sAe(){if(lH)return TR;lH=1,TR=t;function t(i){i=i||{},this.fieldCount=void 0,this.warningCount=i.warningCount,this.serverStatus=i.serverStatus,this.protocol41=i.protocol41}return t.prototype.parse=function(i){this.fieldCount=i.parseUnsignedNumber(1),this.protocol41&&(this.warningCount=i.parseUnsignedNumber(2),this.serverStatus=i.parseUnsignedNumber(2))},t.prototype.write=function(i){i.writeUnsignedNumber(1,254),this.protocol41&&(i.writeUnsignedNumber(2,this.warningCount),i.writeUnsignedNumber(2,this.serverStatus))},TR}var MR,cH;function oAe(){if(cH)return MR;cH=1,MR=t;function t(i){i=i||{},this.fieldCount=i.fieldCount,this.errno=i.errno,this.sqlStateMarker=i.sqlStateMarker,this.sqlState=i.sqlState,this.message=i.message}return t.prototype.parse=function(i){this.fieldCount=i.parseUnsignedNumber(1),this.errno=i.parseUnsignedNumber(2),i.peak()===35&&(this.sqlStateMarker=i.parseString(1),this.sqlState=i.parseString(5)),this.message=i.parsePacketTerminatedString()},t.prototype.write=function(i){i.writeUnsignedNumber(1,255),i.writeUnsignedNumber(2,this.errno),this.sqlStateMarker&&(i.writeString(this.sqlStateMarker),i.writeString(this.sqlState)),i.writeString(this.message)},MR}var xR={},hH;function eN(){return hH||(hH=1,function(t){t.DECIMAL=0,t.TINY=1,t.SHORT=2,t.LONG=3,t.FLOAT=4,t.DOUBLE=5,t.NULL=6,t.TIMESTAMP=7,t.LONGLONG=8,t.INT24=9,t.DATE=10,t.TIME=11,t.DATETIME=12,t.YEAR=13,t.NEWDATE=14,t.VARCHAR=15,t.BIT=16,t.TIMESTAMP2=17,t.DATETIME2=18,t.TIME2=19,t.JSON=245,t.NEWDECIMAL=246,t.ENUM=247,t.SET=248,t.TINY_BLOB=249,t.MEDIUM_BLOB=250,t.LONG_BLOB=251,t.BLOB=252,t.VAR_STRING=253,t.STRING=254,t.GEOMETRY=255,t[0]="DECIMAL",t[1]="TINY",t[2]="SHORT",t[3]="LONG",t[4]="FLOAT",t[5]="DOUBLE",t[6]="NULL",t[7]="TIMESTAMP",t[8]="LONGLONG",t[9]="INT24",t[10]="DATE",t[11]="TIME",t[12]="DATETIME",t[13]="YEAR",t[14]="NEWDATE",t[15]="VARCHAR",t[16]="BIT",t[17]="TIMESTAMP2",t[18]="DATETIME2",t[19]="TIME2",t[245]="JSON",t[246]="NEWDECIMAL",t[247]="ENUM",t[248]="SET",t[249]="TINY_BLOB",t[250]="MEDIUM_BLOB",t[251]="LONG_BLOB",t[252]="BLOB",t[253]="VAR_STRING",t[254]="STRING",t[255]="GEOMETRY"}(xR)),xR}var RR,uH;function $j(){if(uH)return RR;uH=1;var t=eN();RR=i;function i(r){r=r||{},this.parser=r.parser,this.packet=r.packet,this.db=r.packet.db,this.table=r.packet.table,this.name=r.packet.name,this.type=t[r.packet.type],this.length=r.packet.length}return i.prototype.string=function(){return this.parser.parseLengthCodedString()},i.prototype.buffer=function(){return this.parser.parseLengthCodedBuffer()},i.prototype.geometry=function(){return this.parser.parseGeometryValue()},RR}var BR,dH;function lAe(){if(dH)return BR;dH=1,BR=t;function t(i){i=i||{},this.catalog=i.catalog,this.db=i.db,this.table=i.table,this.orgTable=i.orgTable,this.name=i.name,this.orgName=i.orgName,this.charsetNr=i.charsetNr,this.length=i.length,this.type=i.type,this.flags=i.flags,this.decimals=i.decimals,this.default=i.default,this.zeroFill=i.zeroFill,this.protocol41=i.protocol41}
4573return t.prototype.parse=function(i){if(this.protocol41){if(this.catalog=i.parseLengthCodedString(),this.db=i.parseLengthCodedString(),this.table=i.parseLengthCodedString(),this.orgTable=i.parseLengthCodedString(),this.name=i.parseLengthCodedString(),this.orgName=i.parseLengthCodedString(),i.parseLengthCodedNumber()!==12){var r=new TypeError("Received invalid field length");throw r.code="PARSER_INVALID_FIELD_LENGTH",r}this.charsetNr=i.parseUnsignedNumber(2),this.length=i.parseUnsignedNumber(4),this.type=i.parseUnsignedNumber(1),this.flags=i.parseUnsignedNumber(2),this.decimals=i.parseUnsignedNumber(1);var n=i.parseBuffer(2);if(n[0]!==0||n[1]!==0){var r=new TypeError("Received invalid filler");throw r.code="PARSER_INVALID_FILLER",r}if(this.zeroFill=!!(this.flags&64),i.reachedPacketEnd())return;this.default=i.parseLengthCodedString()}else this.table=i.parseLengthCodedString(),this.name=i.parseLengthCodedString(),this.length=i.parseUnsignedNumber(i.parseUnsignedNumber(1)),this.type=i.parseUnsignedNumber(i.parseUnsignedNumber(1))},t.prototype.write=function(i){this.protocol41?(i.writeLengthCodedString(this.catalog),i.writeLengthCodedString(this.db),i.writeLengthCodedString(this.table),i.writeLengthCodedString(this.orgTable),i.writeLengthCodedString(this.name),i.writeLengthCodedString(this.orgName),i.writeLengthCodedNumber(12),i.writeUnsignedNumber(2,this.charsetNr||0),i.writeUnsignedNumber(4,this.length||0),i.writeUnsignedNumber(1,this.type||0),i.writeUnsignedNumber(2,this.flags||0),i.writeUnsignedNumber(1,this.decimals||0),i.writeFiller(2),this.default!==void 0&&i.writeLengthCodedString(this.default)):(i.writeLengthCodedString(this.table),i.writeLengthCodedString(this.name),i.writeUnsignedNumber(1,1),i.writeUnsignedNumber(1,this.length),i.writeUnsignedNumber(1,1),i.writeUnsignedNumber(1,this.type))},BR}var IR,AH;function cAe(){if(AH)return IR;AH=1;var t=Zu().Buffer,i=vE();IR=r;function r(n){n=n||{},this.protocolVersion=n.protocolVersion,this.serverVersion=n.serverVersion,this.threadId=n.threadId,this.scrambleBuff1=n.scrambleBuff1,this.filler1=n.filler1,this.serverCapabilities1=n.serverCapabilities1,this.serverLanguage=n.serverLanguage,this.serverStatus=n.serverStatus,this.serverCapabilities2=n.serverCapabilities2,this.scrambleLength=n.scrambleLength,this.filler2=n.filler2,this.scrambleBuff2=n.scrambleBuff2,this.filler3=n.filler3,this.pluginData=n.pluginData,this.protocol41=n.protocol41,this.protocol41&&(this.serverCapabilities1|=i.CLIENT_PROTOCOL_41)}return r.prototype.parse=function(n){if(this.protocolVersion=n.parseUnsignedNumber(1),this.serverVersion=n.parseNullTerminatedString(),this.threadId=n.parseUnsignedNumber(4),this.scrambleBuff1=n.parseBuffer(8),this.filler1=n.parseFiller(1),this.serverCapabilities1=n.parseUnsignedNumber(2),this.serverLanguage=n.parseUnsignedNumber(1),this.serverStatus=n.parseUnsignedNumber(2),this.protocol41=(this.serverCapabilities1&512)>0,this.protocol41?(this.serverCapabilities2=n.parseUnsignedNumber(2),this.scrambleLength=n.parseUnsignedNumber(1),this.filler2=n.parseFiller(10),this.scrambleBuff2=n.parseBuffer(12),this.filler3=n.parseFiller(1)):this.filler2=n.parseFiller(13),!n.reachedPacketEnd()){this.pluginData=n.parsePacketTerminatedString();var a=this.pluginData.length-1;this.pluginData[a]==="\0"&&(this.pluginData=this.pluginData.substr(0,a))}},r.prototype.write=function(n){n.writeUnsignedNumber(1,this.protocolVersion),n.writeNullTerminatedString(this.serverVersion),n.writeUnsignedNumber(4,this.threadId),n.writeBuffer(this.scrambleBuff1),n.writeFiller(1),n.writeUnsignedNumber(2,this.serverCapabilities1),n.writeUnsignedNumber(1,this.serverLanguage),n.writeUnsignedNumber(2,this.serverStatus),this.protocol41&&(n.writeUnsignedNumber(2,this.serverCapabilities2),n.writeUnsignedNumber(1,this.scrambleLength),n.writeFiller(10)),n.writeNullTerminatedBuffer(this.scrambleBuff2),this.pluginData!==void 0&&n.writeNullTerminatedString(this.pluginData)},r.prototype.scrambleBuff=function(){var n=null;return typeof this.scrambleBuff2>"u"?n=t.from(this.scrambleBuff1):(n=t.allocUnsafe(this.scrambleBuff1.length+this.scrambleBuff2.length),this.scrambleBuff1.copy(n,0),this.scrambleBuff2.copy(n,this.scrambleBuff1.length)),n},IR}var DR,fH;function hAe(){if(fH)return DR;fH=1,DR=t;function t(i){this.data=i}return t.prototype.write=function(i){i.writeBuffer(this.data)},DR}var PR,pH;function uAe(){if(pH)return PR;pH=1,PR=t;function t(i){i=i||{},this.filename=i.filename}return t.prototype.parse=function(r){if(r.parseLengthCodedNumber()!==null){var n=new TypeError("Received invali
4573d field length");throw n.code="PARSER_INVALID_FIELD_LENGTH",n}this.filename=r.parsePacketTerminatedString()},t.prototype.write=function(r){r.writeLengthCodedNumber(null),r.writeString(this.filename)},PR}var LR,mH;function dAe(){if(mH)return LR;mH=1;var t=/^[^:0-9]+: [0-9]+[^:0-9]+: ([0-9]+)[^:0-9]+: [0-9]+[^:0-9]*$/;LR=i;function i(r){r=r||{},this.fieldCount=void 0,this.affectedRows=void 0,this.insertId=void 0,this.serverStatus=void 0,this.warningCount=void 0,this.message=void 0,this.protocol41=r.protocol41}return i.prototype.parse=function(r){this.fieldCount=r.parseUnsignedNumber(1),this.affectedRows=r.parseLengthCodedNumber(),this.insertId=r.parseLengthCodedNumber(),this.protocol41&&(this.serverStatus=r.parseUnsignedNumber(2),this.warningCount=r.parseUnsignedNumber(2)),this.message=r.parsePacketTerminatedString(),this.changedRows=0;var n=t.exec(this.message);n!==null&&(this.changedRows=parseInt(n[1],10))},i.prototype.write=function(r){r.writeUnsignedNumber(1,0),r.writeLengthCodedNumber(this.affectedRows||0),r.writeLengthCodedNumber(this.insertId||0),this.protocol41&&(r.writeUnsignedNumber(2,this.serverStatus||0),r.writeUnsignedNumber(2,this.warningCount||0)),r.writeString(this.message)},LR}var OR,gH;function AAe(){if(gH)return OR;gH=1,OR=t;function t(i){i=i||{},this.scrambleBuff=i.scrambleBuff}return t.prototype.parse=function(i){this.scrambleBuff=i.parsePacketTerminatedBuffer()},t.prototype.write=function(i){i.writeBuffer(this.scrambleBuff)},OR}var NR,vH;function fAe(){if(vH)return NR;vH=1,NR=t;function t(i){i=i||{},this.fieldCount=i.fieldCount}return t.prototype.parse=function(i){this.fieldCount=i.parseLengthCodedNumber()},t.prototype.write=function(i){i.writeLengthCodedNumber(this.fieldCount)},NR}var UR,_H;function pAe(){if(_H)return UR;_H=1;var t=eN(),i=Jj(),r=$j(),n=Math.pow(2,53);UR=a;function a(){}Object.defineProperty(a.prototype,"parse",{configurable:!0,enumerable:!1,value:s}),Object.defineProperty(a.prototype,"_typeCast",{configurable:!0,enumerable:!1,value:o});function s(c,h,u,d,A){for(var f=this,m=function(){return f._typeCast(p,c,A.config.timezone,A.config.supp
4573ortBigNumbers,A.config.bigNumberStrings,A.config.dateStrings)},g=0;g<h.length;g++){var p=h[g],v;typeof u=="function"?v=u.apply(A,[new r({packet:p,parser:c}),m]):v=u?this._typeCast(p,c,A.config.timezone,A.config.supportBigNumbers,A.config.bigNumberStrings,A.config.dateStrings):p.charsetNr===i.BINARY?c.parseLengthCodedBuffer():c.parseLengthCodedString(),typeof d=="string"&&d.length?this[p.table+d+p.name]=v:d?(this[p.table]=this[p.table]||{},this[p.table][p.name]=v):this[p.name]=v}}function o(c,h,u,d,A,f){var m;switch(c.type){case t.TIMESTAMP:case t.TIMESTAMP2:case t.DATE:case t.DATETIME:case t.DATETIME2:case t.NEWDATE:var g=h.parseLengthCodedString();if(l(c.type,f))return g;if(g===null)return null;var p=g;c.type===t.DATE&&(g+=" 00:00:00"),u!=="local"&&(g+=" "+u);var v=new Date(g);return isNaN(v.getTime())?p:v;case t.TINY:case t.SHORT:case t.LONG:case t.INT24:case t.YEAR:case t.FLOAT:case t.DOUBLE:return m=h.parseLengthCodedString(),m===null||c.zeroFill&&m[0]==="0"?m:Number(m);case t.NEWDECIMAL:case t.LONGLONG:return m=h.parseLengthCodedString(),m===null||c.zeroFill&&m[0]==="0"||d&&(A||Number(m)>=n||Number(m)<=-n)?m:Number(m);case t.BIT:return h.parseLengthCodedBuffer();case t.STRING:case t.VAR_STRING:case t.TINY_BLOB:case t.MEDIUM_BLOB:case t.LONG_BLOB:case t.BLOB:return c.charsetNr===i.BINARY?h.parseLengthCodedBuffer():h.parseLengthCodedString();case t.GEOMETRY:return h.parseGeometryValue();default:return h.parseLengthCodedString()}}function l(c,h){return Array.isArray(h)?h.indexOf(t[c])!==-1:!!h}return UR}var FR,yH;function mAe(){if(yH)return FR;yH=1;var t=vE();FR=i;function i(r){r=r||{},this.clientFlags=r.clientFlags|t.CLIENT_SSL,this.maxPacketSize=r.maxPacketSize,this.charsetNumber=r.charsetNumber}return i.prototype.parse=function(r){this.clientFlags=r.parseUnsignedNumber(4),this.maxPacketSize=r.parseUnsignedNumber(4),this.charsetNumber=r.parseUnsignedNumber(1)},i.prototype.write=function(r){r.writeUnsignedNumber(4,this.clientFlags),r.writeUnsignedNumber(4,this.maxPacketSize),r.writeUnsignedNumber(1,this.charsetNumber),r.writeFiller(23)},FR}var kR,EH;function gAe(){if(EH)return kR;EH=1,kR=t;function t(){this.message=void 0}return t.prototype.parse=function(i){this.message=i.parsePacketTerminatedString();for(var r=this.message.split(/\s\s/),n=0;n<r.length;n++){var a=r[n].match(/^(.+)\:\s+(.+)$/);a!==null&&(this[a[1].toLowerCase().replace(/\s/g,"_")]=Number(a[2]))}},t.prototype.write=function(i){i.writeString(this.message)},kR}var HR,wH;function vAe(){if(wH)return HR;wH=1,HR=t;function t(i){i=i||{},this.firstByte=i.firstByte||254}return t.prototype.parse=function(i){this.firstByte=i.parseUnsignedNumber(1)},t.prototype.write=function(i){i.writeUnsignedNumber(1,this.firstByte)},HR}var bH;function QA(){return bH||(bH=1,Nr.AuthSwitchRequestPacket=Zde(),Nr.AuthSwitchResponsePacket=Jde(),Nr.ClientAuthenticationPacket=$de(),Nr.ComChangeUserPacket=eAe(),Nr.ComPingPacket=tAe(),Nr.ComQueryPacket=iAe(),Nr.ComQuitPacket=rAe(),Nr.ComStatisticsPacket=nAe(),Nr.EmptyPacket=aAe(),Nr.EofPacket=sAe(),Nr.ErrorPacket=oAe(),Nr.Field=$j(),Nr.FieldPacket=lAe(),Nr.HandshakeInitializationPacket=cAe(),Nr.LocalDataFilePacket=hAe(),Nr.LocalInfileRequestPacket=uAe(),Nr.OkPacket=dAe(),Nr.OldPasswordPacket=AAe(),Nr.ResultSetHeaderPacket=fAe(),Nr.RowDataPacket=pAe(),Nr.SSLRequestPacket=mAe(),Nr.StatisticsPacket=gAe(),Nr.UseOldPasswordPacket=vAe()),Nr}var GR={},SH;function _Ae(){return SH||(SH=1,function(t){t.EE_CANTCREATEFILE=1,t.EE_READ=2,t.EE_WRITE=3,t.EE_BADCLOSE=4,t.EE_OUTOFMEMORY=5,t.EE_DELETE=6,t.EE_LINK=7,t.EE_EOFERR=9,t.EE_CANTLOCK=10,t.EE_CANTUNLOCK=11,t.EE_DIR=12,t.EE_STAT=13,t.EE_CANT_CHSIZE=14,t.EE_CANT_OPEN_STREAM=15,t.EE_GETWD=16,t.EE_SETWD=17,t.EE_LINK_WARNING=18,t.EE_OPEN_WARNING=19,t.EE_DISK_FULL=20,t.EE_CANT_MKDIR=21,t.EE_UNKNOWN_CHARSET=22,t.EE_OUT_OF_FILERESOURCES=23,t.EE_CANT_READLINK=24,t.EE_CANT_SYMLINK=25,t.EE_REALPATH=26,t.EE_SYNC=27,t.EE_UNKNOWN_COLLATION=28,t.EE_FILENOTFOUND=29,t.EE_FILE_NOT_CLOSED=30,t.EE_CHANGE_OWNERSHIP=31,t.EE_CHANGE_PERMISSIONS=32,t.EE_CANT_SEEK=33,t.EE_CAPACITY_EXCEEDED=34,t.HA_ERR_KEY_NOT_FOUND=120,t.HA_ERR_FOUND_DUPP_KEY=121,t.HA_ERR_INTERNAL_ERROR=122,t.HA_ERR_RECORD_CHANGED=123,t.HA_ERR_WRONG_INDEX=124,t.HA_ERR_CRA
4573SHED=126,t.HA_ERR_WRONG_IN_RECORD=127,t.HA_ERR_OUT_OF_MEM=128,t.HA_ERR_NOT_A_TABLE=130,t.HA_ERR_WRONG_COMMAND=131,t.HA_ERR_OLD_FILE=132,t.HA_ERR_NO_ACTIVE_RECORD=133,t.HA_ERR_RECORD_DELETED=134,t.HA_ERR_RECORD_FILE_FULL=135,t.HA_ERR_INDEX_FILE_FULL=136,t.HA_ERR_END_OF_FILE=137,t.HA_ERR_UNSUPPORTED=138,t.HA_ERR_TOO_BIG_ROW=139,t.HA_WRONG_CREATE_OPTION=140,t.HA_ERR_FOUND_DUPP_UNIQUE=141,t.HA_ERR_UNKNOWN_CHARSET=142,t.HA_ERR_WRONG_MRG_TABLE_DEF=143,t.HA_ERR_CRASHED_ON_REPAIR=144,t.HA_ERR_CRASHED_ON_USAGE=145,t.HA_ERR_LOCK_WAIT_TIMEOUT=146,t.HA_ERR_LOCK_TABLE_FULL=147,t.HA_ERR_READ_ONLY_TRANSACTION=148,t.HA_ERR_LOCK_DEADLOCK=149,t.HA_ERR_CANNOT_ADD_FOREIGN=150,t.HA_ERR_NO_REFERENCED_ROW=151,t.HA_ERR_ROW_IS_REFERENCED=152,t.HA_ERR_NO_SAVEPOINT=153,t.HA_ERR_NON_UNIQUE_BLOCK_SIZE=154,t.HA_ERR_NO_SUCH_TABLE=155,t.HA_ERR_TABLE_EXIST=156,t.HA_ERR_NO_CONNECTION=157,t.HA_ERR_NULL_IN_SPATIAL=158,t.HA_ERR_TABLE_DEF_CHANGED=159,t.HA_ERR_NO_PARTITION_FOUND=160,t.HA_ERR_RBR_LOGGING_FAILED=161,t.HA_ERR_DROP_INDEX_FK=162,t.HA_ERR_FOREIGN_DUPLICATE_KEY=163,t.HA_ERR_TABLE_NEEDS_UPGRADE=164,t.HA_ERR_TABLE_READONLY=165,t.HA_ERR_AUTOINC_READ_FAILED=166,t.HA_ERR_AUTOINC_ERANGE=167,t.HA_ERR_GENERIC=168,t.HA_ERR_RECORD_IS_THE_SAME=169,t.HA_ERR_LOGGING_IMPOSSIBLE=170,t.HA_ERR_CORRUPT_EVENT=171,t.HA_ERR_NEW_FILE=172,t.HA_ERR_ROWS_EVENT_APPLY=173,t.HA_ERR_INITIALIZATION=174,t.HA_ERR_FILE_TOO_SHORT=175,t.HA_ERR_WRONG_CRC=176,t.HA_ERR_TOO_MANY_CONCURRENT_TRXS=177,t.HA_ERR_NOT_IN_LOCK_PARTITIONS=178,t.HA_ERR_INDEX_COL_TOO_LONG=179,t.HA_ERR_INDEX_CORRUPT=180,t.HA_ERR_UNDO_REC_TOO_BIG=181,t.HA_FTS_INVALID_DOCID=182,t.HA_ERR_TABLE_IN_FK_CHECK=183,t.HA_ERR_TABLESPACE_EXISTS=184,t.HA_ERR_TOO_MANY_FIELDS=185,t.HA_ERR_ROW_IN_WRONG_PARTITION=186,t.HA_ERR_INNODB_READ_ONLY=187,t.HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT=188,t.HA_ERR_TEMP_FILE_WRITE_FAILURE=189,t.HA_ERR_INNODB_FORCED_RECOVERY=190,t.HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE=191,t.HA_ERR_FK_DEPTH_EXCEEDED=192,t.HA_MISSING_CREATE_OPTION=193,t.HA_ERR_SE_OUT_OF_MEMORY=194,t.HA_ERR_TABLE_CORRUPT=195,t.HA_ERR_QUERY_INTERRUPTED=196,t.HA_ERR_TABLESPACE_MISSING=197,t.HA_ERR_TABLESPACE_IS_NOT_EMPTY=198,t.HA_ERR_WRONG_FILE_NAME=199,t.HA_ERR_NOT_ALLOWED_COMMAND=200,t.HA_ERR_COMPUTE_FAILED=201,t.ER_HASHCHK=1e3,t.ER_NISAMCHK=1001,t.ER_NO=1002,t.ER_YES=1003,t.ER_CANT_CREATE_FILE=1004,t.ER_CANT_CREATE_TABLE=1005,t.ER_CANT_CREATE_DB=1006,t.ER_DB_CREATE_EXISTS=1007,t.ER_DB_DROP_EXISTS=1008,t.ER_DB_DROP_DELETE=1009,t.ER_DB_DROP_RMDIR=1010,t.ER_CANT_DELETE_FILE=1011,t.ER_CANT_FIND_SYSTEM_REC=1012,t.ER_CANT_GET_STAT=1013,t.ER_CANT_GET_WD=1014,t.ER_CANT_LOCK=1015,t.ER_CANT_OPEN_FILE=1016,t.ER_FILE_NOT_FOUND=1017,t.ER_CANT_READ_DIR=1018,t.ER_CANT_SET_WD=1019,t.ER_CHECKREAD=1020,t.ER_DISK_FULL=1021,t.ER_DUP_KEY=1022,t.ER_ERROR_ON_CLOSE=1023,t.ER_ERROR_ON_READ=1024,t.ER_ERROR_ON_RENAME=1025,t.ER_ERROR_ON_WRITE=1026,t.ER_FILE_USED=1027,t.ER_FILSORT_ABORT=1028,t.ER_FORM_NOT_FOUND=1029,t.ER_GET_ERRNO=1030,t.ER_ILLEGAL_HA=1031,t.ER_KEY_NOT_FOUND=1032,t.ER_NOT_FORM_FILE=1033,t.ER_NOT_KEYFILE=1034,t.ER_OLD_KEYFILE=1035,t.ER_OPEN_AS_READONLY=1036,t.ER_OUTOFMEMORY=1037,t.ER_OUT_OF_SORTMEMORY=1038,t.ER_UNEXPECTED_EOF=1039,t.ER_CON_COUNT_ERROR=1040,t.ER_OUT_OF_RESOURCES=1041,t.ER_BAD_HOST_ERROR=1042,t.ER_HANDSHAKE_ERROR=1043,t.ER_DBACCESS_DENIED_ERROR=1044,t.ER_ACCESS_DENIED_ERROR=1045,t.ER_NO_DB_ERROR=1046,t.ER_UNKNOWN_COM_ERROR=1047,t.ER_BAD_NULL_ERROR=1048,t.ER_BAD_DB_ERROR=1049,t.ER_TABLE_EXISTS_ERROR=1050,t.ER_BAD_TABLE_ERROR=1051,t.ER_NON_UNIQ_ERROR=1052,t.ER_SERVER_SHUTDOWN=1053,t.ER_BAD_FIELD_ERROR=1054,t.ER_WRONG_FIELD_WITH_GROUP=1055,t.ER_WRONG_GROUP_FIELD=1056,t.ER_WRONG_SUM_SELECT=1057,t.ER_WRONG_VALUE_COUNT=1058,t.ER_TOO_LONG_IDENT=1059,t.ER_DUP_FIELDNAME=1060,t.ER_DUP_KEYNAME=1061,t.ER_DUP_ENTRY=1062,t.ER_WRONG_FIELD_SPEC=1063,t.ER_PARSE_ERROR=1064,t.ER_EMPTY_QUERY=1065,t.ER_NONUNIQ_TABLE=1066,t.ER_INVALID_DEFAULT=1067,t.ER_MULTIPLE_PRI_KEY=1068,t.ER_TOO_MANY_KEYS=1069,t.ER_TOO_MANY_KEY_PARTS=1070,t.ER_TOO_LONG_KEY=1071,t.ER_KEY_COLUMN_DOES_NOT_EXITS=1072,t.ER_BLOB_USED_AS_KEY=1073,t.ER_TOO_BIG_FIELDLENGTH=1074,t.ER_WRONG_AUTO_KEY=1075,t.ER_READY=1076,t.ER_NORMAL_SHUTDOWN=1077,t.ER_GOT_SIGNAL=1078,t.ER_SHUTDOWN_COMPLETE=1079,t.ER_FORCING_CLOSE=1080,t.ER_IPSOCK_ERROR=1081,t.ER_NO_SUCH_INDEX=1082,t.ER_WRONG_FIELD_TERMINATORS=1083,t.ER_BLOBS_AND_NO_TERMINATED=1084,t.ER_TEXTFILE_NOT_READABLE=1085,t.ER_FILE_EXISTS_ERROR=1086,t.ER_LOAD_INFO=1087,t.ER_ALTER_INFO=1088,t.ER_WRONG_SUB_KEY=1089,t.ER_CANT_REMOVE_ALL_FIELDS=1090,t.ER_CANT_DROP_FIELD_OR_KEY=1091,t.ER_INSERT_INFO=1092,t.ER_UPDATE_TABLE_USED=1093,t.ER_NO_SUCH_THREAD=1094,t.ER_KILL_DENIED_ERROR=1095,t.ER_NO_TABLES_USED=1096,t.ER_TOO_BIG_SET=1097,t.ER_NO_UNIQUE_LOGFILE=1098,t.ER_TABLE_NOT_LOCKED_FOR_WRITE=1099,t.ER_TABLE_NOT_LOCKED=1100,t.ER_BLOB_CANT_HAVE_DEFAULT=1101,t.ER_WRONG_DB_NAME=1102,t.ER_WRONG_TABLE_NAME=1103,t.ER_TOO_BIG_SELECT=1104,t.ER_UNKNOWN_ERROR=1105,t.ER_
4573UNKNOWN_PROCEDURE=1106,t.ER_WRONG_PARAMCOUNT_TO_PROCEDURE=1107,t.ER_WRONG_PARAMETERS_TO_PROCEDURE=1108,t.ER_UNKNOWN_TABLE=1109,t.ER_FIELD_SPECIFIED_TWICE=1110,t.ER_INVALID_GROUP_FUNC_USE=1111,t.ER_UNSUPPORTED_EXTENSION=1112,t.ER_TABLE_MUST_HAVE_COLUMNS=1113,t.ER_RECORD_FILE_FULL=1114,t.ER_UNKNOWN_CHARACTER_SET=1115,t.ER_TOO_MANY_TABLES=1116,t.ER_TOO_MANY_FIELDS=1117,t.ER_TOO_BIG_ROWSIZE=1118,t.ER_STACK_OVERRUN=1119,t.ER_WRONG_OUTER_JOIN=1120,t.ER_NULL_COLUMN_IN_INDEX=1121,t.ER_CANT_FIND_UDF=1122,t.ER_CANT_INITIALIZE_UDF=1123,t.ER_UDF_NO_PATHS=1124,t.ER_UDF_EXISTS=1125,t.ER_CANT_OPEN_LIBRARY=1126,t.ER_CANT_FIND_DL_ENTRY=1127,t.ER_FUNCTION_NOT_DEFINED=1128,t.ER_HOST_IS_BLOCKED=1129,t.ER_HOST_NOT_PRIVILEGED=1130,t.ER_PASSWORD_ANONYMOUS_USER=1131,t.ER_PASSWORD_NOT_ALLOWED=1132,t.ER_PASSWORD_NO_MATCH=1133,t.ER_UPDATE_INFO=1134,t.ER_CANT_CREATE_THREAD=1135,t.ER_WRONG_VALUE_COUNT_ON_ROW=1136,t.ER_CANT_REOPEN_TABLE=1137,t.ER_INVALID_USE_OF_NULL=1138,t.ER_REGEXP_ERROR=1139,t.ER_MIX_OF_GROUP_FUNC_AND_FIELDS=1140,t.ER_NONEXISTING_GRANT=1141,t.ER_TABLEACCESS_DENIED_ERROR=1142,t.ER_COLUMNACCESS_DENIED_ERROR=1143,t.ER_ILLEGAL_GRANT_FOR_TABLE=1144,t.ER_GRANT_WRONG_HOST_OR_USER=1145,t.ER_NO_SUCH_TABLE=1146,t.ER_NONEXISTING_TABLE_GRANT=1147,t.ER_NOT_ALLOWED_COMMAND=1148,t.ER_SYNTAX_ERROR=1149,t.ER_DELAYED_CANT_CHANGE_LOCK=1150,t.ER_TOO_MANY_DELAYED_THREADS=1151,t.ER_ABORTING_CONNECTION=1152,t.ER_NET_PACKET_TOO_LARGE=1153,t.ER_NET_READ_ERROR_FROM_PIPE=1154,t.ER_NET_FCNTL_ERROR=1155,t.ER_NET_PACKETS_OUT_OF_ORDER=1156,t.ER_NET_UNCOMPRESS_ERROR=1157,t.ER_NET_READ_ERROR=1158,t.ER_NET_READ_INTERRUPTED=1159,t.ER_NET_ERROR_ON_WRITE=1160,t.ER_NET_WRITE_INTERRUPTED=1161,t.ER_TOO_LONG_STRING=1162,t.ER_TABLE_CANT_HANDLE_BLOB=1163,t.ER_TABLE_CANT_HANDLE_AUTO_INCREMENT=1164,t.ER_DELAYED_INSERT_TABLE_LOCKED=1165,t.ER_WRONG_COLUMN_NAME=1166,t.ER_WRONG_KEY_COLUMN=1167,t.ER_WRONG_MRG_TABLE=1168,t.ER_DUP_UNIQUE=1169,t.ER_BLOB_KEY_WITHOUT_LENGTH=1170,t.ER_PRIMARY_CANT_HAVE_NULL=1171,t.ER_TOO_MANY_ROWS=1172,t.ER_REQUIRES_PRIMARY_KEY=1173,t.ER_NO_RAID_COMPILED=1174,t.ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE=1175,t.ER_KEY_DOES_NOT_EXITS=1176,t.ER_CHECK_NO_SUCH_TABLE=1177,t.ER_CHECK_NOT_IMPLEMENTED=1178,t.ER_CANT_DO_THIS_DURING_AN_TRANSACTION=1179,t.ER_ERROR_DURING_COMMIT=1180,t.ER_ERROR_DURING_ROLLBACK=1181,t.ER_ERROR_DURING_FLUSH_LOGS=1182,t.ER_ERROR_DURING_CHECKPOINT=1183,t.ER_NEW_ABORTING_CONNECTION=1184,t.ER_DUMP_NOT_IMPLEMENTED=1185,t.ER_FLUSH_MASTER_BINLOG_CLOSED=1186,t.ER_INDEX_REBUILD=1187,t.ER_MASTER=1188,t.ER_MASTER_NET_READ=1189,t.ER_MASTER_NET_WRITE=1190,t.ER_FT_MATCHING_KEY_NOT_FOUND=1191,t.ER_LOCK_OR_ACTIVE_TRANSACTION=1192,t.ER_UNKNOWN_SYSTEM_VARIABLE=1193,t.ER_CRASHED_ON_USAGE=1194,t.ER_CRASHED_ON_REPAIR=1195,t.ER_WARNING_NOT_COMPLETE_ROLLBACK=1196,t.ER_TRANS_CACHE_FULL=1197,t.ER_SLAVE_MUST_STOP=1198,t.ER_SLAVE_NOT_RUNNING=1199,t.ER_BAD_SLAVE=1200,t.ER_MASTER_INFO=1201,t.ER_SLAVE_THREAD=1202,t.ER_TOO_MANY_USER_CONNECTIONS=1203,t.ER_SET_CONSTANTS_ONLY=1204,t.ER_LOCK_WAIT_TIMEOUT=1205,t.ER_LOCK_TABLE_FULL=1206,t.ER_READ_ONLY_TRANSACTION=1207,t.ER_DROP_DB_WITH_READ_LOCK=1208,t.ER_CREATE_DB_WITH_READ_LOCK=1209,t.ER_WRONG_ARGUMENTS=1210,t.ER_NO_PERMISSION_TO_CREATE_USER=1211,t.ER_UNION_TABLES_IN_DIFFERENT_DIR=1212,t.ER_LOCK_DEADLOCK=1213,t.ER_TABLE_CANT_HANDLE_FT=1214,t.ER_CANNOT_ADD_FOREIGN=1215,t.ER_NO_REFERENCED_ROW=1216,t.ER_ROW_IS_REFERENCED=1217,t.ER_CONNECT_TO_MASTER=1218,t.ER_QUERY_ON_MASTER=1219,t.ER_ERROR_WHEN_EXECUTING_COMMAND=1220,t.ER_WRONG_USAGE=1221,t.ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT=1222,t.ER_CANT_UPDATE_WITH_READLOCK=1223,t.ER_MIXING_NOT_ALLOWED=1224,t.ER_DUP_ARGUMENT=1225,t.ER_USER_LIMIT_REACHED=1226,t.ER_SPECIFIC_ACCESS_DENIED_ERROR=1227,t.ER_LOCAL_VARIABLE=1228,t.ER_GLOBAL_VARIABLE=1229,t.ER_NO_DEFAULT=1230,t.ER_WRONG_VALUE_FOR_VAR=1231,t.ER_WRONG_TYPE_FOR_VAR=1232,t.ER_VAR_CANT_BE_READ=1233,t.ER_CANT_USE_OPTION_HERE=1234,t.ER_NOT_SUPPORTED_YET=1235,t.ER_MASTER_FATAL_ERROR_READING_BINLOG=1236,t.ER_SLAVE_IGNORED_TABLE=1237,t.ER_INCORRECT_GLOBAL_LOCAL_VAR=1238,t.ER_WRONG_FK_DEF=1239,t.ER_KEY_REF_DO_NOT_MATCH_TABLE_REF=1240,t.ER_OPERAND_COLUMNS=1241,t.ER_SUBQUERY_NO_1_ROW=1242,t.ER_UNKNOWN_STMT_HANDLER=1243,t.ER_CORRUPT_HELP_DB=1244,t.ER_CYCLIC_REFERENCE=1245,t.ER_AUTO_CONVERT=1246,t.ER_ILLEGAL_REFERENCE=1247,t.ER_DERIVED_MUST_HAVE_ALIAS=1248,t.ER_SELECT_REDUCED=1249,t.ER_TABLENAME_NOT_ALLOWED_HERE=1250,t.ER_NOT_SUPPORTED_AUTH_MODE=1251,t.ER_SPATIAL_CANT_HAVE_NULL=1252,t.ER_COLLATION_CHARSET_MISMATCH=1253,t.ER_SLAVE_WAS_RUNNING=1254,t.ER_SLAVE_WAS_NOT_RUNNING=1255,t.ER_TOO_BIG_FOR_UNCOMPRESS=1256,t.ER_ZLIB_Z_MEM_ERROR=1257,t.ER_ZLIB_Z_BUF_ER
4573ROR=1258,t.ER_ZLIB_Z_DATA_ERROR=1259,t.ER_CUT_VALUE_GROUP_CONCAT=1260,t.ER_WARN_TOO_FEW_RECORDS=1261,t.ER_WARN_TOO_MANY_RECORDS=1262,t.ER_WARN_NULL_TO_NOTNULL=1263,t.ER_WARN_DATA_OUT_OF_RANGE=1264,t.WARN_DATA_TRUNCATED=1265,t.ER_WARN_USING_OTHER_HANDLER=1266,t.ER_CANT_AGGREGATE_2COLLATIONS=1267,t.ER_DROP_USER=1268,t.ER_REVOKE_GRANTS=1269,t.ER_CANT_AGGREGATE_3COLLATIONS=1270,t.ER_CANT_AGGREGATE_NCOLLATIONS=1271,t.ER_VARIABLE_IS_NOT_STRUCT=1272,t.ER_UNKNOWN_COLLATION=1273,t.ER_SLAVE_IGNORED_SSL_PARAMS=1274,t.ER_SERVER_IS_IN_SECURE_AUTH_MODE=1275,t.ER_WARN_FIELD_RESOLVED=1276,t.ER_BAD_SLAVE_UNTIL_COND=1277,t.ER_MISSING_SKIP_SLAVE=1278,t.ER_UNTIL_COND_IGNORED=1279,t.ER_WRONG_NAME_FOR_INDEX=1280,t.ER_WRONG_NAME_FOR_CATALOG=1281,t.ER_WARN_QC_RESIZE=1282,t.ER_BAD_FT_COLUMN=1283,t.ER_UNKNOWN_KEY_CACHE=1284,t.ER_WARN_HOSTNAME_WONT_WORK=1285,t.ER_UNKNOWN_STORAGE_ENGINE=1286,t.ER_WARN_DEPRECATED_SYNTAX=1287,t.ER_NON_UPDATABLE_TABLE=1288,t.ER_FEATURE_DISABLED=1289,t.ER_OPTION_PREVENTS_STATEMENT=1290,t.ER_DUPLICATED_VALUE_IN_TYPE=1291,t.ER_TRUNCATED_WRONG_VALUE=1292,t.ER_TOO_MUCH_AUTO_TIMESTAMP_COLS=1293,t.ER_INVALID_ON_UPDATE=1294,t.ER_UNSUPPORTED_PS=1295,t.ER_GET_ERRMSG=1296,t.ER_GET_TEMPORARY_ERRMSG=1297,t.ER_UNKNOWN_TIME_ZONE=1298,t.ER_WARN_INVALID_TIMESTAMP=1299,t.ER_INVALID_CHARACTER_STRING=1300,t.ER_WARN_ALLOWED_PACKET_OVERFLOWED=1301,t.ER_CONFLICTING_DECLARATIONS=1302,t.ER_SP_NO_RECURSIVE_CREATE=1303,t.ER_SP_ALREADY_EXISTS=1304,t.ER_SP_DOES_NOT_EXIST=1305,t.ER_SP_DROP_FAILED=1306,t.ER_SP_STORE_FAILED=1307,t.ER_SP_LILABEL_MISMATCH=1308,t.ER_SP_LABEL_REDEFINE=1309,t.ER_SP_LABEL_MISMATCH=1310,t.ER_SP_UNINIT_VAR=1311,t.ER_SP_BADSELECT=1312,t.ER_SP_BADRETURN=1313,t.ER_SP_BADSTATEMENT=1314,t.ER_UPDATE_LOG_DEPRECATED_IGNORED=1315,t.ER_UPDATE_LOG_DEPRECATED_TRANSLATED=1316,t.ER_QUERY_INTERRUPTED=1317,t.ER_SP_WRONG_NO_OF_ARGS=1318,t.ER_SP_COND_MISMATCH=1319,t.ER_SP_NORETURN=1320,t.ER_SP_NORETURNEND=1321,t.ER_SP_BAD_CURSOR_QUERY=1322,t.ER_SP_BAD_CURSOR_SELECT=1323,t.ER_SP_CURSOR_MISMATCH=1324,t.ER_SP_CURSOR_ALREADY_OPEN=1325,t.ER_SP_CURSOR_NOT_OPEN=1326,t.ER_SP_UNDECLARED_VAR=1327,t.ER_SP_WRONG_NO_OF_FETCH_ARGS=1328,t.ER_SP_FETCH_NO_DATA=1329,t.ER_SP_DUP_PARAM=1330,t.ER_SP_DUP_VAR=1331,t.ER_SP_DUP_COND=1332,t.ER_SP_DUP_CURS=1333,t.ER_SP_CANT_ALTER=1334,t.ER_SP_SUBSELECT_NYI=1335,t.ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG=1336,t.ER_SP_VARCOND_AFTER_CURSHNDLR=1337,t.ER_SP_CURSOR_AFTER_HANDLER=1338,t.ER_SP_CASE_NOT_FOUND=1339,t.ER_FPARSER_TOO_BIG_FILE=1340,t.ER_FPARSER_BAD_HEADER=1341,t.ER_FPARSER_EOF_IN_COMMENT=1342,t.ER_FPARSER_ERROR_IN_PARAMETER=1343,t.ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER=1344,t.ER_VIEW_NO_EXPLAIN=1345,t.ER_FRM_UNKNOWN_TYPE=1346,t.ER_WRONG_OBJECT=1347,t.ER_NONUPDATEABLE_COLUMN=1348,t.ER_VIEW_SELECT_DERIVED=1349,t.ER_VIEW_SELECT_CLAUSE=1350,t.ER_VIEW_SELECT_VARIABLE=1351,t.ER_VIEW_SELECT_TMPTABLE=1352,t.ER_VIEW_WRONG_LIST=1353,t.ER_WARN_VIEW_MERGE=1354,t.ER_WARN_VIEW_WITHOUT_KEY=1355,t.ER_VIEW_INVALID=1356,t.ER_SP_NO_DROP_SP=1357,t.ER_SP_GOTO_IN_HNDLR=1358,t.ER_TRG_ALREADY_EXISTS=1359,t.ER_TRG_DOES_NOT_EXIST=1360,t.ER_TRG_ON_VIEW_OR_TEMP_TABLE=1361,t.ER_TRG_CANT_CHANGE_ROW=1362,t.ER_TRG_NO_SUCH_ROW_IN_TRG=1363,t.ER_NO_DEFAULT_FOR_FIELD=1364,t.ER_DIVISION_BY_ZERO=1365,t.ER_TRUNCATED_WRONG_VALUE_FOR_FIELD=1366,t.ER_ILLEGAL_VALUE_FOR_TYPE=1367,t.ER_VIEW_NONUPD_CHECK=1368,t.ER_VIEW_CHECK_FAILED=1369,t.ER_PROCACCESS_DENIED_ERROR=1370,t.ER_RELAY_LOG_FAIL=1371,t.ER_PASSWD_LENGTH=1372,t.ER_UNKNOWN_TARGET_BINLOG=1373,t.ER_IO_ERR_LOG_INDEX_READ=1374,t.ER_BINLOG_PURGE_PROHIBITED=1375,t.ER_FSEEK_FAIL=1376,t.ER_BINLOG_PURGE_FATAL_ERR=1377,t.ER_LOG_IN_USE=1378,t.ER_LOG_PURGE_UNKNOWN_ERR=1379,t.ER_RELAY_LOG_INIT=1380,t.ER_NO_BINARY_LOGGING=1381,t.ER_RESERVED_SYNTAX=1382,t.ER_WSAS_FAILED=1383,t.ER_DIFF_GROUPS_PROC=1384,t.ER_NO_GROUP_FOR_PROC=1385,t.ER_ORDER_WITH_PROC=1386,t.ER_LOGGING_PROHIBIT_CHANGING_OF=1387,t.ER_NO_FILE_MAPPING=1388,t.ER_WRONG_MAGIC=1389,t.ER_PS_MANY_PARAM=1390,t.ER_KEY_PART_0=1391,t.ER_VIEW_CHECKSUM=1392,t.ER_VIEW_MULTIUPDATE=1393,t.ER_VIEW_NO_INSERT_FIELD_LIST=1394,t.ER_VIEW_DELETE_MERGE_VIEW=1395,t.ER_CANNOT_USER=1396,t.ER_XAER_NOTA=1397,t.ER_XAER_INVAL=1398,t.ER_XAER_RMFAIL=1399,t.ER_XAER_OUTSIDE=1400,t.ER_XAER_RMERR=1401,t.ER_XA_RBROLLBACK=1402,t.ER_NONEXISTING_PROC_GRANT=1403,t.ER_PROC_AUTO_GRANT_FAIL=1404,t.ER_PROC_AUTO_REVOKE_FAIL=1405,t.ER_DATA_TOO_LONG=1406,t.ER_SP_BAD_SQLSTATE=1407,t.ER_STARTUP=14
457308,t.ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR=1409,t.ER_CANT_CREATE_USER_WITH_GRANT=1410,t.ER_WRONG_VALUE_FOR_TYPE=1411,t.ER_TABLE_DEF_CHANGED=1412,t.ER_SP_DUP_HANDLER=1413,t.ER_SP_NOT_VAR_ARG=1414,t.ER_SP_NO_RETSET=1415,t.ER_CANT_CREATE_GEOMETRY_OBJECT=1416,t.ER_FAILED_ROUTINE_BREAK_BINLOG=1417,t.ER_BINLOG_UNSAFE_ROUTINE=1418,t.ER_BINLOG_CREATE_ROUTINE_NEED_SUPER=1419,t.ER_EXEC_STMT_WITH_OPEN_CURSOR=1420,t.ER_STMT_HAS_NO_OPEN_CURSOR=1421,t.ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG=1422,t.ER_NO_DEFAULT_FOR_VIEW_FIELD=1423,t.ER_SP_NO_RECURSION=1424,t.ER_TOO_BIG_SCALE=1425,t.ER_TOO_BIG_PRECISION=1426,t.ER_M_BIGGER_THAN_D=1427,t.ER_WRONG_LOCK_OF_SYSTEM_TABLE=1428,t.ER_CONNECT_TO_FOREIGN_DATA_SOURCE=1429,t.ER_QUERY_ON_FOREIGN_DATA_SOURCE=1430,t.ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST=1431,t.ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE=1432,t.ER_FOREIGN_DATA_STRING_INVALID=1433,t.ER_CANT_CREATE_FEDERATED_TABLE=1434,t.ER_TRG_IN_WRONG_SCHEMA=1435,t.ER_STACK_OVERRUN_NEED_MORE=1436,t.ER_TOO_LONG_BODY=1437,t.ER_WARN_CANT_DROP_DEFAULT_KEYCACHE=1438,t.ER_TOO_BIG_DISPLAYWIDTH=1439,t.ER_XAER_DUPID=1440,t.ER_DATETIME_FUNCTION_OVERFLOW=1441,t.ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG=1442,t.ER_VIEW_PREVENT_UPDATE=1443,t.ER_PS_NO_RECURSION=1444,t.ER_SP_CANT_SET_AUTOCOMMIT=1445,t.ER_MALFORMED_DEFINER=1446,t.ER_VIEW_FRM_NO_USER=1447,t.ER_VIEW_OTHER_USER=1448,t.ER_NO_SUCH_USER=1449,t.ER_FORBID_SCHEMA_CHANGE=1450,t.ER_ROW_IS_REFERENCED_2=1451,t.ER_NO_REFERENCED_ROW_2=1452,t.ER_SP_BAD_VAR_SHADOW=1453,t.ER_TRG_NO_DEFINER=1454,t.ER_OLD_FILE_FORMAT=1455,t.ER_SP_RECURSION_LIMIT=1456,t.ER_SP_PROC_TABLE_CORRUPT=1457,t.ER_SP_WRONG_NAME=1458,t.ER_TABLE_NEEDS_UPGRADE=1459,t.ER_SP_NO_AGGREGATE=1460,t.ER_MAX_PREPARED_STMT_COUNT_REACHED=1461,t.ER_VIEW_RECURSIVE=1462,t.ER_NON_GROUPING_FIELD_USED=1463,t.ER_TABLE_CANT_HANDLE_SPKEYS=1464,t.ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA=1465,t.ER_REMOVED_SPACES=1466,t.ER_AUTOINC_READ_FAILED=1467,t.ER_USERNAME=1468,t.ER_HOSTNAME=1469,t.ER_WRONG_STRING_LENGTH=1470,t.ER_NON_INSERTABLE_TABLE=1471,t.ER_ADMIN_WRONG_MRG_TABLE=1472,t.ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT=1473,t.ER_NAME_BECOMES_EMPTY=1474,t.ER_AMBIGUOUS_FIELD_TERM=1475,t.ER_FOREIGN_SERVER_EXISTS=1476,t.ER_FOREIGN_SERVER_DOESNT_EXIST=1477,t.ER_ILLEGAL_HA_CREATE_OPTION=1478,t.ER_PARTITION_REQUIRES_VALUES_ERROR=1479,t.ER_PARTITION_WRONG_VALUES_ERROR=1480,t.ER_PARTITION_MAXVALUE_ERROR=1481,t.ER_PARTITION_SUBPARTITION_ERROR=1482,t.ER_PARTITION_SUBPART_MIX_ERROR=1483,t.ER_PARTITION_WRONG_NO_PART_ERROR=1484,t.ER_PARTITION_WRONG_NO_SUBPART_ERROR=1485,t.ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR=1486,t.ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR=1487,t.ER_FIELD_NOT_FOUND_PART_ERROR=1488,t.ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR=1489,t.ER_INCONSISTENT_PARTITION_INFO_ERROR=1490,t.ER_PARTITION_FUNC_NOT_ALLOWED_ERROR=1491,t.ER_PARTITIONS_MUST_BE_DEFINED_ERROR=1492,t.ER_RANGE_NOT_INCREASING_ERROR=1493,t.ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR=1494,t.ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR=1495,t.ER_PARTITION_ENTRY_ERROR=1496,t.ER_MIX_HANDLER_ERROR=1497,t.ER_PARTITION_NOT_DEFINED_ERROR=1498,t.ER_TOO_MANY_PARTITIONS_ERROR=1499,t.ER_SUBPARTITION_ERROR=1500,t.ER_CANT_CREATE_HANDLER_FILE=1501,t.ER_BLOB_FIELD_IN_PART_FUNC_ERROR=1502,t.ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF=1503,t.ER_NO_PARTS_ERROR=1504,t.ER_PARTITION_MGMT_ON_NONPARTITIONED=1505,t.ER_FOREIGN_KEY_ON_PARTITIONED=1506,t.ER_DROP_PARTITION_NON_EXISTENT=1507,t.ER_DROP_LAST_PARTITION=1508,t.ER_COALESCE_ONLY_ON_HASH_PARTITION=1509,t.ER_REORG_HASH_ONLY_ON_SAME_NO=1510,t.ER_REORG_NO_PARAM_ERROR=1511,t.ER_ONLY_ON_RANGE_LIST_PARTITION=1512,t.ER_ADD_PARTITION_SUBPART_ERROR=1513,t.ER_ADD_PARTITION_NO_NEW_PARTITION=1514,t.ER_COALESCE_PARTITION_NO_PARTITION=1515,t.ER_REORG_PARTITION_NOT_EXIST=1516,t.ER_SAME_NAME_PARTITION=1517,t.ER_NO_BINLOG_ERROR=1518,t.ER_CONSECUTIVE_REORG_PARTITIONS=1519,t.ER_REORG_OUTSIDE_RANGE=1520,t.ER_PARTITION_FUNCTION_FAILURE=1521,t.ER_PART_STATE_ERROR=1522,t.ER_LIMITED_PART_RANGE=1523,t.ER_PLUGIN_IS_NOT_LOADED=1524,t.ER_WRONG_VALUE=1525,t.ER_NO_PARTITION_FOR_GIVEN_VALUE=1526,t.ER_FILEGROUP_OPTION_ONLY_ONCE=1527,t.ER_CREATE_FILEGROUP_FAILED=1528,t.ER_DROP_FILEGROUP_FAILED=1529,t.ER_TABLESPACE_AUTO_EXTEND_ERROR=1530,t.ER_WRONG_SIZE_NUMBER=1531,t.ER_SIZE_OVERFLOW_ERROR=1532,t.ER_ALTER_FILEGROUP_FAILED=1533,t.ER_BINLOG_ROW_LOGGING_FAILED=1534,t.ER_BINLOG_ROW_WRONG_TABLE_DEF=1535,t.ER_BINLOG_ROW_RBR_TO_SBR=1536,t.ER_EVENT_ALREADY_EXISTS=1537,t.ER_EVENT_STORE_FAILED=1538,t.ER_EVENT_DOES_NOT_EXIST=1539,t.ER_EVENT_CANT_ALTER=1540,t.ER_EVENT_DROP_FAILED=1541,t.ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG=1542,t.ER_EVENT_ENDS_BEFORE_STARTS=1543,t.ER_EVENT_EXEC_TIME_IN_THE_PAST=1544,t.ER_EVENT_OPEN_TABLE_FAILED=1545,t.ER_EVENT_NEITHER_M_EXPR_NOR_M_AT=1546,t.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED=1547,t.ER_CANNOT_LOAD_FROM_TABLE=1548,t.ER_EVENT_CANNOT_DELETE=1549,t.ER_EVENT_COMPILE_ERROR=1550,t.ER_EVENT_SAME_NAME=1551,t.ER_EVENT_DATA_TOO_LONG=1552,t.ER_DROP_INDEX_FK=1553,t.ER_WARN_DEPRECATED_SYNTAX_WITH_VER=1554,t.ER_CANT_WRITE_LO
4573CK_LOG_TABLE=1555,t.ER_CANT_LOCK_LOG_TABLE=1556,t.ER_FOREIGN_DUPLICATE_KEY=1557,t.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE=1558,t.ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR=1559,t.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT=1560,t.ER_NDB_CANT_SWITCH_BINLOG_FORMAT=1561,t.ER_PARTITION_NO_TEMPORARY=1562,t.ER_PARTITION_CONST_DOMAIN_ERROR=1563,t.ER_PARTITION_FUNCTION_IS_NOT_ALLOWED=1564,t.ER_DDL_LOG_ERROR=1565,t.ER_NULL_IN_VALUES_LESS_THAN=1566,t.ER_WRONG_PARTITION_NAME=1567,t.ER_CANT_CHANGE_TX_CHARACTERISTICS=1568,t.ER_DUP_ENTRY_AUTOINCREMENT_CASE=1569,t.ER_EVENT_MODIFY_QUEUE_ERROR=1570,t.ER_EVENT_SET_VAR_ERROR=1571,t.ER_PARTITION_MERGE_ERROR=1572,t.ER_CANT_ACTIVATE_LOG=1573,t.ER_RBR_NOT_AVAILABLE=1574,t.ER_BASE64_DECODE_ERROR=1575,t.ER_EVENT_RECURSION_FORBIDDEN=1576,t.ER_EVENTS_DB_ERROR=1577,t.ER_ONLY_INTEGERS_ALLOWED=1578,t.ER_UNSUPORTED_LOG_ENGINE=1579,t.ER_BAD_LOG_STATEMENT=1580,t.ER_CANT_RENAME_LOG_TABLE=1581,t.ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT=1582,t.ER_WRONG_PARAMETERS_TO_NATIVE_FCT=1583,t.ER_WRONG_PARAMETERS_TO_STORED_FCT=1584,t.ER_NATIVE_FCT_NAME_COLLISION=1585,t.ER_DUP_ENTRY_WITH_KEY_NAME=1586,t.ER_BINLOG_PURGE_EMFILE=1587,t.ER_EVENT_CANNOT_CREATE_IN_THE_PAST=1588,t.ER_EVENT_CANNOT_ALTER_IN_THE_PAST=1589,t.ER_SLAVE_INCIDENT=1590,t.ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT=1591,t.ER_BINLOG_UNSAFE_STATEMENT=1592,t.ER_SLAVE_FATAL_ERROR=1593,t.ER_SLAVE_RELAY_LOG_READ_FAILURE=1594,t.ER_SLAVE_RELAY_LOG_WRITE_FAILURE=1595,t.ER_SLAVE_CREATE_EVENT_FAILURE=1596,t.ER_SLAVE_MASTER_COM_FAILURE=1597,t.ER_BINLOG_LOGGING_IMPOSSIBLE=1598,t.ER_VIEW_NO_CREATION_CTX=1599,t.ER_VIEW_INVALID_CREATION_CTX=1600,t.ER_SR_INVALID_CREATION_CTX=1601,t.ER_TRG_CORRUPTED_FILE=1602,t.ER_TRG_NO_CREATION_CTX=1603,t.ER_TRG_INVALID_CREATION_CTX=1604,t.ER_EVENT_INVALID_CREATION_CTX=1605,t.ER_TRG_CANT_OPEN_TABLE=1606,t.ER_CANT_CREATE_SROUTINE=1607,t.ER_NEVER_USED=1608,t.ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT=1609,t.ER_SLAVE_CORRUPT_EVENT=1610,t.ER_LOAD_DATA_INVALID_COLUMN=1611,t.ER_LOG_PURGE_NO_FILE=1612,t.ER_XA_RBTIMEOUT=1613,t.ER_XA_RBDEADLOCK=1614,t.ER_NEED_REPREPARE=1615,t.ER_DELAYED_NOT_SUPPORTED=1616,t.WARN_NO_MASTER_INFO=1617,t.WARN_OPTION_IGNORED=1618,t.ER_PLUGIN_DELETE_BUILTIN=1619,t.WARN_PLUGIN_BUSY=1620,t.ER_VARIABLE_IS_READONLY=1621,t.ER_WARN_ENGINE_TRANSACTION_ROLLBACK=1622,t.ER_SLAVE_HEARTBEAT_FAILURE=1623,t.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE=1624,t.ER_NDB_REPLICATION_SCHEMA_ERROR=1625,t.ER_CONFLICT_FN_PARSE_ERROR=1626,t.ER_EXCEPTIONS_WRITE_ERROR=1627,t.ER_TOO_LONG_TABLE_COMMENT=1628,t.ER_TOO_LONG_FIELD_COMMENT=1629,t.ER_FUNC_INEXISTENT_NAME_COLLISION=1630,t.ER_DATABASE_NAME=1631,t.ER_TABLE_NAME=1632,t.ER_PARTITION_NAME=1633,t.ER_SUBPARTITION_NAME=1634,t.ER_TEMPORARY_NAME=1635,t.ER_RENAMED_NAME=1636,t.ER_TOO_MANY_CONCURRENT_TRXS=1637,t.WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED=1638,t.ER_DEBUG_SYNC_TIMEOUT=1639,t.ER_DEBUG_SYNC_HIT_LIMIT=1640,t.ER_DUP_SIGNAL_SET=1641,t.ER_SIGNAL_WARN=1642,t.ER_SIGNAL_NOT_FOUND=1643,t.ER_SIGNAL_EXCEPTION=1644,t.ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER=1645,t.ER_SIGNAL_BAD_CONDITION_TYPE=1646,t.WARN_COND_ITEM_TRUNCATED=1647,t.ER_COND_ITEM_TOO_LONG=1648,t.ER_UNKNOWN_LOCALE=1649,t.ER_SLAVE_IGNORE_SERVER_IDS=1650,t.ER_QUERY_CACHE_DISABLED=1651,t.ER_SAME_NAME_PARTITION_FIELD=1652,t.ER_PARTITION_COLUMN_LIST_ERROR=1653,t.ER_WRONG_TYPE_COLUMN_VALUE_ERROR=1654,t.ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR=1655,t.ER_MAXVALUE_IN_VALUES_IN=1656,t.ER_TOO_MANY_VALUES_ERROR=1657,t.ER_ROW_SINGLE_PARTITION_FIELD_ERROR=1658,t.ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD=1659,t.ER_PARTITION_FIELDS_TOO_LONG=1660,t.ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE=1661,t.ER_BINLOG_ROW_MODE_AND_STMT_ENGINE=1662,t.ER_BINLOG_UNSAFE_AND_STMT_ENGINE=1663,t.ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE=1664,t.ER_BINLOG_STMT_MODE_AND_ROW_ENGINE=1665,t.ER_BINLOG_ROW_INJECTION_AND_STMT_MODE=1666,t.ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE=1667,t.ER_BINLOG_UNSAFE_LIMIT=1668,t.ER_BINLOG_UNSAFE_INSERT_DELAYED=1669,t.ER_BINLOG_UNSAFE_SYSTEM_TABLE=1670,t.ER_BINLOG_UNSAFE_AUTOINC_COLUMNS=1671,t.ER_BINLOG_UNSAFE_UDF=1672,t.ER_BINLOG_UNSAFE_SYSTEM_VARIABLE=1673,t.ER_BINLOG_UNSAFE_SYSTEM_FUNCTION=1674,t.ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS=1675,t.ER_MESSAGE_AND_STATEMENT=1676,t.ER_SLAVE_CONVERSION_FAILED=1677,t.ER_SLAVE_CANT_CREATE_CONVERSION=1678,t.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT=1679,t.ER_PATH_LENGTH=1680,t.ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT=1681,t.ER_WRONG_NATIVE_TABLE_STRUCTURE=1682,t.ER_WRONG_PERFSCHEMA_USAGE=1683,t.ER_WARN_I_S_SKIPPED_TABLE=1684,t.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT=1685,t.ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT=1686,t.ER_SPATIAL_MUST_HAVE_GEOM_COL=1687,t.ER_TOO_LONG_INDEX_COMMENT=1688,t.ER_LOCK_ABORTED=1689,t.ER_DATA_OUT_OF_RANGE=1690,t.ER_WRONG_SPVAR_TYPE_IN_LIMIT=1691,t.ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE=1692,t.ER_BINLOG_UNSAFE_MIXED_STATE
4573MENT=1693,t.ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN=1694,t.ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN=1695,t.ER_FAILED_READ_FROM_PAR_FILE=1696,t.ER_VALUES_IS_NOT_INT_TYPE_ERROR=1697,t.ER_ACCESS_DENIED_NO_PASSWORD_ERROR=1698,t.ER_SET_PASSWORD_AUTH_PLUGIN=1699,t.ER_GRANT_PLUGIN_USER_EXISTS=1700,t.ER_TRUNCATE_ILLEGAL_FK=1701,t.ER_PLUGIN_IS_PERMANENT=1702,t.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN=1703,t.ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX=1704,t.ER_STMT_CACHE_FULL=1705,t.ER_MULTI_UPDATE_KEY_CONFLICT=1706,t.ER_TABLE_NEEDS_REBUILD=1707,t.WARN_OPTION_BELOW_LIMIT=1708,t.ER_INDEX_COLUMN_TOO_LONG=1709,t.ER_ERROR_IN_TRIGGER_BODY=1710,t.ER_ERROR_IN_UNKNOWN_TRIGGER_BODY=1711,t.ER_INDEX_CORRUPT=1712,t.ER_UNDO_RECORD_TOO_BIG=1713,t.ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT=1714,t.ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE=1715,t.ER_BINLOG_UNSAFE_REPLACE_SELECT=1716,t.ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT=1717,t.ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT=1718,t.ER_BINLOG_UNSAFE_UPDATE_IGNORE=1719,t.ER_PLUGIN_NO_UNINSTALL=1720,t.ER_PLUGIN_NO_INSTALL=1721,t.ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT=1722,t.ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC=1723,t.ER_BINLOG_UNSAFE_INSERT_TWO_KEYS=1724,t.ER_TABLE_IN_FK_CHECK=1725,t.ER_UNSUPPORTED_ENGINE=1726,t.ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST=1727,t.ER_CANNOT_LOAD_FROM_TABLE_V2=1728,t.ER_MASTER_DELAY_VALUE_OUT_OF_RANGE=1729,t.ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT=1730,t.ER_PARTITION_EXCHANGE_DIFFERENT_OPTION=1731,t.ER_PARTITION_EXCHANGE_PART_TABLE=1732,t.ER_PARTITION_EXCHANGE_TEMP_TABLE=1733,t.ER_PARTITION_INSTEAD_OF_SUBPARTITION=1734,t.ER_UNKNOWN_PARTITION=1735,t.ER_TABLES_DIFFERENT_METADATA=1736,t.ER_ROW_DOES_NOT_MATCH_PARTITION=1737,t.ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX=1738,t.ER_WARN_INDEX_NOT_APPLICABLE=1739,t.ER_PARTITION_EXCHANGE_FOREIGN_KEY=1740,t.ER_NO_SUCH_KEY_VALUE=1741,t.ER_RPL_INFO_DATA_TOO_LONG=1742,t.ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE=1743,t.ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE=1744,t.ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX=1745,t.ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT=1746,t.ER_PARTITION_CLAUSE_ON_NONPARTITIONED=1747,t.ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET=1748,t.ER_NO_SUCH_PARTITION=1749,t.ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE=1750,t.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE=1751,t.ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE=1752,t.ER_MTS_FEATURE_IS_NOT_SUPPORTED=1753,t.ER_MTS_UPDATED_DBS_GREATER_MAX=1754,t.ER_MTS_CANT_PARALLEL=1755,t.ER_MTS_INCONSISTENT_DATA=1756,t.ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING=1757,t.ER_DA_INVALID_CONDITION_NUMBER=1758,t.ER_INSECURE_PLAIN_TEXT=1759,t.ER_INSECURE_CHANGE_MASTER=1760,t.ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO=1761,t.ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO=1762,t.ER_SQLTHREAD_WITH_SECURE_SLAVE=1763,t.ER_TABLE_HAS_NO_FT=1764,t.ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER=1765,t.ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION=1766,t.ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST=1767,t.ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION=1768,t.ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION=1769,t.ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL=1770,t.ER_SKIPPING_LOGGED_TRANSACTION=1771,t.ER_MALFORMED_GTID_SET_SPECIFICATION=1772,t.ER_MALFORMED_GTID_SET_ENCODING=1773,t.ER_MALFORMED_GTID_SPECIFICATION=1774,t.ER_GNO_EXHAUSTED=1775,t.ER_BAD_SLAVE_AUTO_POSITION=1776,t.ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF=1777,t.ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET=1778,t.ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON=1779,t.ER_GTID_MODE_REQUIRES_BINLOG=1780,t.ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF=1781,t.ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON=1782,t.ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF=1783,t.ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF=1784,t.ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE=1785,t.ER_GTID_UNSAFE_CREATE_SELECT=1786,t.ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION=1787,t.ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME=1788,t.ER_MASTER_HAS_PURGED_REQUIRED_GTIDS=1789,t.ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID=1790,t.ER_UNKNOWN_EXPLAIN_FORMAT=1791,t.ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION=1792,t.ER_TOO_LONG_TABLE_PARTITION_COMMENT=1793,t.ER_SLAVE_CONFIGURATION=1794,t.ER_INNODB_FT_LIMIT=1795,t.ER_INNODB_NO_FT_TEMP_TABLE=1796,t.ER_INNODB_FT_WRONG_DOCID_COLUMN=1797,t.ER_INNODB_FT_WRONG_DOCID_INDEX=1798,t.ER_INNODB_ONLINE_LOG_TOO_BIG=1799,t.ER_UNKNOWN_ALTER_ALGORITHM=1800,t.ER_UNKNOWN_ALTER_LOCK=1801,t.ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS=1802,t.ER_MTS_RECOVERY_FAILURE=1803,t.ER_MTS_RESET_WORKERS=1804,t.ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2=1805,t.ER_SLAVE_SILENT_RETRY_TRANSACTION=1806,t.ER_DISCARD_FK_CHECKS_RUNNING=1807,t.ER_TABLE_SCHEMA_MISMATCH=1808,t.ER_TABLE_IN_SYSTEM_TABLESPACE=1809,t.ER_IO_READ_ERROR=1810,t.ER_IO_WRITE_ERROR=1811,t.ER_TABLESPACE_MISSING=1812,t.ER_TABLESPACE_EXISTS=1813,t.ER_TABLESPACE_DISCARDED=1814,t.ER_INTERNAL_ERROR=1815,t.ER_INNODB_IMPORT_ERROR=1816,t.ER_INNODB_INDEX_CORRUPT=1817,t.ER_INVALID_YEAR_COLUMN_LENGTH=1818,t.ER_NOT_VALID_PASSWORD=1819,t.ER_MUST_CHANGE_PASSWORD=1820,t.ER_FK_NO_INDEX_CHILD=1821,t.ER_FK_NO_INDEX_PARENT=1822,t.ER_FK_FAIL_ADD_SYSTEM=1823,t.ER_FK_CANNOT_OPEN_PARENT=1824,t.ER_FK_INCORRECT_OPTION=1825,t.ER_FK_DUP_NAME=1826,t.ER_PASSWORD_FORMAT=1827,t.ER_FK_COLUMN_CANNOT_DROP=1828,t.ER_FK_COLUMN_CANNOT_DROP_CHILD=1829,t.ER_FK_COLUMN_NOT_NULL=1830,t.ER_DUP_INDEX=1831,t.ER_FK_COLUMN_CANNOT_CHANGE=1832,t.ER_FK_COLUMN_CANNOT_CHANGE_CHILD=1833,t.ER_FK_CANNOT_DELETE_PARENT=1834,t.ER_MALFORMED_PACKET=1835,t.ER_READ_ONLY_MODE=1836,t.ER_GTID_NEXT_TYPE_UNDEFINED_GROUP=1837,t.ER_VARIABLE_NOT_SETTABLE_IN_SP=1838,t.ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF=1839,t.ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY=1840,t.ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY=1841,t.ER_GTID_PURGED_WAS_CHANGED=1842,t.ER_GTID_EXECUTED_WAS_CHANGED=1843,t.ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES=1844,t.ER_ALTER_OPERATION_NOT_SUPPORTED=1845,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON=1846,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY=1847,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION=1848,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME=1849,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE=1850,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK=1851,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE=1852,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK=1853,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC=1854,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS=1855,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS=1856,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS=1857,t.ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE=1858,t.ER_DUP_UNKNOWN_IN_INDEX=1859,t.ER_IDENT_CAUSES_TOO_LONG_PATH=1860,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL=1861,t.ER_MUST_CHANGE_PASSWORD_LOGIN=1862,t.ER_ROW_IN_WRONG_PARTITION=1863,t.ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX=1864,t.ER_INNODB_NO_FT_USES_PARSER=1865,t.ER_BINLOG_LOGICAL_CORRUPTION=1866,t.ER_WARN_PURGE_LOG_IN_USE=1867,t.ER_WARN_PURGE_LOG_IS_ACTIVE=1868,t.ER_AUTO_INCREMENT_CONFLICT=1869,t.WARN_ON_BLOCKHOLE_IN_RBR=1870,t.ER_SLAVE_MI_INIT_REPOSITORY=1871,t.ER_SLAVE_RLI_INIT_REPOSITORY=1872,t.ER_ACCESS_DENIED_CHANGE_USER_ERROR=1873,t.ER_INNODB_READ_ONLY=1874,t.ER_STOP_SLAVE_SQL_THREAD_TIMEOUT=1875,t.ER_STOP_SLAVE_IO_THREAD_TIMEOUT=1876,t.ER_TABLE_CORRUPT=1877,t.ER_TEMP_FILE_WRITE_FAILURE=1878,t.ER_INNODB_FT_AUX_NOT_HEX_ID=1879,t.ER_OLD_TEMPORALS_UPGRADED=1880,t.ER_INNODB_FORCED_RECOVERY=1881,t.ER_AES_INVALID_IV=1882,t.ER_PLUGIN_CANNOT_BE_UNINSTALLED=1883,t.ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP=1884,t.ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER=1885,t.ER_MISSING_KEY=1886,t.WARN_NAMED_PIPE_ACCESS_EVERYONE=1887,t.ER_FOUND_MISSING_GTIDS=1888,t.ER_FILE_CORRUPT=3e3,t.ER_ERROR_ON_MASTER=3001,t.ER_INCONSISTENT_ERROR=3002,t.ER_STORAGE_ENGINE_NOT_LOADED=3003,t.ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER=3004,t.ER_WARN_LEGACY_SYNTAX_CONVERTED=3005,t.ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN=3006,t.ER_CANNOT_DISCARD_TEMPORARY_TABLE=3007,t.ER_FK_DEPTH_EXCEEDED=3008,t.ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2=3009,t.ER_WARN_TRIGGER_DOESNT_HAVE_CREATED=3010,t.ER_REFERENCED_TRG_DOES_NOT_EXIST=3011,t.ER_EXPLAIN_NOT_SUPPORTED=3012,t.ER_INVALID_FIELD_SIZE=3013,t.ER_MISSING_HA_CREATE_OPTION=3014,t.ER_ENGINE_OUT_OF_MEMORY=3015,t.ER_PASSWORD_EXPIRE_ANONYMOUS_USER=3016,t.ER_SLAVE_SQL_THREAD_MUST_STOP=3017,t.ER_NO_FT_MATERIALIZED_
4573SUBQUERY=3018,t.ER_INNODB_UNDO_LOG_FULL=3019,t.ER_INVALID_ARGUMENT_FOR_LOGARITHM=3020,t.ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP=3021,t.ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO=3022,t.ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS=3023,t.ER_QUERY_TIMEOUT=3024,t.ER_NON_RO_SELECT_DISABLE_TIMER=3025,t.ER_DUP_LIST_ENTRY=3026,t.ER_SQL_MODE_NO_EFFECT=3027,t.ER_AGGREGATE_ORDER_FOR_UNION=3028,t.ER_AGGREGATE_ORDER_NON_AGG_QUERY=3029,t.ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR=3030,t.ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER=3031,t.ER_SERVER_OFFLINE_MODE=3032,t.ER_GIS_DIFFERENT_SRIDS=3033,t.ER_GIS_UNSUPPORTED_ARGUMENT=3034,t.ER_GIS_UNKNOWN_ERROR=3035,t.ER_GIS_UNKNOWN_EXCEPTION=3036,t.ER_GIS_INVALID_DATA=3037,t.ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION=3038,t.ER_BOOST_GEOMETRY_CENTROID_EXCEPTION=3039,t.ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION=3040,t.ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION=3041,t.ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION=3042,t.ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION=3043,t.ER_STD_BAD_ALLOC_ERROR=3044,t.ER_STD_DOMAIN_ERROR=3045,t.ER_STD_LENGTH_ERROR=3046,t.ER_STD_INVALID_ARGUMENT=3047,t.ER_STD_OUT_OF_RANGE_ERROR=3048,t.ER_STD_OVERFLOW_ERROR=3049,t.ER_STD_RANGE_ERROR=3050,t.ER_STD_UNDERFLOW_ERROR=3051,t.ER_STD_LOGIC_ERROR=3052,t.ER_STD_RUNTIME_ERROR=3053,t.ER_STD_UNKNOWN_EXCEPTION=3054,t.ER_GIS_DATA_WRONG_ENDIANESS=3055,t.ER_CHANGE_MASTER_PASSWORD_LENGTH=3056,t.ER_USER_LOCK_WRONG_NAME=3057,t.ER_USER_LOCK_DEADLOCK=3058,t.ER_REPLACE_INACCESSIBLE_ROWS=3059,t.ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS=3060,t.ER_ILLEGAL_USER_VAR=3061,t.ER_GTID_MODE_OFF=3062,t.ER_UNSUPPORTED_BY_REPLICATION_THREAD=3063,t.ER_INCORRECT_TYPE=3064,t.ER_FIELD_IN_ORDER_NOT_SELECT=3065,t.ER_AGGREGATE_IN_ORDER_NOT_SELECT=3066,t.ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN=3067,t.ER_NET_OK_PACKET_TOO_LARGE=3068,t.ER_INVALID_JSON_DATA=3069,t.ER_INVALID_GEOJSON_MISSING_MEMBER=3070,t.ER_INVALID_GEOJSON_WRONG_TYPE=3071,t.ER_INVALID_GEOJSON_UNSPECIFIED=3072,t.ER_DIMENSION_UNSUPPORTED=3073,t.ER_SLAVE_CHANNEL_DOES_NOT_EXIST=3074,t.ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT=3075,t.ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG=3076,t.ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY=3077,t.ER_SLAVE_CHANNEL_DELETE=3078,t.ER_SLAVE_MULTIPLE_CHANNELS_CMD=3079,t.ER_SLAVE_MAX_CHANNELS_EXCEEDED=3080,t.ER_SLAVE_CHANNEL_MUST_STOP=3081,t.ER_SLAVE_CHANNEL_NOT_RUNNING=3082,t.ER_SLAVE_CHANNEL_WAS_RUNNING=3083,t.ER_SLAVE_CHANNEL_WAS_NOT_RUNNING=3084,t.ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP=3085,t.ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER=3086,t.ER_WRONG_FIELD_WITH_GROUP_V2=3087,t.ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2=3088,t.ER_WARN_DEPRECATED_SYSVAR_UPDATE=3089,t.ER_WARN_DEPRECATED_SQLMODE=3090,t.ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID=3091,t.ER_GROUP_REPLICATION_CONFIGURATION=3092,t.ER_GROUP_REPLICATION_RUNNING=3093,t.ER_GROUP_REPLICATION_APPLIER_INIT_ERROR=3094,t.ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT=3095,t.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR=3096,t.ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR=3097,t.ER_BEFORE_DML_VALIDATION_ERROR=3098,t.ER_PREVENTS_VARIABLE_WITHOUT_RBR=3099,t.ER_RUN_HOOK_ERROR=3100,t.ER_TRANSACTION_ROLLBACK_DURING_COMMIT=3101,t.ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED=3102,t.ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN=3103,t.ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN=3104,t.ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN=3105,t.ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN=3106,t.ER_GENERATED_COLUMN_NON_PRIOR=3107,t.ER_DEPENDENT_BY_GENERATED_COLUMN=3108,t.ER_GENERATED_COLUMN_REF_AUTO_INC=3109,t.ER_FEATURE_NOT_AVAILABLE=3110,t.ER_CANT_SET_GTID_MODE=3111,t.ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF=3112,t.ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION=3113,t.ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON=3114,t.ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF=3115,t.ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS=3116,t.ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS=3117,t.ER_ACCOUNT_HAS_BEEN_LOCKED=3118,t.ER_WRONG_TABLESPACE_NAME=3119,t.ER_TABLESPACE_IS_NOT_EMPTY=3120,t.ER_WRONG_FILE_NAME=3121,t.ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION=3122,t.ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR=3123,t.ER_WARN_BAD_MAX_EXECUTION_TIME=3124,t.ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME=3125,t.ER_WARN_CONFLICTING_HINT=3126,t.ER_WARN_UNKNOWN_QB_NAME=3127,t.ER_UNRESOLVED_HINT_NAME=3128,t.ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE=3129,t.ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED=3130,t.ER_LOCKING_SERVICE_WRONG_NAME=3131,t.ER_LOCKING_SERVICE_DEADLOCK=3132,t.ER_LOCKING_SERVICE_TIMEOUT=3133,t.ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED=3134,t.ER_SQL_MODE_MERGED=3135,t.ER_VTOKEN_PLUGIN_TOKEN_MISMATCH=3136,t.ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND=3137,t.ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID=3138,t.ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED=3139,t.ER_INVALID_JSON_TEXT=3140,t.ER_INVALID_JSON_TEXT_IN_PARAM=3141,t.ER_INVALID_JSON_BINARY_DATA=3142,t.ER_INVALID_JSON_PATH=3143,t.ER_INVALID_JSON_CHARSET=3144,t.ER_INVALID_JSON_CHARSET_IN_FUNCTION=3145,t.ER_INVALID_TYPE_FOR_JSON=3146,t.ER_INVALID_CAST_TO_JSON=3147,t.ER_INVALID_JSON_PATH_CHARSET=3148,t.ER_INVALID_JSON_PATH_WILDCARD=3149,t.ER_JSON_VALUE_TOO_BIG=3150,t.ER_JSON_KEY_TOO_BIG=3151,t.ER_JSON_USED_AS_KEY=3152,t.ER_JSON_VACUOUS_PATH=3153,t.ER_JSON_BAD_ONE_OR_ALL_ARG=3154,t.ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE=3155,t.ER_INVALID_JSON_VALUE_FOR_CAST=3156,t.ER_JSON_DOCUMENT_TOO_DEEP=3157,t.ER_JSON_DOCUMENT_NULL_KEY=3158,t.ER_SECURE_TRANSPORT_REQUIRED=3159,t.ER_NO_SECURE_TRANSPORTS_CONFIGURED=3160,t.ER_DISABLED_STORAGE_ENGINE=3161,t.ER_USER_DOES_NOT_EXIST=3162,t.ER_USER_ALREADY_EXISTS=3163,t.ER_AUDIT_API_ABORT=3164,t.ER_INVALID_JSON_PATH_ARRAY_CELL=3165,t.ER_BUFPOOL_RESIZE_INPROGRESS=3166,t.ER_FEATURE_DISABLED_SEE_DOC=3167,t.ER_SERVER_ISNT_AVAILABLE=3168,t.ER_SESSION_WAS_KILLED=3169,t.ER_CAPACITY_EXCEEDED=3170,t.ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER=3171,t.ER_TABLE_NEEDS_UPG_PART=3172,t.ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID=3173,t.ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL=3174,t.ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT=3175,t.ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE=3176,t.ER_LOCK_REFUSED_BY_ENGINE=3177,t.ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN=3178,t.ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE=3179,t.ER_MASTER_KEY_ROTATION_ERROR_BY_SE=3180,t.ER_MASTER_KEY_ROTATION_BINLOG_FAILED=3181,t.ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE=3182,t.ER_TABLESPACE_CANNOT_ENCRYPT=3183,t.ER_INVALID_ENCRYPTION_OPTION=3184,t.ER_CANNOT_FIND_KEY_IN_KEYRING=3185,t.ER_CAPACITY_EXCEEDED_IN_PARSER=3186,t.ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE=3187,t.ER_KEYRING_UDF_KEYRING_SERVICE_ERROR=3188,t.ER_USER_COLUMN_OLD_LENGTH=3189,t.ER_CANT_RESET_MASTER=3190,t.ER_GROUP_REPLICATION_MAX_GROUP_SIZE=3191,t.ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED=3192,t.ER_TABLE_REFERENCED=3193,t.ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE=3194,t.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO=3195,t.ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID=3196,t.ER_XA_RETRY=3197,t.ER_KEYRING_AWS_UDF_AWS_KMS_ERROR=3198,t.ER_BINLOG_UNSAFE_XA=3199,t.ER_UDF_ERROR=3200,t.ER_KEYRING_MIGRATION_FAILURE=3201,t.ER_KEYRING_ACCESS_DENIED_ERROR=3202,t.ER_KEYRING_MIGRATION_STATUS=3203,t.ER_PLUGIN_FAILED_TO_OPEN_TABLES=3204,t.ER_PLUGIN_FAILED_TO_OPEN_TABLE=3205,t.ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED=3206,t.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET=3207,t.ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY=3208,t.ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED=3209,t.ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED=3210,t.ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE=3211,t.ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED=3212,t.ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS=3213,t.ER_AUDIT_LOG_UDF_INVA
4573LID_ARGUMENT_TYPE=3214,t.ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT=3215,t.ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED=3216,t.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE=3217,t.ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE=3218,t.ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR=3219,t.ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY=3220,t.ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY=3221,t.ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS=3222,t.ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC=3223,t.ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER=3224,t.ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER=3225,t.WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP=3226,t.ER_XA_REPLICATION_FILTERS=3227,t.ER_CANT_OPEN_ERROR_LOG=3228,t.ER_GROUPING_ON_TIMESTAMP_IN_DST=3229,t.ER_CANT_START_SERVER_NAMED_PIPE=3230,t[1]="EE_CANTCREATEFILE",t[2]="EE_READ",t[3]="EE_WRITE",t[4]="EE_BADCLOSE",t[5]="EE_OUTOFMEMORY",t[6]="EE_DELETE",t[7]="EE_LINK",t[9]="EE_EOFERR",t[10]="EE_CANTLOCK",t[11]="EE_CANTUNLOCK",t[12]="EE_DIR",t[13]="EE_STAT",t[14]="EE_CANT_CHSIZE",t[15]="EE_CANT_OPEN_STREAM",t[16]="EE_GETWD",t[17]="EE_SETWD",t[18]="EE_LINK_WARNING",t[19]="EE_OPEN_WARNING",t[20]="EE_DISK_FULL",t[21]="EE_CANT_MKDIR",t[22]="EE_UNKNOWN_CHARSET",t[23]="EE_OUT_OF_FILERESOURCES",t[24]="EE_CANT_READLINK",t[25]="EE_CANT_SYMLINK",t[26]="EE_REALPATH",t[27]="EE_SYNC",t[28]="EE_UNKNOWN_COLLATION",t[29]="EE_FILENOTFOUND",t[30]="EE_FILE_NOT_CLOSED",t[31]="EE_CHANGE_OWNERSHIP",t[32]="EE_CHANGE_PERMISSIONS",t[33]="EE_CANT_SEEK",t[34]="EE_CAPACITY_EXCEEDED",t[120]="HA_ERR_KEY_NOT_FOUND",t[121]="HA_ERR_FOUND_DUPP_KEY",t[122]="HA_ERR_INTERNAL_ERROR",t[123]="HA_ERR_RECORD_CHANGED",t[124]="HA_ERR_WRONG_INDEX",t[126]="HA_ERR_CRASHED",t[127]="HA_ERR_WRONG_IN_RECORD",t[128]="HA_ERR_OUT_OF_MEM",t[130]="HA_ERR_NOT_A_TABLE",t[131]="HA_ERR_WRONG_COMMAND",t[132]="HA_ERR_OLD_FILE",t[133]="HA_ERR_NO_ACTIVE_RECORD",t[134]="HA_ERR_RECORD_DELETED",t[135]="HA_ERR_RECORD_FILE_FULL",t[136]="HA_ERR_INDEX_FILE_FULL",t[137]="HA_ERR_END_OF_FILE",t[138]="HA_ERR_UNSUPPORTED",t[139]="HA_ERR_TOO_BIG_ROW",t[140]="HA_WRONG_CREATE_OPTION",t[141]="HA_ERR_FOUND_DUPP_UNIQUE",t[142]="HA_ERR_UNKNOWN_CHARSET",t[143]="HA_ERR_WRONG_MRG_TABLE_DEF",t[144]="HA_ERR_CRASHED_ON_REPAIR",t[145]="HA_ERR_CRASHED_ON_USAGE",t[146]="HA_ERR_LOCK_WAIT_TIMEOUT",t[147]="HA_ERR_LOCK_TABLE_FULL",t[148]="HA_ERR_READ_ONLY_TRANSACTION",t[149]="HA_ERR_LOCK_DEADLOCK",t[150]="HA_ERR_CANNOT_ADD_FOREIGN",t[151]="HA_ERR_NO_REFERENCED_ROW",t[152]="HA_ERR_ROW_IS_REFERENCED",t[153]="HA_ERR_NO_SAVEPOINT",t[154]="HA_ERR_NON_UNIQUE_BLOCK_SIZE",t[155]="HA_ERR_NO_SUCH_TABLE",t[156]="HA_ERR_TABLE_EXIST",t[157]="HA_ERR_NO_CONNECTION",t[158]="HA_ERR_NULL_IN_SPATIAL",t[159]="HA_ERR_TABLE_DEF_CHANGED",t[160]="HA_ERR_NO_PARTITION_FOUND",t[161]="HA_ERR_RBR_LOGGING_FAILED",t[162]="HA_ERR_DROP_INDEX_FK",t[163]="HA_ERR_FOREIGN_DUPLICATE_KEY",t[164]="HA_ERR_TABLE_NEEDS_UPGRADE",t[165]="HA_ERR_TABLE_READONLY",t[166]="HA_ERR_AUTOINC_READ_FAILED",t[167]="HA_ERR_AUTOINC_ERANGE",t[168]="HA_ERR_GENERIC",t[169]="HA_ERR_RECORD_IS_THE_SAME",t[170]="HA_ERR_LOGGING_IMPOSSIBLE",t[171]="HA_ERR_CORRUPT_EVENT",t[172]="HA_ERR_NEW_FILE",t[173]="HA_ERR_ROWS_EVENT_APPLY",t[174]="HA_ERR_INITIALIZATION",t[175]="HA_ERR_FILE_TOO_SHORT",t[176]="HA_ERR_WRONG_CRC",t[177]="HA_ERR_TOO_MANY_CONCURRENT_TRXS",t[178]="HA_ERR_NOT_IN_LOCK_PARTITIONS",t[179]="HA_ERR_INDEX_COL_TOO_LONG",t[180]="HA_ERR_INDEX_CORRUPT",t[181]="HA_ERR_UNDO_REC_TOO_BIG",t[182]="HA_FTS_INVALID_DOCID",t[183]="HA_ERR_TABLE_IN_FK_CHECK",t[184]="HA_ERR_TABLESPACE_EXISTS",t[185]="HA_ERR_TOO_MANY_FIELDS",t[186]="HA_ERR_ROW_IN_WRONG_PARTITION",t[187]="HA_ERR_INNODB_READ_ONLY",t[188]="HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT",t[189]="HA_ERR_TEMP_FILE_WRITE_FAILURE",t[190]="HA_ERR_INNODB_FORCED_RECOVERY",t[191]="HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE",t[192]="HA_ERR_FK_DEPTH_EXCEEDED",t[193]="HA_MISSING_CREATE_OPTION",t[194]="HA_ERR_SE_OUT_OF_MEMORY",t[195]="HA_ERR_TABLE_CORRUPT",t[196]="HA_ERR_QUERY_INTERRUPTED",t[197]="HA_ERR_TABLESPACE_MISSING",t[198]="HA_ERR_TABLESPACE_IS_NOT_EMPTY",t[199]="HA_ERR_WRONG_FILE_NAME",t[200]="HA_ERR_NOT_ALLOWED_COMMAND",t[201]="HA_ERR_COMPUTE_FAILED",t[1e3]="ER_HASHCHK",t[1001]="ER_NISAMCHK",t[1002]="ER_NO",t[1003]="ER_YES",t[1004]="ER_CANT_CREATE_FILE",t[1005]="ER_CANT_CREATE_TABLE",t[1006]="ER_CANT_CREATE_DB",t[1007]="ER_DB_CREATE_EXISTS",t[1008]="ER_DB_DROP_EXISTS",t[1009]="ER_DB_DROP_DELETE",t[1010]="ER_DB_DROP_RMDIR",t[1011]="ER_CANT_DELETE_FILE",t[1012]="ER_CANT_FIND_SYSTEM_REC",t[1013]="ER_CANT_GET_STAT",t[1014]="ER_CANT_GET_WD",t[1015]="ER_CANT_LOCK",t[1016]="ER_CANT_OP
4573EN_FILE",t[1017]="ER_FILE_NOT_FOUND",t[1018]="ER_CANT_READ_DIR",t[1019]="ER_CANT_SET_WD",t[1020]="ER_CHECKREAD",t[1021]="ER_DISK_FULL",t[1022]="ER_DUP_KEY",t[1023]="ER_ERROR_ON_CLOSE",t[1024]="ER_ERROR_ON_READ",t[1025]="ER_ERROR_ON_RENAME",t[1026]="ER_ERROR_ON_WRITE",t[1027]="ER_FILE_USED",t[1028]="ER_FILSORT_ABORT",t[1029]="ER_FORM_NOT_FOUND",t[1030]="ER_GET_ERRNO",t[1031]="ER_ILLEGAL_HA",t[1032]="ER_KEY_NOT_FOUND",t[1033]="ER_NOT_FORM_FILE",t[1034]="ER_NOT_KEYFILE",t[1035]="ER_OLD_KEYFILE",t[1036]="ER_OPEN_AS_READONLY",t[1037]="ER_OUTOFMEMORY",t[1038]="ER_OUT_OF_SORTMEMORY",t[1039]="ER_UNEXPECTED_EOF",t[1040]="ER_CON_COUNT_ERROR",t[1041]="ER_OUT_OF_RESOURCES",t[1042]="ER_BAD_HOST_ERROR",t[1043]="ER_HANDSHAKE_ERROR",t[1044]="ER_DBACCESS_DENIED_ERROR",t[1045]="ER_ACCESS_DENIED_ERROR",t[1046]="ER_NO_DB_ERROR",t[1047]="ER_UNKNOWN_COM_ERROR",t[1048]="ER_BAD_NULL_ERROR",t[1049]="ER_BAD_DB_ERROR",t[1050]="ER_TABLE_EXISTS_ERROR",t[1051]="ER_BAD_TABLE_ERROR",t[1052]="ER_NON_UNIQ_ERROR",t[1053]="ER_SERVER_SHUTDOWN",t[1054]="ER_BAD_FIELD_ERROR",t[1055]="ER_WRONG_FIELD_WITH_GROUP",t[1056]="ER_WRONG_GROUP_FIELD",t[1057]="ER_WRONG_SUM_SELECT",t[1058]="ER_WRONG_VALUE_COUNT",t[1059]="ER_TOO_LONG_IDENT",t[1060]="ER_DUP_FIELDNAME",t[1061]="ER_DUP_KEYNAME",t[1062]="ER_DUP_ENTRY",t[1063]="ER_WRONG_FIELD_SPEC",t[1064]="ER_PARSE_ERROR",t[1065]="ER_EMPTY_QUERY",t[1066]="ER_NONUNIQ_TABLE",t[1067]="ER_INVALID_DEFAULT",t[1068]="ER_MULTIPLE_PRI_KEY",t[1069]="ER_TOO_MANY_KEYS",t[1070]="ER_TOO_MANY_KEY_PARTS",t[1071]="ER_TOO_LONG_KEY",t[1072]="ER_KEY_COLUMN_DOES_NOT_EXITS",t[1073]="ER_BLOB_USED_AS_KEY",t[1074]="ER_TOO_BIG_FIELDLENGTH",t[1075]="ER_WRONG_AUTO_KEY",t[1076]="ER_READY",t[1077]="ER_NORMAL_SHUTDOWN",t[1078]="ER_GOT_SIGNAL",t[1079]="ER_SHUTDOWN_COMPLETE",t[1080]="ER_FORCING_CLOSE",t[1081]="ER_IPSOCK_ERROR",t[1082]="ER_NO_SUCH_INDEX",t[1083]="ER_WRONG_FIELD_TERMINATORS",t[1084]="ER_BLOBS_AND_NO_TERMINATED",t[1085]="ER_TEXTFILE_NOT_READABLE",t[1086]="ER_FILE_EXISTS_ERROR",t[1087]="ER_LOAD_INFO",t[1088]="ER_ALTER_INFO",t[1089]="ER_WRONG_SUB_KEY",t[1090]="ER_CANT_REMOVE_ALL_FIELDS",t[1091]="ER_CANT_DROP_FIELD_OR_KEY",t[1092]="ER_INSERT_INFO",t[1093]="ER_UPDATE_TABLE_USED",t[1094]="ER_NO_SUCH_THREAD",t[1095]="ER_KILL_DENIED_ERROR",t[1096]="ER_NO_TABLES_USED",t[1097]="ER_TOO_BIG_SET",t[1098]="ER_NO_UNIQUE_LOGFILE",t[1099]="ER_TABLE_NOT_LOCKED_FOR_WRITE",t[1100]="ER_TABLE_NOT_LOCKED",t[1101]="ER_BLOB_CANT_HAVE_DEFAULT",t[1102]="ER_WRONG_DB_NAME",t[1103]="ER_WRONG_TABLE_NAME",t[1104]="ER_TOO_BIG_SELECT",t[1105]="ER_UNKNOWN_ERROR",t[1106]="ER_UNKNOWN_PROCEDURE",t[1107]="ER_WRONG_PARAMCOUNT_TO_PROCEDURE",t[1108]="ER_WRONG_PARAMETERS_TO_PROCEDURE",t[1109]="ER_UNKNOWN_TABLE",t[1110]="ER_FIELD_SPECIFIED_TWICE",t[1111]="ER_INVALID_GROUP_FUNC_USE",t[1112]="ER_UNSUPPORTED_EXTENSION",t[1113]="ER_TABLE_MUST_HAVE_COLUMNS",t[1114]="ER_RECORD_FILE_FULL",t[1115]="ER_UNKNOWN_CHARACTER_SET",t[1116]="ER_TOO_MANY_TABLES",t[1117]="ER_TOO_MANY_FIELDS",t[1118]="ER_TOO_BIG_ROWSIZE",t[1119]="ER_STACK_OVERRUN",t[1120]="ER_WRONG_OUTER_JOIN",t[1121]="ER_NULL_COLUMN_IN_INDEX",t[1122]="ER_CANT_FIND_UDF",t[1123]="ER_CANT_INITIALIZE_UDF",t[1124]="ER_UDF_NO_PATHS",t[1125]="ER_UDF_EXISTS",t[1126]="ER_CANT_OPEN_LIBRARY",t[1127]="ER_CANT_FIND_DL_ENTRY",t[1128]="ER_FUNCTION_NOT_DEFINED",t[1129]="ER_HOST_IS_BLOCKED",t[1130]="ER_HOST_NOT_PRIVILEGED",t[1131]="ER_PASSWORD_ANONYMOUS_USER",t[1132]="ER_PASSWORD_NOT_ALLOWED",t[1133]="ER_PASSWORD_NO_MATCH",t[1134]="ER_UPDATE_INFO",t[1135]="ER_CANT_CREATE_THREAD",t[1136]="ER_WRONG_VALUE_COUNT_ON_ROW",t[1137]="ER_CANT_REOPEN_TABLE",t[1138]="ER_INVALID_USE_OF_NULL",t[1139]="ER_REGEXP_ERROR",t[1140]="ER_MIX_OF_GROUP_FUNC_AND_FIELDS",t[1141]="ER_NONEXISTING_GRANT",t[1142]="ER_TABLEACCESS_DENIED_ERROR",t[1143]="ER_COLUMNACCESS_DENIED_ERROR",t[1144]="ER_ILLEGAL_GRANT_FOR_TABLE",t[1145]="ER_GRANT_WRONG_HOST_OR_USER",t[1146]="ER_NO_SUCH_TABLE",t[1147]="ER_NONEXISTING_TABLE_GRANT",t[1148]="ER_NOT_ALLOWED_COMMAND",t[1149]="ER_SYNTAX_ERROR",t[1150]="ER_DELAYED_CANT_CHANGE_LOCK",t[1151]="ER_TOO_MANY_DELAYED_THREADS",t[1152]="ER_ABORTING_CONNECTION",t[1153]="ER_NET_PACKET_TOO_LARGE",t[1154]="ER_NET_READ_ERROR_FROM_PIPE",t[1155]="ER_NET_FCNTL_ERROR",t[1156]="ER_NET_PACKETS_OUT_OF_ORDER",t[1157]="ER_NET_UNCOMPRESS_ERROR",t[1158]="ER_NET_READ_ERROR",t[1159]="ER_NET_READ_INTERRUPTED",t[1160]="ER_NET_ERROR_ON_WRITE",t[1161]="ER_NET_WRITE_INTERRUPTED",t[1162]="ER_TOO_LONG_STRING",t[1163]="ER_TABLE_CANT_HANDLE_BLOB",t[1164]="ER_TABLE_CANT_HANDLE_AUTO_INCREMENT",t[1165]="ER_DELAYED_INSERT_TABLE_LOCKED",t[1166]="ER_WRONG_COLUMN_NAME",t[1167]="ER_WRONG_KEY_COLUMN",t[1168]="ER_WRONG_MRG_TABLE",t[1169]="ER_DUP_UNIQUE",t[1170]="ER_BLOB_KEY_WITHOUT_LENGTH",t[1171]="ER_PRIMARY_CANT_HAVE_NULL",t[1172]="ER_TOO_MANY_ROWS",t[1173]="ER_REQUIRES_PRIMARY_KEY",t[1174]="ER_NO_RAID_COMPILED",t[1175]="ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE",t[1176]="ER_KEY_DOES_NOT_EXITS",t[1177]="ER_CHECK_NO_SUCH_TABLE",t[1178]="ER_CHECK_NOT_IMPLEMENT
4573ED",t[1179]="ER_CANT_DO_THIS_DURING_AN_TRANSACTION",t[1180]="ER_ERROR_DURING_COMMIT",t[1181]="ER_ERROR_DURING_ROLLBACK",t[1182]="ER_ERROR_DURING_FLUSH_LOGS",t[1183]="ER_ERROR_DURING_CHECKPOINT",t[1184]="ER_NEW_ABORTING_CONNECTION",t[1185]="ER_DUMP_NOT_IMPLEMENTED",t[1186]="ER_FLUSH_MASTER_BINLOG_CLOSED",t[1187]="ER_INDEX_REBUILD",t[1188]="ER_MASTER",t[1189]="ER_MASTER_NET_READ",t[1190]="ER_MASTER_NET_WRITE",t[1191]="ER_FT_MATCHING_KEY_NOT_FOUND",t[1192]="ER_LOCK_OR_ACTIVE_TRANSACTION",t[1193]="ER_UNKNOWN_SYSTEM_VARIABLE",t[1194]="ER_CRASHED_ON_USAGE",t[1195]="ER_CRASHED_ON_REPAIR",t[1196]="ER_WARNING_NOT_COMPLETE_ROLLBACK",t[1197]="ER_TRANS_CACHE_FULL",t[1198]="ER_SLAVE_MUST_STOP",t[1199]="ER_SLAVE_NOT_RUNNING",t[1200]="ER_BAD_SLAVE",t[1201]="ER_MASTER_INFO",t[1202]="ER_SLAVE_THREAD",t[1203]="ER_TOO_MANY_USER_CONNECTIONS",t[1204]="ER_SET_CONSTANTS_ONLY",t[1205]="ER_LOCK_WAIT_TIMEOUT",t[1206]="ER_LOCK_TABLE_FULL",t[1207]="ER_READ_ONLY_TRANSACTION",t[1208]="ER_DROP_DB_WITH_READ_LOCK",t[1209]="ER_CREATE_DB_WITH_READ_LOCK",t[1210]="ER_WRONG_ARGUMENTS",t[1211]="ER_NO_PERMISSION_TO_CREATE_USER",t[1212]="ER_UNION_TABLES_IN_DIFFERENT_DIR",t[1213]="ER_LOCK_DEADLOCK",t[1214]="ER_TABLE_CANT_HANDLE_FT",t[1215]="ER_CANNOT_ADD_FOREIGN",t[1216]="ER_NO_REFERENCED_ROW",t[1217]="ER_ROW_IS_REFERENCED",t[1218]="ER_CONNECT_TO_MASTER",t[1219]="ER_QUERY_ON_MASTER",t[1220]="ER_ERROR_WHEN_EXECUTING_COMMAND",t[1221]="ER_WRONG_USAGE",t[1222]="ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT",t[1223]="ER_CANT_UPDATE_WITH_READLOCK",t[1224]="ER_MIXING_NOT_ALLOWED",t[1225]="ER_DUP_ARGUMENT",t[1226]="ER_USER_LIMIT_REACHED",t[1227]="ER_SPECIFIC_ACCESS_DENIED_ERROR",t[1228]="ER_LOCAL_VARIABLE",t[1229]="ER_GLOBAL_VARIABLE",t[1230]="ER_NO_DEFAULT",t[1231]="ER_WRONG_VALUE_FOR_VAR",t[1232]="ER_WRONG_TYPE_FOR_VAR",t[1233]="ER_VAR_CANT_BE_READ",t[1234]="ER_CANT_USE_OPTION_HERE",t[1235]="ER_NOT_SUPPORTED_YET",t[1236]="ER_MASTER_FATAL_ERROR_READING_BINLOG",t[1237]="ER_SLAVE_IGNORED_TABLE",t[1238]="ER_INCORRECT_GLOBAL_LOCAL_VAR",t[1239]="ER_WRONG_FK_DEF",t[1240]="ER_KEY_REF_DO_NOT_MATCH_TABLE_REF",t[1241]="ER_OPERAND_COLUMNS",t[1242]="ER_SUBQUERY_NO_1_ROW",t[1243]="ER_UNKNOWN_STMT_HANDLER",t[1244]="ER_CORRUPT_HELP_DB",t[1245]="ER_CYCLIC_REFERENCE",t[1246]="ER_AUTO_CONVERT",t[1247]="ER_ILLEGAL_REFERENCE",t[1248]="ER_DERIVED_MUST_HAVE_ALIAS",t[1249]="ER_SELECT_REDUCED",t[1250]="ER_TABLENAME_NOT_ALLOWED_HERE",t[1251]="ER_NOT_SUPPORTED_AUTH_MODE",t[1252]="ER_SPATIAL_CANT_HAVE_NULL",t[1253]="ER_COLLATION_CHARSET_MISMATCH",t[1254]="ER_SLAVE_WAS_RUNNING",t[1255]="ER_SLAVE_WAS_NOT_RUNNING",t[1256]="ER_TOO_BIG_FOR_UNCOMPRESS",t[1257]="ER_ZLIB_Z_MEM_ERROR",t[1258]="ER_ZLIB_Z_BUF_ERROR",t[1259]="ER_ZLIB_Z_DATA_ERROR",t[1260]="ER_CUT_VALUE_GROUP_CONCAT",t[1261]="ER_WARN_TOO_FEW_RECORDS",t[1262]="ER_WARN_TOO_MANY_RECORDS",t[1263]="ER_WARN_NULL_TO_NOTNULL",t[1264]="ER_WARN_DATA_OUT_OF_RANGE",t[1265]="WARN_DATA_TRUNCATED",t[1266]="ER_WARN_USING_OTHER_HANDLER",t[1267]="ER_CANT_AGGREGATE_2COLLATIONS",t[1268]="ER_DROP_USER",t[1269]="ER_REVOKE_GRANTS",t[1270]="ER_CANT_AGGREGATE_3COLLATIONS",t[1271]="ER_CANT_AGGREGATE_NCOLLATIONS",t[1272]="ER_VARIABLE_IS_NOT_STRUCT",t[1273]="ER_UNKNOWN_COLLATION",t[1274]="ER_SLAVE_IGNORED_SSL_PARAMS",t[1275]="ER_SERVER_IS_IN_SECURE_AUTH_MODE",t[1276]="ER_WARN_FIELD_RESOLVED",t[1277]="ER_BAD_SLAVE_UNTIL_COND",t[1278]="ER_MISSING_SKIP_SLAVE",t[1279]="ER_UNTIL_COND_IGNORED",t[1280]="ER_WRONG_NAME_FOR_INDEX",t[1281]="ER_WRONG_NAME_FOR_CATALOG",t[1282]="ER_WARN_QC_RESIZE",t[1283]="ER_BAD_FT_COLUMN",t[1284]="ER_UNKNOWN_KEY_CACHE",t[1285]="ER_WARN_HOSTNAME_WONT_WORK",t[1286]="ER_UNKNOWN_STORAGE_ENGINE",t[1287]="ER_WARN_DEPRECATED_SYNTAX",t[1288]="ER_NON_UPDATABLE_TABLE",t[1289]="ER_FEATURE_DISABLED",t[1290]="ER_OPTION_PREVENTS_STATEMENT",t[1291]="ER_DUPLICATED_VALUE_IN_TYPE",t[1292]="ER_TRUNCATED_WRONG_VALUE",t[1293]="ER_TOO_MUCH_AUTO_TIMESTAMP_COLS",t[1294]="ER_INVALID_ON_UPDATE",t[1295]="ER_UNSUPPORTED_PS",t[1296]="ER_GET_ERRMSG",t[1297]="ER_GET_TEMPORARY_ERRMSG",t[1298]="ER_UNKNOWN_TIME_ZONE",t[1299]="ER_WARN_INVALID_TIMESTAMP",t[1300]="ER_INVALID_CHARACTER_STRING",t[1301]="ER_WARN_ALLOWED_PACKET_OVERFLOWED",t[1302]="ER_CONFLICTING_DECLARATIONS",t[1303]="ER_SP_NO_RECURSIVE_CREATE",t[1304]="ER_SP_ALREADY_EXISTS",t[1305]="ER_SP_DOES_NOT_EXIST",t[1306]="ER_SP_DROP_FAILED",t[1307]="ER_SP_STORE_FAILED",t[1308]="ER_SP_LILABEL_MISMATCH",t[1309]="ER_SP_LABEL_REDEFINE",t[1310]="ER_SP_LABEL_MISMATCH",t[1311]="ER_SP_UNINIT_VAR",t[1312]="ER_SP_BADSELECT",t[1313]="ER_SP_BADRETURN",t[1314]="ER_SP_BADSTATEMENT",t[1315]="ER_UPDATE_LOG_DEPRECATED_IGNORED",t[1316]="ER_UPDATE_LOG_DEPRECATED_TRANSLATED",t[1317]="ER_QUERY_INTERRUPTED",t[1318]="ER_SP_WRONG_NO_OF_ARGS",t[1319]="ER_SP_COND_MISMATCH",t[1320]="ER_SP_NORETURN",t[1321]="ER_SP_NORETURNEND",t[1322]="ER_SP_BAD_CURSOR_QUERY",t[1323]="ER_SP_BAD_CURSOR_SELECT",t[1324]="ER_SP_CURSOR_MISMATCH",t[1325]="ER_SP_CURSOR_ALREADY_OPEN",t[1326]="ER_SP_CURSOR_NOT_OPEN",t[1327]="ER_SP_UNDECLARED_VAR",t[1328]="ER_SP_WRONG_NO_OF_FETCH_ARGS",t[1329]="ER_SP_FETCH_NO_DATA",t[1330]="ER_SP_DUP_PARAM",t[1331]="ER_SP_DUP_VAR",t[1332]="ER_SP_DUP_COND",t[1333]="ER_SP_DUP_CURS",t[1334]="ER_SP_CANT_ALTER",t[1335]="ER_SP_SUBSELECT_NYI",t[1336]="ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG",t[1337]="ER_SP_VARCOND_AFTER_CURSHNDLR",t[1338]="ER_SP_CURSOR_AFTER_HANDLER",t[1339]="ER_SP_CASE_NOT_FOUND",t[1340]="ER_FPARSER_TOO_BIG_FILE",t[1341]="ER_FPARSER_BAD_HEADER",t[1342]="ER_FPARSER_EOF_IN_COMMENT",t[1343]="ER_FPARSER_ERROR_IN_PARAMETER",t[1344]="ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER",t[1345]="ER_VIEW_NO_EXPLAIN",t[1346]="ER_FRM_UNKNOWN_TYPE",t[1347]="ER_WRONG_OBJECT",t[1348]="ER_NONUPDATEABLE_COLUMN",t[1349]="ER_VIEW_SELECT_DERIVED",t[1350]="ER_VIEW_SELECT_CLAUSE",t[1351]="ER_VIEW_SELECT_VARIABLE",t[1352]="ER_VIEW_SELECT_TMPTABLE",t[1353]="ER_VIEW_WRONG_LIST",t[1354]="ER_WARN_VIEW_MERGE",t[1355]="ER_WARN_VIEW_WITHOUT_KEY",t[1356]="ER_VIEW_INVALID",t[1357]="ER_SP_NO_DROP_SP",t[1358]="ER_SP_GOTO_IN_HNDLR",t[1359]="ER_TRG_ALREADY_EXISTS",t[1360]="ER_TRG_DOES_NOT_EXIST",t[1361]="ER_TRG_ON_VIEW_OR_TEMP_TABLE",t[1362]="ER_TRG_CANT_CHANGE_ROW",t[1363]="ER_TRG_NO_SUCH_ROW_IN_TRG",t[1364]="ER_NO_DEFAULT_FOR_FIELD",t[1365]="ER_DIVISION_BY_ZERO",t[1366]="ER_TRUNCATED_WRONG_VALUE_FOR_FIELD",t[1367]="ER_ILLEGAL_VALUE_FOR_TYPE",t[1368]="ER_VIEW_NONUPD_CHECK",t[1369]="ER_VIEW_CHECK_FAILED",t[1370]="ER_PROCACCESS_DENIED_ERROR",t[1371]="ER_RELAY_LOG_FAIL",t[1372]="ER_PASSWD_LENGTH",t[1373]="ER_UNKNOWN_TARGET_BINLOG",t[1374]="ER_IO_ERR_LOG_INDEX_READ",t[1375]="ER_BINLOG_PURGE_PROHIBITED",t[1376]="ER_FSEEK_FAIL",t[1377]="ER_BINLOG_PURGE_FATAL_ERR",t[1378]="ER_LOG_IN_USE",t[1379]="ER_LOG_PURGE_UNKNOWN_ERR",t[1380]="ER_RELAY_LOG_INIT",t[1381]="ER_NO_BINARY_LOGGING",t[1382]="ER_RESERVED_SYNTAX",t[1383]="ER_WSAS_FAILED",t[1384]="ER_DIFF_GROUPS_PROC",t[1385]="ER_NO_GROUP_FOR_PROC",t[1386]="ER_ORDER_WITH_PROC",t[1387]="ER_LOGGING_PROHIBIT_CHANGING_OF",t[1388]="ER_NO_FILE_MAPPING",t[1389]="ER_WRONG_MAGIC",t[1390]="ER_PS_MANY_PARAM",t[1391]="ER_KEY_PART_0",t[1392]="ER_VIEW_CHECKSUM",t[1393]="ER_VIEW_MULTIUPDATE",t[1394]="ER_VIEW_NO_INSERT_FIELD_LIST",t[1395]="ER_VIEW_DELETE_MERGE_VIEW",t[1396]="ER_CANNOT_USER",t[1397]="ER_XAER_NOTA",t[1398]="ER_XAER_INVAL",t[1399]="ER_XAER_RMFAIL",t[1400]="ER_XAER_OUTSIDE",t[1401]="ER_XAER_RMERR",t[1402]="ER_XA_RBROLLBACK",t[1403]="ER_NONEXISTING_PROC_GRANT",t[1404]="ER_PROC_AUTO_GRANT_FAIL",t[1405]="ER_PROC_AUTO_REVOKE_FAIL",t[1406]="ER_DATA_TOO_LONG",t[1407]="ER_SP_BAD_SQLSTATE",t[1408]="ER_STARTUP",t[1409]="ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR",t[1410]="ER_CANT_CREATE_USER_WITH_GRANT",t[1411]="ER_WRONG_VALUE_FOR_TYPE",t[1412]="ER_TABLE_DEF_CHANGED",t[1413]="ER_SP_DUP_HANDLER",t[1414]="ER_SP_NOT_VAR_ARG",t[1415]="ER_SP_NO_RETSET",t[1416]="ER_CANT_CREATE_GEOMETRY_OBJECT",t[1417]="ER_FAILED_ROUTINE_BREAK_BINLOG",t[1418]="ER_BINLOG_UNSAFE_ROUTINE",t[1419]="ER_BINLOG_CREATE_ROUTINE_NEED_SUPER",t[1420]="ER_EXEC_STMT_WITH_OPEN_CURSOR",t[1421]="ER_STMT_HAS_NO_OPEN_CURSOR",t[1422]="ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG",t[1423]="ER_NO_DEFAULT_FOR_VIEW_FIELD",t[1424]="ER_SP_NO_RECURSION",t[1425]="ER_TOO_BIG_SCALE",t[1426]="ER_TOO_BIG_PRECISION",t[1427]="ER_M_BIGGER_THAN_D",t[1428]="ER_WRONG_LOCK_OF_SYSTEM_TABLE",t[1429]="ER_CONNECT_TO_FOREIGN_DATA_SOURCE",t[1430]="ER_QUERY_ON_FOREIGN_DATA_SOURCE",t[1431]="ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST",t[1432]="ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE",t[1433]="ER_FOREIGN_DATA_STRING_INVALID",t[1434]="ER_CANT_CREATE_FEDERATED_TABLE",t[1435]="ER_TRG_IN_WRONG_SCHEMA",t[1436]="ER_STACK_OVERRUN_NEED_MORE",t[1437]="ER_TOO_LONG_BODY",t[1438]="ER_WARN_CANT_DROP_DEFAULT_KEYCACHE",t[1439]="ER_TOO_BIG_DISPLAYWIDTH",t[1440]="ER_XAER_DUPID",t[1441]="ER_DATETIME_FUNCTION_OVERFLOW",t[1442]="ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG",t[1443]="ER_VIEW_PREVENT_UPDATE",t[1444]="ER_PS_NO_RECURSION",t[1445]="ER_SP_CANT_SET_AUTOCOMMIT",t[1446]="ER_MALFORMED_DEFINER",t[1447]="ER_VIEW_FRM_NO_USER",t[1448]="ER_VIEW_OTHER_USER",t[1449]="ER_NO_SUCH_USER",t[1450]="ER_FORBID_SCHEMA_CHANGE",t[1451]="ER_ROW_IS_REFERENCED_2",t[1452]="ER_NO_REFERENCED_ROW_2",t[1453]="ER_SP_BAD_VAR_SHADOW",t[1454]="ER_TRG_NO_DEFINER",t[1455]="ER_OLD_FILE_FORMAT",t[1456]="ER_SP_RECURSION_LIMIT",t[1457]="ER_SP_PROC_TABLE_CORRUPT",t[1458]="ER_SP_WRONG_NAME",t[1459]="ER_TABLE_NEEDS_UPGRADE",t[1460]="ER_SP_NO_AGGREGATE",t[1461]="ER_MAX_PREPARED_STMT_COUNT_REACHED",t[1462]="ER_VIEW_RECURSIVE",t[1463]="ER_NON_GROUPING_FIELD_USED",t[1464]="ER_TABLE_CANT_HANDLE_SPKEYS",t[1465]="ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA",t[1466]="ER_REMOVED_SPACES",t[1467]="ER_AUTOINC_READ_FAILED",t[1468]="ER_USERNAME",t[1469]="ER_HOSTNAME",t[1470]="ER_WRONG_STRING_LENGTH",t[1471]="ER_NON_INSERTABLE_TABLE",t[1472]="ER_ADMIN_WRONG_MRG_TABLE",t[1473]="ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT",t[1474]="ER_NAME_BECOMES_EMPTY",t[1475]="ER_AMBIGUOUS_FIELD_TERM",t[1476]="ER_FOREIGN_SERVER_EXISTS",t[1477]="ER_FOREIGN_SERVER_DOESNT_EXIST",t[1478]="ER_ILLEGAL_HA_CREATE_OPTION",t[1479]="ER_PARTITION_REQUIRES_VALUES_ERROR",t[1480]="ER_PARTITION_WRONG_VALUES_ERROR",t[1481]="ER_PARTITION_MAXVALUE_ERROR",t[1482]="ER_PARTITION_SUBPARTITION_ERROR",t[1483]="ER_PARTITION_SUBPART_MIX_ERROR",t[1484]="ER_PARTITION_WRONG_NO_PART_ERROR",t[1485]="ER_PARTITION_WRONG_NO_SUBPART_ERROR",t[1486]="ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR",t[1487]="ER_NO_CONST_EXPR_IN_RANGE_OR_LIST_ERROR",t[1488]="ER_FIELD_NOT_FOUND_PART_ERROR",t[1489]="ER_LIST_OF_FIELDS_ONLY_IN_HASH_ERROR",t[1490]="ER_INCONSISTENT_PARTITION_INFO_ERROR",t[1491]="ER_PARTITION_FUNC_NOT_ALLOWED_ER
4573ROR",t[1492]="ER_PARTITIONS_MUST_BE_DEFINED_ERROR",t[1493]="ER_RANGE_NOT_INCREASING_ERROR",t[1494]="ER_INCONSISTENT_TYPE_OF_FUNCTIONS_ERROR",t[1495]="ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR",t[1496]="ER_PARTITION_ENTRY_ERROR",t[1497]="ER_MIX_HANDLER_ERROR",t[1498]="ER_PARTITION_NOT_DEFINED_ERROR",t[1499]="ER_TOO_MANY_PARTITIONS_ERROR",t[1500]="ER_SUBPARTITION_ERROR",t[1501]="ER_CANT_CREATE_HANDLER_FILE",t[1502]="ER_BLOB_FIELD_IN_PART_FUNC_ERROR",t[1503]="ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF",t[1504]="ER_NO_PARTS_ERROR",t[1505]="ER_PARTITION_MGMT_ON_NONPARTITIONED",t[1506]="ER_FOREIGN_KEY_ON_PARTITIONED",t[1507]="ER_DROP_PARTITION_NON_EXISTENT",t[1508]="ER_DROP_LAST_PARTITION",t[1509]="ER_COALESCE_ONLY_ON_HASH_PARTITION",t[1510]="ER_REORG_HASH_ONLY_ON_SAME_NO",t[1511]="ER_REORG_NO_PARAM_ERROR",t[1512]="ER_ONLY_ON_RANGE_LIST_PARTITION",t[1513]="ER_ADD_PARTITION_SUBPART_ERROR",t[1514]="ER_ADD_PARTITION_NO_NEW_PARTITION",t[1515]="ER_COALESCE_PARTITION_NO_PARTITION",t[1516]="ER_REORG_PARTITION_NOT_EXIST",t[1517]="ER_SAME_NAME_PARTITION",t[1518]="ER_NO_BINLOG_ERROR",t[1519]="ER_CONSECUTIVE_REORG_PARTITIONS",t[1520]="ER_REORG_OUTSIDE_RANGE",t[1521]="ER_PARTITION_FUNCTION_FAILURE",t[1522]="ER_PART_STATE_ERROR",t[1523]="ER_LIMITED_PART_RANGE",t[1524]="ER_PLUGIN_IS_NOT_LOADED",t[1525]="ER_WRONG_VALUE",t[1526]="ER_NO_PARTITION_FOR_GIVEN_VALUE",t[1527]="ER_FILEGROUP_OPTION_ONLY_ONCE",t[1528]="ER_CREATE_FILEGROUP_FAILED",t[1529]="ER_DROP_FILEGROUP_FAILED",t[1530]="ER_TABLESPACE_AUTO_EXTEND_ERROR",t[1531]="ER_WRONG_SIZE_NUMBER",t[1532]="ER_SIZE_OVERFLOW_ERROR",t[1533]="ER_ALTER_FILEGROUP_FAILED",t[1534]="ER_BINLOG_ROW_LOGGING_FAILED",t[1535]="ER_BINLOG_ROW_WRONG_TABLE_DEF",t[1536]="ER_BINLOG_ROW_RBR_TO_SBR",t[1537]="ER_EVENT_ALREADY_EXISTS",t[1538]="ER_EVENT_STORE_FAILED",t[1539]="ER_EVENT_DOES_NOT_EXIST",t[1540]="ER_EVENT_CANT_ALTER",t[1541]="ER_EVENT_DROP_FAILED",t[1542]="ER_EVENT_INTERVAL_NOT_POSITIVE_OR_TOO_BIG",t[1543]="ER_EVENT_ENDS_BEFORE_STARTS",t[1544]="ER_EVENT_EXEC_TIME_IN_THE_PAST",t[1545]="ER_EVENT_OPEN_TABLE_FAILED",t[1546]="ER_EVENT_NEITHER_M_EXPR_NOR_M_AT",t[1547]="ER_COL_COUNT_DOESNT_MATCH_CORRUPTED",t[1548]="ER_CANNOT_LOAD_FROM_TABLE",t[1549]="ER_EVENT_CANNOT_DELETE",t[1550]="ER_EVENT_COMPILE_ERROR",t[1551]="ER_EVENT_SAME_NAME",t[1552]="ER_EVENT_DATA_TOO_LONG",t[1553]="ER_DROP_INDEX_FK",t[1554]="ER_WARN_DEPRECATED_SYNTAX_WITH_VER",t[1555]="ER_CANT_WRITE_LOCK_LOG_TABLE",t[1556]="ER_CANT_LOCK_LOG_TABLE",t[1557]="ER_FOREIGN_DUPLICATE_KEY",t[1558]="ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE",t[1559]="ER_TEMP_TABLE_PREVENTS_SWITCH_OUT_OF_RBR",t[1560]="ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT",t[1561]="ER_NDB_CANT_SWITCH_BINLOG_FORMAT",t[1562]="ER_PARTITION_NO_TEMPORARY",t[1563]="ER_PARTITION_CONST_DOMAIN_ERROR",t[1564]="ER_PARTITION_FUNCTION_IS_NOT_ALLOWED",t[1565]="ER_DDL_LOG_ERROR",t[1566]="ER_NULL_IN_VALUES_LESS_THAN",t[1567]="ER_WRONG_PARTITION_NAME",t[1568]="ER_CANT_CHANGE_TX_CHARACTERISTICS",t[1569]="ER_DUP_ENTRY_AUTOINCREMENT_CASE",t[1570]="ER_EVENT_MODIFY_QUEUE_ERROR",t[1571]="ER_EVENT_SET_VAR_ERROR",t[1572]="ER_PARTITION_MERGE_ERROR",t[1573]="ER_CANT_ACTIVATE_LOG",t[1574]="ER_RBR_NOT_AVAILABLE",t[1575]="ER_BASE64_DECODE_ERROR",t[1576]="ER_EVENT_RECURSION_FORBIDDEN",t[1577]="ER_EVENTS_DB_ERROR",t[1578]="ER_ONLY_INTEGERS_ALLOWED",t[1579]="ER_UNSUPORTED_LOG_ENGINE",t[1580]="ER_BAD_LOG_STATEMENT",t[1581]="ER_CANT_RENAME_LOG_TABLE",t[1582]="ER_WRONG_PARAMCOUNT_TO_NATIVE_FCT",t[1583]="ER_WRONG_PARAMETERS_TO_NATIVE_FCT",t[1584]="ER_WRONG_PARAMETERS_TO_STORED_FCT",t[1585]="ER_NATIVE_FCT_NAME_COLLISION",t[1586]="ER_DUP_ENTRY_WITH_KEY_NAME",t[1587]="ER_BINLOG_PURGE_EMFILE",t[1588]="ER_EVENT_CANNOT_CREATE_IN_THE_PAST",t[1589]="ER_EVENT_CANNOT_ALTER_IN_THE_PAST",t[1590]="ER_SLAVE_INCIDENT",t[1591]="ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT",t[1592]="ER_BINLOG_UNSAFE_STATEMENT",t[1593]="ER_SLAVE_FATAL_ERROR",t[1594]="ER_SLAVE_RELAY_LOG_READ_FAILURE",t[1595]="ER_SLAVE_RELAY_LOG_WRITE_FAILURE",t[1596]="ER_SLAVE_CREATE_EVENT_FAILURE",t[1597]="ER_SLAVE_MASTER_COM_FAILURE",t[1598]="ER_BINLOG_LOGGING_IMPOSSIBLE",t[1599]="ER_VIEW_NO_C
4573REATION_CTX",t[1600]="ER_VIEW_INVALID_CREATION_CTX",t[1601]="ER_SR_INVALID_CREATION_CTX",t[1602]="ER_TRG_CORRUPTED_FILE",t[1603]="ER_TRG_NO_CREATION_CTX",t[1604]="ER_TRG_INVALID_CREATION_CTX",t[1605]="ER_EVENT_INVALID_CREATION_CTX",t[1606]="ER_TRG_CANT_OPEN_TABLE",t[1607]="ER_CANT_CREATE_SROUTINE",t[1608]="ER_NEVER_USED",t[1609]="ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT",t[1610]="ER_SLAVE_CORRUPT_EVENT",t[1611]="ER_LOAD_DATA_INVALID_COLUMN",t[1612]="ER_LOG_PURGE_NO_FILE",t[1613]="ER_XA_RBTIMEOUT",t[1614]="ER_XA_RBDEADLOCK",t[1615]="ER_NEED_REPREPARE",t[1616]="ER_DELAYED_NOT_SUPPORTED",t[1617]="WARN_NO_MASTER_INFO",t[1618]="WARN_OPTION_IGNORED",t[1619]="ER_PLUGIN_DELETE_BUILTIN",t[1620]="WARN_PLUGIN_BUSY",t[1621]="ER_VARIABLE_IS_READONLY",t[1622]="ER_WARN_ENGINE_TRANSACTION_ROLLBACK",t[1623]="ER_SLAVE_HEARTBEAT_FAILURE",t[1624]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE",t[1625]="ER_NDB_REPLICATION_SCHEMA_ERROR",t[1626]="ER_CONFLICT_FN_PARSE_ERROR",t[1627]="ER_EXCEPTIONS_WRITE_ERROR",t[1628]="ER_TOO_LONG_TABLE_COMMENT",t[1629]="ER_TOO_LONG_FIELD_COMMENT",t[1630]="ER_FUNC_INEXISTENT_NAME_COLLISION",t[1631]="ER_DATABASE_NAME",t[1632]="ER_TABLE_NAME",t[1633]="ER_PARTITION_NAME",t[1634]="ER_SUBPARTITION_NAME",t[1635]="ER_TEMPORARY_NAME",t[1636]="ER_RENAMED_NAME",t[1637]="ER_TOO_MANY_CONCURRENT_TRXS",t[1638]="WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED",t[1639]="ER_DEBUG_SYNC_TIMEOUT",t[1640]="ER_DEBUG_SYNC_HIT_LIMIT",t[1641]="ER_DUP_SIGNAL_SET",t[1642]="ER_SIGNAL_WARN",t[1643]="ER_SIGNAL_NOT_FOUND",t[1644]="ER_SIGNAL_EXCEPTION",t[1645]="ER_RESIGNAL_WITHOUT_ACTIVE_HANDLER",t[1646]="ER_SIGNAL_BAD_CONDITION_TYPE",t[1647]="WARN_COND_ITEM_TRUNCATED",t[1648]="ER_COND_ITEM_TOO_LONG",t[1649]="ER_UNKNOWN_LOCALE",t[1650]="ER_SLAVE_IGNORE_SERVER_IDS",t[1651]="ER_QUERY_CACHE_DISABLED",t[1652]="ER_SAME_NAME_PARTITION_FIELD",t[1653]="ER_PARTITION_COLUMN_LIST_ERROR",t[1654]="ER_WRONG_TYPE_COLUMN_VALUE_ERROR",t[1655]="ER_TOO_MANY_PARTITION_FUNC_FIELDS_ERROR",t[1656]="ER_MAXVALUE_IN_VALUES_IN",t[1657]="ER_TOO_MANY_VALUES_ERROR",t[1658]="ER_ROW_SINGLE_PARTITION_FIELD_ERROR",t[1659]="ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD",t[1660]="ER_PARTITION_FIELDS_TOO_LONG",t[1661]="ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE",t[1662]="ER_BINLOG_ROW_MODE_AND_STMT_ENGINE",t[1663]="ER_BINLOG_UNSAFE_AND_STMT_ENGINE",t[1664]="ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE",t[1665]="ER_BINLOG_STMT_MODE_AND_ROW_ENGINE",t[1666]="ER_BINLOG_ROW_INJECTION_AND_STMT_MODE",t[1667]="ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE",t[1668]="ER_BINLOG_UNSAFE_LIMIT",t[1669]="ER_BINLOG_UNSAFE_INSERT_DELAYED",t[1670]="ER_BINLOG_UNSAFE_SYSTEM_TABLE",t[1671]="ER_BINLOG_UNSAFE_AUTOINC_COLUMNS",t[1672]="ER_BINLOG_UNSAFE_UDF",t[1673]="ER_BINLOG_UNSAFE_SYSTEM_VARIABLE",t[1674]="ER_BINLOG_UNSAFE_SYSTEM_FUNCTION",t[1675]="ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS",t[1676]="ER_MESSAGE_AND_STATEMENT",t[1677]="ER_SLAVE_CONVERSION_FAILED",t[1678]="ER_SLAVE_CANT_CREATE_CONVERSION",t[1679]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT",t[1680]="ER_PATH_LENGTH",t[1681]="ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT",t[1682]="ER_WRONG_NATIVE_TABLE_STRUCTURE",t[1683]="ER_WRONG_PERFSCHEMA_USAGE",t[1684]="ER_WARN_I_S_SKIPPED_TABLE",t[1685]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_DIRECT",t[1686]="ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_DIRECT",t[1687]="ER_SPATIAL_MUST_HAVE_GEOM_COL",t[1688]="ER_TOO_LONG_INDEX_COMMENT",t[1689]="ER_LOCK_ABORTED",t[1690]="ER_DATA_OUT_OF_RANGE",t[1691]="ER_WRONG_SPVAR_TYPE_IN_LIMIT",t[1692]="ER_BINLOG_UNSAFE_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE",t[1693]="ER_BINLOG_UNSAFE_MIXED_STATEMENT",t[1694]="ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN",t[1695]="ER_STORED_FUNCTION_PREVENTS_SWITCH_SQL_LOG_BIN",t[1696]="ER_FAILED_READ_FROM_PAR_FILE",t[1697]="ER_VALUES_IS_NOT_INT_TYPE_ERROR",t[1698]="ER_ACCESS_DENIED_NO_PASSWORD_ERROR",t[1699]="ER_SET_PASSWORD_AUTH_PLUGIN",t[1700]="ER_GRANT_PLUGIN_USER_EXISTS",t[1701]="ER_TRUNCATE_ILLEGAL_FK",t[1702]="ER_PLUGIN_IS_PERMANENT",t[1703]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MIN",t[1704]="ER_SLAVE_HEARTBEAT_VALUE_OUT_OF_RANGE_MAX",t[1705]="ER_STMT_CACHE_FULL",t[1706]="ER_MULTI_UPDATE_KEY_CONFLICT",t[1707]="ER_TABLE_NEEDS_REBUILD",t[1708]="WARN_OPTION_BELOW_LIMIT",t[1709]="ER_INDEX_COLUMN_TOO_LONG",t[1710]="ER_ERROR_IN_TRIGGER_BODY",t[1711]="ER_ERROR_IN_UNKNOWN_TRIGGER_BODY",t[1712]="ER_INDEX_CORRUPT",t[1713]="ER_UNDO_RECORD_TOO_BIG",t[1714]="ER_BINLOG_UNSAFE_INSERT_IGNORE_SELECT",t[1715]="ER_BINLOG_UNSAFE_INSERT_SELECT_UPDATE",t[1716]="ER_BINLOG_UNSAFE_REPLACE_SELECT",t[1717]="ER_BINLOG_UNSAFE_CREATE_IGNORE_SELECT",t[1718]="ER_BINLOG_UNSAFE_CREATE_REPLACE_SELECT",t[1719]="ER_BINLOG_UNSAFE_UPDATE_IGNORE",t[1720]="ER_PLUGIN_NO_UNINSTALL",t[1721]="ER_PLUGIN_NO_INSTALL",t[1722]="ER_BINLOG_UNSAFE_WRITE_AUTOINC_SELECT",t[1723]="ER_BINLOG_UNSAFE_CREATE_SELECT_AUTOINC",t[1724]="ER_BINLOG_UNSAFE_INSERT_TWO_KEYS",t[1725]="ER_TABLE_IN_FK_CHECK",t[1726]="ER_UNSUPPORTED_ENGINE",t[1727]="ER_BINLOG_UNSAFE_AUTOINC_NOT_FIRST",t[1728]="ER_CANNOT_LOAD_FROM_TABLE_V2",t[1729]="ER_MASTER_DELAY_VALUE_O
4573UT_OF_RANGE",t[1730]="ER_ONLY_FD_AND_RBR_EVENTS_ALLOWED_IN_BINLOG_STATEMENT",t[1731]="ER_PARTITION_EXCHANGE_DIFFERENT_OPTION",t[1732]="ER_PARTITION_EXCHANGE_PART_TABLE",t[1733]="ER_PARTITION_EXCHANGE_TEMP_TABLE",t[1734]="ER_PARTITION_INSTEAD_OF_SUBPARTITION",t[1735]="ER_UNKNOWN_PARTITION",t[1736]="ER_TABLES_DIFFERENT_METADATA",t[1737]="ER_ROW_DOES_NOT_MATCH_PARTITION",t[1738]="ER_BINLOG_CACHE_SIZE_GREATER_THAN_MAX",t[1739]="ER_WARN_INDEX_NOT_APPLICABLE",t[1740]="ER_PARTITION_EXCHANGE_FOREIGN_KEY",t[1741]="ER_NO_SUCH_KEY_VALUE",t[1742]="ER_RPL_INFO_DATA_TOO_LONG",t[1743]="ER_NETWORK_READ_EVENT_CHECKSUM_FAILURE",t[1744]="ER_BINLOG_READ_EVENT_CHECKSUM_FAILURE",t[1745]="ER_BINLOG_STMT_CACHE_SIZE_GREATER_THAN_MAX",t[1746]="ER_CANT_UPDATE_TABLE_IN_CREATE_TABLE_SELECT",t[1747]="ER_PARTITION_CLAUSE_ON_NONPARTITIONED",t[1748]="ER_ROW_DOES_NOT_MATCH_GIVEN_PARTITION_SET",t[1749]="ER_NO_SUCH_PARTITION",t[1750]="ER_CHANGE_RPL_INFO_REPOSITORY_FAILURE",t[1751]="ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_CREATED_TEMP_TABLE",t[1752]="ER_WARNING_NOT_COMPLETE_ROLLBACK_WITH_DROPPED_TEMP_TABLE",t[1753]="ER_MTS_FEATURE_IS_NOT_SUPPORTED",t[1754]="ER_MTS_UPDATED_DBS_GREATER_MAX",t[1755]="ER_MTS_CANT_PARALLEL",t[1756]="ER_MTS_INCONSISTENT_DATA",t[1757]="ER_FULLTEXT_NOT_SUPPORTED_WITH_PARTITIONING",t[1758]="ER_DA_INVALID_CONDITION_NUMBER",t[1759]="ER_INSECURE_PLAIN_TEXT",t[1760]="ER_INSECURE_CHANGE_MASTER",t[1761]="ER_FOREIGN_DUPLICATE_KEY_WITH_CHILD_INFO",t[1762]="ER_FOREIGN_DUPLICATE_KEY_WITHOUT_CHILD_INFO",t[1763]="ER_SQLTHREAD_WITH_SECURE_SLAVE",t[1764]="ER_TABLE_HAS_NO_FT",t[1765]="ER_VARIABLE_NOT_SETTABLE_IN_SF_OR_TRIGGER",t[1766]="ER_VARIABLE_NOT_SETTABLE_IN_TRANSACTION",t[1767]="ER_GTID_NEXT_IS_NOT_IN_GTID_NEXT_LIST",t[1768]="ER_CANT_CHANGE_GTID_NEXT_IN_TRANSACTION",t[1769]="ER_SET_STATEMENT_CANNOT_INVOKE_FUNCTION",t[1770]="ER_GTID_NEXT_CANT_BE_AUTOMATIC_IF_GTID_NEXT_LIST_IS_NON_NULL",t[1771]="ER_SKIPPING_LOGGED_TRANSACTION",t[1772]="ER_MALFORMED_GTID_SET_SPECIFICATION",t[1773]="ER_MALFORMED_GTID_SET_ENCODING",t[1774]="ER_MALFORMED_GTID_SPECIFICATION",t[1775]="ER_GNO_EXHAUSTED",t[1776]="ER_BAD_SLAVE_AUTO_POSITION",t[1777]="ER_AUTO_POSITION_REQUIRES_GTID_MODE_NOT_OFF",t[1778]="ER_CANT_DO_IMPLICIT_COMMIT_IN_TRX_WHEN_GTID_NEXT_IS_SET",t[1779]="ER_GTID_MODE_ON_REQUIRES_ENFORCE_GTID_CONSISTENCY_ON",t[1780]="ER_GTID_MODE_REQUIRES_BINLOG",t[1781]="ER_CANT_SET_GTID_NEXT_TO_GTID_WHEN_GTID_MODE_IS_OFF",t[1782]="ER_CANT_SET_GTID_NEXT_TO_ANONYMOUS_WHEN_GTID_MODE_IS_ON",t[1783]="ER_CANT_SET_GTID_NEXT_LIST_TO_NON_NULL_WHEN_GTID_MODE_IS_OFF",t[1784]="ER_FOUND_GTID_EVENT_WHEN_GTID_MODE_IS_OFF",t[1785]="ER_GTID_UNSAFE_NON_TRANSACTIONAL_TABLE",t[1786]="ER_GTID_UNSAFE_CREATE_SELECT",t[1787]="ER_GTID_UNSAFE_CREATE_DROP_TEMPORARY_TABLE_IN_TRANSACTION",t[1788]="ER_GTID_MODE_CAN_ONLY_CHANGE_ONE_STEP_AT_A_TIME",t[1789]="ER_MASTER_HAS_PURGED_REQUIRED_GTIDS",t[1790]="ER_CANT_SET_GTID_NEXT_WHEN_OWNING_GTID",t[1791]="ER_UNKNOWN_EXPLAIN_FORMAT",t[1792]="ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION",t[1793]="ER_TOO_LONG_TABLE_PARTITION_COMMENT",t[1794]="ER_SLAVE_CONFIGURATION",t[1795]="ER_INNODB_FT_LIMIT",t[1796]="ER_INNODB_NO_FT_TEMP_TABLE",t[1797]="ER_INNODB_FT_WRONG_DOCID_COLUMN",t[1798]="ER_INNODB_FT_WRONG_DOCID_INDEX",t[1799]="ER_INNODB_ONLINE_LOG_TOO_BIG",t[1800]="ER_UNKNOWN_ALTER_ALGORITHM",t[1801]="ER_UNKNOWN_ALTER_LOCK",t[1802]="ER_MTS_CHANGE_MASTER_CANT_RUN_WITH_GAPS",t[1803]="ER_MTS_RECOVERY_FAILURE",t[1804]="ER_MTS_RESET_WORKERS",t[1805]="ER_COL_COUNT_DOESNT_MATCH_CORRUPTED_V2",t[1806]="ER_SLAVE_SILENT_RETRY_TRANSACTION",t[1807]="ER_DISCARD_FK_CHECKS_RUNNING",t[1808]="ER_TABLE_SCHEMA_MISMATCH",t[1809]="ER_TABLE_IN_SYSTEM_TABLESPACE",t[1810]="ER_IO_READ_ERROR",t[1811]="ER_IO_WRITE_ERROR",t[1812]="ER_TABLESPACE_MISSING",t[1813]="ER_TABLESPACE_EXISTS",t[1814]="ER_TABLESPACE_DISCARDED",t[1815]="ER_INTERNAL_ERROR",t[1816]="ER_INNODB_IMPORT_ERROR",t[1817]="ER_INNODB_INDEX_CORRUPT",t[1818]="ER_INVALID_YEAR_COLUMN_LENGTH",t[1819]="ER_NOT_VALID_PASSWORD",t[1820]="ER_MUST_CHANGE_PASSWORD",t[1821]="ER_FK_NO_INDEX_CHILD",t[1822]="ER_FK_NO_INDEX_PARENT",t[1823]="ER_FK_FAIL_ADD_SYSTEM",t[1824]="ER_FK_CANNOT_OPEN_PARENT",t[1825]="ER_FK_INCORRECT_OPTION",t[1826]="ER_FK_DUP_NAME",t[1827]="ER_PASSWORD_FORMAT",t[1828]="ER_FK_COLUMN_CANNOT_DROP",t[1829]="ER_FK_COLUMN_CANNOT_DROP_CHILD",t[1830]="ER_FK_COLUMN_NOT_NULL",t[1831]="ER_DUP_INDEX",t[1832]="ER_FK_COLUMN_CANNOT_CHANGE",t[1833]="ER_FK_COLUMN_CANNOT_CHANGE_CHILD",t[1834]="ER_FK_CANNOT_DELETE_PARENT",t[1835]="ER_MALFORMED_PACKET",t[1836]="ER_READ_ONLY_MODE",t[1837]="ER_GTID_NEXT_TYPE_UNDEFINED_GROUP",t[1838]="ER_VARIABLE_NOT_SETTABLE_IN_SP",t[1839]="ER_CANT_SET_GTID_PURGED_WHEN_GTID_MODE_IS_OFF",t[1840]="ER_CANT_SET_GTID_PURGED_WHEN_GTID_EXECUTED_IS_NOT_EMPTY",t[1841]="ER_CANT_SET_GTID_PURGED_WHEN_OWNED_GTIDS_IS_NOT_EMPTY",t[1842]="ER_GTID_PURGED_WAS_CHANGED",t[1843]="ER_GTID_EXECUTED_WAS_CHANGED",t[1844]="ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES",t[1845]="ER_ALTER_OPERATION_NOT_SUPPORTED",t[1846]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON",t[1847]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COPY",t[1848]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_PARTITION",t[1849]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_RENAME",t[1850]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_COLUMN_TYPE",t[1851]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FK_CHECK",t[1852]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_IGNORE",t[1853]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOPK",t[1854]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_AUTOINC",t[1855]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_HIDDEN_FTS",t[1856]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_CHANGE_FTS",t[1857]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_FTS",t[1858]="ER_SQL_SLAVE_SKIP_COUNTER_NOT_SETTABLE_IN_GTID_MODE",t[1859]="ER_DUP_UNKNOWN_IN_INDEX",t[1860]="ER_IDENT_CAUSES_TOO_LONG_PATH",t[1861]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL",t[1862]="ER_MUST_CHANGE_PASSWORD_LOGIN",t[1863]="ER_ROW_IN_WRONG_PARTITION",t[1864]="ER_MTS_EVENT_BIGGER_PENDING_JOBS_SIZE_MAX",t[1865]="ER_INNODB_NO_FT_USES_PARSER",t[1866]="ER_BINLOG_LOGICAL_CORRUPTION",t[1867]="ER_WARN_PURGE_LOG_IN_USE",t[1868]="ER_WARN_PURGE_LOG_IS_ACTIVE",t[1869]="ER_AUTO_INCREMENT_CONFLICT",t[1870]="WARN_ON_BLOCKHOLE_IN_RBR",t[1871]="ER_SLAVE_MI_INIT_REPOSITORY",t[1872]="ER_SLAVE_RLI_INIT_REPOSITORY",t[1873]="ER_ACCESS_DENIED_CHANGE_USER_ERROR",t[1874]="ER_INNODB_READ_ONLY",t[1875]="ER_STOP_SLAVE_SQL_THREAD_TIMEOUT",t[1876]="ER_STOP_SLAVE_IO_THREAD_TIMEOUT",t[1877]="ER_TABLE_CORRUPT",t[1878]="ER_TEMP_FILE_WRITE_FAILURE",t[1879]="ER_INNODB_FT_AUX_NOT_HEX_ID",t[1880]="ER_OLD_TEMPORALS_UPGRADED",t[1881]="ER_INNODB_FORCED_RECOVERY",t[1882]="ER_AES_INVALID_IV",t[1883]="ER_P
4573LUGIN_CANNOT_BE_UNINSTALLED",t[1884]="ER_GTID_UNSAFE_BINLOG_SPLITTABLE_STATEMENT_AND_GTID_GROUP",t[1885]="ER_SLAVE_HAS_MORE_GTIDS_THAN_MASTER",t[1886]="ER_MISSING_KEY",t[1887]="WARN_NAMED_PIPE_ACCESS_EVERYONE",t[1888]="ER_FOUND_MISSING_GTIDS",t[3e3]="ER_FILE_CORRUPT",t[3001]="ER_ERROR_ON_MASTER",t[3002]="ER_INCONSISTENT_ERROR",t[3003]="ER_STORAGE_ENGINE_NOT_LOADED",t[3004]="ER_GET_STACKED_DA_WITHOUT_ACTIVE_HANDLER",t[3005]="ER_WARN_LEGACY_SYNTAX_CONVERTED",t[3006]="ER_BINLOG_UNSAFE_FULLTEXT_PLUGIN",t[3007]="ER_CANNOT_DISCARD_TEMPORARY_TABLE",t[3008]="ER_FK_DEPTH_EXCEEDED",t[3009]="ER_COL_COUNT_DOESNT_MATCH_PLEASE_UPDATE_V2",t[3010]="ER_WARN_TRIGGER_DOESNT_HAVE_CREATED",t[3011]="ER_REFERENCED_TRG_DOES_NOT_EXIST",t[3012]="ER_EXPLAIN_NOT_SUPPORTED",t[3013]="ER_INVALID_FIELD_SIZE",t[3014]="ER_MISSING_HA_CREATE_OPTION",t[3015]="ER_ENGINE_OUT_OF_MEMORY",t[3016]="ER_PASSWORD_EXPIRE_ANONYMOUS_USER",t[3017]="ER_SLAVE_SQL_THREAD_MUST_STOP",t[3018]="ER_NO_FT_MATERIALIZED_SUBQUERY",t[3019]="ER_INNODB_UNDO_LOG_FULL",t[3020]="ER_INVALID_ARGUMENT_FOR_LOGARITHM",t[3021]="ER_SLAVE_CHANNEL_IO_THREAD_MUST_STOP",t[3022]="ER_WARN_OPEN_TEMP_TABLES_MUST_BE_ZERO",t[3023]="ER_WARN_ONLY_MASTER_LOG_FILE_NO_POS",t[3024]="ER_QUERY_TIMEOUT",t[3025]="ER_NON_RO_SELECT_DISABLE_TIMER",t[3026]="ER_DUP_LIST_ENTRY",t[3027]="ER_SQL_MODE_NO_EFFECT",t[3028]="ER_AGGREGATE_ORDER_FOR_UNION",t[3029]="ER_AGGREGATE_ORDER_NON_AGG_QUERY",t[3030]="ER_SLAVE_WORKER_STOPPED_PREVIOUS_THD_ERROR",t[3031]="ER_DONT_SUPPORT_SLAVE_PRESERVE_COMMIT_ORDER",t[3032]="ER_SERVER_OFFLINE_MODE",t[3033]="ER_GIS_DIFFERENT_SRIDS",t[3034]="ER_GIS_UNSUPPORTED_ARGUMENT",t[3035]="ER_GIS_UNKNOWN_ERROR",t[3036]="ER_GIS_UNKNOWN_EXCEPTION",t[3037]="ER_GIS_INVALID_DATA",t[3038]="ER_BOOST_GEOMETRY_EMPTY_INPUT_EXCEPTION",t[3039]="ER_BOOST_GEOMETRY_CENTROID_EXCEPTION",t[3040]="ER_BOOST_GEOMETRY_OVERLAY_INVALID_INPUT_EXCEPTION",t[3041]="ER_BOOST_GEOMETRY_TURN_INFO_EXCEPTION",t[3042]="ER_BOOST_GEOMETRY_SELF_INTERSECTION_POINT_EXCEPTION",t[3043]="ER_BOOST_GEOMETRY_UNKNOWN_EXCEPTION",t[3044]="ER_STD_BAD_ALLOC_ERROR",t[3045]="ER_STD_DOMAIN_ERROR",t[3046]="ER_STD_LENGTH_ERROR",t[3047]="ER_STD_INVALID_ARGUMENT",t[3048]="ER_STD_OUT_OF_RANGE_ERROR",t[3049]="ER_STD_OVERFLOW_ERROR",t[3050]="ER_STD_RANGE_ERROR",t[3051]="ER_STD_UNDERFLOW_ERROR",t[3052]="ER_STD_LOGIC_ERROR",t[3053]="ER_STD_RUNTIME_ERROR",t[3054]="ER_STD_UNKNOWN_EXCEPTION",t[3055]="ER_GIS_DATA_WRONG_ENDIANESS",t[3056]="ER_CHANGE_MASTER_PASSWORD_LENGTH",t[3057]="ER_USER_LOCK_WRONG_NAME",t[3058]="ER_USER_LOCK_DEADLOCK",t[3059]="ER_REPLACE_INACCESSIBLE_ROWS",t[3060]="ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_GIS",t[3061]="ER_ILLEGAL_USER_VAR",t[3062]="ER_GTID_MODE_OFF",t[3063]="ER_UNSUPPORTED_BY_REPLICATION_THREAD",t[3064]="ER_INCORRECT_TYPE",t[3065]="ER_FIELD_IN_ORDER_NOT_SELECT",t[3066]="ER_AGGREGATE_IN_ORDER_NOT_SELECT",t[3067]="ER_INVALID_RPL_WILD_TABLE_FILTER_PATTERN",t[3068]="ER_NET_OK_PACKET_TOO_LARGE",t[3069]="ER_INVALID_JSON_DATA",t[3070]="ER_INVALID_GEOJSON_MISSING_MEMBER",t[3071]="ER_INVALID_GEOJSON_WRONG_TYPE",t[3072]="ER_INVALID_GEOJSON_UNSPECIFIED",t[3073]="ER_DIMENSION_UNSUPPORTED",t[3074]="ER_SLAVE_CHANNEL_DOES_NOT_EXIST",t[3075]="ER_SLAVE_MULTIPLE_CHANNELS_HOST_PORT",t[3076]="ER_SLAVE_CHANNEL_NAME_INVALID_OR_TOO_LONG",t[3077]="ER_SLAVE_NEW_CHANNEL_WRONG_REPOSITORY",t[3078]="ER_SLAVE_CHANNEL_DELETE",t[3079]="ER_SLAVE_MULTIPLE_CHANNELS_CMD",t[3080]="ER_SLAVE_MAX_CHANNELS_EXCEEDED",t[3081]="ER_SLAVE_CHANNEL_MUST_STOP",t[3082]="ER_SLAVE_CHANNEL_NOT_RUNNING",t[3083]="ER_SLAVE_CHANNEL_WAS_RUNNING",t[3084]="ER_SLAVE_CHANNEL_WAS_NOT_RUNNING",t[3085]="ER_SLAVE_CHANNEL_SQL_THREAD_MUST_STOP",t[3086]="ER_SLAVE_CHANNEL_SQL_SKIP_COUNTER",t[3087]="ER_WRONG_FIELD_WITH_GROUP_V2",t[3088]="ER_MIX_OF_GROUP_FUNC_AND_FIELDS_V2",t[3089]="ER_WARN_DEPRECATED_SYSVAR_UPDATE",t[3090]="ER_WARN_DEPRECATED_SQLMODE",t[3091]="ER_CANNOT_LOG_PARTIAL_DROP_DATABASE_WITH_GTID",t[3092]="ER_GROUP_REPLICATION_CONFIGURATION",t[3093]="ER_GROUP_REPLICATION_RUNNING",t[3094]="ER_GROUP_REPLICATION_APPLIER_INIT_ERROR",t[3095]="ER_GROUP_REPLICATION_STOP_APPLIER_THREAD_TIMEOUT",t[3096]="ER_GROUP_REPLICATION_COMMUNICATION_LAYER_SESSION_ERROR",t[3097]="ER_GROUP_REPLICATION_COMMUNICATION_LAYER_JOIN_ERROR",t[3098]="ER_BEFORE_DML_VALIDATION_ERROR",t[3099]="ER_PREVENTS_VARIABLE_WITHOUT_RBR",t[3100]="ER_RUN_HOOK_ER
4573ROR",t[3101]="ER_TRANSACTION_ROLLBACK_DURING_COMMIT",t[3102]="ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED",t[3103]="ER_UNSUPPORTED_ALTER_INPLACE_ON_VIRTUAL_COLUMN",t[3104]="ER_WRONG_FK_OPTION_FOR_GENERATED_COLUMN",t[3105]="ER_NON_DEFAULT_VALUE_FOR_GENERATED_COLUMN",t[3106]="ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN",t[3107]="ER_GENERATED_COLUMN_NON_PRIOR",t[3108]="ER_DEPENDENT_BY_GENERATED_COLUMN",t[3109]="ER_GENERATED_COLUMN_REF_AUTO_INC",t[3110]="ER_FEATURE_NOT_AVAILABLE",t[3111]="ER_CANT_SET_GTID_MODE",t[3112]="ER_CANT_USE_AUTO_POSITION_WITH_GTID_MODE_OFF",t[3113]="ER_CANT_REPLICATE_ANONYMOUS_WITH_AUTO_POSITION",t[3114]="ER_CANT_REPLICATE_ANONYMOUS_WITH_GTID_MODE_ON",t[3115]="ER_CANT_REPLICATE_GTID_WITH_GTID_MODE_OFF",t[3116]="ER_CANT_SET_ENFORCE_GTID_CONSISTENCY_ON_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS",t[3117]="ER_SET_ENFORCE_GTID_CONSISTENCY_WARN_WITH_ONGOING_GTID_VIOLATING_TRANSACTIONS",t[3118]="ER_ACCOUNT_HAS_BEEN_LOCKED",t[3119]="ER_WRONG_TABLESPACE_NAME",t[3120]="ER_TABLESPACE_IS_NOT_EMPTY",t[3121]="ER_WRONG_FILE_NAME",t[3122]="ER_BOOST_GEOMETRY_INCONSISTENT_TURNS_EXCEPTION",t[3123]="ER_WARN_OPTIMIZER_HINT_SYNTAX_ERROR",t[3124]="ER_WARN_BAD_MAX_EXECUTION_TIME",t[3125]="ER_WARN_UNSUPPORTED_MAX_EXECUTION_TIME",t[3126]="ER_WARN_CONFLICTING_HINT",t[3127]="ER_WARN_UNKNOWN_QB_NAME",t[3128]="ER_UNRESOLVED_HINT_NAME",t[3129]="ER_WARN_ON_MODIFYING_GTID_EXECUTED_TABLE",t[3130]="ER_PLUGGABLE_PROTOCOL_COMMAND_NOT_SUPPORTED",t[3131]="ER_LOCKING_SERVICE_WRONG_NAME",t[3132]="ER_LOCKING_SERVICE_DEADLOCK",t[3133]="ER_LOCKING_SERVICE_TIMEOUT",t[3134]="ER_GIS_MAX_POINTS_IN_GEOMETRY_OVERFLOWED",t[3135]="ER_SQL_MODE_MERGED",t[3136]="ER_VTOKEN_PLUGIN_TOKEN_MISMATCH",t[3137]="ER_VTOKEN_PLUGIN_TOKEN_NOT_FOUND",t[3138]="ER_CANT_SET_VARIABLE_WHEN_OWNING_GTID",t[3139]="ER_SLAVE_CHANNEL_OPERATION_NOT_ALLOWED",t[3140]="ER_INVALID_JSON_TEXT",t[3141]="ER_INVALID_JSON_TEXT_IN_PARAM",t[3142]="ER_INVALID_JSON_BINARY_DATA",t[3143]="ER_INVALID_JSON_PATH",t[3144]="ER_INVALID_JSON_CHARSET",t[3145]="ER_INVALID_JSON_CHARSET_IN_FUNCTION",t[3146]="ER_INVALID_TYPE_FOR_JSON",t[3147]="ER_INVALID_CAST_TO_JSON",t[3148]="ER_INVALID_JSON_PATH_CHARSET",t[3149]="ER_INVALID_JSON_PATH_WILDCARD",t[3150]="ER_JSON_VALUE_TOO_BIG",t[3151]="ER_JSON_KEY_TOO_BIG",t[3152]="ER_JSON_USED_AS_KEY",t[3153]="ER_JSON_VACUOUS_PATH",t[3154]="ER_JSON_BAD_ONE_OR_ALL_ARG",t[3155]="ER_NUMERIC_JSON_VALUE_OUT_OF_RANGE",t[3156]="ER_INVALID_JSON_VALUE_FOR_CAST",t[3157]="ER_JSON_DOCUMENT_TOO_DEEP",t[3158]="ER_JSON_DOCUMENT_NULL_KEY",t[3159]="ER_SECURE_TRANSPORT_REQUIRED",t[3160]="ER_NO_SECURE_TRANSPORTS_CONFIGURED",t[3161]="ER_DISABLED_STORAGE_ENGINE",t[3162]="ER_USER_DOES_NOT_EXIST",t[3163]="ER_USER_ALREADY_EXISTS",t[3164]="ER_AUDIT_API_ABORT",t[3165]="ER_INVALID_JSON_PATH_ARRAY_CELL",t[3166]="ER_BUFPOOL_RESIZE_INPROGRESS",t[3167]="ER_FEATURE_DISABLED_SEE_DOC",t[3168]="ER_SERVER_ISNT_AVAILABLE",t[3169]="ER_SESSION_WAS_KILLED",t[3170]="ER_CAPACITY_EXCEEDED",t[3171]="ER_CAPACITY_EXCEEDED_IN_RANGE_OPTIMIZER",t[3172]="ER_TABLE_NEEDS_UPG_PART",t[3173]="ER_CANT_WAIT_FOR_EXECUTED_GTID_SET_WHILE_OWNING_A_GTID",t[3174]="ER_CANNOT_ADD_FOREIGN_BASE_COL_VIRTUAL",t[3175]="ER_CANNOT_CREATE_VIRTUAL_INDEX_CONSTRAINT",t[3176]="ER_ERROR_ON_MODIFYING_GTID_EXECUTED_TABLE",t[3177]="ER_LO
4573CK_REFUSED_BY_ENGINE",t[3178]="ER_UNSUPPORTED_ALTER_ONLINE_ON_VIRTUAL_COLUMN",t[3179]="ER_MASTER_KEY_ROTATION_NOT_SUPPORTED_BY_SE",t[3180]="ER_MASTER_KEY_ROTATION_ERROR_BY_SE",t[3181]="ER_MASTER_KEY_ROTATION_BINLOG_FAILED",t[3182]="ER_MASTER_KEY_ROTATION_SE_UNAVAILABLE",t[3183]="ER_TABLESPACE_CANNOT_ENCRYPT",t[3184]="ER_INVALID_ENCRYPTION_OPTION",t[3185]="ER_CANNOT_FIND_KEY_IN_KEYRING",t[3186]="ER_CAPACITY_EXCEEDED_IN_PARSER",t[3187]="ER_UNSUPPORTED_ALTER_ENCRYPTION_INPLACE",t[3188]="ER_KEYRING_UDF_KEYRING_SERVICE_ERROR",t[3189]="ER_USER_COLUMN_OLD_LENGTH",t[3190]="ER_CANT_RESET_MASTER",t[3191]="ER_GROUP_REPLICATION_MAX_GROUP_SIZE",t[3192]="ER_CANNOT_ADD_FOREIGN_BASE_COL_STORED",t[3193]="ER_TABLE_REFERENCED",t[3194]="ER_PARTITION_ENGINE_DEPRECATED_FOR_TABLE",t[3195]="ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID_ZERO",t[3196]="ER_WARN_USING_GEOMFROMWKB_TO_SET_SRID",t[3197]="ER_XA_RETRY",t[3198]="ER_KEYRING_AWS_UDF_AWS_KMS_ERROR",t[3199]="ER_BINLOG_UNSAFE_XA",t[3200]="ER_UDF_ERROR",t[3201]="ER_KEYRING_MIGRATION_FAILURE",t[3202]="ER_KEYRING_ACCESS_DENIED_ERROR",t[3203]="ER_KEYRING_MIGRATION_STATUS",t[3204]="ER_PLUGIN_FAILED_TO_OPEN_TABLES",t[3205]="ER_PLUGIN_FAILED_TO_OPEN_TABLE",t[3206]="ER_AUDIT_LOG_NO_KEYRING_PLUGIN_INSTALLED",t[3207]="ER_AUDIT_LOG_ENCRYPTION_PASSWORD_HAS_NOT_BEEN_SET",t[3208]="ER_AUDIT_LOG_COULD_NOT_CREATE_AES_KEY",t[3209]="ER_AUDIT_LOG_ENCRYPTION_PASSWORD_CANNOT_BE_FETCHED",t[3210]="ER_AUDIT_LOG_JSON_FILTERING_NOT_ENABLED",t[3211]="ER_AUDIT_LOG_UDF_INSUFFICIENT_PRIVILEGE",t[3212]="ER_AUDIT_LOG_SUPER_PRIVILEGE_REQUIRED",t[3213]="ER_COULD_NOT_REINITIALIZE_AUDIT_LOG_FILTERS",t[3214]="ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_TYPE",t[3215]="ER_AUDIT_LOG_UDF_INVALID_ARGUMENT_COUNT",t[3216]="ER_AUDIT_LOG_HAS_NOT_BEEN_INSTALLED",t[3217]="ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_TYPE",t[3218]="ER_AUDIT_LOG_UDF_READ_INVALID_MAX_ARRAY_LENGTH_ARG_VALUE",t[3219]="ER_AUDIT_LOG_JSON_FILTER_PARSING_ERROR",t[3220]="ER_AUDIT_LOG_JSON_FILTER_NAME_CANNOT_BE_EMPTY",t[3221]="ER_AUDIT_LOG_JSON_USER_NAME_CANNOT_BE_EMPTY",t[3222]="ER_AUDIT_LOG_JSON_FILTER_DOES_NOT_EXISTS",t[3223]="ER_AUDIT_LOG_USER_FIRST_CHARACTER_MUST_BE_ALPHANUMERIC",t[3224]="ER_AUDIT_LOG_USER_NAME_INVALID_CHARACTER",t[3225]="ER_AUDIT_LOG_HOST_NAME_INVALID_CHARACTER",t[3226]="WARN_DEPRECATED_MAXDB_SQL_MODE_FOR_TIMESTAMP",t[3227]="ER_XA_REPLICATION_FILTERS",t[3228]="ER_CANT_OPEN_ERROR_LOG",t[3229]="ER_GROUPING_ON_TIMESTAMP_IN_DST",t[3230]="ER_CANT_START_SERVER_NAMED_PIPE"}(GR)),GR}var zR,CH;function yAe(){if(CH)return zR;CH=1;var t=ir;zR=i;function i(r){this._object=r,this._timeout=null}return i.prototype.active=function(){this._timeout&&(this._timeout.refresh?this._timeout.refresh():t.active(this._timeout))},i.prototype.start=function(n){this.stop(),this._timeout=t.setTimeout(this._onTimeout.bind(this),n)},i.prototype.stop=function(){this._timeout&&(t.clearTimeout(this._timeout),this._timeout=null)}
4573,i.prototype._onTimeout=function(){return this._object._onTimeout()},zR}var QR,TH;function Rp(){if(TH)return QR;TH=1;var t=ir,i=ir.EventEmitter,r=QA(),n=_Ae(),a=yAe(),s=i.listenerCount||function(c,h){return c.listeners(h).length},o=` 4574 -------------------- 4575`;QR=l,t.inherits(l,i);function l(c,h){typeof c=="function"&&(h=c,c={}),i.call(this),c=c||{},this._callback=h,this._callSite=null,this._ended=!1,this._timeout=c.timeout,this._timer=new a(this)}return l.determinePacket=function(c){switch(c){case 0:return r.OkPacket;case 254:return r.EofPacket;case 255:return r.ErrorPacket;default:return}},l.prototype.hasErrorHandler=function(){return!!this._callback||s(this,"error")>1},l.prototype._packetToError=function(c){var h=n[c.errno]||"UNKNOWN_CODE_PLEASE_REPORT",u=new Error(h+": "+c.message);return u.code=h,u.errno=c.errno,u.sqlMessage=c.message,u.sqlState=c.sqlState,u},l.prototype.end=function(c){if(!this._ended){this._ended=!0,c&&this._addLongStackTrace(c),this._callSite=null;try{c&&this.emit("error",c)}finally{try{this._callback&&this._callback.apply(this,arguments)}finally{this.emit("end")}}}},l.prototype.OkPacket=function(c){this.end(null,c)},l.prototype.ErrorPacket=function(c){this.end(this._packetToError(c))},l.prototype.start=function(){},l.prototype._addLongStackTrace=function(h){var u=this._callSite&&this._callSite.stack;if(!(!u||typeof u!="string")&&h.stack.indexOf(o)===-1){var d=u.indexOf(` 4576`);d!==-1&&(h.stack+=o+u.substr(d+1))}}
4576,l.prototype._onTimeout=function(){this.emit("timeout")},QR}var VR={},MH;function e7(){return MH||(MH=1,function(t){var i=Zu().Buffer,r=ir,n=t;function a(l,c,h){switch(h=h||{},l){case"mysql_native_password":return n.token(h.password,c.slice(0,20));default:return}}n.auth=a;function s(l){var c=r.createHash("sha1");return c.update(l,"binary"),c.digest("binary")}n.sha1=s;function o(l,c){l=i.from(l,"binary"),c=i.from(c,"binary");for(var h=i.allocUnsafe(l.length),u=0;u<l.length;u++)h[u]=l[u]^c[u];return h}n.xor=o,n.token=function(l,c){if(!l)return i.alloc(0);var h=s(i.from(l,"utf8").toString("binary")),u=s(h),d=s(c.toString("binary")+u);return o(d,h)},n.hashPassword=function(l){var c=[20528,22325],h=7,u=[4660,22129],d=i.alloc(8);typeof l=="string"&&(l=i.from(l));for(var A=0;A<l.length;A++){var f=l[A];f===32||f===9||(c=this.xor32(c,this.add32(this.mul32(this.add32(this.and32(c,[0,63]),[0,h]),[0,f]),this.shl32(c,8))),u=this.add32(u,this.xor32(this.shl32(u,8),c)),h+=f)}return this.int31Write(d,c,0),this.int31Write(d,u,4),d},n.randomInit=function(l,c){return{max_value:1073741823,max_value_dbl:1073741823,seed1:l%1073741823,seed2:c%1073741823}},n.myRnd=function(l){return l.seed1=(l.seed1*3+l.seed2)%l.max_value,l.seed2=(l.seed1+l.seed2+33)%l.max_value,l.seed1/l.max_value_dbl},n.scramble323=function(l,c){if(!c)return i.alloc(0);for(var h=i.allocUnsafe(8),u=this.hashPassword(c),d=this.hashPassword(l.slice(0,8)),A=this.int32Read(u,0)^this.int32Read(d,0),f=this.int32Read(u,4)^this.int32Read(d,4),m=this.randomInit(A,f),g=0;g<8;g++)h[g]=Math.floor(this.myRnd(m)*31)+64;for(var p=Math.floor(this.myRnd(m)*31),g=0;g<8;g++)h[g]^=p;return h},n.xor32=function(l,c){return[l[0]^c[0],l[1]^c[1]]},n.add32=function(l,c){var h=l[1]+c[1],u=l[0]+c[0]+((h&4294901760)>>16);return[u&65535,h&65535]},n.mul32=function(l,c){var h=l[1]*c[1],u=(l[1]*c[1]>>16&65535)+(l[0]*c[1]&65535)+(l[1]*c[0]&65535);return[u&65535,h&65535]},n.and32=function(l,c){return[l[0]&c[0],l[1]&c[1]]},n.shl32=function(l,c){var h=l[1]<<c,u=l[0]<<c|(h&4294901760)>>16;return[u&65535,h&65535]},n.int31Write=function(l,c,h){l[h]=c[0]>>8&127,l[h+1]=c[0]&255,l[h+2]=c[1]>>8&255,l[h+3]=c[1]&255},n.int32Read=function(l,c){return(l[c]<<24)+(l[c+1]<<16)+(l[c+2]<<8)+l[c+3]}}(VR)),VR}var WR,xH;function EAe(){if(xH)return WR;xH=1;var t=Rp(),i=ir,r=QA(),n=e7();WR=a,i.inherits(a,t);function a(s,o){t.call(this,s,o),this._user=s.user,this._password=s.password,this._database=s.database,this._charsetNumber=s.charsetNumber,this._currentConfig=s.currentConfig}return a.prototype.determinePacket=function(o){switch(o){case 254:return r.AuthSwitchRequestPacket;case 255:return r.ErrorPacket;default:return}},a.prototype.start=function(s){var o=s.scrambleBuff();o=n.token(this._password,o);var l=new r.ComChangeUserPacket({user:this._user,scrambleBuff:o,database:this._database,charsetNumber:this._charsetNumber});this._currentConfig.user=this._user,this._currentConfig.password=this._password,this._currentConfig.database=this._database,this._currentConfig.charsetNumber=this._charsetNumber,this.emit("packet",l)},a.prototype.AuthSwitchRequestPacket=function(s){var o=s.authMethodName,l=n.auth(o,s.authMethodData,{password:this._password});
4576if(l!==void 0)this.emit("packet",new r.AuthSwitchResponsePacket({data:l}));else{var c=new Error("MySQL is requesting the "+o+" authentication method, which is not supported.");c.code="UNSUPPORTED_AUTH_METHOD",c.fatal=!0,this.end(c)}},a.prototype.ErrorPacket=function(s){var o=this._packetToError(s);o.fatal=!0,this.end(o)},WR}var jR,RH;function wAe(){if(RH)return jR;RH=1;var t=Rp(),i=ir,r=QA(),n=e7(),a=vE();jR=s,i.inherits(s,t);function s(o,l){t.call(this,o,l),o=o||{},this._config=o.config,this._handshakeInitializationPacket=null}return s.prototype.determinePacket=function(l,c){if(l===255)return r.ErrorPacket;if(!this._handshakeInitializationPacket)return r.HandshakeInitializationPacket;if(l===254)return c.packetLength()===1?r.UseOldPasswordPacket:r.AuthSwitchRequestPacket},s.prototype.AuthSwitchRequestPacket=function(o){var l=o.authMethodName,c=n.auth(l,o.authMethodData,{password:this._config.password});if(c!==void 0)this.emit("packet",new r.AuthSwitchResponsePacket({data:c}));else{var h=new Error("MySQL is requesting the "+l+" authentication method, which is not supported.");h.code="UNSUPPORTED_AUTH_METHOD",h.fatal=!0,this.end(h)}},s.prototype.HandshakeInitializationPacket=function(o){this._handshakeInitializationPacket=o,this._config.protocol41=o.protocol41;var l=o.serverCapabilities1&a.CLIENT_SSL;if(this._config.ssl){if(!l){var c=new Error("Server does not support secure connection");c.code="HANDSHAKE_NO_SSL_SUPPORT",c.fatal=!0,this.end(c);return}this._config.clientFlags|=a.CLIENT_SSL,this.emit("packet",new r.SSLRequestPacket({clientFlags:this._config.clientFlags,maxPacketSize:this._config.maxPacketSize,charsetNumber:this._config.charsetNumber})),this.emit("start-tls")}else this._sendCredentials()},s.prototype._tlsUpgradeCompleteHandler=function(){this._sendCredentials()},s.prototype._sendCredentials=function(){var o=this._handshakeInitializationPacket;this.emit("packet",new r.ClientAuthenticationPacket({clientFlags:this._config.clientFlags,maxPacketSize:this._config.maxPacketSize,charsetNumber:this._config.charsetNumber,user:this._config.user,database:this._config.database,protocol41:o.protocol41,scrambleBuff:o.protocol41?n.token(this._config.password,o.scrambleBuff()):n.scramble323(o.scrambleBuff(),this._config.password)}))},s.prototype.UseOldPasswordPacket=function(){if(!this._config.insecureAuth){var o=new Error("MySQL server is requesting the old and insecure pre-4.1 auth mechanism. Upgrade the user password or use the {insecureAuth: true} option.");o.code="HANDSHAKE_INSECURE_AUTH",o.fatal=!0,this.end(o);return}this.emit("packet",new r.OldPasswordPacket({scrambleBuff:n.scramble323(this._handshakeInitializationPacket.scrambleBuff(),this._config.password)}))},s.prototype.ErrorPacket=function(o){var l=this._packetToError(o,!0);l.fatal=!0,this.end(l)},jR}var YR,BH;function bAe(){if(BH)return YR;BH=1;var t=Rp(),i=ir,r=QA();YR=n,i.inherits(n,t);function n(a,s){!s&&typeof a=="function"&&(s=a,a={}),t.call(this,a,s)}return n.prototype.start=function(){this.emit("packet",new r.ComPingPacket)},YR}var KR,IH;function SAe(){if(IH)return KR;IH=1,KR=t;function t(i){this.resultSetHeaderPacket=i,this.fieldPackets=[],this.eofPackets=[],this.rows=[]}return KR}var js={},DH;function CAe(){return DH||(DH=1,js.SERVER_STATUS_IN_TRANS=1,js.SERVER_STATUS_AUTOCOMMIT=2,js.SERVER_MORE_RESULTS_EXISTS=8,js.SERVER_QUERY_NO_GOOD_INDEX_USED=16,js.SERVER_QUERY_NO_INDEX_USED=32,js.SERVER_STATUS_CURSOR_EXISTS=64,js.SERVER_STATUS_LAST_ROW_SENT=128,js.SERVER_STATUS_DB_DROPPED=256,js.SERVER_STATUS_NO_BACKSLASH_ESCAPES=512,js.SERVER_STATUS_METADATA_CHANGED=1024,js.SERVER_QUERY_WAS_SLOW=2048,js.SERVER_PS_OUT_PARAMS=4096),js}var Bw={exports:{}},Iw={exports:{}},PH;function nM(){if(PH)return Iw.exports;PH=1,typeof process>"u"||!process.version||process.version.indexOf("v0.")===0||process.version.indexOf("v1.")===0&&process.version.indexOf("v1.8.")!==0?Iw.exports={nextTick:t}:Iw.exports=process;function t(i,r,n,a){if(typeof i!="function")throw new TypeError('"callback" argument must be a function');var s=arguments.length,o,l;switch(s){case 0:case 1:return process.nextTick(i);case 2:return process.nextTick(function(){i.call(null,r)}
4576);case 3:return process.nextTick(function(){i.call(null,r,n)});case 4:return process.nextTick(function(){i.call(null,r,n,a)});default:for(o=new Array(s-1),l=0;l<o.length;)o[l++]=arguments[l];return process.nextTick(function(){i.apply(null,o)})}}return Iw.exports}var XR,LH;function TAe(){if(LH)return XR;LH=1;var t={}.toString;return XR=Array.isArray||function(i){return t.call(i)=="[object Array]"},XR}var qR,OH;function t7(){return OH||(OH=1,qR=ir.EventEmitter),qR}var Ia={},NH;function _E(){if(NH)return Ia;NH=1;function t(g){return Array.isArray?Array.isArray(g):m(g)==="[object Array]"}Ia.isArray=t;function i(g){return typeof g=="boolean"}Ia.isBoolean=i;function r(g){return g===null}Ia.isNull=r;function n(g){return g==null}Ia.isNullOrUndefined=n;function a(g){return typeof g=="number"}Ia.isNumber=a;function s(g){return typeof g=="string"}Ia.isString=s;function o(g){return typeof g=="symbol"}Ia.isSymbol=o;function l(g){return g===void 0}Ia.isUndefined=l;function c(g){return m(g)==="[object RegExp]"}Ia.isRegExp=c;function h(g){return typeof g=="object"&&g!==null}Ia.isObject=h;function u(g){return m(g)==="[object Date]"}Ia.isDate=u;function d(g){return m(g)==="[object Error]"||g instanceof Error}Ia.isError=d;function A(g){return typeof g=="function"}Ia.isFunction=A;function f(g){return g===null||typeof g=="boolean"||typeof g=="number"||typeof g=="string"||typeof g=="symbol"||typeof g>"u"}Ia.isPrimitive=f,Ia.isBuffer=ir.Buffer.isBuffer;function m(g){return Object.prototype.toString.call(g)}return Ia}var Dw={exports:{}},UH;function yE(){return UH||(UH=1,typeof Object.create=="function"?Dw.exports=function(i,r){r&&(i.super_=r,i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}))}:Dw.exports=function(i,r){if(r){i.super_=r;var n=function(){};n.prototype=r.prototype,i.prototype=new n,i.prototype.constructor=i}}),Dw.exports}var ZR={exports:{}},FH;function MAe(){return FH||(FH=1,function(t){function i(s,o){if(!(s instanceof o))throw new TypeError("Cannot call a class as a function")}var r=Zu().Buffer,n=ir;function a(s,o,l){s.copy(o,l)}t.exports=function(){function s(){i(this,s),this.head=null,this.tail=null,this.length=0}return s.prototype.push=function(l){var c={data:l,next:null};this.length>0?this.tail.next=c:this.head=c,this.tail=c,++this.length},s.prototype.unshift=function(l){var c={data:l,next:this.head};this.length===0&&(this.tail=c),this.head=c,++this.length},s.prototype.shift=function(){if(this.length!==0){var l=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,l}},s.prototype.clear=function(){this.head=this.tail=null,this.length=0},s.prototype.join=function(l){if(this.length===0)return"";for(var c=this.head,h=""+c.data;c=c.next;)h+=l+c.data;return h},s.prototype.concat=function(l){if(this.length===0)return r.alloc(0);if(this.length===1)return this.head.data;for(var c=r.allocUnsafe(l>>>0),h=this.head,u=0;h;)a(h.data,c,u),u+=h.data.length,h=h.next;return c},s}(),n&&n.inspect&&n.inspect.custom&&(t.exports.prototype[n.inspect.custom]=function(){var s=n.inspect({length:this.length});return this.constructor.name+" "+s})}(ZR)),ZR.exports}var JR,kH;function i7(){if(kH)return JR;kH=1;var t=nM();function i(a,s){var o=this,l=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return l||c?(s?s(a):a&&(!this._writableState||!this._writableState.errorEmitted)&&t.nextTick(n,this,a),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(a||null,function(h){!s&&h?(t.nextTick(n,o,h),o._writableState&&(o._writableState.errorEmitted=!0)):s&&s(h)}),this)}function r(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}
4576function n(a,s){a.emit("error",s)}return JR={destroy:i,undestroy:r},JR}var $R,HH;function xAe(){if(HH)return $R;HH=1,$R=t;function t(r,n){if(i("noDeprecation"))return r;var a=!1;function s(){if(!a){if(i("throwDeprecation"))throw new Error(n);i("traceDeprecation")?console.trace(n):console.warn(n),a=!0}return r.apply(this,arguments)}return s}function i(r){try{if(!Cy.localStorage)return!1}catch{return!1}var n=Cy.localStorage[r];return n==null?!1:String(n).toLowerCase()==="true"}return $R}var eB,GH;function r7(){if(GH)return eB;GH=1;var t=nM();eB=g;function i(D){var U=this;this.next=null,this.entry=null,this.finish=function(){Y(U,D)}}var r=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:t.nextTick,n;g.WritableState=f;var a=Object.create(_E());a.inherits=yE();var s={deprecate:xAe()},o=t7(),l=Zu().Buffer,c=Cy.Uint8Array||function(){};function h(D){return l.from(D)}function u(D){return l.isBuffer(D)||D instanceof c}var d=i7();a.inherits(g,o);function A(){}function f(D,U){n=n||n0(),D=D||{};var j=U instanceof n;this.objectMode=!!D.objectMode,j&&(this.objectMode=this.objectMode||!!D.writableObjectMode);var J=D.highWaterMark,z=D.writableHighWaterMark,$=this.objectMode?16:16*1024;J||J===0?this.highWaterMark=J:j&&(z||z===0)?this.highWaterMark=z:this.highWaterMark=$,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var te=D.decodeStrings===!1;this.decodeStrings=!te,this.defaultEncoding=D.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ae){M(U,ae)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}f.prototype.getBuffer=function(){for(var U=this.bufferedRequest,j=[];U;)j.push(U),U=U.next;return j},function(){try{Object.defineProperty(f.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var m;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(m=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(D){return m.call(this,D)?!0:this!==g?!1:D&&D._writableState instanceof f}})):m=function(D){return D instanceof this};function g(D){if(n=n||n0(),!m.call(g,this)&&!(this instanceof n))return new g(D);this._writableState=new f(D,this),this.writable=!0,D&&(typeof D.write=="function"&&(this._write=D.write),typeof D.writev=="function"&&(this._writev=D.writev),typeof D.destroy=="function"&&(this._destroy=D.destroy),typeof D.final=="function"&&(this._final=D.final)),o.call(this)}g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function p(D,U){var j=new Error("write after end");D.emit("error",j),t.nextTick(U,j)}function v(D,U,j,J){var z=!0,$=!1;return j===null?$=new TypeError("May not write null values to stream"):typeof j!="string"&&j!==void 0&&!U.objectMode&&($=new TypeError("Invalid non-string/buffer chunk")),$&&(D.emit("error",$),t.nextTick(J,$),z=!1),z}g.prototype.write=function(D,U,j){var J=this._writableState,z=!1,$=!J.objectMode&&u(D);return $&&!l.isBuffer(D)&&(D=h(D)),typeof U=="function"&&(j=U,U=null),$?U="buffer":U||(U=J.defaultEncoding),typeof j!="function"&&(j=A),J.ended?p(this,j):($||v(this,J,D,j))&&(J.pendingcb++,z=y(this,J,$,D,U,j)),z},g.prototype.cork=function(){var D=this._writableState;D.corked++},g.prototype.uncork=function(){var D=this._writableState;D.corked&&(D.corked--,!D.writing&&!D.corked&&!D.finished&&!D.bufferProcessing&&D.bufferedRequest&&C(this,D))},g.prototype.setDefaultEncoding=function(U){if(typeof U=="string"&&(U=U.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((U+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+U);return this._writableState.defaultEncoding=U,this};function _(D,U,j){return!D.objectMode&&D.decodeStrings!==!1&&typeof U=="string"&&(U=l.from(U,j)),U}Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function y(D,U,j,J,z,$){if(!j){var te=_(U,J,z);J!==te&&(j=!0,z="buffer",J=te)}var ae=U.objectMode?1:J.length;U.length+=ae;var ve=U.length<U.highWaterMark;if(ve||(U.needDrain=!0),U.writing||U.corked){var oe=U.lastBufferedRequest;U.lastBufferedRequest={chunk:J,encoding:z,isBuf:j,callback:$,next:null},oe?oe.next=U.lastBufferedRequest:U.bufferedRequest=U.lastBufferedRequest,U.bufferedRequestCount+=1}else w(D,U,!1,ae,J,z,$);return ve}function w(D,U,j,J,z,$,te){U.writelen=J,U.writecb=te,U.writing=!0,U.sync=!0,j?D._writev(z,U.onwrite):D._write(z,$,U.onwrite),U.sync=!1}function b(D,U,j,J,z){--U.pendingcb,j?(t.nextTick(z,J),t.nextTick(I,D,U),D._writableState.errorEmitted=!0,D.emit("error",J)):(z(J),D._writableState.errorEmitted=!0,D.emit("error",J),I(D,U))}function E(D){D.writing=!1,D.writecb=null,D.length-=D.writelen,D.writelen=0}function M(D,U){var j=D._writableState,J=j.sync,z=j.writecb;if(E(j),U)b(D,j,J,U,z);else{var $=x(j);!$&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&C(D,j),J?r(S,D,j,$,z):S(D,j,$,z)}}function S(D,U,j,J){j||T(D,U),U.pendingcb--,J(),I(D,U)}function T(D,U){U.length===0&&U.needDrain&&(U.needDrain=!1,D.emit("drain"))}function C(D,U){U.bufferProcessing=!0;var j=U.bufferedRequest;if(D._writev&&j&&j.next){var J=U.bufferedRequestCount,z=new Array(J),$=U.corkedRequestsFree;$.entry=j;for(var te=0,ae=!0;j;)z[te]=j,j.isBuf||(ae=!1),j=j.next,te+=1;z.allBuffers=ae,w(D,U,!0,U.length,z,"",$.finish),U.pendingcb++,U.lastBufferedRequest=null,$.next?(U.corkedRequestsFree=$.next,$.next=null):U.corkedRequestsFree=new i(U),U.bufferedRequestCount=0}else{for(;j;){var ve=j.chunk,oe=j.encoding,K=j.callback,X=U.objectMode?1:ve.length;if(w(D,U,!1,X,ve,oe,K),j=j.next,U.bufferedRequestCount--,U.writing)break}j===null&&(U.lastBufferedRequest=null)}U.bufferedRequest=j,U.bufferProcessing=!1}g.prototype._write=function(D,U,j){j(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(D,U,j){var J=this._writableState;typeof D=="function"?(j=D,D=null,U=null):typeof U=="function"&&(j=U,U=null),D!=null&&this.write(D,U),J.corked&&(J.corked=1,this.uncork()),!J.ending&&!J.finished&&F(this,J,j)};function x(D){return D.ending&&D.length===0&&D.bufferedRequest===null&&!D.finished&&!D.writing}function R(D,U){D._final(function(j){U.pendingcb--,j&&D.emit("error",j),U.prefinished=!0,D.emit("prefinish"),I(D,U)})}function L(D,U){!U.prefinished&&!U.finalCalled&&(typeof D._final=="function"?(U.pendingcb++,U.finalCalled=!0,t.nextTick(R,D,U)):(U.prefinished=!0,D.emit("prefinish")))}function I(D,U){var j=x(U);return j&&(L(D,U),U.pendingcb===0&&(U.finished=!0,D.emit("finish"))),j}function F(D,U,j){U.ending=!0,I(D,U),j&&(U.finished?t.nextTick(j):D.once("finish",j)),U.ended=!0,D.writable=!1}function Y(D,U,j){var J=D.entry;for(D.entry=null;J;){var z=J.callback;U.pendingcb--,z(j),J=J.next}U.corkedRequestsFree?U.corkedRequestsFree.next=D:U.corkedRequestsFree=D}return Object.defineProperty(g.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(D){this._writableState&&(this._writableState.destroyed=D)}}),g.prototype.destroy=d.destroy,g.prototype._undestroy=d.undestroy,g.prototype._destroy=function(D,U){this.end(),U(D)},eB}var tB,zH;function n0(){if(zH)return tB;zH=1;var t=nM(),i=Object.keys||function(d){var A=[];for(var f in d)A.push(f);return A};tB=c;var r=Object.create(_E());r.inherits=yE();var n=n7(),a=r7();r.inherits(c,n);for(var s=i(a.prototype),o=0;o<s.length;o++){var l=s[o];c.prototype[l]||(c.prototype[l]=a.prototype[l])}function c(d){if(!(this instanceof c))return new c(d);n.call(this,d),a.call(this,d),d&&d.readable===!1&&(this.readable=!1),d&&d.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,d&&d.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",h)}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function h(){this.allowHalfOpen||this._writableState.ended||t.nextTick(u,this)}function u(d){d.end()}return Object.defineProperty(c.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),c.prototype._destroy=function(d,A){this.push(null),this.end(),t.nextTick(A,d)},tB}var iB={},QH;function VH(){if(QH)return iB;QH=1;var t=Zu().Buffer,i=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(v){if(!v)return"utf8";for(var _;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";
4576case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(_)return;v=(""+v).toLowerCase(),_=!0}}function n(v){var _=r(v);if(typeof _!="string"&&(t.isEncoding===i||!i(v)))throw new Error("Unknown encoding: "+v);return _||v}iB.StringDecoder=a;function a(v){this.encoding=n(v);var _;switch(this.encoding){case"utf16le":this.text=d,this.end=A,_=4;break;case"utf8":this.fillLast=c,_=4;break;case"base64":this.text=f,this.end=m,_=3;break;default:this.write=g,this.end=p;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(_)}a.prototype.write=function(v){if(v.length===0)return"";var _,y;if(this.lastNeed){if(_=this.fillLast(v),_===void 0)return"";y=this.lastNeed,this.lastNeed=0}else y=0;return y<v.length?_?_+this.text(v,y):this.text(v,y):_||""},a.prototype.end=u,a.prototype.text=h,a.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function s(v){return v<=127?0:v>>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function o(v,_,y){var w=_.length-1;if(w<y)return 0;var b=s(_[w]);return b>=0?(b>0&&(v.lastNeed=b-1),b):--w<y||b===-2?0:(b=s(_[w]),b>=0?(b>0&&(v.lastNeed=b-2),b):--w<y||b===-2?0:(b=s(_[w]),b>=0?(b>0&&(b===2?b=0:v.lastNeed=b-3),b):0))}function l(v,_,y){if((_[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return v.lastNeed=2,"�"}}function c(v){var _=this.lastTotal-this.lastNeed,y=l(this,v);if(y!==void 0)return y;if(this.lastNeed<=v.length)return v.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,_,0,v.length),this.lastNeed-=v.length}function h(v,_){var y=o(this,v,_);if(!this.lastNeed)return v.toString("utf8",_);this.lastTotal=y;var w=v.length-(y-this.lastNeed);return v.copy(this.lastChar,0,w),v.toString("utf8",_,w)}function u(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+"�":_}function d(v,_){if((v.length-_)%2===0){var y=v.toString("utf16le",_);if(y){var w=y.charCodeAt(y.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],y.slice(0,-1)}return y}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",_,v.length-1)}function A(v){var _=v&&v.length?this.write(v):"";if(this.lastNeed){var y=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,y)}return _}function f(v,_){var y=(v.length-_)%3;return y===0?v.toString("base64",_):(this.lastNeed=3-y,this.lastTotal=3,y===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",_,v.length-y))}function m(v){var _=v&&v.length?this.write(v):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function g(v){return v.toString(this.encoding)}function p(v){return v&&v.length?this.write(v):""}return iB}var rB,WH;function n7(){if(WH)return rB;WH=1;var t=nM();rB=_;var i=TAe(),r;_.ReadableState=v,ir.EventEmitter;var n=function(K,X){return K.listeners(X).length},a=t7(),s=Zu().Buffer,o=Cy.Uint8Array||function(){};function l(K){return s.from(K)}function c(K){return s.isBuffer(K)||K instanceof o}var h=Object.create(_E());h.inherits=yE();var u=ir,d=void 0;u&&u.debuglog?d=u.debuglog("stream"):d=function(){};var A=MAe(),f=i7(),m;h.inherits(_,a);var g=["error","close","destroy","pause","resume"];function p(K,X,N){if(typeof K.prependListener=="function")return K.prependListener(X,N);!K._events||!K._events[X]?K.on(X,N):i(K._events[X])?K._events[X].unshift(N):K._events[X]=[N,K._events[X]]}function v(K,X){r=r||n0(),K=K||{};var N=X instanceof r;this.objectMode=!!K.objectMode,N&&(this.objectMode=this.objectMode||!!K.readableObjectMode);var k=K.highWaterMark,Z=K.readableHighWaterMark,V=this.objectMode?16:16*1024;k||k===0?this.highWaterMark=k:N&&(Z||Z===0)?this.highWaterMark=Z:this.highWaterMark=V,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new A,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=K.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,K.encoding&&(m||(m=VH().StringDecoder),this.decoder=new m(K.encoding),this.encoding=K.encoding)}function _(K){if(r=r||n0(),!(this instanceof _))return new _(K);this._readableState=new v(K,this),this.readable=!0,K&&(typeof K.read=="function"&&(this._read=K.read),typeof K.destroy=="function"&&(this._destroy=K.destroy)),a.call(this)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(K){this._readableState&&(this._readableState.destroyed=K)}}),_.prototype.destroy=f.destroy,_.prototype._undestroy=f.undestroy,_.prototype._destroy=function(K,X){this.push(null),X(K)},_.prototype.push=function(K,X){var N=this._readableState,k;return N.objectMode?k=!0:typeof K=="string"&&(X=X||N.defaultEncoding,X!==N.encoding&&(K=s.from(K,X),X=""),k=!0),y(this,K,X,!1,k)},_.prototype.unshift=function(K){return y(this,K,null,!0,!1)};function y(K,X,N,k,Z){var V=K._readableState;if(X===null)V.reading=!1,C(K,V);else{var re;Z||(re=b(V,X)),re?K.emit("error",re):V.objectMode||X&&X.length>
45760?(typeof X!="string"&&!V.objectMode&&Object.getPrototypeOf(X)!==s.prototype&&(X=l(X)),k?V.endEmitted?K.emit("error",new Error("stream.unshift() after end event")):w(K,V,X,!0):V.ended?K.emit("error",new Error("stream.push() after EOF")):(V.reading=!1,V.decoder&&!N?(X=V.decoder.write(X),V.objectMode||X.length!==0?w(K,V,X,!1):L(K,V)):w(K,V,X,!1))):k||(V.reading=!1)}return E(V)}function w(K,X,N,k){X.flowing&&X.length===0&&!X.sync?(K.emit("data",N),K.read(0)):(X.length+=X.objectMode?1:N.length,k?X.buffer.unshift(N):X.buffer.push(N),X.needReadable&&x(K)),L(K,X)}function b(K,X){var N;return!c(X)&&typeof X!="string"&&X!==void 0&&!K.objectMode&&(N=new TypeError("Invalid non-string/buffer chunk")),N}function E(K){return!K.ended&&(K.needReadable||K.length<K.highWaterMark||K.length===0)}_.prototype.isPaused=function(){return this._readableState.flowing===!1},_.prototype.setEncoding=function(K){return m||(m=VH().StringDecoder),this._readableState.decoder=new m(K),this._readableState.encoding=K,this};var M=8388608;function S(K){return K>=M?K=M:(K--,K|=K>>>1,K|=K>>>2,K|=K>>>4,K|=K>>>8,K|=K>>>16,K++),K}function T(K,X){return K<=0||X.length===0&&X.ended?0:X.objectMode?1:K!==K?X.flowing&&X.length?X.buffer.head.data.length:X.length:(K>X.highWaterMark&&(X.highWaterMark=S(K)),K<=X.length?K:X.ended?X.length:(X.needReadable=!0,0))}_.prototype.read=function(K){d("read",K),K=parseInt(K,10);var X=this._readableState,N=K;if(K!==0&&(X.emittedReadable=!1),K===0&&X.needReadable&&(X.length>=X.highWaterMark||X.ended))return d("read: emitReadable",X.length,X.ended),X.length===0&&X.ended?ae(this):x(this),null;if(K=T(K,X),K===0&&X.ended)return X.length===0&&ae(this),null;var k=X.needReadable;d("need readable",k),(X.length===0||X.length-K<X.highWaterMark)&&(k=!0,d("length less than watermark",k)),X.ended||X.reading?(k=!1,d("reading or ended",k)):k&&(d("do read"),X.reading=!0,X.sync=!0,X.length===0&&(X.needReadable=!0),this._read(X.highWaterMark),X.sync=!1,X.reading||(K=T(N,X)));var Z;return K>0?Z=J(K,X):Z=null,Z===null?(X.needReadable=!0,K=0):X.length-=K,X.length===0&&(X.ended||(X.needReadable=!0),N!==K&&X.ended&&ae(this)),Z!==null&&this.emit("data",Z),Z};function C(K,X){if(!X.ended){if(X.decoder){var N=X.decoder.end();N&&N.length&&(X.buffer.push(N),X.length+=X.objectMode?1:N.length)}X.ended=!0,x(K)}}function x(K){var X=K._readableState;X.needReadable=!1,X.emittedReadable||(d("emitReadable",X.flowing),X.emittedReadable=!0,X.sync?t.nextTick(R,K):R(K))}function R(K){d("emit readable"),K.emit("readable"),j(K)}function L(K,X){X.readingMore||(X.readingMore=!0,t.nextTick(I,K,X))}function I(K,X){for(var N=X.length;!X.reading&&!X.flowing&&!X.ended&&X.length<X.highWaterMark&&(d("maybeReadMore read 0"),K.read(0),N!==X.length);)N=X.length;X.readingMore=!1}_.prototype._read=function(K){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(K,X){var N=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=K;break;case 1:k.pipes=[k.pipes,K];break;default:k.pipes.push(K);break}k.pipesCount+=1,d("pipe count=%d opts=%j",k.pipesCount,X);var Z=(!X||X.end!==!1)&&K!==process.stdout&&K!==process.stderr,V=Z?Ae:P;k.endEmitted?t.nextTick(V):N.once("end",V),K.on("unpipe",re);function re(H,ye){d("onunpipe"),H===N&&ye&&ye.hasUnpiped===!1&&(ye.hasUnpiped=!0,_e())}function Ae(){d("onend"),K.end()}var pe=F(N);K.on("drain",pe);var ce=!1;function _e(){d("cleanup"),K.removeListener("close",Ve),K.removeListener("finish",se),K.removeListener("drain",pe),K.removeListener("error",De),K.removeListener("unpipe",re),N.removeListener("end",Ae),N.removeListener("end",P),N.removeListener("data",le),ce=!0,k.awaitDrain&&(!K._writableState||K._writableState.needDrain)&&pe()}var me=!1;N.on("data",le);function le(H){d("ondata"),me=!1;var ye=K.write(H);ye===!1&&!me&&((k.pipesCount===1&&k.pipes===K||k.pipesCount>1&&oe(k.pipes,K)!==-1)&&!ce&&(d("false write response, pause",N._readableState.awaitDrain),N._readableState.awaitDrain++,me=!0),N.pause())}function De(H){d("onerror",H),P(),K.removeListener("error",De),n(K,"error")===0&&K.emit("error",H)}p(K,"error",De);function Ve(){K.removeListener("finish",se),P()}K.once("close",Ve);function se(){d("onfinish"),K.removeListener("close",Ve),P()}K.once("finish",se);function P(){d("unpipe"),N.unpipe(K)}return K.emit("pipe",N),k.flowing||(d("pipe resume"),N.resume()),K};function F(K){return function(){var X=K._readableState;d("pipeOnDrain",X.awaitDrain),X.awaitDrain&&X.awaitDrain--,X.awaitDrain===0&&n(K,"data")&&(X.flowing=!0,j(K))}}_.prototype.unpipe=function(K){var X=this._readableState,N={hasUnpiped:!1};if(X.pipesCount===0)return this;if(X.pipesCount===1)return K&&K!==X.pipes?this:(K||(K=X.pipes),X.pipes=null,X.pipesCount=0,X.flowing=!1,K&&K.emit("unpipe",this,N),this);if(!K){var k=X.pipes,Z=X.pipesCount;X.pipes=null,X.pipesCount=0,X.flowing=!1;for(var V=0;V<Z;V++)k[V].emit("unpipe",this,N);return this}
4576var re=oe(X.pipes,K);return re===-1?this:(X.pipes.splice(re,1),X.pipesCount-=1,X.pipesCount===1&&(X.pipes=X.pipes[0]),K.emit("unpipe",this,N),this)},_.prototype.on=function(K,X){var N=a.prototype.on.call(this,K,X);if(K==="data")this._readableState.flowing!==!1&&this.resume();else if(K==="readable"){var k=this._readableState;!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.emittedReadable=!1,k.reading?k.length&&x(this):t.nextTick(Y,this))}return N},_.prototype.addListener=_.prototype.on;function Y(K){d("readable nexttick read 0"),K.read(0)}_.prototype.resume=function(){var K=this._readableState;return K.flowing||(d("resume"),K.flowing=!0,D(this,K)),this};function D(K,X){X.resumeScheduled||(X.resumeScheduled=!0,t.nextTick(U,K,X))}function U(K,X){X.reading||(d("resume read 0"),K.read(0)),X.resumeScheduled=!1,X.awaitDrain=0,K.emit("resume"),j(K),X.flowing&&!X.reading&&K.read(0)}_.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function j(K){var X=K._readableState;for(d("flow",X.flowing);X.flowing&&K.read()!==null;);}_.prototype.wrap=function(K){var X=this,N=this._readableState,k=!1;K.on("end",function(){if(d("wrapped end"),N.decoder&&!N.ended){var re=N.decoder.end();re&&re.length&&X.push(re)}X.push(null)}),K.on("data",function(re){if(d("wrapped data"),N.decoder&&(re=N.decoder.write(re)),!(N.objectMode&&re==null)&&!(!N.objectMode&&(!re||!re.length))){var Ae=X.push(re);Ae||(k=!0,K.pause())}});for(var Z in K)this[Z]===void 0&&typeof K[Z]=="function"&&(this[Z]=function(re){return function(){return K[re].apply(K,arguments)}}(Z));for(var V=0;V<g.length;V++)K.on(g[V],this.emit.bind(this,g[V]));return this._read=function(re){d("wrapped _read",re),k&&(k=!1,K.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=J;function J(K,X){if(X.length===0)return null;var N;return X.objectMode?N=X.buffer.shift():!K||K>=X.length?(X.decoder?N=X.buffer.join(""):X.buffer.length===1?N=X.buffer.head.data:N=X.buffer.concat(X.length),X.buffer.clear()):N=z(K,X.buffer,X.decoder),N}function z(K,X,N){var k;return K<X.head.data.length?(k=X.head.data.slice(0,K),X.head.data=X.head.data.slice(K)):K===X.head.data.length?k=X.shift():k=N?$(K,X):te(K,X),k}function $(K,X){var N=X.head,k=1,Z=N.data;for(K-=Z.length;N=N.next;){var V=N.data,re=K>V.length?V.length:K;if(re===V.length?Z+=V:Z+=V.slice(0,K),K-=re,K===0){re===V.length?(++k,N.next?X.head=N.next:X.head=X.tail=null):(X.head=N,N.data=V.slice(re));break}++k}return X.length-=k,Z}function te(K,X){var N=s.allocUnsafe(K),k=X.head,Z=1;for(k.data.copy(N),K-=k.data.length;k=k.next;){var V=k.data,re=K>V.length?V.length:K;if(V.copy(N,N.length-K,0,re),K-=re,K===0){re===V.length?(++Z,k.next?X.head=k.next:X.head=X.tail=null):(X.head=k,k.data=V.slice(re));break}++Z}return X.length-=Z,N}function ae(K){var X=K._readableState;if(X.length>0)throw new Error('"endReadable()" called on non-empty stream');X.endEmitted||(X.ended=!0,t.nextTick(ve,X,K))}function ve(K,X){!K.endEmitted&&K.length===0&&(K.endEmitted=!0,X.readable=!1,X.emit("end"))}function oe(K,X){for(var N=0,k=K.length;N<k;N++)if(K[N]===X)return N;return-1}return rB}var nB,jH;function a7(){if(jH)return nB;jH=1,nB=n;var t=n0(),i=Object.create(_E());i.inherits=yE(),i.inherits(n,t);function r(o,l){var c=this._transformState;c.transforming=!1;var h=c.writecb;if(!h)return this.emit("error",new Error("write callback called multiple times"));c.writechunk=null,c.writecb=null,l!=null&&this.push(l),h(o);var u=this._readableState;u.reading=!1,(u.needReadable||u.length<u.highWaterMark)&&this._read(u.highWaterMark)}function n(o){if(!(this instanceof n))return new n(o);t.call(this,o),this._transformState={afterTransform:r.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,o&&(typeof o.transform=="function"&&(this._transform=o.transform),typeof o.flush=="function"&&(this._flush=o.flush)),this.on("prefinish",a)}function a(){var o=this;typeof this._flush=="function"?this._flush(function(l,c){s(o,l,c)}):s(this,null,null)}n.prototype.push=function(o,l){return this._transformState.needTransform=!1,t.prototype.push.call(this,o,l)},n.prototype._transform=function(o,l,c){throw new Error("_transform() is not implemented")},n.prototype._write=function(o,l,c){var h=this._transformState;if(h.writecb=c,h.writechunk=o,h.writeencoding=l,!h.transforming){var u=this._readableState;(h.needTransform||u.needReadable||u.length<u.highWaterMark)&&this._read(u.highWaterMark)}},n.prototype._read=function(o){var l=this._transformState;l.writechunk!==null&&l.writecb&&!l.transforming?(l.transforming=!0,this._transform(l.writechunk,l.writeencoding,l.afterTransform)):l.needTransform=!0},n.prototype._destroy=function(o,l){var c=this;t.prototype._destroy.call(this,o,function(h){l(h),c.emit("close")})};function s(o,l,c){if(l)return o.emit("error",l);if(c!=null&&o.push(c),o._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(o._transformState.transforming)throw new Error("Calling transform done when still transforming");return o.push(null)}return nB}var aB,YH;function RAe(){if(YH)return aB;YH=1,aB=r;var t=a7(),i=Object.create(_E());i.inherits=yE(),i.inherits(r,t);function r(n){if(!(this instanceof r))return new r(n);t.call(this,n)}return r.prototype._transform=function(n,a,s){s(null,n)},aB}var KH;function BAe(){return KH||(KH=1,function(t,i){i=t.exports=n7(),i.Stream=i,i.Readable=i,i.Writable=r7(),i.Duplex=n0(),i.Transform=a7(),i.PassThrough=RAe()}
4576(Bw,Bw.exports)),Bw.exports}var sB,XH;function s7(){if(XH)return sB;XH=1;var t=vE(),i=ir,r=QA(),n=SAe(),a=Rp(),s=CAe(),o=BAe(),l=ir;sB=c,l.inherits(c,a);function c(h,u){a.call(this,h,u),this.sql=h.sql,this.values=h.values,this.typeCast=h.typeCast===void 0?!0:h.typeCast,this.nestTables=h.nestTables||!1,this._resultSet=null,this._results=[],this._fields=[],this._index=0,this._loadError=null}return c.prototype.start=function(){this.emit("packet",new r.ComQueryPacket(this.sql))},c.prototype.determinePacket=function(u,d){var A=this._resultSet;if(!A)switch(u){case 0:return r.OkPacket;case 251:return r.LocalInfileRequestPacket;case 255:return r.ErrorPacket;default:return r.ResultSetHeaderPacket}return A.eofPackets.length===0?A.fieldPackets.length<A.resultSetHeaderPacket.fieldCount?r.FieldPacket:r.EofPacket:u===255?r.ErrorPacket:u===254&&d.packetLength()<9?r.EofPacket:r.RowDataPacket},c.prototype.OkPacket=function(h){try{this._callback?(this._results.push(h),this._fields.push(void 0)):this.emit("result",h,this._index)}finally{this._index++,this._resultSet=null,this._handleFinalResultPacket(h)}},c.prototype.ErrorPacket=function(h){var u=this._packetToError(h),d=this._results.length>0?this._results:void 0,A=this._fields.length>0?this._fields:void 0;u.index=this._index,u.sql=this.sql,this.end(u,d,A)},c.prototype.LocalInfileRequestPacket=function(h){this._connection.config.clientFlags&t.CLIENT_LOCAL_FILES?this._sendLocalDataFile(h.filename):(this._loadError=new Error("Load local files command is disabled"),this._loadError.code="LOCAL_FILES_DISABLED",this._loadError.fatal=!1,this.emit("packet",new r.EmptyPacket))},c.prototype.ResultSetHeaderPacket=function(h){this._resultSet=new n(h)},c.prototype.FieldPacket=function(h){this._resultSet.fieldPackets.push(h)},c.prototype.EofPacket=function(h){this._resultSet.eofPackets.push(h),this._resultSet.eofPackets.length===1&&!this._callback&&this.emit("fields",this._resultSet.fieldPackets,this._index),this._resultSet.eofPackets.length===2&&(this._callback&&(this._results.push(this._resultSet.rows),this._fields.push(this._resultSet.fieldPackets)),this._index++,this._resultSet=null,this._handleFinalResultPacket(h))},c.prototype._handleFinalResultPacket=function(h){if(!(h.serverStatus&s.SERVER_MORE_RESULTS_EXISTS)){var u=this._results.length>1?this._results:this._results[0],d=this._fields.length>1?this._fields:this._fields[0];this.end(this._loadError,u,d)}},c.prototype.RowDataPacket=function(h,u,d){h.parse(u,this._resultSet.fieldPackets,this.typeCast,this.nestTables,d),this._callback?this._resultSet.rows.push(h):this.emit("result",h,this._index)},c.prototype._sendLocalDataFile=function(h){var u=this,d=i.createReadStream(h,{flag:"r",encoding:null,autoClose:!0});this.on("pause",function(){d.pause()}),this.on("resume",function(){d.resume()}),d.on("data",function(A){u.emit("packet",new r.LocalDataFilePacket(A))}),d.on("error",function(A){u._loadError=A,d.emit("end")}),d.on("end",function(){u.emit("packet",new r.EmptyPacket)})},c.prototype.stream=function(h){var u=this;h=h||{},h.objectMode=!0;var d=new o(h);return d._read=function(){u._connection&&u._connection.resume()},d.once("end",function(){process.nextTick(function(){d.emit("close")})}),this.on("result",function(A,f){d.push(A)||u._connection.pause(),d.emit("result",A,f)}),this.on("error",function(A){d.emit("error",A)}),this.on("end",function(){d.push(null)}),this.on("fields",function(A,f){d.emit("fields",A,f)}),d},sB}var oB,qH;function IAe(){if(qH)return oB;qH=1;var t=Rp(),i=ir,r=QA();oB=n,i.inherits(n,t);function n(a,s){!s&&typeof a=="function"&&(s=a,a={}),t.call(this,a,s),this._started=!1}return n.prototype.end=function(s){if(!this._ended){if(!this._started){t.prototype.end.call(this,s);return}if(s&&s.code==="ECONNRESET"&&s.syscall==="read"){t.prototype.end.call(this);return}t.prototype.end.call(this,s)}},n.prototype.start=function(){this._started=!0,this.emit("packet",new r.ComQuitPacket)},oB}var lB,ZH;function DAe(){if(ZH)return lB;ZH=1;var t=Rp(),i=ir,r=QA();lB=n,i.inherits(n,t);function n(a,s){!s&&typeof a=="function"&&(s=a,a={}),t.call(this,a,s)}
4576return n.prototype.start=function(){this.emit("packet",new r.ComStatisticsPacket)},n.prototype.StatisticsPacket=function(a){this.end(null,a)},n.prototype.determinePacket=function(s){if(s===85)return r.StatisticsPacket},lB}var JH;function PAe(){return JH||(JH=1,Nh.ChangeUser=EAe(),Nh.Handshake=wAe(),Nh.Ping=bAe(),Nh.Query=s7(),Nh.Quit=IAe(),Nh.Sequence=Rp(),Nh.Statistics=DAe()),Nh}var cB,$H;function LAe(){if($H)return cB;$H=1;var t=Math.pow(2,16),i=Math.pow(2,24),r=Math.pow(2,8),n=Math.pow(2,53),a=Math.pow(2,24)-1,s=Zu().Buffer;cB=o;function o(){this._buffer=null,this._offset=0}return o.prototype.toBuffer=function(c){this._buffer||(this._buffer=s.alloc(0),this._offset=0);var h=this._buffer,u=this._offset,d=Math.floor(u/a)+1;this._buffer=s.allocUnsafe(u+d*4),this._offset=0;for(var A=0;A<d;A++){var f=A+1===d,m=f?u%a:a,g=c.incrementPacketNumber();this.writeUnsignedNumber(3,m),this.writeUnsignedNumber(1,g);var p=A*a,v=p+m;this.writeBuffer(h.slice(p,v))}return this._buffer},o.prototype.writeUnsignedNumber=function(l,c){this._allocate(l);for(var h=0;h<l;h++)this._buffer[this._offset++]=c>>h*8&255},o.prototype.writeFiller=function(l){this._allocate(l);for(var c=0;c<l;c++)this._buffer[this._offset++]=0},o.prototype.writeNullTerminatedString=function(l,c){l=l||"",l=l+"";var h=s.byteLength(l,c||"utf-8")+1;this._allocate(h),this._buffer.write(l,this._offset,c),this._buffer[this._offset+h-1]=0,this._offset+=h},o.prototype.writeString=function(l){l=l||"",l=l+"";var c=s.byteLength(l,"utf-8");this._allocate(c),this._buffer.write(l,this._offset,"utf-8"),this._offset+=c},o.prototype.writeBuffer=function(l){var c=l.length;this._allocate(c),l.copy(this._buffer,this._offset),this._offset+=c},o.prototype.writeLengthCodedNumber=function(l){if(l===null){this._allocate(1),this._buffer[this._offset++]=251;return}if(l<=250){this._allocate(1),this._buffer[this._offset++]=l;return}if(l>n)throw new Error('writeLengthCodedNumber: JS precision range exceeded, your number is > 53 bit: "'+l+'"');l<t?(this._allocate(3),this._buffer[this._offset++]=252):l<i?(this._allocate(4),this._buffer[this._offset++]=253):(this._allocate(9),this._buffer[this._offset++]=254),this._buffer[this._offset++]=l&255,this._buffer[this._offset++]=l>>8&255,!(l<t)&&(this._buffer[this._offset++]=l>>16&255,!(l<i)&&(this._buffer[this._offset++]=l>>24&255,l=l.toString(2),l=l.substr(0,l.length-32),l=parseInt(l,2),this._buffer[this._offset++]=l&255,this._buffer[this._offset++]=l>>8&255,this._buffer[this._offset++]=l>>16&255,this._buffer[this._offset++]=0))},o.prototype.writeLengthCodedBuffer=function(l){var c=l.length;this.writeLengthCodedNumber(c),this.writeBuffer(l)},o.prototype.writeNullTerminatedBuffer=function(l){this.writeBuffer(l),this.writeFiller(1)},o.prototype.writeLengthCodedString=function(l){if(l===null){this.writeLengthCodedNumber(null);return}l=l===void 0?"":String(l);var c=s.byteLength(l,"utf-8");this.writeLengthCodedNumber(c),c&&(this._allocate(c),this._buffer.write(l,this._offset,"utf-8"),this._offset+=c)},o.prototype._allocate=function(c){if(!this._buffer){this._buffer=s.alloc(Math.max(r,c)),this._offset=0;return}var h=this._buffer.length-this._offset;if(!(h>=c)){var u=this._buffer.length+Math.max(r,c),d=this._buffer;this._buffer=s.alloc(u),d.copy(this._buffer)}},cB}var hB,e5;function OAe(){if(e5)return hB;e5=1;var t=qde(),i=PAe(),r=QA(),n=ir.Stream,a=ir,s=LAe();hB=o,a.inherits(o,n);function o(l){n.call(this),l=l||{},this.readable=!0,this.writable=!0,this._config=l.config||{},this._connection=l.connection,this._callback=null,this._fatalError=null,this._quitSequence=null,this._handshake=!1,this._handshaked=!1,this._ended=!1,this._destroyed=!1,this._queue=[],this._handshakeInitializationPacket=null,this._parser=new t({onError:this.handleParserError.bind(this),onPacket:this._parsePacket.bind(this),config:this._config})}return o.prototype.write=function(l){return this._parser.write(l),!0},o.prototype.handshake=function(c,h){typeof c=="function"&&(h=c,c={}),c=c||{},c.config=this._config;var u=this._enqueue(new i.Handshake(c,h));return this._handshake=!0,u},o.prototype.query=function(c,h){return this._enqueue(new i.Query(c,h))},o.prototype.changeUser=function(c,h){return this._enqueue(new i.ChangeUser(c,h))},o.prototype.ping=function(c,h){return typeof c=="function"&&(h=c,c={}),this._enqueue(new i.Ping(c,h))},o.prototype.stats=function(c,h){return typeof c=="function"&&(h=c,c={}),this._enqueue(new i.Statistics(c,h))},o.prototype.quit=function(c,h){typeof c=="function"&&(h=c,c={});var u=this,d=this._enqueue(new i.Quit(c,h));return d.on("end",function(){u.end()}),this._quitSequence=d},o.prototype.end=function(){if(!this._ended){if(this._ended=!0,this._quitSequence&&(this._quitSequence._ended||this._queue[0]===this._quitSequence)){this._quitSequence.end(),this.emit
4576("end");return}var l=new Error("Connection lost: The server closed the connection.");l.fatal=!0,l.code="PROTOCOL_CONNECTION_LOST",this._delegateError(l)}},o.prototype.pause=function(){this._parser.pause();var l=this._queue[0];l&&l.emit&&l.emit("pause")},o.prototype.resume=function(){this._parser.resume();var l=this._queue[0];l&&l.emit&&l.emit("resume")},o.prototype._enqueue=function(l){if(!this._validateEnqueue(l))return l;this._config.trace&&(l._callSite=l._callSite||new Error),this._queue.push(l),this.emit("enqueue",l);var c=this;return l.on("error",function(h){c._delegateError(h,l)}).on("packet",function(h){l._timer.active(),c._emitPacket(h)}).on("timeout",function(){var h=new Error(l.constructor.name+" inactivity timeout");h.code="PROTOCOL_SEQUENCE_TIMEOUT",h.fatal=!0,h.timeout=l._timeout,c._delegateError(h,l)}),l.constructor===i.Handshake&&(l.on("start-tls",function(){l._timer.active(),c._connection._startTLS(function(h){if(h){h.code="HANDSHAKE_SSL_ERROR",h.fatal=!0,l.end(h);return}l._timer.active(),l._tlsUpgradeCompleteHandler()})}),l.on("end",function(){c._handshaked=!0,c._fatalError||c.emit("handshake",c._handshakeInitializationPacket)})),l.on("end",function(){c._dequeue(l)}),this._queue.length===1&&(this._parser.resetPacketNumber(),this._startSequence(l)),l},o.prototype._validateEnqueue=function(c){var h,u="Cannot enqueue "+c.constructor.name;if(this._fatalError)h=new Error(u+" after fatal error."),h.code="PROTOCOL_ENQUEUE_AFTER_FATAL_ERROR";else if(this._quitSequence)h=new Error(u+" after invoking quit."),h.code="PROTOCOL_ENQUEUE_AFTER_QUIT";else if(this._destroyed)h=new Error(u+" after being destroyed."),h.code="PROTOCOL_ENQUEUE_AFTER_DESTROY";else if((this._handshake||this._handshaked)&&c.constructor===i.Handshake)h=new Error(u+" after already enqueuing a Handshake."),h.code="PROTOCOL_ENQUEUE_HANDSHAKE_TWICE";else return!0;var d=this;return h.fatal=!1,c.on("error",function(A){d._delegateError(A,c)}),process.nextTick(function(){c.end(h)}),!1},o.prototype._parsePacket=function(){var l=this._queue[0];if(!l){var c=new Error("Received packet with no active sequence.");c.code="PROTOCOL_STRAY_PACKET",c.fatal=!0,this._delegateError(c);return}var h=this._determinePacket(l),u=new h({protocol41:this._config.protocol41}),d=h.name;if(h===r.RowDataPacket){l.RowDataPacket(u,this._parser,this._connection),this._config.debug&&this._debugPacket(!0,u);return}if(this._config.debug?this._parsePacketDebug(u):u.parse(this._parser),h===r.HandshakeInitializationPacket&&(this._handshakeInitializationPacket=u,this.emit("initialize",u)),l._timer.active(),!l[d]){var c=new Error("Received packet in the wrong sequence.");c.code="PROTOCOL_INCORRECT_PACKET_SEQUENCE",c.fatal=!0,this._delegateError(c);return}l[d](u)},o.prototype._parsePacketDebug=function(c){try{c.parse(this._parser)}finally{this._debugPacket(!0,c)}},o.prototype._emitPacket=function(l){var c=new s;l.write(c),this.emit("data",c.toBuffer(this._parser)),this._config.debug&&this._debugPacket(!1,l)},o.prototype._determinePacket=function(l){var c=this._parser.peak();if(l.determinePacket){var h=l.determinePacket(c,this._parser);if(h)return h}switch(c){case 0:return r.OkPacket;case 254:return r.EofPacket;case 255:return r.ErrorPacket}throw new Error("Could not determine packet, firstByte = "+c)},o.prototype._dequeue=function(c){if(c._timer.stop(),!this._fatalError){this._queue.shift();var c=this._queue[0];if(!c){this.emit("drain");return}this._parser.resetPacketNumber(),this._startSequence(c)}},o.prototype._startSequence=function(l){l._timeout>0&&isFinite(l._timeout)&&l._timer.start(l._timeout),l.constructor===i.ChangeUser?l.start(this._handshakeInitializationPacket):l.start()},o.prototype.handleNetworkError=function(l){l.fatal=!0;var c=this._queue[0];c?c.end(l):this._delegateError(l)},o.prototype.handleParserError=function(c){var h=this._queue[0];h?h.end(c):this._delegateError(c)},o.prototype._delegateError=function(l,c){if(!this._fatalError){if(l.fatal&&(this._fatalError=l),this._shouldErrorBubbleUp(l,c))this.emit("unhandledError",l);else if(l.fatal){var h=this._queue;process.nextTick(function(){h.forEach(function(u){u.end(l)}),h.length=0})}
4576l.fatal&&this.emit("end",l)}},o.prototype._shouldErrorBubbleUp=function(l,c){if(c){if(c.hasErrorHandler())return!1;if(!l.fatal)return!0}return l.fatal&&!this._hasPendingErrorHandlers()},o.prototype._hasPendingErrorHandlers=function(){return this._queue.some(function(l){return l.hasErrorHandler()})},o.prototype.destroy=function(){this._destroyed=!0,this._parser.pause(),this._connection.state!=="disconnected"&&(this._ended||this.end())},o.prototype._debugPacket=function(l,c){var h=this._connection,u=l?"<--":"-->",d=c.constructor.name,A=h&&h.threadId!==null?" ("+h.threadId+")":"";if(!(Array.isArray(this._config.debug)&&this._config.debug.indexOf(d)===-1)){var f=a.inspect(c).replace(/^[^{]+/,"");console.log(`%s%s %s %s 4577`,u,A,d,f)}},hB}var uB={},t5;function NAe(){return t5||(t5=1,function(t){var i=t,r=/`/g,n=/\./g,a=/[\0\b\t\n\r\x1a\"\'\\]/g,s={"\0":"\\0","\b":"\\b"," ":"\\t","\n":"\\n","\r":"\\r","�":"\\Z",'"':'\\"',"'":"\\'","\\":"\\\\"};i.escapeId=function(u,d){if(Array.isArray(u)){for(var A="",f=0;f<u.length;f++)A+=(f===0?"":", ")+i.escapeId(u[f],d);return A}else return d?"`"+String(u).replace(r,"``")+"`":"`"+String(u).replace(r,"``").replace(n,"`.`")+"`"},i.escape=function(u,d,A){if(u==null)return"NULL";switch(typeof u){case"boolean":return u?"true":"false";case"number":return u+"";case"object":return u instanceof Date?i.dateToString(u,A||"local"):Array.isArray(u)?i.arrayToList(u,A):Buffer.isBuffer(u)?i.bufferToString(u):typeof u.toSqlString=="function"?String(u.toSqlString()):d?o(u.toString()):i.objectToValues(u,A);default:return o(u)}},i.arrayToList=function(u,d){for(var A="",f=0;f<u.length;f++){var m=u[f];Array.isArray(m)?A+=(f===0?"":", ")+"("+i.arrayToList(m,d)+")":A+=(f===0?"":", ")+i.escape(m,!0,d)}return A},i.format=function(u,d,A,f){if(d==null)return u;d instanceof Array||Array.isArray(d)||(d=[d]);for(var m=0,g=/\?+/g,p="",v=0,_;v<d.length&&(_=g.exec(u));){var y=_[0].length;if(!(y>2)){var w=y===2?i.escapeId(d[v]):i.escape(d[v],A,f);p+=u.slice(m,_.index)+w,m=g.lastIndex,v++}}return m===0?u:m<u.length?p+u.slice(m):p},i.dateToString=function(u,d){var A=new Date(u);if(isNaN(A.getTime()))return"NULL";var f,m,g,p,v,_,y;if(d==="local")f=A.getFullYear(),m=A.getMonth()+1,g=A.getDate(),p=A.getHours(),v=A.getMinutes(),_=A.getSeconds(),y=A.getMilliseconds();else{var w=c(d);w!==!1&&w!==0&&A.setTime(A.getTime()+w*6e4),f=A.getUTCFullYear(),m=A.getUTCMonth()+1,g=A.getUTCDate(),p=A.getUTCHours(),v=A.getUTCMinutes(),_=A.getUTCSeconds(),y=A.getUTCMilliseconds()}var b=l(f,4)+"-"+l(m,2)+"-"+l(g,2)+" "+l(p,2)+":"+l(v,2)+":"+l(_,2)+"."+l(y,3);return o(b)},i.bufferToString=function(u){return"X"+o(u.toString("hex"))},i.objectToValues=function(u,d){var A="";for(var f in u){var m=u[f];typeof m!="function"&&(A+=(A.length===0?"":", ")+i.escapeId(f)+" = "+i.escape(m,!0,d))}return A},i.raw=function(u){if(typeof u!="string")throw new TypeError("argument sql must be a string");return{toSqlString:function(){return u}}};function o(h){for(var u=a.lastIndex=0,d="",A;A=a.exec(h);)d+=h.slice(u,A.index)+s[A[0]],u=a.lastIndex;return u===0?"'"+h+"'":u<h.length?"'"+d+h.slice(u)+"'":"'"+d+"'"}function l(h,u){for(h=h.toString();h.length<u;)h="0"+h;return h}function c(h){if(h==="Z")return 0;var u=h.match(/([\+\-\s])(\d\d):?(\d\d)?/);return u?(u[1]==="-"?-1:1)*(parseInt(u[2],10)+(u[3]?parseInt(u[3],10):0)/60)*60:!1}}(uB)),uB}var dB,i5;function UAe(){return i5||(i5=1,dB=NAe()),dB}var AB,r5;function o7(){return r5||(r5=1,AB=UAe()),AB}var fB,n5;function aM(){if(n5)return fB;n5=1;var t=ir,i=ir,r=ir,n=ir,a=$O(),s=OAe(),o=o7(),l=s7(),c=ir;fB=h,c.inherits(h,i.EventEmitter);function h(m){i.EventEmitter.call(this),this.config=m.config,this._socket=m.socket,this._protocol=new s({config:this.config,connection:this}),this._connectCalled=!1,this.state="disconnected",this.threadId=null}h.createQuery=function(g,p,v){if(g instanceof l)return g;var _=v,y={};if(typeof g=="function"?_=g:typeof g=="object"?(y=Object.create(g),typeof p=="function"?_=p:p!==void 0&&Object.defineProperty(y,"values",{value:p})):(y.sql=g,typeof p=="function"?_=p:p!==void 0&&(y.values=p)),_!==void 0&&(_=A(null,_),_===void 0))throw new TypeError("argument callback must be a function when provided");return new l(y,_)},h.prototype.connect=function(g,p){if(!p&&typeof g=="function"&&(p=g,g={}),!this._connectCalled){this._connectCalled=!0,this._socket=this.config.socketPath?r.createConnection(this.config.socketPath):r.createConnection(this.config.port,this.config.host),i.usingDomains&&(this._socket.domain=this.domain);var v=this;if(this._protocol.on("data",function(y){v._socket.write(y)}),this._socket.on("data",f(v,function(y){v._protocol.write(y)})),this._protocol.on("end",function(){v._socket.end()}),this._socket.on("end",f(v,function(){v._protocol.end()})),this._socket.on("error",this._handleNetworkError.bind(this)),this._socket.on("connect",this._handleProtocolConnect.bind(this)),this._protocol.on("handshake",this._handleProtocolHandshake.bind(this)),this._protocol.on("initialize",this._handleProtocolInitialize.bind(this)),this._protocol.on("unhandledError",this._handleProtocolError.bind(this)),this._protocol.on("drain",this._handleProtocolDrain.bind(this)),this._protocol.on("end",this._handleProtocolEnd.bind(this)),this._protocol.on("enqueue",this._handleProtocolEnqueue.bind(this)),this.config.connectTimeout){var _=this._handleConnectTimeout.bind(this);this._socket.setTimeout(this.config.connectTimeout,_),this._socket.once("connect",function(){this.setTimeout(0,_)})}}this._protocol.handshake(g,A(this,p))},h.prototype.changeUser=function(g,p){!p&&typeof g=="function"&&(p=g,g={}),this._implyConnect();var v=g.charset?a.getCharsetNumber(g.charset):this.config.charsetNumber;return this._protocol.changeUser({user:g.user||this.config.user,password:g.password||this.config.password,database:g.database||this.config.database,timeout:g.timeout,charsetNumber:v,currentConfig:this.config},A(this,p))},h.prototype.beginTransaction=function(g,p){return!p&&typeof g=="function"&&(p=g,g={}),g=g||{},g.sql="START TRANSACTION",g.values=null,this.query(g,p)},h.prototype.commit=function(g,p){return!p&&typeof g=="function"&&(p=g,g={}),g=g||{},g.sql="COMMIT",g.values=null,this.query(g,p)},h.prototype.rollback=function(g,p){return!p&&typeof g=="function"&&(p=g,g={}),g=g||{},g.sql="ROLLBACK",g.values=null,this.query(g,p)},h.prototype.query=function(g,p,v){var _=h.createQuery(g,p,v);return _._connection=this,typeof g=="object"&&"typeCast"in g||(_.typeCast=this.config.typeCast),_.sql&&(_.sql=this.format(_.sql,_.values)),_._callback&&(_._callback=A(this,_._callback)),this._implyConnect(),this._protocol._enqueue(_)},h.prototype.ping=function(g,p){!p&&typeof g=="function"&&(p=g,g={}),this._implyConnect(),this._protocol.ping(g,A(this,p))},h.prototype.statistics=function(g,p){!p&&typeof g=="function"&&(p=g,g={}),this._implyConnect(),this._protocol.stats(g,A(this,p))},h.prototype.end=function(g,p){var v=p,_=g;!p&&typeof g=="function"&&(v=g,_=null),_=Object.create(_||null),_.timeout===void 0&&(_.timeout=3e4),this._implyConnect(),this._protocol.quit(_,A(this,v))},h.prototype.destroy=function(){this.state="disconnected",this._implyConnect(),this._socket.destroy(),this._protocol.destroy()},h.prototype.pause=function(){this._socket.pause(),this._protocol.pause()},h.prototype.resume=function(){this._socket.resume(),this._protocol.resume()},h.prototype.escape=function(m){return o.escape(m,!1,this.config.timezone)},h.prototype.escapeId=function(g){return o.escapeId(g,!1)},h.prototype.format=function(m,g){return typeof this.config.queryFormat=="function"?this.config.queryFormat.call(this,m,g,this.config.timezone):o.format(m,g,this.config.stringifyObjects,this.config.timezone)},n.TLSSocket?h.prototype._startTLS=function(g){var p=this;u(this.config,function(v,_){if(v){g(v);return}p._socket.removeAllListeners("data"),p._protocol.removeAllListeners("data");var y=p.config.ssl.rejectUnauthorized,w=!1,b=new n.TLSSocket(p._socket,{rejectUnauthorized:y,requestCert
4577:!0,secureContext:_,isServer:!1});b.on("_tlsError",function(E){w?p._handleNetworkError(E):g(E)}),b.pipe(p._protocol),p._protocol.on("data",function(E){b.write(E)}),b.on("secure",function(){w=!0,g(y?this.ssl.verifyError():null)}),b._start()})}:h.prototype._startTLS=function(g){var p=this,v=t.createCredentials({ca:this.config.ssl.ca,cert:this.config.ssl.cert,ciphers:this.config.ssl.ciphers,key:this.config.ssl.key,passphrase:this.config.ssl.passphrase}),_=this.config.ssl.rejectUnauthorized,y=!1,w=n.createSecurePair(v,!1,!0,_);w.on("error",function(b){y?p._handleNetworkError(b):g(b)}),this._socket.removeAllListeners("data"),this._protocol.removeAllListeners("data"),w.encrypted.pipe(this._socket),this._socket.on("data",function(b){w.encrypted.write(b)}),w.cleartext.pipe(this._protocol),this._protocol.on("data",function(b){w.cleartext.write(b)}),w.on("secure",function(){if(y=!0,!_){g();return}var b=this.ssl.verifyError(),E=b;typeof E=="string"&&(E=new Error(b),E.code=b),g(E)}),w._cycle=w.cycle,w.cycle=function(){return this.ssl&&this.ssl.error&&this.error(),this._cycle.apply(this,arguments)}},h.prototype._handleConnectTimeout=function(){this._socket&&(this._socket.setTimeout(0),this._socket.destroy());var m=new Error("connect ETIMEDOUT");m.errorno="ETIMEDOUT",m.code="ETIMEDOUT",m.syscall="connect",this._handleNetworkError(m)},h.prototype._handleNetworkError=function(m){this._protocol.handleNetworkError(m)},h.prototype._handleProtocolError=function(m){this.state="protocol_error",this.emit("error",m)},h.prototype._handleProtocolDrain=function(){this.emit("drain")},h.prototype._handleProtocolConnect=function(){this.state="connected",this.emit("connect")},h.prototype._handleProtocolHandshake=function(){this.state="authenticated"},h.prototype._handleProtocolInitialize=function(g){this.threadId=g.threadId},h.prototype._handleProtocolEnd=function(m){this.state="disconnected",this.emit("end",m)},h.prototype._handleProtocolEnqueue=function(g){this.emit("enqueue",g)},h.prototype._implyConnect=function(){this._connectCalled||this.connect()};function u(m,g){var p=null,v=null;try{p=n.createSecureContext({ca:m.ssl.ca,cert:m.ssl.cert,ciphers:m.ssl.ciphers,key:m.ssl.key,passphrase:m.ssl.passphrase})}catch(_){v=_}g(v,p)}function d(m){return function(){for(var g=[],p;process.domain;)g.shift(process.domain),process.domain.exit();try{p=m.apply(this,arguments)}finally{for(var v=0;v<g.length;v++)g[v].enter()}return p}}function A(m,g){if(typeof g=="function"){if(g.domain)return g;var p=process.domain;return p?p.bind(g):m?d(f(m,g)):g}}function f(m,g){return function(){i.usingDomains&&m.domain?(m.domain.enter(),g.apply(this,arguments),m.domain.exit()):g.apply(this,arguments)}}return fB}var pB,a5;function FAe(){if(a5)return pB;a5=1;var t=ir.inherits,i=aM(),r=ir;pB=n,t(n,i);function n(a,s){i.call(this,s),this._pool=a,r.usingDomains&&(this.domain=a.domain),this.on("end",this._removeFromPool),this.on("error",function(o){o.fatal&&this._removeFromPool()})}return n.prototype.release=function(){var s=this._pool;if(!(!s||s._closed))return s.releaseConnection(this)},n.prototype._realEnd=i.prototype.end,n.prototype.end=function(){console.warn("Calling conn.end() to release a pooled connection is deprecated. In next version calling conn.end() will be restored to default conn.end() behavior. Use conn.release() instead."),this.release()},n.prototype.destroy=function(){i.prototype.destroy.apply(this,arguments),this._removeFromPool(this)},n.prototype._removeFromPool=function(){if(!(!this._pool||this._pool._closed)){var s=this._pool;this._pool=null,s._purgeConnection(this)}},pB}var mB,s5;function l7(){if(s5)return mB;s5=1;var t=u7(),i=aM(),r=ir.EventEmitter,n=ir,a=FAe();mB=s,n.inherits(s,r);function s(l){r.call(this),this.config=l.config,this.config.connectionConfig.pool=this,this._acquiringConnections=[],this._allConnections=[],this._freeConnections=[],this._connectionQueue=[],this._closed=!1}s.prototype.getConnection=function(l){if(this._closed){var c=new Error("Pool is closed.");c.code="POOL_CLOSED",process.nextTick(function(){l(c)});return}var h,u=this;if(this._freeConnections.length>0){h=this._freeConnections.shift(),this.acquireConnection(h,l);return}if(this.config.connectionLimit===0||this._allConnections.length<this.config.connectionLimit){h=new a(this,{config:this.config.newConnectionConfig()}),this._acquiringConnections.push(h),this._allConnections.push(h),h.connect({timeout:this.config.acquireTimeout},function(A){if(o(u._acquiringConnections,h),u._closed&&(A=new Error("Pool is closed."),A.code="POOL_CLOSED"),A){u._purgeConnection(h),l(A);return}u.emit("connection",h),u.emit("acquire",h),l(null,h)});return}if(!this.config.waitForConnections){process.nextTick(function(){var d=new Error("No connections available.");d.code="POOL_CONNLIMIT",l(d)});return}this._enqueueCallback(l)},s.prototype.acquireConnection=function(c,h){if(c._pool!==this)throw new Error("Connection acquired from wrong pool.");var u=this._needsChangeUser(c),d=this;this._acquiringConnections.push(c);function A(f){if(o(d._acquiringConnections,c),d._closed&&(f=new Error("Pool is closed."),f.code="POOL_CLOSED"),f){d._connectionQueue.unshift(h),d._purgeConnection(c);return}u&&d.emit("connection",c),d.emit("acquire",c),h(null,c)}u?(c.config=this.config.newConnectionConfig(),c.changeUser({timeout:this.config.acquireTimeout},A)):c.ping({timeout:this.config.acquireTimeout},A)},s.prototype.releaseConnection=function(c){if(this._acquiringConnections.indexOf(c)===-1){if(c._pool){if(c._pool!==this)throw new Error("Connection released to wrong pool");if(this._freeConnections.indexOf(c)!==-1)throw new Error("Connection already released");
4577this._freeConnections.push(c),this.emit("release",c)}this._closed?this._connectionQueue.splice(0).forEach(function(h){var u=new Error("Pool is closed.");u.code="POOL_CLOSED",process.nextTick(function(){h(u)})}):this._connectionQueue.length&&this.getConnection(this._connectionQueue.shift())}},s.prototype.end=function(l){this._closed=!0,typeof l!="function"&&(l=function(d){if(d)throw d});var c=!1,h=0;function u(d){!c&&(d||--h<=0)&&(c=!0,l(d))}for(;this._allConnections.length!==0;)h++,this._purgeConnection(this._allConnections[0],u);h===0&&process.nextTick(u)},s.prototype.query=function(l,c,h){var u=i.createQuery(l,c,h);return typeof l=="object"&&"typeCast"in l||(u.typeCast=this.config.connectionConfig.typeCast),this.config.connectionConfig.trace&&(u._callSite=new Error),this.getConnection(function(d,A){if(d){u.on("error",function(){}),u.end(d);return}u.once("end",function(){A.release()}),A.query(u)}),u},s.prototype._enqueueCallback=function(c){if(this.config.queueLimit&&this._connectionQueue.length>=this.config.queueLimit){process.nextTick(function(){var u=new Error("Queue limit reached.");u.code="POOL_ENQUEUELIMIT",c(u)});return}var h=process.domain?process.domain.bind(c):c;this._connectionQueue.push(h),this.emit("enqueue")},s.prototype._needsChangeUser=function(c){var h=c.config,u=this.config.connectionConfig;return h.user!==u.user||h.database!==u.database||h.password!==u.password||h.charsetNumber!==u.charsetNumber},s.prototype._purgeConnection=function(c,h){var u=h||function(){};if(c.state==="disconnected"&&c.destroy(),this._removeConnection(c),c.state!=="disconnected"&&!c._protocol._quitSequence){c._realEnd(u);return}process.nextTick(u)},s.prototype._removeConnection=function(l){l._pool=null,o(this._allConnections,l),o(this._freeConnections,l),this.releaseConnection(l)},s.prototype.escape=function(l){return t.escape(l,this.config.connectionConfig.stringifyObjects,this.config.connectionConfig.timezone)},s.prototype.escapeId=function(c){return t.escapeId(c,!1)};function o(l,c){var h;(h=l.indexOf(c))!==-1&&l.splice(h,1)}return mB}var gB,o5;function c7(){if(o5)return gB;o5=1;var t=$O();gB=i;function i(r){typeof r=="string"&&(r=t.parseUrl(r)),this.acquireTimeout=r.acquireTimeout===void 0?10*1e3:Number(r.acquireTimeout),this.connectionConfig=new t(r),this.waitForConnections=r.waitForConnections===void 0?!0:!!r.waitForConnections,this.connectionLimit=r.connectionLimit===void 0?10:Number(r.connectionLimit),this.queueLimit=r.queueLimit===void 0?0:Number(r.queueLimit)}return i.prototype.newConnectionConfig=function(){var n=new t(this.connectionConfig);return n.clientFlags=this.connectionConfig.clientFlags,n.maxPacketSize=this.connectionConfig.maxPacketSize,n},gB}var vB={exports:{}},l5;function h7(){if(l5)return vB.exports;l5=1;var t=vB.exports={};return t.RR=function(){var r=0;return function(n){r>=n.length&&(r=0);var a=n[r++];return a}},t.RANDOM=function(){return function(r){return r[Math.floor(Math.random()*r.length)]}},t.ORDER=function(){return function(r){return r[0]}},vB.exports}var _B,c5;function kAe(){if(c5)return _B;c5=1;var t=aM(),i=h7();_B=r;function r(n,a,s){this._cluster=n,this._pattern=a,this._selector=new i[s]}return r.prototype.getConnection=function(n){var a=this._getClusterNode(),s=this._cluster,o=this;if(a===null){var l=null;this._cluster._findNodeIds(this._pattern,!0).length!==0?(l=new Error("Pool does not have online node."),l.code="POOL_NONEONLINE"):(l=new Error("Pool does not exist."),l.code="POOL_NOEXIST"),n(l);return}s._getConnection(a,function(c,h){var u=c&&s._canRetry&&s._findNodeIds(o._pattern).length!==0;if(u){o.getConnection(n);return}if(c){n(c);return}n(null,h)})},r.prototype.query=function(n,a,s){var o=this._cluster,l=this._getClusterNode(),c=t.createQuery(n,a,s),h=this;if(l===null){var u=null;return this._cluster._findNodeIds(this._pattern,!0).length!==0?(u=new Error("Pool does not have online node."),u.code="POOL_NONEONLINE"):(u=new Error("Pool does not exist."),u.code="POOL_NOEXIST"),process.nextTick(function(){c.on("error",function(){}),c.end(u)}),c}return typeof n=="object"&&"typeCast"in n||(c.typeCast=l.pool.config.connectionConfig.typeCast),l.pool.config.connectionConfig.trace&&(c._callSite=new Error),o._getConnection(l,function(d,A){var f=d&&o._canRetry&&o._findNodeIds(h._pattern).length!==0;if(f){h.query(c);return}if(d){c.on("error",function(){}),c.end(d);return}c.once("end",function(){A.release()}),A.query(c)}),c},r.prototype._getClusterNode=function(){var a=this._cluster._findNodeIds(this._pattern),s;switch(a.length){case 0:s=null;break;case 1:s=a[0];break;default:s=this._selector(a);break}return s!==null?this._cluster._getNode(s):null},_B}var yB,h5;function HAe(){if(h5)return yB;h5=1;var t=l7(),i=c7(),r=kAe(),n=h7(),a=ir,s=ir.EventEmitter;
4577yB=o;function o(A){s.call(this),A=A||{},this._canRetry=typeof A.canRetry>"u"?!0:A.canRetry,this._defaultSelector=A.defaultSelector||"RR",this._removeNodeErrorCount=A.removeNodeErrorCount||5,this._restoreNodeTimeout=A.restoreNodeTimeout||0,this._closed=!1,this._findCaches=Object.create(null),this._lastId=0,this._namespaces=Object.create(null),this._nodes=Object.create(null)}a.inherits(o,s),o.prototype.add=function(f,m){if(this._closed)throw new Error("PoolCluster is closed.");var g=typeof f=="object"?"CLUSTER::"+ ++this._lastId:String(f);if(this._nodes[g]!==void 0)throw new Error('Node ID "'+g+'" is already defined in PoolCluster.');var p=typeof f!="object"?new i(m):new i(f);this._nodes[g]={id:g,errorCount:0,pool:new t({config:p}),_offlineUntil:0},this._clearFindCaches()},o.prototype.end=function(f){var m=f!==void 0?f:u;if(typeof m!="function")throw TypeError("callback argument must be a function");if(this._closed){process.nextTick(m);return}this._closed=!0;var g=!1,p=Object.keys(this._nodes),v=0;function _(E){!g&&(E||--v<=0)&&(g=!0,m(E))}for(var y=0;y<p.length;y++){var w=p[y],b=this._nodes[w];v++,b.pool.end(_)}v===0&&process.nextTick(_)},o.prototype.of=function(A,f){A=A||"*",f=f||this._defaultSelector,f=f.toUpperCase(),typeof n[f]>"u"&&(f=this._defaultSelector);var m=A+f;return typeof this._namespaces[m]>"u"&&(this._namespaces[m]=new r(this,A,f)),this._namespaces[m]},o.prototype.remove=function(f){for(var m=this._findNodeIds(f,!0),g=0;g<m.length;g++){var p=this._getNode(m[g]);p&&this._removeNode(p)}},o.prototype.getConnection=function(A,f,m){var g;typeof A=="function"?(m=A,g=this.of()):(typeof f=="function"&&(m=f,f=this._defaultSelector),g=this.of(A,f)),g.getConnection(m)},o.prototype._clearFindCaches=function(){this._findCaches=Object.create(null)},o.prototype._decreaseErrorCount=function(f){var m=f.errorCount;m>this._removeNodeErrorCount&&(m=this._removeNodeErrorCount),m<1&&(m=1),f.errorCount=m-1,f._offlineUntil&&(f._offlineUntil=0,this.emit("online",f.id))},o.prototype._findNodeIds=function(f,m){var g=0,p=this._findCaches[f];if(p===void 0){var v=h(f),_=Object.keys(this._nodes);p=_.filter(function(y){return y.match(v)}),this._findCaches[f]=p}return m?p:p.filter(function(y){var w=this._getNode(y);return w._offlineUntil?(g||(g=l()),w._offlineUntil<=g):!0},this)},o.prototype._getNode=function(f){return this._nodes[f]||null},o.prototype._increaseErrorCount=function(f){var m=++f.errorCount;if(!(this._removeNodeErrorCount>m)){if(this._restoreNodeTimeout>0){f._offlineUntil=l()+this._restoreNodeTimeout,this.emit("offline",f.id);return}this._removeNode(f),this.emit("remove",f.id)}},o.prototype._getConnection=function(A,f){var m=this;A.pool.getConnection(function(g,p){if(g){m._increaseErrorCount(A),f(g);return}else m._decreaseErrorCount(A);p._clusterId=A.id,f(null,p)})},o.prototype._removeNode=function(f){delete this._nodes[f.id],this._clearFindCaches(),f.pool.end(d)};function l(){var A;return typeof process.hrtime=="function"?(A=process.hrtime(),A=A[0]*1e3+A[1]*1e-6):A=process.uptime()*1e3,Math.floor(A)}function c(A){return typeof A=="object"&&Object.prototype.toString.call(A)==="[object RegExp]"}function h(A){if(c(A))return A;var f=A.replace(/([.+?^=!:${}()|\[\]\/\\])/g,"\\$1").replace(/\*/g,".*");return new RegExp("^"+f+"$")}function u(A){if(A)throw A}function d(){}return yB}var u5;function u7(){return u5||(u5=1,function(t){var i=Object.create(null);t.createConnection=function(a){var s=r("Connection"),o=r("ConnectionConfig");return new s({config:new o(a)})},t.createPool=function(a){var s=r("Pool"),o=r("PoolConfig");return new s({config:new o(a)})},t.createPoolCluster=function(a){var s=r("PoolCluster");return new s(a)},t.createQuery=function(a,s,o){var l=r("Connection");return l.createQuery(a,s,o)},t.escape=function(a,s,o){var l=r("SqlString");return l.escape(a,s,o)},t.escapeId=function(a,s){var o=r("SqlString");return o.escapeId(a,s)},t.format=function(a,s,o,l){var c=r("SqlString");return c.format(a,s,o,l)},t.raw=function(a){var s=r("SqlString");return s.raw(a)}
4577,Object.defineProperty(t,"Types",{get:r.bind(null,"Types")});function r(n){var a=i[n];if(a!==void 0)return a;switch(n){case"Connection":a=aM();break;case"ConnectionConfig":a=$O();break;case"Pool":a=l7();break;case"PoolCluster":a=HAe();break;case"PoolConfig":a=c7();break;case"SqlString":a=o7();break;case"Types":a=eN();break;default:throw new Error("Cannot find class '"+n+"'")}return i[n]=a,a}}(cR)),cR}u7();const GAe="modulepreload",zAe=function(t,i){return new URL(t,i).href},d5={},VA=function(i,r,n){if(!r||r.length===0)return i();const a=document.getElementsByTagName("link");return Promise.all(r.map(s=>{if(s=zAe(s,n),s in d5)return;d5[s]=!0;const o=s.endsWith(".css"),l=o?'[rel="stylesheet"]':"";if(!!n)for(let u=a.length-1;u>=0;u--){const d=a[u];if(d.href===s&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${s}"]${l}`))return;const h=document.createElement("link");if(h.rel=o?"stylesheet":GAe,o||(h.as="script",h.crossOrigin=""),h.href=s,document.head.appendChild(h),o)return new Promise((u,d)=>{h.addEventListener("load",u),h.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>i()).catch(s=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s})};var QAe=Object.create,sM=Object.defineProperty,VAe=Object.getOwnPropertyDescriptor,WAe=Object.getOwnPropertyNames,jAe=Object.getPrototypeOf,YAe=Object.prototype.hasOwnProperty,KAe=(t,i,r)=>i in t?sM(t,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[i]=r,Ju=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports),XAe=(t,i)=>{for(var r in i)sM(t,r,{get:i[r],enumerable:!0})},qAe=(t,i,r,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of WAe(i))!YAe.call(t,a)&&a!==r&&sM(t,a,{get:()=>i[a],enumerable:!(n=VAe(i,a))||n.enumerable});return t},$u=(t,i,r)=>(r=t!=null?QAe(jAe(t)):{},qAe(i||!t||!t.__esModule?sM(r,"default",{value:t,enumerable:!0}):r,t)),g_=(t,i,r)=>(KAe(t,typeof i!="symbol"?i+"":i,r),r),ZAe=Ju((t,i)=>{(function(r,n){typeof t=="object"?i.exports=n():typeof define=="function"&&define.amd?define(n):r.Alea=n()})(t,function(){return r.importState=function(a){var s=new r;return s.importState(a),s},r;function r(){return function(a){var s=0,o=0,l=0,c=1;a.length==0&&(a=[+new Date]);var h=n();s=h(" "),o=h(" "),l=h(" ");for(var u=0;u<a.length;u++)s-=h(a[u]),s<0&&(s+=1),o-=h(a[u]),o<0&&(o+=1),l-=h(a[u]),l<0&&(l+=1);h=null;var d=function(){var A=2091639*s+c*23283064365386963e-26;return s=o,o=l,l=A-(c=A|0)};return d.next=d,d.uint32=function(){return d()*4294967296},d.fract53=function(){return d()+(d()*2097152|0)*11102230246251565e-32},d.version="Alea 0.9",d.args=a,d.exportState=function(){return[s,o,l,c]},d.importState=function(A){s=+A[0]||0,o=+A[1]||0,l=+A[2]||0,c=+A[3]||0},d}(Array.prototype.slice.call(arguments))}function n(){var a=4022871197,s=function(o){o=o.toString();for(var l=0;l<o.length;l++){a+=o.charCodeAt(l);var c=.02519603282416938*a;a=c>>>0,c-=a,c*=a,a=c>>>0,c-=a,a+=c*4294967296}return(a>>>0)*23283064365386963e-26};return s.version="Mash 0.9",s}})}),d7=Ju((t,i)=>{(function(r,n){typeof t=="object"&&typeof i<"u"?n(t):typeof define=="function"&&define.amd?define(["exports"],n):n((r=typeof globalThis<"u"?globalThis:r||self).SVDJS={})})(t,function(r){r.SVD=function(n,a,s,o,l){if(a=a===void 0||a,s=s===void 0||s,l=1e-64/(o=o||Math.pow(2,-52)),!n)throw new TypeError("Matrix a is not defined");var c,h,u,d,A,f,m,g,p,v,_,y,w=n[0].length,b=n.length;if(b<w)throw new TypeError("Invalid matrix: m < n");for(var E=[],M=[],S=[],T=a==="f"?b:w,C=v=m=0;C<b;C++)M[C]=new Array(T).fill(0);for(C=0;C<w;C++)S[C]=new Array(w).fill(0);var x,R=new Array(w).fill(0);for(C=0;C<b;C++)for(c=0;c<w;c++)M[C][c]=n[C][c];for(C=0;C<w;C++){for(E[C]=m,p=0,u=C+1,c=C;c<b;c++)p+=Math.pow(M[c][C],2);if(p<l)m=0;else for(g=(f=M[C][C])*(m=f<0?Math.sqrt(p):-Math.sqrt(p))-p,M[C][C]=f-m,c=u;c<w;c++){for(p=0,h=C;h<b;h++)p+=M[h][C]*M[h][c];for(f=p/g,h=C;h<b;h++)M[h][c]=M[h][c]+f*M[h][C]}for(R[C]=m,p=0,c=u;c<w;c++)p+=Math.pow(M[C][c],2);if(p<l)m=0;else{for(g=(f=M[C][C+1])*(m=f<0?Math.sqrt(p):-Math.sqrt(p))-p,M[C][C+1]=f-m,c=u;c<w;c++)E[c]=M[C][c]/g;for(c=u;c<b;c++){for(p=0,h=u;h<w;h++)p+=M[c][h]*M[C][h];for(h=u;h<w;h++)M[c][h]=M[c][h]+p*E[h]}}v<(_=Math.abs(R[C])+Math.abs(E[C]))&&(v=_)}if(s)for(C=w-1;0<=C;C--){if(m!==0){for(g=M[C][C+1]*m,c=u;c<w;c++)S[c][C]=M[C][c]/g;for(c=u;c<w;c++){for(p=0,h=u;h<w;h++)p+=M[C][h]*S[h][c];for(h=u;h<w;h++)S[h][c]=S[h][c]+p*S[h][C]}}for(c=u;c<w;c++)S[C][c]=0,S[c][C]=0;S[C][C]=1,m=E[C],u=C}if(a){if(a==="f")for(C=w;C<b;C++){for(c=w;c<b;c++)M[C][c]=0;M[C][C]=1}for(C=w-1;0<=C;C--){for(u=C+1,m=R[C],c=u;c<T;c++)M[C][c]=0;if(m!==0){for(g=M[C][C]*m,c=u;c<T;c++){for(p=0,h=u;h<b;h++)p+=M[h][C]*M[h][c];for(f=p/g,h=C;h<b;h++)M[h][c]=M[h][c]+f*M[h][C]}for(c=C;c<b;c++)M[c][C]=M[c][C]/m}else for(c=C;c<b;c++)M[c][C]=0;M[C][C]=M[C][C]+1}}for(o*=v,h=w-1;0<=h;h--)for(var L=0;L<50;L++){for(x=!1,u=h;0<=u;u--){if(Math.abs(E[u])<=o){x=!0;break}if(Math.abs(R[u-1])<=o)break}if(!x){for(A=0,d=u-(p=1),C=u;C<h+1&&(f=p*E[C],E[C]=A*E[C],!(Math.abs(f)<=o));C++)if(m=R[C],R[C]=Math.sqrt(f*f+m*m),A=m/(g=R[C]),p=-f/g,a)for(c=0;c<b;c++)_=M[c][d],y=M[c][C],M[c][d]=_*A+y*p,M[c][C]=-_*p+y*A}
4577if(y=R[h],u===h){if(y<0&&(R[h]=-y,s))for(c=0;c<w;c++)S[c][h]=-S[c][h];break}for(v=R[u],f=(((_=R[h-1])-y)*(_+y)+((m=E[h-1])-(g=E[h]))*(m+g))/(2*g*_),m=Math.sqrt(f*f+1),f=((v-y)*(v+y)+g*(_/(f<0?f-m:f+m)-g))/v,C=u+(p=A=1);C<h+1;C++){if(m=E[C],_=R[C],g=p*m,m*=A,y=Math.sqrt(f*f+g*g),f=v*(A=f/(E[C-1]=y))+m*(p=g/y),m=-v*p+m*A,g=_*p,_*=A,s)for(c=0;c<w;c++)v=S[c][C-1],y=S[c][C],S[c][C-1]=v*A+y*p,S[c][C]=-v*p+y*A;if(y=Math.sqrt(f*f+g*g),f=(A=f/(R[C-1]=y))*m+(p=g/y)*_,v=-p*m+A*_,a)for(c=0;c<b;c++)_=M[c][C-1],y=M[c][C],M[c][C-1]=_*A+y*p,M[c][C]=-_*p+y*A}E[u]=0,E[h]=f,R[h]=v}for(C=0;C<w;C++)R[C]<o&&(R[C]=0);return{u:M,q:R,v:S}},r.VERSION="1.1.1",Object.defineProperty(r,"__esModule",{value:!0})})}),JAe=Ju((t,i)=>{(function(r,n){typeof t=="object"&&typeof i<"u"?i.exports=n():typeof define=="function"&&define.amd?define(n):(r=r||self,r.TinyQueue=n())})(t,function(){var r=function(a,s){if(a===void 0&&(a=[]),s===void 0&&(s=n),this.data=a,this.length=this.data.length,this.compare=s,this.length>0)for(var o=(this.length>>1)-1;o>=0;o--)this._down(o)};r.prototype.push=function(a){this.data.push(a),this.length++,this._up(this.length-1)},r.prototype.pop=function(){if(this.length!==0){var a=this.data[0],s=this.data.pop();return this.length--,this.length>0&&(this.data[0]=s,this._down(0)),a}},r.prototype.peek=function(){return this.data[0]},r.prototype._up=function(a){for(var s=this,o=s.data,l=s.compare,c=o[a];a>0;){var h=a-1>>1,u=o[h];if(l(c,u)>=0)break;o[a]=u,a=h}o[a]=c},r.prototype._down=function(a){for(var s=this,o=s.data,l=s.compare,c=this.length>>1,h=o[a];a<c;){var u=(a<<1)+1,d=o[u],A=u+1;if(A<this.length&&l(o[A],d)<0&&(u=A,d=o[A]),l(d,h)>=0)break;o[a]=d,a=u}o[a]=h};function n(a,s){return a<s?-1:a>s?1:0}return r})}),$Ae=Ju((t,i)=>{var r=JAe();r.default&&(r=r.default),i.exports=n,i.exports.default=n;function n(h,u,d){u=u||1;for(var A,f,m,g,p=0;p<h[0].length;p++){var v=h[0][p];(!p||v[0]<A)&&(A=v[0]),(!p||v[1]<f)&&(f=v[1]),(!p||v[0]>m)&&(m=v[0]),(!p||v[1]>g)&&(g=v[1])}var _=m-A,y=g-f,w=Math.min(_,y),b=w/2;if(w===0){var E=[A,f];return E.distance=0,E}for(var M=new r(void 0,a),S=A;S<m;S+=w)for(var T=f;T<g;T+=w)M.push(new s(S+b,T+b,b,h));var C=l(h),x=new s(A+_/2,f+y/2,0,h);x.d>C.d&&(C=x);for(var R=M.length;M.length;){var L=M.pop();L.d>C.d&&(C=L,d&&console.log("found best %d after %d probes",Math.round(1e4*L.d)/1e4,R)),!(L.max-C.d<=u)&&(b=L.h/2,M.push(new s(L.x-b,L.y-b,b,h)),M.push(new s(L.x+b,L.y-b,b,h)),M.push(new s(L.x-b,L.y+b,b,h)),M.push(new s(L.x+b,L.y+b,b,h)),R+=4)}d&&(console.log("num probes: "+R),console.log("best distance: "+C.d));var I=[C.x,C.y];return I.distance=C.d,I}function a(h,u){return u.max-h.max}function s(h,u,d,A){this.x=h,this.y=u,this.h=d,this.d=o(h,u,A),this.max=this.d+this.h*Math.SQRT2}function o(h,u,d){for(var A=!1,f=1/0,m=0;m<d.length;m++)for(var g=d[m],p=0,v=g.length,_=v-1;p<v;_=p++){var y=g[p],w=g[_];y[1]>u!=w[1]>u&&h<(w[0]-y[0])*(u-y[1])/(w[1]-y[1])+y[0]&&(A=!A),f=Math.min(f,c(h,u,y,w))}return f===0?0:(A?1:-1)*Math.sqrt(f)}function l(h){for(var u=0,d=0,A=0,f=h[0],m=0,g=f.length,p=g-1;m<g;p=m++){var v=f[m],_=f[p],y=v[0]*_[1]-_[0]*v[1];d+=(v[0]+_[0])*y,A+=(v[1]+_[1])*y,u+=y*3}return u===0?new s(f[0][0],f[0][1],0,h):new s(d/u,A/u,0,h)}
4577function c(h,u,d,A){var f=d[0],m=d[1],g=A[0]-f,p=A[1]-m;if(g!==0||p!==0){var v=((h-f)*g+(u-m)*p)/(g*g+p*p);v>1?(f=A[0],m=A[1]):v>0&&(f+=g*v,m+=p*v)}return g=h-f,p=u-m,g*g+p*p}}),efe=Ju((t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n){if(n===null||n===!0||n===!1)return NaN;var a=Number(n);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}i.exports=t.default}),tfe=Ju((t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;function r(n){var a=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return a.setUTCFullYear(n.getFullYear()),n.getTime()-a.getTime()}i.exports=t.default}),ife=Ju((t,i)=>{function r(s,o){function l(){this.constructor=s}l.prototype=o.prototype,s.prototype=new l}function n(s,o,l,c){this.message=s,this.expected=o,this.found=l,this.location=c,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,n)}r(n,Error),n.buildMessage=function(s,o){var l={literal:function(m){return'"'+h(m.text)+'"'},class:function(m){var g="",p;for(p=0;p<m.parts.length;p++)g+=m.parts[p]instanceof Array?u(m.parts[p][0])+"-"+u(m.parts[p][1]):u(m.parts[p]);return"["+(m.inverted?"^":"")+g+"]"},any:function(m){return"any character"},end:function(m){return"end of input"},other:function(m){return m.description}};function c(m){return m.charCodeAt(0).toString(16).toUpperCase()}function h(m){return m.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+c(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+c(g)})}function u(m){return m.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+c(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+c(g)})}function d(m){return l[m.type](m)}function A(m){var g=new Array(m.length),p,v;for(p=0;p<m.length;p++)g[p]=d(m[p]);if(g.sort(),g.length>0){for(p=1,v=1;p<g.length;p++)g[p-1]!==g[p]&&(g[v]=g[p],v++);g.length=v}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function f(m){return m?'"'+h(m)+'"':"end of input"}return"Expected "+A(s)+" but "+f(o)+" found."};function a(s,o){o=o!==void 0?o:{};var l={},c={svg_path:At},h=At,u=function(q){if(!q)return[];for(var ee=[],Te=0;Te<q.length;Te++)ee=ee.concat.apply(ee,q[Te]);var ie=ee[0];return ie&&ie.code=="m"&&(delete ie.relative,ie.code="M"),ee},d=function(q,ee){return mt(q,ee)},A=/^[Mm]/,f=fe(["M","m"],!1,!1),m=function(q,ee,Te){var ie=Si(q,[ee]);return Te&&(ie=ie.concat(Si(q=="M"?"L":"l",Te[1]))),ie},g=/^[Zz]/,p=fe(["Z","z"],!1,!1),v=function(){return Si("Z")},_=/^[Ll]/,y=fe(["L","l"],!1,!1),w=function(q,ee){return Si(q,ee)},b=/^[Hh]/,E=fe(["H","h"],!1,!1),M=function(q,ee){return Si(q,ee.map(function(Te){return{x:Te}}))},S=/^[Vv]/,T=fe(["V","v"],!1,!1),C=function(q,ee){return Si(q,ee.map(function(Te){return{y:Te}}))},x=/^[Cc]/,R=fe(["C","c"],!1,!1),L=function(q,ee,Te){return{x1:q.x,y1:q.y,x2:ee.x,y2:ee.y,x:Te.x,y:Te.y}},I=/^[Ss]/,F=fe(["S","s"],!1,!1),Y=function(q,ee){return{x2:q.x,y2:q.y,x:ee.x,y:ee.y}},D=/^[Qq]/,U=fe(["Q","q"],!1,!1),j=function(q,ee){return{x1:q.x,y1:q.y,x:ee.x,y:ee.y}},J=/^[Tt]/,z=fe(["T","t"],!1,!1),$=/^[Aa]/,te=fe(["A","a"],!1,!1),ae=function(q,ee,Te,ie,Ie,lt){return{rx:q,ry:ee,xAxisRotation:Te,largeArc:ie,sweep:Ie,x:lt.x,y:lt.y}},ve=function(q,ee){return{x:q,y:ee}},oe=function(q){return q*1},K=function(q){return q.join("")*1},X=/^[01]/,N=fe(["0","1"],!1,!1),k=function(q){return q=="1"},Z=function(){return""},V=",",re=Xe(",",!1),Ae=function(q){return q.join("")},pe=".",ce=Xe(".",!1),_e=/^[eE]/,me=fe(["e","E"],!1,!1),le=/^[+\-]/,De=fe(["+","-"],!1,!1),Ve=/^[0-9]/,se=fe([["0","9"]],!1,!1),P=function(q){return q.join("")},H=/^[ \t\n\r]/,ye=fe([" "," ",` 4578`,"\r"],!1,!1),Q=0,Be=[{line:1,column:1}],Le=0,Ke=[],Re;if("startRule"in o){if(!(o.startRule in c))throw new Error(`Can't start parsing from rule "`+o.startRule+'".');h=c[o.startRule]}function Xe(q,ee){return{type:"literal",text:q,ignoreCase:ee}}
vendor: 13,446 bytes, line 4578
4578function fe(q,ee,Te){return{type:"class",parts:q,inverted:ee,ignoreCase:Te}}function Ge(){return{type:"end"}}function Pe(q){var ee=Be[q],Te;if(ee)return ee;for(Te=q-1;!Be[Te];)Te--;for(ee=Be[Te],ee={line:ee.line,column:ee.column};Te<q;)s.charCodeAt(Te)===10?(ee.line++,ee.column=1):ee.column++,Te++;return Be[q]=ee,ee}function rt(q,ee){var Te=Pe(q),ie=Pe(ee);return{start:{offset:q,line:Te.line,column:Te.column},end:{offset:ee,line:ie.line,column:ie.column}}}function Ze(q){Q<Le||(Q>Le&&(Le=Q,Ke=[]),Ke.push(q))}function pt(q,ee,Te){return new n(n.buildMessage(q,ee),q,ee,Te)}function At(){var q,ee,Te,ie,Ie;for(q=Q,ee=[],Te=nt();Te!==l;)ee.push(Te),Te=nt();if(ee!==l)if(Te=Se(),Te===l&&(Te=null),Te!==l){for(ie=[],Ie=nt();Ie!==l;)ie.push(Ie),Ie=nt();ie!==l?(ee=u(Te),q=ee):(Q=q,q=l)}else Q=q,q=l;else Q=q,q=l;return q}function Se(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=xe(),ee!==l){for(Te=[],ie=Q,Ie=[],lt=nt();lt!==l;)Ie.push(lt),lt=nt();for(Ie!==l?(lt=xe(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;){for(Te.push(ie),ie=Q,Ie=[],lt=nt();lt!==l;)Ie.push(lt),lt=nt();Ie!==l?(lt=xe(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l)}Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function xe(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=Qe(),ee!==l){for(Te=[],ie=Q,Ie=[],lt=nt();lt!==l;)Ie.push(lt),lt=nt();for(Ie!==l?(lt=de(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;){for(Te.push(ie),ie=Q,Ie=[],lt=nt();lt!==l;)Ie.push(lt),lt=nt();Ie!==l?(lt=de(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l)}Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function de(){var q;return q=We(),q===l&&(q=He(),q===l&&(q=St(),q===l&&(q=oi(),q===l&&(q=Ir(),q===l&&(q=$a(),q===l&&(q=ge(),q===l&&(q=Ne(),q===l&&(q=W())))))))),q}function Qe(){var q,ee,Te,ie,Ie,lt,zi;if(q=Q,A.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(f)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=G(),ie!==l?(Ie=Q,lt=Ce(),lt===l&&(lt=null),lt!==l?(zi=ct(),zi!==l?(lt=[lt,zi],Ie=lt):(Q=Ie,Ie=l)):(Q=Ie,Ie=l),Ie===l&&(Ie=null),Ie!==l?(ee=m(ee,ie,Ie),q=ee):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function We(){var q,ee;return q=Q,g.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(p)),ee!==l&&(ee=v()),q=ee,q}function He(){var q,ee,Te,ie;if(q=Q,_.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(y)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=ct(),ie!==l?(ee=w(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function ct(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=G(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=G(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=G(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function St(){var q,ee,Te,ie;if(q=Q,b.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(E)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=si(),ie!==l?(ee=M(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function si(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=he(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=he(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=he(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function oi(){var q,ee,Te,ie;if(q=Q,S.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(T)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=si(),ie!==l?(ee=C(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function Ir(){var q,ee,Te,ie;if(q=Q,x.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(R)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=bi(),ie!==l?(ee=w(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function bi(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=Qr(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Qr(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Qr(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function Qr(){var q,ee,Te,ie,Ie,lt;return q=Q,ee=G(),ee!==l?(Te=Ce(),Te===l&&(Te=null),Te!==l?(ie=G(),ie!==l?(Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=G(),lt!==l?(ee=L(ee,ie,lt),q=ee):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l),q}function $a(){var q,ee,Te,ie;if(q=Q,I.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(F)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=Ll(),ie!==l?(ee=w(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function Ll(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=Th(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Th(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Th(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function Th(){var q,ee,Te,ie;return q=Q,ee=G(),ee!==l?(Te=Ce(),Te===l&&(Te=null),Te!==l?(ie=G(),ie!==l?(ee=Y(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l),q}function ge(){var q,ee,Te,ie;if(q=Q,D.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(U)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=ze(),ie!==l?(ee=w(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function ze(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=Oe(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Oe(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Oe(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function Oe(){var q,ee,Te,ie;return q=Q,ee=G(),ee!==l?(Te=Ce(),Te===l&&(Te=null),Te!==l?(ie=G(),ie!==l?(ee=j(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l),q}function Ne(){var q,ee,Te,ie;if(q=Q,J.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(z)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=it(),ie!==l?(ee=w(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function it(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=G(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=G(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=G(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function W(){var q,ee,Te,ie;if(q=Q,$.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(te)),ee!==l){for(Te=[],ie=nt();ie!==l;)Te.push(ie),ie=nt();Te!==l?(ie=ne(),ie!==l?(ee=w(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)}else Q=q,q=l;return q}function ne(){var q,ee,Te,ie,Ie,lt;if(q=Q,ee=Ee(),ee!==l){for(Te=[],ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Ee(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);ie!==l;)Te.push(ie),ie=Q,Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=Ee(),lt!==l?(Ie=[Ie,lt],ie=Ie):(Q=ie,ie=l)):(Q=ie,ie=l);Te!==l?(ee=d(ee,Te),q=ee):(Q=q,q=l)}else Q=q,q=l;return q}function Ee(){var q,ee,Te,ie,Ie,lt,zi,Pi,di,dn,Ws,pr;return q=Q,ee=ue(),ee!==l?(Te=Ce(),Te===l&&(Te=null),Te!==l?(ie=ue(),ie!==l?(Ie=Ce(),Ie===l&&(Ie=null),Ie!==l?(lt=he(),lt!==l?(zi=Ce(),zi!==l?(Pi=be(),Pi!==l?(di=Ce(),di===l&&(di=null),di!==l?(dn=be(),dn!==l?(Ws=Ce(),Ws===l&&(Ws=null),Ws!==l?(pr=G(),pr!==l?(ee=ae(ee,ie,lt,Pi,dn,pr),q=ee):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l),q}function G(){var q,ee,Te,ie;return q=Q,ee=he(),ee!==l?(Te=Ce(),Te===l&&(Te=null),Te!==l?(ie=he(),ie!==l?(ee=ve(ee,ie),q=ee):(Q=q,q=l)):(Q=q,q=l)):(Q=q,q=l),q}function ue(){var q,ee;return q=Q,ee=Ue(),ee===l&&(ee=dt()),ee!==l&&(ee=oe(ee)),q=ee,q}function he(){var q,ee,Te,ie;return q=Q,ee=Q,Te=Je(),Te===l&&(Te=null),Te!==l?(ie=Ue(),ie!==l?(Te=[Te,ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l),ee===l&&(ee=Q,Te=Je(),Te===l&&(Te=null),Te!==l?(ie=dt(),ie!==l?(Te=[Te,ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l)),ee!==l&&(ee=K(ee)),q=ee,q}function be(){var q,ee;return q=Q,X.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(N)),ee!==l&&(ee=k(ee)),q=ee,q}function Ce(){var q,ee,Te,ie,Ie;if(q=Q,ee=[],Te=nt(),Te!==l)for(;Te!==l;)ee.push(Te),Te=nt();else ee=l;if(ee!==l)if(Te=Fe(),Te===l&&(Te=null),Te!==l){for(ie=[],Ie=nt();Ie!==l;)ie.push(Ie),Ie=nt();ie!==l?(ee=[ee,Te,ie],q=ee):(Q=q,q=l)}else Q=q,q=l;else Q=q,q=l;if(q===l){if(q=Q,ee=Q,Te=Fe(),Te!==l){for(ie=[],Ie=nt();Ie!==l;)ie.push(Ie),Ie=nt();ie!==l?(Te=[Te,ie],ee=Te):(Q=ee,ee=l)}else Q=ee,ee=l;ee!==l&&(ee=Z()),q=ee}return q}function Fe(){var q;return s.charCodeAt(Q)===44?(q=V,Q++):(q=l,Ze(re)),q}function Ue(){var q,ee,Te,ie;return q=Q,ee=Q,Te=qe(),Te!==l?(ie=tt(),ie===l&&(ie=null),ie!==l?(Te=[Te,ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l),ee===l&&(ee=Q,Te=dt(),Te!==l?(ie=tt(),ie!==l?(Te=[Te,ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l)),ee!==l&&(ee=Ae(ee)),q=ee,q}function qe(){var q,ee,Te,ie,Ie;return q=Q,ee=Q,Te=dt(),Te===l&&(Te=null),Te!==l?(s.charCodeAt(Q)===46?(ie=pe,Q++):(ie=l,Ze(ce)),ie!==l?(Ie=dt(),Ie!==l?(Te=[Te,ie,Ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l)):(Q=ee,ee=l),ee===l&&(ee=Q,Te=dt(),Te!==l?(s.charCodeAt(Q)===46?(ie=pe,Q++):(ie=l,Ze(ce)),ie!==l?(Te=[Te,ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l)),ee!==l&&(ee=Ae(ee)),q=ee,q}function tt(){var q,ee,Te,ie,Ie;return q=Q,ee=Q,_e.test(s.charAt(Q))?(Te=s.charAt(Q),Q++):(Te=l,Ze(me)),Te!==l?(ie=Je(),ie===l&&(ie=null),ie!==l?(Ie=dt(),Ie!==l?(Te=[Te,ie,Ie],ee=Te):(Q=ee,ee=l)):(Q=ee,ee=l)):(Q=ee,ee=l),ee!==l&&(ee=Ae(ee)),q=ee,q}function Je(){var q;return le.test(s.charAt(Q))?(q=s.charAt(Q),Q++):(q=l,Ze(De)),q}function dt(){var q,ee,Te;if(q=Q,ee=[],Ve.test(s.charAt(Q))?(Te=s.charAt(Q),Q++):(Te=l,Ze(se)),Te!==l)for(;Te!==l;)ee.push(Te),Ve.test(s.charAt(Q))?(Te=s.charAt(Q),Q++):(Te=l,Ze(se));else ee=l;return ee!==l&&(ee=P(ee)),q=ee,q}function nt(){var q,ee;return q=Q,H.test(s.charAt(Q))?(ee=s.charAt(Q),Q++):(ee=l,Ze(ye)),ee!==l&&(ee=Z()),q=ee,q}function mt(q,ee){if(!ee)return[q];for(var Te=[q],ie=0,Ie=ee.length;ie<Ie;ie++)Te[ie+1]=ee[ie][1];return Te}var bt={m:"moveto",l:"lineto",h:"horizontal lineto",v:"vertical lineto",c:"curveto",s:"smooth curveto",q:"quadratic curveto",t:"smooth quadratic curveto",a:"elliptical arc",z:"closepath"};for(var Rt in bt)bt[Rt.toUpperCase()]=bt[Rt];function Si(q,ee){ee||(ee=[{}]);for(var Te=ee.length;Te--;){var ie={code:q,command:bt[q]};q==q.toLowerCase()&&(ie.relative=!0);for(var Ie in ee[Te])ie[Ie]=ee[Te][Ie];ee[Te]=ie}return ee}if(Re=h(),Re!==l&&Q===s.length)return Re;throw Re!==l&&Q<s.length&&Ze(Ge()),pt(Ke,Le<s.length?s.charAt(Le):null,Le<s.length?rt(Le,Le+1):rt(Le,Le))}i.exports={SyntaxError:n,parse:a}}),A7=Ju((t,i)=>{var r=ife().parse;r.parseSVG=r,r.makeAbsolute=n,i.exports=r;function n(a){var s,o={x:0,y:0},l={x:"x0",y:"y0",x1:"x0",y1:"y0",x2:"x0",y2:"y0"};return a.forEach(function(c){c.command==="moveto"&&(s=c),c.x0=o.x,c.y0=o.y;for(var h in l)h in c&&(c[h]+=c.relative?c[l[h]]:0);"x"in c||(c.x=o.x),"y"in c||(c.y=o.y),c.relative=!1,c.code=c.code.toUpperCase(),c.command=="closepath"&&(c.x=s.x,c.y=s.y),o=c}),a}}),rfe=Ju((t,i)=>{i.exports=function(r,n){for(var a=r.split("."),s=n.split("."),o=0;o<3;o++){var l=Number(a[o]),c=Number(s[o]);if(l>c)return 1;if(c>l)return-1;if(!isNaN(l)&&isNaN(c))return 1;if(isNaN(l)&&!isNaN(c))return-1}return 0}}),P0="149",Ho={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},nfe=0,A5=1,afe=2,tN=1,sfe=2,v_=3,pc=0,Ea=1,hs=2,Un=0,Jf=1,f5=2,p5=3,m5=4,ofe=5,$m=100,lfe=101,cfe=102,g5=103,v5=104,hfe=200,ufe=201,dfe=202,Afe=203,f7=204,p7=205,ffe=206,pfe=207,mfe=208,gfe=209,vfe=210,_fe=0,yfe=1,Efe=2,iP=3,wfe=4,bfe=5,Sfe=6,Cfe=7,m7=0,Tfe=1,Mfe=2,lh=0,xfe=1,Rfe=2,Bfe=3,Ife=4,Dfe=5,g7=300,cp=301,hp=302,rP=303,nP=304,EE=306,bu=1e3,Gr=1001,aP=1002,tr=1003,_5=1004,EB=1005,Ei=1006,Pfe=1007,a0=1008,gs=1009,Lfe=1010,Ofe=1011,v7=1012,Nfe=1013,Su=1014,On=1015,Hu=1016,Ufe=1017,Ffe=1018,$f=1020,kfe=1021,_a=1023,Hfe=1024,Gfe=1025,ep=1026,up=1027,zfe=1028,Qfe=1029,EC=1030,Vfe=1031,_7=1033,wB=33776,bB=33777,SB=33778,CB=33779,y5=35840,E5=35841,w5=35842,b5=35843,Wfe=36196,S5=37492,C5=37496,T5=37808,M5=37809,x5=37810,R5=37811,B5=37812,I5=37813,D5=37814,P5=37815,L5=37816,O5=37817,N5=37818,U5=37819,F5=37820,k5=37821,TB=36492,jfe=36283,H5=36284,G5=36285,z5=36286,y7=2200,E7=2201,iN=2202,wC=2300,bC=2301,MB=2302,hg=2400,ug=2401,SC=2402,rN=2500,Yfe=2501,mc=3e3,gi=3001,ed=3200,w7=3201,Kfe=0,Xfe=1,zc="srgb",CC="srgb-linear",xB=7680,qfe=519,sP=35044,Zfe=35048,Q5="300 es",oP=1035,Ja=class{addEventListener(t,i){this._listeners===void 0&&(this._listeners={});let r=this._listeners;r[t]===void 0&&(r[t]=[]),r[t].indexOf(i)===-1&&r[t].push(i)}hasEventListener(t,i){if(this._listeners===void 0)return!1;let r=this._listeners;return r[t]!==void 0&&r[t].indexOf(i)!==-1}removeEventListener(t,i){if(this._listeners===void 0)return;let r=this._listeners[t];if(r!==void 0){let n=r.indexOf(i);n!==-1&&r.splice(n,1)}}dispatchEvent(t){if(this._listeners===void 0)return;let i=this._listeners[t.type];if(i!==void 0){t.target=this;let r=i.slice(0);for(let n=0,a=r.length;n<a;n++)r[n].call(this,t);t.target=null}}},is=["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","5
45785","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"],V5=1234567,W_=Math.PI/180,Ty=180/Math.PI;function gl(){let t=Math.random()*4294967295|0,i=Math.random()*4294967295|0,r=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(is[t&255]+is[t>>8&255]+is[t>>16&255]+is[t>>24&255]+"-"+is[i&255]+is[i>>8&255]+"-"+is[i>>16&15|64]+is[i>>24&255]+"-"+is[r&63|128]+is[r>>8&255]+"-"+is[r>>16&255]+is[r>>24&255]+is[n&255]+is[n>>8&255]+is[n>>16&255]+is[n>>24&255]).toLowerCase()}function Dn(t,i,r){return Math.max(i,Math.min(r,t))}function nN(t,i){return(t%i+i)%i}function Jfe(t,i,r,n,a){return n+(t-i)*(a-n)/(r-i)}function $fe(t,i,r){return t!==i?(r-t)/(i-t):0}function j_(t,i,r){return(1-r)*t+r*i}function epe(t,i,r,n){return j_(t,i,1-Math.exp(-r*n))}function tpe(t,i=1){return i-Math.abs(nN(t,i*2)-i)}function ipe(t,i,r){return t<=i?0:t>=r?1:(t=(t-i)/(r-i),t*t*(3-2*t))}function rpe(t,i,r){return t<=i?0:t>=r?1:(t=(t-i)/(r-i),t*t*t*(t*(t*6-15)+10))}function npe(t,i){return t+Math.floor(Math.random()*(i-t+1))}function ape(t,i){return t+Math.random()*(i-t)}function spe(t){return t*(.5-Math.random())}function ope(t){t!==void 0&&(V5=t);let i=V5+=1831565813;return i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61),((i^i>>>14)>>>0)/4294967296}function lpe(t){return t*W_}function cpe(t){return t*Ty}function lP(t){return(t&t-1)===0&&t!==0}function b7(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function TC(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function hpe(t,i,r,n,a){let s=Math.cos,o=Math.sin,l=s(r/2),c=o(r/2),h=s((i+n)/2),u=o((i+n)/2),d=s((i-n)/2),A=o((i-n)/2),f=s((n-i)/2),m=o((n-i)/2);switch(a){case"XYX":t.set(l*u,c*d,c*A,l*h);break;case"YZY":t.set(c*A,l*u,c*d,l*h);break;case"ZXZ":t.set(c*d,c*A,l*u,l*h);break;case"XZX":t.set(l*u,c*m,c*f,l*h);break;case"YXY":t.set(c*f,l*u,c*m,l*h);break;case"ZYZ":t.set(c*m,c*f,l*u,l*h);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function Cu(t,i){switch(i.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Tr(t,i){switch(i.constructor){case Float32Array:return t;case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}var Ct=Object.freeze({__proto__:null,DEG2RAD:W_,RAD2DEG:Ty,ceilPowerOfTwo:b7,clamp:Dn,damp:epe,degToRad:lpe,denormalize:Cu,euclideanModulo:nN,floorPowerOfTwo:TC,generateUUID:gl,inverseLerp:$fe,isPowerOfTwo:lP,lerp:j_,mapLinear:Jfe,normalize:Tr,pingpong:tpe,radToDeg:cpe,randFloat:ape,randFloatSpread:spe,randInt:npe,seededRandom:ope,setQuaternionFromProperEuler:hpe,smootherstep:rpe,smoothstep:ipe}),Me=class{constructor(t=0,i=0){Me.prototype.isVector2=!0,this.x=t,this.y=i}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,i){return this.x=t,this.y=i,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t){return this.x+=t.x,this.y+=t.y,this}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){let i=this.x,r=this.y,n=t.elements;return this.x=n[0]*i+n[3]*r+n[6],this.y=n[1]*i+n[4]*r+n[7],this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}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}
vendor: 2,573 bytes, line 4578
4578round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.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}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let i=this.x-t.x,r=this.y-t.y;return i*i+r*r}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this}rotateAround(t,i){let r=Math.cos(i),n=Math.sin(i),a=this.x-t.x,s=this.y-t.y;return this.x=a*r-s*n+t.x,this.y=a*n+s*r+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}},Nn=class{constructor(){Nn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1]}set(t,i,r,n,a,s,o,l,c){let h=this.elements;return h[0]=t,h[1]=n,h[2]=o,h[3]=i,h[4]=a,h[5]=l,h[6]=r,h[7]=s,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(t){let i=this.elements,r=t.elements;return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],this}extractBasis(t,i,r){return t.setFromMatrix3Column(this,0),i.setFromMatrix3Column(this,1),r.setFromMatrix3Column(this,2),this}setFromMatrix4(t){let i=t.elements;return this.set(i[0],i[4],i[8],i[1],i[5],i[9],i[2],i[6],i[10]),this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){let r=t.elements,n=i.elements,a=this.elements,s=r[0],o=r[3],l=r[6],c=r[1],h=r[4],u=r[7],d=r[2],A=r[5],f=r[8],m=n[0],g=n[3],p=n[6],v=n[1],_=n[4],y=n[7],w=n[2],b=n[5],E=n[8];return a[0]=s*m+o*v+l*w,a[3]=s*g+o*_+l*b,a[6]=s*p+o*y+l*E,a[1]=c*m+h*v+u*w,a[4]=c*g+h*_+u*b,a[7]=c*p+h*y+u*E,a[2]=d*m+A*v+f*w,a[5]=d*g+A*_+f*b,a[8]=d*p+A*y+f*E,this}multiplyScalar(t){let i=this.elements;
4578return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=t,i[4]*=t,i[7]*=t,i[2]*=t,i[5]*=t,i[8]*=t,this}determinant(){let t=this.elements,i=t[0],r=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],h=t[8];return i*s*h-i*o*c-r*a*h+r*o*l+n*a*c-n*s*l}invert(){let t=this.elements,i=t[0],r=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=h*s-o*c,d=o*l-h*a,A=c*a-s*l,f=i*u+r*d+n*A;if(f===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/f;return t[0]=u*m,t[1]=(n*c-h*r)*m,t[2]=(o*r-n*s)*m,t[3]=d*m,t[4]=(h*i-n*l)*m,t[5]=(n*a-o*i)*m,t[6]=A*m,t[7]=(r*l-c*i)*m,t[8]=(s*i-r*a)*m,this}transpose(){let t,i=this.elements;return t=i[1],i[1]=i[3],i[3]=t,t=i[2],i[2]=i[6],i[6]=t,t=i[5],i[5]=i[7],i[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).invert().transpose()}transposeIntoArray(t){let i=this.elements;return t[0]=i[0],t[1]=i[3],t[2]=i[6],t[3]=i[1],t[4]=i[4],t[5]=i[7],t[6]=i[2],t[7]=i[5],t[8]=i[8],this}setUvTransform(t,i,r,n,a,s,o){let l=Math.cos(a),c=Math.sin(a);return this.set(r*l,r*c,-r*(l*s+c*o)+s+t,-n*c,n*l,-n*(-c*s+l*o)+o+i,0,0,1),this}scale(t,i){return this.premultiply(RB.makeScale(t,i)),this}rotate(t){return this.premultiply(RB.makeRotation(-t)),this}translate(t,i){return this.premultiply(RB.makeTranslation(t,i)),this}makeTranslation(t,i){return this.set(1,0,t,0,1,i,0,0,1),this}makeRotation(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,-r,0,r,i,0,0,0,1),this}makeScale(t,i){return this.set(t,0,0,0,i,0,0,0,1),this}equals(t){let i=this.elements,r=t.elements;for(let n=0;n<9;n++)if(i[n]!==r[n])return!1;return!0}fromArray(t,i=0){for(let r=0;r<9;r++)this.elements[r]=t[r+i];return this}toArray(t=[],i=0){let r=this.elements;return t[i]=r[0],t[i+1]=r[1],t[i+2]=r[2],t[i+3]=r[3],t[i+4]=r[4],t[i+5]=r[5],t[i+6]=r[6],t[i+7]=r[7],t[i+8]=r[8],t}clone(){return new this.constructor().fromArray(this.elements)}},RB=new Nn;function S7(t){for(let i=t.length-1;i>=0;--i)if(t[i]>=65535)return!0;return!1}var upe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Pw(t,i){return new upe[t](i)}function My(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function tp(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function SS(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}var BB={[zc]:{[CC]:tp},[CC]:{[zc]:SS}},ys={legacyMode:!0,get workingColorSpace(){return CC},set workingColorSpace(t){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(t,i,r){if(this.legacyMode||i===r||!i||!r)return t;if(BB[i]&&BB[i][r]!==void 0){let n=BB[i][r];return t.r=n(t.r),t.g=n(t.g),t.b=n(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,i){return this.convert(t,this.workingColorSpace,i)},toWorkingColorSpace:function(t,i){return this.convert(t,i,this.workingColorSpace)}},C7={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},Hn={r:0,g:0,b:0},kl={h:0,s:0,l:0},Lw={h:0,s:0,l:0};function IB(t,i,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(i-t)*6*r:r<1/2?i:r<2/3?t+(i-t)*6*(2/3-r):t}function Ow(t,i){return i.r=t.r,i.g=t.g,i.b=t.b,i}var Ht=class{constructor(t,i,r){return this.isColor=!0,this.r=1,this.g=1,this.b=1,i===void 0&&r===void 0?this.set(t):this.setRGB(t,i,r)}set(t){return t&&t.isColor?this.copy(t):typeof t=="number"?this.setHex(t):typeof t=="string"&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t,i=zc){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(t&255)/255,ys.toWorkingColorSpace(this,i),this}setRGB(t,i,r,n=ys.workingColorSpace){return this.r=t,this.g=i,this.b=r,ys.toWorkingColorSpace(this,n),this}setHSL(t,i,r,n=ys.workingColorSpace){if(t=nN(t,1),i=Dn(i,0,1),r=Dn(r,0,1),i===0)this.r=this.g=this.b=r;else{let a=r<=.5?r*(1+i):r+i-r*i,s=2*r-a;this.r=IB(s,a,t+1/3),this.g=IB(s,a,t),this.b=IB(s,a,t-1/3)}return ys.toWorkingColorSpace(this,n),this}
4578setStyle(t,i=zc){function r(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let a,s=n[1],o=n[2];switch(s){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(a[1],10))/255,this.g=Math.min(255,parseInt(a[2],10))/255,this.b=Math.min(255,parseInt(a[3],10))/255,ys.toWorkingColorSpace(this,i),r(a[4]),this;if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(a[1],10))/100,this.g=Math.min(100,parseInt(a[2],10))/100,this.b=Math.min(100,parseInt(a[3],10))/100,ys.toWorkingColorSpace(this,i),r(a[4]),this;break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o)){let l=parseFloat(a[1])/360,c=parseFloat(a[2])/100,h=parseFloat(a[3])/100;return r(a[4]),this.setHSL(l,c,h,i)}break}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){let a=n[1],s=a.length;if(s===3)return this.r=parseInt(a.charAt(0)+a.charAt(0),16)/255,this.g=parseInt(a.charAt(1)+a.charAt(1),16)/255,this.b=parseInt(a.charAt(2)+a.charAt(2),16)/255,ys.toWorkingColorSpace(this,i),this;if(s===6)return this.r=parseInt(a.charAt(0)+a.charAt(1),16)/255,this.g=parseInt(a.charAt(2)+a.charAt(3),16)/255,this.b=parseInt(a.charAt(4)+a.charAt(5),16)/255,ys.toWorkingColorSpace(this,i),this}return t&&t.length>0?this.setColorName(t,i):this}setColorName(t,i=zc){let r=C7[t.toLowerCase()];return r!==void 0?this.setHex(r,i):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copySRGBToLinear(t){return this.r=tp(t.r),this.g=tp(t.g),this.b=tp(t.b),this}copyLinearToSRGB(t){return this.r=SS(t.r),this.g=SS(t.g),this.b=SS(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=zc){return ys.fromWorkingColorSpace(Ow(this,Hn),t),Dn(Hn.r*255,0,255)<<16^Dn(Hn.g*255,0,255)<<8^Dn(Hn.b*255,0,255)<<0}getHexString(t=zc){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,i=ys.workingColorSpace){ys.fromWorkingColorSpace(Ow(this,Hn),i);let r=Hn.r,n=Hn.g,a=Hn.b,s=Math.max(r,n,a),o=Math.min(r,n,a),l,c,h=(o+s)/2;if(o===s)l=0,c=0;else{let u=s-o;switch(c=h<=.5?u/(s+o):u/(2-s-o),s){case r:l=(n-a)/u+(n<a?6:0);break;case n:l=(a-r)/u+2;break;case a:l=(r-n)/u+4;break}l/=6}return t.h=l,t.s=c,t.l=h,t}getRGB(t,i=ys.workingColorSpace){return ys.fromWorkingColorSpace(Ow(this,Hn),i),t.r=Hn.r,t.g=Hn.g,t.b=Hn.b,t}getStyle(t=zc){return ys.fromWorkingColorSpace(Ow(this,Hn),t),t!==zc?`color(${t} ${Hn.r} ${Hn.g} ${Hn.b})`:`rgb(${Hn.r*255|0},${Hn.g*255|0},${Hn.b*255|0})`}offsetHSL(t,i,r){return this.getHSL(kl),kl.h+=t,kl.s+=i,kl.l+=r,this.setHSL(kl.h,kl.s,kl.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,i){return this.r=t.r+i.r,this.g=t.g+i.g,this.b=t.b+i.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,i){return this.r+=(t.r-this.r)*i,this.g+=(t.g-this.g)*i,this.b+=(t.b-this.b)*i,this}lerpColors(t,i,r){return this.r=t.r+(i.r-t.r)*r,this.g=t.g+(i.g-t.g)*r,this.b=t.b+(i.b-t.b)*r,this}lerpHSL(t,i){this.getHSL(kl),t.getHSL(Lw);let r=j_(kl.h,Lw.h,i),n=j_(kl.s,Lw.s,i),a=j_(kl.l,Lw.l,i);return this.setHSL(r,n,a),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,i=0){return this.r=t[i],this.g=t[i+1],this.b=t[i+2],this}toArray(t=[],i=0){return t[i]=this.r,t[i+1]=this.g,t[i+2]=this.b,t}fromBufferAttribute(t,i){return this.r=t.getX(i),this.g=t.getY(i),this.b=t.getZ(i),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}};Ht.NAMES=C7;var Am,T7=class{static getDataURL(t){if(/^data:/i.test(t.src)||typeof HTMLCanvasElement>"u")return t.src;let i;if(t instanceof HTMLCanvasElement)i=t;else{Am===void 0&&(Am=My("canvas")),Am.width=t.width,Am.height=t.height;let r=Am.getContext("2d");t instanceof ImageData?r.putImageData(t,0,0):r.drawImage(t,0,0,t.width,t.height),i=Am}return i.width>2048||i.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",t),i.toDataURL("image/jpeg",.6)):i.toDataURL("image/png")}static sRGBToLinear(t){if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap){let i=My("canvas");i.width=t.width,i.height=t.height;let r=i.getContext("2d");r.drawImage(t,0,0,t.width,t.height);let n=r.getImageData(0,0,t.width,t.height),a=n.data;for(let s=0;s<a.length;s++)a[s]=tp(a[s]/255)*255;return r.putImageData(n,0,0),i}else if(t.data){let i=t.data.slice(0);for(let r=0;r<i.length;r++)i instanceof Uint8Array||i instanceof Uint8ClampedArray?i[r]=Math.floor(tp(i[r]/255)*255):i[r]=tp(i[r]);return{data:i,width:t.width,height:t.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),t}},M7=class{constructor(t=null){this.isSource=!0,this.uuid=gl(),this.data=t,this.version=0}set needsUpdate(t){t===!0&&this.version++}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.images[this.uuid]!==void 0)return t.images[this.uuid];let r={uuid:this.uuid,url:""},n=this.data;if(n!==null){let a;if(Array.isArray(n)){a=[];for(let s=0,o=n.length;s<o;s++)n[s].isDataTexture?a.push(DB(n[s].image)):a.push(DB(n[s]))}else a=DB(n);r.url=a}
vendor: 19,698 bytes, line 4578
4578return i||(t.images[this.uuid]=r),r}};function DB(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?T7.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}var dpe=0,en=class extends Ja{constructor(t=en.DEFAULT_IMAGE,i=en.DEFAULT_MAPPING,r=Gr,n=Gr,a=Ei,s=a0,o=_a,l=gs,c=en.DEFAULT_ANISOTROPY,h=mc){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:dpe++}),this.uuid=gl(),this.name="",this.source=new M7(t),this.mipmaps=[],this.mapping=i,this.wrapS=r,this.wrapT=n,this.magFilter=a,this.minFilter=s,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Me(0,0),this.repeat=new Me(1,1),this.center=new Me(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=h,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(t){return this.name=t.name,this.source=t.source,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(t){let i=t===void 0||typeof t=="string";if(!i&&t.textures[this.uuid]!==void 0)return t.textures[this.uuid];let r={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(t).uuid,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(r.userData=this.userData),i||(t.textures[this.uuid]=r),r}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==g7)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case bu:t.x=t.x-Math.floor(t.x);break;case Gr:t.x=t.x<0?0:1;break;case aP:Math.abs(Math.floor(t.x)%2)===1?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x);break}if(t.y<0||t.y>1)switch(this.wrapT){case bu:t.y=t.y-Math.floor(t.y);break;case Gr:t.y=t.y<0?0:1;break;case aP:Math.abs(Math.floor(t.y)%2)===1?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y);break}return this.flipY&&(t.y=1-t.y),t}set needsUpdate(t){t===!0&&(this.version++,this.source.needsUpdate=!0)}};en.DEFAULT_IMAGE=null;en.DEFAULT_MAPPING=g7;en.DEFAULT_ANISOTROPY=1;var ai=class{constructor(t=0,i=0,r=0,n=1){ai.prototype.isVector4=!0,this.x=t,this.y=i,this.z=r,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,i,r,n){return this.x=t,this.y=i,this.z=r,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;case 3:this.w=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==void 0?t.w:1,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this.w=t.w+i.w,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this.w+=t.w*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this.w=t.w-i.w,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){let i=this.x,r=this.y,n=this.z,a=this.w,s=t.elements;return this.x=s[0]*i+s[4]*r+s[8]*n+s[12]*a,this.y=s[1]*i+s[5]*r+s[9]*n+s[13]*a,this.z=s[2]*i+s[6]*r+s[10]*n+s[14]*a,this.w=s[3]*i+s[7]*r+s[11]*n+s[15]*a,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);let i=Math.sqrt(1-t.w*t.w);return i<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/i,this.y=t.y/i,this.z=t.z/i),this}setAxisAngleFromRotationMatrix(t){let i,r,n,a,s=t.elements,o=s[0],l=s[4],c=s[8],h=s[1],u=s[5],d=s[9],A=s[2],f=s[6],m=s[10];if(Math.abs(l-h)<.01&&Math.abs(c-A)<.01&&Math.abs(d-f)<.01){if(Math.abs(l+h)<.1&&Math.abs(c+A)<.1&&Math.abs(d+f)<.1&&Math.abs(o+u+m-3)<.1)return this.set(1,0,0,0),this;i=Math.PI;let p=(o+1)/2,v=(u+1)/2,_=(m+1)/2,y=(l+h)/4,w=(c+A)/4,b=(d+f)/4;return p>v&&p>_?p<.01?(r=0,n=.707106781,a=.707106781):(r=Math.sqrt(p),n=y/r,a=w/r):v>_?v<.01?(r=.707106781,n=0,a=.707106781):(n=Math.sqrt(v),r=y/n,a=b/n):_<.01?(r=.707106781,n=.707106781,a=0):(a=Math.sqrt(_),r=w/a,n=b/a),this.set(r,n,a,i),this}let g=Math.sqrt((f-d)*(f-d)+(c-A)*(c-A)+(h-l)*(h-l));return Math.abs(g)<.001&&(g=1),this.x=(f-d)/g,this.y=(c-A)/g,this.z=(h-l)/g,this.w=Math.acos((o+u+m-1)/2),this}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this.w=Math.max(t.w,Math.min(i.w,this.w)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this.w=Math.max(t,Math.min(i,this.w)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}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=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this.w+=(t.w-this.w)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this.z=t.z+(i.z-t.z)*r,this.w=t.w+(i.w-t.w)*r,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this.w=t[i+3],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t[i+3]=this.w,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this.w=t.getW(i),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}},$i=class extends Ja{constructor(t=1,i=1,r={}){super(),this.isWebGLRenderTarget=!0,this.width=t,this.height=i,this.depth=1,this.scissor=new ai(0,0,t,i),this.scissorTest=!1,this.viewport=new ai(0,0,t,i);let n={width:t,height:i,depth:1};this.texture=new en(n,r.mapping,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=r.generateMipmaps!==void 0?r.generateMipmaps:!1,this.texture.internalFormat=r.internalFormat!==void 0?r.internalFormat:null,this.texture.minFilter=r.minFilter!==void 0?r.minFilter:Ei,this.depthBuffer=r.depthBuffer!==void 0?r.depthBuffer:!0,this.stencilBuffer=r.stencilBuffer!==void 0?r.stencilBuffer:!1,this.depthTexture=r.depthTexture!==void 0?r.depthTexture:null,this.samples=r.samples!==void 0?r.samples:0}setSize(t,i,r=1){(this.width!==t||this.height!==i||this.depth!==r)&&(this.width=t,this.height=i,this.depth=r,this.texture.image.width=t,this.texture.image.height=i,this.texture.image.depth=r,this.dispose()),this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i)}clone(){return new this.constructor().copy(this)}copy(t){this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0;let i=Object.assign({},t.texture.image);return this.texture.source=new M7(i),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}},x7=class extends en{constructor(t=null,i=1,r=1,n=1){super(null),this.isDataArrayTexture=!0,this.image={data:t,width:i,height:r,depth:n},this.magFilter=tr,this.minFilter=tr,this.wrapR=Gr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},Ape=class extends en{constructor(t=null,i=1,r=1,n=1){super(null),this.isData3DTexture=!0,this.image={data:t,width:i,height:r,depth:n},this.magFilter=tr,this.minFilter=tr,this.wrapR=Gr,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}},fpe=class extends $i{constructor(t=1,i=1,r=1,n={}){super(t,i,n),this.isWebGLMultipleRenderTargets=!0;let a=this.texture;this.texture=[];for(let s=0;s<r;s++)this.texture[s]=a.clone(),this.texture[s].isRenderTargetTexture=!0}setSize(t,i,r=1){if(this.width!==t||this.height!==i||this.depth!==r){this.width=t,this.height=i,this.depth=r;for(let n=0,a=this.texture.length;n<a;n++)this.texture[n].image.width=t,this.texture[n].image.height=i,this.texture[n].image.depth=r;this.dispose()}return this.viewport.set(0,0,t,i),this.scissor.set(0,0,t,i),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,t.depthTexture!==null&&(this.depthTexture=t.depthTexture.clone()),this.texture.length=0;for(let i=0,r=t.texture.length;i<r;i++)this.texture[i]=t.texture[i].clone(),this.texture[i].isRenderTargetTexture=!0;return this}},ri=class{constructor(t=0,i=0,r=0,n=1){this.isQuaternion=!0,this._x=t,this._y=i,this._z=r,this._w=n}static slerpFlat(t,i,r,n,a,s,o){let l=r[n+0],c=r[n+1],h=r[n+2],u=r[n+3],d=a[s+0],A=a[s+1],f=a[s+2],m=a[s+3];if(o===0){t[i+0]=l,t[i+1]=c,t[i+2]=h,t[i+3]=u;return}if(o===1){t[i+0]=d,t[i+1]=A,t[i+2]=f,t[i+3]=m;return}if(u!==m||l!==d||c!==A||h!==f){let g=1-o,p=l*d+c*A+h*f+u*m,v=p>=0?1:-1,_=1-p*p;if(_>Number.EPSILON){let w=Math.sqrt(_),b=Math.atan2(w,p*v);g=Math.sin(g*b)/w,o=Math.sin(o*b)/w}let y=o*v;if(l=l*g+d*y,c=c*g+A*y,h=h*g+f*y,u=u*g+m*y,g===1-o){let w=1/Math.sqrt(l*l+c*c+h*h+u*u);l*=w,c*=w,h*=w,u*=w}}t[i]=l,t[i+1]=c,t[i+2]=h,t[i+3]=u}static multiplyQuaternionsFlat(t,i,r,n,a,s){let o=r[n],l=r[n+1],c=r[n+2],h=r[n+3],u=a[s],d=a[s+1],A=a[s+2],f=a[s+3];return t[i]=o*f+h*u+l*A-c*d,t[i+1]=l*f+h*d+c*u-o*A,t[i+2]=c*f+h*A+o*d-l*u,t[i+3]=h*f-o*u-l*d-c*A,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,i,r,n){return this._x=t,this._y=i,this._z=r,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,i){let r=t._x,n=t._y,a=t._z,s=t._order,o=Math.cos,l=Math.sin,c=o(r/2),h=o(n/2),u=o(a/2),d=l(r/2),A=l(n/2),f=l(a/2);switch(s){case"XYZ":this._x=d*h*u+c*A*f,this._y=c*A*u-d*h*f,this._z=c*h*f+d*A*u,this._w=c*h*u-d*A*f;break;case"YXZ":this._x=d*h*u+c*A*f,this._y=c*A*u-d*h*f,this._z=c*h*f-d*A*u,this._w=c*h*u+d*A*f;break;case"ZXY":this._x=d*h*u-c*A*f,this._y=c*A*u+d*h*f,this._z=c*h*f+d*A*u,this._w=c*h*u-d*A*f;break;case"ZYX":this._x=d*h*u-c*A*f,this._y=c*A*u+d*h*f,this._z=c*h*f-d*A*u,this._w=c*h*u+d*A*f;break;case"YZX":this._x=d*h*u+c*A*f,this._y=c*A*u+d*h*f,this._z=c*h*f-d*A*u,this._w=c*h*u-d*A*f;break;case"XZY":this._x=d*h*u-c*A*f,this._y=c*A*u-d*h*f,this._z=c*h*f+d*A*u,this._w=c*h*u+d*A*f;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return i!==!1&&this._onChangeCallback(),this}setFromAxisAngle(t,i){let r=i/2,n=Math.sin(r);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(r),this._onChangeCallback(),this}setFromRotationMatrix(t){let i=t.elements,r=i[0],n=i[4],a=i[8],s=i[1],o=i[5],l=i[9],c=i[2],h=i[6],u=i[10],d=r+o+u;if(d>0){let A=.5/Math.sqrt(d+1);this._w=.25/A,this._x=(h-l)*A,this._y=(a-c)*A,this._z=(s-n)*A}else if(r>o&&r>u){let A=2*Math.sqrt(1+r-o-u);this._w=(h-l)/A,this._x=.25*A,this._y=(n+s)/A,this._z=(a+c)/A}else if(o>u){let A=2*Math.sqrt(1+o-r-u);this._w=(a-c)/A,this._x=(n+s)/A,this._y=.25*A,this._z=(l+h)/A}else{let A=2*Math.sqrt(1+u-r-o);this._w=(s-n)/A,this._x=(a+c)/A,this._y=(l+h)/A,this._z=.25*A}return this._onChangeCallback(),this}setFromUnitVectors(t,i){let r=t.dot(i)+1;return r<Number.EPSILON?(r=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=r):(this._x=0,this._y=-t.z,this._z=t.y,this._w=r)):(this._x=t.y*i.z-t.z*i.y,this._y=t.z*i.x-t.x*i.z,this._z=t.x*i.y-t.y*i.x,this._w=r),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Dn(this.dot(t),-1,1)))}rotateTowards(t,i){let r=this.angleTo(t);if(r===0)return this;let n=Math.min(1,i/r);return this.slerp(t,n),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(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._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 t=this.length();return t===0?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this}multiply(t){return this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,i){let r=t._x,n=t._y,a=t._z,s=t._w,o=i._x,l=i._y,c=i._z,h=i._w;return this._x=r*h+s*o+n*c-a*l,this._y=n*h+s*l+a*o-r*c,this._z=a*h+s*c+r*l-n*o,this._w=s*h-r*o-n*l-a*c,this._onChangeCallback(),this}slerp(t,i){if(i===0)return this;if(i===1)return this.copy(t);let r=this._x,n=this._y,a=this._z,s=this._w,o=s*t._w+r*t._x+n*t._y+a*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=r,this._y=n,this._z=a,this;let l=1-o*o;if(l<=Number.EPSILON){let A=1-i;return this._w=A*s+i*this._w,this._x=A*r+i*this._x,this._y=A*n+i*this._y,this._z=A*a+i*this._z,this.normalize(),this._onChangeCallback(),this}let c=Math.sqrt(l),h=Math.atan2(c,o),u=Math.sin((1-i)*h)/c,d=Math.sin(i*h)/c;return this._w=s*u+this._w*d,this._x=r*u+this._x*d,this._y=n*u+this._y*d,this._z=a*u+this._z*d,this._onChangeCallback(),this}slerpQuaternions(t,i,r){return this.copy(t).slerp(i,r)}random(){let t=Math.random(),i=Math.sqrt(1-t),r=Math.sqrt(t),n=2*Math.PI*Math.random(),a=2*Math.PI*Math.random();return this.set(i*Math.cos(n),r*Math.sin(a),r*Math.cos(a),i*Math.sin(n))}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,i=0){return this._x=t[i],this._y=t[i+1],this._z=t[i+2],this._w=t[i+3],this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._w,t}fromBufferAttribute(t,i){return this._x=t.getX(i),this._y=t.getY(i),this._z=t.getZ(i),this._w=t.getW(i),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},O=class{constructor(t=0,i=0,r=0){O.prototype.isVector3=!0,this.x=t,this.y=i,this.z=r}set(t,i,r){return r===void 0&&(r=this.z),this.x=t,this.y=i,this.z=r,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(t,i){switch(t){case 0:this.x=i;break;case 1:this.y=i;break;case 2:this.z=i;break;default:throw new Error("index is out of range: "+t)}return this}getComponent(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,i){return this.x=t.x+i.x,this.y=t.y+i.y,this.z=t.z+i.z,this}addScaledVector(t,i){return this.x+=t.x*i,this.y+=t.y*i,this.z+=t.z*i,this}sub(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,i){return this.x=t.x-i.x,this.y=t.y-i.y,this.z=t.z-i.z,this}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,i){return this.x=t.x*i.x,this.y=t.y*i.y,this.z=t.z*i.z,this}applyEuler(t){return this.applyQuaternion(W5.setFromEuler(t))}applyAxisAngle(t,i){return this.applyQuaternion(W5.setFromAxisAngle(t,i))}applyMatrix3(t){let i=this.x,r=this.y,n=this.z,a=t.elements;return this.x=a[0]*i+a[3]*r+a[6]*n,this.y=a[1]*i+a[4]*r+a[7]*n,this.z=a[2]*i+a[5]*r+a[8]*n,this}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){let i=this.x,r=this.y,n=this.z,a=t.elements,s=1/(a[3]*i+a[7]*r+a[11]*n+a[15]);
vendor: 11,098 bytes, line 4578
4578return this.x=(a[0]*i+a[4]*r+a[8]*n+a[12])*s,this.y=(a[1]*i+a[5]*r+a[9]*n+a[13])*s,this.z=(a[2]*i+a[6]*r+a[10]*n+a[14])*s,this}applyQuaternion(t){let i=this.x,r=this.y,n=this.z,a=t.x,s=t.y,o=t.z,l=t.w,c=l*i+s*n-o*r,h=l*r+o*i-a*n,u=l*n+a*r-s*i,d=-a*i-s*r-o*n;return this.x=c*l+d*-a+h*-o-u*-s,this.y=h*l+d*-s+u*-a-c*-o,this.z=u*l+d*-o+c*-s-h*-a,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){let i=this.x,r=this.y,n=this.z,a=t.elements;return this.x=a[0]*i+a[4]*r+a[8]*n,this.y=a[1]*i+a[5]*r+a[9]*n,this.z=a[2]*i+a[6]*r+a[10]*n,this.normalize()}divide(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this}clamp(t,i){return this.x=Math.max(t.x,Math.min(i.x,this.x)),this.y=Math.max(t.y,Math.min(i.y,this.y)),this.z=Math.max(t.z,Math.min(i.z,this.z)),this}clampScalar(t,i){return this.x=Math.max(t,Math.min(i,this.x)),this.y=Math.max(t,Math.min(i,this.y)),this.z=Math.max(t,Math.min(i,this.z)),this}clampLength(t,i){let r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(t,Math.min(i,r)))}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}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.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(t){return this.normalize().multiplyScalar(t)}lerp(t,i){return this.x+=(t.x-this.x)*i,this.y+=(t.y-this.y)*i,this.z+=(t.z-this.z)*i,this}lerpVectors(t,i,r){return this.x=t.x+(i.x-t.x)*r,this.y=t.y+(i.y-t.y)*r,this.z=t.z+(i.z-t.z)*r,this}cross(t){return this.crossVectors(this,t)}crossVectors(t,i){let r=t.x,n=t.y,a=t.z,s=i.x,o=i.y,l=i.z;return this.x=n*l-a*o,this.y=a*s-r*l,this.z=r*o-n*s,this}projectOnVector(t){let i=t.lengthSq();if(i===0)return this.set(0,0,0);let r=t.dot(this)/i;return this.copy(t).multiplyScalar(r)}projectOnPlane(t){return PB.copy(this).projectOnVector(t),this.sub(PB)}reflect(t){return this.sub(PB.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){let i=Math.sqrt(this.lengthSq()*t.lengthSq());if(i===0)return Math.PI/2;let r=this.dot(t)/i;return Math.acos(Dn(r,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){let i=this.x-t.x,r=this.y-t.y,n=this.z-t.z;return i*i+r*r+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,i,r){let n=Math.sin(i)*t;return this.x=n*Math.sin(r),this.y=Math.cos(i)*t,this.z=n*Math.cos(r),this}setFromCylindrical(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,i,r){return this.x=t*Math.sin(i),this.y=r,this.z=t*Math.cos(i),this}setFromMatrixPosition(t){let i=t.elements;return this.x=i[12],this.y=i[13],this.z=i[14],this}setFromMatrixScale(t){let i=this.setFromMatrixColumn(t,0).length(),r=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=i,this.y=r,this.z=n,this}setFromMatrixColumn(t,i){return this.fromArray(t.elements,i*4)}setFromMatrix3Column(t,i){return this.fromArray(t.elements,i*3)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,i=0){return this.x=t[i],this.y=t[i+1],this.z=t[i+2],this}toArray(t=[],i=0){return t[i]=this.x,t[i+1]=this.y,t[i+2]=this.z,t}fromBufferAttribute(t,i){return this.x=t.getX(i),this.y=t.getY(i),this.z=t.getZ(i),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let t=(Math.random()-.5)*2,i=Math.random()*Math.PI*2,r=Math.sqrt(1-t**2);return this.x=r*Math.cos(i),this.y=r*Math.sin(i),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},PB=new O,W5=new ri,Sn=class{constructor(t=new O(1/0,1/0,1/0),i=new O(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromArray(t){let i=1/0,r=1/0,n=1/0,a=-1/0,s=-1/0,o=-1/0;for(let l=0,c=t.length;l<c;l+=3){let h=t[l],u=t[l+1],d=t[l+2];h<i&&(i=h),u<r&&(r=u),d<n&&(n=d),h>a&&(a=h),u>s&&(s=u),d>o&&(o=d)}return this.min.set(i,r,n),this.max.set(a,s,o),this}setFromBufferAttribute(t){let i=1/0,r=1/0,n=1/0,a=-1/0,s=-1/0,o=-1/0;for(let l=0,c=t.count;l<c;l++){let h=t.getX(l),u=t.getY(l),d=t.getZ(l);h<i&&(i=h),u<r&&(r=u),d<n&&(n=d),h>a&&(a=h),u>s&&(s=u),d>o&&(o=d)}return this.min.set(i,r,n),this.max.set(a,s,o),this}setFromPoints(t){this.makeEmpty();for(let i=0,r=t.length;i<r;i++)this.expandByPoint(t[i]);return this}setFromCenterAndSize(t,i){let r=rf.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}setFromObject(t,i=!1){return this.makeEmpty(),this.expandByObject(t,i)}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.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(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,i=!1){t.updateWorldMatrix(!1,!1);let r=t.geometry;if(r!==void 0)if(i&&r.attributes!=null&&r.attributes.position!==void 0){let a=r.attributes.position;for(let s=0,o=a.count;s<o;s++)rf.fromBufferAttribute(a,s).applyMatrix4(t.matrixWorld),this.expandByPoint(rf)}else r.boundingBox===null&&r.computeBoundingBox(),LB.copy(r.boundingBox),LB.applyMatrix4(t.matrixWorld),this.union(LB);let n=t.children;for(let a=0,s=n.length;a<s;a++)this.expandByObject(n[a],i);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,rf),rf.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let i,r;return t.normal.x>0?(i=t.normal.x*this.min.x,r=t.normal.x*this.max.x):(i=t.normal.x*this.max.x,r=t.normal.x*this.min.x),t.normal.y>0?(i+=t.normal.y*this.min.y,r+=t.normal.y*this.max.y):(i+=t.normal.y*this.max.y,r+=t.normal.y*this.min.y),t.normal.z>0?(i+=t.normal.z*this.min.z,r+=t.normal.z*this.max.z):(i+=t.normal.z*this.max.z,r+=t.normal.z*this.min.z),i<=-t.constant&&r>=-t.constant}intersectsTriangle(t){if(this.isEmpty())return!1;this.getCenter(Tv),Nw.subVectors(this.max,Tv),fm.subVectors(t.a,Tv),pm.subVectors(t.b,Tv),mm.subVectors(t.c,Tv),ud.subVectors(pm,fm),dd.subVectors(mm,pm),nf.subVectors(fm,mm);let i=[0,-ud.z,ud.y,0,-dd.z,dd.y,0,-nf.z,nf.y,ud.z,0,-ud.x,dd.z,0,-dd.x,nf.z,0,-nf.x,-ud.y,ud.x,0,-dd.y,dd.x,0,-nf.y,nf.x,0];return!OB(i,fm,pm,mm,Nw)||(i=[1,0,0,0,1,0,0,0,1],!OB(i,fm,pm,mm,Nw))?!1:(Uw.crossVectors(ud,dd),i=[Uw.x,Uw.y,Uw.z],OB(i,fm,pm,mm,Nw))}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return rf.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=this.getSize(rf).length()*.5,t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()?this:(Uh[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Uh[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Uh[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Uh[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Uh[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Uh[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Uh[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Uh[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Uh),this)}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},Uh=[new O,new O,new O,new O,new O,new O,new O,new O],rf=new O,LB=new Sn,fm=new O,pm=new O,mm=new O,ud=new O,dd=new O,nf=new O,Tv=new O,Nw=new O,Uw=new O,af=new O;function OB(t,i,r,n,a){for(let s=0,o=t.length-3;s<=o;s+=3){af.fromArray(t,s);let l=a.x*Math.abs(af.x)+a.y*Math.abs(af.y)+a.z*Math.abs(af.z),c=i.dot(af),h=r.dot(af),u=n.dot(af);if(Math.max(-Math.max(c,h,u),Math.min(c,h,u))>l)return!1}return!0}var ppe=new Sn,Mv=new O,NB=new O,ho=class{constructor(t=new O,i=-1){this.center=t,this.radius=i}set(t,i){return this.center.copy(t),this.radius=i,this}setFromPoints(t,i){let r=this.center;i!==void 0?r.copy(i):ppe.setFromPoints(t).getCenter(r);let n=0;for(let a=0,s=t.length;a<s;a++)n=Math.max(n,r.distanceToSquared(t[a]));return this.radius=Math.sqrt(n),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){let i=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=i*i}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,i){let r=this.center.distanceToSquared(t);return i.copy(t),r>this.radius*this.radius&&(i.sub(this.center).normalize(),i.multiplyScalar(this.radius).add(this.center)),i}getBoundingBox(t){return this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}
vendor: 4,132 bytes, line 4578
4578applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}expandByPoint(t){if(this.isEmpty())return this.center.copy(t),this.radius=0,this;Mv.subVectors(t,this.center);let i=Mv.lengthSq();if(i>this.radius*this.radius){let r=Math.sqrt(i),n=(r-this.radius)*.5;this.center.addScaledVector(Mv,n/r),this.radius+=n}return this}union(t){return t.isEmpty()?this:this.isEmpty()?(this.copy(t),this):(this.center.equals(t.center)===!0?this.radius=Math.max(this.radius,t.radius):(NB.subVectors(t.center,this.center).setLength(t.radius),this.expandByPoint(Mv.copy(t.center).add(NB)),this.expandByPoint(Mv.copy(t.center).sub(NB))),this)}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return new this.constructor().copy(this)}},Fh=new O,UB=new O,Fw=new O,Ad=new O,FB=new O,kw=new O,kB=new O,L0=class{constructor(t=new O,i=new O(0,0,-1)){this.origin=t,this.direction=i}set(t,i){return this.origin.copy(t),this.direction.copy(i),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,i){return i.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,Fh)),this}closestPointToPoint(t,i){i.subVectors(t,this.origin);let r=i.dot(this.direction);return r<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){let i=Fh.subVectors(t,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(t):(Fh.copy(this.direction).multiplyScalar(i).add(this.origin),Fh.distanceToSquared(t))}distanceSqToSegment(t,i,r,n){UB.copy(t).add(i).multiplyScalar(.5),Fw.copy(i).sub(t).normalize(),Ad.copy(this.origin).sub(UB);let a=t.distanceTo(i)*.5,s=-this.direction.dot(Fw),o=Ad.dot(this.direction),l=-Ad.dot(Fw),c=Ad.lengthSq(),h=Math.abs(1-s*s),u,d,A,f;if(h>0)if(u=s*l-o,d=s*o-l,f=a*h,u>=0)if(d>=-f)if(d<=f){let m=1/h;u*=m,d*=m,A=u*(u+s*d+2*o)+d*(s*u+d+2*l)+c}else d=a,u=Math.max(0,-(s*d+o)),A=-u*u+d*(d+2*l)+c;else d=-a,u=Math.max(0,-(s*d+o)),A=-u*u+d*(d+2*l)+c;else d<=-f?(u=Math.max(0,-(-s*a+o)),d=u>0?-a:Math.min(Math.max(-a,-l),a),A=-u*u+d*(d+2*l)+c):d<=f?(u=0,d=Math.min(Math.max(-a,-l),a),A=d*(d+2*l)+c):(u=Math.max(0,-(s*a+o)),d=u>0?a:Math.min(Math.max(-a,-l),a),A=-u*u+d*(d+2*l)+c);else d=s>0?-a:a,u=Math.max(0,-(s*d+o)),A=-u*u+d*(d+2*l)+c;return r&&r.copy(this.direction).multiplyScalar(u).add(this.origin),n&&n.copy(Fw).multiplyScalar(d).add(UB),A}intersectSphere(t,i){Fh.subVectors(t.center,this.origin);let r=Fh.dot(this.direction),n=Fh.dot(Fh)-r*r,a=t.radius*t.radius;if(n>a)return null;let s=Math.sqrt(a-n),o=r-s,l=r+s;return o<0&&l<0?null:o<0?this.at(l,i):this.at(o,i)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){let i=t.normal.dot(this.direction);if(i===0)return t.distanceToPoint(this.origin)===0?0:null;let r=-(this.origin.dot(t.normal)+t.constant)/i;return r>=0?r:null}intersectPlane(t,i){let r=this.distanceToPlane(t);return r===null?null:this.at(r,i)}intersectsPlane(t){let i=t.distanceToPoint(this.origin);return i===0||t.normal.dot(this.direction)*i<0}intersectBox(t,i){let r,n,a,s,o,l,c=1/this.direction.x,h=1/this.direction.y,u=1/this.direction.z,d=this.origin;return c>=0?(r=(t.min.x-d.x)*c,n=(t.max.x-d.x)*c):(r=(t.max.x-d.x)*c,n=(t.min.x-d.x)*c),h>=0?(a=(t.min.y-d.y)*h,s=(t.max.y-d.y)*h):(a=(t.max.y-d.y)*h,s=(t.min.y-d.y)*h),r>s||a>n||((a>r||isNaN(r))&&(r=a),(s<n||isNaN(n))&&(n=s),u>=0?(o=(t.min.z-d.z)*u,l=(t.max.z-d.z)*u):(o=(t.max.z-d.z)*u,l=(t.min.z-d.z)*u),r>l||o>n)||((o>r||r!==r)&&(r=o),(l<n||n!==n)&&(n=l),n<0)?null:this.at(r>=0?r:n,i)}intersectsBox(t){return this.intersectBox(t,Fh)!==null}intersectTriangle(t,i,r,n,a){FB.subVectors(i,t),kw.subVectors(r,t),kB.crossVectors(FB,kw);let s=this.direction.dot(kB),o;if(s>0){if(n)return null;o=1}else if(s<0)o=-1,s=-s;else return null;Ad.subVectors(this.origin,t);let l=o*this.direction.dot(kw.crossVectors(Ad,kw));if(l<0)return null;
vendor: 14,915 bytes, line 4578
4578let c=o*this.direction.dot(FB.cross(Ad));if(c<0||l+c>s)return null;let h=-o*Ad.dot(kB);return h<0?null:this.at(h/s,a)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}},ht=class{constructor(){ht.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,i,r,n,a,s,o,l,c,h,u,d,A,f,m,g){let p=this.elements;return p[0]=t,p[4]=i,p[8]=r,p[12]=n,p[1]=a,p[5]=s,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=u,p[14]=d,p[3]=A,p[7]=f,p[11]=m,p[15]=g,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 ht().fromArray(this.elements)}copy(t){let i=this.elements,r=t.elements;return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this}copyPosition(t){let i=this.elements,r=t.elements;return i[12]=r[12],i[13]=r[13],i[14]=r[14],this}setFromMatrix3(t){let i=t.elements;return this.set(i[0],i[3],i[6],0,i[1],i[4],i[7],0,i[2],i[5],i[8],0,0,0,0,1),this}extractBasis(t,i,r){return t.setFromMatrixColumn(this,0),i.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this}makeBasis(t,i,r){return this.set(t.x,i.x,r.x,0,t.y,i.y,r.y,0,t.z,i.z,r.z,0,0,0,0,1),this}extractRotation(t){let i=this.elements,r=t.elements,n=1/gm.setFromMatrixColumn(t,0).length(),a=1/gm.setFromMatrixColumn(t,1).length(),s=1/gm.setFromMatrixColumn(t,2).length();return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i[3]=0,i[4]=r[4]*a,i[5]=r[5]*a,i[6]=r[6]*a,i[7]=0,i[8]=r[8]*s,i[9]=r[9]*s,i[10]=r[10]*s,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromEuler(t){let i=this.elements,r=t.x,n=t.y,a=t.z,s=Math.cos(r),o=Math.sin(r),l=Math.cos(n),c=Math.sin(n),h=Math.cos(a),u=Math.sin(a);if(t.order==="XYZ"){let d=s*h,A=s*u,f=o*h,m=o*u;i[0]=l*h,i[4]=-l*u,i[8]=c,i[1]=A+f*c,i[5]=d-m*c,i[9]=-o*l,i[2]=m-d*c,i[6]=f+A*c,i[10]=s*l}else if(t.order==="YXZ"){let d=l*h,A=l*u,f=c*h,m=c*u;i[0]=d+m*o,i[4]=f*o-A,i[8]=s*c,i[1]=s*u,i[5]=s*h,i[9]=-o,i[2]=A*o-f,i[6]=m+d*o,i[10]=s*l}else if(t.order==="ZXY"){let d=l*h,A=l*u,f=c*h,m=c*u;i[0]=d-m*o,i[4]=-s*u,i[8]=f+A*o,i[1]=A+f*o,i[5]=s*h,i[9]=m-d*o,i[2]=-s*c,i[6]=o,i[10]=s*l}else if(t.order==="ZYX"){let d=s*h,A=s*u,f=o*h,m=o*u;i[0]=l*h,i[4]=f*c-A,i[8]=d*c+m,i[1]=l*u,i[5]=m*c+d,i[9]=A*c-f,i[2]=-c,i[6]=o*l,i[10]=s*l}else if(t.order==="YZX"){let d=s*l,A=s*c,f=o*l,m=o*c;i[0]=l*h,i[4]=m-d*u,i[8]=f*u+A,i[1]=u,i[5]=s*h,i[9]=-o*h,i[2]=-c*h,i[6]=A*u+f,i[10]=d-m*u}else if(t.order==="XZY"){let d=s*l,A=s*c,f=o*l,m=o*c;i[0]=l*h,i[4]=-u,i[8]=c*h,i[1]=d*u+m,i[5]=s*h,i[9]=A*u-f,i[2]=f*u-A,i[6]=o*h,i[10]=m*u+d}return i[3]=0,i[7]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,this}makeRotationFromQuaternion(t){return this.compose(mpe,t,gpe)}lookAt(t,i,r){let n=this.elements;return wo.subVectors(t,i),wo.lengthSq()===0&&(wo.z=1),wo.normalize(),fd.crossVectors(r,wo),fd.lengthSq()===0&&(Math.abs(r.z)===1?wo.x+=1e-4:wo.z+=1e-4,wo.normalize(),fd.crossVectors(r,wo)),fd.normalize(),Hw.crossVectors(wo,fd),n[0]=fd.x,n[4]=Hw.x,n[8]=wo.x,n[1]=fd.y,n[5]=Hw.y,n[9]=wo.y,n[2]=fd.z,n[6]=Hw.z,n[10]=wo.z,this}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,i){let r=t.elements,n=i.elements,a=this.elements,s=r[0],o=r[4],l=r[8],c=r[12],h=r[1],u=r[5],d=r[9],A=r[13],f=r[2],m=r[6],g=r[10],p=r[14],v=r[3],_=r[7],y=r[11],w=r[15],b=n[0],E=n[4],M=n[8],S=n[12],T=n[1],C=n[5],x=n[9],R=n[13],L=n[2],I=n[6],F=n[10],Y=n[14],D=n[3],U=n[7],j=n[11],J=n[15];return a[0]=s*b+o*T+l*L+c*D,a[4]=s*E+o*C+l*I+c*U,a[8]=s*M+o*x+l*F+c*j,a[12]=s*S+o*R+l*Y+c*J,a[1]=h*b+u*T+d*L+A*D,a[5]=h*E+u*C+d*I+A*U,a[9]=h*M+u*x+d*F+A*j,a[13]=h*S+u*R+d*Y+A*J,a[2]=f*b+m*T+g*L+p*D,a[6]=f*E+m*C+g*I+p*U,a[10]=f*M+m*x+g*F+p*j,a[14]=f*S+m*R+g*Y+p*J,a[3]=v*b+_*T+y*L+w*D,a[7]=v*E+_*C+y*I+w*U,a[11]=v*M+_*x+y*F+w*j,a[15]=v*S+_*R+y*Y+w*J,this}multiplyScalar(t){let i=this.elements;return i[0]*=t,i[4]*=t,i[8]*=t,i[12]*=t,i[1]*=t,i[5]*=t,i[9]*=t,i[13]*=t,i[2]*=t,i[6]*=t,i[10]*=t,i[14]*=t,i[3]*=t,i[7]*=t,i[11]*=t,i[15]*=t,this}determinant(){let t=this.elements,i=t[0],r=t[4],n=t[8],a=t[12],s=t[1],o=t[5],l=t[9],c=t[13],h=t[2],u=t[6],d=t[10],A=t[14],f=t[3],m=t[7],g=t[11],p=t[15];return f*(+a*l*u-n*c*u-a*o*d+r*c*d+n*o*A-r*l*A)+m*(+i*l*A-i*c*d+a*s*d-n*s*A+n*c*h-a*l*h)+g*(+i*c*u-i*o*A-a*s*u+r*s*A+a*o*h-r*c*h)+p*(-n*o*h-i*l*u+i*o*d+n*s*u-r*s*d+r*l*h)}transpose(){let t=this.elements,i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,this}setPosition(t,i,r){let n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=i,n[14]=r),this}invert(){let t=this.elements,i=t[0],r=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],A=t[11],f=t[12],m=t[13],g=t[14],p=t[15],v=u*g*c-m*d*c+m*l*A-o*g*A-u*l*p+o*d*p,_=f*d*c-h*g*c-f*l*A+s*g*A+h*l*p-s*d*p,y=h*m*c-f*u*c+f*o*A-s*m*A-h*o*p+s*u*p,w=f*u*l-h*m*l-f*o*d+s*m*d+h*o*g-s*u*g,b=i*v+r*_+n*y+a*w;if(b===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let E=1/b;return t[0]=v*E,t[1]=(m*d*a-u*g*a-m*n*A+r*g*A+u*n*p-r*d*p)*E,t[2]=(o*g*a-m*l*a+m*n*c-r*g*c-o*n*p+r*l*p)*E,t[3]=(u*l*a-o*d*a-u*n*c+r*d*c+o*n*A-r*l*A)*E,t[4]=_*E,t[5]=(h*g*a-f*d*a+f*n*A-i*g*A-h*n*p+i*d*p)*E,t[6]=(f*l*a-s*g*a-f*n*c+i*g*c+s*n*p-i*l*p)*E,t[7]=(s*d*a-h*l*a+h*n*c-i*d*c-s*n*A+i*l*A)*E,t[8]=y*E,t[9]=(f*u*a-h*m*a-f*r*A+i*m*A+h*r*p-i*u*p)*E,t[10]=(s*m*a-f*o*a+f*r*c-i*m*c-s*r*p+i*o*p)*E,t[11]=(h*o*a-s*u*a-h*r*c+i*u*c+s*r*A-i*o*A)*E,t[12]=w*E,t[13]=(h*m*n-f*u*n+f*r*d-i*m*d-h*r*g+i*u*g)*E,t[14]=(f*o*n-s*m*n-f*r*l+i*m*l+s*r*g-i*o*g)*E,t[15]=(s*u*n-h*o*n+h*r*l-i*u*l-s*r*d+i*o*d)*E,this}scale(t){let i=this.elements,r=t.x,n=t.y,a=t.z;return i[0]*=r,i[4]*=n,i[8]*=a,i[1]*=r,i[5]*=n,i[9]*=a,i[2]*=r,i[6]*=n,i[10]*=a,i[3]*=r,i[7]*=n,i[11]*=a,this}getMaxScaleOnAxis(){let t=this.elements,i=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],r=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(i,r,n))}makeTranslation(t,i,r){return this.set(1,0,0,t,0,1,0,i,0,0,1,r,0,0,0,1),this}makeRotationX(t){let i=Math.cos(t),r=Math.sin(t);return this.set(1,0,0,0,0,i,-r,0,0,r,i,0,0,0,0,1),this}makeRotationY(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,0,r,0,0,1,0,0,-r,0,i,0,0,0,0,1),this}makeRotationZ(t){let i=Math.cos(t),r=Math.sin(t);return this.set(i,-r,0,0,r,i,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,i){let r=Math.cos(i),n=Math.sin(i),a=1-r,s=t.x,o=t.y,l=t.z,c=a*s,h=a*o;return this.set(c*s+r,c*o-n*l,c*l+n*o,0,c*o+n*l,h*o+r,h*l-n*s,0,c*l-n*o,h*l+n*s,a*l*l+r,0,0,0,0,1),this}makeScale(t,i,r){return this.set(t,0,0,0,0,i,0,0,0,0,r,0,0,0,0,1),this}makeShear(t,i,r,n,a,s){return this.set(1,r,a,0,t,1,s,0,i,n,1,0,0,0,0,1),this}compose(t,i,r){let n=this.elements,a=i._x,s=i._y,o=i._z,l=i._w,c=a+a,h=s+s,u=o+o,d=a*c,A=a*h,f=a*u,m=s*h,g=s*u,p=o*u,v=l*c,_=l*h,y=l*u,w=r.x,b=r.y,E=r.z;return n[0]=(1-(m+p))*w,n[1]=(A+y)*w,n[2]=(f-_)*w,n[3]=0,n[4]=(A-y)*b,n[5]=(1-(d+p))*b,n[6]=(g+v)*b,n[7]=0,n[8]=(f+_)*E,n[9]=(g-v)*E,n[10]=(1-(d+m))*E,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,i,r){let n=this.elements,a=gm.set(n[0],n[1],n[2]).length(),s=gm.set(n[4],n[5],n[6]).length(),o=gm.set(n[8],n[9],n[10]).length();this.determinant()<0&&(a=-a),t.x=n[12],t.y=n[13],t.z=n[14],Hl.copy(this);let l=1/a,c=1/s,h=1/o;return Hl.elements[0]*=l,Hl.elements[1]*=l,Hl.elements[2]*=l,Hl.elements[4]*=c,Hl.elements[5]*=c,Hl.elements[6]*=c,Hl.elements[8]*=h,Hl.elements[9]*=h,Hl.elements[10]*=h,i.setFromRotationMatrix(Hl),r.x=a,r.y=s,r.z=o,this}makePerspective(t,i,r,n,a,s){let o=this.elements,l=2*a/(i-t),c=2*a/(r-n),h=(i+t)/(i-t),u=(r+n)/(r-n),d=-(s+a)/(s-a),A=-2*s*a/(s-a);return o[0]=l,o[4]=0,o[8]=h,o[12]=0,o[1]=0,o[5]=c,o[9]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=d,o[14]=A,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,i,r,n,a,s){let o=this.elements,l=1/(i-t),c=1/(r-n),h=1/(s-a),u=(i+t)*l,d=(r+n)*c,A=(s+a)*h;return o[0]=2*l,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*c,o[9]=0,o[13]=-d,o[2]=0,o[6]=0,o[10]=-2*h,o[14]=-A,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){let i=this.elements,r=t.elements;for(let n=0;n<16;n++)if(i[n]!==r[n])return!1;return!0}fromArray(t,i=0){for(let r=0;r<16;r++)this.elements[r]=t[r+i];return this}toArray(t=[],i=0){let r=this.elements;return t[i]=r[0],t[i+1]=r[1],t[i+2]=r[2],t[i+3]=r[3],t[i+4]=r[4],t[i+5]=r[5],t[i+6]=r[6],t[i+7]=r[7],t[i+8]=r[8],t[i+9]=r[9],t[i+10]=r[10],t[i+11]=r[11],t[i+12]=r[12],t[i+13]=r[13],t[i+14]=r[14],t[i+15]=r[15],t}},gm=new O,Hl=new ht,mpe=new O(0,0,0),gpe=new O(1,1,1),fd=new O,Hw=new O,wo=new O,j5=new ht,Y5=new ri,qn=class{constructor(t=0,i=0,r=0,n=qn.DEFAULT_ORDER){this.isEuler=!0,this._x=t,this._y=i,this._z=r,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,i,r,n=this._order){return this._x=t,this._y=i,this._z=r,this._order=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,i=this._order,r=!0){let n=t.elements,a=n[0],s=n[4],o=n[8],l=n[1],c=n[5],h=n[9],u=n[2],d=n[6],A=n[10];switch(i){case"XYZ":this._y=Math.asin(Dn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,A),this._z=Math.atan2(-s,a)):(this._x=Math.atan2(d,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Dn(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,A),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-u,a),this._z=0);break;case"ZXY":this._x=Math.asin(Dn(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,A),this._z=Math.atan2(-s,c)):(this._y=0,this._z=Math.atan2(l,a));break;case"ZYX":this._y=Math.asin(-Dn(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,A),this._z=Math.atan2(l,a)):(this._x=0,this._z=Math.atan2(-s,c));break;case"YZX":this._z=Math.asin(Dn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-u,a)):(this._x=0,this._y=Math.atan2(o,A));break;case"XZY":this._z=Math.asin(-Dn(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(d,c),this._y=Math.atan2(o,a)):(this._x=Math.atan2(-h,A),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+i)}return this._order=i,r===!0&&this._onChangeCallback(),this}setFromQuaternion(t,i,r){return j5.makeRotationFromQuaternion(t),this.setFromRotationMatrix(j5,i,r)}setFromVector3(t,i=this._order){return this.set(t.x,t.y,t.z,i)}reorder(t){return Y5.setFromEuler(this),this.setFromQuaternion(Y5,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==void 0&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],i=0){return t[i]=this._x,t[i+1]=this._y,t[i+2]=this._z,t[i+3]=this._order,t}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}};qn.DEFAULT_ORDER="XYZ";var aN=class{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return(this.mask&t.mask)!==0}isEnabled(t){return(this.mask&(1<<t|0))!==0}},vpe=0,K5=new O,vm=new ri,kh=new ht,Gw=new O,xv=new O,_pe=new O,ype=new ri,X5=new O(1,0,0),q5=new O(0,1,0),Z5=new O(0,0,1),Epe={type:"added"},J5={type:"removed"},lr=class extends Ja{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:vpe++}),this.uuid=gl(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=lr.DEFAULT_UP.clone();let t=new O,i=new qn,r=new ri,n=new O(1,1,1);function a(){r.setFromEuler(i,!1)}function s(){i.setFromQuaternion(r,void 0,!1)}i._onChange(a),r._onChange(s),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:i},quaternion:{configurable:!0,enumerable:!0,value:r},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new ht},normalMatrix:{value:new Nn}}),this.matrix=new ht,this.matrixWorld=new ht,this.matrixAutoUpdate=lr.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.matrixWorldAutoUpdate=lr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.layers=new aN,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,i){this.quaternion.setFromAxisAngle(t,i)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,i){return vm.setFromAxisAngle(t,i),this.quaternion.multiply(vm),this}rotateOnWorldAxis(t,i){return vm.setFromAxisAngle(t,i),this.quaternion.premultiply(vm),this}rotateX(t){return this.rotateOnAxis(X5,t)}rotateY(t){return this.rotateOnAxis(q5,t)}rotateZ(t){return this.rotateOnAxis(Z5,t)}translateOnAxis(t,i){return K5.copy(t).applyQuaternion(this.quaternion),this.position.add(K5.multiplyScalar(i)),this}translateX(t){return this.translateOnAxis(X5,t)}translateY(t){return this.translateOnAxis(q5,t)}translateZ(t){return this.translateOnAxis(Z5,t)}localToWorld(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return this.updateWorldMatrix(!0,!1),t.applyMatrix4(kh.copy(this.matrixWorld).invert())}lookAt(t,i,r){t.isVector3?Gw.copy(t):Gw.set(t,i,r);let n=this.parent;this.updateWorldMatrix(!0,!1),xv.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?kh.lookAt(xv,Gw,this.up):kh.lookAt(Gw,xv,this.up),this.quaternion.setFromRotationMatrix(kh),n&&(kh.extractRotation(n.matrixWorld),vm.setFromRotationMatrix(kh),this.quaternion.premultiply(vm.invert()))}add(t){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(t.parent!==null&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(Epe)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)}remove(t){if(arguments.length>1){for(let r=0;r<arguments.length;r++)this.remove(arguments[r]);return this}let i=this.children.indexOf(t);
4578return i!==-1&&(t.parent=null,this.children.splice(i,1),t.dispatchEvent(J5)),this}removeFromParent(){let t=this.parent;return t!==null&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){let i=this.children[t];i.parent=null,i.dispatchEvent(J5)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),kh.copy(this.matrixWorld).invert(),t.parent!==null&&(t.parent.updateWorldMatrix(!0,!1),kh.multiply(t.parent.matrixWorld)),t.applyMatrix4(kh),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,i){if(this[t]===i)return this;for(let r=0,n=this.children.length;r<n;r++){let a=this.children[r].getObjectByProperty(t,i);if(a!==void 0)return a}}getObjectsByProperty(t,i){let r=[];this[t]===i&&r.push(this);for(let n=0,a=this.children.length;n<a;n++){let s=this.children[n].getObjectsByProperty(t,i);s.length>0&&(r=r.concat(s))}return r}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(xv,t,_pe),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(xv,ype,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld.elements;return t.set(i[8],i[9],i[10]).normalize()}raycast(){}traverse(t){t(this);let i=this.children;for(let r=0,n=i.length;r<n;r++)i[r].traverse(t)}traverseVisible(t){if(this.visible===!1)return;t(this);let i=this.children;for(let r=0,n=i.length;r<n;r++)i[r].traverseVisible(t)}traverseAncestors(t){let i=this.parent;i!==null&&(t(i),i.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);let i=this.children;for(let r=0,n=i.length;r<n;r++){let a=i[r];(a.matrixWorldAutoUpdate===!0||t===!0)&&a.updateMatrixWorld(t)}}updateWorldMatrix(t,i){let r=this.parent;if(t===!0&&r!==null&&r.matrixWorldAutoUpdate===!0&&r.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),i===!0){let n=this.children;for(let a=0,s=n.length;a<s;a++){let o=n[a];o.matrixWorldAutoUpdate===!0&&o.updateWorldMatrix(!1,!0)}}}toJSON(t){let i=t===void 0||typeof t=="string",r={};i&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},r.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});let n={};
vendor: 17,653 bytes, line 4578
4578n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.castShadow===!0&&(n.castShadow=!0),this.receiveShadow===!0&&(n.receiveShadow=!0),this.visible===!1&&(n.visible=!1),this.frustumCulled===!1&&(n.frustumCulled=!1),this.renderOrder!==0&&(n.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),this.matrixAutoUpdate===!1&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(n.instanceColor=this.instanceColor.toJSON()));function a(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(t)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=a(t.geometries,this.geometry);let o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){let l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){let u=l[c];a(t.shapes,u)}else a(t.shapes,l)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){let o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(a(t.materials,this.material[l]));n.material=o}else n.material=a(t.materials,this.material);if(this.children.length>0){n.children=[];for(let o=0;o<this.children.length;o++)n.children.push(this.children[o].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let o=0;o<this.animations.length;o++){let l=this.animations[o];n.animations.push(a(t.animations,l))}}if(i){let o=s(t.geometries),l=s(t.materials),c=s(t.textures),h=s(t.images),u=s(t.shapes),d=s(t.skeletons),A=s(t.animations),f=s(t.nodes);o.length>0&&(r.geometries=o),l.length>0&&(r.materials=l),c.length>0&&(r.textures=c),h.length>0&&(r.images=h),u.length>0&&(r.shapes=u),d.length>0&&(r.skeletons=d),A.length>0&&(r.animations=A),f.length>0&&(r.nodes=f)}return r.object=n,r;function s(o){let l=[];for(let c in o){let h=o[c];delete h.metadata,l.push(h)}return l}}clone(t){return new this.constructor().copy(this,t)}copy(t,i=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=t.matrixWorldAutoUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),i===!0)for(let r=0;r<t.children.length;r++){let n=t.children[r];this.add(n.clone())}return this}};lr.DEFAULT_UP=new O(0,1,0);lr.DEFAULT_MATRIX_AUTO_UPDATE=!0;lr.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;var Gl=new O,Hh=new O,HB=new O,Gh=new O,_m=new O,ym=new O,$5=new O,GB=new O,zB=new O,QB=new O,za=class{constructor(t=new O,i=new O,r=new O){this.a=t,this.b=i,this.c=r}static getNormal(t,i,r,n){n.subVectors(r,i),Gl.subVectors(t,i),n.cross(Gl);let a=n.lengthSq();return a>0?n.multiplyScalar(1/Math.sqrt(a)):n.set(0,0,0)}static getBarycoord(t,i,r,n,a){Gl.subVectors(n,i),Hh.subVectors(r,i),HB.subVectors(t,i);let s=Gl.dot(Gl),o=Gl.dot(Hh),l=Gl.dot(HB),c=Hh.dot(Hh),h=Hh.dot(HB),u=s*c-o*o;if(u===0)return a.set(-2,-1,-1);let d=1/u,A=(c*l-o*h)*d,f=(s*h-o*l)*d;return a.set(1-A-f,f,A)}static containsPoint(t,i,r,n){return this.getBarycoord(t,i,r,n,Gh),Gh.x>=0&&Gh.y>=0&&Gh.x+Gh.y<=1}static getUV(t,i,r,n,a,s,o,l){return this.getBarycoord(t,i,r,n,Gh),l.set(0,0),l.addScaledVector(a,Gh.x),l.addScaledVector(s,Gh.y),l.addScaledVector(o,Gh.z),l}static isFrontFacing(t,i,r,n){return Gl.subVectors(r,i),Hh.subVectors(t,i),Gl.cross(Hh).dot(n)<0}set(t,i,r){return this.a.copy(t),this.b.copy(i),this.c.copy(r),this}setFromPointsAndIndices(t,i,r,n){return this.a.copy(t[i]),this.b.copy(t[r]),this.c.copy(t[n]),this}setFromAttributeAndIndices(t,i,r,n){return this.a.fromBufferAttribute(t,i),this.b.fromBufferAttribute(t,r),this.c.fromBufferAttribute(t,n),this}clone(){return new this.constructor().copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return Gl.subVectors(this.c,this.b),Hh.subVectors(this.a,this.b),Gl.cross(Hh).length()*.5}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return za.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,i){return za.getBarycoord(t,this.a,this.b,this.c,i)}getUV(t,i,r,n,a){return za.getUV(t,this.a,this.b,this.c,i,r,n,a)}containsPoint(t){return za.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return za.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,i){let r=this.a,n=this.b,a=this.c,s,o;_m.subVectors(n,r),ym.subVectors(a,r),GB.subVectors(t,r);let l=_m.dot(GB),c=ym.dot(GB);if(l<=0&&c<=0)return i.copy(r);zB.subVectors(t,n);let h=_m.dot(zB),u=ym.dot(zB);if(h>=0&&u<=h)return i.copy(n);let d=l*u-h*c;if(d<=0&&l>=0&&h<=0)return s=l/(l-h),i.copy(r).addScaledVector(_m,s);QB.subVectors(t,a);let A=_m.dot(QB),f=ym.dot(QB);if(f>=0&&A<=f)return i.copy(a);let m=A*c-l*f;if(m<=0&&c>=0&&f<=0)return o=c/(c-f),i.copy(r).addScaledVector(ym,o);let g=h*f-A*u;if(g<=0&&u-h>=0&&A-f>=0)return $5.subVectors(a,n),o=(u-h)/(u-h+(A-f)),i.copy(n).addScaledVector($5,o);let p=1/(g+m+d);return s=m*p,o=d*p,i.copy(r).addScaledVector(_m,s).addScaledVector(ym,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}},wpe=0,wE=class extends Ja{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:wpe++}),this.uuid=gl(),this.name="",this.type="Material",this.blending=Jf,this.side=pc,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=f7,this.blendDst=p7,this.blendEquation=$m,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=iP,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=qfe,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=xB,this.stencilZFail=xB,this.stencilZPass=xB,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.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(t!==void 0)for(let i in t){let r=t[i];if(r===void 0){console.warn("THREE.Material: '"+i+"' parameter is undefined.");continue}let n=this[i];if(n===void 0){console.warn("THREE."+this.type+": '"+i+"' is not a property of this material.");continue}n&&n.isColor?n.set(r):n&&n.isVector3&&r&&r.isVector3?n.copy(r):this[i]=r}}toJSON(t){let i=t===void 0||typeof t=="string";i&&(t={textures:{},images:{}});let r={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};r.uuid=this.uuid,r.type=this.type,this.name!==""&&(r.name=this.name),this.color&&this.color.isColor&&(r.color=this.color.getHex()),this.roughness!==void 0&&(r.roughness=this.roughness),this.metalness!==void 0&&(r.metalness=this.metalness),this.sheen!==void 0&&(r.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(r.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(r.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(r.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(r.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(r.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(r.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(r.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(r.shininess=this.shininess),this.clearcoat!==void 0&&(r.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(r.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(r.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(r.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(r.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,r.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(r.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(r.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(r.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(r.iridescenceMap=this.iridescenceMap.toJSON(t).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(r.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(t).uuid),this.map&&this.map.isTexture&&(r.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(r.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(r.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(r.lightMap=this.lightMap.toJSON(t).uuid,r.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(r.aoMap=this.aoMap.toJSON(t).uuid,r.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(r.bumpMap=this.bumpMap.toJSON(t).uuid,r.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(r.normalMap=this.normalMap.toJSON(t).uuid,r.normalMapType=this.normalMapType,r.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(r.displacementMap=this.displacementMap.toJSON(t).uuid,r.displacementScale=this.displacementScale,r.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(r.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(r.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(r.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(r.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(r.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(r.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(r.envMap=this.envMap.toJSON(t).uuid,this.combine!==void 0&&(r.combine=this.combine)),this.envMapIntensity!==void 0&&(r.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(r.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(r.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(r.gradientMap=this.gradientMap.toJSON(t).uuid),this.transmission!==void 0&&(r.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(r.transmissionMap=this.transmissionMap.toJSON(t).uuid),this.thickness!==void 0&&(r.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(r.thicknessMap=this.thicknessMap.toJSON(t).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(r.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(r.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(r.size=this.size),this.shadowSide!==null&&(r.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(r.sizeAttenuation=this.sizeAttenuation),this.blending!==Jf&&(r.blending=this.blending),this.side!==pc&&(r.side=this.side),this.vertexColors&&(r.vertexColors=!0),this.opacity<1&&(r.opacity=this.opacity),this.transparent===!0&&(r.transparent=this.transparent),r.depthFunc=this.depthFunc,r.depthTest=this.depthTest,r.depthWrite=this.depthWrite,r.colorWrite=this.colorWrite,r.stencilWrite=this.stencilWrite,r.stencilWriteMask=this.stencilWriteMask,r.stencilFunc=this.stencilFunc,r.stencilRef=this.stencilRef,r.stencilFuncMask=this.stencilFuncMask,r.stencilFail=this.stencilFail,r.stencilZFail=this.stencilZFail,r.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(r.rotation=this.rotation),this.polygonOffset===!0&&(r.polygonOffset=!0),this.polygonOffsetFactor!==0&&(r.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(r.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(r.linewidth=this.linewidth),this.dashSize!==void 0&&(r.dashSize=this.dashSize),this.gapSize!==void 0&&(r.gapSize=this.gapSize),this.scale!==void 0&&(r.scale=this.scale),this.dithering===!0&&(r.dithering=!0),this.alphaTest>0&&(r.alphaTest=this.alphaTest),this.alphaToCoverage===!0&&(r.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(r.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(r.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(r.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(r.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(r.flatShading=this.flatShading),this.visible===!1&&(r.visible=!1),this.toneMapped===!1&&(r.toneMapped=!1),this.fog===!1&&(r.fog=!1),Object.keys(this.userData).length>0&&(r.userData=this.userData);function n(a){let s=[];for(let o in a){let l=a[o];delete l.metadata,s.push(l)}return s}if(i){let a=n(t.textures),s=n(t.images);a.length>0&&(r.textures=a),s.length>0&&(r.images=s)}return r}clone(){return new this.constructor().copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;let i=t.clippingPlanes,r=null;if(i!==null){let n=i.length;r=new Array(n);for(let a=0;a!==n;++a)r[a]=i[a].clone()}return this.clippingPlanes=r,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.forceSinglePass=t.forceSinglePass,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){t===!0&&this.version++}},Gu=class extends wE{constructor(t){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Ht(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=m7,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}},xn=new O,zw=new Me,ei=class{constructor(t,i,r=!1){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=t,this.itemSize=i,this.count=t!==void 0?t.length/i:0,this.normalized=r,this.usage=sP,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this}copyAt(t,i,r){t*=this.itemSize,r*=i.itemSize;
vendor: 5,620 bytes, line 4578
4578for(let n=0,a=this.itemSize;n<a;n++)this.array[t+n]=i.array[r+n];return this}copyArray(t){return this.array.set(t),this}applyMatrix3(t){if(this.itemSize===2)for(let i=0,r=this.count;i<r;i++)zw.fromBufferAttribute(this,i),zw.applyMatrix3(t),this.setXY(i,zw.x,zw.y);else if(this.itemSize===3)for(let i=0,r=this.count;i<r;i++)xn.fromBufferAttribute(this,i),xn.applyMatrix3(t),this.setXYZ(i,xn.x,xn.y,xn.z);return this}applyMatrix4(t){for(let i=0,r=this.count;i<r;i++)xn.fromBufferAttribute(this,i),xn.applyMatrix4(t),this.setXYZ(i,xn.x,xn.y,xn.z);return this}applyNormalMatrix(t){for(let i=0,r=this.count;i<r;i++)xn.fromBufferAttribute(this,i),xn.applyNormalMatrix(t),this.setXYZ(i,xn.x,xn.y,xn.z);return this}transformDirection(t){for(let i=0,r=this.count;i<r;i++)xn.fromBufferAttribute(this,i),xn.transformDirection(t),this.setXYZ(i,xn.x,xn.y,xn.z);return this}set(t,i=0){return this.array.set(t,i),this}getX(t){let i=this.array[t*this.itemSize];return this.normalized&&(i=Cu(i,this.array)),i}setX(t,i){return this.normalized&&(i=Tr(i,this.array)),this.array[t*this.itemSize]=i,this}getY(t){let i=this.array[t*this.itemSize+1];return this.normalized&&(i=Cu(i,this.array)),i}setY(t,i){return this.normalized&&(i=Tr(i,this.array)),this.array[t*this.itemSize+1]=i,this}getZ(t){let i=this.array[t*this.itemSize+2];return this.normalized&&(i=Cu(i,this.array)),i}setZ(t,i){return this.normalized&&(i=Tr(i,this.array)),this.array[t*this.itemSize+2]=i,this}getW(t){let i=this.array[t*this.itemSize+3];return this.normalized&&(i=Cu(i,this.array)),i}setW(t,i){return this.normalized&&(i=Tr(i,this.array)),this.array[t*this.itemSize+3]=i,this}setXY(t,i,r){return t*=this.itemSize,this.normalized&&(i=Tr(i,this.array),r=Tr(r,this.array)),this.array[t+0]=i,this.array[t+1]=r,this}setXYZ(t,i,r,n){return t*=this.itemSize,this.normalized&&(i=Tr(i,this.array),r=Tr(r,this.array),n=Tr(n,this.array)),this.array[t+0]=i,this.array[t+1]=r,this.array[t+2]=n,this}setXYZW(t,i,r,n,a){return t*=this.itemSize,this.normalized&&(i=Tr(i,this.array),r=Tr(r,this.array),n=Tr(n,this.array),a=Tr(a,this.array)),this.array[t+0]=i,this.array[t+1]=r,this.array[t+2]=n,this.array[t+3]=a,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){let t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(t.name=this.name),this.usage!==sP&&(t.usage=this.usage),(this.updateRange.offset!==0||this.updateRange.count!==-1)&&(t.updateRange=this.updateRange),t}copyColorsArray(){console.error("THREE.BufferAttribute: copyColorsArray() was removed in r144.")}copyVector2sArray(){console.error("THREE.BufferAttribute: copyVector2sArray() was removed in r144.")}copyVector3sArray(){console.error("THREE.BufferAttribute: copyVector3sArray() was removed in r144.")}copyVector4sArray(){console.error("THREE.BufferAttribute: copyVector4sArray() was removed in r144.")}},R7=class extends ei{constructor(t,i,r){super(new Uint16Array(t),i,r)}},Rg=class extends ei{constructor(t,i,r){super(new Uint32Array(t),i,r)}},Et=class extends ei{constructor(t,i,r){super(new Float32Array(t),i,r)}},bpe=0,Go=new ht,VB=new lr,Em=new O,bo=new Sn,Rv=new Sn,aa=new O,Lt=class extends Ja{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:bpe++}),this.uuid=gl(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(S7(t)?Rg:R7)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,i){return this.attributes[t]=i,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return this.attributes[t]!==void 0}addGroup(t,i,r=0){this.groups.push({start:t,count:i,materialIndex:r})}clearGroups(){this.groups=[]}setDrawRange(t,i){this.drawRange.start=t,this.drawRange.count=i}applyMatrix4(t){let i=this.attributes.position;i!==void 0&&(i.applyMatrix4(t),i.needsUpdate=!0);let r=this.attributes.normal;if(r!==void 0){let a=new Nn().getNormalMatrix(t);r.applyNormalMatrix(a),r.needsUpdate=!0}let n=this.attributes.tangent;return n!==void 0&&(n.transformDirection(t),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(t){return Go.makeRotationFromQuaternion(t),this.applyMatrix4(Go),this}rotateX(t){return Go.makeRotationX(t),this.applyMatrix4(Go),this}rotateY(t){return Go.makeRotationY(t),this.applyMatrix4(Go),this}rotateZ(t){return Go.makeRotationZ(t),this.applyMatrix4(Go),this}translate(t,i,r){return Go.makeTranslation(t,i,r),this.applyMatrix4(Go),this}scale(t,i,r){return Go.makeScale(t,i,r),this.applyMatrix4(Go),this}lookAt(t){return VB.lookAt(t),VB.updateMatrix(),this.applyMatrix4(VB.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Em).negate(),this.translate(Em.x,Em.y,Em.z),this}setFromPoints(t){let i=[];for(let r=0,n=t.length;r<n;r++){let a=t[r];i.push(a.x,a.y,a.z||0)}return this.setAttribute("position",new Et(i,3)),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Sn);let t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "fal
4578se".',this),this.boundingBox.set(new O(-1/0,-1/0,-1/0),new O(1/0,1/0,1/0));return}if(t!==void 0){if(this.boundingBox.setFromBufferAttribute(t),i)for(let r=0,n=i.length;r<n;r++){let a=i[r];bo.setFromBufferAttribute(a),this.morphTargetsRelative?(aa.addVectors(this.boundingBox.min,bo.min),this.boundingBox.expandByPoint(aa),aa.addVectors(this.boundingBox.max,bo.max),this.boundingBox.expandByPoint(aa)):(this.boundingBox.expandByPoint(bo.min),this.boundingBox.expandByPoint(bo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ho);let t=this.attributes.position,i=this.morphAttributes.position;if(t&&t.isGLBufferAttribute){console.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "fal
4578se".',this),this.boundingSphere.set(new O,1/0);return}if(t){let r=this.boundingSphere.center;if(bo.setFromBufferAttribute(t),i)for(let a=0,s=i.length;a<s;a++){let o=i[a];Rv.setFromBufferAttribute(o),this.morphTargetsRelative?(aa.addVectors(bo.min,Rv.min),bo.expandByPoint(aa),aa.addVectors(bo.max,Rv.max),bo.expandByPoint(aa)):(bo.expandByPoint(Rv.min),bo.expandByPoint(Rv.max))}bo.getCenter(r);let n=0;for(let a=0,s=t.count;a<s;a++)aa.fromBufferAttribute(t,a),n=Math.max(n,r.distanceToSquared(aa));if(i)for(let a=0,s=i.length;a<s;a++){let o=i[a],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)aa.fromBufferAttribute(o,c),l&&(Em.fromBufferAttribute(t,c),aa.add(Em)),n=Math.max(n,r.distanceToSquared(aa))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){let t=this.index,i=this.attributes;if(t===null||i.position===void 0||i.normal===void 0||i.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}let r=t.array,n=i.position.array,a=i.normal.array,s=i.uv.array,o=n.length/3;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ei(new Float32Array(4*o),4));let l=this.getAttribute("tangent").array,c=[],h=[];for(let T=0;T<o;T++)c[T]=new O,h[T]=new O;let u=new O,d=new O,A=new O,f=new Me,m=new Me,g=new Me,p=new O,v=new O;function _(T,C,x){u.fromArray(n,T*3),d.fromArray(n,C*3),A.fromArray(n,x*3),f.fromArray(s,T*2),m.fromArray(s,C*2),g.fromArray(s,x*2),d.sub(u),A.sub(u),m.sub(f),g.sub(f);let R=1/(m.x*g.y-g.x*m.y);!isFinite(R)||(p.copy(d).multiplyScalar(g.y).addScaledVector(A,-m.y).multiplyScalar(R),v.copy(A).multiplyScalar(m.x).addScaledVector(d,-g.x).multiplyScalar(R),c[T].add(p),c[C].add(p),c[x].add(p),h[T].add(v),h[C].add(v),h[x].add(v))}let y=this.groups;y.length===0&&(y=[{start:0,count:r.length}]);for(let T=0,C=y.length;T<C;++T){let x=y[T],R=x.start,L=x.count;for(let I=R,F=R+L;I<F;I+=3)_(r[I+0],r[I+1],r[I+2])}let w=new O,b=new O,E=new O,M=new O;function S(T){E.fromArray(a,T*3),M.copy(E);let C=c[T];w.copy(C),w.sub(E.multiplyScalar(E.dot(C))).normalize(),b.crossVectors(M,C);let x=b.dot(h[T])<0?-1:1;l[T*4]=w.x,l[T*4+1]=w.y,l[T*4+2]=w.z,l[T*4+3]=x}for(let T=0,C=y.length;T<C;++T){let x=y[T],R=x.start,L=x.count;for(let I=R,F=R+L;I<F;I+=3)S(r[I+0]),S(r[I+1]),S(r[I+2])}}computeVertexNormals(){let t=this.index,i=this.getAttribute("position");if(i!==void 0){let r=this.getAttribute("normal");if(r===void 0)r=new ei(new Float32Array(i.count*3),3),this.setAttribute("normal",r);else for(let d=0,A=r.count;d<A;d++)r.setXYZ(d,0,0,0);let n=new O,a=new O,s=new O,o=new O,l=new O,c=new O,h=new O,u=new O;if(t)for(let d=0,A=t.count;d<A;d+=3){let f=t.getX(d+0),m=t.getX(d+1),g=t.getX(d+2);n.fromBufferAttribute(i,f),a.fromBufferAttribute(i,m),s.fromBufferAttribute(i,g),h.subVectors(s,a),u.subVectors(n,a),h.cross(u),o.fromBufferAttribute(r,f),l.fromBufferAttribute(r,m),c.fromBufferAttribute(r,g),o.add(h),l.add(h),c.add(h),r.setXYZ(f,o.x,o.y,o.z),r.setXYZ(m,l.x,l.y,l.z),r.setXYZ(g,c.x,c.y,c.z)}else for(let d=0,A=i.count;d<A;d+=3)n.fromBufferAttribute(i,d+0),a.fromBufferAttribute(i,d+1),s.fromBufferAttribute(i,d+2),h.subVectors(s,a),u.subVectors(n,a),h.cross(u),r.setXYZ(d+0,h.x,h.y,h.z),r.setXYZ(d+1,h.x,h.y,h.z),r.setXYZ(d+2,h.x,h.y,h.z);this.normalizeNormals(),r.needsUpdate=!0}}merge(){return console.error("THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeBufferGeometries() instead."),this}normalizeNormals(){let t=this.attributes.normal;for(let i=0,r=t.count;i<r;i++)aa.fromBufferAttribute(t,i),aa.normalize(),t.setXYZ(i,aa.x,aa.y,aa.z)}toNonIndexed(){function t(o,l){let c=o.array,h=o.itemSize,u=o.normalized,d=new c.constructor(l.length*h),A=0,f=0;for(let m=0,g=l.length;m<g;m++){o.isInterleavedBufferAttribute?A=l[m]*o.data.stride+o.offset:A=l[m]*h;for(let p=0;p<h;p++)d[f++]=c[A++]}return new ei(d,h,u)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;let i=new Lt,r=this.index.array,n=this.attributes;for(let o in n){let l=n[o],c=t(l,r);i.setAttribute(o,c)}let a=this.morphAttributes;for(let o in a){let l=[],c=a[o];for(let h=0,u=c.length;h<u;h++){let d=c[h],A=t(d,r);l.push(A)}i.morphAttributes[o]=l}i.morphTargetsRelative=this.morphTargetsRelative;let s=this.groups;for(let o=0,l=s.length;o<l;o++){let c=s[o];i.addGroup(c.start,c.count,c.materialIndex)}return i}toJSON(){let t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};
vendor: 7,339 bytes, lines 4578-4580
4578if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),this.parameters!==void 0){let l=this.parameters;for(let c in l)l[c]!==void 0&&(t[c]=l[c]);return t}t.data={attributes:{}};let i=this.index;i!==null&&(t.data.index={type:i.array.constructor.name,array:Array.prototype.slice.call(i.array)});let r=this.attributes;for(let l in r){let c=r[l];t.data.attributes[l]=c.toJSON(t.data)}let n={},a=!1;for(let l in this.morphAttributes){let c=this.morphAttributes[l],h=[];for(let u=0,d=c.length;u<d;u++){let A=c[u];h.push(A.toJSON(t.data))}h.length>0&&(n[l]=h,a=!0)}a&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);let s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));let o=this.boundingSphere;return o!==null&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t}clone(){return new this.constructor().copy(this)}copy(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;let i={};this.name=t.name;let r=t.index;r!==null&&this.setIndex(r.clone(i));let n=t.attributes;for(let c in n){let h=n[c];this.setAttribute(c,h.clone(i))}let a=t.morphAttributes;for(let c in a){let h=[],u=a[c];for(let d=0,A=u.length;d<A;d++)h.push(u[d].clone(i));this.morphAttributes[c]=h}this.morphTargetsRelative=t.morphTargetsRelative;let s=t.groups;for(let c=0,h=s.length;c<h;c++){let u=s[c];this.addGroup(u.start,u.count,u.materialIndex)}let o=t.boundingBox;o!==null&&(this.boundingBox=o.clone());let l=t.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,t.parameters!==void 0&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}},eG=new ht,wm=new L0,WB=new ho,Bv=new O,Iv=new O,Dv=new O,jB=new O,Qw=new O,Vw=new Me,Ww=new Me,jw=new Me,YB=new O,Yw=new O,Zr=class extends lr{constructor(t=new Lt,i=new Gu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=t,this.material=i,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),t.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),t.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,a=r.length;n<a;n++){let s=r[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=n}}}}getVertexPosition(t,i){let r=this.geometry,n=r.attributes.position,a=r.morphAttributes.position,s=r.morphTargetsRelative;i.fromBufferAttribute(n,t);let o=this.morphTargetInfluences;if(a&&o){Qw.set(0,0,0);for(let l=0,c=a.length;l<c;l++){let h=o[l],u=a[l];h!==0&&(jB.fromBufferAttribute(u,t),s?Qw.addScaledVector(jB,h):Qw.addScaledVector(jB.sub(i),h))}i.add(Qw)}return this.isSkinnedMesh&&this.boneTransform(t,i),i}raycast(t,i){let r=this.geometry,n=this.material,a=this.matrixWorld;if(n===void 0||(r.boundingSphere===null&&r.computeBoundingSphere(),WB.copy(r.boundingSphere),WB.applyMatrix4(a),t.ray.intersectsSphere(WB)===!1)||(eG.copy(a).invert(),wm.copy(t.ray).applyMatrix4(eG),r.boundingBox!==null&&wm.intersectsBox(r.boundingBox)===!1))return;let s,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv2,u=r.groups,d=r.drawRange;if(o!==null)if(Array.isArray(n))for(let A=0,f=u.length;A<f;A++){let m=u[A],g=n[m.materialIndex],p=Math.max(m.start,d.start),v=Math.min(o.count,Math.min(m.start+m.count,d.start+d.count));for(let _=p,y=v;_<y;_+=3){let w=o.getX(_),b=o.getX(_+1),E=o.getX(_+2);s=Kw(this,g,t,wm,c,h,w,b,E),s&&(s.faceIndex=Math.floor(_/3),s.face.materialIndex=m.materialIndex,i.push(s))}}else{let A=Math.max(0,d.start),f=Math.min(o.count,d.start+d.count);for(let m=A,g=f;m<g;m+=3){let p=o.getX(m),v=o.getX(m+1),_=o.getX(m+2);s=Kw(this,n,t,wm,c,h,p,v,_),s&&(s.faceIndex=Math.floor(m/3),i.push(s))}}else if(l!==void 0)if(Array.isArray(n))for(let A=0,f=u.length;A<f;A++){let m=u[A],g=n[m.materialIndex],p=Math.max(m.start,d.start),v=Math.min(l.count,Math.min(m.start+m.count,d.start+d.count));for(let _=p,y=v;_<y;_+=3){let w=_,b=_+1,E=_+2;s=Kw(this,g,t,wm,c,h,w,b,E),s&&(s.faceIndex=Math.floor(_/3),s.face.materialIndex=m.materialIndex,i.push(s))}}else{let A=Math.max(0,d.start),f=Math.min(l.count,d.start+d.count);for(let m=A,g=f;m<g;m+=3){let p=m,v=m+1,_=m+2;s=Kw(this,n,t,wm,c,h,p,v,_),s&&(s.faceIndex=Math.floor(m/3),i.push(s))}}}};function Spe(t,i,r,n,a,s,o,l){let c;if(i.side===Ea?c=n.intersectTriangle(o,s,a,!0,l):c=n.intersectTriangle(a,s,o,i.side===pc,l),c===null)return null;Yw.copy(l),Yw.applyMatrix4(t.matrixWorld);let h=r.ray.origin.distanceTo(Yw);return h<r.near||h>r.far?null:{distance:h,point:Yw.clone(),object:t}}function Kw(t,i,r,n,a,s,o,l,c){t.getVertexPosition(o,Bv),t.getVertexPosition(l,Iv),t.getVertexPosition(c,Dv);let h=Spe(t,i,r,n,Bv,Iv,Dv,YB);if(h){a&&(Vw.fromBufferAttribute(a,o),Ww.fromBufferAttribute(a,l),jw.fromBufferAttribute(a,c),h.uv=za.getUV(YB,Bv,Iv,Dv,Vw,Ww,jw,new Me)),s&&(Vw.fromBufferAttribute(s,o),Ww.fromBufferAttribute(s,l),jw.fromBufferAttribute(s,c),h.uv2=za.getUV(YB,Bv,Iv,Dv,Vw,Ww,jw,new Me));let u={a:o,b:l,c,normal:new O,materialIndex:0};za.getNormal(Bv,Iv,Dv,u.normal),h.face=u}return h}var gc=class extends Lt{constructor(t=1,i=1,r=1,n=1,a=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:i,depth:r,widthSegments:n,heightSegments:a,depthSegments:s};let o=this;n=Math.floor(n),a=Math.floor(a),s=Math.floor(s);let l=[],c=[],h=[],u=[],d=0,A=0;f("z","y","x",-1,-1,r,i,t,s,a,0),f("z","y","x",1,-1,r,i,-t,s,a,1),f("x","z","y",1,1,t,r,i,n,s,2),f("x","z","y",1,-1,t,r,-i,n,s,3),f("x","y","z",1,-1,t,i,r,n,a,4),f("x","y","z",-1,-1,t,i,-r,n,a,5),this.setIndex(l),this.setAttribute("position",new Et(c,3)),this.setAttribute("normal",new Et(h,3)),this.setAttribute("uv",new Et(u,2));function f(m,g,p,v,_,y,w,b,E,M,S){let T=y/E,C=w/M,x=y/2,R=w/2,L=b/2,I=E+1,F=M+1,Y=0,D=0,U=new O;for(let j=0;j<F;j++){let J=j*C-R;for(let z=0;z<I;z++){let $=z*T-x;U[m]=$*v,U[g]=J*_,U[p]=L,c.push(U.x,U.y,U.z),U[m]=0,U[g]=0,U[p]=b>0?1:-1,h.push(U.x,U.y,U.z),u.push(z/E),u.push(1-j/M),Y+=1}}for(let j=0;j<M;j++)for(let J=0;J<E;J++){let z=d+J+I*j,$=d+J+I*(j+1),te=d+(J+1)+I*(j+1),ae=d+(J+1)+I*j;l.push(z,$,ae),l.push($,te,ae),D+=6}o.addGroup(A,D,S),A+=D,d+=Y}}static fromJSON(t){return new gc(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}};function s0(t){let i={};for(let r in t){i[r]={};for(let n in t[r]){let a=t[r][n];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture||a.isQuaternion)?i[r][n]=a.clone():Array.isArray(a)?i[r][n]=a.slice():i[r][n]=a}}return i}function Ms(t){let i={};for(let r=0;r<t.length;r++){let n=s0(t[r]);for(let a in n)i[a]=n[a]}return i}function Cpe(t){let i=[];for(let r=0;r<t.length;r++)i.push(t[r].clone());return i}function B7(t){return t.getRenderTarget()===null&&t.outputEncoding===gi?zc:CC}var O0={clone:s0,merge:Ms},Tpe=`void main() { 4579 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 4580}
4580`,Mpe=`void main() { 4581 gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 ); 4582}`,Xi=class extends wE{constructor(t){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=Tpe,this.fragmentShader=Mpe,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,t!==void 0&&this.setValues(t)}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=s0(t.uniforms),this.uniformsGroups=Cpe(t.uniformsGroups),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){let i=super.toJSON(t);i.glslVersion=this.glslVersion,i.uniforms={};for(let n in this.uniforms){let a=this.uniforms[n].value;a&&a.isTexture?i.uniforms[n]={type:"t",value:a.toJSON(t).uuid}:a&&a.isColor?i.uniforms[n]={type:"c",value:a.getHex()}:a&&a.isVector2?i.uniforms[n]={type:"v2",value:a.toArray()}:a&&a.isVector3?i.uniforms[n]={type:"v3",value:a.toArray()}:a&&a.isVector4?i.uniforms[n]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?i.uniforms[n]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?i.uniforms[n]={type:"m4",value:a.toArray()}:i.uniforms[n]={value:a}}Object.keys(this.defines).length>0&&(i.defines=this.defines),i.vertexShader=this.vertexShader,i.fragmentShader=this.fragmentShader;let r={};for(let n in this.extensions)this.extensions[n]===!0&&(r[n]=!0);return Object.keys(r).length>0&&(i.extensions=r),i}},Bp=class extends lr{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new ht,this.projectionMatrix=new ht,this.projectionMatrixInverse=new ht}copy(t,i){return super.copy(t,i),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);let i=this.matrixWorld.elements;return t.set(-i[8],-i[9],-i[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}},as=class extends Bp{constructor(t=50,i=1,r=.1,n=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=r,this.far=n,this.focus=10,this.aspect=i,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=t.view===null?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this}setFocalLength(t){let i=.5*this.getFilmHeight()/t;this.fov=Ty*2*Math.atan(i),this.updateProjectionMatrix()}getFocalLength(){let t=Math.tan(W_*.5*this.fov);return .5*this.getFilmHeight()/t}getEffectiveFOV(){return Ty*2*Math.atan(Math.tan(W_*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(t,i,r,n,a,s){this.aspect=t/i,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=r,this.view.offsetY=n,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=this.near,i=t*Math.tan(W_*.5*this.fov)/this.zoom,r=2*i,n=this.aspect*r,a=-.5*n,s=this.view;if(this.view!==null&&this.view.enabled){let l=s.fullWidth,c=s.fullHeight;a+=s.offsetX*n/l,i-=s.offsetY*r/c,n*=s.width/l,r*=s.height/c}let o=this.filmOffset;o!==0&&(a+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+n,i,i-r,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let i=super.toJSON(t);return i.object.fov=this.fov,i.object.zoom=this.zoom,i.object.near=this.near,i.object.far=this.far,i.object.focus=this.focus,i.object.aspect=this.aspect,this.view!==null&&(i.object.view=Object.assign({},this.view)),i.object.filmGauge=this.filmGauge,i.object.filmOffset=this.filmOffset,i}},bm=-90,Sm=1,xpe=class extends lr{constructor(t,i,r){super(),this.type="CubeCamera",this.renderTarget=r;let n=new as(bm,Sm,t,i);n.layers=this.layers,n.up.set(0,1,0),n.lookAt(1,0,0),this.add(n);let a=new as(bm,Sm,t,i);a.layers=this.layers,a.up.set(0,1,0),a.lookAt(-1,0,0),this.add(a);let s=new as(bm,Sm,t,i);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(0,1,0),this.add(s);let o=new as(bm,Sm,t,i);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(0,-1,0),this.add(o);let l=new as(bm,Sm,t,i);l.layers=this.layers,l.up.set(0,1,0),l.lookAt(0,0,1),this.add(l);let c=new as(bm,Sm,t,i);c.layers=this.layers,c.up.set(0,1,0),c.lookAt(0,0,-1),this.add(c)}update(t,i){this.parent===null&&this.updateMatrixWorld();let r=this.renderTarget,[n,a,s,o,l,c]=this.children,h=t.getRenderTarget(),u=t.toneMapping,d=t.xr.enabled;t.toneMapping=lh,t.xr.enabled=!1;let A=r.texture.generateMipmaps;r.texture.generateMipmaps=!1,t.setRenderTarget(r,0),t.render(i,n),t.setRenderTarget(r,1),t.render(i,a),t.setRenderTarget(r,2),t.render(i,s),t.setRenderTarget(r,3),t.render(i,o),t.setRenderTarget(r,4),t.render(i,l),r.texture.generateMipmaps=A,t.setRenderTarget(r,5),t.render(i,c),t.setRenderTarget(h),t.toneMapping=u,t.xr.enabled=d,r.texture.needsPMREMUpdate=!0}},sN=class extends en{constructor(t,i,r,n,a,s,o,l,c,h){t=t!==void 0?t:[],i=i!==void 0?i:cp,super(t,i,r,n,a,s,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(t){this.image=t}},Rpe=class extends $i{constructor(t=1,i={}
vendor: 4,633 bytes, lines 4582-4617
4582){super(t,t,i),this.isWebGLCubeRenderTarget=!0;let r={width:t,height:t,depth:1},n=[r,r,r,r,r,r];this.texture=new sN(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=i.generateMipmaps!==void 0?i.generateMipmaps:!1,this.texture.minFilter=i.minFilter!==void 0?i.minFilter:Ei}fromEquirectangularTexture(t,i){this.texture.type=i.type,this.texture.encoding=i.encoding,this.texture.generateMipmaps=i.generateMipmaps,this.texture.minFilter=i.minFilter,this.texture.magFilter=i.magFilter;let r={uniforms:{tEquirect:{value:null}},vertexShader:` 4583 4584 varying vec3 vWorldDirection; 4585 4586 vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 4587 4588 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 4589 4590 } 4591 4592 void main() { 4593 4594 vWorldDirection = transformDirection( position, modelMatrix ); 4595 4596 #include <begin_vertex> 4597 #include <project_vertex> 4598 4599 } 4600 `,fragmentShader:` 4601 4602 uniform sampler2D tEquirect; 4603 4604 varying vec3 vWorldDirection; 4605 4606 #include <common> 4607 4608 void main() { 4609 4610 vec3 direction = normalize( vWorldDirection ); 4611 4612 vec2 sampleUV = equirectUv( direction ); 4613 4614 gl_FragColor = texture2D( tEquirect, sampleUV ); 4615 4616 } 4617 `},n=new gc(5,5,5),a=new Xi({name:"CubemapFromEquirect",uniforms:s0(r.uniforms),vertexShader:r.vertexShader,fragmentShader:r.fragmentShader,side:Ea,blending:Un});a.uniforms.tEquirect.value=i;let s=new Zr(n,a),o=i.minFilter;return i.minFilter===a0&&(i.minFilter=Ei),new xpe(1,10,this).update(t,s),i.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,i,r,n){let a=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(this,s),t.clear(i,r,n);t.setRenderTarget(a)}},KB=new O,Bpe=new O,Ipe=new Nn,eo=class{constructor(t=new O(1,0,0),i=0){this.isPlane=!0,this.normal=t,this.constant=i}set(t,i){return this.normal.copy(t),this.constant=i,this}setComponents(t,i,r,n){return this.normal.set(t,i,r),this.constant=n,this}setFromNormalAndCoplanarPoint(t,i){return this.normal.copy(t),this.constant=-i.dot(this.normal),this}setFromCoplanarPoints(t,i,r){let n=KB.subVectors(r,i).cross(Bpe.subVectors(t,i)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){let t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,i){return i.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,i){let r=t.delta(KB),n=this.normal.dot(r);if(n===0)return this.distanceToPoint(t.start)===0?i.copy(t.start):null;let a=-(t.start.dot(this.normal)+this.constant)/n;return a<0||a>1?null:i.copy(r).multiplyScalar(a).add(t.start)}intersectsLine(t){let i=this.distanceToPoint(t.start),r=this.distanceToPoint(t.end);return i<0&&r>0||r<0&&i>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,i){let r=i||Ipe.getNormalMatrix(t),n=this.coplanarPoint(KB).applyMatrix4(t),a=this.normal.applyMatrix3(r).normalize();return this.constant=-n.dot(a),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}clone(){return new this.constructor().copy(this)}},Cm=new ho,Xw=new O,oN=class{constructor(t=new eo,i=new eo,r=new eo,n=new eo,a=new eo,s=new eo){this.planes=[t,i,r,n,a,s]}set(t,i,r,n,a,s){let o=this.planes;return o[0].copy(t),o[1].copy(i),o[2].copy(r),o[3].copy(n),o[4].copy(a),o[5].copy(s),this}copy(t){let i=this.planes;for(let r=0;r<6;r++)i[r].copy(t.planes[r]);return this}setFromProjectionMatrix(t){let i=this.planes,r=t.elements,n=r[0],a=r[1],s=r[2],o=r[3],l=r[4],c=r[5],h=r[6],u=r[7],d=r[8],A=r[9],f=r[10],m=r[11],g=r[12],p=r[13],v=r[14],_=r[15];return i[0].setComponents(o-n,u-l,m-d,_-g).normalize(),i[1].setComponents(o+n,u+l,m+d,_+g).normalize(),i[2].setComponents(o+a,u+c,m+A,_+p).normalize(),i[3].setComponents(o-a,u-c,m-A,_-p).normalize(),i[4].setComponents(o-s,u-h,m-f,_-v).normalize(),i[5].setComponents(o+s,u+h,m+f,_+v).normalize(),this}intersectsObject(t){let i=t.geometry;return i.boundingSphere===null&&i.computeBoundingSphere(),Cm.copy(i.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Cm)}intersectsSprite(t){return Cm.center.set(0,0,0),Cm.radius=.7071067811865476,Cm.applyM
4617atrix4(t.matrixWorld),this.intersectsSphere(Cm)}intersectsSphere(t){let i=this.planes,r=t.center,n=-t.radius;for(let a=0;a<6;a++)if(i[a].distanceToPoint(r)<n)return!1;return!0}intersectsBox(t){let i=this.planes;for(let r=0;r<6;r++){let n=i[r];if(Xw.x=n.normal.x>0?t.max.x:t.min.x,Xw.y=n.normal.y>0?t.max.y:t.min.y,Xw.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Xw)<0)return!1}return!0}containsPoint(t){let i=this.planes;for(let r=0;r<6;r++)if(i[r].distanceToPoint(t)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}};function I7(){let t=null,i=!1,r=null,n=null;function a(s,o){r(s,o),n=t.requestAnimationFrame(a)}return{start:function(){i!==!0&&r!==null&&(n=t.requestAnimationFrame(a),i=!0)},stop:function(){t.cancelAnimationFrame(n),i=!1},setAnimationLoop:function(s){r=s},setContext:function(s){t=s}}}function Dpe(t,i){let r=i.isWebGL2,n=new WeakMap;function a(h,u){let d=h.array,A=h.usage,f=t.createBuffer();t.bindBuffer(u,f),t.bufferData(u,d,A),h.onUploadCallback();let m;if(d instanceof Float32Array)m=5126;else if(d instanceof Uint16Array)if(h.isFloat16BufferAttribute)if(r)m=5131;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else m=5123;else if(d instanceof Int16Array)m=5122;else if(d instanceof Uint32Array)m=5125;else if(d instanceof Int32Array)m=5124;else if(d instanceof Int8Array)m=5120;else if(d instanceof Uint8Array)m=5121;else if(d instanceof Uint8ClampedArray)m=5121;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+d);return{buffer:f,type:m,bytesPerElement:d.BYTES_PER_ELEMENT,version:h.version}}function s(h,u,d){let A=u.array,f=u.updateRange;t.bindBuffer(d,h),f.count===-1?t.bufferSubData(d,0,A):(r?t.bufferSubData(d,f.offset*A.BYTES_PER_ELEMENT,A,f.offset,f.count):t.bufferSubData(d,f.offset*A.BYTES_PER_ELEMENT,A.subarray(f.offset,f.offset+f.count)),f.count=-1),u.onUploadCallback()}function o(h){return h.isInterleavedBufferAttribute&&(h=h.data),n.get(h)}function l(h){h.isInterleavedBufferAttribute&&(h=h.data);let u=n.get(h);u&&(t.deleteBuffer(u.buffer),n.delete(h))}function c(h,u){if(h.isGLBufferAttribute){let A=n.get(h);(!A||A.version<h.version)&&n.set(h,{buffer:h.buffer,type:h.type,bytesPerElement:h.elementSize,version:h.version});return}h.isInterleavedBufferAttribute&&(h=h.data);let d=n.get(h);d===void 0?n.set(h,a(h,u)):d.version<h.version&&(s(d.buffer,h,u),d.version=h.version)}return{get:o,remove:l,update:c}}var zu=class extends Lt{constructor(t=1,i=1,r=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:i,widthSegments:r,heightSegments:n};let a=t/2,s=i/2,o=Math.floor(r),l=Math.floor(n),c=o+1,h=l+1,u=t/o,d=i/l,A=[],f=[],m=[],g=[];for(let p=0;p<h;p++){let v=p*d-s;for(let _=0;_<c;_++){let y=_*u-a;f.push(y,-v,0),m.push(0,0,1),g.push(_/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let v=0;v<o;v++){let _=v+c*p,y=v+c*(p+1),w=v+1+c*(p+1),b=v+1+c*p;A.push(_,y,b),A.push(y,w,b)}this.setIndex(A),this.setAttribute("position",new Et(f,3)),this.setAttribute("normal",new Et(m,3)),this.setAttribute("uv",new Et(g,2))}static fromJSON(t){return new zu(t.width,t.height,t.widthSegments,t.heightSegments)}},Ppe=`#ifdef USE_ALPHAMAP 4618 diffuseColor.a *= texture2D( alphaMap, vUv ).g; 4619#endif`,Lpe=`#ifdef USE_ALPHAMAP 4620 uniform sampler2D alphaMap; 4621#endif`,Ope=`#ifdef USE_ALPHATEST 4622 if ( diffuseColor.a < alphaTest ) discard; 4623#endif`,Npe=`#ifdef USE_ALPHATEST 4624 uniform float alphaTest; 4625#endif`,Upe=`#ifdef USE_AOMAP 4626 float ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0; 4627 reflectedLight.indirectDiffuse *= ambientOcclusion; 4628 #if defined( USE_ENVMAP ) && defined( STANDARD ) 4629 float dotNV = saturate( dot( geometry.normal, geometry.viewDir ) ); 4630 reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness ); 4631 #endif 4632#endif`,Fpe=`#ifdef USE_AOMAP 4633 uniform sampler2D aoMap; 4634 uniform float aoMapIntensity; 4635#endif`,kpe="vec3 transformed = vec3( position );",Hpe=`vec3 objectNormal = vec3( normal ); 4636#ifdef USE_TANGENT 4637 vec3 objectTangent = vec3( tangent.xyz ); 4638#endif`,Gpe=`vec3 BRDF_Lambert( const in vec3 diffuseColor ) { 4639 return RECIPROCAL_PI * diffuseColor; 4640} 4641vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { 4642 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 4643 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 4644} 4645float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { 4646 float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); 4647 return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); 4648} 4649vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { 4650 float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); 4651 float x2 = x * x; 4652 float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); 4653 return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); 4654} 4655float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { 4656 float a2 = pow2( alpha ); 4657 float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); 4658 float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); 4659 return 0.5 / max( gv + gl, EPSILON ); 4660} 4661float D_GGX( const in float alpha, const in float dotNH ) { 4662 float a2 = pow2( alpha ); 4663 float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; 4664 return RECIPROCAL_PI * a2 / pow2( denom ); 4665}
4666vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) { 4667 float alpha = pow2( roughness ); 4668 vec3 halfDir = normalize( lightDir + viewDir ); 4669 float dotNL = saturate( dot( normal, lightDir ) ); 4670 float dotNV = saturate( dot( normal, viewDir ) ); 4671 float dotNH = saturate( dot( normal, halfDir ) ); 4672 float dotVH = saturate( dot( viewDir, halfDir ) ); 4673 vec3 F = F_Schlick( f0, f90, dotVH ); 4674 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 4675 float D = D_GGX( alpha, dotNH ); 4676 return F * ( V * D ); 4677} 4678#ifdef USE_IRIDESCENCE 4679 vec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) { 4680 float alpha = pow2( roughness ); 4681 vec3 halfDir = normalize( lightDir + viewDir ); 4682 float dotNL = saturate( dot( normal, lightDir ) ); 4683 float dotNV = saturate( dot( normal, viewDir ) ); 4684 float dotNH = saturate( dot( normal, halfDir ) ); 4685 float dotVH = saturate( dot( viewDir, halfDir ) ); 4686 vec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence ); 4687 float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); 4688 float D = D_GGX( alpha, dotNH ); 4689 return F * ( V * D ); 4690 } 4691#endif 4692vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { 4693 const float LUT_SIZE = 64.0; 4694 const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; 4695 const float LUT_BIAS = 0.5 / LUT_SIZE; 4696 float dotNV = saturate( dot( N, V ) ); 4697 vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); 4698 uv = uv * LUT_SCALE + LUT_BIAS; 4699 return uv; 4700} 4701float LTC_ClippedSphereFormFactor( const in vec3 f ) { 4702 float l = length( f ); 4703 return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); 4704} 4705vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { 4706 float x = dot( v1, v2 ); 4707 float y = abs( x ); 4708 float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; 4709 float b = 3.4175940 + ( 4.1616724 + y ) * y; 4710 float v = a / b; 4711 float theta_sintheta = ( x >
4711 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; 4712 return cross( v1, v2 ) * theta_sintheta; 4713} 4714vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { 4715 vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; 4716 vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; 4717 vec3 lightNormal = cross( v1, v2 ); 4718 if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); 4719 vec3 T1, T2; 4720 T1 = normalize( V - N * dot( V, N ) ); 4721 T2 = - cross( N, T1 ); 4722 mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); 4723 vec3 coords[ 4 ]; 4724 coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); 4725 coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); 4726 coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); 4727 coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); 4728 coords[ 0 ] = normalize( coords[ 0 ] ); 4729 coords[ 1 ] = normalize( coords[ 1 ] ); 4730 coords[ 2 ] = normalize( coords[ 2 ] ); 4731 coords[ 3 ] = normalize( coords[ 3 ] ); 4732 vec3 vectorFormFactor = vec3( 0.0 ); 4733 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); 4734 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); 4735 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); 4736 vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); 4737 float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); 4738 return vec3( result ); 4739} 4740float G_BlinnPhong_Implicit( ) { 4741 return 0.25; 4742} 4743float D_BlinnPhong( const in float shininess, const in float dotNH ) { 4744 return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess ); 4745} 4746vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) { 4747 vec3 halfDir = normalize( lightDir + viewDir ); 4748 float dotNH = saturate( dot( normal, halfDir ) ); 4749 float dotVH = saturate( dot( viewDir, halfDir ) ); 4750 vec3 F = F_Schlick( specularColor, 1.0, dotVH ); 4751 float G = G_BlinnPhong_Implicit( ); 4752 float D = D_BlinnPhong( shininess, dotNH ); 4753 return F * ( G * D ); 4754} 4755#if defined( USE_SHEEN ) 4756float D_Charlie( float roughness, float dotNH ) { 4757 float alpha = pow2( roughness ); 4758 float invAlpha = 1.0 / alpha; 4759 float cos2h = dotNH * dotNH; 4760 float sin2h = max( 1.0 - cos2h, 0.0078125 ); 4761 return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); 4762} 4763float V_Neubelt( float dotNV, float dotNL ) { 4764 return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); 4765} 4766vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { 4767 vec3 halfDir = normalize( lightDir + viewDir ); 4768 float dotNL = saturate( dot( normal, lightDir ) ); 4769 float dotNV = saturate( dot( normal, viewDir ) ); 4770 float dotNH = saturate( dot( normal, halfDir ) ); 4771 float D = D_Charlie( sheenRoughness, dotNH ); 4772 float V = V_Neubelt( dotNV, dotNL ); 4773 return sheenColor * ( D * V ); 4774} 4775#endif`,zpe=`#ifdef USE_IRIDESCENCE 4776 const mat3 XYZ_TO_REC709 = mat3( 4777 3.2404542, -0.9692660, 0.0556434, 4778 -1.5371385, 1.8760108, -0.2040259, 4779 -0.4985314, 0.0415560, 1.0572252 4780 ); 4781 vec3 Fresnel0ToIor( vec3 fresnel0 ) { 4782 vec3 sqrtF0 = sqrt( fresnel0 ); 4783 return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 ); 4784 } 4785 vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) { 4786 return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) ); 4787 } 4788 float IorToFresnel0( float transmittedIor, float incidentIor ) { 4789 return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor )); 4790 } 4791 vec3 evalSensitivity( float OPD, vec3 shift ) { 4792 float phase = 2.0 * PI * OPD * 1.0e-9; 4793 vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 ); 4794 vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 ); 4795 vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 ); 4796 vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var ); 4797 xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) ); 4798 xyz /= 1.0685e-7; 4799 vec3 rgb = XYZ_TO_REC709 * xyz; 4800 return rgb; 4801 } 4802 vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) { 4803 vec3 I; 4804 float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) ); 4805 float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) ); 4806 float cosTheta2Sq = 1.0 - sinTheta2Sq; 4807 if ( cosTheta2Sq < 0.0 ) { 4808 return vec3( 1.0 ); 4809 } 4810 float cosTheta2 = sqrt( cosTheta2Sq ); 4811 float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
4812 float R12 = F_Schlick( R0, 1.0, cosTheta1 ); 4813 float R21 = R12; 4814 float T121 = 1.0 - R12; 4815 float phi12 = 0.0; 4816 if ( iridescenceIOR < outsideIOR ) phi12 = PI; 4817 float phi21 = PI - phi12; 4818 vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR ); 4819 vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 ); 4820 vec3 phi23 = vec3( 0.0 ); 4821 if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI; 4822 if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI; 4823 if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI; 4824 float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2; 4825 vec3 phi = vec3( phi21 ) + phi23; 4826 vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 ); 4827 vec3 r123 = sqrt( R123 ); 4828 vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 ); 4829 vec3 C0 = R12 + Rs; 4830 I = C0; 4831 vec3 Cm = Rs - T121; 4832 for ( int m = 1; m <= 2; ++ m ) { 4833 Cm *= r123; 4834 vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi ); 4835 I += Cm * Sm; 4836 } 4837 return max( I, vec3( 0.0 ) ); 4838 } 4839#endif`,Qpe=`#ifdef USE_BUMPMAP 4840 uniform sampler2D bumpMap; 4841 uniform float bumpScale; 4842 vec2 dHdxy_fwd() { 4843 vec2 dSTdx = dFdx( vUv ); 4844 vec2 dSTdy = dFdy( vUv ); 4845 float Hll = bumpScale * texture2D( bumpMap, vUv ).x; 4846 float dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll; 4847 float dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll; 4848 return vec2( dBx, dBy ); 4849 } 4850 vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 4851 vec3 vSigmaX = dFdx( surf_pos.xyz ); 4852 vec3 vSigmaY = dFdy( surf_pos.xyz ); 4853 vec3 vN = surf_norm; 4854 vec3 R1 = cross( vSigmaY, vN ); 4855 vec3 R2 = cross( vN, vSigmaX ); 4856 float fDet = dot( vSigmaX, R1 ) * faceDirection; 4857 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 4858 return normalize( abs( fDet ) * surf_norm - vGrad ); 4859 } 4860#endif`,Vpe=`#if NUM_CLIPPING_PLANES > 0 4861 vec4 plane; 4862 #pragma unroll_loop_start 4863 for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { 4864 plane = clippingPlanes[ i ]; 4865 if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; 4866 } 4867 #pragma unroll_loop_end 4868 #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES 4869 bool clipped = true; 4870 #pragma unroll_loop_start 4871 for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { 4872 plane = clippingPlanes[ i ]; 4873 clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; 4874 } 4875 #pragma unroll_loop_end 4876 if ( clipped ) discard; 4877 #endif 4878#endif`,Wpe=`#if NUM_CLIPPING_PLANES > 0 4879 varying vec3 vClipPosition; 4880 uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; 4881#endif`,jpe=`#if NUM_CLIPPING_PLANES > 0 4882 varying vec3 vClipPosition; 4883#endif`,Ype=`#if NUM_CLIPPING_PLANES > 0 4884 vClipPosition = - mvPosition.xyz; 4885#endif`,Kpe=`#if defined( USE_COLOR_ALPHA ) 4886 diffuseColor *= vColor; 4887#elif defined( USE_COLOR ) 4888 diffuseColor.rgb *= vColor; 4889#endif`,Xpe=`#if defined( USE_COLOR_ALPHA ) 4890 varying vec4 vColor; 4891#elif defined( USE_COLOR ) 4892 varying vec3 vColor; 4893#endif`,qpe=`#if defined( USE_COLOR_ALPHA ) 4894 varying vec4 vColor; 4895#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 4896 varying vec3 vColor; 4897#endif`,Zpe=`#if defined( USE_COLOR_ALPHA ) 4898 vColor = vec4( 1.0 ); 4899#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) 4900 vColor = vec3( 1.0 ); 4901#endif 4902#ifdef USE_COLOR 4903 vColor *= color; 4904#endif 4905#ifdef USE_INSTANCING_COLOR 4906 vColor.xyz *= instanceColor.xyz; 4907#endif`,Jpe=`#define PI 3.141592653589793 4908#define PI2 6.283185307179586 4909#define PI_HALF 1.5707963267948966 4910#define RECIPROCAL_PI 0.3183098861837907 4911#define RECIPROCAL_PI2 0.15915494309189535 4912#define EPSILON 1e-6 4913#ifndef saturate 4914#define saturate( a ) clamp( a, 0.0, 1.0 ) 4915#endif 4916#define whiteComplement( a ) ( 1.0 - saturate( a ) ) 4917float pow2( const in float x ) { return x*x; } 4918vec3 pow2( const in vec3 x ) { return x*x; } 4919float pow3( const in float x ) { return x*x*x; } 4920float pow4( const in float x ) { float x2 = x*x; return x2*x2; } 4921float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } 4922float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } 4923highp float rand( const in vec2 uv ) { 4924 const highp float a = 12.9898, b = 78.233, c = 43758.5453; 4925 highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); 4926 return fract( sin( sn ) * c ); 4927} 4928#ifdef HIGH_PRECISION 4929 float precisionSafeLength( vec3 v ) { return length( v ); } 4930#else 4931 float precisionSafeLength( vec3 v ) { 4932 float maxComponent = max3( abs( v ) ); 4933 return length( v / maxComponent ) * maxComponent; 4934 } 4935#endif 4936struct IncidentLight { 4937 vec3 color; 4938 vec3 direction; 4939 bool visible; 4940}; 4941struct ReflectedLight { 4942 vec3 directDiffuse; 4943 vec3 directSpecular; 4944 vec3 indirectDiffuse; 4945 vec3 indirectSpecular; 4946}; 4947struct GeometricContext { 4948 vec3 position; 4949 vec3 normal; 4950 vec3 viewDir; 4951#ifdef USE_CLEARCOAT 4952 vec3 clearcoatNormal; 4953#endif 4954}; 4955vec3 transformDirection( in vec3 dir, in mat4 matrix ) { 4956 return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); 4957} 4958vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { 4959 return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); 4960} 4961mat3 transposeMat3( const in mat3 m ) { 4962 mat3 tmp; 4963 tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); 4964 tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); 4965 tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); 4966 return tmp; 4967} 4968float luminance( const in vec3 rgb ) { 4969 const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); 4970 return dot( weights, rgb ); 4971} 4972bool isPerspectiveMatrix( mat4 m ) { 4973 return m[ 2 ][ 3 ] == - 1.0; 4974} 4975vec2 equirectUv( in vec3 dir ) { 4976 float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; 4977 float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; 4978 return vec2( u, v ); 4979}`,$pe=`#ifdef ENVMAP_TYPE_CUBE_UV 4980 #define cubeUV_minMipLevel 4.0 4981 #define cubeUV_minTileSize 16.0 4982 float getFace( vec3 direction ) { 4983 vec3 absDirection = abs( direction ); 4984 float face = - 1.0; 4985 if ( absDirection.x > absDirection.z ) { 4986 if ( absDirection.x > absDirection.y ) 4987 face = direction.x > 0.0 ? 0.0 : 3.0; 4988 else 4989 face = direction.y > 0.0 ? 1.0 : 4.0; 4990 } else { 4991 if ( absDirection.z > absDirection.y ) 4992 face = direction.z > 0.0 ? 2.0 : 5.0; 4993 else 4994 face = direction.y > 0.0 ? 1.0 : 4.0; 4995 } 4996 return face; 4997 } 4998 vec2 getUV( vec3 direction, float face ) { 4999 vec2 uv; 5000 if ( face == 0.0 ) { 5001 uv = vec2( direction.z, direction.y ) / abs( direction.x ); 5002 } else if ( face == 1.0 ) { 5003 uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); 5004 } else if ( face == 2.0 ) { 5005 uv = vec2( - direction.x, direction.y ) / abs( direction.z ); 5006 } else if ( face == 3.0 ) { 5007 uv = vec2( - direction.z, direction.y ) / abs( direction.x ); 5008 } else if ( face == 4.0 ) { 5009 uv = vec2( - direction.x, direction.z ) / abs( direction.y ); 5010 } else { 5011 uv = vec2( direction.x, direction.y ) / abs( direction.z ); 5012 } 5013 return 0.5 * ( uv + 1.0 ); 5014 } 5015 vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { 5016 float face = getFace( direction ); 5017 float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); 5018 mipInt = max( mipInt, cubeUV_minMipLevel ); 5019 float faceSize = exp2( mipInt );
5020 highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; 5021 if ( face > 2.0 ) { 5022 uv.y += faceSize; 5023 face -= 3.0; 5024 } 5025 uv.x += face * faceSize; 5026 uv.x += filterInt * 3.0 * cubeUV_minTileSize; 5027 uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); 5028 uv.x *= CUBEUV_TEXEL_WIDTH; 5029 uv.y *= CUBEUV_TEXEL_HEIGHT; 5030 #ifdef texture2DGradEXT 5031 return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; 5032 #else 5033 return texture2D( envMap, uv ).rgb; 5034 #endif 5035 } 5036 #define cubeUV_r0 1.0 5037 #define cubeUV_v0 0.339 5038 #define cubeUV_m0 - 2.0 5039 #define cubeUV_r1 0.8 5040 #define cubeUV_v1 0.276 5041 #define cubeUV_m1 - 1.0 5042 #define cubeUV_r4 0.4 5043 #define cubeUV_v4 0.046 5044 #define cubeUV_m4 2.0 5045 #define cubeUV_r5 0.305 5046 #define cubeUV_v5 0.016 5047 #define cubeUV_m5 3.0 5048 #define cubeUV_r6 0.21 5049 #define cubeUV_v6 0.0038 5050 #define cubeUV_m6 4.0 5051 float roughnessToMip( float roughness ) { 5052 float mip = 0.0; 5053 if ( roughness >= cubeUV_r1 ) { 5054 mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; 5055 } else if ( roughness >= cubeUV_r4 ) { 5056 mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; 5057 } else if ( roughness >= cubeUV_r5 ) { 5058 mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; 5059 } else if ( roughness >= cubeUV_r6 ) { 5060 mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; 5061 } else { 5062 mip = - 2.0 * log2( 1.16 * roughness ); } 5063 return mip; 5064 } 5065 vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { 5066 float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); 5067 float mipF = fract( mip ); 5068 float mipInt = floor( mip ); 5069 vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); 5070 if ( mipF == 0.0 ) { 5071 return vec4( color0, 1.0 ); 5072 } else { 5073 vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); 5074 return vec4( mix( color0, color1, mipF ), 1.0 ); 5075 } 5076 } 5077#endif`,eme=`vec3 transformedNormal = objectNormal; 5078#ifdef USE_INSTANCING 5079 mat3 m = mat3( instanceMatrix ); 5080 transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); 5081 transformedNormal = m * transformedNormal; 5082#endif 5083transformedNormal = normalMatrix * transformedNormal; 5084#ifdef FLIP_SIDED 5085 transformedNormal = - transformedNormal; 5086#endif 5087#ifdef USE_TANGENT 5088 vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; 5089 #ifdef FLIP_SIDED 5090 transformedTangent = - transformedTangent; 5091 #endif 5092#endif`,tme=`#ifdef USE_DISPLACEMENTMAP 5093 uniform sampler2D displacementMap; 5094 uniform float displacementScale; 5095 uniform float displacementBias; 5096#endif`,ime=`#ifdef USE_DISPLACEMENTMAP 5097 transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias ); 5098#endif`,rme=`#ifdef USE_EMISSIVEMAP 5099 vec4 emissiveColor = texture2D( emissiveMap, vUv ); 5100 totalEmissiveRadiance *= emissiveColor.rgb; 5101#endif`,nme=`#ifdef USE_EMISSIVEMAP 5102 uniform sampler2D emissiveMap; 5103#endif`,ame="gl_FragColor = linearToOutputTexel( gl_FragColor );",sme=`vec4 LinearToLinear( in vec4 value ) { 5104 return value; 5105} 5106vec4 LinearTosRGB( in vec4 value ) { 5107 return 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 ); 5108}`,ome=`#ifdef USE_ENVMAP 5109 #ifdef ENV_WORLDPOS 5110 vec3 cameraToFrag; 5111 if ( isOrthographic ) { 5112 cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 5113 } else { 5114 cameraToFrag = normalize( vWorldPosition - cameraPosition ); 5115 } 5116 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 5117 #ifdef ENVMAP_MODE_REFLECTION 5118 vec3 reflectVec = reflect( cameraToFrag, worldNormal ); 5119 #else 5120 vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); 5121 #endif 5122 #else 5123 vec3 reflectVec = vReflect; 5124 #endif 5125 #ifdef ENVMAP_TYPE_CUBE 5126 vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); 5127 #else 5128 vec4 envColor = vec4( 0.0 ); 5129 #endif 5130 #ifdef ENVMAP_BLENDING_MULTIPLY 5131 outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); 5132 #elif defined( ENVMAP_BLENDING_MIX ) 5133 outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); 5134 #elif defined( ENVMAP_BLENDING_ADD ) 5135 outgoingLight += envColor.xyz * specularStrength * reflectivity; 5136 #endif 5137#endif`,lme=`#ifdef USE_ENVMAP 5138 uniform float envMapIntensity; 5139 uniform float flipEnvMap; 5140 #ifdef ENVMAP_TYPE_CUBE 5141 uniform samplerCube envMap; 5142 #else 5143 uniform sampler2D envMap; 5144 #endif 5145 5146#endif`,cme=`#ifdef USE_ENVMAP 5147 uniform float reflectivity; 5148 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 5149 #define ENV_WORLDPOS 5150 #endif 5151 #ifdef ENV_WORLDPOS 5152 varying vec3 vWorldPosition; 5153 uniform float refractionRatio; 5154 #else 5155 varying vec3 vReflect; 5156 #endif 5157#endif`,hme=`#ifdef USE_ENVMAP 5158 #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) 5159 #define ENV_WORLDPOS 5160 #endif 5161 #ifdef ENV_WORLDPOS 5162 5163 varying vec3 vWorldPosition; 5164 #else 5165 varying vec3 vReflect; 5166 uniform float refractionRatio; 5167 #endif 5168#endif`,ume=`#ifdef USE_ENVMAP 5169 #ifdef ENV_WORLDPOS 5170 vWorldPosition = worldPosition.xyz; 5171 #else 5172 vec3 cameraToVertex; 5173 if ( isOrthographic ) { 5174 cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 5175 } else {
5176 cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); 5177 } 5178 vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 5179 #ifdef ENVMAP_MODE_REFLECTION 5180 vReflect = reflect( cameraToVertex, worldNormal ); 5181 #else 5182 vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); 5183 #endif 5184 #endif 5185#endif`,dme=`#ifdef USE_FOG 5186 vFogDepth = - mvPosition.z; 5187#endif`,Ame=`#ifdef USE_FOG 5188 varying float vFogDepth; 5189#endif`,fme=`#ifdef USE_FOG 5190 #ifdef FOG_EXP2 5191 float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); 5192 #else 5193 float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); 5194 #endif 5195 gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); 5196#endif`,pme=`#ifdef USE_FOG 5197 uniform vec3 fogColor; 5198 varying float vFogDepth; 5199 #ifdef FOG_EXP2 5200 uniform float fogDensity; 5201 #else 5202 uniform float fogNear; 5203 uniform float fogFar; 5204 #endif 5205#endif`,mme=`#ifdef USE_GRADIENTMAP 5206 uniform sampler2D gradientMap; 5207#endif 5208vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { 5209 float dotNL = dot( normal, lightDirection ); 5210 vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); 5211 #ifdef USE_GRADIENTMAP 5212 return vec3( texture2D( gradientMap, coord ).r ); 5213 #else 5214 vec2 fw = fwidth( coord ) * 0.5; 5215 return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); 5216 #endif 5217}`,gme=`#ifdef USE_LIGHTMAP 5218 vec4 lightMapTexel = texture2D( lightMap, vUv2 ); 5219 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 5220 reflectedLight.indirectDiffuse += lightMapIrradiance; 5221#endif`,vme=`#ifdef USE_LIGHTMAP 5222 uniform sampler2D lightMap; 5223 uniform float lightMapIntensity; 5224#endif`,_me=`LambertMaterial material; 5225material.diffuseColor = diffuseColor.rgb; 5226material.specularStrength = specularStrength;`,yme=`varying vec3 vViewPosition; 5227struct LambertMaterial { 5228 vec3 diffuseColor; 5229 float specularStrength; 5230}; 5231void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 5232 float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); 5233 vec3 irradiance = dotNL * directLight.color; 5234 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5235} 5236void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { 5237 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5238} 5239#define RE_Direct RE_Direct_Lambert 5240#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Eme=`uniform bool receiveShadow; 5241uniform vec3 ambientLightColor; 5242uniform vec3 lightProbe[ 9 ]; 5243vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { 5244 float x = normal.x, y = normal.y, z = normal.z; 5245 vec3 result = shCoefficients[ 0 ] * 0.886227; 5246 result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; 5247 result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; 5248 result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; 5249 result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; 5250 result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; 5251 result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); 5252 result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; 5253 result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); 5254 return result; 5255} 5256vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { 5257 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 5258 vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); 5259 return irradiance; 5260} 5261vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { 5262 vec3 irradiance = ambientLightColor; 5263 return irradiance; 5264} 5265float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { 5266 #if defined ( PHYSICALLY_CORRECT_LIGHTS ) 5267 float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); 5268 if ( cutoffDistance > 0.0 ) { 5269 distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); 5270 } 5271 return distanceFalloff; 5272 #else 5273 if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { 5274 return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); 5275 } 5276 return 1.0; 5277 #endif 5278} 5279float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { 5280 return smoothstep( coneCosine, penumbraCosine, angleCosine ); 5281} 5282#if NUM_DIR_LIGHTS > 0 5283 struct DirectionalLight { 5284 vec3 direction; 5285 vec3 color; 5286 }; 5287 uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; 5288 void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) { 5289 light.color = directionalLight.color; 5290 light.direction = directionalLight.direction; 5291 light.visible = true; 5292 } 5293#endif 5294#if NUM_POINT_LIGHTS > 0 5295 struct PointLight { 5296 vec3 position; 5297 vec3 color; 5298 float distance; 5299 float decay; 5300 }; 5301 uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; 5302 void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) { 5303 vec3 lVector = pointLight.position - geometry.position; 5304 light.direction = normalize( lVector ); 5305 float lightDistance = length( lVector ); 5306 light.color = pointLight.color; 5307 light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); 5308 light.visible = ( light.color != vec3( 0.0 ) ); 5309 } 5310#endif
5311#if NUM_SPOT_LIGHTS > 0 5312 struct SpotLight { 5313 vec3 position; 5314 vec3 direction; 5315 vec3 color; 5316 float distance; 5317 float decay; 5318 float coneCos; 5319 float penumbraCos; 5320 }; 5321 uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; 5322 void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) { 5323 vec3 lVector = spotLight.position - geometry.position; 5324 light.direction = normalize( lVector ); 5325 float angleCos = dot( light.direction, spotLight.direction ); 5326 float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); 5327 if ( spotAttenuation > 0.0 ) { 5328 float lightDistance = length( lVector ); 5329 light.color = spotLight.color * spotAttenuation; 5330 light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); 5331 light.visible = ( light.color != vec3( 0.0 ) ); 5332 } else { 5333 light.color = vec3( 0.0 ); 5334 light.visible = false; 5335 } 5336 } 5337#endif 5338#if NUM_RECT_AREA_LIGHTS > 0 5339 struct RectAreaLight { 5340 vec3 color; 5341 vec3 position; 5342 vec3 halfWidth; 5343 vec3 halfHeight; 5344 }; 5345 uniform sampler2D ltc_1; uniform sampler2D ltc_2; 5346 uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; 5347#endif 5348#if NUM_HEMI_LIGHTS > 0 5349 struct HemisphereLight { 5350 vec3 direction; 5351 vec3 skyColor; 5352 vec3 groundColor; 5353 }; 5354 uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; 5355 vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { 5356 float dotNL = dot( normal, hemiLight.direction ); 5357 float hemiDiffuseWeight = 0.5 * dotNL + 0.5; 5358 vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); 5359 return irradiance; 5360 } 5361#endif`,wme=`#if defined( USE_ENVMAP ) 5362 vec3 getIBLIrradiance( const in vec3 normal ) { 5363 #if defined( ENVMAP_TYPE_CUBE_UV ) 5364 vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); 5365 vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); 5366 return PI * envMapColor.rgb * envMapIntensity; 5367 #else 5368 return vec3( 0.0 ); 5369 #endif 5370 } 5371 vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { 5372 #if defined( ENVMAP_TYPE_CUBE_UV ) 5373 vec3 reflectVec = reflect( - viewDir, normal ); 5374 reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); 5375 reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); 5376 vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); 5377 return envMapColor.rgb * envMapIntensity; 5378 #else 5379 return vec3( 0.0 ); 5380 #endif 5381 } 5382#endif`,bme=`ToonMaterial material; 5383material.diffuseColor = diffuseColor.rgb;`,Sme=`varying vec3 vViewPosition; 5384struct ToonMaterial { 5385 vec3 diffuseColor; 5386}; 5387void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 5388 vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; 5389 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5390} 5391void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 5392 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5393} 5394#define RE_Direct RE_Direct_Toon 5395#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Cme=`BlinnPhongMaterial material; 5396material.diffuseColor = diffuseColor.rgb; 5397material.specularColor = specular; 5398material.specularShininess = shininess; 5399material.specularStrength = specularStrength;`,Tme=`varying vec3 vViewPosition; 5400struct BlinnPhongMaterial { 5401 vec3 diffuseColor; 5402 vec3 specularColor; 5403 float specularShininess; 5404 float specularStrength; 5405}; 5406void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 5407 float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); 5408 vec3 irradiance = dotNL * directLight.color; 5409 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5410 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; 5411} 5412void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { 5413 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5414} 5415#define RE_Direct RE_Direct_BlinnPhong 5416#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Mme=`PhysicalMaterial material; 5417material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); 5418vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); 5419float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); 5420material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; 5421material.roughness = min( material.roughness, 1.0 ); 5422#ifdef IOR 5423 material.ior = ior; 5424 #ifdef SPECULAR 5425 float specularIntensityFactor = specularIntensity; 5426 vec3 specularColorFactor = specularColor; 5427 #ifdef USE_SPECULARINTENSITYMAP 5428 specularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a; 5429 #endif 5430 #ifdef USE_SPECULARCOLORMAP 5431 specularColorFactor *= texture2D( specularColorMap, vUv ).rgb; 5432 #endif 5433 material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); 5434 #else 5435 float specularIntensityFactor = 1.0; 5436 vec3 specularColorFactor = vec3( 1.0 ); 5437 material.specularF90 = 1.0; 5438 #endif 5439 material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); 5440#else 5441 material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); 5442 material.specularF90 = 1.0; 5443#endif 5444#ifdef USE_CLEARCOAT 5445 material.clearcoat = clearcoat; 5446 material.clearcoatRoughness = clearcoatRoughness; 5447 material.clearcoatF0 = vec3( 0.04 ); 5448 material.clearcoatF90 = 1.0; 5449 #ifdef USE_CLEARCOATMAP 5450 material.clearcoat *= texture2D( clearcoatMap, vUv ).x; 5451 #endif 5452 #ifdef USE_CLEARCOAT_ROUGHNESSMAP 5453 material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y; 5454 #endif 5455 material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); 5456 material.clearcoatRoughness += geometryRoughness; 5457 material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); 5458#endif
5459#ifdef USE_IRIDESCENCE 5460 material.iridescence = iridescence; 5461 material.iridescenceIOR = iridescenceIOR; 5462 #ifdef USE_IRIDESCENCEMAP 5463 material.iridescence *= texture2D( iridescenceMap, vUv ).r; 5464 #endif 5465 #ifdef USE_IRIDESCENCE_THICKNESSMAP 5466 material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum; 5467 #else 5468 material.iridescenceThickness = iridescenceThicknessMaximum; 5469 #endif 5470#endif 5471#ifdef USE_SHEEN 5472 material.sheenColor = sheenColor; 5473 #ifdef USE_SHEENCOLORMAP 5474 material.sheenColor *= texture2D( sheenColorMap, vUv ).rgb; 5475 #endif 5476 material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); 5477 #ifdef USE_SHEENROUGHNESSMAP 5478 material.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a; 5479 #endif 5480#endif`,xme=`struct PhysicalMaterial { 5481 vec3 diffuseColor; 5482 float roughness; 5483 vec3 specularColor; 5484 float specularF90; 5485 #ifdef USE_CLEARCOAT 5486 float clearcoat; 5487 float clearcoatRoughness; 5488 vec3 clearcoatF0; 5489 float clearcoatF90; 5490 #endif 5491 #ifdef USE_IRIDESCENCE 5492 float iridescence; 5493 float iridescenceIOR; 5494 float iridescenceThickness; 5495 vec3 iridescenceFresnel; 5496 vec3 iridescenceF0; 5497 #endif 5498 #ifdef USE_SHEEN 5499 vec3 sheenColor; 5500 float sheenRoughness; 5501 #endif 5502 #ifdef IOR 5503 float ior; 5504 #endif 5505 #ifdef USE_TRANSMISSION 5506 float transmission; 5507 float transmissionAlpha; 5508 float thickness; 5509 float attenuationDistance; 5510 vec3 attenuationColor; 5511 #endif 5512}; 5513vec3 clearcoatSpecular = vec3( 0.0 ); 5514vec3 sheenSpecular = vec3( 0.0 ); 5515float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 5516 float dotNV = saturate( dot( normal, viewDir ) ); 5517 float r2 = roughness * roughness; 5518 float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; 5519 float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; 5520 float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); 5521 return saturate( DG * RECIPROCAL_PI ); 5522} 5523vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { 5524 float dotNV = saturate( dot( normal, viewDir ) ); 5525 const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); 5526 const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); 5527 vec4 r = roughness * c0 + c1; 5528 float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; 5529 vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; 5530 return fab; 5531} 5532vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { 5533 vec2 fab = DFGApprox( normal, viewDir, roughness ); 5534 return specularColor * fab.x + specularF90 * fab.y; 5535} 5536#ifdef USE_IRIDESCENCE 5537void 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 ) { 5538#else 5539void 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 ) { 5540#endif 5541 vec2 fab = DFGApprox( normal, viewDir, roughness ); 5542 #ifdef USE_IRIDESCENCE 5543 vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); 5544 #else 5545 vec3 Fr = specularColor; 5546 #endif 5547 vec3 FssEss = Fr * fab.x + specularF90 * fab.y; 5548 float Ess = fab.x + fab.y; 5549 float Ems = 1.0 - Ess; 5550 vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); 5551 singleScatter += FssEss; 5552 multiScatter += Fms * Ems; 5553} 5554#if NUM_RECT_AREA_LIGHTS > 0 5555 void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 5556 vec3 normal = geometry.normal; 5557 vec3 viewDir = geometry.viewDir; 5558 vec3 position = geometry.position; 5559 vec3 lightPos = rectAreaLight.position; 5560 vec3 halfWidth = rectAreaLight.halfWidth; 5561 vec3 halfHeight = rectAreaLight.halfHeight; 5562 vec3 lightColor = rectAreaLight.color; 5563 float roughness = material.roughness; 5564 vec3 rectCoords[ 4 ]; 5565 rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; 5566 rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; 5567 rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; 5568 vec2 uv = LTC_Uv( normal, viewDir, roughness ); 5569 vec4 t1 = texture2D( ltc_1, uv ); 5570 vec4 t2 = texture2D( ltc_2, uv ); 5571 mat3 mInv = mat3( 5572 vec3( t1.x, 0, t1.y ), 5573 vec3( 0, 1, 0 ), 5574 vec3( t1.z, 0, t1.w ) 5575 ); 5576 vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); 5577 reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); 5578 reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); 5579 } 5580#endif 5581void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
5582 float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); 5583 vec3 irradiance = dotNL * directLight.color; 5584 #ifdef USE_CLEARCOAT 5585 float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); 5586 vec3 ccIrradiance = dotNLcc * directLight.color; 5587 clearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 5588 #endif 5589 #ifdef USE_SHEEN 5590 sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); 5591 #endif 5592 #ifdef USE_IRIDESCENCE 5593 reflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness ); 5594 #else 5595 reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness ); 5596 #endif 5597 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5598} 5599void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { 5600 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 5601} 5602void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { 5603 #ifdef USE_CLEARCOAT 5604 clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); 5605 #endif 5606 #ifdef USE_SHEEN 5607 sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); 5608 #endif 5609 vec3 singleScattering = vec3( 0.0 ); 5610 vec3 multiScattering = vec3( 0.0 ); 5611 vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; 5612 #ifdef USE_IRIDESCENCE 5613 computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); 5614 #else 5615 computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); 5616 #endif 5617 vec3 totalScattering = singleScattering + multiScattering; 5618 vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); 5619 reflectedLight.indirectSpecular += radiance * singleScattering; 5620 reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; 5621 reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; 5622} 5623#define RE_Direct RE_Direct_Physical 5624#define RE_Direct_RectArea RE_Direct_RectArea_Physical 5625#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical 5626#define RE_IndirectSpecular RE_IndirectSpecular_Physical 5627float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { 5628 return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); 5629}`,Rme=` 5630GeometricContext geometry; 5631geometry.position = - vViewPosition; 5632geometry.normal = normal; 5633geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); 5634#ifdef USE_CLEARCOAT 5635 geometry.clearcoatNormal = clearcoatNormal; 5636#endif 5637#ifdef USE_IRIDESCENCE 5638 float dotNVi = saturate( dot( normal, geometry.viewDir ) ); 5639 if ( material.iridescenceThickness == 0.0 ) { 5640 material.iridescence = 0.0; 5641 } else { 5642 material.iridescence = saturate( material.iridescence ); 5643 } 5644 if ( material.iridescence > 0.0 ) { 5645 material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); 5646 material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); 5647 } 5648#endif 5649IncidentLight directLight; 5650#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) 5651 PointLight pointLight; 5652 #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 5653 PointLightShadow pointLightShadow; 5654 #endif 5655 #pragma unroll_loop_start 5656 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 5657 pointLight = pointLights[ i ]; 5658 getPointLightInfo( pointLight, geometry, directLight ); 5659 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) 5660 pointLightShadow = pointLightShadows[ i ]; 5661 directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; 5662 #endif 5663 RE_Direct( directLight, geometry, material, reflectedLight ); 5664 } 5665 #pragma unroll_loop_end 5666#endif
5667#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) 5668 SpotLight spotLight; 5669 vec4 spotColor; 5670 vec3 spotLightCoord; 5671 bool inSpotLightMap; 5672 #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 5673 SpotLightShadow spotLightShadow; 5674 #endif 5675 #pragma unroll_loop_start 5676 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 5677 spotLight = spotLights[ i ]; 5678 getSpotLightInfo( spotLight, geometry, directLight ); 5679 #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 5680 #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX 5681 #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 5682 #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS 5683 #else 5684 #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) 5685 #endif 5686 #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) 5687 spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; 5688 inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); 5689 spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); 5690 directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; 5691 #endif 5692 #undef SPOT_LIGHT_MAP_INDEX 5693 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 5694 spotLightShadow = spotLightShadows[ i ]; 5695 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 5696 #endif 5697 RE_Direct( directLight, geometry, material, reflectedLight ); 5698 } 5699 #pragma unroll_loop_end 5700#endif 5701#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) 5702 DirectionalLight directionalLight; 5703 #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 5704 DirectionalLightShadow directionalLightShadow; 5705 #endif 5706 #pragma unroll_loop_start 5707 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 5708 directionalLight = directionalLights[ i ]; 5709 getDirectionalLightInfo( directionalLight, geometry, directLight ); 5710 #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) 5711 directionalLightShadow = directionalLightShadows[ i ]; 5712 directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 5713 #endif 5714 RE_Direct( directLight, geometry, material, reflectedLight ); 5715 } 5716 #pragma unroll_loop_end 5717#endif 5718#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) 5719 RectAreaLight rectAreaLight; 5720 #pragma unroll_loop_start 5721 for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { 5722 rectAreaLight = rectAreaLights[ i ]; 5723 RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); 5724 } 5725 #pragma unroll_loop_end 5726#endif 5727#if defined( RE_IndirectDiffuse ) 5728 vec3 iblIrradiance = vec3( 0.0 ); 5729 vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); 5730 irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); 5731 #if ( NUM_HEMI_LIGHTS > 0 ) 5732 #pragma unroll_loop_start 5733 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 5734 irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); 5735 } 5736 #pragma unroll_loop_end 5737 #endif 5738#endif 5739#if defined( RE_IndirectSpecular ) 5740 vec3 radiance = vec3( 0.0 ); 5741 vec3 clearcoatRadiance = vec3( 0.0 ); 5742#endif`,Bme=`#if defined( RE_IndirectDiffuse ) 5743 #ifdef USE_LIGHTMAP 5744 vec4 lightMapTexel = texture2D( lightMap, vUv2 ); 5745 vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; 5746 irradiance += lightMapIrradiance; 5747 #endif 5748 #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) 5749 iblIrradiance += getIBLIrradiance( geometry.normal ); 5750 #endif 5751#endif 5752#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) 5753 radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); 5754 #ifdef USE_CLEARCOAT 5755 clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); 5756 #endif 5757#endif`,Ime=`#if defined( RE_IndirectDiffuse ) 5758 RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); 5759#endif 5760#if defined( RE_IndirectSpecular ) 5761 RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); 5762#endif`,Dme=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 5763 gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; 5764#endif`,Pme=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) 5765 uniform float logDepthBufFC; 5766 varying float vFragDepth; 5767 varying float vIsPerspective; 5768#endif`,Lme=`#ifdef USE_LOGDEPTHBUF 5769 #ifdef USE_LOGDEPTHBUF_EXT 5770 varying float vFragDepth; 5771 varying float vIsPerspective; 5772 #else 5773 uniform float logDepthBufFC; 5774 #endif 5775#endif`,Ome=`#ifdef USE_LOGDEPTHBUF 5776 #ifdef USE_LOGDEPTHBUF_EXT 5777 vFragDepth = 1.0 + gl_Position.w; 5778 vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); 5779 #else 5780 if ( isPerspectiveMatrix( projectionMatrix ) ) { 5781 gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; 5782 gl_Position.z *= gl_Position.w; 5783 } 5784 #endif 5785#endif`,Nme=`#ifdef USE_MAP 5786 vec4 sampledDiffuseColor = texture2D( map, vUv ); 5787 #ifdef DECODE_VIDEO_TEXTURE 5788 sampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w ); 5789 #endif 5790 diffuseColor *= sampledDiffuseColor; 5791#endif`,Ume=`#ifdef USE_MAP 5792 uniform sampler2D map; 5793#endif`,Fme=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 5794 vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; 5795#endif 5796#ifdef USE_MAP 5797 diffuseColor *= texture2D( map, uv ); 5798#endif 5799#ifdef USE_ALPHAMAP 5800 diffuseColor.a *= texture2D( alphaMap, uv ).g; 5801#endif`,kme=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) 5802 uniform mat3 uvTransform; 5803#endif 5804#ifdef USE_MAP 5805 uniform sampler2D map; 5806#endif 5807#ifdef USE_ALPHAMAP 5808 uniform sampler2D alphaMap; 5809#endif`,Hme=`float metalnessFactor = metalness; 5810#ifdef USE_METALNESSMAP 5811 vec4 texelMetalness = texture2D( metalnessMap, vUv ); 5812 metalnessFactor *= texelMetalness.b; 5813#endif`,Gme=`#ifdef USE_METALNESSMAP 5814 uniform sampler2D metalnessMap; 5815#endif`,zme=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) 5816 vColor *= morphTargetBaseInfluence; 5817 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 5818 #if defined( USE_COLOR_ALPHA ) 5819 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; 5820 #elif defined( USE_COLOR ) 5821 if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; 5822 #endif 5823 } 5824#endif`,Qme=`#ifdef USE_MORPHNORMALS 5825 objectNormal *= morphTargetBaseInfluence; 5826 #ifdef MORPHTARGETS_TEXTURE 5827 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 5828 if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; 5829 } 5830 #else 5831 objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; 5832 objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; 5833 objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; 5834 objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; 5835 #endif 5836#endif`,Vme=`#ifdef USE_MORPHTARGETS 5837 uniform float morphTargetBaseInfluence; 5838 #ifdef MORPHTARGETS_TEXTURE 5839 uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; 5840 uniform sampler2DArray morphTargetsTexture; 5841 uniform ivec2 morphTargetsTextureSize; 5842 vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { 5843 int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; 5844 int y = texelIndex / morphTargetsTextureSize.x; 5845 int x = texelIndex - y * morphTargetsTextureSize.x; 5846 ivec3 morphUV = ivec3( x, y, morphTargetIndex ); 5847 return texelFetch( morphTargetsTexture, morphUV, 0 ); 5848 } 5849 #else 5850 #ifndef USE_MORPHNORMALS 5851 uniform float morphTargetInfluences[ 8 ]; 5852 #else 5853 uniform float morphTargetInfluences[ 4 ]; 5854 #endif 5855 #endif 5856#endif`,Wme=`#ifdef USE_MORPHTARGETS 5857 transformed *= morphTargetBaseInfluence; 5858 #ifdef MORPHTARGETS_TEXTURE 5859 for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { 5860 if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; 5861 } 5862 #else 5863 transformed += morphTarget0 * morphTargetInfluences[ 0 ]; 5864 transformed += morphTarget1 * morphTargetInfluences[ 1 ]; 5865 transformed += morphTarget2 * morphTargetInfluences[ 2 ]; 5866 transformed += morphTarget3 * morphTargetInfluences[ 3 ]; 5867 #ifndef USE_MORPHNORMALS 5868 transformed += morphTarget4 * morphTargetInfluences[ 4 ]; 5869 transformed += morphTarget5 * morphTargetInfluences[ 5 ]; 5870 transformed += morphTarget6 * morphTargetInfluences[ 6 ]; 5871 transformed += morphTarget7 * morphTargetInfluences[ 7 ]; 5872 #endif 5873 #endif 5874#endif`,jme=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; 5875#ifdef FLAT_SHADED 5876 vec3 fdx = dFdx( vViewPosition ); 5877 vec3 fdy = dFdy( vViewPosition ); 5878 vec3 normal = normalize( cross( fdx, fdy ) ); 5879#else 5880 vec3 normal = normalize( vNormal ); 5881 #ifdef DOUBLE_SIDED 5882 normal = normal * faceDirection; 5883 #endif 5884 #ifdef USE_TANGENT 5885 vec3 tangent = normalize( vTangent ); 5886 vec3 bitangent = normalize( vBitangent ); 5887 #ifdef DOUBLE_SIDED 5888 tangent = tangent * faceDirection; 5889 bitangent = bitangent * faceDirection; 5890 #endif 5891 #if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP ) 5892 mat3 vTBN = mat3( tangent, bitangent, normal ); 5893 #endif 5894 #endif 5895#endif 5896vec3 geometryNormal = normal;`,Yme=`#ifdef OBJECTSPACE_NORMALMAP 5897 normal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; 5898 #ifdef FLIP_SIDED 5899 normal = - normal; 5900 #endif 5901 #ifdef DOUBLE_SIDED 5902 normal = normal * faceDirection; 5903 #endif 5904 normal = normalize( normalMatrix * normal ); 5905#elif defined( TANGENTSPACE_NORMALMAP ) 5906 vec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0; 5907 mapN.xy *= normalScale; 5908 #ifdef USE_TANGENT 5909 normal = normalize( vTBN * mapN ); 5910 #else
5911 normal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection ); 5912 #endif 5913#elif defined( USE_BUMPMAP ) 5914 normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); 5915#endif`,Kme=`#ifndef FLAT_SHADED 5916 varying vec3 vNormal; 5917 #ifdef USE_TANGENT 5918 varying vec3 vTangent; 5919 varying vec3 vBitangent; 5920 #endif 5921#endif`,Xme=`#ifndef FLAT_SHADED 5922 varying vec3 vNormal; 5923 #ifdef USE_TANGENT 5924 varying vec3 vTangent; 5925 varying vec3 vBitangent; 5926 #endif 5927#endif`,qme=`#ifndef FLAT_SHADED 5928 vNormal = normalize( transformedNormal ); 5929 #ifdef USE_TANGENT 5930 vTangent = normalize( transformedTangent ); 5931 vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); 5932 #endif 5933#endif`,Zme=`#ifdef USE_NORMALMAP 5934 uniform sampler2D normalMap; 5935 uniform vec2 normalScale; 5936#endif 5937#ifdef OBJECTSPACE_NORMALMAP 5938 uniform mat3 normalMatrix; 5939#endif 5940#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) ) 5941 vec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) { 5942 vec3 q0 = dFdx( eye_pos.xyz ); 5943 vec3 q1 = dFdy( eye_pos.xyz ); 5944 vec2 st0 = dFdx( vUv.st ); 5945 vec2 st1 = dFdy( vUv.st ); 5946 vec3 N = surf_norm; 5947 vec3 q1perp = cross( q1, N ); 5948 vec3 q0perp = cross( N, q0 ); 5949 vec3 T = q1perp * st0.x + q0perp * st1.x; 5950 vec3 B = q1perp * st0.y + q0perp * st1.y; 5951 float det = max( dot( T, T ), dot( B, B ) ); 5952 float scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det ); 5953 return normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z ); 5954 } 5955#endif`,Jme=`#ifdef USE_CLEARCOAT 5956 vec3 clearcoatNormal = geometryNormal; 5957#endif`,$me=`#ifdef USE_CLEARCOAT_NORMALMAP 5958 vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0; 5959 clearcoatMapN.xy *= clearcoatNormalScale; 5960 #ifdef USE_TANGENT 5961 clearcoatNormal = normalize( vTBN * clearcoatMapN ); 5962 #else 5963 clearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection ); 5964 #endif 5965#endif`,ege=`#ifdef USE_CLEARCOATMAP 5966 uniform sampler2D clearcoatMap; 5967#endif 5968#ifdef USE_CLEARCOAT_ROUGHNESSMAP 5969 uniform sampler2D clearcoatRoughnessMap; 5970#endif 5971#ifdef USE_CLEARCOAT_NORMALMAP 5972 uniform sampler2D clearcoatNormalMap; 5973 uniform vec2 clearcoatNormalScale; 5974#endif`,tge=`#ifdef USE_IRIDESCENCEMAP 5975 uniform sampler2D iridescenceMap; 5976#endif 5977#ifdef USE_IRIDESCENCE_THICKNESSMAP 5978 uniform sampler2D iridescenceThicknessMap; 5979#endif`,ige=`#ifdef OPAQUE 5980diffuseColor.a = 1.0; 5981#endif 5982#ifdef USE_TRANSMISSION 5983diffuseColor.a *= material.transmissionAlpha + 0.1; 5984#endif 5985gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,rge=`vec3 packNormalToRGB( const in vec3 normal ) { 5986 return normalize( normal ) * 0.5 + 0.5; 5987} 5988vec3 unpackRGBToNormal( const in vec3 rgb ) { 5989 return 2.0 * rgb.xyz - 1.0; 5990} 5991const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; 5992const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); 5993const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); 5994const float ShiftRight8 = 1. / 256.; 5995vec4 packDepthToRGBA( const in float v ) { 5996 vec4 r = vec4( fract( v * PackFactors ), v ); 5997 r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; 5998} 5999float unpackRGBAToDepth( const in vec4 v ) { 6000 return dot( v, UnpackFactors ); 6001} 6002vec2 packDepthToRG( in highp float v ) { 6003 return packDepthToRGBA( v ).yx; 6004} 6005float unpackRGToDepth( const in highp vec2 v ) { 6006 return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); 6007} 6008vec4 pack2HalfToRGBA( vec2 v ) { 6009 vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); 6010 return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); 6011} 6012vec2 unpackRGBATo2Half( vec4 v ) { 6013 return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); 6014} 6015float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { 6016 return ( viewZ + near ) / ( near - far ); 6017} 6018float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { 6019 return linearClipZ * ( near - far ) - near; 6020} 6021float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { 6022 return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); 6023} 6024float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { 6025 return ( near * far ) / ( ( far - near ) * invClipZ - far ); 6026}`,nge=`#ifdef PREMULTIPLIED_ALPHA 6027 gl_FragColor.rgb *= gl_FragColor.a; 6028#endif`,age=`vec4 mvPosition = vec4( transformed, 1.0 ); 6029#ifdef USE_INSTANCING 6030 mvPosition = instanceMatrix * mvPosition; 6031#endif 6032mvPosition = modelViewMatrix * mvPosition; 6033gl_Position = projectionMatrix * mvPosition;`,sge=`#ifdef DITHERING 6034 gl_FragColor.rgb = dithering( gl_FragColor.rgb ); 6035#endif`,oge=`#ifdef DITHERING 6036 vec3 dithering( vec3 color ) { 6037 float grid_position = rand( gl_FragCoord.xy ); 6038 vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); 6039 dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); 6040 return color + dither_shift_RGB; 6041 } 6042#endif`,lge=`float roughnessFactor = roughness; 6043#ifdef USE_ROUGHNESSMAP 6044 vec4 texelRoughness = texture2D( roughnessMap, vUv ); 6045 roughnessFactor *= texelRoughness.g; 6046#endif`,cge=`#ifdef USE_ROUGHNESSMAP 6047 uniform sampler2D roughnessMap;
6048#endif`,hge=`#if NUM_SPOT_LIGHT_COORDS > 0 6049 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 6050#endif 6051#if NUM_SPOT_LIGHT_MAPS > 0 6052 uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; 6053#endif 6054#ifdef USE_SHADOWMAP 6055 #if NUM_DIR_LIGHT_SHADOWS > 0 6056 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 6057 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 6058 struct DirectionalLightShadow { 6059 float shadowBias; 6060 float shadowNormalBias; 6061 float shadowRadius; 6062 vec2 shadowMapSize; 6063 }; 6064 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 6065 #endif 6066 #if NUM_SPOT_LIGHT_SHADOWS > 0 6067 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 6068 struct SpotLightShadow { 6069 float shadowBias; 6070 float shadowNormalBias; 6071 float shadowRadius; 6072 vec2 shadowMapSize; 6073 }; 6074 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 6075 #endif 6076 #if NUM_POINT_LIGHT_SHADOWS > 0 6077 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 6078 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 6079 struct PointLightShadow { 6080 float shadowBias; 6081 float shadowNormalBias; 6082 float shadowRadius; 6083 vec2 shadowMapSize; 6084 float shadowCameraNear; 6085 float shadowCameraFar; 6086 }; 6087 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 6088 #endif 6089 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 6090 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 6091 } 6092 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 6093 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 6094 } 6095 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 6096 float occlusion = 1.0; 6097 vec2 distribution = texture2DDistribution( shadow, uv ); 6098 float hard_shadow = step( compare , distribution.x ); 6099 if (hard_shadow != 1.0 ) { 6100 float distance = compare - distribution.x ; 6101 float variance = max( 0.00000, distribution.y * distribution.y ); 6102 float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); 6103 } 6104 return occlusion; 6105 } 6106 float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 6107 float shadow = 1.0; 6108 shadowCoord.xyz /= shadowCoord.w; 6109 shadowCoord.z += shadowBias; 6110 bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; 6111 bool frustumTest = inFrustum && shadowCoord.z <= 1.0; 6112 if ( frustumTest ) { 6113 #if defined( SHADOWMAP_TYPE_PCF ) 6114 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 6115 float dx0 = - texelSize.x * shadowRadius; 6116 float dy0 = - texelSize.y * shadowRadius; 6117 float dx1 = + texelSize.x * shadowRadius; 6118 float dy1 = + texelSize.y * shadowRadius; 6119 float dx2 = dx0 / 2.0; 6120 float dy2 = dy0 / 2.0; 6121 float dx3 = dx1 / 2.0; 6122 float dy3 = dy1 / 2.0; 6123 shadow = ( 6124 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + 6125 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + 6126 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + 6127 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + 6128 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + 6129 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + 6130 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + 6131 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + 6132 texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + 6133 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + 6134 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + 6135 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + 6136 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + 6137 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + 6138 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + 6139 texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + 6140 texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) 6141 ) * ( 1.0 / 17.0 ); 6142 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 6143 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 6144 float dx = texelSize.x; 6145 float dy = texelSize.y; 6146 vec2 uv = shadowCoord.xy;
6147 vec2 f = fract( uv * shadowMapSize + 0.5 ); 6148 uv -= f * texelSize; 6149 shadow = ( 6150 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 6151 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 6152 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 6153 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 6154 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 6155 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 6156 f.x ) + 6157 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 6158 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 6159 f.x ) + 6160 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 6161 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 6162 f.y ) + 6163 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 6164 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 6165 f.y ) + 6166 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 6167 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 6168 f.x ), 6169 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 6170 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 6171 f.x ), 6172 f.y ) 6173 ) * ( 1.0 / 9.0 ); 6174 #elif defined( SHADOWMAP_TYPE_VSM ) 6175 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 6176 #else 6177 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 6178 #endif 6179 } 6180 return shadow; 6181 } 6182 vec2 cubeToUV( vec3 v, float texelSizeY ) { 6183 vec3 absV = abs( v ); 6184 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 6185 absV *= scaleToCube; 6186 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 6187 vec2 planar = v.xy; 6188 float almostATexel = 1.5 * texelSizeY; 6189 float almostOne = 1.0 - almostATexel; 6190 if ( absV.z >= almostOne ) { 6191 if ( v.z > 0.0 ) 6192 planar.x = 4.0 - v.x; 6193 } else if ( absV.x >= almostOne ) { 6194 float signX = sign( v.x ); 6195 planar.x = v.z * signX + 2.0 * signX; 6196 } else if ( absV.y >= almostOne ) { 6197 float signY = sign( v.y ); 6198 planar.x = v.x + 2.0 * signY + 2.0; 6199 planar.y = v.z * signY - 2.0; 6200 } 6201 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 6202 } 6203 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 6204 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 6205 vec3 lightToPosition = shadowCoord.xyz; 6206 float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; 6207 vec3 bd3D = normalize( lightToPosition ); 6208 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) 6209 vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; 6210 return ( 6211 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + 6212 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + 6213 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + 6214 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + 6215 texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + 6216 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + 6217 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + 6218 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + 6219 texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) 6220 ) * ( 1.0 / 9.0 ); 6221 #else 6222 return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); 6223 #endif 6224 } 6225#endif`,uge=`#if NUM_SPOT_LIGHT_COORDS > 0 6226 uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; 6227 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; 6228#endif 6229#ifdef USE_SHADOWMAP 6230 #if NUM_DIR_LIGHT_SHADOWS > 0 6231 uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; 6232 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 6233 struct DirectionalLightShadow { 6234 float shadowBias; 6235 float shadowNormalBias; 6236 float shadowRadius; 6237 vec2 shadowMapSize; 6238 }; 6239 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 6240 #endif
6241 #if NUM_SPOT_LIGHT_SHADOWS > 0 6242 struct SpotLightShadow { 6243 float shadowBias; 6244 float shadowNormalBias; 6245 float shadowRadius; 6246 vec2 shadowMapSize; 6247 }; 6248 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 6249 #endif 6250 #if NUM_POINT_LIGHT_SHADOWS > 0 6251 uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; 6252 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 6253 struct PointLightShadow { 6254 float shadowBias; 6255 float shadowNormalBias; 6256 float shadowRadius; 6257 vec2 shadowMapSize; 6258 float shadowCameraNear; 6259 float shadowCameraFar; 6260 }; 6261 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 6262 #endif 6263#endif`,dge=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) 6264 vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); 6265 vec4 shadowWorldPosition; 6266#endif 6267#if defined( USE_SHADOWMAP ) 6268 #if NUM_DIR_LIGHT_SHADOWS > 0 6269 #pragma unroll_loop_start 6270 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 6271 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); 6272 vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; 6273 } 6274 #pragma unroll_loop_end 6275 #endif 6276 #if NUM_POINT_LIGHT_SHADOWS > 0 6277 #pragma unroll_loop_start 6278 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 6279 shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); 6280 vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; 6281 } 6282 #pragma unroll_loop_end 6283 #endif 6284#endif 6285#if NUM_SPOT_LIGHT_COORDS > 0 6286 #pragma unroll_loop_start 6287 for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { 6288 shadowWorldPosition = worldPosition; 6289 #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) 6290 shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; 6291 #endif 6292 vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; 6293 } 6294 #pragma unroll_loop_end 6295#endif`,Age=`float getShadowMask() { 6296 float shadow = 1.0; 6297 #ifdef USE_SHADOWMAP 6298 #if NUM_DIR_LIGHT_SHADOWS > 0 6299 DirectionalLightShadow directionalLight; 6300 #pragma unroll_loop_start 6301 for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { 6302 directionalLight = directionalLightShadows[ i ]; 6303 shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; 6304 } 6305 #pragma unroll_loop_end 6306 #endif 6307 #if NUM_SPOT_LIGHT_SHADOWS > 0 6308 SpotLightShadow spotLight; 6309 #pragma unroll_loop_start 6310 for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { 6311 spotLight = spotLightShadows[ i ]; 6312 shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; 6313 } 6314 #pragma unroll_loop_end 6315 #endif 6316 #if NUM_POINT_LIGHT_SHADOWS > 0 6317 PointLightShadow pointLight; 6318 #pragma unroll_loop_start 6319 for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { 6320 pointLight = pointLightShadows[ i ]; 6321 shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; 6322 } 6323 #pragma unroll_loop_end 6324 #endif 6325 #endif 6326 return shadow; 6327}`,fge=`#ifdef USE_SKINNING 6328 mat4 boneMatX = getBoneMatrix( skinIndex.x ); 6329 mat4 boneMatY = getBoneMatrix( skinIndex.y ); 6330 mat4 boneMatZ = getBoneMatrix( skinIndex.z ); 6331 mat4 boneMatW = getBoneMatrix( skinIndex.w ); 6332#endif`,pge=`#ifdef USE_SKINNING 6333 uniform mat4 bindMatrix; 6334 uniform mat4 bindMatrixInverse; 6335 uniform highp sampler2D boneTexture; 6336 uniform int boneTextureSize; 6337 mat4 getBoneMatrix( const in float i ) { 6338 float j = i * 4.0; 6339 float x = mod( j, float( boneTextureSize ) ); 6340 float y = floor( j / float( boneTextureSize ) ); 6341 float dx = 1.0 / float( boneTextureSize ); 6342 float dy = 1.0 / float( boneTextureSize ); 6343 y = dy * ( y + 0.5 ); 6344 vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); 6345 vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); 6346 vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); 6347 vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); 6348 mat4 bone = mat4( v1, v2, v3, v4 ); 6349 return bone; 6350 } 6351#endif`,mge=`#ifdef USE_SKINNING 6352 vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); 6353 vec4 skinned = vec4( 0.0 ); 6354 skinned += boneMatX * skinVertex * skinWeight.x; 6355 skinned += boneMatY * skinVertex * skinWeight.y; 6356 skinned += boneMatZ * skinVertex * skinWeight.z; 6357 skinned += boneMatW * skinVertex * skinWeight.w; 6358 transformed = ( bindMatrixInverse * skinned ).xyz; 6359#endif`,gge=`#ifdef USE_SKINNING 6360 mat4 skinMatrix = mat4( 0.0 ); 6361 skinMatrix += skinWeight.x * boneMatX; 6362 skinMatrix += skinWeight.y * boneMatY; 6363 skinMatrix += skinWeight.z * boneMatZ; 6364 skinMatrix += skinWeight.w * boneMatW; 6365 skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; 6366 objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; 6367 #ifdef USE_TANGENT 6368 objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; 6369 #endif 6370#endif`,vge=`float specularStrength; 6371#ifdef USE_SPECULARMAP 6372 vec4 texelSpecular = texture2D( specularMap, vUv ); 6373 specularStrength = texelSpecular.r; 6374#else 6375 specularStrength = 1.0; 6376#endif`,_ge=`#ifdef USE_SPECULARMAP 6377 uniform sampler2D specularMap; 6378#endif`,yge=`#if defined( TONE_MAPPING ) 6379 gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); 6380#endif`,Ege=`#ifndef saturate 6381#define saturate( a ) clamp( a, 0.0, 1.0 ) 6382#endif 6383uniform float toneMappingExposure; 6384vec3 LinearToneMapping( vec3 color ) { 6385 return toneMappingExposure * color; 6386} 6387vec3 ReinhardToneMapping( vec3 color ) { 6388 color *= toneMappingExposure; 6389 return saturate( color / ( vec3( 1.0 ) + color ) ); 6390} 6391vec3 OptimizedCineonToneMapping( vec3 color ) { 6392 color *= toneMappingExposure; 6393 color = max( vec3( 0.0 ), color - 0.004 ); 6394 return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); 6395} 6396vec3 RRTAndODTFit( vec3 v ) { 6397 vec3 a = v * ( v + 0.0245786 ) - 0.000090537; 6398 vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; 6399 return a / b; 6400} 6401vec3 ACESFilmicToneMapping( vec3 color ) { 6402 const mat3 ACESInputMat = mat3( 6403 vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), 6404 vec3( 0.04823, 0.01566, 0.83777 ) 6405 ); 6406 const mat3 ACESOutputMat = mat3( 6407 vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), 6408 vec3( -0.07367, -0.00605, 1.07602 ) 6409 ); 6410 color *= toneMappingExposure / 0.6; 6411 color = ACESInputMat * color; 6412 color = RRTAndODTFit( color ); 6413 color = ACESOutputMat * color; 6414 return saturate( color ); 6415} 6416vec3 CustomToneMapping( vec3 color ) { return color; }`,wge=`#ifdef USE_TRANSMISSION 6417 material.transmission = transmission; 6418 material.transmissionAlpha = 1.0; 6419 material.thickness = thickness; 6420 material.attenuationDistance = attenuationDistance; 6421 material.attenuationColor = attenuationColor; 6422 #ifdef USE_TRANSMISSIONMAP 6423 material.transmission *= texture2D( transmissionMap, vUv ).r; 6424 #endif 6425 #ifdef USE_THICKNESSMAP 6426 material.thickness *= texture2D( thicknessMap, vUv ).g;
6427 #endif 6428 vec3 pos = vWorldPosition; 6429 vec3 v = normalize( cameraPosition - pos ); 6430 vec3 n = inverseTransformDirection( normal, viewMatrix ); 6431 vec4 transmission = getIBLVolumeRefraction( 6432 n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, 6433 pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, 6434 material.attenuationColor, material.attenuationDistance ); 6435 material.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission ); 6436 totalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission ); 6437#endif`,bge=`#ifdef USE_TRANSMISSION 6438 uniform float transmission; 6439 uniform float thickness; 6440 uniform float attenuationDistance; 6441 uniform vec3 attenuationColor; 6442 #ifdef USE_TRANSMISSIONMAP 6443 uniform sampler2D transmissionMap; 6444 #endif 6445 #ifdef USE_THICKNESSMAP 6446 uniform sampler2D thicknessMap; 6447 #endif 6448 uniform vec2 transmissionSamplerSize; 6449 uniform sampler2D transmissionSamplerMap; 6450 uniform mat4 modelMatrix; 6451 uniform mat4 projectionMatrix; 6452 varying vec3 vWorldPosition; 6453 vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { 6454 vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); 6455 vec3 modelScale; 6456 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 6457 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 6458 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 6459 return normalize( refractionVector ) * thickness * modelScale; 6460 } 6461 float applyIorToRoughness( const in float roughness, const in float ior ) { 6462 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 6463 } 6464 vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { 6465 float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 6466 #ifdef texture2DLodEXT 6467 return texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod ); 6468 #else 6469 return texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod ); 6470 #endif 6471 } 6472 vec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { 6473 if ( isinf( attenuationDistance ) ) { 6474 return radiance; 6475 } else { 6476 vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; 6477 vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance * radiance; 6478 } 6479 } 6480 vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, 6481 const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, 6482 const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, 6483 const in vec3 attenuationColor, const in float attenuationDistance ) { 6484 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 6485 vec3 refractedRayExit = position + transmissionRay; 6486 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 6487 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 6488 refractionCoords += 1.0; 6489 refractionCoords /= 2.0; 6490 vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); 6491 vec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance ); 6492 vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); 6493 return vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a ); 6494 } 6495#endif`,Sge=`#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) ) 6496 varying vec2 vUv; 6497#endif`,Cge=`#ifdef USE_UV 6498 #ifdef UVS_VERTEX_ONLY 6499 vec2 vUv; 6500 #else 6501 varying vec2 vUv; 6502 #endif 6503 uniform mat3 uvTransform; 6504#endif`,Tge=`#ifdef USE_UV 6505 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 6506#endif`,Mge=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) 6507 varying vec2 vUv2; 6508#endif`,xge=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) 6509 attribute vec2 uv2; 6510 varying vec2 vUv2; 6511 uniform mat3 uv2Transform; 6512#endif`,Rge=`#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP ) 6513 vUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy; 6514#endif`,Bge=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_L
6514IGHT_COORDS > 0 6515 vec4 worldPosition = vec4( transformed, 1.0 ); 6516 #ifdef USE_INSTANCING 6517 worldPosition = instanceMatrix * worldPosition; 6518 #endif 6519 worldPosition = modelMatrix * worldPosition; 6520#endif`,Ige=`varying vec2 vUv; 6521uniform mat3 uvTransform; 6522void main() { 6523 vUv = ( uvTransform * vec3( uv, 1 ) ).xy; 6524 gl_Position = vec4( position.xy, 1.0, 1.0 ); 6525}`,Dge=`uniform sampler2D t2D; 6526uniform float backgroundIntensity; 6527varying vec2 vUv; 6528void main() { 6529 vec4 texColor = texture2D( t2D, vUv ); 6530 #ifdef DECODE_VIDEO_TEXTURE 6531 texColor = 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 ); 6532 #endif 6533 texColor.rgb *= backgroundIntensity; 6534 gl_FragColor = texColor; 6535 #include <tonemapping_fragment> 6536 #include <encodings_fragment> 6537}`,Pge=`varying vec3 vWorldDirection; 6538#include <common> 6539void main() { 6540 vWorldDirection = transformDirection( position, modelMatrix ); 6541 #include <begin_vertex> 6542 #include <project_vertex> 6543 gl_Position.z = gl_Position.w; 6544}`,Lge=`#ifdef ENVMAP_TYPE_CUBE 6545 uniform samplerCube envMap; 6546#elif defined( ENVMAP_TYPE_CUBE_UV ) 6547 uniform sampler2D envMap; 6548#endif 6549uniform float flipEnvMap; 6550uniform float backgroundBlurriness; 6551uniform float backgroundIntensity; 6552varying vec3 vWorldDirection; 6553#include <cube_uv_reflection_fragment> 6554void main() { 6555 #ifdef ENVMAP_TYPE_CUBE 6556 vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); 6557 #elif defined( ENVMAP_TYPE_CUBE_UV ) 6558 vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); 6559 #else 6560 vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 6561 #endif 6562 texColor.rgb *= backgroundIntensity; 6563 gl_FragColor = texColor; 6564 #include <tonemapping_fragment> 6565 #include <encodings_fragment> 6566}`,Oge=`varying vec3 vWorldDirection; 6567#include <common> 6568void main() { 6569 vWorldDirection = transformDirection( position, modelMatrix ); 6570 #include <begin_vertex> 6571 #include <project_vertex> 6572 gl_Position.z = gl_Position.w; 6573}`,Nge=`uniform samplerCube tCube; 6574uniform float tFlip; 6575uniform float opacity; 6576varying vec3 vWorldDirection; 6577void main() { 6578 vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); 6579 gl_FragColor = texColor; 6580 gl_FragColor.a *= opacity; 6581 #include <tonemapping_fragment> 6582 #include <encodings_fragment> 6583}`,Uge=`#include <common> 6584#include <uv_pars_vertex> 6585#include <displacementmap_pars_vertex> 6586#include <morphtarget_pars_vertex> 6587#include <skinning_pars_vertex> 6588#include <logdepthbuf_pars_vertex> 6589#include <clipping_planes_pars_vertex> 6590varying vec2 vHighPrecisionZW; 6591void main() { 6592 #include <uv_vertex> 6593 #include <skinbase_vertex> 6594 #ifdef USE_DISPLACEMENTMAP 6595 #include <beginnormal_vertex> 6596 #include <morphnormal_vertex> 6597 #include <skinnormal_vertex> 6598 #endif 6599 #include <begin_vertex> 6600 #include <morphtarget_vertex> 6601 #include <skinning_vertex> 6602 #include <displacementmap_vertex> 6603 #include <project_vertex> 6604 #include <logdepthbuf_vertex> 6605 #include <clipping_planes_vertex> 6606 vHighPrecisionZW = gl_Position.zw; 6607}`,Fge=`#if DEPTH_PACKING == 3200 6608 uniform float opacity; 6609#endif 6610#include <common> 6611#include <packing> 6612#include <uv_pars_fragment> 6613#include <map_pars_fragment> 6614#include <alphamap_pars_fragment> 6615#include <alphatest_pars_fragment> 6616#include <logdepthbuf_pars_fragment> 6617#include <clipping_planes_pars_fragment> 6618varying vec2 vHighPrecisionZW; 6619void main() { 6620 #include <clipping_planes_fragment> 6621 vec4 diffuseColor = vec4( 1.0 ); 6622 #if DEPTH_PACKING == 3200 6623 diffuseColor.a = opacity; 6624 #endif 6625 #include <map_fragment> 6626 #include <alphamap_fragment> 6627 #include <alphatest_fragment> 6628 #include <logdepthbuf_fragment> 6629 float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; 6630 #if DEPTH_PACKING == 3200 6631 gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); 6632 #elif DEPTH_PACKING == 3201 6633 gl_FragColor = packDepthToRGBA( fragCoordZ ); 6634 #endif 6635}`,kge=`#define DISTANCE 6636varying vec3 vWorldPosition; 6637#include <common> 6638#include <uv_pars_vertex> 6639#include <displacementmap_pars_vertex> 6640#include <morphtarget_pars_vertex> 6641#include <skinning_pars_vertex> 6642#include <clipping_planes_pars_vertex> 6643void main() { 6644 #include <uv_vertex> 6645 #include <skinbase_vertex> 6646 #ifdef USE_DISPLACEMENTMAP 6647 #include <beginnormal_vertex> 6648 #include <morphnormal_vertex> 6649 #include <skinnormal_vertex> 6650 #endif 6651 #include <begin_vertex> 6652 #include <morphtarget_vertex> 6653 #include <skinning_vertex> 6654 #include <displacementmap_vertex> 6655 #include <project_vertex> 6656 #include <worldpos_vertex> 6657 #include <clipping_planes_vertex> 6658 vWorldPosition = worldPosition.xyz; 6659}`,Hge=`#define DISTANCE 6660uniform vec3 referencePosition; 6661uniform float nearDistance; 6662uniform float farDistance; 6663varying vec3 vWorldPosition; 6664#include <common> 6665#include <packing> 6666#include <uv_pars_fragment> 6667#include <map_pars_fragment> 6668#include <alphamap_pars_fragment> 6669#include <alphatest_pars_fragment> 6670#include <clipping_planes_pars_fragment> 6671void main () { 6672 #include <clipping_planes_fragment> 6673 vec4 diffuseColor = vec4( 1.0 ); 6674 #include <map_fragment> 6675 #include <alphamap_fragment> 6676 #include <alphatest_fragment> 6677 float dist = length( vWorldPosition - referencePosition ); 6678 dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); 6679 dist = saturate( dist ); 6680 gl_FragColor = packDepthToRGBA( dist ); 6681}`,Gge=`varying vec3 vWorldDirection; 6682#include <common> 6683void main() { 6684 vWorldDirection = transformDirection( position, modelMatrix ); 6685 #include <begin_vertex> 6686 #include <project_vertex> 6687}`,zge=`uniform sampler2D tEquirect; 6688varying vec3 vWorldDirection; 6689#include <common> 6690void main() { 6691 vec3 direction = normalize( vWorldDirection ); 6692 vec2 sampleUV = equirectUv( direction ); 6693 gl_FragColor = texture2D( tEquirect, sampleUV ); 6694 #include <tonemapping_fragment> 6695 #include <encodings_fragment> 6696}`,Qge=`uniform float scale; 6697attribute float lineDistance; 6698varying float vLineDistance; 6699#include <common> 6700#include <color_pars_vertex> 6701#include <fog_pars_vertex> 6702#include <morphtarget_pars_vertex> 6703#include <logdepthbuf_pars_vertex> 6704#include <clipping_planes_pars_vertex> 6705void main() { 6706 vLineDistance = scale * lineDistance; 6707 #include <color_vertex> 6708 #include <morphcolor_vertex> 6709 #include <begin_vertex> 6710 #include <morphtarget_vertex> 6711 #include <project_vertex> 6712 #include <logdepthbuf_vertex> 6713 #include <clipping_planes_vertex> 6714 #include <fog_vertex> 6715}`,Vge=`uniform vec3 diffuse; 6716uniform float opacity; 6717uniform float dashSize; 6718uniform float totalSize; 6719varying float vLineDistance; 6720#include <common> 6721#include <color_pars_fragment> 6722#include <fog_pars_fragment> 6723#include <logdepthbuf_pars_fragment> 6724#include <clipping_planes_pars_fragment> 6725void main() { 6726 #include <clipping_planes_fragment> 6727 if ( mod( vLineDistance, totalSize ) > dashSize ) { 6728 discard; 6729 } 6730 vec3 outgoingLight = vec3( 0.0 ); 6731 vec4 diffuseColor = vec4( diffuse, opacity ); 6732 #include <logdepthbuf_fragment> 6733 #include <color_fragment> 6734 outgoingLight = diffuseColor.rgb; 6735 #include <output_fragment> 6736 #include <tonemapping_fragment> 6737 #include <encodings_fragment> 6738 #include <fog_fragment> 6739 #include <premultiplied_alpha_fragment> 6740}`,Wge=`#include <common> 6741#include <uv_pars_vertex> 6742#include <uv2_pars_vertex> 6743#include <envmap_pars_vertex> 6744#include <color_pars_vertex> 6745#include <fog_pars_vertex> 6746#include <morphtarget_pars_vertex> 6747#include <skinning_pars_vertex> 6748#include <logdepthbuf_pars_vertex> 6749#include <clipping_planes_pars_vertex> 6750void main() { 6751 #include <uv_vertex> 6752 #include <uv2_vertex> 6753 #include <color_vertex> 6754 #include <morphcolor_vertex> 6755 #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) 6756 #include <beginnormal_vertex> 6757 #include <morphnormal_vertex> 6758 #include <skinbase_vertex> 6759 #include <skinnormal_vertex> 6760 #include <defaultnormal_vertex> 6761 #endif 6762 #include <begin_vertex> 6763 #include <morphtarget_vertex> 6764 #include <skinning_vertex> 6765 #include <project_vertex> 6766 #include <logdepthbuf_vertex> 6767 #include <clipping_planes_vertex> 6768 #include <worldpos_vertex> 6769 #include <envmap_vertex> 6770 #include <fog_vertex> 6771}`,jge=`uniform vec3 diffuse; 6772uniform float opacity; 6773#ifndef FLAT_SHADED 6774 varying vec3 vNormal; 6775#endif 6776#include <common> 6777#include <dithering_pars_fragment> 6778#include <color_pars_fragment> 6779#include <uv_pars_fragment> 6780#include <uv2_pars_fragment> 6781#include <map_pars_fragment> 6782#include <alphamap_pars_fragment> 6783#include <alphatest_pars_fragment> 6784#include <aomap_pars_fragment> 6785#include <lightmap_pars_fragment> 6786#include <envmap_common_pars_fragment> 6787#include <envmap_pars_fragment> 6788#include <fog_pars_fragment> 6789#include <specularmap_pars_fragment> 6790#include <logdepthbuf_pars_fragment> 6791#include <clipping_planes_pars_fragment> 6792void main() { 6793 #include <clipping_planes_fragment> 6794 vec4 diffuseColor = vec4( diffuse, opacity ); 6795 #include <logdepthbuf_fragment> 6796 #include <map_fragment> 6797 #include <color_fragment> 6798 #include <alphamap_fragment> 6799 #include <alphatest_fragment> 6800 #include <specularmap_fragment> 6801 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 6802 #ifdef USE_LIGHTMAP 6803 vec4 lightMapTexel = texture2D( lightMap, vUv2 ); 6804 reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; 6805 #else 6806 reflectedLight.indirectDiffuse += vec3( 1.0 ); 6807 #endif 6808 #include <aomap_fragment> 6809 reflectedLight.indirectDiffuse *= diffuseColor.rgb; 6810 vec3 outgoingLight = reflectedLight.indirectDiffuse; 6811 #include <envmap_fragment> 6812 #include <output_fragment> 6813 #include <tonemapping_fragment> 6814 #include <encodings_fragment> 6815 #include <fog_fragment> 6816 #include <premultiplied_alpha_fragment> 6817 #include <dithering_fragment> 6818}`,Yge=`#define LAMBERT 6819varying vec3 vViewPosition; 6820#include <common> 6821#include <uv_pars_vertex> 6822#include <uv2_pars_vertex> 6823#include <displacementmap_pars_vertex> 6824#include <envmap_pars_vertex> 6825#include <color_pars_vertex> 6826#include <fog_pars_vertex> 6827#include <normal_pars_vertex> 6828#include <morphtarget_pars_vertex> 6829#include <skinning_pars_vertex> 6830#include <shadowmap_pars_vertex> 6831#include <logdepthbuf_pars_vertex> 6832#include <clipping_planes_pars_vertex> 6833void main() { 6834 #include <uv_vertex> 6835 #include <uv2_vertex> 6836 #include <color_vertex> 6837 #include <morphcolor_vertex> 6838 #include <beginnormal_vertex> 6839 #include <morphnormal_vertex> 6840 #include <skinbase_vertex> 6841 #include <skinnormal_vertex> 6842 #include <defaultnormal_vertex> 6843 #include <normal_vertex> 6844 #include <begin_vertex> 6845 #include <morphtarget_vertex> 6846 #include <skinning_vertex> 6847 #include <displacementmap_vertex> 6848 #include <project_vertex> 6849 #include <logdepthbuf_vertex> 6850 #include <clipping_planes_vertex> 6851 vViewPosition = - mvPosition.xyz; 6852 #include <worldpos_vertex> 6853 #include <envmap_vertex> 6854 #include <shadowmap_vertex> 6855 #include <fog_vertex> 6856}`,Kge=`#define LAMBERT 6857uniform vec3 diffuse; 6858uniform vec3 emissive; 6859uniform float opacity; 6860#include <common> 6861#include <packing> 6862#include <dithering_pars_fragment> 6863#include <color_pars_fragment> 6864#include <uv_pars_fragment> 6865#include <uv2_pars_fragment> 6866#include <map_pars_fragment> 6867#include <alphamap_pars_fragment> 6868#include <alphatest_pars_fragment> 6869#include <aomap_pars_fragment> 6870#include <lightmap_pars_fragment> 6871#include <emissivemap_pars_fragment> 6872#include <envmap_common_pars_fragment> 6873#include <envmap_pars_fragment> 6874#include <fog_pars_fragment> 6875#include <bsdfs> 6876#include <lights_pars_begin> 6877#include <normal_pars_fragment> 6878#include <lights_lambert_pars_fragment> 6879#include <shadowmap_pars_fragment> 6880#include <bumpmap_pars_fragment> 6881#include <normalmap_pars_fragment> 6882#include <specularmap_pars_fragment> 6883#include <logdepthbuf_pars_fragment> 6884#include <clipping_planes_pars_fragment> 6885void main() { 6886 #include <clipping_planes_fragment> 6887 vec4 diffuseColor = vec4( diffuse, opacity ); 6888 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 6889 vec3 totalEmissiveRadiance = emissive; 6890 #include <logdepthbuf_fragment> 6891 #include <map_fragment> 6892 #include <color_fragment> 6893 #include <alphamap_fragment> 6894 #include <alphatest_fragment> 6895 #include <specularmap_fragment> 6896 #include <normal_fragment_begin> 6897 #include <normal_fragment_maps> 6898 #include <emissivemap_fragment> 6899 #include <lights_lambert_fragment> 6900 #include <lights_fragment_begin> 6901 #include <lights_fragment_maps> 6902 #include <lights_fragment_end> 6903 #include <aomap_fragment> 6904 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 6905 #include <envmap_fragment> 6906 #include <output_fragment> 6907 #include <tonemapping_fragment> 6908 #include <encodings_fragment> 6909 #include <fog_fragment> 6910 #include <premultiplied_alpha_fragment> 6911 #include <dithering_fragment> 6912}`,Xge=`#define MATCAP 6913varying vec3 vViewPosition; 6914#include <common> 6915#include <uv_pars_vertex> 6916#include <color_pars_vertex> 6917#include <displacementmap_pars_vertex> 6918#include <fog_pars_vertex> 6919#include <normal_pars_vertex> 6920#include <morphtarget_pars_vertex> 6921#include <skinning_pars_vertex> 6922#include <logdepthbuf_pars_vertex> 6923#include <clipping_planes_pars_vertex> 6924void main() { 6925 #include <uv_vertex> 6926 #include <color_vertex> 6927 #include <morphcolor_vertex> 6928 #include <beginnormal_vertex> 6929 #include <morphnormal_vertex> 6930 #include <skinbase_vertex> 6931 #include <skinnormal_vertex> 6932 #include <defaultnormal_vertex> 6933 #include <normal_vertex> 6934 #include <begin_vertex> 6935 #include <morphtarget_vertex> 6936 #include <skinning_vertex> 6937 #include <displacementmap_vertex> 6938 #include <project_vertex> 6939 #include <logdepthbuf_vertex> 6940 #include <clipping_planes_vertex> 6941 #include <fog_vertex> 6942 vViewPosition = - mvPosition.xyz; 6943}`,qge=`#define MATCAP 6944uniform vec3 diffuse; 6945uniform float opacity; 6946uniform sampler2D matcap; 6947varying vec3 vViewPosition; 6948#include <common> 6949#include <dithering_pars_fragment> 6950#include <color_pars_fragment> 6951#include <uv_pars_fragment> 6952#include <map_pars_fragment> 6953#include <alphamap_pars_fragment> 6954#include <alphatest_pars_fragment> 6955#include <fog_pars_fragment> 6956#include <normal_pars_fragment> 6957#include <bumpmap_pars_fragment> 6958#include <normalmap_pars_fragment> 6959#include <logdepthbuf_pars_fragment> 6960#include <clipping_planes_pars_fragment> 6961void main() { 6962 #include <clipping_planes_fragment> 6963 vec4 diffuseColor = vec4( diffuse, opacity ); 6964 #include <logdepthbuf_fragment> 6965 #include <map_fragment> 6966 #include <color_fragment> 6967 #include <alphamap_fragment> 6968 #include <alphatest_fragment> 6969 #include <normal_fragment_begin> 6970 #include <normal_fragment_maps> 6971 vec3 viewDir = normalize( vViewPosition ); 6972 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 6973 vec3 y = cross( viewDir, x ); 6974 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; 6975 #ifdef USE_MATCAP
6976 vec4 matcapColor = texture2D( matcap, uv ); 6977 #else 6978 vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); 6979 #endif 6980 vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; 6981 #include <output_fragment> 6982 #include <tonemapping_fragment> 6983 #include <encodings_fragment> 6984 #include <fog_fragment> 6985 #include <premultiplied_alpha_fragment> 6986 #include <dithering_fragment> 6987}`,Zge=`#define NORMAL 6988#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) 6989 varying vec3 vViewPosition; 6990#endif 6991#include <common> 6992#include <uv_pars_vertex> 6993#include <displacementmap_pars_vertex> 6994#include <normal_pars_vertex> 6995#include <morphtarget_pars_vertex> 6996#include <skinning_pars_vertex> 6997#include <logdepthbuf_pars_vertex> 6998#include <clipping_planes_pars_vertex> 6999void main() { 7000 #include <uv_vertex> 7001 #include <beginnormal_vertex> 7002 #include <morphnormal_vertex> 7003 #include <skinbase_vertex> 7004 #include <skinnormal_vertex> 7005 #include <defaultnormal_vertex> 7006 #include <normal_vertex> 7007 #include <begin_vertex> 7008 #include <morphtarget_vertex> 7009 #include <skinning_vertex> 7010 #include <displacementmap_vertex> 7011 #include <project_vertex> 7012 #include <logdepthbuf_vertex> 7013 #include <clipping_planes_vertex> 7014#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) 7015 vViewPosition = - mvPosition.xyz; 7016#endif 7017}`,Jge=`#define NORMAL 7018uniform float opacity; 7019#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP ) 7020 varying vec3 vViewPosition; 7021#endif 7022#include <packing> 7023#include <uv_pars_fragment> 7024#include <normal_pars_fragment> 7025#include <bumpmap_pars_fragment> 7026#include <normalmap_pars_fragment> 7027#include <logdepthbuf_pars_fragment> 7028#include <clipping_planes_pars_fragment> 7029void main() { 7030 #include <clipping_planes_fragment> 7031 #include <logdepthbuf_fragment> 7032 #include <normal_fragment_begin> 7033 #include <normal_fragment_maps> 7034 gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); 7035 #ifdef OPAQUE 7036 gl_FragColor.a = 1.0; 7037 #endif 7038}`,$ge=`#define PHONG 7039varying vec3 vViewPosition; 7040#include <common> 7041#include <uv_pars_vertex> 7042#include <uv2_pars_vertex> 7043#include <displacementmap_pars_vertex> 7044#include <envmap_pars_vertex> 7045#include <color_pars_vertex> 7046#include <fog_pars_vertex> 7047#include <normal_pars_vertex> 7048#include <morphtarget_pars_vertex> 7049#include <skinning_pars_vertex> 7050#include <shadowmap_pars_vertex> 7051#include <logdepthbuf_pars_vertex> 7052#include <clipping_planes_pars_vertex> 7053void main() { 7054 #include <uv_vertex> 7055 #include <uv2_vertex> 7056 #include <color_vertex> 7057 #include <morphcolor_vertex> 7058 #include <beginnormal_vertex> 7059 #include <morphnormal_vertex> 7060 #include <skinbase_vertex> 7061 #include <skinnormal_vertex> 7062 #include <defaultnormal_vertex> 7063 #include <normal_vertex> 7064 #include <begin_vertex> 7065 #include <morphtarget_vertex> 7066 #include <skinning_vertex> 7067 #include <displacementmap_vertex> 7068 #include <project_vertex> 7069 #include <logdepthbuf_vertex> 7070 #include <clipping_planes_vertex> 7071 vViewPosition = - mvPosition.xyz; 7072 #include <worldpos_vertex> 7073 #include <envmap_vertex> 7074 #include <shadowmap_vertex> 7075 #include <fog_vertex> 7076}`,e0e=`#define PHONG 7077uniform vec3 diffuse; 7078uniform vec3 emissive; 7079uniform vec3 specular; 7080uniform float shininess; 7081uniform float opacity; 7082#include <common> 7083#include <packing> 7084#include <dithering_pars_fragment> 7085#include <color_pars_fragment> 7086#include <uv_pars_fragment> 7087#include <uv2_pars_fragment> 7088#include <map_pars_fragment> 7089#include <alphamap_pars_fragment> 7090#include <alphatest_pars_fragment> 7091#include <aomap_pars_fragment> 7092#include <lightmap_pars_fragment> 7093#include <emissivemap_pars_fragment> 7094#include <envmap_common_pars_fragment> 7095#include <envmap_pars_fragment> 7096#include <fog_pars_fragment> 7097#include <bsdfs> 7098#include <lights_pars_begin> 7099#include <normal_pars_fragment> 7100#include <lights_phong_pars_fragment> 7101#include <shadowmap_pars_fragment> 7102#include <bumpmap_pars_fragment> 7103#include <normalmap_pars_fragment> 7104#include <specularmap_pars_fragment> 7105#include <logdepthbuf_pars_fragment> 7106#include <clipping_planes_pars_fragment> 7107void main() { 7108 #include <clipping_planes_fragment> 7109 vec4 diffuseColor = vec4( diffuse, opacity ); 7110 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 7111 vec3 totalEmissiveRadiance = emissive; 7112 #include <logdepthbuf_fragment> 7113 #include <map_fragment> 7114 #include <color_fragment> 7115 #include <alphamap_fragment> 7116 #include <alphatest_fragment> 7117 #include <specularmap_fragment> 7118 #include <normal_fragment_begin> 7119 #include <normal_fragment_maps> 7120 #include <emissivemap_fragment> 7121 #include <lights_phong_fragment> 7122 #include <lights_fragment_begin> 7123 #include <lights_fragment_maps> 7124 #include <lights_fragment_end> 7125 #include <aomap_fragment> 7126 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; 7127 #include <envmap_fragment> 7128 #include <output_fragment> 7129 #include <tonemapping_fragment> 7130 #include <encodings_fragment> 7131 #include <fog_fragment> 7132 #include <premultiplied_alpha_fragment> 7133 #include <dithering_fragment> 7134}`,t0e=`#define STANDARD 7135varying vec3 vViewPosition; 7136#ifdef USE_TRANSMISSION 7137 varying vec3 vWorldPosition; 7138#endif 7139#include <common> 7140#include <uv_pars_vertex> 7141#include <uv2_pars_vertex> 7142#include <displacementmap_pars_vertex> 7143#include <color_pars_vertex> 7144#include <fog_pars_vertex> 7145#include <normal_pars_vertex> 7146#include <morphtarget_pars_vertex> 7147#include <skinning_pars_vertex> 7148#include <shadowmap_pars_vertex> 7149#include <logdepthbuf_pars_vertex> 7150#include <clipping_planes_pars_vertex> 7151void main() { 7152 #include <uv_vertex> 7153 #include <uv2_vertex> 7154 #include <color_vertex> 7155 #include <morphcolor_vertex> 7156 #include <beginnormal_vertex> 7157 #include <morphnormal_vertex> 7158 #include <skinbase_vertex> 7159 #include <skinnormal_vertex> 7160 #include <defaultnormal_vertex> 7161 #include <normal_vertex> 7162 #include <begin_vertex> 7163 #include <morphtarget_vertex> 7164 #include <skinning_vertex> 7165 #include <displacementmap_vertex> 7166 #include <project_vertex> 7167 #include <logdepthbuf_vertex> 7168 #include <clipping_planes_vertex> 7169 vViewPosition = - mvPosition.xyz; 7170 #include <worldpos_vertex> 7171 #include <shadowmap_vertex> 7172 #include <fog_vertex> 7173#ifdef USE_TRANSMISSION 7174 vWorldPosition = worldPosition.xyz; 7175#endif 7176}`,i0e=`#define STANDARD 7177#ifdef PHYSICAL 7178 #define IOR 7179 #define SPECULAR 7180#endif 7181uniform vec3 diffuse; 7182uniform vec3 emissive; 7183uniform float roughness; 7184uniform float metalness; 7185uniform float opacity; 7186#ifdef IOR 7187 uniform float ior; 7188#endif 7189#ifdef SPECULAR 7190 uniform float specularIntensity; 7191 uniform vec3 specularColor; 7192 #ifdef USE_SPECULARINTENSITYMAP 7193 uniform sampler2D specularIntensityMap; 7194 #endif 7195 #ifdef USE_SPECULARCOLORMAP 7196 uniform sampler2D specularColorMap; 7197 #endif 7198#endif 7199#ifdef USE_CLEARCOAT 7200 uniform float clearcoat; 7201 uniform float clearcoatRoughness; 7202#endif
7203#ifdef USE_IRIDESCENCE 7204 uniform float iridescence; 7205 uniform float iridescenceIOR; 7206 uniform float iridescenceThicknessMinimum; 7207 uniform float iridescenceThicknessMaximum; 7208#endif 7209#ifdef USE_SHEEN 7210 uniform vec3 sheenColor; 7211 uniform float sheenRoughness; 7212 #ifdef USE_SHEENCOLORMAP 7213 uniform sampler2D sheenColorMap; 7214 #endif 7215 #ifdef USE_SHEENROUGHNESSMAP 7216 uniform sampler2D sheenRoughnessMap; 7217 #endif 7218#endif 7219varying vec3 vViewPosition; 7220#include <common> 7221#include <packing> 7222#include <dithering_pars_fragment> 7223#include <color_pars_fragment> 7224#include <uv_pars_fragment> 7225#include <uv2_pars_fragment> 7226#include <map_pars_fragment> 7227#include <alphamap_pars_fragment> 7228#include <alphatest_pars_fragment> 7229#include <aomap_pars_fragment> 7230#include <lightmap_pars_fragment> 7231#include <emissivemap_pars_fragment> 7232#include <bsdfs> 7233#include <iridescence_fragment> 7234#include <cube_uv_reflection_fragment> 7235#include <envmap_common_pars_fragment> 7236#include <envmap_physical_pars_fragment> 7237#include <fog_pars_fragment> 7238#include <lights_pars_begin> 7239#include <normal_pars_fragment> 7240#include <lights_physical_pars_fragment> 7241#include <transmission_pars_fragment> 7242#include <shadowmap_pars_fragment> 7243#include <bumpmap_pars_fragment> 7244#include <normalmap_pars_fragment> 7245#include <clearcoat_pars_fragment> 7246#include <iridescence_pars_fragment> 7247#include <roughnessmap_pars_fragment> 7248#include <metalnessmap_pars_fragment> 7249#include <logdepthbuf_pars_fragment> 7250#include <clipping_planes_pars_fragment> 7251void main() { 7252 #include <clipping_planes_fragment> 7253 vec4 diffuseColor = vec4( diffuse, opacity ); 7254 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 7255 vec3 totalEmissiveRadiance = emissive; 7256 #include <logdepthbuf_fragment> 7257 #include <map_fragment> 7258 #include <color_fragment> 7259 #include <alphamap_fragment> 7260 #include <alphatest_fragment> 7261 #include <roughnessmap_fragment> 7262 #include <metalnessmap_fragment> 7263 #include <normal_fragment_begin> 7264 #include <normal_fragment_maps> 7265 #include <clearcoat_normal_fragment_begin> 7266 #include <clearcoat_normal_fragment_maps> 7267 #include <emissivemap_fragment> 7268 #include <lights_physical_fragment> 7269 #include <lights_fragment_begin> 7270 #include <lights_fragment_maps> 7271 #include <lights_fragment_end> 7272 #include <aomap_fragment> 7273 vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; 7274 vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; 7275 #include <transmission_fragment> 7276 vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; 7277 #ifdef USE_SHEEN 7278 float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); 7279 outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular; 7280 #endif 7281 #ifdef USE_CLEARCOAT 7282 float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); 7283 vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); 7284 outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; 7285 #endif 7286 #include <output_fragment> 7287 #include <tonemapping_fragment> 7288 #include <encodings_fragment> 7289 #include <fog_fragment> 7290 #include <premultiplied_alpha_fragment> 7291 #include <dithering_fragment> 7292}`,r0e=`#define TOON 7293varying vec3 vViewPosition; 7294#include <common> 7295#include <uv_pars_vertex> 7296#include <uv2_pars_vertex> 7297#include <displacementmap_pars_vertex> 7298#include <color_pars_vertex> 7299#include <fog_pars_vertex> 7300#include <normal_pars_vertex> 7301#include <morphtarget_pars_vertex> 7302#include <skinning_pars_vertex> 7303#include <shadowmap_pars_vertex> 7304#include <logdepthbuf_pars_vertex> 7305#include <clipping_planes_pars_vertex> 7306void main() { 7307 #include <uv_vertex> 7308 #include <uv2_vertex> 7309 #include <color_vertex> 7310 #include <morphcolor_vertex> 7311 #include <beginnormal_vertex> 7312 #include <morphnormal_vertex> 7313 #include <skinbase_vertex> 7314 #include <skinnormal_vertex> 7315 #include <defaultnormal_vertex> 7316 #include <normal_vertex> 7317 #include <begin_vertex> 7318 #include <morphtarget_vertex> 7319 #include <skinning_vertex> 7320 #include <displacementmap_vertex> 7321 #include <project_vertex> 7322 #include <logdepthbuf_vertex> 7323 #include <clipping_planes_vertex> 7324 vViewPosition = - mvPosition.xyz; 7325 #include <worldpos_vertex> 7326 #include <shadowmap_vertex> 7327 #include <fog_vertex> 7328}`,n0e=`#define TOON 7329uniform vec3 diffuse; 7330uniform vec3 emissive; 7331uniform float opacity; 7332#include <common> 7333#include <packing> 7334#include <dithering_pars_fragment> 7335#include <color_pars_fragment> 7336#include <uv_pars_fragment> 7337#include <uv2_pars_fragment> 7338#include <map_pars_fragment> 7339#include <alphamap_pars_fragment> 7340#include <alphatest_pars_fragment> 7341#include <aomap_pars_fragment> 7342#include <lightmap_pars_fragment> 7343#include <emissivemap_pars_fragment> 7344#include <gradientmap_pars_fragment> 7345#include <fog_pars_fragment> 7346#include <bsdfs> 7347#include <lights_pars_begin> 7348#include <normal_pars_fragment> 7349#include <lights_toon_pars_fragment> 7350#include <shadowmap_pars_fragment> 7351#include <bumpmap_pars_fragment> 7352#include <normalmap_pars_fragment> 7353#include <logdepthbuf_pars_fragment> 7354#include <clipping_planes_pars_fragment> 7355void main() { 7356 #include <clipping_planes_fragment> 7357 vec4 diffuseColor = vec4( diffuse, opacity ); 7358 ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); 7359 vec3 totalEmissiveRadiance = emissive; 7360 #include <logdepthbuf_fragment> 7361 #include <map_fragment> 7362 #include <color_fragment> 7363 #include <alphamap_fragment> 7364 #include <alphatest_fragment> 7365 #include <normal_fragment_begin> 7366 #include <normal_fragment_maps> 7367 #include <emissivemap_fragment> 7368 #include <lights_toon_fragment> 7369 #include <lights_fragment_begin> 7370 #include <lights_fragment_maps> 7371 #include <lights_fragment_end> 7372 #include <aomap_fragment> 7373 vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; 7374 #include <output_fragment> 7375 #include <tonemapping_fragment> 7376 #include <encodings_fragment> 7377 #include <fog_fragment> 7378 #include <premultiplied_alpha_fragment> 7379 #include <dithering_fragment> 7380}`,a0e=`uniform float size; 7381uniform float scale; 7382#include <common> 7383#include <color_pars_vertex> 7384#include <fog_pars_vertex> 7385#include <morphtarget_pars_vertex> 7386#include <logdepthbuf_pars_vertex> 7387#include <clipping_planes_pars_vertex> 7388void main() { 7389 #include <color_vertex> 7390 #include <morphcolor_vertex> 7391 #include <begin_vertex> 7392 #include <morphtarget_vertex> 7393 #include <project_vertex> 7394 gl_PointSize = size; 7395 #ifdef USE_SIZEATTENUATION 7396 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 7397 if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); 7398 #endif 7399 #include <logdepthbuf_vertex> 7400 #include <clipping_planes_vertex> 7401 #include <worldpos_vertex> 7402 #include <fog_vertex> 7403}`,s0e=`uniform vec3 diffuse; 7404uniform float opacity; 7405#include <common> 7406#include <color_pars_fragment> 7407#include <map_particle_pars_fragment> 7408#include <alphatest_pars_fragment> 7409#include <fog_pars_fragment> 7410#include <logdepthbuf_pars_fragment> 7411#include <clipping_planes_pars_fragment> 7412void main() { 7413 #include <clipping_planes_fragment> 7414 vec3 outgoingLight = vec3( 0.0 ); 7415 vec4 diffuseColor = vec4( diffuse, opacity ); 7416 #include <logdepthbuf_fragment> 7417 #include <map_particle_fragment> 7418 #include <color_fragment> 7419 #include <alphatest_fragment> 7420 outgoingLight = diffuseColor.rgb; 7421 #include <output_fragment> 7422 #include <tonemapping_fragment> 7423 #include <encodings_fragment> 7424 #include <fog_fragment> 7425 #include <premultiplied_alpha_fragment> 7426}`,o0e=`#include <common> 7427#include <fog_pars_vertex> 7428#include <morphtarget_pars_vertex> 7429#include <skinning_pars_vertex> 7430#include <shadowmap_pars_vertex> 7431void main() { 7432 #include <beginnormal_vertex> 7433 #include <morphnormal_vertex> 7434 #include <skinbase_vertex> 7435 #include <skinnormal_vertex> 7436 #include <defaultnormal_vertex> 7437 #include <begin_vertex> 7438 #include <morphtarget_vertex> 7439 #include <skinning_vertex> 7440 #include <project_vertex> 7441 #include <worldpos_vertex> 7442 #include <shadowmap_vertex> 7443 #include <fog_vertex> 7444}`,l0e=`uniform vec3 color; 7445uniform float opacity; 7446#include <common> 7447#include <packing> 7448#include <fog_pars_fragment> 7449#include <bsdfs> 7450#include <lights_pars_begin> 7451#include <shadowmap_pars_fragment> 7452#include <shadowmask_pars_fragment> 7453void main() { 7454 gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); 7455 #include <tonemapping_fragment> 7456 #include <encodings_fragment> 7457 #include <fog_fragment> 7458}`,c0e=`uniform float rotation; 7459uniform vec2 center; 7460#include <common> 7461#include <uv_pars_vertex> 7462#include <fog_pars_vertex> 7463#include <logdepthbuf_pars_vertex> 7464#include <clipping_planes_pars_vertex> 7465void main() { 7466 #include <uv_vertex> 7467 vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 7468 vec2 scale; 7469 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 7470 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 7471 #ifndef USE_SIZEATTENUATION 7472 bool isPerspective = isPerspectiveMatrix( projectionMatrix ); 7473 if ( isPerspective ) scale *= - mvPosition.z; 7474 #endif 7475 vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; 7476 vec2 rotatedPosition; 7477 rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; 7478 rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; 7479 mvPosition.xy += rotatedPosition; 7480 gl_Position = projectionMatrix * mvPosition; 7481 #include <logdepthbuf_vertex> 7482 #include <clipping_planes_vertex> 7483 #include <fog_vertex> 7484}`,h0e=`uniform vec3 diffuse; 7485uniform float opacity; 7486#include <common> 7487#include <uv_pars_fragment> 7488#include <map_pars_fragment> 7489#include <alphamap_pars_fragment> 7490#include <alphatest_pars_fragment> 7491#include <fog_pars_fragment> 7492#include <logdepthbuf_pars_fragment> 7493#include <clipping_planes_pars_fragment> 7494void main() { 7495 #include <clipping_planes_fragment> 7496 vec3 outgoingLight = vec3( 0.0 ); 7497 vec4 diffuseColor = vec4( diffuse, opacity ); 7498 #include <logdepthbuf_fragment> 7499 #include <map_fragment> 7500 #include <alphamap_fragment> 7501 #include <alphatest_fragment> 7502 outgoingLight = diffuseColor.rgb; 7503 #include <output_fragment> 7504 #include <tonemapping_fragment> 7505 #include <encodings_fragment> 7506 #include <fog_fragment> 7507}`,_i={alphamap_fragment:Ppe,alphamap_pars_fragment:Lpe,alphatest_fragment:Ope,alphatest_pars_fragment:Npe,aomap_fragment:Upe,aomap_pars_fragment:Fpe,begin_vertex:kpe,beginnormal_vertex:Hpe,bsdfs:Gpe,iridescence_fragment:zpe,bumpmap_pars_fragment:Qpe,clipping_planes_fragment:Vpe,clipping_planes_pars_fragment:Wpe,clipping_planes_pars_vertex:jpe,clipping_planes_vertex:Ype,color_fragment:Kpe,color_pars_fragment:Xpe,color_pars_vertex:qpe,color_vertex:Zpe,common:Jpe,cube_uv_reflection_fragment:$pe,defaultnormal_vertex:eme,displacementmap_pars_vertex:tme,displacementmap_vertex:ime,emissivemap_fragment:rme,emissivemap_pars_fragment:nme,encodings_fragment:ame,encodings_pars_fragment:sme,envmap_fragment:ome,envmap_common_pars_fragment:lme,envmap_pars_fragment:cme,envmap_pars_vertex:hme,envmap_physical_pars_fragment:wme,envmap_vertex:ume,fog_vertex:dme,fog_pars_vertex:Ame,fog_fragment:fme,fog_pars_fragment:pme,gradientmap_pars_fragment:mme,lightmap_fragment:gme,lightmap_pars_fragment:vme,lights_lambert_fragment:_me,lights_lambert_pars_fragment:yme,lights_pars_begin:Eme,lights_toon_fragment:bme,lights_toon_pars_fragment:Sme,lights_phong_fragment:Cme,lights_phong_pars_fragment:Tme,lights_physical_fragment:Mme,lights_physical_pars_fragment:xme,lights_fragment_begin:Rme,lights_fragment_maps:Bme,lights_fragment_end:Ime,logdepthbuf_fragment:Dme,logdepthbuf_pars_fragment:Pme,logdepthbuf_pars_vertex:Lme,logdepthbuf_vertex:Ome,map_fragment:Nme,map_pars_fragment:Ume,map_particle_fragment:Fme,map_particle_pars_fragment:kme,metalnessmap_fragment:Hme,metalnessmap_pars_fragment:Gme,morphcolor_vertex:zme,morphnormal_vertex:Qme,morphtarget_pars_vertex:Vme,morphtarget_vertex:Wme,normal_fragment_begin:jme,normal_fragment_maps:Yme,normal_pars_fragment:Kme,normal_pars_vertex:Xme,normal_vertex:qme,normalmap_pars_fragment:Zme,clearcoat_normal_fragment_begin:Jme,clearcoat_normal_fragment_maps:$me,clearcoat_pars_fragment:ege,iridescence_pars_fragment:tge,output_fragment:ige,packing:rge,premultiplied_alpha_fragment:nge,project_vertex:age,dithering_fragment:sge,dithering_pars_fragment:oge,roughnessmap_fragment:lge,roughnessmap_pars_fragment:cge,shadowmap_pars_fragment:hge,shadowmap_pars_vertex:uge,shadowmap_vertex:dge,shadowmask_pars_fragment:Age,skinbase_vertex:fge,skinning_pars_vertex:pge,
vendor: 4,735 bytes, line 7507
7507skinning_vertex:mge,skinnormal_vertex:gge,specularmap_fragment:vge,specularmap_pars_fragment:_ge,tonemapping_fragment:yge,tonemapping_pars_fragment:Ege,transmission_fragment:wge,transmission_pars_fragment:bge,uv_pars_fragment:Sge,uv_pars_vertex:Cge,uv_vertex:Tge,uv2_pars_fragment:Mge,uv2_pars_vertex:xge,uv2_vertex:Rge,worldpos_vertex:Bge,background_vert:Ige,background_frag:Dge,backgroundCube_vert:Pge,backgroundCube_frag:Lge,cube_vert:Oge,cube_frag:Nge,depth_vert:Uge,depth_frag:Fge,distanceRGBA_vert:kge,distanceRGBA_frag:Hge,equirect_vert:Gge,equirect_frag:zge,linedashed_vert:Qge,linedashed_frag:Vge,meshbasic_vert:Wge,meshbasic_frag:jge,meshlambert_vert:Yge,meshlambert_frag:Kge,meshmatcap_vert:Xge,meshmatcap_frag:qge,meshnormal_vert:Zge,meshnormal_frag:Jge,meshphong_vert:$ge,meshphong_frag:e0e,meshphysical_vert:t0e,meshphysical_frag:i0e,meshtoon_vert:r0e,meshtoon_frag:n0e,points_vert:a0e,points_frag:s0e,shadow_vert:o0e,shadow_frag:l0e,sprite_vert:c0e,sprite_frag:h0e},vt={common:{diffuse:{value:new Ht(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Nn},uv2Transform:{value:new Nn},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Me(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ht(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ht(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Nn}},sprite:{diffuse:{value:new Ht(16777215)},opacity:{value:1},center:{value:new Me(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Nn}}},Wc={basic:{uniforms:Ms([vt.common,vt.specularmap,vt.envmap,vt.aomap,vt.lightmap,vt.fog]),vertexShader:_i.meshbasic_vert,fragmentShader:_i.meshbasic_frag},lambert:{uniforms:Ms([vt.common,vt.specularmap,vt.envmap,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.fog,vt.lights,{emissive:{value:new Ht(0)}}]),vertexShader:_i.meshlambert_vert,fragmentShader:_i.meshlambert_frag},phong:{uniforms:Ms([vt.common,vt.specularmap,vt.envmap,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.fog,vt.lights,{emissive:{value:new Ht(0)},specular:{value:new Ht(1118481)},shininess:{value:30}}]),vertexShader:_i.meshphong_vert,fragmentShader:_i.meshphong_frag},standard:{uniforms:Ms([vt.common,vt.envmap,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.roughnessmap,vt.metalnessmap,vt.fog,vt.lights,{emissive:{value:new Ht(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:_i.meshphysical_vert,fragmentShader:_i.meshphysical_frag},toon:{uniforms:Ms([vt.common,vt.aomap,vt.lightmap,vt.emissivemap,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.gradientmap,vt.fog,vt.lights,{emissive:{value:new Ht(0)}}]),vertexShader:_i.meshtoon_vert,fragmentShader:_i.meshtoon_frag},matcap:{uniforms:Ms([vt.common,vt.bumpmap,vt.normalmap,vt.displacementmap,vt.fog,{matc
7507ap:{value:null}}]),vertexShader:_i.meshmatcap_vert,fragmentShader:_i.meshmatcap_frag},points:{uniforms:Ms([vt.points,vt.fog]),vertexShader:_i.points_vert,fragmentShader:_i.points_frag},dashed:{uniforms:Ms([vt.common,vt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:_i.linedashed_vert,fragmentShader:_i.linedashed_frag},depth:{uniforms:Ms([vt.common,vt.displacementmap]),vertexShader:_i.depth_vert,fragmentShader:_i.depth_frag},normal:{uniforms:Ms([vt.common,vt.bumpmap,vt.normalmap,vt.displacementmap,{opacity:{value:1}}]),vertexShader:_i.meshnormal_vert,fragmentShader:_i.meshnormal_frag},sprite:{uniforms:Ms([vt.sprite,vt.fog]),vertexShader:_i.sprite_vert,fragmentShader:_i.sprite_frag},background:{uniforms:{uvTransform:{value:new Nn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:_i.background_vert,fragmentShader:_i.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:_i.backgroundCube_vert,fragmentShader:_i.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:_i.cube_vert,fragmentShader:_i.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:_i.equirect_vert,fragmentShader:_i.equirect_frag},distanceRGBA:{uniforms:Ms([vt.common,vt.displacementmap,{referencePosition:{value:new O},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:_i.distanceRGBA_vert,fragmentShader:_i.distanceRGBA_frag},shadow:{uniforms:Ms([vt.lights,vt.fog,{color:{value:new Ht(0)},opacity:{value:1}}]),vertexShader:_i.shadow_vert,fragmentShader:_i.shadow_frag}};Wc.physical={uniforms:Ms([Wc.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Me(1,1)},clearcoatNormalMap:{value:null},iridescence:{value:0},iridescenceMap:{value:null},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},sheen:{value:0},sheenColor:{value:new Ht(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Me},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Ht(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Ht(1,1,1)},specularColorMap:{value:null}}]),vertexShader:_i.meshphysical_vert,fragmentShader:_i.meshphysical_frag};var qw={r:0,b:0,g:0};function u0e(t,i,r,n,a,s,o){let l=new Ht(0),c=s===!0?0:1,h,u,d=null,A=0,f=null;function m(p,v){let _=!1,y=v.isScene===!0?v.background:null;y&&y.isTexture&&(y=(v.backgroundBlurriness>0?r:i).get(y));let w=t.xr,b=w.getSession&&w.getSession();b&&b.environmentBlendMode==="additive"&&(y=null),y===null?g(l,c):y&&y.isColor&&(g(y,1),_=!0),(t.autoClear||_)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),y&&(y.isCubeTexture||y.mapping===EE)?(u===void 0&&(u=new Zr(new gc(1,1,1),new Xi({name:"BackgroundCubeMaterial",uniforms:s0(Wc.backgroundCube.uniforms),vertexShader:Wc.backgroundCube.vertexShader,fragmentShader:Wc.backgroundCube.fragmentShader,side:Ea,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(E,M,S){this.matrixWorld.copyPosition(S.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(u)),u.material.uniforms.envMap.value=y,u.material.uniforms.flipEnvMap.value=y.isCubeTexture&&y.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=v.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,u.material.toneMapped=y.encoding!==gi,(d!==y||A!==y.version||f!==t.toneMapping)&&(u.material.needsUpdate=!0,d=y,A=y.version,f=t.toneMapping),u.layers.enableAll(),p.unshift(u,u.geometry,u.material,0,0,null)):y&&y.isTexture&&(h===void 0&&(h=new Zr(new zu(2,2),new Xi({name:"Backgroun
7507dMaterial",uniforms:s0(Wc.background.uniforms),vertexShader:Wc.background.vertexShader,fragmentShader:Wc.background.fragmentShader,side:pc,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),Object.defineProperty(h.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(h)),h.material.uniforms.t2D.value=y,h.material.uniforms.backgroundIntensity.value=v.backgroundIntensity,h.material.toneMapped=y.encoding!==gi,y.matrixAutoUpdate===!0&&y.updateMatrix(),h.material.uniforms.uvTransform.value.copy(y.matrix),(d!==y||A!==y.version||f!==t.toneMapping)&&(h.material.needsUpdate=!0,d=y,A=y.version,f=t.toneMapping),h.layers.enableAll(),p.unshift(h,h.geometry,h.material,0,0,null))}function g(p,v){p.getRGB(qw,B7(t)),n.buffers.color.setClear(qw.r,qw.g,qw.b,v,o)}return{getClearColor:function(){return l},setClearColor:function(p,v=1){l.set(p),c=v,g(l,c)},getClearAlpha:function(){return c},setClearAlpha:function(p){c=p,g(l,c)},render:m}}function d0e(t,i,r,n){let a=t.getParameter(34921),s=n.isWebGL2?null:i.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,l={},c=p(null),h=c,u=!1;function d(I,F,Y,D,U){let j=!1;if(o){let J=g(D,Y,F);h!==J&&(h=J,f(h.object)),j=v(I,D,Y,U),j&&_(I,D,Y,U)}else{let J=F.wireframe===!0;(h.geometry!==D.id||h.program!==Y.id||h.wireframe!==J)&&(h.geometry=D.id,h.program=Y.id,h.wireframe=J,j=!0)}U!==null&&r.update(U,34963),(j||u)&&(u=!1,S(I,F,Y,D),U!==null&&t.bindBuffer(34963,r.get(U).buffer))}function A(){return n.isWebGL2?t.createVertexArray():s.createVertexArrayOES()}function f(I){return n.isWebGL2?t.bindVertexArray(I):s.bindVertexArrayOES(I)}function m(I){return n.isWebGL2?t.deleteVertexArray(I):s.deleteVertexArrayOES(I)}function g(I,F,Y){let D=Y.wireframe===!0,U=l[I.id];U===void 0&&(U={},l[I.id]=U);let j=U[F.id];j===void 0&&(j={},U[F.id]=j);let J=j[D];return J===void 0&&(J=p(A()),j[D]=J),J}function p(I){let F=[],Y=[],D=[];for(let U=0;U<a;U++)F[U]=0,Y[U]=0,D[U]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:F,enabledAttributes:Y,attributeDivisors:D,object:I,attributes:{},index:null}}function v(I,F,Y,D){let U=h.attributes,j=F.attributes,J=0,z=Y.getAttributes();for(let $ in z)if(z[$].location>=0){let te=U[$],ae=j[$];if(ae===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(ae=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(ae=I.instanceColor)),te===void 0||te.attribute!==ae||ae&&te.data!==ae.data)return!0;J++}return h.attributesNum!==J||h.index!==D}function _(I,F,Y,D){let U={},j=F.attributes,J=0,z=Y.getAttributes();for(let $ in z)if(z[$].location>=0){let te=j[$];te===void 0&&($==="instanceMatrix"&&I.instanceMatrix&&(te=I.instanceMatrix),$==="instanceColor"&&I.instanceColor&&(te=I.instanceColor));let ae={};ae.attribute=te,te&&te.data&&(ae.data=te.data),U[$]=ae,J++}h.attributes=U,h.attributesNum=J,h.index=D}function y(){let I=h.newAttributes;for(let F=0,Y=I.length;F<Y;F++)I[F]=0}function w(I){b(I,0)}function b(I,F){let Y=h.newAttributes,D=h.enabledAttributes,U=h.attributeDivisors;Y[I]=1,D[I]===0&&(t.enableVertexAttribArray(I),D[I]=1),U[I]!==F&&((n.isWebGL2?t:i.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](I,F),U[I]=F)}function E(){let I=h.newAttributes,F=h.enabledAttributes;for(let Y=0,D=F.length;Y<D;Y++)F[Y]!==I[Y]&&(t.disableVertexAttribArray(Y),F[Y]=0)}function M(I,F,Y,D,U,j){n.isWebGL2===!0&&(Y===5124||Y===5125)?t.vertexAttribIPointer(I,F,Y,U,j):t.vertexAttribPointer(I,F,Y,D,U,j)}function S(I,F,Y,D){if(n.isWebGL2===!1&&(I.isInstancedMesh||D.isInstancedBufferGeometry)&&i.get("ANGLE_instanced_arrays")===null)return;y();let U=D.attributes,j=Y.getAttributes(),J=F.defaultAttributeValues;for(let z in j){let $=j[z];if($.location>=0){let te=U[z];if(te===void 0&&(z==="instanceMatrix"&&I.instanceMatrix&&(te=I.instanceMatrix),z==="instanceColor"&&I.instanceColor&&(te=I.instanceColor)),te!==void 0){let ae=te.normalized,ve=te.itemSize,oe=r.get(te);if(oe===void 0)continue;let K=oe.buffer,X=oe.type,N=oe.bytesPerElement;if(te.isInterleavedBufferAttribute){let k=te.data,Z=k.stride,V=te.offset;if(k.isInstancedInterleavedBuffer){for(let re=0;re<$.locationSize;re++)b($.location+re,k.meshPerAttribute);I.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=k.meshPerAttribute*k.count)}else for(let re=0;re<$.locationSize;re++)w($.location+re);t.bindBuffer(34962,K);for(let re=0;re<$.locationSize;re++)M($.location+re,ve/$.locationSize,X,ae,Z*N,(V+ve/$.locationSize*re)*N)}else{if(te.isInstancedBufferAttribute){for(let k=0;k<$.locationSize;k++)b($.location+k,te.meshPerAttribute);I.isInstancedMesh!==!0&&D._maxInstanceCount===void 0&&(D._maxInstanceCount=te.meshPerAttribute*te.count)}else for(let k=0;k<$.locationSize;k++)w($.location+k);t.bindBuffer(34962,K);for(let k=0;k<$.locationSize;k++)M($.location+k,ve/$.locationSize,X,ae,ve*N,ve/$.locationSize*k*N)}}else if(J!==void 0){let ae=J[z];if(ae!==void 0)switch(ae.length){case 2:t.vertexAttrib2fv($.location,ae);break;case 3:t.vertexAttrib3fv($.location,ae);break;case 4:t.vertexAttrib4fv($.location,ae);break;default:t.vertexAttrib1fv($.location,ae)}}}}E()}function T(){R();for(let I in l){let F=l[I];for(let Y in F){let D=F[Y];for(let U in D)m(D[U].object),delete D[U];delete F[Y]}delete l[I]}}
7507function C(I){if(l[I.id]===void 0)return;let F=l[I.id];for(let Y in F){let D=F[Y];for(let U in D)m(D[U].object),delete D[U];delete F[Y]}delete l[I.id]}function x(I){for(let F in l){let Y=l[F];if(Y[I.id]===void 0)continue;let D=Y[I.id];for(let U in D)m(D[U].object),delete D[U];delete Y[I.id]}}function R(){L(),u=!0,h!==c&&(h=c,f(h.object))}function L(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:d,reset:R,resetDefaultState:L,dispose:T,releaseStatesOfGeometry:C,releaseStatesOfProgram:x,initAttributes:y,enableAttribute:w,disableUnusedAttributes:E}}function A0e(t,i,r,n){let a=n.isWebGL2,s;function o(h){s=h}function l(h,u){t.drawArrays(s,h,u),r.update(u,s,1)}function c(h,u,d){if(d===0)return;let A,f;if(a)A=t,f="drawArraysInstanced";else if(A=i.get("ANGLE_instanced_arrays"),f="drawArraysInstancedANGLE",A===null){console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}A[f](s,h,u,d),r.update(u,s,d)}this.setMode=o,this.render=l,this.renderInstances=c}function f0e(t,i,r){let n;function a(){if(n!==void 0)return n;if(i.has("EXT_texture_filter_anisotropic")===!0){let M=i.get("EXT_texture_filter_anisotropic");n=t.getParameter(M.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n}function s(M){if(M==="highp"){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";M="mediump"}return M==="mediump"&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}let o=typeof WebGL2RenderingContext<"u"&&t instanceof WebGL2RenderingContext,l=r.precision!==void 0?r.precision:"highp",c=s(l);c!==l&&(console.warn("THREE.WebGLRenderer:",l,"not supported, using",c,"instead."),l=c);let h=o||i.has("WEBGL_draw_buffers"),u=r.logarithmicDepthBuffer===!0,d=t.getParameter(34930),A=t.getParameter(35660),f=t.getParameter(3379),m=t.getParameter(34076),g=t.getParameter(34921),p=t.getParameter(36347),v=t.getParameter(36348),_=t.getParameter(36349),y=A>0,w=o||i.has("OES_texture_float"),b=y&&w,E=o?t.getParameter(36183):0;return{isWebGL2:o,drawBuffers:h,getMaxAnisotropy:a,getMaxPrecision:s,precision:l,logarithmicDepthBuffer:u,maxTextures:d,maxVertexTextures:A,maxTextureSize:f,maxCubemapSize:m,maxAttributes:g,maxVertexUniforms:p,maxVaryings:v,maxFragmentUniforms:_,vertexTextures:y,floatFragmentTextures:w,floatVertexTextures:b,maxSamples:E}}function p0e(t){let i=this,r=null,n=0,a=!1,s=!1,o=new eo,l=new Nn,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,A){let f=d.length!==0||A||n!==0||a;return a=A,n=d.length,f},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,A){r=u(d,A,0)},this.setState=function(d,A,f){let m=d.clippingPlanes,g=d.clipIntersection,p=d.clipShadows,v=t.get(d);if(!a||m===null||m.length===0||s&&!p)s?u(null):h();else{let _=s?0:n,y=_*4,w=v.clippingState||null;c.value=w,w=u(m,A,y,f);for(let b=0;b!==y;++b)w[b]=r[b];v.clippingState=w,this.numIntersection=g?this.numPlanes:0,this.numPlanes+=_}};function h(){c.value!==r&&(c.value=r,c.needsUpdate=n>0),i.numPlanes=n,i.numIntersection=0}function u(d,A,f,m){let g=d!==null?d.length:0,p=null;if(g!==0){if(p=c.value,m!==!0||p===null){let v=f+g*4,_=A.matrixWorldInverse;l.getNormalMatrix(_),(p===null||p.length<v)&&(p=new Float32Array(v));for(let y=0,w=f;y!==g;++y,w+=4)o.copy(d[y]).applyMatrix4(_,l),o.normal.toArray(p,w),p[w+3]=o.constant}c.value=p,c.needsUpdate=!0}return i.numPlanes=g,i.numIntersection=0,p}}function m0e(t){let i=new WeakMap;function r(o,l){return l===rP?o.mapping=cp:l===nP&&(o.mapping=hp),o}function n(o){if(o&&o.isTexture&&o.isRenderTargetTexture===!1){let l=o.mapping;if(l===rP||l===nP)if(i.has(o)){let c=i.get(o).texture;return r(c,o.mapping)}else{let c=o.image;if(c&&c.height>0){let h=new Rpe(c.height/2);return h.fromEquirectangularTexture(t,o),i.set(o,h),o.addEventListener("dispose",a),r(h.texture,o.mapping)}else return null}}return o}function a(o){let l=o.target;l.removeEventListener("dispose",a);let c=i.get(l);c!==void 0&&(i.delete(l),c.dispose())}function s(){i=new WeakMap}return{get:n,dispose:s}}var oM=class extends Bp{constructor(t=-1,i=1,r=1,n=-1,a=.1,s=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
7507phicCamera",this.zoom=1,this.view=null,this.left=t,this.right=i,this.top=r,this.bottom=n,this.near=a,this.far=s,this.updateProjectionMatrix()}copy(t,i){return super.copy(t,i),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=t.view===null?null:Object.assign({},t.view),this}setViewOffset(t,i,r,n,a,s){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=i,this.view.offsetX=r,this.view.offsetY=n,this.view.width=a,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){let t=(this.right-this.left)/(2*this.zoom),i=(this.top-this.bottom)/(2*this.zoom),r=(this.right+this.left)/2,n=(this.top+this.bottom)/2,a=r-t,s=r+t,o=n+i,l=n-i;if(this.view!==null&&this.view.enabled){let c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=c*this.view.offsetX,s=a+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(a,s,o,l,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){let i=super.toJSON(t);return i.object.zoom=this.zoom,i.object.left=this.left,i.object.right=this.right,i.object.top=this.top,i.object.bottom=this.bottom,i.object.near=this.near,i.object.far=this.far,this.view!==null&&(i.object.view=Object.assign({},this.view)),i}},dg=4,tG=[.125,.215,.35,.446,.526,.582],wf=20,XB=new oM,iG=new Ht,qB=null,pf=(1+Math.sqrt(5))/2,Tm=1/pf,rG=[new O(1,1,1),new O(-1,1,1),new O(1,1,-1),new O(-1,1,-1),new O(0,pf,Tm),new O(0,pf,-Tm),new O(Tm,0,pf),new O(-Tm,0,pf),new O(pf,Tm,0),new O(-pf,Tm,0)],nG=class{constructor(t){this._renderer=t,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(t,i=0,r=.1,n=100){qB=this._renderer.getRenderTarget(),this._setSize(256);let a=this._allocateTargets();return a.depthBuffer=!0,this._sceneToCubeUV(t,r,n,a),i>0&&this._blur(a,0,0,i),this._applyPMREM(a),this._cleanup(a),a}fromEquirectangular(t,i=null){return this._fromTexture(t,i)}fromCubemap(t,i=null){return this._fromTexture(t,i)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=oG(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=sG(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(qB),t.scissorTest=!1,Zw(t,0,0,t.width,t.height)}_fromTexture(t,i){t.mapping===cp||t.mapping===hp?this._setSize(t.image.length===0?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),qB=this._renderer.getRenderTarget();let r=i||this._allocateTargets();return this._textureToCubeUV(t,r),this._applyPMREM(r),this._cleanup(r),r}_allocateTargets(){let t=3*Math.max(this._cubeSize,112),i=4*this._cubeSize,r={magFilter:Ei,minFilter:Ei,generateMipmaps:!1,type:Hu,format:_a,encoding:mc,depthBuffer:!1},n=aG(t,i,r);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==t||this._pingPongRenderTarget.height!==i){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=aG(t,i,r);let{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=g0e(a)),this._blurMaterial=v0e(a,t,i)}return n}_compileMaterial(t){let i=new Zr(this._lodPlanes[0],t);this._renderer.compile(i,XB)}_sceneToCubeUV(t,i,r,n){let a=new as(90,1,i,r),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],l=this._renderer,c=l.autoClear,h=l.toneMapping;l.getClearColor(iG),l.toneMapping=lh,l.autoClear=!1;
vendor: 5,038 bytes, lines 7507-7567
7507let u=new Gu({name:"PMREM.Background",side:Ea,depthWrite:!1,depthTest:!1}),d=new Zr(new gc,u),A=!1,f=t.background;f?f.isColor&&(u.color.copy(f),t.background=null,A=!0):(u.color.copy(iG),A=!0);for(let m=0;m<6;m++){let g=m%3;g===0?(a.up.set(0,s[m],0),a.lookAt(o[m],0,0)):g===1?(a.up.set(0,0,s[m]),a.lookAt(0,o[m],0)):(a.up.set(0,s[m],0),a.lookAt(0,0,o[m]));let p=this._cubeSize;Zw(n,g*p,m>2?p:0,p,p),l.setRenderTarget(n),A&&l.render(d,a),l.render(t,a)}d.geometry.dispose(),d.material.dispose(),l.toneMapping=h,l.autoClear=c,t.background=f}_textureToCubeUV(t,i){let r=this._renderer,n=t.mapping===cp||t.mapping===hp;n?(this._cubemapMaterial===null&&(this._cubemapMaterial=oG()),this._cubemapMaterial.uniforms.flipEnvMap.value=t.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=sG());let a=n?this._cubemapMaterial:this._equirectMaterial,s=new Zr(this._lodPlanes[0],a),o=a.uniforms;o.envMap.value=t;let l=this._cubeSize;Zw(i,0,0,3*l,2*l),r.setRenderTarget(i),r.render(s,XB)}_applyPMREM(t){let i=this._renderer,r=i.autoClear;i.autoClear=!1;for(let n=1;n<this._lodPlanes.length;n++){let a=Math.sqrt(this._sigmas[n]*this._sigmas[n]-this._sigmas[n-1]*this._sigmas[n-1]),s=rG[(n-1)%rG.length];this._blur(t,n-1,n,a,s)}i.autoClear=r}_blur(t,i,r,n,a){let s=this._pingPongRenderTarget;this._halfBlur(t,s,i,r,n,"latitudinal",a),this._halfBlur(s,t,r,r,n,"longitudinal",a)}_halfBlur(t,i,r,n,a,s,o){let l=this._renderer,c=this._blurMaterial;s!=="latitudinal"&&s!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");let h=3,u=new Zr(this._lodPlanes[n],c),d=c.uniforms,A=this._sizeLods[r]-1,f=isFinite(a)?Math.PI/(2*A):2*Math.PI/(2*wf-1),m=a/f,g=isFinite(a)?1+Math.floor(h*m):wf;g>wf&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${wf}`);let p=[],v=0;for(let E=0;E<wf;++E){let M=E/m,S=Math.exp(-M*M/2);p.push(S),E===0?v+=S:E<g&&(v+=2*S)}for(let E=0;E<p.length;E++)p[E]=p[E]/v;d.envMap.value=t.texture,d.samples.value=g,d.weights.value=p,d.latitudinal.value=s==="latitudinal",o&&(d.poleAxis.value=o);let{_lodMax:_}=this;d.dTheta.value=f,d.mipInt.value=_-r;let y=this._sizeLods[n],w=3*y*(n>_-dg?n-_+dg:0),b=4*(this._cubeSize-y);Zw(i,w,b,3*y,2*y),l.setRenderTarget(i),l.render(u,XB)}};function g0e(t){let i=[],r=[],n=[],a=t,s=t-dg+1+tG.length;for(let o=0;o<s;o++){let l=Math.pow(2,a);r.push(l);let c=1/l;o>t-dg?c=tG[o-t+dg-1]:o===0&&(c=0),n.push(c);let h=1/(l-2),u=-h,d=1+h,A=[u,u,d,u,d,d,u,u,d,d,u,d],f=6,m=6,g=3,p=2,v=1,_=new Float32Array(g*m*f),y=new Float32Array(p*m*f),w=new Float32Array(v*m*f);for(let E=0;E<f;E++){let M=E%3*2/3-1,S=E>2?0:-1,T=[M,S,0,M+2/3,S,0,M+2/3,S+1,0,M,S,0,M+2/3,S+1,0,M,S+1,0];_.set(T,g*m*E),y.set(A,p*m*E);let C=[E,E,E,E,E,E];w.set(C,v*m*E)}let b=new Lt;b.setAttribute("position",new ei(_,g)),b.setAttribute("uv",new ei(y,p)),b.setAttribute("faceIndex",new ei(w,v)),i.push(b),a>dg&&a--}return{lodPlanes:i,sizeLods:r,sigmas:n}}function aG(t,i,r){let n=new $i(t,i,r);return n.texture.mapping=EE,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Zw(t,i,r,n,a){t.viewport.set(i,r,n,a),t.scissor.set(i,r,n,a)}function v0e(t,i,r){let n=new Float32Array(wf),a=new O(0,1,0);return new Xi({name:"SphericalGaussianBlur",defines:{n:wf,CUBEUV_TEXEL_WIDTH:1/i,CUBEUV_TEXEL_HEIGHT:1/r,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:lN(),fragmentShader:` 7508 7509 precision mediump float; 7510 precision mediump int; 7511 7512 varying vec3 vOutputDirection; 7513 7514 uniform sampler2D envMap; 7515 uniform int samples; 7516 uniform float weights[ n ]; 7517 uniform bool latitudinal; 7518 uniform float dTheta; 7519 uniform float mipInt; 7520 uniform vec3 poleAxis; 7521 7522 #define ENVMAP_TYPE_CUBE_UV 7523 #include <cube_uv_reflection_fragment> 7524 7525 vec3 getSample( float theta, vec3 axis ) { 7526 7527 float cosTheta = cos( theta ); 7528 // Rodrigues' axis-angle rotation 7529 vec3 sampleDirection = vOutputDirection * cosTheta 7530 + cross( axis, vOutputDirection ) * sin( theta ) 7531 + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); 7532 7533 return bilinearCubeUV( envMap, sampleDirection, mipInt ); 7534 7535 } 7536 7537 void main() { 7538 7539 vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); 7540 7541 if ( all( equal( axis, vec3( 0.0 ) ) ) ) { 7542 7543 axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); 7544 7545 } 7546 7547 axis = normalize( axis ); 7548 7549 gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); 7550 gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); 7551 7552 for ( int i = 1; i < n; i++ ) { 7553 7554 if ( i >= samples ) { 7555 7556 break; 7557 7558 } 7559 7560 float theta = dTheta * float( i ); 7561 gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); 7562 gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); 7563 7564 } 7565 7566 } 7567 `,blending:Un,depthTest:!1,depthWrite:!1})}function sG(){return new Xi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}}
7567,vertexShader:lN(),fragmentShader:` 7568 7569 precision mediump float; 7570 precision mediump int; 7571 7572 varying vec3 vOutputDirection; 7573 7574 uniform sampler2D envMap; 7575 7576 #include <common> 7577 7578 void main() { 7579 7580 vec3 outputDirection = normalize( vOutputDirection ); 7581 vec2 uv = equirectUv( outputDirection ); 7582 7583 gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); 7584 7585 } 7586 `,blending:Un,depthTest:!1,depthWrite:!1})}function oG(){return new Xi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:lN(),fragmentShader:` 7587 7588 precision mediump float; 7589 precision mediump int; 7590 7591 uniform float flipEnvMap; 7592 7593 varying vec3 vOutputDirection; 7594 7595 uniform samplerCube envMap; 7596 7597 void main() { 7598 7599 gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); 7600 7601 } 7602 `,blending:Un,depthTest:!1,depthWrite:!1})}function lN(){return` 7603 7604 precision mediump float; 7605 precision mediump int; 7606 7607 attribute float faceIndex; 7608 7609 varying vec3 vOutputDirection; 7610 7611 // RH coordinate system; PMREM face-indexing convention 7612 vec3 getDirection( vec2 uv, float face ) { 7613 7614 uv = 2.0 * uv - 1.0; 7615 7616 vec3 direction = vec3( uv, 1.0 ); 7617 7618 if ( face == 0.0 ) { 7619 7620 direction = direction.zyx; // ( 1, v, u ) pos x 7621 7622 } else if ( face == 1.0 ) { 7623 7624 direction = direction.xzy; 7625 direction.xz *= -1.0; // ( -u, 1, -v ) pos y 7626 7627 } else if ( face == 2.0 ) { 7628 7629 direction.x *= -1.0; // ( -u, v, 1 ) pos z 7630 7631 } else if ( face == 3.0 ) { 7632 7633 direction = direction.zyx; 7634 direction.xz *= -1.0; // ( -1, v, -u ) neg x 7635 7636 } else if ( face == 4.0 ) { 7637 7638 direction = direction.xzy; 7639 direction.xy *= -1.0; // ( -u, -1, v ) neg y 7640 7641 } else if ( face == 5.0 ) { 7642 7643 direction.z *= -1.0; // ( u, v, -1 ) neg z 7644 7645 } 7646 7647 return direction; 7648 7649 } 7650 7651 void main() { 7652 7653 vOutputDirection = getDirection( uv, faceIndex ); 7654 gl_Position = vec4( position, 1.0 ); 7655 7656 } 7657 `}function _0e(t){let i=new WeakMap,r=null;function n(l){if(l&&l.isTexture){let c=l.mapping,h=c===rP||c===nP,u=c===cp||c===hp;if(h||u)if(l.isRenderTargetTexture&&l.needsPMREMUpdate===!0){l.needsPMREMUpdate=!1;let d=i.get(l);return r===null&&(r=new nG(t)),d=h?r.fromEquirectangular(l,d):r.fromCubemap(l,d),i.set(l,d),d.texture}else{if(i.has(l))return i.get(l).texture;{let d=l.image;if(h&&d&&d.height>0||u&&d&&a(d)){r===null&&(r=new nG(t));let A=h?r.fromEquirectangular(l):r.fromCubemap(l);return i.set(l,A),l.addEventListener("dispose",s),A.texture}else return null}}}return l}function a(l){let c=0,h=6;for(let u=0;u<h;u++)l[u]!==void 0&&c++;return c===h}function s(l){let c=l.target;c.removeEventListener("dispose",s);let h=i.get(c);h!==void 0&&(i.delete(c),h.dispose())}function o(){i=new WeakMap,r!==null&&(r.dispose(),r=null)}return{get:n,dispose:o}}function y0e(t){let i={};function r(n){if(i[n]!==void 0)return i[n];let a;switch(n){case"WEBGL_depth_texture":a=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":a=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":a=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:a=t.getExtension(n)}return i[n]=a,a}return{has:function(n){return r(n)!==null},init:function(n){n.isWebGL2?r("EXT_color_buffer_float"):(r("WEBGL_depth_texture"),r("OES_texture_float"),r("OES_texture_half_float"),r("OES_texture_half_float_linear"),r("OES_standard_derivatives"),r("OES_element_index_uint"),r("OES_vertex_array_object"),r("ANGLE_instanced_arrays")),r("OES_texture_float_linear"),r("EXT_color_buffer_half_float"),r("WEBGL_multisampled_render_to_texture")},get:function(n){let a=r(n);return a===null&&console.warn("THREE.WebGLRenderer: "+n+" extension not supported."),a}}}function E0e(t,i,r,n){let a={},s=new WeakMap;function o(d){let A=d.target;A.index!==null&&i.remove(A.index);for(let m in A.attributes)i.remove(A.attributes[m]);A.removeEventListener("dispose",o),delete a[A.id];let f=s.get(A);
7657f&&(i.remove(f),s.delete(A)),n.releaseStatesOfGeometry(A),A.isInstancedBufferGeometry===!0&&delete A._maxInstanceCount,r.memory.geometries--}function l(d,A){return a[A.id]===!0||(A.addEventListener("dispose",o),a[A.id]=!0,r.memory.geometries++),A}function c(d){let A=d.attributes;for(let m in A)i.update(A[m],34962);let f=d.morphAttributes;for(let m in f){let g=f[m];for(let p=0,v=g.length;p<v;p++)i.update(g[p],34962)}}function h(d){let A=[],f=d.index,m=d.attributes.position,g=0;if(f!==null){let _=f.array;g=f.version;for(let y=0,w=_.length;y<w;y+=3){let b=_[y+0],E=_[y+1],M=_[y+2];A.push(b,E,E,M,M,b)}}else{let _=m.array;g=m.version;for(let y=0,w=_.length/3-1;y<w;y+=3){let b=y+0,E=y+1,M=y+2;A.push(b,E,E,M,M,b)}}let p=new(S7(A)?Rg:R7)(A,1);p.version=g;let v=s.get(d);v&&i.remove(v),s.set(d,p)}function u(d){let A=s.get(d);if(A){let f=d.index;f!==null&&A.version<f.version&&h(d)}else h(d);return s.get(d)}return{get:l,update:c,getWireframeAttribute:u}}function w0e(t,i,r,n){let a=n.isWebGL2,s;function o(A){s=A}let l,c;function h(A){l=A.type,c=A.bytesPerElement}function u(A,f){t.drawElements(s,f,l,A*c),r.update(f,s,1)}function d(A,f,m){if(m===0)return;let g,p;if(a)g=t,p="drawElementsInstanced";else if(g=i.get("ANGLE_instanced_arrays"),p="drawElementsInstancedANGLE",g===null){console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");return}g[p](s,f,l,A*c,m),r.update(f,s,m)}this.setMode=o,this.setIndex=h,this.render=u,this.renderInstances=d}function b0e(t){let i={geometries:0,textures:0},r={frame:0,calls:0,triangles:0,points:0,lines:0};function n(s,o,l){switch(r.calls++,o){case 4:r.triangles+=l*(s/3);break;case 1:r.lines+=l*(s/2);break;case 3:r.lines+=l*(s-1);break;case 2:r.lines+=l*s;break;case 0:r.points+=l*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",o);break}}function a(){r.frame++,r.calls=0,r.triangles=0,r.points=0,r.lines=0}return{memory:i,render:r,programs:null,autoReset:!0,reset:a,update:n}}function S0e(t,i){return t[0]-i[0]}function C0e(t,i){return Math.abs(i[1])-Math.abs(t[1])}function T0e(t,i,r){let n={},a=new Float32Array(8),s=new WeakMap,o=new ai,l=[];for(let h=0;h<8;h++)l[h]=[h,0];function c(h,u,d,A){let f=h.morphTargetInfluences;
7657if(i.isWebGL2===!0){let m=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,g=m!==void 0?m.length:0,p=s.get(u);if(p===void 0||p.count!==g){let y=function(){I.dispose(),s.delete(u),u.removeEventListener("dispose",y)};p!==void 0&&p.texture.dispose();let w=u.morphAttributes.position!==void 0,b=u.morphAttributes.normal!==void 0,E=u.morphAttributes.color!==void 0,M=u.morphAttributes.position||[],S=u.morphAttributes.normal||[],T=u.morphAttributes.color||[],C=0;w===!0&&(C=1),b===!0&&(C=2),E===!0&&(C=3);let x=u.attributes.position.count*C,R=1;x>i.maxTextureSize&&(R=Math.ceil(x/i.maxTextureSize),x=i.maxTextureSize);let L=new Float32Array(x*R*4*g),I=new x7(L,x,R,g);I.type=On,I.needsUpdate=!0;let F=C*4;for(let Y=0;Y<g;Y++){let D=M[Y],U=S[Y],j=T[Y],J=x*R*4*Y;for(let z=0;z<D.count;z++){let $=z*F;w===!0&&(o.fromBufferAttribute(D,z),L[J+$+0]=o.x,L[J+$+1]=o.y,L[J+$+2]=o.z,L[J+$+3]=0),b===!0&&(o.fromBufferAttribute(U,z),L[J+$+4]=o.x,L[J+$+5]=o.y,L[J+$+6]=o.z,L[J+$+7]=0),E===!0&&(o.fromBufferAttribute(j,z),L[J+$+8]=o.x,L[J+$+9]=o.y,L[J+$+10]=o.z,L[J+$+11]=j.itemSize===4?o.w:1)}}p={count:g,texture:I,size:new Me(x,R)},s.set(u,p),u.addEventListener("dispose",y)}let v=0;for(let y=0;y<f.length;y++)v+=f[y];let _=u.morphTargetsRelative?1:1-v;A.getUniforms().setValue(t,"morphTargetBaseInfluence",_),A.getUniforms().setValue(t,"morphTargetInfluences",f),A.getUniforms().setValue(t,"morphTargetsTexture",p.texture,r),A.getUniforms().setValue(t,"morphTargetsTextureSize",p.size)}else{let m=f===void 0?0:f.length,g=n[u.id];if(g===void 0||g.length!==m){g=[];for(let w=0;w<m;w++)g[w]=[w,0];n[u.id]=g}for(let w=0;w<m;w++){let b=g[w];b[0]=w,b[1]=f[w]}g.sort(C0e);for(let w=0;w<8;w++)w<m&&g[w][1]?(l[w][0]=g[w][0],l[w][1]=g[w][1]):(l[w][0]=Number.MAX_SAFE_INTEGER,l[w][1]=0);l.sort(S0e);let p=u.morphAttributes.position,v=u.morphAttributes.normal,_=0;for(let w=0;w<8;w++){let b=l[w],E=b[0],M=b[1];E!==Number.MAX_SAFE_INTEGER&&M?(p&&u.getAttribute("morphTarget"+w)!==p[E]&&u.setAttribute("morphTarget"+w,p[E]),v&&u.getAttribute("morphNormal"+w)!==v[E]&&u.setAttribute("morphNormal"+w,v[E]),a[w]=M,_+=M):(p&&u.hasAttribute("morphTarget"+w)===!0&&u.deleteAttribute("morphTarget"+w),v&&u.hasAttribute("morphNormal"+w)===!0&&u.deleteAttribute("morphNormal"+w),a[w]=0)}let y=u.morphTargetsRelative?1:1-_;A.getUniforms().setValue(t,"morphTargetBaseInfluence",y),A.getUniforms().setValue(t,"morphTargetInfluences",a)}}return{update:c}}function M0e(t,i,r,n){let a=new WeakMap;function s(c){let h=n.render.frame,u=c.geometry,d=i.get(c,u);return a.get(d)!==h&&(i.update(d),a.set(d,h)),c.isInstancedMesh&&(c.hasEventListener("dispose",l)===!1&&c.addEventListener("dispose",l),r.update(c.instanceMatrix,34962),c.instanceColor!==null&&r.update(c.instanceColor,34962)),d}function o(){a=new WeakMap}function l(c){let h=c.target;h.removeEventListener("dispose",l),r.remove(h.instanceMatrix),h.instanceColor!==null&&r.remove(h.instanceColor)}return{update:s,dispose:o}}var D7=new en,P7=new x7,L7=new Ape,O7=new sN,lG=[],cG=[],hG=new Float32Array(16),uG=new Float32Array(9),dG=new Float32Array(4);function N0(t,i,r){let n=t[0];if(n<=0||n>0)return t;let a=i*r,s=lG[a];if(s===void 0&&(s=new Float32Array(a),lG[a]=s),i!==0){n.toArray(s,0);for(let o=1,l=0;o!==i;++o)l+=r,t[o].toArray(s,l)}return s}function ta(t,i){if(t.length!==i.length)return!1;for(let r=0,n=t.length;r<n;r++)if(t[r]!==i[r])return!1;return!0}function ia(t,i){for(let r=0,n=i.length;r<n;r++)t[r]=i[r]}function lM(t,i){let r=cG[i];r===void 0&&(r=new Int32Array(i),cG[i]=r);for(let n=0;n!==i;++n)r[n]=t.allocateTextureUnit();return r}function x0e(t,i){let r=this.cache;r[0]!==i&&(t.uniform1f(this.addr,i),r[0]=i)}function R0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y)&&(t.uniform2f(this.addr,i.x,i.y),r[0]=i.x,r[1]=i.y);else{if(ta(r,i))return;t.uniform2fv(this.addr,i),ia(r,i)}}function B0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z)&&(t.uniform3f(this.addr,i.x,i.y,i.z),r[0]=i.x,r[1]=i.y,r[2]=i.z);else if(i.r!==void 0)(r[0]!==i.r||r[1]!==i.g||r[2]!==i.b)&&(t.uniform3f(this.addr,i.r,i.g,i.b),r[0]=i.r,r[1]=i.g,r[2]=i.b);else{if(ta(r,i))return;t.uniform3fv(this.addr,i),ia(r,i)}}function I0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z||r[3]!==i.w)&&(t.uniform4f(this.addr,i.x,i.y,i.z,i.w),r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=i.w);else{if(ta(r,i))return;t.uniform4fv(this.addr,i),ia(r,i)}}function D0e(t,i){let r=this.cache,n=i.elements;if(n===void 0){if(ta(r,i))return;t.uniformMatrix2fv(this.addr,!1,i),ia(r,i)}else{if(ta(r,n))return;dG.set(n),t.uniformMatrix2fv(this.addr,!1,dG),ia(r,n)}}function P0e(t,i){let r=this.cache,n=i.elements;if(n===void 0){if(ta(r,i))return;t.uniformMatrix3fv(this.addr,!1,i),ia(r,i)}else{if(ta(r,n))return;uG.set(n),t.uniformMatrix3fv(this.addr,!1,uG),ia(r,n)}}function L0e(t,i){let r=this.cache,n=i.elements;if(n===void 0){if(ta(r,i))return;t.uniformMatrix4fv(this.addr,!1,i),ia(r,i)}else{if(ta(r,n))return;hG.set(n),t.uniformMatrix4fv(this.addr,!1,hG),ia(r,n)}}function O0e(t,i){let r=this.cache;r[0]!==i&&(t.uniform1i(this.addr,i),r[0]=i)}function N0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y)&&(t.uniform2i(this.addr,i.x,i.y),r[0]=i.x,r[1]=i.y);else{if(ta(r,i))return;t.uniform2iv(this.addr,i),ia(r,i)}}function U0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z)&&(t.uniform3i(this.addr,i.x,i.y,i.z),r[0]=i.x,r[1]=i.y,r[2]=i.z);else{if(ta(r,i))return;t.uniform3iv(this.addr,i),ia(r,i)}}
7657function F0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z||r[3]!==i.w)&&(t.uniform4i(this.addr,i.x,i.y,i.z,i.w),r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=i.w);else{if(ta(r,i))return;t.uniform4iv(this.addr,i),ia(r,i)}}function k0e(t,i){let r=this.cache;r[0]!==i&&(t.uniform1ui(this.addr,i),r[0]=i)}function H0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y)&&(t.uniform2ui(this.addr,i.x,i.y),r[0]=i.x,r[1]=i.y);else{if(ta(r,i))return;t.uniform2uiv(this.addr,i),ia(r,i)}}function G0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z)&&(t.uniform3ui(this.addr,i.x,i.y,i.z),r[0]=i.x,r[1]=i.y,r[2]=i.z);else{if(ta(r,i))return;t.uniform3uiv(this.addr,i),ia(r,i)}}function z0e(t,i){let r=this.cache;if(i.x!==void 0)(r[0]!==i.x||r[1]!==i.y||r[2]!==i.z||r[3]!==i.w)&&(t.uniform4ui(this.addr,i.x,i.y,i.z,i.w),r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=i.w);else{if(ta(r,i))return;t.uniform4uiv(this.addr,i),ia(r,i)}}function Q0e(t,i,r){let n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTexture2D(i||D7,a)}function V0e(t,i,r){let n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTexture3D(i||L7,a)}function W0e(t,i,r){let n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTextureCube(i||O7,a)}function j0e(t,i,r){let n=this.cache,a=r.allocateTextureUnit();n[0]!==a&&(t.uniform1i(this.addr,a),n[0]=a),r.setTexture2DArray(i||P7,a)}function Y0e(t){switch(t){case 5126:return x0e;case 35664:return R0e;case 35665:return B0e;case 35666:return I0e;case 35674:return D0e;case 35675:return P0e;case 35676:return L0e;case 5124:case 35670:return O0e;case 35667:case 35671:return N0e;case 35668:case 35672:return U0e;case 35669:case 35673:return F0e;case 5125:return k0e;case 36294:return H0e;case 36295:return G0e;case 36296:return z0e;case 35678:case 36198:case 36298:case 36306:case 35682:return Q0e;case 35679:case 36299:case 36307:return V0e;case 35680:case 36300:case 36308:case 36293:return W0e;case 36289:case 36303:case 36311:case 36292:return j0e}}function K0e(t,i){t.uniform1fv(this.addr,i)}function X0e(t,i){let r=N0(i,this.size,2);t.uniform2fv(this.addr,r)}function q0e(t,i){let r=N0(i,this.size,3);t.uniform3fv(this.addr,r)}function Z0e(t,i){let r=N0(i,this.size,4);t.uniform4fv(this.addr,r)}function J0e(t,i){let r=N0(i,this.size,4);t.uniformMatrix2fv(this.addr,!1,r)}function $0e(t,i){let r=N0(i,this.size,9);t.uniformMatrix3fv(this.addr,!1,r)}function eve(t,i){let r=N0(i,this.size,16);t.uniformMatrix4fv(this.addr,!1,r)}function tve(t,i){t.uniform1iv(this.addr,i)}function ive(t,i){t.uniform2iv(this.addr,i)}function rve(t,i){t.uniform3iv(this.addr,i)}function nve(t,i){t.uniform4iv(this.addr,i)}function ave(t,i){t.uniform1uiv(this.addr,i)}function sve(t,i){t.uniform2uiv(this.addr,i)}function ove(t,i){t.uniform3uiv(this.addr,i)}function lve(t,i){t.uniform4uiv(this.addr,i)}function cve(t,i,r){let n=this.cache,a=i.length,s=lM(r,a);ta(n,s)||(t.uniform1iv(this.addr,s),ia(n,s));for(let o=0;o!==a;++o)r.setTexture2D(i[o]||D7,s[o])}function hve(t,i,r){let n=this.cache,a=i.length,s=lM(r,a);ta(n,s)||(t.uniform1iv(this.addr,s),ia(n,s));for(let o=0;o!==a;++o)r.setTexture3D(i[o]||L7,s[o])}function uve(t,i,r){let n=this.cache,a=i.length,s=lM(r,a);ta(n,s)||(t.uniform1iv(this.addr,s),ia(n,s));for(let o=0;o!==a;++o)r.setTextureCube(i[o]||O7,s[o])}function dve(t,i,r){let n=this.cache,a=i.length,s=lM(r,a);ta(n,s)||(t.uniform1iv(this.addr,s),ia(n,s));for(let o=0;o!==a;++o)r.setTexture2DArray(i[o]||P7,s[o])}function Ave(t){switch(t){case 5126:return K0e;case 35664:return X0e;case 35665:return q0e;case 35666:return Z0e;case 35674:return J0e;case 35675:return $0e;case 35676:return eve;case 5124:case 35670:return tve;case 35667:case 35671:return ive;case 35668:case 35672:return rve;case 35669:case 35673:return nve;case 5125:return ave;case 36294:return sve;case 36295:return ove;case 36296:return lve;case 35678:case 36198:case 36298:case 36306:case 35682:return cve;case 35679:case 36299:case 36307:return hve;case 35680:case 36300:case 36308:case 36293:return uve;case 36289:case 36303:case 36311:case 36292:return dve}}var fve=class{constructor(t,i,r){this.id=t,this.addr=r,this.cache=[],this.setValue=Y0e(i.type)}},pve=class{constructor(t,i,r){this.id=t,this.addr=r,this.cache=[],this.size=i.size,this.setValue=Ave(i.type)}},mve=class{constructor(t){this.id=t,this.seq=[],this.map={}}setValue(t,i,r){let n=this.seq;for(let a=0,s=n.length;a!==s;++a){let o=n[a];o.setValue(t,i[o.id],r)}}},ZB=/(\w+)(\])?(\[|\.)?/g;function AG(t,i){t.seq.push(i),t.map[i.id]=i}function gve(t,i,r){let n=t.name,a=n.length;for(ZB.lastIndex=0;;){let s=ZB.exec(n),o=ZB.lastIndex,l=s[1],c=s[2]==="]",h=s[3];if(c&&(l=l|0),h===void 0||h==="["&&o+2===a){AG(r,h===void 0?new fve(l,t,i):new pve(l,t,i));break}else{let u=r.map[l];u===void 0&&(u=new mve(l),AG(r,u)),r=u}}}var CS=class{constructor(t,i){this.seq=[],this.map={};let r=t.getProgramParameter(i,35718);for(let n=0;n<r;++n){let a=t.getActiveUniform(i,n),s=t.getUniformLocation(i,a.name);gve(a,s,this)}}setValue(t,i,r,n){let a=this.map[i];a!==void 0&&a.setValue(t,r,n)}setOptional(t,i,r){let n=i[r];n!==void 0&&this.setValue(t,r,n)}static upload(t,i,r,n){for(let a=0,s=i.length;a!==s;++a){let o=i[a],l=r[o.id];l.needsUpdate!==!1&&o.setValue(t,l.value,n)}}static seqWithValue(t,i){let r=[];for(let n=0,a=t.length;n!==a;++n){let s=t[n];s.id in i&&r.push(s)}return r}};function fG(t,i,r){let n=t.createShader(i);return t.shaderSource(n,r),t.compileShader(n),n}var vve=0;function _ve(t,i){let r=t.split(` 7658`),n=[],a=Math.max(i-6,0),s=Math.min(i+6,r.length);for(let o=a;o<s;o++){let l=o+1;n.push(`${l===i?">":" "} ${l}: ${r[o]}`)}return n.join(` 7659`)}function yve(t){switch(t){case mc:return["Linear","( value )"];case gi:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function pG(t,i,r){let n=t.getShaderParameter(i,35713),a=t.getShaderInfoLog(i).trim();if(n&&a==="")return"";let s=/ERROR: 0:(\d+)/.exec(a);if(s){let o=parseInt(s[1]);return r.toUpperCase()+` 7660 7661`+a+` 7662 7663`+_ve(t.getShaderSource(i),o)}else return a}function Eve(t,i){let r=yve(i);return"vec4 "+t+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}function wve(t,i){let r;switch(i){case xfe:r="Linear";break;case Rfe:r="Reinhard";break;case Bfe:r="OptimizedCineon";break;case Ife:r="ACESFilmic";break;case Dfe:r="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",i),r="Linear"}return"vec3 "+t+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}function bve(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||t.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap||t.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(__).join(` 7664`)}function Sve(t){let i=[];for(let r in t){let n=t[r];n!==!1&&i.push("#define "+r+" "+n)}return i.join(` 7665`)}function Cve(t,i){let r={},n=t.getProgramParameter(i,35721);for(let a=0;a<n;a++){let s=t.getActiveAttrib(i,a),o=s.name,l=1;s.type===35674&&(l=2),s.type===35675&&(l=3),s.type===35676&&(l=4),r[o]={type:s.type,location:t.getAttribLocation(i,o),locationSize:l}}return r}function __(t){return t!==""}function mG(t,i){let r=i.numSpotLightShadows+i.numSpotLightMaps-i.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,i.numDirLights).replace(/NUM_SPOT_L
7665IGHTS/g,i.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,i.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,r).replace(/NUM_RECT_AREA_LIGHTS/g,i.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,i.numPointLights).replace(/NUM_HEMI_LIGHTS/g,i.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,i.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,i.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,i.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,i.numPointLightShadows)}function gG(t,i){return t.replace(/NUM_CLIPPING_PLANES/g,i.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,i.numClippingPlanes-i.numClipIntersection)}var Tve=/^[ \t]*#include +<([\w\d./]+)>/gm;function cP(t){return t.replace(Tve,Mve)}function Mve(t,i){let r=_i[i];if(r===void 0)throw new Error("Can not resolve #include <"+i+">");return cP(r)}var xve=/#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 vG(t){return t.replace(xve,Rve)}function Rve(t,i,r,n){let a="";for(let s=parseInt(i);s<parseInt(r);s++)a+=n.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return a}function _G(t){let i="precision "+t.precision+` float; 7666precision `+t.precision+" int;";return t.precision==="highp"?i+=` 7667#define HIGH_PRECISION`:t.precision==="mediump"?i+=` 7668#define MEDIUM_PRECISION`:t.precision==="lowp"&&(i+=` 7669#define LOW_PRECISION`),i}function Bve(t){let i="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===tN?i="SHADOWMAP_TYPE_PCF":t.shadowMapType===sfe?i="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===v_&&(i="SHADOWMAP_TYPE_VSM"),i}function Ive(t){let i="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case cp:case hp:i="ENVMAP_TYPE_CUBE";break;case EE:i="ENVMAP_TYPE_CUBE_UV";break}return i}function Dve(t){let i="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case hp:i="ENVMAP_MODE_REFRACTION";break}return i}function Pve(t){let i="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case m7:i="ENVMAP_BLENDING_MULTIPLY";break;case Tfe:i="ENVMAP_BLENDING_MIX";break;case Mfe:i="ENVMAP_BLENDING_ADD";break}return i}function Lve(t){let i=t.envMapCubeUVHeight;if(i===null)return null;let r=Math.log2(i)-2,n=1/i;return{texelWidth:1/(3*Math.max(Math.pow(2,r),7*16)),texelHeight:n,maxMip:r}}function Ove(t,i,r,n){let a=t.getContext(),s=r.defines,o=r.vertexShader,l=r.fragmentShader,c=Bve(r),h=Ive(r),u=Dve(r),d=Pve(r),A=Lve(r),f=r.isWebGL2?"":bve(r),m=Sve(s),g=a.createProgram(),p,v,_=r.glslVersion?"#version "+r.glslVersion+` 7670`:"";r.isRawShaderMaterial?(p=[m].filter(__).join(` 7671`),p.length>0&&(p+=` 7672`),v=[f,m].filter(__).join(` 7673`),v.length>0&&(v+=` 7674`)):(p=[_G(r),"#define SHADER_NAME "+r.shaderName,m,r.instancing?"#define USE_INSTANCING":"",r.instancingColor?"#define USE_INSTANCING_COLOR":"",r.supportsVertexTextures?"#define VERTEX_TEXTURES":"",r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+u:"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.displacementMap&&r.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals&&r.flatShading===!1?"#define USE_MORPHNORMALS":"",r.morphColors&&r.isWebGL2?"#define USE_MORPHCOLORS":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+r.morphTextureStride:"",r.morphTargetsCount>0&&r.isWebGL2?"#define MORPHTARGETS_COUNT "+r.morphTargetsCount:"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` 7675`].filter(__).join(` 7676`),v=[f,_G(r),"#define SHADER_NAME "+r.shaderName,m,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp2?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.matcap?"#define USE_MATCAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+h:"",r.envMap?"#define "+u:"",r.envMap?"#define "+d:"",A?"#define CUBEUV_TEXEL_WIDTH "+A.texelWidth:"",A?"#define CUBEUV_TEXEL_HEIGHT "+A.texelHeight:"",A?"#define CUBEUV_MAX_MIP "+A.maxMip+".0":"",r.lightMap?"#define USE_LIGHTMAP":"",r.aoMap?"#define USE_AOMAP":"",r.emissiveMap?"#define USE_EMISSIVEMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.normalMap&&r.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",r.normalMap&&r.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",r.clearcoat?"#define USE_CLEARCOAT":"",r.clearcoatMap?"#define USE_CLEARCOATMAP":"",r.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",r.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",r.iridescence?"#define USE_IR
7676IDESCENCE":"",r.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",r.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",r.specularColorMap?"#define USE_SPECULARCOLORMAP":"",r.roughnessMap?"#define USE_ROUGHNESSMAP":"",r.metalnessMap?"#define USE_METALNESSMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.alphaTest?"#define USE_ALPHATEST":"",r.sheen?"#define USE_SHEEN":"",r.sheenColorMap?"#define USE_SHEENCOLORMAP":"",r.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",r.transmission?"#define USE_TRANSMISSION":"",r.transmissionMap?"#define USE_TRANSMISSIONMAP":"",r.thicknessMap?"#define USE_THICKNESSMAP":"",r.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",r.vertexTangents?"#define USE_TANGENT":"",r.vertexColors||r.instancingColor?"#define USE_COLOR":"",r.vertexAlphas?"#define USE_COLOR_ALPHA":"",r.vertexUvs?"#define USE_UV":"",r.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",r.gradientMap?"#define USE_GRADIENTMAP":"",r.flatShading?"#define FLAT_SHADED":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+c:"",r.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",r.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",r.logarithmicDepthBuffer&&r.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",r.toneMapping!==lh?"#define TONE_MAPPING":"",r.toneMapping!==lh?_i.tonemapping_pars_fragment:"",r.toneMapping!==lh?wve("toneMapping",r.toneMapping):"",r.dithering?"#define DITHERING":"",r.opaque?"#define OPAQUE":"",_i.encodings_pars_fragment,Eve("linearToOutputTexel",r.outputEncoding),r.useDepthPacking?"#define DEPTH_PACKING "+r.depthPacking:"",` 7677`].filter(__).join(` 7678`)),o=cP(o),o=mG(o,r),o=gG(o,r),l=cP(l),l=mG(l,r),l=gG(l,r),o=vG(o),l=vG(l),r.isWebGL2&&r.isRawShaderMaterial!==!0&&(_=`#version 300 es 7679`,p=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` 7680`)+` 7681`+p,v=["#define varying in",r.glslVersion===Q5?"":"layout(location = 0) out highp vec4 pc_fragColor;",r.glslVersion===Q5?"":"#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(` 7682`)+` 7683`+v);let y=_+p+o,w=_+v+l,b=fG(a,35633,y),E=fG(a,35632,w);if(a.attachShader(g,b),a.attachShader(g,E),r.index0AttributeName!==void 0?a.bindAttribLocation(g,0,r.index0AttributeName):r.morphTargets===!0&&a.bindAttribLocation(g,0,"position"),a.linkProgram(g),t.debug.checkShaderErrors){let T=a.getProgramInfoLog(g).trim(),C=a.getShaderInfoLog(b).trim(),x=a.getShaderInfoLog(E).trim(),R=!0,L=!0;if(a.getProgramParameter(g,35714)===!1){R=!1;let I=pG(a,b,"vertex"),F=pG(a,E,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(g,35715)+` 7684 7685Program Info Log: `+T+` 7686`+I+` 7687`+F)}else T!==""?console.warn("THREE.WebGLProgram: Program Info Log:",T):(C===""||x==="")&&(L=!1);L&&(this.diagnostics={runnable:R,programLog:T,vertexShader:{log:C,prefix:p},fragmentShader:{log:x,prefix:v}})}a.deleteShader(b),a.deleteShader(E);let M;this.getUniforms=function(){return M===void 0&&(M=new CS(a,g)),M};let S;return this.getAttributes=function(){return S===void 0&&(S=Cve(a,g)),S},this.destroy=function(){n.releaseStatesOfProgram(this),a.deleteProgram(g),this.program=void 0},this.name=r.shaderName,this.id=vve++,this.cacheKey=i,this.usedTimes=1,this.program=g,this.vertexShader=b,this.fragmentShader=E,this}var Nve=0,Uve=class{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){let i=t.vertexShader,r=t.fragmentShader,n=this._getShaderStage(i),a=this._getShaderStage(r),s=this._getShaderCacheForMaterial(t);return s.has(n)===!1&&(s.add(n),n.usedTimes++),s.has(a)===!1&&(s.add(a),a.usedTimes++),this}remove(t){let i=this.materialCache.get(t);for(let r of i)r.usedTimes--,r.usedTimes===0&&this.shaderCache.delete(r.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){let i=this.materialCache,r=i.get(t);return r===void 0&&(r=new Set,i.set(t,r)),r}_getShaderStage(t){let i=this.shaderCache,r=i.get(t);return r===void 0&&(r=new Fve(t),i.set(t,r)),r}},Fve=class{constructor(t){this.id=Nve++,this.code=t,this.usedTimes=0}};function kve(t,i,r,n,a,s,o){let l=new aN,c=new Uve,h=[],u=a.isWebGL2,d=a.logarithmicDepthBuffer,A=a.vertexTextures,f=a.precision,m={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 g(S,T,C,x,R){let L=x.fog,I=R.geometry,F=S.isMeshStandardMaterial?x.environment:null,Y=(S.isMeshStandardMaterial?r:i).get(S.envMap||F),D=Y&&Y.mapping===EE?Y.image.height:null,U=m[S.type];S.precision!==null&&(f=a.getMaxPrecision(S.precision),f!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",f,"instead."));let j=I.morphAttributes.position||I.morphAttributes.normal||I.morphAttributes.color,J=j!==void 0?j.length:0,z=0;I.morphAttributes.position!==void 0&&(z=1),I.morphAttributes.normal!==void 0&&(z=2),I.morphAttributes.color!==void 0&&(z=3);let $,te,ae,ve;if(U){let k=Wc[U];$=k.vertexShader,te=k.fragmentShader}else $=S.vertexShader,te=S.fragmentShader,c.update(S),ae=c.getVertexShaderID(S),ve=c.getFragmentShaderID(S);let oe=t.getRenderTarget(),K=S.alphaTest>0,X=S.clearcoat>0,N=S.iridescence>0;return{isWebGL2:u,shaderID:U,shaderName:S.type,vertexShader:$,fragmentShader:te,defines:S.defines,customVertexShaderID:ae,customFragmentShaderID:ve,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:f,instancing:R.isInstancedMesh===!0,instancingColor:R.isInstancedMesh===!0&&R.instanceColor!==null,supportsVertexTextures:A,outputEncoding:oe===null?t.outputEncoding:oe.isXRRenderTarget===!0?oe.texture.encoding:mc,map:!!S.map,matcap:!!S.matcap,envMap:!!Y,envMapMode:Y&&Y.mapping,envMapCubeUVHeight:D,lightMap:!!S.lightMap,aoMap:!!S.aoMap,emissiveMap:!!S.emissiveMap,bumpMap:!!S.bumpMap,normalMap:!!S.normalMap,objectSpaceNormalMap:S.normalMapType===Xfe,tangentSpaceNormalMap:S.normalMapType===Kfe,decodeVideoTexture:!!S.map&&S.map.isVideoTexture===!0&&S.map.encoding===gi,clearcoat:X,clearcoatMap:X&&!!S.clearcoatMap,clearcoatRoughnessMap:X&&!!S.clearcoatRoughnessMap,clearcoatNormalMap:X&&!!S.clearcoatNormalMap,iridescence:N,iridescenceMap:N&&!!S.iridescenceMap,iridescenceThicknessMap:N&&!!S.iridescenceThicknessMap,displacementMap:!!S.displacementMap,roughnessMap:!!S.roughnessMap,metalnessMap:!!S.metalnessMap,specularMap:!!S.specularMap,specularIntensityMap:!!S.specularIntensityMap,specularColorMap:!!S.specularColorMap,opaque:S.transparent===!1&&S.blending===Jf,alphaMap:!!S.alphaMap,alphaTest:K,gradientMap:!!S.gradientMap,sheen:S.sheen>0,sheenColorMap:!!S.sheenColorMap,sheenRoughnessMap:!!S.sheenRoughnessMap,transmission:S.transmission>0,transmissionMap:!!S.transmissionMap,thicknessMap:!!S.thicknessMap,combine:S.combine,vertexTangents:!!S.normalMap&&!!I.attributes.tangent,vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!I.attributes.color&&I.attributes.color.itemSize===4,vertexUvs:!!S.map||!!S.bumpMap||!!S.normalMap||!!S.specularMap||!!S.alphaMap||!!S.emissiveMap||!!S.roughnessMap||!!S.metalnessMap||!!S.
7687clearcoatMap||!!S.clearcoatRoughnessMap||!!S.clearcoatNormalMap||!!S.iridescenceMap||!!S.iridescenceThicknessMap||!!S.displacementMap||!!S.transmissionMap||!!S.thicknessMap||!!S.specularIntensityMap||!!S.specularColorMap||!!S.sheenColorMap||!!S.sheenRoughnessMap,uvsVertexOnly:!(S.map||S.bumpMap||S.normalMap||S.specularMap||S.alphaMap||S.emissiveMap||S.roughnessMap||S.metalnessMap||S.clearcoatNormalMap||S.iridescenceMap||S.iridescenceThicknessMap||S.transmission>0||S.transmissionMap||S.thicknessMap||S.specularIntensityMap||S.specularColorMap||S.sheen>0||S.sheenColorMap||S.sheenRoughnessMap)&&!!S.displacementMap,fog:!!L,useFog:S.fog===!0,fogExp2:L&&L.isFogExp2,flatShading:!!S.flatShading,sizeAttenuation:S.sizeAttenuation,logarithmicDepthBuffer:d,skinning:R.isSkinnedMesh===!0,morphTargets:I.morphAttributes.position!==void 0,morphNormals:I.morphAttributes.normal!==void 0,morphColors:I.morphAttributes.color!==void 0,morphTargetsCount:J,morphTextureStride:z,numDirLights:T.directional.length,numPointLights:T.point.length,numSpotLights:T.spot.length,numSpotLightMaps:T.spotLightMap.length,numRectAreaLights:T.rectArea.length,numHemiLights:T.hemi.length,numDirLightShadows:T.directionalShadowMap.length,numPointLightShadows:T.pointShadowMap.length,numSpotLightShadows:T.spotShadowMap.length,numSpotLightShadowsWithMaps:T.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:S.dithering,shadowMapEnabled:t.shadowMap.enabled&&C.length>0,shadowMapType:t.shadowMap.type,toneMapping:S.toneMapped?t.toneMapping:lh,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===hs,flipSided:S.side===Ea,useDepthPacking:!!S.depthPacking,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionDerivatives:S.extensions&&S.extensions.derivatives,extensionFragDepth:S.extensions&&S.extensions.fragDepth,extensionDrawBuffers:S.extensions&&S.extensions.drawBuffers,extensionShaderTextureLOD:S.extensions&&S.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:S.customProgramCacheKey()}}function p(S){let T=[];if(S.shaderID?T.push(S.shaderID):(T.push(S.customVertexShaderID),T.push(S.customFragmentShaderID)),S.defines!==void 0)for(let C in S.defines)T.push(C),T.push(S.defines[C]);return S.isRawShaderMaterial===!1&&(v(T,S),_(T,S),T.push(t.outputEncoding)),T.push(S.customProgramCacheKey),T.join()}function v(S,T){S.push(T.precision),S.push(T.outputEncoding),S.push(T.envMapMode),S.push(T.envMapCubeUVHeight),S.push(T.combine),S.push(T.vertexUvs),S.push(T.fogExp2),S.push(T.sizeAttenuation),S.push(T.morphTargetsCount),S.push(T.morphAttributeCount),S.push(T.numDirLights),S.push(T.numPointLights),S.push(T.numSpotLights),S.push(T.numSpotLightMaps),S.push(T.numHemiLights),S.push(T.numRectAreaLights),S.push(T.numDirLightShadows),S.push(T.numPointLightShadows),S.push(T.numSpotLightShadows),S.push(T.numSpotLightShadowsWithMaps),S.push(T.shadowMapType),S.push(T.toneMapping),S.push(T.numClippingPlanes),S.push(T.numClipIntersection),S.push(T.depthPacking)}function _(S,T){l.disableAll(),T.isWebGL2&&l.enable(0),T.supportsVertexTextures&&l.enable(1),T.instancing&&l.enable(2),T.instancingColor&&l.enable(3),T.map&&l.enable(4),T.matcap&&l.enable(5),T.envMap&&l.enable(6),T.lightMap&&l.enable(7),T.aoMap&&l.enable(8),T.emissiveMap&&l.enable(9),T.bumpMap&&l.enable(10),T.normalMap&&l.enable(11),T.objectSpaceNormalMap&&l.enable(12),T.tangentSpaceNormalMap&&l.enable(13),T.clearcoat&&l.enable(14),T.clearcoatMap&&l.enable(15),T.clearcoatRoughnessMap&&l.enable(16),T.clearcoatNormalMap&&l.enable(17),T.iridescence&&l.enable(18),T.iridescenceMap&&l.enable(19),T.iridescenceThicknessMap&&l.enable(20),T.displacementMap&&l.enable(21),T.specularMap&&l.enable(22),T.roughnessMap&&l.enable(23),T.metalnessMap&&l.enable(24),T.gradientMap&&l.enable(25),T.alphaMap&&l.enable(26),T.alphaTest&&l.enable(27),T.vertexColors&&l.enable(28),T.vertexAlphas&&l.enable(29),T.vertexUvs&&l.enable(30),T.vertexTangents&&l.enable(31),T.uvsVertexOnly&&l.enable(32),S.push(l.mask),l.disableAll(),T.fog&&l.enable(0),T.useFog&&l.enable(1),T.flatShading&&l.enable(2),T.logarithmicDepthBuffer&&l.enable(3),T.skinning&&l.enable(4),T.morphTargets&&l.enable(5),T.morphNormals&&l.enable(6),T.morphColors&&l.enable(7),T.premultipliedAlpha&&l.enable(8),T.shadowMapEnabled&&l.enable(9),T.physicallyCorrectLights&&l.enable(10),T.doubleSided&&l.enable(11),T.flipSided&&l.enable(12),T.useDepthPacking&&l.enable(13),T.dithering&&l.enable(14),T.specularIntensityMap&&l.enable(15),T.specularColorMap&&l.enable(16),T.transmission&&l.enable(17),T.transmissionMap&&l.enable(18),T.thicknessMap&&l.enable(19),T.sheen&&l.enable(20),T.sheenColorMap&&l.enable(21),T.sheenRoughnessMap&&l.enable(22),T.decodeVideoTexture&&l.enable(23),T.o
vendor: 6,135 bytes, line 7687
7687paque&&l.enable(24),S.push(l.mask)}function y(S){let T=m[S.type],C;if(T){let x=Wc[T];C=O0.clone(x.uniforms)}else C=S.uniforms;return C}function w(S,T){let C;for(let x=0,R=h.length;x<R;x++){let L=h[x];if(L.cacheKey===T){C=L,++C.usedTimes;break}}return C===void 0&&(C=new Ove(t,T,S,s),h.push(C)),C}function b(S){if(--S.usedTimes===0){let T=h.indexOf(S);h[T]=h[h.length-1],h.pop(),S.destroy()}}function E(S){c.remove(S)}function M(){c.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:y,acquireProgram:w,releaseProgram:b,releaseShaderCache:E,programs:h,dispose:M}}function Hve(){let t=new WeakMap;function i(s){let o=t.get(s);return o===void 0&&(o={},t.set(s,o)),o}function r(s){t.delete(s)}function n(s,o,l){t.get(s)[o]=l}function a(){t=new WeakMap}return{get:i,remove:r,update:n,dispose:a}}function Gve(t,i){return t.groupOrder!==i.groupOrder?t.groupOrder-i.groupOrder:t.renderOrder!==i.renderOrder?t.renderOrder-i.renderOrder:t.material.id!==i.material.id?t.material.id-i.material.id:t.z!==i.z?t.z-i.z:t.id-i.id}function yG(t,i){return t.groupOrder!==i.groupOrder?t.groupOrder-i.groupOrder:t.renderOrder!==i.renderOrder?t.renderOrder-i.renderOrder:t.z!==i.z?i.z-t.z:t.id-i.id}function EG(){let t=[],i=0,r=[],n=[],a=[];function s(){i=0,r.length=0,n.length=0,a.length=0}function o(d,A,f,m,g,p){let v=t[i];return v===void 0?(v={id:d.id,object:d,geometry:A,material:f,groupOrder:m,renderOrder:d.renderOrder,z:g,group:p},t[i]=v):(v.id=d.id,v.object=d,v.geometry=A,v.material=f,v.groupOrder=m,v.renderOrder=d.renderOrder,v.z=g,v.group=p),i++,v}function l(d,A,f,m,g,p){let v=o(d,A,f,m,g,p);f.transmission>0?n.push(v):f.transparent===!0?a.push(v):r.push(v)}function c(d,A,f,m,g,p){let v=o(d,A,f,m,g,p);f.transmission>0?n.unshift(v):f.transparent===!0?a.unshift(v):r.unshift(v)}function h(d,A){r.length>1&&r.sort(d||Gve),n.length>1&&n.sort(A||yG),a.length>1&&a.sort(A||yG)}function u(){for(let d=i,A=t.length;d<A;d++){let f=t[d];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:r,transmissive:n,transparent:a,init:s,push:l,unshift:c,finish:u,sort:h}}function zve(){let t=new WeakMap;function i(n,a){let s=t.get(n),o;return s===void 0?(o=new EG,t.set(n,[o])):a>=s.length?(o=new EG,s.push(o)):o=s[a],o}function r(){t=new WeakMap}return{get:i,dispose:r}}function Qve(){let t={};return{get:function(i){if(t[i.id]!==void 0)return t[i.id];let r;switch(i.type){case"DirectionalLight":r={direction:new O,color:new Ht};break;case"SpotLight":r={position:new O,direction:new O,color:new Ht,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":r={position:new O,color:new Ht,distance:0,decay:0};break;case"HemisphereLight":r={direction:new O,skyColor:new Ht,groundColor:new Ht};break;case"RectAreaLight":r={color:new Ht,position:new O,halfWidth:new O,halfHeight:new O};break}return t[i.id]=r,r}}}function Vve(){let t={};return{get:function(i){if(t[i.id]!==void 0)return t[i.id];let r;switch(i.type){case"DirectionalLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me};break;case"SpotLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me};break;case"PointLight":r={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Me,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[i.id]=r,r}}}var Wve=0;function jve(t,i){return(i.castShadow?2:0)-(t.castShadow?2:0)+(i.map?1:0)-(t.map?1:0)}function Yve(t,i){let r=new Qve,n=Vve(),a={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-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};for(let u=0;u<9;u++)a.probe.push(new O);let s=new O,o=new ht,l=new ht;function c(u,d){let A=0,f=0,m=0;for(let x=0;x<9;x++)a.probe[x].set(0,0,0);let g=0,p=0,v=0,_=0,y=0,w=0,b=0,E=0,M=0,S=0;u.sort(jve);let T=d!==!0?Math.PI:1;for(let x=0,R=u.length;x<R;x++){let L=u[x],I=L.color,F=L.intensity,Y=L.distance,D=L.shadow&&L.shadow.map?L.shadow.map.texture:null;if(L.isAmbientLight)A+=I.r*F*T,f+=I.g*F*T,m+=I.b*F*T;else if(L.isLightProbe)for(let U=0;U<9;U++)a.probe[U].addScaledVector(L.sh.coefficients[U],F);else if(L.isDirectionalLight){let U=r.get(L);if(U.color.copy(L.color).multiplyScalar(L.intensity*T),L.castShadow){let j=L.shadow,J=n.get(L);J.shadowBias=j.bias,J.shadowNormalBias=j.normalBias,J.shadowRadius=j.radius,J.shadowMapSize=j.mapSize,a.directionalShadow[g]=J,a.directionalShadowMap[g]=D,a.directionalShadowMatrix[g]=L.shadow.matrix,w++}a.directional[g]=U,g++}else if(L.isSpotLight){let U=r.get(L);U.position.setFromMatrixPosition(L.matrixWorld),U.color.copy(I).multiplyScalar(F*T),U.distance=Y,U.coneCos=Math.cos(L.angle),U.penumbraCos=Math.cos(L.angle*(1-L.penumbra)),U.decay=L.decay,a.spot[v]=U;let j=L.shadow;if(L.map&&(a.spotLightMap[M]=L.map,M++,j.updateMatrices(L),L.castShadow&&S++),a.spotLightMatrix[v]=j.matrix,L.castShadow){let J=n.get(L);J.shadowBias=j.bias,J.shadowNormalBias=j.normalBias,J.shadowRadius=j.radius,J.shadowMapSize=j.mapSize,a.spotShadow[v]=J,a.spotShadowMap[v]=D,E++}v++}else if(L.isRectAreaLight){let U=r.get(L);U.color.copy(I).multiplyScalar(F),U.halfWidth.set(L.width*.5,0,0),U.halfHeight.set(0,L.height*.5,0),a.rectArea[_]=U,_++}else if(L.isPointLight){let U=r.get(L);if(U.color.copy(L.color).multiplyScalar(L.intensity*T),U.distance=L.distance,U.decay=L.decay,L.castShadow){let j=L.shadow,J=n.get(L);J.shadowBias=j.bias,J.shadowNormalBias=j.normalBias,J.shadowRadius=j.radius,J.shadowMapSize=j.mapSize,J.shadowCameraNear=j.camera.near,J.shadowCameraFar=j.camera.far,a.pointShadow[p]=J,a.pointShadowMap[p]=D,a.pointShadowMatrix[p]=L.shadow.matrix,b++}a.point[p]=U,p++}else if(L.isHemisphereLight){let U=r.get(L);U.skyColor.copy(L.color).multiplyScalar(F*T),U.groundColor.copy(L.groundColor).multiplyScalar(F*T),a.hemi[y]=U,y++}}_>
76870&&(i.isWebGL2||t.has("OES_texture_float_linear")===!0?(a.rectAreaLTC1=vt.LTC_FLOAT_1,a.rectAreaLTC2=vt.LTC_FLOAT_2):t.has("OES_texture_half_float_linear")===!0?(a.rectAreaLTC1=vt.LTC_HALF_1,a.rectAreaLTC2=vt.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),a.ambient[0]=A,a.ambient[1]=f,a.ambient[2]=m;let C=a.hash;(C.directionalLength!==g||C.pointLength!==p||C.spotLength!==v||C.rectAreaLength!==_||C.hemiLength!==y||C.numDirectionalShadows!==w||C.numPointShadows!==b||C.numSpotShadows!==E||C.numSpotMaps!==M)&&(a.directional.length=g,a.spot.length=v,a.rectArea.length=_,a.point.length=p,a.hemi.length=y,a.directionalShadow.length=w,a.directionalShadowMap.length=w,a.pointShadow.length=b,a.pointShadowMap.length=b,a.spotShadow.length=E,a.spotShadowMap.length=E,a.directionalShadowMatrix.length=w,a.pointShadowMatrix.length=b,a.spotLightMatrix.length=E+M-S,a.spotLightMap.length=M,a.numSpotLightShadowsWithMaps=S,C.directionalLength=g,C.pointLength=p,C.spotLength=v,C.rectAreaLength=_,C.hemiLength=y,C.numDirectionalShadows=w,C.numPointShadows=b,C.numSpotShadows=E,C.numSpotMaps=M,a.version=Wve++)}function h(u,d){let A=0,f=0,m=0,g=0,p=0,v=d.matrixWorldInverse;for(let _=0,y=u.length;_<y;_++){let w=u[_];if(w.isDirectionalLight){let b=a.directional[A];b.direction.setFromMatrixPosition(w.matrixWorld),s.setFromMatrixPosition(w.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(v),A++}else if(w.isSpotLight){let b=a.spot[m];b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(v),b.direction.setFromMatrixPosition(w.matrixWorld),s.setFromMatrixPosition(w.target.matrixWorld),b.direction.sub(s),b.direction.transformDirection(v),m++}else if(w.isRectAreaLight){let b=a.rectArea[g];b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(v),l.identity(),o.copy(w.matrixWorld),o.premultiply(v),l.extractRotation(o),b.halfWidth.set(w.width*.5,0,0),b.halfHeight.set(0,w.height*.5,0),b.halfWidth.applyMatrix4(l),b.halfHeight.applyMatrix4(l),g++}else if(w.isPointLight){let b=a.point[f];b.position.setFromMatrixPosition(w.matrixWorld),b.position.applyMatrix4(v),f++}else if(w.isHemisphereLight){let b=a.hemi[p];b.direction.setFromMatrixPosition(w.matrixWorld),b.direction.transformDirection(v),p++}}}return{setup:c,setupView:h,state:a}}function wG(t,i){let r=new Yve(t,i),n=[],a=[];function s(){n.length=0,a.length=0}function o(u){n.push(u)}function l(u){a.push(u)}function c(u){r.setup(n,u)}function h(u){r.setupView(n,u)}return{init:s,state:{lightsArray:n,shadowsArray:a,lights:r},setupLights:c,setupLightsView:h,pushLight:o,pushShadow:l}}function Kve(t,i){let r=new WeakMap;function n(s,o=0){let l=r.get(s),c;return l===void 0?(c=new wG(t,i),r.set(s,[c])):o>=l.length?(c=new wG(t,i),l.push(c)):c=l[o],c}function a(){r=new WeakMap}return{get:n,dispose:a}}var N7=class extends wE{constructor(t){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ed,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this}},Xve=class extends wE{constructor(t){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.referencePosition=new O,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}},qve=`void main() { 7688 gl_Position = vec4( position, 1.0 ); 7689}`,Zve=`uniform sampler2D shadow_pass; 7690uniform vec2 resolution; 7691uniform float radius; 7692#include <packing> 7693void main() {
7694 const float samples = float( VSM_SAMPLES ); 7695 float mean = 0.0; 7696 float squared_mean = 0.0; 7697 float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); 7698 float uvStart = samples <= 1.0 ? 0.0 : - 1.0; 7699 for ( float i = 0.0; i < samples; i ++ ) { 7700 float uvOffset = uvStart + i * uvStride; 7701 #ifdef HORIZONTAL_PASS 7702 vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); 7703 mean += distribution.x; 7704 squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; 7705 #else 7706 float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); 7707 mean += depth; 7708 squared_mean += depth * depth; 7709 #endif 7710 } 7711 mean = mean / samples; 7712 squared_mean = squared_mean / samples; 7713 float std_dev = sqrt( squared_mean - mean * mean ); 7714 gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); 7715}`;function Jve(t,i,r){let n=new oN,a=new Me,s=new Me,o=new ai,l=new N7({depthPacking:w7}),c=new Xve,h={},u=r.maxTextureSize,d={[pc]:Ea,[Ea]:pc,[hs]:hs},A=new Xi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Me},radius:{value:4}},vertexShader:qve,fragmentShader:Zve}),f=A.clone();f.defines.HORIZONTAL_PASS=1;let m=new Lt;m.setAttribute("position",new ei(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));let g=new Zr(m,A),p=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=tN,this.render=function(w,b,E){if(p.enabled===!1||p.autoUpdate===!1&&p.needsUpdate===!1||w.length===0)return;let M=t.getRenderTarget(),S=t.getActiveCubeFace(),T=t.getActiveMipmapLevel(),C=t.state;C.setBlending(Un),C.buffers.color.setClear(1,1,1,1),C.buffers.depth.setTest(!0),C.setScissorTest(!1);for(let x=0,R=w.length;x<R;x++){let L=w[x],I=L.shadow;if(I===void 0){console.warn("THREE.WebGLShadowMap:",L,"has no shadow.");continue}if(I.autoUpdate===!1&&I.needsUpdate===!1)continue;a.copy(I.mapSize);let F=I.getFrameExtents();if(a.multiply(F),s.copy(I.mapSize),(a.x>u||a.y>u)&&(a.x>u&&(s.x=Math.floor(u/F.x),a.x=s.x*F.x,I.mapSize.x=s.x),a.y>u&&(s.y=Math.floor(u/F.y),a.y=s.y*F.y,I.mapSize.y=s.y)),I.map===null){let D=this.type!==v_?{minFilter:tr,magFilter:tr}:{};I.map=new $i(a.x,a.y,D),I.map.texture.name=L.name+".shadowMap",I.camera.updateProjectionMatrix()}
7715t.setRenderTarget(I.map),t.clear();let Y=I.getViewportCount();for(let D=0;D<Y;D++){let U=I.getViewport(D);o.set(s.x*U.x,s.y*U.y,s.x*U.z,s.y*U.w),C.viewport(o),I.updateMatrices(L,D),n=I.getFrustum(),y(b,E,I.camera,L,this.type)}I.isPointLightShadow!==!0&&this.type===v_&&v(I,E),I.needsUpdate=!1}p.needsUpdate=!1,t.setRenderTarget(M,S,T)};function v(w,b){let E=i.update(g);A.defines.VSM_SAMPLES!==w.blurSamples&&(A.defines.VSM_SAMPLES=w.blurSamples,f.defines.VSM_SAMPLES=w.blurSamples,A.needsUpdate=!0,f.needsUpdate=!0),w.mapPass===null&&(w.mapPass=new $i(a.x,a.y)),A.uniforms.shadow_pass.value=w.map.texture,A.uniforms.resolution.value=w.mapSize,A.uniforms.radius.value=w.radius,t.setRenderTarget(w.mapPass),t.clear(),t.renderBufferDirect(b,null,E,A,g,null),f.uniforms.shadow_pass.value=w.mapPass.texture,f.uniforms.resolution.value=w.mapSize,f.uniforms.radius.value=w.radius,t.setRenderTarget(w.map),t.clear(),t.renderBufferDirect(b,null,E,f,g,null)}function _(w,b,E,M,S,T){let C=null,x=E.isPointLight===!0?w.customDistanceMaterial:w.customDepthMaterial;if(x!==void 0)C=x;else if(C=E.isPointLight===!0?c:l,t.localClippingEnabled&&b.clipShadows===!0&&Array.isArray(b.clippingPlanes)&&b.clippingPlanes.length!==0||b.displacementMap&&b.displacementScale!==0||b.alphaMap&&b.alphaTest>0||b.map&&b.alphaTest>0){let R=C.uuid,L=b.uuid,I=h[R];I===void 0&&(I={},h[R]=I);let F=I[L];F===void 0&&(F=C.clone(),I[L]=F),C=F}return C.visible=b.visible,C.wireframe=b.wireframe,T===v_?C.side=b.shadowSide!==null?b.shadowSide:b.side:C.side=b.shadowSide!==null?b.shadowSide:d[b.side],C.alphaMap=b.alphaMap,C.alphaTest=b.alphaTest,C.map=b.map,C.clipShadows=b.clipShadows,C.clippingPlanes=b.clippingPlanes,C.clipIntersection=b.clipIntersection,C.displacementMap=b.displacementMap,C.displacementScale=b.displacementScale,C.displacementBias=b.displacementBias,C.wireframeLinewidth=b.wireframeLinewidth,C.linewidth=b.linewidth,E.isPointLight===!0&&C.isMeshDistanceMaterial===!0&&(C.referencePosition.setFromMatrixPosition(E.matrixWorld),C.nearDistance=M,C.farDistance=S),C}function y(w,b,E,M,S){if(w.visible===!1)return;if(w.layers.test(b.layers)&&(w.isMesh||w.isLine||w.isPoints)&&(w.castShadow||w.receiveShadow&&S===v_)&&(!w.frustumCulled||n.intersectsObject(w))){w.modelViewMatrix.multiplyMatrices(E.matrixWorldInverse,w.matrixWorld);let C=i.update(w),x=w.material;if(Array.isArray(x)){let R=C.groups;for(let L=0,I=R.length;L<I;L++){let F=R[L],Y=x[F.materialIndex];if(Y&&Y.visible){let D=_(w,Y,M,E.near,E.far,S);t.renderBufferDirect(E,null,C,D,w,F)}}}else if(x.visible){let R=_(w,x,M,E.near,E.far,S);t.renderBufferDirect(E,null,C,R,w,null)}}let T=w.children;for(let C=0,x=T.length;C<x;C++)y(T[C],b,E,M,S)}}function $ve(t,i,r){let n=r.isWebGL2;function a(){let Se=!1,xe=new ai,de=null,Qe=new ai(0,0,0,0);return{setMask:function(We){de!==We&&!Se&&(t.colorMask(We,We,We,We),de=We)},setLocked:function(We){Se=We},setClear:function(We,He,ct,St,si){si===!0&&(We*=St,He*=St,ct*=St),xe.set(We,He,ct,St),Qe.equals(xe)===!1&&(t.clearColor(We,He,ct,St),Qe.copy(xe))},reset:function(){Se=!1,de=null,Qe.set(-1,0,0,0)}}}function s(){let Se=!1,xe=null,de=null,Qe=null;return{setTest:function(We){We?K(2929):X(2929)},setMask:function(We){xe!==We&&!Se&&(t.depthMask(We),xe=We)},setFunc:function(We){if(de!==We){switch(We){case _fe:t.depthFunc(512);break;case yfe:t.depthFunc(519);break;case Efe:t.depthFunc(513);break;case iP:t.depthFunc(515);break;case wfe:t.depthFunc(514);break;case bfe:t.depthFunc(518);break;case Sfe:t.depthFunc(516);break;case Cfe:t.depthFunc(517);break;default:t.depthFunc(515)}de=We}},setLocked:function(We){Se=We},setClear:function(We){Qe!==We&&(t.clearDepth(We),Qe=We)},reset:function(){Se=!1,xe=null,de=null,Qe=null}}}function o(){let Se=!1,xe=null,de=null,Qe=null,We=null,He=null,ct=null,St=null,si=null;return{setTest:function(oi){Se||(oi?K(2960):X(2960))},setMask:function(oi){xe!==oi&&!Se&&(t.stencilMask(oi),xe=oi)},setFunc:function(oi,Ir,bi){(de!==oi||Qe!==Ir||We!==bi)&&(t.stencilFunc(oi,Ir,bi),de=oi,Qe=Ir,We=bi)},setOp:function(oi,Ir,bi){(He!==oi||ct!==Ir||St!==bi)&&(t.stencilOp(oi,Ir,bi),He=oi,ct=Ir,St=bi)}
7715,setLocked:function(oi){Se=oi},setClear:function(oi){si!==oi&&(t.clearStencil(oi),si=oi)},reset:function(){Se=!1,xe=null,de=null,Qe=null,We=null,He=null,ct=null,St=null,si=null}}}let l=new a,c=new s,h=new o,u=new WeakMap,d=new WeakMap,A={},f={},m=new WeakMap,g=[],p=null,v=!1,_=null,y=null,w=null,b=null,E=null,M=null,S=null,T=!1,C=null,x=null,R=null,L=null,I=null,F=t.getParameter(35661),Y=!1,D=0,U=t.getParameter(7938);U.indexOf("WebGL")!==-1?(D=parseFloat(/^WebGL (\d)/.exec(U)[1]),Y=D>=1):U.indexOf("OpenGL ES")!==-1&&(D=parseFloat(/^OpenGL ES (\d)/.exec(U)[1]),Y=D>=2);let j=null,J={},z=t.getParameter(3088),$=t.getParameter(2978),te=new ai().fromArray(z),ae=new ai().fromArray($);function ve(Se,xe,de){let Qe=new Uint8Array(4),We=t.createTexture();t.bindTexture(Se,We),t.texParameteri(Se,10241,9728),t.texParameteri(Se,10240,9728);for(let He=0;He<de;He++)t.texImage2D(xe+He,0,6408,1,1,0,6408,5121,Qe);return We}let oe={};oe[3553]=ve(3553,3553,1),oe[34067]=ve(34067,34069,6),l.setClear(0,0,0,1),c.setClear(1),h.setClear(0),K(2929),c.setFunc(iP),ce(!1),_e(A5),K(2884),Ae(Un);function K(Se){A[Se]!==!0&&(t.enable(Se),A[Se]=!0)}function X(Se){A[Se]!==!1&&(t.disable(Se),A[Se]=!1)}function N(Se,xe){return f[Se]!==xe?(t.bindFramebuffer(Se,xe),f[Se]=xe,n&&(Se===36009&&(f[36160]=xe),Se===36160&&(f[36009]=xe)),!0):!1}function k(Se,xe){let de=g,Qe=!1;if(Se)if(de=m.get(xe),de===void 0&&(de=[],m.set(xe,de)),Se.isWebGLMultipleRenderTargets){let We=Se.texture;if(de.length!==We.length||de[0]!==36064){for(let He=0,ct=We.length;He<ct;He++)de[He]=36064+He;de.length=We.length,Qe=!0}}else de[0]!==36064&&(de[0]=36064,Qe=!0);else de[0]!==1029&&(de[0]=1029,Qe=!0);Qe&&(r.isWebGL2?t.drawBuffers(de):i.get("WEBGL_draw_buffers").drawBuffersWEBGL(de))}function Z(Se){return p!==Se?(t.useProgram(Se),p=Se,!0):!1}let V={[$m]:32774,[lfe]:32778,[cfe]:32779};if(n)V[g5]=32775,V[v5]=32776;else{let Se=i.get("EXT_blend_minmax");Se!==null&&(V[g5]=Se.MIN_EXT,V[v5]=Se.MAX_EXT)}let re={[hfe]:0,[ufe]:1,[dfe]:768,[f7]:770,[vfe]:776,[mfe]:774,[ffe]:772,[Afe]:769,[p7]:771,[gfe]:775,[pfe]:773};function Ae(Se,xe,de,Qe,We,He,ct,St){if(Se===Un){v===!0&&(X(3042),v=!1);return}if(v===!1&&(K(3042),v=!0),Se!==ofe){if(Se!==_||St!==T){if((y!==$m||E!==$m)&&(t.blendEquation(32774),y=$m,E=$m),St)switch(Se){case Jf:t.blendFuncSeparate(1,771,1,771);break;case f5:t.blendFunc(1,1);break;case p5:t.blendFuncSeparate(0,769,0,1);break;case m5:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",Se);break}else switch(Se){case Jf:t.blendFuncSeparate(770,771,1,771);break;case f5:t.blendFunc(770,1);break;case p5:t.blendFuncSeparate(0,769,0,1);break;case m5:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",Se);break}w=null,b=null,M=null,S=null,_=Se,T=St}return}We=We||xe,He=He||de,ct=ct||Qe,(xe!==y||We!==E)&&(t.blendEquationSeparate(V[xe],V[We]),y=xe,E=We),(de!==w||Qe!==b||He!==M||ct!==S)&&(t.blendFuncSeparate(re[de],re[Qe],re[He],re[ct]),w=de,b=Qe,M=He,S=ct),_=Se,T=!1}function pe(Se,xe){Se.side===hs?X(2884):K(2884);let de=Se.side===Ea;xe&&(de=!de),ce(de),Se.blending===Jf&&Se.transparent===!1?Ae(Un):Ae(Se.blending,Se.blendEquation,Se.blendSrc,Se.blendDst,Se.blendEquationAlpha,Se.blendSrcAlpha,Se.blendDstAlpha,Se.premultipliedAlpha),c.setFunc(Se.depthFunc),c.setTest(Se.depthTest),c.setMask(Se.depthWrite),l.setMask(Se.colorWrite);let Qe=Se.stencilWrite;h.setTest(Qe),Qe&&(h.setMask(Se.stencilWriteMask),h.setFunc(Se.stencilFunc,Se.stencilRef,Se.stencilFuncMask),h.setOp(Se.stencilFail,Se.stencilZFail,Se.stencilZPass)),le(Se.polygonOffset,Se.polygonOffsetFactor,Se.polygonOffsetUnits),Se.alphaToCoverage===!0?K(32926):X(32926)}function ce(Se){C!==Se&&(Se?t.frontFace(2304):t.frontFace(2305),C=Se)}function _e(Se){Se!==nfe?(K(2884),Se!==x&&(Se===A5?t.cullFace(1029):Se===afe?t.cullFace(1028):t.cullFace(1032))):X(2884),x=Se}function me(Se){Se!==R&&(Y&&t.lineWidth(Se),R=Se)}function le(Se,xe,de){Se?(K(32823),(L!==xe||I!==de)&&(t.polygonOffset(xe,de),L=xe,I=de)):X(32823)}function De(Se){Se?K(3089):X(3089)}function Ve(Se){Se===void 0&&(Se=33984+F-1),j!==Se&&(t.activeTexture(Se),j=Se)}function se(Se,xe,de){de===void 0&&(j===null?de=33984+F-1:de=j);let Qe=J[de];Qe===void 0&&(Qe={type:void 0,texture:void 0},J[de]=Qe),(Qe.type!==Se||Qe.texture!==xe)&&(j!==de&&(t.activeTexture(de),j=de),t.bindTexture(Se,xe||oe[Se]),Qe.type=Se,Qe.texture=xe)}function P(){let Se=J[j];Se!==void 0&&Se.type!==void 0&&(t.bindTexture(Se.type,null),Se.type=void 0,Se.texture=void 0)}function H(){try{t.compressedTexImage2D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function ye(){try{t.compressedTexImage3D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Q(){try{t.texSubImage2D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Be(){try{t.texSubImage3D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Le(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Ke(){try{t.compressedTexSubImage3D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Re(){try{t.texStorage2D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Xe(){try{t.texStorage3D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function fe(){try{t.texImage2D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Ge(){try{t.texImage3D.apply(t,arguments)}catch(Se){console.error("THREE.WebGLState:",Se)}}function Pe(Se){te.equals(Se)===!1&&(t.scissor(Se.x,Se.y,Se.z,Se.w),te.copy(Se))}function rt(Se){ae.equals(Se)===!1&&(t.viewport(Se.x,Se.y,Se.z,Se.w),ae.copy(Se))}function Ze(Se,xe){let de=d.get(xe);
7715de===void 0&&(de=new WeakMap,d.set(xe,de));let Qe=de.get(Se);Qe===void 0&&(Qe=t.getUniformBlockIndex(xe,Se.name),de.set(Se,Qe))}function pt(Se,xe){let de=d.get(xe).get(Se);u.get(xe)!==de&&(t.uniformBlockBinding(xe,de,Se.__bindingPointIndex),u.set(xe,de))}function At(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),n===!0&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),A={},j=null,J={},f={},m=new WeakMap,g=[],p=null,v=!1,_=null,y=null,w=null,b=null,E=null,M=null,S=null,T=!1,C=null,x=null,R=null,L=null,I=null,te.set(0,0,t.canvas.width,t.canvas.height),ae.set(0,0,t.canvas.width,t.canvas.height),l.reset(),c.reset(),h.reset()}return{buffers:{color:l,depth:c,stencil:h},enable:K,disable:X,bindFramebuffer:N,drawBuffers:k,useProgram:Z,setBlending:Ae,setMaterial:pe,setFlipSided:ce,setCullFace:_e,setLineWidth:me,setPolygonOffset:le,setScissorTest:De,activeTexture:Ve,bindTexture:se,unbindTexture:P,compressedTexImage2D:H,compressedTexImage3D:ye,texImage2D:fe,texImage3D:Ge,updateUBOMapping:Ze,uniformBlockBinding:pt,texStorage2D:Re,texStorage3D:Xe,texSubImage2D:Q,texSubImage3D:Be,compressedTexSubImage2D:Le,compressedTexSubImage3D:Ke,scissor:Pe,viewport:rt,reset:At}}function e_e(t,i,r,n,a,s,o){let l=a.isWebGL2,c=a.maxTextures,h=a.maxCubemapSize,u=a.maxTextureSize,d=a.maxSamples,A=i.has("WEBGL_multisampled_render_to_texture")?i.get("WEBGL_multisampled_render_to_texture"):null,f=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),m=new WeakMap,g,p=new WeakMap,v=!1;try{v=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function _(se,P){return v?new OffscreenCanvas(se,P):My("canvas")}function y(se,P,H,ye){let Q=1;if((se.width>ye||se.height>ye)&&(Q=ye/Math.max(se.width,se.height)),Q<1||P===!0)if(typeof HTMLImageElement<"u"&&se instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&se instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&se instanceof ImageBitmap){let Be=P?TC:Math.floor,Le=Be(Q*se.width),Ke=Be(Q*se.height);g===void 0&&(g=_(Le,Ke));let Re=H?_(Le,Ke):g;return Re.width=Le,Re.height=Ke,Re.getContext("2d").drawImage(se,0,0,Le,Ke),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+se.width+"x"+se.height+") to ("+Le+"x"+Ke+")."),Re}else return"data"in se&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+se.width+"x"+se.height+")."),se;return se}function w(se){return lP(se.width)&&lP(se.height)}function b(se){return l?!1:se.wrapS!==Gr||se.wrapT!==Gr||se.minFilter!==tr&&se.minFilter!==Ei}function E(se,P){return se.generateMipmaps&&P&&se.minFilter!==tr&&se.minFilter!==Ei}function M(se){t.generateMipmap(se)}function S(se,P,H,ye,Q=!1){if(l===!1)return P;if(se!==null){if(t[se]!==void 0)return t[se];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+se+"'")}let Be=P;return P===6403&&(H===5126&&(Be=33326),H===5131&&(Be=33325),H===5121&&(Be=33321)),P===33319&&(H===5126&&(Be=33328),H===5131&&(Be=33327),H===5121&&(Be=33323)),P===6408&&(H===5126&&(Be=34836),H===5131&&(Be=34842),H===5121&&(Be=ye===gi&&Q===!1?35907:32856),H===32819&&(Be=32854),H===32820&&(Be=32855)),(Be===33325||Be===33326||Be===33327||Be===33328||Be===34842||Be===34836)&&i.get("EXT_color_buffer_float"),Be}function T(se,P,H){return E(se,H)===!0||se.isFramebufferTexture&&se.minFilter!==tr&&se.minFilter!==Ei?Math.log2(Math.max(P.width,P.height))+1:se.mipmaps!==void 0&&se.mipmaps.length>0?se.mipmaps.length:se.isCompressedTexture&&Array.isArray(se.image)?P.mipmaps.length:1}function C(se){return se===tr||se===_5||se===EB?9728:9729}function x(se){let P=se.target;P.removeEventListener("dispose",x),L(P),P.isVideoTexture&&m.delete(P)}function R(se){let P=se.target;P.removeEventListener("dispose",R),F(P)}function L(se){let P=n.get(se);if(P.__webglInit===void 0)return;let H=se.source,ye=p.get(H);if(ye){let Q=ye[P.__cacheKey];Q.usedTimes--,Q.usedTimes===0&&I(se),Object.keys(ye).length===0&&p.delete(H)}n.remove(se)}function I(se){let P=n.get(se);t.deleteTexture(P.__webglTexture);let H=se.source,ye=p.get(H);delete ye[P.__cacheKey],o.memory.textures--}function F(se){let P=se.texture,H=n.get(se),ye=n.get(P);if(ye.__webglTexture!==void 0&&(t.deleteTexture(ye.__webglTexture),o.memory.textures--),se.depthTexture&&se.depthTexture.dispose(),se.isWebGLCubeRen
7715derTarget)for(let Q=0;Q<6;Q++)t.deleteFramebuffer(H.__webglFramebuffer[Q]),H.__webglDepthbuffer&&t.deleteRenderbuffer(H.__webglDepthbuffer[Q]);else{if(t.deleteFramebuffer(H.__webglFramebuffer),H.__webglDepthbuffer&&t.deleteRenderbuffer(H.__webglDepthbuffer),H.__webglMultisampledFramebuffer&&t.deleteFramebuffer(H.__webglMultisampledFramebuffer),H.__webglColorRenderbuffer)for(let Q=0;Q<H.__webglColorRenderbuffer.length;Q++)H.__webglColorRenderbuffer[Q]&&t.deleteRenderbuffer(H.__webglColorRenderbuffer[Q]);H.__webglDepthRenderbuffer&&t.deleteRenderbuffer(H.__webglDepthRenderbuffer)}if(se.isWebGLMultipleRenderTargets)for(let Q=0,Be=P.length;Q<Be;Q++){let Le=n.get(P[Q]);Le.__webglTexture&&(t.deleteTexture(Le.__webglTexture),o.memory.textures--),n.remove(P[Q])}n.remove(P),n.remove(se)}let Y=0;function D(){Y=0}function U(){let se=Y;return se>=c&&console.warn("THREE.WebGLTextures: Trying to use "+se+" texture units while this GPU supports only "+c),Y+=1,se}function j(se){let P=[];return P.push(se.wrapS),P.push(se.wrapT),P.push(se.wrapR||0),P.push(se.magFilter),P.push(se.minFilter),P.push(se.anisotropy),P.push(se.internalFormat),P.push(se.format),P.push(se.type),P.push(se.generateMipmaps),P.push(se.premultiplyAlpha),P.push(se.flipY),P.push(se.unpackAlignment),P.push(se.encoding),P.join()}function J(se,P){let H=n.get(se);if(se.isVideoTexture&&De(se),se.isRenderTargetTexture===!1&&se.version>0&&H.__version!==se.version){let ye=se.image;if(ye===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(ye.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{X(H,se,P);return}}r.bindTexture(3553,H.__webglTexture,33984+P)}function z(se,P){let H=n.get(se);if(se.version>0&&H.__version!==se.version){X(H,se,P);return}r.bindTexture(35866,H.__webglTexture,33984+P)}function $(se,P){let H=n.get(se);if(se.version>0&&H.__version!==se.version){X(H,se,P);return}r.bindTexture(32879,H.__webglTexture,33984+P)}function te(se,P){let H=n.get(se);if(se.version>0&&H.__version!==se.version){N(H,se,P);return}r.bindTexture(34067,H.__webglTexture,33984+P)}let ae={[bu]:10497,[Gr]:33071,[aP]:33648},ve={[tr]:9728,[_5]:9984,[EB]:9986,[Ei]:9729,[Pfe]:9985,[a0]:9987};function oe(se,P,H){if(H?(t.texParameteri(se,10242,ae[P.wrapS]),t.texParameteri(se,10243,ae[P.wrapT]),(se===32879||se===35866)&&t.texParameteri(se,32882,ae[P.wrapR]),t.texParameteri(se,10240,ve[P.magFilter]),t.texParameteri(se,10241,ve[P.minFilter])):(t.texParameteri(se,10242,33071),t.texParameteri(se,10243,33071),(se===32879||se===35866)&&t.texParameteri(se,32882,33071),(P.wrapS!==Gr||P.wrapT!==Gr)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(se,10240,C(P.magFilter)),t.texParameteri(se,10241,C(P.minFilter)),P.minFilter!==tr&&P.minFilter!==Ei&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),i.has("EXT_texture_filter_anisotropic")===!0){let ye=i.get("EXT_texture_filter_anisotropic");if(P.magFilter===tr||P.minFilter!==EB&&P.minFilter!==a0||P.type===On&&i.has("OES_texture_float_linear")===!1||l===!1&&P.type===Hu&&i.has("OES_texture_half_float_linear")===!1)return;(P.anisotropy>1||n.get(P).__currentAnisotropy)&&(t.texParameterf(se,ye.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(P.anisotropy,a.getMaxAnisotropy())),n.get(P).__currentAnisotropy=P.anisotropy)}}function K(se,P){let H=!1;se.__webglInit===void 0&&(se.__webglInit=!0,P.addEventListener("dispose",x));let ye=P.source,Q=p.get(ye);Q===void 0&&(Q={},p.set(ye,Q));let Be=j(P);if(Be!==se.__cacheKey){Q[Be]===void 0&&(Q[Be]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,H=!0),Q[Be].usedTimes++;let Le=Q[se.__cacheKey];Le!==void 0&&(Q[se.__cacheKey].usedTimes--,Le.usedTimes===0&&I(P)),se.__cacheKey=Be,se.__webglTexture=Q[Be].texture}return H}function X(se,P,H){let ye=3553;(P.isDataArrayTexture||P.isCompressedArrayTexture)&&(ye=35866),P.isData3DTexture&&(ye=32879);let Q=K(se,P),Be=P.source;r.bindTexture(ye,se.__webglTexture,33984+H);let Le=n.get(Be);
7715if(Be.version!==Le.__version||Q===!0){r.activeTexture(33984+H),t.pixelStorei(37440,P.flipY),t.pixelStorei(37441,P.premultiplyAlpha),t.pixelStorei(3317,P.unpackAlignment),t.pixelStorei(37443,0);let Ke=b(P)&&w(P.image)===!1,Re=y(P.image,Ke,!1,u);Re=Ve(P,Re);let Xe=w(Re)||l,fe=s.convert(P.format,P.encoding),Ge=s.convert(P.type),Pe=S(P.internalFormat,fe,Ge,P.encoding,P.isVideoTexture);oe(ye,P,Xe);let rt,Ze=P.mipmaps,pt=l&&P.isVideoTexture!==!0,At=Le.__version===void 0||Q===!0,Se=T(P,Re,Xe);if(P.isDepthTexture)Pe=6402,l?P.type===On?Pe=36012:P.type===Su?Pe=33190:P.type===$f?Pe=35056:Pe=33189:P.type===On&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),P.format===ep&&Pe===6402&&P.type!==v7&&P.type!==Su&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),P.type=Su,Ge=s.convert(P.type)),P.format===up&&Pe===6402&&(Pe=34041,P.type!==$f&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),P.type=$f,Ge=s.convert(P.type))),At&&(pt?r.texStorage2D(3553,1,Pe,Re.width,Re.height):r.texImage2D(3553,0,Pe,Re.width,Re.height,0,fe,Ge,null));else if(P.isDataTexture)if(Ze.length>0&&Xe){pt&&At&&r.texStorage2D(3553,Se,Pe,Ze[0].width,Ze[0].height);for(let xe=0,de=Ze.length;xe<de;xe++)rt=Ze[xe],pt?r.texSubImage2D(3553,xe,0,0,rt.width,rt.height,fe,Ge,rt.data):r.texImage2D(3553,xe,Pe,rt.width,rt.height,0,fe,Ge,rt.data);P.generateMipmaps=!1}else pt?(At&&r.texStorage2D(3553,Se,Pe,Re.width,Re.height),r.texSubImage2D(3553,0,0,0,Re.width,Re.height,fe,Ge,Re.data)):r.texImage2D(3553,0,Pe,Re.width,Re.height,0,fe,Ge,Re.data);else if(P.isCompressedTexture)if(P.isCompressedArrayTexture){pt&&At&&r.texStorage3D(35866,Se,Pe,Ze[0].width,Ze[0].height,Re.depth);for(let xe=0,de=Ze.length;xe<de;xe++)rt=Ze[xe],P.format!==_a?fe!==null?pt?r.compressedTexSubImage3D(35866,xe,0,0,0,rt.width,rt.height,Re.depth,fe,rt.data,0,0):r.compressedTexImage3D(35866,xe,Pe,rt.width,rt.height,Re.depth,0,rt.data,0,0):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?r.texSubImage3D(35866,xe,0,0,0,rt.width,rt.height,Re.depth,fe,Ge,rt.data):r.texImage3D(35866,xe,Pe,rt.width,rt.height,Re.depth,0,fe,Ge,rt.data)}else{pt&&At&&r.texStorage2D(3553,Se,Pe,Ze[0].width,Ze[0].height);for(let xe=0,de=Ze.length;xe<de;xe++)rt=Ze[xe],P.format!==_a?fe!==null?pt?r.compressedTexSubImage2D(3553,xe,0,0,rt.width,rt.height,fe,rt.data):r.compressedTexImage2D(3553,xe,Pe,rt.width,rt.height,0,rt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):pt?r.texSubImage2D(3553,xe,0,0,rt.width,rt.height,fe,Ge,rt.data):r.texImage2D(3553,xe,Pe,rt.width,rt.height,0,fe,Ge,rt.data)}else if(P.isDataArrayTexture)pt?(At&&r.texStorage3D(35866,Se,Pe,Re.width,Re.height,Re.depth),r.texSubImage3D(35866,0,0,0,0,Re.width,Re.height,Re.depth,fe,Ge,Re.data)):r.texImage3D(35866,0,Pe,Re.width,Re.height,Re.depth,0,fe,Ge,Re.data);else if(P.isData3DTexture)pt?(At&&r.texStorage3D(32879,Se,Pe,Re.width,Re.height,Re.depth),r.texSubImage3D(32879,0,0,0,0,Re.width,Re.height,Re.depth,fe,Ge,Re.data)):r.texImage3D(32879,0,Pe,Re.width,Re.height,Re.depth,0,fe,Ge,Re.data);else if(P.isFramebufferTexture){if(At)if(pt)r.texStorage2D(3553,Se,Pe,Re.width,Re.height);else{let xe=Re.width,de=Re.height;for(let Qe=0;Qe<Se;Qe++)r.texImage2D(3553,Qe,Pe,xe,de,0,fe,Ge,null),xe>>=1,de>>=1}}else if(Ze.length>0&&Xe){pt&&At&&r.texStorage2D(3553,Se,Pe,Ze[0].width,Ze[0].height);for(let xe=0,de=Ze.length;xe<de;xe++)rt=Ze[xe],pt?r.texSubImage2D(3553,xe,0,0,fe,Ge,rt):r.texImage2D(3553,xe,Pe,fe,Ge,rt);P.generateMipmaps=!1}else pt?(At&&r.texStorage2D(3553,Se,Pe,Re.width,Re.height),r.texSubImage2D(3553,0,0,0,fe,Ge,Re)):r.texImage2D(3553,0,Pe,fe,Ge,Re);E(P,Xe)&&M(ye),Le.__version=Be.version,P.onUpdate&&P.onUpdate(P)}se.__version=P.version}function N(se,P,H){if(P.image.length!==6)return;let ye=K(se,P),Q=P.source;r.bindTexture(34067,se.__webglTexture,33984+H);let Be=n.get(Q);if(Q.version!==Be.__version||ye===!0){r.activeTexture(33984+H),t.pixelStorei(37440,P.flipY),t.pixelStorei(37441,P.premultiplyAlpha),t.pixelStorei(3317,P.unpackAlignment),t.pixelStorei(37443,0);let Le=P.isCompressedTexture||P.image[0].isCompressedTexture,Ke=P.image[0]&&P.image[0].isDataTexture,Re=[];for(let xe=0;xe<6;xe++)!Le&&!Ke?Re[xe]=y(P.image[xe],!1,!0,h):Re[xe]=Ke?P.image[xe].image:P.image[xe],Re[xe]=Ve(P,Re[xe]);let Xe=Re[0],fe=w(Xe)||l,Ge=s.convert(P.format,P.encoding),Pe=s.convert(P.type),rt=S(P.internalFormat,Ge,Pe,P.encoding),Ze=l&&P.isVideoTexture!==!0,pt=Be.__version===void 0||ye===!0,At=T(P,Xe,fe);oe(34067,P,fe);let Se;if(Le){Ze&&pt&&r.texStorage2D(34067,At,rt,Xe.width,Xe.height);for(let xe=0;xe<6;xe++){Se=Re[xe].mipmaps;for(let de=0;de<Se.length;de++){let Qe=Se[de];P.format!==_a?Ge!==null?Ze?r.compressedTexSubImage2D(34069+xe,de,0,0,Qe.width,Qe.height,Ge,Qe.data):r.compressedTexImage2D(34069+xe,de,rt,Qe.width,Qe.height,0,Qe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Ze?r.texSubImage2D(34069+xe,de,0,0,Qe.width,Qe.height,Ge,Pe,Qe.data):r.texImage2D(34069+xe,de,rt,Qe.width,Qe.height,0,Ge,Pe,Qe.data)}}}else{Se=P.mipmaps,Ze&&pt&&(Se.length>0&&At++,r.texStorage2D(34067,At,rt,Re[0].width,Re[0].height));for(let xe=0;xe<6;xe++)if(Ke){Ze?r.texSubImage2D(34069+xe,0,0,0,Re[xe].width,Re[xe].height,Ge,Pe,Re[xe].data):r.texImage2D(34069+xe,0,rt,Re[xe].width,Re[xe].height,0,Ge,Pe,Re[xe].data);for(let de=0;de<Se.length;de++){let Qe=Se[de].image[xe].image;Ze?r.texSubImage2D(34069+xe,de+1,0,0,Qe.width,Qe.height,Ge,Pe,Qe.data):r.texImage2D(34069+xe,de+1,rt,Qe.width,Qe.height,0,Ge,Pe,Qe.data)}}else{Ze?r.texSubImage2D(34069+xe,0,0,0,Ge,Pe,Re[xe]):r.texImage2D(34069+xe,0,rt,Ge,Pe,Re[xe]);for(let de=0;de<Se.length;de++){let Qe=Se[de];Ze?r.texSubImage2D(34069+xe,de+1,0,0,Ge,Pe,Qe.image[xe]):r.texImage2D(34069+xe,de+1,rt,Ge,Pe,Qe.image[xe])}}}E(P,fe)&&M(34067),Be.__version=Q.version,P.onUpdate&&P.onUpdate(P)}se.__version=P.version}function k(se,P,H,ye,Q){let Be=s.convert(H.format,H.encoding),Le=s.convert(H.type),Ke=S(H.internalFormat,Be,Le,H.encoding);n.get(P).__hasExternalTextures||(Q===32879||Q===35866?r.texImage3D(Q,0,Ke,P.width,P.height,P.depth,0,Be,Le,null):r.texImage2D(Q,0,Ke,P.width,P.height,0,Be,Le,null)),r.bindFramebuffer(36160,se),le(P)?A.framebufferTexture2DMultisampleEXT(36160,ye,Q,n.get(H).__webglTexture,0,me(P)):(
7715Q===3553||Q>=34069&&Q<=34074)&&t.framebufferTexture2D(36160,ye,Q,n.get(H).__webglTexture,0),r.bindFramebuffer(36160,null)}function Z(se,P,H){if(t.bindRenderbuffer(36161,se),P.depthBuffer&&!P.stencilBuffer){let ye=33189;if(H||le(P)){let Q=P.depthTexture;Q&&Q.isDepthTexture&&(Q.type===On?ye=36012:Q.type===Su&&(ye=33190));let Be=me(P);le(P)?A.renderbufferStorageMultisampleEXT(36161,Be,ye,P.width,P.height):t.renderbufferStorageMultisample(36161,Be,ye,P.width,P.height)}else t.renderbufferStorage(36161,ye,P.width,P.height);t.framebufferRenderbuffer(36160,36096,36161,se)}else if(P.depthBuffer&&P.stencilBuffer){let ye=me(P);H&&le(P)===!1?t.renderbufferStorageMultisample(36161,ye,35056,P.width,P.height):le(P)?A.renderbufferStorageMultisampleEXT(36161,ye,35056,P.width,P.height):t.renderbufferStorage(36161,34041,P.width,P.height),t.framebufferRenderbuffer(36160,33306,36161,se)}else{let ye=P.isWebGLMultipleRenderTargets===!0?P.texture:[P.texture];for(let Q=0;Q<ye.length;Q++){let Be=ye[Q],Le=s.convert(Be.format,Be.encoding),Ke=s.convert(Be.type),Re=S(Be.internalFormat,Le,Ke,Be.encoding),Xe=me(P);H&&le(P)===!1?t.renderbufferStorageMultisample(36161,Xe,Re,P.width,P.height):le(P)?A.renderbufferStorageMultisampleEXT(36161,Xe,Re,P.width,P.height):t.renderbufferStorage(36161,Re,P.width,P.height)}}t.bindRenderbuffer(36161,null)}function V(se,P){if(P&&P.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(r.bindFramebuffer(36160,se),!(P.depthTexture&&P.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");(!n.get(P.depthTexture).__webglTexture||P.depthTexture.image.width!==P.width||P.depthTexture.image.height!==P.height)&&(P.depthTexture.image.width=P.width,P.depthTexture.image.height=P.height,P.depthTexture.needsUpdate=!0),J(P.depthTexture,0);let H=n.get(P.depthTexture).__webglTexture,ye=me(P);if(P.depthTexture.format===ep)le(P)?A.framebufferTexture2DMultisampleEXT(36160,36096,3553,H,0,ye):t.framebufferTexture2D(36160,36096,3553,H,0);else if(P.depthTexture.format===up)le(P)?A.framebufferTexture2DMultisampleEXT(36160,33306,3553,H,0,ye):t.framebufferTexture2D(36160,33306,3553,H,0);else throw new Error("Unknown depthTexture format")}function re(se){let P=n.get(se),H=se.isWebGLCubeRenderTarget===!0;if(se.depthTexture&&!P.__autoAllocateDepthBuffer){if(H)throw new Error("target.depthTexture not supported in Cube render targets");V(P.__webglFramebuffer,se)}else if(H){P.__webglDepthbuffer=[];for(let ye=0;ye<6;ye++)r.bindFramebuffer(36160,P.__webglFramebuffer[ye]),P.__webglDepthbuffer[ye]=t.createRenderbuffer(),Z(P.__webglDepthbuffer[ye],se,!1)}else r.bindFramebuffer(36160,P.__webglFramebuffer),P.__webglDepthbuffer=t.createRenderbuffer(),Z(P.__webglDepthbuffer,se,!1);r.bindFramebuffer(36160,null)}function Ae(se,P,H){let ye=n.get(se);P!==void 0&&k(ye.__webglFramebuffer,se,se.texture,36064,3553),H!==void 0&&re(se)}function pe(se){let P=se.texture,H=n.get(se),ye=n.get(P);se.addEventListener("dispose",R),se.isWebGLMultipleRenderTargets!==!0&&(ye.__webglTexture===void 0&&(ye.__webglTexture=t.createTexture()),ye.__version=P.version,o.memory.textures++);let Q=se.isWebGLCubeRenderTarget===!0,Be=se.isWebGLMultipleRenderTargets===!0,Le=w(se)||l;if(Q){H.__webglFramebuffer=[];for(let Ke=0;Ke<6;Ke++)H.__webglFramebuffer[Ke]=t.createFramebuffer()}else{if(H.__webglFramebuffer=t.createFramebuffer(),Be)if(a.drawBuffers){let Ke=se.texture;for(let Re=0,Xe=Ke.length;Re<Xe;Re++){let fe=n.get(Ke[Re]);fe.__webglTexture===void 0&&(fe.__webglTexture=t.createTexture(),o.memory.textures++)}}else console.warn("THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.");if(l&&se.samples>0&&le(se)===!1){let Ke=Be?P:[P];H.__webglMultisampledFramebuffer=t.createFramebuffer(),H.__webglColorRenderbuffer=[],r.bindFramebuffer(36160,H.__webglMultisampledFramebuffer);for(let Re=0;Re<Ke.length;Re++){let Xe=Ke[Re];H.__webglColorRenderbuffer[Re]=t.createRenderbuffer(),t.bindRenderbuffer(36161,H.__webglColorRenderbuffer[Re]);let fe=s.convert(Xe.format,Xe.encoding),Ge=s.convert(Xe.type),Pe=S(Xe.internalFormat,fe,Ge,Xe.encoding,se.isXRRenderTarget===!0),rt=me(se);t.renderbufferStorageMultisample(36161,rt,Pe,se.width,se.height),t.framebufferRenderbuffer(36160,36064+Re,36161,H.__webglColorRen
7715derbuffer[Re])}t.bindRenderbuffer(36161,null),se.depthBuffer&&(H.__webglDepthRenderbuffer=t.createRenderbuffer(),Z(H.__webglDepthRenderbuffer,se,!0)),r.bindFramebuffer(36160,null)}}if(Q){r.bindTexture(34067,ye.__webglTexture),oe(34067,P,Le);for(let Ke=0;Ke<6;Ke++)k(H.__webglFramebuffer[Ke],se,P,36064,34069+Ke);E(P,Le)&&M(34067),r.unbindTexture()}else if(Be){let Ke=se.texture;for(let Re=0,Xe=Ke.length;Re<Xe;Re++){let fe=Ke[Re],Ge=n.get(fe);r.bindTexture(3553,Ge.__webglTexture),oe(3553,fe,Le),k(H.__webglFramebuffer,se,fe,36064+Re,3553),E(fe,Le)&&M(3553)}r.unbindTexture()}else{let Ke=3553;(se.isWebGL3DRenderTarget||se.isWebGLArrayRenderTarget)&&(l?Ke=se.isWebGL3DRenderTarget?32879:35866:console.error("THREE.WebGLTextures: THREE.Data3DTexture and THREE.DataArrayTexture only supported with WebGL2.")),r.bindTexture(Ke,ye.__webglTexture),oe(Ke,P,Le),k(H.__webglFramebuffer,se,P,36064,Ke),E(P,Le)&&M(Ke),r.unbindTexture()}se.depthBuffer&&re(se)}function ce(se){let P=w(se)||l,H=se.isWebGLMultipleRenderTargets===!0?se.texture:[se.texture];for(let ye=0,Q=H.length;ye<Q;ye++){let Be=H[ye];if(E(Be,P)){let Le=se.isWebGLCubeRenderTarget?34067:3553,Ke=n.get(Be).__webglTexture;r.bindTexture(Le,Ke),M(Le),r.unbindTexture()}}}function _e(se){if(l&&se.samples>0&&le(se)===!1){let P=se.isWebGLMultipleRenderTargets?se.texture:[se.texture],H=se.width,ye=se.height,Q=16384,Be=[],Le=se.stencilBuffer?33306:36096,Ke=n.get(se),Re=se.isWebGLMultipleRenderTargets===!0;if(Re)for(let Xe=0;Xe<P.length;Xe++)r.bindFramebuffer(36160,Ke.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+Xe,36161,null),r.bindFramebuffer(36160,Ke.__webglFramebuffer),t.framebufferTexture2D(36009,36064+Xe,3553,null,0);r.bindFramebuffer(36008,Ke.__webglMultisampledFramebuffer),r.bindFramebuffer(36009,Ke.__webglFramebuffer);for(let Xe=0;Xe<P.length;Xe++){Be.push(36064+Xe),se.depthBuffer&&Be.push(Le);let fe=Ke.__ignoreDepthValues!==void 0?Ke.__ignoreDepthValues:!1;if(fe===!1&&(se.depthBuffer&&(Q|=256),se.stencilBuffer&&(Q|=1024)),Re&&t.framebufferRenderbuffer(36008,36064,36161,Ke.__webglColorRenderbuffer[Xe]),fe===!0&&(t.invalidateFramebuffer(36008,[Le]),t.invalidateFramebuffer(36009,[Le])),Re){let Ge=n.get(P[Xe]).__webglTexture;t.framebufferTexture2D(36009,36064,3553,Ge,0)}t.blitFramebuffer(0,0,H,ye,0,0,H,ye,Q,9728),f&&t.invalidateFramebuffer(36008,Be)}if(r.bindFramebuffer(36008,null),r.bindFramebuffer(36009,null),Re)for(let Xe=0;Xe<P.length;Xe++){r.bindFramebuffer(36160,Ke.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064+Xe,36161,Ke.__webglColorRenderbuffer[Xe]);let fe=n.get(P[Xe]).__webglTexture;r.bindFramebuffer(36160,Ke.__webglFramebuffer),t.framebufferTexture2D(36009,36064+Xe,3553,fe,0)}r.bindFramebuffer(36009,Ke.__webglMultisampledFramebuffer)}}function me(se){return Math.min(d,se.samples)}function le(se){let P=n.get(se);return l&&se.samples>0&&i.has("WEBGL_multisampled_render_to_texture")===!0&&P.__useRenderToTexture!==!1}function De(se){let P=o.render.frame;m.get(se)!==P&&(m.set(se,P),se.update())}function Ve(se,P){let H=se.encoding,ye=se.format,Q=se.type;return se.isCompressedTexture===!0||se.isVideoTexture===!0||se.format===oP||H!==mc&&(H===gi?l===!1?i.has("EXT_sRGB")===!0&&ye===_a?(se.format=oP,se.minFilter=Ei,se.generateMipmaps=!1):P=T7.sRGBToLinear(P):(ye!==_a||Q!==gs)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture encoding:",H)),P}this.allocateTextureUnit=U,this.resetTextureUnits=D,this.setTexture2D=J,this.setTexture2DArray=z,this.setTexture3D=$,this.setTextureCube=te,this.rebindTextures=Ae,this.setupRenderTarget=pe,this.updateRenderTargetMipmap=ce,this.updateMultisampleRenderTarget=_e,this.setupDepthRenderbuffer=re,this.setupFrameBufferTexture=k,this.useMultisampledRTT=le}function t_e(t,i,r){let n=r.isWebGL2;function a(s,o=null){let l;if(s===gs)return 5121;if(s===Ufe)return 32819;if(s===Ffe)return 32820;if(s===Lfe)return 5120;if(s===Ofe)return 5122;if(s===v7)return 5123;if(s===Nfe)return 5124;if(s===Su)return 5125;if(s===On)return 5126;if(s===Hu)return n?5131:(l=i.get("OES_texture_half_float"),l!==null?l.HALF_FLOAT_OES:null);if(s===kfe)return 6406;if(s===_a)return 6408;if(s===Hfe)return 6409;if(s===Gfe)return 6410;if(s===ep)return 6402;if(s===up)return 34041;if(s===oP)return l=i.get("EXT_sRGB"),l!==null?l.SRGB_ALPHA_EXT:null;if(s===zfe)return 6403;if(s===Qfe)return 36244;if(s===EC)return 33319;if(s===Vfe)return 33320;if(s===_7)return 36249;if(s===wB||s===bB||s===SB||s===CB)if(o===gi)if(l=i.get("WEBGL_compressed_texture_s3tc_srgb"),l!==null){if(s===wB)return l.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===bB)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===SB)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===CB)return l.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(l=i.get("WEBGL_compressed_texture_s3tc"),l!==null){if(s===wB)return l.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===bB)return l.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===SB)return l.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===CB)return l.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===y5||s===E5||s===w5||s===b5)if(l=i.get("WEBGL_compressed_texture_pvrtc"),l!==null){if(s===y5)return l.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===E5)return l.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===w5)return l.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===b5)return l.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Wfe)return l=i.get("WEBGL_compressed_texture_etc1"),l!==null?l.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===S5||s===C5)if(l=i.get("WEBGL_compressed_texture_etc"),l!==null){if(s===S5)return o===gi?l.COMPRESSED_SRGB8_ETC2:l.COMPRESSED_RGB8_ETC2;if(s===C5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:l.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===T5||s===M5||s===x5||s===R5||s===B5||s===I5||s===D5||s===P5||s===L5||s===O5||s===N5||s===U5||s===F5||s===k5)if(l=i.get("WEBGL_compressed_texture_astc"),l!==null){if(s===T5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:l.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===M5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:l.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===x5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:l.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===R5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:l.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===B5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:l.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===I5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:l.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===D5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:l.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===P5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:l.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===L5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:l.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===O5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:l.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===N5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:l.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===U5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:l.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===F5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:l.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===k5)return o===gi?l.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:l.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===TB)if(l=i.get("EXT_texture_compression_bptc"),l!==null){if(s===TB)return o===gi?l.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:l.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===jfe||s===H5||s===G5||s===z5)if(l=i.get("EXT_texture_compression_rgtc"),l!==null){if(s===TB)return l.COMPRESSED_RED_RGT
7715C1_EXT;if(s===H5)return l.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===G5)return l.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===z5)return l.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===$f?n?34042:(l=i.get("WEBGL_depth_texture"),l!==null?l.UNSIGNED_INT_24_8_WEBGL:null):t[s]!==void 0?t[s]:null}return{convert:a}}var i_e=class extends as{constructor(t=[]){super(),this.isArrayCamera=!0,this.cameras=t}},Tu=class extends lr{constructor(){super(),this.isGroup=!0,this.type="Group"}},r_e={type:"move"},JB=class{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Tu,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Tu,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new O,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new O),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Tu,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new O,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new O),this._grip}dispatchEvent(t){return this._targetRay!==null&&this._targetRay.dispatchEvent(t),this._grip!==null&&this._grip.dispatchEvent(t),this._hand!==null&&this._hand.dispatchEvent(t),this}connect(t){if(t&&t.hand){let i=this._hand;if(i)for(let r of t.hand.values())this._getHandJoint(i,r)}return this.dispatchEvent({type:"connected",data:t}),this}disconnect(t){return this.dispatchEvent({type:"disconnected",data:t}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(t,i,r){let n=null,a=null,s=null,o=this._targetRay,l=this._grip,c=this._hand;if(t&&i.session.visibilityState!=="visible-blurred"){if(c&&t.hand){s=!0;for(let m of t.hand.values()){let g=i.getJointPose(m,r),p=this._getHandJoint(c,m);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.jointRadius=g.radius),p.visible=g!==null}let h=c.joints["index-finger-tip"],u=c.joints["thumb-tip"],d=h.position.distanceTo(u.position),A=.02,f=.005;c.inputState.pinching&&d>A+f?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&d<=A-f&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else l!==null&&t.gripSpace&&(a=i.getPose(t.gripSpace,r),a!==null&&(l.matrix.fromArray(a.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),a.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(a.linearVelocity)):l.hasLinearVelocity=!1,a.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(a.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(n=i.getPose(t.targetRaySpace,r),n===null&&a!==null&&(n=a),n!==null&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(r_e)))}return o!==null&&(o.visible=n!==null),l!==null&&(l.visible=a!==null),c!==null&&(c.visible=s!==null),this}_getHandJoint(t,i){if(t.joints[i.jointName]===void 0){let r=new Tu;r.matrixAutoUpdate=!1,r.visible=!1,t.joints[i.jointName]=r,t.add(r)}return t.joints[i.jointName]}},o0=class extends en{constructor(t,i,r,n,a,s,o,l,c,h){if(h=h!==void 0?h:ep,h!==ep&&h!==up)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");r===void 0&&h===ep&&(r=Su),r===void 0&&h===up&&(r=$f),super(null,n,a,s,o,l,h,r,c),this.isDepthTexture=!0,this.image={width:t,height:i},this.magFilter=o!==void 0?o:tr,this.minFilter=l!==void 0?l:tr,this.flipY=!1,this.generateMipmaps=!1}},n_e=class extends Ja{constructor(t,i){super();let r=this,n=null,a=1,s=null,o="local-floor",l=1,c=null,h=null,u=null,d=null,A=null,f=null,m=i.getContextAttributes(),g=null,p=null,v=[],_=[],y=new Set,w=new Map,b=new as;b.layers.enable(1),b.viewport=new ai;let E=new as;E.layers.enable(2),E.viewport=new ai;let M=[b,E],S=new i_e;S.layers.enable(1),S.layers.enable(2);let T=null,C=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(z){let $=v[z];return $===void 0&&($=new JB,v[z]=$),$.getTargetRaySpace()},this.getControllerGrip=function(z){let $=v[z];return $===void 0&&($=new JB,v[z]=$),$.getGripSpace()},this.getHand=function(z){let $=v[z];return $===void 0&&($=new JB,v[z]=$),$.getHandSpace()};function x(z){let $=_.indexOf(z.inputSource);if($===-1)return;let te=v[$];te!==void 0&&te.dispatchEvent({type:z.type,data:z.inputSource})}function R(){n.removeEventListener("select",x),n.removeEventListener("selectstart",x),n.removeEventListener("selectend",x),n.removeEventListener("squeeze",x),n.removeEventListener("squeezestart",x),n.removeEventListener("squeezeend",x),n.removeEventListener("end",R),n.removeEventListener("inputsourceschange",L);for(let z=0;z<v.length;z++){let $=_[z];$!==null&&(_[z]=null,v[z].disconnect($))}T=null,C=null,t.setRenderTarget(g),A=null,d=null,u=null,n=null,p=null,J.stop(),r.isPresenting=!1,r.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(z){a=z,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(z){o=z,r.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||s},this.setReferenceSpace=function(z){c=z},this.getBaseLayer=function(){return d!==null?d:A},this.getBinding=function(){return u},this.getFrame=function(){return f}
7715,this.getSession=function(){return n},this.setSession=async function(z){if(n=z,n!==null){if(g=t.getRenderTarget(),n.addEventListener("select",x),n.addEventListener("selectstart",x),n.addEventListener("selectend",x),n.addEventListener("squeeze",x),n.addEventListener("squeezestart",x),n.addEventListener("squeezeend",x),n.addEventListener("end",R),n.addEventListener("inputsourceschange",L),m.xrCompatible!==!0&&await i.makeXRCompatible(),n.renderState.layers===void 0||t.capabilities.isWebGL2===!1){let $={antialias:n.renderState.layers===void 0?m.antialias:!0,alpha:m.alpha,depth:m.depth,stencil:m.stencil,framebufferScaleFactor:a};A=new XRWebGLLayer(n,i,$),n.updateRenderState({baseLayer:A}),p=new $i(A.framebufferWidth,A.framebufferHeight,{format:_a,type:gs,encoding:t.outputEncoding,stencilBuffer:m.stencil})}else{let $=null,te=null,ae=null;m.depth&&(ae=m.stencil?35056:33190,$=m.stencil?up:ep,te=m.stencil?$f:Su);let ve={colorFormat:32856,depthFormat:ae,scaleFactor:a};u=new XRWebGLBinding(n,i),d=u.createProjectionLayer(ve),n.updateRenderState({layers:[d]}),p=new $i(d.textureWidth,d.textureHeight,{format:_a,type:gs,depthTexture:new o0(d.textureWidth,d.textureHeight,te,void 0,void 0,void 0,void 0,void 0,void 0,$),stencilBuffer:m.stencil,encoding:t.outputEncoding,samples:m.antialias?4:0});let oe=t.properties.get(p);oe.__ignoreDepthValues=d.ignoreDepthValues}p.isXRRenderTarget=!0,this.setFoveation(l),c=null,s=await n.requestReferenceSpace(o),J.setContext(n),J.start(),r.isPresenting=!0,r.dispatchEvent({type:"sessionstart"})}};function L(z){for(let $=0;$<z.removed.length;$++){let te=z.removed[$],ae=_.indexOf(te);ae>=0&&(_[ae]=null,v[ae].disconnect(te))}for(let $=0;$<z.added.length;$++){let te=z.added[$],ae=_.indexOf(te);if(ae===-1){for(let oe=0;oe<v.length;oe++)if(oe>=_.length){_.push(te),ae=oe;break}else if(_[oe]===null){_[oe]=te,ae=oe;break}if(ae===-1)break}let ve=v[ae];ve&&ve.connect(te)}}let I=new O,F=new O;function Y(z,$,te){I.setFromMatrixPosition($.matrixWorld),F.setFromMatrixPosition(te.matrixWorld);let ae=I.distanceTo(F),ve=$.projectionMatrix.elements,oe=te.projectionMatrix.elements,K=ve[14]/(ve[10]-1),X=ve[14]/(ve[10]+1),N=(ve[9]+1)/ve[5],k=(ve[9]-1)/ve[5],Z=(ve[8]-1)/ve[0],V=(oe[8]+1)/oe[0],re=K*Z,Ae=K*V,pe=ae/(-Z+V),ce=pe*-Z;$.matrixWorld.decompose(z.position,z.quaternion,z.scale),z.translateX(ce),z.translateZ(pe),z.matrixWorld.compose(z.position,z.quaternion,z.scale),z.matrixWorldInverse.copy(z.matrixWorld).invert();let _e=K+pe,me=X+pe,le=re-ce,De=Ae+(ae-ce),Ve=N*X/me*_e,se=k*X/me*_e;z.projectionMatrix.makePerspective(le,De,Ve,se,_e,me)}function D(z,$){$===null?z.matrixWorld.copy(z.matrix):z.matrixWorld.multiplyMatrices($.matrixWorld,z.matrix),z.matrixWorldInverse.copy(z.matrixWorld).invert()}this.updateCamera=function(z){if(n===null)return;S.near=E.near=b.near=z.near,S.far=E.far=b.far=z.far,(T!==S.near||C!==S.far)&&(n.updateRenderState({depthNear:S.near,depthFar:S.far}),T=S.near,C=S.far);let $=z.parent,te=S.cameras;D(S,$);for(let ve=0;ve<te.length;ve++)D(te[ve],$);S.matrixWorld.decompose(S.position,S.quaternion,S.scale),z.matrix.copy(S.matrix),z.matrix.decompose(z.position,z.quaternion,z.scale);let ae=z.children;for(let ve=0,oe=ae.length;ve<oe;ve++)ae[ve].updateMatrixWorld(!0);te.length===2?Y(S,b,E):S.projectionMatrix.copy(b.projectionMatrix)},this.getCamera=function(){return S},this.getFoveation=function(){if(!(d===null&&A===null))return l},this.setFoveation=function(z){l=z,d!==null&&(d.fixedFoveation=z),A!==null&&A.fixedFoveation!==void 0&&(A.fixedFoveation=z)},this.getPlanes=function(){return y};let U=null;function j(z,$){if(h=$.getViewerPose(c||s),f=$,h!==null){let te=h.views;A!==null&&(t.setRenderTargetFramebuffer(p,A.framebuffer),t.setRenderTarget(p));let ae=!1;te.length!==S.cameras.length&&(S.cameras.length=0,ae=!0);for(let ve=0;ve<te.length;ve++){let oe=te[ve],K=null;if(A!==null)K=A.getViewport(oe);else{let N=u.getViewSubImage(d,oe);K=N.viewport,ve===0&&(t.setRenderTargetTextures(p,N.colorTexture,d.ignoreDepthValues?void 0:N.depthStencilTexture),t.setRenderTarget(p))}let X=M[ve];X===void 0&&(X=new as,X.layers.enable(ve),X.viewport=new ai,M[ve]=X),X.matrix.fromArray(oe.transform.matrix),X.projectionMatrix.fromArray(oe.projectionMatrix),X.viewport.set(K.x,K.y,K.width,K.height),ve===0&&S.matrix.copy(X.matrix
7715),ae===!0&&S.cameras.push(X)}}for(let te=0;te<v.length;te++){let ae=_[te],ve=v[te];ae!==null&&ve!==void 0&&ve.update(ae,$,c||s)}if(U&&U(z,$),$.detectedPlanes){r.dispatchEvent({type:"planesdetected",data:$.detectedPlanes});let te=null;for(let ae of y)$.detectedPlanes.has(ae)||(te===null&&(te=[]),te.push(ae));if(te!==null)for(let ae of te)y.delete(ae),w.delete(ae),r.dispatchEvent({type:"planeremoved",data:ae});for(let ae of $.detectedPlanes)if(!y.has(ae))y.add(ae),w.set(ae,$.lastChangedTime),r.dispatchEvent({type:"planeadded",data:ae});else{let ve=w.get(ae);ae.lastChangedTime>ve&&(w.set(ae,ae.lastChangedTime),r.dispatchEvent({type:"planechanged",data:ae}))}}f=null}let J=new I7;J.setAnimationLoop(j),this.setAnimationLoop=function(z){U=z},this.dispose=function(){}}};function a_e(t,i){function r(g,p){p.color.getRGB(g.fogColor.value,B7(t)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function n(g,p,v,_,y){p.isMeshBasicMaterial||p.isMeshLambertMaterial?a(g,p):p.isMeshToonMaterial?(a(g,p),u(g,p)):p.isMeshPhongMaterial?(a(g,p),h(g,p)):p.isMeshStandardMaterial?(a(g,p),d(g,p),p.isMeshPhysicalMaterial&&A(g,p,y)):p.isMeshMatcapMaterial?(a(g,p),f(g,p)):p.isMeshDepthMaterial?a(g,p):p.isMeshDistanceMaterial?(a(g,p),m(g,p)):p.isMeshNormalMaterial?a(g,p):p.isLineBasicMaterial?(s(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,v,_):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function a(g,p){g.opacity.value=p.opacity,p.color&&g.diffuse.value.copy(p.color),p.emissive&&g.emissive.value.copy(p.emissive).multiplyScalar(p.emissiveIntensity),p.map&&(g.map.value=p.map),p.alphaMap&&(g.alphaMap.value=p.alphaMap),p.bumpMap&&(g.bumpMap.value=p.bumpMap,g.bumpScale.value=p.bumpScale,p.side===Ea&&(g.bumpScale.value*=-1)),p.displacementMap&&(g.displacementMap.value=p.displacementMap,g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap),p.normalMap&&(g.normalMap.value=p.normalMap,g.normalScale.value.copy(p.normalScale),p.side===Ea&&g.normalScale.value.negate()),p.specularMap&&(g.specularMap.value=p.specularMap),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);let v=i.get(p).envMap;if(v&&(g.envMap.value=v,g.flipEnvMap.value=v.isCubeTexture&&v.isRenderTargetTexture===!1?-1:1,g.reflectivity.value=p.reflectivity,g.ior.value=p.ior,g.refractionRatio.value=p.refractionRatio),p.lightMap){g.lightMap.value=p.lightMap;let w=t.physicallyCorrectLights!==!0?Math.PI:1;g.lightMapIntensity.value=p.lightMapIntensity*w}p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity);let _;p.map?_=p.map:p.specularMap?_=p.specularMap:p.displacementMap?_=p.displacementMap:p.normalMap?_=p.normalMap:p.bumpMap?_=p.bumpMap:p.roughnessMap?_=p.roughnessMap:p.metalnessMap?_=p.metalnessMap:p.alphaMap?_=p.alphaMap:p.emissiveMap?_=p.emissiveMap:p.clearcoatMap?_=p.clearcoatMap:p.clearcoatNormalMap?_=p.clearcoatNormalMap:p.clearcoatRoughnessMap?_=p.clearcoatRoughnessMap:p.iridescenceMap?_=p.iridescenceMap:p.iridescenceThicknessMap?_=p.iridescenceThicknessMap:p.specularIntensityMap?_=p.specularIntensityMap:p.specularColorMap?_=p.specularColorMap:p.transmissionMap?_=p.transmissionMap:p.thicknessMap?_=p.thicknessMap:p.sheenColorMap?_=p.sheenColorMap:p.sheenRoughnessMap&&(_=p.sheenRoughnessMap),_!==void 0&&(_.isWebGLRenderTarget&&(_=_.texture),_.matrixAutoUpdate===!0&&_.updateMatrix(),g.uvTransform.value.copy(_.matrix));let y;p.aoMap?y=p.aoMap:p.lightMap&&(y=p.lightMap),y!==void 0&&(y.isWebGLRenderTarget&&(y=y.texture),y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uv2Transform.value.copy(y.matrix))}function s(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity}function o(g,p){g.dashSize.value=p.dashSize,g.totalSize.value=p.dashSize+p.gapSize,g.scale.value=p.scale}function l(g,p,v,_){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*v,g.scale.value=_*.5,p.map&&(g.map.value=p.map),p.alphaMap&&(g.alphaMap.value=p.alphaMap),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);let y;
7715p.map?y=p.map:p.alphaMap&&(y=p.alphaMap),y!==void 0&&(y.matrixAutoUpdate===!0&&y.updateMatrix(),g.uvTransform.value.copy(y.matrix))}function c(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.rotation.value=p.rotation,p.map&&(g.map.value=p.map),p.alphaMap&&(g.alphaMap.value=p.alphaMap),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);let v;p.map?v=p.map:p.alphaMap&&(v=p.alphaMap),v!==void 0&&(v.matrixAutoUpdate===!0&&v.updateMatrix(),g.uvTransform.value.copy(v.matrix))}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function u(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function d(g,p){g.roughness.value=p.roughness,g.metalness.value=p.metalness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap),p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap),i.get(p).envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function A(g,p,v){g.ior.value=p.ior,p.sheen>0&&(g.sheenColor.value.copy(p.sheenColor).multiplyScalar(p.sheen),g.sheenRoughness.value=p.sheenRoughness,p.sheenColorMap&&(g.sheenColorMap.value=p.sheenColorMap),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap)),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap),p.clearcoatNormalMap&&(g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),g.clearcoatNormalMap.value=p.clearcoatNormalMap,p.side===Ea&&g.clearcoatNormalScale.value.negate())),p.iridescence>0&&(g.iridescence.value=p.iridescence,g.iridescenceIOR.value=p.iridescenceIOR,g.iridescenceThicknessMinimum.value=p.iridescenceThicknessRange[0],g.iridescenceThicknessMaximum.value=p.iridescenceThicknessRange[1],p.iridescenceMap&&(g.iridescenceMap.value=p.iridescenceMap),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap)),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=v.texture,g.transmissionSamplerSize.value.set(v.width,v.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap)}function f(g,p){p.matcap&&(g.matcap.value=p.matcap)}function m(g,p){g.referencePosition.value.copy(p.referencePosition),g.nearDistance.value=p.nearDistance,g.farDistance.value=p.farDistance}return{refreshFogUniforms:r,refreshMaterialUniforms:n}}function s_e(t,i,r,n){let a={},s={},o=[],l=r.isWebGL2?t.getParameter(35375):0;function c(_,y){let w=y.program;n.uniformBlockBinding(_,w)}function h(_,y){let w=a[_.id];w===void 0&&(m(_),w=u(_),a[_.id]=w,_.addEventListener("dispose",p));let b=y.program;n.updateUBOMapping(_,b);let E=i.render.frame;s[_.id]!==E&&(A(_),s[_.id]=E)}function u(_){let y=d();_.__bindingPointIndex=y;let w=t.createBuffer(),b=_.__size,E=_.usage;return t.bindBuffer(35345,w),t.bufferData(35345,b,E),t.bindBuffer(35345,null),t.bindBufferBase(35345,y,w),w}function d(){for(let _=0;_<l;_++)if(o.indexOf(_)===-1)return o.push(_),_;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function A(_){let y=a[_.id],w=_.uniforms,b=_.__cache;t.bindBuffer(35345,y);for(let E=0,M=w.length;E<M;E++){let S=w[E];if(f(S,E,b)===!0){let T=S.__offset,C=Array.isArray(S.value)?S.value:[S.value],x=0;for(let R=0;R<C.length;R++){let L=C[R],I=g(L);typeof L=="number"?(S.__data[0]=L,t.bufferSubData(35345,T+x,S.__data)):L.isMatrix3?(S.__data[0]=L.elements[0],S.__data[1]=L.elements[1],S.__data[2]=L.elements[2],S.__data[3]=L.elements[0],S.__data[4]=L.elements[3],S.__data[5]=L.elements[4],S.__data[6]=L.elements[5],S.__data[7]=L.elements[0],S.__data[8]=L.elements[6],S.__data[9]=L.elements[7],S.__data[10]=L.elements[8],S.__data[11]=L.elements[0]):(L.toArray(S.__data,x),x+=I.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(35345,T,S.__data)}}t.bindBuffer(35345,null)}function f(_,y,w){let b=_.value;if(w[y]===void 0){if(typeof b=="number")w[y]=b;else{let E=Array.isArray(b)?b:[b],M=[];for(let S=0;S<E.length;S++)M.push(E[S].clone());w[y]=M}return!0}else if(typeof b=="number"){if(w[y]!==b)return w[y]=b,!0}else{let E=Array.isArray(w[y])?w[y]:[w[y]],M=Array.isArray(b)?b:[b];for(let S=0;S<E.length;S++){let T=E[S];if(T.equals(M[S])===!1)return T.copy(M[S]),!0}}return!1}function m(_){let y=_.uniforms,w=0,b=16,E=0;for(let M=0,S=y.length;M<S;M++){let T=y[M],C={boundary:0,storage:0},x=Array.isArray(T.value)?T.value:[T.value];for(let R=0,L=x.length;R<L;R++){let I=x[R],F=g(I);C.boundary+=F.boundary,C.storage+=F.storage}if(T.__data=new Float32Array(C.storage/Float32Array.BYTES_PER_ELEMENT),T.__offset=w,M>0){E=w%b;let R=b-E;E!==0&&R-C.boundary<0&&(w+=b-E,T.__offset=w)}w+=C.storage}return E=w%b,E>0&&(w+=b-E),_.__size=w,_.__cache={},this}function g(_){let y={boundary:0,storage:0};return typeof _=="number"?(y.boundary=4,y.storage=4):_.isVector2?(y.boundary=8,y.storage=8):_.isVector3||_.isColor?(y.boundary=16,y.storage=12):_.isVector4?(y.boundary=16,y.storage=16):_.isMatrix3?(y.boundary=48,y.storage=48):_.isMatrix4?(y.boundary=64,y.storage=64):_.isTexture?c
7715onsole.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",_),y}function p(_){let y=_.target;y.removeEventListener("dispose",p);let w=o.indexOf(y.__bindingPointIndex);o.splice(w,1),t.deleteBuffer(a[y.id]),delete a[y.id],delete s[y.id]}function v(){for(let _ in a)t.deleteBuffer(a[_]);o=[],a={},s={}}return{bind:c,update:h,dispose:v}}function o_e(){let t=My("canvas");return t.style.display="block",t}function U7(t={}){this.isWebGLRenderer=!0;let i=t.canvas!==void 0?t.canvas:o_e(),r=t.context!==void 0?t.context:null,n=t.depth!==void 0?t.depth:!0,a=t.stencil!==void 0?t.stencil:!0,s=t.antialias!==void 0?t.antialias:!1,o=t.premultipliedAlpha!==void 0?t.premultipliedAlpha:!0,l=t.preserveDrawingBuffer!==void 0?t.preserveDrawingBuffer:!1,c=t.powerPreference!==void 0?t.powerPreference:"default",h=t.failIfMajorPerformanceCaveat!==void 0?t.failIfMajorPerformanceCaveat:!1,u;r!==null?u=r.getContextAttributes().alpha:u=t.alpha!==void 0?t.alpha:!1;let d=null,A=null,f=[],m=[];this.domElement=i,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=mc,this.physicallyCorrectLights=!1,this.toneMapping=lh,this.toneMappingExposure=1;let g=this,p=!1,v=0,_=0,y=null,w=-1,b=null,E=new ai,M=new ai,S=null,T=i.width,C=i.height,x=1,R=null,L=null,I=new ai(0,0,T,C),F=new ai(0,0,T,C),Y=!1,D=new oN,U=!1,j=!1,J=null,z=new ht,$=new Me,te=new O,ae={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ve(){return y===null?x:1}let oe=r;function K(ge,ze){for(let Oe=0;Oe<ge.length;Oe++){let Ne=ge[Oe],it=i.getContext(Ne,ze);if(it!==null)return it}return null}try{let ge={alpha:!0,depth:n,stencil:a,antialias:s,premultipliedAlpha:o,preserveDrawingBuffer:l,powerPreference:c,failIfMajorPerformanceCaveat:h};if("setAttribute"in i&&i.setAttribute("data-engine",`three.js r${P0}`),i.addEventListener("webglcontextlost",Pe,!1),i.addEventListener("webglcontextrestored",rt,!1),i.addEventListener("webglcontextcreationerror",Ze,!1),oe===null){let ze=["webgl2","webgl","experimental-webgl"];if(g.isWebGL1Renderer===!0&&ze.shift(),oe=K(ze,ge),oe===null)throw K(ze)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}oe.getShaderPrecisionFormat===void 0&&(oe.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(ge){throw console.error("THREE.WebGLRenderer: "+ge.message),ge}let X,N,k,Z,V,re,Ae,pe,ce,_e,me,le,De,Ve,se,P,H,ye,Q,Be,Le,Ke,Re,Xe;function fe(){X=new y0e(oe),N=new f0e(oe,X,t),X.init(N),Ke=new t_e(oe,X,N),k=new $ve(oe,X,N),Z=new b0e,V=new Hve,re=new e_e(oe,X,k,V,N,Ke,Z),Ae=new m0e(g),pe=new _0e(g),ce=new Dpe(oe,N),Re=new d0e(oe,X,ce,N),_e=new E0e(oe,ce,Z,Re),me=new M0e(oe,_e,ce,Z),Q=new T0e(oe,N,re),P=new p0e(V),le=new kve(g,Ae,pe,X,N,Re,P),De=new a_e(g,V),Ve=new zve,se=new Kve(X,N),ye=new u0e(g,Ae,pe,k,me,u,o),H=new Jve(g,me,N),Xe=new s_e(oe,Z,N,k),Be=new A0e(oe,X,Z,N),Le=new w0e(oe,X,Z,N),Z.programs=le.programs,g.capabilities=N,g.extensions=X,g.properties=V,g.renderLists=Ve,g.shadowMap=H,g.state=k,g.info=Z}fe();let Ge=new n_e(g,oe);this.xr=Ge,this.getContext=function(){return oe},this.getContextAttributes=function(){return oe.getContextAttributes()},this.forceContextLoss=function(){let ge=X.get("WEBGL_lose_context");ge&&ge.loseContext()},this.forceContextRestore=function(){let ge=X.get("WEBGL_lose_context");ge&&ge.restoreContext()},this.getPixelRatio=function(){return x},this.setPixelRatio=function(ge){ge!==void 0&&(x=ge,this.setSize(T,C,!1))},this.getSize=function(ge){return ge.set(T,C)},this.setSize=function(ge,ze,Oe){if(Ge.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}T=ge,C=ze,i.width=Math.floor(ge*x),i.height=Math.floor(ze*x),Oe!==!1&&(i.style.width=ge+"px",i.style.height=ze+"px"),this.setViewport(0,0,ge,ze)},this.getDrawingBufferSize=function(ge){return ge.set(T*x,C*x).floor()},this.setDrawingBufferSize=function(ge,ze,Oe){T=ge,C=ze,x=Oe,i.width=Math.floor(ge*Oe),i.height=Math.floor(ze*Oe),this.setViewport(0,0,ge,ze)},this.getCurrentViewport=function(ge){return ge.copy(E)},this.getViewport=function(ge){return ge.copy(I)},this.setViewport=function(ge,ze,Oe,Ne){ge.isVector4?I.set(ge.x,ge.y,ge.z,ge.w):I.set(ge,ze,Oe,Ne),k.viewport(E.copy(I).multiplyScalar(x).floor())}
vendor: 1,167 bytes, line 7715
7715,this.getScissor=function(ge){return ge.copy(F)},this.setScissor=function(ge,ze,Oe,Ne){ge.isVector4?F.set(ge.x,ge.y,ge.z,ge.w):F.set(ge,ze,Oe,Ne),k.scissor(M.copy(F).multiplyScalar(x).floor())},this.getScissorTest=function(){return Y},this.setScissorTest=function(ge){k.setScissorTest(Y=ge)},this.setOpaqueSort=function(ge){R=ge},this.setTransparentSort=function(ge){L=ge},this.getClearColor=function(ge){return ge.copy(ye.getClearColor())},this.setClearColor=function(){ye.setClearColor.apply(ye,arguments)},this.getClearAlpha=function(){return ye.getClearAlpha()},this.setClearAlpha=function(){ye.setClearAlpha.apply(ye,arguments)},this.clear=function(ge=!0,ze=!0,Oe=!0){let Ne=0;ge&&(Ne|=16384),ze&&(Ne|=256),Oe&&(Ne|=1024),oe.clear(Ne)},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(){i.removeEventListener("webglcontextlost",Pe,!1),i.removeEventListener("webglcontextrestored",rt,!1),i.removeEventListener("webglcontextcreationerror",Ze,!1),Ve.dispose(),se.dispose(),V.dispose(),Ae.dispose(),pe.dispose(),me.dispose(),Re.dispose(),Xe.dis
7715pose(),le.dispose(),Ge.dispose(),Ge.removeEventListener("sessionstart",Qe),Ge.removeEventListener("sessionend",We),J&&(J.dispose(),J=null),He.stop()};function Pe(ge){ge.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),p=!0}function rt(){console.log("THREE.WebGLRenderer: Context Restored."),p=!1;let ge=Z.autoReset,ze=H.enabled,Oe=H.autoUpdate,Ne=H.needsUpdate,it=H.type;fe(),Z.autoReset=ge,H.enabled=ze,H.autoUpdate=Oe,H.needsUpdate=Ne,H.type=it}function Ze(ge){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",ge.statusMessage)}function pt(ge){let ze=ge.target;ze.removeEventListener("dispose",pt),At(ze)}function At(ge){Se(ge),V.remove(ge)}function Se(ge){let ze=V.get(ge).programs;ze!==void 0&&(ze.forEach(function(Oe){le.releaseProgram(Oe)}),ge.isShaderMaterial&&le.releaseShaderCache(ge))}this.renderBufferDirect=function(ge,ze,Oe,Ne,it,W){ze===null&&(ze=ae);let ne=it.isMesh&&it.matrixWorld.determinant()<0,Ee=$a(ge,ze,Oe,Ne,it);k.setMaterial(Ne,ne);let G=Oe.index,ue=1;Ne.wireframe===!0&&(G=_e.getWireframeAttribute(Oe),ue=2);let he=Oe.drawRange,be=Oe.attributes.position,Ce=he.start*ue,Fe=(he.start+he.count)*ue;W!==null&&(Ce=Math.max(Ce,W.start*ue),Fe=Math.min(Fe,(W.start+W.count)*ue)),G!==null?(Ce=Math.max(Ce,0),Fe=Math.min(Fe,G.count)):be!=null&&(Ce=Math.max(Ce,0),Fe=Math.min(Fe,be.count));let Ue=Fe-Ce;if(Ue<0||Ue===1/0)return;Re.setup(it,Ne,Ee,Oe,G);let qe,tt=Be;if(G!==null&&(qe=ce.get(G),tt=Le,tt.setIndex(qe)),it.isMesh)Ne.wireframe===!0?(k.setLineWidth(Ne.wireframeLinewidth*ve()),tt.setMode(1)):tt.setMode(4);else if(it.isLine){let Je=Ne.linewidth;Je===void 0&&(Je=1),k.setLineWidth(Je*ve()),it.isLineSegments?tt.setMode(1):it.isLineLoop?tt.setMode(2):tt.setMode(3)}else it.isPoints?tt.setMode(0):it.isSprite&&tt.setMode(4);if(it.isInstancedMesh)tt.renderInstances(Ce,Ue,it.count);else if(Oe.isInstancedBufferGeometry){let Je=Oe._maxInstanceCount!==void 0?Oe._maxInstanceCount:1/0,dt=Math.min(Oe.instanceCount,Je);tt.renderInstances(Ce,Ue,dt)}else tt.render(Ce,Ue)},this.compile=function(ge,ze){function Oe(Ne,it,W){Ne.transparent===!0&&Ne.side===hs&&Ne.forceSinglePass===!1?(Ne.side=Ea,Ne.needsUpdate=!0,bi(Ne,it,W),Ne.side=pc,Ne.needsUpdate=!0,bi(Ne,it,W),Ne.side=hs):bi(Ne,it,W)}A=se.get(ge),A.init(),m.push(A),ge.traverseVisible(function(Ne){Ne.isLight&&Ne.layers.test(ze.layers)&&(A.pushLight(Ne),Ne.castShadow&&A.pushShadow(Ne))}),A.setupLights(g.physicallyCorrectLights),ge.traverse(function(Ne){let it=Ne.material;if(it)if(Array.isArray(it))for(let W=0;W<it.length;W++){let ne=it[W];Oe(ne,ge,Ne)}else Oe(it,ge,Ne)}),m.pop(),A=null};let xe=null;function de(ge){xe&&xe(ge)}function Qe(){He.stop()}function We(){He.start()}let He=new I7;He.setAnimationLoop(de),typeof self<"u"&&He.setContext(self),this.setAnimationLoop=function(ge){xe=ge,Ge.setAnimationLoop(ge),ge===null?He.stop():He.start()},Ge.addEventListener("sessionstart",Qe),Ge.addEventListener("sessionend",We),this.render=function(ge,ze){if(ze!==void 0&&ze.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(p===!0)return;ge.matrixWorldAutoUpdate===!0&&ge.updateMatrixWorld(),ze.parent===null&&ze.matrixWorldAutoUpdate===!0&&ze.updateMatrixWorld(),Ge.enabled===!0&&Ge.isPresenting===!0&&(Ge.cameraAutoUpdate===!0&&Ge.updateCamera(ze),ze=Ge.getCamera()),ge.isScene===!0&&ge.onBeforeRender(g,ge,ze,y),A=se.get(ge,m.length),A.init(),m.push(A),z.multiplyMatrices(ze.projectionMatrix,ze.matrixWorldInverse),D.setFromProjectionMatrix(z),j=this.localClippingEnabled,U=P.init(this.clippingPlanes,j),d=Ve.get(ge,f.length),d.init(),f.push(d),ct(ge,ze,0,g.sortObjects),d.finish(),g.sortObjects===!0&&d.sort(R,L),U===!0&&P.beginShadows();let Oe=A.state.shadowsArray;if(H.render(Oe,ge,ze),U===!0&&P.endShadows(),this.info.autoReset===!0&&this.info.reset(),ye.render(d,ge),A.setupLights(g.physicallyCorrectLights),ze.isArrayCamera){let Ne=ze.cameras;for(let it=0,W=Ne.length;it<W;it++){let ne=Ne[it];St(d,ge,ne,ne.viewport)}}else St(d,ge,ze);y!==null&&(re.updateMultisampleRenderTarget(y),re.updateRenderTargetMipmap(y)),ge.isScene===!0&&ge.onAfterRender(g,ge,ze),Re.resetDefaultState(),w=-1,b=null,m.pop(),m.length>0?A=m[m.length-1]:A=null,f.pop(),f.length>0?d=f[f.length-1]:d=null};function ct(ge,ze,Oe,Ne){if(ge.visible===!1)return;if(ge.layers.test(ze.layers)){if(ge.isGroup)Oe=ge.renderOrder;else if(ge.isLOD)ge.autoUpdate===!0&&ge.update(ze);else if(ge.isLight)A.pushLight(ge),ge.castShadow&&A.pushShadow(ge);else if(ge.isSprite){if(!ge.frustumCulled||D.intersectsSprite(ge)){Ne&&te.setFromMatrixPosition(ge.matrixWorld).applyMatrix4(z);let W=me.update(ge),ne=ge.material;ne.visible&&d.push(ge,W,ne,Oe,te.z,null)}}else if((ge.isMesh||ge.isLine||ge.isPoints)&&(ge.isSkinnedMesh&&ge.skeleton.frame!==Z.render.frame&&(ge.skeleton.update(),ge.skeleton.frame=Z.render.frame),!ge.frustumCulled||D.intersectsObject(ge))){Ne&&te.setFromMatrixPosition(ge.matrixWorld).applyMatrix4(z);let W=me.update(ge),ne=ge.material;if(Array.isArray(ne)){let Ee=W.groups;for(let G=0,ue=Ee.length;G<ue;G++){let he=Ee[G],be=ne[he.materialIndex];be&&be.visible&&d.push(ge,W,be,Oe,te.z,he)}}else ne.visible&&d.push(ge,W,ne,Oe,te.z,null)}}let it=ge.children;for(let W=0,ne=it.length;W<ne;W++)ct(it[W],ze,Oe,Ne)}function St(ge,ze,Oe,Ne){let it=ge.opaque,W=ge.transmissive,ne=ge.transparent;A.setupLightsView(Oe),U===!0&&P.setGlobalState(g.clippingPlanes,Oe),W.length>0&&si(it,ze,Oe),Ne&&k.viewport(E.copy(Ne)),it.length>0&&oi(it,ze,Oe),W.length>0&&oi(W,ze,Oe),ne.length>0&&oi(ne,ze,Oe),k.buffers.depth.setTest(!0),k.buffers.depth.setMask(!0),k.buffers.color.setMask(!0),k.setPolygonOffset(!1)}
7715function si(ge,ze,Oe){let Ne=N.isWebGL2;J===null&&(J=new $i(1,1,{generateMipmaps:!0,type:X.has("EXT_color_buffer_half_float")?Hu:gs,minFilter:a0,samples:Ne&&s===!0?4:0})),g.getDrawingBufferSize($),Ne?J.setSize($.x,$.y):J.setSize(TC($.x),TC($.y));let it=g.getRenderTarget();g.setRenderTarget(J),g.clear();let W=g.toneMapping;g.toneMapping=lh,oi(ge,ze,Oe),g.toneMapping=W,re.updateMultisampleRenderTarget(J),re.updateRenderTargetMipmap(J),g.setRenderTarget(it)}function oi(ge,ze,Oe){let Ne=ze.isScene===!0?ze.overrideMaterial:null;for(let it=0,W=ge.length;it<W;it++){let ne=ge[it],Ee=ne.object,G=ne.geometry,ue=Ne===null?ne.material:Ne,he=ne.group;Ee.layers.test(Oe.layers)&&Ir(Ee,ze,Oe,G,ue,he)}}function Ir(ge,ze,Oe,Ne,it,W){ge.onBeforeRender(g,ze,Oe,Ne,it,W),ge.modelViewMatrix.multiplyMatrices(Oe.matrixWorldInverse,ge.matrixWorld),ge.normalMatrix.getNormalMatrix(ge.modelViewMatrix),it.onBeforeRender(g,ze,Oe,Ne,ge,W),it.transparent===!0&&it.side===hs&&it.forceSinglePass===!1?(it.side=Ea,it.needsUpdate=!0,g.renderBufferDirect(Oe,ze,Ne,it,ge,W),it.side=pc,it.needsUpdate=!0,g.renderBufferDirect(Oe,ze,Ne,it,ge,W),it.side=hs):g.renderBufferDirect(Oe,ze,Ne,it,ge,W),ge.onAfterRender(g,ze,Oe,Ne,it,W)}function bi(ge,ze,Oe){ze.isScene!==!0&&(ze=ae);let Ne=V.get(ge),it=A.state.lights,W=A.state.shadowsArray,ne=it.state.version,Ee=le.getParameters(ge,it.state,W,ze,Oe),G=le.getProgramCacheKey(Ee),ue=Ne.programs;Ne.environment=ge.isMeshStandardMaterial?ze.environment:null,Ne.fog=ze.fog,Ne.envMap=(ge.isMeshStandardMaterial?pe:Ae).get(ge.envMap||Ne.environment),ue===void 0&&(ge.addEventListener("dispose",pt),ue=new Map,Ne.programs=ue);let he=ue.get(G);if(he!==void 0){if(Ne.currentProgram===he&&Ne.lightsStateVersion===ne)return Qr(ge,Ee),he}else Ee.uniforms=le.getUniforms(ge),ge.onBuild(Oe,Ee,g),ge.onBeforeCompile(Ee,g),he=le.acquireProgram(Ee,G),ue.set(G,he),Ne.uniforms=Ee.uniforms;let be=Ne.uniforms;(!ge.isShaderMaterial&&!ge.isRawShaderMaterial||ge.clipping===!0)&&(be.clippingPlanes=P.uniform),Qr(ge,Ee),Ne.needsLights=Th(ge),Ne.lightsStateVersion=ne,Ne.needsLights&&(be.ambientLightColor.value=it.state.ambient,be.lightProbe.value=it.state.probe,be.directionalLights.value=it.state.directional,be.directionalLightShadows.value=it.state.directionalShadow,be.spotLights.value=it.state.spot,be.spotLightShadows.value=it.state.spotShadow,be.rectAreaLights.value=it.state.rectArea,be.ltc_1.value=it.state.rectAreaLTC1,be.ltc_2.value=it.state.rectAreaLTC2,be.pointLights.value=it.state.point,be.pointLightShadows.value=it.state.pointShadow,be.hemisphereLights.value=it.state.hemi,be.directionalShadowMap.value=it.state.directionalShadowMap,be.directionalShadowMatrix.value=it.state.directionalShadowMatrix,be.spotShadowMap.value=it.state.spotShadowMap,be.spotLightMatrix.value=it.state.spotLightMatrix,be.spotLightMap.value=it.state.spotLightMap,be.pointShadowMap.value=it.state.pointShadowMap,be.pointShadowMatrix.value=it.state.pointShadowMatrix);let Ce=he.getUniforms(),Fe=CS.seqWithValue(Ce.seq,be);return Ne.currentProgram=he,Ne.uniformsList=Fe,he}function Qr(ge,ze){let Oe=V.get(ge);Oe.outputEncoding=ze.outputEncoding,Oe.instancing=ze.instancing,Oe.skinning=ze.skinning,Oe.morphTargets=ze.morphTargets,Oe.morphNormals=ze.morphNormals,Oe.morphColors=ze.morphColors,Oe.morphTargetsCount=ze.morphTargetsCount,Oe.numClippingPlanes=ze.numClippingPlanes,Oe.numIntersection=ze.numClipIntersection,Oe.vertexAlphas=ze.vertexAlphas,Oe.vertexTangents=ze.vertexTangents,Oe.toneMapping=ze.toneMapping}function $a(ge,ze,Oe,Ne,it){ze.isScene!==!0&&(ze=ae),re.resetTextureUnits();let W=ze.fog,ne=Ne.isMeshStandardMaterial?ze.environment:null,Ee=y===null?g.outputEncoding:y.isXRRenderTarget===!0?y.texture.encoding:mc,G=(Ne.isMeshStandardMaterial?pe:Ae).get(Ne.envMap||ne),ue=Ne.vertexColors===!0&&!!Oe.attributes.color&&Oe.attributes.color.itemSize===4,he=!!Ne.normalMap&&!!Oe.attributes.tangent,be=!!Oe.morphAttributes.position,Ce=!!Oe.morphAttributes.normal,Fe=!!Oe.morphAttributes.color,Ue=Ne.toneMapped?g.toneMapping:lh,qe=Oe.morphAttributes.position||Oe.morphAttributes.normal||Oe.morphAttributes.color,tt=qe!==void 0?qe.length:0,Je=V.get(Ne),dt=A.state.lights;if(U===!0&&(j===!0||ge!==b)){let ie=ge===b&&Ne.id===w;P.setState(Ne,ge,ie)}let nt=!1;Ne.version===Je.__version?(Je.needsLights&&Je.lightsStateVersion!==dt.state.ver
7715sion||Je.outputEncoding!==Ee||it.isInstancedMesh&&Je.instancing===!1||!it.isInstancedMesh&&Je.instancing===!0||it.isSkinnedMesh&&Je.skinning===!1||!it.isSkinnedMesh&&Je.skinning===!0||Je.envMap!==G||Ne.fog===!0&&Je.fog!==W||Je.numClippingPlanes!==void 0&&(Je.numClippingPlanes!==P.numPlanes||Je.numIntersection!==P.numIntersection)||Je.vertexAlphas!==ue||Je.vertexTangents!==he||Je.morphTargets!==be||Je.morphNormals!==Ce||Je.morphColors!==Fe||Je.toneMapping!==Ue||N.isWebGL2===!0&&Je.morphTargetsCount!==tt)&&(nt=!0):(nt=!0,Je.__version=Ne.version);let mt=Je.currentProgram;nt===!0&&(mt=bi(Ne,ze,it));let bt=!1,Rt=!1,Si=!1,q=mt.getUniforms(),ee=Je.uniforms;if(k.useProgram(mt.program)&&(bt=!0,Rt=!0,Si=!0),Ne.id!==w&&(w=Ne.id,Rt=!0),bt||b!==ge){if(q.setValue(oe,"projectionMatrix",ge.projectionMatrix),N.logarithmicDepthBuffer&&q.setValue(oe,"logDepthBufFC",2/(Math.log(ge.far+1)/Math.LN2)),b!==ge&&(b=ge,Rt=!0,Si=!0),Ne.isShaderMaterial||Ne.isMeshPhongMaterial||Ne.isMeshToonMaterial||Ne.isMeshStandardMaterial||Ne.envMap){let ie=q.map.cameraPosition;ie!==void 0&&ie.setValue(oe,te.setFromMatrixPosition(ge.matrixWorld))}(Ne.isMeshPhongMaterial||Ne.isMeshToonMaterial||Ne.isMeshLambertMaterial||Ne.isMeshBasicMaterial||Ne.isMeshStandardMaterial||Ne.isShaderMaterial)&&q.setValue(oe,"isOrthographic",ge.isOrthographicCamera===!0),(Ne.isMeshPhongMaterial||Ne.isMeshToonMaterial||Ne.isMeshLambertMaterial||Ne.isMeshBasicMaterial||Ne.isMeshStandardMaterial||Ne.isShaderMaterial||Ne.isShadowMaterial||it.isSkinnedMesh)&&q.setValue(oe,"viewMatrix",ge.matrixWorldInverse)}if(it.isSkinnedMesh){q.setOptional(oe,it,"bindMatrix"),q.setOptional(oe,it,"bindMatrixInverse");let ie=it.skeleton;ie&&(N.floatVertexTextures?(ie.boneTexture===null&&ie.computeBoneTexture(),q.setValue(oe,"boneTexture",ie.boneTexture,re),q.setValue(oe,"boneTextureSize",ie.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}let Te=Oe.morphAttributes;if((Te.position!==void 0||Te.normal!==void 0||Te.color!==void 0&&N.isWebGL2===!0)&&Q.update(it,Oe,Ne,mt),(Rt||Je.receiveShadow!==it.receiveShadow)&&(Je.receiveShadow=it.receiveShadow,q.setValue(oe,"receiveShadow",it.receiveShadow)),Ne.isMeshGouraudMaterial&&Ne.envMap!==null&&(ee.envMap.value=G,ee.flipEnvMap.value=G.isCubeTexture&&G.isRenderTargetTexture===!1?-1:1),Rt&&(q.setValue(oe,"toneMappingExposure",g.toneMappingExposure),Je.needsLights&&Ll(ee,Si),W&&Ne.fog===!0&&De.refreshFogUniforms(ee,W),De.refreshMaterialUniforms(ee,Ne,x,C,J),CS.upload(oe,Je.uniformsList,ee,re)),Ne.isShaderMaterial&&Ne.uniformsNeedUpdate===!0&&(CS.upload(oe,Je.uniformsList,ee,re),Ne.uniformsNeedUpdate=!1),Ne.isSpriteMaterial&&q.setValue(oe,"center",it.center),q.setValue(oe,"modelViewMatrix",it.modelViewMatrix),q.setValue(oe,"normalMatrix",it.normalMatrix),q.setValue(oe,"modelMatrix",it.matrixWorld),it.previousModelViewMatrix&&q.setValue(oe,"previousModelViewMatrix",it.previousModelViewMatrix),ge.previousProjectionMatrix&&q.setValue(oe,"previousProjectionMatrix",ge.previousProjectionMatrix),Ne.isShaderMaterial||Ne.isRawShaderMaterial){let ie=Ne.uniformsGroups;for(let Ie=0,lt=ie.length;Ie<lt;Ie++)if(N.isWebGL2){let zi=ie[Ie];Xe.update(zi,mt),Xe.bind(zi,mt)}else console.warn("THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.")}return mt}function Ll(ge,ze){ge.ambientLightColor.needsUpdate=ze,ge.lightProbe.needsUpdate=ze,ge.directionalLights.needsUpdate=ze,ge.directionalLightShadows.needsUpdate=ze,ge.pointLights.needsUpdate=ze,ge.pointLightShadows.needsUpdate=ze,ge.spotLights.needsUpdate=ze,ge.spotLightShadows.needsUpdate=ze,ge.rectAreaLights.needsUpdate=ze,ge.hemisphereLights.needsUpdate=ze}function Th(ge){return ge.isMeshLambertMaterial||ge.isMeshToonMaterial||ge.isMeshPhongMaterial||ge.isMeshStandardMaterial||ge.isShadowMaterial||ge.isShaderMaterial&&ge.lights===!0}this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return _},this.getRenderTarget=function(){return y},this.setRenderTargetTextures=function(ge,ze,Oe){V.get(ge.texture).__webglTexture=ze,V.get(ge.depthTexture).__webglTexture=Oe;let Ne=V.get(ge);Ne.__hasExternalTextures=!0,Ne.__hasExternalTextures&&(Ne.__autoAllocateDepthBuffer=Oe===void 0,Ne.__autoAllocateDepthBuffer||X.has("WEBGL_multisampled_render_to_texture")===!0&&(console.warn("THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided"),Ne.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(ge,ze){let Oe=V.get(ge);Oe.__webglFramebuffer=ze,Oe.__useDefaultFramebuffer=ze===void 0},this.setRenderTarget=function(ge,ze=0,Oe=0){y=ge,v=ze,_=Oe;let Ne=!0,it=null,W=!1,ne=!1;if(ge){let Ee=V.get(ge);Ee.__useDefaultFramebuffer!==void 0?(k.bindFramebuffer(36160,null),Ne=!1):Ee.__webglFramebuffer===void 0?re.setupRenderTarget(ge):Ee.__hasExternalTextures&&re.rebindTextures(ge,V.get(ge.texture).__webglTexture,V.get(ge.depthTexture).__webglTexture);let G=ge.texture;(G.isData3DTexture||G.isDataArrayTexture||G.isCompressedArrayTexture)&&(ne=!0);let ue=V.get(ge).__webglFramebuffer;
7715ge.isWebGLCubeRenderTarget?(it=ue[ze],W=!0):N.isWebGL2&&ge.samples>0&&re.useMultisampledRTT(ge)===!1?it=V.get(ge).__webglMultisampledFramebuffer:it=ue,E.copy(ge.viewport),M.copy(ge.scissor),S=ge.scissorTest}else E.copy(I).multiplyScalar(x).floor(),M.copy(F).multiplyScalar(x).floor(),S=Y;if(k.bindFramebuffer(36160,it)&&N.drawBuffers&&Ne&&k.drawBuffers(ge,it),k.viewport(E),k.scissor(M),k.setScissorTest(S),W){let Ee=V.get(ge.texture);oe.framebufferTexture2D(36160,36064,34069+ze,Ee.__webglTexture,Oe)}else if(ne){let Ee=V.get(ge.texture),G=ze||0;oe.framebufferTextureLayer(36160,36064,Ee.__webglTexture,Oe||0,G)}w=-1},this.readRenderTargetPixels=function(ge,ze,Oe,Ne,it,W,ne){if(!(ge&&ge.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ee=V.get(ge).__webglFramebuffer;if(ge.isWebGLCubeRenderTarget&&ne!==void 0&&(Ee=Ee[ne]),Ee){k.bindFramebuffer(36160,Ee);try{let G=ge.texture,ue=G.format,he=G.type;if(ue!==_a&&Ke.convert(ue)!==oe.getParameter(35739)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}let be=he===Hu&&(X.has("EXT_color_buffer_half_float")||N.isWebGL2&&X.has("EXT_color_buffer_float"));if(he!==gs&&Ke.convert(he)!==oe.getParameter(35738)&&!(he===On&&(N.isWebGL2||X.has("OES_texture_float")||X.has("WEBGL_color_buffer_float")))&&!be){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ze>=0&&ze<=ge.width-Ne&&Oe>=0&&Oe<=ge.height-it&&oe.readPixels(ze,Oe,Ne,it,Ke.convert(ue),Ke.convert(he),W)}finally{let G=y!==null?V.get(y).__webglFramebuffer:null;k.bindFramebuffer(36160,G)}}},this.copyFramebufferToTexture=function(ge,ze,Oe=0){let Ne=Math.pow(2,-Oe),it=Math.floor(ze.image.width*Ne),W=Math.floor(ze.image.height*Ne);re.setTexture2D(ze,0),oe.copyTexSubImage2D(3553,Oe,0,0,ge.x,ge.y,it,W),k.unbindTexture()},this.copyTextureToTexture=function(ge,ze,Oe,Ne=0){let it=ze.image.width,W=ze.image.height,ne=Ke.convert(Oe.format),Ee=Ke.convert(Oe.type);re.setTexture2D(Oe,0),oe.pixelStorei(37440,Oe.flipY),oe.pixelStorei(37441,Oe.premultiplyAlpha),oe.pixelStorei(3317,Oe.unpackAlignment),ze.isDataTexture?oe.texSubImage2D(3553,Ne,ge.x,ge.y,it,W,ne,Ee,ze.image.data):ze.isCompressedTexture?oe.compressedTexSubImage2D(3553,Ne,ge.x,ge.y,ze.mipmaps[0].width,ze.mipmaps[0].height,ne,ze.mipmaps[0].data):oe.texSubImage2D(3553,Ne,ge.x,ge.y,ne,Ee,ze.image),Ne===0&&Oe.generateMipmaps&&oe.generateMipmap(3553),k.unbindTexture()},this.copyTextureToTexture3D=function(ge,ze,Oe,Ne,it=0){if(g.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}let W=ge.max.x-ge.min.x+1,ne=ge.max.y-ge.min.y+1,Ee=ge.max.z-ge.min.z+1,G=Ke.convert(Ne.format),ue=Ke.convert(Ne.type),he;if(Ne.isData3DTexture)re.setTexture3D(Ne,0),he=32879;else if(Ne.isDataArrayTexture)re.setTexture2DArray(Ne,0),he=35866;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}oe.pixelStorei(37440,Ne.flipY),oe.pixelStorei(37441,Ne.premultiplyAlpha),oe.pixelStorei(3317,Ne.unpackAlignment);let be=oe.getParameter(3314),Ce=oe.getParameter(32878),Fe=oe.getParameter(3316),Ue=oe.getParameter(3315),qe=oe.getParameter(32877),tt=Oe.isCompressedTexture?Oe.mipmaps[0]:Oe.image;oe.pixelStorei(3314,tt.width),oe.pixelStorei(32878,tt.height),oe.pixelStorei(3316,ge.min.x),oe.pixelStorei(3315,ge.min.y),oe.pixelStorei(32877,ge.min.z),Oe.isDataTexture||Oe.isData3DTexture?oe.texSubImage3D(he,it,ze.x,ze.y,ze.z,W,ne,Ee,G,ue,tt.data):Oe.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),oe.compressedTexSubImage3D(he,it,ze.x,ze.y,ze.z,W,ne,Ee,G,tt.data)):oe.texSubImage3D(he,it,ze.x,ze.y,ze.z,W,ne,Ee,G,ue,tt),oe.pixelStorei(3314,be),oe.pixelStorei(32878,Ce),oe.pixelStorei(3316,Fe),oe.pixelStorei(3315,Ue),oe.pixelStorei(32877,qe),it===0&&Ne.generateMipmaps&&oe.generateMipmap(he),k.unbindTexture()},this.initTexture=function(ge){ge.isCubeTexture?re.setTextureCube(ge,0):ge.isData3DTexture?re.setTexture3D(ge,0):ge.isDataArrayTexture||ge.isCompressedArrayTexture?re.setTexture2DArray(ge,0):re.setTexture2D(ge,0),k.unbindTexture()},this.resetState=function(){v=0,_=0,y=null,k.reset(),Re.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}var l_e=class extends U7{};l_e.prototype.isWebGL1Renderer=!0;var F7=class{constructor(t,i=1,r=1e3){this.isFog=!0,this.name="",this.color=new Ht(t),this.near=i,this.far=r}clone(){return new F7(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}},ch=class extends lr{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,i){return super.copy(t,i),t.background!==null&&(this.background=t.background.clone()),t.environment!==null&&(this.environment=t.environment.clone()),t.fog!==null&&(this.fog=t.fog.clone()),this.backgroundBlurriness=t.backgroundBlurriness,this.backgroundIntensity=t.backgroundIntensity,t.overrideMaterial!==null&&(this.overrideMaterial=t.overrideMaterial.clone()),this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){let i=super.toJSON(t);return this.fog!==null&&(i.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(i.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(i.object.backgroundIntensity=this.backgroundIntensity),i}get autoUpdate(){return console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate}set autoUpdate(t){console.warn("THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144."),this.matrixWorldAutoUpdate=t}},c_e=class{constructor(t,i){this.isInterleavedBuffer=!0,this.array=t,this.stride=i,this.count=t!==void 0?t.length/i:0,this.usage=sP,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=gl()}onUploadCallback(){}set needsUpdate(t){t===!0&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,i,r){t*=this.stride,r*=i.stride;for(let n=0,a=this.stride;n<a;n++)this.array[t+n]=i.array[r+n];return this}set(t,i=0){return this.array.set(t,i),this}clone(t){t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=gl()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);let i=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),r=new this.constructor(i,this.stride);return r.setUsage(this.usage),r}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return t.arrayBuffers===void 0&&(t.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=gl()),t.arrayBuffers[this.array.buffer._uuid]===void 0&&(t.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}}},Es=new O,hP=class{constructor(t,i,r,n=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=t,this.itemSize=i,this.offset=r,this.normalized=n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let i=0,r=this.data.count;i<r;i++)Es.fromBufferAttribute(this,i),Es.applyMatrix4(t),this.setXYZ(i,Es.x,Es.y,Es.z);return this}applyNormalMatrix(t){for(let i=0,r=this.count;i<r;i++)Es.fromBufferAttribute(this,i),Es.applyNormalMatrix(t),this.setXYZ(i,Es.x,Es.y,Es.z);return this}transformDirection(t){for(let i=0,r=this.count;i<r;i++)Es.fromBufferAttribute(this,i),Es.transformDirection(t),this.setXYZ(i,Es.x,Es.y,Es.z);return this}setX(t,i){return this.normalized&&(i=Tr(i,this.array)),this.data.array[t*this.data.stride+this.offset]=i,this}setY(t,i){return this.normalized&&(i=Tr(i,this.array)),this.data.array[t*this.data.stride+this.offset+1]=i,this}setZ(t,i){return this.normalized&&(i=Tr(i,this.array)),this.data.array[t*this.data.stride+this.offset+2]=i,this}setW(t,i){return this.normalized&&(i=Tr(i,this.array)),this.data.array[t*this.data.stride+this.offset+3]=i,this}getX(t){let i=this.data.array[t*this.data.stride+this.offset];return this.normalized&&(i=Cu(i,this.array)),i}getY(t){let i=this.data.array[t*this.data.stride+this.offset+1];return this.normalized&&(i=Cu(i,this.array)),i}getZ(t){let i=this.data.array[t*this.data.stride+this.offset+2];return this.normalized&&(i=Cu(i,this.array)),i}getW(t){let i=this.data.array[t*this.data.stride+this.offset+3];return this.normalized&&(i=Cu(i,this.array)),i}setXY(t,i,r){return t=t*this.data.stride+this.offset,this.normalized&&(i=Tr(i,this.array),r=Tr(r,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this}setXYZ(t,i,r,n){return t=t*this.data.stride+this.offset,this.normalized&&(i=Tr(i,this.array),r=Tr(r,this.array),n=Tr(n,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this.data.array[t+2]=n,this}setXYZW(t,i,r,n,a){return t=t*this.data.stride+this.offset,this.normalized&&(i=Tr(i,this.array),r=Tr(r,this.array),n=Tr(n,this.array),a=Tr(a,this.array)),this.data.array[t+0]=i,this.data.array[t+1]=r,this.data.array[t+2]=n,this.data.array[t+3]=a,this}clone(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");let i=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)i.push(this.data.array[n+a])}return new ei(new this.array.constructor(i),this.itemSize,this.normalized)}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new hP(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(t===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");let i=[];for(let r=0;r<this.count;r++){let n=r*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)i.push(this.data.array[n+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:i,normalized:this.normalized}}else return t.interleavedBuffers===void 0&&(t.interleavedBuffers={}),t.interleavedBuffers[this.data.uuid]===void 0&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}},k7=class extends lr{constructor(){super(),this.isBone=!0,this.type="Bone"}},ul=class extends en{constructor(t=null,i=1,r=1,n,a,s,o,l,c=tr,h=tr,u,d){super(null,s,o,l,c,h,n,a,u,d),this.isDataTexture=!0,this.image={data:t,width:i,height:r},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}
vendor: 5,091 bytes, line 7715
7715,bG=new ht,h_e=new ht,cN=class{constructor(t=[],i=[]){this.uuid=gl(),this.bones=t.slice(0),this.boneInverses=i,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){let t=this.bones,i=this.boneInverses;if(this.boneMatrices=new Float32Array(t.length*16),i.length===0)this.calculateInverses();else if(t.length!==i.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let r=0,n=this.bones.length;r<n;r++)this.boneInverses.push(new ht)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,i=this.bones.length;t<i;t++){let r=new ht;this.bones[t]&&r.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(r)}}pose(){for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];r&&r.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,i=this.bones.length;t<i;t++){let r=this.bones[t];r&&(r.parent&&r.parent.isBone?(r.matrix.copy(r.parent.matrixWorld).invert(),r.matrix.multiply(r.matrixWorld)):r.matrix.copy(r.matrixWorld),r.matrix.decompose(r.position,r.quaternion,r.scale))}}update(){let t=this.bones,i=this.boneInverses,r=this.boneMatrices,n=this.boneTexture;for(let a=0,s=t.length;a<s;a++){let o=t[a]?t[a].matrixWorld:h_e;bG.multiplyMatrices(o,i[a]),bG.toArray(r,a*16)}n!==null&&(n.needsUpdate=!0)}clone(){return new cN(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(this.bones.length*4);t=b7(t),t=Math.max(t,4);let i=new Float32Array(t*t*4);i.set(this.boneMatrices);let r=new ul(i,t,t,_a,On);return r.needsUpdate=!0,this.boneMatrices=i,this.boneTexture=r,this.boneTextureSize=t,this}getBoneByName(t){for(let i=0,r=this.bones.length;i<r;i++){let n=this.bones[i];if(n.name===t)return n}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,i){this.uuid=t.uuid;for(let r=0,n=t.bones.length;r<n;r++){let a=t.bones[r],s=i[a];s===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",a),s=new k7),this.bones.push(s),this.boneInverses.push(new ht().fromArray(t.boneInverses[r]))}return this.init(),this}toJSON(){let t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;let i=this.bones,r=this.boneInverses;for(let n=0,a=i.length;n<a;n++){let s=i[n];t.bones.push(s.uuid);let o=r[n];t.boneInverses.push(o.toArray())}return t}},xy=class extends ei{constructor(t,i,r,n=1){super(t,i,r),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){let t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}},SG=new ht,CG=new ht,Jw=[],u_e=new ht,Pv=new Zr,d_e=class extends Zr{constructor(t,i,r){super(t,i),this.isInstancedMesh=!0,this.instanceMatrix=new xy(new Float32Array(r*16),16),this.instanceColor=null,this.count=r,this.frustumCulled=!1;for(let n=0;n<r;n++)this.setMatrixAt(n,u_e)}copy(t,i){return super.copy(t,i),this.instanceMatrix.copy(t.instanceMatrix),t.instanceColor!==null&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,i){i.fromArray(this.instanceColor.array,t*3)}getMatrixAt(t,i){i.fromArray(this.instanceMatrix.array,t*16)}raycast(t,i){let r=this.matrixWorld,n=this.count;if(Pv.geometry=this.geometry,Pv.material=this.material,Pv.material!==void 0)for(let a=0;a<n;a++){this.getMatrixAt(a,SG),CG.multiplyMatrices(r,SG),Pv.matrixWorld=CG,Pv.raycast(t,Jw);for(let s=0,o=Jw.length;s<o;s++){let l=Jw[s];l.instanceId=a,l.object=this,i.push(l)}Jw.length=0}}setColorAt(t,i){this.instanceColor===null&&(this.instanceColor=new xy(new Float32Array(this.instanceMatrix.count*3),3)),i.toArray(this.instanceColor.array,t*3)}setMatrixAt(t,i){i.toArray(this.instanceMatrix.array,t*16)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}},WA=class extends wE{constructor(t){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Ht(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}},TG=new O,MG=new O,xG=new ht,$B=new L0,$w=new ho,MC=class extends lr{constructor(t=new Lt,i=new WA){super(),this.isLine=!0,this.type="Line",this.geometry=t,this.material=i,this.updateMorphTargets()}copy(t,i){return super.copy(t,i),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){let t=this.geometry;if(t.index===null){let i=t.attributes.position,r=[0];for(let n=1,a=i.count;n<a;n++)TG.fromBufferAttribute(i,n-1),MG.fromBufferAttribute(i,n),r[n]=r[n-1],r[n]+=TG.distanceTo(MG);t.setAttribute("lineDistance",new Et(r,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(t,i){let r=this.geometry,n=this.matrixWorld,a=t.params.Line.threshold,s=r.drawRange;if(r.boundingSphere===null&&r.computeBoundingSphere(),$w.copy(r.boun
7715dingSphere),$w.applyMatrix4(n),$w.radius+=a,t.ray.intersectsSphere($w)===!1)return;xG.copy(n).invert(),$B.copy(t.ray).applyMatrix4(xG);let o=a/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=new O,h=new O,u=new O,d=new O,A=this.isLineSegments?2:1,f=r.index,m=r.attributes.position;if(f!==null){let g=Math.max(0,s.start),p=Math.min(f.count,s.start+s.count);for(let v=g,_=p-1;v<_;v+=A){let y=f.getX(v),w=f.getX(v+1);if(c.fromBufferAttribute(m,y),h.fromBufferAttribute(m,w),$B.distanceSqToSegment(c,h,d,u)>l)continue;d.applyMatrix4(this.matrixWorld);let b=t.ray.origin.distanceTo(d);b<t.near||b>t.far||i.push({distance:b,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}else{let g=Math.max(0,s.start),p=Math.min(m.count,s.start+s.count);for(let v=g,_=p-1;v<_;v+=A){if(c.fromBufferAttribute(m,v),h.fromBufferAttribute(m,v+1),$B.distanceSqToSegment(c,h,d,u)>l)continue;d.applyMatrix4(this.matrixWorld);let y=t.ray.origin.distanceTo(d);y<t.near||y>t.far||i.push({distance:y,point:u.clone().applyMatrix4(this.matrixWorld),index:v,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){let t=this.geometry.morphAttributes,i=Object.keys(t);if(i.length>0){let r=t[i[0]];if(r!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let n=0,a=r.length;n<a;n++){let s=r[n].name||String(n);this.morphTargetInfluences.push(0),this.morphTargetDictionary[s]=n}}}}},RG=new O,BG=new O,bE=class extends MC{constructor(t,i){super(t,i),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){let t=this.geometry;if(t.index===null){let i=t.attributes.position,r=[];for(let n=0,a=i.count;n<a;n+=2)RG.fromBufferAttribute(i,n),BG.fromBufferAttribute(i,n+1),r[n]=n===0?0:r[n-1],r[n+1]=r[n]+RG.distanceTo(BG);t.setAttribute("lineDistance",new Et(r,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}},A_e=class extends en{constructor(t,i,r,n,a,s,o,l,c){super(t,i,r,n,a,s,o,l,c),this.isVideoTexture=!0,this.minFilter=s!==void 0?s:Ei,this.magFilter=a!==void 0?a:Ei,this.generateMipmaps=!1;let h=this;function u(){h.needsUpdate=!0,t.requestVideoFrameCallback(u)}"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(u)}clone(){return new this.constructor(this.image).copy(this)}update(){let t=this.image;!("requestVideoFrameCallback"in t)&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}},f_e=class extends en{constructor(t,i,r,n,a,s,o,l,c){super(t,i,r,n,a,s,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}},wh=class{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(t,i){let r=this.getUtoTmapping(t);return this.getPoint(r,i)}getPoints(t=5){let i=[];for(let r=0;r<=t;r++)i.push(this.getPoint(r/t));return i}getSpacedPoints(t=5){let i=[];for(let r=0;r<=t;r++)i.push(this.getPointAt(r/t));return i}getLength(){let t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;let i=[],r,n=this.getPoint(0),a=0;i.push(0);for(let s=1;s<=t;s++)r=this.getPoint(s/t),a+=r.distanceTo(n),i.push(a),n=r;return this.cacheArcLengths=i,i}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(t,i){let r=this.getLengths(),n=0,a=r.length,s;i?s=i:s=t*r[a-1];let o=0,l=a-1,c;for(;o<=l;)if(n=Math.floor(o+(l-o)/2),c=r[n]-s,c<0)o=n+1;else if(c>0)l=n-1;else{l=n;break}if(n=l,r[n]===s)return n/(a-1);let h=r[n],u=r[n+1]-h,d=(s-h)/u;return(n+d)/(a-1)}getTangent(t,i){let r=t-1e-4,n=t+1e-4;r<0&&(r=0),n>1&&(n=1);let a=this.getPoint(r),s=this.getPoint(n),o=i||(a.isVector2?new Me:new O);return o.copy(s).sub(a).normalize(),o}getTangentAt(t,i){let r=this.getUtoTmapping(t);return this.getTangent(r,i)}computeFrenetFrames(t,i){let r=new O,n=[],a=[],s=[],o=new O,l=new ht;for(let A=0;A<=t;A++){let f=A/t;n[A]=this.getTangentAt(f,new O)}a[0]=new O,s[0]=new O;let c=Number.MAX_VALUE,h=Math.abs(n[0].x),u=Math.abs(n[0].y),d=Math.abs(n[0].z);h<=c&&(c=h,r.set(1,0,0)),u<=c&&(c=u,r.set(0,1,0)),d<=c&&r.set(0,0,1),o.crossVectors(n[0],r).normalize(),a[0].crossVectors(n[0],o),s[0].crossVectors(n[0],a[0]);for(let A=1;A<=t;A++){if(a[A]=a[A-1].clone(),s[A]=s[A-1].clone(),o.crossVectors(n[A-1],n[A]),o.length()>Number.EPSILON){o.normalize();let f=Math.acos(Dn(n[A-1].dot(n[A]),-1,1));a[A].applyMatrix4(l.makeRotationAxis(o,f))}s[A].crossVectors(n[A],a[A])}if(i===!0){let A=Math.acos(Dn(a[0].dot(a[t]),-1,1));A/=t,n[0].dot(o.crossVectors(a[0],a[t]))>0&&(A=-A);for(let f=1;f<=t;f++)a[f].applyMatrix4(l.makeRotationAxis(n[f],A*f)),s[f].crossVectors(n[f],a[f])}return{tangents:n,normals:a,binormals:s}}clone(){return new this.constructor().copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){let t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.t
vendor: 5,819 bytes, line 7715
7715ype,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}},cM=class extends wh{constructor(t=0,i=0,r=1,n=1,a=0,s=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=t,this.aY=i,this.xRadius=r,this.yRadius=n,this.aStartAngle=a,this.aEndAngle=s,this.aClockwise=o,this.aRotation=l}getPoint(t,i){let r=i||new Me,n=Math.PI*2,a=this.aEndAngle-this.aStartAngle,s=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=n;for(;a>n;)a-=n;a<Number.EPSILON&&(s?a=0:a=n),this.aClockwise===!0&&!s&&(a===n?a=-n:a=a-n);let o=this.aStartAngle+t*a,l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){let h=Math.cos(this.aRotation),u=Math.sin(this.aRotation),d=l-this.aX,A=c-this.aY;l=d*h-A*u+this.aX,c=d*u+A*h+this.aY}return r.set(l,c)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){let t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}},p_e=class extends cM{constructor(t,i,r,n,a,s){super(t,i,r,r,n,a,s),this.isArcCurve=!0,this.type="ArcCurve"}};function hN(){let t=0,i=0,r=0,n=0;function a(s,o,l,c){t=s,i=l,r=-3*s+3*o-2*l-c,n=2*s-2*o+l+c}return{initCatmullRom:function(s,o,l,c,h){a(o,l,h*(l-s),h*(c-o))},initNonuniformCatmullRom:function(s,o,l,c,h,u,d){let A=(o-s)/h-(l-s)/(h+u)+(l-o)/u,f=(l-o)/u-(c-o)/(u+d)+(c-l)/d;A*=u,f*=u,a(o,l,A,f)},calc:function(s){let o=s*s,l=o*s;return t+i*s+r*o+n*l}}}var eb=new O,eI=new hN,tI=new hN,iI=new hN,m_e=class extends wh{constructor(t=[],i=!1,r="centripetal",n=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=t,this.closed=i,this.curveType=r,this.tension=n}getPoint(t,i=new O){let r=i,n=this.points,a=n.length,s=(a-(this.closed?0:1))*t,o=Math.floor(s),l=s-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/a)+1)*a:l===0&&o===a-1&&(o=a-2,l=1);let c,h;this.closed||o>0?c=n[(o-1)%a]:(eb.subVectors(n[0],n[1]).add(n[0]),c=eb);let u=n[o%a],d=n[(o+1)%a];if(this.closed||o+2<a?h=n[(o+2)%a]:(eb.subVectors(n[a-1],n[a-2]).add(n[a-1]),h=eb),this.curveType==="centripetal"||this.curveType==="chordal"){let A=this.curveType==="chordal"?.5:.25,f=Math.pow(c.distanceToSquared(u),A),m=Math.pow(u.distanceToSquared(d),A),g=Math.pow(d.distanceToSquared(h),A);m<1e-4&&(m=1),f<1e-4&&(f=m),g<1e-4&&(g=m),eI.initNonuniformCatmullRom(c.x,u.x,d.x,h.x,f,m,g),tI.initNonuniformCatmullRom(c.y,u.y,d.y,h.y,f,m,g),iI.initNonuniformCatmullRom(c.z,u.z,d.z,h.z,f,m,g)}else this.curveType==="catmullrom"&&(eI.initCatmullRom(c.x,u.x,d.x,h.x,this.tension),tI.initCatmullRom(c.y,u.y,d.y,h.y,this.tension),iI.initCatmullRom(c.z,u.z,d.z,h.z,this.tension));return r.set(eI.calc(l),tI.calc(l),iI.calc(l)),r}copy(t){super.copy(t),this.points=[];for(let i=0,r=t.points.length;i<r;i++){let n=t.points[i];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){let t=super.toJSON();t.points=[];for(let i=0,r=this.points.length;i<r;i++){let n=this.points[i];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let i=0,r=t.points.length;i<r;i++){let n=t.points[i];this.points.push(new O().fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}};function IG(t,i,r,n,a){let s=(n-i)*.5,o=(a-r)*.5,l=t*t,c=t*l;return(2*r-2*n+s+o)*c+(-3*r+3*n-2*s-o)*l+s*t+r}function g_e(t,i){let r=1-t;return r*r*i}function v_e(t,i){return 2*(1-t)*t*i}function __e(t,i){return t*t*i}function Y_(t,i,r,n){return g_e(t,i)+v_e(t,r)+__e(t,n)}function y_e(t,i){let r=1-t;return r*r*r*i}function E_e(t,i){let r=1-t;return 3*r*r*t*i}function w_e(t,i){return 3*(1-t)*t*t*i}function b_e(t,i){return t*t*t*i}function K_(t,i,r,n,a){return y_e(t,i)+E_e(t,r)+w_e(t,n)+b_e(t,a)}var nc=class extends wh{constructor(t=new Me,i=new Me,r=new Me,n=new Me){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=t,this.v1=i,this.v2=r,this.v3=n}getPoint(t,i=new Me){let r=i,n=this.v0,a=this.v1,s=this.v2,o=this.v3;return r.set(K_(t,n.x,a.x,s.x,o.x),K_(t,n.y,a.y,s.y,o.y)),r}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},TS=class extends wh{constructor(t=new O,i=new O,r=new O,n=new O){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=t,this.v1=i,this.v2=r,this.v3=n}getPoint(t,i=new O){let r=i,n=this.v0,a=this.v1,s=this.v2,o=this.v3;return r.set(K_(t,n.x,a.x,s.x,o.x),K_(t,n.y,a.y,s.y,o.y),K_(t,n.z,a.z,s.z,o.z)),r}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}},dc=class extends wh{constructor(t=new Me,i=new Me){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=t,this.v2=i}
vendor: 9,520 bytes, line 7715
7715getPoint(t,i=new Me){let r=i;return t===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(t).add(this.v1)),r}getPointAt(t,i){return this.getPoint(t,i)}getTangent(t,i){let r=i||new Me;return r.copy(this.v2).sub(this.v1).normalize(),r}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},H7=class extends wh{constructor(t=new O,i=new O){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=t,this.v2=i}getPoint(t,i=new O){let r=i;return t===1?r.copy(this.v2):(r.copy(this.v2).sub(this.v1),r.multiplyScalar(t).add(this.v1)),r}getPointAt(t,i){return this.getPoint(t,i)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},DA=class extends wh{constructor(t=new Me,i=new Me,r=new Me){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=t,this.v1=i,this.v2=r}getPoint(t,i=new Me){let r=i,n=this.v0,a=this.v1,s=this.v2;return r.set(Y_(t,n.x,a.x,s.x),Y_(t,n.y,a.y,s.y)),r}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},S_e=class extends wh{constructor(t=new O,i=new O,r=new O){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=t,this.v1=i,this.v2=r}getPoint(t,i=new O){let r=i,n=this.v0,a=this.v1,s=this.v2;return r.set(Y_(t,n.x,a.x,s.x),Y_(t,n.y,a.y,s.y),Y_(t,n.z,a.z,s.z)),r}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){let t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}},uN=class extends wh{constructor(t=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=t}getPoint(t,i=new Me){let r=i,n=this.points,a=(n.length-1)*t,s=Math.floor(a),o=a-s,l=n[s===0?s:s-1],c=n[s],h=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return r.set(IG(o,l.x,c.x,h.x,u.x),IG(o,l.y,c.y,h.y,u.y)),r}copy(t){super.copy(t),this.points=[];for(let i=0,r=t.points.length;i<r;i++){let n=t.points[i];this.points.push(n.clone())}return this}toJSON(){let t=super.toJSON();t.points=[];for(let i=0,r=this.points.length;i<r;i++){let n=this.points[i];t.points.push(n.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let i=0,r=t.points.length;i<r;i++){let n=t.points[i];this.points.push(new Me().fromArray(n))}return this}},C_e=Object.freeze({__proto__:null,ArcCurve:p_e,CatmullRomCurve3:m_e,CubicBezierCurve:nc,CubicBezierCurve3:TS,EllipseCurve:cM,LineCurve:dc,LineCurve3:H7,QuadraticBezierCurve:DA,QuadraticBezierCurve3:S_e,SplineCurve:uN}),G7=class extends wh{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){let t=this.curves[0].getPoint(0),i=this.curves[this.curves.length-1].getPoint(1);t.equals(i)||this.curves.push(new dc(i,t))}getPoint(t,i){let r=t*this.getLength(),n=this.getCurveLengths(),a=0;for(;a<n.length;){if(n[a]>=r){let s=n[a]-r,o=this.curves[a],l=o.getLength(),c=l===0?0:1-s/l;return o.getPointAt(c,i)}a++}return null}getLength(){let t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;let t=[],i=0;for(let r=0,n=this.curves.length;r<n;r++)i+=this.curves[r].getLength(),t.push(i);return this.cacheLengths=t,t}getSpacedPoints(t=40){let i=[];for(let r=0;r<=t;r++)i.push(this.getPoint(r/t));return this.autoClose&&i.push(i[0]),i}getPoints(t=12){let i=[],r;for(let n=0,a=this.curves;n<a.length;n++){let s=a[n],o=s.isEllipseCurve?t*2:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,l=s.getPoints(o);for(let c=0;c<l.length;c++){let h=l[c];r&&r.equals(h)||(i.push(h),r=h)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}copy(t){super.copy(t),this.curves=[];for(let i=0,r=t.curves.length;i<r;i++){let n=t.curves[i];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this}toJSON(){let t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let i=0,r=this.curves.length;i<r;i++){let n=this.curves[i];t.curves.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let i=0,r=t.curves.length;i<r;i++){let n=t.curves[i];this.curves.push(new C_e[n.type]().fromJSON(n))}return this}},xC=class extends G7{constructor(t){super(),this.type="Path",this.currentPoint=new Me,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let i=1,r=t.length;i<r;i++)this.lineTo(t[i].x,t[i].y);return this}moveTo(t,i){return this.currentPoint.set(t,i),this}lineTo(t,i){let r=new dc(this.currentPoint.clone(),new Me(t,i));return this.curves.push(r),this.currentPoint.set(t,i),this}quadraticCurveTo(t,i,r,n){let a=new DA(this.currentPoint.clone(),new Me(t,i),new Me(r,n));return this.curves.push(a),this.currentPoint.set(r,n),this}bezierCurveTo(t,i,r,n,a,s){let o=new nc(this.currentPoint.clone(),new Me(t,i),new Me(r,n),new Me(a,s));return this.curves.push(o),this.currentPoint.set(a,s),this}splineThru(t){let i=[this.currentPoint.clone()].concat(t),r=new uN(i);return this.curves.push(r),this.currentPoint.copy(t[t.length-1]),this}arc(t,i,r,n,a,s){let o=this.currentPoint.x,l=this.currentPoint.y;return this.absarc(t+o,i+l,r,n,a,s),this}absarc(t,i,r,n,a,s){return this.absellipse(t,i,r,r,n,a,s),this}ellipse(t,i,r,n,a,s,o,l){let c=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(t+c,i+h,r,n,a,s,o,l),this}absellipse(t,i,r,n,a,s,o,l){let c=new cM(t,i,r,n,a,s,o,l);if(this.curves.length>0){let u=c.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(c);let h=c.getPoint(1);return this.currentPoint.copy(h),this}copy(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){let t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}},z7=class extends Lt{constructor(t=[new Me(0,-.5),new Me(.5,0),new Me(0,.5)],i=12,r=0,n=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:t,segments:i,phiStart:r,phiLength:n},i=Math.floor(i),n=Dn(n,0,Math.PI*2);let a=[],s=[],o=[],l=[],c=[],h=1/i,u=new O,d=new Me,A=new O,f=new O,m=new O,g=0,p=0;for(let v=0;v<=t.length-1;v++)switch(v){case 0:g=t[v+1].x-t[v].x,p=t[v+1].y-t[v].y,A.x=p*1,A.y=-g,A.z=p*0,m.copy(A),A.normalize(),l.push(A.x,A.y,A.z);break;case t.length-1:l.push(m.x,m.y,m.z);break;default:g=t[v+1].x-t[v].x,p=t[v+1].y-t[v].y,A.x=p*1,A.y=-g,A.z=p*0,f.copy(A),A.x+=m.x,A.y+=m.y,A.z+=m.z,A.normalize(),l.push(A.x,A.y,A.z),m.copy(f)}for(let v=0;v<=i;v++){let _=r+v*h*n,y=Math.sin(_),w=Math.cos(_);for(let b=0;b<=t.length-1;b++){u.x=t[b].x*y,u.y=t[b].y,u.z=t[b].x*w,s.push(u.x,u.y,u.z),d.x=v/i,d.y=b/(t.length-1),o.push(d.x,d.y);let E=l[3*b+0]*y,M=l[3*b+1],S=l[3*b+0]*w;c.push(E,M,S)}}for(let v=0;v<i;v++)for(let _=0;_<t.length-1;_++){let y=_+v*t.length,w=y,b=y+t.length,E=y+t.length+1,M=y+1;a.push(w,b,M),a.push(E,M,b)}this.setIndex(a),this.setAttribute("position",new Et(s,3)),this.setAttribute("uv",new Et(o,2)),this.setAttribute("normal",new Et(c,3))}static fromJSON(t){return new z7(t.points,t.segments,t.phiStart,t.phiLength)}},dN=class extends Lt{constructor(t=1,i=1,r=1,n=32,a=1,s=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:i,height:r,radialSegments:n,heightSegments:a,openEnded:s,thetaStart:o,thetaLength:l};let c=this;n=Math.floor(n),a=Math.floor(a);let h=[],u=[],d=[],A=[],f=0,m=[],g=r/2,p=0;v(),s===!1&&(t>0&&_(!0),i>0&&_(!1)),this.setIndex(h),this.setAttribute("position",new Et(u,3)),this.setAttribute("normal",new Et(d,3)),this.setAttribute("uv",new Et(A,2));function v(){let y=new O,w=new O,b=0,E=(i-t)/r;for(let M=0;M<=a;M++){let S=[],T=M/a,C=T*(i-t)+t;for(let x=0;x<=n;x++){let R=x/n,L=R*l+o,I=Math.sin(L),F=Math.cos(L);w.x=C*I,w.y=-T*r+g,w.z=C*F,u.push(w.x,w.y,w.z),y.set(I,E,F).normalize(),d.push(y.x,y.y,y.z),A.push(R,1-T),S.push(f++)}m.push(S)}for(let M=0;M<n;M++)for(let S=0;S<a;S++){let T=m[S][M],C=m[S+1][M],x=m[S+1][M+1],R=m[S][M+1];h.push(T,C,R),h.push(C,x,R),b+=6}c.addGroup(p,b,0),p+=b}function _(y){let w=f,b=new Me,E=new O,M=0,S=y===!0?t:i,T=y===!0?1:-1;for(let x=1;x<=n;x++)u.push(0,g*T,0),d.push(0,T,0),A.push(.5,.5),f++;let C=f;for(let x=0;x<=n;x++){let R=x/n*l+o,L=Math.cos(R),I=Math.sin(R);E.x=S*I,E.y=g*T,E.z=S*L,u.push(E.x,E.y,E.z),d.push(0,T,0),b.x=L*.5+.5,b.y=I*.5*T+.5,A.push(b.x,b.y),f++}for(let x=0;x<n;x++){let R=w+x,L=C+x;y===!0?h.push(L,L+1,R):h.push(L+1,L,R),M+=3}c.addGroup(p,M,y===!0?1:2),p+=M}}static fromJSON(t){return new dN(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},AN=class extends dN{constructor(t=1,i=1,r=32,n=1,a=!1,s=0,o=Math.PI*2){super(0,t,i,r,n,a,s,o),this.type="C
7715oneGeometry",this.parameters={radius:t,height:i,radialSegments:r,heightSegments:n,openEnded:a,thetaStart:s,thetaLength:o}}static fromJSON(t){return new AN(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}},fN=class extends Lt{constructor(t=[],i=[],r=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:i,radius:r,detail:n};let a=[],s=[];o(n),c(r),h(),this.setAttribute("position",new Et(a,3)),this.setAttribute("normal",new Et(a.slice(),3)),this.setAttribute("uv",new Et(s,2)),n===0?this.computeVertexNormals():this.normalizeNormals();function o(v){let _=new O,y=new O,w=new O;for(let b=0;b<i.length;b+=3)A(i[b+0],_),A(i[b+1],y),A(i[b+2],w),l(_,y,w,v)}function l(v,_,y,w){let b=w+1,E=[];for(let M=0;M<=b;M++){E[M]=[];let S=v.clone().lerp(y,M/b),T=_.clone().lerp(y,M/b),C=b-M;for(let x=0;x<=C;x++)x===0&&M===b?E[M][x]=S:E[M][x]=S.clone().lerp(T,x/C)}for(let M=0;M<b;M++)for(let S=0;S<2*(b-M)-1;S++){let T=Math.floor(S/2);S%2===0?(d(E[M][T+1]),d(E[M+1][T]),d(E[M][T])):(d(E[M][T+1]),d(E[M+1][T+1]),d(E[M+1][T]))}}function c(v){let _=new O;for(let y=0;y<a.length;y+=3)_.x=a[y+0],_.y=a[y+1],_.z=a[y+2],_.normalize().multiplyScalar(v),a[y+0]=_.x,a[y+1]=_.y,a[y+2]=_.z}function h(){let v=new O;for(let _=0;_<a.length;_+=3){v.x=a[_+0],v.y=a[_+1],v.z=a[_+2];let y=g(v)/2/Math.PI+.5,w=p(v)/Math.PI+.5;s.push(y,1-w)}f(),u()}function u(){for(let v=0;v<s.length;v+=6){let _=s[v+0],y=s[v+2],w=s[v+4],b=Math.max(_,y,w),E=Math.min(_,y,w);b>.9&&E<.1&&(_<.2&&(s[v+0]+=1),y<.2&&(s[v+2]+=1),w<.2&&(s[v+4]+=1))}}function d(v){a.push(v.x,v.y,v.z)}function A(v,_){let y=v*3;_.x=t[y+0],_.y=t[y+1],_.z=t[y+2]}function f(){let v=new O,_=new O,y=new O,w=new O,b=new Me,E=new Me,M=new Me;for(let S=0,T=0;S<a.length;S+=9,T+=6){v.set(a[S+0],a[S+1],a[S+2]),_.set(a[S+3],a[S+4],a[S+5]),y.set(a[S+6],a[S+7],a[S+8]),b.set(s[T+0],s[T+1]),E.set(s[T+2],s[T+3]),M.set(s[T+4],s[T+5]),w.copy(v).add(_).add(y).divideScalar(3);let C=g(w);m(b,T+0,v,C),m(E,T+2,_,C),m(M,T+4,y,C)}}function m(v,_,y,w){w<0&&v.x===1&&(s[_]=v.x-1),y.x===0&&y.z===0&&(s[_]=w/2/Math.PI+.5)}function g(v){return Math.atan2(v.z,-v.x)}function p(v){return Math.atan2(-v.y,Math.sqrt(v.x*v.x+v.z*v.z))}}static fromJSON(t){return new fN(t.vertices,t.indices,t.radius,t.details)}},Q7=class extends fN{constructor(t=1,i=0){let r=(1+Math.sqrt(5))/2,n=1/r,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n],s=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
771519,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(a,s,t,i),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:i}}static fromJSON(t){return new Q7(t.radius,t.detail)}},RC=class extends xC{constructor(t){super(t),this.uuid=gl(),this.type="Shape",this.holes=[]}getPointsHoles(t){let i=[];for(let r=0,n=this.holes.length;r<n;r++)i[r]=this.holes[r].getPoints(t);return i}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let i=0,r=t.holes.length;i<r;i++){let n=t.holes[i];this.holes.push(n.clone())}return this}toJSON(){let t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let i=0,r=this.holes.length;i<r;i++){let n=this.holes[i];t.holes.push(n.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let i=0,r=t.holes.length;i<r;i++){let n=t.holes[i];this.holes.push(new xC().fromJSON(n))}return this}},T_e={triangulate:function(t,i,r=2){let n=i&&i.length,a=n?i[0]*r:t.length,s=V7(t,0,a,r,!0),o=[];if(!s||s.next===s.prev)return o;let l,c,h,u,d,A,f;if(n&&(s=I_e(t,i,s,r)),t.length>80*r){l=h=t[0],c=u=t[1];for(let m=r;m<a;m+=r)d=t[m],A=t[m+1],d<l&&(l=d),A<c&&(c=A),d>h&&(h=d),A>u&&(u=A);f=Math.max(h-l,u-c),f=f!==0?32767/f:0}return Ry(s,o,r,l,c,f,0),o}};function V7(t,i,r,n,a){let s,o;if(a===z_e(t,i,r,n)>0)for(s=i;s<r;s+=n)o=DG(s,t[s],t[s+1],o);else for(s=r-n;s>=i;s-=n)o=DG(s,t[s],t[s+1],o);return o&&hM(o,o.next)&&(Iy(o),o=o.next),o}function dp(t,i){if(!t)return t;i||(i=t);let r=t,n;do if(n=!1,!r.steiner&&(hM(r,r.next)||qr(r.prev,r,r.next)===0)){if(Iy(r),r=i=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==i);return i}function Ry(t,i,r,n,a,s,o){if(!t)return;!o&&s&&N_e(t,n,a,s);let l=t,c,h;for(;t.prev!==t.next;){if(c=t.prev,h=t.next,s?x_e(t,n,a,s):M_e(t)){i.push(c.i/r|0),i.push(t.i/r|0),i.push(h.i/r|0),Iy(t),t=h.next,l=h.next;continue}if(t=h,t===l){o?o===1?(t=R_e(dp(t),i,r),Ry(t,i,r,n,a,s,2)):o===2&&B_e(t,i,r,n,a,s):Ry(dp(t),i,r,n,a,s,1);break}}}function M_e(t){let i=t.prev,r=t,n=t.next;if(qr(i,r,n)>=0)return!1;let a=i.x,s=r.x,o=n.x,l=i.y,c=r.y,h=n.y,u=a<s?a<o?a:o:s<o?s:o,d=l<c?l<h?l:h:c<h?c:h,A=a>s?a>o?a:o:s>o?s:o,f=l>c?l>h?l:h:c>h?c:h,m=n.next;for(;m!==i;){if(m.x>=u&&m.x<=A&&m.y>=d&&m.y<=f&&Ag(a,l,s,c,o,h,m.x,m.y)&&qr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function x_e(t,i,r,n){let a=t.prev,s=t,o=t.next;if(qr(a,s,o)>=0)return!1;let l=a.x,c=s.x,h=o.x,u=a.y,d=s.y,A=o.y,f=l<c?l<h?l:h:c<h?c:h,m=u<d?u<A?u:A:d<A?d:A,g=l>c?l>h?l:h:c>h?c:h,p=u>d?u>A?u:A:d>A?d:A,v=uP(f,m,i,r,n),_=uP(g,p,i,r,n),y=t.prevZ,w=t.nextZ;for(;y&&y.z>=v&&w&&w.z<=_;){if(y.x>=f&&y.x<=g&&y.y>=m&&y.y<=p&&y!==a&&y!==o&&Ag(l,u,c,d,h,A,y.x,y.y)&&qr(y.prev,y,y.next)>=0||(y=y.prevZ,w.x>=f&&w.x<=g&&w.y>=m&&w.y<=p&&w!==a&&w!==o&&Ag(l,u,c,d,h,A,w.x,w.y)&&qr(w.prev,w,w.next)>=0))return!1;w=w.nextZ}for(;y&&y.z>=v;){if(y.x>=f&&y.x<=g&&y.y>=m&&y.y<=p&&y!==a&&y!==o&&Ag(l,u,c,d,h,A,y.x,y.y)&&qr(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;w&&w.z<=_;){if(w.x>=f&&w.x<=g&&w.y>=m&&w.y<=p&&w!==a&&w!==o&&Ag(l,u,c,d,h,A,w.x,w.y)&&qr(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function R_e(t,i,r){let n=t;do{let a=n.prev,s=n.next.next;!hM(a,s)&&W7(a,n,n.next,s)&&By(a,s)&&By(s,a)&&(i.push(a.i/r|0),i.push(n.i/r|0),i.push(s.i/r|0),Iy(n),Iy(n.next),n=t=s),n=n.next}while(n!==t);return dp(n)}function B_e(t,i,r,n,a,s){let o=t;do{let l=o.next.next;for(;l!==o.prev;){if(o.i!==l.i&&k_e(o,l)){let c=j7(o,l);o=dp(o,o.next),c=dp(c,c.next),Ry(o,i,r,n,a,s,0),Ry(c,i,r,n,a,s,0);return}l=l.next}o=o.next}while(o!==t)}function I_e(t,i,r,n){let a=[],s,o,l,c,h;for(s=0,o=i.length;s<o;s++)l=i[s]*n,c=s<o-1?i[s+1]*n:t.length,h=V7(t,l,c,n,!1),h===h.next&&(h.steiner=!0),a.push(F_e(h));for(a.sort(D_e),s=0;s<a.length;s++)r=P_e(a[s],r);return r}function D_e(t,i){return t.x-i.x}function P_e(t,i){let r=L_e(t,i);if(!r)return i;let n=j7(r,t);return dp(n,n.next),dp(r,r.next)}function L_e(t,i){let r=i,n=-1/0,a,s=t.x,o=t.y;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){let A=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y
vendor: 2,255 bytes, line 7715
7715);if(A<=s&&A>n&&(n=A,a=r.x<r.next.x?r:r.next,A===s))return a}r=r.next}while(r!==i);if(!a)return null;let l=a,c=a.x,h=a.y,u=1/0,d;r=a;do s>=r.x&&r.x>=c&&s!==r.x&&Ag(o<h?s:n,o,c,h,o<h?n:s,o,r.x,r.y)&&(d=Math.abs(o-r.y)/(s-r.x),By(r,t)&&(d<u||d===u&&(r.x>a.x||r.x===a.x&&O_e(a,r)))&&(a=r,u=d)),r=r.next;while(r!==l);return a}function O_e(t,i){return qr(t.prev,t,i.prev)<0&&qr(i.next,t,t.next)<0}function N_e(t,i,r,n){let a=t;do a.z===0&&(a.z=uP(a.x,a.y,i,r,n)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,U_e(a)}function U_e(t){let i,r,n,a,s,o,l,c,h=1;do{for(r=t,t=null,s=null,o=0;r;){for(o++,n=r,l=0,i=0;i<h&&(l++,n=n.nextZ,!!n);i++);for(c=h;l>0||c>0&&n;)l!==0&&(c===0||!n||r.z<=n.z)?(a=r,r=r.nextZ,l--):(a=n,n=n.nextZ,c--),s?s.nextZ=a:t=a,a.prevZ=s,s=a;r=n}s.nextZ=null,h*=2}while(o>1);return t}function uP(t,i,r,n,a){return t=(t-r)*a|0,i=(i-n)*a|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,t|i<<1}function F_e(t){let i=t,r=t;do(i.x<r.x||i.x===r.x&&i.y<r.y)&&(r=i),i=i.next;while(i!==t);return r}function Ag(t,i,r,n,a,s,o,l){return(a-o)*(i-l)>=(t-o)*(s-l)&&(t-o)*(n-l)>=(r-o)*(i-l)&&(r-o)*(s-l)>=(a-o)*(n-l)}function k_e(t,i){return t.next.i!==i.i&&t.prev.i!==i.i&&!H_e(t,i)&&(By(t,i)&&By(i,t)&&G_e(t,i)&&(qr(t.prev,t,i.prev)||qr(t,i.prev,i))||hM(t,i)&&qr(t.prev,t,t.next)>0&&qr(i.prev,i,i.next)>0)}function qr(t,i,r){return(i.y-t.y)*(r.x-i.x)-(i.x-t.x)*(r.y-i.y)}function hM(t,i){return t.x===i.x&&t.y===i.y}function W7(t,i,r,n){let a=ib(qr(t,i,r)),s=ib(qr(t,i,n)),o=ib(qr(r,n,t)),l=ib(qr(r,n,i));return!!(a!==s&&o!==l||a===0&&tb(t,r,i)||s===0&&tb(t,n,i)||o===0&&tb(r,t,n)||l===0&&tb(r,i,n))}function tb(t,i,r){return i.x<=Math.max(t.x,r.x)&&i.x>=Math.min(t.x,r.x)&&i.y<=Math.max(t.y,r.y)&&i.y>=Math.min(t.y,r.y)}function ib(t){return t>0?1:t<0?-1:0}function H_e(t,i){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==i.i&&r.next.i!==i.i&&W7(r,r.next,t,i))return!0;r=r.next}while(r!==t);return!1}function By(t,i){return qr(t.prev,t,t.next)<0?qr(t,i,t.next)>=0&&qr(t,t.prev,i)>=0:qr(t,i,t.prev)<0||qr(t,t.next,i)<0}function G_e(t,i){let r=t,n=!1,a=(t.x+i.x)/2,s=(t.y+i.y)/2;do r.y>s!=r.next.y>
vendor: 8,913 bytes, line 7715
7715s&&r.next.y!==r.y&&a<(r.next.x-r.x)*(s-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}function j7(t,i){let r=new dP(t.i,t.x,t.y),n=new dP(i.i,i.x,i.y),a=t.next,s=i.prev;return t.next=i,i.prev=t,r.next=a,a.prev=r,n.next=r,r.prev=n,s.next=n,n.prev=s,n}function DG(t,i,r,n){let a=new dP(t,i,r);return n?(a.next=n.next,a.prev=n,n.next.prev=a,n.next=a):(a.prev=a,a.next=a),a}function Iy(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function dP(t,i,r){this.i=t,this.x=i,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function z_e(t,i,r,n){let a=0;for(let s=i,o=r-n;s<r;s+=n)a+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return a}var Y7=class{static area(t){let i=t.length,r=0;for(let n=i-1,a=0;a<i;n=a++)r+=t[n].x*t[a].y-t[a].x*t[n].y;return r*.5}static isClockWise(t){return Y7.area(t)<0}static triangulateShape(t,i){let r=[],n=[],a=[];PG(t),LG(r,t);let s=t.length;i.forEach(PG);for(let l=0;l<i.length;l++)n.push(s),s+=i[l].length,LG(r,i[l]);let o=T_e.triangulate(r,n);for(let l=0;l<o.length;l+=3)a.push(o.slice(l,l+3));return a}};function PG(t){let i=t.length;i>2&&t[i-1].equals(t[0])&&t.pop()}function LG(t,i){for(let r=0;r<i.length;r++)t.push(i[r].x),t.push(i[r].y)}var K7=class extends fN{constructor(t=1,i=0){let r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(n,a,t,i),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:i}}static fromJSON(t){return new K7(t.radius,t.detail)}},Bg=class extends Lt{constructor(t=1,i=32,r=16,n=0,a=Math.PI*2,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:i,heightSegments:r,phiStart:n,phiLength:a,thetaStart:s,thetaLength:o},i=Math.max(3,Math.floor(i)),r=Math.max(2,Math.floor(r));let l=Math.min(s+o,Math.PI),c=0,h=[],u=new O,d=new O,A=[],f=[],m=[],g=[];for(let p=0;p<=r;p++){let v=[],_=p/r,y=0;p==0&&s==0?y=.5/i:p==r&&l==Math.PI&&(y=-.5/i);for(let w=0;w<=i;w++){let b=w/i;u.x=-t*Math.cos(n+b*a)*Math.sin(s+_*o),u.y=t*Math.cos(s+_*o),u.z=t*Math.sin(n+b*a)*Math.sin(s+_*o),f.push(u.x,u.y,u.z),d.copy(u).normalize(),m.push(d.x,d.y,d.z),g.push(b+y,1-_),v.push(c++)}h.push(v)}for(let p=0;p<r;p++)for(let v=0;v<i;v++){let _=h[p][v+1],y=h[p][v],w=h[p+1][v],b=h[p+1][v+1];(p!==0||s>0)&&A.push(_,y,b),(p!==r-1||l<Math.PI)&&A.push(y,w,b)}this.setIndex(A),this.setAttribute("position",new Et(f,3)),this.setAttribute("normal",new Et(m,3)),this.setAttribute("uv",new Et(g,2))}static fromJSON(t){return new Bg(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}},X7=class extends Lt{constructor(t=1,i=.4,r=12,n=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:i,radialSegments:r,tubularSegments:n,arc:a},r=Math.floor(r),n=Math.floor(n);let s=[],o=[],l=[],c=[],h=new O,u=new O,d=new O;for(let A=0;A<=r;A++)for(let f=0;f<=n;f++){let m=f/n*a,g=A/r*Math.PI*2;u.x=(t+i*Math.cos(g))*Math.cos(m),u.y=(t+i*Math.cos(g))*Math.sin(m),u.z=i*Math.sin(g),o.push(u.x,u.y,u.z),h.x=t*Math.cos(m),h.y=t*Math.sin(m),d.subVectors(u,h).normalize(),l.push(d.x,d.y,d.z),c.push(f/n),c.push(A/r)}for(let A=1;A<=r;A++)for(let f=1;f<=n;f++){let m=(n+1)*A+f-1,g=(n+1)*(A-1)+f-1,p=(n+1)*(A-1)+f,v=(n+1)*A+f;s.push(m,g,v),s.push(g,p,v)}this.setIndex(s),this.setAttribute("position",new Et(o,3)),this.setAttribute("normal",new Et(l,3)),this.setAttribute("uv",new Et(c,2))}static fromJSON(t){return new X7(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}},q7=class extends Lt{constructor(t=1,i=.4,r=64,n=8,a=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:i,tubularSegments:r,radialSegments:n,p:a,q:s},r=Math.floor(r),n=Math.floor(n);let o=[],l=[],c=[],h=[],u=new O,d=new O,A=new O,f=new O,m=new O,g=new O,p=new O;for(let _=0;_<=r;++_){let y=_/r*a*Math.PI*2;v(y,a,s,t,A),v(y+.01,a,s,t,f),g.subVectors(f,A),p.addVectors(f,A),m.crossVectors(g,p),p.crossVectors(m,g),m.normalize(),p.normalize();for(let w=0;w<=n;++w){let b=w/n*Math.PI*2,E=-i*Math.cos(b),M=i*Math.sin(b);u.x=A.x+(E*p.x+M*m.x),u.y=A.y+(E*p.y+M*m.y),u.z=A.z+(E*p.z+M*m.z),l.push(u.x,u.y,u.z),d.subVectors(u,A).normalize(),c.push(d.x,d.y,d.z),h.push(_/r),h.push(w/n)}}for(let _=1;_<=r;_++)for(let y=1;y<=n;y++){let w=(n+1)*(_-1)+(y-1),b=(n+1)*_+(y-1),E=(n+1)*_+y,M=(n+1)*(_-1)+y;o.push(w,b,M),o.push(b,E,M)}this.setIndex(o),this.setAttribute("position",new Et(l,3)),this.setAttribute("normal",new Et(c,3)),this.setAttribute("uv",new Et(h,2));function v(_,y,w,b,E){let M=Math.cos(_),S=Math.sin(_),T=w/y*_,C=Math.cos(T);E.x=b*(2+C)*.5*M,E.y=b*(2+C)*S*.5,E.z=b*Math.sin(T)*.5}}static fromJSON(t){return new q7(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}};function pd(t,i,r){return Z7(t)?new t.constructor(t.subarray(i,r!==void 0?r:t.length)):t.slice(i,r)}function rb(t,i,r){return!t||!r&&t.constructor===i?t:typeof i.BYTES_PER_ELEMENT=="number"?new i(t):Array.prototype.slice.call(t)}function Z7(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Q_e(t){function i(a,s){return t[a]-t[s]}let r=t.length,n=new Array(r);for(let a=0;a!==r;++a)n[a]=a;return n.sort(i),n}function OG(t,i,r){let n=t.length,a=new t.constructor(n);for(let s=0,o=0;o!==n;++s){let l=r[s]*i;for(let c=0;c!==i;++c)a[o++]=t[l+c]}return a}function J7(t,i,r,n){let a=1,s=t[0];for(;s!==void 0&&s[n]===void 0;)s=t[a++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(i.push(s.time),r.push.apply(r,o)),s=t[a++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(i.push(s.time),o.toArray(r,r.length)),s=t[a++];while(s!==void 0);else do o=s[n],o!==void 0&&(i.push(s.time),r.push(o)),s=t[a++];while(s!==void 0)}var uM=class{constructor(t,i,r,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=n!==void 0?n:new i.constructor(r),this.sampleValues=i,this.valueSize=r,this.settings=null,this.DefaultSettings_={}}evaluate(t){let i=this.parameterPositions,r=this._cachedIndex,n=i[r],a=i[r-1];e:{t:{let s;i:{r:if(!(t<n)){for(let o=r+2;;){if(n===void 0){if(t<a)break r;return r=i.length,this._cachedIndex=r,this.copySampleValue_(r-1)}if(r===o)break;if(a=n,n=i[++r],t<n)break t}s=i.length;break i}if(!(t>=a)){let o=i[1];t<o&&(r=2,a=o);for(let l=r-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(r===l)break;if(n=a,a=i[--r-1],t>=a)break t}s=r,r=0;break i}break e}for(;r<s;){let o=r+s>>>1;t<i[o]?s=o:r=o+1}if(n=i[r],a=i[r-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===void 0)return r=i.length,this._cachedIndex=r,this.copySampleValue_(r-1)}this._cachedIndex=r,this.intervalChanged_(r,a,n)}return this.interpolate_(r,a,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){let i=this.resultBuffer,r=this.sampleValues,n=this.valueSize,a=t*n;for(let s=0;s!==n;++s)i[s]=r[a+s];return i}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}},V_e=class extends uM{constructor(t,i,r,n){super(t,i,r,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:hg,endingEnd:hg}}intervalChanged_(t,i,r){let n=this.parameterPositions,a=t-2,s=t+1,o=n[a],l=n[s];if(o===void 0)switch(this.getSettings_().endingStart){case ug:a=t,o=2*i-r;break;case SC:a=n.length-2,o=i+n[a]-n[a+1];break;default:a=t,o=r}if(l===void 0)switch(this.getSettings_().endingEnd){case ug:s=t,l=2*r-i;break;case SC:s=1,l=r+n[1]-n[0];break;default:s=t-1,l=i}let c=(r-i)*.5,h=this.valueSize;this._weightPrev=c/(i-o),this._weightNext=c/(l-r),this._offsetPrev=a*h,this._offsetNext=s*h}interpolate_(t,i,r,n){let a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,h=this._offsetPrev,u=this._offsetNext,d=this._weightPrev,A=this._weightNext,f=(r-i)/(n-i),m=f*f,g=m*f,p=-d*g+2*d*m-d*f,v=(1+d)*g+(-1.5-2*d)*m+(-.5+d)*f+1,_=(-1-A)*g+(1.5+A)*m+.5*f,y=A*g-A*m;for(let w=0;w!==o;++w)a[w]=p*s[h+w]+v*s[c+w]+_*s[l+w]+y*s[u+w];return a}},$7=class extends uM{constructor(t,i,r,n){super(t,i,r,n)}interpolate_(t,i,r,n){let a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=t*o,c=l-o,h=(r-i)/(n-i),u=1-h;for(let d=0;d!==o;++d)a[d]=s[c+d]*u+s[l+d]*h;return a}},W_e=class extends uM{constructor(t,i,r,n){super(t,i,r,n)}interpolate_(t){return this.copySampleValue_(t-1)}},bh=class{constructor(t,i,r,n){if(t===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(i===void 0||i.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=rb(i,this.TimeBufferType),this.values=rb(r,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){let i=t.constructor,r;if(i.toJSON!==this.toJSON)r=i.toJSON(t);
vendor: 16,644 bytes, line 7715
7715else{r={name:t.name,times:rb(t.times,Array),values:rb(t.values,Array)};let n=t.getInterpolation();n!==t.DefaultInterpolation&&(r.interpolation=n)}return r.type=t.ValueTypeName,r}InterpolantFactoryMethodDiscrete(t){return new W_e(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new $7(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new V_e(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let i;switch(t){case wC:i=this.InterpolantFactoryMethodDiscrete;break;case bC:i=this.InterpolantFactoryMethodLinear;break;case MB:i=this.InterpolantFactoryMethodSmooth;break}if(i===void 0){let r="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(t!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(r);return console.warn("THREE.KeyframeTrack:",r),this}return this.createInterpolant=i,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return wC;case this.InterpolantFactoryMethodLinear:return bC;case this.InterpolantFactoryMethodSmooth:return MB}}getValueSize(){return this.values.length/this.times.length}shift(t){if(t!==0){let i=this.times;for(let r=0,n=i.length;r!==n;++r)i[r]+=t}return this}scale(t){if(t!==1){let i=this.times;for(let r=0,n=i.length;r!==n;++r)i[r]*=t}return this}trim(t,i){let r=this.times,n=r.length,a=0,s=n-1;for(;a!==n&&r[a]<t;)++a;for(;s!==-1&&r[s]>i;)--s;if(++s,a!==0||s!==n){a>=s&&(s=Math.max(s,1),a=s-1);let o=this.getValueSize();this.times=pd(r,a,s),this.values=pd(this.values,a*o,s*o)}return this}validate(){let t=!0,i=this.getValueSize();i-Math.floor(i)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);let r=this.times,n=this.values,a=r.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let o=0;o!==a;o++){let l=r[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),t=!1;break}if(s!==null&&s>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,s),t=!1;break}s=l}if(n!==void 0&&Z7(n))for(let o=0,l=n.length;o!==l;++o){let c=n[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),t=!1;break}}return t}optimize(){let t=pd(this.times),i=pd(this.values),r=this.getValueSize(),n=this.getInterpolation()===MB,a=t.length-1,s=1;for(let o=1;o<a;++o){let l=!1,c=t[o],h=t[o+1];if(c!==h&&(o!==1||c!==t[0]))if(n)l=!0;else{let u=o*r,d=u-r,A=u+r;for(let f=0;f!==r;++f){let m=i[u+f];if(m!==i[d+f]||m!==i[A+f]){l=!0;break}}}if(l){if(o!==s){t[s]=t[o];let u=o*r,d=s*r;for(let A=0;A!==r;++A)i[d+A]=i[u+A]}++s}}if(a>0){t[s]=t[a];for(let o=a*r,l=s*r,c=0;c!==r;++c)i[l+c]=i[o+c];++s}return s!==t.length?(this.times=pd(t,0,s),this.values=pd(i,0,s*r)):(this.times=t,this.values=i),this}clone(){let t=pd(this.times,0),i=pd(this.values,0),r=this.constructor,n=new r(this.name,t,i);return n.createInterpolant=this.createInterpolant,n}};bh.prototype.TimeBufferType=Float32Array;bh.prototype.ValueBufferType=Float32Array;bh.prototype.DefaultInterpolation=bC;var U0=class extends bh{};U0.prototype.ValueTypeName="bool";U0.prototype.ValueBufferType=Array;U0.prototype.DefaultInterpolation=wC;U0.prototype.InterpolantFactoryMethodLinear=void 0;U0.prototype.InterpolantFactoryMethodSmooth=void 0;var eY=class extends bh{};eY.prototype.ValueTypeName="color";var BC=class extends bh{};BC.prototype.ValueTypeName="number";var j_e=class extends uM{constructor(t,i,r,n){super(t,i,r,n)}interpolate_(t,i,r,n){let a=this.resultBuffer,s=this.sampleValues,o=this.valueSize,l=(r-i)/(n-i),c=t*o;for(let h=c+o;c!==h;c+=4)ri.slerpFlat(a,0,s,c-o,s,c,l);return a}},SE=class extends bh{InterpolantFactoryMethodLinear(t){return new j_e(this.times,this.values,this.getValueSize(),t)}};SE.prototype.ValueTypeName="quaternion";SE.prototype.DefaultInterpolation=bC;SE.prototype.InterpolantFactoryMethodSmooth=void 0;var F0=class extends bh{};F0.prototype.ValueTypeName="string";F0.prototype.ValueBufferType=Array;F0.prototype.DefaultInterpolation=wC;F0.prototype.InterpolantFactoryMethodLinear=void 0;F0.prototype.InterpolantFactoryMethodSmooth=void 0;var IC=class extends bh{};IC.prototype.ValueTypeName="vector";var AP=class{constructor(t,i=-1,r,n=rN){this.name=t,this.tracks=r,this.duration=i,this.blendMode=n,this.uuid=gl(),this.duration<0&&this.resetDuration()}static parse(t){let i=[],r=t.tracks,n=1/(t.fps||1);for(let s=0,o=r.length;s!==o;++s)i.push(K_e(r[s]).scale(n));let a=new this(t.name,t.duration,i,t.blendMode);return a.uuid=t.uuid,a}static toJSON(t){let i=[],r=t.tracks,n={name:t.name,duration:t.duration,tracks:i,uuid:t.uuid,blendMode:t.blendMode};for(let a=0,s=r.length;a!==s;++a)i.push(bh.toJSON(r[a]));return n}static CreateFromMorphTargetSequence(t,i,r,n){let a=i.length,s=[];for(let o=0;o<a;o++){let l=[],c=[];l.push((o+a-1)%a,o,(o+1)%a),c.push(0,1,0);let h=Q_e(l);l=OG(l,1,h),c=OG(c,1,h),!n&&l[0]===0&&(l.push(a),c.push(c[0])),s.push(new BC(".morphTargetInfluences["+i[o].name+"]",l,c).scale(1/r))}return new this(t,-1,s)}static findByName(t,i){let r=t;if(!Array.isArray(t)){let n=t;r=n.geometry&&n.geometry.animations||n.animations}for(let n=0;n<r.length;n++)if(r[n].name===i)return r[n];return null}static CreateClipsFromMorphTargetSequences(t,i,r){let n={},a=/^([\w-]*?)([\d]+)$/;for(let o=0,l=t.length;o<l;o++){let c=t[o],h=c.name.match(a);if(h&&h.length>1){let u=h[1],d=n[u];d||(n[u]=d=[]),d.push(c)}}let s=[];for(let o in n)s.push(this.CreateFromMorphTargetSequence(o,n[o],i,r));return s}static parseAnimation(t,i){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;let r=function(h,u,d,A,f){if(d.length!==0){let m=[],g=[];J7(d,m,g,A),m.length!==0&&f.push(new h(u,m,g))}},n=[],a=t.name||"default",s=t.fps||30,o=t.blendMode,l=t.length||-1,c=t.hierarchy||[];for(let h=0;h<c.length;h++){let u=c[h].keys;if(!(!u||u.length===0))if(u[0].morphTargets){let d={},A;for(A=0;A<u.length;A++)if(u[A].morphTargets)for(let f=0;f<u[A].morphTargets.length;f++)d[u[A].morphTargets[f]]=-1;for(let f in d){let m=[],g=[];for(let p=0;p!==u[A].morphTargets.length;++p){let v=u[A];m.push(v.time),g.push(v.morphTarget===f?1:0)}n.push(new BC(".morphTargetInfluence["+f+"]",m,g))}l=d.length*s}else{let d=".bones["+i[h].name+"]";r(IC,d+".position",u,"pos",n),r(SE,d+".quaternion",u,"rot",n),r(IC,d+".scale",u,"scl",n)}}return n.length===0?null:new this(a,l,n,o)}resetDuration(){let t=this.tracks,i=0;for(let r=0,n=t.length;r!==n;++r){let a=this.tracks[r];i=Math.max(i,a.times[a.times.length-1])}return this.duration=i,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let i=0;i<this.tracks.length;i++)t=t&&this.tracks[i].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){let t=[];for(let i=0;i<this.tracks.length;i++)t.push(this.tracks[i].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}};function Y_e(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return BC;case"vector":case"vector2":case"vector3":case"vector4":return IC;case"color":return eY;case"quaternion":return SE;case"bool":case"boolean":return U0;case"string":return F0}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function K_e(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");let i=Y_e(t.type);if(t.times===void 0){let r=[],n=[];J7(t.keys,r,n,"value"),t.times=r,t.values=n}return i.parse!==void 0?i.parse(t):new i(t.name,t.times,t.values,t.interpolation)}var DC={enabled:!1,files:{},add:function(t,i){this.enabled!==!1&&(this.files[t]=i)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},tY=class{constructor(t,i,r){let n=this,a=!1,s=0,o=0,l,c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=i,this.onError=r,this.itemStart=function(h){o++,a===!1&&n.onStart!==void 0&&n.onStart(h,s,o),a=!0},this.itemEnd=function(h){s++,n.onProgress!==void 0&&n.onProgress(h,s,o),s===o&&(a=!1,n.onLoad!==void 0&&n.onLoad())},this.itemError=function(h){n.onError!==void 0&&n.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,u){return c.push(h,u),this},this.removeHandler=function(h){let u=c.indexOf(h);return u!==-1&&c.splice(u,2),this},this.getHandler=function(h){for(let u=0,d=c.length;u<d;u+=2){let A=c[u],f=c[u+1];if(A.global&&(A.lastIndex=0),A.test(h))return f}return null}}},X_e=new tY,CE=class{constructor(t){this.manager=t!==void 0?t:X_e,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,i){let r=this;return new Promise(function(n,a){r.load(t,n,i,a)})}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}},zh={},q_e=class extends Error{constructor(t,i){super(t),this.response=i}},fP=class extends CE{constructor(t){super(t)}load(t,i,r,n){t===void 0&&(t=""),this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let a=DC.get(t);if(a!==void 0)return this.manager.itemStart(t),setTimeout(()=>{i&&i(a),this.manager.itemEnd(t)},0),a;if(zh[t]!==void 0){zh[t].push({onLoad:i,onProgress:r,onError:n});return}zh[t]=[],zh[t].push({onLoad:i,onProgress:r,onError:n});let s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(s).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;let h=zh[t],u=c.body.getReader(),d=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),A=d?parseInt(d):0,f=A!==0,m=0,g=new ReadableStream({start(p){v();function v(){u.read().then(({done:_,value:y})=>{if(_)p.close();else{m+=y.byteLength;let w=new ProgressEvent("progress",{lengthComputable:f,loaded:m,total:A});for(let b=0,E=h.length;b<E;b++){let M=h[b];M.onProgress&&M.onProgress(w)}p.enqueue(y),v()}})}}});return new Response(g)}else throw new q_e(`fetch for "${c.url}" responded with ${c.status}: ${c.statusText}`,c)}).then(c=>{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return c.json();default:if(o===void 0)return c.text();{let h=/charset="?([^;"\s]*)"?/i.exec(o),u=h&&h[1]?h[1].toLowerCase():void 0,d=new TextDecoder(u);return c.arrayBuffer().then(A=>d.decode(A))}}}).then(c=>{DC.add(t,c);let h=zh[t];delete zh[t];for(let u=0,d=h.length;u<d;u++){let A=h[u];A.onLoad&&A.onLoad(c)}}).catch(c=>{let h=zh[t];if(h===void 0)throw this.manager.itemError(t),c;delete zh[t];for(let u=0,d=h.length;u<d;u++){let A=h[u];A.onError&&A.onError(c)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}},Z_e=class extends CE{constructor(t){super(t)}load(t,i,r,n){this.path!==void 0&&(t=this.path+t),t=this.manager.resolveURL(t);let a=this,s=DC.get(t);if(s!==void 0)return a.manager.itemStart(t),setTimeout(function(){i&&i(s),a.manager.itemEnd(t)},0),s;let o=My("img");function l(){h(),DC.add(t,this),i&&i(this),a.manager.itemEnd(t)}function c(u){h(),n&&n(u),a.manager.itemError(t),a.manager.itemEnd(t)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),t.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),a.manager.itemStart(t),o.src=t,o}},J_e=class extends CE{constructor(t){super(t)}load(t,i,r,n){let a=new en,s=new Z_e(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,function(o){a.image=o,a.needsUpdate=!0,i!==void 0&&i(a)},r,n),a}},TE=class extends lr{constructor(t,i=1){super(),this.isLight=!0,this.type="Light",this.color=new Ht(t),this.intensity=i}dispose(){}copy(t,i){return super.copy(t,i),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){let i=super.toJSON(t);return i.object.color=this.color.getHex(),i.object.intensity=this.intensity,this.groundColor!==void 0&&(i.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(i.object.distance=this.distance),this.angle!==void 0&&(i.object.angle=this.angle),this.decay!==void 0&&(i.object.decay=this.decay),this.penumbra!==void 0&&(i.object.penumbra=this.penumbra),this.shadow!==void 0&&(i.object.shadow=this.shadow.toJSON()),i}},$_e=class extends TE{constructor(t,i,r){super(t,r),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(lr.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Ht(i)}copy(t,i){return super.copy(t,i),this.groundColor.copy(t.groundColor),this}},rI=new ht,NG=new O,UG=new O,pN=class{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Me(512,512),this.map=null,this.mapPass=null,this.matrix=new ht,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new oN,this._frameExtents=new Me(1,1),this._viewportCount=1,this._viewports=[new ai(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){let i=this.camera,r=this.matrix;NG.setFromMatrixPosition(t.matrixWorld),i.position.copy(NG),UG.setFromMatrixPosition(t.target.matrixWorld),i.lookAt(UG),i.updateMatrixWorld(),rI.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(rI),r.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),r.multiply(rI)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){let t={};return this.bias!==0&&(t.bias=this.bias),this.normalBias!==0&&(t.normalBias=this.normalBias),this.radius!==1&&(t.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}},eye=class extends pN{constructor(){super(new as(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(t){let i=this.camera,r=Ty*2*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,a=t.distance||i.far;(r!==i.fov||n!==i.aspect||a!==i.far)&&(i.fov=r,i.aspect=n,i.far=a,i.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}},tye=class extends TE{constructor(t,i,r=0,n=Math.PI/3,a=0,s=2){super(t,i),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(lr.DEFAULT_UP),this.updateMatrix(),this.target=new lr,this.distance=r,this.angle=n,this.penumbra=a,this.decay=s,this.map=null,this.shadow=new eye}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t,i){return super.copy(t,i),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},FG=new ht,Lv=new O,nI=new O,iye=class extends pN{constructor(){super(new as(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Me(4,2),this._viewportCount=6,this._viewports=[new ai(2,1,1,1),new ai(0,1,1,1),new ai(3,1,1,1),new ai(1,1,1,1),new ai(3,0,1,1),new ai(1,0,1,1)],this._cubeDirections=[new O(1,0,0),new O(-1,0,0),new O(0,0,1),new O(0,0,-1),new O(0,1,0),new O(0,-1,0)],this._cubeUps=[new O(0,1,0),new O(0,1,0),new O(0,1,0),new O(0,1,0),new O(0,0,1),new O(0,0,-1)]}updateMatrices(t,i=0){let r=this.camera,n=this.matrix,a=t.distance||r.far;a!==r.far&&(r.far=a,r.updateProjectionMatrix()),Lv.setFromMatrixPosition(t.matrixWorld),r.position.copy(Lv),nI.copy(r.position),nI.add(this._cubeDirections[i]),r.up.copy(this._cubeUps[i]),r.lookAt(nI),r.updateMatrixWorld(),n.makeTranslation(-Lv.x,-Lv.y,-Lv.z),FG.multiplyMatrices(r.projectionMatrix,r.matrixWorldInverse),this._frustum.setFromProjectionMatrix(FG)}
vendor: 5,469 bytes, line 7715
7715},rye=class extends TE{constructor(t,i,r=0,n=2){super(t,i),this.isPointLight=!0,this.type="PointLight",this.distance=r,this.decay=n,this.shadow=new iye}get power(){return this.intensity*4*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t,i){return super.copy(t,i),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}},nye=class extends pN{constructor(){super(new oM(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}},aye=class extends TE{constructor(t,i){super(t,i),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(lr.DEFAULT_UP),this.updateMatrix(),this.target=new lr,this.shadow=new nye}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}},iY=class extends Lt{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}toJSON(){let t=super.toJSON();return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}},rY=class extends CE{constructor(t){super(t)}load(t,i,r,n){let a=this,s=new fP(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(t,function(o){try{i(a.parse(JSON.parse(o)))}catch(l){n?n(l):console.error(l),a.manager.itemError(t)}},r,n)}parse(t){let i={},r={};function n(d,A){if(i[A]!==void 0)return i[A];let f=d.interleavedBuffers[A],m=a(d,f.buffer),g=Pw(f.type,m),p=new c_e(g,f.stride);return p.uuid=f.uuid,i[A]=p,p}function a(d,A){if(r[A]!==void 0)return r[A];let f=d.arrayBuffers[A],m=new Uint32Array(f).buffer;return r[A]=m,m}let s=t.isInstancedBufferGeometry?new iY:new Lt,o=t.data.index;if(o!==void 0){let d=Pw(o.type,o.array);s.setIndex(new ei(d,1))}let l=t.data.attributes;for(let d in l){let A=l[d],f;if(A.isInterleavedBufferAttribute){let m=n(t.data,A.data);f=new hP(m,A.itemSize,A.offset,A.normalized)}else{let m=Pw(A.type,A.array),g=A.isInstancedBufferAttribute?xy:ei;f=new g(m,A.itemSize,A.normalized)}A.name!==void 0&&(f.name=A.name),A.usage!==void 0&&f.setUsage(A.usage),A.updateRange!==void 0&&(f.updateRange.offset=A.updateRange.offset,f.updateRange.count=A.updateRange.count),s.setAttribute(d,f)}let c=t.data.morphAttributes;if(c)for(let d in c){let A=c[d],f=[];for(let m=0,g=A.length;m<g;m++){let p=A[m],v;if(p.isInterleavedBufferAttribute){let _=n(t.data,p.data);v=new hP(_,p.itemSize,p.offset,p.normalized)}else{let _=Pw(p.type,p.array);v=new ei(_,p.itemSize,p.normalized)}p.name!==void 0&&(v.name=p.name),f.push(v)}s.morphAttributes[d]=f}t.data.morphTargetsRelative&&(s.morphTargetsRelative=!0);let h=t.data.groups||t.data.drawcalls||t.data.offsets;if(h!==void 0)for(let d=0,A=h.length;d!==A;++d){let f=h[d];s.addGroup(f.start,f.count,f.materialIndex)}let u=t.data.boundingSphere;if(u!==void 0){let d=new O;u.center!==void 0&&d.fromArray(u.center),s.boundingSphere=new ho(d,u.radius)}return t.name&&(s.name=t.name),t.userData&&(s.userData=t.userData),s}},sye=class{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=kG(),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 t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let i=kG();t=(i-this.oldTime)/1e3,this.oldTime=i,this.elapsedTime+=t}return t}};function kG(){return(typeof performance>"u"?Date:performance).now()}var oye=class{constructor(t,i,r){this.binding=t,this.valueSize=r;let n,a,s;switch(i){case"quaternion":n=this._slerp,a=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(r*6),this._workIndex=5;break;case"string":case"bool":n=this._select,a=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(r*5);break;default:n=this._lerp,a=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(r*5)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=a,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,i){let r=this.buffer,n=this.valueSize,a=t*n+n,s=this.cumulativeWeight;if(s===0){for(let o=0;o!==n;++o)r[a+o]=r[o];s=i}else{s+=i;let o=i/s;this._mixBufferRegion(r,a,0,o,n)}this.cumulativeWeight=s}accumulateAdditive(t){let i=this.buffer,r=this.valueSize,n=r*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(i,n,0,t,r),this.cumulativeWeightAdditive+=t}apply(t){let i=this.valueSize,r=this.buffer,n=t*i+i,a=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){let l=i*this._origIndex;this._mixBufferRegion(r,n,l,1-a,i)}s>0&&this._mixBufferRegionAdditive(r,n,this._addIndex*i,1,i);for(let l=i,c=i+i;l!==c;++l)if(r[l]!==r[l+i]){o.setValue(r,n);break}}saveOriginalState(){let t=this.binding,i=this.buffer,r=this.valueSize,n=r*this._origIndex;t.getValue(i,n);for(let a=r,s=n;a!==s;++a)i[a]=i[n+a%r];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){let t=this.valueSize*3;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){let t=this._addIndex*this.valueSize,i=t+this.valueSize;
vendor: 4,482 bytes, line 7715
7715for(let r=t;r<i;r++)this.buffer[r]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){let t=this._origIndex*this.valueSize,i=this._addIndex*this.valueSize;for(let r=0;r<this.valueSize;r++)this.buffer[i+r]=this.buffer[t+r]}_select(t,i,r,n,a){if(n>=.5)for(let s=0;s!==a;++s)t[i+s]=t[r+s]}_slerp(t,i,r,n){ri.slerpFlat(t,i,t,i,t,r,n)}_slerpAdditive(t,i,r,n,a){let s=this._workIndex*a;ri.multiplyQuaternionsFlat(t,s,t,i,t,r),ri.slerpFlat(t,i,t,i,t,s,n)}_lerp(t,i,r,n,a){let s=1-n;for(let o=0;o!==a;++o){let l=i+o;t[l]=t[l]*s+t[r+o]*n}}_lerpAdditive(t,i,r,n,a){for(let s=0;s!==a;++s){let o=i+s;t[o]=t[o]+t[r+s]*n}}},mN="\\[\\]\\.:\\/",lye=new RegExp("["+mN+"]","g"),gN="[^"+mN+"]",cye="[^"+mN.replace("\\.","")+"]",hye=/((?:WC+[\/:])*)/.source.replace("WC",gN),uye=/(WCOD+)?/.source.replace("WCOD",cye),dye=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",gN),Aye=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",gN),fye=new RegExp("^"+hye+uye+dye+Aye+"$"),pye=["material","materials","bones","map"],mye=class{constructor(t,i,r){let n=r||gr.parseTrackName(i);this._targetGroup=t,this._bindings=t.subscribe_(i,n)}getValue(t,i){this.bind();let r=this._targetGroup.nCachedObjects_,n=this._bindings[r];n!==void 0&&n.getValue(t,i)}setValue(t,i){let r=this._bindings;for(let n=this._targetGroup.nCachedObjects_,a=r.length;n!==a;++n)r[n].setValue(t,i)}bind(){let t=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=t.length;i!==r;++i)t[i].bind()}unbind(){let t=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=t.length;i!==r;++i)t[i].unbind()}},gr=class{constructor(t,i,r){this.path=i,this.parsedPath=r||gr.parseTrackName(i),this.node=gr.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,i,r){return t&&t.isAnimationObjectGroup?new gr.Composite(t,i,r):new gr(t,i,r)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(lye,"")}static parseTrackName(t){let i=fye.exec(t);if(i===null)throw new Error("PropertyBinding: Cannot parse trackName: "+t);let r={nodeName:i[2],objectName:i[3],objectIndex:i[4],propertyName:i[5],propertyIndex:i[6]},n=r.nodeName&&r.nodeName.lastIndexOf(".");if(n!==void 0&&n!==-1){let a=r.nodeName.substring(n+1);pye.indexOf(a)!==-1&&(r.nodeName=r.nodeName.substring(0,n),r.objectName=a)}if(r.propertyName===null||r.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return r}static findNode(t,i){if(i===void 0||i===""||i==="."||i===-1||i===t.name||i===t.uuid)return t;if(t.skeleton){let r=t.skeleton.getBoneByName(i);if(r!==void 0)return r}if(t.children){let r=function(a){for(let s=0;s<a.length;s++){let o=a[s];if(o.name===i||o.uuid===i)return o;let l=r(o.children);if(l)return l}return null},n=r(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,i){t[i]=this.targetObject[this.propertyName]}_getValue_array(t,i){let r=this.resolvedProperty;for(let n=0,a=r.length;n!==a;++n)t[i++]=r[n]}_getValue_arrayElement(t,i){t[i]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,i){this.resolvedProperty.toArray(t,i)}_setValue_direct(t,i){this.targetObject[this.propertyName]=t[i]}_setValue_direct_setNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,i){this.targetObject[this.propertyName]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,i){let r=this.resolvedProperty;for(let n=0,a=r.length;n!==a;++n)r[n]=t[i++]}_setValue_array_setNeedsUpdate(t,i){let r=this.resolvedProperty;for(let n=0,a=r.length;n!==a;++n)r[n]=t[i++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,i){let r=this.resolvedProperty;for(let n=0,a=r.length;n!==a;++n)r[n]=t[i++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,i){this.resolvedProperty[this.propertyIndex]=t[i]}_setValue_arrayElement_setNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty[this.propertyIndex]=t[i],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,i){this.resolvedProperty.fromArray(t,i)}_setValue_fromArray_setNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.needsUpdate=!0}
vendor: 15,883 bytes, line 7715
7715_setValue_fromArray_setMatrixWorldNeedsUpdate(t,i){this.resolvedProperty.fromArray(t,i),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,i){this.bind(),this.getValue(t,i)}_setValue_unbound(t,i){this.bind(),this.setValue(t,i)}bind(){let t=this.node,i=this.parsedPath,r=i.objectName,n=i.propertyName,a=i.propertyIndex;if(t||(t=gr.findNode(this.rootNode,i.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t){console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");return}if(r){let c=i.objectIndex;switch(r){case"materials":if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}t=t.material.materials;break;case"bones":if(!t.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}t=t.skeleton.bones;for(let h=0;h<t.length;h++)if(t[h].name===c){c=h;break}break;case"map":if("map"in t){t=t.map;break}if(!t.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!t.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}t=t.material.map;break;default:if(t[r]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}t=t[r]}if(c!==void 0){if(t[c]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);return}t=t[c]}}let s=t[n];if(s===void 0){let c=i.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+c+"."+n+" but it wasn't found.",t);return}let o=this.Versioning.None;this.targetObject=t,t.needsUpdate!==void 0?o=this.Versioning.NeedsUpdate:t.matrixWorldNeedsUpdate!==void 0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let l=this.BindingType.Direct;if(a!==void 0){if(n==="morphTargetInfluences"){if(!t.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!t.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}t.morphTargetDictionary[a]!==void 0&&(a=t.morphTargetDictionary[a])}l=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=a}else s.fromArray!==void 0&&s.toArray!==void 0?(l=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(l=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[l],this.setValue=this.SetterByBindingTypeAndVersioning[l][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}};gr.Composite=mye;gr.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};gr.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};gr.prototype.GetterByBindingType=[gr.prototype._getValue_direct,gr.prototype._getValue_array,gr.prototype._getValue_arrayElement,gr.prototype._getValue_toArray];gr.prototype.SetterByBindingTypeAndVersioning=[[gr.prototype._setValue_direct,gr.prototype._setValue_direct_setNeedsUpdate,gr.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[gr.prototype._setValue_array,gr.prototype._setValue_array_setNeedsUpdate,gr.prototype._setValue_array_setMatrixWorldNeedsUpdate],[gr.prototype._setValue_arrayElement,gr.prototype._setValue_arrayElement_setNeedsUpdate,gr.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[gr.prototype._setValue_fromArray,gr.prototype._setValue_fromArray_setNeedsUpdate,gr.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];var gye=class{constructor(t,i,r=null,n=i.blendMode){this._mixer=t,this._clip=i,this._localRoot=r,this.blendMode=n;let a=i.tracks,s=a.length,o=new Array(s),l={endingStart:hg,endingEnd:hg};for(let c=0;c!==s;++c){let h=a[c].createInterpolant(null);o[c]=h,h.settings=l}this._interpolantSettings=l,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=E7,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,i){return this.loop=t,this.repetitions=i,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,i,r){if(t.fadeOut(i),this.fadeIn(i),r){let n=this._clip.duration,a=t._clip.duration,s=a/n,o=n/a;t.warp(1,s,i),this.warp(o,1,i)}return this}crossFadeTo(t,i,r){return t.crossFadeFrom(this,i,r)}stopFading(){let t=this._weightInterpolant;return t!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,i,r){let n=this._mixer,a=n.time,s=this.timeScale,o=this._timeScaleInterpolant;o===null&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);let l=o.parameterPositions,c=o.sampleValues;return l[0]=a,l[1]=a+r,c[0]=t/s,c[1]=i/s,this}stopWarping(){let t=this._timeScaleInterpolant;return t!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,i,r,n){if(!this.enabled){this._updateWeight(t);return}let a=this._startTime;if(a!==null){let l=(t-a)*r;l<0||r===0?i=0:(this._startTime=null,i=r*l)}i*=this._updateTimeScale(t);let s=this._updateTime(i),o=this._updateWeight(t);if(o>0){let l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Yfe:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(s),c[h].accumulateAdditive(o);break;case rN:default:for(let h=0,u=l.length;h!==u;++h)l[h].evaluate(s),c[h].accumulate(n,o)}}}_updateWeight(t){let i=0;if(this.enabled){i=this.weight;let r=this._weightInterpolant;if(r!==null){let n=r.evaluate(t)[0];i*=n,t>r.parameterPositions[1]&&(this.stopFading(),n===0&&(this.enabled=!1))}}return this._effectiveWeight=i,i}_updateTimeScale(t){let i=0;if(!this.paused){i=this.timeScale;let r=this._timeScaleInterpolant;if(r!==null){let n=r.evaluate(t)[0];i*=n,t>r.parameterPositions[1]&&(this.stopWarping(),i===0?this.paused=!0:this.timeScale=i)}}return this._effectiveTimeScale=i,i}_updateTime(t){let i=this._clip.duration,r=this.loop,n=this.time+t,a=this._loopCount,s=r===iN;if(t===0)return a===-1?n:s&&(a&1)===1?i-n:n;if(r===y7){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(n>=i)n=i;else if(n<0)n=0;else{this.time=n;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(a===-1&&(t>=0?(a=0,this._setEndings(!0,this.repetitions===0,s)):this._setEndings(this.repetitions===0,!0,s)),n>=i||n<0){let o=Math.floor(n/i);n-=i*o,a+=Math.abs(o);let l=this.repetitions-a;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?i:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(l===1){let c=t<0;this._setEndings(c,!c,s)}else this._setEndings(!1,!1,s);this._loopCount=a,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=n;if(s&&(a&1)===1)return i-n}return n}_setEndings(t,i,r){let n=this._interpolantSettings;r?(n.endingStart=ug,n.endingEnd=ug):(t?n.endingStart=this.zeroSlopeAtStart?ug:hg:n.endingStart=SC,i?n.endingEnd=this.zeroSlopeAtEnd?ug:hg:n.endingEnd=SC)}_scheduleFading(t,i,r){let n=this._mixer,a=n.time,s=this._weightInterpolant;s===null&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);let o=s.parameterPositions,l=s.sampleValues;return o[0]=a,l[0]=i,o[1]=a+t,l[1]=r,this}},vye=new Float32Array(1),_ye=class extends Ja{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(t,i){let r=t._localRoot||this._root,n=t._clip.tracks,a=n.length,s=t._propertyBindings,o=t._interpolants,l=r.uuid,c=this._bindingsByRootAndName,h=c[l];h===void 0&&(h={},c[l]=h);for(let u=0;u!==a;++u){let d=n[u],A=d.name,f=h[A];if(f!==void 0)++f.referenceCount,s[u]=f;else{if(f=s[u],f!==void 0){f._cacheIndex===null&&(++f.referenceCount,this._addInactiveBinding(f,l,A));continue}let m=i&&i._propertyBindings[u].binding.parsedPath;f=new oye(gr.create(r,A,m),d.ValueTypeName,d.getValueSize()),++f.referenceCount,this._addInactiveBinding(f,l,A),s[u]=f}o[u].resultBuffer=f.buffer}}_activateAction(t){if(!this._isActiveAction(t)){if(t._cacheIndex===null){let r=(t._localRoot||this._root).uuid,n=t._clip.uuid,a=this._actionsByClip[n];this._bindAction(t,a&&a.knownActions[0]),this._addInactiveAction(t,n,r)}let i=t._propertyBindings;for(let r=0,n=i.length;r!==n;++r){let a=i[r];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(t)}}_deactivateAction(t){if(this._isActiveAction(t)){let i=t._propertyBindings;for(let r=0,n=i.length;r!==n;++r){let a=i[r];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(t)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;let t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}}_isActiveAction(t){let i=t._cacheIndex;return i!==null&&i<this._nActiveActions}_addInactiveAction(t,i,r){let n=this._actions,a=this._actionsByClip,s=a[i];if(s===void 0)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,a[i]=s;else{let o=s.knownActions;t._byClipCacheIndex=o.length,o.push(t)}t._cacheIndex=n.length,n.push(t),s.actionByRoot[r]=t}_removeInactiveAction(t){let i=this._actions,r=i[i.length-1],n=t._cacheIndex;r._cacheIndex=n,i[n]=r,i.pop(),t._cacheIndex=null;let a=t._clip.uuid,s=this._actionsByClip,o=s[a],l=o.knownActions,c=l[l.length-1],h=t._byClipCacheIndex;c._byClipCacheIndex=h,l[h]=c,l.pop(),t._byClipCacheIndex=null;let u=o.actionByRoot,d=(t._localRoot||this._root).uuid;delete u[d],l.length===0&&delete s[a],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){let i=t._propertyBindings;for(let r=0,n=i.length;r!==n;++r){let a=i[r];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(t){let i=this._actions,r=t._cacheIndex,n=this._nActiveActions++,a=i[n];t._cacheIndex=n,i[n]=t,a._cacheIndex=r,i[r]=a}_takeBackAction(t){let i=this._actions,r=t._cacheIndex,n=--this._nActiveActions,a=i[n];t._cacheIndex=n,i[n]=t,a._cacheIndex=r,i[r]=a}_addInactiveBinding(t,i,r){let n=this._bindingsByRootAndName,a=this._bindings,s=n[i];s===void 0&&(s={},n[i]=s),s[r]=t,t._cacheIndex=a.length,a.push(t)}_removeInactiveBinding(t){let i=this._bindings,r=t.binding,n=r.rootNode.uuid,a=r.path,s=this._bindingsByRootAndName,o=s[n],l=i[i.length-1],c=t._cacheIndex;l._cacheIndex=c,i[c]=l,i.pop(),delete o[a],Object.keys(o).length===0&&delete s[n]}_lendBinding(t){let i=this._bindings,r=t._cacheIndex,n=this._nActiveBindings++,a=i[n];t._cacheIndex=n,i[n]=t,a._cacheIndex=r,i[r]=a}_takeBackBinding(t){let i=this._bindings,r=t._cacheIndex,n=--this._nActiveBindings,a=i[n];t._cacheIndex=n,i[n]=t,a._cacheIndex=r,i[r]=a}_lendControlInterpolant(){let t=this._controlInterpolants,i=this._nActiveControlInterpolants++,r=t[i];return r===void 0&&(r=new $7(new Float32Array(2),new Float32Array(2),1,vye),r.__cacheIndex=i,t[i]=r),r}_takeBackControlInterpolant(t){let i=this._controlInterpolants,r=t.__cacheIndex,n=--this._nActiveControlInterpolants,a=i[n];t.__cacheIndex=n,i[n]=t,a.__cacheIndex=r,i[r]=a}clipAction(t,i,r){let n=i||this._root,a=n.uuid,s=typeof t=="string"?AP.findByName(n,t):t,o=s!==null?s.uuid:t,l=this._actionsByClip[o],c=null;if(r===void 0&&(s!==null?r=s.blendMode:r=rN),l!==void 0){let u=l.actionByRoot[a];if(u!==void 0&&u.blendMode===r)return u;c=l.knownActions[0],s===null&&(s=c._clip)}if(s===null)return null;let h=new gye(this,s,i,r);return this._bindAction(h,c),this._addInactiveAction(h,o,a),h}existingAction(t,i){let r=i||this._root,n=r.uuid,a=typeof t=="string"?AP.findByName(r,t):t,s=a?a.uuid:t,o=this._actionsByClip[s];return o!==void 0&&o.actionByRoot[n]||null}stopAllAction(){let t=this._actions,i=this._nActiveActions;for(let r=i-1;r>=0;--r)t[r].stop();return this}update(t){t*=this.timeScale;let i=this._actions,r=this._nActiveActions,n=this.time+=t,a=Math.sign(t),s=this._accuIndex^=1;for(let c=0;c!==r;++c)i[c]._update(n,t,a,s);let o=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)o[c].apply(s);return this}setTime(t){this.time=0;for(let i=0;i<this._actions.length;i++)this._actions[i].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){let i=this._actions,r=t.uuid,n=this._actionsByClip,a=n[r];if(a!==void 0){let s=a.knownActions;for(let o=0,l=s.length;o!==l;++o){let c=s[o];this._deactivateAction(c);let h=c._cacheIndex,u=i[i.length-1];c._cacheIndex=null,c._byClipCacheIndex=null,u._cacheIndex=h,i[h]=u,i.pop(),this._removeInactiveBindingsForAction(c)}delete n[r]}}uncacheRoot(t){let i=t.uuid,r=this._actionsByClip;for(let s in r){let o=r[s].actionByRoot,l=o[i];l!==void 0&&(this._deactivateAction(l),this._removeInactiveAction(l))}let n=this._bindingsByRootAndName,a=n[i];if(a!==void 0)for(let s in a){let o=a[s];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(t,i){let r=this.existingAction(t,i);r!==null&&(this._deactivateAction(r),this._removeInactiveAction(r))}},at=class{constructor(t){this.value=t}clone(){return new at(this.value.clone===void 0?this.value:this.value.clone())}},nY=class{constructor(t,i,r=0,n=1/0){this.ray=new L0(t,i),this.near=r,this.far=n,this.camera=null,this.layers=new aN,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,i){this.ray.set(t,i)}setFromCamera(t,i){i.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(i.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(i).sub(this.ray.origin).normalize(),this.camera=i):i.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(i.near+i.far)/(i.near-i.far)).unproject(i),this.ray.direction.set(0,0,-1).transformDirection(i.matrixWorld),this.camera=i):console.error("THREE.Raycaster:
7715Unsupported camera type: "+i.type)}intersectObject(t,i=!0,r=[]){return pP(t,this,r,i),r.sort(HG),r}intersectObjects(t,i=!0,r=[]){for(let n=0,a=t.length;n<a;n++)pP(t[n],this,r,i);return r.sort(HG),r}};function HG(t,i){return t.distance-i.distance}function pP(t,i,r,n){if(t.layers.test(i.layers)&&t.raycast(i,r),n===!0){let a=t.children;for(let s=0,o=a.length;s<o;s++)pP(a[s],i,r,!0)}}var GG=class{constructor(t=1,i=0,r=0){return this.radius=t,this.phi=i,this.theta=r,this}set(t,i,r){return this.radius=t,this.phi=i,this.theta=r,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,i,r){return this.radius=Math.sqrt(t*t+i*i+r*r),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,r),this.phi=Math.acos(Dn(i/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}},zG=new Me,aY=class{constructor(t=new Me(1/0,1/0),i=new Me(-1/0,-1/0)){this.isBox2=!0,this.min=t,this.max=i}set(t,i){return this.min.copy(t),this.max.copy(i),this}setFromPoints(t){this.makeEmpty();for(let i=0,r=t.length;i<r;i++)this.expandByPoint(t[i]);return this}setFromCenterAndSize(t,i){let r=zG.copy(i).multiplyScalar(.5);return this.min.copy(t).sub(r),this.max.copy(t).add(r),this}clone(){return new this.constructor().copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)}containsBox(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y}getParameter(t,i){return i.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,i){return i.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return zG.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}},QG=new O,nb=new O,vl=class{constructor(t=new O,i=new O){this.start=t,this.end=i}set(t,i){return this.start.copy(t),this.end.copy(i),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,i){return this.delta(i).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,i){QG.subVectors(t,this.start),nb.subVectors(this.end,this.start);let r=nb.dot(nb),n=nb.dot(QG)/r;return i&&(n=Dn(n,0,1)),n}closestPointToPoint(t,i,r){let n=this.closestPointToPointParameter(t,i);return this.delta(r).multiplyScalar(n).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}clone(){return new this.constructor().copy(this)}},VG=new O,yye=class extends lr{constructor(t,i){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="SpotLightHelper";let r=new Lt,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let s=0,o=1,l=32;s<l;s++,o++){let c=s/l*Math.PI*2,h=o/l*Math.PI*2;n.push(Math.cos(c),Math.sin(c),1,Math.cos(h),Math.sin(h),1)}r.setAttribute("position",new Et(n,3));let a=new WA({fog:!1,toneMapped:!1});this.cone=new bE(r,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1);let t=this.light.distance?this.light.distance:1e3,i=t*Math.tan(this.light.angle);this.cone.scale.set(i,i,t),VG.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(VG),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}},Eye=class extends Zr{constructor(t,i,r){let n=new Bg(i,4,2),a=new Gu({wireframe:!0,fog:!1,toneMapped:!1});super(n,a),this.light=t,this.color=r,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}},WG=new O,ab=new O,jG=new O,wye=class extends lr{constructor(t,i,r){super(),this.light=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=r,this.type="DirectionalLightHelper",i===void 0&&(i=1);let n=new Lt;n.setAttribute("position",new Et([-i,i,0,i,i,0,i,-i,0,-i,-i,0,-i,i,0],3));let a=new WA({fog:!1,toneMapped:!1});this.lightPlane=new MC(n,a),this.add(this.lightPlane),n=new Lt,n.setAttribute("position",new Et([0,0,0,0,0,1],3)),this.targetLine=new MC(n,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),WG.setFromMatrixPosition(this.light.matrixWorld),ab.setFromMatrixPosition(this.light.target.matrixWorld),jG.subVectors(ab,WG),this.lightPlane.lookAt(ab),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(ab),this.targetLine.scale.z
7715=jG.length()}},sb=new O,tn=new Bp,PC=class extends bE{constructor(t){let i=new Lt,r=new WA({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],a=[],s={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(f,m){l(f),l(m)}function l(f){n.push(0,0,0),a.push(0,0,0),s[f]===void 0&&(s[f]=[]),s[f].push(n.length/3-1)}i.setAttribute("position",new Et(n,3)),i.setAttribute("color",new Et(a,3)),super(i,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update();let c=new Ht(16755200),h=new Ht(16711680),u=new Ht(43775),d=new Ht(16777215),A=new Ht(3355443);this.setColors(c,h,u,d,A)}setColors(t,i,r,n,a){let s=this.geometry.getAttribute("color");s.setXYZ(0,t.r,t.g,t.b),s.setXYZ(1,t.r,t.g,t.b),s.setXYZ(2,t.r,t.g,t.b),s.setXYZ(3,t.r,t.g,t.b),s.setXYZ(4,t.r,t.g,t.b),s.setXYZ(5,t.r,t.g,t.b),s.setXYZ(6,t.r,t.g,t.b),s.setXYZ(7,t.r,t.g,t.b),s.setXYZ(8,t.r,t.g,t.b),s.setXYZ(9,t.r,t.g,t.b),s.setXYZ(10,t.r,t.g,t.b),s.setXYZ(11,t.r,t.g,t.b),s.setXYZ(12,t.r,t.g,t.b),s.setXYZ(13,t.r,t.g,t.b),s.setXYZ(14,t.r,t.g,t.b),s.setXYZ(15,t.r,t.g,t.b),s.setXYZ(16,t.r,t.g,t.b),s.setXYZ(17,t.r,t.g,t.b),s.setXYZ(18,t.r,t.g,t.b),s.setXYZ(19,t.r,t.g,t.b),s.setXYZ(20,t.r,t.g,t.b),s.setXYZ(21,t.r,t.g,t.b),s.setXYZ(22,t.r,t.g,t.b),s.setXYZ(23,t.r,t.g,t.b),s.setXYZ(24,i.r,i.g,i.b),s.setXYZ(25,i.r,i.g,i.b),s.setXYZ(26,i.r,i.g,i.b),s.setXYZ(27,i.r,i.g,i.b),s.setXYZ(28,i.r,i.g,i.b),s.setXYZ(29,i.r,i.g,i.b),s.setXYZ(30,i.r,i.g,i.b),s.setXYZ(31,i.r,i.g,i.b),s.setXYZ(32,r.r,r.g,r.b),s.setXYZ(33,r.r,r.g,r.b),s.setXYZ(34,r.r,r.g,r.b),s.setXYZ(35,r.r,r.g,r.b),s.setXYZ(36,r.r,r.g,r.b),s.setXYZ(37,r.r,r.g,r.b),s.setXYZ(38,n.r,n.g,n.b),s.setXYZ(39,n.r,n.g,n.b),s.setXYZ(40,a.r,a.g,a.b),s.setXYZ(41,a.r,a.g,a.b),s.setXYZ(42,a.r,a.g,a.b),s.setXYZ(43,a.r,a.g,a.b),s.setXYZ(44,a.r,a.g,a.b),s.setXYZ(45,a.r,a.g,a.b),s.setXYZ(46,a.r,a.g,a.b),s.setXYZ(47,a.r,a.g,a.b),s.setXYZ(48,a.r,a.g,a.b),s.setXYZ(49,a.r,a.g,a.b),s.needsUpdate=!0}update(){let t=this.geometry,i=this.pointMap,r=1,n=1;tn.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),fn("c",i,t,tn,0,0,-1),fn("t",i,t,tn,0,0,1),fn("n1",i,t,tn,-r,-n,-1),fn("n2",i,t,tn,r,-n,-1),fn("n3",i,t,tn,-r,n,-1),fn("n4",i,t,tn,r,n,-1),fn("f1",i,t,tn,-r,-n,1),fn("f2",i,t,tn,r,-n,1),fn("f3",i,t,tn,-r,n,1),fn("f4",i,t,tn,r,n,1),fn("u1",i,t,tn,r*.7,n*1.1,-1),fn("u2",i,t,tn,-r*.7,n*1.1,-1),fn("u3",i,t,tn,0,n*2,-1),fn("cf1",i,t,tn,-r,0,1),fn("cf2",i,t,tn,r,0,1),fn("cf3",i,t,tn,0,-n,1),fn("cf4",i,t,tn,0,n,1),fn("cn1",i,t,tn,-r,0,-1),fn("cn2",i,t,tn,r,0,-1),fn("cn3",i,t,tn,0,-n,-1),fn("cn4",i,t,tn,0,n,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function fn(t,i,r,n,a,s,o){sb.set(a,s,o).unproject(n);let l=i[t];if(l!==void 0){let c=r.getAttribute("position");for(let h=0,u=l.length;h<u;h++)c.setXYZ(l[h],sb.x,sb.y,sb.z)}}var LC=class extends bE{constructor(t,i=16776960){let r=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new Lt;a.setIndex(new ei(r,1)),a.setAttribute("position",new Et(n,3)),super(a,new WA({color:i,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){let i=this.box;i.isEmpty()||(i.getCenter(this.position),i.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}dispose(){this.geometry.dispose(),this.material.dispose()}},bye=class extends bE{constructor(t=1){let i=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],r=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],n=new Lt;n.setAttribute("position",new Et(i,3)),n.setAttribute("color",new Et(r,3));let a=new WA({vertexColors:!0,toneMapped:!1});super(n,a),this.type="AxesHelper"}setColors(t,i,r){let n=new Ht,a=this.geometry.attributes.color.array;return n.set(t),n.toArray(a,0),n.toArray(a,3),n.set(i),n.toArray(a,6),n.toArray(a,9),n.set(r),n.toArray(a,12),n.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}},mu=Sye();function Sye(){let t=new ArrayBuffer(4),i=new Float32Array(t),r=new Uint32Array(t),n=new Uint32Array(512),a=new Uint32Array(512);for(let c=0;c<256;++c){let h=c-127;h<-27?(n[c]=0,n[c|256]=32768,a[c]=24,a[c|256]=24):h<-14?(n[c]=1024>>-h-14,n[c|256]=1024>>-h-14|32768,a[c]=-h-1,a[c|256]=-h-1):h<=15?(n[c]=h+15<<10,n[c|256]=h+15<<10|32768,a[c]=13,a[c|256]=13):h<128?(n[c]=31744,n[c|256]=64512,a[c]=24,a[c|256]=24):(n[c]=31744,n[c|256]=64512,a[c]=13,a[c|256]=13)}let s=new Uint32Array(2048),o=new Uint32Array(64),l=new Uint32Array(64);for(let c=1;c<1024;++c){let h=c<<13,u=0;for(;!(h&8388608);)h<<=1,u-=8388608;h&=-8388609,u+=947912704,s[c]=h|u}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)o[c]=c<<23;o[31]=1199570944,o[32]=2147483648;for(let c=33;c<63;++c)o[c]=2147483648+(c-32<<23);o[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(l[c]=1024);return{floatView:i,uint32View:r,baseTable:n,shiftTable:a,mantissaTable:s,exponentTable:o,offsetTable:l}}function Cye(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=Dn(t,-65504,65504),mu.floatView[0]=t;let i=mu.uint32View[0],r=i>>23&511;return mu.baseTable[r]+((i&8388607)>>mu.shiftTable[r])}function Tye(t){let i=t>>10;return mu.uint32View[0]=mu.mantissaTable[mu.offsetTable[i]+(t&1023)]+mu.exponentTable[i],mu.floatView[0]}var Mye=Object.freeze({__proto__:null,fromHalfFloat:Tye,toHalfFloat:Cye});typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:P0}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=P0);var Ov=".",vN=Symbol("target"),sY=Symbol("unsubscribe");function mP(t){return t instanceof Date||t instanceof Set||t instanceof Map||t instanceof WeakSet||t instanceof WeakMap||ArrayBuffer.isView(t)}function xye(t){return(typeof t=="object"?t===null:typeof t!="function")||t instanceof RegExp}var Xc=Array.isArray;function _N(t){return typeof t=="symbol"}var Rye={after:(t,i)=>Xc(t)?t.slice(i.length):i===""?t:t.slice(i.length+1),concat:(t,i)=>Xc(t)?(t=[...t],i&&t.push(i),t):i&&i.toString!==void 0?(t!==""&&(t+=Ov),_N(i)?t+i.toString():t+i):t,initial:t=>
vendor: 9,077 bytes, line 7715
7715{if(Xc(t))return t.slice(0,-1);if(t==="")return t;let i=t.lastIndexOf(Ov);return i===-1?"":t.slice(0,i)},last:t=>{if(Xc(t))return t[t.length-1]||"";if(t==="")return t;let i=t.lastIndexOf(Ov);return i===-1?t:t.slice(i+1)},walk:(t,i)=>{if(Xc(t))for(let r of t)i(r);else if(t!==""){let r=0,n=t.indexOf(Ov);if(n===-1)i(t);else for(;r<t.length;)n===-1&&(n=t.length),i(t.slice(r,n)),r=n+1,n=t.indexOf(Ov,r)}},get(t,i){return this.walk(i,r=>{t&&(t=t[r])}),t}},Xo=Rye;function Bye(t){return typeof t=="object"&&typeof t.next=="function"}function Iye(t,i,r,n,a){let s=t.next;if(i.name==="entries")t.next=function(){let o=s.call(this);return o.done===!1&&(o.value[0]=a(o.value[0],i,o.value[0],n),o.value[1]=a(o.value[1],i,o.value[0],n)),o};else if(i.name==="values"){let o=r[vN].keys();t.next=function(){let l=s.call(this);return l.done===!1&&(l.value=a(l.value,i,o.next().value,n)),l}}else t.next=function(){let o=s.call(this);return o.done===!1&&(o.value=a(o.value,i,o.value,n)),o};return t}function YG(t,i,r){return t.isUnsubscribed||i.ignoreSymbols&&_N(r)||i.ignoreUnderscores&&r.charAt(0)==="_"||"ignoreKeys"in i&&i.ignoreKeys.includes(r)}var Dye=class{constructor(t){this._equals=t,this._proxyCache=new WeakMap,this._pathCache=new WeakMap,this.isUnsubscribed=!1}_getDescriptorCache(){return this._descriptorCache===void 0&&(this._descriptorCache=new WeakMap),this._descriptorCache}_getProperties(t){let i=this._getDescriptorCache(),r=i.get(t);return r===void 0&&(r={},i.set(t,r)),r}_getOwnPropertyDescriptor(t,i){if(this.isUnsubscribed)return Reflect.getOwnPropertyDescriptor(t,i);let r=this._getProperties(t),n=r[i];return n===void 0&&(n=Reflect.getOwnPropertyDescriptor(t,i),r[i]=n),n}getProxy(t,i,r,n){if(this.isUnsubscribed)return t;let a=t[n],s=a||t;this._pathCache.set(s,i);let o=this._proxyCache.get(s);return o===void 0&&(o=a===void 0?new Proxy(t,r):t,this._proxyCache.set(s,o)),o}getPath(t){return this.isUnsubscribed?void 0:this._pathCache.get(t)}isDetached(t,i){return!Object.is(t,Xo.get(i,this.getPath(t)))}defineProperty(t,i,r){return Reflect.defineProperty(t,i,r)?(this.isUnsubscribed||(this._getProperties(t)[i]=r),!0):!1}setProperty(t,i,r,n,a){if(!this._equals(a,r)||!(i in t)){let s=this._getOwnPropertyDescriptor(t,i);return s!==void 0&&"set"in s?Reflect.set(t,i,r,n):Reflect.set(t,i,r)}return!0}deleteProperty(t,i,r){if(Reflect.deleteProperty(t,i)){if(!this.isUnsubscribed){let n=this._getDescriptorCache().get(t);n&&(delete n[i],this._pathCache.delete(r))}return!0}return!1}isSameDescriptor(t,i,r){let n=this._getOwnPropertyDescriptor(i,r);return t!==void 0&&n!==void 0&&Object.is(t.value,n.value)&&(t.writable||!1)===(n.writable||!1)&&(t.enumerable||!1)===(n.enumerable||!1)&&(t.configurable||!1)===(n.configurable||!1)&&t.get===n.get&&t.set===n.set}isGetInvariant(t,i){let r=this._getOwnPropertyDescriptor(t,i);return r!==void 0&&r.configurable!==!0&&r.writable!==!0}unsubscribe(){this._descriptorCache=null,this._pathCache=null,this._proxyCache=null,this.isUnsubscribed=!0}};function gP(t){return toString.call(t)==="[object Object]"}function ob(){return!0}function Mm(t,i){return t.length!==i.length||t.some((r,n)=>i[n]!==r)}var oY=new Set(["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Pye=new Set(["concat","includes","indexOf","join","keys","lastIndexOf"]),lY={push:ob,pop:ob,shift:ob,unshift:ob,copyWithin:Mm,reverse:Mm,sort:Mm,splice:Mm,flat:Mm,fill:Mm},Lye=new Set([...oY,...Pye,...Object.keys(lY)]);function lb(t,i){if(t.size!==i.size)return!0;for(let r of t)if(!i.has(r))return!0;return!1}var cY=["keys","values","entries"],hY=new Set(["has","toString"]),uY={add:lb,clear:lb,delete:lb,forEach:lb},Oye=new Set([...hY,...Object.keys(uY),...cY]);function cb(t,i){if(t.size!==i.size)return!0;let r;for(let[n,a]of t)if(r=i.get(n),r!==a||r===void 0&&!i.has(n))return!0;return!1}var Nye=new Set([...hY,"get"]),dY={set:cb,clear:cb,delete:cb,forEach:cb},Uye=new Set([...Nye,...Object.keys(dY),...cY]),PA=class{constructor(t,i,r,n){this._path=i,this._isChanged=!1,this._clonedCache=new Set,this._hasOnValidate=n,this._changes=n?[]:null,this.clone=i===void 0?t:this._shallowClone(t)}static isHandledMethod(t){return oY.has(t)}_shallowClone(t){let i=t;if(gP(t))i={...t};else if(Xc(t))i=[...t];else if(t instanceof Date)i=new Date(t);else if(t instanceof Set)i=new Set([...t].map(r=>this._shallowClone(r)));else if(t instanceof Map){i=new Map;for(let[r,n]of t.entries())i.set(r,this._shallowClone(n))}return this._clonedCache.add(i),i}preferredThisArg(t,i,r,n){return t?(Xc(n)?this._onIsChanged=lY[i]:n instanceof Set?this._onIsChanged=uY[i]:n instanceof Map&&(this._onIsChanged=dY[i]),n):r}update(t,i,r){let n=Xo.after(t,this._path);if(i!=="length"){let a=this.clone;Xo.walk(n,s=>{a&&a[s]&&(this._clonedCache.has(a[s])||(a[s]=this._shallowClone(a[s])),a=a[s])}),this._hasOnValidate&&this._changes.push({path:n,property:i,previous:r}),a&&a[i]&&(a[i]=r)}this._isChanged=!0}undo(t){let i;for(let r=this._changes.length-1;r!==-1;r--)i=this._changes[r],Xo.get(t,i.path)[i.property]=i.previous}isChanged(t){return this._onIsChanged===void 0?this._isChanged:this._onIsChanged(this.clone,t)}},KG=class extends PA{static isHandledMethod(t){return Lye.has(t)}},Fye=class extends PA{undo(t){t.setTime(this.clone.getTime())}isChanged(t,i){return!i(this.clone.valueOf(),t.valueOf())}},XG=class extends PA{static isHandledMethod(t){return Oye.has(t)}undo(t){for(let i of this.clone)t.add(i);for(let i of t)this.clone.has(i)||t.delete(i)}},qG=class extends PA{static isHandledMethod(t){return Uye.has(t)}undo(t){for(let[i,r]of this.clone.entries())t.set(i,r);for(let i of t.keys())this.clone.has(i)||t.delete(i)}},kye=class extends PA{constructor(t,i,r,n){super(void 0,i,r,n),this._arg1=r[0],this._weakValue=t.has(this._arg1)}isChanged(t){return this._weakValue!==t.has(this._arg1)}undo(t){this._weakValue&&!t.has(this._arg1)?t.add(this._arg1):t.delete(this._arg1)}},Hye=class extends PA{constructor(t,i,r,n){super(void 0,i,r,n),this._weakKey=r[0],this._weakHas=t.has(this._weakKey),this._weakValue=t.get(this._weakKey)}isChanged(t){return this._weakValue!==t.get(this._weakKey)}undo(t){let i=t.has(this._weakKey);this._weakHas&&!i?t.set(this._weakKey,this._weakValue):!this._weakHas&&i?t.delete(this._weakKey):this._weakValue!==t.get(this._weakKey)&&t.set(this._weakKey,this._weakValue)}},eg=class{constructor(t){this._stack=[],this._hasOnValidate=t}static isHandledType(t){return gP(t)||Xc(t)||mP(t)}static isHandledMethod(t,i){return gP(t)?PA.isHandledMethod(i):Xc(t)?KG.isHandledMethod(i):t instanceof Set?XG.isHandledMethod(i):t instanceof Map?qG.isHandledMethod(i):mP(t)}get isCloning(){return this._stack.length>0}start(t,i,r){let n=PA;Xc(t)?n=KG:t instanceof Date?n=Fye:t instanceof Set?n=XG:t instanceof Map?n=qG:t instanceof WeakSet?n=kye:t instanceof WeakMap&&(n=Hye),this._stack.push(new n(t,i,r,this._hasOnValidate))}update(t,i,r){this._stack[this._stack.length-1].update(t,i,r)}preferredThisArg(t,i,r){let{name:n}=t,a=eg.isHandledMethod(r,n);return this._stack[this._stack.length-1].preferredThisArg(a,n,i,r)}isChanged(t,i,r){return this._stack[this._stack.length-1].isChanged(t,i,r)}undo(t){this._previousClone!==void 0&&this._previousClone.undo(t)}stop(){return this._previousClone=this._stack.pop(),this._previousClone.clone}},Gye={equals:Object.is,isShallow:!1,pathAsArray:!1,ignoreSymbols:!1,ignoreUnderscores:!1,ignoreDetached:!1,details:!1},yN=(t,i,r={})=>{r={...Gye,...r};let n=Symbol("ProxyTarget"),{equals:a,isShallow:s,ignoreDetached:o,details:l}=r,c=new Dye(a),h=typeof r.onValidate=="function",u=new eg(h),d=(_,y,w,b,E)=>!h||u.isCloning||r.onValidate(Xo.concat(c.getPath(_),y),w,b,E)===!0,A=(_,y,w,b)=>{!YG(c,r,y)&&!(o&&c.isDetached(_,t))&&f(c.getPath(_),y,w,b)},f=(_,y,w,b,E)=>{u.isCloning?u.update(_,y,b):i(Xo.concat(_,y),w,b,E)},m=_=>_&&(_[n]||_),g=(_,y,w,b)=>xye(_)||w==="constructor"||s&&!eg.isHandledMethod(y,w)||YG(c,r,w)||c.isGetInvariant(y,w)||o&&c.isDetached(y,t)?_:(b===void 0&&(b=c.getPath(y)),c.getProxy(_,Xo.concat(b,w),p,n)),p={get(_,y,w){if(_N(y)){if(y===n||y===vN)return _;if(y===sY&&!c.isUnsubscribed&&c.getPath(_).length===0)return c.unsubscribe(),_}let b=mP(_)?Reflect.get(_,y):Reflect.get(_,y,w);return g(b,_,y)},set(_,y,w,b){w=m(w);let E=_[n]||_,M=E[y];if(a(M,w)&&y in _)return!0;let S=d(_,y,w,M);return S&&c.setProperty(E,y,w,b,M)?(A(_,y,_[y],M),!0):!S},defineProperty(_,y,w){if(!c.isSameDescriptor(w,_,y)){let b=_[y];d(_,y,w.value,b)&&c.defineProperty(_,y,w,b)&&A(_,y,w.value,b)}return!0},deleteProperty(_,y){if(!Reflect.has(_,y))return!0;let w=Reflect.get(_,y),b=d(_,y,void 0,w);return b&&c.deleteProperty(_,y,w)?(A(_,y,void 0,w),!0):!b},apply(_,y,w){let b=y[n]||y;if(c.isUnsubscribed)return Reflect.apply(_,b,w);if((l===!1||l!==!0&&!l.includes(_.name))&&eg.isHandledType(b)){let E=Xo.initial(c.getPath(_)),M=eg.isHandledMethod(b,_.name);u.start(b,E,w);let S=Reflect.apply(_,u.preferredThisArg(_,y,b),M?w.map(x=>m(x)):w),T=u.isChanged(b,a),C=u.stop();if(eg.isHandledType(S)&&M&&(y instanceof Map&&_.name==="get"&&(E=Xo.concat(E,w[0])),S=c.getProxy(S,E,p)),T){let x={name:_.n
7715ame,args:w,result:S},R=u.isCloning?Xo.initial(E):E,L=u.isCloning?Xo.last(E):"";d(Xo.get(t,R),L,b,C,x)?f(R,L,b,C,x):u.undo(b)}return(y instanceof Map||y instanceof Set)&&Bye(S)?Iye(S,_,y,E,g):S}return Reflect.apply(_,y,w)}},v=c.getProxy(t,r.pathAsArray?[]:"",p);return i=i.bind(v),h&&(r.onValidate=r.onValidate.bind(v)),v};yN.target=t=>t&&t[vN]||t;yN.unsubscribe=t=>t[sY]||t;var ZG=yN,zye=typeof global=="object"&&global&&global.Object===Object&&global,AY=zye,Qye=typeof self=="object"&&self&&self.Object===Object&&self,Vye=AY||Qye||Function("return this")(),Ec=Vye,Wye=Ec.Symbol,bl=Wye,fY=Object.prototype,jye=fY.hasOwnProperty,Yye=fY.toString,Nv=bl?bl.toStringTag:void 0;function Kye(t){var i=jye.call(t,Nv),r=t[Nv];try{t[Nv]=void 0;var n=!0}catch{}var a=Yye.call(t);return n&&(i?t[Nv]=r:delete t[Nv]),a}var Xye=Kye,qye=Object.prototype,Zye=qye.toString;function Jye(t){return Zye.call(t)}var $ye=Jye,eEe="[object Null]",tEe="[object Undefined]",JG=bl?bl.toStringTag:void 0;function iEe(t){return t==null?t===void 0?tEe:eEe:JG&&JG in Object(t)?Xye(t):$ye(t)}var Ip=iEe;function rEe(t){return t!=null&&typeof t=="object"}var Qu=rEe,nEe="[object Symbol]";function aEe(t){return typeof t=="symbol"||Qu(t)&&Ip(t)==nEe}var ME=aEe;function sEe(t,i){for(var r=-1,n=t==null?0:t.length,a=Array(n);++r<n;)a[r]=i(t[r],r,t);return a}var pY=sEe,oEe=Array.isArray,ph=oEe,lEe=1/0,$G=bl?bl.prototype:void 0,ez=$G?$G.toString:void 0;function mY(t){if(typeof t=="string")return t;if(ph(t))return pY(t,mY)+"";if(ME(t))return ez?ez.call(t):"";var i=t+"";return i=="0"&&1/t==-lEe?"-0":i}var cEe=mY,hEe=/\s/;function uEe(t){for(var i=t.length;i--&&hEe.test(t.charAt(i)););return i}var dEe=uEe,AEe=/^\s+/;function fEe(t){return t&&t.slice(0,dEe(t)+1).replace(AEe,"")}var pEe=fEe;function mEe(t){var i=typeof t;return t!=null&&(i=="object"||i=="function")}var vc=mEe,tz=0/0,gEe=/^[-+]0x[0-9a-f]+$/i,vEe=/^0b[01]+$/i,_Ee=/^0o[0-7]+$/i,yEe=parseInt;function EEe(t){if(typeof t=="number")return t;if(ME(t))return tz;if(vc(t)){var i=typeof t.valueOf=="function"?t.valueOf():t;t=vc(i)?i+"":i}if(typeof t!="string")return t===0?t:+t;t=pEe(t);var r=vEe.test(t);return r||_Ee.test(t)?yEe(t.slice(2),r?2:8):gEe.test(t)?tz:+t}var iz=EEe;function wEe(t){return t}var gY=wEe,bEe="[object AsyncFunction]",SEe="[object Function]",CEe="[object GeneratorFunction]",TEe="[object Proxy]";function MEe(t){if(!vc(t))return!1;var i=Ip(t);return i==SEe||i==CEe||i==bEe||i==TEe}var vY=MEe,xEe=Ec["__core-js_shared__"],aI=xEe,rz=function(){var t=/[^.]+$/.exec(aI&&aI.keys&&aI.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function REe(t){return!!rz&&rz in t}var BEe=REe,IEe=Function.prototype,DEe=IEe.toString;function PEe(t){if(t!=null){try{return DEe.call(t)}catch{}try{return t+""}catch{}}return""}var Dp=PEe,LEe=/[\\^$.*+?()[\]{}|]/g,OEe=/^\[object .+?Constructor\]$/,NEe=Function.prototype,UEe=Object.prototype,FEe=NEe.toString,kEe=UEe.hasOwnProperty,HEe=RegExp("^"+FEe.call(kEe).replace(LEe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function GEe(t){if(!vc(t)||BEe(t))return!1;var i=vY(t)?HEe:OEe;return i.test(Dp(t))}var zEe=GEe;function QEe(t,i){return t==null?void 0:t[i]}var VEe=QEe;function WEe(t,i){var r=VEe(t,i);return zEe(r)?r:void 0}var Pp=WEe,jEe=Pp(Ec,"WeakMap"),vP=jEe,nz=Object.create,YEe=function(){function t(){}return function(i){if(!vc(i))return{};if(nz)return nz(i);t.prototype=i;var r=new t;return t.prototype=void 0,r}}(),KEe=YEe;function XEe(t,i,r){switch(r.length){case 0:return t.call(i);case 1:return t.call(i,r[0]);case 2:return t.call(i,r[0],r[1]);case 3:return t.call(i,r[0],r[1],r[2])}return t.apply(i,r)}var qEe=XEe;function ZEe(t,i){var r=-1,n=t.length;for(i||(i=Array(n));++r<n;)i[r]=t[r];return i}var JEe=ZEe,$Ee=800,e1e=16,t1e=Date.now;function i1e(t){var i=0,r=0;return function(){var n=t1e(),a=e1e-(n-r);if(r=n,a>0){if(++i>=$Ee)return arguments[0]}else i=0;return t.apply(void 0,arguments)}}var r1e=i1e;function n1e(t){return function(){return t}}var a1e=n1e,s1e=function(){try{var t=Pp(Object,"defineProperty");return t({},"",{}),t}catch{}}(),OC=s1e,o1e=OC?function(t,i){return OC(t,"toString",{configurable:!0,enumerable:!1,value:a1e(i),writable:!0})}:gY,l1e=o1e,c1e=r1e(l1e),h1e=c1e;function u1e(t,i){for(var r=-1,n=t==null?0:t.length;++r<n&&i(t[r],r,t)!==!1;);return t}var d1e=u1e,A1e=9007199254740991,f1e=/^(?:0|[1-9]\d*)$/;function p1e(t,i){var r=typeof t;return i=i??A1e,!!i&&(r=="number"||r!="symbol"&&f1e.test(t))&&t>-1&&t%1==0&&t<i}var EN=p1e;function m1e(t,i,r){i=="__proto__"&&OC?OC(t,i,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[i]=r}var _Y=m1e;function g1e(t,i){return t===i||t!==t&&i!==i}var wN=g1e,v1e=Object.prototype,_1e=v1e.hasOwnProperty;function y1e(t,i,r){var n=t[i];(!(_1e.call(t,i)&&wN(n,r))||r===void 0&&!(i in t))&&_Y(t,i,r)}var bN=y1e;function E1e(t,i,r,n){var a=!r;r||(r={});for(var s=-1,o=i.length;++s<o;){var l=i[s],c=n?n(r[l],t[l],l,r,t):void 0;c===void 0&&(c=t[l]),a?_Y(r,l,c):bN(r,l,c)}return r}var xE=E1e,az=Math.max;function w1e(t,i,r){return i=az(i===void 0?t.length-1:i,0),function(){for(var n=arguments,a=-1,s=az(n.length-i,0),o=Array(s);++a<s;)o[a]=n[i+a];a=-1;for(var l=Array(i+1);++a<i;)l[a]=n[a];return l[i]=r(o),qEe(t,this,l)}}var b1e=w1e,S1e=9007199254740991;function C1e(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=S1e}var SN=C1e;function T1e(t){return t!=null&&SN(t.length)&&!vY(t)}var yY=T1e,M1e=Object.prototype;function x1e(t){var i=t&&t.constructor,r=typeof i=="function"&&i.prototype||M1e;return t===r}var CN=x1e;function R1e(t,i){for(var r=-1,n=Array(t);++r<t;)n[r]=i(r);return n}var B1e=R1e,I1e="[object Arguments]";function D1e(t){return Qu(t)&&Ip(t)==I1e}var sz=D1e,EY=Object.prototype,P1e=EY.hasOwnProperty,L1e=EY.propertyIsEnumerable,O1e=sz(function(){return arguments}())?sz:function(t){return Qu(t)&&P1e.call(t,"callee")&&!L1e.call(t,"callee")},TN=O1e;function N1e(){return!1}var U1e=N1e,wY=typeof exports=="object"&&exports&&!exports.nodeType&&exports,oz=wY&&typeof module=="object"&&module&&!module.nodeType&&module,F1e=oz&&oz.exports===wY,lz=F1e?Ec.Buffer:void 0,k1e=lz?lz.isBuffer:void 0,H1e=k1e||U1e,NC=H1e,G1e="[object Arguments]",z1e="[object Array]",Q1e="[object Boolean]",V1e="[object Date]",W1e="[object Error]",j1e="[object Function]",Y1e="[object Map]",K1e="[object Number]",X1e="[object Object]",q1e="[object RegExp]",Z1e="[object Set]",J1e="[object String]",$1e="[object WeakMap]",ewe="[object ArrayBuffer]",twe="[object DataView]",iwe="[object Float32Array]",rwe="[object Float64Array
7715]",nwe="[object Int8Array]",awe="[object Int16Array]",swe="[object Int32Array]",owe="[object Uint8Array]",lwe="[object Uint8ClampedArray]",cwe="[object Uint16Array]",hwe="[object Uint32Array]",Fr={};Fr[iwe]=Fr[rwe]=Fr[nwe]=Fr[awe]=Fr[swe]=Fr[owe]=Fr[lwe]=Fr[cwe]=Fr[hwe]=!0;Fr[G1e]=Fr[z1e]=Fr[ewe]=Fr[Q1e]=Fr[twe]=Fr[V1e]=Fr[W1e]=Fr[j1e]=Fr[Y1e]=Fr[K1e]=Fr[X1e]=Fr[q1e]=Fr[Z1e]=Fr[J1e]=Fr[$1e]=!1;function uwe(t){return Qu(t)&&SN(t.length)&&!!Fr[Ip(t)]}var dwe=uwe;function Awe(t){return function(i){return t(i)}}var MN=Awe,bY=typeof exports=="object"&&exports&&!exports.nodeType&&exports,X_=bY&&typeof module=="object"&&module&&!module.nodeType&&module,fwe=X_&&X_.exports===bY,sI=fwe&&AY.process,pwe=function(){try{var t=X_&&X_.require&&X_.require("util").types;return t||sI&&sI.binding&&sI.binding("util")}catch{}}(),l0=pwe,cz=l0&&l0.isTypedArray,mwe=cz?MN(cz):dwe,SY=mwe,gwe=Object.prototype,vwe=gwe.hasOwnProperty;function _we(t,i){var r=ph(t),n=!r&&TN(t),a=!r&&!n&&NC(t),s=!r&&!n&&!a&&SY(t),o=r||n||a||s,l=o?B1e(t.length,String):[],c=l.length;for(var h in t)(i||vwe.call(t,h))&&!(o&&(h=="length"||a&&(h=="offset"||h=="parent")||s&&(h=="buffer"||h=="byteLength"||h=="byteOffset")||EN(h,c)))&&l.push(h);return l}var CY=_we;function ywe(t,i){return function(r){return t(i(r))}}var TY=ywe,Ewe=TY(Object.keys,Object),wwe=Ewe,bwe=Object.prototype,Swe=bwe.hasOwnProperty;function Cwe(t){if(!CN(t))return wwe(t);var i=[];for(var r in Object(t))Swe.call(t,r)&&r!="constructor"&&i.push(r);return i}var Twe=Cwe;function Mwe(t){return yY(t)?CY(t):Twe(t)}var xN=Mwe;function xwe(t){var i=[];if(t!=null)for(var r in Object(t))i.push(r);return i}var Rwe=xwe,Bwe=Object.prototype,Iwe=Bwe.hasOwnProperty;function Dwe(t){if(!vc(t))return Rwe(t);var i=CN(t),r=[];for(var n in t)n=="constructor"&&(i||!Iwe.call(t,n))||r.push(n);return r}var Pwe=Dwe;function Lwe(t){return yY(t)?CY(t,!0):Pwe(t)}var Rf=Lwe,Owe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nwe=/^\w*$/;function Uwe(t,i){if(ph(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||ME(t)?!0:Nwe.test(t)||!Owe.test(t)||i!=null&&t in Object(i)}var Fwe=Uwe,kwe=Pp(Object,"create"),Dy=kwe;function Hwe(){this.__data__=Dy?Dy(null):{},this.size=0}var Gwe=Hwe;function zwe(t){var i=this.has(t)&&delete this.__data__[t];return this.size-=i?1:0,i}var Qwe=zwe,Vwe="__lodash_hash_undefined__",Wwe=Object.prototype,jwe=Wwe.hasOwnProperty;function Ywe(t){var i=this.__data__;if(Dy){var r=i[t];return r===Vwe?void 0:r}return jwe.call(i,t)?i[t]:void 0}var Kwe=Ywe,Xwe=Object.prototype,qwe=Xwe.hasOwnProperty;function Zwe(t){var i=this.__data__;return Dy?i[t]!==void 0:qwe.call(i,t)}var Jwe=Zwe,$we="__lodash_hash_undefined__";function ebe(t,i){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Dy&&i===void 0?$we:i,this}var tbe=ebe;function k0(t){var i=-1,r=t==null?0:t.length;for(this.clear();++i<r;){var n=t[i];this.set(n[0],n[1])}}k0.prototype.clear=Gwe;k0.prototype.delete=Qwe;k0.prototype.get=Kwe;k0.prototype.has=Jwe;k0.prototype.set=tbe;var hz=k0;function ibe(){this.__data__=[],this.size=0}var rbe=ibe;function nbe(t,i){for(var r=t.length;r--;)if(wN(t[r][0],i))return r;return-1}var dM=nbe,abe=Array.prototype,sbe=abe.splice;function obe(t){var i=this.__data__,r=dM(i,t);if(r<0)return!1;var n=i.length-1;return r==n?i.pop():sbe.call(i,r,1),--this.size,!0}var lbe=obe;function cbe(t){var i=this.__data__,r=dM(i,t);return r<0?void 0:i[r][1]}var hbe=cbe;function ube(t){return dM(this.__data__,t)>-1}var dbe=ube;function Abe(t,i){var r=this.__data__,n=dM(r,t);return n<0?(++this.size,r.push([t,i])):r[n][1]=i,this}var fbe=Abe;function H0(t){var i=-1,r=t==null?0:t.length;for(this.clear();++i<r;){var n=t[i];this.set(n[0],n[1])}}H0.prototype.clear=rbe;H0.prototype.delete=lbe;H0.prototype.get=hbe;H0.prototype.has=dbe;H0.prototype.set=fbe;var AM=H0,pbe=Pp(Ec,"Map"),Py=pbe;function mbe(){this.size=0,this.__data__={hash:new hz,map:new(Py||AM),string:new hz}}var gbe=mbe;function vbe(t){var i=typeof t;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?t!=="__proto__":t===null}var _be=vbe;function ybe(t,i){var r=t.__data__;return _be(i)?r[typeof i=="string"?"string":"hash"]:r.map}var fM=ybe;function Ebe(t){var i=fM(this,t).delete(t);return this.size-=i?1:0,i}var wbe=Ebe;function bbe(t){return fM(this,t).get(t)}var Sbe=bbe;function Cbe(t){return fM(this,t).has(t)}var Tbe=Cbe;function Mbe(t,i){var r=fM(this,t),n=r.size;return r.set(t,i),this.size+=r.size==n?0:1,this}var xbe=Mbe;function G0(t){var i=-1,r=t==null?0:t.length;for(this.clear();++i<r;){var n=t[i];this.set(n[0],n[1])}}G0.prototype.clear=gbe;G0.prototype.delete=wbe;G0.prototype.get=Sbe;G0.prototype.has=Tbe;G0.prototype.set=xbe;var pM=G0,Rbe="Expected a function";function RN(t,i){if(typeof t!="function"||i!=null&&typeof i!="function")throw new TypeError(Rbe);var r=function(){var n=arguments,a=i?i.apply(this,n):n[0],s=r.cache;if(s.has(a))return s.get(a);
7715var o=t.apply(this,n);return r.cache=s.set(a,o)||s,o};return r.cache=new(RN.Cache||pM),r}RN.Cache=pM;var Bbe=RN,Ibe=500;function Dbe(t){var i=Bbe(t,function(n){return r.size===Ibe&&r.clear(),n}),r=i.cache;return i}var Pbe=Dbe,Lbe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Obe=/\\(\\)?/g,Nbe=Pbe(function(t){var i=[];return t.charCodeAt(0)===46&&i.push(""),t.replace(Lbe,function(r,n,a,s){i.push(a?s.replace(Obe,"$1"):n||r)}),i}),Ube=Nbe;function Fbe(t){return t==null?"":cEe(t)}var kbe=Fbe;function Hbe(t,i){return ph(t)?t:Fwe(t,i)?[t]:Ube(kbe(t))}var z0=Hbe,Gbe=1/0;function zbe(t){if(typeof t=="string"||ME(t))return t;var i=t+"";return i=="0"&&1/t==-Gbe?"-0":i}var mM=zbe;function Qbe(t,i){i=z0(i,t);for(var r=0,n=i.length;t!=null&&r<n;)t=t[mM(i[r++])];return r&&r==n?t:void 0}var MY=Qbe;function Vbe(t,i){for(var r=-1,n=i.length,a=t.length;++r<n;)t[a+r]=i[r];return t}var BN=Vbe,uz=bl?bl.isConcatSpreadable:void 0;function Wbe(t){return ph(t)||TN(t)||!!(uz&&t&&t[uz])}var jbe=Wbe;function xY(t,i,r,n,a){var s=-1,o=t.length;for(r||(r=jbe),a||(a=[]);++s<o;){var l=t[s];i>0&&r(l)?i>1?xY(l,i-1,r,n,a):BN(a,l):n||(a[a.length]=l)}return a}var Ybe=xY;function Kbe(t){var i=t==null?0:t.length;return i?Ybe(t,1):[]}var Xbe=Kbe;function qbe(t){return h1e(b1e(t,void 0,Xbe),t+"")}var RY=qbe,Zbe=TY(Object.getPrototypeOf,Object),IN=Zbe,Jbe="[object Object]",$be=Function.prototype,eSe=Object.prototype,BY=$be.toString,tSe=eSe.hasOwnProperty,iSe=BY.call(Object);function rSe(t){if(!Qu(t)||Ip(t)!=Jbe)return!1;var i=IN(t);if(i===null)return!0;var r=tSe.call(i,"constructor")&&i.constructor;return typeof r=="function"&&r instanceof r&&BY.call(r)==iSe}var nSe=rSe;function aSe(t,i,r){var n=-1,a=t.length;i<0&&(i=-i>a?0:a+i),r=r>a?a:r,r<0&&(r+=a),a=i>r?0:r-i>>>0,i>>>=0;for(var s=Array(a);++n<a;)s[n]=t[n+i];return s}var sSe=aSe;function oSe(){this.__data__=new AM,this.size=0}var lSe=oSe;function cSe(t){var i=this.__data__,r=i.delete(t);return this.size=i.size,r}var hSe=cSe;function uSe(t){return this.__data__.get(t)}var dSe=uSe;function ASe(t){return this.__data__.has(t)}var fSe=ASe,pSe=200;function mSe(t,i){var r=this.__data__;if(r instanceof AM){var n=r.__data__;if(!Py||n.length<pSe-1)return n.push([t,i]),this.size=++r.size,this;r=this.__data__=new pM(n)}return r.set(t,i),this.size=r.size,this}var gSe=mSe;function Q0(t){var i=this.__data__=new AM(t);this.size=i.size}Q0.prototype.clear=lSe;Q0.prototype.delete=hSe;Q0.prototype.get=dSe;Q0.prototype.has=fSe;Q0.prototype.set=gSe;var MS=Q0;function vSe(t,i){return t&&xE(i,xN(i),t)}var _Se=vSe;function ySe(t,i){return t&&xE(i,Rf(i),t)}var ESe=ySe,IY=typeof exports=="object"&&exports&&!exports.nodeType&&exports,dz=IY&&typeof module=="object"&&module&&!module.nodeType&&module,wSe=dz&&dz.exports===IY,Az=wSe?Ec.Buffer:void 0,fz=Az?Az.allocUnsafe:void 0;function bSe(t,i){if(i)return t.slice();var r=t.length,n=fz?fz(r):new t.constructor(r);return t.copy(n),n}var SSe=bSe;function CSe(t,i){for(var r=-1,n=t==null?0:t.length,a=0,s=[];++r<n;){var o=t[r];i(o,r,t)&&(s[a++]=o)}return s}var TSe=CSe;function MSe(){return[]}var DY=MSe,xSe=Object.prototype,RSe=xSe.propertyIsEnumerable,pz=Object.getOwnPropertySymbols,BSe=pz?function(t){return t==null?[]:(t=Object(t),TSe(pz(t),function(i){return RSe.call(t,i)}))}:DY,DN=BSe;function ISe(t,i){return xE(t,DN(t),i)}var DSe=ISe,PSe=Object.getOwnPropertySymbols,LSe=PSe?function(t){for(var i=[];t;)BN(i,DN(t)),t=IN(t);return i}:DY,PY=LSe;function OSe(t,i){return xE(t,PY(t),i)}var NSe=OSe;function USe(t,i,r){var n=i(t);return ph(t)?n:BN(n,r(t))}var LY=USe;function FSe(t){return LY(t,xN,DN)}var _P=FSe;function kSe(t){return LY(t,Rf,PY)}var OY=kSe,HSe=Pp(Ec,"DataView"),yP=HSe,GSe=Pp(Ec,"Promise"),EP=GSe,zSe=Pp(Ec,"Set"),wP=zSe,mz="[object Map]",QSe="[object Object]",gz="[object Promise]",vz="[object Set]",_z="[object WeakMap]",yz="[object DataView]",VSe=Dp(yP),WSe=Dp(Py),jSe=Dp(EP),YSe=Dp(wP),KSe=Dp(vP),mf=Ip;(yP&&mf(new yP(new ArrayBuffer(1)))!=yz||Py&&mf(new Py)!=mz||EP&&mf(EP.resolve())!=gz||wP&&mf(new wP)!=vz||vP&&mf(new vP)!=_z)&&(mf=function(t){var i=Ip(t),r=i==QSe?t.constructor:void 0,n=r?Dp(r):"";if(n)switch(n){case VSe:return yz;case WSe:return mz;case jSe:return gz;case YSe:return vz;case KSe:return _z}return i});var Ly=mf,XSe=Object.prototype,qSe=XSe.hasOwnProperty;function ZSe(t){var i=t.length,r=new t.constructor(i);return i&&typeof t[0]=="string"&&qSe.call(t,"index")&&(r.index=t.index,r.input
vendor: 6,491 bytes, line 7715
7715=t.input),r}var JSe=ZSe,$Se=Ec.Uint8Array,UC=$Se;function eCe(t){var i=new t.constructor(t.byteLength);return new UC(i).set(new UC(t)),i}var PN=eCe;function tCe(t,i){var r=i?PN(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var iCe=tCe,rCe=/\w*$/;function nCe(t){var i=new t.constructor(t.source,rCe.exec(t));return i.lastIndex=t.lastIndex,i}var aCe=nCe,Ez=bl?bl.prototype:void 0,wz=Ez?Ez.valueOf:void 0;function sCe(t){return wz?Object(wz.call(t)):{}}var oCe=sCe;function lCe(t,i){var r=i?PN(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var cCe=lCe,hCe="[object Boolean]",uCe="[object Date]",dCe="[object Map]",ACe="[object Number]",fCe="[object RegExp]",pCe="[object Set]",mCe="[object String]",gCe="[object Symbol]",vCe="[object ArrayBuffer]",_Ce="[object DataView]",yCe="[object Float32Array]",ECe="[object Float64Array]",wCe="[object Int8Array]",bCe="[object Int16Array]",SCe="[object Int32Array]",CCe="[object Uint8Array]",TCe="[object Uint8ClampedArray]",MCe="[object Uint16Array]",xCe="[object Uint32Array]";function RCe(t,i,r){var n=t.constructor;switch(i){case vCe:return PN(t);case hCe:case uCe:return new n(+t);case _Ce:return iCe(t,r);case yCe:case ECe:case wCe:case bCe:case SCe:case CCe:case TCe:case MCe:case xCe:return cCe(t,r);case dCe:return new n;case ACe:case mCe:return new n(t);case fCe:return aCe(t);case pCe:return new n;case gCe:return oCe(t)}}var BCe=RCe;function ICe(t){return typeof t.constructor=="function"&&!CN(t)?KEe(IN(t)):{}}var DCe=ICe,PCe="[object Map]";function LCe(t){return Qu(t)&&Ly(t)==PCe}var OCe=LCe,bz=l0&&l0.isMap,NCe=bz?MN(bz):OCe,UCe=NCe,FCe="[object Set]";function kCe(t){return Qu(t)&&Ly(t)==FCe}var HCe=kCe,Sz=l0&&l0.isSet,GCe=Sz?MN(Sz):HCe,zCe=GCe,QCe=1,VCe=2,WCe=4,NY="[object Arguments]",jCe="[object Array]",YCe="[object Boolean]",KCe="[object Date]",XCe="[object Error]",UY="[object Function]",qCe="[object GeneratorFunction]",ZCe="[object Map]",JCe="[object Number]",FY="[object Object]",$Ce="[object RegExp]",eTe="[object Set]",tTe="[object String]",iTe="[object Symbol]",rTe="[object WeakMap]",nTe="[object ArrayBuffer]",aTe="[object DataView]",sTe="[object Float32Array]",oTe="[object Float64Array]",lTe="[object Int8Array]",cTe="[object Int16Array]",hTe="[object Int32Array]",uTe="[object Uint8Array]",dTe="[object Uint8ClampedArray]",ATe="[object Uint16Array]",fTe="[object Uint32Array]",Dr={};Dr[NY]=Dr[jCe]=Dr[nTe]=Dr[aTe]=Dr[YCe]=Dr[KCe]=Dr[sTe]=Dr[oTe]=Dr[lTe]=Dr[cTe]=Dr[hTe]=Dr[ZCe]=Dr[JCe]=Dr[FY]=Dr[$Ce]=Dr[eTe]=Dr[tTe]=Dr[iTe]=Dr[uTe]=Dr[dTe]=Dr[ATe]=Dr[fTe]=!0;Dr[XCe]=Dr[UY]=Dr[rTe]=!1;function xS(t,i,r,n,a,s){var o,l=i&QCe,c=i&VCe,h=i&WCe;if(r&&(o=a?r(t,n,a,s):r(t)),o!==void 0)return o;if(!vc(t))return t;var u=ph(t);if(u){if(o=JSe(t),!l)return JEe(t,o)}else{var d=Ly(t),A=d==UY||d==qCe;if(NC(t))return SSe(t,l);if(d==FY||d==NY||A&&!a){if(o=c||A?{}:DCe(t),!l)return c?NSe(t,ESe(o,t)):DSe(t,_Se(o,t))}else{if(!Dr[d])return a?t:{};o=BCe(t,d,l)}}s||(s=new MS);var f=s.get(t);if(f)return f;s.set(t,o),zCe(t)?t.forEach(function(p){o.add(xS(p,i,r,p,t,s))}):UCe(t)&&t.forEach(function(p,v){o.set(v,xS(p,i,r,v,t,s))});var m=h?c?OY:_P:c?Rf:xN,g=u?void 0:m(t);return d1e(g||t,function(p,v){g&&(v=p,p=t[v]),bN(o,v,xS(p,i,r,v,t,s))}),o}var kY=xS,pTe=1,mTe=4;function gTe(t){return kY(t,pTe|mTe)}var gM=gTe,vTe="__lodash_hash_undefined__";function _Te(t){return this.__data__.set(t,vTe),this}var yTe=_Te;function ETe(t){return this.__data__.has(t)}var wTe=ETe;function FC(t){var i=-1,r=t==null?0:t.length;for(this.__data__=new pM;++i<r;)this.add(t[i])}FC.prototype.add=FC.prototype.push=yTe;FC.prototype.has=wTe;var bTe=FC;function STe(t,i){for(var r=-1,n=t==null?0:t.length;++r<n;)if(i(t[r],r,t))return!0;return!1}var CTe=STe;function TTe(t,i){return t.has(i)}var MTe=TTe,xTe=1,RTe=2;function BTe(t,i,r,n,a,s){var o=r&xTe,l=t.length,c=i.length;if(l!=c&&!(o&&c>l))return!1;var h=s.get(t),u=s.get(i);if(h&&u)return h==i&&u==t;var d=-1,A=!0,f=r&RTe?new bTe:void 0;for(s.set(t,i),s.set(i,t);++d<l;){var m=t[d],g=i[d];if(n)var p=o?n(g,m,d,i,t,s):n(m,g,d,t,i,s);if(p!==void 0){if(p)continue;A=!1;break}if(f){if(!CTe(i,function(v,_){if(!MTe(f,_)&&(m===v||a(m,v,r,n,s)))return f.push(_)})){A=!1;break}}else if(!(m===g||a(m,g,r,n,s))){A=!1;break}}return s.delete(t),s.delete(i),A}var HY=BTe;function ITe(t){var i=-1,r=Array(t.size);return t.forEach(function(n,a){r[++i]=[a,n]}),r}var DTe=ITe;function PTe(t){var i=-1,r=Array(t.size);return t.forEach(function(n){r[++i]=n}),r}var LTe=PTe,OTe=1,NTe=2,UTe="[object Boolean]",FTe="[object Date]",kTe="[object Error]",HTe="[object Map]",GTe="[object Number]",zTe="[object RegExp]",QTe="[object Set]",VTe="[object String]",WTe="[object Symbol]",jTe="[object ArrayBuffer]",YTe="[object DataView]",Cz=bl?bl.prototype:void 0,oI=Cz?Cz.valueOf:void 0;function KTe(t,i,r,n,a,s,o){switch(r){case YTe:if(t.byteLength!=i.byteLength||t.byteOffset!=i.byteOffset)return!1;t=t.buffer,i=i.buffer;case jTe:return!(t.byteLength!=i.byteLength||!s(new UC(t),new UC(i)));case UTe:case FTe:case GTe:return wN(+t,+i);case kTe:return t.name==i.name&&t.message==i.message;case zTe:case VTe:return t==i+"";case HTe:var l=DTe;case QTe:var c=n&OTe;if(l||(l=LTe),t.size!=i.size&&!c)return!1;var h=o.get(t);if(h)return h==i;n|=NTe,o.set(t,i);var u=HY(l(t),l(i),n,a,s,o);return o.delete(t),u;case WTe:if(oI)return oI.call(t)==oI.call(i)}return!1}var XTe=KTe,qTe=1,ZTe=Object.prototype,JTe=ZTe.hasOwnProperty;function $Te(t,i,r,n,a,s){var o=r&qTe,l=_P(t),c=l.length,h=_P(i),u=h.length;if(c!=u&&!o)return!1;for(var d=c;d--;){var A=l[d];if(!(o?A in i:JTe.call(i,A)))return!1}var f=s.get(t),m=s.get(i);if(f&&m)return f==i&&m==t;var g=!0;s.set(t,i),s.set(i,t);for(var p=o;++d<c;){A=l[d];var v=t[A],_=i[A];if(n)var y=o?n(_,v,A,i,t,s):n(v,_,A,t,i,s);if(!(y===void 0?v===_||a(v,_,r,n,s):y)){g=!1;break}p||(p=A=="constructor")}if(g&&!p){var w=t.constructor,b=i.constructor;w!=b&&"constructor"in t&&"constructor"in i&&!(typeof w=="function"&&w instanceof w&&typeof b=="function"&&b instanceof b)&&(g=!1)}return s.delete(t),s.delete(i),g}var eMe=$Te,tMe=1,Tz="[object Arguments]",Mz="[object Array]",hb="[object Object]",iMe=Object.prototype,xz=iMe.hasOwnProperty;function rMe(t,i,r,n,a,s){var o=ph(t),l=ph(i),c=o?Mz:Ly(t),h=l?Mz:Ly(i);c=c==Tz?hb:c,h=h==Tz?hb:h;var u=c==hb,d=h==hb,A=c==h;if(A&&NC(t)){if(!NC(i))return!1;o=!0,u=!1}if(A&&!u)return s||(s=new MS),o||SY(t)?HY(t,i,r,n,a,s):XTe(t,i,c,r,n,a,s);if(!(r&tMe)){var f=u&&xz.call(t,"__wrapped__"),m=d&&xz.call(i,"__wrapped__");
7715if(f||m){var g=f?t.value():t,p=m?i.value():i;return s||(s=new MS),a(g,p,r,n,s)}}return A?(s||(s=new MS),eMe(t,i,r,n,a,s)):!1}var nMe=rMe;function GY(t,i,r,n,a){return t===i?!0:t==null||i==null||!Qu(t)&&!Qu(i)?t!==t&&i!==i:nMe(t,i,r,n,GY,a)}var aMe=GY;function sMe(t,i){return t!=null&&i in Object(t)}var oMe=sMe;function lMe(t,i,r){i=z0(i,t);for(var n=-1,a=i.length,s=!1;++n<a;){var o=mM(i[n]);if(!(s=t!=null&&r(t,o)))break;t=t[o]}return s||++n!=a?s:(a=t==null?0:t.length,!!a&&SN(a)&&EN(o,a)&&(ph(t)||TN(t)))}var cMe=lMe;function hMe(t,i){return t!=null&&cMe(t,i,oMe)}var uMe=hMe,dMe=function(){return Ec.Date.now()},lI=dMe,AMe="Expected a function",fMe=Math.max,pMe=Math.min;function mMe(t,i,r){var n,a,s,o,l,c,h=0,u=!1,d=!1,A=!0;if(typeof t!="function")throw new TypeError(AMe);i=iz(i)||0,vc(r)&&(u=!!r.leading,d="maxWait"in r,s=d?fMe(iz(r.maxWait)||0,i):s,A="trailing"in r?!!r.trailing:A);function f(E){var M=n,S=a;return n=a=void 0,h=E,o=t.apply(S,M),o}function m(E){return h=E,l=setTimeout(v,i),u?f(E):o}function g(E){var M=E-c,S=E-h,T=i-M;return d?pMe(T,s-S):T}function p(E){var M=E-c,S=E-h;return c===void 0||M>=i||M<0||d&&S>=s}function v(){var E=lI();if(p(E))return _(E);l=setTimeout(v,g(E))}function _(E){return l=void 0,A&&n?f(E):(n=a=void 0,o)}function y(){l!==void 0&&clearTimeout(l),h=0,n=c=a=l=void 0}function w(){return l===void 0?o:_(lI())}function b(){var E=lI(),M=p(E);if(n=arguments,a=this,c=E,M){if(l===void 0)return m(c);if(d)return clearTimeout(l),l=setTimeout(v,i),f(c)}return l===void 0&&(l=setTimeout(v,i)),o}return b.cancel=y,b.flush=w,b}var LN=mMe;function gMe(t){var i=t==null?0:t.length;return i?t[i-1]:void 0}var vMe=gMe;function _Me(t,i){return t>i}var yMe=_Me;function EMe(t,i){return i.length<2?t:MY(t,sSe(i,0,-1))}var wMe=EMe;function bMe(t,i){return aMe(t,i)}var ON=bMe;function SMe(t,i,r){for(var n=-1,a=t.length;++n<a;){var s=t[n],o=i(s);if(o!=null&&(l===void 0?o===o&&!ME(o):r(o,l)))var l=o,c=s}return c}var CMe=SMe;function TMe(t){return t&&t.length?CMe(t,gY,yMe):void 0}var MMe=TMe;function xMe(t,i){return i=z0(i,t),t=wMe(t,i),t==null||delete t[mM(vMe(i))]}var RMe=xMe;function BMe(t){return nSe(t)?void 0:t}var IMe=BMe,DMe=1,PMe=2,LMe=4,OMe=RY(function(t,i){var r={};if(t==null)return r;var n=!1;i=pY(i,function(s){return s=z0(s,t),n||(n=s.length>1),s}),xE(t,OY(t),r),n&&(r=kY(r,DMe|PMe|LMe,IMe));for(var a=i.length;a--;)RMe(r,i[a]);return r}),bP=OMe;function NMe(t,i,r,n){if(!vc(t))return t;i=z0(i,t);for(var a=-1,s=i.length,o=s-1,l=t;l!=null&&++a<s;){var c=mM(i[a]),h=r;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(a!=o){var u=l[c];h=n?n(u,c,l):void 0,h===void 0&&(h=vc(u)?u:EN(i[a+1])?[]:{})}bN(l,c,h),l=l[c]}return t}var UMe=NMe;function FMe(t,i,r){for(var n=-1,a=i.length,s={};++n<a;){var o=i[n],l=MY(t,o);r(l,o)&&UMe(s,z0(o,t),l)}return s}var kMe=FMe;function HMe(t,i){return kMe(t,i,function(r,n){return uMe(t,n)})}var GMe=HMe,zMe=RY(function(t,i){return t==null?{}:GMe(t,i)}),Pu=zMe,QMe="Expected a function";function VMe(t,i,r){var n=!0,a=!0;if(typeof t!="function")throw new TypeError(QMe);return vc(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),LN(t,i,{leading:n,maxWait:i,trailing:a})}var WMe=VMe;function zY(t){for(let i of Object.keys(t))t[i]===void 0&&delete t[i];return t}function Sl(t,i){return Object.setPrototypeOf(t,i),t}var jMe=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().includes(" electron/"),YMe=()=>typeof window>"u"?!1:window.navigator.platform.toUpperCase().includes("MAC"),KMe=()=>typeof window>"u"?!1:/iPad|iPhone|iPod/.test(window.navigator.userAgent)||vM&&"ontouchend"in document,XMe=()=>typeof window>"u"?!1:window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,qMe=()=>typeof window>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0,ZMe=()=>{if(typeof window>"u")return!1;let t=navigator.userAgent,i=navigator.vendor;return/Safari/i.test(t)&&/Apple Computer/.test(i)},JMe=()=>{if(typeof window>"u")return null;let t=navigator.userAgent.match(/Version\/(\d+\.\d)/);return t&&t[1]},$Me=()=>{if(typeof window>"u")return;let t=new URLSearchParams(window.location.search).get("desktop-app-version");return t?(window.localStorage.setItem("desktop-app-version",t),t):window.localStorage.getItem("desktop-app-version")??"0.0.6"},QY=jMe();QY&&$Me();var vM=YMe(),RE=KMe(),exe=XMe(),Do=qMe(),Rz=ZMe(),txe=Number(JMe());function VY(t){return Array.isArray(t)?t:[t]}function WY(t,i){let r=0;for(;r<t.length&&r<i.length;){if(t[r]<i[r])return-1;if(t[r]>i[r])return 1;r+=1}return r!==i.length?-1:r!==t.length?1:0}function ub(t){return vM?t.metaKey:t.ctrlKey}function ixe(t){return t.wheelDeltaY===0||t.deltaY===0?vM&&t.shiftKey&&Math.abs(t.wheelDeltaX)>=120?!1:t.wheelDeltaX?t.wheelDeltaX===-3*t.deltaX||t.wheelDeltaX===-3*window.devicePixelRatio*t.deltaX:t.deltaMode===0:t.wheelDeltaY?t.wheelDeltaY===-3*t.deltaY||t.wheelDeltaY===-3*window.devicePixelRatio*t.deltaY:t.deltaMode===0}var jt=[],kC={},y_={},RS={};function jY(t){jt.includes(t)||jt.push(t)}function Ig(t){delete kC[t.pointerId];for(let i=0;i<jt.length;i++)if(jt[i].pointerId===t.pointerId){jt.splice(i,1);break}}function rxe(){jt.splice(0,jt.length)}function HC(t){if(t.pointerType!=="touch")return;let i=kC[t.pointerId];i===void 0&&(i={x:0,y:0},kC[t.pointerId]=i),i.x=t.pageX,i.y=t.pageY}function cI(t){let i=t.pointerId===jt[0].pointerId?jt[1]:jt[0];return kC[i.pointerId]}
7715function YY(t){y_[t.key]=!0,RS[t.key]=RS[t.key]===void 0?1:RS[t.key]+1}function KY(t){if(vM&&y_.Meta)for(let i in y_)y_[i]=!1;else y_[t.key]=!1;RS={}}function nxe(t){t.addEventListener("pointerdown",jY,!0),t.addEventListener("pointerdown",HC,!0),t.addEventListener("pointermove",HC,!0),t.addEventListener("pointerup",Ig,!0),t.addEventListener("pointercancel",Ig,!0),t.addEventListener("pointerleave",Ig,!0),window.addEventListener("keydown",YY,!0),window.addEventListener("keyup",KY,!0)}function axe(t){t.removeEventListener("pointerdown",jY,!0),t.removeEventListener("pointerdown",HC,!0),t.removeEventListener("pointermove",HC,!0),t.removeEventListener("pointerup",Ig,!0),t.removeEventListener("pointercancel",Ig,!0),t.removeEventListener("pointerleave",Ig,!0),window.removeEventListener("keydown",YY,!0),window.removeEventListener("keyup",KY,!0)}var XY,sxe=new Promise(t=>{XY=t}),db;function oxe(){if(db)return db;async function t(){let i="https://unpkg.com/@splinetool/[email protected]/build",r=VA(()=>import("./navmesh-0b92f809.js"),[],import.meta.url),[n,a]=await Promise.all([r,fetch(`${i}/navmesh.wasm`).then(l=>l.arrayBuffer())]),s=n.default,o=await s({wasmBinary:a});XY(o)}return db=t(),db}var qY,lxe=new Promise(t=>{qY=t}),Ab;function cxe(){if(Ab)return Ab;async function t(){let i=await VA(()=>import("./physics-dee4de67.js"),[],import.meta.url);await i.init(),qY(i)}return Ab=t(),Ab}var kt=class{modifyById(t,i){let r=this;if(r[t]===void 0)throw new Error("not expected");{let n={...r,[t]:i};return Object.setPrototypeOf(n,kt.prototype),n}}add(t,i){var r;return((r=this.runOp({type:1,id:t,data:i}))==null?void 0:r.data)??this}runOp(t){let i=this;if(t.type===1){let r=i[t.id],n;r===void 0?n={type:2,id:t.id}:n={type:1,id:t.id,data:r};let{id:a,data:s}=t,o={...i,[a]:s};return Object.setPrototypeOf(o,kt.prototype),{data:o,actual:t,reverse:n}}else if(t.type===2){let{id:r}=t,n=i[r];if(n===void 0)return null;{let a={...i};return Object.setPrototypeOf(a,kt.prototype),delete a[r],{data:a,actual:t,reverse:{type:1,id:r,data:n}}}}return null}};function NN(t){if(t.deepFreeze!==void 0){t.deepFreeze(t);return}let i=Object.getOwnPropertyNames(t);for(let r of i){let n=t[r];n&&typeof n=="object"&&NN(n)}return Object.freeze(t)}function hxe(t,i){let r=0;for(;r<t.length&&r<i.length;){if(t[r]<i[r])return-1;if(t[r]>i[r])return 1;r+=1}return r!==i.length?-1:r!==t.length?1:0}var ZY=class extends Error{};function hI(t){let i={...t};return Object.setPrototypeOf(i,Object.getPrototypeOf(t)),i}function tA(t,i,r){if(t===void 0?i===void 0?(t=0,i=10):t=i-10:i===void 0&&(i=t+10),t>i){let s=t;t=i,i=s}let n=[],a=1/(r+1);for(let s=0;s<r;s++){let o=t+(i-t)*(s+.75+Math.random()*.5)*a;n.push(o)}return n}function UN(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array}function uxe(){return typeof process<"u"}function JY(t,i){for(let r of t)i(r.id,r.data)!==!0&&JY(r.children,i)}function $Y(t,i){if(i(t.id,t.data)!==!0)for(let r of t.children)$Y(r,i)}var Va=class extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Va.prototype)}deepFreeze(){let t=0;for(;t<this.length;)NN(this[t]),t++}fillCaches0(t,i){this.objCaches.set(t.id,t),this.parentCaches.set(t.id,i);for(let r of t.children)this.fillCaches0(r,t.id)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,this.parentCaches=new Map;for(let t of this)this.fillCaches0(t,null)}}randomId(){this.fillCaches();let t=Array.from(this.objCaches.keys());if(t.length!==0)return t[Math.max(0,Math.floor(Math.random()*t.length)-1)]}nonExistOrDescendantOf(t,i){if(!this.has(t))return!0;for(;t;){let r=this.parent(t);if(r===i)return!0;t=r}return!1}rootAcestor(t){for(;t;){let i=this.parent(t);if(i)t=i;else return t}return t}isDescendantOf(t,i){for(;t;){let r=this.parent(t);if(r===i)return!0;t=r}return!1}data(t){var i;return(i=this.get(t))==null?void 0:i.data}has(t){return this.childrenOf(t)!==void 0}get(t){return this.fillCaches(),this.objCaches.get(t)}childrenOf(t){var i;return t===null?this:(i=this.get(t))==null?void 0:i.children}traverseFrom(t,i){if(t===null)this.traverse(i);else{let r=this.get(t);r&&$Y(r,i)}}traverse(t){JY(this,t)}totalSize(){return this.fillCaches(),this.objCaches.size}
vendor: 19,060 bytes, line 7715
7715parent(t){return this.fillCaches(),this.parentCaches.get(t)}childrenArray(t){return t===null?this:this.get(t).children}modifyById(t,i){if(this.get(t)===void 0)throw new Error("not expected");{let r=this.parent(t),n=this.childrenArray(r),a=n.findIndex(o=>o.id===t);if(a<0)throw new Error("not expected");let s=n[a];return n=[...n],n[a]={...s,data:i},this.modifyArrayBy(r,n)}}modifyArrayBy(t,i){let r=t,n=i;for(;r!==null;){let s=n,o=r;if(r=this.parent(r),r===void 0)throw new Error;n=this.childrenArray(r);let l=n.findIndex(c=>c.id===o);if(l<0)throw new Error;n=[...n],n[l]={...n[l],children:s}}Object.setPrototypeOf(n,Va.prototype);let a=n;return a.fillCaches(),a}runOp(t){switch(t.type){case 7:return this.addOp(t);case 8:return this.deleteOp(t);case 9:return this.moveOp(t)}return null}checkDuplicatedIdRec({id:t,children:i}){if(this.get(t)!==void 0)return!0;for(let r of i)if(this.checkDuplicatedIdRec(r))return!0;return!1}addOp(t){let{parent:i,fi:r,id:n,data:a,children:s}=t;if(i!==null&&this.get(i)===void 0||this.checkDuplicatedIdRec(t))return null;{let o=i,l=this.childrenArray(o),c={fi:r,id:n,data:a,children:s};return l=[...l,c],l.sort((h,u)=>h.fi-u.fi),t.localIndex=l.indexOf(c),{data:this.modifyArrayBy(o,l),actual:t,reverse:{type:8,id:n}}}}deleteOp(t){let{id:i}=t;if(this.get(i)===null)return null;{let r=this.parent(i);if(r===void 0)return null;let n=this.childrenArray(r),a=n.findIndex(o=>o.id===i);t.localIndex=a,n=[...n];let s=n.splice(a,1)[0];return{data:this.modifyArrayBy(r,n),actual:t,reverse:{type:7,...s,parent:r}}}}moveOp(t){let{parent:i,fi:r,id:n}=t;if(i!==null&&this.get(i)===void 0)return this.deleteOp({type:8,id:n});if(i!==null){let d=i;for(;d!==null;){if(d===void 0)throw new Error;if(d===n)throw new ZY("cyclic tree");d=this.parent(d)}}let a=this.parent(n);if(a===void 0)return null;let s=a,o=this.childrenArray(a),l=o.findIndex(d=>d.id===n);o=[...o];let c=o.splice(l,1)[0],h=this.modifyArrayBy(a,o);a=i,o=h.childrenArray(a);let u=c.fi;return c={...c,fi:r},o=[...o,c],o.sort((d,A)=>d.fi-A.fi),t.localIndex=o.indexOf(c),h=h.modifyArrayBy(a,o),{data:h,actual:t,reverse:{type:9,parent:s,fi:u,id:n}}}previous(t,i){if(i===null){let n=this.childrenArray(t);return n.length===0?null:n[n.length-1].id}let r=null;for(let n of this.childrenArray(t)){if(n.id===i)return r;r=n.id}return null}traverseSortNext(t){let i=this.parent(t);if(i!==void 0){let r=this.childrenArray(i),n=r.findIndex(a=>a.id===t)+1;if(n<r.length)return r[n].id;if(i)return this.traverseSortNext(i)}}sortNext(t){let i=this.childrenArray(t);return i.length>0?i[0].id:this.traverseSortNext(t)}traverseSortPrevious(t){let i=this.childrenArray(t);return i.length>0?this.traverseSortPrevious(i[i.length-1].id):t}sortPrevious(t){let i=this.parent(t);if(i!==void 0){let r=this.childrenArray(i),n=r.findIndex(a=>a.id===t)-1;return n>=0?this.traverseSortPrevious(r[n].id):i}}getAllSorted(t){let i=[];for(let r of t){let n=this.getWithSortKey(r.id);n!==void 0&&i.push({...r,...n})}i.sort((r,n)=>hxe(r.sortKey,n.sortKey));for(let r of i)delete r.sortKey;return i}getWithSortKey(t){var i=t;let r=[],n=this.get(i),a=n;if(n!==void 0){for(;i;)r.splice(0,0,n.fi),i=this.parent(i),i!==null&&(n=this.get(i));return{...a,sortKey:r}}}insertBeforeHelper(t,i,r){return this.insertAfterHelper(t,this.previous(t,i),r)}insertAfterHelper(t,i,r){let n=this.childrenArray(t);if(i===null){if(n.length===0)return tA(0,r,r);{let a=n[0].fi;return tA(a-r,a,r)}}else{let a=this.get(i);if(a===void 0||this.parent(i)!==t)throw new Error("illegal args");let s=n.find(o=>o.fi>a.fi);if(s===void 0){let o=n[n.length-1].fi;return tA(o,o+r,r)}else return tA(a.fi,s.fi,r)}}},GC;(t=>{function i(r,n){if(n.type!==0)return null;if(Array.isArray(r)){let a=n.props,s={},o=[...r],l=!1;if(a)for(let c of Object.keys(a)){let h=parseInt(c);if(isNaN(h))throw new Error("wrong index");s[c]=o[h],o[h]=a[c],l=!0}return l?{data:o,actual:n,reverse:{type:0,props:s}}:null}else{let a=n.props,s={},o={...r},l=!1;if(a)for(let c of Object.keys(a)){s[c]=o[c];let h=a[c];h===void 0?delete o[c]:o[c]=h,l=!0}return l?{data:o,actual:n,reverse:{type:0,props:s}}:null}}t.runOp=i})(GC||(GC={}));var Pt=class extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Pt.prototype)}deepFreeze(){let t=0;for(;t<this.length;)NN(this[t]),t++}fillCaches0(t){this.objCaches.set(t.id,t)}fillCaches(){if(this.objCaches===void 0){this.objCaches=new Map,Object.getOwnPropertyDescriptor(this,"objCaches").enumerable=!1;for(let t of this)this.fillCaches0(t)}}randomId(){this.fillCaches();let t=Array.from(this.objCaches.keys());if(t.length!==0)return t[Math.max(0,Math.floor(Math.random()*t.length)-1)]}data(t){var i;return(i=this.get(t))==null?void 0:i.data}get(t){return this.fillCaches(),this.objCaches.get(t)}modifyById(t,i){if(this.get(t)===void 0)throw new Error("not expected");{let r=this,n=r.findIndex(s=>s.id===t);if(n<0)throw new Error("not expected");let a=r[n];return r=[...r],r[n]={...a,data:i},this.modifyArrayBy(r)}}modifyArrayBy(t){Object.setPrototypeOf(t,Pt.prototype);let i=t;return uxe()||i.fillCaches(),i}runOp(t){switch(t.type){case 4:return this.addOp(t);case 5:return this.deleteOp(t);case 6:return this.moveOp(t)}return null}addOp(t){let{fi:i,id:r,data:n}=t,a=this,s={fi:i,id:r,data:n};return a=[...a,s],a.sort((o,l)=>o.fi-l.fi),t.localIndex=a.indexOf(s),{data:this.modifyArrayBy(a),actual:t,reverse:{type:5,id:r}}}deleteOp(t){let{id:i}=t,r=this,n=r.findIndex(s=>s.id===i);if(n===-1)return null;t.localIndex=n,r=[...r];let a=r.splice(n,1)[0];return{data:this.modifyArrayBy(r),actual:t,reverse:{type:4,...a}}}moveOp(t){let{fi:i,id:r}=t,n=this;n=[...n];let a=n.findIndex(l=>l.id===r);if(a===-1)return null;let s=n[a].fi,o={...n[a],fi:i};return n[a]=o,n.sort((l,c)=>l.fi-c.fi),t.localIndex=n.indexOf(o),{data:this.modifyArrayBy(n),actual:t,reverse:{type:6,fi:s,id:r}}}previous(t){if(t===null)return this.length===0?null:this[this.length-1].id;let i=null;for(let r of this){if(r.id===t)return i;i=r.id}return null}insertBeforeHelper(t,i){return this.insertAfterHelper(this.previous(t),i)}insertAfterHelper(t,i){let r=this;if(t===null){if(r.length===0)return tA(0,i,i);{let n=r[0].fi;return tA(n-i,n,i)}}else{let n=this.get(t);if(n===void 0)throw new Error("illegal args");let a=r.find(s=>s.fi>n.fi);if(a===void 0){let s=r[r.length-1].fi;return tA(s,s+i,i)}else return tA(n.fi,a.fi,i)}}};function c0(t){return t&&typeof t=="object"&&t instanceof Fn}var Fn=class{unusedFunOverridesTable(t){}runOp(t){let i=[],r=this,n=0,a={};for(;n<t.path.length;){if(i.push(r),r=r===void 0?void 0:r[t.path[n]],r!==void 0&&!c0(r))return null;n+=1}r=r?hI(r):new Fn;for(let[l,c]of Object.entries(t.props)){let h=r[l];a[l]=h,c===void 0?delete r[l]:r[l]=c}for(;n>0;){if(Object.keys(r).length===0){let l=i[n-1];l&&(r=hI(l),delete r[t.path[n-1]])}else{let l=i[n-1];if(l){let c=hI(l);c[t.path[n-1]]=r,r=c}else{let c=new Fn;c[t.path[n-1]]=r,r=c}}n-=1}let s=Object.setPrototypeOf(r,Fn.prototype),o={...t,props:a};return{data:s,actual:t,reverse:o}}},wA;(t=>{function i(a,s){return Oy(a,s)??a}t.apply=i;function r(a,s){return kN(a,s)}t.merge=r;function n(a,s){let o=0,l=s.path,c=a;for(;o<l.length&&c!==void 0;){if(c=Zn.zoomOnce(c,l[o]),c===void 0)return s;if(!c0(c))return;o+=1}if(c===void 0)return s;if(c0(c))if(s.type===0){let h={...s.props};for(let u of Object.keys(c))delete h[u];return{...s,props:h}}else if(s.type===1||s.type===4||s.type===7){let h=FN([s],c);return h?(console.log(h),h):s}else return s}t.filterOp=n})(wA||(wA={}));function FN(t,i){if(i===void 0)return;let r=!1,n=t.map(a=>{let s=a.id,o=Oy(a.data,i[s]);if(r=r||o!==void 0,o===void 0&&(o=a.data),a.children){let l=FN(a.children,i);return l!==void 0?r=!0:l=a.children,{...a,id:s,data:o,children:l}}else return{...a,id:s,data:o}});if(r)return n}function dxe(t,i){if(i===void 0)return;let r=!1,n=t.map(a=>{let s=a.id,o=Oy(a.data,i[s]);return r=r||o!==void 0,o===void 0&&(o=a.data),{...a,id:s,data:o}});if(r)return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}function Oy(t,i){if(!c0(i))return i;if(t instanceof Va){let r=FN(t,i);return r!==void 0&&Object.setPrototypeOf(r,Object.getPrototypeOf(t)),r}else{if(t instanceof Pt)return dxe(t,i);if(Array.isArray(t)){let r=!1,n=t.map((a,s)=>{let o=Oy(a,i[s]);return r=r||o!==void 0,o===void 0&&(o=a),o});return r?(Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n):void 0}else{if(t instanceof Fn)return kN(t,i);if(t&&typeof t=="object"){let r={},n=!1;for(let[a,s]of Object.entries(t)){let o=Oy(s,i[a]);n=n||o!==void 0,o===void 0&&(o=s),r[a]=o}return n?(Object.setPrototypeOf(r,Object.getPrototypeOf(t)),r):void 0}}}}function kN(t,i){if(t===void 0)return i;if(i===void 0)return t;if(!c0(i))return i;if(!c0(t))return wA.apply(t,i);let r=new Set;for(let a of Object.keys(t))r.add(a);for(let a of Object.keys(i))r.add(a);let n=new Fn;for(let a of r){let s=kN(t===void 0?void 0:t[a],i===void 0?void 0:i[a]);n[a]=s}return n}function Axe(t,i){let r={cur:[],result:[],len:0};return t=Ny(t,i,r)??t,[t,r.result]}function zC(t,i){return t===null?null:(t.cur[t.len]=i,t.len+=1,t)}function QC(t){t&&(t.len-=1)}function fxe(t){if(t===null)return null;t.result.push(t.cur.slice(0,t.len))}function eK(t,i,r){let n=!1,a=t.map(s=>{let o=s.id,l=i[o];if(l!==void 0&&typeof l=="string"&&(n=!0,o=l,r!==null))throw new Error("not supported");let c=Ny(s.data,i,zC(r,o));QC(r),n=n||c!==void 0,c===void 0&&(c=s.data);let h=eK(s.children,i,r);return h!==void 0?n=!0:h=s.children,{...s,id:o,data:c,children:h}});if(n)return a}function pxe(t,i,r){let n=!1,a=t.map(s=>{let o=s.id,l=i[o];if(l!==void 0&&typeof l=="string"&&(n=!0,o=l,r!==null))throw new Error("not supported");let c=Ny(s.data,i,zC(r,o));return QC(r),n=n||c!==void 0,c===void 0&&(c=s.data),{...s,id:o,data:c}});if(n)return Object.setPrototypeOf(a,Object.getPrototypeOf(t)),a}function Ny(t,i,r){if(t instanceof Va){let n=eK(t,i,r);return n!==void 0&&Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n}else{if(t instanceof Pt)return pxe(t,i,r);if(Array.isArray(t)){let n=!1,a=t.map((s,o)=>{let l=Ny(s,i,zC(r,o));return QC(r),n=n||l!==void 0,l===void 0&&(l=s),l});return n?(Object.setPrototypeOf(a,Object.getPrototypeOf(t)),a):void 0}else if(t&&typeof t=="object"&&!UN(t)){let n={},a=!1;for(let[s,o]of Object.entries(t))if(s!=="name"&&s!=="variableId"){let l=i[s];if(typeof l=="string"){if(r!==null)throw new Error("not supported");a=!0,s=l}let c=Ny(o,i,zC(r,s));QC(r),a=a||c!==void 0,c===void 0&&(c=o),n[s]=c}else n[s]=o;return a?(Object.setPrototypeOf(n,Object.getPrototypeOf(t)),n):void 0}else if(typeof t=="string"){let n=i[t];return n!==void 0&&fxe(r),n}else return}}var VC;(t=>{function i(r,n){let a=Zn.zoom(n,r.path);if(typeof a=="object"){let s={};for(let o of Object.keys(r.props))s[o]=a[o];return{...r,props:s}}else return{...r,props:{}}}t.replaceProps=i})(VC||(VC={}));var ya;(t=>{function i(c,h){return{...c,path:c.path.slice(h)}}t.drop=i;function r(c,h){var u;return((u=n(c,h))==null?void 0:u.data)??c}t.applySimple=r;function n(c,h){var A,f;let u=h.path;for(var d=[];;){let m;if(c instanceof Fn&&h.type===0&&(m=c.runOp({...h,path:u.slice(d.length)}),m===null&&(m=void 0)),m===void 0&&d.length===u.length&&(c instanceof Va||c instanceof Pt||c instanceof kt?m=c.runOp(h):m=GC.runOp(c,h)),m!==void 0)if(m!==null){let v=m.data;for(let _=d.length-1;_>=0;_--){let y=u[_],w=d[_];if(w instanceof Va){if(typeof y=="number")throw new Error("illegal arg");v=w.modifyById(y,v)}else if(w instanceof Pt){if(typeof y=="number")throw new Error("illegal arg");v=w.modifyById(y,v)}else if(w instanceof kt){if(typeof y=="number")throw new Error("illegal arg");v=w.modifyById(y,v)}else if(w instanceof Fn){let b={...w,[y]:v};v=Object.setPrototypeOf(b,Fn.prototype)}else if(typeof w=="object")if(Array.isArray(w)){if(typeof y=="string"&&(y=parseInt(y),isNaN(y)))throw new Error("Invalid path");let b=v;v=[...w],v[y]=b}else v={...w,[y]:v};else return null}return{data:v,actual:{...m.actual,path:u},reverse:{...m.reverse,path:u}}}else return null;let g=u[d.length],p;if(c instanceof Va){if(typeof g=="number")throw new Error("");p=(A=c.get(g))==null?void 0:A.data}else if(c instanceof Pt){if(typeof g=="number")throw new Error("");p=(f=c.get(g))==null?void 0:f.data}else c!==null&&(p=c[g]);if(p!==void 0)d.push(c),c=p;else return null}}t.apply=n;function a(c,h){for(let u=0;u<c.length&&u<h.length;u++)if(c[u]!==h[u])return!0;return!1}t.pathDisjoint=a;function s(c,h){if(c.length!==h.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==h[u])return!1;return!0}t.pathEq=s;function o(c,h){return a(c.path,h.path)}t.commutative=o;function l(c,h){return c.type===0&&h.type===0&&s(c.path,h.path)?Object.keys(c.props).every(u=>h.props[u]!==void 0):!1}t.subsumed=l})(ya||(ya={}));var SP;(t=>{function i(){return[]}t.empty=i;function r(h,u){let d=[];for(let A of h){let[f,...m]=A.path;f===u&&d.push({...A,path:m})}return d}t.removePrefix=r;function n(h,u){return h.map(d=>({...d,path:[u,...d.path]}))}t.addPrefix=n;function a(h,u){return[...h,...u]}t.concat=a;function s(h,u){return[...h.filter(d=>!u.some(A=>ya.subsumed(d,A))),...u]}t.compress=s;function o(h,u){return h.every(d=>u.every(A=>ya.commutative(d,A)))}t.commutative=o;function l(h,u){for(let d of u){let A=c(h,d);A!==null&&(h=A.data)}return h}t.applyAll=l;function c(h,u){var d=h;let A=[],f=[];for(let m of u)try{if(m.type===3||m.type===5&&m.path[m.path.length-1]==="variables"){let g,p,v;if(m.type===3?(g=Zn.zoom(d,[...m.path,m.id]),v=ya.apply(d,{...m,type:2})):(g=Zn.zoom(d,[...m.path,m.id,"value"]),v=ya.apply(d,m)),v!==null){d=v.data;let[_,y]=Axe(d,{[m.id]:g});d=_;for(let w=0;w<y.length;w++){let b=y[w],E=b.pop();if(typeof E=="number"){let M=[E];for(let T=w+1;T<y.length;T++){let C=y[T],x=C[C.length-1];if(typeof x=="number"&&Zn.equal(b,C.slice(0,C.length-1)))M.push(x),y.splice(T,1);else break}let S=Zn.zoom(d,b);p=S.map((T,C)=>M.includes(C)?m.id:T),g=S,E=b.pop()}else{if(E==="alphaOverride"||E==="alpha"){g/=100;let M=g,S=Zn.zoom(d,b.slice(0,b.length-2)),T=S.layers.map(C=>C.id===b[b.length-1]?{...C,data:{...C.data,[E]:M}}:C);Object.setPrototypeOf(T,Object.getPrototypeOf(S.layers)),S.layers=T}p=m.id}A.push({type:0,path:b,props:{[E]:g}}),f.push({type:0,path:b,props:{[E]:p}})}f.push(v.reverse),A.push(v.actual)}}else{let g=ya.apply(d,m);g!==null&&(A.push(g.actual),d=g.data,f.push(g.reverse))}}catch(g){if(g instanceof ZY)return null;throw g}return{data:d,actual:A,reverse:f.reverse()}}t.apply=c})(SP||(SP={}));var tK=Symbol(),mxe=Symbol(),_M=Symbol(),BE=class{reportOp(t,i,r=[]){let n=this;if(i===null)return;n._current=i.data;let a=r;for(;!(n instanceof rK);){let s=n._path,o=n._current;if(s!==""&&a.splice(0,0,s),n=n._parent,n===null)return;n.update(s,o)}n.push(a,t,i.actual,i.reverse)}deleteChildren(t){if(this._children){let i=this._children[t];if(i){let r=i[_M];r&&r(),delete this._children[t]}}}},gxe=class extends BE{constructor(t,i,r){super(),this._parent=t,this._path=i,this._current=r}update(t,i){if(Array.isArray(this._current)){if(typeof t=="string"&&(t=parseInt(t),isNaN(t)))throw new Error("Invalid path");this._current=[...this._current],this._current[t]=i}else this._current={...this._current,[t]:i}}runOp(t){this.reportOp(t,GC.runOp(this._current,t),t.path)}},vxe=class extends BE{constructor(t,i,r){super(),this._parent=t,this._path=i,this._current=r}update(t,i){this._current={...this._current,[t]:i},Object.setPrototypeOf(this._current,kt.prototype)}runOp(t){this.reportOp(t,this._current.runOp(t))}},iK={get(t,i){if(i===_M)return()=>{t._parent=null};if(i===tK)return t._current;if(i===mxe)return t;let{_current:r,_children:n}=t;if(i==="push"&&Array.isArray(r))throw new Error("not supported to expand array");let a=n===void 0?void 0:n[i];if(a!==void 0)return a;let s=r[i],o=yM(t,i,s);return o!==s?(n===void 0&&(n={},t._children=n),n[i]=o,o):s},has(t,i){return i in t._current},ownKeys(t){return Reflect.ownKeys(t._current)},defineProperty(){throw Error("not supported")},getPrototypeOf(t){return Object.getPrototypeOf(t._current)},setPrototypeOf(){throw Error("not supported")},getOwnPropertyDescriptor(t,i){let r=t._current,n=Reflect.getOwnPropertyDescriptor(r,i);return n&&{writable:!0,configurable:!0,enumerable:n.enumerable,value:r[i]}}},_xe={...iK,set(t,i,r){let n={type:0,props:{[i]:wn(r)??r}};return t.deleteChildren(i),t.runOp(n),!0},deleteProperty(t,i){let r={type:0,props:{[i]:void 0}};return t.deleteChildren(i),t.runOp(r),!0}},yxe={...iK,set(t,i,r){return r===void 0?this.deleteProperty(t,i):(t.deleteChildren(i),t.runOp({type:1,id:i,data:r})),!0},deleteProperty(t,i){return t.runOp({type:2,id:i}),!0}},HN=class extends BE{constructor(t,i,r){super(),this._children={},this._parent=t,this._path=i,this._current=r,this[_M]=()=>{this._parent=null}}unproxy(){return this._current}update(t,i){this._current=this._current.modifyById(t,i)}runOp(t){this.reportOp(t,this._current.runOp(t))}randomId(){return this._current.randomId()}isDescendantOf(t,i){return this._current.isDescendantOf(t,i)}childrenOf(t){return this._current.childrenOf(t)}traverse(t){return this._current.traverse(t)}get(t){return this._current.get(t)}parent(t){return this._current.parent(t)}traverse(t){this._current.traverse((i,r)=>{t(i,this.data(i))})}data(t){var o;let{_current:i,_children:r}=this,n=r===void 0?void 0:r[t];if(n!==void 0)return n;let a=(o=i.get(t))==null?void 0:o.data,s=yM(this,t,a);return s!==a?(r===void 0&&(r={},this._children=r),r[t]=s,s):a}add(t,i,r,n,a){this.runOp({type:7,parent:t,fi:i,id:r,data:n,children:a})}move(t,i,r){this.runOp({type:9,parent:t,fi:i,id:r})}insertAfter(t,i,r){let n=this._current.insertAfterHelper(t,i,r.length);for(let a=0;a<r.length;a++){let s=r[a];this.add(t,n[a],s.id,s.data,s.children)}}insertBefore(t,i,r){let n=this._current.insertBeforeHelper(t,i,r.length);for(let a=0;a<r.length;a++){let s=r[a];this.add(t,n[a],s.id,s.data,s.children)}}moveAfter(t,i,r){let n=this._current.insertAfterHelper(t,i,r.length);for(let a=0;a<r.length;a++){let s=r[a];this.move(t,n[a],s)}}moveBefore(t,i,r){let n=this._current.insertBeforeHelper(t,i,r.length);for(let a=0;a<r.length;a++){let s=r[a];this.move(t,n[a],s)}}delete(t){this.deleteChildren(t),this.runOp({type:8,id:t})}sortNext(t){return this._current.sortNext(t)}sortPrevious(t){return this._current.sortPrevious(t)}getAllSorted(t){return this._current.getAllSorted(t)}},GN=class extends BE{constructor(t,i,r){super(),this._children={},this._parent=t,this._path=i,this._current=r,this[_M]=()=>{this._parent=null}}unproxy(){return this._current}get length(){return this._current.length}forEach(t){let i=this.length;for(let r=0;r<i;r++){let n=this._current[r].id,a=this._current[r].fi;t(this.data(this._current[r].id),n,a)}}find(t){let i=this.length;for(let r=0;r<i;r++){let n=this._current[r].id;if(t(this.data(n),n))return this.get(n)}}update(t,i){this._current=this._current.modifyById(t,i)}randomId(){return this._current.randomId()}get(t){return{...this._current.get(t),data:this.data(t)}}data(t){var o;let{_current:i,_children:r}=this,n=r===void 0?void 0:r[t];if(n!==void 0)return n;let a=(o=i.get(t))==null?void 0:o.data,s=yM(this,t,a);return s!==a?(r===void 0&&(r={},this._children=r),r[t]=s,s):a}runOp(t){this.reportOp(t,this._current.runOp(t))}
7715add(t,i,r){this.runOp({type:4,fi:t,id:i,data:r})}move(t,i){this.runOp({type:6,fi:t,id:i})}insertAfter(t,i){let r=this._current.insertAfterHelper(t,i.length);for(let n=0;n<i.length;n++){let a=i[n];this.add(r[n],a.id,a.data)}}insertBefore(t,i){let r=this._current.insertBeforeHelper(t,i.length);for(let n=0;n<i.length;n++){let a=i[n];this.add(r[n],a.id,a.data)}}moveAfter(t,i){let r=this._current.insertAfterHelper(t,i.length);for(let n=0;n<i.length;n++){let a=i[n];this.move(r[n],a)}}moveBefore(t,i){let r=this._current.insertBeforeHelper(t,i.length);for(let n=0;n<i.length;n++){let a=i[n];this.move(r[n],a)}}delete(t){this.deleteChildren(t),this.runOp({type:5,id:t})}};function uI(t,i,r){if(t.length>0){let n=t[t.length-1];if(n.type===0&&i.type===0&&Zn.equal(n.path,r)){Object.assign(n.props,i.props);return}}t.push({...i,path:r})}var rK=class extends BE{constructor(t){super(),this.ts=[],this.actual=[],this.reverse=[],this._current=t}update(t,i){if(t!=="")throw new Error("");this._current=i}push(t,i,r,n){uI(this.ts,i,t),uI(this.actual,r,t),uI(this.reverse,n,t)}result(){return{data:this._current,ts:this.ts,actual:this.actual,reverse:this.reverse.reverse()}}};function yM(t,i,r){return r instanceof Va?new HN(t,i,r):r instanceof Pt?new GN(t,i,r):r instanceof kt?new Proxy(new vxe(t,i,r),yxe):r!==null&&typeof r=="object"?UN(r)?r:new Proxy(new gxe(t,i,r),_xe):r}function nK(t){let i=new rK(t);return[yM(i,"",t),i]}function Uy(t,i){let[r,n]=nK(t);return i(r),n.result()}function wn(t){return t instanceof HN||t instanceof GN?t._current:t!==null&&typeof t=="object"?t[tK]:t}var Zn;(t=>{function i(s,o){if(o.length===s.length)for(var l=0;l<s.length;){if(s[l]!==o[l])return!1;l+=1}else return!1;return!0}t.equal=i;function r(s,o,l){let c=a(l,s);if(c!==void 0&&typeof c=="object"&&c!==null){let h={...o};return Object.keys(c).forEach(u=>{delete h[u]}),h}else return o}t.removeOverridden=r;function n(s,o){if((s instanceof Va||s instanceof HN)&&typeof o=="string"||(s instanceof Pt||s instanceof GN)&&typeof o=="string")return s.data(o);if(typeof o=="number"&&Array.isArray(s)||typeof o=="string"&&typeof s=="object"&&s!==null)return s[o]}t.zoomOnce=n;function a(s,o,l=0){for(;l<o.length&&s!==void 0;)s=n(s,o[l]),l+=1;return s}t.zoom=a})(Zn||(Zn={}));function Exe(t,i){let r=[];if(i.length===t.length)for(var n=0;n<t.length;){if(i[n]==="*")r.push(t[n]);else if(t[n]!==i[n])return null;n+=1}else return null;return r}function Er(t,i){let r=[];if(i.length<=t.length)for(var n=0;n<i.length;){if(i[n]==="*")r.push(t[n]);else if(t[n]!==i[n])return null;n+=1}else return null;return r}var aK=class{},Bz=class extends aK{constructor(t){super(),this.id=t}},Iz=class extends aK{constructor(t){super(),this.data=t}},CP;try{CP=new TextDecoder}catch{}var xt,bA,ke=0,io={},Ji,iA,qo=0,qc=0,xo,Lu,Gs=[],sr,Dz={useRecords:!1,mapsAsObjects:!0},sK=class{},oK=new sK;oK.name="MessagePack 0xC1";var h0=!1,WC=class{constructor(t){t&&(t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0)),Object.assign(this,t)}unpack(t,i){if(xt)return AK(()=>(MP(),this?this.unpack(t,i):WC.prototype.unpack.call(Dz,t,i)));bA=i>-1?i:t.length,ke=0,qc=0,iA=null,xo=null,xt=t;try{sr=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(r){throw xt=null,t instanceof Uint8Array?r:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof WC){if(io=this,this.structures)return Ji=this.structures,fb();(!Ji||Ji.length>0)&&(Ji=[])}else io=Dz,(!Ji||Ji.length>0)&&(Ji=[]);return fb()}unpackMultiple(t,i){let r,n=0;try{h0=!0;let a=t.length,s=this?this.unpack(t,a):wM.unpack(t,a);if(i){for(i(s);ke<a;)if(n=ke,i(fb())===!1)return}else{for(r=[s];ke<a;)n=ke,r.push(fb());return r}}catch(a){throw a.lastPosition=n,a.values=r,a}finally{h0=!1,MP()}}_mergeStructures(t,i){t=t||[];for(let r=0,n=t.length;r<n;r++){let a=t[r];a&&(a.isShared=!0,r>=32&&(a.highByte=r-32>>5))}t.sharedLength=t.length;for(let r in i||[])if(r>=0){let n=t[r],a=i[r];a&&(n&&((t.restoreStructures||(t.restoreStructures=[]))[r]=n),t[r]=a)}return this.structures=t}decode(t,i){return this.unpack(t,i)}};function fb(){try{if(!io.trusted&&!h0){let i=Ji.sharedLength||0;i<Ji.length&&(Ji.length=i)}let t=sn();if(ke==bA)Ji.restoreStructures&&Pz(),Ji=null,xt=null,Lu&&(Lu=null);else if(ke>bA){let i=new Error("Unexpected end of MessagePack data");throw i.incomplete=!0,i}else if(!h0)throw new Error("Data read, but end of buffer not reached");return t}catch(t){throw Ji.restoreStructures&&Pz(),MP(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer"))&&(t.incomplete=!0),t}}function Pz(){for(let t in Ji.restoreStructures)Ji[t]=Ji.restoreStructures[t];Ji.restoreStructures=null}function sn(){let t=xt[ke++];if(t<160)if(t<128){if(t<64)return t;{let i=Ji[t&63]||io.getStructures&&lK()[t&63];return i?(i.read||(i.read=zN(i,t&63)),i.read()):t}}else if(t<144)if(t-=128,io.mapsAsObjects){let i={};for(let r=0;r<t;r++)i[hK()]=sn();return i}else{let i=new Map;for(let r=0;r<t;r++)i.set(sn(),sn());return i}else{t-=144;let i=new Array(t);for(let r=0;r<t;r++)i[r]=sn();return i}else if(t<192){let i=t-160;if(qc>=ke)return iA.slice(ke-qo,(ke+=i)-qo);if(qc==0&&bA<140){let r=i<16?QN(i):cK(i);if(r!=null)return r}return TP(i)}else{let i;switch(t){case 192:return null;case 193:return xo?(i=sn(),i>
77150?xo[1].slice(xo.position1,xo.position1+=i):xo[0].slice(xo.position0,xo.position0-=i)):oK;case 194:return!1;case 195:return!0;case 196:return dI(xt[ke++]);case 197:return i=sr.getUint16(ke),ke+=2,dI(i);case 198:return i=sr.getUint32(ke),ke+=4,dI(i);case 199:return sf(xt[ke++]);case 200:return i=sr.getUint16(ke),ke+=2,sf(i);case 201:return i=sr.getUint32(ke),ke+=4,sf(i);case 202:if(i=sr.getFloat32(ke),io.useFloat32>2){let r=VN[(xt[ke]&127)<<1|xt[ke+1]>>7];return ke+=4,(r*i+(i>0?.5:-.5)>>0)/r}return ke+=4,i;case 203:return i=sr.getFloat64(ke),ke+=8,i;case 204:return xt[ke++];case 205:return i=sr.getUint16(ke),ke+=2,i;case 206:return i=sr.getUint32(ke),ke+=4,i;case 207:return io.int64AsNumber?(i=sr.getUint32(ke)*4294967296,i+=sr.getUint32(ke+4)):i=sr.getBigUint64(ke),ke+=8,i;case 208:return sr.getInt8(ke++);case 209:return i=sr.getInt16(ke),ke+=2,i;case 210:return i=sr.getInt32(ke),ke+=4,i;case 211:return io.int64AsNumber?(i=sr.getInt32(ke)*4294967296,i+=sr.getUint32(ke+4)):i=sr.getBigInt64(ke),ke+=8,i;case 212:if(i=xt[ke++],i==114)return Fz(xt[ke++]&63);{let r=Gs[i];if(r)return r.read?(ke++,r.read(sn())):r.noBuffer?(ke++,r()):r(xt.subarray(ke,++ke));throw new Error("Unknown extension "+i)}case 213:return i=xt[ke],i==114?(ke++,Fz(xt[ke++]&63,xt[ke++])):sf(2);case 214:return sf(4);case 215:return sf(8);case 216:return sf(16);case 217:return i=xt[ke++],qc>=ke?iA.slice(ke-qo,(ke+=i)-qo):bxe(i);case 218:return i=sr.getUint16(ke),ke+=2,qc>=ke?iA.slice(ke-qo,(ke+=i)-qo):Sxe(i);case 219:return i=sr.getUint32(ke),ke+=4,qc>=ke?iA.slice(ke-qo,(ke+=i)-qo):Cxe(i);case 220:return i=sr.getUint16(ke),ke+=2,Oz(i);case 221:return i=sr.getUint32(ke),ke+=4,Oz(i);case 222:return i=sr.getUint16(ke),ke+=2,Nz(i);case 223:return i=sr.getUint32(ke),ke+=4,Nz(i);default:if(t>=224)return t-256;if(t===void 0){let r=new Error("Unexpected end of MessagePack data");throw r.incomplete=!0,r}throw new Error("Unknown MessagePack token "+t)}}}var wxe=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function zN(t,i){function r(){if(r.count++>2){let a=t.read=new Function("r","return function(){return {"+t.map(s=>wxe.test(s)?s+":r()":"["+JSON.stringify(s)+"]:r()").join(",")+"}}")(sn);return t.highByte===0&&(t.read=Lz(i,t.read)),a()}let n={};for(let a=0,s=t.length;a<s;a++){let o=t[a];n[o]=sn()}return n}return r.count=0,t.highByte===0?Lz(i,r):r}var Lz=(t,i)=>function(){let r=xt[ke++];if(r===0)return i();let n=t<32?-(t+(r<<5)):t+(r<<5),a=Ji[n]||lK()[n];if(!a)throw new Error("Record id is not defined for "+n);return a.read||(a.read=zN(a,t)),a.read()};function lK(){let t=AK(()=>(xt=null,io.getStructures()));return Ji=io._mergeStructures(t,Ji)}var TP=EM,bxe=EM,Sxe=EM,Cxe=EM;function EM(t){let i;if(t<16&&(i=QN(t)))return i;if(t>64&&CP)return CP.decode(xt.subarray(ke,ke+=t));let r=ke+t,n=[];for(i="";ke<r;){let a=xt[ke++];if(!(a&128))n.push(a);else if((a&224)===192){let s=xt[ke++]&63;n.push((a&31)<<6|s)}else if((a&240)===224){let s=xt[ke++]&63,o=xt[ke++]&63;n.push((a&31)<<12|s<<6|o)}else if((a&248)===240){let s=xt[ke++]&63,o=xt[ke++]&63,l=xt[ke++]&63,c=(a&7)<<18|s<<12|o<<6|l;c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c)}else n.push(a);n.length>=4096&&(i+=la.apply(String,n),n.length=0)}return n.length>0&&(i+=la.apply(String,n)),i}function Oz(t){let i=new Array(t);for(let r=0;r<t;r++)i[r]=sn();return i}function Nz(t){if(io.mapsAsObjects){let i={};for(let r=0;r<t;r++)i[hK()]=sn();return i}else{let i=new Map;for(let r=0;r<t;r++)i.set(sn(),sn());return i}}var la=String.fromCharCode;function cK(t){let i=ke,r=new Array(t);for(let n=0;n<t;n++){let a=xt[ke++];if((a&128)>0){ke=i;return}r[n]=a}return la.apply(String,r)}function QN(t){if(t<4)if(t<2){if(t===0)return"";{let i=xt[ke++];if((i&128)>1){ke-=1;return}return la(i)}}else{let i=xt[ke++],r=xt[ke++];if((i&128)>0||(r&128)>0){ke-=2;return}if(t<3)return la(i,r);let n=xt[ke++];if((n&128)>0){ke-=3;return}return la(i,r,n)}else{let i=xt[ke++],r=xt[ke++],n=xt[ke++],a=xt[ke++];if((i&128)>0||(r&128)>0||(n&128)>0||(a&128)>0){ke-=4;return}if(t<6){if(t===4)return la(i,r,n,a);{let s=xt[ke++];if((s&128)>0){ke-=5;return}return la(i,r,n,a,s)}}else if(t<8){let s=xt[ke++],o=xt[ke++];if((s&128)>0||(o&128)>0){ke-=6;return}if(t<7)return la(i,r,n,a,s,o);let l=xt[ke++];if((l&128)>0){ke-=7;return}return la(i,r,n,a,s,o,l)}else{let s=xt[ke++],o=xt[ke++],l=xt[ke++],c=xt[ke++];if((s&128)>0||(o&128)>0||(l&128)>0||(c&128)>0){ke-=8;return}if(t<10){if(t===8)return la(i,r,n,a,s,o,l,c);{let h=xt[ke++];if((h&128)>0){ke-=9;return}return la(i,r,n,a,s,o,l,c,h)}}else if(t<12){let h=xt[ke++],u=xt[ke++];if((h&128)>0||(u&128)>0){ke-=10;return}if(t<11)return la(i,r,n,a,s,o,l,c,h,u);let d=xt[ke++];if((d&128)>0){ke-=11;return}return la(i,r,n,a,s,o,l,c,h,u,d)}else{let h=xt[ke++],u=xt[ke++],d=xt[ke++],A=xt[ke++];if((h&128)>0||(u&128)>0||(d&128)>0||(A&128)>0){ke-=12;return}if(t<14){if(t===12)return la(i,r,n,a,s,o,l,c,h,u,d,A);{let f=xt[ke++];if((f&128)>0){ke-=13;return}return la(i,r,n,a,s,o,l,c,h,u,d,A,f)}}else{let f=xt[ke++],m=xt[ke++];if((f&128)>0||(m&128)>0){ke-=14;return}if(t<15)return la(i,r,n,a,s,o,l,c,h,u,d,A,f,m);let g=xt[ke++];if((g&128)>0){ke-=15;return}return la(i,r,n,a,s,o,l,c,h,u,d,A,f,m,g)}}}}}function dI(t){return io.copyBuffers?Uint8Array.prototype.slice.call(xt,ke,ke+=t):xt.subarray(ke,ke+=t)}function sf(t){let i=xt[ke++];if(Gs[i])return Gs[i](xt.subarray(ke,ke+=t));throw new Error("Unknown extension type "+i)}var Uz=new Array(4096);function hK(){let t=xt[ke++];if(t>=160&&t<192){if(t=t-160,qc>=ke)return iA.slice(ke-qo,(ke+=t)-qo);if(!(qc==0&&bA<180))return TP(t)}else return ke--,sn();let i=(t<<5^(t>1?sr.getUint16(ke):t>0?xt[ke]:0))&4095,r=Uz[i],n=ke,a=ke+t-3,s,o=0;if(r&&r.bytes==t){for(;n<a;){if(s=sr.getUint32(n),s!=r[o++]){n=1879048192;break}n+=4}for(a+=3;n<a;)if(s=xt[n++],s!=r[o++]){n=1879048192;break}if(n===a)return ke=n,r.string;a-=3,n=ke}for(r=[],Uz[i]=r,r.bytes=t;n<a;)s=sr.getUint32(n),r.push(s),n+=4;for(a+=3;n<a;)s=xt[n++],r.push(s);let l=t<16?QN(t):cK(t);return l!=null?r.string=l:r.string=TP(t)}var Fz=(t,i)=>{var r=sn();let n=t;i!==void 0&&(t=t<32?-((i<<5)+t):(i<<5)+t,r.highByte=i);let a=Ji[t];return a&&a.isShared&&((Ji.restoreStructures||(Ji.restoreStructures=[]))[t]=a),Ji[t]=r,r.read=zN(r,n),r.read()},uK=typeof self=="object"?self:global;Gs[0]=()=>{};Gs[0].noBuffer=!0;Gs[101]=()=>{let t=sn();return(uK[t[0]]||Error)(t[1])};Gs[105]=t=>{let i=sr.getUint32(ke-4);Lu||(Lu=new Map);let r=xt[ke],n;r>=144&&r<160||r==220||r==221?n=[]:n={};let a={target:n};Lu.set(i,a);let s=sn();return a.used?Object.assign(n,s):(a.target=s,s)};Gs[112]=t=>{let i=sr.getUint32(ke-4),r=Lu.get(i);return r.used=!0,r.target};Gs[115]=()=>new Set(sn());var dK=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(t=>t+"Array");Gs[116]=t=>{let i=t[0],r=dK[i];
7715if(!r)throw new Error("Could not find typed array for code "+i);return new uK[r](Uint8Array.prototype.slice.call(t,1).buffer)};Gs[120]=()=>{let t=sn();return new RegExp(t[0],t[1])};Gs[98]=t=>{let i=(t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3],r=ke;ke+=i-4,xo=[sn(),sn()],xo.position0=0,xo.position1=0;let n=ke;ke=r;try{return sn()}finally{ke=n}};Gs[255]=t=>t.length==4?new Date((t[0]*16777216+(t[1]<<16)+(t[2]<<8)+t[3])*1e3):t.length==8?new Date(((t[0]<<22)+(t[1]<<14)+(t[2]<<6)+(t[3]>>2))/1e6+((t[3]&3)*4294967296+t[4]*16777216+(t[5]<<16)+(t[6]<<8)+t[7])*1e3):t.length==12?new Date(((t[0]<<24)+(t[1]<<16)+(t[2]<<8)+t[3])/1e6+((t[4]&128?-281474976710656:0)+t[6]*1099511627776+t[7]*4294967296+t[8]*16777216+(t[9]<<16)+(t[10]<<8)+t[11])*1e3):new Date("invalid");function AK(t){let i=bA,r=ke,n=qo,a=qc,s=iA,o=Lu,l=xo,c=new Uint8Array(xt.slice(0,bA)),h=Ji,u=Ji.slice(0,Ji.length),d=io,A=h0,f=t();return bA=i,ke=r,qo=n,qc=a,iA=s,Lu=o,xo=l,xt=c,h0=A,Ji=h,Ji.splice(0,Ji.length,...u),io=d,sr=new DataView(xt.buffer,xt.byteOffset,xt.byteLength),f}function MP(){xt=null,Lu=null,Ji=null}function Txe(t){t.unpack?Gs[t.type]=t.unpack:Gs[t.type]=t}var VN=new Array(147);for(let t=0;t<256;t++)VN[t]=+("1e"+Math.floor(45.15-t*.30103));var wM=new WC({useRecords:!1});wM.unpack;wM.unpackMultiple;wM.unpack;var Mxe=new Float32Array(1);new Uint8Array(Mxe.buffer,0,4);var BS;try{BS=new TextEncoder}catch{}var jC,WN,bM=typeof Buffer<"u",AI=bM?Buffer.allocUnsafeSlow:Uint8Array,fK=bM?Buffer:Uint8Array,kz=bM?4294967296:2144337920,ot,pn,Ye=0,Tc,Mc=null,xxe=/[\u0080-\uFFFF]/,Uv=Symbol("record-id"),pK=class extends WC{constructor(t){super(t),this.offset=0;let i,r,n,a,s,o=0,l=fK.prototype.utf8Write?function(E,M,S){return ot.utf8Write(E,M,S)}:BS&&BS.encodeInto?function(E,M){return BS.encodeInto(E,ot.subarray(M)).written}:!1,c=this;t||(t={});let h=t&&t.sequential,u=t.structures||t.saveStructures,d=t.maxSharedStructures;if(d==null&&(d=u?32:0),d>8160)throw new Error("Maximum maxSharedStructure is 8160");let A=t.maxOwnStructures;A==null&&(A=u?32:64),h&&!t.saveStructures&&(this.structures=[]);let f=d>32||A+d>64,m=d+64,g=d+A+64;if(g>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let p=[],v=0,_=0;this.pack=this.encode=function(E,M){if(ot||(ot=new AI(8192),pn=new DataView(ot.buffer,0,8192),Ye=0),Tc=ot.length-10,Tc-Ye<2048?(ot=new AI(ot.length),pn=new DataView(ot.buffer,0,ot.length),Tc=ot.length-10,Ye=0):Ye=Ye+7&2147483640,i=Ye,s=c.structuredClone?new Map:null,c.bundleStrings?(Mc=["",""],ot[Ye++]=214,ot[Ye++]=98,Mc.position=Ye-i,Ye+=4):Mc=null,r=c.structures,r){r.uninitialized&&(r=c._mergeStructures(c.getStructures()));let S=r.sharedLength||0;if(S>d)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+r.sharedLength);if(!r.transitions){r.transitions=Object.create(null);for(let T=0;T<S;T++){let C=r[T];if(!C)continue;let x,R=r.transitions;for(let L=0,I=C.length;L<I;L++){let F=C[L];x=R[F],x||(x=R[F]=Object.create(null)),R=x}R[Uv]=T+64}o=S}h||(r.nextId=S+64)}n&&(n=!1),a=r||[];try{if(y(E),Mc){pn.setUint32(Mc.position+i,Ye-Mc.position-i);let S=Mc;Mc=null,y(S[0]),y(S[1])}if(c.offset=Ye,s&&s.idsToInsert){Ye+=s.idsToInsert.length*6,Ye>Tc&&b(Ye),c.offset=Ye;let S=Bxe(ot.subarray(i,Ye),s.idsToInsert);return s=null,S}return M&Ixe?(ot.start=i,ot.end=Ye,ot):ot.subarray(i,Ye)}finally{if(r){if(_<10&&_++,v>1e4)r.transitions=null,_=0,v=0,p.length>0&&(p=[]);else if(p.length>0&&!h){for(let S=0,T=p.length;S<T;S++)p[S][Uv]=0;p=[]}if(n&&c.saveStructures){let S=r.sharedLength||d;r.length>S&&(r=r.slice(0,S));let T=ot.subarray(i,Ye);return c.saveStructures(r,o)===!1?(c._mergeStructures(c.getStructures()),c.pack(E)):(o=S,T)}}M&Dxe&&(Ye=i)}};let y=E=>{Ye>Tc&&(ot=b(Ye));var M=typeof E,S;
7715if(M==="string"){let T=E.length;if(Mc&&T>=8&&T<4096){let R=xxe.test(E);Mc[R?0:1]+=E,ot[Ye++]=193,y(R?-T:T);return}let C;T<32?C=1:T<256?C=2:T<65536?C=3:C=5;let x=T*3;if(Ye+x>Tc&&(ot=b(Ye+x)),T<64||!l){let R,L,I,F=Ye+C;for(R=0;R<T;R++)L=E.charCodeAt(R),L<128?ot[F++]=L:L<2048?(ot[F++]=L>>6|192,ot[F++]=L&63|128):(L&64512)===55296&&((I=E.charCodeAt(R+1))&64512)===56320?(L=65536+((L&1023)<<10)+(I&1023),R++,ot[F++]=L>>18|240,ot[F++]=L>>12&63|128,ot[F++]=L>>6&63|128,ot[F++]=L&63|128):(ot[F++]=L>>12|224,ot[F++]=L>>6&63|128,ot[F++]=L&63|128);S=F-Ye-C}else S=l(E,Ye+C,x);S<32?ot[Ye++]=160|S:S<256?(C<2&&ot.copyWithin(Ye+2,Ye+1,Ye+1+S),ot[Ye++]=217,ot[Ye++]=S):S<65536?(C<3&&ot.copyWithin(Ye+3,Ye+2,Ye+2+S),ot[Ye++]=218,ot[Ye++]=S>>8,ot[Ye++]=S&255):(C<5&&ot.copyWithin(Ye+5,Ye+3,Ye+3+S),ot[Ye++]=219,pn.setUint32(Ye,S),Ye+=4),Ye+=S}else if(M==="number")if(E>>>0===E)E<64?ot[Ye++]=E:E<256?(ot[Ye++]=204,ot[Ye++]=E):E<65536?(ot[Ye++]=205,ot[Ye++]=E>>8,ot[Ye++]=E&255):(ot[Ye++]=206,pn.setUint32(Ye,E),Ye+=4);else if(E>>0===E)E>=-32?ot[Ye++]=256+E:E>=-128?(ot[Ye++]=208,ot[Ye++]=E+256):E>=-32768?(ot[Ye++]=209,pn.setInt16(Ye,E),Ye+=2):(ot[Ye++]=210,pn.setInt32(Ye,E),Ye+=4);else{let T;if((T=this.useFloat32)>0&&E<4294967296&&E>=-2147483648){ot[Ye++]=202,pn.setFloat32(Ye,E);let C;if(T<4||(C=E*VN[(ot[Ye]&127)<<1|ot[Ye+1]>>7])>>0===C){Ye+=4;return}else Ye--}ot[Ye++]=203,pn.setFloat64(Ye,E),Ye+=8}else if(M==="object")if(!E)ot[Ye++]=192;else{if(s){let C=s.get(E);if(C){if(!C.id){let x=s.idsToInsert||(s.idsToInsert=[]);C.id=x.push(C)}ot[Ye++]=214,ot[Ye++]=112,pn.setUint32(Ye,C.id),Ye+=4;return}else s.set(E,{offset:Ye-i})}let T=E.constructor;if(T===Object)w(E,!0);else if(T===Array){S=E.length,S<16?ot[Ye++]=144|S:S<65536?(ot[Ye++]=220,ot[Ye++]=S>>8,ot[Ye++]=S&255):(ot[Ye++]=221,pn.setUint32(Ye,S),Ye+=4);for(let C=0;C<S;C++)y(E[C])}else if(T===Map){S=E.size,S<16?ot[Ye++]=128|S:S<65536?(ot[Ye++]=222,ot[Ye++]=S>>8,ot[Ye++]=S&255):(ot[Ye++]=223,pn.setUint32(Ye,S),Ye+=4);for(let[C,x]of E)y(C),y(x)}else{for(let C=0,x=jC.length;C<x;C++){let R=WN[C];if(E instanceof R){let L=jC[C];if(L.write){L.type&&(ot[Ye++]=212,ot[Ye++]=L.type,ot[Ye++]=0),y(L.write.call(this,E));return}let I=ot,F=pn,Y=Ye;ot=null;let D;try{D=L.pack.call(this,E,U=>(ot=I,I=null,Ye+=U,Ye>Tc&&b(Ye),{target:ot,targetView:pn,position:Ye-U}),y)}finally{I&&(ot=I,pn=F,Ye=Y,Tc=ot.length-10)}D&&(D.length+Ye>Tc&&b(D.length+Ye),Ye=Rxe(D,ot,Ye,L.type));return}}w(E,!E.hasOwnProperty)}}else if(M==="boolean")ot[Ye++]=E?195:194;else if(M==="bigint"){if(E<BigInt(1)<<BigInt(63)&&E>=-(BigInt(1)<<BigInt(63)))ot[Ye++]=211,pn.setBigInt64(Ye,E);else if(E<BigInt(1)<<BigInt(64)&&E>0)ot[Ye++]=207,pn.setBigUint64(Ye,E);else if(this.largeBigIntToFloat)ot[Ye++]=203,pn.setFloat64(Ye,Number(E));else throw new RangeError(E+" was too large to fit in MessagePack 64-bit integer format, set largeBigIntToFloat to convert to float-64");Ye+=8}else if(M==="undefined")this.encodeUndefinedAsNil?ot[Ye++]=192:(ot[Ye++]=212,ot[Ye++]=0,ot[Ye++]=0);else if(M==="function")y(this.writeFunction&&this.writeFunction());else throw new Error("Unknown type: "+M)},w=this.useRecords===!1?this.variableMapSize?E=>{let M=Object.keys(E),S=M.length;S<16?ot[Ye++]=128|S:S<65536?(ot[Ye++]=222,ot[Ye++]=S>>8,ot[Ye++]=S&255):(ot[Ye++]=223,pn.setUint32(Ye,S),Ye+=4);let T;for(let C=0;C<S;C++)y(T=M[C]),y(E[T])}:(E,M)=>{ot[Ye++]=222;let S=Ye-i;Ye+=2;let T=0;for(let C in E)(M||E.hasOwnProperty(C))&&(y(C),y(E[C]),T++);ot[S+++i]=T>>8,ot[S+i]=T&255}:E=>{let M=Object.keys(E),S,T=a.transitions||(a.transitions=Object.create(null)),C=0;for(let R=0,L=M.length;R<L;R++){let I=M[R];S=T[I],S||(S=T[I]=Object.create(null),C++),T=S}let x=T[Uv];if(x)x>=96&&f?(ot[Ye++]=((x-=96)&31)+96,ot[Ye++]=x>>5):ot[Ye++]=x;else{x=a.nextId,x||(x=64),x<m&&this.shouldShareStructure&&!this.shouldShareStructure(M
7715)?(x=a.nextOwnId,x<g||(x=m),a.nextOwnId=x+1):(x>=g&&(x=m),a.nextId=x+1);let R=M.highByte=x>=96&&f?x-96>>5:-1;T[Uv]=x,a[x-64]=M,x<m?(M.isShared=!0,a.sharedLength=x-63,n=!0,R>=0?(ot[Ye++]=(x&31)+96,ot[Ye++]=R):ot[Ye++]=x):(R>=0?(ot[Ye++]=213,ot[Ye++]=114,ot[Ye++]=(x&31)+96,ot[Ye++]=R):(ot[Ye++]=212,ot[Ye++]=114,ot[Ye++]=x),C&&(v+=_*C),p.length>=A&&(p.shift()[Uv]=0),p.push(T),y(M))}for(let R=0,L=M.length;R<L;R++)y(E[M[R]])},b=E=>{let M;if(E>16777216){if(E-i>kz)throw new Error("Packed buffer would be larger than maximum buffer size");M=Math.min(kz,Math.round(Math.max((E-i)*(E>67108864?1.25:2),4194304)/4096)*4096)}else M=(Math.max(E-i<<2,ot.length-1)>>12)+1<<12;let S=new AI(M);return pn=new DataView(S.buffer,0,M),ot.copy?ot.copy(S,0,i,E):S.set(ot.slice(i,E)),Ye-=i,i=0,Tc=S.length-10,ot=S}}useBuffer(t){ot=t,pn=new DataView(ot.buffer,ot.byteOffset,ot.byteLength),Ye=0}};WN=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,sK];jC=[{pack(t,i,r){let n=t.getTime()/1e3;if((this.useTimestamp32||t.getMilliseconds()===0)&&n>=0&&n<4294967296){let{target:a,targetView:s,position:o}=i(6);a[o++]=214,a[o++]=255,s.setUint32(o,n)}else if(n>0&&n<17179869184){let{target:a,targetView:s,position:o}=i(10);a[o++]=215,a[o++]=255,s.setUint32(o,t.getMilliseconds()*4e6+(n/1e3/4294967296>>0)),s.setUint32(o+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return i(0),r(this.onInvalidDate());let{target:a,targetView:s,position:o}=i(3);a[o++]=212,a[o++]=255,a[o++]=255}else{let{target:a,targetView:s,position:o}=i(15);a[o++]=199,a[o++]=12,a[o++]=255,s.setUint32(o,t.getMilliseconds()*1e6),s.setBigInt64(o+4,BigInt(Math.floor(n)))}}},{pack(t,i,r){let n=Array.from(t),{target:a,position:s}=i(this.structuredClone?3:0);this.structuredClone&&(a[s++]=212,a[s++]=115,a[s++]=0),r(n)}},{pack(t,i,r){let{target:n,position:a}=i(this.structuredClone?3:0);this.structuredClone&&(n[a++]=212,n[a++]=101,n[a++]=0),r([t.name,t.message])}},{pack(t,i,r){let{target:n,position:a}=i(this.structuredClone?3:0);this.structuredClone&&(n[a++]=212,n[a++]=120,n[a++]=0),r([t.source,t.flags])}},{pack(t,i){this.structuredClone?Hz(t,16,i):Gz(bM?Buffer.from(t):new Uint8Array(t),i)}},{pack(t,i){let r=t.constructor;r!==fK&&this.structuredClone?Hz(t,dK.indexOf(r.name),i):Gz(t,i)}},{pack(t,i){let{target:r,position:n}=i(1);r[n]=193}}];function Hz(t,i,r,n){let a=t.byteLength;if(a+1<256){var{target:s,position:o}=r(4+a);s[o++]=199,s[o++]=a+1}else if(a+1<65536){var{target:s,position:o}=r(5+a);s[o++]=200,s[o++]=a+1>>8,s[o++]=a+1&255}else{var{target:s,position:o,targetView:l}=r(7+a);s[o++]=201,l.setUint32(o,a+1),o+=4}s[o++]=116,s[o++]=i,s.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),o)}function Gz(t,i){let r=t.byteLength;var n,a;if(r<256){var{target:n,position:a}=i(r+2);n[a++]=196,n[a++]=r}else if(r<65536){var{target:n,position:a}=i(r+3);n[a++]=197,n[a++]=r>>8,n[a++]=r&255}else{var{target:n,position:a,targetView:s}=i(r+5);n[a++]=198,s.setUint32(a,r),a+=4}n.set(t,a)}function Rxe(t,i,r,n){let a=t.length;switch(a){case 1:i[r++]=212;break;case 2:i[r++]=213;break;case 4:i[r++]=214;break;case 8:i[r++]=215;break;case 16:i[r++]=216;break;default:a<256?(i[r++]=199,i[r++]=a):a<65536?(i[r++]=200,i[r++]=a>>8,i[r++]=a&255):(i[r++]=201,i[r++]=a>>24,i[r++]=a>>16&255,i[r++]=a>>8&255,i[r++]=a&255)}return i[r++]=n,i.set(t,r),r+=a,r}function Bxe(t,i){let r,n=i.length*6,a=t.length-n;for(i.sort((s,o)=>s.offset>o.offset?1:-1);r=i.pop();){let s=r.offset,o=r.id;t.copyWithin(s+n,s,a),n-=6;let l=s+n;t[l++]=214,t[l++]=105,t[l++]=o>>24,t[l++]=o>>16&255,t[l++]=o>>8&255,t[l++]=o&255,a=s}return t}function V0(t){if(t.Class){if(!t.pack&&!t.write)throw new Error("Extension has no pack or write function");if(t.pack&&!t.type)throw new Error("Extension has no type (numeric code to identify the extension)");WN.unshift(t.Class),jC.unshift(t)}Txe(t)}var mK=new pK({useRecords:!1});mK.pack;mK.pack;var Ixe=512,Dxe=1024,zz=new pK({structuredClone:!0});V0({Class:kt.prototype.constructor,type:1,write(t){return{...t}},read(t){return Object.setPrototypeOf(t,kt.prototype),t}});V0({Class:Pt.prototype.constructor,type:2,write(t){return[...t]},read(t){return Object.setPrototypeOf(t,Pt.prototype),t}});V0({Class:Va.prototype.constructor,type:3,write(t){return[...t]},read(t){return Object.setPrototypeOf(t,Va.prototype),t}});V0({Class:Bz.prototype.constructor,type:4,write(t){return t.id},read(t){return new Bz(t)}});V0({Class:Iz.prototype.constructor,type:5,write(t){return t.data},read(t){return new Iz(t)}});V0({Class:Fn.prototype.constructor,type:6,write(t){return{...t}},read(t){return Object.setPrototypeOf(t,Fn.prototype),t}});function Pxe(t){var i=0;if(t.length===0)return i;for(let r=0;r<t.length;r++){let n=t[r];
7715i=(i<<5)-i+n,i=i&i}return i}function xP(t){if(UN(t))return t;if(Array.isArray(t))return t.map(xP);if(typeof t=="object"&&t!==null){let i={};for(let r of Object.keys(t).sort())i[r]=xP(t[r]);return Object.setPrototypeOf(i,Object.getPrototypeOf(t)),i}else return t}var RP;(t=>{function i(a){return zz.pack(a)}t.serialize=i;function r(a){return zz.unpack(a)}t.deserialize=r;function n(a){return Pxe(i(xP(a))).toString()}t.checksum=n})(RP||(RP={}));var Qz;(t=>{function i(n){return n.type==="Conditional"?n.condition.type==="Distance"?"Distance":"StateChange":n.type}t.toEventUIType=i;function r(n){return n==="Distance"||n==="StateChange"?"Conditional":n}t.fromEventUIType=r})(Qz||(Qz={}));function Vz(t){return t==="MouseDown"||t==="MouseUp"||t==="KeyDown"||t==="KeyUp"||t==="Collision"||t==="Trigger"}var rs={LookAt:[],Follow:["Create"],DragDrop:["Transition","Animation","Audio","Particles","Create","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MouseHover:["Transition","Animation","Particles","Create","Destroy","SwitchCamera","SceneTransition","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Scroll:["Transition","Animation","Create","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Start:["Transition","Animation","Audio","Particles","Video","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Conditional:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MouseDown:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MouseUp:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],MousePress:["Transition","Animation","Audio","Particles","Video","Link","Create","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],KeyDown:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],KeyUp:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],KeyPress:["Transition","Animation","Audio","Particles","Video","Link","Create","SwitchCamera","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],GameControl:["Transition","Animation","Audio","Particles","Create","Conditional"],Collision:["Transition","Animation","Audio","Particles","Video","Create","Destroy","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Trigger:["Transition","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],Resize:["Transition","Animation","Audio","Particles","Video","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],VariableChange:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],API:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"],WEBHOOK:["Transition","Animation","Audio","Particles","Video","Link","Create","Destroy","SwitchCamera","SceneTransition","Reset","SetVariable","DynamicVariablePlay","Conditional","ClearLocalStorage","UserAPI"]},Wz;(t=>{function i(n){return n.type==="MouseDown"||n.type==="MouseUp"||n.type==="MousePress"||n.type==="KeyDown"||n.type==="KeyUp"||n.type==="KeyPress"}t.is=i;function r(n){return n==="MouseDown"||n==="MouseUp"||n==="MousePress"?{type:n,mode:"Object",disabled:!1,actions:new Pt}:{type:n,disabled:!1,key:void 0,actions:new Pt}}t.defaultData=r})(Wz||(Wz={}));var YC;(t=>{function i(r){return{type:"Property",value:[r??null,"position","x"]}}t.propertyDefaultData=i,t.valueDefaultData={type:"Literal",value:0}})(YC||(YC={}));var BP;(t=>{function i(a){return{type:"Comparison",operator:"==",lOperand:YC.propertyDefaultData(a),rOperand:{...YC.valueDefaultData}}}t.comparisonDefaultData=i;function r(a){return{type:"Distance",toObject:a??null,fromObject:a??null,distance:200}}t.distanceDefaultData=r;function n(a,s){return{type:"State",object:a??null,state:s??null}}t.stateDefaultData=n})(BP||(BP={}));var jz;(t=>{function i(r){return r.find(n=>n==="ifActions"||n==="elseActions")!==void 0}t.isConditionalSubActions=i})(jz||(jz={}));var Yz;(t=>{function i(n){return n.type==="Conditional"}t.is=i;function r(n){return{type:"Conditional",disabled:!1,inActions:new Pt,outActions:new Pt,condition:BP.distanceDefaultData(n)}}t.defaultData=r})(Yz||(Yz={}));var Kz;(t=>t.defaultData={type:"DragDrop",cursor:"hand",disabled:!1,dampingFactor:1,objects:[],snapTo:"center",snapSurfaceMode:"bbox",snapSurfaceOffset:0,dropOn:"all",autoOrient:!0,dropDestinations:[],plane:"adaptive",planeMode:"locked",referenceFrame:"global",limits:[-1/0,1/0,-1/0,1/0,-1/0,1/0],drop:!1,resetOnSnapFail:!1,snapSpeed:20,resetSpeed:20,dragDropActions:{drag:new Pt,drop:new Pt}})(Kz||(Kz={}));var IP;(t=>t.defaultData={type:"Follow",disabled:!1,maxDelta:0,dampingFactor:1,target:"cursor",plane:"custom",resetOnPointerLeave:!0,resetAfterDistanceLimit:!0,enabledTranslation:[!0,!0,!0],limitDistanceEnabled:!1,limitDistance:1e3,snapDelay:0,resetSpeed:5,actions:new Pt})(IP||(IP={}));var DP;(t=>t.defaultData={type:"LookAt",disabled:!1,distance:1e3,dampingFactor:1,target:"cursor",tilt:"up",axis:"z",plane:"custom",resetOnPointerLeave:!0,resetAfterDistanceLimit:!0,enabledRotation:[!0,!0,!0],limitDistanceEnabled:!1,limitDistance:1e3,snapDelay:0,resetSpeed:5})(DP||(DP={}));var Xz;(t=>{function i(n){return n.type==="MouseHover"}t.is=i;function r(){return{type:"MouseHover",disabled:!1,actions:new Pt}}t.defaultData=r})(Xz||(Xz={}));var qz;(t=>{function i(n){return n.type==="Scroll"}t.is=i;function r(){return{type:"Scroll",disabled:!1,steps:100,trigger:"load",startFrom:"enter",enterAnchor:"top",startOffset:0,endAfter:400,actions:new Pt}}t.defaultData=r})(qz||(qz={}));var Zz;(t=>{function i(n){return n.type==="Start"}t.is=i;function r(){return{type:"Start",disabled:!1,actions:new Pt}}t.defaultData=r})(Zz||(Zz={}));var Jz;(t=>{function i(n){return n.type==="Collision"}t.is=i;function r(){return{type:"Collision",disabled:!1,target:"character",actions:new Pt}}t.defaultData=r})(Jz||(Jz={}));var $z;(t=>{function i(n){return n.type==="Trigger"}t.is=i;function r(n,a){return{type:"Trigger",disabled:!1,target:"all",triggeringObjects:[],actions:new Pt,triggerZone:"box",position:a.toArray(),rotation:[0,0,0],size:n.toArray(),radius:n.length()/2,helperVisible:!0}}t.defaultData=r})($z||($z={}));var PP;(t=>
vendor: 6,385 bytes, line 7715
7715{t.defaultSizes={mobile:[480,480],tablet:[768,768],desktop:[1200,1200],custom:[769,1200]};function i(o){return o.type==="Resize"}t.is=i;function r(o){return typeof o=="string"?o:"custom"}t.sizeToDevice=r;function n(o){return typeof o=="string"?[...t.defaultSizes[o]]:[...o]}t.deviceToSize=n;function a(){let o={size:"mobile",operator:"<",actions:new Pt},l={size:"tablet",operator:"<",actions:new Pt},c={size:[...t.defaultSizes.custom],operator:"<>",actions:new Pt},h=new Pt;return h.push({id:Ct.generateUUID(),fi:0,data:o},{id:Ct.generateUUID(),fi:1,data:l},{id:Ct.generateUUID(),fi:2,data:c}),{type:"Resize",disabled:!1,orientation:"horizontal",breakpoints:h}}t.defaultData=a;function s(){return{size:[...t.defaultSizes.custom],operator:"<>",actions:new Pt}}t.defaultBreakpointData=s})(PP||(PP={}));var LP;(t=>{t.propertyPaths={Position:["position"],"Position X":["position","x"],"Position Y":["position","y"],"Position Z":["position","z"],Rotation:["rotation"],"Rotation X":["rotation","x"],"Rotation Y":["rotation","y"],"Rotation Z":["rotation","z"],Scale:["scale"],"Scale X":["scale","x"],"Scale Y":["scale","y"],"Scale Z":["scale","z"],Width:["width"],Height:["height"],Depth:["depth"],"Mouse Position X":["mouse","x"],"Mouse Position Y":["mouse","y"],"Mouse Pressed":["mouse","pressed"],"Screen Width":["mouse","width"],"Screen Height":["mouse","height"],"Hit Position X":["raycast","x"],"Hit Position Y":["raycast","y"],"Hit Position Z":["raycast","z"],"Hit Object Position X":["raycast","objX"],"Hit Object Position Y":["raycast","objY"],"Hit Object Position Z":["raycast","objZ"]};function i(n){return n.type==="VariableChange"}t.is=i;function r(){return{disabled:!1,type:"VariableChange",actions:new Pt,variableId:"",objectId:null,property:"Position X"}}t.defaultData=r})(LP||(LP={}));var eQ;(t=>{function i(n){return n.type==="API"}t.is=i;function r(){return{disabled:!1,type:"API",successActions:new Pt,errorActions:new Pt,userAPIId:""}}t.defaultData=r})(eQ||(eQ={}));var tQ;(t=>{function i(n){return n.type==="WEBHOOK"}t.is=i;function r(){return{disabled:!1,type:"WEBHOOK",actions:new Pt,userWebhookId:""}}t.defaultData=r})(tQ||(tQ={}));var W0="personal camera",q_="a218fcc3-276b-49b9-b485-49037fd14f5f",Lxe=2960946,No=5526619,Mu;(t=>{function i(m,g){return m[0]===g[0]&&m[1]===g[1]}t.isEqual=i;function r(m,g,p){return[m[0]+(g[0]-m[0])*p,m[1]+(g[1]-m[1])*p]}t.lerp=r;function n(m,g){return[m[0]+g[0],m[1]+g[1]]}t.add=n;function a(m,g){return[m[0]-g[0],m[1]-g[1]]}t.sub=a;function s(m,g){return[m[0]*g[0],m[1]*g[1]]}t.multiply=s;function o(m,g){return[m[0]/g[0],m[1]/g[1]]}t.divide=o;function l(m,g){return Math.pow(g[0]-m[0],2)+Math.pow(g[1]-m[1],2)}t.distanceSquared=l;function c(m,g){return Math.sqrt(l(m,g))}t.distance=c;function h(m,g){return m[0]*g[0]+m[1]*g[1]}t.dot=h;function u(m,g){return[m[0]*g,m[1]*g]}t.scalarMultiply=u;function d(m,g,p){let v=t.sub(g,m),_=t.sub(p,m),y=t.dot(v,_)/t.dot(v,v),w=t.scalarMultiply(v,y);return t.add(m,w)}t.projectionOnto=d;function A(m,g,p){return c(m,d(m,g,p))}t.projectionOntoDistance=A;function f(m,g){return[(m[0]+g[0])*.5,(m[1]+g[1])*.5]}t.center=f})(Mu||(Mu={}));var ip;(t=>{function i(c,h){return c[0]===h[0]&&c[1]===h[1]&&c[2]===h[2]}t.isEqual=i;function r(c,h){return[c[0]+h[0],c[1]+h[1],c[2]+h[2]]}t.add=r;function n(c,h){return[c[0]-h[0],c[1]-h[1],c[2]-h[2]]}t.sub=n;function a(c,h){return[c[0]/h[0],c[1]/h[1],c[2]/h[2]]}t.div=a;function s(c,h){return[c[0]*h[0],c[1]*h[1],c[2]*h[2]]}t.mul=s;function o(c,h){return Math.hypot(c[0]-h[0],c[1]-h[1],c[2]-h[2])}t.dist=o;function l(c,h,u){return[c[0]+(h[0]-c[0])*u,c[1]+(h[1]-c[1])*u,c[2]+(h[2]-c[2])*u]}t.lerp=l})(ip||(ip={}));var KC;(t=>{function i(n,a){return n[0]===a[0]&&n[1]===a[1]&&n[2]===a[2]&&n[3]===a[3]}t.isEqual=i;function r(n,a,s){return[n[0]+(a[0]-n[0])*s,n[1]+(a[1]-n[1])*s,n[2]+(a[2]-n[2])*s,n[3]+(a[3]-n[3])*s]}t.lerp=r})(KC||(KC={}));var iQ;(t=>{let i=180/Math.PI,r=Math.PI/180;function n(l){return typeof l=="number"?l*i:l}function a(l){return typeof l=="number"?l*r:l}function s(l){return[n(l[0]),n(l[1]),n(l[2])]}t.radToDeg=s;function o(l){return[a(l[0]),a(l[1]),a(l[2])]}t.degToRad=o})(iQ||(iQ={}));var u0;(t=>{t.identity=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function i(a,s){for(let o=0;o<16;o++)if(a[o]!==s[o])return!1;return!0}t.isEqual=i;function r(a){return a??t.identity}t.simplify=r;function n(a,s){let o=s.slice(0);for(var l=0,c=s.length;l<c;l+=3){let h=a[3]*s[l]+a[7]*s[l+1]+a[11]*s[l+2]+a[15];o[l]=(a[0]*s[l]+a[4]*s[l+1]+a[8]*s[l+2]+a[12])/h,o[l+1]=(a[1]*s[l]+a[5]*s[l+1]+a[9]*s[l+2]+a[13])/h,o[l+2]=(a[2]*s[l]+a[6]*s[l+1]+a[10]*s[l+2]+a[14])/h}return o}t.applyMatrix4=n})(u0||(u0={}));var ka;(t=>{function i(h){return typeof h=="object"&&typeof h.r=="number"&&typeof h.g=="number"&&typeof h.b=="number"}t.isRGB=i,t.white={r:1,g:1,b:1},t.red={r:1,g:0,b:0},t.black={r:0,g:0,b:0};function r(h){return{r:Math.round(h.r*255),g:Math.round(h.g*255),b:Math.round(h.b*255),a:1}}t.toRgb255a1=r;function n(h){return{r:h.r,g:h.g,b:h.b}}t.clone=n;function a(h){return h=Math.floor(h),{r:(h>>16&255)/255,g:(h>>8&255)/255,b:(h&255)/255}}t.fromHex=a;function s(h){return Math.round(h.r*255)*65536+Math.round(h.g*255)*256+Math.round(h.b*255)}t.toHex=s;function o(h,u){return h.r===u.r&&h.g===u.g&&h.b===u.b}t.equals=o;function l(h,u){return h.r.toFixed(2)===u.r.toFixed(2)&&h.g.toFixed(2)===u.g.toFixed(2)&&h.b.toFixed(2)===u.b.toFixed(2)}t.equalsFixed=l;function c(h,u,d){return{r:h.r+(u.r-h.r)*d,g:h.g+(u.g-h.g)*d,b:h.b+(u.b-h.b)*d}}t.lerp=c})(ka||(ka={}));var Ar;(t=>{t.white={...ka.white,a:1},t.transparent={...ka.white,a:0};function i(c){return{r:c[0],g:c[1],b:c[2],a:c[3]}}t.from0to1=i;function r(c,h){return{...ka.fromHex(c),a:h}}t.fromHexAndA=r;function n(c){return{r:Math.round(c.r*255),g:Math.round(c.g*255),b:Math.round(c.b*255),a:c.a}}t.toRgb255a1=n;function a(c,h){return ka.equals(c,h)&&c.a===h.a}t.equals=a;function s(c,h){return ka.equalsFixed(c,h)&&c.a.toFixed(2)===h.a.toFixed(2)}t.equalsFixed=s;function o(c,h,u){return{r:c.r+(h.r-c.r)*u,g:c.g+(h.g-c.g)*u,b:c.b+(h.b-c.b)*u,a:c.a+(h.a-c.a)*u}}t.lerp=o;function l({r:c,g:h,b:u,a:d}=t.white){return`rgba(${c*255}, ${h*255}, ${u*255}, ${d})`}t.toStyle=l})(Ar||(Ar={}));var OP;(t=>t.identity={position:[0,0,0],rotation:[0,0,0],scale:[1,1,1]})(OP||(OP={}));var rQ;(t=>t.defaultData={mass:1,stiffness:80,damping:10,velocity:0})(rQ||(rQ={}));var nQ;(t=>t.defaultData={control1:[.5,0],control2:[.5,1]}
7715)(nQ||(nQ={}));var Fd;(t=>(t.linear=[0,0,1,1],t.ease=[.25,.1,.25,1],t.easeIn=[.42,0,1,1],t.easeOut=[0,0,.58,1],t.easeInOut=[.42,0,.58,1]))(Fd||(Fd={}));function aQ(t){return typeof t=="string"&&t.length===36?/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t):!1}var Ap;(t=>{t.all=["PerspectiveCamera","OrthographicCamera"];function i(r){return t.all.includes(r)}t.is=i})(Ap||(Ap={}));var d0;(t=>{t.DefaultUp=[0,1,0],t.DefaultTargetOffset=1e3,t.defaultData={far:1e5,type:"OrthographicCamera",perspective:{near:70,fov:45,zoom:1},orthographic:{near:-1e5,zoom:1},up:t.DefaultUp,isUpVectorFlipped:!1,targetOffset:t.DefaultTargetOffset};function i(r){var n,a;return r.type==="PerspectiveCamera"?((n=r.perspective)==null?void 0:n.zoom)??1:((a=r.orthographic)==null?void 0:a.zoom)??1}t.getZoom=i})(d0||(d0={}));var rA;(t=>{function i(n,a=.1){return{disabled:!1,type:"linear",hideBase:!1,count:3,radial:{radius:Math.max(n[0],n[1])*2,start:0,end:360,alignment:!1,axis:"y",scale:[1,1,1],rotation:[0,0,0],position:[0,0,0]},toObject:{object:"",spreadType:"random",scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],axis:"x",seed:0,count:99,align:"normal"},linear:{scale:[1,1,1],rotation:[0,0,0],position:[n[0]+n[0]*a,0,0]},grid:{count:[2,2,2],size:n.map(s=>s*(1+a)),useCenter:!0},randomness:!1,randomnessObject:{strength:100,scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],movement:1,seed:0,freqScale:10,noiseType:"perlin"}}}t.defaultData=i;function r(n,a){let s={...n};
7715if(gK.forEach(o=>{Object.assign(s,{[o]:a[o]??n[o]})}),s.radial={...n.radial},a.radial){let o=n.radial,l=a.radial;vK.forEach(c=>{Object.assign(s.radial,{[c]:l[c]??o[c]})})}if(s.linear={...n.linear},a.linear){let o=n.linear,l=a.linear;_K.forEach(c=>{Object.assign(s.linear,{[c]:l[c]??o[c]})})}if(s.grid={...n.grid},a.grid){let o=n.grid,l=a.grid;yK.forEach(c=>{Object.assign(s.grid,{[c]:l[c]??o[c]})})}if(s.toObject={...n.toObject},a.toObject){let o=n.toObject,l=a.toObject;EK.forEach(c=>{Object.assign(s.toObject,{[c]:l[c]??o[c]})})}if(s.randomnessObject={...n.randomnessObject},a.randomnessObject){let o=n.randomnessObject,l=a.randomnessObject;wK.forEach(c=>{Object.assign(s.randomnessObject,{[c]:l[c]??o[c]})})}return s}t.merge=r})(rA||(rA={}));var NP;(t=>{t.defaultData={radial:{},linear:{},grid:{},toObject:{},randomnessObject:{}};let i=["radial","linear","grid","toObject","randomnessObject"];function r(n,a){let s=[];n.count!==void 0&&s.push({type:0,path:a,props:{count:n.count}});for(let o of i){let l=n[o];l&&Object.keys(l).length>0&&s.push({type:0,path:[...a,o],props:l})}return s}t.toOps=r})(NP||(NP={}));var gK=["count"],vK=["radius","start","end","position","scale","rotation"],_K=["position","scale","rotation"],yK=["count","size"],EK=["count","position","scale","rotation"],wK=["strength","scale","rotation","position","movement","seed","freqScale"],UP;(t=>{t.all=["PointLight","SpotLight","DirectionalLight","HemisphereLight"];function i(r){return t.all.includes(r)}t.is=i})(UP||(UP={}));var FP;(t=>{function i(n){return r(n)}t.defaultData=i;function r(n){if(n==="PointLight")return{type:n,color:Ar.white,intensity:1,distance:2e3,decay:1,shadows:!0,shadowResolution:1024,shadowRadius:1,penumbraSize:.5,depth:1e5};if(n==="SpotLight")return{type:n,color:Ar.white,intensity:1,distance:2e3,decay:1,shadows:!0,penumbra:0,angle:30/180*Math.PI,depth:1e5,penumbraSize:.5,shadowResolution:1024,shadowRadius:1};if(n==="DirectionalLight")return{type:n,color:Ar.white,intensity:1,shadows:!0,size:2e3,depth:1e5,penumbraSize:.5,shadowResolution:1024,shadowRadius:1};throw new Error("not implemented")}})(FP||(FP={}));var XC;(t=>(t.defaultShapeData={type:"PlaneEmitterShape",size:[100,100,100]},t.defaultCollisionData={colliderEntityId:null,collisionBounce:.75},t.defaultData={renderMaterial:{type:"particleMaterial",color:{r:1,g:.2,b:.545,a:1},color2:{r:.945,g:.714,b:.184,a:1},coloring:"gradient",ease:"linearFadeOut",easeSize:"linearFadeOut",transparent:!0,size:[40,40],texture:"pt_default_particle",spriteRotation:[0,0]},birthRatePerSec:50,gravity:1,noiseStrength:0,noiseScale:0,noiseSeed:1,noiseType:"curl",randomRotation:0,randomScale:.2,randomMass:.5,rootObjectType:"instancedMesh",life:1,direction:[0,0,0],directionMode:"axis",speed:10,shape:t.defaultShapeData,autoPlay:!0,emitTimeDelay:0,emitTimeCycle:"infinity",emitTimeDuration:1,...t.defaultCollisionData}))(XC||(XC={}));var A0;(t=>t.defaultData={enabled:"visibility",fusedBody:!0,rigidBody:"positioned",density:1,pointMass:0,gravityScale:1,friction:.5,damping:0,restitution:.2,colliderType:"convex",enabledRotation:[!0,!0,!0],enabledTranslation:[!0,!0,!0]})(A0||(A0={}));var kP;(t=>{t.defaultData={castShadow:!0,receiveShadow:!0};function i(r,n){return r.castShadow===n.castShadow&&r.receiveShadow===n.receiveShadow}t.equals=i})(kP||(kP={}));var HP;(t=>{t.defaultData={flatShading:!1,wireframe:!1,side:0};function i(r,n){return r.flatShading===n.flatShading&&r.side===n.side&&r.wireframe===n.wireframe}t.equals=i})(HP||(HP={}));var GP;(t=>t.defaultData={...HP.defaultData,...kP.defaultData})(GP||(GP={}));var sQ;(t=>{function i(r,n){var s,o;let a=[];if("material"in r){let l=typeof r.material=="string"?n.materials[r.material]??((s=n.lib.materials[r.material])==null?void 0:s.asset):r.material;l&&a.push(l)}else if("materials"in r)for(let l of r.materials){let c=typeof l=="string"?n.materials[l]??((o=n.lib.materials[l])==null?void 0:o.asset):l;c&&a.push(c)}return a}t.getMaterialData=i})(sQ||(sQ={}));var qC;(t=>(t.defaultVideo={data:"",thumb:"/_assets/_videos/catThumb.png",type:"video",name:"Cat video"},t.maxSize=3e7))(qC||(qC={}));var oQ;(t=>{function i(r){return r==="texture"||r==="video"||r==="color"||r==="depth"||r==="normal"||r==="gradient"||r==="noise"||r==="fresnel"||r==="rainbow"||r==="toon"||r==="outline"||r==="particle"||r==="transmission"||r==="matcap"||r==="displace"||r==="pattern"||r==="light"}t.is=i})(oQ||(oQ={}));function Oxe(t){return t.type!=="displace"}var lQ;(t=>{function i(r){return r==="phong"||r==="toon"||r==="lambert"||r==="physical"}t.is=i})(lQ||(lQ={}));var bK=["mode","gradientType","noiseType","displacementType","projection","cnormal","crop","axis","side"],Nxe=["wrapping","image","video","name","minFilter","magFilter"],ua;(t=>{function i(s,o){let{texture:l,...c}=o;if(Object.assign(s,c),l){let h=s.texture;h&&Object.assign(h,l)}}t.patch=i;function r(s,o){return s==="light"&&o?n(o):a(s)}t.defaultData=r;function n(s){let o={mode:0,isMask:!1,visible:!0,bumpMap:void 0,bumpMapIntensity:5,roughnessMap:void 0,alphaOverride:1};switch(s){case"phong":return{...o,category:"phong",specular:{r:.2,g:.2,b:.2},shininess:5,type:"light",visible:!0,mode:0,occlusion:!0,alpha:.6};case"toon":return{...o,category:"toon",specular:{r:.2,g:.2,b:.2},shininess:10,type:"light",alpha:1};case"lambert":return{...o,category:"lambert",emissive:{r:0,g:0,b:0},type:"light",alpha:1,visible:!0,mode:0,occlusion:!0};case"physical":return{...o,category:"physical",roughness:.2,metalness:.2,reflectivity:.2,type:"light",alpha:1,visible:!0,mode:0,occlusion:!0}}}function a(s){let o={alpha:1,mode:0,isMask:!1,visible:!0};switch(s){case"texture":return{...o,type:"texture",size:[128,128],blending:0,axis:"x",side:2,projection:0,texture:{image:"image_0",wrapping:1e3,repeat:[1,1],offset:[0,0],rotation:0,minFilter:1008,magFilter:1006}
vendor: 4,453 bytes, line 7715
7715,crop:!1};case"video":return{...o,type:"video",size:[128,128],blending:0,axis:"x",side:2,projection:0,texture:{video:qC.defaultVideo,wrapping:1001,repeat:[1,1],offset:[0,0],rotation:0,minFilter:1008,magFilter:1006},crop:!1};case"color":return{...o,type:"color",color:ka.fromHex(No)};case"depth":return{...o,type:"depth",gradientType:1,smooth:!1,isVector:!0,isWorldSpace:!1,origin:[0,0,0],direction:[1,0,0],colors:[[1,1,1,1],[0,0,0,1]],steps:[0,1],near:50,far:200};case"normal":return{...o,type:"normal",cnormal:[1,1,1]};case"gradient":return{...o,type:"gradient",gradientType:0,smooth:!1,colors:[[0,0,0,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,1,1,1,1,1,1,1,1,1],num:2,angle:0,offset:[0,0],morph:[0,0]};case"noise":return{...o,type:"noise",size:[100,100,100],noiseType:0,scale:1,move:1,colorA:{...ka.fromHex(6710886),a:1},colorB:{...ka.fromHex(6710886),a:1},colorC:{...ka.fromHex(16777215),a:1},colorD:{...ka.fromHex(16777215),a:1},distortion:[1,1],fA:[1.7,9.2],fB:[8.3,2.8],voronoiStyle:0,highCut:1,lowCut:0,smoothness:.3,seed:0,quality:1};case"fresnel":return{...o,type:"fresnel",color:Ar.fromHexAndA(16777215,1),bias:.1,scale:1,intensity:2,factor:1};case"rainbow":return{...o,type:"rainbow",filmThickness:30,movement:0,wavelengths:[0,0,0],noiseStrength:0,noiseScale:1,offset:[0,0,0]};case"toon":return{...o,type:"toon",positioning:2,colors:[[0,0,0,1],[.5,.5,.5,1],[.5,.5,.5,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1],[1,1,1,1]],steps:[0,.475,.525,1,1,1,1,1,1,1],num:4,source:[0,1e3,0],isWorldSpace:!0,noiseStrength:0,noiseScale:1,shadowColor:Ar.fromHexAndA(0,0),offset:[0,0,0]};case"outline":return{...o,type:"outline",outlineColor:Ar.fromHexAndA(0,1),contourColor:Ar.fromHexAndA(0,1),outlineWidth:2,contourWidth:5,outlineThreshold:.4,contourThreshold:0,outlineSmoothing:0,contourFrequency:10,contourDirection:[0,1,0],positionalLines:!1,compensation:!0};case"matcap":return{...o,type:"matcap",texture:{image:"matcap_0",wrapping:1001,repeat:[1,1],offset:[0,0],rotation:0,minFilter:1008,magFilter:1006}};case"transmission":return{...o,type:"transmission",thickness:10,ior:1.5,roughness:1};case"displace":return{visible:!0,type:"displace",displacementType:"noise",noiseType:0,scale:10,movement:1,offset:[0,0,0],intensity:8,voronoiStyle:0,smoothness:.3,seed:0,highCut:1,lowCut:0,quality:1};case"pattern":return{...o,type:"pattern",style:0,projection:0,axis:"y",blending:0,offset:[0,0],colorA:{...ka.fromHex(0),a:1},colorB:{...ka.fromHex(16777215),a:1},frequency:[10,10],size:.5,variation:0,smoothness:.5,zigzag:0,rotation:0,vertical:[0,1],horizontal:[0,1],sides:6}}}})(ua||(ua={}));var Wa;(t=>{function i(u){return!u.layers.some(d=>d.data.type==="texture"&&d.data.projection!==0||d.data.type==="depth"&&!d.data.isWorldSpace||d.data.type==="noise"||d.data.type==="displace")}t.isMergable=i;function r(u){let d="";return u.layers.forEach(A=>{Object.entries(A.data).forEach(([f,m])=>{d+=`${f}${m}`,Array.isArray(m)?m.forEach(g=>d+=`${g}`):typeof m=="object"?Object.values(m).forEach(g=>{typeof g=="number"?d+=`${g.toFixed(4)}`:d+=`${g}`}):d+=`${m}`})}),d}t.getHash=r;function n(){return{layers:new Pt}}t.defaultEmptyData=n;function a(u="layer1",d="layer2"){return o("phong",u,d)}t.defaultData=a;function s(u,d){return{...u,name:d}}t.withName=s;function o(u,d="layer1",A="layer2"){let f=new Pt;return f.push({fi:0,data:ua.defaultData("light",u),id:d}),f.push({fi:1,data:ua.defaultData("color"),id:A}),{layers:f}}t.defaultTwoLayerData=o;function l(u){let d=ua.defaultData("texture");u&&Object.assign(d.texture,{image:u});let A=new Pt;return A.push({fi:0,data:d,id:"layer1"}),A.push({fi:1,data:{...ua.defaultData("transmission"),alpha:1},id:"layer2"}),A.push({fi:2,data:{...ua.defaultData("light","lambert"),alpha:0},id:"layer3"}),{layers:A}}t.defaultUIObjectMaterial=l;function c(u,d="phong",A="layer1",f="layer2"){let m=ua.defaultData("texture");Object.assign(m.texture,{image:u});let g=new Pt;return g.push({fi:0,data:m,id:A}),g.push({fi:1,data:ua.defaultData("light",d),id:f}),{layers:g}}t.defaultTwoLayerTextureData=c;function h(u,d="phong",A="layer1",f="layer2"){let m=ua.defaultData("video");Object.assign(m.texture,{video:u});let g=new Pt;return g.push({fi:0,data:m,id:A}),g.push({fi:1,data:ua.defaultData("light",d),id:f}),{layers:g}}t.defaultTwoLayerVideoTextureData=h})(Wa||(Wa={}));var ZC;(t=>{function i(){return{points:new Pt,roundness:0,shapeHoles:[],isClosed:!1}
7715}t.defaultData=i})(ZC||(ZC={}));var JC;(t=>{function i(){return{points:new Pt,lastInsertionPlane:null,subdivisions:12,isClosed:!1}}t.defaultData=i})(JC||(JC={}));var SK={type:"Ellipse",width:50,height:50,spikes:16,angle:360,innerRadius:0},zP;(t=>{function i(r,n){let a={...r};return TK.forEach(s=>{Object.assign(a,{[s]:n[s]??r[s]})}),a}t.merge=i})(zP||(zP={}));var CK={shape:SK,depth:1,offset:0,bevel:50,bevelSides:6,angle:0,twist:0,startScale:1,endScale:1,capType:"flat"},TK=["depth","offset","angle","twist","startScale","endScale"],$C;(t=>{function i(n){return n==="PolygonGeometry"||n==="RectangleGeometry"||n==="StarGeometry"||n==="TriangleGeometry"||n==="EllipseGeometry"||n==="UIGeometry"}t.is2DParametricMesh=i;function r(n){return n==="PolygonGeometry"||n==="PolygonGeometry"||n==="RectangleGeometry"||n==="StarGeometry"||n==="TriangleGeometry"||n==="EllipseGeometry"||n==="PathGeometry"||n==="VectorGeometry"||n==="ConeGeometry"||n==="CubeGeometry"||n==="CylinderGeometry"||n==="DodecahedronGeometry"||n==="HelixGeometry"||n==="IcosahedronGeometry"||n==="LatheGeometry"||n==="PyramidGeometry"||n==="SphereGeometry"||n==="PlaneGeometry"||n==="BackdropGeometry"||n==="TorusGeometry"||n==="TorusKnotGeometry"||n==="BooleanGeometry"||n==="TextGeometry"||n==="InputGeometry"}t.isParametricMesh=r})($C||($C={}));var QP;(t=>{function i(r,n){let a={...r};return Object.assign(a,n),a.type==="PathGeometry"&&"extrusion"in n&&n.extrusion&&(a.extrusion={...r.extrusion},Object.assign(a.extrusion,zP.merge(a.extrusion,n.extrusion))),a}t.merge=i})(QP||(QP={}));var Bf;(t=>{function i(r){if(r==="RectangleGeometry")return{width:320,height:320,type:r,cornerRadius:[0,0,0,0],cornerType:0,depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if(r==="UIGeometry")return{type:r,frame:"",cornerRadius:[0,0,0,0],cornerType:0,width:1,height:1};if(r==="PathGeometry")return{type:r,width:1,height:1,depth:1,path:JC.defaultData(),extrusion:CK};if(r==="VectorGeometry")return{width:1,height:1,type:r,subdivisions:12,shape:ZC.defaultData(),depth:0,extrudeBevelSize:0,extrudeBevelSegments:1};if(r==="BooleanGeometry")return{type:r,operation:2,width:0,height:0,depth:0,phongAngle:35};if(r==="TextGeometry")return{type:r,width:100,height:100,depth:0,horizontalAlign:1,verticalAlign:1,fontSize:16,lineHeight:1.2,letterSpacing:0,text:{textValue:""},textTransform:1,font:"Roboto_regular",editable:!1,extrudeBevelSize:0,extrudeBevelSegments:1};if(r==="InputGeometry")return{...t.defaultData("TextGeometry"),type:r,editable:!0};if(r==="SphereGeometry")return{type:"SphereGeometry",width:100,height:100,depth:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:180};throw new Error("not implemented")}t.defaultData=i})(Bf||(Bf={}));var cQ=["width","height","depth"],VP;(t=>t.defaultData={enabled:!1,useBackgroundColor:!1,color:ka.white,near:.1,far:2e3})(VP||(VP={}));var eT;(t=>{let i={opacity:1,blendFunction:13,enabled:!1};t.defaultData={enabled:!1,pixelation:{...i,blendFunction:16,granularity:15},bloom:{...i,blendFunction:16,intensity:1,blurScale:1,luminanceThreshold:.25,luminanceSmoothing:.025,kernelSize:3},chromaticAberration:{...i,offset:[2,2]},vignette:{...i,darkness:1,offset:0},hueSaturation:{...i,hue:3,saturation:0},brightnessContrast:{...i,brightness:.25,contrast:0},depthOfField:{...i,focusDistance:100,focalLength:20,bokehScale:5},noise:{...i,blendFunction:16}}})(eT||(eT={}));var WP;(t=>t.defaultData={softShadowQuality:"low"})(WP||(WP={}));var jP;(t=>t.defaultData={enabled:!0,color:{r:.8274509803921568,g:.8274509803921568,b:.8274509803921568},intensity:.75})(jP||(jP={}));var YP;(t=>t.defaultData={occlusion:!1,aoFullRes:!1,radius:256,bias:.5,aoColor:{r:.19607843137254902,g:.19607843137254902,b:.19607843137254902}})(YP||(YP={}));var f0;(t=>t.defaultData={usePhysics:!1,gravity:-10})(f0||(f0={}));var KP;(t=>t.defaultData={playCamera:W0,gameControlObject:null})(KP||(KP={}));var XP;(t=>t.defaultData={backgroundColor:Ar.fromHexAndA(Lxe,1),postprocessing:eT.defaultData,fog:VP.defaultData,globalPhysics:f0.defaultData,ambient:jP.defaultData,ao:YP.defaultData,shadow:WP.defaultData,publish:KP.defaultData})(XP||(XP={}));var qP;(t=>
vendor: 4,765 bytes, line 7715
7715t.defaultData={colliderType:"box",size:[100,100,100],colliderHelperVisible:!0,forceType:"collider",forceRange:"global",forceIntensity:.5,forceDambing:.95})(qP||(qP={}));var hQ;(t=>{function i(n){return n==="Component"||n==="Instance"}t.isComponentRelated=i;function r(n){return n==="Empty"||n==="Instance"}t.isEmptyOrComponent=r})(hQ||(hQ={}));var p0;(t=>{t.identity={...OP.identity,hiddenMatrix:u0.identity};function i(a){return{position:a.position,rotation:a.rotation,scale:a.scale,hiddenMatrix:a.hiddenMatrix}}t.fromObject=i;function r(a,s){return{position:(s==null?void 0:s.position)||a.position,rotation:(s==null?void 0:s.rotation)||a.rotation,scale:(s==null?void 0:s.scale)||a.scale,hiddenMatrix:(s==null?void 0:s.hiddenMatrix)||a.hiddenMatrix}}t.merge=r;function n(a,s){return zY({position:ip.isEqual(a.position,s.position)?void 0:s.position,rotation:ip.isEqual(a.rotation,s.rotation)?void 0:s.rotation,scale:ip.isEqual(a.scale,s.scale)?null:s.scale,hiddenMatrix:u0.isEqual(a.hiddenMatrix,s.hiddenMatrix)?void 0:s.hiddenMatrix})}t.diff=n})(p0||(p0={}));var wa;(t=>t.defaultData={states:new Pt,events:new Pt,visible:!0,raycastLock:!1,physics:A0.defaultData,pathSnapping:{pathId:null,slide:0,offset:0,orientation:"tangential"},...p0.identity,cloner:null})(wa||(wa={}));var ZP;(t=>t.defaultData={type:"Empty",...wa.defaultData})(ZP||(ZP={}));var uQ;(t=>t.defaultData={type:"ParticleCollider",...qP.defaultData,...wa.defaultData})(uQ||(uQ={}));var dQ;(t=>t.defaultData={type:"Component",...wa.defaultData})(dQ||(dQ={}));var AQ;(t=>t.defaultData={type:"Particle",...wa.defaultData,...XC.defaultData})(AQ||(AQ={}));var If;(t=>t.defaultData={type:"Mesh",...wa.defaultData,...GP.defaultData})(If||(If={}));var Fy;(t=>t.defaultData={...wa.defaultData,...p0.identity,position:[0,0,d0.DefaultTargetOffset],...d0.defaultData})(Fy||(Fy={}));var JP;(t=>{function i(r){return{...wa.defaultData,...FP.defaultData(r)}}t.defaultData=i,t.defaultDirectionalLightData={...t.defaultData("DirectionalLight"),position:[200,300,300],name:"Directional Light",intensity:.7}})(JP||(JP={}));var tT;(t=>{function i(n,a,s=0){for(;s<a.length;){let o=n?n[a[s]]:void 0;if(a.length===s+1)return o;if(o)n=o.descendants,s+=1;else return}}t.resolveWithDes=i;function r(n,a,s=0){let o=i(n,a,s);if(o){let l=Object.keys(o);if(l.length===1&&l[0]==="descendants")return}return o}t.resolve=r})(tT||(tT={}));var nA;(t=>{t.rootOverrideProps=["physics","events"],t.compositeNonOptionalOverrideProps=["geometry"],t.compositeEntireOverrideOverrideProps=["material"];function i(n,a){return{...wa.defaultData,...a,component:n,overrides:new Fn,physics:void 0,events:void 0,type:"Instance"}}t.ofComponent=i;function r(n){let a=p0.fromObject(n.data);return i(n.id,a)}t.fromComponentData=r})(nA||(nA={}));var m0;(t=>{t.defaultData={type:"Page",...wa.defaultData,physics:{...A0.defaultData,fusedBody:!1},...XP.defaultData,camera:Fy.defaultData};function i(r){return r.uiScene!==void 0}t.isUIPage=i})(m0||(m0={}));var $P;(t=>(t.defaultCamera={position:[0,0,1e3],scale:[1,1,1],rotation:[0,0,0],hiddenMatrix:u0.identity,name:"Play Camera",visible:!0,raycastLock:!1,physics:A0.defaultData,states:new Pt,events:new Pt,cloner:null,pathSnapping:{pathId:null,orientation:"tangential",slide:0,offset:0},...d0.defaultData},t.KeysByResetCategory={States:["states"],Events:["events"],Material:["material","materials"],Geometry:["geometry"],Position:["position"],Rotation:["rotation"],Scale:["scale"],Transform:["position","scale","rotation","hiddenMatrix"],Name:["name"],Visibility:["visible","raycastLock","flatShading","wireframe","side"],Shadows:["castShadow","receiveShadow"],Cloner:["cloner"],Physics:["physics"]},t.defaultMeshObject={name:"Rectangle",...wa.defaultData,...If.defaultData,geometry:Bf.defaultData("RectangleGeometry"),material:Wa.defaultTwoLayerData("phong","layer1","layer2")},t.defaultBooleanObject={name:"Boolean",...wa.defaultData,...If.defaultData,geometry:Bf.defaultData("BooleanGeometry"),material:Wa.defaultTwoLayerData("phong","layer1","layer2")},t.defaultTextObject={name:"Text",...wa.defaultData,...If.defaultData,geometry:Bf.defaultData("TextGeometry"),material:Wa.defaultTwoLayerData("phong","layer1","layer2")},t.defaultInputObject={name:"Input",...wa.defaultData,...If.defaultData,geometry:Bf.defaultData("InputGeometry"),material:Wa.defaultTwoLayerData("phong","layer1","layer2")}))($P||($P={}));var Df;(t=>{function i(s,o){let l={name:o};return s.type==="Mesh"?(l.geometry={},"material"in s&&(l.material={layers:new Fn}),"materials"in s&&(l.materials=s.materials.map(c=>({layers:new Fn})))):Ap.is(s.type)&&(l.perspective={},l.orthographic={}),l}t.newEmpty=i;function r(s,o){if(o===void 0)return s;let l={...s};return"material"in l&&"material"in o&&o.material&&(l.material=Uy(l.material,c=>
7715{if(typeof c!="string")for(let[h,u]of Object.entries(o.material.layers)){let d=c.layers.data(h);d&&ua.patch(d,u)}}).data),l.materials&&o.materials&&(l.materials=Uy(l.materials,c=>{var h,u;for(let d=0;d<l.materials.length;d++){let A=o.materials[d];if(typeof A!="string")for(let[f,m]of Object.entries(A.layers)){let g=(u=(h=c[d])==null?void 0:h.layers)==null?void 0:u.data(f);g&&ua.patch(g,m)}}}).data),l}function n(s,o){let l,c=[],h={orthographic:0,perspective:0,geometry:0};function u(d,A){for(let[f,m]of Object.entries(A.layers)){let{texture:g,...p}=m;if(g!==void 0&&Object.keys(g).length>0){let v={path:[...d,"layers",f,"texture"],props:g,type:0};c.push(v)}if(Object.keys(p).length>0){let v={path:[...d,"layers",f],props:p,type:0};c.push(v)}}}for(let[d,A]of Object.entries(o))if(d!=="name")if(d==="cloner")c.push(...NP.toOps(A,["cloner"]));else if(d==="pathSnapping")c.push({path:[d],props:{slide:A.slide,offset:A.offset},type:0});else if(d==="material")u(["material"],A);else if(d==="materials")for(let[f,m]of Object.entries(A))u(["materials",f],m);else if(h[d]===0){if(d==="geometry"&&A.extrusion!==void 0){let f={path:[d,"extrusion"],props:A.extrusion,type:0};c.push(f),A={...A},delete A.extrusion}if(Object.keys(A).length>0){let f={path:[d],props:A,type:0};c.push(f)}}else l===void 0&&(l={path:[],props:{},type:0},c.push(l)),l.props[d]=A;return c}t.toOps=n;function a(s,o){var c,h,u,d,A,f;if(o===void 0)return s;let l={...s};if(Object.assign(l,p0.merge(l,o)),Object.assign(l,{pathSnapping:Object.assign({},l.pathSnapping,{slide:((c=o.pathSnapping)==null?void 0:c.slide)??((h=l.pathSnapping)==null?void 0:h.slide)??0,offset:((u=o.pathSnapping)==null?void 0:u.offset)??((d=l.pathSnapping)==null?void 0:d.offset)??0})}),Ap.is(s.type)){l.orthographic={...l.orthographic},l.perspective={...l.perspective};let m=o;((A=m.orthographic)==null?void 0:A.zoom)!==void 0&&(l.orthographic.zoom=m.orthographic.zoom),((f=m.perspective)==null?void 0:f.zoom)!==void 0&&(l.perspective.zoom=m.perspective.zoom),m.isUpVectorFlipped!==void 0&&(l.isUpVectorFlipped=m.isUpVectorFlipped),m.targetOffset!==void 0&&(l.targetOffset=m.targetOffset)}else if(s.type==="Mesh")"geometry"in o&&Object.assign(l,{geometry:QP.merge(l.geometry,o.geometry)}),(o.material||o.materials)&&(l=r(l,o)),l.cloner&&"cloner"in o&&Object.assign(l,{cloner:rA.merge(l.cloner,o.cloner)});else if(s.type==="Empty")l.cloner&&"cloner"in o&&Object.assign(l,{cloner:rA.merge(l.cloner,o.cloner)});else if(UP.is(s.type)){let m=o;m.intensity!==void 0&&(l.intensity=m.intensity),m.color!==void 0&&(typeof m.color=="string"?l.color=m.color:l.color=ka.clone(m.color))}return l}t.patch=a})(Df||(Df={}));var iT;(t=>t.defaultData={enablePan:!0,enableZoom:!0,enableRotate:!0,enableDamping:!0,rotationLimitsMode:0,rotationVerticalOffset:{min:Math.PI/4,max:Math.PI/4},rotationHorizontalOffset:{min:Math.PI/4,max:Math.PI/4},rotationSoftLimit:2,panLimitsMode:0,panVerticalOffset:{min:250,max:250},panHorizontalOffset:{min:250,max:250},panSoftLimit:2,zoomLimitsEnabled:!1,zoomLimits:{min:.1,max:2},autoRotate:!1,autoRotateSpeed:2,autoRotateClockwise:!0,hoverRotatePanMode:0,hoverRotatePanStrength:20,hoverRotateDamping:.125,isTouchZoom:!0,orbitTouches:2,panTouches:3,resetHoverEffectOnPointerLeave:!0})(iT||(iT={}));var aA;(t=>t.defaultData={orbitControls:iT.defaultData,playPage:q_,withBackground:!0,preventScroll:!1,preventTouchScroll:!1,hideCursor:!1,mouseEventTarget:"canvas",joystickSizeAndXYOffset:Array(12).fill(0).map((i,r)=>{let n=0,a=0;return r<5?a=-30:r<10&&(a=30),r===0||r===10||r===5?n=30:(r===4||r===11||r===9)&&(n=-30),[120,[n,a],"show"]}),settings:{image:{format:"jpg",ratio:1},video:{format:"mp4",imageFormat:"jpg",fps:30,mbps:80,ratio:Math.max(1,typeof window<"u"?Math.floor(window.devicePixelRatio):1),stopMode:"manual",duration:5e3},web:{logo:!0,compress:!0,preset:1,preload:!0,hint:!1,imageQuality:70}},stopRaycast:!0,hdTransmission:!1})(aA||(aA={}));var eL;(t=>t.defaultData={id:"basic",label:"Basic",style:"None",prompt:""})(eL||(eL={}));var tL;(t=>t.defaultData={weather:0,shadows:0,lightOrigin:0,temperature:0,sun:0,camera:0,environment:0,particles:0,nature:0,floor:0})(tL||(tL={}));var Pf;(t=>(t.defaultData=()=>({mode:"line-art-both",prompt:"",negativePrompt:"",style:{...eL.defaultData},isRandomSeed:!0,seed:t.generateSeed(),guessMode:!1,advanced:!1,steps:20,guidanceScale:7.5,controlNetScale:1,modifiers:tL.defaultData}),t.generateSeed=()=>Math.round(Math.random()*1e5)))(Pf||(Pf={}));var ky;(t=>{function i(n){return n.find(a=>a.data.type==="Page"&&a.data.globalPhysics.usePhysics)!==void 0}t.physicsEnabled=i;function r(n,a,s){n.scene.objects.traverseFrom(a,(o,l)=>{var c;if(l.type==="Instance"){let h=(c=aT.getComponentData(n,l.component))==null?void 0:c.data;h&&s(o,l,h.events)}else s(o,l,l.events)})}t.traverseModuleInstances=r})(ky||(ky={}));var Lf;(t=>{t.TRASH_CAN_ID="830a2708-8ed9-49cf-a68e-085299892222",t.defaultLight={fi:-1,data:JP.defaultDirectionalLightData,id:"830a2708-8ed9-49cf-a68e-085299899103",children:[]};function i(a=!0,s=[]){let o=[],l=$P.defaultMeshObject;a&&(o.push({...t.defaultLight}
vendor: 13,534 bytes, line 7715
7715),o.push({fi:1,id:"7ba78968-2a55-48f2-b14c-5191da3e075e",data:l,children:[]})),o.push(...s);let c=new Va;return c.push({fi:1,id:q_,data:{...m0.defaultData,name:"Scene 1"},children:o}),c}t.createDefaultObjectTreeWithPage=i,t.defaultData={objects:i(),publish:aA.defaultData,styles:Pf.defaultData()},t.emptyDataWithoutPage=function(){return{objects:new Va,publish:aA.defaultData,styles:Pf.defaultData()}},t.emptyDataWithPage=function(a=!0){return{objects:i(a),publish:aA.defaultData,styles:Pf.defaultData()}},t.emptyData=function(){return{objects:new Va,publish:{...aA.defaultData},styles:Pf.defaultData()}};function r(a){return{...t.defaultData,objects:Sl(a,Va.prototype)}}t.withObjs=r;function n(a,s){return r([{id:a,data:s,children:[],fi:0}])}t.withObj=n})(Lf||(Lf={}));var Z_;(t=>t.defaultData={preset:"fullscreen",allowResponsive:!1,size:[512,512],coords:[0,0],sceneScale:1,color:{r:0,g:0,b:0,a:.5}})(Z_||(Z_={}));var iL;(t=>(t.defaultData=i=>({url:i,name:"New Webhook",parametersSchemas:new Pt}),t.defaultParameterValueByType=i=>i==="number"?0:i==="boolean"?!1:""))(iL||(iL={}));var fQ;(t=>t.defaultData=(i,r="GET")=>({url:i,method:r,name:"New API",headers:new Pt,queries:new Pt,autoStart:!0}))(fQ||(fQ={}));var ja;(t=>{function i(o){return o.textValue!==void 0}t.isTextValue=i;function r(o){return typeof o=="number"}t.isNumber=r;function n(o){return typeof o=="boolean"}t.isBoolean=n;function a(o){return i(o)?"string":n(o)?"boolean":"number"}t.typeOfVariable=a;function s(o){return t.isTextValue(o)?Array.isArray(o.textValue)?o.textValue.map(l=>l.toString().padStart(o.padding??2,"0")).join(o.deliminator??":")+(o.suffix!==void 0?" "+o.suffix:""):o.textValue.toString():t.isBoolean(o)?o?"True":"False":t.isNumber(o)?parseFloat(o.toFixed(3)).toString():o.toString()}t.getDisplayedValue=s})(ja||(ja={}));var rL;(t=>t.all=["images","videos","colors","audios","particles","fonts","materials","variables"])(rL||(rL={}));var pQ;(t=>t.all=[...rL.all,"components"])(pQ||(pQ={}));var mQ;(t=>{function i(){return{images:new kt,videos:new kt,colors:new kt,audios:new kt,particles:new kt,fonts:new kt,materials:new kt,components:new kt,variables:new kt,userAPIs:new kt,userWebhooks:new kt}}t.defaultData=i})(mQ||(mQ={}));var Vu;(t=>{function i(){return{images:new kt,videos:new kt,colors:new kt,audios:new kt,particles:new kt,fonts:new kt,materials:new kt,components:new kt,variables:new kt,userAPIs:new kt,userWebhooks:new kt}}t.defaultData=i})(Vu||(Vu={}));var Jo;(t=>{function i(){let o={};return o["89b10010-844c-11ec-a8a3-0242ac120002"]={r:.5,g:.5,b:.5,a:1,name:"Default Color"},Sl(o,kt.prototype)}t.defaultColors=i;function r(){return Sl({},kt.prototype)}t.defaultImages=r;function n(){return{catelogs:new kt,materials:new kt,images:new kt,videos:new kt,colors:new kt,audios:new kt,particles:new kt,fonts:new kt,variables:new Pt,userAPIs:new kt,userWebhooks:new kt,lib:Vu.defaultData()}}t.emptyData=n;function a(o){switch(o){case"number":return{value:0,name:"Number"};case"boolean":return{value:!1,name:"Boolean"};case"string":return{value:{textValue:"String value"},name:"String"};case"time":let l=[0,0,0];return{name:"Time",value:{textValue:l,deliminator:":",padding:2,suffix:"AM"},dynamicVariableType:"time",format:"HH:mm:ss",format12h24h:"12ampm",timeZone:null,hasEnd:!1,endValue:{textValue:l,deliminator:":",padding:2,suffix:"AM"},autoStart:!0,repeat:!1};case"counter":return{name:"Counter",value:0,dynamicVariableType:"counter",updateInterval:1e3,increment:1,autoStart:!0,hasEnd:!0,endValue:60,repeat:!0,randomStart:!1,range:[0,100],decimals:0};case"random":return{name:"Random",value:0,dynamicVariableType:"random",updateInterval:1e3,increment:1,autoStart:!0,isStatic:!1,hasEnd:!0,endValue:60,repeat:!0,min:0,max:100,decimals:0};default:console.error("Unknown variable type",o)}}t.defaultVariables=a;function s(o,l){if(l.format==="HH:mm:ss"){let c=Math.floor(o/3600),h=Math.floor((o-c*3600)/60),u=Math.round(o-c*3600-h*60);return{textValue:[c,h,u]}}else if(l.format==="mm:ss"){let c=Math.floor(o/60),h=Math.round(o-c*60);return{textValue:[c,h]}}else return l.format==="number"?o=Math.round(o):o=Math.round(o*1e3)/1e3,o}t.getFormattedTimerTime=s})(Jo||(Jo={}));var rT;(t=>t.list=["idle","move","jump","run"])(rT||(rT={}));var nT;(t=>(t.defaultColliderData={type:"capsule",height:200,radius:50,position:[0,0,0],rotation:[0,0,0]},t.defaultDataThirdPerson={moveMode:"walk",forwardDirection:"+z",speedTranslate:1e3,speedRotate:100,runMultiplier:2,rotationMode:"normal",rotBy:"keys",rotByTouch:"drag",delayPos:[.3,.3],delayRot:[.3,.3],keyAssignments:[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","â²"],["rotPosY","â"],["rotNegX","â¼"],["rotNegY","â¶"],["jump","Space"],["run","â§"],["none","Ctrl"]],touchControl:!0,joystickPosLoc:5,joystickRotLoc:11,jumpTouchButtonLoc:9,collider:t.defaultColliderData,colliderHelperVisible:!0,collisionEnabled:!0,jumpPower:100,resetYPosition:3e3,alignToGround:!1,autoOrientMove:!0,orientWith:"camera",orientMode:"radial",delayPosCamera:.3,delayRotCamera:.3,camera:"",cameraXAxis:"Limit",cameraYAxis:"Free",cameraRotXLimits:[0,Math.PI/2],cameraRotYLimits:[-Math.PI/2,Math.PI/2],gameActions:{idle:new Pt,move:new Pt,jump:new Pt,run:new Pt},navmesh:{enabled:!1,ch:6,cs:6,walkableClimb:5,walkableHeight:1,walkableRadius:0,zones:"all",objects:[],helperVisible:!0,destinationHelperRadius:0,destinationHelperColor:Ar.fromHexAndA(3728051,1)}}))(nT||(nT={}));function gQ(t){t.layers.forEach(i=>{if(i.type==="depth"&&i.colorA!==void 0){let r=i.colorA,n=i.colorB,a=[[r.r,r.g,r.b,r.a],[n.r,n.g,n.b,n.a]],s=[0,1];for(let l=2;l<10;l++)a.push(a[1]),s.push(1);let o={...Pu(wn(i),"type","visible","isVector","isWorldSpace","origin","alpha","mode"),near:Math.max(0,i.near),far:Math.max(0,i.far),colors:a,steps:s,num:2,direction:[1,0,0],smooth:!1,gradientType:1};Object.assign(i,o)}else if(i.type==="depth"&&i.gradientType===1&&(i.near<0||i.far<0)){let r={...wn(i),near:Math.max(i.near,0),far:Math.max(i.far,0)};Object.assign(i,r)}})}function Vd(t,i){Object.values(t.shared.materials).forEach(r=>i(r))}function Wd(t,i){t.scene.objects.traverse((r,n)=>{"materials"in n?n.materials.forEach((a,s)=>{a===void 0&&(n.materials[s]=Wa.defaultData(),a=n.materials[s]),typeof a!="string"&&i(a)}):"material"in n?typeof n.material!="string"&&(n.material===void 0&&(n.material=Wa.defaultData()),i(n.material)):n.type==="Mesh"&&(n.material===void 0&&(n.material=Wa.defaultData()),i(n.material)),"overrides"in n&&Object.values(n.overrides).forEach(a=>{a.material&&typeof a.material!="string"&&Object.getPrototypeOf(a.material)!==Fn.prototype&&i(a.material)})})}function Uxe(t){Object.assign(t.scene.publish,{orbitControls:{...iT.defaultData,...wn(t.scene.publish.orbitControls)}})}function Fxe(t){Object.assign(t.scene.publish.settings,{video:{...aA.defaultData.settings.video,...wn(t.scene.publish.settings.video)}})}function kxe(t){function i(r){if(r.layers){for(let n of Object.values(r.layers))if(n){for(let[a,s]of Object.entries(n))if((bK.includes(a)||typeof s=="boolean")&&delete n[a],a==="texture")for(let[o,l]of Object.entries(s))(Nxe.includes(o)||typeof l=="boolean")&&delete s[o]}}}t.scene.objects.traverse((r,n)=>{n.states.forEach(a=>{let s=a;s.material?i(s.material):s.materials&&s.materials.forEach(o=>{i(o)})})})}function Hxe(t){t.scene.publish.withBackground=!0}function Gxe(t){t.scene.publish.settings.web={compress:!0,preload:!0,preset:1,logo:!0,hint:!1}}function zxe(t){t.scene.objects.traverse((i,r)=>{let n=r.cloner;n&&(n.radial.scale=n.radial.scale.map(a=>a+1),n.linear.scale=n.linear.scale.map(a=>a+1))})}function Qxe(t){t.scene.objects.traverse((i,r)=>{let n=r.geometry;n&&(n.type==="DodecahedronGeometry"||n.type==="IcosahedronGeometry")&&(n.detail=Math.round(n.detail))})}function Vxe(t){t.scene.objects.traverse((i,r)=>{let n=t.scene.objects.unproxy().parent(i);if(n){let a=wn(t.scene.objects.data(n));a&&a.type==="Mesh"&&a.geometry.type==="BooleanGeometry"&&r.type==="Mesh"&&(r.visible=wn(r).booleanExclude!==!0)}})}function Wxe(t){t.scene.objects.traverse((i,r)=>{if(r.type==="Mesh"){let n=r;r.geometry.type==="NonParametricGeometry"?n.material!==void 0&&delete n.material:n.materials!==void 0&&delete n.materials}})}function jxe(t){function i(n){Object.setPrototypeOf(n,Fn.prototype),n.texture&&Object.setPrototypeOf(n.texture,Fn.prototype)}function r(n){Object.setPrototypeOf(n,Fn.prototype);for(let a in n)i(n[a])}t.scene.objects.traverse((n,a)=>{a.states.forEach(s=>{let o=s;if(o.material){let l=wn(o.material).layers;r(l),o.material.layers=l}if(o.materials)for(let l=0;l<o.materials.length;l++){let c=o.materials[l],h=wn(c).layers;r(h),c.layers=h}})})}function vQ(t){t.layers===void 0&&Object.assign(t,Wa.defaultTwoLayerData("lambert"))}function fI(t){!t.layers||t.layers.forEach(i=>{if(i.type==="depth"&&i.colors.length===10){let r=[...i.colors];r.push(i.colors[9]);let n=[...i.steps];n.push(i.steps[9]);let a={...wn(i),colors:r,steps:n};Object.assign(i,a)}})}function Yxe(t){t.scene.objects.traverse((i,r)=>{r.type==="Mesh"&&(r.geometry.type==="BooleanGeometry"||r.geometry.type==="SubdivGeometry")&&(r.geometry.phongAngle=35)})}function _Q(t){t.scene.objects.traverse((i,r)=>{"materials"in r?r.materials.forEach(n=>{typeof n!="string"&&fI(n)}):"material"in r&&typeof r.material!="string"&&fI(r.material)}),Object.values(t.shared.materials).forEach(i=>fI(i))}function Kxe(t){t.scene.environment.ambientLight.softShadows=!1,t.scene.environment.ambientLight.softShadowQuality="low",t.scene.objects.traverse((i,r)=>{(r.type==="DirectionalLight"||r.type==="SpotLight")&&(r.shadowResolution=1024,r.shadowRadius=1,r.depth=1e5)}),t.shared.penumbraSize=new Array(5).fill(.5)}function Xxe(t){t.shared.audios=Sl({},kt.prototype)}function qxe(t){t.shared.videos=Sl({},kt.prototype)}function Zxe(t){let i=t.shared.materials;Object.entries(i).forEach(([r,n])=>{if(!n.layers){let a={name:"Untitled Material",layers:[{fi:0,data:{type:"light",category:"phong",alpha:.6,visible:!0,mode:0,specular:{r:.2,g:.2,b:.2},shininess:5},id:"layer1"},{fi:1,data:{type:"color",alpha:1,visible:!0,mode:0,color:{r:.2823529411764706,g:.2823529411764706,b:.30196078431372547}},id:"layer2"}]};Object.assign(i,{[r]:a})}})}function Jxe(t){Object.entries(wn(t.shared.images)).filter(i=>i[1].asset===!1).map(i=>i[0]).forEach(i=>{delete t.shared.images[i]}),Object.entries(wn(t.shared.audios)).filter(i=>i[1].asset===!1).map(i=>i[0]).forEach(i=>{delete t.shared.audios[i]})}function $xe(t){t.scene.publish.settings.web.preload=!1}function yQ(t){t.layers&&t.layers.forEach(i=>{i.type==="depth"&&i.num!==void 0&&(i.colors=i.colors.slice(0,i.num),i.steps=i.steps.slice(0,i.num),delete i.num)})}function EQ(t){t.layers&&t.layers.forEach(i=>{Oxe(i)&&i.isMask===void 0&&(i.isMask=!1),(i.type==="texture"||i.type==="video")&&i.blending===void 0&&(i.blending=0),(i.type==="noise"||i.type==="displace"&&i.displacementType==="noise")&&(i.voronoiStyle===void 0&&(i.voronoiStyle=0),i.highCut===void 0&&(i.highCut=1),i.lowCut===void 0&&(i.lowCut=0),i.smoothness===void 0&&(i.smoothness=.3),i.seed===void 0&&(i.seed=0),i.quality===void 0&&(i.quality=1))})}function eRe(t){t.shared.fonts=Sl({},kt.prototype)}function tRe(t){return t.replace(".typeface","").replace(/optimer/gi,"open sans").replace("space_mono","space mono").replace(/alma_mono/gi,"varela round").replace(/droid_sans_mono/gi,"noto sans mono").replace(/droid_sans|gentilis|gnomon_(simple|foreground)|helvetiker/gi,"roboto").replace(/droid_serif/gi,"roboto slab").replace("_sans"," sans").replace("crimson_text","crimson text").replace("medium_medium","medium").replace("fatface_fatface","fatface").replace("100hairline","thin").replace("200thin","extralight").replace("300light","light").replace("500medium","medium").replace("600semi","semibold").replace("800heavy","extrabold").replace("900black","black").replace(/bodoni_(11|16|24|36|48|72|96)([^_])/gi,"bodoni_$1_$2").replace(/bodoni_(11|16|24|36|48|72|96)/gi,"bodoni moda").replace(/(thin|hairline)(_regular)?/gi,"100").replace(/(extra|ultra)light(_regular)?/gi,"200").replace(/light(_regular)?/gi,"300").replace(/_book|_normal|_roman/gi,"_regular").replace(/medium(_regular)?/gi,"500").replace(/(semi|demi)bold(_regular)?/gi,"600").replace(/(extra|ultra)bold(_regular)?/gi,"800").replace(/bold(_regular)?/gi,"700").replace(/(black|heavy|fatface)(_regular)?/gi,"900").replace(/([1-9]00)_italic/gi,"$1italic").replace(/regularitalic/gi,"italic").replace(/regularitalic/gi,"italic").split(" ").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function iRe(t){let i=[];t.scene.objects.traverse((r,n)=>{let a=n;if(a.type==="TextFrame"){let s=Wa.defaultTwoLayerData("phong"),o=typeof a.color=="string"?t.shared.colors[a.color]:a.color;s.layers[1].data.color={r:o.r,g:o.g,b:o.b},s.layers[1].data.alpha=a.alpha;let l=tRe(a.font);t.shared.fonts[l]===void 0&&(t.shared.fonts[l]={name:l});let c={name:a.name,...wa.defaultData,...If.defaultData,flatShading:!1,wireframe:!1,geometry:{...Bf.defaultData("TextGeometry"),width:a.width,height:a.height,font:l,depth:0,horizontalAlign:a.horizontalAlign,verticalAlign:a.verticalAlign,fontSize:a.fontSize*1.40625,lineHeight:a.lineHeight/1.40625,letterSpacing:a.letterSpacing-1,text:a.text,textTransform:a.textTransform,extrudeBevelSize:0,extrudeBevelSegments:1},material:s,states:wn(a.states),events:wn(a.events),visible:a.visible,raycastLock:a.raycastLock,position:a.position,rotation:a.rotation,scale:a.scale,hiddenMatrix:a.hiddenMatrix},h=wn(t.scene.objects).parent(r);t.scene.objects.insertAfter(h??null,r,[{id:r+"new",data:c,children:[]}]),i.push(r)}}
7715),i.forEach(r=>{t.scene.objects.delete(r)})}function rRe(t){let i={0:"MouseDown",1:"MouseUp",2:"MouseHover",5:"KeyDown",6:"KeyUp",7:"Start",9:"LookAt",10:"Follow",11:"Scroll",12:"Audio",13:"GameControl"};t.scene.objects.traverse((r,n)=>{n.events.forEach(a=>{if(i[Number(a.type)])if(Object.assign(a,{type:i[Number(a.type)]}),a.type==="Audio"&&"audioEvent"in a&&(Object.assign(a,{playAudio:a.audioEvent}),delete a.audioEvent),a.type==="GameControl")Object.assign(a,{gameActions:{idle:new Pt,move:new Pt,jump:new Pt}});else{let s=new Pt;Object.assign(a,{actions:s}),(a.type==="MouseDown"||a.type==="MouseUp"||a.type==="KeyDown"||a.type==="KeyUp")&&"url"in a&&s.push({fi:0,id:Ct.generateUUID(),data:{type:"Link",url:a.url,delay:0}}),"targets"in a&&(a.targets.forEach((o,l,c)=>{let h={state:void 0,repeat:0,delay:0,delayDirection:void 0,direction:"normal",duration:0,easing:4},u={easing:o.easing,duration:o.duration};o.easing===6?Object.assign(u,Pu(o,"mass","stiffness","damping","velocity")):o.easing===5&&Object.assign(u,{control1:{...o.control1},control2:{...o.control2}});let d={repeat:o.repeat?-1:0,delay:o.delay,delayDirection:o.delayDirection,direction:o.cycle&&o.rewind?"pingpong-rewind":o.cycle?"pingpong":"normal"},A={state:o.state,...d,...u},f={allowSlerp:!0,type:"Transition",object:o.object,repeat:0,delay:0,delayDirection:void 0,direction:"normal",tweens:new Pt({fi:0,id:Ct.generateUUID(),data:h},{fi:1,id:Ct.generateUUID(),data:A})};s.push({fi:c,id:l,data:f})}),delete a.targets)}})})}function nRe(t){t.scene.objects.traverse((i,r)=>{function n(a,s){var c;let o=new Pt,l=[];if(r.events.forEach((h,u,d)=>{if(h.type==="Audio"&&h.trigger===s){let A;l.push(u),h.interaction==="play"?A={...Pu(h,"interaction","audio","delay","volume","loop"),triggerAfter:"after"in h?h.after:void 0,toggle:"after"in h?h.toggle:void 0,type:"Audio"}:(h.interaction==="pause"||h.interaction==="stop")&&(A={...Pu(h,"interaction","delay","object","playAudio"),type:"Audio"}),A&&o.push({fi:d,id:u,data:A})}}),l.forEach(h=>r.events.delete(h)),o.length){let h=(c=r.events.find(u=>u.type===a))==null?void 0:c.data;h?"actions"in h&&h.actions.insertBefore(null,o):r.events.insertBefore(null,[{id:Ct.generateUUID(),data:{type:a,actions:o}}])}}n("Start","start"),n("MouseDown","mouseDown"),n("MouseUp","mouseUp"),n("KeyDown","keyDown"),n("KeyUp","keyUp")})}function wQ(t){var r;let i=(r=t.layers.find(n=>n.type==="light"))==null?void 0:r.data;if((i==null?void 0:i.category)==="basic"){let n=ua.defaultData("light","phong"),a=i;Object.assign(a,n),a.visible=!1}}function bQ(t){Vd(t,wQ),Wd(t,wQ)}function aRe(t){t.scene.objects.traverse((i,r)=>{r.type==="Mesh"&&r.geometry.type==="SubdivGeometry"&&(r.geometry.scaleBaked||(r.geometry.scaleBaked=[1,1,1]))})}function sRe(t){t.scene.objects.traverse((i,r)=>{(r.type==="Empty"||r.type==="Mesh")&&r.cloner&&!r.cloner.randomnessObject&&!r.cloner.toObject&&!r.cloner.randomness&&(r.cloner={...r.cloner,toObject:{object:"",spreadType:"random",scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],axis:"x",seed:0,count:99,align:"normal"},randomness:!1,randomnessObject:{strength:100,scale:[0,0,0],rotation:[0,0,0],position:[0,0,0],movement:1,seed:0,freqScale:10,noiseType:"perlin"}})})}function oRe(t){t.scene.objects.traverse((i,r)=>{r.type==="Mesh"&&r.geometry.type==="NonParametricGeometry"&&!("material"in r)&&!("materials"in r)&&(r.material=Wa.defaultTwoLayerData("phong"))})}function lRe(t){t.scene.publish.orbitControls.autoZoom===void 0&&(t.scene.publish.orbitControls.autoZoom=!1),t.scene.objects.traverse((i,r)=>{(r.type==="OrthographicCamera"||r.type==="PerspectiveCamera")&&(r.orthographic.autoZoom===void 0&&(r.orthographic.autoZoom=!1),r.orthographic.autoZoomFrustumSize===void 0&&(r.orthographic.autoZoomFrustumSize=790))})}function cRe(t){t.scene.objects.traverse((i,r)=>{r.pathSnapping===void 0&&(r.pathSnapping={pathId:null,slide:0,offset:0,orientation:"tangential"}),r.pathSnapping.offset===void 0&&(r.pathSnapping.offset=0)})}function hRe(t){t.scene.publish.mouseEventTarget===void 0&&(t.scene.publish.mouseEventTarget="canvas"),t.scene.publish.settings.web.hint===void 0&&(t.sce
vendor: 4,254 bytes, line 7715
7715ne.publish.settings.web.hint=!1)}function uRe(t){let{video:i}=t.scene.publish.settings;i.format==="gif"&&i.fps>48&&(i.fps=15)}function dRe(t){t.scene.objects.traverse((i,r)=>{r.events.forEach(n=>{n.type==="GameControl"&&(n.resetYPosition=Math.abs(n.resetYPosition-r.position[1]))})})}function ARe(t){let i=t.scene.environment.usePhysics;t.scene.objects.traverse((r,n)=>{i&&n.physics===null?n.collision=!1:n.collision="visibility"})}function fRe(t){t.scene.objects.traverse((i,r)=>{r.events.forEach(n=>{n.type==="GameControl"&&(n.navmesh=nT.defaultDataThirdPerson.navmesh)})})}function pRe(t){t.scene.styles||(t.scene.styles=Pf.defaultData())}function SQ(t){t.layers.forEach(i=>{i.type==="light"&&i.category!=="toon"&&i.occlusion===void 0&&(i.occlusion=!0)})}function mRe(t){t.scene.environment.ambientLight.occlusion===void 0&&(t.scene.environment.ambientLight.occlusion=!1),t.scene.environment.ambientLight.aoFullRes===void 0&&(t.scene.environment.ambientLight.aoFullRes=!1),t.scene.environment.ambientLight.radius===void 0&&(t.scene.environment.ambientLight.radius=256),t.scene.environment.ambientLight.bias===void 0&&(t.scene.environment.ambientLight.bias=.5),t.scene.environment.ambientLight.aoColor===void 0&&(t.scene.environment.ambientLight.aoColor={r:.19607843137254902,g:.19607843137254902,b:.19607843137254902}),Wd(t,SQ),Vd(t,SQ)}function gRe(t){t.scene.objects.traverse((i,r)=>{r.events.forEach(n=>{n.type==="GameControl"&&Object.assign(n.gameActions,{run:new Pt})})})}function vRe(t){t.scene.objects.traverse((i,r)=>{r.events.forEach(n=>{n.type==="GameControl"&&(n.keyAssignments=[...n.keyAssignments,["run","â§"],["none","Ctrl"]])})})}function CQ(t){t.layers&&t.layers.forEach(i=>{i.type==="light"&&i.bumpMapIntensity===void 0&&(i.bumpMapIntensity=5)})}function _Re(t,i){if(i<1&&(Wd(t,gQ),Vd(t,gQ),t.schema=1),i<2&&(Uxe(t),t.schema=2),i<3&&(kxe(t),t.schema=3),i<4&&(Hxe(t),t.schema=4),i<5&&(Gxe(t),t.schema=5),i<6&&(zxe(t),t.schema=6),i<7&&(Qxe(t),t.schema=7),i<8&&(t.schema=8),i<9&&(_Q(t),t.schema=9),i<10&&(Yxe(t),t.schema=10),i<11&&(Kxe(t),t.schema=11),i<12&&(_Q(t),t.schema=12),i<13&&(Xxe(t),t.schema=13),i<14&&(Zxe(t),t.schema=14),i<15&&(Jxe(t),t.schema=15),i<16&&($xe(t),t.schema=16),i<17&&(Wd(t,yQ),Vd(t,yQ),t.schema=17),i<18&&(Wd(t,vQ),Vd(t,vQ),t.schema=18),i<19&&(Fxe(t),t.schema=19),i<20&&(eRe(t),iRe(t),t.schema=20),i<21&&(rRe(t),nRe(t),t.schema=21),i<22&&(bQ(t),t.schema=22),i<23&&(aRe(t),t.schema=23),i<24&&(sRe(t),t.schema=24),(i<25||t.shared.videos===void 0)&&(qxe(t),i<25&&(t.schema=25)),i<26&&(Vxe(t),t.schema=26),i<27&&(Wxe(t),t.schema=27),i<28&&(bQ(t),t.schema=28),i<29&&(jxe(t),t.schema=29),i<30&&(oRe(t),t.schema=30),i<31&&(lRe(t),t.schema=31),i<33&&(cRe(t),t.schema=33),i<34&&(hRe(t),t.schema=34),i<35&&(uRe(t),t.schema=35),i<36&&(dRe(t),t.schema=36),i<37&&(ARe(t),t.schema=37),i<38&&(Wd(t,EQ),Vd(t,EQ),t.schema=38),i<39&&(fRe(t),t.schema=39),i<40&&(pRe(t),t.schema=40),i<41&&(mRe(t),t.schema=41),i<42&&(gRe(t),t.schema=42),i<43&&(vRe(t),t.schema=43),i<99){Wd(t,CQ),Vd(t,CQ),t.scene.publish.playCamera===null&&(t.scene.publish.playCamera=W0);let r=wn(t.scene.objects),n=t.scene.objects;t.scene.publish.playPage=q_,n.insertBefore(null,null,[{id:q_,data:{...m0.defaultData,backgroundColor:t.scene.backgroundColor,fog:t.scene.fog,postprocessing:t.scene.postprocessing,ao:Pu(t.scene.environment.ambientLight,"occlusion","aoFullRes","radius","bias","aoColor"),publish:{playCamera:t.scene.publish.playCamera,gameControlObject:t.scene.publish.gameControlObject},shadow:Pu(t.scene.environment.ambientLight,"softShadowQuality"),globalPhysics:{...f0.defaultData,...Pu(t.scene.environment,"usePhysics","gravity")},camera:wn(t.scene.ownerCamera)??m0.defaultData.camera,name:"Scene"},children:[]}]);for(let o of r)o.id!==Lf.TRASH_CAN_ID&&n.move(q_,o.fi,o.id);let a=0,s=0;t.shared.penumbraSize&&t.scene.objects.traverse((o,l)=>{l.type==="DirectionalLight"?(l.penumbraSize=t.shared.penumbraSize[Math.min(a,2)],a+=1):l.type==="SpotLight"&&(l.penumbraSize=t.shared.penumbraSize[3+Math.min(s,1)],s+=1),(l.physics===void 0||l.physics===null)&&l.type!=="Instance"&&(l.physics={},Object.assign(l.physics,A0.defaultData)),l.physics!==void 0&&l.physics!==null&&(l.physics.enabled=l.collision??"visibility",delete l.collision)}),t.schema=99}}
7715function TQ(t){t.layers&&t.layers.forEach(i=>{i.type==="light"&&i.alphaOverride===void 0&&(i.alphaOverride=1)})}function yRe(t){t.scene.objects.traverse((i,r)=>{let n=r.geometry;n&&n.type==="PathGeometry"&&(n.extrusion.capType="flat",n.extrusion.bevel=50,n.extrusion.bevelSides=6,n.extrusion.shape.type==="Custom"&&(n.extrusion.shape.shapeQuality="low"))})}function ERe(t){var i;Array.isArray(wn(t.events))&&((i=t.events)==null||i.forEach(r=>{"disabled"in r||(r.disabled=!1),(r.type==="MouseDown"||r.type==="MouseUp"||r.type==="MousePress")&&(r.mode=r.mode||"Object")}))}var tg=180/Math.PI;function MQ(t){t.rotation=t.rotation.slice(0,3).map(i=>i*tg)}function MK(t){var r,n;MQ(t),t.type==="Page"&&MQ(t.camera),(r=t.states)==null||r.forEach(a=>{a.rotation===void 0||a.rotation===null||(a.rotation=a.rotation.slice(0,3).map(s=>s*tg))});let i=t.geometry;i&&i.type==="SphereGeometry"&&(i.thetaLength=(i.thetaLength??180)*tg),i&&i.type==="TorusGeometry"&&(i.arc=i.arc*tg),i&&i.type==="PathGeometry"&&(i.extrusion.angle*=tg,i.extrusion.twist*=tg),t.type==="Mesh"&&t.geometry.type==="TextGeometry"&&(t.geometry.text={textValue:t.geometry.text}),Array.isArray(wn(t.events))&&((n=t.events)==null||n.forEach(a=>{(a.type==="MouseDown"||a.type==="MouseUp"||a.type==="MousePress"||a.type==="KeyDown"||a.type==="KeyUp"||a.type==="KeyPress"||a.type==="Collision"||a.type==="Trigger")&&(a.runMode=a.toggle?"Toggle":"Repeat")}))}function wRe(t){t.shared.variables=Sl({},kt.prototype)}function bRe(t){let i=wn(t.shared.variables);t.shared.variables=Sl(Object.entries(i??{}).map(([r,n],a)=>({fi:a,id:r,data:n})),Pt.prototype)}var lu=115;function xK(t,i){i(t.data);for(let r of t.children)xK(r,i)}function SRe(t){let i=t.schema??104;i!==lu&&i<105&&(xK(t.asset,MK),t.schema=105)}function CRe(t){t.shared.particles=Sl({},kt.prototype),t.shared.lib&&(t.shared.lib.particles=Vu.defaultData().particles)}function TRe(t){t.scene.objects.traverse((i,r)=>{r.type==="Particle"&&typeof r.renderMaterial.size=="number"&&Object.assign(r.renderMaterial,{size:[r.renderMaterial.size,r.renderMaterial.size]})})}function MRe(t){t.scene.objects.traverse((i,r)=>{r.type==="Page"&&(r.postprocessing.depthOfField.focusDistance=100,r.postprocessing.depthOfField.focalLength=20,r.postprocessing.depthOfField.bokehScale=5)})}function xRe(t){t.scene.objects.traverse((i,r)=>{var n;Array.isArray(wn(r.events))!==!1&&((n=r.events)==null||n.forEach(a=>{var o,l,c,h,u,d,A,f,m,g,p;let s=a.runMode;a.type==="MouseDown"||a.type==="MouseUp"||a.type==="KeyDown"||a.type==="KeyUp"||a.type==="Collision"||a.type==="Trigger"?(o=a.actions)==null||o.forEach(v=>{v.type==="Transition"&&(v.runMode=s??"Repeat"),(v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode=s==="Toggle"?"Toggle":"Normal")}):a.type==="MouseHover"||a.type==="MousePress"||a.type==="KeyPress"?(l=a.actions)==null||l.forEach(v=>{(v.type==="Transition"||v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Toggle")}):a.type==="GameControl"?(delete a.actions,Object.keys(a.gameActions).forEach(v=>{var _;(_=a.gameActions[v])==null||_.forEach(y=>{y.type==="Transition"&&(y.runMode="Repeat"),y.type==="Animation"&&(y.runMode="Normal")})})):a.type==="DragDrop"?(delete a.actions,(h=(c=a.dragDropActions)==null?void 0:c.drag)==null||h.forEach(v=>{(v.type==="Transition"||v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Toggle")}),(d=(u=a.dragDropActions)==null?void 0:u.drop)==null||d.forEach(v=>{(v.type==="Transition"||v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Toggle")})):a.type==="Resize"?(delete a.actions,(A=a.breakpoints)==null||A.forEach(v=>{var _;(_=v.actions)==null||_.forEach(y=>{(y.type==="Transition"||y.type==="Animation"||y.type==="SwitchCamera")&&(y.runMode="Toggle")})})):a.type==="Start"?(f=a.actions)==null||f.forEach(v=>{v.type==="Transition"&&(v.runMode="Once"),(v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Normal")}):a.type==="VariableChange"||a.type==="Scroll"?(m=a.actions)==null||m.forEach(v=>{v.type==="Transition"&&(v.runMode="Repeat"),(v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Normal")}):a.type==="Conditional"&&(delete a.actions,(g=a.inActions)==null||g.forEach(v=>{v.type==="Transition"&&(v.runMode="Repeat"),(v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Normal")}),(p=a.outActions)==null||p.forEach(v=>{v.type==="Transition"&&(v.runMode="Repeat"),(v.type==="Animation"||v.type==="SwitchCamera")&&(v.runMode="Normal")}))}))})}function RRe(t){t.shared.userAPIs=Sl({},kt.prototype),t.shared.userWebhooks=Sl({},kt.prototype),t.shared.lib&&(t.shared.lib.userAPIs=Vu.defaultData().userAPIs,t.shared.lib.userWebhooks=Vu.defaultData().userWebhooks)}function RK(t){let i=t.schema??0;if(i!==lu){console.warn("updating from ",i,"to ",lu),_Re(t,i),i<100&&(t.sce
7715ne.publish.joystickSizeAndXYOffset===void 0&&(t.scene.publish.joystickSizeAndXYOffset=aA.defaultData.joystickSizeAndXYOffset),t.schema=100),i<101&&(Wd(t,TQ),Vd(t,TQ),t.schema=101),i<102&&(yRe(t),t.schema=102),i<104&&(t.shared.catelogs=new kt,t.shared.lib=Vu.defaultData(),t.schema=104),i<105&&(wRe(t),t.scene.objects.traverse((r,n)=>{MK(n)}),t.schema=105);for(let r of Object.values(t.shared.lib.components))SRe(r);i<106&&(bRe(t),t.schema=106),i<107&&(t.shared.lib.variables=Vu.defaultData().variables,t.schema=107),i<109&&(CRe(t),t.schema=109),i<110&&(TRe(t),t.schema=110),i<111&&(t.scene.objects.traverse((r,n)=>{ERe(n)}),t.schema=111),i<112&&(MRe(t),t.schema=112),i<113&&(xRe(t),t.schema=113),i<114&&(t.scene.publish.settings.web.imageQuality===void 0&&(t.scene.publish.settings.web.imageQuality=70),t.schema=114),i<115&&(RRe(t),t.schema=115)}}var aT;(t=>{t.defaultData={schema:lu,scene:Lf.defaultData,frames:new kt().add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",Z_.defaultData),shared:{...Jo.emptyData(),colors:Jo.defaultColors()}},t.emptyDataForImports=function(){let s=Lf.emptyDataWithPage();return{schema:lu,scene:s,frames:new kt().add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",Z_.defaultData),shared:{...Jo.emptyData(),colors:Jo.defaultColors(),images:Jo.defaultImages()}}},t.emptyData=function(){return{schema:lu,scene:Lf.emptyDataWithPage(),frames:new kt().add("72fc2993-2da3-4b6b-96ac-2879db3a28bd",Z_.defaultData),shared:Jo.emptyData()}},t.clipboard2dData=function(){return{schema:lu,scene:Lf.emptyData(),frames:new kt,shared:Jo.emptyData()}},t.collabHelper={...SP,updateSchema(s){return(s.schema??0)<lu?Uy(s,RK):(s.schema??0)-lu}};function i(s){let o=t.collabHelper.updateSchema(s);return typeof o=="number"?o===0?s:null:o.data}t.updateSchemaDirectly=i;function r(s){return{...s,shared:{...s.shared,lib:Vu.defaultData()}}}t.withoutLib=r;function n(s,o){let l=s.scene.objects.get(o);if(l&&l.data.type==="Component")return l;{let c=s.shared.lib.components[o];if(c)return c.asset}}t.getComponentData=n;function a(s){let o=Object.values(s.shared.userAPIs);for(let l of o){let c=l.headers;for(let h of c)if(h.data.key.toLowerCase()==="authorization"&&h.data.value!=="")return!0}return!1}t.hasSensitiveData=a})(aT||(aT={}));var nL;(t=>t.emptyImage={data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII=",name:"empty"})(nL||(nL={}));var xQ;(t=>{function i(r){return!0}t.is=i})(xQ||(xQ={}));var sT;(t=>{t.defaultData={position:[0,0],scale:[1,1],rotation:0,shear:[0,0]};function i(n,a){return{position:(a==null?void 0:a.position)??n.position,rotation:(a==null?void 0:a.rotation)??n.rotation,scale:(a==null?void 0:a.scale)??n.scale,shear:(a==null?void 0:a.shear)??n.shear}}t.merge=i;function r(n,a){return zY({position:Mu.isEqual(n.position,a.position)?void 0:a.position,rotation:n.rotation===a.rotation?void 0:a.rotation,scale:Mu.isEqual(n.scale,a.scale)?void 0:a.scale,shear:n.shear&&a.shear&&Mu.isEqual(n.shear,a.shear)?void 0:a.shear})}t.diff=r})(sT||(sT={}));var aL;(t=>t.defaultData={horizontalConstraint:0,verticalConstraint:0})(aL||(aL={}));var RQ;(t=>t.defaultData={direction:"row",wrap:"unwrap",align:"top-left",gap:10,rowGap:10,autoGap:!1,autoRowGap:!1,leftPadding:8,rightPadding:8,topPadding:8,bottomPadding:8})(RQ||(RQ={}));var oT;(t=>t.defaultData={opacity:1,fill:{color:Ar.fromHexAndA(No,1),enabled:!0},stroke:{color:Ar.from0to1([0,0,0,1]),thickness:1,enabled:!1,mode:"inside"},layerBlur:{radius:2,enabled:!1},backgroundBlur:{radius:2,enabled:!1},dropShadow:{offset:[10,10],blurRadius:10,color:Ar.from0to1([0,0,0,1]),enabled:!1,spread:0},innerShadow:{offset:[10,10],blurRadius:10,color:Ar.from0to1([0,0,0,1]),enabled:!1,spread:0}})(oT||(oT={}));var Of;(t=>{function i(o,l){return{name:l}}t.newEmpty=i;function r(o,l){if(l===void 0)return o;let c={...o},h=["width","height","cornerRadius"];for(let u of h)u in c&&u in l&&l[u]!==void 0&&Object.assign(c,{[u]:l[u]});return c}function n(o,l){if(l===void 0)return o;let c={...o};return"fill"in c&&"fill"in l&&l.fill!==void 0&&Object.assign(c,{fill:{...c.fill,...l.fill}}),"stroke"in c&&"stroke"in l&&l.stroke!==void 0&&Object.assign(c,{stroke:{...c.stroke,...l.stroke}}),"layerBlur"in c&&"layerBlur"in l&&l.layerBlur!==void 0&&Object.assign(c,{layerBlur:{...c.layerBlur,...l.layerBlur}}),"backgroundBlur"in c&&"backgroundBlur"in l&&l.backgroundBlur!==void 0&&Object.assign(c,{backgroundBlur:{...c.backgroundBlur,...l.backgroundBlur}}),"dropShadow"in c&&"dropShadow"in l&&l.dropShadow!==void 0&&Object.assign(c,{dropShadow:{...c.dropShadow,...l.dropShadow}}),"innerShadow"in c&&"innerShadow"in l&&l.innerShadow!==void 0&&Object.assign(c,{innerShadow:{...c.innerShadow,...l.innerShadow}}),c}function a(o,l){if(l===void 0)return o;let c={...o};return Object.assign(c,sT.merge(c,l)),c=r(c,l),c=n(c,l),c}t.patch=a;function s(o,l){let c,h=[];for(let[u,d]of Object.entries(l))u!=="name"&&(c===void 0&&(c={path:[],props:{}
vendor: 4,844 bytes, line 7715
7715,type:0},h.push(c)),c.props[u]=d);return h}t.toOps=s})(Of||(Of={}));var Hy;(t=>t.defaultData={...sT.defaultData,...aL.defaultData,states:new Pt,events:new Pt,visible:!0,raycastLock:!1})(Hy||(Hy={}));var g0;(t=>t.defaultData={...Hy.defaultData,...oT.defaultData})(g0||(g0={}));var lT;(t=>t.defaultData={cornerRadius:[0,0,0,0]})(lT||(lT={}));var sL;(t=>t.defaultData={...g0.defaultData,type:"ellipse2d",width:100,height:100,name:"Ellipse"})(sL||(sL={}));var Gy;(t=>t.defaultData={...g0.defaultData,...lT.defaultData,type:"rectangle2d",width:100,height:100,name:"Rectangle"})(Gy||(Gy={}));var oL;(t=>t.defaultData={...g0.defaultData,type:"text2d",width:100,height:100,fontSize:12,lineHeight:1.2,letterSpacing:0,text:{textValue:"Hello world"},horizontalAlign:1,verticalAlign:1,textTransform:1,font:"Roboto_regular",name:"Text"})(oL||(oL={}));var lL;(t=>t.defaultData={...g0.defaultData,type:"path2d",path:"",name:"Path"})(lL||(lL={}));var BQ;(t=>{function i(r){return r.type==="ellipse2d"||r.type==="rectangle2d"||r.type==="text2d"||r.type==="vector2d"||r.type==="path2d"}t.is=i})(BQ||(BQ={}));var cT;(t=>t.defaultData={...Hy.defaultData,name:"Group",type:"group2d"})(cT||(cT={}));var cL;(t=>t.defaultData=()=>({...Hy.defaultData,...lT.defaultData,...oT.defaultData,name:"Frame",type:"frame2d",clipped:!0,width:200,height:200,fill:{color:Ar.fromHexAndA(4737101,1),enabled:!0},stroke:{color:Ar.fromHexAndA(0,1),thickness:1,enabled:!1,mode:"inside"},backgroundBlur:{radius:2,enabled:!1},layerBlur:{radius:2,enabled:!1}}))(cL||(cL={}));var rp;(t=>{function i(o){switch(o){case"rectangle2d":return{...Gy.defaultData};case"ellipse2d":return{...sL.defaultData};case"text2d":return{...oL.defaultData};case"vector2d":return{...Gy.defaultData};case"path2d":return{...lL.defaultData};case"frame2d":return{...cL.defaultData()};case"group2d":return{...cT.defaultData}}}t.defaultData=i;function r(o){return"width"in o&&"height"in o?[typeof o.width=="number"?o.width*.5:0,typeof o.height=="number"?o.height*.5:0]:[0,0]}t.getPivot=r;function n(o){return o.type==="rectangle2d"||o.type==="ellipse2d"||o.type==="text2d"||o.type==="frame2d"}t.isResizeable=n;function a(o){return o.type==="frame2d"&&o.autoLayout!==void 0}t.isAutoLayoutable=a;function s(o){return o.type==="rectangle2d"||o.type==="frame2d"}t.hasCorners=s})(rp||(rp={}));var hL;(t=>(t.defaultData={name:"UI",type:"scene2d",objects:new Va},t.emptyData=function(){return{type:"scene2d",objects:new Va}}))(hL||(hL={}));function Nf(t,i=!1){let r=t[0].index!==null,n=new Set(Object.keys(t[0].attributes)),a=new Set(Object.keys(t[0].morphAttributes)),s={},o={},l=t[0].morphTargetsRelative,c=new Lt,h=0;for(let u=0;u<t.length;++u){let d=t[u],A=0;if(r!==(d.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let f in d.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;s[f]===void 0&&(s[f]=[]),s[f].push(d.attributes[f]),A++}if(A!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". Make sure all geometries have the same number of attributes."),null;if(l!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let f in d.morphAttributes){if(!a.has(f))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". .morphAttributes must be consistent throughout all geometries."),null;o[f]===void 0&&(o[f]=[]),o[f].push(d.morphAttributes[f])}if(i){let f;if(r)f=d.index.count;else if(d.attributes.position!==void 0)f=d.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+u+". The geometry must have either an index or a position attribute"),null;c.addGroup(h,f,u),h+=f}}if(r){let u=0,d=[];for(let A=0;A<t.length;++A){let f=t[A].index;for(let m=0;m<f.count;++m)d.push(f.getX(m)+u);u+=t[A].attributes.position.count}c.setIndex(d)}for(let u in s){let d=IQ(s[u]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" attribute."),null;c.setAttribute(u,d)}for(let u in o){let d=o[u][0].length;if(d===0)break;c.morphAttributes=c.morphAttributes||{},c.morphAttributes[u]=[];for(let A=0;A<d;++A){let f=[];for(let g=0;g<o[u].length;++g)f.push(o[u][g][A]);let m=IQ(f);
7715if(!m)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+u+" morphAttribute."),null;c.morphAttributes[u].push(m)}}return c}function IQ(t){let i,r,n,a=0;for(let l=0;l<t.length;++l){let c=t[l];if(c.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(i===void 0&&(i=c.array.constructor),i!==c.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(r===void 0&&(r=c.itemSize),r!==c.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=c.normalized),n!==c.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;a+=c.array.length}let s=new i(a),o=0;for(let l=0;l<t.length;++l)s.set(t[l].array,o),o+=t[l].array.length;return new ei(s,r,n)}var BRe=Math.pow(2,-24),pb=class{constructor(){}};function Zc(t,i,r){return r.min.x=i[t],r.min.y=i[t+1],r.min.z=i[t+2],r.max.x=i[t+3],r.max.y=i[t+4],r.max.z=i[t+5],r}function DQ(t){let i=-1,r=-1/0;for(let n=0;n<3;n++){let a=t[n+3]-t[n];a>r&&(r=a,i=n)}return i}function PQ(t,i){i.set(t)}function LQ(t,i,r){let n,a;for(let s=0;s<3;s++){let o=s+3;n=t[s],a=i[s],r[s]=n<a?n:a,n=t[o],a=i[o],r[o]=n>a?n:a}}function mb(t,i,r){for(let n=0;n<3;n++){let a=i[t+2*n],s=i[t+2*n+1],o=a-s,l=a+s;o<r[n]&&(r[n]=o),l>r[n+3]&&(r[n+3]=l)}}function Fv(t){let i=t[3]-t[0],r=t[4]-t[1],n=t[5]-t[2];return 2*(i*r+r*n+n*i)}function IRe(t,i){if(!t.index){let r=t.attributes.position.count,n=i.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,a;r>65535?a=new Uint32Array(new n(4*r)):a=new Uint16Array(new n(2*r)),t.setIndex(new ei(a,1));for(let s=0;s<r;s++)a[s]=s}}function DRe(t){if(!t.groups||!t.groups.length)return[{offset:0,count:t.index.count/3}];let i=[],r=new Set;for(let a of t.groups)r.add(a.start),r.add(a.start+a.count);let n=Array.from(r.values()).sort((a,s)=>a-s);for(let a=0;a<n.length-1;a++){let s=n[a],o=n[a+1];i.push({offset:s/3,count:(o-s)/3})}return i}function pI(t,i,r,n,a=null){let s=1/0,o=1/0,l=1/0,c=-1/0,h=-1/0,u=-1/0,d=1/0,A=1/0,f=1/0,m=-1/0,g=-1/0,p=-1/0,v=a!==null;for(let _=i*6,y=(i+r)*6;_<y;_+=6){let w=t[_+0],b=t[_+1],E=w-b,M=w+b;E<s&&(s=E),M>c&&(c=M),v&&w<d&&(d=w),v&&w>m&&(m=w);let S=t[_+2],T=t[_+3],C=S-T,x=S+T;C<o&&(o=C),x>h&&(h=x),v&&S<A&&(A=S),v&&S>g&&(g=S);let R=t[_+4],L=t[_+5],I=R-L,F=R+L;I<l&&(l=I),F>u&&(u=F),v&&R<f&&(f=R),v&&R>p&&(p=R)}n[0]=s,n[1]=o,n[2]=l,n[3]=c,n[4]=h,n[5]=u,v&&(a[0]=d,a[1]=A,a[2]=f,a[3]=m,a[4]=g,a[5]=p)}function PRe(t,i,r,n){let a=1/0,s=1/0,o=1/0,l=-1/0,c=-1/0,h=-1/0;for(let u=i*6,d=(i+r)*6;u<d;u+=6){let A=t[u+0];A<a&&(a=A),A>l&&(l=A);let f=t[u+2];f<s&&(s=f),f>c&&(c=f);let m=t[u+4];m<o&&(o=m),m>h&&(h=m)}n[0]=a,n[1]=s,n[2]=o,n[3]=l,n[4]=c,n[5]=h}function LRe(t,i,r,n,a){let s=r,o=r+n-1,l=a.pos,c=a.axis*2;for(;;){for(;s<=o&&i[s*6+c]<l;)s++;for(;s<=o&&i[o*6+c]>=l;)o--;if(s<o){for(let h=0;h<3;h++){let u=t[s*3+h];t[s*3+h]=t[o*3+h],t[o*3+h]=u;let d=i[s*6+h*2+0];i[s*6+h*2+0]=i[o*6+h*2+0],i[o*6+h*2+0]=d;let A=i[s*6+h*2+1];i[s*6+h*2+1]=i[o*6+h*2+1],i[o*6+h*2+1]=A}s++,o--}else return s}}var $h=32,ORe=(t,i)=>t.candidate-i.candidate,md=new Array($h).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),gb=new Float32Array(6);function NRe(t,i,r,n,a,s){let o=-1,l=0;if(s===0)o=DQ(i),o!==-1&&(l=(i[o]+i[o+3])/2);else if(s===1)o=DQ(t),o!==-1&&(l=URe(r,n,a,o));else if(s===2){let c=Fv(t),h=1.25*a,u=n*6,d=(n+a)*6;for(let A=0;A<3;A++){let f=i[A],m=(i[A+3]-f)/$h;if(a<$h/4){let g=[...md];g.length=a;let p=0;for(let _=u;_<d;_+=6,p++){let y=g[p];y.candidate=r[_+2*A],y.count=0;let{bounds:w,leftCacheBounds:b,rightCacheBounds:E}=y;for(let M=0;M<3;M++)E[M]=1/0,E[M+3]=-1/0,b[M]=1/0,b[M+3]=-1/0,w[M]=1/0,w[M+3]=-1/0;
7715mb(_,r,w)}g.sort(ORe);let v=a;for(let _=0;_<v;_++){let y=g[_];for(;_+1<v&&g[_+1].candidate===y.candidate;)g.splice(_+1,1),v--}for(let _=u;_<d;_+=6){let y=r[_+2*A];for(let w=0;w<v;w++){let b=g[w];y>=b.candidate?mb(_,r,b.rightCacheBounds):(mb(_,r,b.leftCacheBounds),b.count++)}}for(let _=0;_<v;_++){let y=g[_],w=y.count,b=a-y.count,E=y.leftCacheBounds,M=y.rightCacheBounds,S=0;w!==0&&(S=Fv(E)/c);let T=0;b!==0&&(T=Fv(M)/c);let C=1+1.25*(S*w+T*b);C<h&&(o=A,h=C,l=y.candidate)}}else{for(let v=0;v<$h;v++){let _=md[v];_.count=0,_.candidate=f+m+v*m;let y=_.bounds;for(let w=0;w<3;w++)y[w]=1/0,y[w+3]=-1/0}for(let v=u;v<d;v+=6){let _=~~((r[v+2*A]-f)/m);_>=$h&&(_=$h-1);let y=md[_];y.count++,mb(v,r,y.bounds)}let g=md[$h-1];PQ(g.bounds,g.rightCacheBounds);for(let v=$h-2;v>=0;v--){let _=md[v],y=md[v+1];LQ(_.bounds,y.rightCacheBounds,_.rightCacheBounds)}let p=0;for(let v=0;v<$h-1;v++){let _=md[v],y=_.count,w=_.bounds,b=md[v+1].rightCacheBounds;y!==0&&(p===0?PQ(w,gb):LQ(w,gb,gb)),p+=y;let E=0,M=0;p!==0&&(E=Fv(gb)/c);let S=a-p;S!==0&&(M=Fv(b)/c);let T=1+1.25*(E*p+M*S);T<h&&(o=A,h=T,l=_.candidate)}}}}else console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);return{axis:o,pos:l}}function URe(t,i,r,n){let a=0;for(let s=i,o=i+r;s<o;s++)a+=t[s*6+n*2];return a/r}function FRe(t,i){let r=t.attributes.position,n=t.index.array,a=n.length/3,s=new Float32Array(a*6),o=r.normalized,l=r.array,c=r.offset||0,h=3;r.isInterleavedBufferAttribute&&(h=r.data.stride);let u=["getX","getY","getZ"];for(let d=0;d<a;d++){let A=d*3,f=d*6,m,g,p;o?(m=n[A+0],g=n[A+1],p=n[A+2]):(m=n[A+0]*h+c,g=n[A+1]*h+c,p=n[A+2]*h+c);for(let v=0;v<3;v++){let _,y,w;o?(_=r[u[v]](m),y=r[u[v]](g),w=r[u[v]](p)):(_=l[m+v],y=l[g+v],w=l[p+v]);let b=_;y<b&&(b=y),w<b&&(b=w);let E=_;y>E&&(E=y),w>E&&(E=w);let M=(E-b)/2,S=v*2;s[f+S+0]=b+M,s[f+S+1]=M+(Math.abs(b)+M)*BRe,b<i[v]&&(i[v]=b),E>i[v+3]&&(i[v+3]=E)}}return s}function kRe(t,i){function r(v){A&&A(v/f)}function n(v,_,y,w=null,b=0){if(!m&&b>=c&&(m=!0,h&&(console.warn(`MeshBVH: Max depth of ${c} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),y<=u||b>=c)return r(_+y),v.offset=_,v.count=y,v;let E=NRe(v.boundingData,w,o,_,y,d);if(E.axis===-1)return r(_+y),v.offset=_,v.count=y,v;let M=LRe(l,o,_,y,E);if(M===_||M===_+y)r(_+y),v.offset=_,v.count=y;else{v.splitAxis=E.axis;let S=new pb,T=_,C=M-_;v.left=S,S.boundingData=new Float32Array(6),pI(o,T,C,S.boundingData,s),n(S,T,C,s,b+1);let x=new pb,R=M,L=y-C;v.right=x,x.boundingData=new Float32Array(6),pI(o,R,L,x.boundingData,s),n(x,R,L,s,b+1)}return v}IRe(t,i);let a=new Float32Array(6),s=new Float32Array(6),o=FRe(t,a),l=t.index.array,c=i.maxDepth,h=i.verbose,u=i.maxLeafTris,d=i.strategy,A=i.onProgress,f=t.index.count/3,m=!1,g=[],p=DRe(t);if(p.length===1){let v=p[0],_=new pb;_.boundingData=a,PRe(o,v.offset,v.count,s),n(_,v.offset,v.count,s),g.push(_)}else for(let v of p){let _=new pb;_.boundingData=new Float32Array(6),pI(o,v.offset,v.count,_.boundingData,s),n(_,v.offset,v.count,s),g.push(_)}return g}function HRe(t,i){let r=kRe(t,i),n,a,s,o=[],l=i.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;u<r.length;u++){let d=r[u],A=c(d),f=new l(32*A);n=new Float32Array(f),a=new Uint32Array(f),s=new Uint16Array(f),h(0,d),o.push(f)}return o;function c(u){return u.count?1:1+c(u.left)+c(u.right)}function h(u,d){let A=u/4,f=u/2,m=!!d.count,g=d.boundingData;for(let p=0;p<6;p++)n[A+p]=g[p];if(m){let p=d.offset,v=d.count;return a[A+6]=p,s[f+14]=v,s[f+15]=65535,u+32}else{let p=d.left,v=d.right,_=d.splitAxis,y;if(y=h(u+32,p),y/4>Math.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return a[A+6]=y/4,y=h(y,v),a[A+7]=_,y}}}var Wu=class{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,i){let r=1/0,n=-1/0;for(let a=0,s=t.length;a<s;a++){let o=t[a][i];r=o<r?o:r,n=o>n?o:n}this.min=r,this.max=n}setFromPoints(t,i){let r=1/0,n=-1/0;for(let a=0,s=i.length;a<s;a++){let o=i[a],l=t.dot(o);r=l<r?l:r,n=l>n?l:n}this.min=r,this.max=n}isSeparated(t){return this.min>t.max||t.min>this.max}};Wu.prototype.setFromBox=function(){let t=new O;return function(i,r){let n=r.min,a=r.max,s=1/0,o=-1/0;for(let l=0;l<=1;l++)for(let c=0;c<=1;c++)for(let h=0;h<=1;h++){t.x=n.x*l+a.x*(1-l),t.y=n.y*c+a.y*(1-c),t.z=n.z*h+a.z*(1-h);let u=i.dot(t);s=Math.min(u,s),o=Math.max(u,o)}this.min=s,this.max=o}}();var GRe=function(){let t=new O,i=new O,r=new O;return function(n,a,s){let o=n.start,l=t,c=a.start,h=i;r.subVectors(o,c),t.subVectors(n.end,n.start),i.subVectors(a.end,a.start);
7715let u=r.dot(h),d=h.dot(l),A=h.dot(h),f=r.dot(l),m=l.dot(l)*A-d*d,g,p;m!==0?g=(u*d-f*A)/m:g=0,p=(u+g*d)/A,s.x=g,s.y=p}}(),jN=function(){let t=new Me,i=new O,r=new O;return function(n,a,s,o){GRe(n,a,t);let l=t.x,c=t.y;if(l>=0&&l<=1&&c>=0&&c<=1){n.at(l,s),a.at(c,o);return}else if(l>=0&&l<=1){c<0?a.at(0,o):a.at(1,o),n.closestPointToPoint(o,!0,s);return}else if(c>=0&&c<=1){l<0?n.at(0,s):n.at(1,s),a.closestPointToPoint(s,!0,o);return}else{let h;l<0?h=n.start:h=n.end;let u;c<0?u=a.start:u=a.end;let d=i,A=r;if(n.closestPointToPoint(u,!0,i),a.closestPointToPoint(h,!0,r),d.distanceToSquared(u)<=A.distanceToSquared(h)){s.copy(d),o.copy(u);return}else{s.copy(h),o.copy(A);return}}}}(),zRe=function(){let t=new O,i=new O,r=new eo,n=new vl;return function(a,s){let{radius:o,center:l}=a,{a:c,b:h,c:u}=s;if(n.start=c,n.end=h,n.closestPointToPoint(l,!0,t).distanceTo(l)<=o||(n.start=c,n.end=u,n.closestPointToPoint(l,!0,t).distanceTo(l)<=o)||(n.start=h,n.end=u,n.closestPointToPoint(l,!0,t).distanceTo(l)<=o))return!0;let d=s.getPlane(r);if(Math.abs(d.distanceToPoint(l))<=o){let A=d.projectPoint(l,i);if(s.containsPoint(A))return!0}return!1}}(),QRe=1e-15;function xm(t){return Math.abs(t)<QRe}var ju=class extends za{constructor(...t){super(...t),this.isExtendedTriangle=!0,this.satAxes=new Array(4).fill().map(()=>new O),this.satBounds=new Array(4).fill().map(()=>new Wu),this.points=[this.a,this.b,this.c],this.sphere=new ho,this.plane=new eo,this.needsUpdate=!0}intersectsSphere(t){return zRe(t,this)}update(){let t=this.a,i=this.b,r=this.c,n=this.points,a=this.satAxes,s=this.satBounds,o=a[0],l=s[0];this.getNormal(o),l.setFromPoints(o,n);let c=a[1],h=s[1];c.subVectors(t,i),h.setFromPoints(c,n);let u=a[2],d=s[2];u.subVectors(i,r),d.setFromPoints(u,n);let A=a[3],f=s[3];A.subVectors(r,t),f.setFromPoints(A,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,t),this.needsUpdate=!1}};ju.prototype.closestPointToSegment=function(){let t=new O,i=new O,r=new vl;return function(n,a=null,s=null){let{start:o,end:l}=n,c=this.points,h,u=1/0;for(let d=0;d<3;d++){let A=(d+1)%3;r.start.copy(c[d]),r.end.copy(c[A]),jN(r,n,t,i),h=t.distanceToSquared(i),h<u&&(u=h,a&&a.copy(t),s&&s.copy(i))}return this.closestPointToPoint(o,t),h=o.distanceToSquared(t),h<u&&(u=h,a&&a.copy(t),s&&s.copy(o)),this.closestPointToPoint(l,t),h=l.distanceToSquared(t),h<u&&(u=h,a&&a.copy(t),s&&s.copy(l)),Math.sqrt(u)}}();ju.prototype.intersectsTriangle=function(){let t=new ju,i=new Array(3),r=new Array(3),n=new Wu,a=new Wu,s=new O,o=new O,l=new O,c=new O,h=new vl,u=new vl,d=new vl;return function(A,f=null,m=!1){this.needsUpdate&&this.update(),A.isExtendedTriangle?A.needsUpdate&&A.update():(t.copy(A),t.update(),A=t);let g=this.plane,p=A.plane;if(Math.abs(g.normal.dot(p.normal))>1-1e-10){let v=this.satBounds,_=this.satAxes;r[0]=A.a,r[1]=A.b,r[2]=A.c;for(let b=0;b<4;b++){let E=v[b],M=_[b];if(n.setFromPoints(M,r),E.isSeparated(n))return!1}let y=A.satBounds,w=A.satAxes;i[0]=this.a,i[1]=this.b,i[2]=this.c;for(let b=0;b<4;b++){let E=y[b],M=w[b];if(n.setFromPoints(M,i),E.isSeparated(n))return!1}for(let b=0;b<4;b++){let E=_[b];for(let M=0;M<4;M++){let S=w[M];if(s.crossVectors(E,S),n.setFromPoints(s,i),a.setFromPoints(s,r),n.isSeparated(a))return!1}}return f&&(m||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),f.start.set(0,0,0),f.end.set(0,0,0)),!0}else{let v=this.points,_=!1,y=0;for(let L=0;L<3;L++){let I=v[L],F=v[(L+1)%3];h.start.copy(I),h.end.copy(F),h.delta(o);let Y=_?u.start:u.end,D=xm(p.distanceToPoint(I));if(xm(p.normal.dot(o))&&D){u.copy(h),y=2;break}if((p.intersectLine(h,Y)||D)&&!xm(Y.distanceTo(F))){if(y++,_)break;_=!0}}if(y===1&&A.containsPoint(u.end))return f&&(f.start.copy(u.end),f.end.copy(u.end)),!0;if(y!==2)return!1;let w=A.points,b=!1,E=0;for(let L=0;L<3;L++){let I=w[L],F=w[(L+1)%3];h.start.copy(I),h.end.copy(F),h.delta(l);let Y=b?d.start:d.end,D=xm(g.distanceToPoint(I));if(xm(g.normal.dot(l))&&D){d.copy(h),E=2;break}if((g.intersectLine(h,Y)||D)&&!xm(Y.distanceTo(F))){if(E++,b)break;b=!0}}if(E===1&&this.containsPoint(d.end))return f&&(f.start.copy(d.end),f.end.copy(d.end)),!0;if(E!==2)return!1;if(u.delta(o),d.delta(l),o.dot(l)<0){let L=d.start;d.start=d.end,d.end=L}
vendor: 5,079 bytes, line 7715
7715let M=u.start.dot(o),S=u.end.dot(o),T=d.start.dot(o),C=d.end.dot(o),x=S<T,R=M<C;return M!==C&&T!==S&&x===R?!1:(f&&(c.subVectors(u.start,d.start),c.dot(o)>0?f.start.copy(u.start):f.start.copy(d.start),c.subVectors(u.end,d.end),c.dot(o)<0?f.end.copy(u.end):f.end.copy(d.end)),!0)}}}();ju.prototype.distanceToPoint=function(){let t=new O;return function(i){return this.closestPointToPoint(i,t),i.distanceTo(t)}}();ju.prototype.distanceToTriangle=function(){let t=new O,i=new O,r=["a","b","c"],n=new vl,a=new vl;return function(s,o=null,l=null){let c=o||l?n:null;if(this.intersectsTriangle(s,c))return(o||l)&&(o&&c.getCenter(o),l&&c.getCenter(l)),0;let h=1/0;for(let u=0;u<3;u++){let d,A=r[u],f=s[A];this.closestPointToPoint(f,t),d=f.distanceToSquared(t),d<h&&(h=d,o&&o.copy(t),l&&l.copy(f));let m=this[A];s.closestPointToPoint(m,t),d=m.distanceToSquared(t),d<h&&(h=d,o&&o.copy(m),l&&l.copy(t))}for(let u=0;u<3;u++){let d=r[u],A=r[(u+1)%3];n.set(this[d],this[A]);for(let f=0;f<3;f++){let m=r[f],g=r[(f+1)%3];a.set(s[m],s[g]),jN(n,a,t,i);let p=t.distanceToSquared(i);p<h&&(h=p,o&&o.copy(t),l&&l.copy(i))}}return Math.sqrt(h)}}();var mh=class{constructor(t,i,r){this.isOrientedBox=!0,this.min=new O,this.max=new O,this.matrix=new ht,this.invMatrix=new ht,this.points=new Array(8).fill().map(()=>new O),this.satAxes=new Array(3).fill().map(()=>new O),this.satBounds=new Array(3).fill().map(()=>new Wu),this.alignedSatBounds=new Array(3).fill().map(()=>new Wu),this.needsUpdate=!1,t&&this.min.copy(t),i&&this.max.copy(i),r&&this.matrix.copy(r)}set(t,i,r){this.min.copy(t),this.max.copy(i),this.matrix.copy(r),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}};mh.prototype.update=function(){return function(){let t=this.matrix,i=this.min,r=this.max,n=this.points;for(let c=0;c<=1;c++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){let d=1*c|2*h|4*u,A=n[d];A.x=c?r.x:i.x,A.y=h?r.y:i.y,A.z=u?r.z:i.z,A.applyMatrix4(t)}let a=this.satBounds,s=this.satAxes,o=n[0];for(let c=0;c<3;c++){let h=s[c],u=a[c],d=1<<c,A=n[d];h.subVectors(o,A),u.setFromPoints(h,n)}let l=this.alignedSatBounds;l[0].setFromPointsField(n,"x"),l[1].setFromPointsField(n,"y"),l[2].setFromPointsField(n,"z"),this.invMatrix.copy(this.matrix).invert(),this.needsUpdate=!1}}();mh.prototype.intersectsBox=function(){let t=new Wu;return function(i){this.needsUpdate&&this.update();let r=i.min,n=i.max,a=this.satBounds,s=this.satAxes,o=this.alignedSatBounds;if(t.min=r.x,t.max=n.x,o[0].isSeparated(t)||(t.min=r.y,t.max=n.y,o[1].isSeparated(t))||(t.min=r.z,t.max=n.z,o[2].isSeparated(t)))return!1;for(let l=0;l<3;l++){let c=s[l],h=a[l];if(t.setFromBox(c,i),h.isSeparated(t))return!1}return!0}}();mh.prototype.intersectsTriangle=function(){let t=new ju,i=new Array(3),r=new Wu,n=new Wu,a=new O;return function(s){this.needsUpdate&&this.update(),s.isExtendedTriangle?s.needsUpdate&&s.update():(t.copy(s),t.update(),s=t);let o=this.satBounds,l=this.satAxes;i[0]=s.a,i[1]=s.b,i[2]=s.c;for(let d=0;d<3;d++){let A=o[d],f=l[d];if(r.setFromPoints(f,i),A.isSeparated(r))return!1}let c=s.satBounds,h=s.satAxes,u=this.points;for(let d=0;d<3;d++){let A=c[d],f=h[d];if(r.setFromPoints(f,u),A.isSeparated(r))return!1}for(let d=0;d<3;d++){let A=l[d];for(let f=0;f<4;f++){let m=h[f];if(a.crossVectors(A,m),r.setFromPoints(a,i),n.setFromPoints(a,u),r.isSeparated(n))return!1}}return!0}}();mh.prototype.closestPointToPoint=function(){return function(t,i){return this.needsUpdate&&this.update(),i.copy(t).applyMatrix4(this.invMatrix).clamp(this.min,this.max).applyMatrix4(this.matrix),i}}();mh.prototype.distanceToPoint=function(){let t=new O;return function(i){return this.closestPointToPoint(i,t),i.distanceTo(t)}}();mh.prototype.distanceToBox=function(){let t=["x","y","z"],i=new Array(12).fill().map(()=>new vl),r=new Array(12).fill().map(()=>new vl),n=new O,a=new O;return function(s,o=0,l=null,c=null){if(this.needsUpdate&&this.update(),this.intersectsBox(s))return(l||c)&&(s.getCenter(a),this.closestPointToPoint(a,n),s.closestPointToPoint(n,a),l&&l.copy(n),c&&c.copy(a)),0;let h=o*o,u=s.min,d=s.max,A=this.points,f=1/0;for(let g=0;g<8;g++){let p=A[g];a.copy(p).clamp(u,d);let v=p.distanceToSquared(a);if(v<f&&(f=v,l&&l.copy(p),c&&c.copy(a),v<h))return Math.sqrt(v)}let m=0;for(let g=0;g<3;g++)for(let p=0;p<=1;p++)for(let v=0;v<=1;v++){let _=(g+1)%3,y=(g+2)%3,w=p<<_|v<<y,b=1<<g|p<<_|v<<y,E=A[w],M=A[b];i[m].set(E,M);let S=t[g],T=t[_],C=t[y],x=r[m],R=x.start,L=x.end;R[S]=u[S],R[T]=p?u[T]:d[T],R[C]=v?u[C]:d[T],L[S]=d[S],L[T]=p?u[T]:d[T],L[C]=v?u[C]:d[T],m++}for(let g=0;g<=1;g++)for(let p=0;p<=1;p++)for(let v=0;v<=1;v++){a.x=g?d.x:u.x,a.y=p?d.y:u.y,a.z=v?d.z:u.z,this.closestPointToPoint(a,n);let _=a.distanceToSquared(n);if(_<f&&(f=_,l&&l.copy(n),c&&c.copy(a),_<h))return Math.sqrt(_)}for(let g=0;g<12;g++){let p=i[g];for(let v=0;v<12;v++){let _=r[v];jN(p,_,n,a);let y=n.distanceToSquared(a);if(y<f&&(f=y,l&&l.copy(n),c&&c.copy(a),y<h))return Math.sqrt(y)}}return Math.sqrt(f)}}();var Rm=new O,Bm=new O,Im=new O,vb=new Me,_b=new Me,yb=new Me,OQ=new O,NQ=new O,UQ=new O,Eb=ne
7715w O;function VRe(t,i,r,n,a,s){let o;return s===Ea?o=t.intersectTriangle(n,r,i,!0,a):o=t.intersectTriangle(i,r,n,s!==hs,a),o===null?null:{distance:t.origin.distanceTo(a),point:a.clone()}}function WRe(t,i,r,n,a,s,o,l,c){Rm.fromBufferAttribute(i,s),Bm.fromBufferAttribute(i,o),Im.fromBufferAttribute(i,l);let h=VRe(t,Rm,Bm,Im,Eb,c);if(h){n&&(vb.fromBufferAttribute(n,s),_b.fromBufferAttribute(n,o),yb.fromBufferAttribute(n,l),h.uv=za.getInterpolation(Eb,Rm,Bm,Im,vb,_b,yb,new Me)),a&&(vb.fromBufferAttribute(a,s),_b.fromBufferAttribute(a,o),yb.fromBufferAttribute(a,l),h.uv1=za.getInterpolation(Eb,Rm,Bm,Im,vb,_b,yb,new Me)),r&&(OQ.fromBufferAttribute(r,s),NQ.fromBufferAttribute(r,o),UQ.fromBufferAttribute(r,l),h.normal=za.getInterpolation(Eb,Rm,Bm,Im,OQ,NQ,UQ,new O),h.normal.dot(t.direction)>0&&h.normal.multiplyScalar(-1));let u={a:s,b:o,c:l,normal:new O,materialIndex:0};za.getNormal(Rm,Bm,Im,u.normal),h.face=u,h.faceIndex=s}return h}function BK(t,i,r,n,a){let s=n*3,o=t.index.getX(s),l=t.index.getX(s+1),c=t.index.getX(s+2),{position:h,normal:u,uv:d,uv1:A}=t.attributes,f=WRe(r,h,u,d,A,o,l,c,i);return f?(f.faceIndex=n,a&&a.push(f),f):null}function jRe(t,i,r,n,a,s){for(let o=n,l=n+a;o<l;o++)BK(t,i,r,o,s)}function YRe(t,i,r,n,a){let s=1/0,o=null;for(let l=n,c=n+a;l<c;l++){let h=BK(t,i,r,l);h&&h.distance<s&&(o=h,s=h.distance)}return o}function jc(t,i,r,n){let a=t.a,s=t.b,o=t.c,l=i,c=i+1,h=i+2;r&&(l=r.getX(i),c=r.getX(i+1),h=r.getX(i+2)),a.x=n.getX(l),a.y=n.getY(l),a.z=n.getZ(l),s.x=n.getX(c),s.y=n.getY(c),s.z=n.getZ(c),o.x=n.getX(h),o.y=n.getY(h),o.z=n.getZ(h)}function FQ(t,i,r,n,a,s,o){let l=r.index,c=r.attributes.position;for(let h=t,u=i+t;h<u;h++)if(jc(o,h*3,l,c),o.needsUpdate=!0,n(o,h,a,s))return!0;return!1}var IK=class{constructor(t){this._getNewPrimitive=t,this._primitives=[]}getPrimitive(){let t=this._primitives;return t.length===0?this._getNewPrimitive():t.pop()}releasePrimitive(t){this._primitives.push(t)}};
7715function jd(t,i){return i[t+15]===65535}function Dg(t,i){return i[t+6]}function zy(t,i){return i[t+14]}function Qy(t){return t+8}function Vy(t,i){return i[t+6]}function KRe(t,i){return i[t+7]}var fg=new Sn,hT=new O,XRe=["x","y","z"];function uL(t,i,r,n,a){let s=t*2,o=j0,l=SA,c=CA;if(jd(s,l)){let h=Dg(t,c),u=zy(s,l);jRe(i,r,n,h,u,a)}else{let h=Qy(t);uT(h,o,n,hT)&&uL(h,i,r,n,a);let u=Vy(t,c);uT(u,o,n,hT)&&uL(u,i,r,n,a)}}function dL(t,i,r,n){let a=t*2,s=j0,o=SA,l=CA;if(jd(a,o)){let c=Dg(t,l),h=zy(a,o);return YRe(i,r,n,c,h)}else{let c=KRe(t,l),h=XRe[c],u=n.direction[h]>=0,d,A;u?(d=Qy(t),A=Vy(t,l)):(d=Vy(t,l),A=Qy(t));let f=uT(d,s,n,hT)?dL(d,i,r,n):null;if(f){let g=f.point[h];if(u?g<=s[A+c]:g>=s[A+c+3])return f}let m=uT(A,s,n,hT)?dL(A,i,r,n):null;return f&&m?f.distance<=m.distance?f:m:f||m||null}}var qRe=function(){let t,i,r=[],n=new IK(()=>new Sn);return function(...s){t=n.getPrimitive(),i=n.getPrimitive(),r.push(t,i);let o=a(...s);n.releasePrimitive(t),n.releasePrimitive(i),r.pop(),r.pop();let l=r.length;return l>0&&(i=r[l-1],t=r[l-2]),o};function a(s,o,l,c,h=null,u=0,d=0){function A(_){let y=_*2,w=SA,b=CA;for(;!jd(y,w);)_=Qy(_),y=_*2;return Dg(_,b)}function f(_){let y=_*2,w=SA,b=CA;for(;!jd(y,w);)_=Vy(_,b),y=_*2;return Dg(_,b)+zy(y,w)}let m=s*2,g=j0,p=SA,v=CA;if(jd(m,p)){let _=Dg(s,v),y=zy(m,p);return Zc(s,g,t),c(_,y,!1,d,u+s,t)}else{let _=Qy(s),y=Vy(s,v),w=_,b=y,E,M,S,T;if(h&&(S=t,T=i,Zc(w,g,S),Zc(b,g,T),E=h(S),M=h(T),M<E)){w=y,b=_;let Y=E;E=M,M=Y,S=T}S||(S=t,Zc(w,g,S));let C=jd(w*2,p),x=l(S,C,E,d+1,u+w),R;if(x===2){let Y=A(w),D=f(w)-Y;R=c(Y,D,!0,d+1,u+w,S)}else R=x&&a(w,o,l,c,h,u,d+1);if(R)return!0;T=i,Zc(b,g,T);let L=jd(b*2,p),I=l(T,L,M,d+1,u+b),F;if(I===2){let Y=A(b),D=f(b)-Y;F=c(Y,D,!0,d+1,u+b,T)}else F=I&&a(b,o,l,c,h,u,d+1);return!!F}}}(),ZRe=function(){let t=new ju,i=new ju,r=new ht,n=new mh,a=new mh;return function s(o,l,c,h,u=null){let d=o*2,A=j0,f=SA,m=CA;if(u===null&&(c.boundingBox||c.computeBoundingBox(),n.set(c.boundingBox.min,c.boundingBox.max,h),u=n),jd(d,f)){let g=l,p=g.index,v=g.attributes.position,_=c.index,y=c.attributes.position,w=Dg(o,m),b=zy(d,f);if(r.copy(h).invert(),c.boundsTree)return Zc(o,A,a),a.matrix.copy(r),a.needsUpdate=!0,c.boundsTree.shapecast({intersectsBounds:E=>a.intersectsBox(E),intersectsTriangle:E=>{E.a.applyMatrix4(h),E.b.applyMatrix4(h),E.c.applyMatrix4(h),E.needsUpdate=!0;for(let M=w*3,S=(b+w)*3;M<S;M+=3)if(jc(i,M,p,v),i.needsUpdate=!0,E.intersectsTriangle(i))return!0;return!1}});for(let E=w*3,M=b+w*3;E<M;E+=3){jc(t,E,p,v),t.a.applyMatrix4(r),t.b.applyMatrix4(r),t.c.applyMatrix4(r),t.needsUpdate=!0;for(let S=0,T=_.count;S<T;S+=3)if(jc(i,S,_,y),i.needsUpdate=!0,t.intersectsTriangle(i))return!0}}else{let g=o+8,p=m[o+6];return Zc(g,A,fg),!!(u.intersectsBox(fg)&&s(g,l,c,h,u)||(Zc(p,A,fg),u.intersectsBox(fg)&&s(p,l,c,h,u)))}}}();function uT(t,i,r,n){return Zc(t,i,fg),r.intersectBox(fg,n)}var AL=[],IS,j0,SA,CA;function E_(t){IS&&AL.push(IS),IS=t,j0=new Float32Array(t),SA=new Uint16Array(t),CA=new Uint32Array(t)}function wb(){IS=null,j0=null,SA=null,CA=null,AL.length&&E_(AL.pop())}var mI=Symbol("skip tree generation"),gI=new Sn,vI=new Sn,Dm=new ht,of=new mh,kv=new mh,Hv=new O,bb=new O,JRe=new O,$Re=new O,eBe=new O,kQ=new Sn,xc=new IK(()=>new ju),J_=class{static serialize(t,i={}){if(i.isBufferGeometry)return console.warn("MeshBVH.serialize: The arguments for the function have changed. See documentation for new signature."),J_.serialize(arguments[0],{cloneBuffers:arguments[2]===void 0?!0:arguments[2]});i={cloneBuffers:!0,...i};let r=t.geometry,n=t._roots,a=r.getIndex(),s;return i.cloneBuffers?s={roots:n.map(o=>o.slice()),index:a.array.slice()}:s={roots:n,index:a.array},s}static deserialize(t,i,r={}){if(typeof r=="boolean")return console.warn("MeshBVH.deserialize: The arguments for the function have changed. See documentation for new signature."),J_.deserialize(arguments[0],arguments[1],{setIndex:arguments[2]===void 0?!0:arguments[2]});r={setIndex:!0,...r};let{index:n,roots:a}=t,s=new J_(i,{...r,[mI]:!0});if(s._roots=a,r.setIndex){let o=i.getIndex();if(o===null){let l=new ei(t.index,1,!1);i.setIndex(l)}else o.array!==n&&(o.array.set(n),o.needsUpdate=!0)}return s}constructor(t,i={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");
7715if(i=Object.assign({strategy:0,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,[mI]:!1},i),i.useSharedArrayBuffer&&typeof SharedArrayBuffer>"u")throw new Error("MeshBVH: SharedArrayBuffer is not available.");this._roots=null,i[mI]||(this._roots=HRe(t,i),!t.boundingBox&&i.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new Sn))),this.geometry=t}refit(t=null){t&&Array.isArray(t)&&(t=new Set(t));let i=this.geometry,r=i.index.array,n=i.attributes.position,a,s,o,l,c=0,h=this._roots;for(let d=0,A=h.length;d<A;d++)a=h[d],s=new Uint32Array(a),o=new Uint16Array(a),l=new Float32Array(a),u(0,c),c+=a.byteLength;function u(d,A,f=!1){let m=d*2;if(o[m+15]===65535){let g=s[d+6],p=o[m+14],v=1/0,_=1/0,y=1/0,w=-1/0,b=-1/0,E=-1/0;for(let M=3*g,S=3*(g+p);M<S;M++){let T=r[M],C=n.getX(T),x=n.getY(T),R=n.getZ(T);C<v&&(v=C),C>w&&(w=C),x<_&&(_=x),x>b&&(b=x),R<y&&(y=R),R>E&&(E=R)}return l[d+0]!==v||l[d+1]!==_||l[d+2]!==y||l[d+3]!==w||l[d+4]!==b||l[d+5]!==E?(l[d+0]=v,l[d+1]=_,l[d+2]=y,l[d+3]=w,l[d+4]=b,l[d+5]=E,!0):!1}else{let g=d+8,p=s[d+6],v=g+A,_=p+A,y=f,w=!1,b=!1;t?y||(w=t.has(v),b=t.has(_),y=!w&&!b):(w=!0,b=!0);let E=y||w,M=y||b,S=!1;E&&(S=u(g,A,y));let T=!1;M&&(T=u(p,A,y));let C=S||T;if(C)for(let x=0;x<3;x++){let R=g+x,L=p+x,I=l[R],F=l[R+3],Y=l[L],D=l[L+3];l[d+x]=I<Y?I:Y,l[d+x+3]=F>D?F:D}return C}}}traverse(t,i=0){let r=this._roots[i],n=new Uint32Array(r),a=new Uint16Array(r);s(0);function s(o,l=0){let c=o*2,h=a[c+15]===65535;if(h){let u=n[o+6],d=a[c+14];t(l,h,new Float32Array(r,o*4,6),u,d)}else{let u=o+8,d=n[o+6],A=n[o+7];t(l,h,new Float32Array(r,o*4,6),A)||(s(u,l+1),s(d,l+1))}}}raycast(t,i=pc){let r=this._roots,n=this.geometry,a=[],s=i.isMaterial,o=Array.isArray(i),l=n.groups,c=s?i.side:i;for(let h=0,u=r.length;h<u;h++){let d=o?i[l[h].materialIndex].side:c,A=a.length;if(E_(r[h]),uL(0,n,d,t,a),wb(),o){let f=l[h].materialIndex;for(let m=A,g=a.length;m<g;m++)a[m].face.materialIndex=f}}return a}raycastFirst(t,i=pc){let r=this._roots,n=this.geometry,a=i.isMaterial,s=Array.isArray(i),o=null,l=n.groups,c=a?i.side:i;for(let h=0,u=r.length;h<u;h++){let d=s?i[l[h].materialIndex].side:c;E_(r[h]);let A=dL(0,n,d,t);wb(),A!=null&&(o==null||A.distance<o.distance)&&(o=A,s&&(A.face.materialIndex=l[h].materialIndex))}return o}intersectsGeometry(t,i){let r=this.geometry,n=!1;for(let a of this._roots)if(E_(a),n=ZRe(0,r,t,i),wb(),n)break;return n}shapecast(t,i,r){let n=this.geometry;if(t instanceof Function){if(i){let d=i;i=(A,f,m,g)=>{let p=f*3;return d(A,p,p+1,p+2,m,g)}}t={boundsTraverseOrder:r,intersectsBounds:t,intersectsTriangle:i,intersectsRange:null},console.warn("MeshBVH: Shapecast function signature has changed and now takes an object of callbacks as a second argument. See docs for new signature.")}let a=xc.getPrimitive(),{boundsTraverseOrder:s,intersectsBounds:o,intersectsRange:l,intersectsTriangle:c}=t;if(l&&c){let d=l;l=(A,f,m,g,p)=>d(A,f,m,g,p)?!0:FQ(A,f,n,c,m,g,a)}else l||(c?l=(d,A,f,m)=>FQ(d,A,n,c,f,m,a):l=(d,A,f)=>f);let h=!1,u=0;for(let d of this._roots){if(E_(d),h=qRe(0,n,o,l,s,u),wb(),h)break;u+=d.byteLength}return xc.releasePrimitive(a),h}bvhcast(t,i,r){let{intersectsRanges:n,intersectsTriangles:a}=r,s=this.geometry.index,o=this.geometry.attributes.position,l=t.geometry.index,c=t.geometry.attributes.position;Dm.copy(i).invert();let h=xc.getPrimitive(),u=xc.getPrimitive();if(a){let A=function(f,m,g,p,v,_,y,w){for(let b=g,E=g+p;b<E;b++){jc(u,b*3,l,c),u.a.applyMatrix4(i),u.b.applyMatrix4(i),u.c.applyMatrix4(i),u.needsUpdate=!0;for(let M=f,S=f+m;M<S;M++)if(jc(h,M*3,s,o),h.needsUpdate=!0,a(h,u,M,b,v,_,y,w))return!0}return!1};if(n){let f=n;n=function(m,g,p,v,_,y,w,b){return f(m,g,p,v,_,y,w,b)?!0:A(m,g,p,v,_,y,w,b)}}else n=A}t.getBoundingBox(vI),vI.applyMatrix4(i);let d=this.shapecast({intersectsBounds:A=>vI.intersectsBox(A),intersectsRange:(A,f,m,g,p,v)=>(gI.copy(v),gI.applyMatrix4(Dm),t.shapecast({intersectsBounds:_=>gI.intersectsBox(_),intersectsRange:(_,y,w,b,E)=>n(A,f,_,y,g,p,b,E)}))});return xc.releasePrimitive(h),xc.releasePrimitive(u),d}intersectsBox(t,i){return of.set(t.min,t.max,i),of.needsUpdate=!0,this.shapecast({intersectsBounds:r=>of.intersectsBox(r),intersectsTriangle:r=>of.intersectsTriangle(r)})}intersectsSphere(t){return this.shapecast({intersectsBounds:i=>t.intersectsBox(i),intersectsTriangle:i=>i.intersectsSphere(t)})}closestPointToGeometry(t,i,r={},n={},a=0,s=1/0){t.boundingBox||t.computeBoundingBox(),of.set(t.boundingBox.min,t.boundingBox.max,i),of.needsUpdate=!0;let o=this.geometry,l=o.attributes.position,c=o.index,h=t.attributes.position,u=t.index,d=xc.getPrimitive(),A=xc.getPrimitive(),f=bb,m=JRe,g=null,p=null;n&&(g=$Re,p=eBe);let v=1/0,_=null,y=null;return Dm.copy(i).invert(),kv.matrix.copy(Dm),this.shapecast({boun
vendor: 5,995 bytes, line 7715
7715dsTraverseOrder:w=>of.distanceToBox(w),intersectsBounds:(w,b,E)=>E<v&&E<s?(b&&(kv.min.copy(w.min),kv.max.copy(w.max),kv.needsUpdate=!0),!0):!1,intersectsRange:(w,b)=>{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:E=>kv.distanceToBox(E),intersectsBounds:(E,M,S)=>S<v&&S<s,intersectsRange:(E,M)=>{for(let S=E*3,T=(E+M)*3;S<T;S+=3){jc(A,S,u,h),A.a.applyMatrix4(i),A.b.applyMatrix4(i),A.c.applyMatrix4(i),A.needsUpdate=!0;for(let C=w*3,x=(w+b)*3;C<x;C+=3){jc(d,C,c,l),d.needsUpdate=!0;let R=d.distanceToTriangle(A,f,g);if(R<v&&(m.copy(f),p&&p.copy(g),v=R,_=C/3,y=S/3),R<a)return!0}}}});{let E=u?u.count:h.count;for(let M=0,S=E;M<S;M+=3){jc(A,M,u,h),A.a.applyMatrix4(i),A.b.applyMatrix4(i),A.c.applyMatrix4(i),A.needsUpdate=!0;for(let T=w*3,C=(w+b)*3;T<C;T+=3){jc(d,T,c,l),d.needsUpdate=!0;let x=d.distanceToTriangle(A,f,g);if(x<v&&(m.copy(f),p&&p.copy(g),v=x,_=T/3,y=M/3),x<a)return!0}}}}}),xc.releasePrimitive(d),xc.releasePrimitive(A),v===1/0?null:(r.point?r.point.copy(m):r.point=m.clone(),r.distance=v,r.faceIndex=_,n&&(n.point?n.point.copy(p):n.point=p.clone(),n.point.applyMatrix4(Dm),m.applyMatrix4(Dm),n.distance=m.sub(n.point).length(),n.faceIndex=y),r)}closestPointToPoint(t,i={},r=0,n=1/0){let a=r*r,s=n*n,o=1/0,l=null;if(this.shapecast({boundsTraverseOrder:h=>(Hv.copy(t).clamp(h.min,h.max),Hv.distanceToSquared(t)),intersectsBounds:(h,u,d)=>d<o&&d<s,intersectsTriangle:(h,u)=>{h.closestPointToPoint(t,Hv);let d=t.distanceToSquared(Hv);return d<o&&(bb.copy(Hv),o=d,l=u),d<a}}),o===1/0)return null;let c=Math.sqrt(o);return i.point?i.point.copy(bb):i.point=bb.clone(),i.distance=c,i.faceIndex=l,i}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(i=>{Zc(0,new Float32Array(i),kQ),t.union(kQ)}),t}},Gv=$u(ZAe()),tBe=.5*(Math.sqrt(3)-1),zv=(3-Math.sqrt(3))/6,iBe=1/3,Rc=1/6,$_=t=>Math.floor(t)|0,HQ=new Float64Array([1,1,-1,1,1,-1,-1,-1,1,0,-1,0,1,0,-1,0,0,1,0,-1,0,1,0,-1]),_I=new Float64Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0,1,0,1,-1,0,1,1,0,-1,-1,0,-1,0,1,1,0,-1,1,0,1,-1,0,-1,-1]);function yI(t=Math.random){let i=DK(t),r=new Float64Array(i).map(a=>HQ[a%12*2]),n=new Float64Array(i).map(a=>HQ[a%12*2+1]);return function(a,s){let o=0,l=0,c=0,h=(a+s)*tBe,u=$_(a+h),d=$_(s+h),A=(u+d)*zv,f=u-A,m=d-A,g=a-f,p=s-m,v,_;g>p?(v=1,_=0):(v=0,_=1);let y=g-v+zv,w=p-_+zv,b=g-1+2*zv,E=p-1+2*zv,M=u&255,S=d&255,T=.5-g*g-p*p;if(T>=0){let R=M+i[S],L=r[R],I=n[R];T*=T,o=T*T*(L*g+I*p)}let C=.5-y*y-w*w;if(C>=0){let R=M+v+i[S+_],L=r[R],I=n[R];C*=C,l=C*C*(L*y+I*w)}let x=.5-b*b-E*E;if(x>=0){let R=M+1+i[S+1],L=r[R],I=n[R];x*=x,c=x*x*(L*b+I*E)}return 70*(o+l+c)}}function rBe(t=Math.random){let i=DK(t),r=new Float64Array(i).map(s=>_I[s%12*3]),n=new Float64Array(i).map(s=>_I[s%12*3+1]),a=new Float64Array(i).map(s=>_I[s%12*3+2]);return function(s,o,l){let c,h,u,d,A=(s+o+l)*iBe,f=$_(s+A),m=$_(o+A),g=$_(l+A),p=(f+m+g)*Rc,v=f-p,_=m-p,y=g-p,w=s-v,b=o-_,E=l-y,M,S,T,C,x,R;w>=b?b>=E?(M=1,S=0,T=0,C=1,x=1,R=0):w>=E?(M=1,S=0,T=0,C=1,x=0,R=1):(M=0,S=0,T=1,C=1,x=0,R=1):b<E?(M=0,S=0,T=1,C=0,x=1,R=1):w<E?(M=0,S=1,T=0,C=0,x=1,R=1):(M=0,S=1,T=0,C=1,x=1,R=0);let L=w-M+Rc,I=b-S+Rc,F=E-T+Rc,Y=w-C+2*Rc,D=b-x+2*Rc,U=E-R+2*Rc,j=w-1+3*Rc,J=b-1+3*Rc,z=E-1+3*Rc,$=f&255,te=m&255,ae=g&255,ve=.6-w*w-b*b-E*E;if(ve<0)c=0;else{let N=$+i[te+i[ae]];ve*=ve,c=ve*ve*(r[N]*w+n[N]*b+a[N]*E)}let oe=.6-L*L-I*I-F*F;if(oe<0)h=0;else{let N=$+M+i[te+S+i[ae+T]];oe*=oe,h=oe*oe*(r[N]*L+n[N]*I+a[N]*F)}let K=.6-Y*Y-D*D-U*U;if(K<0)u=0;else{let N=$+C+i[te+x+i[ae+R]];K*=K,u=K*K*(r[N]*Y+n[N]*D+a[N]*U)}let X=.6-j*j-J*J-z*z;if(X<0)d=0;else{let N=$+1+i[te+1+i[ae+1]];X*=X,d=X*X*(r[N]*j+n[N]*J+a[N]*z)}return 32*(c+h+u+d)}}function DK(t){let i=new Uint8Array(512);for(let r=0;r<512/2;r++)i[r]=r;for(let r=0;r<512/2-1;r++){let n=r+~~(t()*(256-r)),a=i[r];i[r]=i[n],i[n]=a}for(let r=256;r<512;r++)i[r]=i[r-256];return i}var zl=new za,nBe=class{constructor(t){this.weightAttribute=null;let i=t.geometry;if(!i.isBufferGeometry||i.attributes.position.itemSize!==3)throw new Error("THREE.MeshSurfaceSampler: Requires BufferGeometry triangle mesh.");i.index&&(i=i.toNonIndexed()),this.geometry=i,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.distribution=null}build(){let t=this.positionAttribute,i=new Float32Array(t.count/3);for(let n=0;n<t.count;n+=3){let a=1;zl.a.fromBufferAttribute(t,n),zl.b.fromBufferAttribute(t,n+1),zl.c.fromBufferAttribute(t,n+2),a*=zl.getArea(),i[n/3]=a}this.distribution=new Float32Array(t.count/3);let r=0;for(let n=0;n<i.length;n++)r+=i[n],this.distribution[n]=r;return this}setRandomGenerator(t){return this.randomFunction=t,this}sample(t,i){if(this.distribution){let r=this.distribution[this.distribution.length-1],n=this.binarySearch(this.randomFunction()*r);return this.sampleFace(n,t,i)}}binarySearch(t){if(!this.distribution)return 0;let i=this.distribution,r=0,n=i.length-1,a=-1;for(;r<=n;){let s=Math.ceil((r+n)/2);if(s===0||i[s-1]<=t&&i[s]>t){a=s;break}else t<i[s]?n=s-1:r=s+1}return a}sampleFace(t,i,r){let n=this.randomFunction(),a=this.randomFunction();return n+a>1&&(n=1-n,a=1-a),zl.a.fromBufferAttribute(this.positionAttribute,t*3),zl.b.fromBufferAttribute(this.positionAttribute,t*3+1),zl.c.fromBufferAttribute(this.positionAttribute,t*3+2),i.set(0,0,0).addScaledVector(zl.a,n).addScaledVector(zl.b,a).addScaledVector(zl.c,1-(n+a)),zl.getNormal(r),this}},aBe=$u(d7()),sBe=new ht,oBe=new ht,lBe=new ht,Wy;(t=>{function i(r){return r&&r.__isSPEObject}t.is=i})(Wy||(Wy={}));var YN=t=>class extends t{constructor(){super(...arguments),this.previousModelViewMatrix=new ht,this.copyPreviousMatrix=!0,this.hiddenMatrix=new ht,this.matrixWorldRigid=new ht,this.shearScale=new ht,this.shearScaleInv=new ht}get __isSPEObject(){return!0}isDescendantOf(i){i instanceof lr&&(i=i.uuid);let r=this;for(;r.parent;){if(r.parent.uuid===i)return!0;r=r.parent}return!1}updateMatrixWorld(i){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||i)&&(this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix
7715):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,i=!0);for(let r of this.children)r.updateMatrixWorld(i)}updateWorldMatrix(i,r){let n=this.parent;if(i&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.parent===null?this.matrixWorld.multiplyMatrices(this.hiddenMatrix,this.matrix):(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,this.matrix)),r)for(let a of this.children)a.updateWorldMatrix(!1,!0)}traverseChildren(i,r=0){for(let n of this.children)Wy.is(n)&&n.traverseObject(i,r+1)}traverseObject(i,r=0){if(i(this,r)!==!0)for(let n of this.children)Wy.is(n)&&n.traverseObject(i,r+1)}updateMatrixWorldSVD(){let i=this.matrixWorld.elements,r=[[i[0],i[4],i[8]],[i[1],i[5],i[9]],[i[2],i[6],i[10]]],{u:n,v:a,q:s}=(0,aBe.SVD)(r),o=sBe.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1),l=oBe.set(a[0][0],a[0][1],a[0][2],0,a[1][0],a[1][1],a[1][2],0,a[2][0],a[2][1],a[2][2],0,0,0,0,1),c=lBe.copy(l).transpose();this.shearScale.makeScale(s[0],s[1],s[2]).multiply(c).premultiply(l),this.shearScaleInv.copy(this.shearScale).invert(),this.matrixWorldRigid.multiplyMatrices(o,c).copyPosition(this.matrixWorld),s.every(h=>Math.abs(s[0]-h)<.01)?this.hasNonUniformScale=!1:this.hasNonUniformScale=!0}attach(i,r){this.updateWorldMatrix(!0,!1);let n=new ht().copy(this.matrixWorld).invert();return i.parent!==null&&(i.parent.updateWorldMatrix(!0,!1),n.multiply(i.parent.matrixWorld)),"hiddenMatrix"in i&&i.hiddenMatrix instanceof ht?i.hiddenMatrix.premultiply(n):i.applyMatrix4(n),i.updateWorldMatrix(!1,!1),this.add(i),r!==void 0&&(this.children.pop(),this.children.splice(r,0,i)),this}copy(i,r=!1){return super.copy(i,r),this.hasNonUniformScale=i.hasNonUniformScale,this}onAfterRender(i,r,n,a,s,o){this.copyPreviousMatrix&&this.previousModelViewMatrix.copy(this.modelViewMatrix)}},cBe=class extends YN(lr){},hBe=t=>t.type==="Mesh",us=class extends cBe{constructor(t){super(),this.object=t,this.matrixAutoUpdate=!1,this.hasNonUniformScale=t.hasNonUniformScale}raycast(t,i){}expand(){let t=0,i=this.object.entityChildren(t);for(;i;){let r=this.children[t];(r==null?void 0:r.object)!==i&&(r&&this.remove(r),r=new us(i),this.add(r),this.children.splice(t,0,this.children.pop()),r.matrixWorldNeedsUpdate=!0,r.matrixAutoUpdate=!1,r.matrix=i.matrix,r.hiddenMatrix=i.hiddenMatrix),r.expand(),t+=1,i=this.object.entityChildren(t)}for(;this.children.length>t;)this.remove(this.children[t])}get visible(){var t;return this.playModeVisible!==void 0?this.playModeVisible:this.object.visible||this.object.dataPatched.visible&&((t=this.object.dataPatched.cloner)==null?void 0:t.hideBase)===!0}set visible(t){}get castShadow(){return this.object.castShadow}set castShadow(t){}get receiveShadow(){return this.object.receiveShadow}set receiveShadow(t){}get isMesh(){return hBe(this.object)}get isLight(){return this.object.isLight}get layers(){return this.object.layers}set layers(t){}get isCamera(){return!1}get geometry(){if(this.object.geometry)return this.object.geometry}get material(){if(this.object.material)return this.object.material}},bf=new O,Sf=new O,Pg=new ht,PK=[new O(-1,1,1),new O(-1,-1,1),new O(1,-1,1),new O(1,1,1),new O(-1,1,-1),new O(-1,-1,-1),new O(1,-1,-1),new O(1,1,-1)],uBe=[[0,3],[1,2],[5,6],[4,7],[0,1],[3,2],[7,6],[4,5],[0,4],[1,5],[2,6],[3,7]],dBe=[[0,2],[7,5],[4,1],[3,6],[4,3],[1,6]],GQ=(t,i,r)=>{t.updateEntityBoxSize(bf,Sf),Pg.copy(i).multiply(t.matrixWorld),Sf.x===0&&Sf.y===0&&Sf.z===0?r.push(new O(bf.x,bf.y,bf.z).applyMatrix4(Pg)):PK.forEach(n=>{r.push(n.clone().multiply(Sf).add(bf).applyMatrix4(Pg))})},zQ=class extends Sn{constructor(){super(...arguments),this.matrix=new ht,this.vertices=[],this.faces=[],this.edges=[],this.centerEdges=[]}copy(t){return super.copy(t),this.matrix.copy(t.matrix),this.vertices=t.vertices.map(i=>i.clone()),this.faces=t.faces.map(i=>i.clone()),this.edges=t.edges.map(i=>i.clone()),this.centerEdges=t.centerEdges.map(i=>i.clone()),this}setFromObjectSize(t,i=!1){t.updateWorldMatrix(!1,i),this.makeEmpty(),this.matrix.copy(t.matrixWorld);let r=new ht().copy(t.matrixWorld).invert();return this.expandByObjectSize(t,r,i)}expandByObjectSize(t,i,r=!1){let n=[];return r===!0?t.traverseEntity(a=>{if(a.visible||a.cloner&&a.data.visible){if(!("geometry"in a)){n.push(new O);return}GQ(a,i,n)}}):GQ(t,i,n),this.setFromPoints(n)}
7715getCenter(t){return t=super.getCenter(t),t.applyMatrix4(this.matrix),t}getPositionToCenter(t){return t=super.getCenter(t),t.applyMatrix4(Pg.copy(this.matrix).setPosition(0,0,0)),t}computeVertices(){this.getSize(Sf).multiplyScalar(.5),this.getCenter(bf),Pg.copy(this.matrix).setPosition(bf),this.vertices=PK.map(t=>t.clone().multiply(Sf).applyMatrix4(Pg))}computeEdges(){this.vertices.length>0&&this.computeVertices(),this.edges=uBe.map(([t,i])=>new vl(this.vertices[t],this.vertices[i])),this.centerEdges=this.edges.map(t=>t.getCenter(new O))}computeFaces(){this.vertices.length>0&&this.computeVertices(),this.faces=dBe.map(([t,i])=>this.vertices[t].clone().add(this.vertices[i]).multiplyScalar(.5))}},sA={Cloner:()=>{},changeEntityProptotype:()=>{},createEntity:()=>{}},ABe=class extends G7{constructor(){super()}getPoints(t=12){let i=[],r,n=this.getCurveLengths(),a=n[n.length-1]/n.length;for(let s=0,o=this.curves;s<o.length;s++){let l=o[s],c=s===0?n[s]:n[s]-n[s-1],h=Math.ceil(t*c/a),u=l.getPoints(h);for(let d=0;d<u.length;d++){let A=u[d];r&&r.equals(A)||(i.push(A),r=A)}}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i}},fL=.001;function pL(t,i,r){return i.clone().sub(t).cross(i.clone().sub(r)).length()<=fL}function EI(t,i){let r=new O(...t.position),n=new O(...t.controlNext.position),a=new O(...i.controlPrevious.position),s=new O(...i.position);return pL(r,n,s)&&pL(r,a,s)}function LK(t){let i=t.points.map(u=>new O(...u.data.position)),r=[t.points[0]],n=new O(...r[0].data.position);for(let u=0;u<t.points.length-1;u++)pL(n,i[u],i[u+1])||(r.push(t.points[u]),n=i[u]);r.push(t.points[t.points.length-1]);let a=t.isClosed,s=r.length-(a?0:1),o=r.length,l=[];for(let u=0;u<o;u++){let d=r[u].data,A=new O(...d.position),f=new O(...d.controlPrevious.position),m=new O(...d.controlNext.position),g={position:A,baseRoundness:d.roundness,controlPrevious:f,controlNext:m};if(d.roundness===0||!t.isClosed&&(u===0||u===o-1)){l[u]={...g,removedLength:0};continue}let p=a&&u==0?o-1:u-1,v=a&&u==o-1?0:u+1,_=r[p].data,y=r[v].data,w=new O(..._.position),b=new O(...y.position),E=w.clone().sub(A).normalize(),M=b.clone().sub(A).normalize();Object.assign(g,{prevDir:E,nextDir:M});let S=EI(_,d),T=EI(d,y);if(!S||!T)l[u]={...g,removedLength:0};else{let C=E.clone().add(M).normalize(),x=C.clone().cross(E).length()/E.dot(C);l[u]={...g,tan:x,removedLength:d.roundness/x}}}for(let u=0;u<s;u++){let d=u,A=a&&u===o-1?0:u+1,f=l[d],m=l[A];if(f.removedLength!==0||m.removedLength!==0){let g=f.position.distanceTo(m.position);f.removedLength=Math.min(f.removedLength,g/2),m.removedLength=Math.min(m.removedLength,g/2)}}let c=[];for(let u=0;u<s;u++){let d=u,A=a&&u===o-1?0:u+1,f=l[d],m=l[A],g=null;if(!EI(r[d].data,r[A].data))f.position.distanceTo(m.position)>fL&&(g=new TS(f.position,f.controlNext,m.controlPrevious,m.position));else{let p=f.position.clone(),v=m.position.clone();(f.removedLength!==0||m.removedLength!==0)&&(f.nextDir&&p.add(f.nextDir.clone().setLength(f.removedLength)),m.prevDir&&v.add(m.prevDir.clone().setLength(m.removedLength))),p.distanceTo(v)>fL&&(g=new TS(p,p.clone().lerp(v,.3),v.clone().lerp(p,.3),v))}c[2*u+1]=g}for(let u=0;u<o;u++){let d=l[u];if(d.removedLength===0){c[2*u]=null;continue}let A=d.position,f=d.prevDir.clone().multiplyScalar(d.removedLength).add(A),m=d.nextDir.clone().multiplyScalar(d.removedLength).add(A),g=d.tan*d.removedLength,p=d.prevDir.clone().add(d.nextDir).normalize(),v=f.clone().lerp(m,.5),_=f.distanceTo(m)/2,y=p.clone().multiplyScalar(Math.sqrt(Math.pow(g,2)-Math.pow(_,2))).add(v),w=p.clone().multiplyScalar(-g).add(y),b=A.distanceTo(w)/A.distanceTo(v),E=d.prevDir.clone().multiplyScalar(b*A.distanceTo(f)).add(A),M=E.clone().lerp(w,2),S=f.clone().lerp(E,4/3),T=m.clone().lerp(M,4/3);c[2*u]=new TS(f,S,T,m)}let h=new ABe;return c.forEach(u=>{u&&h.add(u)}),h}var Oi;(t=>{function i(r){return r&&r.__isEntity}t.is=i})(Oi||(Oi={}));var cu=t=>Oi.is(t),fBe={type:"completeState",isfromEntity:!0},pBe=["x","y","z"],wI=new O,mBe=new O().set(0,1,0),KN=t=>class extends YN(t){constructor(){super(...arguments),this.raycastLock=!1,this.scaleLock=!1,this.disposed=!1,this.stateSelection=null,this.destroyedInAction=!1,this.instances=[],this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this._singleBBox=new zQ,this._recursiveBBox=new zQ,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this._needApplyPathSnapping=!0,this.attachedPaths=new Set}get __isEntity(){return!0}entityChildren(i){let r=this.children[i];if(Oi.is(r))return r}entityChildrenCount(){let i=this.children.length;for(;i--;)if(Oi.is(this.children[i]))return i+1;return 0}get isConcreteEntity(){return typeof this.identity=="string"}
vendor: 4,958 bytes, line 7715
7715get isVirtualEntity(){return typeof this.identity!="string"}get isInstanceRoot(){return this.isConcreteEntity&&this.data.type==="Instance"}nearestInstanceSelfOrParent(){let i=this;for(;i.data.type!=="Instance";){let r=i.parent;if(Oi.is(r))i=r;else return}return i}forInstancesRec(i){this.instances.forEach(r=>{r.disposed||i(r),r.forInstancesRec(i)})}super_Entity(i,r){typeof i=="string"&&(this.uuid=i),this.identity=i,this.data=r,this.matrixAutoUpdate=!1,this.dataPatched=this.data}changeSelectedState(i,r,n=!1){if(!(this.data.states.length===0&&!n)){for(let a of this.data.states)Df.toOps(this.data,a.data).forEach(s=>{let o=VC.replaceProps(s,this.data);this.dataPatched=this.data,this.updateByPatchedOp(o,this.data,r)});if(i!==null){let a=this.data.states.data(i);a&&(this.dataPatched=Df.patch(this.data,a),Df.toOps(this.data,a).forEach(s=>{this.updateByPatchedOp(s,this.dataPatched,r)}))}n&&this.updateTransformState(this.dataPatched,r),this.stateSelection=i,this.updatePathSnapping(this.dataPatched.pathSnapping)}}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges(),this._singleBBox.computeFaces()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges(),this._recursiveBBox.computeFaces()),this._recursiveBBox}updateEntityBoxSize(i,r){i.setScalar(0),r.setScalar(0)}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(i=>{cu(i)&&i.resetBBoxNeedsUpdateSelf()}),this.traverseEntity(i=>{i.resetBBoxNeedsUpdateSelf()})}find(i){let r;return this.traverseEntity(n=>{n.uuid===i&&(r=n)}),r}traverseSortNextHelper(){let i=this.parent;if(i){let r=i.children,n=r.indexOf(this)+1;if(Oi.is(r[n]))return r[n];if(Oi.is(i))return i.traverseSortNextHelper()}}sortNext(){let i=this.children;return this.children.length>0&&Oi.is(this.children[0])?i[0]:this.traverseSortNextHelper()}goUp(i){let r=this;for(;i>0&&r!==null;)r=r.parent,i-=1;return r}hasAnccestorOrSelf(i){return this===i||this.hasAnccestor(i)}hasAnccestor(i){let r=this.parent;for(;r;){if(i===r)return!0;r=r.parent}return!1}countToAccestor(i){let r=0,n=this;for(;n!==i;){if(n===null)return-1;n=n.parent,r+=1}return r}forEachEntity(i){for(let r of this.children)cu(r)&&i(r)}traverseEntityAncestors(i){this.traverseAncestors(r=>{Oi.is(r)&&i(r)})}traverseConcreteEntity(i,r=0){if(i(this,r)!==!0)for(let n of this.children)cu(n)&&n.isConcreteEntity&&n.traverseEntity(i,r+1)}traverseEntity(i,r=0){if(i(this,r)!==!0)for(let n of this.children)cu(n)&&n.traverseEntity(i,r+1)}traverseVisibleEntity(i){i(this);for(let r of this.children)cu(r)&&r.visible&&r.traverseVisibleEntity(i)}updateMatrix(){super.updateMatrix(),this.cloner&&this.cloner.onObjUpdateMatrix(),this.dispatchEvent({type:"updateMatrix"})}updateMatrixWorld(i){super.updateMatrixWorld(i),this.dispatchEvent({type:"updateMatrixWorld"})}copy(i,r=!1){return super.copy(i,r),this.dataPatched=i.dataPatched,this.raycastLock=i.raycastLock,this.scaleLock=i.scaleLock,this.hiddenMatrix.copy(i.hiddenMatrix),this}hasEntityChild(){return this.children.some(i=>cu(i))}isAncestorOf(i){if(this.uuid===i)return!1;let r=!1;return this.traverseEntity(n=>{n.uuid===i&&(r=!0)}),r}toObjectTransformState(i=[]){this.updateWorldMatrix(!0,!1);let r={position:this.position.toArray(),rotation:[this.rotation.x*Ct.RAD2DEG,this.rotation.y*Ct.RAD2DEG,this.rotation.z*Ct.RAD2DEG],scale:this.scale.toArray(),hiddenMatrix:this.hiddenMatrix.toArray()};return bP(r,i)}getTransformValues(i,r,n){return r[i].map((a,s)=>(n==null?void 0:n.shared.getVariable(a,[this.uuid,i,pBe[s]]))??a)}updateTransformState(i,r){let n=!1;return i.position&&(this.position.fromArray(this.getTransformValues("position",i,r)),n=!0),i.rotation&&(wI.fromArray(this.getTransformValues("rotation",i,r)).multiplyScalar(Ct.DEG2RAD),this.rotation.setFromVector3(wI),n=!0),i.scale&&(this.scale.fromArray(this.getTransformValues("scale",i,r)),n=!0),i.hiddenMatrix!==void 0&&(n=!0,this.hiddenMatrix.fromArray(i.hiddenMatrix??u0.identity)),n&&(this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(a=>{a.invalidateClonerTransform(this)})),i.position&&i.rotation&&i.scale&&i.hiddenMatrix!==void 0&&this.updateWorldMatrix(!1,!0),n}onVariableUpdate(i=!1){if(i){this.resetBBoxNeedsUpdate();return}this.updateMatrix(),this.resetBBoxNeedsUpdate(),this.invalidateClonerTransform(this),this.traverseEntityAncestors(r=>{r.invalidateClonerTransform(this)})}dispose(){this.disposed=!0,this.cloner&&(this.cloner.removeFromParent(),this.cloner=void 0)}disposeChildrenRecursively(){for(let i of this.children)Oi.is(i)&&i.disposeRecursively()}
7715disposeRecursively(){this.dispose(),this.children.forEach(i=>{Oi.is(i)&&i.disposeRecursively()})}toState(i=[]){let r={name:this.name,visible:this.visible,raycastLock:this.raycastLock,...this.toObjectTransformState(i)};return bP(r,i)}updateByObjUpdateOp(i,r){i!==void 0&&this.updateByOp({type:0,props:i,path:[]},{...this.data,...i},r,!1)}updateByOp(i,r,n,a){let s=this.data;this.data=r;let o=i,l=Er(i.path,["states","*"]);if(l!==null){if(i.type===0){let[c]=l;if((this==null?void 0:this.stateSelection)===c){let h={...i.props};if(delete h.name,Object.values(i.props).some(u=>u===void 0)){let u=this.data;if(u!==void 0){let d=Zn.zoom(u,i.path.slice(2));if(d)for(let A in i.props)i.props[A]===void 0&&A in d&&(h[A]=d[A])}}o={...i,props:h,path:i.path.slice(2)}}}}else if(i.type===0){let c=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(c!==void 0){if(i.props.name!==void 0&&c.name){let{name:u,...d}=c;c=d}if(i.props.material!==void 0&&"material"in c){let{material:u,...d}=c;c=d}let h=Zn.removeOverridden(i.path,i.props,c);o={...i,props:h}}}if(this.updateByPatchedOpBase(o,Df.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),n),Er(i.path,["overrides"])){let c=[],h=[...i.path];for(c.push(h[1]),h.splice(0,2);h.length>0&&h[0]==="descendants";)c.push(h[1]),h.splice(0,2);if(c[c.length-1]===void 0){if(i.type===0)for(let u of Object.keys(i.props)){c[c.length-1]=u;let d=n.scene.findInstance([this.uuid,...c]);d&&(d.overrideData=i.props[u],d.updateState(wA.apply(d.component.data,d.overrideData),n))}}else{let u=n.scene.findInstance([this.uuid,...c]);if(u){let d=Zn.zoom(u.component.data,h);if(i={...i,path:h},i.type===0){let A=i.props;if(d)for(let[f,m]of Object.entries(i.props))m===void 0&&(A===i.props&&(A={...i.props}),A[f]=d[f]);i={...i,props:A}}u.overrideData=tT.resolve(r.overrides,c),u.updateByOp(i,ya.applySimple(u.data,i),n,!1)}}}else if(this.instances.length>0){let c;if(i.path.length===0&&i.type===0){let h;for(let u of nA.rootOverrideProps)u in i.props&&(h===void 0&&(h={}),h[u]=i.props[u]);h&&(c={...i,props:h})}else for(let h of nA.rootOverrideProps)if(Er(i.path,[h])){c=i;break}c!==void 0&&this.instances.forEach(h=>{if(h.isInstanceRoot){let u=wA.filterOp(h.overrideData,c);u&&h.updateByOp(u,ya.applySimple(h.data,u),n,!0)}}),this.instances.forEach(h=>{if(!h.isInstanceRoot){let u=wA.filterOp(h.overrideData,i);if(u){let d;s===h.data&&i===u?d=r:d=ya.applySimple(h.data,u),h.updateByOp(u,d,n,!0)}}})}}updateByPatchedOpBase(i,r,n){if(this.dataPatched=r,i.path.length===0&&i.type===0)i.props.type!==void 0&&!Ap.is(i.props.type)&&sA.changeEntityProptotype(this,r,n);else if(i.path.length===1&&i.path[0]==="geometry"&&i.type===0&&"type"in i.props){sA.changeEntityProptotype(this,r,n);for(let a of this.children)Oi.is(a)&&a.updateVisible(n.scene)}this.updateByPatchedOp(i,r,n)}updateByPatchedOp(i,r,n){if(i.path.length===0&&i.type===0&&this.updateState(i.props,n),Er(i.path,["pathSnapping"])!==null&&this.updatePathSnapping(r.pathSnapping),Er(i.path,["cloner"])!==null){let a=ya.drop(i,1);a.path.length===0&&a.type===0&&a.props.disabled===!0?this.setFromClonerState(null,n):this.cloner?this.cloner.updateState(r.cloner,n.scene):(this.setFromClonerState(r.cloner,n),this.expandCloner(n.scene)),this.updateVisible(n.scene)}}updatePathSnapping(i=this.dataPatched.pathSnapping){this._updatedPathSnapping=i,this._needApplyPathSnapping=!0}get updatedPathSnapping(){return this._updatedPathSnapping}applyPathSnapping(i){var m,g,p,v,_;let r=((m=this._updatedPathSnapping)==null?void 0:m.pathId)??this.dataPatched.pathSnapping.pathId,n=((g=this._updatedPathSnapping)==null?void 0:g.slide)??this.dataPatched.pathSnapping.slide??0,a=((p=this._updatedPathSnapping)==null?void 0:p.offset)??this.dataPatched.pathSnapping.offset??0,s=((v=this._updatedPathSnapping)==null?void 0:v.orientation)??this.dataPatched.pathSnapping.orientation;if(r===null)return;let o=i.find(r);if(!o||this._needApplyPathSnapping===!1)return;this._needApplyPathSnapping=!1;let l=o.data;if(l.geometry.path.points.length<=1)return;let c=LK(l.geometry.path),h=(n+a)%1;n+a===1&&h===0&&(h=1);let u=c.curves.length?c.getPointAt(h):null;if(u===null)return;let d=this.parent?(_=this.parent)==null?void 0:_.matrixWorld:new ht;o.updateMatrixWorld();let A=new ht().multiplyMatrices(d.clone().invert(),o.matrixWorld);u.applyMatrix4(A);let f={position:u.toArray(),rotation:l.rotation};if(s==="tangential"){let y=new ht().extractRotation(o.matrixWorld),w=c.getTangentAt(h).applyMatrix4(y).add(u),b=new ht().lookAt(u,w,mBe),E=wI.setFromEuler(new qn().setFromRotationMatrix(b)).multiplyScalar(Ct.RAD2DEG);f={...f,rotation:E.toArray()}}this.updateTransformState(f),this.traverseEntity(y=>{y._cameraType&&y.dispatchEvent(fBe)})}updateVisible(i){var n;if(this.visible=this.dataPatched.visible&&(!this.dataPatched.cloner||(this.dataPatched.cloner.disabled??!1)||((n=this.dataPatched.cloner)==null?void 0:n.hideBase)!==!0),!i)return;let r=!1;this.traverseEntity(a=>{if(a.data.type==="Splat")return r=!0,!0}),r&&i.reloadSplats()}updateState_Entity(i,r){i.name!==void 0&&(this.name=i.name),i.raycastLock!==void 0&&(this.raycastLock=i.raycastLock),i.visible!==void 0&&(this.updateVisible(r==null?void 0:r.sce
7715ne),this.resetBBoxNeedsUpdate()),r&&"cloner"in i&&i.cloner!==void 0&&(this.setFromClonerState(i.cloner,r),this.updateVisible(r.scene)),this.updateTransformState(i,r)}get attachedSurfaceCloners(){return this.children.filter(i=>i instanceof sA.Cloner&&i.parameters.type==="toObject")}setFromClonerState(i,r){this.disposed||(i===null||i.disabled?(this.cloner&&this.cloner.removeFromParent(),this.cloner=void 0):this.cloner===void 0?(this.cloner=new sA.Cloner(this,i),r.scene.addPendingExpandCloner(this)):this.cloner.updateState(i,r.scene))}expandCloner(i){!this.disposed&&this.cloner&&this.cloner.expandClones(i)}invalidateClonerTransform(i){this.cloner&&this.cloner.invalidateTransform(i)}requestRender(){this.dispatchEvent({type:"requestRender"})}},OK=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,radialSegments:64,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadius:8,cornerSegments:8,hollow:0},t.parameters);r.thetaLength=Ct.clamp(r.thetaLength,0,360);let n=r.width/2,a=r.radiusTop??n,s=r.radiusBottom??n;return a===s?(a=n,s=n):a>s?(a=n,s=s*n/a):(a=a*n/s,s=n),{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width),radiusTop:a,radiusBottom:s})}}static build(t){let{width:i,depth:r,height:n,radialSegments:a,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:c,radiusTop:h,radiusBottom:u,cornerRadius:d,cornerSegments:A,hollow:f}=t.parameters,m;return c===0?(m=new Lt,m.setAttribute("position",new Et([],3))):d||f?m=new NK(h,u,n,a,s,o,l,c*Math.PI/180,d,d,A,f):m=new dN(h,u,n,a,s,o,l,c*Math.PI/180),m.scale(1,1,r/i),Object.assign(m,{userData:{...t,type:"CylinderGeometry"}})}};function gd(t,i,r){r.x=t.x*i.x,r.y=t.y,r.z=t.x*i.y}function QQ(t){return new Me(t.y,-t.x)}var NK=class extends Lt{constructor(t,i,r,n,a,s,o,l,c,h,u,d,A=!1){super(),this.type="RoundedCylinderBufferGeometry",t=t!==void 0?t:1,i=i!==void 0?i:1,r=r||1,n=Math.floor(n)||8,a=Math.floor(a)||1,s=s!==void 0?s:!1,o=o!==void 0?o:0,l=l!==void 0?l:Math.PI*2,s&&(c=0,h=0);let f=[],m=[],g=[],p=[],v=0,_=r/2,y=new O,w=new O;A&&t==0&&(t=c),A&&i==0&&(i=h);let b=new Me(t,_),E=new Me(i,-_),M=null,S=null,T=null,C=null,x=b.clone().sub(E),R=0,L=0,I=0;d>0&&(R=Math.min(t,i)*(1-d),L=t-R,I=i-R);let F=b.clone();F.x-=R;let Y=Math.PI-x.angle(),D=x.angle(),U=Math.tan(D/2),j=Math.tan(Y/2),J=U+j,z=d?J:j,$=d?J:U;if(c=Math.min(c,(t-L)/z,x.length()/J),h=Math.min(h,(i-I)/$,x.length()/J),c>0){let X=c/U;M=b.clone().sub(new Me(X,c)),d&&(T=M.clone(),T.x-=R-J*c),b.sub(x.clone().setLength(X))}if(h>0){let X=h/j;S=E.clone().sub(new Me(X,-h)),E.add(x.clone().setLength(X)),d&&(C=S.clone(),C.x-=R-J*h,F.sub(x.clone().setLength(X)))}x=b.clone().sub(E);let te=x.length()<.5,ae=[];for(let X=0;X<=n;X++){let N=[],k=X/n,Z=k*l+o,V=new Me(Math.sin(Z),Math.cos(Z));C&&S?(ve(N,k,V,Y,h,C,-1,!0),ve(N,k,V,D,h,S,-1,!1)):S?(oe(N,V,S.x,0,-1),ve(N,k,V,D,h,S,-1,!1)):s||oe(N,V,i,I,-1);let re=QQ(x).normalize();if(gd(re,V,y),!te)for(let Ae=0;Ae<=a;Ae++){let pe=Ae/a,ce=x.clone().multiplyScalar(pe).add(E);gd(ce,V,w),m.push(w.x,w.y,w.z),g.push(y.x,y.y,y.z),p.push(k,.5+w.y/r),N.push(v++)}if(T&&M?(ve(N,k,V,Y,c,M,1,!1),ve(N,k,V,D,c,T,1,!0)):M?(ve(N,k,V,Y,c,M,1,!1),oe(N,V,M.x,0,1)):s||oe(N,V,t,L,1),d&&!te){let Ae=QQ(x).multiplyScalar(-1).normalize();gd(Ae,V,y);for(let pe=0;pe<=a;pe++){let ce=pe/a,_e=x.clone().multiplyScalar(-ce).add(F);gd(_e,V,w),m.push(w.x,w.y,w.z),g.push(y.x,y.y,y.z),p.push(k,.5+w.y/r),N.push(v++)}}d&&!s&&N.push(N[0]),ae.push(N)}for(let X=0;X<ae.length-1;X++)for(let N=0;N<ae[0].length-1;N++){if(s&&d&&N==a)continue;let k=ae[X][N],Z=ae[X+1][N],V=ae[X+1][N+1],re=ae[X][N+1],Ae=m[V*3+0],pe=m[V*3+2];f.push(k,Z,re),(Ae!=0||pe!=0)&&f.push(Z,V,re)}l<Math.PI*2&&(K(-1,ae[0],o),K(1,ae[ae.length-1],o+l)),this.setIndex(f),this.setAttribute("position",new Et(m,3)),this.setAttribute("normal",new Et(g,3)),this.setAttribute("uv",new Et(p,2));function ve(X,N,k,Z,V,re,Ae,pe){for(let ce=0;ce<u+1;ce++){let _e=ce/u,me=Ae<0?_e:1-_e;pe&&(me-=1),me*=Z;let le=new Me(Math.sin(me),Math.cos(me)*Ae),De=le.clone().multiplyScalar(V).add(re);
7715gd(De,k,w),m.push(w.x,w.y,w.z),gd(le,k,y),g.push(y.x,y.y,y.z),p.push(N,.5+w.y/r),X.push(v++)}}function oe(X,N,k,Z,V){let re=new O,Ae=new Me,pe=[k,Z];V<0&&pe.reverse();for(let ce of pe)Ae.set(ce,_*V),gd(Ae,N,re),m.push(re.x,re.y,re.z),g.push(0,V,0),p.push(.5,.5),X.push(v++)}function K(X,N,k){let Z=new Me(Math.sin(k),Math.cos(k)),V=new Me(-Math.cos(k),Math.sin(k)),re=new O,Ae=X<0?(_e,me,le)=>f.push(_e,me,le):(_e,me,le)=>f.push(_e,le,me),pe=new Me((t+i+L+I)/4,0);gd(pe,Z,re),m.push(re.x,re.y,re.z),g.push(V.x,0,V.y),p.push(.5,.5);let ce=v++;for(let _e of N){let me=m.slice(_e*3,_e*3+3);m.push(...me),g.push(V.x,0,V.y);let le=p.slice(_e*2,_e*2+2);p.push(...le),v++}for(let _e=ce+1;_e<v-1;_e++)Ae(ce,_e,_e+1);Ae(ce,v-1,ce+1)}}},gBe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,radialSegments:32,heightSegments:8,openEnded:!1,thetaStart:0,thetaLength:360,cornerRadiusTop:8,cornerRadiusBottom:8,cornerSegments:8},t.parameters);return r.thetaLength=Ct.clamp(r.thetaLength,0,360),{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i,depth:r,height:n,radialSegments:a,heightSegments:s,openEnded:o,thetaStart:l,thetaLength:c,cornerRadiusTop:h,cornerRadiusBottom:u,cornerSegments:d}=t.parameters,A;return c===0?(A=new Lt,A.setAttribute("position",new Et([],3))):h>0||u>0||c<360?A=new NK(0,i/2,n,a,s,o,l,c*Math.PI/180,h,u,d,0,!0):A=new AN(i/2,n,a,s,o),A.scale(1,1,r/i),Object.assign(A,{userData:{...t,type:"ConeGeometry"}})}},vBe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,widthSegments:1,heightSegments:1,depthSegments:1,cornerRadius:8,cornerSegments:8},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i,height:r,depth:n,widthSegments:a,heightSegments:s,depthSegments:o,cornerRadius:l,cornerSegments:c}=t.parameters,h;return l===0?h=new gc(i,r,n,a,s,o):h=new _Be(i,r,n,a,s,o,l,c),Object.assign(h,{userData:{...t,type:"CubeGeometry"}})}},bI=Math.PI/2,_Be=class extends Lt{constructor(t=1,i=1,r=1,n=1,a=1,s=1,o=0,l=4){super(),this.type="BoxGeometry",n=Math.floor(n),a=Math.floor(a),s=Math.floor(s),l=Math.floor(l),o=Math.min(o,t/2,i/2,r/2);let c=[],h=[],u=[],d=[],A=0;f("z","y","x",-1,-1,r,i,t,s,a),f("z","y","x",1,-1,r,i,-t,s,a),f("x","z","y",1,1,t,r,i,n,s),f("x","z","y",1,-1,t,r,-i,n,s),f("x","y","z",1,-1,t,i,r,n,a),f("x","y","z",-1,-1,t,i,-r,n,a),o>0&&(m("z","y","x",-1,-1,1,r,i,t,s),m("z","y","x",1,-1,-1,r,i,t,s),m("z","y","x",-1,1,-1,r,i,t,s),m("z","y","x",1,1,1,r,i,t,s),m("x","y","z",-1,-1,-1,t,i,r,n),m("x","y","z",1,-1,1,t,i,r,n),m("x","y","z",-1,1,1,t,i,r,n),m("x","y","z",1,1,-1,t,i,r,n),m("y","x","z",-1,-1,1,i,t,r,a),m("y","x","z",1,-1,-1,i,t,r,a),m("y","x","z",1,1,1,i,t,r,a),m("y","x","z",-1,1,-1,i,t,r,a),g(1,1,1),g(-1,1,1),g(1,-1,1),g(-1,-1,1),g(1,1,-1),g(-1,1,-1),g(1,-1,-1),g(-1,-1,-1)),this.setIndex(c),this.setAttribute("position",new Et(h,3)),this.setAttribute("normal",new Et(u,3)),this.setAttribute("uv",new Et(d,2));function f(p,v,_,y,w,b,E,M,S,T){let C=(b-2*o)/S,x=(E-2*o)/T,R=b/2-o,L=E/2-o,I=M/2,F=S+1,Y=T+1,D=0,U=new O;for(let j=0;j<Y;j++){let J=j*x-L;for(let z=0;z<F;z++){let $=z*C-R;U[p]=$*y,U[v]=J*w,U[_]=I,h.push(U.x,U.y,U.z),U[p]=0,U[v]=0,U[_]=M>0?1:-1,u.push(U.x,U.y,U.z),d.push(z/S),d.push(1-j/T),D+=1}}for(let j=0;j<T;j++)for(let J=0;J<S;J++){let z=A+J+F*j,$=A+J+F*(j+1),te=A+(J+1)+F*(j+1),ae=A+(J+1)+F*j;c.push(z,$,ae),c.push($,te,ae)}A+=D}function m(p,v,_,y,w,b,E,M,S,T){let C=(E-2*o)/T,x=E/2-o,R=M/2-o,L=S/2,I=T+1,F=0,Y=new O,D=new O;for(let U=0;U<l+1;U++){let j=U/l*bI,J=Math.sin(j)*o,z=(1-Math.cos(j))*o,$=Math.sin(j),te=Math.cos(j);Y[v]=(R+J)*w,Y[_]=(L-z)*b,D[p]=0,D[v]=$*Math.sign(Y[v]),D[_]=te*Math.sign(Y[_]);for(let ae=0;ae<I;ae++){let ve=ae*C-x;Y[p]=ve*y,h.push(Y.x,Y.y,Y.z),u.push(D.x,D.y,D.z),d.push(ae/T),d.push(0),F+=1}}for(let U=0;U<l;U++)for(let j=0;j<T;j++){let J=A+j+I*U,z=A+j+I*(U+1),$=A+(j+1)+I*(U+1),te=A+(j+1)+I*U;c.push(J,z,te),c.push(z,$,te)}A+=F}function g(p,v,_){let y=new O,w=new O(t/2,i/2,r/2);
7715w.subScalar(o);let b=[],E=p*v*_>0?(S,T,C)=>c.push(S,T,C):(S,T,C)=>c.push(S,C,T);for(let S=0;S<=l;S++){let T=[],C=bI*(1-S/l),x=Math.cos(C),R=Math.sin(C),L=0;for(let I=0;I<=S;I++){let F=Math.cos(L),Y=Math.sin(L);y.x=x*F,y.y=R,y.z=x*Y;let D=w.clone().addScaledVector(y,o);h.push(p*D.x,v*D.y,_*D.z),u.push(p*y.x,v*y.y,_*y.z),d.push(0,0),T.push(A++),L+=bI/S}b.push(T)}let M=b.length-1;for(let S=0;S<M;S++){let T=b[S],C=b[S+1],x=T.length-1;E(T[0],C[1],C[0]);for(let R=1;R<=x;R++)E(T[R-1],T[R],C[R]),E(T[R],C[R+1],C[R])}}}},XN=class extends Lt{constructor(t=[],i=[],r="",n=1,a=.2,s=4){super(),this.type="PolyhedronGeometryRound";let o=[],l=[],c=[];h(),u(),this.setAttribute("position",new Et(o,3)),this.setAttribute("normal",new Et(c,3)),this.setAttribute("uv",new Et(l,2));return;function h(){var D;a=Math.min(1-1e-5,a),a==0&&(s=0);let d={IcosahedronGeometry:5,DodecahedronGeometry:3,HexahedronGeometry:3,OctahedronGeometry:4,TetrahedronGeometry:3}[r],A=new O,f=A.clone(),m=new za,g=a*n,p=n-g,v=s+1,_=new O,y=(U,j)=>_.subVectors(U,j).normalize(),w=(U,j)=>Array(U).fill(void 0).map(j),b=w(t.length/3,(U,j)=>new O().fromArray(t,j*3).setLength(n)),E=[],M=1e6;for(let U=0;U<b.length;U++){let j=b[U],J=[],z,$,te,ae=1e10,ve=-1;for(;(ve=i.indexOf(U,ve+1))!=-1;){let N=ve-ve%3;z=i[N+(ve+1)%3],$=i[N+(ve+2)%3],te=j.distanceToSquared(b[z]),ae=Math.min(ae,te),J.push([z,$,te])}ae+=1e-6;let oe=[],K=0,X=J.length;for(let N=0;N<X;N++){[z,$,te]=J[K];let k=((D=E[z])==null?void 0:D.includes(U))==!0;te<=ae&&oe.push(z+ +k*M),K=J.findIndex(Z=>Z[0]==$)}E.push(oe)}let S=[];{let U=0,j=0,J,z,$=d==3;for(let te=0;te<=s;te++){J=te*(te+1)/2,z=(te+1)*(te+2)/2;for(let ae=0;ae<s-te;ae++)[U,j]=[J+ae+te+2,z+ae+te+3],S.push(J,z,...$?[j,J]:[U,z],j,U),[J,z]=[U,j];S.push(J,z,J+s+2)}}let T=A.clone(),C=A.clone(),x=A.clone(),R=A.clone(),L=A.clone(),I=[],F=w(b.length,()=>w(d,()=>A.clone()));for(let U=0;U<b.length;U++){A.copy(b[U]).normalize(),T.copy(A).multiplyScalar(p);let j=E[U];for(let oe=0;oe<j.length;oe++){let K=j[oe],X=j[(oe+1)%d];m.setFromPointsAndIndices(b,U,K%M,X%M),m.b.sub(m.a).setLength(1e10).add(m.a),m.c.sub(m.a).setLength(1e10).add(m.a),m.closestPointToPoint(T,F[U][oe])}let J=[],z=[],$=[],te=new O;s==0&&[...F[U]].reduce((oe,K)=>oe.add(K),te).multiplyScalar(1/d);for(let oe=0;oe<d;oe++){let K=[],X=(oe-1+d)%d,N=F[U][X],k=F[U][oe];A.copy(N).sub(T),f.copy(k).sub(T);let Z=T.angleTo(A),V=A.angleTo(f),re=Math.cos(Z)*g;s==0?C.copy(te):C.copy(T).setLength(p+re),z.push(re);let Ae=[C,N,k];for(let pe=0;pe<2;pe++){let ce=Ae[pe],_e=Ae[pe+1];R.subVectors(ce,T),L.subVectors(_e,T),x.crossVectors(R,L).normalize();for(let me=0;me<v;me++){let le=[Z,V][pe]*me/v;A.copy(R).applyAxisAngle(x,le).add(T),J.push(A.clone()),pe&&(y(A,T),K.push([me==0?ce:A.clone(),_.clone()]))}pe&&(y(_e,T),K.push([_e,_.clone()]))}$.push(K)}I.push($);let ae=2*v,ve=2;for(let oe=0;oe<d;oe++){let K=ae*oe,X=ae*((oe+1)%d),N=[J[K]];for(let Z=1;Z<v;Z++){R=J[K+Z],L=J[X+Z],N.push(R);for(let V=1,re=Z-ve+1;V<=re;V++)A.lerpVectors(R,L,V/(re+1)),A.sub(T).setLength(z[oe]).add(T),N.push(A.clone());N.push(L)}for(let Z=0;Z<v;Z++)N.push(J[Z+v+K]);N.push(J[X+v]);let k=S.map(Z=>N[Z]);o.push(...k.map(Z=>[Z.x,Z.y,Z.z]).flat()),c.push(...k.map(Z=>(y(Z,T),[_.x,_.y,_.z])).flat())}}let Y=[];for(let U=0;U<E.length;U++)for(let j=0;j<d;j++){let J=E[U][j];if(J<M){let z=E[J].findIndex(ae=>ae%M==U),$=I[U][j],te=I[J][z];for(let ae=0;ae<v;ae++){let ve=$[ae],oe=te[v-ae],K=$[ae+1],X=te[v-(ae+1)];[ve,oe,K,K,oe,X].forEach(N=>{o.push(N[0].x,N[0].y,N[0].z),c.push(N[1].x,N[1].y,N[1].z)})}Y.push($[0][0],te[v][0],$[v][0],te[0][0])}}for(;Y.length;){let U,j,J,z;[U,j]=Y.splice(0,2);let $=[U];for(;U!=j;)$.push(j),J=Y.indexOf(j),z=J%2,j=Y.splice(J-z,2)[1-z];_.subVectors($[0],$[1]).cross(A.subVectors($[0],$[2])).normalize();let te=_.dot($[0])<0;te&&_.negate();for(let ae=1;ae<=$.length-2;ae++)[$[ae+ +te],$[ae+1-+te],$[0]].forEach(ve=>{o.push(ve.x,ve.y,ve.z),c.push(_.x,_.y,_.z)})}}function u(){let d=new O;for(let E=0;E<o.length;E+=3){d.x=o[E+0],d.y=o[E+1],d.z=o[E+2];let M=w(d)/2/Math.PI+.5,S=b(d)/Math.PI+.5;l.push(M,1-S)}let A=new O,f=new O,m=new O,g=new O,p=new Me,v=new Me,_=new Me,y=(E,M,S,T)=>{T<0&&E.x===1&&(l[M]=E.x-1),S.x===0&&S.z===0&&(l[M]=T/2/Math.PI+.5)};for(let E=0,M=0;E<o.length;E+=9,M+=6){A.set(o[E+0],o[E+1],o[E+2]),f.set(o[E+3],o[E+4],o[E+5]),m.set(o[E+6],o[E+7],o[E+8]),p.set(l[M+0],l[M+1]),v.set(l[M+2],l[M+3]),_.set(l[M+4],l[M+5]),g.copy(A).add(f).add(m).divideScalar(3);let S=w(g);y(p,M+0,A,S),y(v,M+2,f,S),y(_,M+4,m,S)}for(let E=0;E<l.length;E+=6){let M=l[E+0],S=l[E+2],T=l[E+4],C=Math.max(M,S,T),x=Math.min(M,S,T);C>.9&&x<.1&&(M<.2&&(l[E+0]+=1),S<.2&&(l[E+2]+=1),T<.2&&(l[E+4]+=1))}function w(E){return Math.atan2(E.z,-E.x)}function b(E){return Math.atan2(-E.y,Math.sqrt(E.x*E.x+E.z*E.z))}}}
7715static fromJSON(t){return new XN(t.vertices,t.indices,t.radius,t.corner,t.cornerSides)}},yBe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,detail:0,corner:0,cornerSides:4},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i,height:r,depth:n,detail:a,corner:s,cornerSides:o}=t.parameters,l=a===0&&s!==0?new UK(i*.5,s,o):new Q7(i*.5,a);return l.scale(1,r/i,n/i),Object.assign(l,{userData:{...t,type:"DodecahedronGeometry"}})}},UK=class extends XN{constructor(t=1,i=.2,r=4){let n=(1+Math.sqrt(5))/2,a=1/n,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-a,-n,0,-a,n,0,a,-n,0,a,n,-a,-n,0,-a,n,0,a,-n,0,a,n,0,-n,0,-a,n,0,-a,-n,0,a,n,0,a],o=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 45,332 bytes, line 7715
771519,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],l="DodecahedronGeometry";super(s,o,l,t,i,r),this.type=l}static fromJSON(t){return new UK(t.radius,t.corner,t.cornerSides)}},Qv=1e-12,qN=class{constructor(t){this.position=new Me,this.startPosition=new Me,this.uuid=Ct.generateUUID(),this.position=t.clone()}start(){this.reset()}reset(){this.startPosition.copy(this.position)}applyOffset(t){this.position.copy(this.startPosition).add(t)}copy(t){return this.position.copy(t.position),this.startPosition.copy(t.startPosition),this}clone(){return new qN(this.position).copy(this)}toJSON(){return[this.position.x,this.position.y]}},mL=class extends qN{constructor(t){super(t.position),this.parent=t}copy(t){return super.copy(t),this}clone(){return new mL(this.parent).copy(this)}},Lg=class extends qN{constructor(t,i){super(i),this.controls=[],this.roundness=0,this.areControlsDirectionsMirrored=!0,this.uuid=t,this.controls.push(new mL(this),new mL(this))}static create(t,i){let r=new Lg(t,new Me(...i.position));return r.controls[0].position.set(...i.controlPrevious.position),r.controls[1].position.set(...i.controlNext.position),r.roundness=i.roundness,r.areControlsDirectionsMirrored=i.areControlsDirectionsMirrored,r}getOppositeControl(t){let i=this.controls.indexOf(t);return i===0?this.controls[1]:i===1?this.controls[0]:null}applyOffsetToControls(t,i=1){for(let r=0,n=this.controls.length;r<n;r++){let a=this.controls[r];this.position.distanceTo(a.position)<=i?a.position.copy(this.position):a.applyOffset(t)}}controlsMoved(){return!(this.position.equals(this.controls[0].position)&&this.position.equals(this.controls[1].position))}copy(t){return super.copy(t),this.controls[0].copy(t.controls[0]),this.controls[1].copy(t.controls[1]),this.roundness=t.roundness,this.uuid=t.uuid,this}clone(){return new Lg(this.uuid,this.position).copy(this)}toJSON(){return super.toJSON().concat(this.controls[0].toJSON(),this.controls[1].toJSON(),[this.roundness])}computeTangents(){var r,n;let t=(r=this.curveBefore)==null?void 0:r.getTangentAt(1),i=(n=this.curveAfter)==null?void 0:n.getTangentAt(0);return[t,i]}computeNormals(t=new Me,i=new Me){let[r,n]=this.computeTangents();return r&&n&&(VQ(r,t),VQ(n,i)),[t,i]}computeTangent(t=new Me){let[i,r]=this.computeTangents();return i&&r&&t.copy(i).add(r).normalize(),t}computeNormal(t=new Me){let[i,r]=this.computeNormals();return t.copy(i).add(r).normalize(),t}};function VQ(t,i=new Me){let r=t.length();return i.set(-t.y/r,t.x/r)}var ZN=t=>t,Y0=new Me,SM=new Me,EBe=new Me,wBe=new Me,bBe=new Me,SBe=new Me,FK=new O,kK=new O;function CBe(t){let i=new Me;i.addVectors(t.v0,Y0.subVectors(t.v1,t.v0).multiplyScalar(2/3));let r=new Me;return r.addVectors(t.v2,SM.subVectors(t.v1,t.v2).multiplyScalar(2/3)),new nc(t.v0,i,r,t.v2)}function w_(t,i,r=Number.EPSILON){return Math.abs(t-i)<r}function TBe(t,i,r=Number.EPSILON){return t.distanceTo(i)<r}function MBe(t,i,r=Number.EPSILON){return t.distanceTo(i)<r}function HK(t,i,r){let n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),a=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)),s=Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2));return Math.acos((a*a+n*n-s*s)/(2*a*n))}function xBe(t,i,r){return jQ(t,i)&&jQ(i,r)&&gL(t.position,i.position,r.position)}function gL(t,i,r){return Y0.copy(i).sub(t).cross(SM.copy(r).sub(t))===0}function RBe(t,i,r,n,a){let s=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=(t.y+i.y)/2,l=(t.x+i.x)/2,c=Math.sqrt(Math.pow(r,2)-Math.pow(s/2,2))*(t.y-i.y)/s,h=Math.sqrt(Math.pow(r,2)-Math.pow(s/2,2))*(i.x-t.x)/s;return n.set(l+c,o+h),a.set(l-c,o-h),[n,a]}function BBe(t,i,r){let n=t.distanceTo(r),a=i.distanceTo(r);return n<a?i:t}function IBe(t,i,r,n,a,s){let o=i.x-t.x,l=i.y-t.y,c=r.x-t.x,h=r.y-t.y,u=Math.sqrt((o+c)*(o+c)+(l+h)*(l+h)),d;return HK(i,t,r)>Math.PI&&(u*=-1),w_(h,l)?d=(l+h)*(n/u-.5)*8/3/(o-c):d=(o+c)*(n/u-.5)*8/3/(h-l),a.set(i.x-d*l,i.y+d*o),s.set(r.x+d*h,r.y-d*c),[a,s]}function WQ(t,i){return t.position.equals(t.controls[1].position)&&i.position.equals(i.controls[0].position)}function jQ(t,i){return gL(t.position,t.controls[1].position,i.position)&&gL(t.position,i.controls[0].position,i.position)}function DBe(t,i,r,n,a=.5){let s=Y0.subVectors(i,t).multiplyScalar(a).add(t),o=SM.subVectors(r,i).multiplyScalar(a).add(i),l=EBe.subVectors(n,r).multiplyScalar(a).add(r),c=s,h=wBe.subVectors(o,s).multiplyScalar(a).add(s),u=bBe.subVectors(l,o).multiplyScalar(a).add(o),d=l,A=SBe.subVectors(u,h).multiplyScalar(a).add(h);return[t.x,t.y,c.x,c.y,h.x,h.y,A.x,A.y,u.x,u.y,d.x,d.y,n.x,n.y]}function PBe(t,i,r=12,n=!0){let a=kK.set(0,0,0),s,o=0;for(let l=0;l<i.length;l++){let c=ZN(i[l]),h=Y0,u=np(c,r);for(let d=0;d<=u;d++)if(c instanceof nc||c instanceof DA||c instanceof dc){if(c.getPoint(d/u,h),a.set(h.x,h.y,0),s!==void 0&&MBe(s,a))continue;s===void 0&&(s=FK),s.copy(a),t.setXYZ(o,a.x,a.y,a.z),o++}}return n&&o>1&&!(t.getX(o-1)===t.getX(0)&&t.getY(o-1)===t.getY(0)&&t.getZ(o-1)===t.getZ(0))&&(t.setXYZ(o,t.getX(0),t.getY(0),t.getZ(0)),o++),t}function LBe(t,i,r,n=12,a=!0){let s=kK.set(0,0,0),o=0,l=[];for(let c=0;c<i.length;c++){if(r[c]===!1)continue;let h,u=ZN(i[c]),d=Y0,A=np(u,n);l.push(A);for(let f=0;f<=A;f++)if(u instanceof nc||u instanceof DA||u instanceof dc){if(u.getPoint(f/A,d),s.set(d.x,d.y,0),h==null?void 0:h.equals(s))continue;h===void 0?h=FK:(t.setXYZ(o,h.x,h.y,h.z),o++,t.setXYZ(o,s.x,s.y,s.z),o++),h.copy(s)}}return a&&o>1&&!(t.getX(o-1)===t.getX(0)&&t.getY(o-1)===t.getY(0)&&t.getZ(o-1)===t.getZ(0))&&(t.setXYZ(o,t.getX(0),t.getY(0),t.getZ(0)),o++),l}function YQ(t,i=12,r=!1){let n=[];for(let a=0,s=t.length;a<s;a++){let o=t[a],l=0;if(r&&o.roundedCurveCorner!==void 0){let c=np(o.roundedCurveCorner,i)*.5;a>0&&(n[a-1]+=c),l+=c}o.curveAfter!==void 0&&(l+=np(o.curveAfter,i)),n.push(l)}return t.length>0&&r&&t[0].roundedCurveCorner!==void 0&&(n[t.length-1]+=np(t[0].roundedCurveCorner,i)*.5),n}function np(t,i=12){return t&&t instanceof cM?i*2:t&&(t instanceof dc||t instanceof H7)?1:t&&t instanceof uN?i*t.points.length:i}function OBe(t,i,r=12,n=!0){let a,s=0;for(let o=0;o<i.length;o++){let l=ZN(i[o]),c=np(l,r),h=Y0;for(let u=0;u<=c;u++)if(l instanceof nc||l instanceof DA||l instanceof dc){if(l.getPoint(u/c,h),a!==void 0&&TBe(a,h,Qv))continue;a===void 0&&(a=SM),a.copy(h),t.push(h.x,h.y),s++}}return w_(t[0],t[t.length-2],Qv)&&w_(t[1],t[t.length-1],Qv)&&(t.pop(),t.pop()),n&&s>1&&!(w_(t[s-1],t[1],Qv)&&w_(t[s-2],t[0],Qv))&&(t.push(t[0],t[1]),s++),t}var SI=new Me,NBe=new Me,UBe=new Me,FBe=new Me,kBe=new Me,HBe=new Me,on=class extends RC{constructor(t=100,i=100){super(),this.points=[],this.shapeHoles=[],this.plane=new eo(new O(0,0,-1)),this.subdivision=0,this.controlSnapDistance=4,this.pointIDs=0,this.isMesh2D=!1,this.isText=!1,this._roundness=0,this.isClosed=!1,this.useCubicForRoundedCorners=!0,this.uuid=Ct.generateUUID(),this.needsUpdate=!1,this.roundedCurves=[],this._width=t,this._height=i}static createFromState(t,i,r){let n=new on;return n.isClosed=t.isClosed,n.points=t.points.map(a=>Lg.create(a.id,a.data)),typeof t.roundness=="number"&&(n.roundness=t.roundness),n.shapeHoles=t.shapeHoles.map(a=>on.createFromState(a)),i!==void 0&&r!==void 0&&n.applySize(i,r),n.update(),n}get width(){return this._width}get height(){return this._height}get roundness(){return this._roundness}set roundness(t){if(this._roundness!==t){this._roundness=t;for(let i=0,r=this.points.length;i<r;i++)this.points[i].roundness=t;this.needsUpdate=!0}}getPointsIndexesByIds(t){return t.map(i=>this.getPointIndexById(i)).filter(i=>i>=0)}getPointIndexById(t){let i=this.points.length,r=this.points.findIndex(n=>n.uuid===t);if(r<0){let n=i;for(let a=0,s=this.shapeHoles.length;a<s;a++){let o=this.shapeHoles[a],l=o.points.length,c=o.getPointIndexById(t);if(c<0)n+=l;else return c+n}}return r}getLineIndexById(t){return this.getPointIndexById(t)}getBezierPoint(t){if(t<=this.points.length-1)return this.points[t];if(this.shapeHoles.length>0){let i=this.points.length;for(let r=0,n=this.shapeHoles.length;r<n;r++){let a=this.shapeHoles[r],s=t-i;if(s<=a.points.length-1)return a.points[s];i+=a.points.length}}throw new Error("This shape does not have a point for this index: "+t)}getBezierPointIndex(t){let i=this.points.indexOf(t);if(i>=0)return i;if(i=this.points.length,this.shapeHoles.length>0)for(let r=0,n=this.shapeHoles.length;r<n;r++){let a=this.shapeHoles[r],s=a.points.indexOf(t);if(s>=0)return i+s;i+=a.points.length}return-1}getAllPoints(){let t=[].concat(...this.shapeHoles.map(i=>i.points));return[...this.points,...t]}applySize(t,i){t===0&&(t=.001),i===0&&(i=.001),this._width=t,this._height=i}applyScale(t,i){let r=SI.set(t,i);for(let n=0,a=this.points.length;n<a;n++){let s=this.points[n];s.position.multiply(r),s.controls[0].position.multiply(r),s.controls[1].position.multiply(r)}for(let n=0,a=this.shapeHoles.length;n<a;n++)this.shapeHoles[n].applyScale(t,i);this._update()}createPoint(t,i=0,r=Ct.generateUUID()){let n;t instanceof Me?n=t:n=new Me(t,i);let a=new Lg(r,n);return a.roundness=this.roundness,a}addPoint(t){this.points.push(t),this.needsUpdate=!0}addPointAt(t,i){this.points.splice(i,0,t),this.needsUpdate=!0}getPointByUuid(t){for(let i=0,r=this.points.length;i<r;i++){let n=this.points[i];if(n.uuid===t)return n}for(let i=0,r=this.shapeHoles.length;i<r;i++){let n=this.shapeHoles[i].getPointByUuid(t);if(n)return n}}getFirstPoint(){return this.points[0]}getLastPoint(){return this.points[this.points.length-1]}removePoint(t){let i=this.points.indexOf(t);i>=0&&this.points.splice(i,1),this.needsUpdate=!0}removePointById(t){let i=this.points.find(r=>r.uuid===t);i&&this.removePoint(i)}update(){for(let t=0,i=this.shapeHoles.length;t<i;t++)this.shapeHoles[t].update();this._update()}extractShapePointsToBuffer(t,i=12,r=!1){this.subdivision=i,this.curveDivisions===void 0&&this.computeCurveDivisions(i);let n=r?this.roundedCurveDivisions:this.curveDivisions;return PBe(t,r?this.roundedCurves:this.curves,i,this.autoClose),n.reduce((a,s)=>a+s,0)+1}computeCurveDivisions(t=12){return this.curveDivisions=YQ(this.points,t,!1),this.roundedCurveDivisions=YQ(this.points,t,!0),this.curveDivisions}extractFilteredShapePointsToBuffer(t,i,r=12){return LBe(t,this.curves,i,r,this.autoClose).reduce((n,a)=>n+a,0)*2}extractShapePointsToFlatArray(t,i=12){return this.subdivision=i,this.curveDivisions===void 0&&this.computeCurveDivisions(i),OBe(t,this.roundedCurves,i,this.autoClose)}getCurveIndexFromVertexId(t,i=!1){let r=0;this.curveDivisions===void 0&&this.computeCurveDivisions(this.subdivision);let n=i?this.roundedCurveDivisions:this.curveDivisions,a=0;i&&this.points[0].roundedCurveCorner!==void 0&&(a=np(this.points[0].roundedCurveCorner,this.subdivision)*.5);let s=t-a;s<0&&(s+=n.reduce((o,l)=>o+l,0));for(let o=0,l=n.length;o<l;o++){let c=n[o];if(s<r+c)return[o,(s-r+1)/c];r+=c}return[0,1]}getCurveT(t,i,r){let n=this.points[t],a=this.points[t>=this.points.length-1?0:t+1],s=this.curveDivisions,o=s[t];if(WQ(n,a)){let c=n.position.distanceTo(a.position);return n.position.distanceTo(SI.set(r.x,r.y))/c}let l=0;for(let c=0;c<t;c++)l+=s[c];return(i-l)/o}dispose(){}_applyCurveForPoint(t,i){WQ(i,t)?this.lineTo(t.position.x,t.position.y):this.bezierCurveTo(i.controls[1].position.x,i.controls[1].position.y,t.controls[0].position.x,t.controls[0].position.y,t.position.x,t.position.y);let r=this.curves[this.curves.length-1];t.curveBefore=r,i.curveAfter=r;let n=r.clone();t.roundedCurveBefore=n,i.roundedCurveAfter=n,t.roundedCurveCorner=void 0,this.roundedCurves.push(n)}_update(){if(this.curves=[],this.roundedCurves=[],!this.points.length)return;for(let i=0,r=this.points.length;i<r;i++){let n=this.points[i];if(i===0)this.moveTo(n.position.x,n.position.y);else{let a=this.points[i-1];this._applyCurveForPoint(n,a)}}let t=this.getLastPoint();if(t!=null&&t.curveAfter&&(t.curveAfter=void 0),this.isClosed){let i=this.points[0],r=this.points[this.points.length-1];this._applyCurveForPoint(i,r)}if(this.points.length>2){let i=0;for(let r=0,n=this.points.length;r<n;r++){let a=this.points[r],s=this.points[r-1]??this.points[this.points.length-1],o=this.points[r+1]??this.points[0],l=a.roundness,c=s&&o&&xBe(s,a,o);if(!a.controlsMoved()&&l>0&&!c){let h=a.curveBefore,u=a.curveAfter;if(h===void 0||u===void 0)continue;let d=a.roundedCurveBefore,A=a.roundedCurveAfter,f=h.getLength(),m=u.getLength(),g=Math.min(l,f*.499),p=Math.min(l,m*.499),v=Math.min(g,p),_=1-v/f,y=v/m,w=h.getPointAt(_,SI),b=u.getPointAt(y,NBe);this._subSplitCurve(h,d,_,w,void 0),this._subSplitCurve(u,A,y,void 0,b);let E;if(this.useCubicForRoundedCorners){let M=HK(w,a.position,b)/2,S=Math.tan(M)*w.distanceTo(a.position),[T,C]=RBe(w,b,S,UBe,FBe),x=BBe(T,C,a.position),[R,L]=IBe(x,w,b,S,kBe,HBe);E=new nc(w.clone(),R.clone(),L.clone(),b.clone())}else E=new DA(w.clone(),a.position.clone(),b.clone());a.roundedCurveCorner=E,this.roundedCurves.splice(r+i,0,E),i++}}}}_subSplitCurve(t,i,r,n,a){if(t instanceof dc)n!==void 0&&i.v2.copy(n),a!==void 0&&i.v1.copy(a);else{let s=t,o=i,l=s.getUtoTmapping(r,0),c=DBe(s.v0,s.v1,s.v2,s.v3,l);return n!==void 0&&(o.v0.set(c[0],c[1]),o.v1.set(c[2],c[3]),o.v2.set(c[4],c[5]),o.v3.set(c[6],c[7])),a!==void 0&&(o.v0.set(c[6],c[7]),o.v1.set(c[8],c[9]),o.v2.set(c[10],c[11]),o.v3.set(c[12],c[13])),o}return i}clone(){let t=new on(this._width,this._height);return t.points=this.points.map(i=>i.clone()),t.isClosed=this.isClosed,t.roundness=this.roundness,t.isMesh2D=this.isMesh2D,t.shapeHoles=this.shapeHoles.map(i=>i.clone()),t}toJSON(){return{points:this.points.reduce((t,i)=>t.concat(i.toJSON()),[]),shapeHoles:this.shapeHoles.map(t=>t.toJSON()),isClosed:this.isClosed,roundness:this.roundness}}fromJSON(t){var r;this.points=[],this.pointIDs=0;let i=t.points.length/7;for(let n=0;n<i;n++){let a=n*7,s=t.points[a+0],o=t.points[a+1],l=t.points[a+2],c=t.points[a+3],h=t.points[a+4],u=t.points[a+5],d=t.points[a+6],A=new Lg(Ct.generateUUID(),new Me(s,o));A.controls[0].position.set(l,c),A.controls[1].position.set(h,u),A.roundness=d,this.points.push(A)}return this.shapeHoles=(r=t.shapeHoles)!=null&&r.length?t.shapeHoles.map(n=>{let a=new on;return a.fromJSON(n),a}):[],this.isClosed=t.isClosed,this._roundness=t.roundness,this._update(),this}fromShape(t,i=!1){this.isText=i;let r=(a,s)=>{s instanceof nc&&s.v3.equals(a.position)&&a.controls[0].position.copy(s.v2)},n=a=>{let s=[],o,l;for(o=0,l=a.length;o<l;o++)a[o]instanceof DA&&(a[o]=CBe(a[o]));for(o=0,l=a.length;o<l;o++){let u=a[o],d=o>0?a[o-1]:null,A;u instanceof nc?(A=this.createPoint(u.v0),A.controls[1].position.copy(u.v1)):u instanceof dc&&(A=this.createPoint(u.v1)),A!==void 0&&(d!==null&&r(A,d),s.push(A))}let c=a[a.length-1],h=!1;return c instanceof nc?c.v3.equals(s[0].position)&&(s[0].controls[0].position.copy(c.v2),h=!0):c instanceof dc&&c.v2.equals(s[0].position)&&(h=!0),this.isClosed=h,s};return this.points=n(t.curves),t instanceof RC&&(this.shapeHoles=t.holes.map(a=>{let s=new on;return s.fromShape(a),s})),this.update(),this}updatePoint(t,i){let r=this.getPointByUuid(t);r&&(i.position!==void 0&&r.position.fromArray(i.position),i.roundness!==void 0&&(r.roundness=i.roundness),i.areControlsDirectionsMirrored!==void 0&&(r.areControlsDirectionsMirrored=i.areControlsDirectionsMirrored),this.needsUpdate=!0)}updatePreviousControl(t,i){var n;let r=(n=this.getPointByUuid(t))==null?void 0:n.controls[0];r&&(i.position&&r.position.fromArray(i.position),this.needsUpdate=!0)}updateNextControl(t,i){var n;let r=(n=this.getPointByUuid(t))==null?void 0:n.controls[1];r&&(i.position&&r.position.fromArray(i.position),this.needsUpdate=!0)}},vL=Math.PI*2;function CI({x:t,y:i},r,n,a,s){return{x:t*r+a,y:i*n+s}}function GBe(t,i){let r=i===1.5707963267948966?.551915024494:i===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(i/4),n=Math.cos(t),a=Math.sin(t),s=Math.cos(t+i),o=Math.sin(t+i);return[{x:n-a*r,y:a+n*r},{x:s+o*r,y:o-s*r},{x:s,y:o}]}function KQ(t,i,r,n){let a=t*n-i*r<0?-1:1,s=Math.min(1,Math.max(-1,t*r+i*n));return a*Math.acos(s)}function zBe(t,i,r,n,a,s,o,l,c,h){let u=Math.pow(a,2),d=Math.pow(s,2),A=Math.pow(o,2),f=Math.pow(l,2),m=u*d-u*f-d*A;m<0&&(m=0),m/=u*f+d*A,m=Math.sqrt(m)*(c===h?-1:1);let g=m*a/s*l,p=m*-s/a*o,v=g+(t+r)/2,_=p+(i+n)/2,y=(o-g)/a,w=(l-p)/s,b=(-o-g)/a,E=(-l-p)/s,M=KQ(1,0,y,w),S=KQ(y,w,b,E);return!h&&S>0&&(S-=vL),h&&S<0&&(S+=vL),{centerx:v,centery:_,ang1:M,ang2:S}}function QBe({px:t,py:i,cx:r,cy:n,rx:a,ry:s,largeArcFlag:o,sweepFlag:l}){let c=[];if(a===0||s===0)return[];let h=(t-r)/2,u=(i-n)/2;if(h===0&&u===0)return[];a=Math.abs(a),s=Math.abs(s);let d=Math.pow(h,2)/Math.pow(a,2)+Math.pow(u,2)/Math.pow(s,2);d>1&&(a*=Math.sqrt(d),s*=Math.sqrt(d));let A=zBe(t,i,r,n,a,s,h,u,o,l),{ang1:f,ang2:m}=A,{centerx:g,centery:p}=A,v=Math.abs(m)/(vL/4);Math.abs(1-v)<1e-7&&(v=1);let _=Math.max(Math.ceil(v),1);m/=_;for(let y=0;y<_;y++)c.push(GBe(f,m)),f+=m;return c.map(y=>{let{x:w,y:b}=CI(y[0],a,s,g,p),{x:E,y:M}=CI(y[1],a,s,g,p),{x:S,y:T}=CI(y[2],a,s,g,p);return{x1:w,y1:b,x2:E,y2:M,x:S,y:T}})}var dr;(function(t){t[t.ODD=0]="ODD",t[t.NONZERO=1]="NONZERO",t[t.POSITIVE=2]="POSITIVE",t[t.NEGATIVE=3]="NEGATIVE",t[t.ABS_GEQ_TWO=4]="ABS_GEQ_TWO"})(dr||(dr={}));var Ln;(function(t){t[t.POLYGONS=0]="POLYGONS",t[t.CONNECTED_POLYGONS=1]="CONNECTED_POLYGONS",t[t.BOUNDARY_CONTOURS=2]="BOUNDARY_CONTOURS"})(Ln||(Ln={}));function Zt(t,i){if(!t)throw i||"Assertion Failed!"}var Ft=function(){function t(){}return t.vertEq=function(i,r){return i.s===r.s&&i.t===r.t},t.vertLeq=function(i,r){return i.s<r.s||i.s===r.s&&i.t<=r.t},t.transLeq=function(i,r){return i.t<r.t||i.t===r.t&&i.s<=r.s},t.edgeGoesLeft=function(i){return t.vertLeq(i.Dst,i.Org)},t.edgeGoesRight=function(i){return t.vertLeq(i.Org,i.Dst)},t.vertL1dist=function(i,r){return Math.abs(i.s-r.s)+Math.abs(i.t-r.t)},t.edgeEval=function(i,r,n){Zt(t.vertLeq(i,r)&&t.vertLeq(r,n));var a=r.s-i.s,s=n.s-r.s;return a+s>0?a<s?r.t-i.t+(i.t-n.t)*(a/(a+s)):r.t-n.t+(n.t-i.t)*(s/(a+s)):0},t.edgeSign=function(i,r,n){Zt(t.vertLeq(i,r)&&t.vertLeq(r,n));var a=r.s-i.s,s=n.s-r.s;return a+s>0?(r.t-n.t)*a+(r.t-i.t)*s:0},t.transEval=function(i,r,n){Zt(t.transLeq(i,r)&&t.transLeq(r,n));var a=r.t-i.t,s=n.t-r.t;return a+s>0?a<s?r.s-i.s+(i.s-n.s)*(a/(a+s)):r.s-n.s+(n.s-i.s)*(s/(a+s)):0},t.transSign=function(i,r,n){Zt(t.transLeq(i,r)&&t.transLeq(r,n));var a=r.t-i.t,s=n.t-r.t;return a+s>0?(r.s-n.s)*a+(r.s-i.s)*s:0},t.vertCCW=function(i,r,n){return i.s*(r.t-n.t)+r.s*(n.t-i.t)+n.s*(i.t-r.t)>=0},t.interpolate=function(i,r,n,a){return i=i<0?0:i,n=n<0?0:n,i<=n?n===0?(r+a)/2:r+(a-r)*(i/(i+n)):a+(r-a)*(n/(i+n))},t.intersect=function(i,r,n,a,s){var o,l,c;t.vertLeq(i,r)||(c=i,i=r,r=c),t.vertLeq(n,a)||(c=n,n=a,a=c),t.vertLeq(i,n)||(c=i,i=n,n=c,c=r,r=a,a=c),t.vertLeq(n,r)?t.vertLeq(r,a)?(o=t.edgeEval(i,n,r),l=t.edgeEval(n,r,a),o+l<0&&(o=-o,l=-l),s.s=t.interpolate(o,n.s,l,r.s)):(o=t.edgeSign(i,n,r),l=-t.edgeSign(i,a,r),o+l<0&&(o=-o,l=-l),s.s=t.interpolate(o,n.s,l,a.s)):s.s=(n.s+r.s)/2,t.transLeq(i,r)||(c=i,i=r,r=c),t.transLeq(n,a)||(c=n,n=a,a=c),t.transLeq(i,n)||(c=i,i=n,n=c,c=r,r=a,a=c),t.transLeq(n,r)?t.transLeq(r,a)?(o=t.transEval(i,n,r),l=t.transEval(n,r,a),o+l<0&&(o=-o,l=-l),s.t=t.interpolate(o,n.t,l,r.t)):(o=t.transSign(i,n,r),l=-t.transSign(i,a,r),o+l<0&&(o=-o,l=-l),s.t=t.interpolate(o,n.t,l,a.t)):s.t=(n.t+r.t)/2},t}(),Vv=function(){function t(){this.next=null,this.prev=null,this.anEdge=null,this.trail=null,this.n=0,this.marked=!1,this.inside=!1}return t}(),Sb=function(){function t(i){this.side=i,this.next=null,this.Org=null,this.Sym=null,this.Onext=null,this.Lnext=null,this.Lface=null,this.activeRegion=null,this.winding=0}return Object.defineProperty(t.prototype,"Rface",{get:function(){return this.Sym.Lface},set:function(i){this.Sym.Lface=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dst",{get:function(){return this.Sym.Org},set:function(i){this.Sym.Org=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Oprev",{get:function(){return this.Sym.Lnext},set:function(i){this.Sym.Lnext=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Lprev",{get:function(){return this.Onext.Sym},set:function(i){this.Onext.Sym=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dprev",{get:function(){return this.Lnext.Sym},set:function(i){this.Lnext.Sym=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Rprev",{get:function(){return this.Sym.Onext},set:function(i){this.Sym.Onext=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Dnext",{get:function(){return this.Sym.Onext.Sym},set:function(i){this.Sym.Onext.Sym=i},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"Rnext",{get:function(){return this.Sym.Lnext.Sym},set:function(i){this.Sym.Lnext.Sym=i},enumerable:!0,configurable:!0}),t}(),ig=function(){function t(){this.next=null,this.prev=null,this.anEdge=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0,this.n=0,this.idx=0}return t}(),XQ=function(){function t(){var i=new ig,r=new Vv,n=new Sb(0),a=new Sb(1);i.next=i.prev=i,i.anEdge=null,r.next=r.prev=r,n.next=n,n.Sym=a,a.next=a,a.Sym=n,this.vHead=i,this.fHead=r,this.eHead=n,this.eHeadSym=a}return t.prototype.makeEdge_=function(i){var r=new Sb(0),n=new Sb(1);i.Sym.side<i.side&&(i=i.Sym);var a=i.Sym.next;return n.next=a,a.Sym.next=r,r.next=i,i.Sym.next=n,r.Sym=n,r.Onext=r,r.Lnext=n,r.Org=null,r.Lface=null,r.winding=0,r.activeRegion=null,n.Sym=r,n.Onext=n,n.Lnext=r,n.Org=null,n.Lface=null,n.winding=0,n.activeRegion=null,r},t.prototype.splice_=function(i,r){var n=i.Onext,a=r.Onext;n.Sym.Lnext=r,a.Sym.Lnext=i,i.Onext=a,r.Onext=n},t.prototype.makeVertex_=function(i,r,n){var a=i;Zt(a,"Vertex can't be null!");var s=n.prev;a.prev=s,s.next=a,a.next=n,n.prev=a,a.anEdge=r;var o=r;do o.Org=a,o=o.Onext;while(o!==r)},t.prototype.makeFace_=function(i,r,n){var a=i;Zt(a,"Face can't be null");var s=n.prev;a.prev=s,s.next=a,a.next=n,n.prev=a,a.anEdge=r,a.trail=null,a.marked=!1,a.inside=n.inside;var o=r;do o.Lface=a,o=o.Lnext;while(o!==r)},t.prototype.killEdge_=function(i){i.Sym.side<i.side&&(i=i.Sym);var r=i.next,n=i.Sym.next;r.Sym.next=n,n.Sym.next=r},t.prototype.killVertex_=function(i,r){var n=i.anEdge,a=n;do a.Org=r,a=a.Onext;while(a!==n);var s=i.prev,o=i.next;o.prev=s,s.next=o},t.prototype.killFace_=function(i,r){var n=i.anEdge,a=n;do a.Lface=r,a=a.Lnext;while(a!==n);var s=i.prev,o=i.next;o.prev=s,s.next=o},t.prototype.makeEdge=function(){var i=new ig,r=new ig,n=new Vv,a=this.makeEdge_(this.eHead);return this.makeVertex_(i,a,this.vHead),this.makeVertex_(r,a.Sym,this.vHead),this.makeFace_(n,a,this.fHead),a},t.prototype.splice=function(i,r){var n=!1,a=!1;if(i!==r){if(r.Org!==i.Org&&(a=!0,this.killVertex_(r.Org,i.Org)),r.Lface!==i.Lface&&(n=!0,this.killFace_(r.Lface,i.Lface)),this.splice_(r,i),!a){var s=new ig;this.makeVertex_(s,r,i.Org),i.Org.anEdge=i}if(!n){var o=new Vv;this.makeFace_(o,r,i.Lface),i.Lface.anEdge=i}}},t.prototype.delete=function(i){var r=i.Sym,n=!1;if(i.Lface!==i.Rface&&(n=!0,this.killFace_(i.Lface,i.Rface)),i.Onext===i)this.killVertex_(i.Org,null);else if(i.Rface.anEdge=i.Oprev,i.Org.anEdge=i.Onext,this.splice_(i,i.Oprev),!n){var a=new Vv;this.makeFace_(a,i,i.Lface)}r.Onext===r?(this.killVertex_(r.Org,null),this.killFace_(r.Lface,null)):(i.Lface.anEdge=r.Oprev,r.Org.anEdge=r.Onext,this.splice_(r,r.Oprev)),this.killEdge_(i)},t.prototype.addEdgeVertex=function(i){var r=this.makeEdge_(i),n=r.Sym;this.splice_(r,i.Lnext),r.Org=i.Dst;var a=new ig;return this.makeVertex_(a,n,r.Org),r.Lface=n.Lface=i.Lface,r},t.prototype.splitEdge=function(i){var r=this.addEdgeVertex(i),n=r.Sym;return this.splice_(i.Sym,i.Sym.Oprev),this.splice_(i.Sym,n),i.Dst=n.Org,n.Dst.anEdge=n.Sym,n.Rface=i.Rface,n.winding=i.winding,n.Sym.winding=i.Sym.winding,n.idx=i.idx,n.Sym.idx=i.Sym.idx,n},t.prototype.connect=function(i,r){var n=!1,a=this.makeEdge_(i),s=a.Sym;if(r.Lface!==i.Lface&&(n=!0,this.killFace_(r.Lface,i.Lface)),this.splice_(a,i.Lnext),this.splice_(s,r),a.Org=i.Dst,s.Org=r.Org,a.Lface=s.Lface=i.Lface,i.Lface.anEdge=s,!n){var o=new Vv;this.makeFace_(o,a,i.Lface)}return a},t.prototype.zapFace=function(i){var r=i.anEdge,n,a,s,o,l;a=r.Lnext;do n=a,a=n.Lnext,n.Lface=null,n.Rface===null&&(n.Onext===n?this.killVertex_(n.Org,null):(n.Org.anEdge=n.Onext,this.splice_(n,n.Oprev)),s=n.Sym,s.Onext===s?this.killVertex_(s.Org,null):(s.Org.anEdge=s.Onext,this.splice_(s,s.Oprev)),this.killEdge_(n));while(n!=r);o=i.prev,l=i.next,l.prev=o,o.next=l},t.prototype.countFaceVerts_=function(i){var r=i.anEdge,n=0;do n++,r=r.Lnext;while(r!==i.anEdge);return n},t.prototype.mergeConvexFaces=function(i){var r,n,a,s,o,l,c;for(r=this.fHead.next;r!==this.fHead;r=r.next)if(r.inside)for(n=r.anEdge,o=n.Org;a=n.Lnext,s=n.Sym,s&&s.Lface&&s.Lface.inside&&(l=this.countFaceVerts_(r),c=this.countFaceVerts_(s.Lface),l+c-2<=i&&Ft.vertCCW(n.Lprev.Org,n.Org,s.Lnext.Lnext.Org)&&Ft.vertCCW(s.Lprev.Org,s.Org,n.Lnext.Lnext.Org)&&(a=s.Lnext,this.delete(s),n=null,s=null)),!(n&&n.Lnext.Org===o);)n=a;return!0},t.prototype.check=function(){var i=this.fHead,r=this.vHead,n=this.eHead,a,s,o,l,c,h;for(s=i,s=i;(a=s.next)!==i;s=a){Zt(a.prev===s),c=a.anEdge;do Zt(c.Sym!==c),Zt(c.Sym.Sym===c),Zt(c.Lnext.Onext.Sym===c),Zt(c.Onext.Sym.Lnext===c),Zt(c.Lface===a),c=c.Lnext;while(c!==a.anEdge)}for(Zt(a.prev===s&&a.anEdge===null),l=r,l=r;(o=l.next)!==r;l=o){Zt(o.prev===l),c=o.anEdge;do Zt(c.Sym!==c),Zt(c.Sym.Sym===c),Zt(c.Lnext.Onext.Sym===c),Zt(c.Onext.Sym.Lnext===c),Zt(c.Org===o),c=c.Onext;while(c!==o.anEdge)}for(Zt(o.prev===l&&o.anEdge===null),h=n,h=n;(c=h.next)!==n;h=c)Zt(c.Sym.next===h.Sym),Zt(c.Sym!==c),Zt(c.Sym.Sym===c),Zt(c.Org!==null),Zt(c.Dst!==null),Zt(c.Lnext.Onext.Sym===c),Zt(c.Onext.Sym.Lnext===c);Zt(c.Sym.next===h.Sym&&c.Sym===this.eHeadSym&&c.Sym.Sym===c&&c.Org===null&&c.Dst===null&&c.Lface===null&&c.Rface===null)},t}(),qQ=function(){function t(){this.handle=null}return t}(),ZQ=function(){function t(){this.key=null,this.node=0}return t}(),VBe=function(){function t(i,r){this.leq=r,this.max=0,this.nodes=[],this.handles=[],this.initialized=!1,this.freeList=0,this.size=0,this.max=i,this.nodes=[],this.handles=[];for(var n=0;n<i+1;n++)this.nodes[n]=new qQ,this.handles[n]=new ZQ;this.initialized=!1,this.nodes[1].handle=1,this.handles[1].key=null}return t.prototype.floatDown_=function(i){var r=this.nodes,n=this.handles,a,s,o;for(a=r[i].handle;;){if(o=i<<1,o<this.size&&this.leq(n[r[o+1].handle].key,n[r[o].handle].key)&&++o,Zt(o<=this.max),s=r[o].handle,o>this.size||this.leq(n[a].key,n[s].key)){r[i].handle=a,n[a].node=i;break}r[i].handle=s,n[s].node=i,i=o}},t.prototype.floatUp_=function(i){var r=this.nodes,n=this.handles,a,s,o;for(a=r[i].handle;;){if(o=i>>1,s=r[o].handle,o===0||this.leq(n[s].key,n[a].key)){r[i].handle=a,n[a].node=i;break}r[i].handle=s,n[s].node=i,i=o}},t.prototype.init=function(){for(var i=this.size;i>=1;--i)this.floatDown_(i);this.initialized=!0},t.prototype.min=function(){return this.handles[this.nodes[1].handle].key},t.prototype.insert=function(i){var r,n;if(r=++this.size,r*2>this.max){this.max*=2;var a,s;for(s=this.nodes.length,this.nodes.length=this.max+1,a=s;a<this.nodes.length;a++)this.nodes[a]=new qQ;for(s=this.handles.length,this.handles.length=this.max+1,a=s;a<this.handles.length;a++)this.handles[a]=new ZQ}return this.freeList===0?n=r:(n=this.freeList,this.freeList=this.handles[n].node),this.nodes[r].handle=n,this.handles[n].node=r,this.handles[n].key=i,this.initialized&&this.floatUp_(r),n},t.prototype.extractMin=function(){var i=this.nodes,r=this.handles,n=i[1].handle,a=r[n].key;return this.size>0&&(i[1].handle=i[this.size].handle,r[i[1].handle].node=1,r[n].key=null,r[n].node=this.freeList,this.freeList=n,--this.size,this.size>0&&this.floatDown_(1)),a},t.prototype.delete=function(i){var r=this.nodes,n=this.handles,a;Zt(i>=1&&i<=this.max&&n[i].key!==null),a=n[i].node,r[a].handle=r[this.size].handle,n[r[a].handle].node=a,--this.size,a<=this.size&&(a<=1||this.leq(n[r[a>>1].handle].key,n[r[a].handle].key)?this.floatDown_(a):this.floatUp_(a)),n[i].key=null,n[i].node=this.freeList,this.freeList=i},t}(),TI=function(){function t(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1}return t}(),JQ=function(){function t(){this.key=null,this.next=null,this.prev=null}return t}(),WBe=function(){function t(i,r){this.frame=i,this.leq=r,this.head=new JQ,this.head.next=this.head,this.head.prev=this.head}return t.prototype.min=function(){return this.head.next},t.prototype.max=function(){return this.head.prev},t.prototype.insert=function(i){return this.insertBefore(this.head,i)},t.prototype.search=function(i){var r=this.head;do r=r.next;while(r.key!==null&&!this.leq(this.frame,i,r.key));return r},t.prototype.insertBefore=function(i,r){do i=i.prev;while(i.key!==null&&!this.leq(this.frame,i.key,r));var n=new JQ;return n.key=r,n.next=i.next,i.next.prev=n,n.prev=i,i.next=n,n},t.prototype.delete=function(i){i.next.prev=i.prev,i.prev.next=i.next},t}(),jBe=function(){function t(){}return t.regionBelow=function(i){return i.nodeUp.prev.key},t.regionAbove=function(i){return i.nodeUp.next.key},t.debugEvent=function(i){},t.addWinding=function(i,r){i.winding+=r.winding,i.Sym.winding+=r.Sym.winding},t.edgeLeq=function(i,r,n){var a=i.event,s=r.eUp,o=n.eUp;if(s.Dst===a)return o.Dst===a?Ft.vertLeq(s.Org,o.Org)?Ft.edgeSign(o.Dst,s.Org,o.Org)<=0:Ft.edgeSign(s.Dst,o.Org,s.Org)>=0:Ft.edgeSign(o.Dst,a,o.Org)<=0;if(o.Dst===a)return Ft.edgeSign(s.Dst,a,s.Org)>=0;var l=Ft.edgeEval(s.Dst,a,s.Org),c=Ft.edgeEval(o.Dst,a,o.Org);return l>=c},t.deleteRegion=function(i,r){r.fixUpperEdge&&Zt(r.eUp.winding===0),r.eUp.activeRegion=null,i.dict.delete(r.nodeUp)},t.fixUpperEdge=function(i,r,n){Zt(r.fixUpperEdge),i.mesh.delete(r.eUp),r.fixUpperEdge=!1,r.eUp=n,n.activeRegion=r},t.topLeftRegion=function(i,r){var n=r.eUp.Org,a;do r=t.regionAbove(r);while(r.eUp.Org===n);if(r.fixUpperEdge){if(a=i.mesh.connect(t.regionBelow(r).eUp.Sym,r.eUp.Lnext),a===null)return null;t.fixUpperEdge(i,r,a),r=t.regionAbove(r)}return r},t.topRightRegion=function(i){var r=i.eUp.Dst;do i=t.regionAbove(i);while(i.eUp.Dst===r);return i},t.addRegionBelow=function(i,r,n){var a=new TI;return a.eUp=n,a.nodeUp=i.dict.insertBefore(r.nodeUp,a),a.fixUpperEdge=!1,a.sentinel=!1,a.dirty=!1,n.activeRegion=a,a},t.isWindingInside=function(i,r){switch(i.windingRule){case dr.ODD:return(r&1)!==0;case dr.NONZERO:return r!==0;case dr.POSITIVE:return r>0;case dr.NEGATIVE:return r<0;case dr.ABS_GEQ_TWO:return r>=2||r<=-2}throw new Error("Invalid winding rulle")},t.computeWinding=function(i,r){r.windingNumber=t.regionAbove(r).windingNumber+r.eUp.winding,r.inside=t.isWindingInside(i,r.windingNumber)},t.finishRegion=function(i,r){var n=r.eUp,a=n.Lface;a.inside=r.inside,a.anEdge=n,t.deleteRegion(i,r)},t.finishLeftRegions=function(i,r,n){for(var a,s=null,o=r,l=r.eUp;o!==n;){if(o.fixUpperEdge=!1,s=t.regionBelow(o),a=s.eUp,a.Org!=l.Org){if(!s.fixUpperEdge){t.finishRegion(i,o);break}a=i.mesh.connect(l.Lprev,a.Sym),t.fixUpperEdge(i,s,a)}l.Onext!==a&&(i.mesh.splice(a.Oprev,a),i.mesh.splice(l,a)),t.finishRegion(i,o),l=s.eUp,o=s}return l},t.addRightEdges=function(i,r,n,a,s,o){var l,c,h,u,d=!0;h=n;do Zt(Ft.vertLeq(h.Org,h.Dst)),t.addRegionBelow(i,r,h.Sym),h=h.Onext;while(h!==a);for(s===null&&(s=t.regionBelow(r).eUp.Rprev),c=r,u=s;l=t.regionBelow(c),h=l.eUp.Sym,h.Org===u.Org;)h.Onext!==u&&(i.mesh.splice(h.Oprev,h),i.mesh.splice(u.Oprev,h)),l.windingNumber=c.windingNumber-h.winding,l.inside=t.isWindingInside(i,l.windingNumber),c.dirty=!0,!d&&t.checkForRightSplice(i,c)&&(t.addWinding(h,u),t.deleteRegion(i,c),i.mesh.delete(u)),d=!1,c=l,u=h;c.dirty=!0,Zt(c.windingNumber-h.winding===l.windingNumber),o&&t.walkDirtyRegions(i,c)},t.spliceMergeVertices=function(i,r,n){i.mesh.splice(r,n)},t.vertexWeights=function(i,r,n){var a=Ft.vertL1dist(r,i),s=Ft.vertL1dist(n,i),o=.5*s/(a+s),l=.5*a/(a+s);i.coords[0]+=o*r.coords[0]+l*n.coords[0],i.coords[1]+=o*r.coords[1]+l*n.coords[1],i.coords[2]+=o*r.coords[2]+l*n.coords[2]},t.getIntersectData=function(i,r,n,a,s,o){r.coords[0]=r.coords[1]=r.coords[2]=0,r.idx=-1,t.vertexWeights(r,n,a),t.vertexWeights(r,s,o)},t.checkForRightSplice=function(i,r){var n=t.regionBelow(r),a=r.eUp,s=n.eUp;if(Ft.vertLeq(a.Org,s.Org)){if(Ft.edgeSign(s.Dst,a.Org,s.Org)>0)return!1;Ft.vertEq(a.Org,s.Org)?a.Org!==s.Org&&(i.pq.delete(a.Org.pqHandle),t.spliceMergeVertices(i,s.Oprev,a)):(i.mesh.splitEdge(s.Sym),i.mesh.splice(a,s.Oprev),r.dirty=n.dirty=!0)}else{if(Ft.edgeSign(a.Dst,s.Org,a.Org)<0)return!1;t.regionAbove(r).dirty=r.dirty=!0,i.mesh.splitEdge(a.Sym),i.mesh.splice(s.Oprev,a)}return!0},t.checkForLeftSplice=function(i,r){var n=t.regionBelow(r),a=r.eUp,s=n.eUp,o;if(Zt(!Ft.vertEq(a.Dst,s.Dst)),Ft.vertLeq(a.Dst,s.Dst)){if(Ft.edgeSign(a.Dst,s.Dst,a.Org)<0)return!1;t.regionAbove(r).dirty=r.dirty=!0,o=i.mesh.splitEdge(a),i.mesh.splice(s.Sym,o),o.Lface.inside=r.inside}else{if(Ft.edgeSign(s.Dst,a.Dst,s.Org)>0)return!1;r.dirty=n.dirty=!0,o=i.mesh.splitEdge(s),i.mesh.splice(a.Lnext,s.Sym),o.Rface.inside=r.inside}return!0},t.checkForIntersect=function(i,r){var n=t.regionBelow(r),a=r.eUp,s=n.eUp,o=a.Org,l=s.Org,c=a.Dst,h=s.Dst,u,d,A=new ig,f,m;if(Zt(!Ft.vertEq(h,c)),Zt(Ft.edgeSign(c,i.event,o)<=0),Zt(Ft.edgeSign(h,i.event,l)>=0),Zt(o!==i.event&&l!==i.event),Zt(!r.fixUpperEdge&&!n.fixUpperEdge),o===l||(u=Math.min(o.t,c.t),d=Math.max(l.t,h.t),u>d))return!1;if(Ft.vertLeq(o,l)){if(Ft.edgeSign(h,o,l)>0)return!1}else if(Ft.edgeSign(c,l,o)<0)return!1;return t.debugEvent(i),Ft.intersect(c,o,h,l,A),Zt(Math.min(o.t,c.t)<=A.t),Zt(A.t<=Math.max(l.t,h.t)),Zt(Math.min(h.s,c.s)<=A.s),Zt(A.s<=Math.max(l.s,o.s)),Ft.vertLeq(A,i.event)&&(A.s=i.event.s,A.t=i.event.t),f=Ft.vertLeq(o,l)?o:l,Ft.vertLeq(f,A)&&(A.s=f.s,A.t=f.t),Ft.vertEq(A,o)||Ft.vertEq(A,l)?(t.checkForRightSplice(i,r),!1):!Ft.vertEq(c,i.event)&&Ft.edgeSign(c,i.event,A)>=0||!Ft.vertEq(h,i.event)&&Ft.edgeSign(h,i.event,A)<=0?h===i.event?(i.mesh.splitEdge(a.Sym),i.mesh.splice(s.Sym,a),r=t.topLeftRegion(i,r),a=t.regionBelow(r).eUp,t.finishLeftRegions(i,t.regionBelow(r),n),t.addRightEdges(i,r,a.Oprev,a,a,!0),!0):c===i.event?(i.mesh.splitEdge(s.Sym),i.mesh.splice(a.Lnext,s.Oprev),n=r,r=t.topRightRegion(r),m=t.regionBelow(r).eUp.Rprev,n.eUp=s.Oprev,s=t.finishLeftRegions(i,n,null),t.addRightEdges(i,r,s.Onext,a.Rprev,m,!0),!0):(Ft.edgeSign(c,i.event,A)>=0&&(t.regionAbove(r).dirty=r.dirty=!0,i.mesh.splitEdge(a.Sym),a.Org.s=i.event.s,a.Org.t=i.event.t),Ft.edgeSign(h,i.event,A)<=0&&(r.dirty=n.dirty=!0,i.mesh.splitEdge(s.Sym),s.Org.s=i.event.s,s.Org.t=i.event.t),!1):(i.mesh.splitEdge(a.Sym),i.mesh.splitEdge(s.Sym),i.mesh.splice(s.Oprev,a),a.Org.s=A.s,a.Org.t=A.t,a.Org.pqHandle=i.pq.insert(a.Org),t.getIntersectData(i,a.Org,o,c,l,h),t.regionAbove(r).dirty=r.dirty=n.dirty=!0,!1)},t.walkDirtyRegions=function(i,r){for(var n=t.regionBelow(r),a,s;;){for(;n.dirty;)r=n,n=t.regionBelow(n);if(!r.dirty&&(n=r,r=t.regionAbove(r),r===null||!r.dirty))return;if(r.dirty=!1,a=r.eUp,s=n.eUp,a.Dst!==s.Dst&&t.checkForLeftSplice(i,r)&&(n.fixUpperEdge?(t.deleteRegion(i,n),i.mesh.delete(s),n=t.regionBelow(r),s=n.eUp):r.fixUpperEdge&&(t.deleteRegion(i,r),i.mesh.delete(a),r=t.regionAbove(n),a=r.eUp)),a.Org!==s.Org)if(a.Dst!==s.Dst&&!r.fixUpperEdge&&!n.fixUpperEdge&&(a.Dst===i.event||s.Dst===i.event)){if(t.checkForIntersect(i,r))return}else t.checkForRightSplice(i,r);a.Org===s.Org&&a.Dst===s.Dst&&(t.addWinding(s,a),t.deleteRegion(i,r),i.mesh.delete(a),r=t.regionAbove(n))}},t.connectRightVertex=function(i,r,n){var a,s=n.Onext,o=t.regionBelow(r),l=r.eUp,c=o.eUp,h=!1;if(l.Dst!==c.Dst&&t.checkForIntersect(i,r),Ft.vertEq(l.Org,i.event)&&(i.mesh.splice(s.Oprev,l),r=t.topLeftRegion(i,r),s=t.regionBelow(r).eUp,t.finishLeftRegions(i,t.regionBelow(r),o),h=!0),Ft.vertEq(c.Org,i.event)&&(i.mesh.splice(n,c.Oprev),n=t.finishLeftRegions(i,o,null),h=!0),h){t.addRightEdges(i,r,n.Onext,s,s,!0);return}Ft.vertLeq(c.Org,l.Org)?a=c.Oprev:a=l,a=i.mesh.connect(n.Lprev,a),t.addRightEdges(i,r,a,a.Onext,a.Onext,!1),a.Sym.activeRegion.fixUpperEdge=!0,t.walkDirtyRegions(i,r)},t.connectLeftDegenerate=function(i,r,n){var a,s,o,l,c;if(a=r.eUp,Ft.vertEq(a.Org,n)){Zt(!1),t.spliceMergeVertices(i,a,n.anEdge);return}if(!Ft.vertEq(a.Dst,n)){i.mesh.splitEdge(a.Sym),r.fixUpperEdge&&(i.mesh.delete(a.Onext),r.fixUpperEdge=!1),i.mesh.splice(n.anEdge,a),t.sweepEvent(i,n);return}Zt(!1),r=t.topRightRegion(r),c=t.regionBelow(r),o=c.eUp.Sym,s=l=o.Onext,c.fixUpperEdge&&(Zt(s!==o),t.deleteRegion(i,c),i.mesh.delete(o),o=s.Oprev),i.mesh.splice(n.anEdge,o),Ft.edgeGoesLeft(s)||(s=null),t.addRightEdges(i,r,o.Onext,l,s,!0)},t.connectLeftVertex=function(i,r){var n,a,s,o,l,c,h=new TI;if(h.eUp=r.anEdge.Sym,n=i.dict.search(h).key,a=t.regionBelow(n),!!a){if(o=n.eUp,l=a.eUp,Ft.edgeSign(o.Dst,r,o.Org)===0){t.connectLeftDegenerate(i,n,r);return}if(s=Ft.vertLeq(l.Dst,o.Dst)?n:a,n.inside||s.fixUpperEdge){if(s===n)c=i.mesh.connect(r.anEdge.Sym,o.Lnext);else{var u=i.mesh.connect(l.Dnext,r.anEdge);c=u.Sym}s.fixUpperEdge?t.fixUpperEdge(i,s,c):t.computeWinding(i,t.addRegionBelow(i,n,c)),t.sweepEvent(i,r)}else t.addRightEdges(i,n,r.anEdge,r.anEdge,null,!0)}},t.sweepEvent=function(i,r){i.event=r,t.debugEvent(i);for(var n=r.anEdge;n.activeRegion===null;)if(n=n.Onext,n===r.anEdge){t.connectLeftVertex(i,r);return}var a=t.topLeftRegion(i,n.activeRegion);Zt(a!==null);var s=t.regionBelow(a),o=s.eUp,l=t.finishLeftRegions(i,s,null);l.Onext===o?t.connectRightVertex(i,a,l):t.addRightEdges(i,a,l.Onext,o,o,!0)},t.addSentinel=function(i,r,n,a){var s=new TI,o=i.mesh.makeEdge();o.Org.s=n,o.Org.t=a,o.Dst.s=r,o.Dst.t=a,i.event=o.Dst,s.eUp=o,s.windingNumber=0,s.inside=!1,s.fixUpperEdge=!1,s.sentinel=!0,s.dirty=!1,s.nodeUp=i.dict.insert(s)},t.initEdgeDict=function(i){i.dict=new WBe(i,t.edgeLeq);var r=i.bmax[0]-i.bmin[0],n=i.bmax[1]-i.bmin[1],a=i.bmin[0]-r,s=i.bmax[0]+r,o=i.bmin[1]-n,l=i.bmax[1]+n;t.addSentinel(i,a,s,o),t.addSentinel(i,a,s,l)},t.doneEdgeDict=function(i){for(var r,n=0;(r=i.dict.min().key)!==null;)r.sentinel||(Zt(r.fixUpperEdge),Zt(++n===1)),Zt(r.windingNumber===0),t.deleteRegion(i,r)},t.removeDegenerateEdges=function(i){var r,n,a,s=i.mesh.eHead;for(r=s.next;r!==s;r=n)n=r.next,a=r.Lnext,Ft.vertEq(r.Org,r.Dst)&&r.Lnext.Lnext!==r&&(t.spliceMergeVertices(i,a,r),i.mesh.delete(r),r=a,a=r.Lnext),a.Lnext===r&&(a!==r&&((a===n||a===n.Sym)&&(n=n.next),i.mesh.delete(a)),(r===n||r===n.Sym)&&(n=n.next),i.mesh.delete(r))},t.initPriorityQ=function(i){var r,n,a,s=0;for(a=i.mesh.vHead,n=a.next;n!==a;n=n.next)s++;for(s+=8,r=i.pq=new VBe(s,Ft.vertLeq),a=i.mesh.vHead,n=a.next;n!==a;n=n.next)n.pqHandle=r.insert(n);return n!==a?!1:(r.init(),!0)},t.donePriorityQ=function(i){i.pq=null},t.removeDegenerateFaces=function(i,r){var n,a,s;for(n=r.fHead.next;n!==r.fHead;n=a)a=n.next,s=n.anEdge,Zt(s.Lnext!==s),s.Lnext.Lnext===s&&(t.addWinding(s.Onext,s),i.mesh.delete(s));return!0},t.computeInterior=function(i,r){r===void 0&&(r=!0);var n,a;if(t.removeDegenerateEdges(i),!t.initPriorityQ(i))return!1;for(t.initEdgeDict(i);(n=i.pq.extractMin())!==null;){for(;a=i.pq.min(),!(a===null||!Ft.vertEq(a,n));)a=i.pq.extractMin(),t.spliceMergeVertices(i,n.anEdge,a.anEdge);t.sweepEvent(i,n)}return i.event=i.dict.min().key.eUp.Org,t.debugEvent(i),t.doneEdgeDict(i),t.donePriorityQ(i),t.removeDegenerateFaces(i,i.mesh)?(r&&i.mesh.check(),!0):!1},t}(),YBe=function(){function t(){this.mesh=new XQ,this.normal=[0,0,0],this.sUnit=[0,0,0],this.tUnit=[0,0,0],this.bmin=[0,0],this.bmax=[0,0],this.windingRule=dr.ODD,this.dict=null,this.pq=null,this.event=null,this.vertexIndexCounter=0,this.vertices=[],this.vertexIndices=[],this.vertexCount=0,this.elements=[],this.elementCount=0}return t.prototype.dot_=function(i,r){return i[0]*r[0]+i[1]*r[1]+i[2]*r[2]},t.prototype.normalize_=function(i){var r=i[0]*i[0]+i[1]*i[1]+i[2]*i[2];if(!r)throw"Zero-size vector!";r=Math.sqrt(r),i[0]/=r,i[1]/=r,i[2]/=r},t.prototype.longAxis_=function(i){var r=0;return Math.abs(i[1])>Math.abs(i[0])&&(r=1),Math.abs(i[2])>Math.abs(i[r])&&(r=2),r},t.prototype.computeNormal_=function(i){var r,n,a,s,o,l,c=[0,0,0],h=[0,0,0],u=[0,0,0],d=[0,0,0],A=[0,0,0],f=[null,null,null],m=[null,null,null],g=this.mesh.vHead;r=g.next;for(var p=0;p<3;++p)s=r.coords[p],h[p]=s,m[p]=r,c[p]=s,f[p]=r;for(r=g.next;r!==g;r=r.next)for(var v=0;v<3;++v)s=r.coords[v],s<h[v]&&(h[v]=s,m[v]=r),s>c[v]&&(c[v]=s,f[v]=r);var _=0;if(c[1]-h[1]>c[0]-h[0]&&(_=1),c[2]-h[2]>c[_]-h[_]&&(_=2),h[_]>=c[_]){i[0]=0,i[1]=0,i[2]=1;return}for(l=0,n=m[_],a=f[_],u[0]=n.coords[0]-a.coords[0],u[1]=n.coords[1]-a.coords[1],u[2]=n.coords[2]-a.coords[2],r=g.next;r!==g;r=r.next)d[0]=r.coords[0]-a.coords[0],d[1]=r.coords[1]-a.coords[1],d[2]=r.coords[2]-a.coords[2],A[0]=u[1]*d[2]-u[2]*d[1],A[1]=u[2]*d[0]-u[0]*d[2],A[2]=u[0]*d[1]-u[1]*d[0],o=A[0]*A[0]+A[1]*A[1]+A[2]*A[2],o>l&&(l=o,i[0]=A[0],i[1]=A[1],i[2]=A[2]);l<=0&&(i[0]=i[1]=i[2]=0,i[this.longAxis_(u)]=1)},t.prototype.checkOrientation_=function(){for(var i=this.mesh.fHead,r,n=this.mesh.vHead,a,s=0,o=i.next;o!==i;o=o.next)if(a=o.anEdge,!(a.winding<=0))do s+=(a.Org.s-a.Dst.s)*(a.Org.t+a.Dst.t),a=a.Lnext;while(a!==o.anEdge);if(s<0){for(r=n.next;r!==n;r=r.next)r.t=-r.t;this.tUnit[0]=-this.tUnit[0],this.tUnit[1]=-this.tUnit[1],this.tUnit[2]=-this.tUnit[2]}},t.prototype.projectPolygon_=function(){var i=this.mesh.vHead,r=[0,0,0],n,a,s=!1;r[0]=this.normal[0],r[1]=this.normal[1],r[2]=this.normal[2],!r[0]&&!r[1]&&!r[2]&&(this.computeNormal_(r),s=!0),n=this.sUnit,a=this.tUnit;var o=this.longAxis_(r);n[o]=0,n[(o+1)%3]=1,n[(o+2)%3]=0,a[o]=0,a[(o+1)%3]=0,a[(o+2)%3]=r[o]>0?1:-1;for(var l=i.next;l!==i;l=l.next)l.s=this.dot_(l.coords,n),l.t=this.dot_(l.coords,a);s&&this.checkOrientation_();for(var c=!0,h=i.next;h!==i;h=h.next)c?(this.bmin[0]=this.bmax[0]=h.s,this.bmin[1]=this.bmax[1]=h.t,c=!1):(h.s<this.bmin[0]&&(this.bmin[0]=h.s),h.s>this.bmax[0]&&(this.bmax[0]=h.s),h.t<this.bmin[1]&&(this.bmin[1]=h.t),h.t>this.bmax[1]&&(this.bmax[1]=h.t))},t.prototype.addWinding_=function(i,r){i.winding+=r.winding,i.Sym.winding+=r.Sym.winding},t.prototype.tessellateMonoRegion_=function(i,r){var n,a;if(n=r.anEdge,!(n.Lnext!==n&&n.Lnext.Lnext!==n))throw"Mono region invalid";for(;Ft.vertLeq(n.Dst,n.Org);n=n.Lprev);for(;Ft.vertLeq(n.Org,n.Dst);n=n.Lnext);a=n.Lprev;for(var s=void 0;n.Lnext!==a;)if(Ft.vertLeq(n.Dst,a.Org)){for(;a.Lnext!==n&&(Ft.edgeGoesLeft(a.Lnext)||Ft.edgeSign(a.Org,a.Dst,a.Lnext.Dst)<=0);)s=i.connect(a.Lnext,a),a=s.Sym;a=a.Lprev}else{for(;a.Lnext!==n&&(Ft.edgeGoesRight(n.Lprev)||Ft.edgeSign(n.Dst,n.Org,n.Lprev.Org)>=0);)s=i.connect(n,n.Lprev),n=s.Sym;n=n.Lnext}if(a.Lnext===n)throw"Mono region invalid";for(;a.Lnext.Lnext!==n;)s=i.connect(a.Lnext,a),a=s.Sym;return!0},t.prototype.tessellateInterior_=function(i){for(var r,n=i.fHead.next;n!==i.fHead;n=r)if(r=n.next,n.inside&&!this.tessellateMonoRegion_(i,n))return!1;return!0},t.prototype.discardExterior_=function(i){for(var r,n=i.fHead.next;n!==i.fHead;n=r)r=n.next,n.inside||i.zapFace(n)},t.prototype.setWindingNumber_=function(i,r,n){for(var a,s=i.eHead.next;s!==i.eHead;s=a)a=s.next,s.Rface.inside!==s.Lface.inside?s.winding=s.Lface.inside?r:-r:n?i.delete(s):s.winding=0},t.prototype.getNeighbourFace_=function(i){return!i.Rface||!i.Rface.inside?-1:i.Rface.n},t.prototype.outputPolymesh_=function(i,r,n,a){var s,o=0,l=0,c;n>3&&i.mergeConvexFaces(n);for(var h=i.vHead.next;h!==i.vHead;h=h.next)h.n=-1;for(var u=i.fHead.next;u!==i.fHead;u=u.next)if(u.n=-1,!!u.inside){s=u.anEdge,c=0;do{var h=s.Org;h.n===-1&&(h.n=l,l++),c++,s=s.Lnext}while(s!==u.anEdge);if(c>n)throw"Face vertex greater that support polygon";u.n=o,++o}this.elementCount=o,r===Ln.CONNECTED_POLYGONS&&(o*=2),this.elements=[],this.elements.length=o*n,this.vertexCount=l,this.vertices=[],this.vertices.length=l*a,this.vertexIndices=[],this.vertexIndices.length=l;for(var h=i.vHead.next;h!==i.vHead;h=h.next)if(h.n!==-1){var d=h.n*a;this.vertices[d+0]=h.coords[0],this.vertices[d+1]=h.coords[1],a>2&&(this.vertices[d+2]=h.coords[2]),this.vertexIndices[h.n]=h.idx}for(var A=0,u=i.fHead.next;u!==i.fHead;u=u.next)if(u.inside){s=u.anEdge,c=0;do{var h=s.Org;this.elements[A++]=h.n,c++,s=s.Lnext}while(s!==u.anEdge);for(var f=c;f<n;++f)this.elements[A++]=-1;if(r===Ln.CONNECTED_POLYGONS){s=u.anEdge;do this.elements[A++]=this.getNeighbourFace_(s),s=s.Lnext;while(s!==u.anEdge);for(var m=c;m<n;++m)this.elements[A++]=-1}}},t.prototype.outputContours_=function(i,r){var n,a,s=0,o=0;this.vertexCount=0,this.elementCount=0;for(var l=i.fHead.next;l!==i.fHead;l=l.next)if(l.inside){a=n=l.anEdge;do this.vertexCount++,n=n.Lnext;while(n!==a);this.elementCount++}this.elements=[],this.elements.length=this.elementCount*2,this.vertices=[],this.vertices.length=this.vertexCount*r,this.vertexIndices=[],this.vertexIndices.length=this.vertexCount;var c=0,h=0,u=0;s=0;for(var l=i.fHead.next;l!==i.fHead;l=l.next)if(l.inside){o=0,a=n=l.anEdge;do this.vertices[c++]=n.Org.coords[0],this.vertices[c++]=n.Org.coords[1],r>2&&(this.vertices[c++]=n.Org.coords[2]),this.vertexIndices[h++]=this.vertexIdCallback?this.vertexIdCallback(n):n.Org.idx,o++,n=n.Lnext;while(n!==a);this.elements[u++]=s,this.elements[u++]=o,s+=o}},t.prototype.addContour=function(i,r){this.mesh===null&&(this.mesh=new XQ),i<2&&(i=2),i>3&&(i=3);for(var n=null,a=0;a<r.length;a+=i)n===null?(n=this.mesh.makeEdge(),this.mesh.splice(n,n.Sym)):(this.mesh.splitEdge(n),n=n.Lnext),n.Org.coords[0]=r[a+0],n.Org.coords[1]=r[a+1],i>2?n.Org.coords[2]=r[a+2]:n.Org.coords[2]=0,n.Org.idx=this.vertexIndexCounter++,this.edgeCreateCallback&&this.edgeCreateCallback(n),n.winding=1,n.Sym.winding=-1},t.prototype.tesselate=function(i,r,n,a,s,o){if(i===void 0&&(i=dr.ODD),r
7715===void 0&&(r=Ln.POLYGONS),o===void 0&&(o=!0),this.vertices=[],this.elements=[],this.vertexIndices=[],this.vertexIndexCounter=0,s&&(this.normal[0]=s[0],this.normal[1]=s[1],this.normal[2]=s[2]),this.windingRule=i,a<2&&(a=2),a>3&&(a=3),!this.mesh)return!1;this.projectPolygon_(),jBe.computeInterior(this,o);var l=this.mesh;return r===Ln.BOUNDARY_CONTOURS?this.setWindingNumber_(l,1,!0):this.tessellateInterior_(l),o&&l.check(),r===Ln.BOUNDARY_CONTOURS?this.outputContours_(l,a):this.outputPolymesh_(l,r,n,a),!0},t}();function oA(t){var i=t.windingRule,r=i===void 0?dr.ODD:i,n=t.elementType,a=n===void 0?Ln.POLYGONS:n,s=t.polySize,o=s===void 0?3:s,l=t.vertexSize,c=l===void 0?2:l,h=t.normal,u=h===void 0?[0,0,1]:h,d=t.contours,A=d===void 0?[]:d,f=t.strict,m=f===void 0?!0:f,g=t.debug,p=g===void 0?!1:g;if(!A&&m)throw new Error("Contours can't be empty");if(A){var v=new YBe;t.edgeCreateCallback&&(v.edgeCreateCallback=t.edgeCreateCallback),t.vertexIdCallback&&(v.vertexIdCallback=t.vertexIdCallback);for(var _=0;_<A.length;_++)v.addContour(c||2,A[_]);return v.tesselate(r,a,o,c,u,m),{vertices:v.vertices,vertexIndices:v.vertexIndices,vertexCount:v.vertexCount,elements:v.elements,elementCount:v.elementCount,mesh:p?v.mesh:void 0}}}dr.ODD;dr.NONZERO;dr.POSITIVE;dr.NEGATIVE;dr.ABS_GEQ_TWO;Ln.POLYGONS;Ln.CONNECTED_POLYGONS;Ln.BOUNDARY_CONTOURS;var _L=class{constructor(t=256,i=!1){this.capacity=t,this.size=0,this.debug=i,this.debug&&console.log(`allocating with cap ${t}`);let r=t*_L.eSize;this.buffer=new ArrayBuffer(r);let n=Float32Array.BYTES_PER_ELEMENT,a=0;this.positions=new Float32Array(this.buffer,a*n,3*t),a+=3*t,this.normals=new Float32Array(this.buffer,a*n,3*t),a+=3*t,this.uvs=new Float32Array(this.buffer,a*n,2*t)}realloc(t,i=!1){if(t<this.size)throw Error("cannot shrink buffer");if(t<=this.capacity&&!i)return;this.debug&&console.log(`resizing from ${this.capacity} â ${t}`);let r=t*_L.eSize,n=new ArrayBuffer(r),a=Float32Array.BYTES_PER_ELEMENT,s=0,o=new Float32Array(n,s*a,3*t);s+=3*t;let l=new Float32Array(n,s*a,3*t);s+=3*t;let c=new Float32Array(n,s*a,2*t);i?(o.set(this.positions.subarray(0,this.size*3)),l.set(this.normals.subarray(0,this.size*3)),c.set(this.uvs.subarray(0,this.size*2))):(o.set(this.positions),l.set(this.normals),c.set(this.uvs)),this.buffer=n,this.positions=o,this.normals=l,this.uvs=c,this.capacity=t}get(t=1){let i=this.size+t;if(i>this.capacity){let n=this.capacity;for(;i>n;)n*=2;this.realloc(n)}let r=this.size;return this.size=i,r}reserve(t){let i=this.size+t;i>this.capacity&&this.realloc(i)}shrink(){this.debug&&console.log(`shrinking ${this.capacity} â ${this.size}`),this.realloc(this.size,!0)}},GK=_L;GK.eSize=(3+3+2)*Float32Array.BYTES_PER_ELEMENT;var KBe=$u($Ae()),JN={vertices:[160,160,-160,160,-160,-160,160,-160],vertexIndices:[1,0,3,2],vertexCount:4,elements:[0,4],elementCount:1,mesh:void 0},zK={vertices:[],vertexIndices:[],vertexCount:0,elements:[],elementCount:0,mesh:void 0},QK={vertices:[-160,160,160,-160,160,160,-160,-160],vertexIndices:[1,3,0,2],vertexCount:4,elements:[0,1,2,1,0,3],elementCount:2,mesh:void 0},MI=(t,i)=>([r,n])=>(n<r&&(n+=i),(t>=r?t:t+i)<=n),$N=class extends Lt{constructor(t,i,r=0,n=12,a=3,s=dr.ODD,o=!1){super(),this.forPathBevel=o,this.type="ShapeGeometry",this.vertexCache={},this._shape=t,this._depth=i,this._curveSegments=n,this._bevelSegmentsInput=a;let l=this._shape.extractShapePointsToFlatArray([],n),c=this._shape.shapeHoles.map(T=>{let C=T.extractShapePointsToFlatArray([],n),x=[];for(let R=C.length-1;R>=1;R-=2){let L=C[R-1],I=C[R-0];x.push(L,I)}return x}),h=[],u=[];for(let T=0;T<l.length;T+=2)u.push([l[T],l[T+1]]);h.push(u);for(let T=0;T<c.length;T++){let C=c[T],x=[];for(let R=0;R<C.length;R+=2)x.push([C[R],C[R+1]]);h.push(x)}let d;t.isText?d=new aY().setFromPoints(t.points.map(T=>T.position)).getSize(new Me).length()*.1:h[0].length===0?d=r:d=(0,KBe.default)(h).distance,r<=0?(this._bevel=0,this._bevelSegments=0):(this._bevel=Math.min(r,d,i/2),this._bevelSegments=Math.floor(a));let A;try{A=oA({windingRule:s,elementType:Ln.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[l]})}catch{A=JN}let f;try{f=oA({windingRule:dr.ODD,elementType:Ln.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...c]})}catch{f=zK}if(!A)throw new Error("error generating geometry");let m=A.elementCount;if(f){A.elementCount+=f.elementCount;for(let T=0;T<f.elements.length;T++){let C=f.elements[T],x=T%2===0?A.vertexCount:0;A.elements.push(C+x)}for(let T=0;T<f.vertexIndices.length;T++){let C=f.vertexIndices[T],x=A.vertexCount;A.vertexIndices.push(C+x)}for(let T=0;T<f.vertices.length;T++){let C=f.vertices[T];A.vertices.push(C)}}let g=1/0,p=-1/0,v=1/0,_=-1/0;for(let T=0,C=A.vertexCount;T<C;T++){let x=T*2,R=A.vertices[x+0],L=A.vertices[x+1];R<g&&(g=R),R>p&&(p=R),L<v&&(v=L),L>_&&(_=L)}this._minX=g,this._minY=v,this._width=p-g,this._height=_-v,this._buffer=new GK(this._computeBufferEstimatedSize(A));let y=[],w=[];for(let T=A.elementCount-1;T>=0;T--){let C=T>=m,x=T*2,R=A.elements[x+0],L=A.elements[x+1],I=R+L,F={start:R,count:L,normals:[],continuous:[],concave:[]},Y=R,D=I-1,U=R+1,j=this._shape.roundedCurves.length;do{let ae=Y-R,ve=A.vertices[D*2+0],oe=A.vertices[D*2+1],K=A.vertices[Y*2+0],X=A.vertices[Y*2+1],N=A.vertices[U*2+0],k=A.vertices[U*2+1],Z=K-ve,V=X-oe,re=Math.sqrt(Z*Z+V*V);Z/=re,V/=re;let Ae=K-N,pe=X-k,ce=Math.sqrt(Ae*Ae+pe*pe);Ae/=ce,pe/=ce,F.normals[ae*2+0]=-pe,F.normals[ae*2+1]=Ae,F.concave[ae]=Z*pe-V*Ae>0;let _e=A.vertexIndices[Y];if(Array.isArray(_e))F.continuous[ae]=!1;else{let[me,le]=this._shape.getCurveIndexFromVertexId(_e-1,!0);if(le>0&&le<1)F.continuous[ae]=!0;else{let De=le===1?me+1:me-1;De=(De+j)%j;let Ve=le===1?0:1,se=this._shape.roundedCurves[me].getTangent(le),P=this._shape.roundedCurves[De].getTangent(Ve);F.continuous[ae]=se.dot(P)>.95}}C&&(F.normals[ae*2+0]*=-1,F.normals[ae*2+1]*=-1),[D,Y,U]=[Y,U,U+1],U>=I&&(U-=L)}while(U!==R+1);let J=[];J.push({bevelI:0,angle:0,size:0,boundary:{vertices:A.vertices.slice(R*2,I*2),vertexCount:L,vertexIndices:new Array(L).fill(!0).map((ae,ve)=>[ve,ve]),elements:[0,L],elementCount:1,mesh:null},reverseMap:[],insetPoints:A.vertices.slice(R*2,I*2)});let z=0;for(let ae=1;ae<=this._bevelSegments;ae++){let ve=ae/this._bevelSegments*Math.PI/2,oe=(1-Math.cos(ve))*this._bevel,K=[],X=[],N=0;for(let Z=0;Z<L;Z++){let V=Z*2,re=(Z-1+L)%L*2,Ae=A.vertices[F.start*2+V+0],pe=A.vertices[F.start*2+V+1],ce=-F.normals[re+0]*oe,_e=-F.normals[re+1]*oe,me=-F.normals[V+0]*oe,le=-F.normals[V+1]*oe;if(F.concave[Z]||!F.concave[Z]&&C){let De=Math.atan2(_e,ce),Ve=Math.atan2(le,me);Ve>De&&(Ve-=Math.PI*2);let se=Ve-De;if(F.continuous[Z]||C){let P=De+se/2,H=Math.cos(P)*oe,ye=Math.sin(P)*oe;K[2*N+0]=Ae+H*(C?-1:1),K[2*N+1]=pe+ye*(C?-1:1),X[N]=Z,N++}else{let P=Math.max(1,Math.floor(n/4*Math.abs(se)/Math.PI));for(let H=0;H<=P;H++){let ye=De+se*(H/P),Q=Math.cos(ye)*oe,Be=Math.sin(ye)*oe;K[2*N+0]=Ae+Q,K[2*N+1]=pe+Be,X[N]=Z,N++}}}else K[2*N+0]=Ae+ce,K[2*N+1]=pe+_e,X[N]=Z,N++,K[2*N+0]=Ae,K[2*N+1]=pe,X[N]=Z,N++,K[2*N+0]=Ae+me,K[2*N+1]=pe+le,X[N]=Z,N++}let k=oA({windingRule:dr.POSITIVE,elementType:Ln.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[K],edgeCreateCallback:Z=>{let V=Z.Org.idx,re=X[V],Ae=X[(V+1)%X.length];Z.idx=[re,Ae],Z.Sym.idx=[Ae,re]},vertexIdCallback:Z=>{let V=Z.Lprev.idx;return[V?V[1]:0,Z.idx?Z.idx[0]:0]}});if(!k)throw console.log("Error"),new Error(`error generating bevel geometry for ${ae}'th loop`);if(!k.vertexCount){let Z=(ae-1)/this._bevelSegments*Math.PI/2;z=(1-Math.sin(Z))*this._bevel;break}for(let Z=0;Z<k.vertexIndices.length;Z++){let[V,re]=k.vertexIndices[Z];if(V===re)continue;let Ae=re;re<V&&(Ae+=L);for(let pe=V;pe<Ae;pe++){let ce=pe%L,_e=(pe+1)%L;if(!F.continuous[ce]||!F.continuous[_e]){k.vertexIndices[Z]=[V,ce],k.vertexIndices.splice(Z+1,0,[_e,re]),k.vertices.splice((Z+1)*2,0,k.vertices[Z*2],k.vertices[Z*2+1]);break}}}J.push({bevelI:ae,angle:ve,size:oe,boundary:k,reverseMap:X,insetPoints:K})}let $=(ae,ve,oe)=>{let K=0,X=ae.boundary.vertexIndices.length;for(;K<X&&oe(ae.boundary.vertexIndices[ve]);)ve=(ve+1)%X,K++;return K},te=y.length;for(let ae=1;ae<J.length;ae++){let ve=J[ae-1],oe=J[ae],K=ve.boundary.vertexIndices.length,X=oe.boundary.vertexIndices.length;if(!K||!X)break;let N=F.concave.length,k=0,Z=MI(k,L);for(;
7715!ve.boundary.vertexIndices.filter(Z).length||!oe.boundary.vertexIndices.filter(Z).length;)k++,Z=MI(k,L);let V=ve.boundary.vertexIndices.findIndex(Z),re=oe.boundary.vertexIndices.findIndex(Z);do V=(V+1)%K;while(Z(ve.boundary.vertexIndices[V]));do re=(re+1)%X;while(Z(oe.boundary.vertexIndices[re]));k=(k+1)%L;let Ae=k,pe=0,ce=this._buildBevelVert(F,ve,(V-1+K)%K,void 0,pe),_e=this._buildBevelVert(F,oe,(re-1+X)%X,void 0,pe),me=ce,le=_e,De,Ve,se=!1;do{pe=(k||N)/N,Z=MI(k,L);let P=$(ve,V,Z),H=$(oe,re,Z),ye=se;if(se=!1,P&&!H){for(let Q=0;Q<P;Q++)De=this._buildBevelVert(F,ve,(V+Q)%K,Q/(P-1),pe),y.push(me.topN,De.topP,le.topN),o===!1&&y.push(De.bottomP,me.bottomN,le.bottomN),me=De;se=!0}else if(!P&&H)for(let Q=0;Q<H;Q++)Ve=this._buildBevelVert(F,oe,(re+Q)%X,Q/(H-1),pe),y.push(le.topN,me.topP,Ve.topP),o===!1&&y.push(me.bottomP,le.bottomN,Ve.bottomP),le=Ve;else if(P&&H)if(De=this._buildBevelVert(F,ve,V,0,pe),Ve=this._buildBevelVert(F,oe,re,0,pe),ye?(y.push(me.topN,Ve.topP,le.topN),y.push(me.topN,De.topP,Ve.topP),o===!1&&(y.push(Ve.bottomP,me.bottomN,le.bottomN
7715),y.push(Ve.bottomP,De.bottomP,me.bottomN))):(y.push(le.topN,me.topN,De.topP),y.push(le.topN,De.topP,Ve.topP),o===!1&&(y.push(De.bottomP,me.bottomN,le.bottomN),y.push(De.bottomP,le.bottomN,Ve.bottomP))),me=De,le=Ve,P===H)for(let Q=1;Q<P;Q++)De=this._buildBevelVert(F,ve,(V+Q)%K,Q/(P-1),pe),Ve=this._buildBevelVert(F,oe,(re+Q)%X,Q/(H-1),pe),y.push(me.topN,De.topP,le.topN),y.push(le.topN,De.topP,Ve.topP),o===!1&&(y.push(De.bottomP,me.bottomN,le.bottomN),y.push(De.bottomP,le.bottomN,Ve.bottomP)),me=De,le=Ve;else if(P>H){let Q=P/H,Be=0;for(let Le=1;Le<P;Le++)De=this._buildBevelVert(F,ve,(V+Le)%K,Le/(P-1),pe),y.push(me.topN,De.topP,le.topN),o===!1&&y.push(De.bottomP,me.bottomN,le.bottomN),me=De,Le>(Be+1)*Q&&(Be++,Ve=this._buildBevelVert(F,oe,(re+Be)%X,Be/(H-1),pe),y.push(le.topN,De.topP,Ve.topP),o===!1&&y.push(De.bottomP,le.bottomN,Ve.bottomP),le=Ve)}else{let Q=H/P,Be=0;for(let Le=1;Le<H;Le++)Ve=this._buildBevelVert(F,oe,(re+Le)%X,Le/(H-1),pe),y.push(le.topN,De.topP,Ve.topP),o===!1&&y.push(De.bottomP,le.bottomN,Ve.bottomP),le=Ve,Le>(Be+1)*Q&&(Be++,De=this._buildBevelVert(F,ve,(V+Be)%K,Be/(P-1),pe),y.push(me.topN,De.topP,le.topN),o===!1&&y.push(De.bottomP,me.bottomN,le.bottomN
7715),me=De)}V=(V+P)%K,re=(re+H)%X,k=(k+1)%N}while(k!==Ae)}if(o===!1&&this._depth>this._bevel*2&&this._buildWall(J,F,y),C){let ae=[];for(let ve=y.length-1;ve>=te+2;ve-=3){let oe=y[ve-2],K=y[ve-1],X=y[ve-0];ae.push(X,K,oe)}y.splice(te,y.length-te,...ae)}if(C){let ae=[];for(let ve=J[J.length-1].boundary.vertices.length-1;ve>=1;ve-=2){let oe=J[J.length-1].boundary.vertices[ve-1],K=J[J.length-1].boundary.vertices[ve-0];ae.push(oe,K)}w.push(ae)}if(!C){let ae=J[J.length-1],ve;try{ve=oA({windingRule:J.length>1?dr.POSITIVE:dr.ODD,elementType:Ln.POLYGONS,vertexSize:2,strict:!0,contours:[ae.insetPoints,...w]})}catch{ve=QK}if(!ve)throw new Error("Error generating geometry for surface");c.length===0&&this._bevel<d&&Object.assign(this,{useNgonForTopBottomFaceDuringBake:!0});for(let oe=0;oe<ve.elementCount*3;oe+=3){let K=this._buildSurfaceVert(ve,ve.elements[oe+0],z),X=this._buildSurfaceVert(ve,ve.elements[oe+1],z),N=this._buildSurfaceVert(ve,ve.elements[oe+2],z);y.push(K.top,X.top,N.top),o===!1&&y.push(N.bottom,X.bottom,K.bottom)}}this.vertexCache={}}this._buffer.shrink();let b=new ei(Uint32Array.from(y),1),E=new ei(this._buffer.positions,3),M=new ei(this._buffer.normals,3),S=new ei(this._buffer.uvs,2);E.needsUpdate=!0,M.needsUpdate=!0,S.needsUpdate=!0,b.needsUpdate=!0,this.setAttribute("position",E),this.setAttribute("normal",M),this.setAttribute("uv",S),this.setIndex(b)}_computeBufferEstimatedSize(t){return t.vertexCount*2*(2+this._bevelSegments)}_buildWall(t,i,r){let n=t[0];for(let a=0,s=n.boundary.vertexCount;a<s;a++){let o=this._buildBevelVert(i,n,a),l=this._buildBevelVert(i,n,(a+1)%s);r.push(l.topP,o.topN,o.bottomN),r.push(l.topP,o.bottomN,l.bottomP)}}_buildSurfaceVert(t,i,r){let n=i.toString();if(n in this.vertexCache)return this.vertexCache[n];let a=t.vertices[i*2+0],s=t.vertices[i*2+1],o=(a-this._minX)/this._width,l=(s-this._minY)/this._height;this.forPathBevel&&(l=1);let c=this._buffer.get(this.forPathBevel?1:2),h=c*3,u=c*2,d={top:c+0,bottom:c+1};return this._buffer.positions[h+0]=a,this._buffer.positions[h+1]=s,this._buffer.positions[h+2]=this.forPathBevel?this._bevel:this._depth-r,this._buffer.normals[h+0]=0,this._buffer.normals[h+1]=0,this._buffer.normals[h+2]=1,this._buffer.uvs[u+0]=o,this._buffer.uvs[u+1]=l,this.forPathBevel===!1&&(this._buffer.positions[h+3]=a,this._buffer.positions[h+4]=s,this._buffer.positions[h+5]=r,this._buffer.normals[h+3]=0,this._buffer.normals[h+4]=0,this._buffer.normals[h+5]=-1,this._buffer.uvs[u+2]=o,this._buffer.uvs[u+3]=l),this.vertexCache[n]=d,d}_buildBevelVert(t,i,r,n=1,a){let s=`${i.bevelI}:${r}`;if(s in this.vertexCache&&a!==0&&a!==1&&(!a||a===this.vertexCache[s].pathBevelUCoord))return this.vertexCache[s];let[o,l]=i.boundary.vertexIndices[r],c,h,u,d;o!==l?(h=o,c=l,d=!1,u=t.continuous[h]&&t.continuous[c]):(c=o,h=(c-1+t.count)%t.count,d=t.concave[c]&&i.bevelI>0,u=t.continuous[c]||d);let A=Math.cos(i.angle),f=Math.sin(i.angle),m=r*2,g=c*2,p=h*2,v=i.boundary.vertices[m+0],_=i.boundary.vertices[m+1],y=(1-f)*this._bevel,w=(v-this._minX)/this._width,b=(_-this._minY)/this._height;this.forPathBevel&&(a!==void 0&&(w=a),b=1);let E=t.normals[g+0],M=t.normals[g+1],S=t.normals[p+0],T=t.normals[p+1];if(d){let I=S-E,F=T-M;E=E+I*(1-n),M=M+F*(1-n);let Y=Math.sqrt(E*E+M*M);E/=Y,M/=Y}let C=this.forPathBevel?this._buffer.get(u?1:2):this._buffer.get(u?2:4),x=C*3,R=C*2,L={i:r,fi:c,topP:C+0,topN:C+0,bottomP:C+1,bottomN:C+1,pathBevelUCoord:a};return this._buffer.positions[x+0]=v,this._buffer.positions[x+1]=_,this._buffer.positions[x+2]=(this.forPathBevel?this._bevel:this._depth)-y,this._buffer.normals[x+0]=E*A,this._buffer.normals[x+1]=M*A,this._buffer.normals[x+2]=f,this._buffer.uvs[R+0]=w,this._buffer.uvs[R+1]=b,this.forPathBevel===!1&&(this._buffer.positions[x+3]=v,this._buffer.positions[x+4]=_,this._buffer.positions[x+5]=y,this._buffer.normals[x+3]=E*A,this._buffer.normals[x+4]=M*A,this._buffer.normals[x+5]=-f,this._buffer.uvs[R+2]=b,this._buffer.uvs[R+3]=w),u||(this.forPathBevel?(C+=1,x+=3,R+=2):(C+=2,x+=6,R+=4),L.topP=C+0,L.bottomP=C+1,this._buffer.positions[x+0]=v,this._buffer.positions[x+1]=_,this._buffer.positions[x+2]=(this.forPathBevel?this._bevel:this._depth)-y,this._buffer.normals[x+0]=S*A,this._buffer.normals[x+1]=T*A,this._buffer.normals[x+2]=f,this._buffer.uvs[R+0]=w,this._buffer.uvs[R+1]=b,this.forPathBevel===!1&&(this._buffer.positions[x+3]=v,this._buffer.positions[x+4]=_,this._buffer.positions[x+5]=y,this._buffer.normals[x+3]=S*A,this._buffer.normals[x+4]=T*A,this._buffer.normals[x+5]=-f,this._buffer.uvs[R+2]=b,this._buffer.uvs[R+3]=w)),this.vertexCache[s]=L,L}clone(){let t=new $N(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegmentsInput);return t.userData=gM(this.userData),t}},VK=class extends Lt{constructor(t,i=12,r={}){super(),this.type="ShapeGeometry",this.windingRule=dr.ODD,this.elementType=Ln.POLYGONS,this.polySize=3,this.vertexSize=2,this.strict=!0,this._shape=t,this._curveSegments=i,this._triangulationOptions=Object.assign({windingRule:dr.ODD,elementType:Ln.POLYGONS,polySize:3,vertexSize:2,strict:!0},r);let n=this._shape.extractShapePointsToFlatArray([],this._curveSegments),a=this._shape.shapeHoles.map(A=>A.extractShapePointsToFlatArray([],this._curveSegments)),s,o=!0,l=!0,c,h;for(let A=0,f=n.length/2;A<f;A++){let m=A*2,g=n[m+0],p=n[m+1];if(c!==void 0&&g!==c&&(o=!1),h!==void 0&&p!==h&&(l=!1),c=g,h=p,!o&&!l)break}if(!o&&!l)try{s=oA({contours:[n,...a],windingRule:this._triangulationOptions.windingRule,elementType:this._triangulationOptions.elementType,polySize:this._triangulationOptions.polySize,vertexSize:this._triangulationOptions.vertexSize,strict:this._triangulationOptions.strict})}catch{s=JN}let u=(s==null?void 0:s.vertexCount)??1,d=(s==null?void 0:s.elementCount)??1;if(this._positionAttribute=new ei(new Float32Array(u*3),3),this._normalAttribute=new ei(new Float32Array(u*3),3),this._uvAttribute=new ei(new Float32Array(u*2),2),this._indexAttribute=new ei(new Uint32Array(d*3),1),s){let A=1/0,f=-1/0,m=1/0,g=-1/0;for(let _=0,y=u;_<y;_++){let w=_*2,b=s.vertices[w+0],E=s.vertices[w+1];b<A&&(A=b),b>f&&(f=b),E<m&&(m=E),E>g&&(g=E)}let p=f-A,v=g-m;for(let _=0,y=u;_<y;_++){let w=_*2,b=s.vertices[w+0],E=s.vertices[w+1],M=(b-A)/p,S=(E-m)/v;this._positionAttribute.setXYZ(_,b,E,0),this._normalAttribute.setXYZ(_,0,0,1),this._uvAttribute.setXY(_,M,S)}for(let _=0,y=d;_<y;_++){let w=_*3,b=s.elements[w+0],E=s.elements[w+1],M=s.elements[w+2];this._indexAttribute.setX(w+0,b),this._indexAttribute.setX(w+1,E),this._indexAttribute.setX(w+2,M)}}this.setAttribute("position",this._positionAttribute),this.setAttribute("normal",this._normalAttribute),this.setAttribute("uv",this._uvAttribute),this.setIndex(this._indexAttribute),this.setDrawRange(0,((s==null?void 0:s.elementCount)??1)*3)}clone(){let t=new VK(this._shape,this._curveSegments);return t.userData=gM(this.userData),t}},WK=class extends $N{constructor(t,i,r=0,n=12,a=3,s=dr.ODD){super(t,i,r,n,a,s),this.type="ShapeGeometry"}_computeBufferEstimatedSize(t){return t.vertexCount*2*(2+this._bevelSegments)}_buildWall(t,i,r){let n=t[0];for(let a=0,s=n.boundary.vertexCount;a<s;a++){let o=this._buildBevelVert(i,n,a),l=this._buildBevelVert(i,n,(a+1)%s);r.push(l.topP,o.topN,o.bottomN),r.push(l.topP,o.bottomN,l.bottomP)}}clone(){let t=new WK(this._shape,this._depth,this._bevel,this._curveSegments,this._bevelSegmentsInput);return t.userData=gM(this.userData),t}},Lp=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){var h,u;let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,subdivisions:40,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3,windingRule:dr.ODD},t.parameters),n=Math.abs(r.width),a=Math.abs(r.height??r.width),s=Math.abs(r.depth??0),o=t.shape??(i==null?void 0:i.shape),l=(o==null?void 0:o.roun
7715dness)??r.roundness;o!==void 0&&(o instanceof on?(o.width!==n||o.height!==a)&&o.applySize(n,a):o=new on(n,a).fromJSON(o),((h=t.parameters)==null?void 0:h.roundness)!==void 0&&((u=t.parameters)==null?void 0:u.roundness)>0&&o.update());let c=o??new on(n,a);return{parameters:Object.assign(r,{width:n,height:a,depth:s,roundness:l}),shape:c}}static build(t){let{depth:i,extrudeBevelSize:r,extrudeBevelSegments:n,subdivisions:a,roundness:s,windingRule:o}=t.parameters;t.shape.roundness=s;let l;return i<=0?l=new VK(t.shape,a,{windingRule:o}):l=new WK(t.shape,i,r,a,n,o),Object.assign(l,{userData:{...t,type:"VectorGeometry"}})}},jK=Math.PI*2,eU=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0,spikes:64,angle:360,innerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1},t.parameters);return r.angle=Ct.clamp(r.angle,0,360),{shape:t.shape&&t.shape instanceof on?t.shape:new on,parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??0)})}}static build(t){let{width:i,height:r,spikes:n,angle:a,innerRadius:s,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}=t.parameters,h=t.shape,u=i*.5,d=r*.5,A=XBe(h,u,d,a*Math.PI/180,n,s);h.isClosed=!0,h.update();let f;return a===0?(f=new Lt,f.setAttribute("position",new Et([],3))):f=Lp.create({shape:h,parameters:{subdivisions:A,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}}),Object.assign(f,{userData:{...t,type:"EllipseGeometry"}})}};function XBe(t,i,r,n,a,s){if(n>=jK)return a>30||a%4===0?(ZBe(t,i,r,s),Math.round(a/4)):$Q(t,n,a,i,r,s);n=Math.max(n,.001);let o={x:0,y:r},l=n+Math.PI*.5,c={x:Math.cos(l)*i,y:Math.sin(l)*r},h=QBe({px:o.x,py:o.y,cx:c.x,cy:c.y,rx:i,ry:r,largeArcFlag:n>Math.PI,sweepFlag:!0});return a>30||a%h.length===0?qBe(t,o.x,o.y,h,a,i,r,s):$Q(t,n,a,i,r,s)}function qBe(t,i,r,n,a,s,o,l){let c=Math.round(a/n.length);t.addPoint(Og(i,r));for(let h=0,u=n.length;h<u;h++){let d=n[h],A=t.points[h],f=Og(d.x,d.y);A.controls[1].position.set(d.x1,d.y1),f.controls[0].position.set(d.x2,d.y2),t.addPoint(f)}return l>0?YK(t,s,o,l):t.addPoint(Og(0,0)),c}function $Q(t,i,r,n,a,s){let o=-i/r;for(let l=0;l<=r;l++){let c=o*l,h=Math.sin(c)*n,u=Math.cos(c)*a;t.addPoint(Og(h,u))}return i<jK?s>0?YK(t,n,a,s):t.addPoint(Og(0,0)):(t.removePoint(t.points[t.points.length-1]),s>0&&KK(t,n,a,s)),1}function ZBe(t,i,r,n=0,a=0,s=0){let o=.5522847498,l=i*o,c=r*o;t.addPoint(Cb(a-i,s,a-i,s-c,a-i,s+c)),t.addPoint(Cb(a,s+r,a-l,s+r,a+l,s+r)),t.addPoint(Cb(a+i,s,a+i,s+c,a+i,s-c)),t.addPoint(Cb(a,s-r,a+l,s-r,a-l,s-r)),n>0&&KK(t,i,r,n)}function Og(t,i){return new Lg(Ct.generateUUID(),new Me(t,i))}function Cb(t,i,r,n,a,s){let o=Og(t,i);return o.controls[0].position.set(r,n),o.controls[1].position.set(a,s),o}function YK(t,i,r,n){XK(t,i,r,n).forEach(a=>t.addPoint(a))}function KK(t,i,r,n){let a=XK(t,i,r,n),s=new on;a.forEach(o=>s.addPoint(o)),s.isClosed=!0,t.shapeHoles.push(s)}function XK(t,i,r,n){let a=n*i/100,s=a*(Math.abs(r)/Math.abs(i)),o=new Me(a/i,s/r),l=t.points.map(c=>{let h=c.clone();return h.uuid=Ct.generateUUID(),h}).reverse();return l.forEach(c=>{c.position.multiply(o);let h=c.controls[0].position.clone().multiply(o),u=c.controls[1].position.clone().multiply(o);c.controls[0].position.copy(u),c.controls[1].position.copy(h)}),l}var JBe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,revolutions:2,segments:40,pathRadius:10,pathType:0,pathSegments:30,cornerRadius:30,cornerSegments:4},t.parameters),n=Math.abs(r.width),a=Math.abs(r.height??n),s=Math.abs(r.depth??n),o=Math.abs(Math.min(n,s))/2;return{parameters:Object.assign(r,{width:n,height:a,depth:s,radius:o,segments:Math.round(r.segments),pathSegments:Math.round(r.pathSegments),cornerSegments:Math.round(r.cornerSegments)})}}static build(t){let{width:i,height:r,depth:n,radius:a,revolutions:s,segments:o,pathRadius:l,pathType:c,pathSegments:h,cornerRadius:u,cornerSegments:d}=t.parameters,A=new qK(!1,i,r,n,a,s,o,l,c,h,u,d);return Object.assign(A,{userData:{...t,type:"HelixGeometry"}})}},xI=new Rg([0,0,0],1),qK=class extends Lt{constructor(t=!0,i=1,r=1,n=1,a=1,s=1,o=1,l=1,c=1,h=1,u=1,d=1){if(super(),s===0)return;let A=t&&s===1;A&&(d=0),u>100&&(u=100),u===0&&(d=0);let f=()=>
vendor: 4,207 bytes, line 7715
7715new O,m=new O,g=f(),p=f(),v=f(),_,y,w,b,E,M,S,T,C=f(),x=f(),R=f(),L=f(),I=f(),F=f(),Y=f(),D=f(),U=r-2*l+.001,j=U/s,J=Math.ceil(o*s),z=J+1,$=U/J,te=-U/2,ae=h+1,ve=2*Math.PI/h,oe=Math.PI/2/d,K=.01,X=Math.min((1-u/100)*l,l-K),N=l-X,k=0,Z=2,V=d*Z+Z,re=ae*V/Z,Ae=re+ae*z,pe=Math.max(0,ae*(z+V)),[ce,_e,me]=[3,3,2].map(Re=>Array(pe*Re).fill(0)),le=[],De=a-l;function Ve(Re,Xe){let fe=Math.PI/2;M=Xe*$,T=2*Math.PI*(M%j)/j+fe,M+=te,S=Math.sin(T)*De,E=Math.cos(T)*De,t?Re.set(E,S,M):Re.set(E,M,S)}Ve(m,-1e-10),Ve(g,0),C.copy(m),Ve(m,1);let se=m.distanceTo(g),P=A?0:N+X,H=se*J+2*P,ye=X,Q=H-P;for(let Re=0;Re<=J;Re++){Ve(p,Re),D.subVectors(p,C).normalize(),C.copy(p),F.copy(p).setComponent(+t+1,0).normalize(),Y.crossVectors(D,F).normalize();let Xe=Re===0,fe=Re===J,Ge=Xe?3*Math.PI/2:oe,Pe=Xe?ye:Q,rt=Xe?ae:Ae,Ze=Xe?0:pe-ae,pt=D.clone().multiplyScalar(Xe?-N:N).add(p),At=D.clone().multiplyScalar(Xe?-1:1).normalize();for(let Se=0;Se<ae;Se++){let xe=Se*ve;if(x.addVectors(m.copy(F).multiplyScalar(l*Math.cos(xe)),g.copy(Y).multiplyScalar(l*Math.sin(xe))),R.copy(x).normalize(),Xe||fe){A||(k=Ze+Se,[0,1,2].forEach(de=>{ce[k*3+de]=pt.getComponent(de),_e[k*3+de]=At.getComponent(de)}),me[k*2]=+fe,me[k*2+1]=Se/h),g.copy(R).multiplyScalar(X),v.addVectors(p,g);for(let de=0;de<d;de++){let Qe=de*oe+Ge;L.addVectors(m.copy(D).multiplyScalar(N*Math.sin(Qe)),g.copy(R).multiplyScalar(N*Math.cos(Qe))),I.copy(L).normalize(),g.addVectors(v,L),L.normalize(),k=rt+de*ae+Se,[0,1,2].forEach(He=>{ce[k*3+He]=g.getComponent(He),_e[k*3+He]=I.getComponent(He)});let We=+Xe+Math.sin(Qe);me[k*2]=(Pe+N*We)/H,me[k*2+1]=Se/h}}g.addVectors(p,x),k=re+Re*ae+Se,[0,1,2].forEach(de=>{ce[k*3+de]=g.getComponent(de),_e[k*3+de]=R.getComponent(de)}),me[k*2]=(P+Re*se)/H,me[k*2+1]=Se/h}}let Be=z+2*d+Z,[Le,Ke]=[+A,Be-1];for(let Re=Le;Re<=Ke-1;Re++){let Xe=A&&Re===Ke-1;for(let fe=0;fe<ae-1;fe++)_=Re*ae+fe,y=_+1,w=(Xe?fe:_)+ae,b=(Xe?fe+1:y)+ae,Re===0?le.push(y,b,w):Re===Be-2?le.push(_,y,w):le.push(_,y,w,y,b,w)}this.setIndex(le),this.setAttribute("position",new Et(ce,3)),this.setAttribute("normal",new Et(_e,3)),this.setAttribute("uv",new Et(me,2))}getClosedTorusIndicesForBooleanOrSubdiv(){let t=this.userData.parameters,i=Math.ceil(t.tubularSegments),r=t.radialSegments+1,n=Array.from(this.getIndex().array),a,s,o,l,c=6*(i-1)*t.radialSegments,h=i,u=h===i;for(let d=0;d<t.radialSegments;d++)a=h*r+d,s=a+1,o=(u?d:a)+r,l=(u?d+1:s)+r,n[c++]=a,n[c++]=s,n[c++]=o,n[c++]=s,n[c++]=l,n[c++]=o;return n.length=c,xI.array=n,xI.count=n.length,xI}},$Be=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,detail:0,corner:0,cornerSides:4},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i,height:r,depth:n,detail:a,corner:s,cornerSides:o}=t.parameters,l=a===0&&s!==0?new ZK(i*.5,s,o):new K7(i*.5,a);return l.scale(1,r/i,n/i),Object.assign(l,{userData:{...t,type:"IcosahedronGeometry"}})}},ZK=class extends XN{constructor(t=1,i=.2,r=4){let n=(1+Math.sqrt(5))/2,a=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],o="IcosahedronGeometry";super(a,s,o,t,i,r),this.type=o}static fromJSON(t){return new ZK(t.radius,t.corner,t.cornerSides)}},eIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){var n;(((n=t.parameters)==null?void 0:n.points)??[]).forEach(a=>{Array.isArray(a)&&(a.x=a[0],a.y=a[1])});let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,segments:64,verticalSegments:64,points:[{x:0,y:-50,id:0},{x:50,y:-50,id:1},{x:50,y:50,id:2},{x:0,y:50,id:3}]},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{points:i,segments:r,verticalSegments:n}=t.parameters,a=new RC;a.moveTo(i[0].x,i[0].y),a.bezierCurveTo(i[1].x,i[1].y,i[2].x,i[2].y,i[3].x,i[3].y);let s=new z7(a.extractPoints(n).shape,r);
7715return s.rotateZ(Math.PI),Object.assign(s,{userData:{...t,type:"LatheGeometry"}})}},Bc=new ht,RI=new lr,Tb=new O,dT=class extends Ja{constructor(){super(),this.uuid=Ct.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}applyMatrix4(t){let i=new Nn().getNormalMatrix(t);for(let r=0,n=this.vertices.length;r<n;r++)this.vertices[r].applyMatrix4(t);for(let r=0,n=this.faces.length;r<n;r++){let a=this.faces[r];a.normal.applyMatrix3(i).normalize();for(let s=0,o=a.vertexNormals.length;s<o;s++)a.vertexNormals[s].applyMatrix3(i).normalize()}return this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this}rotateX(t){return Bc.makeRotationX(t),this.applyMatrix4(Bc),this}rotateY(t){return Bc.makeRotationY(t),this.applyMatrix4(Bc),this}rotateZ(t){return Bc.makeRotationZ(t),this.applyMatrix4(Bc),this}translate(t,i,r){return Bc.makeTranslation(t,i,r),this.applyMatrix4(Bc),this}scale(t,i,r){return Bc.makeScale(t,i,r),this.applyMatrix4(Bc),this}lookAt(t){return RI.lookAt(t),RI.updateMatrix(),this.applyMatrix4(RI.matrix),this}fromBufferGeometry(t){let i=this,r=t.index!==null?t.index:void 0,n=t.attributes;if(n.position===void 0)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;let a=n.position,s=n.normal,o=n.color,l=n.uv,c=n.uv2;c!==void 0&&(this.faceVertexUvs[1]=[]);for(let d=0;d<a.count;d++)i.vertices.push(new O().fromBufferAttribute(a,d)),o!==void 0&&i.colors.push(new Ht().fromBufferAttribute(o,d));function h(d,A,f,m){let g=o===void 0?[]:[i.colors[d].clone(),i.colors[A].clone(),i.colors[f].clone()],p=s===void 0?[]:[new O().fromBufferAttribute(s,d),new O().fromBufferAttribute(s,A),new O().fromBufferAttribute(s,f)],v=new yL(d,A,f,p,g,m);i.faces.push(v),l!==void 0&&i.faceVertexUvs[0].push([new Me().fromBufferAttribute(l,d),new Me().fromBufferAttribute(l,A),new Me().fromBufferAttribute(l,f)]),c!==void 0&&i.faceVertexUvs[1].push([new Me().fromBufferAttribute(c,d),new Me().fromBufferAttribute(c,A),new Me().fromBufferAttribute(c,f)])}let u=t.groups;if(u.length>0)for(let d=0;d<u.length;d++){let A=u[d],f=A.start,m=A.count;for(let g=f,p=f+m;g<p;g+=3)r!==void 0?h(r.getX(g),r.getX(g+1),r.getX(g+2),A.materialIndex):h(g,g+1,g+2,A.materialIndex)}else if(r!==void 0)for(let d=0;d<r.count;d+=3)h(r.getX(d),r.getX(d+1),r.getX(d+2));else for(let d=0;d<a.count;d+=3)h(d,d+1,d+2);return this.computeFaceNormals(),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone()),t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Tb).negate(),this.translate(Tb.x,Tb.y,Tb.z),this}normalize(){this.computeBoundingSphere();let t=this.boundingSphere.center,i=this.boundingSphere.radius,r=i===0?1:1/i,n=new ht;return n.set(r,0,0,-r*t.x,0,r,0,-r*t.y,0,0,r,-r*t.z,0,0,0,1),this.applyMatrix4(n),this}computeFaceNormals(){let t=new O,i=new O;for(let r=0,n=this.faces.length;r<n;r++){let a=this.faces[r],s=this.vertices[a.a],o=this.vertices[a.b],l=this.vertices[a.c];t.subVectors(l,o),i.subVectors(s,o),t.cross(i),t.normalize(),a.normal.copy(t)}}computeVertexNormals(t=!0){let i=new Array(this.vertices.length);for(let r=0,n=this.vertices.length;r<n;r++)i[r]=new O;if(t){let r=new O,n=new O;for(let a=0,s=this.faces.length;a<s;a++){let o=this.faces[a],l=this.vertices[o.a],c=this.vertices[o.b],h=this.vertices[o.c];r.subVectors(h,c),n.subVectors(l,c),r.cross(n),i[o.a].add(r),i[o.b].add(r),i[o.c].add(r)}}else{this.computeFaceNormals();for(let r=0,n=this.faces.length;r<n;r++){let a=this.faces[r];i[a.a].add(a.normal),i[a.b].add(a.normal),i[a.c].add(a.normal)}}for(let r=0,n=this.vertices.length;r<n;r++)i[r].normalize();for(let r=0,n=this.faces.length;r<n;r++){let a=this.faces[r],s=a.vertexNormals;s.length===3?(s[0].copy(i[a.a]),s[1].copy(i[a.b]),s[2].copy(i[a.c])):(s[0]=i[a.a].clone(),s[1]=i[a.b].clone(),s[2]=i[a.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeFlatVertexNormals(){this.computeFaceNormals();for(let t=0,i=this.faces.length;t<i;t++){let r=this.faces[t],n=r.vertexNormals;n.length===3?(n[0].copy(r.normal),n[1].copy(r.normal),n[2].copy(r.normal)):(n[0]=r.normal.clone(),n[1]=r.normal.clone(),n[2]=r.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)}computeMorphNormals(){for(let i=0,r=this.faces.length;i<r;i++){let n=this.faces[i];
7715n.__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]);for(let a=0,s=n.vertexNormals.length;a<s;a++)n.__originalVertexNormals[a]?n.__originalVertexNormals[a].copy(n.vertexNormals[a]):n.__originalVertexNormals[a]=n.vertexNormals[a].clone()}let t=new dT;t.faces=this.faces;for(let i=0,r=this.morphTargets.length;i<r;i++){if(!this.morphNormals[i]){this.morphNormals[i]={},this.morphNormals[i].faceNormals=[],this.morphNormals[i].vertexNormals=[];let a=this.morphNormals[i].faceNormals,s=this.morphNormals[i].vertexNormals;for(let o=0,l=this.faces.length;o<l;o++){let c=new O,h={a:new O,b:new O,c:new O};a.push(c),s.push(h)}}let n=this.morphNormals[i];t.vertices=this.morphTargets[i].vertices,t.computeFaceNormals(),t.computeVertexNormals();for(let a=0,s=this.faces.length;a<s;a++){let o=this.faces[a],l=n.faceNormals[a],c=n.vertexNormals[a];l.copy(o.normal),c.a.copy(o.vertexNormals[0]),c.b.copy(o.vertexNormals[1]),c.c.copy(o.vertexNormals[2])}}for(let i=0,r=this.faces.length;i<r;i++){let n=this.faces[i];
7715n.normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals}}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new Sn),this.boundingBox.setFromPoints(this.vertices)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new ho),this.boundingSphere.setFromPoints(this.vertices)}merge(t,i,r=0){if(!(t&&t.isGeometry)){console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);return}let n,a=this.vertices.length,s=this.vertices,o=t.vertices,l=this.faces,c=t.faces,h=this.colors,u=t.colors;i!==void 0&&(n=new Nn().getNormalMatrix(i));for(let d=0,A=o.length;d<A;d++){let f=o[d].clone();i!==void 0&&f.applyMatrix4(i),s.push(f)}for(let d=0,A=u.length;d<A;d++)h.push(u[d].clone());for(let d=0,A=c.length;d<A;d++){let f=c[d],m,g,p=f.vertexNormals,v=f.vertexColors,_=new yL(f.a+a,f.b+a,f.c+a);_.normal.copy(f.normal),n!==void 0&&_.normal.applyMatrix3(n).normalize();for(let y=0,w=p.length;y<w;y++)m=p[y].clone(),n!==void 0&&m.applyMatrix3(n).normalize(),_.vertexNormals.push(m);_.color.copy(f.color);for(let y=0,w=v.length;y<w;y++)g=v[y],_.vertexColors.push(g.clone());_.materialIndex=f.materialIndex+r,l.push(_)}for(let d=0,A=t.faceVertexUvs.length;d<A;d++){let f=t.faceVertexUvs[d];this.faceVertexUvs[d]===void 0&&(this.faceVertexUvs[d]=[]);for(let m=0,g=f.length;m<g;m++){let p=f[m],v=[];for(let _=0,y=p.length;_<y;_++)v.push(p[_].clone());this.faceVertexUvs[d].push(v)}}}mergeMesh(t){if(!(t&&t.isMesh)){console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t);return}t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)}mergeVertices(t=4){let i={},r=[],n=[],a=Math.pow(10,t);for(let l=0,c=this.vertices.length;l<c;l++){let h=this.vertices[l],u=Math.round(h.x*a)+"_"+Math.round(h.y*a)+"_"+Math.round(h.z*a);i[u]===void 0?(i[u]=l,r.push(this.vertices[l]),n[l]=r.length-1):n[l]=n[i[u]]}let s=[];for(let l=0,c=this.faces.length;l<c;l++){let h=this.faces[l];h.a=n[h.a],h.b=n[h.b],h.c=n[h.c];let u=[h.a,h.b,h.c];for(let d=0;d<3;d++)if(u[d]===u[(d+1)%3]){s.push(l);break}}for(let l=s.length-1;l>=0;l--){let c=s[l];this.faces.splice(c,1);for(let h=0,u=this.faceVertexUvs.length;h<u;h++)this.faceVertexUvs[h].splice(c,1)}let o=this.vertices.length-r.length;return this.vertices=r,o}setFromPoints(t){this.vertices=[];for(let i=0,r=t.length;i<r;i++){let n=t[i];this.vertices.push(new O(n.x,n.y,n.z||0))}return this}sortFacesByMaterialIndex(){let t=this.faces,i=t.length;for(let l=0;l<i;l++)t[l]._id=l;function r(l,c){return l.materialIndex-c.materialIndex}t.sort(r);let n=this.faceVertexUvs[0],a=this.faceVertexUvs[1],s,o;n&&n.length===i&&(s=[]),a&&a.length===i&&(o=[]);for(let l=0;l<i;l++){let c=t[l]._id;s&&s.push(n[c]),o&&o.push(a[c])}s&&(this.faceVertexUvs[0]=s),o&&(this.faceVertexUvs[1]=o)}toJSON(){let t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,this.name!==""&&(t.name=this.name),this.parameters!==void 0){let f=this.parameters;for(let m in f)f[m]!==void 0&&(t[m]=f[m]);return t}let i=[];for(let f=0;f<this.vertices.length;f++){let m=this.vertices[f];i.push(m.x,m.y,m.z)}let r=[],n=[],a={},s=[],o={},l=[],c={};for(let f=0;f<this.faces.length;f++){let m=this.faces[f],g=!0,p=!1,v=this.faceVertexUvs[0][f]!==void 0,_=m.normal.length()>0,y=m.vertexNormals.length>0,w=m.color.r!==1||m.color.g!==1||m.color.b!==1,b=m.vertexColors.length>0,E=0;if(E=h(E,0,0),E=h(E,1,g),E=h(E,2,p),E=h(E,3,v),E=h(E,4,_),E=h(E,5,y),E=h(E,6,w),E=h(E,7,b),r.push(E),r.push(m.a,m.b,m.c),r.push(m.materialIndex),v){let M=this.faceVertexUvs[0][f];r.push(A(M[0]),A(M[1]),A(M[2]))}if(_&&r.push(u(m.normal)),y){let M=m.vertexNormals;r.push(u(M[0]),u(M[1]),u(M[2]))}if(w&&r.push(d(m.color)),b){let M=m.vertexColors;r.push(d(M[0]),d(M[1]),d(M[2]))}}function h(f,m,g){return g?f|1<<m:f&~(1<<m)}function u(f){let m=f.x.toString()+f.y.toString()+f.z.toString();return a[m]!==void 0||(a[m]=n.length/3,n.push(f.x,f.y,f.z)),a[m]}function d(f){let m=f.r.toString()+f.g.toString()+f.b.toString();return o[m]!==void 0||(o[m]=s.length,s.push(f.getHex())),o[m]}function A(f){let m=f.x.toString()+f.y.toString();return c[m]!==void 0||(c[m]=l.length/2,l.push(f.x,f.y)),c[m]}return t.data={},t.data.vertices=i,t.data.normals=n,s.length>0&&(t.data.colors=s),l.length>0&&(t.data.uvs=[l]),t.data.faces=r,t}clone(){return new dT().copy(this)}copy(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;let i=t.vertices;for(let d=0,A=i.length;d<A;d++)this.vertices.push(i[d].clone());let r=t.colors;for(let d=0,A=r.length;d<A;d++)this.colors.push(r[d].clone());let n=t.faces;for(let d=0,A=n.length;d<A;d++)this.faces.push(n[d].clone());for(let d=0,A=t.faceVertexUvs.length;d<A;d++){let f=t.faceVertexUvs[d];this.faceVertexUvs[d]===void 0&&(this.faceVertexUvs[d]=[]);for(let m=0,g=f.length;m<g;m++){let p=f[m],v=[];for(let _=0,y=p.length;_<y;_++){let w=p[_];v.push(w.clone())}this.faceVertexUvs[d].push(v)}}let a=t.morphTargets;for(let d=0,A=a.length;d<A;d++){let f={};if(f.name=a[d].name,a[d].vertices!==void 0){f.vertices=[];for(let m=0,g=a[d].vertices.length;m<g;m++)f.vertices.push(a[d].vertices[m].clone())}if(a[d].normals!==void 0){f.normals=[];for(let m=0,g=a[d].normals.length;m<g;m++)f.normals.push(a[d].normals[m].clone())}this.morphTargets.push(f)}let s=t.morphNormals;for(let d=0,A=s.length;d<A;d++){let f={};if(s[d].vertexNormals!==void 0){f.vertexNormals=[];for(let m=0,g=s[d].vertexNormals.length;m<g;m++){let p=s[d].vertexNormals[m],v={};v.a=p.a.clone(),v.b=p.b.clone(),v.c=p.c.clone(),f.vertexNormals.push(v)}}if(s[d].faceNormals!==void 0){f.faceNormals=[];for(let m=0,g=s[d].faceNormals.length;m<g;m++)f.faceNormals.push(s[d].faceNormals[m].clone())}this.morphNormals.push(f)}let o=t.skinWeights;for(let d=0,A=o.length;d<A;d++)this.skinWeights.push(o[d].clone());let l=t.skinIndices;for(let d=0,A=l.length;d<A;d++)this.skinIndices.push(l[d].clone());let c=t.lineDistances;for(let d=0,A=c.length;d<A;d++)this.lineDistances.push(c[d]);let h=t.boundingBox;h!==null&&(this.boundingBox=h.clone());let u=t.boundingSphere;return u!==null&&(this.boundingSphere=u.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}toBufferGeometry(){let t=new tIe().fromGeometry(this),i=new Lt,r=new Float32Array(t.vertices.length*3);if(i.setAttribute("position",Mb.call(new ei(r,3),t.vertices)),t.normals.length>0){let n=new Float32Array(t.normals.length*3);i.setAttribute("normal",Mb.call(new ei(n,3),t.normals))}if(t.colors.length>0){let n=new Float32Array(t.colors.length*3);i.setAttribute("color",e6.call(new ei(n,3),t.colors))}if(t.uvs.length>0){let n=new Float32Array(t.uvs.length*2);i.setAttribute("uv",t6.call(new ei(n,2),t.uvs))}if(t.uvs2.length>0){let n=new Float32Array(t.uvs2.length*2);i.setAttribute("uv2",t6.call(new ei(n,2),t.uvs2))}i.groups=t.groups;for(let n in t.morphTargets){let a=[],s=t.morphTargets[n];for(let o=0,l=s.length;o<l;o++){let c=s[o],h=new Et(c.data.length*3,3);h.name=c.name,a.push(Mb.call(h,c.data))}i.morphAttributes[n]=a}if(t.skinIndices.length>0){let n=new Et(t.skinIndices.length*4,4);i.setAttribute("skinIndex",i6.call(n,t.skinIndices))}if(t.skinWeights.length>0){let n=new Et(t.skinWeights.length*4,4);i.setAttribute("skinWeight",i6.call(n,t.skinWeights))}return t.boundingSphere!==null&&(i.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(i.boundingBox=t.boundingBox.clone()),i}computeTangents(){console.error("THREE.Geometry: .computeTangents() has been removed.")}computeLineDistances(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")}
7715applyMatrix(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}dispose(){this.dispatchEvent({type:"dispose"})}static createBufferGeometryFromObject(t){let i=new Lt,r=t.geometry;if(t.isPoints||t.isLine){let n=new Et(r.vertices.length*3,3),a=new Et(r.colors.length*3,3);if(i.setAttribute("position",Mb.call(n,r.vertices)),i.setAttribute("color",e6.call(a,r.colors)),r.lineDistances&&r.lineDistances.length===r.vertices.length){let s=new Et(r.lineDistances.length,1);i.setAttribute("lineDistance",iIe.call(s,r.lineDistances))}r.boundingSphere!==null&&(i.boundingSphere=r.boundingSphere.clone()),r.boundingBox!==null&&(i.boundingBox=r.boundingBox.clone())}else t.isMesh&&(i=r.toBufferGeometry());return i}};dT.prototype.isGeometry=!0;var tIe=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(t){let i=[],r,n,a,s=t.faces;for(n=0;n<s.length;n++){let o=s[n];o.materialIndex!==a&&(a=o.materialIndex,r!==void 0&&(r.count=n*3-r.start,i.push(r)),r={start:n*3,materialIndex:a})}r!==void 0&&(r.count=n*3-r.start,i.push(r)),this.groups=i}fromGeometry(t){let i=t.faces,r=t.vertices,n=t.faceVertexUvs,a=n[0]&&n[0].length>0,s=n[1]&&n[1].length>0,o=t.morphTargets,l=o.length,c;if(l>0){c=[];for(let p=0;p<l;p++)c[p]={name:o[p].name,data:[]};this.morphTargets.position=c}let h=t.morphNormals,u=h.length,d;if(u>0){d=[];for(let p=0;p<u;p++)d[p]={name:h[p].name,data:[]};this.morphTargets.normal=d}let A=t.skinIndices,f=t.skinWeights,m=A.length===r.length,g=f.length===r.length;r.length>0&&i.length===0&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let p=0;p<i.length;p++){let v=i[p];this.vertices.push(r[v.a],r[v.b],r[v.c]);let _=v.vertexNormals;if(_.length===3)this.normals.push(_[0],_[1],_[2]);else{let w=v.normal;this.normals.push(w,w,w)}let y=v.vertexColors;if(y.length===3)this.colors.push(y[0],y[1],y[2]);else{let w=v.color;this.colors.push(w,w,w)}if(a===!0){let w=n[0][p];w!==void 0?this.uvs.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",p),this.uvs.push(new Me,new Me,new Me))}if(s===!0){let w=n[1][p];w!==void 0?this.uvs2.push(w[0],w[1],w[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",p),this.uvs2.push(new Me,new Me,new Me))}for(let w=0;w<l;w++){let b=o[w].vertices;c[w].data.push(b[v.a],b[v.b],b[v.c])}for(let w=0;w<u;w++){let b=h[w].vertexNormals[p];d[w].data.push(b.a,b.b,b.c)}m&&this.skinIndices.push(A[v.a],A[v.b],A[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,t.boundingSphere!==null&&(this.boundingSphere=t.boundingSphere.clone()),t.boundingBox!==null&&(this.boundingBox=t.boundingBox.clone()),this}},yL=class{constructor(t,i,r,n,a,s=0){this.a=t,this.b=i,this.c=r,this.normal=n&&n.isVector3?n:new O,this.vertexNormals=Array.isArray(n)?n:[],this.color=a&&a.isColor?a:new Ht,this.vertexColors=Array.isArray(a)?a:[],this.materialIndex=s}clone(){return new this.constructor().copy(this)}copy(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let i=0,r=t.vertexNormals.length;i<r;i++)this.vertexNormals[i]=t.vertexNormals[i].clone();for(let i=0,r=t.vertexColors.length;i<r;i++)this.vertexColors[i]=t.vertexColors[i].clone();return this}};function iIe(t){return this.array.set(t),this}function e6(t){let i=this.array,r=0;for(let n=0,a=t.length;n<a;n++){let s=t[n];s===void 0&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",n),s=new Ht),i[r++]=s.r,i[r++]=s.g,i[r++]=s.b}return this}function t6(t){let i=this.array,r=0;for(let n=0,a=t.length;n<a;n++){let s=t[n];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",n),s=new Me),i[r++]=s.x,i[r++]=s.y}return this}function Mb(t){let i=this.array,r=0;for(let n=0,a=t.length;n<a;n++){let s=t[n];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",n),s=new O),i[r++]=s.x,i[r++]=s.y,i[r++]=s.z}return this}function i6(t){let i=this.array,r=0;for(let n=0,a=t.length;n<a;n++){let s=t[n];s===void 0&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",n),s=new ai),i[r++]=s.x,i[r++]=s.y,i[r++]=s.z,i[r++]=s.w}return this}var rIe=["a","b","c"];function nIe(t,i){switch(i){case"c":return t.c;case"b":return t.b;case"a":default:return t.a}}function BI(t,i,r){let n=Math.min(t,i),a=Math.max(t,i),s=n+"_"+a;return r.get(s)}function II(t,i,r,n,a,s){let o=Math.min(t,i),l=Math.max(t,i),c=o+"_"+l,h;if(n.has(c))h=n.get(c);
7715else{let u=r[o],d=r[l];h={a:u,b:d,newEdge:null,faces:[]},n.set(c,h)}h.faces.push(a),s[t].edges.push(h),s[i].edges.push(h)}function aIe(t,i,r,n){let a,s,o;for(a=0,s=t.length;a<s;a++)r[a]={edges:[]};for(a=0,s=i.length;a<s;a++)o=i[a],II(o.a,o.b,t,n,o,r),II(o.b,o.c,t,n,o,r),II(o.c,o.a,t,n,o,r)}function xb(t,i,r,n,a){t.push(new yL(i,r,n,void 0,void 0,a))}function Pm(t,i){return Math.abs(i-t)/2+Math.min(t,i)}function Rb(t,i,r,n){t.push([i.clone(),r.clone(),n.clone()])}var sIe=class{constructor(t=1){this.subdivisions=t}modify(t){t instanceof Lt?t=new dT().fromBufferGeometry(t):t=t.clone(),t.mergeVertices();let i=this.subdivisions;for(;i-- >0;)this._smooth(t);return t.computeFaceNormals(),t.computeVertexNormals(),t}_smooth(t){let i=new O,r,n,a,s,o,l=t.vertices,c=t.faces,h=t.faceVertexUvs[0],u=h!==void 0&&h.length>0,d=[],A=new Map;aIe(l,c,d,A);let f=[],m,g,p,v,_,y,w;for(let K of Array.from(A.keys())){for(g=A.get(K),p=new O,_=3/8,y=1/8,w=g.faces.length,w!=2&&(_=.5,y=0,w!=1),p.addVectors(g.a,g.b).multiplyScalar(_),i.set(0,0,0),s=0;s<w;s++){for(v=g.faces[s],o=0;o<3&&(m=l[nIe(v,rIe[o])],!(m!==g.a&&m!==g.b));o++);m&&i.add(m)}i.multiplyScalar(y),p.add(i),g.newEdge=f.length,f.push(p)}let b,E,M,S,T,C,x,R=[];for(n=0,a=l.length;n<a;n++){for(C=l[n],T=d[n].edges,r=T.length,r==3?b=3/16:r>3&&(b=3/(8*r)),E=1-r*Number(b),M=b,r<=2&&(r==2?(E=3/4,M=1/8):r==1||r==0),x=C.clone().multiplyScalar(E),i.set(0,0,0),s=0;s<r;s++)S=T[s],m=S.a!==C?S.a:S.b,i.add(m);i.multiplyScalar(Number(M)),x.add(i),R.push(x)}let L=R.concat(f),I=R.length,F,Y,D,U=[],j=[],J,z,$,te,ae=new Me,ve=new Me,oe=new Me;for(n=0,a=c.length;n<a;n++)v=c[n],F=Number(BI(v.a,v.b,A).newEdge)+I,Y=Number(BI(v.b,v.c,A).newEdge)+I,D=Number(BI(v.c,v.a,A).newEdge)+I,xb(U,F,Y,D,v.materialIndex),xb(U,v.a,F,D,v.materialIndex),xb(U,v.b,Y,F,v.materialIndex),xb(U,v.c,D,Y,v.materialIndex),u&&(J=h[n],z=J[0],$=J[1],te=J[2],ae.set(Pm(z.x,$.x),Pm(z.y,$.y)),ve.set(Pm($.x,te.x),Pm($.y,te.y)),oe.set(Pm(z.x,te.x),Pm(z.y,te.y)),Rb(j,ae,ve,oe),Rb(j,z,ae,oe),Rb(j,$,ve,ae),Rb(j,te,oe,ve));t.vertices=L,t.faces=U,u&&(t.faceVertexUvs[0]=j)}},Gn=new O,oIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=t.geometry??(i==null?void 0:i.geometry)??new Lt().copy(new gc(100,100,100)),n;i===void 0?(r.computeBoundingBox(),r.boundingBox.getSize(Gn),n={width:Gn.x,height:Gn.y,depth:Gn.z,subdivisions:0}):n=i.parameters;let a={...n,...t.parameters};return{parameters:{width:Math.abs(a.width),height:Math.abs(a.height),depth:Math.abs(a.depth),subdivisions:Math.abs(a.subdivisions)},geometry:r}}static build(t){let{width:i,height:r,depth:n,subdivisions:a}=t.parameters,s=t.geometry??new Lt().copy(new gc(100,100,100)),o=s.userData.parameters;o===void 0?(s.computeBoundingBox(),s.boundingBox.getSize(Gn)):Gn.set(o.width,o.height,o.depth),(i!==Gn.x||r!==Gn.y||n!==Gn.z)&&s.scale(Gn.x===0?1:i/Gn.x,Gn.y===0?1:r/Gn.y,Gn.z===0?1:n/Gn.z);let l=s.originalGeometry;try{a>0?(l===void 0||(o==null?void 0:o.subdivisions)!==a)&&(l===void 0&&(l=s),s=new sIe(a).modify(l).toBufferGeometry()):(l!==void 0&&(s=l),l=void 0,s.getAttribute("normal")===void 0&&s.computeVertexNormals())}catch{l!==void 0&&(s=l),l=void 0,s.getAttribute("normal")===void 0&&s.computeVertexNormals()}return l!==void 0&&Object.assign(s,{originalGeometry:l}),delete t.geometry,Object.assign(s,{userData:{...t,type:"NonParametricGeometry"}})}static loadFromUrl(t,i,r){new rY(r).load(t,n=>{let a=this.normalizeInputs({geometry:n});n.boundingBox.getSize(Gn);let s=100/Gn.x;Object.assign(a.parameters,{width:100,height:Gn.y*s,depth:Gn.z*s}),i(this.build(a))})}},JK=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:3},t.parameters);return{shape:t.shape&&t.shape instanceof on?t.shape:new on,parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??0)})}}static build(t){let{width:i,height:r,spikes:n,cornerRadius:a,depth:s,extrudeBevelSize:o,extrudeBevelSegments:l}=t.parameters,c=t.shape,h=i*.5,u=r*.5,d=0,A=0,f=2*Math.PI/n;for(let g=0;g<n;g++){let p=f*g,v=d+Math.sin(p)*h,_=A+Math.cos(p)*u;c.addPoint(c.createPoint(v,_))}c.isClosed=!0;for(let g=0,p=c.points.length;g<p;g++)c.points[g].roundness=a;
vendor: 28,278 bytes, lines 7715-7716
7715c.roundness=a,c.update();let m=Lp.create({shape:c,parameters:{roundness:a,depth:s,extrudeBevelSize:o,extrudeBevelSegments:l}});return Object.assign(m,{userData:{...t,type:"PolygonGeometry"}})}},lIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,radialSegments:4,heightSegments:1,cornerRadius:0,cornerSegments:8,openEnded:!1},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i,height:r,depth:n,radialSegments:a,heightSegments:s,openEnded:o,cornerRadius:l,cornerSegments:c}=t.parameters,h=new hIe(i*.5,r,a,s,o,l,c);return h.scale(1,1,n/i),Object.assign(h,{userData:{...t,type:"PyramidGeometry"}})}};function Wv(t,i,r){r.x=t.x*i.x,r.y=t.y,r.z=t.x*i.y}function DI(t,i,r,n,a,s){let o=i.clone().sub(t),l=r.clone().sub(t),c=o.angleTo(l);if(o.normalize(),l.normalize(),n===a){let h=o.add(l).normalize();s.copy(t).addScaledVector(h,n/Math.sin(c/2))}else{let h=o.angleTo(l);s.copy(t),s.addScaledVector(o,a/Math.sin(h)),s.addScaledVector(l,n/Math.sin(h))}}function cIe(t,i,r){let n=t.clone().sub(i),a=r.clone().sub(i);return n.projectOnVector(a),n.add(i)}var hIe=class extends Lt{constructor(t=.5,i=1,r=4,n=1,a=!1,s=0,o=4){super(),r=Math.floor(Math.max(3,r)),n=Math.floor(n),o=Math.floor(o);let l=[],c=[],h=[],u=[],d=0,A=i/2,f=Math.PI/r,m=t*Math.cos(Math.PI/r),g=2*Math.PI/r,p=(r-2)*Math.PI/r,v=Math.PI-p,_=new O(0,-A,0),y=new O(0,A,0),w=new Me(t,-A),b=new Me(m,-A),E=new Me(0,y.y).sub(b),M=new Me(0,y.y).sub(w),S=new Me(E.y,-E.x).normalize(),T=new Me(M.y,-M.x).normalize(),C=t*Math.cos(Math.PI/r)*Math.tan((Math.PI-E.angle())/2)-1e-8;s=Math.min(s,C);let x;{let D=new O(S.x,S.y,0),U=new O(Math.cos(g)*D.x,D.y,Math.sin(g)*D.x);x=D.angleTo(U)}let R=s/Math.tan((Math.PI-E.angle())/2),L=s/Math.tan((Math.PI-x)/2),I=new O;if(!a){c.push(_.x,_.y,_.z),h.push(0,-1,0),u.push(0,0);let D=d++,U=[],j=w.clone(),J=R/Math.cos(Math.PI/r);j.x-=J;for(let z=0;z<r;z++){let $=z/r*Math.PI*2+f,te=new Me(Math.sin($),Math.cos($));Wv(j,te,I),c.push(I.x,I.y,I.z),h.push(0,-1,0),u.push(0,0),U.push(d++)}for(let z=0;z<U.length;z++)l.push(U[z],D,U[(z+1)%U.length])}{let D=new O,U=new O,j=new O,J=new O,z=new O,$=new O;for(let te=0;te<r;te++){let ae=te/r*Math.PI*2+f,ve=(te+.5)/r*Math.PI*2+f,oe=(te+1)/r*Math.PI*2+f,K=new Me(Math.sin(ae),Math.cos(ae)),X=new Me(Math.sin(ve),Math.cos(ve)),N=new Me(Math.sin(oe),Math.cos(oe));Wv(w,K,U),Wv(w,N,j),Wv(S,X,D),DI(y,U,j,L,L,J),c.push(J.x,J.y,J.z),DI(U,y,j,L,R,z),c.push(z.x,z.y,z.z),DI(j,U,y,R,L,$),c.push($.x,$.y,$.z),h.push(D.x,D.y,D.z),h.push(D.x,D.y,D.z),h.push(D.x,D.y,D.z),u.push(0,0),u.push(0,0),u.push(0,0);let k=d++,Z=d++,V=d++;if(l.push(k,Z,V),s>0){{let pe=U.clone().add(j).multiplyScalar(.5),ce=y.clone().sub(pe).normalize(),_e=_.clone().sub(pe).normalize().add(ce).normalize().multiplyScalar(-1),me=$.clone().sub(z);F(pe,me,_e,E.angle())}let re,Ae;{let pe=new O;Wv(T,N,pe);let ce=$.clone().add(J).multiplyScalar(.5);ce=cIe(ce,j,y);let _e=$.clone().sub(J);[re,Ae]=F(ce,_e,pe,x,J.y)}{let pe=re,ce=pe.clone().setY(0).normalize(),_e=new O(0,-1,0),me=ce.clone().cross(_e);Y(pe,ce,_e,me)}{let pe=E.angle(),ce=Math.PI-pe,_e=y.clone();_e.y-=s/Math.sin(pe-Math.PI/2);let me=new O,le=[];for(let Ve=0;Ve<o;Ve++){let se=[],P=Math.PI/2-ce*Ve/o,H=Math.cos(P),ye=Math.sin(P),Q=ve;for(let Be=0;Be<=Ve;Be++){let Le=Math.cos(Q),Ke=Math.sin(Q);D.x=H*Ke,D.y=ye,D.z=H*Le,me.copy(_e).addScaledVector(D,s),c.push(me.x,me.y,me.z),h.push(D.x,D.y,D.z),u.push(0,0),se.push(d++),Q+=Math.PI*2/Ve/r}le.push(se)}Ae.reverse(),le.push(Ae);let De=le.length-1;for(let Ve=0;Ve<De;Ve++){let se=le[Ve],P=le[Ve+1],H=se.length-1;l.push(P[1],se[0],P[0]);for(let ye=1;ye<=H;ye++)l.push(se[ye],se[ye-1],P[ye]),l.push(P[ye+1],se[ye],P[ye])}}}}}this.setIndex(l),this.setAttribute("position",new Et(c,3)),this.setAttribute("normal",new Et(h,3)),this.setAttribute("uv",new Et(u,2));function F(D,U,j,J,z){let $=-J/2,te=(Math.PI-J)/2,ae=U.clone().normalize().cross(j);D.addScaledVector(j,-s/Math.sin(te));let ve=new O,oe=new O,K=1,X=d,N=[];for(let k=0;k<=o;k++){let Z=$+k/o*J;oe.set(0,0,0),oe.addScaledVector(ae,Math.sin(Z)),oe.addScaledVector(j,Math.cos(Z));for(let V=0;V<=K;V++){let re=V/K-.5;if(ve.copy(D),ve.addScaledVector(U,re),ve.addScaledVector(oe,s),z!=null){let Ae=Math.max(0,ve.y-z);ve.addScaledVector(U,-Ae/U.y)}c.push(ve.x,ve.y,ve.z),h.push(oe.x,oe.y,oe.z),u.push(0,0),V===0&&N.push(d),d++}}for(let k=0;k<o;k++)for(let Z=0;Z<K;Z++){let V=X+Z+(K+1)*k,re=V+(K+1),Ae=re+1,pe=V+1;l.push(V,re,pe),l.push(re,Ae,pe)}return[D.clone().addScaledVector(U,.5),N]}function Y(D,U,j,J){let z=Math.PI/2,$=M.angle()-z,te=[],ae=new O,ve=new O;for(let K=0;K<=o;K++){let X=[],N=K/o;for(let k=0;k<=K;k++){let Z=((K?k/K:0)-.5)*v,V=Math.cos(Z),re=Math.sin(Z),Ae=Math.atan(Math.tan($)*V),pe=(z+Ae)*N,ce=Math.cos(pe),_e=Math.sin(pe);ae.set(0,0,0),ae.addScaledVector(U,_e*V),ae.addScaledVector(j,ce),ae.addScaledVector(J,_e*re),ve.copy(D).addScaledVector(ae,s),c.push(ve.x,ve.y,ve.z),h.push(ae.x,ae.y,ae.z),u.push(0,0),X.push(d++)}te.push(X)}let oe=te.length-1;for(let K=0;K<oe;K++){let X=te[K],N=te[K+1],k=X.length-1;l.push(X[0],N[1],N[0]);for(let Z=1;Z<=k;Z++)l.push(X[Z-1],X[Z],N[Z]),l.push(X[Z],N[Z+1],N[Z])}}}},tU=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0,cornerRadius:[0,0,0,0],cornerType:1,extrudeBevelSize:0,extrudeBevelSegments:1},t.parameters),n=Object.assign((i==null?void 0:i.ui)??{enabledIndieCorners:!1},t.ui);return{shape:t.shape&&t.shape instanceof on?t.shape:new on,parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??0)}),ui:n}}static build(t){let i=t.shape,{width:r,height:n,cornerRadius:a,cornerType:s,depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}=t.parameters,h={x:r*.5,y:n*.5},u={x:-h.x,y:-h.y},d={x:h.x,y:h.y};function A(w,b,E){return b>r&&E>n?Math.min(w*r/b,w*n/E):b>r?w*r/b:E>n?w*n/E:w}let f=[];f[0]=a[0]===0?0:A(a[0],a[0]+a[3],a[0]+a[1]),f[1]=a[1]===0?0:A(a[1],a[1]+a[2],a[1]+a[0]),f[2]=a[2]===0?0:A(a[2],a[2]+a[1],a[2]+a[3]),f[3]=a[3]===0?0:A(a[3],a[3]+a[0],a[3]+a[2]);let m=u.x,g=d.x,p=d.y,v=u.y;i.addPoint(i.createPoint(m,p)),i.addPoint(i.createPoint(g,p)),i.addPoint(i.createPoint(g,v)),i.addPoint(i.createPoint(m,v)),i.isClosed=!0;let _=!0;for(let w=0,b=i.points.length;w<b;w++)i.points[w].roundness=f[w],w>0&&f[w]!==f[w-1]&&(_=!1);_&&(i.roundness=f[0]),i.useCubicForRoundedCorners=s!==1,i.update();let y=Lp.create({shape:i,parameters:{depth:o,extrudeBevelSize:l,extrudeBevelSegments:c}});return Object.assign(y,{userData:{...t,type:"RectangleGeometry"}})}},uIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,widthSegments:64,heightSegments:64,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:180},t.parameters);return r.thetaLength=Ct.clamp(r.thetaLength,0,180),{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i=100,height:r=i,depth:n=i,widthSegments:a=64,heightSegments:s=64,phiStart:o,phiLength:l,thetaStart:c,thetaLength:h}=t.parameters,u;return h===0?(u=new Lt,u.setAttribute("position",new Et([],3))):u=new Bg(.5*i,a,s,o,l,c,h*Ct.DEG2RAD),u.scale(1,r/i,n/i),Object.assign(u,{userData:{...t,type:"SphereGeometry"}})}},dIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0,widthSegments:8,heightSegments:8},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:0})}}static build(t){let{width:i=100,height:r=i,widthSegments:n=8,heightSegments:a=8}=t.parameters,s=new zu(i,r,n,a);return s.scale(1,1,1),Object.assign(s,{userData:{...t,type:"PlaneGeometry"}})}},AIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,angle:90,cornerRadius:24,cornerSegments:8},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width)})}}static build(t){let{width:i,height:r,depth:n,angle:a,cornerRadius:s,cornerSegments:o}=t.parameters,l=new fIe(i,r,n,a,s,o);return Object.assign(l,{userData:{...t,type:"BackdropGeometry"}})}},fIe=class extends Lt{constructor(t=1,i=1,r=1,n=90,a=10,s=24){super(),this.type="BackdropGeometry";let o=[],l=[],c=[],h=.001;a==0&&(s=1),s=Math.max(1,Math.floor(s)),a=Math.min(a,100),n=Math.min(180-h,n),n*=Math.PI/180;let u=[],d=Math.PI/2,A=(K=0,X=0,N=0)=>new O(K,X,N),f=A(),m=A(),[g,p,v]=[i/2,t/2,r/2],_=-p,y=+p,[w,b,E]=[A(_,-g,+v),A(_,-g,-v),A(_,+g,-v)],M=(K,X=!1)=>Math.sin(K-Math.PI/(1+ +X)),S=(K,X=!1)=>Math.cos(K-Math.PI/(1+ +X));E.y=Math.sin(n)*i-g;let T=Math.cos(n)*i-v,C=w.z-h;n<=d?(E.z=Math.min(T,C),E.z==C&&(E.y-=(T-C)/Math.tan(d-n))):b.z=Math.min(b.z-T-v,w.z-h),f.subVectors(w,b),m.subVectors(E,b);let x=Math.min(f.length(),m.length())*a/100,R=x*Math.tan(n/2),L=x/Math.cos(n/2),I=f.clone().normalize().add(m.normalize()).setLength(L).add(b);f.set(0,M(n,!0),S(n,!0)),u.push([E,f.clone()]);let F=(Math.PI-n)/s;for(let K=0;K<=s;K++){let X=d+n+K*F;f.set(0,Math.sin(X)*R,Math.cos(X)*R),f.add(I),m.set(0,M(X),S(X)),u.push([f.clone(),m.clone()])}u.push([w,A(0,1,0)]);let Y=Math.sin(F/2)*R*2,D=u.length-1,U=u[0][0].distanceTo(u[1][0]),j=u[D-1][0].distanceTo(u[D][0]),J=U+Y*s+j;u[0].push(1);for(let K=0;K<=s;K++)u[K+1].push(1-(U+K*Y)/J);u[D].push(0);let[z,$,te]=u[0],ae,ve,oe;for(let K=1;K<u.length;K++)[ae,ve,oe]=u[K],o.push(_,z.y,z.z,_,ae.y,ae.z,y,z.y,z.z,y,z.y,z.z,_,ae.y,ae.z,y,ae.y,ae.z),l.push(0,$.y,$.z,0,ve.y,ve.z,0,$.y,$.z,0,$.y,$.z,0,ve.y,ve.z,0,ve.y,ve.z),c.push(0,te,0,oe,1,te,1,te,0,oe,1,oe),[z,$,te]=[ae,ve,oe];this.setAttribute("position",new Et(o,3)),this.setAttribute("normal",new Et(l,3)),this.setAttribute("uv",new Et(c,2))}},$K=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0,innerRadiusPercent:38.19,spikes:5,cornerRadius:0,angle:360,extrudeBevelSize:0,extrudeBevelSegments:1},t.parameters);return{shape:t.shape&&t.shape instanceof on?t.shape:new on,parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??0)})}}static build(t){let{width:i,height:r,innerRadiusPercent:n,spikes:a,cornerRadius:s,angle:o,depth:l,extrudeBevelSize:c,extrudeBevelSegments:h}=t.parameters,u=t.shape,d=i*.5,A=r*.5,f=0,m=0,g=o*Math.PI/360/a,p=Math.PI/2*3*-1,v=d*n/100,_=A*n/100;if(a===3&&n===50){g=2*Math.PI/a;for(let w=0;w<a;w++){let b=g*w,E=f+Math.sin(b)*d,M=m+Math.cos(b)*A;u.addPoint(u.createPoint(E,M))}}else for(let w=0;w<a;w++){let b=f+Math.cos(p)*d,E=m+Math.sin(p)*A;u.addPoint(u.createPoint(b,E)),p+=g,b=f+Math.cos(p)*v,E=m+Math.sin(p)*_,u.addPoint(u.createPoint(b,E)),p+=g}u.isClosed=!0;for(let w=0,b=u.points.length;w<b;w++)u.points[w].roundness=s;u.roundness=s,u.update();let y=Lp.create({shape:u,parameters:{roundness:s,depth:l,extrudeBevelSize:c,extrudeBevelSegments:h}});return Object.assign(y,{userData:{...t,type:"StarGeometry"}})}},pIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??0)})}}static build(t){let{width:i,height:r}=t.parameters,n=new zu(i,r);return Object.assign(n,{userData:{...t,type:"TextFrameGeometry"}})}},mIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,radialSegments:32,tubularSegments:64,arc:360,cornerRadius:30,cornerSegments:8},t.parameters),n=Math.abs(r.width),a=Math.abs(r.height??r.width),s=Math.round(Math.abs(r.depth??r.width*.25));return{parameters:Object.assign(r,{width:n,height:a,depth:s})}}static build(t){let{width:i,height:r,depth:n,radialSegments:a,tubularSegments:s,arc:o,cornerRadius:l,cornerSegments:c}=t.parameters,h=gIe(i,r,n,i*.5,o,s,0,0,a,l,c);return h.scale(1,r/i,1),Object.assign(h,{userData:{...t,type:"TorusGeometry"}})}};function gIe(t,i,r,n,a,s,o,l,c,h,u){[i,r]=[r,i],o=i/2;let d=Ct.clamp(a/360,0,1);if(d===0){let A=new Lt;return A.setAttribute("position",new Et([],3)),A}return d===1&&(h=0),new qK(!0,t,i,r,n,d,s,o,l,c,h,u)}var vIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,tubularSegments:64,radialSegments:32,p:2,q:3},t.parameters);return{parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width),depth:Math.abs(r.depth??r.width),tube:r.tube??r.width*.125})}}static build(t){let{width:i,tube:r,tubularSegments:n,radialSegments:a,p:s,q:o}=t.parameters,l=i*.5;l!==r&&(l-=r);let c=new q7(l,r,n,a,s,o);return Object.assign(c,{userData:{...t,type:"TorusKnotGeometry"}})}},_Ie=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,depth:0,spikes:5,cornerRadius:0,extrudeBevelSize:0,extrudeBevelSegments:1,isRect:!1},t.parameters);return{shape:t.shape&&t.shape instanceof on?t.shape:new on,parameters:Object.assign(r,{width:Math.abs(r.width),height:Math.abs(r.height??r.width*(r.isRect?1:Math.sqrt(3)/2)),depth:Math.abs(r.depth??0)})}}static build(t){let{width:i=100,height:r,cornerRadius:n,depth:a,extrudeBevelSize:s,extrudeBevelSegments:o,isRect:l}=t.parameters,c=t.shape,h=i*.5,u=r*.5;l?(c.addPoint(c.createPoint(-h,u)),c.addPoint(c.createPoint(h,-u)),c.addPoint(c.createPoint(-h,-u))):(c.addPoint(c.createPoint(0,u)),c.addPoint(c.createPoint(h,-u)),c.addPoint(c.createPoint(-h,-u))),c.isClosed=!0;for(let A=0,f=c.points.length;A<f;A++)c.points[A].roundness=n;c.roundness=n,c.update();let d=Lp.create({shape:c,parameters:{roundness:n,depth:a,extrudeBevelSize:s,extrudeBevelSegments:o}});return Object.assign(d,{userData:{...t,type:"TriangleGeometry"}})}};function yIe(t,i){let r=2*Math.PI;return(t%r+r)%r===(i%r+r)%r}var EIe=class{add(t,i,r){if(typeof arguments[0]!="string")for(let n in arguments[0])this.add(n,arguments[0][n],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(n){this[n]=this[n]||[],i&&this[n][r?"unshift":"push"](i)},this)}run(t,i){this[t]=this[t]||[],this[t].forEach(function(r){r.call(i&&i.context?i.context:i,i)})}},wIe=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(i=>{if(typeof i!="object"||!i.name||!i.init)throw new Error("Invalid JSEP plugin format");this.registered[i.name]||(i.init(this.jsep),this.registered[i.name]=i)})}},et=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+et.version}static addUnaryOp(t){return et.max_unop_len=Math.max(t.length,et.max_unop_len),et.unary_ops[t]=1,et}static addBinaryOp(t,i,r){return et.max_binop_len=Math.max(t.length,et.max_binop_len),et.binary_ops[t]=i,r?et.right_associative.add(t):et.right_associative.delete(t),et}static addIdentifierChar(t){return et.additional_identifier_chars.add(t),et}static addLiteral(t,i){return et.literals[t]=i,et}static removeUnaryOp(t){return delete et.unary_ops[t],t.length===et.max_unop_len&&(et.max_unop_len=et.getMaxKeyLen(et.unary_ops)),et}static removeAllUnaryOps(){return et.unary_ops={},et.max_unop_len=0,et}static removeIdentifierChar(t){return et.additional_identifier_chars.delete(t),et}static removeBinaryOp(t){return delete et.binary_ops[t],t.length===et.max_binop_len&&(et.max_binop_len=et.getMaxKeyLen(et.binary_ops)),et.right_associative.delete(t),et}static removeAllBinaryOps(){return et.binary_ops={},et.max_binop_len=0,et}static removeLiteral(t){return delete et.literals[t],et}static removeAllLiterals(){return et.literals={},et}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new et(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(i=>i.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return et.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!et.binary_ops[String.fromCharCode(t)]||et.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return et.isIdentifierStart(t)||et.isDecimalDigit(t)}throwError(t){let i=new Error(t+" at character "+this.index);throw i.index=this.index,i.description=t,i}runHook(t,i){if(et.hooks[t]){let r={context:this,node:i};return et.hooks.run(t,r),r.node}return i}searchHook(t){if(et.hooks[t]){let i={context:this};return et.hooks[t].find(function(r){return r.call(i.context,i),i.node}),i.node}}gobbleSpaces(){let t=this.code;for(;t===et.SPACE_CODE||t===et.TAB_CODE||t===et.LF_CODE||t===et.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),i=t.length===1?t[0]:{type:et.COMPOUND,body:t};return this.runHook("after-all",i)}gobbleExpressions(t){let i=[],r,n;for(;this.index<this.expr.length;)if(r=this.code,r===et.SEMCOL_CODE||r===et.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())i.push(n);else if(this.index<this.expr.length){if(r===t)break;this.throwError('Unexpected "'+this.char+'"')}return i}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,et.max_binop_len),i=t.length;for(;i>0;){if(et.binary_ops.hasOwnProperty(t)&&(!et.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!et.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=i,t;t=t.substr(0,--i)}return!1}gobbleBinaryExpression(){let t,i,r,n,a,s,o,l,c;if(s=this.gobbleToken(),!s||(i=this.gobbleBinaryOp(),!i))return s;for(a={value:i,prec:et.binaryPrecedence(i),right_a:et.right_associative.has(i)},o=this.gobbleToken(),o||this.throwError("Expected expression after "+i),n=[s,a,o];i=this.gobbleBinaryOp();){if(r=et.binaryPrecedence(i),r===0){this.index-=i.length;break}a={value:i,prec:r,right_a:et.right_associative.has(i)},c=i;let h=u=>a.right_a&&u.right_a?r>u.prec:r<=u.prec;for(;n.length>2&&h(n[n.length-2]);)o=n.pop(),i=n.pop().value,s=n.pop(),t={type:et.BINARY_EXP,operator:i,left:s,right:o},n.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+c),n.push(a,t)}for(l=n.length-1,t=n[l];l>1;)t={type:et.BINARY_EXP,operator:n[l-1].value,left:n[l-2],right:t},l-=2;return t}gobbleToken(){let t,i,r,n;if(this.gobbleSpaces(),n=this.searchHook("gobble-token"),n)return this.runHook("after-token",n);if(t=this.code,et.isDecimalDigit(t)||t===et.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===et.SQUOTE_CODE||t===et.DQUOTE_CODE)n=this.gobbleStringLiteral();else if(t===et.OBRACK_CODE)n=this.gobbleArray();else{for(i=this.expr.substr(this.index,et.max_unop_len),r=i.length;r>0;){if(et.unary_ops.hasOwnProperty(i)&&(!et.isIdentifierStart(this.code)||this.index+i.length<this.expr.length&&!et.isIdentifierPart(this.expr.charCodeAt(this.index+i.length)))){this.index+=r;let a=this.gobbleToken();return a||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:et.UNARY_EXP,operator:i,argument:a,prefix:!0})}i=i.substr(0,--r)}et.isIdentifierStart(t)?(n=this.gobbleIdentifier(),et.literals.hasOwnProperty(n.name)?n={type:et.LITERAL,value:et.literals[n.name],raw:n.name}:n.name===et.this_str&&(n={type:et.THIS_EXP})):t===et.OPAREN_CODE&&(n=this.gobbleGroup())}return n?(n=this.gobbleTokenProperty(n),this.runHook("after-token",n)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let i=this.code;for(;i===et.PERIOD_CODE||i===et.OBRACK_CODE||i===et.OPAREN_CODE||i===et.QUMARK_CODE;){let r;if(i===et.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==et.PERIOD_CODE)break;r=!0,this.index+=2,this.gobbleSpaces(),i=this.code}this.index++,i===et.OBRACK_CODE?(t={type:et.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},this.gobbleSpaces(),i=this.code,i!==et.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):i===et.OPAREN_CODE?t={type:et.CALL_EXP,arguments:this.gobbleArguments(et.CPAREN_CODE),callee:t}:(i===et.PERIOD_CODE||r)&&(r&&this.index--,this.gobbleSpaces(),t={type:et.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),r&&(t.optional=!0),this.gobbleSpaces(),i=this.code}return t}gobbleNumericLiteral(){let t="",i,r;for(;et.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===et.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);et.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(i=this.char,i==="e"||i==="E"){for(t+=this.expr.charAt(this.index++),i=this.char,(i==="+"||i==="-")&&(t+=this.expr.charAt(this.index++));et.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);et.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return r=this.code,et.isIdentifierStart(r)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(r===et.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===et.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:et.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",i=this.index,r=this.expr.charAt(this.index++),n=!1;for(;this.index<this.expr.length;){let a=this.expr.charAt(this.index++);if(a===r){n=!0;break}else if(a==="\\")switch(a=this.expr.charAt(this.index++),a){case"n":t+=` 7716`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=a}else t+=a}return n||this.throwError('Unclosed quote after "'+t+'"'),{type:et.LITERAL,value:t,raw:this.expr.substring(i,this.index)}}gobbleIdentifier(){let t=this.code,i=this.index;for(et.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,et.isIdentifierPart(t));)this.index++;return{type:et.IDENTIFIER,name:this.expr.slice(i,this.index)}}gobbleArguments(t){let i=[],r=!1,n=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let a=this.code;if(a===t){r=!0,this.index++,t===et.CPAREN_CODE&&n&&n>=i.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(a===et.COMMA_CODE){if(this.index++,n++,n!==i.length){if(t===et.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===et.CBRACK_CODE)for(let s=i.length;s<n;s++)i.push(null)}}else if(i.length!==n&&n!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===et.COMPOUND)&&this.throwError("Expected comma"),i.push(s)}}return r||this.throwError("Expected "+String.fromCharCode(t)),i}gobbleGroup(){this.index++;let t=this.gobbleExpressions(et.CPAREN_CODE);if(this.code===et.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:et.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:et.ARRAY_EXP,elements:this.gobbleArguments(et.CBRACK_CODE)}}},bIe=new EIe;Object.assign(et,{hooks:bIe,plugins:new wIe(et),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});et.max_unop_len=et.getMaxKeyLen(et.unary_ops);et.max_binop_len=et.getMaxKeyLen(et.binary_ops);var v0=t=>new et(t).parse(),SIe=Object.getOwnPropertyNames(et);SIe.forEach(t=>{v0[t]===void 0&&t!=="prototype"&&(v0[t]=et[t])});v0.Jsep=et;var CIe="ConditionalExpression",TIe={name:"ternary",init(t){t.hooks.add("after-expression",function(i){if(i.node&&this.code===t.QUMARK_CODE){this.index++;let r=i.node,n=this.gobbleExpression();if(n||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===t.COLON_CODE){this.index++;let a=this.gobbleExpression();if(a||this.throwError("Expected expression"),i.node={type:CIe,test:r,consequent:n,alternate:a},r.operator&&t.binary_ops[r.operator]<=.9){let s=r;for(;s.right.operator&&t.binary_ops[s.right.operator]<=.9;)s=s.right;i.node.test=s.right,s.right=i.node,i.node=r}}else this.throwError("Expected :")}})}};v0.plugins.register(TIe);var MIe=["+","-","*","/","(",")","==","!=",">","<",">=","<=","and","or","!","%","^",","],xIe=["0","1","2","3","4","5","6","7","8","9","."],RIe=["sin","cos","tan","asin","acos","atan","atan2","sqrt","abs","log","exp","floor","ceil","round","min","max","random"];function BIe(t){return typeof t!="string"?!1:!isNaN(t)&&!isNaN(parseFloat(t))}v0.addBinaryOp("^",11,!0);function eX(t,i,r="number"){let n="";for(let o=0;o<t.length;o++){let l=t[o];if("objType"in l&&l.objType==="api"){let c=JSON.parse(l.id),h=c[0],u=i.getUserAPI(h);if(u!==void 0){let d=u.retrieveValue(c.slice(1));d!==void 0&&(n+=d)}continue}if("objType"in l&&l.objType==="webhook"){let c=JSON.parse(l.id),[h,u]=c,d=i.getUserWebhook(h);if(d!==void 0){let A=d.getParameterValue(u);A!==void 0&&(n+=A)}continue}if("id"in l){let c=t[o-1];if(o>0&&"id"in c){console.error("Two variables in a row",t);return}let h=i.getVariable(l.id),u=ja.getDisplayedValue(h);r==="number"&&ja.isTextValue(h)&&Array.isArray(h.textValue)&&h.textValue.length===1?u=parseFloat(u).toString():r==="boolean"&&ja.isBoolean(h)?u=h?"true":"false":r==="boolean"&&ja.isTextValue(h)&&!Array.isArray(h.textValue)&&(u='"'+u+'"'),n+=u;continue}else if(r==="string"){l.name!=='"'&&(l.name!=="+"||l.escaped)&&(n+=l.name),l.name==="+"&&!l.escaped&&n[n.length-1]==="\\"&&(n=n.slice(0,-1)+l.name);continue}if(l.name==="and"){n+="&&";continue}if(l.name==="or"){n+="||";continue}if(l.name==="True"){n+="true";continue}if(l.name==="False"){n+="false";continue}if(r==="boolean"&&!BIe(l.name)&&!xIe.includes(l.name)&&!MIe.includes(l.name)&&!RIe.includes(l.name.replace(/\($/g,""))){n+='"'+l.name+'"';continue}n+=l.name}if(r==="string")return n;if(t.length===0){if(r==="number")return 0;if(r==="boolean")return!1}let a;try{a=v0(n)}catch(o){console.error(n,o);return}let s;try{s=Qi(a)}catch(o){console.error(n,a,o)}return s}function Qi(t){switch(t.type){case"BinaryExpression":switch(t.operator){case"==":return+(Qi(t.left)===Qi(t.right));case"!=":return+(Qi(t.left)!==Qi(t.right));case">":return+(Qi(t.left)>Qi(t.right));case">=":return+(Qi(t.left)>=Qi(t.right));case"<":return+(Qi(t.left)<Qi(t.right));case"<=":return+(Qi(t.left)<=Qi(t.right));case"+":return Qi(t.left)+Qi(t.right);case"-":return Qi(t.left)-Qi(t.right);case"*":return Qi(t.left)*Qi(t.right);case"/":return Qi(t.left)/Qi(t.right);case"%":return Qi(t.left)%Qi(t.right);case"&&":return Qi(t.left)&&Qi(t.right);case"||":return Qi(t.left)||Qi(t.right);case"^":return Math.pow(Qi(t.left),Qi(t.right));default:throw new Error("Unknown operator: "+t.operator)}case"UnaryExpression":switch(t.operator){case"-":return-Qi(t.argument);case"!":return+!Qi(t.argument);default:throw new Error("Unknown operator: "+t.operator)}case"Identifier":throw new Error("Unknown identifier: "+t.name);case"Literal":return t.value;case"CallExpression":if(t.callee.type==="Identifier"){if(t.callee.name==="random"){let i=0,r=1;if(t.arguments.length>=1)try{i=Qi(t.arguments[0])}catch(n){console.warn(n)}if(t.arguments.length>=2)try{r=Qi(t.arguments[1])}catch(n){console.warn(n)}
7716return i=Math.min(r,i),r=Math.max(r,i),i+Math.random()*(r-i)}return Math[t.callee.name].apply(null,t.arguments.map(Qi))}else throw new Error("Unknown node");default:throw new Error("Unknown node type: "+t.type)}}var IIe=new ht,DIe=new ht;function PIe(t,i,r){let n=[new O,new O,new O],a=[new O,new O,new O];return t.extractBasis(n[0],n[1],n[2]),i.extractBasis(a[0],a[1],a[2]),n.forEach((s,o)=>{let l=a[o],c=Ct.lerp(s.length(),l.length(),r);s.lerp(l,r).setLength(c)}),new ht().makeBasis(n[0],n[1],n[2])}var LIe=class{static create(t){return this.build(this.normalizeInputs(t))}static normalizeInputs(t,i){let r=Object.assign({},(i==null?void 0:i.parameters)??{width:100,height:100,depth:1,subdivisions:12,roundness:0,extrudeBevelSize:0,extrudeBevelSegments:3},t.parameters),n=Math.abs(r.width),a=Math.abs(r.height??r.width),s=Math.abs(r.depth??0),o=(i==null?void 0:i.shapeData)??eU.create({parameters:SK}).userData.shape;return{path:t.path??JC.defaultData(),parameters:Object.assign(r,{width:n,height:a,depth:s,extrusion:{...CK,...r.extrusion}}),shapeData:o}}static build(t){if(t.path.points.length>=2){let i=new OIe(t);return Object.assign(i,{userData:{...t,type:"PathGeometry"}})}else return Object.assign(new Lt,{userData:{...t,type:"PathGeometry"}})}},OIe=class extends Lt{constructor(t){super(),this.type="PathExtrusionGeometry",this.inputs=t,this.build()}_isGeometryClosed(){return this.inputs.path.isClosed&&this.inputs.parameters.extrusion.depth===1}_isOpenEnded(){let t=this.inputs.parameters.extrusion;return!(this.inputs.path.isClosed&&t.depth===1)||!yIe(t.twist,0)||t.startScale!==t.endScale}build(){let t=this._extractPathPoints();if(t.length<2)return;let i=this._computeBasisMatrices(t),{depth:r,offset:n}=this.inputs.parameters.extrusion;r=Math.max(0,Math.min(r,1)),n=Math.max(0,Math.min(n,1));let a=this.inputs.path.isClosed?t.length:t.length-1,s=Math.floor(n*a),o=this.inputs.path.isClosed?Math.ceil((r+n)*a):Math.ceil(Math.min(1,r+n)*a),l=Math.min(Math.max(2,o-s+1),a+2),c=[],h=[];for(let D=0;D<l;D++){let U=this.inputs.path.isClosed?(D+s)%t.length:Math.min(D+s,t.length-1);c.push(t[U].clone()),h.push(i[U].clone())}let u=(D,U,j)=>{c[D]=c[D].clone().lerp(c[U],j),h[D]=PIe(h[D],h[U],j)},d=0,A=n*a%1;(!this.inputs.path.isClosed||r<=1)&&(A||n===0)&&(d=A,u(0,1,d));let f=0,m=(n+r)*a%1;if((this.inputs.path.isClosed&&r<=1||!this.inputs.path.isClosed&&n+r<1)&&m&&(f=m,u(c.length-1,c.length-2,1-f)),r===0){let D=c.length-1;c[D].copy(c[0]),h[D].copy(h[0])}this._applyPathModifiers(h,d,f);let{bevel:g,bevelSides:p}=this.inputs.parameters.extrusion,v=g>0?this.inputs.parameters.extrusion.capType:"flat",_=5;this.inputs.parameters.extrusion.shape.type==="Custom"&&(_=this.inputs.parameters.extrusion.shape.shapeQuality==="low"?5:12);let{regions:y,infos:w,vertices:b}=this._computeShapePoints(_),E=0,M;v==="round"&&(M=new $N(this.inputs.shapeData,2*g,g,_,p,void 0,!0),E=M.getAttribute("position").count);let S=0,T=0;w.sort((D,U)=>D.start-U.start),w.forEach(D=>{D.verticesStart=S,D.verticesCount=D.continuous.reduce((U,j,J)=>U+(J===0||!j?2:1),0),T+=D.verticesCount,S=T});let C=T*l,x,R=0;if(this._isOpenEnded()&&v==="flat"){try{x=oA({windingRule:dr.ODD,elementType:Ln.POLYGONS,polySize:3,vertexSize:2,strict:!0,contours:y})}catch{x=QK}R=x.vertexCount}let L=C+2*R+E*2,I=C+2*R,F={positions:new Float32Array(L*3),normals:new Float32Array(L*3),uvs:new Float32Array(L*2)},Y=[];if(w.forEach(D=>{this._extrudeRegion(D,b,h,c,F,Y,this._isGeometryClosed()&&!this._isOpenEnded())}),x&&(this._closeEnd(x,C,Y,F,h[0],c[0],!1),this._closeEnd(x,C+R,Y,F,h[h.length-1],c[c.length-1],!0)),M){F.positions.set(M.getAttribute("position").array,I*3),F.normals.set(M.getAttribute("normal").array,I*3),F.uvs.set(M.getAttribute("uv").array,I*2);for(let J=I;J<I+E;J++)F.uvs[J*2+1]=1e-4;let D=Y.length;Y.push(...M.getIndex().array.map(J=>J+I)),I+=E,F.positions.set(M.getAttribute("position").array,I*3),F.normals.set(M.getAttribute("normal").array,I*3),F.uvs.set(M.getAttribute("uv").array,I*2);let U=Y.length;Y.push(...M.getIndex().array.map(J=>J+I)),this.setAttribute("position",new ei(F.positions,3)),this.setAttribute("normal",new ei(F.normals,3)),this.setAttribute("uv",new ei(F.uvs,2)),this.setIndex(Y);let j=IIe;j.copy(h[h.length-1]).setPosition(c[c.length-1]),this.applyMatrix4OnRange(j,I,L),j.copy(h[0]).setPosition(c[0]).multiply(DIe.makeScale(1,1,-1)),this.applyMatrix4OnRange(j,I-E,I),this.reverseIndicesOnRange(D,U)}else this.setAttribute("position",new ei(F.positions,3)),this.setAttribute("normal",new ei(F.normals,3)),this.setAttribute("uv",new ei(F.uvs,2)),this.setIndex(Y)}_extractPathPoints(){let t=LK(this.inputs.path).getPoints(this.inputs.path.subdivisions);if(t.length<2)return[];let i=[t[0]];return t.forEach(r=>{i[i.length-1].distanceToSquared(r)>.001&&i.push(r)}),this.inputs.path.isClosed&&i[i.length-1].distanceTo(i[0])<.001&&i.pop(),i}_computeBasisMatrices(t){let i=[],r=t.length,n=this.inputs.path.isClosed,a=new O,s=new O,o=new O,l=new O,c=new O(0,1,0);for(let m=0;m<r;m++){let g=t[m],p;m===0?p=n?t[t.length-2]:g.clone().multiplyScalar(2).sub(t[1]):p=t[m-1];let v;m===r-1?v=n?t[1]:g.clone().multiplyScalar(2).sub(t[m-1]):v=t[m+1];let _=g.clone().sub(p).normalize(),y=v.clone().sub(g).normalize(),w=_.clone().add(y).normalize();o.copy(w),m===0&&(w.equals(c)||w.clone().negate().equals(c))&&c.set(0,0,1);let b=c.clone().cross(w).normalize(),E=w.clone().cross(b).normalize();c.copy(E),l.copy(b),m===0&&(a.copy(E),s.copy(w));let M=new ht().makeBasis(b,E,w);i.push(M)}let h=n?s:o,u=n?a:new O(0,1,0),d=h.clone().cross(l).normalize(),A=Math.acos(u.dot(d));if(isNaN(A))return i;let f=u.clone().cross(d);h.dot(f)>0&&(A*=-1);for(let m=1;m<i.length;m++){let g=new ht().makeRotationZ(A*m/i.length);i[m].multiply(g)}return i}_applyPathModifiers(t,i,r){let n=t.length,{angle:a,twist:s,startScale:o,endScale:l}=this.inputs.parameters.extrusion,c=new ht,h=new ht;return t.forEach((u,d)=>{let A=d===0?0:d===n-1?1:(d-i)/(n-(r===0?0:1)-(i+(1-r)));c.makeRotationZ(Ct.lerp(a,a+s,A)*Ct.DEG2RAD);let f=Ct.lerp(o,l,A);h.makeScale(f,f,f),u.multiply(c).multiply(h)}),t}_computeShapePoints(t=12,i=dr.ODD){let r=this.inputs.shapeData,n=r.extractShapePointsToFlatArray([],t),a=r.shapeHoles.map(h=>{let u=h.extractShapePointsToFlatArray([],t),d=[];for(let A=u.length-1;A>=1;A-=2){let f=u[A-1],m=u[A-0];d.push(f,m)}
7716return d}),s;try{s=oA({windingRule:i,elementType:Ln.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[n]})}catch{s=JN}let o;try{o=oA({windingRule:dr.ODD,elementType:Ln.BOUNDARY_CONTOURS,vertexSize:2,strict:!0,contours:[...a]})}catch{o=zK}if(!s)throw new Error("error generating geometry");let l=s.elementCount;if(o){s.elementCount+=o.elementCount;for(let h=0;h<o.elements.length;h++){let u=o.elements[h],d=h%2===0?s.vertexCount:0;s.elements.push(u+d)}for(let h=0;h<o.vertexIndices.length;h++){let u=o.vertexIndices[h],d=s.vertexCount;s.vertexIndices.push(u+d)}for(let h=0;h<o.vertices.length;h++){let u=o.vertices[h];s.vertices.push(u)}}for(let h=0,u=s.vertexCount;h<u;h++){let d=h*2;s.vertices[d+0],s.vertices[d+1]}let c=[];for(let h=s.elementCount-1;h>=0;h--){let u=h>=l,d=h*2,A=s.elements[d+0],f=s.elements[d+1],m=A+f,g={start:A,count:f,normals:[],isHole:u,continuous:[],verticesStart:0,verticesCount:0};c.push(g);let p=A,v=m-1,_=A+1,y=r.roundedCurves.length;do{let w=p-A;s.vertices[v*2+0],s.vertices[v*2+1];let b=s.vertices[p*2+0],E=s.vertices[p*2+1],M=s.vertices[_*2+0],S=s.vertices[_*2+1],T=b-M,C=E-S,x=Math.sqrt(T*T+C*C);T/=x,C/=x,g.normals[w*2+0]=-C,g.normals[w*2+1]=T;let R=s.vertexIndices[p];if(Array.isArray(R))g.continuous[w]=!1;else{let[L,I]=r.getCurveIndexFromVertexId(R-1,!0);if(I>0&&I<1)g.continuous[w]=!0;else{let F=I===1?L+1:L-1;F=(F+y)%y;let Y=I===1?0:1,D=r.roundedCurves[L].getTangent(I),U=r.roundedCurves[F].getTangent(Y);g.continuous[w]=D.dot(U)>.95}}u&&(g.normals[w*2+0]*=-1,g.normals[w*2+1]*=-1),[v,p,_]=[p,_,_+1],_>=m&&(_-=f)}while(_!==A+1)}return{regions:[n,...a],infos:c,vertices:s.vertices}}_insertVertex(t,i,r,n,a){let s=i*2,o=i*3;t.positions[o+0]=r.x,t.positions[o+1]=r.y,t.positions[o+2]=r.z,t.normals[o+0]=n.x,t.normals[o+1]=n.y,t.normals[o+2]=n.z,t.uvs[s+0]=a.x,t.uvs[s+1]=a.y}_extrudeRegion(t,i,r,n,a,s,o){let l=new O,c=new O,h=new O,u=new O,d=new Me;r.forEach((f,m)=>{let g=n[m],p=t.verticesStart*r.length+t.verticesCount*m;for(let v=0;v<t.count;v++){let _=(t.start+v)*2;if(l.set(i[_+0],i[_+1],0),h.copy(l).applyMatrix4(f).add(g),t.continuous[v])u.set(t.normals[v*2+0],t.normals[v*2+1],0);else{let y=v===0?(t.start+t.count-1)*2:_-2;c.set(i[y+0],i[y+1],0),u.copy(l).sub(c),u.set(-u.y,u.x,0),t.isHole||u.negate()}if(u.applyMatrix4(f).normalize(),d.set(v===0?1:v/t.count,m/(r.length-1)),this._insertVertex(a,p,h,u,d),p++,!t.continuous[v]||v===0){if(v===0)u.set(t.normals[v*2+0],t.normals[v*2+1],0),d.set(0,m/(r.length-1));else{let y=v===t.count-1?t.start*2:_+2;c.set(i[y+0],i[y+1],0),u.copy(c).sub(l),u.set(-u.y,u.x,0),t.isHole||u.negate()}u.applyMatrix4(f).normalize(),this._insertVertex(a,p,h,u,d),p++}}});let A=r.length-1;for(let f=0;f<A;f++){let m=t.verticesStart*r.length+t.verticesCount*f,g=t.verticesStart*r.length+t.verticesCount*(f+1),p=0;for(let v=0;v<t.count;v++){(!t.continuous[v]||v===0)&&p++;let _=v===t.count-1?0:p+1,y=m+p,w=m+_,b=g+_,E=g+p;t.isHole?s.push(y,b,w,y,E,b):s.push(y,w,b,y,b,E),p++}}}_closeEnd(t,i,r,n,a,s,o){let l=t.vertexCount,c=new O(0,0,o?-1:1).applyMatrix4(a),h=new O,u=new Me;for(let A=0;A<l;A++){let f=2*A;h.set(t.vertices[f+0],t.vertices[f+1],0).applyMatrix4(a).add(s),this._insertVertex(n,i+A,h,c,u)}let d=t.elements;for(let A=0;A<t.elementCount;A++){let f=3*A,m=d[f+0]+i,g=d[f+(o?1:2)]+i,p=d[f+(o?2:1)]+i;r.push(m,g,p)}}applyMatrix4OnRange(t,i,r){let n=t.elements,a=new Nn().getNormalMatrix(t).elements,s,o,l,c,h=this.attributes.position,u=this.attributes.normal;if(!h||!u)return;let d=h.array,A=u.array,f=h.itemSize;for(let m=i*f,g=r*f;m<g;m+=f){if(m===i)debugger;s=d[m+0],o=d[m+1],l=d[m+2],c=1/(n[3]*s+n[7]*o+n[11]*l+n[15]),d[m+0]=(n[0]*s+n[4]*o+n[8]*l+n[12])*c,d[m+1]=(n[1]*s+n[5]*o+n[9]*l+n[13])*c,d[m+2]=(n[2]*s+n[6]*o+n[10]*l+n[14])*c,s=A[m+0],o=A[m+1],l=A[m+2],A[m+0]=a[0]*s+a[3]*o+a[6]*l,A[m+1]=a[1]*s+a[4]*o+a[7]*l,A[m+2]=a[2]*s+a[5]*o+a[8]*l}h.needsUpdate=!0,u.needsUpdate=!0}reverseIndicesOnRange(t,i){let r=this.index;if(r){for(let n=t;n<i;n+=3){let a=r.getX(n),s=r.getX(n+1),o=r.getX(n+2);r.setXYZ(n,o,s,a)}r.needsUpdate=!0}}};function tX(){let t=new Lt;return t.setAttribute("position",new ei(new Float32Array([]),3)),t.setIndex(new ei(new Uint16Array([]),1)),t}var NIe=tX().attributes,UIe=12,FIe=1,EL=class extends Lt{constructor(t,i){super(),this.charWidths=[],this.charCoords=[],this.wrappedText=[],this.isLowResolution=!1,this.vectorShapes=[],Object.assign(this.attributes,NIe),this.userData={parameters:t,type:"TextGeometry"};let r=i.getFont(t.font);r!=null&&r.isLoaded?(this.font=r,this.update(t)):this.updateFont(t.font,i).then(()=>{this.update(t),i==null||i.requestRender()})}async updateFont(t,i){let r=i.getFont(t);r&&(this.font=r,await r.loadingPromise)}update(t){let i=this.font;if(this.userData={parameters:t,type:"TextGeometry"},!(i!=null&&i.isLoaded)){console.warn("Cannot update text because its font is not loaded");return}let{width:r,height:n,depth:a,extrudeBevelSize:s,extrudeBevelSegments:o,text:l,textTransform:c}=t,h=ja.getDisplayedValue(l),u=c===2?h.toUpperCase():c===3?h.toLowerCase():h,d=kIe(t,i,u),{shapes:A,charWidths:f,charCoords:m}=i.generateShapes(d,t),g=(typeof r=="number"?r:1)*.5,p=(typeof n=="number"?n:1)*.5,v=A.map(w=>new on().fromShape(w,!0));this.vectorShapes=v;let _=v.map(w=>Lp.create({shape:w,parameters:{depth:a,extrudeBevelSegments:o,extrudeBevelSize:s,windingRule:a<=0?dr.NONZERO:dr.ODD,subdivisions:this.isLowResolution&&a>0?FIe:UIe}})),y=_.length?Nf(_):tX();
7716y.translate(-g,p,0),this.dispose(),this.wrappedText=d,this.charCoords=m,this.charWidths=f,this.deleteAttribute("extrudeNormal"),Object.entries(y.attributes).forEach(([w,b])=>{this.setAttribute(w,b)}),this.setIndex(y.index),this.computeBoundingSphere()}clone(){let t=Sl(new Lt,EL.prototype);return t.copy(this),console.log("CloneGeometry",this,t),t}copy(t){return Object.entries(t.attributes).forEach(([i,r])=>{this.setAttribute(i,r)}),this.setIndex(t.index),this.userData={parameters:{...t.userData.parameters},type:"TextGeometry"},this}async setText(t){this.font&&await this.font.loadingPromise,await this.update({...this.userData.parameters,text:{textValue:t}})}get text(){return this.userData.parameters.text??""}};function kIe(t,i,r){let n=[""],a="";for(let s of r)a+=s,s===" "||s===` 7717`?(n[n.length-1]+=a,a="",s===` 7718`&&n.push("")):i.getTextWidth(n[n.length-1]+a,t)>t.width&&(n[n.length-1].length&&n.push(""),i.getTextWidth(n[n.length-1]+a,t)>t.width&&(a.length===1?(n[n.length-1]+=a,a=""):(n[n.length-1]+=a.slice(0,-1),a=a[a.length-1],n.push(""))));return n[n.length-1]+=a,n}var iX,rX=new Promise(t=>{iX=t}),r6=!1,Bb;function HIe(){if(r6)return;if(Bb)return Bb;async function t(){let i="https://unpkg.com/@splinetool/[email protected]/build",r=VA(()=>import("./process-0cd968c5.js"),[],import.meta.url),[n,a]=await Promise.all([r,fetch(`${i}/process.wasm`).then(l=>l.arrayBuffer())]),s=n.default,o=await s({wasmBinary:a});iX(o),r6=!0}return Bb=t(),Bb}var GIe=["font"];function jy(t,i,r,n){var h,u;let a,s,o;t.type==="PathGeometry"?(s=JSON.parse(JSON.stringify(t)),o=[[],["extrusion"]]):(s={...t},o=[[]]);for(let d of o){let A=s;for(let f of d)A=A[f];for(a in A){let f=A[a];aQ(f)&&!GIe.includes(a)&&(A[a]=i.getVariable(f,[n.uuid,"geometry",...d,a]),aQ(A[a])&&(A[a]=1))}}let l={parameters:s,type:s.type};if(s.type==="PathGeometry")l.path=s.path;else if(s.type==="VectorGeometry"){let d=on.createFromState(s.shape,s.width,s.height);l.shape=d}else if(s.type==="NonParametricGeometry"){if(s.data.groups&&((h=s.data.groups)==null||h.forEach(d=>d.materialIndex=Math.max(d.materialIndex??0,0))),l.geometry=new rY().parse(s),l.geometry.groups.length===0){let d=l.geometry;d.addGroup(0,Math.max(((u=d.getIndex())==null?void 0:u.count)??0,d.getAttribute("position").count),0)}}else if(s.type==="SubdivGeometry"){let d=new Rs(s,r);return d.data=t,d}else{if(s.type==="TextGeometry")return new EL(s,i);if(s.type==="InputGeometry")return new EL(s,i);if(s.type==="UIGeometry")return tU.create({parameters:{width:s.width,height:s.height,cornerRadius:s.cornerRadius,cornerType:s.cornerType}})}let c;try{c=l6(l)}catch(d){console.error(d)}if(!c){let d=on.createFromState(ZC.defaultData(),100,100);l.shape=d,c=l6(l)}return c}var zIe=new ht;function wL(t,i,r,n){let a=t.position.array,s=t.normal.array,o=zIe.makeScale(i,r,n).invert().elements,l,c,h;for(var u=0,d=a.length;u<d;u+=3)a[u]*=i,a[u+1]*=r,a[u+2]*=n,l=s[u],c=s[u+1],h=s[u+2],s[u]=o[0]*l+o[4]*c+o[8]*h,s[u+1]=o[1]*l+o[5]*c+o[9]*h,s[u+2]=o[2]*l+o[6]*c+o[10]*h;t.position.needsUpdate=!0,t.normal.needsUpdate=!0}var Ib=new Sn,Lm=new O,Gt;rX.then(t=>{Gt=t});var n6=new Float32Array([10,10,0,-10,10,0,-10,-10,0,10,-10,0]),a6=new Uint32Array([0,1,2,3]),s6=new Uint8Array([4]),Rs=class extends Lt{constructor(t,i){super(),this.data=t,this.flatShading=i,this.subdivPointer=0,this.rebuild(),this.freeSubdivPointer()}mutateDirectlyScaleBaked(t,i){this.freeSubdivPointer();let r=this.data.scaleBaked,n=ip.div(i,r);this.subdividedGeometry&&wL(this.subdividedGeometry.attributes,...n),this.originalGeometry&&wL(this.originalGeometry.attributes,...n),this.data=t;let a=this.userData.parameters;this.userData.parameters={width:a.width*n[0],height:a.height*n[1],depth:a.depth*n[2]},this.originalGeometry.boundingSphere.center.multiply(Lm.fromArray(n));let s=Lm.set(a.width,a.height,a.depth).length();this.originalGeometry.boundingSphere.radius=s/2}ensureSubdivPointer(){return this.subdivPointer===0&&this.rebuild(),this.subdivPointer}rebuild(){let t,i,r;try{({originalGeometry:t,subdividedGeometry:i,subdivPointer:r}=Rs.build(this.data,void 0,!this.flatShading,void 0))}catch{t=new gc(100,100,100),r=0}this.subdivPointer=r,this.originalGeometry=t,this.subdividedGeometry=i??void 0;let n=this.subdividedGeometry??this.originalGeometry;Object.assign(this,n),this.calcBoundingBox()}freeSubdivPointer(){this.subdivPointer&&(Rs.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0)}dispose(){super.dispose(),this.freeSubdivPointer()}calcBoundingBox(){let t=this.originalGeometry;
7718t.boundingSphere===null&&(t.boundingSphere=new ho,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=t.boundingSphere));let i=t.attributes.position,r=t.boundingSphere.center;Ib.setFromBufferAttribute(i),Ib.getCenter(r),t.boundingSphere.radius=r.distanceTo(Ib.max),isNaN(t.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),Ib.getSize(Lm);let n={width:Lm.x,height:Lm.y,depth:Lm.z};return this.userData.parameters=n,n}static build(t,i,r,n){let a,s,o,l=(t==null?void 0:t.phongAngle)??35;r===!1&&(l=-1),i&&(Gt.free_bvh(i),Gt.free_subdivision_surface(i));try{a=Rs.allocate(t,n)}catch(c){console.error(c,t),a=Rs.allocate({positionWASM:n6,indexWASM:a6,verticesPerFaceWASM:s6},n)}if(Gt.set_destination_refinement_level(a,0),s=Rs.buildLevel(a,!0,l),t.subdivisions>0)try{Gt.set_destination_refinement_level(a,t.subdivisions),o=Rs.buildLevel(a,!1,l)}catch{try{Gt.set_destination_refinement_level(a,t.subdivisions-1),o=Rs.buildLevel(a,!1,l)}catch{o=null}}else o=null;return{subdivPointer:a,originalGeometry:s,subdividedGeometry:o}}static primitiveToQuads(t,i,r){t.widthSegments>16&&(t.widthSegments=16),t.heightSegments>16&&(t.heightSegments=16),t.depthSegments>16&&(t.depthSegments=16),t.radialSegments>16&&(t.radialSegments=16),t.type==="DodecahedronGeometry"&&(t.detail=0);let n=t.shape!==void 0||t.path!==void 0?i.geometry:jy(t,r,!1),a;t.type==="TorusGeometry"&&t.arc===Math.PI*2?a=n.getClosedTorusIndicesForBooleanOrSubdiv():a=n.getIndex();let s,o,l,c;({positions:s,triIndices:c}=CM(n.getAttribute("position"),a));let h;if(t.type==="CylinderGeometry"&&t.cornerRadius===0&&t.hollow===0&&t.openEnded===!1){let u=t.radialSegments*t.heightSegments*3*2,d=u+t.radialSegments*3;h=[u,d]}return{indices:o,verticesPerFace:l}=nX(s,c,n,h),{positions:s,indices:o,verticesPerFace:l}}static allocate(t,i){var y;let r,n,a,s=[],o=[];t.positionWASM&&t.positionWASM.length>0?(r=t.positionWASM,n=t.indexWASM,a=t.verticesPerFaceWASM):(r=n6,n=a6,a=s6);let l=r.length,c=n.length,h=a.length,u=r.length+s.length+o.length,d=n.length+a.length,A=u*Float32Array.BYTES_PER_ELEMENT+d*Uint32Array.BYTES_PER_ELEMENT,f=u*Float32Array.BYTES_PER_ELEMENT,m=Gt._malloc(A),g=new Float32Array(Gt.HEAPF32.buffer,m,u),p=new Uint32Array(Gt.HEAPU32.buffer,m+f,d);g.set(r,0),g.set(s,r.length),g.set(o,r.length+s.length),p.set(n,0),p.set(a,n.length);let v;(y=t==null?void 0:t.scaleBaked)!=null&&y.some(w=>w!==1)&&(v=new ht().makeScale(...t.scaleBaked)),i&&(v?v.premultiply(i):v=i);let _=v?Gt.alloc_subdivision_surface2(m,l,m+f,c,m+f+n.length*Uint32Array.BYTES_PER_ELEMENT,h,v.elements):Gt.alloc_subdivision_surface(m,l,m+f,c,m+f+n.length*Uint32Array.BYTES_PER_ELEMENT,h);return Gt._free(m),_}static buildLevel(t,i,r,n,a){let s=a?Gt.get_mesh_data2(t,i?Gt.Level.CONTROL:Gt.Level.REFINED,r,a.elements):Gt.get_mesh_data(t,i?Gt.Level.CONTROL:Gt.Level.REFINED,r),o=8,l=Gt.HEAPU32.subarray(s>>2,(s>>2)+o),c=l.subarray(4,4+4),h=0,u=Gt.HEAPU32[l[h]>>2],d=Gt.HEAPF32.subarray(u>>2,(u>>2)+c[h]);h++;let A=Gt.HEAPU32[l[h]>>2],f=Gt.HEAPF32.subarray(A>>2,(A>>2)+c[h]);h++;let m=Gt.HEAPU32[l[h]>>2],g=Gt.HEAPU32.subarray(m>>2,(m>>2)+c[h]);h++;let p=Gt.HEAPU32[l[h]>>2],v=Gt.HEAPU32.subarray(p>>2,(p>>2)+c[h]);if(h++,n===void 0){let _=new Lt;if(_.setIndex(new Rg(v,1)),_.setAttribute("position",new Et(d,3)),_.setAttribute("normal",new Et(f,3)),i){_.setAttribute("faceMap",new Rg(g,1));let y=new Float32Array(f.length/3*4).fill(0);_.setAttribute("color",new ei(y,4))}return Gt.free_mesh_data(s),_.userData.type="SubdivGeometry",_}n.getAttribute("position").copyArray(d),n.getAttribute("normal").copyArray(f),n.attributes.position.needsUpdate=!0,n.attributes.normal.needsUpdate=!0,Gt.free_mesh_data(s)}static freeSubdivPointer(t){Gt.free_bvh(t),Gt.free_subdivision_surface(t)}static buildControlCageWireframe(t,i,r){let n=Gt.get_wireframe_data_for_base_level(t),a=4,s=Gt.HEAPU32.subarray(n>>2,(n>>2)+a),o=s.subarray(2,2+2),l=0,c=Gt.HEAPU32[s[l]>>2],h=Gt.HEAPF32.subarray(c>>2,(c>>2)+o[l]);l++;let u=Gt.HEAPU32[s[l]>>2],d=Gt.HEAPU32.subarray(u>>2,(u>>2)+o[l]);if(i===void 0){let A=new Lt;A.setAttribute("position",new Et(h,3));let f=new Float32Array(h.length);for(let m=0,g=h.length;m<g;)f[m++]=r.r,f[m++]=r.g,f[m++]=r.b;
7718return A.setAttribute("color",new ei(f,3)),A.setIndex(new Rg(d,1)),Gt.free_wireframe_data_for_base_level(n),A}i.getAttribute("position").copyArray(h),i.attributes.position.needsUpdate=!0,Gt.free_wireframe_data_for_base_level(n)}static updateCollabMesh(t,i,r){let n=i===0;n||Gt.set_destination_refinement_level(t,i);let a=r?Gt.get_topological_data2(t,n?Gt.Level.CONTROL:Gt.Level.REFINED,r.elements):Gt.get_topological_data(t,n?Gt.Level.CONTROL:Gt.Level.REFINED),s=6,o=Gt.HEAPU32.subarray(a>>2,(a>>2)+s),l=o.subarray(3,3+3),c=0,h=Gt.HEAPU32[o[c]>>2],u=new Float32Array(Gt.HEAPF32.subarray(h>>2,(h>>2)+l[c]));c++;let d=Gt.HEAPU32[o[c]>>2],A=new Uint32Array(Gt.HEAPU32.subarray(d>>2,(d>>2)+l[c]));c++;let f=Gt.HEAPU32[o[c]>>2],m=new Uint8Array(Gt.HEAPU32.subarray(f>>2,(f>>2)+l[c]));return Gt.free_topological_data(a),{positions:u,indices:A,verticesPerFace:m}}},o6=["getX","getY","getZ"];function CM(t,i){let r={},n=i?i.count:t.count,a=0,s=[],o=[],l=1e4;for(let h=0;h<n;h++){let u=i?i.getX(h):h,d="";for(let A=0;A<3;A++)d+=`${~~(t[o6[A]](u)*l)},`;if(d in r)s.push(r[d]);else{for(let A=0;A<3;A++)o.push(t[o6[A]](u));r[d]=a,s.push(a),a++}}let c=[];for(let h=0;h<s.length;h+=3)s[h]===s[h+1]||s[h]===s[h+2]||s[h+1]===s[h+2]||c.push(s[h],s[h+1],s[h+2]);return{positions:o,triIndices:c}}var Db=new O,PI=new O,LI=new O,OI=new O;function nX(t,i,r,n){let a=[],s=[];if(r.userData.shape!==void 0&&r.userData.parameters.depth===0&&r.userData.shape.shapeHoles.length===0){let c=r.userData.shape.extractShapePointsToFlatArray([]),h=r.userData.parameters.spikes;if(r.userData.type==="EllipseGeometry"&&h<=24&&h%4===0&&r.userData.parameters.angle>=360){let A=c.length/2/h;c=c.filter((f,m)=>Math.floor(m/2)%A===0)}let u=0;for(let A=0;A<c.length;A+=2)u+=(c[A]-c[(A===0?c.length:A)-2])*(c[A+1]+c[(A===0?c.length:A)-1]);t.length=0;let d=0;if(u<0)for(let A=0;A<c.length;A+=2)t.push(c[A],c[A+1],0),a.push(d++);else for(let A=c.length-2;A>=0;A-=2)t.push(c[A],c[A+1],0),a.push(d++);return s.push(d),{indices:a,verticesPerFace:s}}let o=new Float32Array([r.userData.parameters.depth])[0],l=0;for(;l<i.length;){if(r.useNgonForTopBottomFaceDuringBake){let c=0;if((t[i[l]*3+2]===o||t[i[l]*3+2]===0)&&c++,(t[i[l+1]*3+2]===o||t[i[l+1]*3+2]===0)&&c++,(t[i[l+2]*3+2]===o||t[i[l+2]*3+2]===0)&&c++,c===3)break}if(i[l+1]===i[l+3]&&i[l+2]===i[l+5]||i[l+0]===i[l+3]&&i[l+2]===i[l+4]){Db.set(t[i[l]*3],t[i[l]*3+1],t[i[l]*3+2]),PI.set(t[i[l+1]*3],t[i[l+1]*3+1],t[i[l+1]*3+2]),LI.set(t[i[l+4]*3],t[i[l+4]*3+1],t[i[l+4]*3+2]),OI.set(t[i[l+5]*3],t[i[l+5]*3+1],t[i[l+5]*3+2]),PI.sub(Db).normalize(),LI.sub(Db).normalize(),OI.sub(Db).normalize();let c=PI.cross(LI).dot(OI);Math.abs(c)>.005||n&&n.some((h,u)=>u%2===1?!1:l>=n[u]&&l<n[u+1])?(a.push(i[l],i[l+1],i[l+2]),s.push(3),l+=3):(a.push(i[l],i[l+1],i[l+4],i[l+5]),s.push(4),l+=6)}else a.push(i[l],i[l+1],i[l+2]),s.push(3),l+=3}if(r.useNgonForTopBottomFaceDuringBake){let c=[],h=[],u=0;for(let d=0,A=0;d<t.length;d+=3,A++)t[d+2]===0&&(c.push(A),u++),t[d+2]===o&&h.push(A);if(r.userData.parameters.extrudeBevelSize===0){let d=h[0];h[0]=h[1],h[1]=d}c.reverse(),a.push(...c,...h),s.push(u,u)}return{indices:a,verticesPerFace:s}}var nu={};XAe(nu,{calcBoolean:()=>YIe,calcBooleanTopological:()=>jIe,freeMeshSet:()=>ZIe,getMeshSet:()=>KIe,hasOpenEdges:()=>XIe,transformMeshSet:()=>qIe});var aX,QIe=new Promise(t=>{aX=t}),Pb;function VIe(){if(Pb)return Pb;async function t(){let i="https://unpkg.com/@splinetool/[email protected]/build",r=VA(()=>import("./boolean-f0a11cc6.js"),[],import.meta.url),[n,a]=await Promise.all([r,fetch(`${i}/boolean.wasm`).then(l=>l.arrayBuffer())]),s=n.default,o=await s({wasmBinary:a});aX(o)}return Pb=t(),Pb}var xi,Ng;QIe.then(t=>xi=t);function WIe(t,i,r){let n,a;t.userData.parameters.type==="TorusGeometry"&&t.userData.parameters.arc===Math.PI*2?a=t.getClosedTorusIndicesForBooleanOrSubdiv():a=t.getIndex();let{positions:s,triIndices:o}=CM(t.getAttribute("position"),a),l;if(i&&r){let{indices:c,verticesPerFace:h}=nX(s,o,t);l=h.length,n=[];for(let u=0,d=0;u<l;u++){n.push(h[u]);for(let A=0;A<h[u];A++)n.push(c[d++])}}else{let c=o.length;n=Array(c+c/3),l=0;for(let h=0,u=0;u<n.length;)n[u++]=3,l++,n[u++]=o[h++],n[u++]=o[h++],n[u++]=o[h++]}return{positions:s,faceIndices:n,nFaces:l}}function sX(t){let i=t.length,r=i*Uint32Array.BYTES_PER_ELEMENT,n=i*Float32Array.BYTES_PER_ELEMENT,a=Number.isInteger(t[0])?r:n,s=xi._malloc(a);return(Number.isInteger(t[0])?new Uint32Array(xi.HEAPU32.buffer,s,i):new Float32Array(xi.HEAPF32.buffer,s,i)).set(t,0),s}function oX(t){switch(t){case 0:return xi.OP.UNION;case 1:return xi.OP.INTERSECTION;case 2:return xi.OP.A_MINUS_B;case 3:return xi.OP.B_MINUS_A;case 4:return xi.OP.SYMMETRIC_DIFFERENCE;case 5:return xi.OP.ALL;default:throw new Error("Unknown boolean operation "+t)}}function jIe(t,i){Ng===void 0&&(Ng=xi.init_csg());let r=sX(t),n=xi.csg_calc_topological(Ng,r,t.length,oX(i));xi._free(r);let a=6,s=xi.HEAPU32.subarray(n>>2,(n>>2)+a),o=s.subarray(3,3+3),l=0,c=xi.HEAPU32[s[l]>>2],h=new Float32Array(xi.HEAPF32.subarray(c>>2,(c>>2)+o[l]));l++;let u=xi.HEAPU32[s[l]>>2],d=new Uint32Array(xi.HEAPU32.subarray(u>>2,(u>>2)+o[l]));l++;
7718let A=xi.HEAPU32[s[l]>>2],f=new Uint8Array(xi.HEAPU32.subarray(A>>2,(A>>2)+o[l]));return xi.free_mesh_data(n),{positions:h,indices:d,verticesPerFace:f}}function YIe(t,i,r,n){Ng===void 0&&(Ng=xi.init_csg());let a=sX(t),s=xi.csg_calc(Ng,a,t.length,n,oX(i));xi._free(a);let o=5,l=xi.HEAPU32.subarray(s>>2,(s>>2)+o),c=l.subarray(2,2+3),h=0,u=xi.HEAPU32[l[h]>>2],d=xi.HEAPF32.subarray(u>>2,(u>>2)+c[h]);h++;let A=xi.HEAPU32[l[h]>>2],f=xi.HEAPF32.subarray(A>>2,(A>>2)+c[h]);h++;let m=c[h];r.setAttribute("position",new Et(d,3)),r.setAttribute("normal",new Et(f,3));let g=xi.HEAPF32.subarray((s>>2)+5,(s>>2)+5+6);return r.boundingSphere===null&&(r.boundingSphere=new ho),r.boundingSphere.center.set(g[0],g[1],g[2]),r.boundingSphere.radius=(g[3]**2+g[4]**2+g[5]**2)**.5,r.userData.parameters={width:g[3]*2,height:g[4]*2,depth:g[5]*2},xi.free_mesh_data(s),m}function KIe(t,i,r){if(xi===void 0)return-1;let n,a,s;if(i&&t.userData.positions!==void 0){let p=t.userData;s=p.verticesPerFace.length,n=p.positions,a=Array(p.verticesPerFace.reduce((v,_)=>v+_,0)+s);for(let v=0,_=0,y=0;v<p.verticesPerFace.length;v++){a[y++]=p.verticesPerFace[v];for(let w=0;w<p.verticesPerFace[v];w++)a[y++]=p.indices[_++]}}else({positions:n,faceIndices:a,nFaces:s}=WIe(t,i,r));let o=n.length,l=a.length,c=n.length,h=a.length,u=c*Float32Array.BYTES_PER_ELEMENT+h*Uint32Array.BYTES_PER_ELEMENT,d=c*Float32Array.BYTES_PER_ELEMENT,A=xi._malloc(u),f=new Float32Array(xi.HEAPF32.buffer,A,c),m=new Uint32Array(xi.HEAPU32.buffer,A+d,h);f.set(n,0),m.set(a,0);let g=xi.get_csg_mesh(A,o,A+d,l,s);return xi._free(A),g}function XIe(t){return xi.has_open_edges(t)}function qIe(t,i){xi.transform_csg_mesh(t,i.elements)}function ZIe(t){xi.free_csg_mesh(t)}var JIe={ConeGeometry:gBe,CubeGeometry:vBe,CylinderGeometry:OK,DodecahedronGeometry:yBe,EllipseGeometry:eU,HelixGeometry:JBe,IcosahedronGeometry:$Be,LatheGeometry:eIe,NonParametricGeometry:oIe,PolygonGeometry:JK,PyramidGeometry:lIe,RectangleGeometry:tU,SphereGeometry:uIe,PlaneGeometry:dIe,BackdropGeometry:AIe,StarGeometry:$K,TextFrameGeometry:pIe,TorusGeometry:mIe,TorusKnotGeometry:vIe,TriangleGeometry:_Ie,PathGeometry:LIe,VectorGeometry:Lp},l6=t=>JIe[t.type].create(t);function Om(t){return t!==null&&"booleanOp"in t}var lX=class extends KN(Zr){constructor(){super(...arguments),this.booleanMeshSetAddress=-1,this.booleanWasTransformed=!1,this.booleanMatrixInvOld=new ht}updateVisible(t){super.updateVisible(t),this.visible=!Om(this.parent)&&this.visible,Om(this.parent)&&this.parent.invalidateDownstreamBooleanData()}freeBooleanPointer(){this.booleanMeshSetAddress!==-1&&(nu.freeMeshSet(this.booleanMeshSetAddress),this.booleanMeshSetAddress=-1)}invalidateDownstreamBooleanData(t=!1){return t?this.booleanWasTransformed=!0:this.freeBooleanPointer(),Om(this.parent)?this.parent.invalidateDownstreamBooleanData():this}invalidateUpstreamBooleanData(){this.freeBooleanPointer();for(let t of this.children)t instanceof lX&&(t.freeBooleanPointer(),Om(t)&&t.invalidateUpstreamBooleanData())}updateTransformState(t,i){let r=super.updateTransformState(t,i);return r&&Om(this.parent)&&this.invalidateDownstreamBooleanData(!0),r}onVariableUpdate(t=!1){super.onVariableUpdate(t),Om(this.parent)&&this.invalidateDownstreamBooleanData(!0)}},Lb=new Sn;function iU(t,i=0,r=t.count,n,a){let s=1/0,o=1/0,l=1/0,c=-1/0,h=-1/0,u=-1/0;for(let d=i;d<r;d++){let A=t.getX(d),f=t.getY(d),m=t.getZ(d);A<s&&(s=A),f<o&&(o=f),m<l&&(l=m),A>c&&(c=A),f>h&&(h=f),m>u&&(u=m)}Lb.min.set(s,o,l),Lb.max.set(c,h,u),Lb.getCenter(n),Lb.getSize(a).multiplyScalar(.5)}var $Ie=new Lt,e2e=new Gu,zs=class extends lX{constructor(t,i){super($Ie,e2e),this.super_Entity(t,i)}updateState(t,i){this.updateState_Entity(t,i)}updateEntityBoxSize(t,i){let r=this.geometry.getAttribute("position");r!==void 0?iU(r,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:r.count,t,i):super.updateEntityBoxSize(t,i)}},kd=class{constructor(t){if(this.hashProperties=void 0,this.isNode=!0,this.shortcuts={},kd.uuidContext===null)throw new Error("plz startContext");kd.uuidContext===kd.globalContext?this.uuid="_gid"+kd.uuidContext.nodeContextUuid++:this.uuid="_uid"+kd.uuidContext.nodeContextUuid++,this.type=t,this.name=""}static startContext(t){this.uuidContext===null||this.uuidContext===kd.globalContext?this.uuidContext=t:console.error("Can't start context twice")}static endContext(t){this.uuidContext!==t&&console.error("Can't end context twice"),this.uuidContext=null}analyze(t,i){i=i??{}
vendor: 6,040 bytes, line 7718
7718,t.analyzing=!0,this.build(t.addFlow(i.slot,i.cache,i.context),"v4"),t.clearVertexNodeCode(),t.clearFragmentNodeCode(),t.removeFlow(),t.analyzing=!1}analyzeAndFlow(t,i,r){return r=r??{},this.analyze(t,r),this.flow(t,i,r)}flow(t,i,r){r=r??{},t.addFlow(r.slot,r.cache,r.context);let n={result:this.build(t,i),code:t.clearNodeCode(),extra:t.context.extra};return t.removeFlow(),n}build(t,i,r){i=i??this.getType(t,i);let n=t.getNodeData(r??this);return t.analyzing&&this.appendDepsNode(t,n,i),t.nodes.indexOf(this)===-1&&t.nodes.push(this),this.updateFrame!==void 0&&t.updaters.indexOf(this)===-1&&t.updaters.push(this),this.generate(t,i,r)}updateFrame(t){}generateReadonly(t,i,r,n,a,s){return""}generate(t,i,r,n,a){return""}parse(t,i,r,n){}appendDepsNode(t,i,r){i.deps=(i.deps||0)+1;let n=t.getTypeLength(r);(n>(i.outputMax||0)||this.getType(t,r))&&(i.outputMax=n,i.output=r)}setName(t){this.name=t}getName(){return this.name}getType(t,i){return i==="sampler2D"||i==="samplerCube"?i:this.type}},Yn=kd;Yn.globalContext={nodeContextUuid:0},Yn.uuidContext=kd.globalContext;var c6=class{constructor(t){t=t??{},this.name=t.name,this.type=t.type,this.node=t.node,this.size=t.size,this.needsUpdate=t.needsUpdate}get value(){return this.node.value}set value(t){this.node.value=t}},t2e=class{constructor(){this.nodes={},this.keywords={}}add(t){this.nodes[t.name]=t}addKeyword(t,i,r){r=r!==void 0?r:!0,this.keywords[t]={callback:i,cache:r}}remove(t){delete this.nodes[t.name]}removeKeyword(t){delete this.keywords[t]}get(t){return this.nodes[t]}getKeyword(t,i){return this.keywords[t].callback(i)}getKeywordData(t){return this.keywords[t]}contains(t){return this.nodes[t]!==void 0}containsKeyword(t){return this.keywords[t]!==void 0}},ro=new t2e,fr=class extends Yn{constructor(t,i){super(t),this.scope="",i=i??{},this.shared=i.shared!==void 0?i.shared:!0,this.unique=i.unique!==void 0?i.unique:!1}build(t,i,r,n){if(i=i??this.getType(t),this.getShared(t,i)){let a=this.getUnique(t,i);a&&this.uuid===void 0&&(this.uuid=Ct.generateUUID()),r=t.getUUID(r??this.getUUID(),!a);let s=t.getNodeData(r),o=s.output||this.getType(t);if(t.analyzing)return(s.deps||0)>0||this.getLabel()?(this.appendDepsNode(t,s,i),this.generate(t,i,r)):super.build(t,i,r);if(a)return s.name=s.name||super.build(t,i,r),s.name;if(!this.getLabel()&&(!this.getShared(t,o)||t.context.ignoreCache||s.deps===1))return super.build(t,i,r);r=this.getUUID(!1);let l=this.getTemp(t,r);if(l)return t.format(l,o,i);{l=super.generate(t,i,r,s.output,n);let c=this.generate(t,o,r);return t.addNodeCode(l+" = "+c+";"),t.format(l,o,i)}}return super.build(t,i,r)}getShared(t,i){return i!=="sampler2D"&&i!=="samplerCube"&&this.shared}getUnique(t,i){return this.unique}setLabel(t){return this.label=t,this}getLabel(){return this.label}getUUID(t){let i=this.uuid;return typeof this.scope=="string"&&(i=this.scope+"-"+i),i}getTemp(t,i){i=i||this.uuid;let r=t.getVars()[i];return r?r.name:void 0}generate(t,i,r,n,a){return this.getShared(t,i)||console.error("TempNode is not shared"),r=r??this.uuid,t.getTempVar(r,n??this.getType(t),a,this.getLabel()).name}},go=class extends fr{constructor(t,i){i=i??{},i.shared=i.shared!==void 0?i.shared:!1,super(t,i),this.readonly=!1}setReadonly(t){return this.readonly=t,this.hashProperties=this.readonly?["value"]:void 0,this}getReadonly(){return this.readonly}generate(t,i,r,n,a,s){r=t.getUUID(r??this.getUUID()),n=n??this.getType(t);let o=t.getNodeData(r);return this.getReadonly()&&this.generateReadonly!==void 0?this.generateReadonly(t,i,r,n,a,s):t.isShader("vertex")?(o.vertex||(o.vertex=t.createVertexUniform(n,this,a,s,this.getLabel())),t.format(o.vertex.name,n,i)):(o.fragment||(o.fragment=t.createFragmentUniform(n,this,a,s,this.getLabel())),t.format(o.fragment.name,n,i))}},La=class extends go{constructor(t=0,i){super("v2"),this.nodeType="Vector2",this.value=t instanceof Me?t:new Me(t,i)}get x(){return this.value.x}set x(t){this.value.x=t}get y(){return this.value.y}set y(t){this.value.y=t}generateReadonly(t,i,r,n,a,s){return t.format("vec2("+this.value.x+", "+this.value.y+")",n,i)}},Ko=class extends go{constructor(t=0,i,r){super("v3"),this.nodeType="Vector3",this.value=t instanceof O?t:new O(t,i,r)}get x(){return this.value.x}set x(t){this.value.x=t}get y(){return this.value.y}set y(t){this.value.y=t}get z(){return this.value.z}set z(t){this.value.z=t}generateReadonly(t,i,r,n,a,s){return t.format("vec3("+this.value.x+", "+this.value.y+", "+this.value.z+")",n,i)}},Xa=class extends Ht{constructor(t,i,r,n){super(t,i,r),this.isColorA=!0,this.a=n}setRGBA(t,i,r,n){super.setRGB(t,i,r),this.a=n}copy(t){return super.copy(t),this.a="a"in t?t.a:1,this}clone(){return new this.constructor(this.r,this.g,this.b,this.a)}equals(t){return super.equals(t)&&this.a===t.a}setStyle(t,i="srgb"){let r;if(t==="transparent")return this.setRGBA(0,0,0,0),this;if(r=/^((?:rgb|hsl)a?)\(([^)]*)\)/.exec(t)){let n,a=r[1],s=r[2];switch(a){case"rgb":case"rgba":if(n=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.a=a==="rgba"?parseFloat(n[4]):1,super.setStyle(t,i);break;case"hsl":case"hsla":if(n=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)%\s*,\s*(\d*\.?\d+)%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))return this.a=a==="hsla"?parseFloat(n[4]):1,super.setStyle(t,i);break}}return super.setStyle(t,i)}get x(){return this.r}get y(){return this.g}get z(){return this.b}get w(){return this.a}set x(t){this.r=t}set y(t){this.g=t}set z(t){this.b=t}set w(t){this.a=t}},au=class extends go{constructor(t){super("v4"),this.nodeType="Vector4",this.value=t instanceof Xa?t:new Xa(t.r,t.g,t.b,t.a)}generateReadonly(t,i,r,n,a,s){return t.format("vec4("+this.value.r+", "+this.value.g+", "+this.value.b+", "+this.value.a+")",n,i)}},i2e=/^\s*([a-z_0-9]+)\s([a-z_0-9]+)\s*\((.*?)\)/i,h6=/[a-z_0-9]+/gi,yt=class extends fr{constructor(t,i,r,n,a){super(a),this.src="",this.nodeType="Function",this.useKeywords=!0,this.includes=[],this.extensions={},this.keywords={},this.isMethod=a===void 0,this.isInterface=!1,this.parse(t,i,r,n)}getShared(t,i){return!this.isMethod}
7718getType(t){return t.getTypeByFormat(this.type)}getInputByName(t){if(this.inputs){let i=this.inputs.length;for(;i--;)if(this.inputs[i].name===t)return this.inputs[i]}}getIncludeByName(t){if(this.includes){let i=this.includes.length;for(;i--;)if(this.includes[i].name===t)return this.includes[i]}}generate(t,i,r,n,a){let s,o=0,l=this.src;if(this.includes)for(let h=0;h<this.includes.length;h++)t.include(this.includes[h],this);for(let h in this.extensions)t.extensions[h]=!0;let c=[];for(;s=h6.exec(this.src);)c.push(s);for(let h=0;h<c.length;h++){let u=c[h],d=u[0],A=this.isMethod?!this.getInputByName(d):!0,f=d;if(this.keywords[d]||this.useKeywords&&A&&ro.containsKeyword(d)){let m=this.keywords[d];if(!m){let g=ro.getKeywordData(d);g.cache&&(m=t.keywords[d]),m=m||ro.getKeyword(d,t),g.cache&&(t.keywords[d]=m)}f=m.build(t)}d!==f&&l[u.index+o-1]!=="."&&(l=l.substring(0,u.index+o)+f+l.substring(u.index+d.length+o),o+=f.length-d.length),this.getIncludeByName(f)===void 0&&ro.contains(f)&&t.include(ro.get(f))}return i==="source"?l:this.isMethod?(this.isInterface||t.include(this,void 0,l),this.name):t.format("( "+l+" )",this.getType(t),i)}parse(t,i,r,n){if(this.src=t||"",this.includes=i??[],this.extensions=r??{},this.keywords=n??{},this.isMethod){let a=i2e.exec(this.src);if(this.inputs=[],a&&a.length==4){this.type=a[1],this.name=a[2];let s=a[3].match(h6);if(s){let o=0;for(;o<s.length;){let l=s[o++],c;l==="in"||l==="out"||l==="inout"?c=s[o++]:(c=l,l="");let h=s[o++];this.inputs.push({name:h,type:c,qualifier:l})}}this.isInterface=this.src.indexOf("{")===-1}else this.type="",this.name=""}}},r2e=/^([a-z_0-9]+)\s([a-z_0-9]+)\s?\=?\s?(.*?)(\;|$)/i,cX=class extends fr{constructor(t="",i){super(),this.src="",this.useDefine=!1,this.nodeType="Const",this.parse(t||cX.PI,void 0,void 0,void 0,i)}getType(t){return t.getTypeByFormat(this.type)}parse(t,i,r,n,a){this.src=t||"";let s,o,l="",c=r2e.exec(t);this.useDefine=a??this.src.charAt(0)==="#",c&&c.length>1?(o=c[1],s=c[2],l=c[3]):(s=this.src,o="f"),this.name=s,this.type=o,this.value=l}build(t,i){if(i==="source"){if(this.value)return this.useDefine?"#define "+this.name+" "+this.value:"const "+this.type+" "+this.name+" = "+this.value+";";if(this.useDefine)return this.src}return t.include(this),t.format(this.name,this.getType(t),i)}generate(t,i,r,n,a){return t.format(this.name,this.getType(t),i)}},hr=cX;hr.PI="PI",hr.PI2="PI2",hr.RECIPROCAL_PI="RECIPROCAL_PI",hr.RECIPROCAL_PI2="RECIPROCAL_PI2",hr.LOG2="LOG2",hr.EPSILON="EPSILON";var n2e=new RegExp(`^structs*([a-z_0-9]+)s*{s*((.| 7719)*?)}`,"gim"),a2e=new RegExp("s*(w*?)s*(w*?)(=|;)","gim"),hX=class extends fr{constructor(t=""){super(),this.inputs=[],this.src="",this.nodeType="Struct",this.parse(t)}getType(t){return t.getTypeByFormat(this.name)}getInputByName(t){let i=this.inputs.length;for(;i--;)if(this.inputs[i].name===t)return this.inputs[i]}generate(t,i,r,n,a){return i==="source"?this.src+";":t.format("( "+this.src+" )",this.getType(t),i)}parse(t=""){this.src=t,this.inputs=[];let i=n2e.exec(t);if(i){let r=i[2],n;for(;n=a2e.exec(r);)this.inputs.push({type:n[1],name:n[2]});this.name=i[1]}else this.name="";this.type=this.name}},rU=class extends fr{constructor(t){super("v2",{shared:!1}),this.nodeType="UV",this.index=t??0}generate(t,i){t.requires.uv[this.index]=!0;let r=this.index>0?this.index+1:"",n=t.isShader("vertex")?"uv"+r:"vUv"+r;return t.format(n,this.getType(t),i)}};ro.addKeyword("uv",function(){return new rU});ro.addKeyword("uv2",function(){return new rU(1)});var rg=class extends fr{constructor(t,i){super("v4"),this.nodeType="ColorSpace",this.input=t,this.method=i??rg.LINEAR_TO_LINEAR,this.hashProperties=["method"]}static getEncodingComponents(t){switch(t){case mc:return["Linear"];case gi:return["sRGB"];default:return[]}}generate(t,i){var o;let r=this.input.build(t,"v4"),n=this.getType(t),a=rg.Nodes[this.method],s=t.include(a);if(s===rg.LINEAR_TO_LINEAR)return t.format(r,n,i);if(((o=a.inputs)==null?void 0:o.length)===2){let l=this.factor.build(t,"f");return t.format(s+"( "+r+", "+l+" )",n,i)}else return t.format(s+"( "+r+" )",n,i)}fromEncoding(t){let i=rg.getEncodingComponents(t);this.method="LinearTo"+i[0],this.factor=i[1]}fromDecoding(t){let i=rg.getEncodingComponents(t);this.method=i[0]+"ToLinear",this.factor=i[1]}},th=rg;th.Nodes={LinearToLinear:new yt(["vec4 LinearToLinear( in vec4 value ) {"," return value;","}"].join(` 7720`)),sRGBToLinear:new yt(["vec4 sRGBToLinear( in vec4 value ) {"," return 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.w );","}"].join(` 7721`)),LinearTosRGB:new yt(["vec4 LinearTosRGB( in vec4 value ) {"," return 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.w );","}"].join(` 7722`))},th.LINEAR_TO_LINEAR="LinearToLinear",th.SRGB_TO_LINEAR="sRGBToLinear",th.LINEAR_TO_SRGB="LinearTosRGB";var Pr=class extends yt{constructor(t="",i,r,n,a){super(t,a,n,r,i),this.nodeType="Expression"}},gu=class extends go{constructor(t=new en,i,r,n){super("v4",{shared:!0}),this.nodeType="Texture",this.value=t,this.uv=i??new rU,this.bias=r,this.project=n!==void 0?n:!1}getTexture(t,i){return super.generate(t,i,this.value.uuid,"t")}generate(t,i){if(i==="sampler2D")return this.getTexture(t,i);
vendor: 10,485 bytes, lines 7722-7801
7722let r=this.getTexture(t,i),n=this.uv.build(t,this.project?"v4":"v2"),a=this.bias?this.bias.build(t,"f"):void 0;a===void 0&&t.context.bias&&(a=t.context.bias.setTexture(this).build(t,"f"));let s,o;this.project?s="texture2DProj":s=a?"tex2DBias":"tex2D",a?o=s+"( "+r+", "+n+", "+a+" )":o=s+"( "+r+", "+n+" )";let l={include:t.isShader("vertex"),ignoreCache:!0},c=this.getType(t);return t.addContext(l),this.colorSpace=this.colorSpace??new th(new Pr("",c)),this.colorSpace.fromDecoding(t.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(o),o=this.colorSpace.build(t,c),t.removeContext(),t.format(o,c,i)}},Tt=class extends go{constructor(t){super("f"),this.nodeType="Float",this.value=t??0}generateReadonly(t,i,r,n,a,s){return t.format(this.value+(this.value%1?"":".0"),n,i)}},u6=class extends fr{constructor(t,i){super(),this.inputs=[],this.nodeType="FunctionCall",this.value=t,this.inputs=i??[]}getFunction(){return this.value}getType(t){return this.value.getType(t)}generate(t,i,r,n,a){n=this.getType(t);let s=this.value,o=s.build(t,i)+"( ",l=[];if(s.inputs){for(let c=0;c<s.inputs.length;c++){let h=s.inputs[c],u=this.inputs[c]||this.inputs[h.name];l.push(u.build(t,t.getTypeByFormat(h.type)))}o+=l.join(", ")+" )"}return t.format(o,n,i)}},uX=class extends fr{constructor(t,i,r=uX.ADD){super(),this.nodeType="Operator",this.type=t.type,this.a=t,this.b=i,this.op=r}getType(t){let i=this.a.getType(t),r=this.b.getType(t);return t.isTypeMatrix(i)?"v4":t.getTypeLength(r)>t.getTypeLength(i)?r:i}generate(t,i){let r=this.getType(t);this.type=r;let n=this.a.build(t,r),a=this.b.build(t,r);return t.format("( "+n+" "+this.op+" "+a+" )",r,i)}},qs=uX;qs.ADD="+",qs.SUB="-",qs.MUL="*",qs.DIV="/";var cr=class extends fr{constructor(t,i=cr.ABS,r,n){super(),this.nodeType="Math",this.a=t,typeof i!="string"?this.b=i:n=i,typeof r!="string"?this.c=r:n=r,this.method=n,this.hashProperties=["method"]}getNumInputs(t){switch(this.method){case cr.MIX:case cr.CLAMP:case cr.REFRACT:case cr.SMOOTHSTEP:case cr.FACEFORWARD:return 3;case cr.MIN:case cr.MAX:case cr.MOD:case cr.STEP:case cr.REFLECT:case cr.DISTANCE:case cr.DOT:case cr.CROSS:case cr.POW:return 2;default:return 1}}getInputType(t){let i=t.getTypeLength(this.a.getType(t)),r=this.b?t.getTypeLength(this.b.getType(t)):0,n=this.c?t.getTypeLength(this.c.getType(t)):0;return i>r&&i>n?this.a.getType(t):r>n?this.b.getType(t):this.c.getType(t)}getType(t){switch(this.method){case cr.LENGTH:case cr.DISTANCE:case cr.DOT:return"f";case cr.CROSS:return"v3"}return this.getInputType(t)}generate(t,i){let r,n,a,s=this.a?t.getTypeLength(this.a.getType(t)):0,o=this.b?t.getTypeLength(this.b.getType(t)):0,l=this.c?t.getTypeLength(this.c.getType(t)):0,c=this.getInputType(t),h=this.getType(t);switch(this.type=h,this.method){case cr.NEGATE:return t.format("( -"+this.a.build(t,c)+" )",c,i);case cr.INVERT:return t.format("( 1.0 - "+this.a.build(t,c)+" )",c,i);case cr.CROSS:r=this.a.build(t,"v3"),n=this.b.build(t,"v3");break;case cr.STEP:r=this.a.build(t,s===1?"f":c),n=this.b.build(t,c);break;case cr.MIN:case cr.MAX:case cr.MOD:r=this.a.build(t,c),n=this.b.build(t,o===1?"f":c);break;case cr.REFRACT:r=this.a.build(t,c),n=this.b.build(t,c),a=this.c.build(t,"f");break;case cr.MIX:r=this.a.build(t,c),n=this.b.build(t,c),a=this.c.build(t,l===1?"f":c);break;default:r=this.a.build(t,c),this.b&&(n=this.b.build(t,c)),this.c&&(a=this.c.build(t,c));break}let u=[];u.push(r),n&&u.push(n),a&&u.push(a);let d=this.getNumInputs(t);if(u.length!==d)throw Error(`Arguments not match used in "${this.method}". Require ${d}, currently ${u.length}.`);return t.format(this.method+"( "+u.join(", ")+" )",h,i)}},pi=cr;pi.RAD="radians",pi.DEG="degrees",pi.EXP="exp",pi.EXP2="exp2",pi.LOG="log",pi.LOG2="log2",pi.SQRT="sqrt",pi.INV_SQRT="inversesqrt",pi.FLOOR="floor",pi.CEIL="ceil",pi.NORMALIZE="normalize",pi.FRACT="fract",pi.SATURATE="saturate",pi.SIN="sin",pi.COS="cos",pi.TAN="tan",pi.ASIN="asin",pi.ACOS="acos",pi.ARCTAN="atan",pi.ABS="abs",pi.SIGN="sign",pi.LENGTH="length",pi.NEGATE="negate",pi.INVERT="invert",pi.MIN="min",pi.MAX="max",pi.MOD="mod",pi.STEP="step",pi.REFLECT="reflect",pi.DISTANCE="distance",pi.DOT="dot",pi.CROSS="cross",pi.POW="pow",pi.MIX="mix",pi.CLAMP="clamp",pi.REFRACT="refract",pi.SMOOTHSTEP="smoothstep",pi.FACEFORWARD="faceforward";var b_=class extends fr{constructor(t,i,r){super("v4"),this.nodeType="TextureCubeUV",this.value=t,this.uv=i,this.bias=r}bilinearCubeUV(t,i,r,n){let a=new u6(b_.Nodes.bilinearCubeUV,[i,r,n]);this.colorSpaceTL=this.colorSpaceTL??new th(new Pr("","v4")),this.colorSpaceTL.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTL.input.parse(a.build(t)+".tl"),this.colorSpaceTR=this.colorSpaceTR??new th(new Pr("","v4")),this.colorSpaceTR.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceTR.input.parse(a.build(t)+".tr"),this.colorSpaceBL=this.colorSpaceBL??new th(new Pr("","v4")),this.colorSpaceBL.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBL.input.parse(a.build(t)+".bl"),this.colorSpaceBR=this.colorSpaceBR??new th(new Pr("","v4")),this.colorSpaceBR.fromDecoding(t.getTextureEncodingFromMap(this.value.value)),this.colorSpaceBR.input.parse(a.build(t)+".br");let s={include:t.isShader("vertex"),ignoreCache:!0};t.addContext(s),this.colorSpaceTLExp=new Pr(this.colorSpaceTL.build(t,"v4"),"v4"),this.colorSpaceTRExp=new Pr(this.colorSpaceTR.build(t,"v4"),"v4"),this.colorSpaceBLExp=new Pr(this.colorSpaceBL.build(t,"v4"),"v4"),this.colorSpaceBRExp=new Pr(this.colorSpaceBR.build(t,"v4"),"v4"),t.removeContext();let o=new Pr("mix( mix( cubeUV_TL, cubeUV_TR, cubeUV.f.x ), mix( cubeUV_BL, cubeUV_BR, cubeUV.f.x ), cubeUV.f.y )","v4");return o.keywords.cubeUV_TL=this.colorSpaceTLExp,o.keywords.cubeUV_TR=this.colorSpaceTRExp,o.keywords.cubeUV_BL=this.colorSpaceBLExp,o.keywords.cubeUV_BR=this.colorSpaceBRExp,o.keywords.cubeUV=a,o}generate(t,i){if(t.isShader("fragment")){let r=this.uv,n=this.bias||t.context.roughness,a=new u6(b_.Nodes.roughnessToMip,[n]),s=new pi(a,b_.Nodes.m0,b_.Nodes.cubeUV_maxMipLevel,pi.CLAMP),o=new pi(s,pi.FLOOR),l=new pi(s,pi.FRACT),c=this.bilinearCubeUV(t,this.value,r,o),h=this.bilinearCubeUV(t,this.value,r,new qs(o,new Tt(1).setReadonly(!0),qs.ADD)),u=new pi(c,h,l,pi.MIX);return t.format(u.build(t),"v4",i)}else return console.warn("TextureCubeUVNode is not compatible with "+t.shader+" shader."),t.format("vec4( 0.0 )",this.getType(t),i)}},bL=b_;bL.Nodes=function(){let t=new hX(`struct TextureCubeUVData { 7723 vec4 tl; 7724 vec4 tr; 7725 vec4 br; 7726 vec4 bl; 7727 vec2 f; 7728 }`),i=new hr("float cubeUV_maxMipLevel 8.0",!0),r=new hr("float cubeUV_minMipLevel 4.0",!0),n=new hr("float cubeUV_maxTileSize 256.0",!0),a=new hr("float cubeUV_minTileSize 16.0",!0),s=new yt(`float getFace(vec3 direction) { 7729 vec3 absDirection = abs(direction); 7730 float face = -1.0; 7731 if (absDirection.x > absDirection.z) { 7732 if (absDirection.x > absDirection.y) 7733 face = direction.x > 0.0 ? 0.0 : 3.0; 7734 else 7735 face = direction.y > 0.0 ? 1.0 : 4.0; 7736 } else { 7737 if (absDirection.z > absDirection.y) 7738 face = direction.z > 0.0 ? 2.0 : 5.0; 7739 else 7740 face = direction.y > 0.0 ? 1.0 : 4.0; 7741 } 7742 return face; 7743 }`);s.useKeywords=!1;let o=new yt(`vec2 getUV(vec3 direction, float face) { 7744 vec2 uv; 7745 if (face == 0.0) { 7746 uv = vec2(direction.z, direction.y) / abs(direction.x); // pos x 7747 } else if (face == 1.0) { 7748 uv = vec2(-direction.x, -direction.z) / abs(direction.y); // pos y 7749 } else if (face == 2.0) { 7750 uv = vec2(-direction.x, direction.y) / abs(direction.z); // pos z 7751 } else if (face == 3.0) { 7752 uv = vec2(-direction.z, direction.y) / abs(direction.x); // neg x 7753 } else if (face == 4.0) { 7754 uv = vec2(-direction.x, direction.z) / abs(direction.y); // neg y 7755 } else { 7756 uv = vec2(direction.x, direction.y) / abs(direction.z); // neg z 7757 } 7758 return 0.5 * (uv + 1.0); 7759 }`);o.useKeywords=!1;let l=new yt(`TextureCubeUVData bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) { 7760 float face = getFace(direction); 7761 float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0); 7762 mipInt = max(mipInt, cubeUV_minMipLevel); 7763 float faceSize = exp2(mipInt); 7764 float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize); 7765 vec2 uv = getUV(direction, face) * (faceSize - 1.0); 7766 vec2 f = fract(uv); 7767 uv += 0.5 - f; 7768 if (face > 2.0) { 7769 uv.y += faceSize; 7770 face -= 3.0; 7771 } 7772 uv.x += face * faceSize; 7773 if(mipInt < cubeUV_maxMipLevel){ 7774 uv.y += 2.0 * cubeUV_maxTileSize; 7775 } 7776 uv.y += filterInt * 2.0 * cubeUV_minTileSize; 7777 uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize); 7778 uv *= texelSize; 7779 vec4 tl = texture2D(envMap, uv); 7780 uv.x += texelSize; 7781 vec4 tr = texture2D(envMap, uv); 7782 uv.y += texelSize; 7783 vec4 br = texture2D(envMap, uv); 7784 uv.x -= texelSize; 7785 vec4 bl = texture2D(envMap, uv); 7786 return TextureCubeUVData( tl, tr, br, bl, f ); 7787 }`,[t,s,o,i,r,n,a]);l.useKeywords=!1;let c=new hr("float r0 1.0",!0),h=new hr("float v0 0.339",!0),u=new hr("float m0 -2.0",!0),d=new hr("float r1 0.8",!0),A=new hr("float v1 0.276",!0),f=new hr("float m1 -1.0",!0),m=new hr("float r4 0.4",!0),g=new hr("float v4 0.046",!0),p=new hr("float m4 2.0",!0),v=new hr("float r5 0.305",!0),_=new hr("float v5 0.016",!0),y=new hr("float m5 3.0",!0),w=new hr("float r6 0.21",!0),b=new hr("float v6 0.0038",!0),E=new hr("float m6 4.0",!0),M=[c,h,u,d,A,f,m,g,p,v,_,y,w,b,E],S=new yt(`float roughnessToMip(float roughness) { 7788 float mip = 0.0; 7789 if (roughness >= r1) { 7790 mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0; 7791 } else if (roughness >= r4) { 7792 mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1; 7793 } else if (roughness >= r5) { 7794 mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4; 7795 } else if (roughness >= r6) { 7796 mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5; 7797 } else { 7798 mip = -2.0 * log2(1.16 * roughness);// 1.16 = 1.79^0.25 7799 } 7800 return mip; 7801 }`,M);return{bilinearCubeUV:l,roughnessToMip:S,m0:u,cubeUV_maxMipLevel:i}}();var ng=class extends fr{constructor(t){super("v3"),this.nodeType="Normal",this.scope=t??ng.VIEW}getShared(){return this.scope===ng.WORLD}build(t,i,r,n){let a=t.context[this.scope+"Normal"];return a?a.build(t,i,r,n):super.build(t,i,r)}generate(t,i,r,n,a){let s;switch(this.scope){case ng.VIEW:t.isShader("vertex")?s="transformedNormal":s="geometryNormal";break;case ng.LOCAL:t.isShader("vertex")?s="objectNormal":(t.requires.normal=!0,s="vOb
7801jectNormal");break;case ng.WORLD:t.isShader("vertex")?s="inverseTransformDirection( transformedNormal, viewMatrix ).xyz":(t.requires.worldNormal=!0,s="vWNormal");break}return t.format(s,this.getType(t),i)}},so=ng;so.LOCAL="local",so.WORLD="world",so.VIEW="view",so.NORMAL="normal";ro.addKeyword("viewNormal",function(){return new so(so.VIEW)});ro.addKeyword("localNormal",function(){return new so(so.NORMAL)});ro.addKeyword("worldNormal",function(){return new so(so.WORLD)});var eu=class extends fr{constructor(t){super("v3"),this.nodeType="Position",this.scope=t??eu.LOCAL}getType(){switch(this.scope){case eu.PROJECTION:return"v4"}return this.type}getShader(){switch(this.scope){case eu.LOCAL:case eu.WORLD:return!1}return!0}generate(t,i,r,n,a){let s;switch(this.scope){case eu.LOCAL:t.isShader("vertex")?s="transformed":(t.requires.position=!0,s="vPosition");break;case eu.WORLD:if(t.isShader("vertex"))return"( modelMatrix * vec4( transformed, 1.0 ) ).xyz";t.requires.worldPosition=!0,s="vWPosition";break;case eu.VIEW:s=t.isShader("vertex")?"-mvPosition.xyz":"vViewPosition";break;case eu.PROJECTION:s=t.isShader("vertex")?"( projectionMatrix * modelViewMatrix * vec4( position, 1.0 ) )":"vec4( 0.0 )";break}return t.format(s,this.getType(),i)}},ac=eu;ac.LOCAL="local",ac.WORLD="world",ac.VIEW="view",ac.PROJECTION="projection";ro.addKeyword("position",function(){return new ac});ro.addKeyword("worldPosition",function(){return new ac(ac.WORLD)});ro.addKeyword("viewPosition",function(){return new ac(ac.VIEW)});var Hc=class extends fr{constructor(t){super("v3"),this.nodeType="Reflect",this.scope=t??Hc.CUBE}getUnique(t){return!t.context.viewNormal}getType(){switch(this.scope){case Hc.SPHERE:return"v2"}return this.type}generate(t,i){let r=this.getUnique(t);if(t.isShader("fragment")){let n;switch(this.scope){case Hc.VECTOR:{let a=new so(so.VIEW),s=t.context.roughness,o=a.build(t,"v3"),l=new ac(ac.VIEW).build(t,"v3"),c=s?s.build(t,"f"):void 0,h=`reflect( -normalize( ${l} ), ${o} )`;c&&(h=`normalize( mix( ${h}, ${o}, ${c} * ${c} ) )`);let u=`inverseTransformDirection( ${h}, viewMatrix )`;r?(t.addNodeCode(`vec3 reflectVec = ${u};`),n="reflectVec"):n=u;break}case Hc.CUBE:{let a=new Hc(Hc.VECTOR).build(t,"v3"),s="vec3( -"+a+".x, "+a+".yz )";r?(t.addNodeCode(`vec3 reflectCubeVec = ${s};`),n="reflectCubeVec"):n=s;break}case Hc.SPHERE:{let a="normalize( ( viewMatrix * vec4( "+new Hc(Hc.VECTOR).build(t,"v3")+", 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5";r?(t.addNodeCode(`vec2 reflectSphereVec = ${a};`),n="reflectSphereVec"):n=a;break}}return t.format(n,this.getType(),i)}else return console.warn("ReflectNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.type,i)}},Ug=Hc;Ug.CUBE="cube",Ug.SPHERE="sphere",Ug.VECTOR="vector";var s2e=class extends fr{constructor(t=new gu,i,r){super("v4"),this.nodeType="TextureCube",this.value=t,this.radianceNode=new bL(this.value,i??new Ug(Ug.VECTOR),r),this.irradianceNode=new bL(this.value,new so(so.WORLD),new Tt(1).setReadonly(!0))}generate(t,i){return t.isShader("fragment")?(t.require("irradiance"),t.context.bias&&t.context.bias.setTexture(this.value),(t.slot==="irradiance"?this.irradianceNode:this.radianceNode).build(t,i)):(console.warn("TextureCubeNode is not compatible with "+t.shader+" shader."),t.format("vec4( 0.0 )",this.getType(t),i))}},o2e=class extends go{constructor(t=new sN,i,r){super("v4",{shared:!0}),this.nodeType="CubeTexture",this.value=t,this.uv=i??new Ug,this.bias=r}getTexture(t,i){return super.generate(t,i,this.value.uuid,"tc")}generate(t,i){var c;if(i==="samplerCube")return this.getTexture(t,i);let r=this.getTexture(t,i),n=(c=this.uv)==null?void 0:c.build(t,"v3"),a=this.bias?this.bias.build(t,"f"):void 0;a===void 0&&t.context.bias&&(a=t.context.bias.setTexture(this).build(t,"f"));let s;a?s="texCubeBias( "+r+", "+n+", "+a+" )":s="texCube( "+r+", "+n+" )";let o={include:t.isShader("vertex"),ignoreCache:!0},l=this.getType(t);return t.addContext(o),this.colorSpace=this.colorSpace??new th(new Pr("",l)),this.colorSpace.fromDecoding(t.getTextureEncodingFromMap(this.value)),this.colorSpace.input.parse(s),s=this.colorSpace.build(t,l),t.removeContext(),t.format(s,l,i)}},l2e=` 7802uniform int frameIndex; 7803uniform vec2 resolution; 7804uniform mat4 previousModelViewMatrix; 7805uniform mat4 previousProjectionMatrix; 7806 7807varying vec4 vCurrentPosition; 7808varying vec4 vPreviousPosition; 7809`,c2e=` 7810layout(location = 1) out vec4 gVelocity; 7811 7812uniform int frameIndex; 7813uniform vec2 resolution; 7814 7815varying vec4 vCurrentPosition; 7816varying vec4 vPreviousPosition; 7817 7818const vec2 haltonSequence[16] = vec2[16]( 7819vec2( 0.000000,-0.333334), 7820vec2(-0.500000, 0.333334), 7821vec2( 0.500000,-0.777778), 7822vec2(-0.750000,-0.111112), 7823vec2( 0.250000, 0.555556), 7824vec2(-0.250000,-0.555556), 7825vec2( 0.750000, 0.111112), 7826vec2(-0.875000, 0.777778), 7827vec2(0.125000, -0.925926), 7828vec2(-0.375000, -0.259260), 7829vec2(0.625000, 0.407408), 7830vec2(-0.625000, -0.703704), 7831vec2(0.375000, -0.037038), 7832vec2(-0.125000, 0.629630), 7833vec2(0.875000, -0.481482), 7834vec2(-0.937500, 0.185186)); 7835 7836vec2 vogelDiskSample(int sampleIndex, int sampleCount, float angle) { 7837 const float goldenAngle = 2.399963f; // radians 7838 float r = sqrt(float(sampleIndex) + 0.5f) / sqrt(float(sampleCount)); 7839 float theta = float(sampleIndex) * goldenAngle + angle; 7840 float sine = sin(theta); 7841 float cosine = cos(theta); 7842 return vec2(cosine, sine) * r; 7843} 7844 7845// Derived from the interleaved gradient function from Jimenez 2014 http:goo.gl/eomGso 7846float getNoiseInterleavedGradient(vec2 screenPos) { 7847 vec3 magic = vec3(0.06711056f, 0.00583715f, 52.9829189f); 7848 return fract(magic.z * fract(dot(screenPos, magic.xy))); 7849} 7850 7851`,h2e=` 7852// TODO: This could be generated CPU side and passed to the shader every frame 7853const vec2 haltonSequence[16] = vec2[16]( 7854vec2( 0.000000,-0.333334), 7855vec2(-0.500000, 0.333334), 7856vec2( 0.500000,-0.777778), 7857vec2(-0.750000,-0.111112), 7858vec2( 0.250000, 0.555556), 7859vec2(-0.250000,-0.555556), 7860vec2( 0.750000, 0.111112), 7861vec2(-0.875000, 0.777778), 7862vec2(0.125000, -0.925926), 7863vec2(-0.375000, -0.259260), 7864vec2(0.625000, 0.407408), 7865vec2(-0.625000, -0.703704), 7866vec2(0.375000, -0.037038), 7867vec2(-0.125000, 0.629630), 7868vec2(0.875000, -0.481482), 7869vec2(-0.937500, 0.185186)); 7870 7871// TODO: Pass correct view size 7872vec2 offset = haltonSequence[frameIndex]; 7873offset.x /= resolution.x; 7874offset.y /= resolution.y; 7875 7876vec4 currentPosition = gl_Position; 7877vec4 currentPositionJittered = currentPosition + (vec4(offset.x, offset.y, 0.0, 0.0) * currentPosition.w); 7878 7879// We want to calculate the velocity with unjittered positions 7880// so that things that are not moving get a velocity = 0 7881vCurrentPosition = currentPosition; 7882vPreviousPosition = previousProjectionMatrix * previousModelViewMatrix * vec4(transformed, 1.0); 7883#ifdef OUTLINE_COMPENSATION 7884vPreviousPosition.xy += OUTLINE_COMPENSATION; 7885#endif 7886gl_Position = currentPositionJittered; 7887 7888`,u2e=` 7889vec2 oldPos = vPreviousPosition.xy; 7890 oldPos /= vPreviousPosition.w; 7891 oldPos.xy = (oldPos.xy+1.)/2.0; 7892 7893vec2 newPos = vCurrentPosition.xy; 7894 newPos /= vCurrentPosition.w; 7895 newPos.xy = (newPos.xy+1.)/2.0; 7896 7897vec2 velocity = (newPos - oldPos); 7898 7899// Discard fully transparent pixels 7900if (gl_FragColor.a <= 0.0) discard; 7901 7902gVelocity = vec4(velocity, 0.0, 1.0); 7903`,d2e=` 7904layout(location = 1) out vec4 gVelocity; 7905`,A2e=` 7906 // Discard fully transparent pixels 7907 if (gl_FragColor.a <= 0.0) discard; 7908 7909 gVelocity = vec4(0.0, 0.0, 0.0, 1.0); 7910`,d6=["x","y","z","w"],f2e=["float","vec2","vec3","vec4"],p2e={float:"f",vec2:"v2",vec3:"v3",vec4:"v4",mat4:"v4",int:"i",bool:"b","float[]":"f[]","vec4[]":"v4[]"},m2e={t:"sampler2D",tc:"samplerCube",b:"bool",i:"int",f:"float",c:"vec3",v2:"vec2",v3:"vec3",v4:"vec4",m3:"mat3",m4:"mat4","f[]":"float[]","v4[]":"vec4[]"},dX=class{constructor(){this.includes={consts:{},functions:{},structs:{}},this.cache="",this.slot="",this.shader="",this.context={},this.needsJitter=!0,this.getIncludesCode=function(){function t(i,r){return i.deps.length-r.deps.length}return function(i,r){let n=this.getIncludes(i,r);if(!n)return"";let a="";n=n.sort(t);for(let s=0;s<n.length;s++)n[s].src&&(a+=n[s].src+` 7911`);return a}}(),this.slots=[],this.caches=[],this.contexts=[],this.keywords={},this.nodeData={},this.fragmentVariables={},this.fragmentParsVariables={},this.vertexParsVariables={},this.requires={uv:[],color:[],transparent:!1,irradiance:!1,position:!1,worldPosition:!1,normal:!1,worldNormal:!1,vWorldViewDir:!1,modelMatrix:!1,viewMatrix:!1,projectionMatrix:!1},this.includes={consts:[],functions:[],structs:[]},this.attributes={}
vendor: 9,707 bytes, lines 7911-7955
7911,this.prefixCode=["#ifdef TEXTURE_LOD_EXT"," #define texCube(a, b) textureCube(a, b)"," #define texCubeBias(a, b, c) textureCubeLodEXT(a, b, c)"," #define tex2D(a, b) texture2D(a, b)"," #define tex2DBias(a, b, c) texture2DLodEXT(a, b, c)","#else"," #define texCube(a, b) textureCube(a, b)"," #define texCubeBias(a, b, c) textureCube(a, b, c)"," #define tex2D(a, b) texture2D(a, b)"," #define tex2DBias(a, b, c) texture2D(a, b, c)","#endif",` 7912 // NOTE: Include Spline's blending modes. This could be part of BlendNode 7913 #define SPE_BLENDING_NORMAL 0 7914 #define SPE_BLENDING_MULTIPLY 1 7915 #define SPE_BLENDING_SCREEN 2 7916 #define SPE_BLENDING_OVERLAY 3 7917 7918 vec3 spe_normalBlend( vec3 a, vec3 b, float alpha ) { 7919 return mix( a, b, alpha ); 7920 } 7921 7922 vec3 spe_multiplyBlend( vec3 a, vec3 b, float alpha ) { 7923 return mix( a, a * b, alpha ); 7924 } 7925 7926 vec3 spe_screenBlend( vec3 a, vec3 b, float alpha ) { 7927 vec3 tmp = 1.0 - ( 1.0 - a ) * ( 1.0 - b ); 7928 return mix( a, tmp, alpha ); 7929 } 7930 7931 vec3 spe_overlayBlend( vec3 a, vec3 b, float alpha ) { 7932 vec3 tmp = mix( 1. - 2. * (1. - a) * (1. - b), 2. * a * b, step( a, vec3(.5) ) ); 7933 return clamp( mix( a, tmp, alpha ), 0.0, 1.0 ); 7934 } 7935 7936 vec3 spe_blend( vec3 a, vec3 b, float alpha, int mode ) { 7937 if ( mode == SPE_BLENDING_NORMAL ) return spe_normalBlend( a, b, alpha ); 7938 else if ( mode == SPE_BLENDING_MULTIPLY ) return spe_multiplyBlend( a, b, alpha ); 7939 else if ( mode == SPE_BLENDING_SCREEN ) return spe_screenBlend( a, b, alpha ); 7940 else if ( mode == SPE_BLENDING_OVERLAY ) return spe_overlayBlend( a, b, alpha ); 7941 return vec3( 1.0 ); 7942 } 7943 `,"#include <packing>","#include <common>"].join(` 7944`),this.parsCode={vertex:["float neighbor_offset = 0.0001;",""].join(` 7945`),fragment:["float accumAlpha = 0.0;",`void accumulateAlpha(float alpha) { 7946 accumAlpha += (1.0 - accumAlpha) * alpha; 7947 }`,""].join(` 7948`)},this.code={vertex:"",fragment:""},this.nodeCode={vertex:"",fragment:""},this.resultCode={vertex:"",fragment:""},this.finalCode={vertex:"",fragment:""},this.inputs={uniforms:{list:[],vertex:[],fragment:[]},arrayUniforms:{list:[],vertex:[],fragment:[]},vars:{varying:[],vertex:[],fragment:[]}},this.defines={},this.uniforms={},this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.updaters=[],this.nodes=[],this.analyzing=!1}build(t,i){this.addVertexParsCode(l2e),this.addFragmentParsCode(c2e),this.buildShader("vertex",t),this.buildShader("fragment",i);for(let r=0;r<this.requires.uv.length;r++)if(this.requires.uv[r]){let n=r>0?r+1:"";this.addVaryCode("varying vec2 vUv"+n+";"),r>0&&this.addVertexParsCode("attribute vec2 uv"+n+";"),this.addVertexFinalCode("vUv"+n+" = uv"+n+";")}return this.requires.color[0]&&(this.addVaryCode("varying vec4 vColor;"),this.addVertexParsCode("attribute vec4 color;"),this.addVertexFinalCode("vColor = color;")),this.requires.color[1]&&(this.addVaryCode("varying vec4 vColor2;"),this.addVertexParsCode("attribute vec4 color2;"),this.addVertexFinalCode("vColor2 = color2;")),this.requires.position&&(this.addVaryCode("varying vec3 vPosition;"),this.addVertexFinalCode("vPosition = transformed;")),this.requires.worldPosition,this.requires.normal&&(this.addVaryCode("varying vec3 vObjectNormal;"),this.addVertexFinalCode("vObjectNormal = normal;")),this.requires.modelMatrix&&this.addFragmentParsCode("uniform mat4 modelMatrix;"),this.requires.viewMatrix&&this.addFragmentParsCode("uniform mat4 viewMatrix;"),this.requires.projectionMatrix&&this.addFragmentParsCode("uniform mat4 projectionMatrix;"),this.requires.worldNormal&&(this.addVaryCode("varying vec3 vWNormal;"),this.addVertexFinalCode("vWNormal = inverseTransformDirection( transformedNormal, viewMatrix ).xyz;")),this.requires.vWorldViewDir&&(this.addVaryCode("varying vec3 vWorldViewDir;"),this.addVertexFinalCode("vWorldViewDir = isPerspectiveMatrix( projectionMatrix ) ? ( (modelMatrix * vec4(position, 1.0)).xyz - cameraPosition ) : vec3( -viewMatrix[0][2], -viewMatrix[1][2], -viewMatrix[2][2] );")),this.needsJitter&&(this.addVertexFinalCode(h2e),this.addFragmentFinalCode(u2e)),this}buildShader(t,i){this.resultCode[t]=i.build(this.setShader(t),"v4")}setMaterial(t,i){return this.defines={},this}addFlow(t,i,r){return this.addSlot(t).addCache(i).addContext(r)}removeFlow(){return this.removeSlot().removeCache().removeContext()}addCache(t){return this.cache=t??"",this.caches.push(this.cache),this}removeCache(){return this.caches.pop(),this.cache=this.caches[this.caches.length-1]||"",this}addContext(t){return this.context=Object.assign({},this.context,t),this.context.extra=this.context.extra||{},this.contexts.push(this.context),this}removeContext(){return this.contexts.pop(),this.context=this.contexts[this.contexts.length-1]||{},this}addSlot(t){return this.slot=t||"",this.slots.push(this.slot),this}removeSlot(){return this.slots.pop(),this.slot=this.slots[this.slots.length-1]||"",this}addFragmentVariable(t,i){this.fragmentVariables[t]===void 0&&(this.addFragmentCode(`${i} ${t};`),this.fragmentVariables[t]="")}addFragmentParsVariable(t,i){this.fragmentParsVariables[t]===void 0&&(this.addFragmentParsCode(`${i} ${t};`),this.fragmentParsVariables[t]="")}addVertexParsVariable(t,i){this.vertexParsVariables[t]===void 0&&(this.addVertexParsCode(`${i} ${t};`),this.vertexParsVariables[t]="")}addVertexCode(t){this.addCode(t,"vertex")}addFragmentCode(t){this.addCode(t,"fragment")}addCode(t,i){this.code[i??this.shader]+=t+` 7949`}addVertexNodeCode(t){this.addNodeCode(t,"vertex")}addFragmentNodeCode(t){this.addNodeCode(t,"fragment")}addNodeCode(t,i){this.nodeCode[i??this.shader]+=t+` 7950`}clearNodeCode(t){t=t??this.shader;let i=this.nodeCode[t];return this.nodeCode[t]="",i}clearVertexNodeCode(){return this.clearNodeCode("vertex")}clearFragmentNodeCode(){return this.clearNodeCode("fragment")}addVertexFinalCode(t){this.addFinalCode(t,"vertex")}addFragmentFinalCode(t){this.addFinalCode(t,"fragment")}addFinalCode(t,i){this.finalCode[i??this.shader]+=t+` 7951`}addVertexParsCode(t){this.addParsCode(t,"vertex")}addFragmentParsCode(t){this.addParsCode(t,"fragment")}addParsCode(t,i){this.parsCode[i??this.shader]+=t+` 7952`}addVaryCode(t){this.addVertexParsCode(t),this.addFragmentParsCode(t)}isCache(t){return this.caches.indexOf(t)!==-1}isSlot(t){return this.slots.indexOf(t)!==-1}define(t,i){this.defines[t]=i===void 0?1:i}require(t){this.requires[t]=!0}isDefined(t){return this.defines[t]!==void 0}getVar(t,i,r,n="varying",a="V",s=""){let o=this.getVars(n),l=o[t];if(!l){let c=o.length;l={name:r||"node"+a+c+(s?"_"+s:""),type:i},o.push(l),o[t]=l}return l}getTempVar(t,i,r,n){return this.getVar(t,i,r,this.shader,"T",n)}getAttribute(t,i){if(!this.attributes[t]){let r=this.getVar(t,i);this.addVertexParsCode("attribute "+i+" "+t+";"),this.addVertexFinalCode(r.name+" = "+t+";"),this.attributes[t]={varying:r,name:t,type:i}}return this.attributes[t]}getCode(t){return[this.prefixCode,this.parsCode[t],this.getVarListCode(this.getVars("varying"),"varying"),this.getVarListCode(this.inputs.uniforms[t],"uniform"),this.getVarListCode(this.inputs.arrayUniforms[t],"uniform"),this.getIncludesCode("consts",t),this.getIncludesCode("structs",t),this.getIncludesCode("functions",t),"void main() {",this.getVarListCode(this.getVars(t)),this.code[t],this.resultCode[t],this.finalCode[t],"}"].join(` 7953`)}getVarListCode(t,i){i=i??"";let r="";for(let n=0,a=t.length;n<a;++n){let s=t[n],o=s.type,l=s.name,c=s.size,h=this.getFormatByType(o);if(h===void 0)throw new Error("Node pars "+h+" not found.");h.includes("[]")?r+=i+" "+h.substring(0,h.length-2)+" "+l+`[${c}]; 7954`:r+=i+" "+h+" "+l+`; 7955`}return r}getVars(t){return this.inputs.vars[t??this.shader]}getNodeData(t){let i=t instanceof Yn?t.uuid:t;return this.nodeData[i]=this.nodeData[i]||{}}createUniform(t,i,r,n,a,s){if(i.includes("[]")){let o=this.inputs.arrayUniforms,l=o.list.length,c=new c6({type:i,size:r.size,name:n||"nodeUA"+l+(s?"_"+s:""),node:r,needsUpdate:a});return o.list.push(c),o[t].push(c),o[t][c.name]=c,this.uniforms[c.name]=c,c}else{let o=this.inputs.uniforms,l=o.list.length,c=new c6({type:i,name:n||"nodeU"+l+(s?"_"+s:""),node:r,needsUpdate:a});return o.list.push(c),o[t].push(c),o[t][c.name]=c,this.uniforms[c.name]=c,c}}createVertexUniform(t,i,r,n,a){return this.createUniform("vertex",t,i,r,n,a)}createFragmentUniform(t,i,r,n,a){return this.createUniform("fragment",t,i,r,n,a)}include(t,i,r){var s;let n;if(t=typeof t=="string"?ro.get(t):t,this.context.include===!1)return t.name;t instanceof yt?n=this.includes.functions:t instanceof hr?n=this.includes.consts:t instanceof hX&&(n=this.includes.structs);let a=n[this.shader]=n[this.shader]||[];if(t){let o=a[t.name];if(o||(o=a[t.name]={node:t,deps:[]},a.push(o),o.src=t.build(this,"source")),t instanceof yt&&i&&a[i.name]&&a[i.name].deps.indexOf(t)===-1&&(a[i.name].deps.push(t),(s=t.includes)==null?void 0:s.length)){let l=0;do this.include(t.includes[l++],i);while(l<t.includes.length)}return r&&(o.src=r),t.name}else throw new Error("Include not found.")}colorToVectorProperties(t){return t.replace("r","x").replace("g","y").replace("b","z").replace("a","w")}colorToVector(t){return t.replace(/c/g,"v3")}getIncludes(t,i){return this.includes[t][i||this.shader]}getConstructorFromLength(t){return f2e[t-1]}isTypeMatrix(t){return/^m/.test(t)}getTypeLength(t){return t==="f"?1:parseInt(this.colorToVector(t).substr(1))}getTypeFromLength(t){return t===1?"f":"v"+t}findNode(...t){for(let i=0;i<arguments.length;i++){let r=t[i];if(r!=null&&r.isNode)return r}}resolve(...t){for(let i=0;i<arguments.length;i++){let r=t[i];if(r!==void 0){if(r.isNode)return r;if(r.isTexture)switch(r.mapping){case cp:case hp:return new o2e(r);case EE:return new s2e(new gu(r));default:return new gu(r)}
7955else{if(r.isVector2)return new La(r);if(r.isVector3)return new Ko(r);if(r.isVector4)return new au(r)}}}}format(t,i,r){switch(this.colorToVector(r+" <- "+i)){case"f <- v2":return t+".x";case"f <- v3":return t+".x";case"f <- v4":return t+".x";case"f <- i":case"f <- b":return"float( "+t+" )";case"v2 <- f":return"vec2( "+t+" )";case"v2 <- v3":return t+".xy";case"v2 <- v4":return t+".xy";case"v2 <- i":case"v2 <- b":return"vec2( float( "+t+" ) )";case"v3 <- f":return"vec3( "+t+" )";case"v3 <- v2":return"vec3( "+t+", 0.0 )";case"v3 <- v4":return t+".xyz";case"v3 <- i":case"v3 <- b":return"vec2( float( "+t+" ) )";case"v4 <- f":return"vec4( "+t+" )";case"v4 <- v2":return"vec4( "+t+", 0.0, 1.0 )";case"v4 <- v3":return"vec4( "+t+", 1.0 )";case"v4 <- i":case"v4 <- b":return"vec4( float( "+t+" ) )";case"i <- f":case"i <- b":return"int( "+t+" )";case"i <- v2":return"int( "+t+".x )";case"i <- v3":return"int( "+t+".x )";case"i <- v4":return"int( "+t+".x )";case"b <- f":return"( "+t+" != 0.0 )";case"b <- v2":return"( "+t+" != vec2( 0.0 ) )";case"b <- v3":return"( "+t+" != vec3( 0.0 ) )";case"b <- v4":return"( "+t+" != vec4( 0.0 ) )";case"b <- i":return"( "+t+" != 0 )"}return t}getTypeByFormat(t){return p2e[t]||t}getFormatByType(t){return m2e[t]||t}getUUID(t,i){return i=i!==void 0?i:!0,i&&this.cache&&(t=this.cache+"-"+t),t}getElementByIndex(t){return d6[t]}getIndexByElement(t){return d6.indexOf(t)}isShader(t){return this.shader===t}setShader(t){return this.shader=t,this}mergeDefines(t){for(let i in t)this.defines[i]=t[i];return this.defines}mergeUniform(t){for(let i in t)this.uniforms[i]=t[i];return this.uniforms}getTextureEncodingFromMap(t){let i;return t?t.isTexture&&(i=t.encoding):i=mc,i===mc&&this.context.gamma&&(i=gi),i}},ln=class extends go{constructor(t=0,i,r,n){super("c"),this.nodeType="Color",this.value=t instanceof Xa?t:new Xa(t||0,i,r,n)}setRGBA(t){this.value.setRGBA(t.r,t.g,t.b,t.a)}generate(t,i,r,n,a,s){r=t.getUUID(r??this.getUUID()),n=n??this.getType(t);let o=t.getNodeData(r),l=this.getReadonly()&&this.generateReadonly!==void 0;if(this.alpha){let c=this.alpha.build(t,"f");t.addFragmentNodeCode(`accumAlpha += ( 1.0 - accumAlpha ) * ${c};`)}return l?this.generateReadonly(t,i,r,n,a,s):t.isShader("vertex")?(o.vertex||(o.vertex=t.createVertexUniform(n,this,a,s,this.getLabel())),t.format(o.vertex.name,n,i)):(o.fragment||(o.fragment=t.createFragmentUniform(n,this,a,s,this.getLabel())),t.format(o.fragment.name,n,i))}generateReadonly(t,i,r,n,a,s){return t.format("vec3("+this.value.r+", "+this.value.g+", "+this.value.b+")",n,i)}},_r=class extends go{constructor(t){super("i"),this.nodeType="Int",this.value=Math.floor(t??0)}generateReadonly(t,i,r,n,a,s){return t.format(this.value.toString(),n,i)}},Ls=class extends go{constructor(t){super("b"),this.nodeType="Bool",this.value=t??!1}generateReadonly(t,i,r,n){return t.format(this.value?"true":"false",n,i)}},gf=class extends go{constructor(t=1,i){super("f[]"),this.nodeType="FloatArray",this.size=t,this.value=Array.isArray(i)?i:typeof i=="number"?new Array(t).fill(i):new Array(t).fill(0)}},nU=class extends go{},g2e=class extends nU{constructor(t){super("v3"),this.image=t,this._value=new O}get value(){return this._value.x=this.image.isVideo?this.image.img.videoWidth??0:this.image.img.width,this._value.y=this.image.isVideo?this.image.img.videoHeight??0:this.image.img.height,this._value}},SL=class extends nU{constructor(t,i,r=1008,n=1006){super("t"),this.image=t,this.wrap=i,this.minFilter=r,this.magFilter=n}get value(){return this.image.getTexture(this.wrap,this.minFilter,this.magFilter)}},AX=class extends go{constructor(t){super("m3"),this.nodeType="Matrix3",this.value=t??new Nn}generateReadonly(t,i,r,n,a,s){return t.format("mat3("+this.value.elements.join(", ")+")",n,i)}get elements(){return this.value.elements}set elements(t){this.value.fromArray(t)}},gh=class extends go{constructor(t){super("m4"),this.nodeType="Matrix4",this.value=t??new ht}generateReadonly(t,i,r,n,a,s){return t.format("mat4("+this.value.elements.join(", ")+")",n,i)}get elements(){return this.value.elements}set elements(t){this.value.fromArray(t)}};function A6(t,i,r,n=0){t.setUvTransform(r[0],r[1],i[0],i[1],0,0,0).premultiply(new Nn().makeRotation(n*Ct.DEG2RAD))}var v2e=class extends AX{constructor(t,i,r=0){super(new Nn),this.repeat=t,this.offset=i,this.rotation=r,A6(this.value,t,i,r)}updateMatrix(){A6(this.value,this.repeat,this.offset,this.rotation)}},vf=class extends go{constructor(t=1,i){super("v4[]"),this.nodeType="Vector4Array",this.size=t,this.value=Array.isArray(i)?i:i instanceof ai?new Array(t).fill(i):new Array(t).fill(new ai(0))}},f6=class extends fr{constructor(t,i,r,n){super("v3"),this.nodeType="Blend",this.a=t,this.b=i,this.alpha=r,this.mode=n}generate(t,i){if(t.isShader("fragment")){let r=[];return r.push(this.a.build(t,"c")),r.push(this.b.build(t,"c")),r.push(this.alpha.build(t,"f")),r.push(this.mode.build(t,"i")),t.format("spe_blend("
7955+r.join(",")+")",this.getType(t),i)}else return console.warn("BlendNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},fX=class extends fr{constructor(t,i){super("v3"),this.nodeType="CustomColor",this.color=t,this.alpha=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.isShader("fragment")){let r=t.include(fX.Nodes.customColor);t.addFragmentVariable(this.calpha,"float");let n=[];return n.push(this.color.build(t,"v3")),n.push(this.mask?`luminance(${this.mask.build(t,"v3")})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.calpha),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("CustomColorNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},CL=fX;CL.Nodes=function(){return{customColor:new yt(`vec3 customColor(vec3 color, float mask, float alpha, out float calpha) { 7956 float lalpha = alpha * mask; 7957 calpha = lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0); 7958 accumAlpha += (1.0 - accumAlpha) * lalpha; 7959 7960 return color; 7961 }`)}}();var pX=class extends fr{constructor(t,i){super("v3"),this.nodeType="CustomNormal",this.cnormal=t,this.alpha=i,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.isShader("fragment")){let r=t.include(pX.Nodes.customNormal);t.addFragmentVariable(this.calpha,"float");let n=[];return n.push(this.cnormal.build(t,"v3")),n.push("normal"),n.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.calpha),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("CustomNormalNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},mX=pX;mX.Nodes=function(){return{customNormal:new yt(`vec3 customNormal(vec3 cnormal, vec3 norm, float mask, float alpha, out float calpha) { 7962 vec3 normal = packNormalToRGB( norm ).rgb; 7963 normal *= step( vec3(0.5), cnormal ); 7964 7965 float lalpha = alpha * mask; 7966 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 7967 accumAlpha += ( 1.0 - accumAlpha ) * lalpha; 7968 7969 return normal; 7970 }`)}}();var S_=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h,u,d){super("v3"),this.nodeType="CustomTexture",this.texture=t,this.textureSize=i,this.crop=r,this.projection=n,this.axis=a,this.side=s,this.size=o,this.blending=l,this.mat=c,this.isMask=d,this.alpha=h,this.mode=u,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){t.require("position"),t.require("normal"),t.require("uv"),t.requires.uv=[!0],t.extensions.shaderTextureLOD=!0,t.extensions.derivatives=!0;let r=`g${this.uuid.toString().replace(/-/g,"")}`,n;switch(this.projection.value){case 3:n=t.include(S_.Nodes.cylindrical);break;case 2:n=t.include(S_.Nodes.spherical);break;case 1:let s=["vec3(1.0, 0.0, 0.0)","vec3(0.0, 1.0, 0.0)","vec3(0.0, 0.0, 1.0)"][this.axis.value],o=["zy","xz","xy"][this.axis.value],l=new yt(` 7971 vec3 ${r}_planarTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) { 7972 vec2 projected = (1. + (position.${o})) / 2.; 7973 vec2 uvs = ( mat * vec3( (projected * 2. - 1.) / (size * .5), 1. ) / 2. + 0.5 ).xy; 7974 writeUv = uvs; 7975 7976 vec4 tmp = texture2D( tex, uvs ); 7977 7978 vec3 col = tmp.rgb; 7979 float lalpha = alpha * tmp.a; 7980 ${this.side.value===2?"":`lalpha *= step(0.0, ${this.side.value===1?"-1.0 * ":""}dot(vObjectNormal, ${s}));`} 7981 7982 if ( crop > 0.5 ) { 7983 if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { 7984 lalpha = 0.0; 7985 } 7986 } 7987 7988 lalpha *= mask; 7989 7990 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 7991 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 7992 7993 return col; 7994 }`);n=t.include(l);break;case 4:n=t.include(S_.Nodes.triplanar);break;default:n=t.include(S_.Nodes.uv);break}t.addFragmentVariable(this.calpha,"float");let a=[];if(a.push("normal"),a.push(this.texture.generate(t,"t")),a.push(this.textureSize.build(t,"v2")),a.push(this.crop.build(t,"f")),a.push(this.mat.build(t,"mat3")),a.push(this.size.build(t,"v2")),a.push(this.blending.build(t,"f")),a.push(this.isMask.build(t,"b")),a.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),a.push(this.alpha.build(t,"f")),a.push(this.mode.build(t,"i")),a.push(this.calpha),this.projection.value===4){let s=`${r}_writeUvs`,o=s+"0",l=s+"1",c=s+"2",h=`${r}_triplanarWeights`;t.addFragmentVariable(o,"vec2"),t.addFragmentVariable(l,"vec2"),t.addFragmentVariable(c,"vec2"),t.addFragmentVariable(h,"vec3"),a.push(o),a.push(l),a.push(c),a.push(h)}else{let s=`${r}_writeUvs`;t.addFragmentVariable(s,"vec2"),a.push(s)}return t.format(n+"("+a.join(",")+")",this.getType(t),i)}},aU=S_;aU.Nodes=function(){let t=new yt(` 7995vec3 cylindricalTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) { 7996 vec3 posN = normalize(position); 7997 float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); 7998 float scaledHeight = position.y / (size.y * 0.5); 7999 float v = (scaledHeight / 2.) + .5; 8000 8001 vec2 calculatedUv = vec2(u,v); 8002 vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; 8003 writeUv = uvs; 8004 8005 vec2 df = fwidth(uvs); 8006 if(df.x > 0.5) df.x = 0.; 8007 8008 #ifdef GL_EXT_shader_texture_lod 8009 vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); 8010 #else 8011 vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); 8012 #endif 8013 8014 vec3 col = tmp.rgb;
8015 float lalpha = alpha * tmp.a; 8016 if ( crop > 0.5 ) { 8017 if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { 8018 lalpha = 0.0; 8019 } 8020 } 8021 8022 lalpha *= mask; 8023 8024 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 8025 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8026 8027 return col; 8028 } 8029`),i=new yt(` 8030vec3 sphericalTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) { 8031 vec3 posN = normalize(vPosition); 8032 float u = 0.5 + atan(posN.z, posN.x) / (2.*3.1415); 8033 float v = 0.5 + asin(posN.y) / 3.1415; 8034 8035 vec2 calculatedUv = vec2(u,v); 8036 vec2 uvs = ( mat * vec3( calculatedUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; 8037 writeUv = uvs; 8038 8039 vec2 df = fwidth(uvs); 8040 if(df.x > 0.5) df.x = 0.; 8041 #ifdef GL_EXT_shader_texture_lod 8042 vec4 tmp = texture2DLodEXT(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); 8043 #else 8044 vec4 tmp = textureLod(tex, uvs, log2(max(df.x, df.y)*min(textureSize.x, textureSize.y))); 8045 #endif 8046 8047 vec3 col = tmp.rgb; 8048 float lalpha = alpha * tmp.a; 8049 if ( crop > 0.5 ) { 8050 if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { 8051 lalpha = 0.0; 8052 } 8053 } 8054 8055 lalpha *= mask; 8056 8057 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 8058 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8059 8060 return col; 8061 } 8062`),r=new yt(`vec3 uvTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUv) { 8063 vec2 uvs = ( mat * vec3( vUv * 2. - 1., 1. ) / 2. + 0.5 ).xy; 8064 writeUv = uvs; 8065 8066 vec4 tmp = texture2D( tex, uvs ); 8067 8068 vec3 col = tmp.rgb; 8069 8070 float lalpha = alpha * tmp.a; 8071 if ( crop > 0.5 ) { 8072 if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { 8073 lalpha = 0.0; 8074 } 8075 } 8076 8077 lalpha *= mask; 8078 8079 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 8080 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8081 8082 return col; 8083 }`),n=new yt(`vec3 triplanarTexture(vec3 normal, sampler2D tex, vec2 textureSize, float crop, mat3 mat, vec2 size, float blending, bool isMask, float mask, float alpha, int mode, out float calpha, out vec2 writeUvs0, out vec2 writeUvs1, out vec2 writeUvs2, out vec3 writeWeights) { 8084 vec3 p = position; 8085 vec2 uv0 = (1.0 + p.xy) / 2.0; 8086 vec2 uv1 = (1.0 + p.zy) / 2.0; 8087 vec2 uv2 = (1.0 + p.xz) / 2.0; 8088 8089 uv0 = (mat * vec3((uv0 * 2.0 - 1.0) / (size * 0.5), 1.0) / 2.0 + 0.5).xy; 8090 uv1 = (mat * vec3((uv1 * 2.0 - 1.0) / (size * 0.5), 1.0) / 2.0 + 0.5).xy; 8091 uv2 = (mat * vec3((uv2 * 2.0 - 1.0) / (size * 0.5), 1.0) / 2.0 + 0.5).xy; 8092 8093 // Range from 3 to 128 seems to be good 8094 float exponent = (1.0 - blending) * 125.0 + 3.0; 8095 8096 vec3 n = vObjectNormal; 8097 vec3 weights = abs(normalize(n)); 8098 weights = pow(weights, vec3(exponent)); 8099 weights /= dot(weights, vec3(1.0)); 8100 8101 // Write out all sets of UVs that we generated 8102 writeUvs0 = uv0; 8103 writeUvs1 = uv1; 8104 writeUvs2 = uv2; 8105 writeWeights = weights; 8106 8107 // Derivatives for LOD 8108 vec2 df0 = fwidth(uv0); 8109 vec2 df1 = fwidth(uv1); 8110 vec2 df2 = fwidth(uv2); 8111 if (df0.x > 0.5) df0.x = 0.0; 8112 if (df1.x > 0.5) df1.x = 0.0; 8113 if (df2.x > 0.5) df2.x = 0.0; 8114 8115 #ifdef GL_EXT_shader_texture_lod 8116 vec4 tmp = 8117 texture2DLodEXT(tex, uv0, log2(max(df0.x, df0.y)*min(textureSize.x, textureSize.y))) * weights.z + 8118 texture2DLodEXT(tex, uv1, log2(max(df1.x, df1.y)*min(textureSize.x, textureSize.y))) * weights.x + 8119 texture2DLodEXT(tex, uv2, log2(max(df2.x, df2.y)*min(textureSize.x, textureSize.y))) * weights.y; 8120 #else 8121 vec4 tmp = 8122 textureLod(tex, uv0, log2(max(df0.x, df0.y)*min(textureSize.x, textureSize.y))) * weights.z + 8123 textureLod(tex, uv1, log2(max(df1.x, df1.y)*min(textureSize.x, textureSize.y))) * weights.x + 8124 textureLod(tex, uv2, log2(max(df2.x, df2.y)*min(textureSize.x, textureSize.y))) * weights.y; 8125 #endif 8126 8127 vec3 col = tmp.rgb;
8128 float lalpha = alpha * tmp.a; 8129 8130 // Apply cropping across all 3 planes 8131 if ( crop > 0.5 ) { 8132 if ( uv0.x < 0.0 || uv0.x > 1.0 || uv0.y < 0.0 || uv0.y > 1.0 ) { 8133 lalpha = 0.0; 8134 } 8135 if ( uv1.x < 0.0 || uv1.x > 1.0 || uv1.y < 0.0 || uv1.y > 1.0 ) { 8136 lalpha = 0.0; 8137 } 8138 if ( uv2.x < 0.0 || uv2.x > 1.0 || uv2.y < 0.0 || uv2.y > 1.0 ) { 8139 lalpha = 0.0; 8140 } 8141 } 8142 8143 lalpha *= mask; 8144 calpha = lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0); 8145 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8146 8147 return col;//n * 0.5 + 0.5; 8148 } 8149 `);return{cylindrical:t,spherical:i,uv:r,triplanar:n}}();var C_=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h,u,d){super("v3"),this.nodeType="Depth",this.gradientType=t,this.smooth=i,this.near=r,this.far=n,this.isVector=a,this.isWorldSpace=s,this.origin=o,this.direction=l,this.colors=c,this.steps=h,this.isMask=d,this.alpha=u,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){let r=`g${this.uuid.toString().replace(/-/g,"")}`,n=new yt(`vec3 ${r}_sdepth(float near, float far, vec3 origin, vec3 direction, vec4 colors[${r}_MAX_COLORS], float steps[${r}_MAX_COLORS], bool isMask, float mask, float alpha, out float calpha) { 8150 vec4 color = colors[0]; 8151 #ifdef ${r}_IS_VECTOR 8152 #ifdef ${r}_LINEAR 8153 #ifdef ${r}_WORLDSPACE 8154 float depth = vectorLinearWorldSpaceDepth(direction, origin, near, far); 8155 #else 8156 float depth = vectorLinearObjectSpaceDepth(direction, origin, near, far); 8157 #endif 8158 #else 8159 #ifdef ${r}_WORLDSPACE 8160 float depth = vectorSphericalWorldSpaceDepth(origin, near, far); 8161 #else 8162 float depth = vectorSphericalObjectSpaceDepth(origin, near, far); 8163 #endif 8164 #endif 8165 #else 8166 float dist = length(vWPosition - cameraPosition); 8167 float depth = ( dist - near ) / ( far - near ); 8168 #endif 8169 8170 8171 float p; 8172 #ifdef ${r}_SMOOTH 8173 for ( int i = 1; i < ${r}_MAX_COLORS; i++ ) { 8174 p = clamp( ( depth - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); 8175 color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); 8176 } 8177 #else 8178 for ( int i = 1; i < ${r}_MAX_COLORS; i++ ) { 8179 p = clamp(( depth - steps[i - 1] ) / ( steps[i] - steps[i - 1] ), 0.0, 1.0); 8180 color = mix(color, colors[i], p); 8181 } 8182 #endif 8183 8184 float lalpha = alpha * color.a * mask; 8185 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 8186 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8187 8188 return color.rgb; 8189 }`,[C_.Nodes.vectorLinearWorldSpaceDepth,C_.Nodes.vectorLinearObjectSpaceDepth,C_.Nodes.vectorSphericalObjectSpaceDepth,C_.Nodes.vectorSphericalWorldSpaceDepth]);if(t.isShader("fragment")){t.define(`${r}_MAX_COLORS`,this.colors.value.length),this.smooth.value&&t.define(`${r}_SMOOTH`),this.isVector.value>.5&&t.define(`${r}_IS_VECTOR`),this.gradientType.value===0&&t.define(`${r}_LINEAR`),this.isWorldSpace.value>.5&&t.define(`${r}_WORLDSPACE`),t.require("worldPosition"),t.addFragmentVariable(this.calpha,"float");let a=t.include(n),s=[];return s.push(this.near.build(t,"f")),s.push(this.far.build(t,"f")),s.push(this.origin.build(t,"v3")),s.push(this.direction.build(t,"v3")),s.push(this.colors.build(t,"v4[]")),s.push(this.steps.build(t,"f[]")),s.push(this.isMask.build(t,"b")),s.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),s.push(this.alpha.build(t,"f")),s.push(this.calpha),t.format(a+"("+s.join(",")+")",this.getType(t),i)}else return console.warn("DepthNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},gX=C_;gX.Nodes=function(){let t=new yt(`float vectorLinearWorldSpaceDepth(vec3 direction, vec3 origin, float near, float far) { 8190 vec3 n = normalize(direction); 8191 float dist = (n.x*(vWPosition.x - origin.x) + n.y*(vWPosition.y - origin.y) + n.z*(vWPosition.z - origin.z)); 8192 return ( dist - near ) / ( far - near ); 8193 }`),i=new yt(`float vectorLinearObjectSpaceDepth(vec3 direction, vec3 origin, float near, float far) { 8194 vec3 n = normalize(direction); 8195 float dist = (n.x*(position.x - origin.x) + n.y*(position.y - origin.y) + n.z*(position.z - origin.z)); 8196 return ( dist - near ) / ( far - near ); 8197 }`),r=new yt(`float vectorSphericalWorldSpaceDepth(vec3 origin, float near, float far) { 8198 float dist = length(vWPosition - origin); 8199 return ( dist - near ) / ( far - near ); 8200 }`),n=new yt(`float vectorSphericalObjectSpaceDepth(vec3 origin, float near, float far) { 8201 float dist = length(position - origin); 8202 return ( dist - near ) / ( far - near ); 8203 }`);return{vectorLinearWorldSpaceDepth:t,vectorLinearObjectSpaceDepth:i,vectorSphericalWorldSpaceDepth:r,vectorSphericalObjectSpaceDepth:n}}();var _2e=class extends fr{constructor(t,i,r,n,a,s,o,l){super("v3"),this.nodeType="Fresnel",this.color=t,this.bias=i,this.scale=r,this.intensity=n,this.factor=a,this.isMask=l,this.alpha=s,this.mode=o,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.require("vWorldViewDir"),t.require("worldNormal"),t.isShader("fragment")){t.addFragmentVariable(this.calpha,"float");
8203let r=new yt(`vec3 fresnel(vec3 color, float bias, float scale, float intensity, float factor, bool isMask, float mask, float alpha, int mode, out float calpha) { 8204 float fresnel = bias + scale * pow( abs( factor + dot( normalize( vWorldViewDir ), normalize( vWNormal ) ) ), intensity ); 8205 8206 float lalpha = clamp(fresnel, 0.0, 1.0) * alpha * mask; 8207 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 8208 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8209 8210 return color; 8211 }`),n=t.include(r),a=[];return a.push(this.color.build(t,"c")),a.push(this.bias.build(t,"f")),a.push(this.scale.build(t,"f")),a.push(this.intensity.build(t,"f")),a.push(this.factor.build(t,"f")),a.push(this.isMask.build(t,"b")),a.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),a.push(this.alpha.build(t,"f")),a.push(this.mode.build(t,"i")),a.push(this.calpha),t.format(n+"("+a.join(",")+")",this.getType(t),i)}else return console.warn("FresnelNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},vX=class extends fr{constructor(t,i,r,n,a,s,o,l,c){super("v3"),this.nodeType="Gradient",this.gradientType=t,this.smooth=i,this.colors=r,this.steps=n,this.offset=a,this.morph=s,this.angle=o,this.isMask=c,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.isShader("fragment")){t.define("GRAD_MAX",10),t.require("uv"),t.requires.uv=[!0],t.addFragmentVariable(this.calpha,"float");let r=t.include(vX.Nodes.gradient),n=[];return n.push(this.gradientType.build(t,"i")),n.push(this.smooth.build(t,"b")),n.push(this.colors.build(t,"v4[]")),n.push(this.steps.build(t,"f[]")),n.push(this.offset.build(t,"v2")),n.push(this.morph.build(t,"v2")),n.push(this.angle.build(t,"f")),n.push(this.isMask.build(t,"b")),n.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.calpha),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("GradientNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},_X=vX;_X.Nodes=function(){return{gradient:new yt(`vec3 gradient(int gradientType, bool smoothed, vec4 colors[GRAD_MAX], float steps[GRAD_MAX], vec2 offset, vec2 morph, float angle, bool isMask, float mask, float alpha, out float calpha) { 8212 vec4 color = colors[0]; 8213 vec2 m = morph / vUv.xy; 8214 vec2 rot = vec2( 0.5 + m.x, m.y ); 8215 vec2 dt = vec2( 8216 cos( angle ) * rot.x - sin( angle ) * rot.y, 8217 sin( angle ) * rot.x + cos( angle ) * rot.y 8218 ); 8219 vec2 pt = ( vUv - 0.5 + offset ) / 2.0 + dt / 2.0; 8220 float t = dot( pt, dt ) / dot( dt, dt ); 8221 if ( gradientType == 1 ) { 8222 t = distance ( 8223 ( vUv + morph ) * 3.0, 8224 ( vUv + offset ) + 1.0 8225 ) + angle; 8226 } else if ( gradientType == 2 ) { 8227 float polar = atan( 8228 vUv.x + morph.x - 0.5 + offset.x, 8229 vUv.y + morph.y - 0.5 + offset.y 8230 ) * -1.0; 8231 t = fract( ( angle / PI / -2.0 ) + 0.5 * ( polar / PI ) ); 8232 } 8233 8234 float p; 8235 if (smoothed) { 8236 for ( int i = 1; i < GRAD_MAX; i++ ) { 8237 p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); 8238 color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); 8239 } 8240 8241 } else { 8242 for ( int i = 1; i < GRAD_MAX; i++ ) { 8243 p = clamp( ( t - steps[i-1] ) / ( steps[i] - steps[i-1] ), 0.0, 1.0 ); 8244 color = mix(color, colors[i], p); 8245 } 8246 } 8247 8248 float lalpha = alpha * color.a * mask; 8249 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 8250 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8251 8252 return color.xyz; 8253 }`)}}();var yX=class extends fr{constructor(t,i,r,n,a){super("v3"),this.nodeType="Matcap",this.texture=t,this.isMask=n,this.alpha=i,this.mode=r,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`,this.rotation=a}generate(t,i){if(t.isShader("fragment")){t.addFragmentVariable(this.calpha,"float");let r=t.include(yX.Nodes.matcap);t.require("normal"),t.requires.normal=!0;let n=[];return n.push(this.texture.generate(t,"t")),n.push("normal"),n.push(this.isMask.build(t,"b")),n.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.mode.build(t,"i")),n.push(this.calpha),n.push(this.rotation.build(t,"f")),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("MatcapNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},EX=yX;EX.Nodes=function(){return{matcap:new yt(`vec3 matcap(sampler2D matcapTex, vec3 normal, bool isMask, float mask, float alpha, int mode, out float calpha, float rotation) { 8254 vec3 viewDir = normalize( vViewPosition ); 8255 vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); 8256 vec3 y = cross( viewDir, x ); 8257 vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ); 8258 uv = mat2( cos(rotation), sin(rotation), -sin(rotation), cos(rotation) ) * uv; 8259 uv = uv * 0.495 + 0.5;
8260 vec4 matcapColor = texture2D( matcapTex, uv ); 8261 8262 float lalpha = alpha * mask; 8263 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 8264 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8265 8266 return matcapColor.rgb; 8267 }`)}}();var sU=(t=>(t.SIMPLEX="simplex3d",t.SIMPLEX_FRACTAL="simplex3dFractal",t.ASHIMA="simplexAshima",t.FBM="fbm",t.PERLIN="perlin",t.VORONOI="voronoi",t))(sU||{}),to=function(){let t=new yt(`vec3 random3(vec3 c) { 8268 float j = 4096.0*sin(dot(c,vec3(17.0, 59.4, 15.0))); 8269 vec3 r; 8270 r.z = fract(512.0*j); 8271 j *= .125; 8272 r.x = fract(512.0*j); 8273 j *= .125; 8274 r.y = fract(512.0*j); 8275 return r-0.5; 8276 }`),i=new yt(`float simplex3d(vec3 p) { 8277 vec3 s = floor(p + dot(p, vec3(F3))); 8278 vec3 x = p - s + dot(s, vec3(G3)); 8279 8280 vec3 e = step(vec3(0.0), x - x.yzx); 8281 vec3 i1 = e*(1.0 - e.zxy); 8282 vec3 i2 = 1.0 - e.zxy*(1.0 - e); 8283 8284 vec3 x1 = x - i1 + G3; 8285 vec3 x2 = x - i2 + 2.0*G3; 8286 vec3 x3 = x - 1.0 + 3.0*G3; 8287 8288 vec4 w, d; 8289 8290 w.x = dot(x, x); 8291 w.y = dot(x1, x1); 8292 w.z = dot(x2, x2);
8293 w.w = dot(x3, x3); 8294 8295 w = max(0.6 - w, 0.0); 8296 8297 d.x = dot(random3(s), x); 8298 d.y = dot(random3(s + i1), x1); 8299 d.z = dot(random3(s + i2), x2); 8300 d.w = dot(random3(s + 1.0), x3); 8301 8302 w *= w; 8303 w *= w; 8304 d *= w; 8305 8306 return dot(d, vec4(52.0)); 8307 }`,[t]);i.keywords.F3=new hr("float F3 0.3333333"),i.keywords.G3=new hr("float G3 0.1666667");let r=new yt(`float simplex3dFractal(vec3 m) { 8308 mat3 rot1 = mat3(-0.37, 0.36, 0.85,-0.14,-0.93, 0.34,0.92, 0.01,0.4); 8309 mat3 rot2 = mat3(-0.55,-0.39, 0.74, 0.33,-0.91,-0.24,0.77, 0.12,0.63); 8310 mat3 rot3 = mat3(-0.71, 0.52,-0.47,-0.08,-0.72,-0.68,-0.7,-0.45,0.56); 8311 return 0.5333333 * simplex3d(m * rot1) 8312 + 0.2666667 * simplex3d(2.0 * m * rot2) 8313 + 0.1333333 * simplex3d(4.0 * m * rot3) 8314 + 0.0666667 * simplex3d(8.0 * m); 8315 }`,[i]),n=new yt("vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);}"),a=new yt("vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;}"),s=new yt(`float simplexAshima(vec3 v) { 8316 const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; 8317 const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); 8318 vec3 i = floor(v + dot(v, C.yyy) ); 8319 vec3 x0 = v - i + dot(i, C.xxx) ; 8320 vec3 g = step(x0.yzx, x0.xyz); 8321 vec3 l = 1.0 - g; 8322 vec3 i1 = min( g.xyz, l.zxy ); 8323 vec3 i2 = max( g.xyz, l.zxy ); 8324 vec3 x1 = x0 - i1 + 1.0 * C.xxx; 8325 vec3 x2 = x0 - i2 + 2.0 * C.xxx; 8326 vec3 x3 = x0 - 1. + 3.0 * C.xxx; 8327 i = mod(i, 289.0 ); 8328 vec4 p = permute( permute( permute( 8329 i.z + vec4(0.0, i1.z, i2.z, 1.0 )) 8330 + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) 8331 + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); 8332 float n_ = 1.0/7.0; // N=7 8333 vec3 ns = n_ * D.wyz - D.xzx; 8334 vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) 8335 vec4 x_ = floor(j * ns.z); 8336 vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) 8337 vec4 x = x_ *ns.x + ns.yyyy; 8338 vec4 y = y_ *ns.x + ns.yyyy; 8339 vec4 h = 1.0 - abs(x) - abs(y); 8340 vec4 b0 = vec4( x.xy, y.xy ); 8341 vec4 b1 = vec4( x.zw, y.zw ); 8342 vec4 s0 = floor(b0)*2.0 + 1.0; 8343 vec4 s1 = floor(b1)*2.0 + 1.0; 8344 vec4 sh = -step(h, vec4(0.0)); 8345 vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; 8346 vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; 8347 vec3 p0 = vec3(a0.xy,h.x); 8348 vec3 p1 = vec3(a0.zw,h.y); 8349 vec3 p2 = vec3(a1.xy,h.z); 8350 vec3 p3 = vec3(a1.zw,h.w); 8351 vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 8352 p0 *= norm.x; 8353 p1 *= norm.y; 8354 p2 *= norm.z; 8355 p3 *= norm.w; 8356 vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); 8357 m = m * m; 8358 return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), 8359 dot(p2,x2), dot(p3,x3) ) ); 8360 }`,[n,a]),o=new yt("vec4 mod289(vec4 x){return x - floor(x * (1.0 / 289.0)) * 289.0;}"),l=new yt("vec4 perm(vec4 x){return mod289(((x * 34.0) + 1.0) * x);}",[o]),c=new yt(`float noise(vec3 p){ 8361 vec3 a = floor(p); 8362 vec3 d = p - a; 8363 d = d * d * (3.0 - 2.0 * d); 8364 vec4 b = a.xxyy + vec4(0.0, 1.0, 0.0, 1.0); 8365 vec4 k1 = perm(b.xyxy); 8366 vec4 k2 = perm(k1.xyxy + b.zzww); 8367 vec4 c = k2 + a.zzzz; 8368 vec4 k3 = perm(c); 8369 vec4 k4 = perm(c + 1.0); 8370 vec4 o1 = fract(k3 * (1.0 / 41.0)); 8371 vec4 o2 = fract(k4 * (1.0 / 41.0)); 8372 vec4 o3 = o2 * d.z + o1 * (1.0 - d.z); 8373 vec2 o4 = o3.yw * d.x + o3.xz * (1.0 - d.x); 8374 return o4.y * d.y + o4.x * (1.0 - d.y); 8375 }`,[l]),h=new yt(`float fbm(vec3 x) { 8376 float v = 0.0; 8377 float a = 0.5; 8378 vec3 shift = vec3(100); 8379 for (int i = 0; i < NUM_OCTAVES; ++i) { 8380 v += a * noise(x); 8381 x = x * 2.0 + shift; 8382 a *= 0.5; 8383 } 8384 return v; 8385 }`,[c]);h.keywords.NUM_OCTAVES=new hr("int NUM_OCTAVES 5");let u=new yt("vec3 fade(vec3 t) {return t*t*t*(t*(t*6.0-15.0)+10.0);}"),d=new yt(`float perlin(vec3 P){ 8386 vec3 Pi0 = floor(P); 8387 vec3 Pi1 = Pi0 + vec3(1.0); 8388 Pi0 = mod(Pi0, 289.0); 8389 Pi1 = mod(Pi1, 289.0); 8390 vec3 Pf0 = fract(P); 8391 vec3 Pf1 = Pf0 - vec3(1.0); 8392 vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 8393 vec4 iy = vec4(Pi0.yy, Pi1.yy); 8394 vec4 iz0 = Pi0.zzzz; 8395 vec4 iz1 = Pi1.zzzz; 8396 vec4 ixy = permute(permute(ix) + iy); 8397 vec4 ixy0 = permute(ixy + iz0); 8398 vec4 ixy1 = permute(ixy + iz1); 8399 vec4 gx0 = ixy0 / 7.0; 8400 vec4 gy0 = fract(floor(gx0) / 7.0) - 0.5; 8401 gx0 = fract(gx0); 8402 vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); 8403 vec4 sz0 = step(gz0, vec4(0.0)); 8404 gx0 -= sz0 * (step(0.0, gx0) - 0.5); 8405 gy0 -= sz0 * (step(0.0, gy0) - 0.5); 8406 vec4 gx1 = ixy1 / 7.0; 8407 vec4 gy1 = fract(floor(gx1) / 7.0) - 0.5; 8408 gx1 = fract(gx1); 8409 vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); 8410 vec4 sz1 = step(gz1, vec4(0.0)); 8411 gx1 -= sz1 * (step(0.0, gx1) - 0.5); 8412 gy1 -= sz1 * (step(0.0, gy1) - 0.5); 8413 vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); 8414 vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); 8415 vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); 8416 vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); 8417 vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); 8418 vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); 8419 vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); 8420 vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); 8421 vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); 8422 g000 *= norm0.x; 8423 g010 *= norm0.y; 8424 g100 *= norm0.z; 8425 g110 *= norm0.w; 8426 vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); 8427 g001 *= norm1.x; 8428 g011 *= norm1.y; 8429 g101 *= norm1.z; 8430 g111 *= norm1.w; 8431 float n000 = dot(g000, Pf0); 8432 float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); 8433 float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); 8434 float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); 8435 float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); 8436 float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); 8437 float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); 8438 float n111 = dot(g111, Pf1); 8439 vec3 fade_xyz = fade(Pf0); 8440 vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); 8441 vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); 8442 float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); 8443 return 2.2 * n_xyz; 8444 }`,[n,a,u]),A=new yt(`float hashwithoutsine13(vec3 p3) 8445 { 8446 p3 = fract(p3 * .1031); 8447 p3 += dot(p3, p3.yzx + 33.33); 8448 return fract((p3.x + p3.y) * p3.z); 8449 }`),f=new yt(`vec3 hashwithoutsine33(vec3 p3) 8450 { 8451 p3 = fract(p3 * vec3(.1031, .1030, .0973)); 8452 p3 += dot(p3, p3.yxz+33.33); 8453 return fract((p3.xxy + p3.yxx)*p3.zyx); 8454 }`),m=new yt(`float metric(in vec3 p) 8455 { 8456 // L2 8457 return length(p); 8458 8459 // Chebyshev 8460 // vec3 a = abs(p); 8461 // return max(a.x, max(a.y, a.z)); 8462 }`),g=new yt(`float smin( float a, float b, float k ) 8463 { 8464 float h = smoothstep(0.0, 1.0, 0.5 + 0.5 * (b - a) / k); 8465 float correction = k * h * (1.0 - h); 8466 return mix(b, a, h) - correction; 8467 }`),p=new yt(`float smax( float a, float b, float k ) 8468 { 8469 float h = smoothstep(1.0, 0.0, 0.5 + 0.5 * (a - b) / k); 8470 float correction = k * h * (1.0 - h); 8471 return mix(a, b, h) + correction; 8472 }`),v=new yt(`float remap(float value, float input_min, float input_max, float output_min, float output_max) { 8473 // Compute width of each interval 8474 float input_width = input_max - input_min; 8475 float output_width = output_max - output_min; 8476 8477 // Convert input range into a 0-1 range 8478 float scaled = (value - input_min) / input_width; 8479 8480 // Convert the 0-1 range into a value in output range 8481 return output_min + (scaled * output_width); 8482 }`),_=new yt(`float voronoi(in vec3 x, in int style, in float smoothness, in float seed, in int quality) 8483 { 8484 // Integer and fractional parts of this point's coordinates
8485 ivec3 p = ivec3(floor(x)); 8486 vec3 f = fract(x); 8487 8488 // Different variables that we will use to construct noise: 8489 // 8490 // f1: distance to the closest feature point 8491 // f2: distance to the second closest feature point 8492 // e: distance to the closest edge (cell boundary) 8493 // 8494 // We also compute "smooth" versions of all of the above quantites, essentially 8495 // replacing "hard" minimums with "smooth" minimums (described by IQ) 8496 float f1_smooth = 8.0; 8497 float f1 = 8.0; 8498 float f2_smooth = 8.0; 8499 float f2 = 8.0; 8500 float e_smooth = 8.0; 8501 float e = 8.0; 8502 8503 // Variables stored from closest cell 8504 ivec3 mb; 8505 vec3 mr; 8506 8507 int steps = quality; 8508 8509 for (int x = -steps; x <= steps; x++) 8510 for (int y = -steps; y <= steps; y++) 8511 for (int z = -steps; z <= steps; z++) 8512 { 8513 ivec3 b = ivec3(x, y, z); 8514 vec3 r = vec3(b) + hashwithoutsine33(vec3(p + b) + seed) - f; 8515 float d = length(r); 8516 8517 f1_smooth = smin(d, f1_smooth, smoothness); 8518 8519 // Store un-smoothed distances too 8520 if (d < f1) 8521 { 8522 f2 = f1; 8523 f1 = d; 8524 8525 mb = ivec3(x, y, z); 8526 mr = r; 8527 } 8528 else if (d < f2) 8529 { 8530 f2 = d; 8531 } 8532 } 8533 8534 float id = hashwithoutsine13(vec3(p + mb) + seed); 8535 8536 // Second pass for edge distance 8537 for (int x = -steps; x <= steps; x++) 8538 for (int y = -steps; y <= steps; y++) 8539 for (int z = -steps; z <= steps; z++) 8540 { 8541 // Start search at the cell that contains the closest point to "x" (found in 1st pass) 8542 ivec3 b = mb + ivec3(x, y, z); 8543 vec3 r = vec3(b) + hashwithoutsine33(vec3(p + b) + seed) - f; 8544 float d1 = dot(0.5 * (mr + r), (r - mr)); // IQ normalizes "r - mr" but that breaks things for the smooth version? 8545 float d2 = dot(0.5 * (mr + r), normalize(r - mr)); 8546 8547 e_smooth = smin(d1, e_smooth, smoothness); 8548 8549 e = min(e, d2); 8550 8551 // Also compute a smooth version of F2 in this pass 8552 { 8553 ivec3 b = ivec3(x, y, z); 8554 if (b != mb) 8555 { 8556 vec3 r = vec3(b) + hashwithoutsine33(vec3(p + b) + seed) - f; 8557 float d = length(r); 8558 8559 f2_smooth = smin(d, f2_smooth, smoothness); 8560 } 8561 } 8562 } 8563 8564 // Different visualization modes 8565 if (style == 0) 8566 { 8567 return f1_smooth; 8568 } 8569 if (style == 1) 8570 { 8571 return f2_smooth; 8572 } 8573 if (style == 2) 8574 { 8575 return f2_smooth - f1_smooth; 8576 8577 // "Pebbles" also cool 8578 //return step(0.2, f2_smooth - f1_smooth); 8579 } 8580 if (style == 3) 8581 { 8582 // This one is really good for rock / stone effects 8583 float a = f1; 8584 float b = f2; 8585 float k = 3.0; 8586 float h = max(k - abs(a - b), 0.0) / k; 8587 float final = min(a, b) - h * h * k * (1.0 / 4.0); 8588 return final; 8589 } 8590 if (style == 4) 8591 { 8592 // Some random adjustments to make this style stand out more 8593 return exp(5.0 * e_smooth); 8594 } 8595 if (style == 5) 8596 { 8597 return pow(f1_smooth, 3.0); 8598 } 8599 if (style == 6) 8600 { 8601 const float eps = 0.0125; 8602 8603 // Thicker lines as the user increases the smoothness slider 8604 float thickness = smoothness * 0.25 + eps; 8605 8606 // Blurrier lines as the user increases the smoothness slider 8607 float blur = pow(smoothness, 3.0) * 0.25 + eps; 8608 8609 return smoothstep( 8610 thickness - thickness * blur, 8611 thickness + thickness * blur, 8612 e 8613 ); 8614 } 8615 if (style == 7) 8616 { 8617 return hashwithoutsine13(vec3(p + mb) + seed); 8618 } 8619 } 8620 `,[A,f,m,g,p,v]);return{simplex:i,simplexFractal:r,simplexAshima:s,fbm:h,perlin:d,voronoi:_}}(),wX=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h,u,d,A,f,m,g,p,v,_){super("v3"),this.nodeType="Noise",this.scale=t,this.size=i,this.move=r,this.fA=n,this.fB=a,this.distortion=s,this.colorA=o,this.colorB=l,this.colorC=c,this.colorD=h,this.noiseType=d,this.voronoiStyle=f,this.highCut=m,this.lowCut=g,this.smoothness=p,this.seed=v,this.quality=_,this.isMask=A,this.alpha=u,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i,r,n,a){t.require("uv"),t.requires.uv=[!0],t.addFragmentVariable(this.calpha,"float");let s=Object.values(sU)[this.noiseType.value],o=s=="voronoi"?` 8621 float v = ${s}(st + move, voronoiStyle, smoothness, seed, quality); 8622 8623 // Apply clipping to colors 8624 v = remap(v, lowCut, highCut, 0.0, 1.0); 8625 v = smax(v, 0.0, smoothness * 0.25); 8626 v = smin(v, 1.0, smoothness * 0.25); 8627 8628 // Note that the voronoi mode only uses colors "A" and "C" from the UI 8629 vec4 color = mix(colorA, colorC, v); 8630 `:` 8631 vec3 q = vec3(${s}(st), 8632 ${s}(st + vec3(1.0)), 8633 ${s}(st + vec3(1.0))); 8634 vec3 r = vec3(${s}
8634(st + vec3(distortion, 1.0) * q + vec3(fA, 1.0) + move), 8635 ${s}(st + vec3(distortion, 1.0) * q + vec3(fB, 1.0) + move), 8636 ${s}(st * q)); 8637 float f = ${s}(st + r); 8638 vec4 color; 8639 color = mix(colorA, colorB, clamp((f * f) * 4.0, 0.0, 1.0)); 8640 color = mix(color, colorC, clamp(length(q), 0.0, 1.0)); 8641 color = mix(color, colorD, clamp(length(r.x), 0.0, 1.0)); 8642 `,l=new yt(`vec3 ${s}customNoise(float scale, vec3 size, float move, vec2 fA, vec2 fB, vec2 distortion, vec4 colorA, vec4 colorB, vec4 colorC, vec4 colorD, int voronoiStyle, float highCut, float lowCut, float smoothness, float seed, int quality, bool isMask, float mask, float alpha, out float calpha) 8643 { 8644 // Prevent scale of zero 8645 scale = max(abs(scale), 0.001); 8646 8647 vec3 st = position / size; 8648 st /= scale; 8649 8650 ${o} 8651 8652 float lalpha = alpha * color.a * mask; 8653 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 8654 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8655 8656 return clamp(color, 0.0, 1.0).rgb; 8657 }`,[to.simplex,to.simplexFractal,to.simplexAshima,to.fbm,to.perlin,to.voronoi]),c=t.include(l),h=[];return h.push(this.scale.build(t,"f")),h.push(this.size.build(t,"v3")),h.push(this.move.build(t,"f")),h.push(this.fA.build(t,"v2")),h.push(this.fB.build(t,"v2")),h.push(this.distortion.build(t,"v2")),h.push(this.colorA.build(t,"v4")),h.push(this.colorB.build(t,"v4")),h.push(this.colorC.build(t,"v4")),h.push(this.colorD.build(t,"v4")),h.push(this.voronoiStyle.build(t,"i")),h.push(this.highCut.build(t,"f")),h.push(this.lowCut.build(t,"f")),h.push(this.smoothness.build(t,"f")),h.push(this.seed.build(t,"f")),h.push(this.quality.build(t,"i")),h.push(this.isMask.build(t,"b")),h.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),h.push(this.alpha.build(t,"f")),h.push(this.calpha),t.format(c+"("+h.join(",")+")",this.getType(t),i)}};wX.numOctaves=5;var bX=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h,u,d,A,f,m,g){super("v3"),this.nodeType="Outline",this.firstTime=!0,this.outlineColor=t,this.contourColor=i,this.outlineWidth=r,this.contourWidth=n,this.contourThreshold=a,this.outlineThreshold=s,this.contourFrequency=o,this.outlineSmoothing=l,this.contourDirection=c,this.positionalLines=h,this.compensation=u,this.resolution=d,this.normalMap=A,this.depthMap=f,this.pixelRatio=m,this.alpha=g,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){let r=`g${this.uuid.toString().replace(/-/g,"")}`;if(t.require("vWorldViewDir"),t.require("worldNormal"),t.extensions.derivatives=!0,this.compensation.value&&t.define("OUTLINE_COMPENSATION",`${r}_offset`),this.firstTime){let n=this.outlineWidth.build(t,"f"),a=this.resolution.build(t,"v2"),s=this.compensation.build(t,"b"),o=this.pixelRatio.build(t,"f");t.addVertexParsVariable("randomColor","attribute vec3"),t.addVertexParsVariable("extrudeNormal","attribute vec3"),t.addVertexParsVariable(n,"uniform float"),t.addVertexParsVariable(a,"uniform vec2"),t.addVertexParsVariable(s,"uniform bool"),t.addVertexParsVariable(o,"uniform float"),t.addVertexParsVariable("vID","flat out float"),t.addFragmentParsVariable("vID","flat in float"),t.addVertexFinalCode(` 8658 vID = randomColor.r; 8659 vec2 ${r}_offset = vec2(0.0); 8660 if (${s}) { 8661 vec4 ${r}_clipPosition = projectionMatrix * (modelViewMatrix * vec4(transformed, 1.0)); 8662 // NOTE: For certain shapes, like spheres, we get incorrect extrusion when the 8663 // normals face the camera directly. So we hackily fix this by offsetting the normal 8664 // by a tiny amount. 8665 vec3 ${r}_clipNormal = mat3(projectionMatrix) * (mat3(modelViewMatrix) * extrudeNormal) + 0.0000001; 8666 ${r}_offset = normalize(${r}_clipNormal.xy) / ${a} * (${n} / 2.0) * ${r}_clipPosition.w * 2.0 * ${o}; 8667 ${r}_clipPosition.xy += ${r}_offset; 8668 // TODO(MAX): To handle multiple outline layers, we only want to extrude 8669 // if this offset is the biggest of all the potential offsets 8670 gl_Position = ${r}_clipPosition; 8671 } 8672 `)}if(t.isShader("fragment")){t.require("uv"),t.requires.uv=[!0],t.addFragmentVariable(this.calpha,"float");let n=t.include(bX.Nodes.outline),a=[];return a.push(this.outlineColor.build(t,"c")),a.push(this.contourColor.build(t,"c")),a.push(this.outlineWidth.build(t,"f")),a.push(this.contourWidth.build(t,"f")),a.push(this.contourThreshold.build(t,"f")),a.push(this.outlineThreshold.build(t,"f")),a.push(this.contourFrequency.build(t,"f")),a.push(this.outlineSmoothing.build(t,"f")),a.push(this.contourDirection.build(t,"v3")),a.push(this.positionalLines.build(t,"b")),a.push(this.resolution.build(t,"v2")),a.push(this.normalMap.getTexture(t,"t")),a.push(this.depthMap.getTexture(t,"t")),a.push(this.pixelRatio.build(t,"f")),a.push(this.compensation.build(t,"b")),a.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),a.push(this.alpha.build(t,"f")),a.push(this.calpha),this.firstTime=!this.firstTime,t.format(n+"("+a.join(",")+")",this.getType(t),i)}else return console.warn("OutlineNode is not compatible with "+t.shader+" shader."),""}},SX=bX;SX.Nodes=function(){let t=new yt(` 8673float sobelSample(sampler2D t, sampler2D d, vec2 uv, vec2 resolution, float outlineWidth, float pixelRatio) 8674{ 8675 vec2 halton = haltonSequence[frameIndex]; 8676 float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton); 8677 float temporalAngle = temporalOffset * PI2; 8678 8679 vec2 texelSize = (vec2(1.0) / resolution); 8680 vec2 offsetSize = texelSize * outlineWidth * pixelRatio; 8681 8682 vec2 uvSamples[9]; 8683 vec4 normalSamples[9]; 8684 8685 uvSamples[0] = uv + vec2( -offsetSize.x, -offsetSize.y) + (vogelDiskSample(0, 9, temporalAngle) * texelSize); 8686 uvSamples[1] = uv + vec2(0.0, -offsetSize.y) + (vogelDiskSample(1, 9, temporalAngle) * texelSize); 8687 uvSamples[2] = uv + vec2( offsetSize.x, -offsetSize.y) + (vogelDiskSample(2, 9, temporalAngle) * texelSize);
8688 uvSamples[3] = uv + vec2( -offsetSize.x, 0.0) + (vogelDiskSample(3, 9, temporalAngle) * texelSize); 8689 uvSamples[4] = uv; 8690 uvSamples[5] = uv + vec2( offsetSize.x, 0.0) + (vogelDiskSample(5, 9, temporalAngle) * texelSize); 8691 uvSamples[6] = uv + vec2( -offsetSize.x, offsetSize.y) + (vogelDiskSample(6, 9, temporalAngle) * texelSize); 8692 uvSamples[7] = uv + vec2(0.0, offsetSize.y) + (vogelDiskSample(7, 9, temporalAngle) * texelSize); 8693 uvSamples[8] = uv + vec2( offsetSize.x, offsetSize.y) + (vogelDiskSample(8, 9, temporalAngle) * texelSize); 8694 8695 8696 normalSamples[0] = texture2D(t, uvSamples[0]); 8697 normalSamples[1] = texture2D(t, uvSamples[1]); 8698 normalSamples[2] = texture2D(t, uvSamples[2]); 8699 normalSamples[3] = texture2D(t, uvSamples[3]); 8700 normalSamples[4] = texture2D(t, uvSamples[4]); 8701 normalSamples[5] = texture2D(t, uvSamples[5]); 8702 normalSamples[6] = texture2D(t, uvSamples[6]); 8703 normalSamples[7] = texture2D(t, uvSamples[7]); 8704 normalSamples[8] = texture2D(t, uvSamples[8]); 8705 8706 float depthBias = 0.0001; 8707 // TODO(MAX): Can we somehow reduce the number of conditionals here with MATH?! 8708 if (normalSamples[0].a != vID && normalSamples[0].a != 0.0) { 8709 float depthAtSample = texture2D(d, uvSamples[0]).r + depthBias; 8710 if (gl_FragCoord.z > depthAtSample) { 8711 return 0.0; 8712 } 8713 } 8714 8715 if (normalSamples[1].a != vID && normalSamples[1].a != 0.0) { 8716 float depthAtSample = texture2D(d, uvSamples[1]).r + depthBias; 8717 if (gl_FragCoord.z > depthAtSample) { 8718 return 0.0; 8719 } 8720 } 8721 8722 if (normalSamples[2].a != vID && normalSamples[2].a != 0.0) { 8723 float depthAtSample = texture2D(d, uvSamples[2]).r + depthBias; 8724 if (gl_FragCoord.z > depthAtSample) { 8725 return 0.0; 8726 } 8727 } 8728 8729 if (normalSamples[3].a != vID && normalSamples[3].a != 0.0) { 8730 float depthAtSample = texture2D(d, uvSamples[3]).r + depthBias; 8731 if (gl_FragCoord.z > depthAtSample) { 8732 return 0.0; 8733 } 8734 } 8735 8736 8737 if (normalSamples[4].a != vID && normalSamples[4].a != 0.0) { 8738 float depthAtSample = texture2D(d, uvSamples[4]).r + depthBias; 8739 if (gl_FragCoord.z > depthAtSample) { 8740 return 0.0; 8741 } 8742 } 8743 8744 if (normalSamples[5].a != vID && normalSamples[5].a != 0.0) { 8745 float depthAtSample = texture2D(d, uvSamples[5]).r + depthBias; 8746 if (gl_FragCoord.z > depthAtSample) { 8747 return 0.0; 8748 } 8749 } 8750 8751 if (normalSamples[6].a != vID && normalSamples[6].a != 0.0) { 8752 float depthAtSample = texture2D(d, uvSamples[6]).r + depthBias; 8753 if (gl_FragCoord.z > depthAtSample) { 8754 return 0.0; 8755 } 8756 } 8757 8758 if (normalSamples[7].a != vID && normalSamples[7].a != 0.0) { 8759 float depthAtSample = texture2D(d, uvSamples[7]).r + depthBias; 8760 if (gl_FragCoord.z > depthAtSample) { 8761 return 0.0; 8762 } 8763 } 8764 8765 if (normalSamples[8].a != vID && normalSamples[8].a != 0.0) { 8766 float depthAtSample = texture2D(d, uvSamples[8]).r + depthBias; 8767 if (gl_FragCoord.z > depthAtSample) { 8768 return 0.0; 8769 } 8770 } 8771 8772 vec3 sobel_edge_h = normalSamples[2].rgb + (2.0*normalSamples[5].rgb) + normalSamples[8].rgb - (normalSamples[0].rgb + (2.0*normalSamples[3].rgb) + normalSamples[6].rgb); 8773 vec3 sobel_edge_v = normalSamples[0].rgb + (2.0*normalSamples[1].rgb) + normalSamples[2].rgb - (normalSamples[6].rgb + (2.0*normalSamples[7].rgb) + normalSamples[8].rgb); 8774 8775 float edgeNormal = sqrt(dot(sobel_edge_h, sobel_edge_h) + dot(sobel_edge_v, sobel_edge_v)); 8776 return edgeNormal; 8777} 8778`);return{outline:new yt(`vec3 outline(vec3 outlineColor, vec3 contourColor, float outlineWidth, float contourWidth, float outlineThreshold, float contourThreshold, float outlineSmoothing, float contourFrequency, vec3 contourDirection, bool positionalLines, vec2 resolution, sampler2D normalMap, sampler2D depthMap, float pixelRatio, bool compensation, float mask, float alpha, out float calpha) { 8779 vec3 result = outlineColor; 8780 float resultAlpha = 0.0; 8781 8782 vec3 N = normalize(vWNormal); 8783 vec2 nuv = (gl_FragCoord.xy / resolution); 8784 float sobelSample = compensation ? sobelSample(normalMap, depthMap, nuv, resolution, outlineWidth / 2., pixelRatio) : sobelSample(normalMap, depthMap, nuv, resolution, outlineWidth, pixelRatio); 8785 resultAlpha = smoothstep(outlineThreshold - outlineSmoothing, outlineThreshold + outlineSmoothing, sobelSample); 8786 8787 //resultAlpha = 1.0; 8788 //result = vec3(sobelSample); 8789 8790 float t = 1.0 - contourThreshold; 8791 if(positionalLines) { 8792 vec3 NDir = position * contourDirection; 8793 float NT = NDir.x + NDir.y + NDir.z; 8794 float f = fract(NT * contourFrequency * 0.01); 8795 float df = fwidth(NT * contourFrequency); 8796 8797 float g = smoothstep(df * (contourWidth * 0.01), df * (contourWidth * 0.01 * 2.0), f); 8798 if (g < 1.0 && resultAlpha == 0.0) { 8799 result = contourColor; 8800 resultAlpha = 1.0; 8801 } 8802 } 8803 else { 8804 vec3 NDir = N * contourDirection; 8805 float NT = NDir.x + NDir.y + NDir.z; 8806 float df = fwidth(NT * contourThreshold); 8807 float f = sin(NT * 1.0 * contourFrequency); 8808 float g = smoothstep(0.0, df * contourWidth, 1.0 - f); 8809 8810 if (df > (t * 0.5) && g < 1.0 && resultAlpha == 0.0) { 8811 result = contourColor; 8812 resultAlpha = 1.0 - g; 8813 } 8814 } 8815
8816 float lalpha = alpha * resultAlpha * mask; 8817 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 8818 accumAlpha += ( 1.0 - accumAlpha ) * lalpha; 8819 8820 return result; 8821 }`,[t])}}();var tu=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h,u,d,A,f,m,g,p,v){super("v3"),this.nodeType="Pattern",this.style=t,this.projection=i,this.axis=r,this.blending=n,this.offset=a,this.colorA=s,this.colorB=o,this.frequency=l,this.size=c,this.variation=h,this.smoothness=u,this.zigzag=d,this.rotation=A,this.vertical=f,this.horizontal=m,this.sides=g,this.isMask=v,this.alpha=p,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.isShader("fragment")){t.require("position"),t.require("uv"),t.requires.uv=[!0],t.require("normal"),t.requires.normal=!0,t.addFragmentVariable(this.calpha,"float");let r;switch(this.style.value){case 0:r="circle";break;case 1:r="ring";break;case 2:r="polygon";break;case 3:r="xcross";break;case 4:r="diamond";break;case 5:r="checkerboard";break;case 6:r="line";break;case 7:r="wave";break;default:r="circle";break}let n=`g${this.uuid.toString().replace(/-/g,"")}`,a=new yt(`float hashwithoutsine12(vec2 p) 8822 { 8823 vec3 p3 = fract(vec3(p.xyx) * .1031); 8824 p3 += dot(p3, p3.yzx + 33.33); 8825 return fract((p3.x + p3.y) * p3.z); 8826 }`),s=new yt(`vec2 rotate_uv(in vec2 uv, float a, bool repeat) 8827 { 8828 const float mid = 0.5; 8829 float radians = a * (PI / 180.0); 8830 vec2 rotated = vec2( 8831 cos(radians) * (uv.x - mid) + sin(radians) * (uv.y - mid) + mid, 8832 cos(radians) * (uv.y - mid) - sin(radians) * (uv.x - mid) + mid 8833 ); 8834 return repeat ? fract(rotated): rotated; 8835 }`),o="";if(this.projection.value===4){let u=this.style.value===2?`${r}(uv0, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)`:`${r}(uv0, frequency, size, variation, smoothness_remapped, zigzag, rotation)`,d=this.style.value===2?`${r}(uv1, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)`:`${r}(uv1, frequency, size, variation, smoothness_remapped, zigzag, rotation)`,A=this.style.value===2?`${r}(uv2, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)`:`${r}(uv2, frequency, size, variation, smoothness_remapped, zigzag, rotation)`;o=` 8836 vec3 p = position; 8837 float factor = 0.0125; 8838 vec2 uv0 = fract(p.xy * factor); 8839 vec2 uv1 = fract(p.zy * factor); 8840 vec2 uv2 = fract(p.xz * factor); 8841 8842 uv0 = rotate_uv(uv0 + offset, rotation, true); 8843 uv1 = rotate_uv(uv1 + offset, rotation, true); 8844 uv2 = rotate_uv(uv2 + offset, rotation, true); 8845 8846 float d0 = ${u}; 8847 float d1 = ${d}; 8848 float d2 = ${A}; 8849 8850 // Range from 3 to 128 seems to be good 8851 float exponent = (1.0 - blending) * 125.0 + 3.0; 8852 8853 vec3 n = vObjectNormal; 8854 vec3 weights = abs(normalize(n)); 8855 weights = pow(weights, vec3(exponent)); 8856 weights /= dot(weights, vec3(1.0)); 8857 d0 *= weights.z; 8858 d1 *= weights.x; 8859 d2 *= weights.y; 8860 float draw = d0 + d1 + d2; 8861 8862 vec2 custom_uv = uv0 * weights.z + uv1 * weights.x + uv2 * weights.y; 8863 `}else{let u=this.style.value===2?`${r}(custom_uv, frequency, size, variation, smoothness_remapped, zigzag, rotation, sides)`:`${r}(custom_uv, frequency, size, variation, smoothness_remapped, zigzag, rotation)`,d="";this.axis.value===0?d=`float radius = length(p); 8864 float theta = atan(p.y, p.z); 8865 float phi = acos(p.x / radius);`:this.axis.value===1?d=`float radius = length(p); 8866 float theta = atan(p.x, p.z); 8867 float phi = acos(p.y / radius);`:(this.axis.value,d=`float radius = length(p); 8868 float theta = atan(p.y, p.x); 8869 float phi = acos(p.z / radius);`);let A="";switch(this.projection.value){case 0:A="custom_uv = vUv.st;";break;case 1:break;case 2:A=` 8870 vec3 p = position; 8871 ${d} 8872 custom_uv = vec2(theta, phi); 8873 custom_uv /= PI; 8874 `;break}o=` 8875 vec2 custom_uv; 8876 ${A} 8877 8878 custom_uv += offset; 8879 custom_uv = fract(custom_uv); 8880 custom_uv = rotate_uv(custom_uv, rotation, true); 8881 8882 float draw = ${u}; 8883 `}let l=new yt(`vec3 ${n}_pattern(vec3 normal, float blending, int style, vec2 offset, vec4 colorA, vec4 colorB, vec2 frequency, float size, float variation, float smoothness, float zigzag, float rotation, vec2 vertical, vec2 horizontal, int sides, bool isMask, float mask, float alpha, out float calpha) { 8884 const float TWO_PI = PI * 2.0; 8885 float smoothness_remapped = pow(smoothness, 5.0); 8886 8887 ${o} 8888 8889 // Construct final output color 8890 vec4 color = mix(colorA, colorB, draw); 8891 color.a = clamp(color.a, 0.0, 1.0); 8892 8893 // Apply cuts 8894 color.a *= 8895 step(vertical.x, custom_uv.y) * 8896 step(custom_uv.y, vertical.y); 8897 color.a *= 8898 step(horizontal.x, abs(custom_uv.x)) * 8899 step(abs(custom_uv.x), horizontal.y); 8900 8901 // Accumulate alpha
8902 float lalpha = alpha * clamp(color.a, 0.0, 1.0) * mask; 8903 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 8904 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 8905 8906 return clamp(color, 0.0, 1.0).rgb; 8907 }`,[s,a,tu.DrawFunctions.circle,tu.DrawFunctions.ring,tu.DrawFunctions.polygon,tu.DrawFunctions.cross,tu.DrawFunctions.diamond,tu.DrawFunctions.checkerboard,tu.DrawFunctions.line,tu.DrawFunctions.wave]),c=t.include(l),h=[];return h.push("normal"),h.push(this.blending.build(t,"f")),h.push(this.style.build(t,"i")),h.push(this.offset.build(t,"v2")),h.push(this.colorA.build(t,"v4")),h.push(this.colorB.build(t,"v4")),h.push(this.frequency.build(t,"v2")),h.push(this.size.build(t,"f")),h.push(this.variation.build(t,"f")),h.push(this.smoothness.build(t,"f")),h.push(this.zigzag.build(t,"f")),h.push(this.rotation.build(t,"f")),h.push(this.vertical.build(t,"v2")),h.push(this.horizontal.build(t,"v2")),h.push(this.sides.build(t,"i")),h.push(this.isMask.build(t,"b")),h.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),h.push(this.alpha.build(t,"f")),h.push(this.calpha),t.format(c+"("+h.join(",")+")",this.getType(t),i)}else return console.warn("PatterNode is not compatible with "+t.shader+" shader."),t.format("vec3(0.0)",this.getType(t),i)}},CX=tu;CX.DrawFunctions=function(){let t=new yt(`float hashwithoutsine12(vec2 p) { 8908 vec3 p3 = fract(vec3(p.xyx) * 0.1031); 8909 p3 += dot(p3, p3.yzx + 33.33); 8910 return fract((p3.x + p3.y) * p3.z); 8911 }`),i=new yt(`vec2 tile_and_center(in vec2 uv, in vec2 frequency, in float variation, in float zigzag, in float rotation) { 8912 // Create tiles in UV-space 8913 uv *= frequency; 8914 8915 // Integer coords 8916 vec2 i = floor(uv); 8917 8918 // Offset every other row based on zigzag param, then compute fractional coords 8919 float row_offset = mod(i.y, 2.0); 8920 uv.x += row_offset * zigzag; 8921 vec2 f = fract(uv); 8922 8923 // Rotate the tile itself: 8924 // const float mid = 0.5; 8925 // f = vec2( 8926 // cos(rotation) * (f.x - mid) + sin(rotation) * (f.y - mid) + mid, 8927 // cos(rotation) * (f.y - mid) - sin(rotation) * (f.x - mid) + mid 8928 // ); 8929 // f = fract(f); 8930 8931 f = f * 2.0 - 1.0; 8932 8933 // Recompute integer coords after shifting - then, random value per tile 8934 i = floor(uv); 8935 float rand = (hashwithoutsine12(i) * 5.0 + 1.0); 8936 float jitter = mix(1.0, rand, variation); 8937 f *= jitter; 8938 8939 return f; 8940 }`,[t]),r=new yt(`float circle(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 8941 vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation); 8942 return smoothstep( 8943 -smoothness, 8944 smoothness, 8945 length(f) - size 8946 ); 8947 }`,[i]),n=new yt(`float ring(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 8948 vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation); 8949 8950 float d = length(f); 8951 const float inner_width = 0.5; 8952 8953 float outer = smoothstep(-smoothness, smoothness, d - size); 8954 float inner = smoothstep(-smoothness, smoothness, d - size * inner_width); 8955 return outer + (1.0 - inner); 8956 }`,[i]),a=new yt(`float sdf_ngon(in vec2 p, in float r, in int n) { 8957 float an = (PI * 2.0) / float(n); 8958 float he = r * tan(0.5 * an); 8959 8960 // Rotate to first sector 8961 p = -p.yx; 8962 float bn = an * floor((atan(p.y, p.x) + 0.5 * an) / an); 8963 vec2 cs = vec2(cos(bn), sin(bn)); 8964 p = mat2(cs.x, -cs.y, cs.y, cs.x)*p; 8965 8966 // Side of polygon 8967 return length(p - vec2(r, clamp(p.y, -he, he))) * sign(p.x - r); 8968 } 8969 8970 float polygon(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation, in int sides) { 8971 vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation); 8972 return smoothstep(-smoothness, smoothness, sdf_ngon(f, size, sides)); 8973 }`,[i]),s=new yt(`float sdf_cross(in vec2 p, in vec2 b, float r ) { 8974 p = abs(p);
8975 p = (p.y > p.x) ? p.yx : p.xy; 8976 vec2 q = p - b; 8977 float k = max(q.y, q.x); 8978 vec2 w = (k > 0.0) ? q : vec2(b.y - p.x, -k); 8979 return sign(k) * length(max(w, 0.0)) + r; 8980 } 8981 8982 // Avoid namespace conflicts 8983 float xcross(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 8984 vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation); 8985 return smoothstep(-smoothness, smoothness, sdf_cross(f, vec2(size, size * 0.25), smoothness)); 8986 }`,[i]),o=new yt(`float ndot(vec2 a, vec2 b) { 8987 return a.x*b.x - a.y*b.y; 8988 } 8989 8990 float sdf_diamond(in vec2 p, in vec2 b) { 8991 p = abs(p); 8992 float h = clamp(ndot(b - 2.0 * p, b) / dot(b, b), -1.0, 1.0); 8993 float d = length(p - 0.5 * b * vec2(1.0 - h, 1.0 + h)); 8994 return d * sign(p.x * b.y + p.y * b.x - b.x * b.y); 8995 } 8996 8997 float diamond(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 8998 vec2 f = tile_and_center(uv, frequency, variation, zigzag, rotation); 8999 return smoothstep(-smoothness, smoothness, sdf_diamond(f, vec2(size))); 9000 }`,[i]),l=new yt(`float checkerboard(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 9001 uv *= frequency; 9002 vec2 i = floor(uv); 9003 9004 float offset = mod(i.y, 2.0); 9005 9006 uv.x += offset + zigzag * offset; 9007 float x = floor(uv.x); 9008 9009 return mod(x, 2.0); 9010 }`),c=new yt(`float line(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 9011 vec2 f = tile_and_center(uv, frequency, 0.0, zigzag, rotation); 9012 9013 // Different approach for variation param here 9014 float row = floor(uv * frequency).y; 9015 float rand = hashwithoutsine12(vec2(row)); 9016 float s = mix(size, size * rand, variation); 9017 9018 return smoothstep( 9019 s - smoothness, 9020 s + smoothness, 9021 abs(f.y) 9022 ); 9023 }`,[i]),h=new yt(`// Uses bisection 9024 float udf_cos(in vec2 p, in float a, in float b, in float c, in float d) { 9025 // Convert all data to a primitive cosine wave 9026 p = c * (p - vec2(d, a)); 9027 9028 const float TWO_PI = PI * 2.0; 9029 9030 // Reduce to principal half cycle 9031 p.x = mod(p.x, TWO_PI); 9032 if (p.x > PI) { 9033 p.x = TWO_PI - p.x; 9034 } 9035 9036 // Find zero of derivative (minimize distance) 9037 float xa = 0.0; 9038 float xb = TWO_PI; 9039 9040 // 24 bit precision 9041 for (int i = 0; i < 24; i++) { 9042 float x = 0.5 * (xa + xb); 9043 float y = x - p.x + b * c * sin(x) * (p.y - b * c * cos(x)); 9044 if (y < 0.0) xa = x; 9045 else xb = x; 9046 } 9047 float x = 0.5 * (xa + xb); 9048 9049 // Compute distance 9050 vec2 q = vec2(x, b * c * cos(x)); 9051 return length(p - q) / c; 9052 } 9053 9054 float wave(in vec2 uv, in vec2 frequency, in float size, in float variation, in float smoothness, in float zigzag, in float rotation) { 9055 float repeat = frequency.x; 9056 uv *= repeat; 9057 vec2 i = floor(uv); 9058 float row_offset = mod(i.y, 2.0); 9059 uv.x += row_offset * zigzag; 9060 vec2 f = vec2(uv.x, fract(uv.y)); 9061 9062 // Generalized cosine: y(x) = a + b * cos(cx + d) 9063 const float amplitude = 0.125; 9064 float wave_frequency = frequency.y * 0.1; 9065 float distance_estimate = udf_cos(f, 0.50, amplitude, wave_frequency * (2.0 * PI), 0.0); 9066 9067 // Different approach for variation param here 9068 float rand = hashwithoutsine12(vec2(i.y)); 9069 float s = mix(size, size * rand, variation); 9070 9071 return smoothstep(-smoothness, smoothness, distance_estimate - s * 0.5); 9072 }`);return{tileAndCenter:i,circle:r,ring:n,polygon:a,cross:s,diamond:o,checkerboard:l,line:c,wave:h}}();var TX=class extends fr{constructor(t,i,r,n,a,s,o,l){super("v3"),this.nodeType="Rainbow",this.filmThickness=t,this.movement=i,this.wavelengths=r,this.noiseStrength=n,this.noiseScale=a,this.offset=s,this.isMask=l,this.alpha=o,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.require("vWorldViewDir"),t.require("worldNormal"),t.isShader("fragment")){t.require("uv"),t.requires.uv=[!0],t.addFragmentVariable(this.calpha,"float");let r=t.include(TX.Nodes.rainbow),n=[];return n.push(this.filmThickness.build(t,"f")),n.push(this.movement.build(t,"f")),n.push(this.wavelengths.build(t,"v3")),n.push(this.noiseStrength.build(t,"f")),n.push(this.noiseScale.build(t,"f")),n.push(this.offset.build(t,"v3")),n.push(this.isMask.build(t,"b")),n.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.calpha),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("RainbowNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},MX=TX;MX.Nodes=function(){let t=new yt(`vec3 attenuation(vec3 wavelengths, float filmThickness, float movement, float noiseStrength, float noiseScale, vec3 offset) { 9073 vec3 st = position / noiseScale; 9074 vec3 q = vec3(simplex3d(st), 9075 simplex3d(st + vec3(1.0)), 9076 simplex3d(st + vec3(1.0))); 9077 9078 vec3 r = vec3(simplex3d(st + vec3(1.4, 1.3, 1.0) * q + vec3(1.7, 9.2, 1.0)), 9079 simplex3d(st + vec3(2.0, 1.2, 1.0) * q + vec3(8.3, 2.8, 1.0)), 9080 simplex3d(st * q)); 9081 9082 float noise = simplex3d(st + r); 9083 9084 return .5 + .5 * cos((((filmThickness + (noise * noiseStrength)) / (vec3(wavelengths.r * 1.0, wavelengths.g * 0.8, wavelengths.b * 0.6) + 1.0)) * dot(normalize(vWorldViewDir + (offset * -0.001)), normalize(vWNormal))) + movement); 9085 }
9085`,[to.simplex]);return{rainbow:new yt(`vec3 rainbow(float filmThickness, float movement, vec3 wavelengths, float noiseStrength, float noiseScale, vec3 offset, bool isMask, float mask, float alpha, out float calpha) { 9086 vec3 res = clamp(attenuation(wavelengths, filmThickness, movement, noiseStrength, noiseScale, offset), 0.0, 2.0); 9087 9088 float rainbowContribution = clamp(res.r + res.g + res.b, 0.0, 1.0); 9089 9090 float lalpha = alpha * rainbowContribution * mask; 9091 calpha = mix(lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0), lalpha, float(isMask)); 9092 accumAlpha += (1.0 - accumAlpha) * lalpha * (1.0 - float(isMask)); 9093 9094 return res; 9095 }`,[t])}}();var xX=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h){super("v3"),this.nodeType="Toon",this.positioning=t,this.colors=i,this.steps=r,this.source=n,this.isWorldSpace=a,this.noiseStrength=s,this.noiseScale=o,this.shadowColor=l,this.offset=c,this.alpha=h,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.require("worldNormal"),t.require("worldPosition"),t.isShader("fragment")){t.define("COLORS_MAX",10),t.addFragmentVariable(this.calpha,"float");let r=t.include(xX.Nodes.toon),n=[];return n.push(this.positioning.build(t,"i")),n.push(this.colors.build(t,"v4[]")),n.push(this.steps.build(t,"f[]")),n.push(this.source.build(t,"v3")),n.push(this.isWorldSpace.build(t,"b")),n.push(this.noiseStrength.build(t,"f")),n.push(this.noiseScale.build(t,"f")),n.push(this.shadowColor.build(t,"v4")),n.push(this.offset.build(t,"v3")),n.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.calpha),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("ToonNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},RX=xX;RX.Nodes=function(){let t=new yt(`float rand(float n) { 9096 return fract(sin(n) * 43758.5453123); 9097 }`),i=new yt(`float hash1(float p) { 9098 p = fract(p * 0.011); 9099 p *= p + 7.5; 9100 p *= p + p; 9101 return fract(p); 9102 }`),r=new yt(`float valueNoise(vec3 x) { 9103 const vec3 step = vec3(110, 241, 171); 9104 9105 vec3 i = floor(x); 9106 vec3 f = fract(x); 9107 9108 // For performance, compute the base input to a 1D hash from the integer part of the argument and the 9109 // incremental change to the 1D based on the 3D -> 1D wrapping 9110 float n = dot(i, step); 9111 9112 vec3 u = f * f * (3.0 - 2.0 * f); 9113 return mix(mix(mix( hash1(n + dot(step, vec3(0, 0, 0))), hash1(n + dot(step, vec3(1, 0, 0))), u.x), 9114 mix( hash1(n + dot(step, vec3(0, 1, 0))), hash1(n + dot(step, vec3(1, 1, 0))), u.x), u.y), 9115 mix(mix( hash1(n + dot(step, vec3(0, 0, 1))), hash1(n + dot(step, vec3(1, 0, 1))), u.x), 9116 mix( hash1(n + dot(step, vec3(0, 1, 1))), hash1(n + dot(step, vec3(1, 1, 1))), u.x), u.y), u.z); 9117 }`,[i]),n=new yt(`vec3 hash3(vec3 x) { 9118 x = vec3(dot(x,vec3(127.1, 311.7, 74.7)), 9119 dot(x,vec3(269.5, 183.3, 246.1)), 9120 dot(x,vec3(113.5, 271.9, 124.6))); 9121 9122 return fract(sin(x)*43758.5453123); 9123 }`),a=new yt(`vec3 voronoiNoise(in vec3 x) 9124 { 9125 vec3 p = floor(x); 9126 vec3 f = fract(x); 9127 9128 float id = 0.0; 9129 vec2 res = vec2(100.0); 9130 9131 for(int k=-1; k<=1; k++) 9132 for(int j=-1; j<=1; j++) 9133 for(int i=-1; i<=1; i++) 9134 { 9135 vec3 b = vec3(float(i), float(j), float(k)); 9136 9137 // Comment out the "+ hash(p + b);" part below to get "square" cells 9138 vec3 r = vec3(b) - f + hash3(p + b); 9139 float d = dot(r, r); 9140 9141 if (d < res.x) 9142 { 9143 id = dot(p + b, vec3(1.0, 57.0, 113.0)); 9144 res = vec2(d, res.x); 9145 } 9146 else if (d < res.y) 9147 { 9148 res.y = d; 9149 } 9150 } 9151 9152 return vec3(sqrt(res), abs(id)); 9153 } 9154 `,[n]);return{toon:new yt(`vec3 toon(int positioning, vec4 colors[COLORS_MAX], float steps[COLORS_MAX], vec3 source, bool isWorldSpace, float noiseStrength, float noiseScale, vec4 shadowColor, vec3 offset, float mask, float alpha, out float calpha) { 9155 float t = 0.0; 9156 float shadow = 1.0; 9157 9158 if (positioning == 0) { 9159 9160 // Can't do this mode if lighting is "none" 9161 #if (defined(PHONG) || defined(LAMBERT) || defined(STANDARD)) 9162 9163 // Algorithm from Chapter 10 of Graphics Shaders 9164 const vec3 weights = vec3(0.2125, 0.7154, 0.0721); 9165 vec3 lpos; 9166 vec3 l; 9167 float dproduct; 9168 9169 #if (NUM_POINT_LIGHTS > 0) 9170 9171 #if defined(USE_SHADOWMAP) && (NUM_POINT_LIGHT_SHADOWS > 0) 9172 PointLightShadow pointLightShadow; 9173 #endif 9174 9175 #pragma unroll_loop_start 9176 for (int i = 0; i < NUM_POINT_LIGHTS; i++) { 9177 // Light positions are in view-space for some reason? 9178 lpos = (inverse(viewMatrix) * vec4(pointLights[UNROLLED_LOOP_INDEX].position, 1.0
9178)).xyz; 9179 l = normalize(lpos - worldPosition); 9180 9181 dproduct = dot(l, normalize(worldNormal)) * 0.5 + 0.5; 9182 9183 // TODO: we want to use "intensity" but it isn't available in the shader code 9184 //dproduct += dot(pointLights[UNROLLED_LOOP_INDEX].color, weights); 9185 9186 t = max(t, dproduct); 9187 9188 // Accumulate shadow contribution 9189 #if defined(USE_SHADOWMAP) && (UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS) 9190 pointLightShadow = pointLightShadows[UNROLLED_LOOP_INDEX]; 9191 shadow *= getPointShadow( 9192 pointShadowMap[UNROLLED_LOOP_INDEX], 9193 pointLightShadow.shadowMapSize, 9194 pointLightShadow.shadowBias, 9195 pointLightShadow.shadowRadius, 9196 vPointShadowCoord[UNROLLED_LOOP_INDEX], 9197 pointLightShadow.shadowCameraNear, 9198 pointLightShadow.shadowCameraFar); 9199 #endif 9200 } 9201 #pragma unroll_loop_end 9202 9203 #endif 9204 9205 #if NUM_DIR_LIGHTS > 0 9206 9207 #if defined(USE_SHADOWMAP) && (NUM_DIR_LIGHT_SHADOWS > 0) 9208 DirectionalLightShadow directionalLightShadow; 9209 #endif 9210 9211 #pragma unroll_loop_start 9212 for (int i = 0; i < NUM_DIR_LIGHTS; i++) { 9213 // Use the direction vector for directional lights instead 9214 l = (inverse(viewMatrix) * vec4(directionalLights[UNROLLED_LOOP_INDEX].direction, 0.0)).xyz; 9215 9216 dproduct = dot(l, normalize(worldNormal)) * 0.5 + 0.5; 9217 t = max(t, dproduct); 9218 9219 // Accumulate shadow contribution 9220 #if defined(USE_SHADOWMAP) && (UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS) 9221 directionalLightShadow = directionalLightShadows[UNROLLED_LOOP_INDEX]; 9222 shadow *= getShadow( 9223 UNROLLED_LOOP_INDEX, 9224 directionalShadowMap[UNROLLED_LOOP_INDEX], 9225 directionalLightShadow.shadowMapSize, 9226 directionalLightShadow.shadowBias, 9227 directionalLightShadow.shadowRadius, 9228 vDirectionalShadowCoord[UNROLLED_LOOP_INDEX]); 9229 #endif 9230 } 9231 #pragma unroll_loop_end 9232 9233 #endif 9234 9235 #if NUM_SPOT_LIGHTS > 0 9236 9237 #if defined(USE_SHADOWMAP) && (NUM_SPOT_LIGHT_SHADOWS > 0) 9238 SpotLightShadow spotLightShadow; 9239 #endif 9240 9241 #pragma unroll_loop_start 9242 for (int i = 0; i < NUM_SPOT_LIGHTS; i++) { 9243 lpos = (inverse(viewMatrix) * vec4(spotLights[UNROLLED_LOOP_INDEX].position, 1.0)).xyz; 9244 l = normalize(lpos - worldPosition); 9245 9246 dproduct = dot(l, normalize(worldNormal)) * 0.5 + 0.5; 9247 t = max(t, dproduct); 9248 9249 // Accumulate shadow contribution 9250 #if defined(USE_SHADOWMAP) && (UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS) 9251 spotLightShadow = spotLightShadows[UNROLLED_LOOP_INDEX]; 9252 shadow *= getShadow( 9253 UNROLLED_LOOP_INDEX, 9254 spotShadowMap[UNROLLED_LOOP_INDEX], 9255 spotLightShadow.shadowMapSize, 9256 spotLightShadow.shadowBias, 9257 spotLightShadow.shadowRadius, 9258 vSpotLightCoord[UNROLLED_LOOP_INDEX]); 9259 #endif 9260 } 9261 #pragma unroll_loop_end 9262 9263 #endif 9264 9265 t = clamp(t, 0.0, 1.0); 9266 9267 #endif 9268 9269 } else if (positioning == 1) { 9270 9271 vec3 origin = mix(position, worldPosition, float(isWorldSpace)); 9272 vec3 direction = normalize(source - origin); 9273 t = dot(direction, normalize(worldNormal)) * 0.5 + 0.5; 9274 9275 } else { 9276 9277 vec3 origin = worldPosition; 9278 vec3 source = cameraPosition - offset; 9279 vec3 direction = normalize(source - origin); 9280 t = dot(direction, normalize(worldNormal)) * 0.5 + 0.5; 9281 9282 } 9283 9284 if (noiseStrength > 0.0) { 9285 // Distort with noise 9286 vec3 st = position / noiseScale; 9287 9288 // Voronoi "smooth" noise 9289 float noise = 1.0 - voronoiNoise(st).x; 9290 9291 // Voronoi cellular noise 9292 //float noise = 1.0 - rand(voronoiNoise(st).z); 9293 9294 // Position warp noise 9295 // vec3 offset = vec3( 9296 // simplex3d(st), 9297 // simplex3d(st + vec3(111.1, 143.89, 217.19)), 9298 // simplex3d(st + vec3(171.1, 247.89, 117.23)) 9299 // ); 9300 // st += offset; 9301 // float noise = valueNoise(st); 9302 9303 t += noise * noiseStrength; 9304 } 9305 9306 t = clamp(t, 0.0, 1.0); 9307 9308 // Compute ramp color 9309 float p; 9310 vec4 color = colors[0]; 9311 for (int i = 1; i < COLORS_MAX; i++) { 9312 p = clamp((t - steps[i-1]) / (steps[i] - steps[i-1]), 0.0, 1.0); 9313 color = mix(color, colors[i], smoothstep(0.0, 1.0, p)); 9314 } 9315 9316 // Incorporate custom shadow color 9317 if (positioning == 0) { 9318 9319 vec3 blendedShadow = mix(color.rgb, shadowColor.rgb, shadowColor.a); 9320 color.rgb = mix(blendedShadow, color.rgb, shadow); 9321 9322 } 9323 9324 // Accumulate alpha as usual
9325 float lalpha = alpha * color.a * mask; 9326 calpha = lalpha / clamp(lalpha + accumAlpha, 0.00001, 1.0); 9327 accumAlpha += (1.0 - accumAlpha) * lalpha; 9328 9329 return color.xyz; 9330 9331 }`,[to.simplex,t,r,a])}}();var y2e=function(){return{textureBicubic:new yt(`float w0( float a ) { 9332 return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); 9333 } 9334 9335 float w1( float a ) { 9336 return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); 9337 } 9338 9339 float w2( float a ){ 9340 return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); 9341 } 9342 9343 float w3( float a ) { 9344 return ( 1.0 / 6.0 ) * ( a * a * a ); 9345 } 9346 9347 // g0 and g1 are the two amplitude functions 9348 float g0( float a ) { 9349 return w0( a ) + w1( a ); 9350 } 9351 9352 float g1( float a ) { 9353 return w2( a ) + w3( a ); 9354 } 9355 9356 // h0 and h1 are the two offset functions 9357 float h0( float a ) { 9358 return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); 9359 } 9360 9361 float h1( float a ) { 9362 return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); 9363 } 9364 9365 vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { 9366 uv = uv * texelSize.zw + 0.5; 9367 9368 vec2 iuv = floor( uv ); 9369 vec2 fuv = fract( uv ); 9370 9371 float g0x = g0( fuv.x ); 9372 float g1x = g1( fuv.x ); 9373 float h0x = h0( fuv.x ); 9374 float h1x = h1( fuv.x ); 9375 float h0y = h0( fuv.y ); 9376 float h1y = h1( fuv.y ); 9377 9378 vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 9379 vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; 9380 vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 9381 vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; 9382 9383 return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + 9384 g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); 9385 } 9386 9387 vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { 9388 vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); 9389 vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); 9390 vec2 fLodSizeInv = 1.0 / fLodSize; 9391 vec2 cLodSizeInv = 1.0 / cLodSize; 9392 vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); 9393 vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); 9394 return mix( fSample, cSample, fract( lod ) ); 9395 }`)}}();function E2e(t,i){return t>=i?new Me(i/t,1):new Me(1,t/i)}var BX=class extends fr{constructor(t,i,r,n,a,s,o,l){super("v3"),this.nodeType="Transmission",this.thickness=t,this.ior=i,this.roughness=r,this.transmissionSamplerSize=n,this.transmissionSamplerMap=a,this.transmissionDepthMap=s,this.aspectRatio=o,this.alpha=l,this.calpha=`g${this.uuid.toString().replace(/-/g,"")}_calpha`}generate(t,i){if(t.extensions.shaderTextureLOD=!0,t.extensions.derivatives=!0,t.isShader("fragment")){t.define("NUM_SAMPLES",6),t.define("BLUR_SLOD",Math.pow(2,zt.transmissionLod.value)),t.require("worldPosition"),t.requires.worldNormal=!0,t.requires.modelMatrix=!0,t.requires.projectionMatrix=!0,t.addFragmentVariable(this.calpha,"float");let r=t.include(BX.Nodes.transmission),n=[];return n.push(this.thickness.build(t,"f")),n.push(this.ior.build(t,"f")),n.push(this.roughness.build(t,"f")),n.push(this.transmissionSamplerSize.build(t,"v2")),n.push(this.transmissionSamplerMap.getTexture(t,"t")),n.push(this.transmissionDepthMap.getTexture(t,"t")),n.push(this.aspectRatio.build(t,"v2")),n.push("normal"),n.push(this.mask?`luminance(${this.mask.flow(t,"v3").result})`:"1.0"),n.push(this.alpha.build(t,"f")),n.push(this.calpha),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("TransmissionNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},IX=BX;IX.Nodes=function(){let t=new yt(`vec3 blur(sampler2D sp, vec2 U, vec2 scale, float lod, sampler2D dm, vec2 unrefractedU, vec2 aspectRatio) { 9396 // Slightly modified version of this: 9397 // https://www.shadertoy.com/view/ltScRG 9398 9399 // Special case for blur == 0.0 9400 if (lod == 0.0) { 9401 #ifdef TEXTURE_LOD_EXT 9402 return texture2DLodEXT( sp, U, 0.0).rgb; 9403 #else 9404 return textureLod( sp, U, 0.0).rgb; 9405 #endif 9406 } 9407 9408 vec2 texelSize = vec2(1.0) / resolution; 9409 vec2 halton = haltonSequence[frameIndex]; 9410 float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton); 9411 float temporalAngle = temporalOffset * PI2; 9412 vec3 res = vec3(0.0); 9413 vec2 uv = vec2(0.0); 9414 vec2 offset = vec2(0.0); 9415 vec2 vogelSample = vec2(0.0); 9416 for (int i = 0; i < NUM_SAMPLES; i++) { 9417 vogelSample = vogelDiskSample(i, NUM_SAMPLES, temporalAngle) * texelSize; 9418 offset = vogelSample * scale * (lod * 10.0); // TODO: used to be hardcoded to 20 9419 uv = U + offset; 9420 float opaqueDepth = unpackRGBAToDepth(textureLod(dm, uv, lod)); 9421 if (opaqueDepth != 0.0 && opaqueDepth < gl_FragCoord.z) { 9422 uv = unrefractedU; 9423 lod = lod > 4.0 ? lod : lod / 2.0; 9424 } 9425 res += textureLod(sp, uv, lod).rgb; 9426 } 9427 return res / float(NUM_SAMPLES); 9428 }`),i=new yt(`vec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) { 9429 // Direction of refracted light. 9430 vec3 refractionVector = refract( -v, n, 1.0 / ior ); 9431 9432 // Compute rotation-independant scaling of the model matrix. 9433 vec3 modelScale; 9434 modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); 9435 modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); 9436 modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); 9437 9438 // The thickness is specified in local space 9439 return normalize( refractionVector ) * thickness * modelScale; 9440 }`),r=new yt(`float applyIorToRoughness( float roughness, float ior ) { 9441 // Scale roughness with IOR so that an IOR of 1.0 results in no microfacet refraction and 9442 // an IOR of 1.5 results in the default amount of microfacet refraction. 9443 return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); 9444 }`),n=new yt(`vec3 getTransmissionSample( vec2 fragCoord, float roughness, float ior, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 unrefractedCoords, vec2 aspectRatio) { 9445 // Threejs exports do not pass a depth map to this shader, so we have to fallback to the "Threejs method of blurring" - see 9446 // also the code in convertTransmission.ts, which runs during export 9447 #ifdef IS_THREEJS_EXPORT 9448 float lod = log2(transmissionSamplerSize.x) * applyIorToRoughness(roughness / 5.0, ior); 9449 return textureBicubic(transmissionSamplerMap, fragCoord.xy, lod).rgb; 9450 #else 9451 float framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); 9452 float lod = applyIorToRoughness(roughness, ior); 9453 return blur(transmissionSamplerMap, fragCoord, vec2(lod), min(framebufferLod / 5.5, 8.5), transmissionDepthMap, unrefractedCoords, aspectRatio); 9454 #endif 9455 }`,[y2e.textureBicubic,r,t]),a=new yt(`vec3 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio ) { 9456 vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); 9457 vec3 refractedRayExit = position + transmissionRay; 9458 9459 // Project refracted vector on the framebuffer, while mapping to normalized device coordinates. 9460 vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); 9461 vec2 refractionCoords = ndcPos.xy / ndcPos.w; 9462 refractionCoords += 1.0; 9463 refractionCoords /= 2.0; 9464 9465 vec4 ndcPosUnrefracted = projMatrix * viewMatrix * vec4(position, 1.0 ); 9466 vec2 unrefractedCoords = ndcPosUnrefracted.xy / ndcPosUnrefracted.w; 9467 unrefractedCoords += 1.0; 9468 unrefractedCoords /= 2.0; 9469 9470 // Sample framebuffer to get pixel the refracted ray hits. 9471 return getTransmissionSample( refractionCoords, roughness, ior, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, unrefractedCoords, aspectRatio ); 9472 }`,[n,i]);return{transmission:new yt(`vec3 transmission(float thickness, float ior, float roughness, vec2 transmissionSamplerSize, sampler2D transmissionSamplerMap, sampler2D transmissionDepthMap, vec2 aspectRatio, vec3 normal, float mask, float alpha, out float calpha) { 9473 vec3 v = vec3(0.); 9474 if (isOrthographic) { 9475 v = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); 9476 } else { 9477 v = normalize(vWPosition - cameraPosition); 9478 } 9479 vec3 transmission = getIBLVolumeRefraction(vWNormal, -v, roughness, vWPosition, modelMatrix, viewMatrix, projectionMatrix, ior, thickness, transmissionSamplerSize, transmissionSamplerMap, transmissionDepthMap, aspectRatio ); 9480
9481 float lalpha = alpha * mask; 9482 calpha = lalpha / clamp( lalpha + accumAlpha, 0.00001, 1.0 ); 9483 accumAlpha += ( 1.0 - accumAlpha ) * alpha; 9484 9485 return transmission; 9486 }`,[a])}}();var TL=(t=>(t.NOISE="noise",t.MAP="map",t))(TL||{}),DX=class extends fr{constructor(t,i,r,n,a,s,o,l,c,h,u){super("v3"),this.displacementTypeIndex=new _r(0),this.nodeType="VertexDisplacement",this.intensity=t,this.movementOrTexture=i,Object.values(TL)[this.displacementTypeIndex.value]==="map"&&(this.mat=new AX(this.movementOrTexture.value.matrix)),this.cropOrOffset=r,this.scale=h,this.noiseFunctionIndex=u,this.voronoiStyle=n,this.smoothness=a,this.seed=s,this.highCut=o,this.lowCut=l,this.quality=c}generate(t,i){if(t.isShader("vertex")){t.define("USE_LAYER_DISPLACE");let r,n=[];switch(n.push("displaced_position"),n.push("displaced_normal"),Object.values(TL)[this.displacementTypeIndex.value]){case"map":{r=t.include(DX.Nodes.map),n.push(this.movementOrTexture.getTexture(t,"t")),n.push("uv"),n.push(this.cropOrOffset.build(t,"f")),this.mat&&n.push(this.mat.build(t,"mat3"));break}case"noise":{let a=Object.values(sU)[this.noiseFunctionIndex.value],s=new yt(`vec3 orthogonal(vec3 v) { 9487 return normalize(abs(v.x) > abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); 9488 }`),o=a=="voronoi"?` 9489 float v = ${a}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1), voronoiStyle, smoothness, seed, quality); 9490 v = remap(v, lowCut, highCut, 0.0, 1.0); 9491 v = smax(v, 0.0, smoothness * 0.25); 9492 v = smin(v, 1.0, smoothness * 0.25); 9493 9494 return p + n * v * intensity; 9495 `:` 9496 return p + n * ${a}((p + offset) * scale * 0.001 + neighbour_offset + (movement * 0.1)) * intensity; 9497 `,l=new yt(`vec3 distorted(vec3 p, vec3 n, float scale, float intensity, vec3 offset, float neighbour_offset, float movement, int voronoiStyle, float smoothness, float seed, float highCut, float lowCut, int quality) { 9498 ${o} 9499 }`,[to.simplex,to.simplexFractal,to.simplexAshima,to.fbm,to.perlin,to.voronoi]),c=new yt(`vec3 vertexDisplacementNoise(vec3 position, vec3 normal, float scale, vec3 offset, float movement, int voronoiStyle, float smoothness, float seed, float highCut, float lowCut, int quality, float intensity, out vec3 displaced_normal) { 9500 vec3 displaced_position = distorted(position, normal, scale, intensity, offset, neighbor_offset, movement, voronoiStyle, smoothness, seed, highCut, lowCut, quality); 9501 vec3 tangent1 = orthogonal(normal); 9502 vec3 tangent2 = normalize(cross(normal, tangent1)); 9503 9504 // TODO(Max): The distance to the neighbors was originally scaled by 0.1. 9505 // This caused some small oval/circular visual artifacts in the lighting. 9506 // For now, simply using neighbors further away betters the problem, 9507 // but we should figure out the underlying cause when we have some time. 9508 // Maybe its related to how we calculate the tangent and bitangent? 9509 vec3 nearby1 = position + tangent1; 9510 vec3 nearby2 = position + tangent2; 9511 vec3 distorted1 = distorted(nearby1, normal, scale, intensity, offset, neighbor_offset, movement, voronoiStyle, smoothness, seed, highCut, lowCut, quality); 9512 vec3 distorted2 = distorted(nearby2, normal, scale, intensity, offset, neighbor_offset, movement, voronoiStyle, smoothness, seed, highCut, lowCut, quality); 9513 displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); 9514 return displaced_position; 9515 }`,[l,s]);r=t.include(c),n.push(this.scale.build(t,"f")),n.push(this.cropOrOffset.build(t,"v3")),n.push(this.movementOrTexture.build(t,"f")),n.push(this.voronoiStyle.build(t,"i")),n.push(this.smoothness.build(t,"f")),n.push(this.seed.build(t,"f")),n.push(this.highCut.build(t,"f")),n.push(this.lowCut.build(t,"f")),n.push(this.quality.build(t,"i"));break}}return n.push(this.intensity.build(t,"f")),n.push("displaced_normal"),t.format(r+"("+n.join(",")+")",this.getType(t),i)}else return console.warn("VertexDisplacementNode is not compatible with "+t.shader+" shader."),t.format("vec3( 0.0 )",this.getType(t),i)}},PX=DX;PX.Nodes=function(){let t=new yt(`vec3 orthogonal(vec3 v) { 9516 return normalize(abs(v.x) >
9516 abs(v.z) ? vec3(-v.y, v.x, 0.0) : vec3(0.0, -v.z, v.y)); 9517 }`),i=new yt(`float displacementMapTexture(sampler2D tex, float crop, vec2 uv, mat3 mat, vec2 offset) { 9518 vec2 uvs = (mat * vec3(uv * 2.0 - 1.0, 1.0) / 2.0 + 0.5).xy + offset; 9519 vec4 tmp = texture2D(tex, uvs); 9520 vec3 col = tmp.rgb; 9521 if (crop > 0.5) { 9522 if ( uvs.x < 0.0 || uvs.x > 1.0 || uvs.y < 0.0 || uvs.y > 1.0 ) { 9523 return 0.0; 9524 } 9525 } 9526 return col.r; 9527 }`);return{map:new yt(`vec3 vertexDisplacementMap(vec3 position, vec3 normal, sampler2D tex, vec2 uv, float crop, mat3 mat, float intensity, out vec3 displaced_normal) { 9528 vec3 displaced_position = position + normal * displacementMapTexture(tex, crop, uv, mat, vec2(0.0)) * intensity; 9529 vec3 tangent1 = normalize(orthogonal(normal)); 9530 vec3 tangent2 = normalize(cross(normal, tangent1)); 9531 vec3 nearby1 = position + tangent1 * 0.1; 9532 vec3 nearby2 = position + tangent2 * 0.1; 9533 vec3 distorted1 = nearby1 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; 9534 vec3 distorted2 = nearby2 + normal * displacementMapTexture(tex, crop, uv, mat, vec2(neighbor_offset)) * intensity; 9535 displaced_normal = normalize(cross(distorted1 - displaced_position, distorted2 - displaced_position)); 9536 return displaced_position; 9537 }`,[t,i])}}();var zt={normalRenderTarget:new gu,normalRenderTargetDepth:new gu,transmissionRenderTarget:new gu,aspectRatio:new La,transmissionSize:new La(2048,2048),transmissionRenderTargetDepth:new gu,aoRenderTarget:new gu,aoEnabled:new Ls,pixelRatioNode:new Tt(1),resolution:new La,pe
9537numbraSize:new gf(5,.5),frameIndex:new _r(0),transmissionLod:new _r(2)};for(let t of Object.values(zt))t.isRenderGlobal=!0;var LX={skiaWasmUrl:"https://unpkg.com/@splinetool/[email protected]/build/ui.wasm"},oU=class extends Yn{constructor(){super("basic"),this.nodeType="Basic",this.color=new ln(No),this.shadingAlpha=new Tt(1),this.shadingBlend=new _r(0),this.previousModelViewMatrix=new gh,this.previouseProjectionMatrix=new gh}get category(){return"phong"}generate(t){let i;if(t.isShader("vertex")){let r=this.position?this.position.analyzeAndFlow(t,"v3",{cache:"position"}):void 0;t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({resolution:zt.resolution}),t.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),t.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),t.mergeUniform(O0.merge([vt.fog])),t.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <normal_pars_vertex>"].join(` 9538`));let n=["#include <beginnormal_vertex>",` 9539 #if !defined( USE_LAYER_DISPLACE ) 9540 #include <defaultnormal_vertex> 9541 #endif 9542 9543 vec3 displaced_position = position; 9544 vec3 displaced_normal = normal; 9545 9546 #if defined( USE_LAYER_DISPLACE ) 9547 vec3 transformed; 9548 vec3 transformedNormal; 9549 #endif 9550 `,"#include <normal_vertex>",` 9551 #if !defined( USE_LAYER_DISPLACE ) 9552 #include <begin_vertex> 9553 #endif /* !USE_LAYER_DISPLACE */ 9554 `];r&&n.push(r.code,r.result?"displaced_position = "+r.result+";
9554":""),n.push("transformed = displaced_position;","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),n.push("#include <project_vertex>","#include <fog_vertex>","#include <clipping_planes_vertex>"," vViewPosition = - mvPosition.xyz;","#include <worldpos_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),i=n.join(` 9555`)}else{this.color===void 0&&(this.color=new ln(No)),this.color.analyze(t,{slot:"color"}),this.alpha&&this.alpha.analyze(t),this.afterColor&&this.afterColor.analyze(t,{slot:"afterColor"});let r=this.color.flow(t,"c",{slot:"color"}),n=this.alpha?this.alpha.flow(t,"f"):void 0,a=this.alphaOverride?this.alphaOverride.flow(t,"f"):void 0,s=this.afterColor?this.afterColor.flow(t,"c",{slot:"afterColor"}):void 0;t.requires.transparent=n!==void 0,t.addParsCode(["varying vec3 vWPosition;","#include <fog_pars_fragment>","#include <dithering_pars_fragment>","varying vec3 vViewPosition;","#include <normal_pars_fragment>"].join(` 9556`));let o=["#include <normal_fragment_begin>",r.code];n&&o.push(n.code,"#ifdef ALPHATEST"," if ( "+n.result+" <= ALPHATEST ) discard;","#endif"),s?o.push(s.code,`vec3 outgoingLight = ${r.result};`,`vec3 finalColor = spe_blend(outgoingLight, ${s.result}, 1.0, SPE_BLENDING_NORMAL);`):o.push(`vec3 finalColor = ${r.result};`);let l="1.0";this.mask&&(this.mask.analyze(t),l=`luminance(${this.mask.flow(t,"v3").result})`),n?o.push(`gl_FragColor = vec4( finalColor, accumAlpha * ${n.result} * ${l} );`):o.push("gl_FragColor = vec4("+r.result+", 1.0 );"),a&&o.push(`gl_FragColor.a *= ${a.result};`),o.push("#include <fog_fragment>","#include <dithering_fragment>"),i=o.join(` 9557`)}return i}},w2e=class extends Yn{constructor(){super("lambert"),this.nodeType="Lambert",this.color=new ln(No),this.emissive=new ln(0),this.emissiveIntensity=new Tt(1),this.previousModelViewMatrix=new gh,this.previouseProjectionMatrix=new gh,this.shadingAlpha=new Tt(1),this.shadingBlend=new _r(0),this.occlusion=new Ls(!0)}get category(){return"lambert"}build(t){let i;if(t.define("LAMBERT"),t.requires.lights=!0,t.extensions.derivatives=!0,t.isShader("vertex")){let r=this.position?this.position.analyzeAndFlow(t,"v3",{cache:"position"}):void 0;t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({resolution:zt.resolution}),t.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),t.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),t.mergeUniform(O0.merge([vt.fog,vt.lights])),t.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include <bsdfs>","#include <lights_pars_begin>","#include <color_pars_vertex>","#include <fog_pars_vertex>","#include <skinning_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join(` 9558`));let n=["#include <beginnormal_vertex>",` 9559 #include <skinbase_vertex> 9560 #include <skinnormal_vertex> 9561 #ifndef USE_LAYER_DISPLACE 9562 #include <defaultnormal_vertex> 9563 #endif 9564 9565 vec3 displaced_position = position; 9566 vec3 displaced_normal = objectNormal; 9567 9568 #ifdef USE_LAYER_DISPLACE 9569 vec3 transformed; 9570 vec3 transformedNormal; 9571 #endif 9572 `,"#include <normal_vertex>",` 9573 #ifndef USE_LAYER_DISPLACE 9574 #include <begin_vertex> 9575 #endif 9576 `];r&&n.push(r.code,r.result?"displaced_position = "+r.result+";
9576":""),n.push("transformed = displaced_position;","#include <skinning_vertex>","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),n.push(" #include <project_vertex>"," #include <clipping_planes_vertex>"," vViewPosition = - mvPosition.xyz;"," #include <worldpos_vertex>",` 9577 vec3 diffuse = vec3( 1.0 ); 9578 GeometricContext geometry; 9579 geometry.position = mvPosition.xyz; 9580 geometry.normal = normalize( transformedNormal ); 9581 geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz ); 9582 `),n.push(` 9583 GeometricContext backGeometry; 9584 backGeometry.position = geometry.position; 9585 backGeometry.normal = -geometry.normal; 9586 backGeometry.viewDir = geometry.viewDir; 9587 vLightFront = vec3( 0.0 ); 9588 vIndirectFront = vec3( 0.0 ); 9589 #ifdef DOUBLE_SIDED 9590 vLightBack = vec3( 0.0 ); 9591 vIndirectBack = vec3( 0.0 ); 9592 #endif 9593 IncidentLight directLight; 9594 float dotNL; 9595 vec3 directLightColor_Diffuse; 9596 vIndirectFront += getAmbientLightIrradiance( ambientLightColor ); 9597 vIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal ); 9598 #ifdef DOUBLE_SIDED 9599 vIndirectBack += getAmbientLightIrradiance( ambientLightColor ); 9600 vIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal ); 9601 #endif 9602 #if NUM_POINT_LIGHTS > 0 9603 #pragma unroll_loop_start 9604 for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { 9605 getPointLightInfo( pointLights[ i ], geometry, directLight ); 9606 dotNL = dot( geometry.normal, directLight.direction ); 9607 directLightColor_Diffuse = directLight.color; 9608 vLightFront += saturate( dotNL ) * directLightColor_Diffuse; 9609 #ifdef DOUBLE_SIDED 9610 vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; 9611 #endif 9612 } 9613 #pragma unroll_loop_end 9614 #endif 9615 #if NUM_SPOT_LIGHTS > 0 9616 #pragma unroll_loop_start 9617 for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { 9618 getSpotLightInfo( spotLights[ i ], geometry, directLight ); 9619 dotNL = dot( geometry.normal, directLight.direction ); 9620 directLightColor_Diffuse = directLight.color; 9621 vLightFront += saturate( dotNL ) * directLightColor_Diffuse; 9622 #ifdef DOUBLE_SIDED 9623 vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; 9624 #endif 9625 } 9626 #pragma unroll_loop_end 9627 #endif 9628 #if NUM_DIR_LIGHTS > 0 9629 #pragma unroll_loop_start 9630 for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { 9631 getDirectionalLightInfo( directionalLights[ i ], geometry, directLight ); 9632 dotNL = dot( geometry.normal, directLight.direction ); 9633 directLightColor_Diffuse = directLight.color; 9634 vLightFront += saturate( dotNL ) * directLightColor_Diffuse; 9635 #ifdef DOUBLE_SIDED 9636 vLightBack += saturate( -dotNL ) * directLightColor_Diffuse; 9637 #endif 9638 } 9639 #pragma unroll_loop_end 9640 #endif 9641 #if NUM_HEMI_LIGHTS > 0 9642 #pragma unroll_loop_start 9643 for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { 9644 vIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); 9645 #ifdef DOUBLE_SIDED 9646 vIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal ); 9647 #endif 9648 } 9649 #pragma unroll_loop_end 9650 #endif 9651 `," #include <shadowmap_vertex>"," #include <fog_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),i=n.join(` 9652`)}else{t.mergeUniform({penumbraSize:zt.penumbraSize}),t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({aoMap:zt.aoRenderTarget}),t.mergeUniform({aoEnabled:zt.aoEnabled}),this.color===void 0&&(this.color=new ln(No)),this.color.analyze(t,{slot:"color"}),this.shadingAlpha.analyze(t),this.shadingBlend.analyze(t),this.afterColor&&this.afterColor.analyze(t,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(t);let r=this.color.flow(t,"c",{slot:"color"}),n=this.emissive.flow(t,"c",{slot:"emissive"}),a=this.emissiveIntensity.flow(t,"f",{slot:"emissive"}),s=this.occlusion.flow(t,"b",{slot:"occlusion"}
vendor: 4,561 bytes, lines 9652-9699
9652),o=this.shadingAlpha.flow(t,"f"),l=this.shadingBlend.flow(t,"i"),c=this.afterColor?this.afterColor.flow(t,"c",{slot:"afterColor"}):void 0,h=this.alpha?this.alpha.flow(t,"f"):void 0,u=this.alphaOverride?this.alphaOverride.flow(t,"f"):void 0;t.requires.transparent=h!==void 0,t.addParsCode(["uniform float penumbraSize[5];","uniform sampler2D aoMap;","uniform bool aoEnabled;","varying vec3 vViewPosition;","varying vec3 vWPosition;","varying vec3 vLightFront;","varying vec3 vIndirectFront;","#ifndef DOUBLE_SIDED"," #define DOUBLE_SIDED","#endif","#include <normal_pars_fragment>","#ifdef DOUBLE_SIDED"," varying vec3 vLightBack;"," varying vec3 vIndirectBack;","#endif","#include <bsdfs>","#include <lights_pars_begin>","#include <fog_pars_fragment>","#include <shadowmap_pars_fragment>","#include <shadowmask_pars_fragment>","#include <clipping_planes_pars_fragment>","#include <dithering_pars_fragment>"].join(` 9653`));let d=["#include <normal_fragment_begin>",` 9654 // NOTE: gl_FrontFacing alternative using face normal estimation. 9655 vec3 viewdx = dFdx(vViewPosition); 9656 vec3 viewdy = dFdy(vViewPosition); 9657 vec3 faceNormal = normalize(cross(viewdx, viewdy)); 9658 bool isFrontFacing = (dot(normal, faceNormal) >= 0.0); 9659 `,"#include <clipping_planes_fragment>"];d.push(r.code,"vec3 diffuseColor = "+r.result+";","ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"),h&&d.push(h.code,"#ifdef ALPHATEST","if ( "+h.result+" <= ALPHATEST ) discard;","#endif"),d.push("#ifdef DOUBLE_SIDED"," reflectedLight.indirectDiffuse += ( isFrontFacing ) ? vIndirectFront : vIndirectBack;","#else"," reflectedLight.indirectDiffuse += vIndirectFront;","#endif","#include <lightmap_fragment>","reflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );","#ifdef DOUBLE_SIDED"," reflectedLight.directDiffuse = ( isFrontFacing ) ? vLightFront : vLightBack;","#else"," reflectedLight.directDiffuse = vLightFront;","#endif","reflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();"),n&&d.push(n.code,"reflectedLight.directDiffuse += "+n.result+" * "+a.result+";"),d.push("vec3 ao = aoEnabled && "+s.result+" ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = (reflectedLight.directDiffuse + reflectedLight.indirectDiffuse) ;");let A="1.0";this.mask&&(this.mask.analyze(t),A=`luminance(${this.mask.flow(t,"v3").result})`),d.push(` 9660 if (outgoingLight != diffuseColor) { 9661 float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); 9662 accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * ${A} * lightAccu; 9663 outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result} * ${A}, ${l.result} ); 9664 9665 outgoingLight *= ao; 9666 } 9667 `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),h?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${h.result} );`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u&&d.push(`gl_FragColor.a *= ${u.result};`),d.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),i=d.join(` 9668`)}return i}},_0=function(){let t=new yt(`vec2 dHdxy(sampler2D bumpMap, vec2 bumpMapUv, float bumpScale) { 9669 9670 // Gradient of UVs w.r.t. X coordinate (in screen-space) 9671 vec2 dSTdx = dFdx(bumpMapUv); 9672 9673 // Gradient of UVs w.r.t. Y coordinate (in screen-space) 9674 vec2 dSTdy = dFdy(bumpMapUv); 9675 9676 // Forward differencing 9677 float Hll = bumpScale * luminance(texture(bumpMap, bumpMapUv).rgb); 9678 float dBx = bumpScale * luminance(texture(bumpMap, bumpMapUv + dSTdx).rgb) - Hll; 9679 float dBy = bumpScale * luminance(texture(bumpMap, bumpMapUv + dSTdy).rgb) - Hll; 9680 9681 return vec2( dBx, dBy ); 9682 }`),i=new yt(`vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) { 9683 vec3 vSigmaX = dFdx( surf_pos.xyz ); 9684 vec3 vSigmaY = dFdy( surf_pos.xyz ); 9685 vec3 vN = surf_norm; // normalized 9686 9687 vN = normalize(vN); 9688 9689 vec3 R1 = cross( vSigmaY, vN ); 9690 vec3 R2 = cross( vN, vSigmaX ); 9691 9692 R1 = normalize(R1); 9693 R2 = normalize(R2); 9694 9695 float fDet = dot( vSigmaX, R1 ) * faceDirection; 9696 9697 vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 ); 9698 return normalize( abs( fDet ) * vN - vGrad ); 9699 }`);
9699return{dHdxy:t,perturbNormalArb:i}}(),b2e=class extends Yn{constructor(){super("phong"),this.nodeType="Phong",this.color=new ln(No),this.specular=new ln(1118481),this.shininess=new Tt(30),this.previousModelViewMatrix=new gh,this.previouseProjectionMatrix=new gh,this.shadingAlpha=new Tt(1),this.shadingBlend=new _r(0),this.occlusion=new Ls(!0)}get category(){return"phong"}build(t){let i;if(t.define("PHONG"),t.requires.lights=!0,t.extensions.derivatives=!0,t.isShader("vertex")){let r=this.position?this.position.analyzeAndFlow(t,"v3",{cache:"position"}):void 0;t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({resolution:zt.resolution}),t.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),t.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),t.mergeUniform(O0.merge([vt.fog,vt.lights])),t.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <skinning_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join(` 9700`));let n=["#include <beginnormal_vertex>",` 9701 #include <skinbase_vertex> 9702 #include <skinnormal_vertex> 9703 #ifndef USE_LAYER_DISPLACE 9704 #include <defaultnormal_vertex> 9705 #endif 9706 9707 vec3 displaced_position = position; 9708 vec3 displaced_normal = objectNormal; 9709 9710 #ifdef USE_LAYER_DISPLACE 9711 vec3 transformed; 9712 vec3 transformedNormal; 9713 #endif 9714 `,"#include <normal_vertex>",` 9715 #ifndef USE_LAYER_DISPLACE 9716 #include <begin_vertex> 9717 #endif 9718 `];r&&n.push(r.code,r.result?"displaced_position = "+r.result+";
9718":""),n.push("transformed = displaced_position;","#include <skinning_vertex>","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),n.push(" #include <project_vertex>"," #include <clipping_planes_vertex>"," vViewPosition = - mvPosition.xyz;"," #include <worldpos_vertex>"," #include <shadowmap_vertex>"," #include <fog_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),i=n.join(` 9719`)}else{t.mergeUniform({penumbraSize:zt.penumbraSize}),t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({aoMap:zt.aoRenderTarget}),t.mergeUniform({aoEnabled:zt.aoEnabled}),this.color===void 0&&(this.color=new ln(No)),this.color.analyze(t,{slot:"color"}),this.specular.analyze(t),this.shininess.analyze(t);let r=this.occlusion.flow(t,"b",{slot:"occlusion"});this.shadingAlpha.analyze(t),this.shadingBlend.analyze(t),this.afterColor&&this.afterColor.analyze(t,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(t);let n=this.color.flow(t,"c",{slot:"color"}),a=this.specular.flow(t,"c"),s=this.shininess.flow(t,"f"),o=this.shadingAlpha.flow(t,"f"),l=this.shadingBlend.flow(t,"i"),c=this.afterColor?this.afterColor.flow(t,"c",{slot:"afterColor"}):void 0,h=this.alpha?this.alpha.flow(t,"f"):void 0,u=this.alphaOverride?this.alphaOverride.flow(t,"f"):void 0;t.requires.transparent=h!==void 0,t.addParsCode(["varying vec3 vWPosition;","uniform vec3 emissive;","uniform float penumbraSize[5];","uniform sampler2D aoMap;","uniform bool aoEnabled;","#include <normal_pars_fragment>","#include <fog_pars_fragment>","#include <bsdfs>","#include <lights_pars_begin>","#include <lights_phong_pars_fragment>","#include <shadowmap_pars_fragment>","#include <dithering_pars_fragment>"].join(` 9720`));let d=["#include <normal_fragment_begin>",` 9721 // NOTE: gl_FrontFacing alternative using face normal estimation. 9722 vec3 viewdx = dFdx(vViewPosition); 9723 vec3 viewdy = dFdy(vViewPosition); 9724 vec3 faceNormal = normalize(cross(viewdx,viewdy)); 9725 if (dot(normal, faceNormal) < 0.0) { 9726 normal *= -1.0; 9727 } 9728 `," BlinnPhongMaterial material;"];if(this.bumpMap){t.include(_0.dHdxy),t.include(_0.perturbNormalArb);let f=this.bumpMap.texture.flow(t,"t"),m=this.bumpMap.flow(t,"v3"),g=this.bumpMapIntensity?this.bumpMapIntensity.flow(t,"f").result:"1.0",p="";this.bumpMap.projection.value===4?p=` 9729 vec3 bumpNormal = vec3(0.0); 9730 { 9731 vec2 uv0 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs0; 9732 vec2 uv1 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs1; 9733 vec2 uv2 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs2; 9734 vec3 weights = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_triplanarWeights; 9735 9736 vec2 grad0 = dHdxy(${f.result}, uv0, ${g}); 9737 vec3 n0 = perturbNormalArb(-vViewPosition, normal, grad0, faceDirection); 9738 9739 vec2 grad1 = dHdxy(${f.result}, uv1, ${g}); 9740 vec3 n1 = perturbNormalArb(-vViewPosition, normal, grad1, faceDirection); 9741 9742 vec2 grad2 = dHdxy(${f.result}, uv2, ${g}); 9743 vec3 n2 = perturbNormalArb(-vViewPosition, normal, grad2, faceDirection); 9744 9745 bumpNormal = n0 * weights.z + n1 * weights.x + n2 * weights.y; 9746 bumpNormal = normalize(bumpNormal); 9747 } 9748 9749 normal = bumpNormal; 9750 `:p=` 9751 vec2 bumpMapCachedUv = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs; 9752 vec2 grad = dHdxy(${f.result}, bumpMapCachedUv, ${g}); 9753 normal = perturbNormalArb( - vViewPosition, normal, grad, faceDirection ); 9754 `,d.push(`// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates 9755 ${m.result}; 9756 ${p} 9757 `)}d.push(n.code," vec3 diffuseColor = "+n.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );"," vec3 totalEmissiveRadiance = emissive;",a.code," vec3 specular = "+a.result+";",s.code," float shininess = max( 0.0001, "+s.result+" );"," float specularStrength = 1.0;"),h&&d.push(h.code,"#ifdef ALPHATEST","if ( "+h.result+" <= ALPHATEST ) discard;","#endif"),d.push("material.diffuseColor = diffuseColor;"),d.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include <lights_fragment_begin>","#include <lights_fragment_end>"),d.push("vec3 ao = aoEnabled && "+r.result+" ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = ((reflectedLight.directDiffuse + reflectedLight.indirectDiffuse)) + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;");let A="1.0";this.mask&&(this.mask.analyze(t),A=`luminance(${this.mask.flow(t,"v3").result})`),d.push(` 9758 if (outgoingLight != diffuseColor) { 9759 float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); 9760 accumAlpha += ( 1.0 - accumAlpha ) * ${o.result} * ${A} * lightAccu; 9761 outgoingLight = spe_blend( diffuseColor, outgoingLight, ${o.result} * ${A}, ${l.result} ); 9762 9763 outgoingLight *= ao; 9764 } 9765 `),c&&d.push(c.code,`outgoingLight = spe_blend(outgoingLight, ${c.result}, 1.0, SPE_BLENDING_NORMAL);`),h?d.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${h.result});`):d.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),u&&d.push(`gl_FragColor.a *= ${u.result};`),d.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),i=d.join(` 9766`)}return i}},S2e=class extends Yn{constructor(){super("standard"),this.nodeType="Standard",this.color=new ln(No),this.roughness=new Tt(.3),this.metalness=new Tt(0),this.reflectivity=new Tt(.5),this.previousModelViewMatrix=new gh,this.previouseProjectionMatrix=new gh,this.shadingAlp
vendor: 1,517 bytes, lines 9766-9785
9766ha=new Tt(1),this.shadingBlend=new _r(0),this.occlusion=new Ls(!0)}get category(){return"physical"}build(t){let i;if(t.define("STANDARD"),t.requires.lights=!0,t.extensions.derivatives=!0,t.extensions.shaderTextureLOD=!0,t.isShader("vertex")){let r=this.position?this.position.analyzeAndFlow(t,"v3",{cache:"position"}):void 0;t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({resolution:zt.resolution}),t.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),t.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),t.mergeUniform(O0.merge([vt.fog,vt.lights])),vt.LTC_1&&(t.uniforms.ltc_1={value:void 0},t.uniforms.ltc_2={value:void 0}),t.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <skinning_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join(` 9767`));let n=["#include <beginnormal_vertex>",` 9768 #include <skinbase_vertex> 9769 #include <skinnormal_vertex> 9770 #if !defined( USE_LAYER_DISPLACE ) 9771 #include <defaultnormal_vertex> 9772 #endif 9773 9774 vec3 displaced_position = position; 9775 vec3 displaced_normal = objectNormal; 9776 9777 #if defined( USE_LAYER_DISPLACE ) 9778 vec3 transformed; 9779 vec3 transformedNormal; 9780 #endif 9781 `,"#include <normal_vertex>",` 9782 #if !defined( USE_LAYER_DISPLACE ) 9783 #include <begin_vertex> 9784 #endif /* !USE_LAYER_DISPLACE */ 9785 `];r&&n.push(r.code,r.result?"displaced_position = "+r.result+";
9785":""),n.push("transformed = displaced_position;","#include <skinning_vertex>","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),n.push("#include <project_vertex>","#include <fog_vertex>","#include <clipping_planes_vertex>"," vViewPosition = - mvPosition.xyz;","#include <worldpos_vertex>","#include <shadowmap_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),i=n.join(` 9786`)}else{t.mergeUniform({penumbraSize:zt.penumbraSize}),t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({aoMap:zt.aoRenderTarget}),t.mergeUniform({aoEnabled:zt.aoEnabled});let r={gamma:!0};this.color===void 0&&(this.color=new ln(No)),this.color.analyze(t,{slot:"color",context:r}),this.roughness.analyze(t),this.metalness.analyze(t);let n=this.occlusion.flow(t,"b",{slot:"occlusion"});this.shadingAlpha.analyze(t),this.shadingBlend.analyze(t),this.afterColor&&this.afterColor.analyze(t,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(t),this.reflectivity&&this.reflectivity.analyze(t);let a=this.color.flow(t,"c",{slot:"color",context:r}),s=this.roughness.flow(t,"f"),o=this.metalness.flow(t,"f"),l=this.shadingAlpha.flow(t,"f"),c=this.shadingBlend.flow(t,"i"),h=this.afterColor?this.afterColor.flow(t,"c",{slot:"afterColor"}):void 0,u=this.alpha?this.alpha.flow(t,"f"):void 0,d=this.alphaOverride?this.alphaOverride.flow(t,"f"):void 0,A=this.reflectivity?this.reflectivity.flow(t,"f"):void 0;t.requires.transparent=u!==void 0,t.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","uniform float penumbraSize[5];","uniform sampler2D aoMap;","uniform bool aoEnabled;","#include <normal_pars_fragment>","#include <dithering_pars_fragment>","#include <fog_pars_fragment>","#include <bsdfs>","#include <lights_pars_begin>","#include <lights_physical_pars_fragment>","#include <shadowmap_pars_fragment>"].join(` 9787`));let f=["#include <clipping_planes_fragment>"," #include <normal_fragment_begin>",` 9788 // NOTE: gl_FrontFacing alternative using face normal estimation. 9789 vec3 viewdx = dFdx(vViewPosition); 9790 vec3 viewdy = dFdy(vViewPosition); 9791 vec3 faceNormal = normalize(cross(viewdx,viewdy)); 9792 if (dot(normal, faceNormal) < 0.0) { 9793 normal *= -1.0; 9794 } 9795 `," PhysicalMaterial material;"," material.diffuseColor = vec3( 1.0 );"];if(this.bumpMap){t.include(_0.dHdxy),t.include(_0.perturbNormalArb);let g=this.bumpMap.texture.flow(t,"t"),p=this.bumpMap.flow(t,"v3"),v=this.bumpMapIntensity?this.bumpMapIntensity.flow(t,"f").result:"1.0",_="";this.bumpMap.projection.value===4?_=` 9796 vec3 bumpNormal = vec3(0.0); 9797 { 9798 vec2 uv0 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs0; 9799 vec2 uv1 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs1; 9800 vec2 uv2 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs2; 9801 vec3 weights = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_triplanarWeights; 9802 9803 vec2 grad0 = dHdxy(${g.result}, uv0, ${v}); 9804 vec3 n0 = perturbNormalArb(-vViewPosition, normal, grad0, faceDirection); 9805 9806 vec2 grad1 = dHdxy(${g.result}, uv1, ${v}); 9807 vec3 n1 = perturbNormalArb(-vViewPosition, normal, grad1, faceDirection); 9808 9809 vec2 grad2 = dHdxy(${g.result}, uv2, ${v}); 9810 vec3 n2 = perturbNormalArb(-vViewPosition, normal, grad2, faceDirection); 9811 9812 bumpNormal = n0 * weights.z + n1 * weights.x + n2 * weights.y; 9813 bumpNormal = normalize(bumpNormal); 9814 } 9815 9816 normal = bumpNormal; 9817 `:_=` 9818 vec2 bumpMapCachedUv = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs; 9819 vec2 grad = dHdxy(${g.result}, bumpMapCachedUv, ${v}); 9820 normal = perturbNormalArb( - vViewPosition, normal, grad, faceDirection ); 9821 `,f.push(`// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates 9822 ${p.result}; 9823 ${_} 9824 `)}if(f.push(a.code," vec3 diffuseColor = "+a.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",o.code," float metalnessFactor = "+o.result+";"),this.roughnessMap){let g=this.roughnessMap.texture.flow(t,"t"),p=this.roughnessMap.flow(t,"v3"),v="";this.roughnessMap.projection.value===4?v=` 9825 float roughnessChange = 1.0; 9826 { 9827 vec2 uv0 = g${this.roughnessMap.uuid.toString().replace(/-/g,"")}_writeUvs0; 9828 vec2 uv1 = g${this.roughnessMap.uuid.toString().replace(/-/g,"")}_writeUvs1; 9829 vec2 uv2 = g${this.roughnessMap.uuid.toString().replace(/-/g,"")}_writeUvs2; 9830 vec3 weights = g${this.roughnessMap.uuid.toString().replace(/-/g,"")}_triplanarWeights; 9831 9832 float r0 = luminance(texture(${g.result}, uv0).rgb) * roughnessScale; 9833 float r1 = luminance(texture(${g.result}, uv1).rgb) * roughnessScale; 9834 float r2 = luminance(texture(${g.result}, uv2).rgb) * roughnessScale; 9835 9836 roughnessChange = (r0 * weights.z + r1 * weights.x + r2 * weights.y); 9837 } 9838 float roughnessFactor = roughnessChange * ${s.result}; 9839 `:v=` 9840 vec2 roughnessMapCachedUv = g${this.roughnessMap.uuid.toString().replace(/-/g,"")}_writeUvs; 9841 9842 vec4 vals = texture(${g.result}, roughnessMapCachedUv); 9843 float roughnessFactor = luminance(vals.rgb) * ${s.result}; 9844 `,f.push(`// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates 9845 ${p.result}; 9846 9847 const float roughnessScale = 1.0; 9848 9849 ${v} 9850 `)}else f.push(s.code," float roughnessFactor = "+s.result+";");u&&f.push(u.code,"#ifdef ALPHATEST"," if ( "+u.result+" <= ALPHATEST ) discard;","#endif"),f.push("vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );"),f.push("material.diffuseColor = diffuseColor * ( 1.0 - metalnessFactor );","material.roughness = max( roughnessFactor, 0.0525 );","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.roughness = clamp( roughnessFactor, 0.04, 1.0 );"),A?f.push(A.code,"material.specularColor = mix( vec3( 0.16 * pow2( "+A.result+" ) ), diffuseColor, metalnessFactor );"):f.push("material.specularColor = mix( vec3( 0.04 ), diffuseColor, metalnessFactor );"),f.push("#include <lights_fragment_begin>"),f.push("#include <lights_fragment_end>"),f.push("vec3 ao = aoEnabled && "+n.result+" ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = ((reflectedLight.directDiffuse + reflectedLight.indirectDiffuse)) + reflectedLight.directSpecular + reflectedLight.indirectSpecular;");let m="1.0";this.mask&&(this.mask.analyze(t),m=`luminance(${this.mask.flow(t,"v3").result})`),f.push(` 9851 if (outgoingLight != diffuseColor) { 9852 float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); 9853 accumAlpha += ( 1.0 - accumAlpha ) * ${l.result} * ${m} * lightAccu; 9854 outgoingLight = spe_blend( diffuseColor, outgoingLight, ${l.result} * ${m}, ${c.result} ); 9855 9856 outgoingLight *= ao; 9857 } 9858 `),h&&f.push(h.code,`outgoingLight = spe_blend(outgoingLight, ${h.result}, 1.0, SPE_BLENDING_NORMAL);`),u?f.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${u.result} );`):f.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),d&&f.push(`gl_FragColor.a *= ${d.result};`),f.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),i=f.join(` 9859`)}return i}},C2e=class extends Yn{constructor(){super("toon"),this.nodeType="Toon",this.color=new ln(No),this.specular=new ln(1118481),this.shininess=new Tt(30),this.previousModelViewMatrix=new gh,this.previouseProjectionMatrix=new gh,this.shadingAlp
vendor: 1,324 bytes, lines 9859-9878
9859ha=new Tt(1),this.shadingBlend=new _r(0)}get category(){return"toon"}build(t){let i;if(t.define("TOON"),t.requires.lights=!0,t.extensions.derivatives=!0,t.isShader("vertex")){let r=this.position?this.position.analyzeAndFlow(t,"v3",{cache:"position"}):void 0;t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({resolution:zt.resolution}),t.mergeUniform({previousModelViewMatrix:this.previousModelViewMatrix}),t.mergeUniform({previousProjectionMatrix:this.previouseProjectionMatrix}),t.mergeUniform(O0.merge([vt.fog,vt.lights])),t.addParsCode(["varying vec3 vViewPosition;","varying vec3 vWPosition;","#include <fog_pars_vertex>","#include <skinning_pars_vertex>","#include <normal_pars_vertex>","#include <shadowmap_pars_vertex>","#include <clipping_planes_pars_vertex>"].join(` 9860`));let n=["#include <beginnormal_vertex>",` 9861 #include <skinbase_vertex> 9862 #include <skinnormal_vertex> 9863 #ifndef USE_LAYER_DISPLACE 9864 #include <defaultnormal_vertex> 9865 #endif 9866 9867 vec3 displaced_position = position; 9868 vec3 displaced_normal = objectNormal; 9869 9870 #ifdef USE_LAYER_DISPLACE 9871 vec3 transformed; 9872 vec3 transformedNormal; 9873 #endif 9874 `,"#include <normal_vertex>",` 9875 #ifndef USE_LAYER_DISPLACE 9876 #include <begin_vertex> 9877 #endif 9878 `];r&&n.push(r.code,r.result?"displaced_position = "+r.result+";
9878":""),n.push("transformed = displaced_position;","#include <skinning_vertex>","transformedNormal = normalMatrix * displaced_normal;","#ifndef FLAT_SHADED"," vNormal = transformedNormal;","#endif"),n.push(" #include <project_vertex>"," #include <fog_vertex>"," #include <clipping_planes_vertex>"," vViewPosition = - mvPosition.xyz;"," #include <worldpos_vertex>"," #include <shadowmap_vertex>"," #include <fog_vertex>"),n.push("vWPosition = ( modelMatrix * vec4( transformed, 1.0 ) ).xyz;"),i=n.join(` 9879`)}else{t.mergeUniform({penumbraSize:zt.penumbraSize}),t.mergeUniform({frameIndex:zt.frameIndex}),t.mergeUniform({aoMap:zt.aoRenderTarget}),t.mergeUniform({aoEnabled:zt.aoEnabled}),this.color===void 0&&(this.color=new ln(No)),this.color.analyze(t,{slot:"color"}),this.specular.analyze(t),this.shininess.analyze(t),this.shadingAlpha.analyze(t),this.shadingBlend.analyze(t),this.afterColor&&this.afterColor.analyze(t,{slot:"afterColor"}),this.alpha&&this.alpha.analyze(t);let r=this.color.flow(t,"c",{slot:"color"}),n=this.specular.flow(t,"c"),a=this.shininess.flow(t,"f"),s=this.shadingAlpha.flow(t,"f"),o=this.shadingBlend.flow(t,"i"),l=this.afterColor?this.afterColor.flow(t,"c",{slot:"afterColor"}):void 0,c=this.alpha?this.alpha.flow(t,"f"):void 0,h=this.alphaOverride?this.alphaOverride.flow(t,"f"):void 0;t.requires.transparent=c!==void 0,t.addParsCode(["uniform float penumbraSize[5];","uniform sampler2D aoMap;","uniform bool aoEnabled;","varying vec3 vWPosition;","#include <normal_pars_fragment>","#include <gradientmap_pars_fragment>","#include <fog_pars_fragment>","#include <bsdfs>","#include <lights_pars_begin>","#include <dithering_pars_fragment>",` 9880 varying vec3 vViewPosition; 9881 struct ToonMaterial { 9882 vec3 diffuseColor; 9883 vec3 specularColor; 9884 float specularShininess; 9885 float specularStrength; 9886 }; 9887 void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 9888 vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; 9889 9890 reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 9891 reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; 9892 } 9893 void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { 9894 reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); 9895 } 9896 #define RE_Direct RE_Direct_Toon 9897 #define RE_IndirectDiffuse RE_IndirectDiffuse_Toon 9898 #define Material_LightProbeLOD( material ) (0) 9899 `,"#include <shadowmap_pars_fragment>","#include <bumpmap_pars_fragment>","#include <normalmap_pars_fragment>"].join(` 9900`));let u=["#include <normal_fragment_begin>",` 9901 // NOTE: gl_FrontFacing alternative using face normal estimation. 9902 vec3 viewdx = dFdx(vViewPosition); 9903 vec3 viewdy = dFdy(vViewPosition); 9904 vec3 faceNormal = normalize(cross(viewdx,viewdy)); 9905 if (dot(normal, faceNormal) < 0.0) { 9906 normal *= -1.0; 9907 } 9908 `," ToonMaterial material;"];if(this.bumpMap){t.include(_0.dHdxy),t.include(_0.perturbNormalArb);let A=this.bumpMap.texture.flow(t,"t"),f=this.bumpMap.flow(t,"v3"),m=this.bumpMapIntensity?this.bumpMapIntensity.flow(t,"f").result:"1.0",g="";this.bumpMap.projection.value===4?g=` 9909 vec3 bumpNormal = vec3(0.0); 9910 { 9911 vec2 uv0 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs0; 9912 vec2 uv1 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs1; 9913 vec2 uv2 = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs2; 9914 vec3 weights = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_triplanarWeights; 9915 9916 vec2 grad0 = dHdxy(${A.result}, uv0, ${m}); 9917 vec3 n0 = perturbNormalArb(-vViewPosition, normal, grad0, faceDirection); 9918 9919 vec2 grad1 = dHdxy(${A.result}, uv1, ${m});
9920 vec3 n1 = perturbNormalArb(-vViewPosition, normal, grad1, faceDirection); 9921 9922 vec2 grad2 = dHdxy(${A.result}, uv2, ${m}); 9923 vec3 n2 = perturbNormalArb(-vViewPosition, normal, grad2, faceDirection); 9924 9925 bumpNormal = n0 * weights.z + n1 * weights.x + n2 * weights.y; 9926 bumpNormal = normalize(bumpNormal); 9927 } 9928 9929 normal = bumpNormal; 9930 `:g=` 9931 vec2 bumpMapCachedUv = g${this.bumpMap.uuid.toString().replace(/-/g,"")}_writeUvs; 9932 vec2 grad = dHdxy(${A.result}, bumpMapCachedUv, ${m}); 9933 normal = perturbNormalArb( - vViewPosition, normal, grad, faceDirection ); 9934 `,u.push(`// Call the Texture Layer's function once here so that it writes out its procedural UV coordinates 9935 ${f.result}; 9936 ${g} 9937 `)}u.push(r.code," vec3 diffuseColor = "+r.result+";"," ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );",n.code," vec3 specular = "+n.result+";",a.code," float shininess = max( 0.0001, "+a.result+" );"," float specularStrength = 1.0;"),c&&u.push(c.code,"#ifdef ALPHATEST","if ( "+c.result+" <= ALPHATEST ) discard;","#endif"),u.push("material.diffuseColor = diffuseColor;"),u.push("material.specularColor = specular;","material.specularShininess = shininess;","material.specularStrength = specularStrength;","#include <lights_fragment_begin>","#include <lights_fragment_end>"),u.push("vec3 ao = aoEnabled ? tex2D(aoMap, gl_FragCoord.xy / resolution).rgb : vec3(1.0);","vec3 outgoingLight = ((reflectedLight.directDiffuse + reflectedLight.indirectDiffuse) * ao) + reflectedLight.directSpecular;");let d="1.0";this.mask&&(this.mask.analyze(t),d=`luminance(${this.mask.flow(t,"v3").result})`),u.push(` 9938 if (outgoingLight != diffuseColor) { 9939 float lightAccu = clamp( length( reflectedLight.directSpecular + reflectedLight.indirectSpecular ), 0.0, 1.0 ); 9940 accumAlpha += ( 1.0 - accumAlpha ) * ${s.result} * ${d} * lightAccu; 9941 outgoingLight = spe_blend( diffuseColor, outgoingLight, ${s.result} * ${d}, ${o.result} ); 9942 } 9943 `),l&&u.push(l.code,`outgoingLight = spe_blend(outgoingLight, ${l.result}, 1.0, SPE_BLENDING_NORMAL);`),c?u.push(`gl_FragColor = vec4( outgoingLight, accumAlpha * ${c.result} );`):u.push("gl_FragColor = vec4( outgoingLight, 1.0 );"),h&&u.push(`gl_FragColor.a *= ${h.result};`),u.push("#include <encodings_fragment>","#include <fog_fragment>","#include <dithering_fragment>"),i=u.join(` 9944`)}return i}},T2e=class{constructor(t=1e3*10){this.timeout=t,this.cache=new Map,this.head={data:null,time:0,src:null,next:null,prev:null},this.tail={data:null,time:1/0,src:null,next:null,prev:null},this.hasClean=!1,this.head.next=this.tail,this.tail.prev=this.head}log(...t){}remove(t){let i=this.cache.get(t);i&&(this.dispose(t,i.data),this.cache.delete(t),i.prev.next=i.next,i.next.prev=i.prev)}scheduleCleanup(){this.hasClean||(this.log("scheduled cleanup"),this.hasClean=!0,setTimeout(()=>{this.hasClean=!1,this.log("cleaning");let t=Date.now(),i=this.head.next;for(;i.time<t-this.timeout;)this.dispose(i.src,i.data),this.cache.delete(i.src),i=i.next,i.prev=this.head,this.head.next=i;this.head.next!==this.tail?this.scheduleCleanup():this.log("no more cleanup")},this.timeout+1e3))}has(t){var i;return(i=this.cache.get(t))==null?void 0:i.data}load(t){let i=Date.now(),r=this.cache.get(t);return r===void 0?(r={data:this.create(t),src:t,time:i,next:null,prev:null},this.cache.set(t,r)):(r.time=i,r.prev.next=r.next,r.next.prev=r.prev),r.prev=this.tail.prev,r.next=this.tail,this.tail.prev.next=r,this.tail.prev=r,this.scheduleCleanup(),r.data}},M2e=class extends T2e{create(t){return URL.createObjectURL(new Blob([t]))}dispose(t,i){URL.revokeObjectURL(i)}},NI;function x2e(t){return typeof t=="string"?t:(NI||(NI=new M2e),NI.load(t))}var R2e=class{constructor(t,i){this.data=t,this.cache=i,this.refCount=0}deref(){this.refCount,this.refCount-=1,this.refCount===0&&(this.cache.remove(this),this.dispose())}dispose(){this.refCount}},B2e=class{constructor(){this.cache=new Map}remove(t){this.cache.delete(t.data)}load(t){let i=this.cache.get(t);return i===void 0&&(i=this.create(t),this.cache.set(t,i)),i.refCount+=1,i}},OX=class extends R2e{constructor(t,i){super(t,i.imageHolderCache),this.data=t,this.shared=i,this.loaded=!1,this.isVideo=!1,this.isBuffer=!1,this._cache={1e3:{},1001:{},1002:{}},this.isVideo=t.type==="video",this.isBuffer=t.isWebGLRenderTarget===!0,this.loadPromise=this.updateSrc(this.isBuffer?t:t.data)}async updateSrc(t){if(typeof document>"u")return;this.disposeTextures(),this.loaded=!1;let i=()=>{this.loaded=!0;for(let n of Object.values(this._cache))for(let a of Object.values(n))for(let s of Object.values(a))s&&(s.image=this.img,s.needsUpdate=!0);this.shared.requestRender()};if(this.isBuffer)this.img=t,this.loaded=!0;else if(this.isVideo){if(this.img=document.createElement("video"),this.img.preload="auto",this.img.playsInl
9944ine=!0,this.img.currentTime=.01,typeof t!="string"){var r=new FileReader;r.readAsDataURL(new Blob([t],{type:"video/mp4"}));let n;await new Promise(a=>{r.onloadend=s=>{var o;n=(o=s.target)==null?void 0:o.result,a(null)}}),this.img.src=n}else this.img.src=t;this.img.onloadeddata=()=>{i()}}else this.img=new Image,this.img.src=x2e(t),this.img.onload=i,await new Promise(n=>{this.img.onload=()=>{i(),n(null)}})}getTexture(t,i=1008,r=1006){var a,s;let n=(s=(a=this._cache[t])==null?void 0:a[i])==null?void 0:s[r];if(n)return n;{let o;return this.isBuffer?o=this.img.texture:this.isVideo?o=new A_e(this.img,void 0,t,t):o=new en(this.img,void 0,t,t,r,i),this.loaded&&(o.needsUpdate=!0),this._cache[t]===void 0&&(this._cache[t]={}),this._cache[t][i]===void 0&&(this._cache[t][i]={}),this._cache[t][i][r]=o,o}}setNeedsUpdate(t){for(let i of Object.values(this._cache))for(let r of Object.values(i))for(let n of Object.values(r))n&&(n.needsUpdate=t)}disposeTextures(){for(let[t,i]of Object.entries(this._cache))for(let[r,n]of Object.entries(i))for(let[a,s]of Object.entries(n))s==null||s.dispose(),this._cache[t]!==void 0&&this._cache[t][r]!==void 0&&(this._cache[t][r][a]=void 0)}dispose(){super.dispose(),this.disposeTextures()}},Yd=class extends OX{};function I2e(t,i){var r=O2e(i);return r.formatToParts?P2e(r,t):L2e(r,t)}var D2e={year:0,month:1,day:2,hour:3,minute:4,second:5};function P2e(t,i){try{for(var r=t.formatToParts(i),n=[],a=0;a<r.length;a++){var s=D2e[r[a].type];s>=0&&(n[s]=parseInt(r[a].value,10))}return n}catch(o){if(o instanceof RangeError)return[NaN];throw o}}function L2e(t,i){var r=t.format(i).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);return[n[3],n[1],n[2],n[4],n[5],n[6]]}var UI={};function O2e(t){if(!UI[t]){var i=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),r=i==="06/25/2014, 00:00:00"||i==="â06â/â25â/â2014â â00â:â00â:â00";UI[t]=r?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:t,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return UI[t]}function NX(t,i,r,n,a,s,o){var l=new Date(0);return l.setUTCFullYear(t,i,r),l.setUTCHours(n,a,s,o),l}var p6=36e5,N2e=6e4,FI={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function UX(t,i,r){var n,a;if(!t||(n=FI.timezoneZ.exec(t),n))return 0;var s;if(n=FI.timezoneHH.exec(t),n)return s=parseInt(n[1],10),m6(s)?-(s*p6):NaN;if(n=FI.timezoneHHMM.exec(t),n){s=parseInt(n[1],10);var o=parseInt(n[2],10);return m6(s,o)?(a=Math.abs(s)*p6+o*N2e,s>0?-a:a):NaN}if(k2e(t)){i=new Date(i||Date.now());var l=r?i:U2e(i),c=ML(l,t),h=r?c:F2e(i,c,t);return-h}return NaN}function U2e(t){return NX(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}function ML(t,i){var r=I2e(t,i),n=NX(r[0],r[1]-1,r[2],r[3]%24,r[4],r[5],0).getTime(),a=t.getTime(),s=a%1e3;return a-=s>=0?s:1e3+s,n-a}function F2e(t,i,r){var n=t.getTime(),a=n-i,s=ML(new Date(a),r);if(i===s)return i;a-=s-i;var o=ML(new Date(a),r);return s===o?s:Math.max(s,o)}function m6(t,i){return-23<=t&&t<=23&&(i==null||0<=i&&i<=59)}var g6={};function k2e(t){if(g6[t])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:t}),g6[t]=!0,!0}catch{return!1}}var H2e=$u(efe(),1),v6=$u(tfe(),1),G2e=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,z2e=G2e,kI=36e5,_6=6e4,Q2e=2,Os={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:z2e};function V2e(t,i){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(t===null)return new Date(NaN);var r=i||{},n=r.additionalDigits==null?Q2e:(0,H2e.default)(r.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]")return new Date(t.getTime());if(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")return new Date(t);if(!(typeof t=="string"||Object.prototype.toString.call(t)==="[object String]"))return new Date(NaN);var a=W2e(t),s=j2e(a.date,n),o=s.year,l=s.restDateString,c=Y2e(l,o);if(isNaN(c))return new Date(NaN);if(c){var h=c.getTime(),u=0,d;if(a.time&&(u=K2e(a.time),isNaN(u)))return new Date(NaN);if(a.timeZone||r.timeZone){if(d=UX(a.timeZone||r.timeZone,new Date(h+u)),isNaN(d))return new Date(NaN)}else d=(0,v6.default)(new Date(h+u)),d=(0,v6.default)(new Date(h+u+d));return new Date(h+u+d)}else return new Date(NaN)}function W2e(t){var i={},r=Os.dateTimePattern.exec(t),n;if(r?(i.date=r[1],n=r[3]):(r=Os.datePattern.exec(t),r?(i.date=r[1],n=r[2]):(i.date=null,n=t)),n){var a=Os.timeZone.exec(n);a?(i.time=n.replace(a[1],""),i.timeZone=a[1].trim()):i.time=n}return i}function j2e(t,i){var r=Os.YYY[i],n=Os.YYYYY[i],a;if(a=Os.YYYY.exec(t)||n.exec(t),a){var s=a[1];return{year:parseInt(s,10),restDateString:t.slice(s.length)}}if(a=Os.YY.exec(t)||r.exec(t),a){var o=a[1];return{year:parseInt(o,10)*100,restDateString:t.slice(o.length)}}return{year:null}}function Y2e(t,i){if(i===null)return null;var r,n,a,s;if(t.length===0)return n=new Date(0),n.setUTCFullYear(i),n;if(r=Os.MM.exec(t),r)return n=new Date(0),a=parseInt(r[1],10)-1,E6(i,a)?(n.setUTCFullYear(i,a),n):new Date(NaN);if(r=Os.DDD.exec(t),r){n=new Date(0);var o=parseInt(r[1],10);return Z2e(i,o)?(n.setUTCFullYear(i,0,o),n):new Date(NaN)}if(r=Os.MMDD.exec(t),r){n=new Date(0),a=parseInt(r[1],10)-1;var l=parseInt(r[2],10);return E6(i,a,l)?(n.setUTCFullYear(i,a,l),n):new Date(NaN)}if(r=Os.Www.exec(t),r)return s=parseInt(r[1],10)-1,w6(i,s)?y6(i,s):new Date(NaN);if(r=Os.WwwD.exec(t),r){s=parseInt(r[1],10)-1;var c=parseInt(r[2],10)-1;return w6(i,s,c)?y6(i,s,c):new Date(NaN)}return null}function K2e(t){var i,r,n;if(i=Os.HH.exec(t),i)return r=parseFloat(i[1].replace(",",".")),HI(r)?r%24*kI:NaN;if(i=Os.HHMM.exec(t),i)return r=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),HI(r,n)?r%24*kI+n*_6:NaN;if(i=Os.HHMMSS.exec(t),i){r=parseInt(i[1],10),n=parseInt(i[2],10);var a=parseFloat(i[3].replace(",","."));return HI(r,n,a)?r%24*kI+n*_6+a*1e3:NaN}return null}function y6(t,i,r){i=i||0,r=r||0;var n=new Date(0);n.setUTCFullYear(t,0,4);var a=n.getUTCDay()||7,s=i*7+r+1-a;return n.setUTCDate(n.getUTCDate()+s),n}var X2e=[31,28,31,30,31,30,31,31,30,31,30,31],q2e=[31,29,31,30,31,30,31,31,30,31,30,31];function FX(t){return t%400===0||t%4===0&&t%100!==0}function E6(t,i,r){if(i<0||i>11)return!1;if(r!=null){if(r<1)return!1;var n=FX(t);if(n&&r>q2e[i]||!n&&r>X2e[i])return!1}return!0}function Z2e(t,i){if(i<1)return!1;var r=FX(t);return!(r&&i>366||!r&&i>365)}function w6(t,i,r){return!(i<0||i>52||r!=null&&(r<0||r>6))}function HI(t,i,r){return!(t!=null&&(t<0||t>=25)||i!=null&&(i<0||i>=60)||r!=null&&(r<0||r>=60))}function J2e(t,i,r){var n=V2e(t,r),a=UX(i,n,!0),s=new Date(n.getTime()-a),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Us(t,i){return i.color(t)}function b6(t=new Date,i){let r=i.format,n=t.getSeconds(),a=t;i&&i.timeZone!==null&&(a=J2e(new Date,i.timeZone));let s=a.getHours(),o=a.getMinutes(),l;i.format12h24h==="12ampm"&&(l=s>=12?"PM":"AM");let c=s;i.format12h24h!=="24"&&(c=s%12,c===0&&(c=12));let h,u;switch(r){case"HH:mm:ss":h=[c,o,n];break;case"HH:mm":h=[c,o];break;case"HH":h=[c],l=void 0;break;case"mm":h=[o],l=void 0;break;case"ss":h=[n],l=void 0;break;case"year":u=a.getFullYear();break;case"month":u=a.getMonth()+1;break;case"dayOfYear":u=Math.floor((a.getTime()-new Date(a.getFullYear(),0,0).getTime())/864e5);break;case"dayOfMonth":u=a.getDate();break;case"secondOfDay":u=s*60*60+o*60+n;break;default:console.error("Unknown time format",r),u=0;break}return h!==void 0?{textValue:h,suffix:l}:u}function $2e(t,i){switch(t.type){case"fresnel":return iDe(t,i);case"gradient":return rDe(t,i);case"depth":return nDe(t,i);case"normal":return aDe(t,i);case"noise":return sDe(t,i);case"rainbow":return oDe(t,i);case"toon":return lDe(t,i);case"outline":return cDe(t,i);case"transmission":return hDe(t,i);case"color":return tDe(t,i);case"pattern":return uDe(t,i)}}function eDe(t){return{type:t.type}}function wc(t,i){let{alpha:r,mode:n,isMask:a}=t,s=typeof r=="string"?(Number(i.getVariable(r))??100)/100:r;return{...eDe(t),alpha:s,mode:n,isMask:a}}function tDe(t,i){return{...wc(t,i),color:Us(t.color,i)}}function iDe(t,i){let{bias:r,scale:n,intensity:a,factor:s,color:o}=t;return{...wc(t,i),color:Us(o,i),bias:r,scale:n,intensity:a,factor:s}}function rDe(t,i){let{gradientType:r,smooth:n,colors:a,steps:s,angle:o,offset:l,morph:c}=t;return{...wc(t,i),gradientType:r,smooth:n,colors:a.map(h=>new ai(h[0],h[1],h[2],h[3])),num:a.length,steps:s,offset:new Me(...l),morph:new Me(...c),angle:o}}function nDe(t,i){let{gradientType:r,near:n,far:a,isVector:s,isWorldSpace:o,origin:l,direction:c,colors:h,steps:u,smooth:d}=t;return{...wc(t,i),gradientType:r,near:n,far:a,isVector:s,isWorldSpace:o,origin:new O(...l),direction:c?new O(...c):new O(1,0,0),colors:h.map(A=>A!==void 0?new ai(A[0],A[1],A[2],A[3]):new ai(0,0,0,0)),steps:u.slice(0,h.length),smooth:d}}function aDe(t,i){let{cnormal:r}=t;return{...wc(t,i),cnormal:new O(r[0],r[1],r[2])}}function sDe(t,i){return{...wc(t,i),scale:t.scale,move:t.move,fA:new Me(...t.fA),fB:new Me(...t.fB),size:new O(...t.size),distortion:new Me(...t.distortion),colorA:Us(t.colorA,i),colorB:Us(t.colorB,i),colorC:Us(t.colorC,i),c
9944olorD:Us(t.colorD,i),noiseType:t.noiseType,voronoiStyle:t.voronoiStyle,highCut:t.highCut,lowCut:t.lowCut,smoothness:t.smoothness,seed:t.seed,quality:t.quality}}function oDe(t,i){return{...wc(t,i),filmThickness:t.filmThickness,movement:t.movement,wavelengths:new O(...t.wavelengths),noiseStrength:t.noiseStrength,noiseScale:t.noiseScale,offset:new O(...t.offset)}}function lDe(t,i){return{...wc(t,i),positioning:t.positioning,colors:t.colors.map(r=>new ai(r[0],r[1],r[2],r[3])),num:t.colors.length,steps:t.steps,source:new O(...t.source),isWorldSpace:t.isWorldSpace,noiseStrength:t.noiseStrength,noiseScale:t.noiseScale,shadowColor:Us(t.shadowColor,i),offset:new O(...t.offset)}}function cDe(t,i){return{...wc(t,i),outlineColor:Us(t.outlineColor,i),contourColor:Us(t.contourColor,i),outlineWidth:t.outlineWidth,contourWidth:t.contourWidth,outlineThreshold:t.outlineThreshold,contourThreshold:t.contourThreshold,outlineSmoothing:t.outlineSmoothing,contourFrequency:t.contourFrequency,contourDirection:new O(...t.contourDirection),positionalLines:t.positionalLines,compensation:t.compensation}}function hDe(t,i){return{...wc(t,i),thickness:t.thickness,ior:t.ior,roughness:t.roughness}}function uDe(t,i){return{...wc(t,i),style:t.style,projection:t.projection,axis:t.axis,blending:t.blending,offset:new Me(...t.offset),colorA:Us(t.colorA,i),colorB:Us(t.colorB,i),frequency:new Me(...t.frequency),size:t.size,variation:t.variation,smoothness:t.smoothness,zigzag:t.zigzag,rotation:t.rotation,vertical:new Me(...t.vertical),horizontal:new Me(...t.horizontal),sides:t.sides}}var AT=class extends Xa{},dDe={noise:["noiseType"],texture:["projection","axis","side"],video:["projection","axis","side"],displace:["noiseType"],light:["roughnessMap","bumpMap"],depth:["smooth","isWorldSpace","gradientType","isVector"],pattern:["style","projection","axis"]},ADe={depth:["colors"]};function fDe(t,i,r){var s,o;if(i==="isMask")return!0;let n=dDe[t.type],a=ADe[t.type];if(a!==void 0){let l=t.color;if(a.includes(i)){let c=(o=(s=l[i])==null?void 0:s.value)==null?void 0:o.length;if(c!==void 0&&c!==r.length)return!0}}return n!==void 0?n.includes(i):!1}function kX(t,i,r){let n=r.uniforms[`f${r.id}_texture`];if(!n)return!1;let a=!1,s=t;if("image"in s){let o=s.image,l=i.image(o),c=n;c.image instanceof Yd||c.image.deref(),c.image=l}if("video"in s){let o=s.video,l=i.video(o),c=n;c.image instanceof Yd||c.image.deref(),c.image=l}if("wrapping"in s){let o=n;o.wrap=s.wrapping}if("minFilter"in s){let o=n;o.minFilter=s.minFilter}if("magFilter"in s){let o=n;o.magFilter=s.magFilter}if("rotation"in s&&r.uniforms[`f${r.id}_rotation`])return r.uniforms[`f${r.id}_rotation`].value=(s.rotation??0)*Ct.DEG2RAD,a;if("repeat"in s||"offset"in s||"rotation"in s){let o="mat",l=r.uniforms[`f${r.id}_${o}`];"repeat"in s&&(l.repeat=s.repeat),"offset"in s&&(l.offset=s.offset),"rotation"in s&&(l.rotation=s.rotation??0),l.updateMatrix()}return a}function pDe(t,i,r,n){let a=!1;for(let[s,o]of Object.entries(t)){if(s==="bumpMap"||s==="roughnessMap"){a=!0;continue}if(!s||o===void 0)continue;if(GX(s,r,n,i)){s==="visible"&&r.type==="light"&&(a=!0);continue}r.visible=n.visible;let l=r.uniforms[`f${r.id}_${s}`];if(l&&!(l instanceof nU))switch(a=a||fDe(r,s,o),l.constructor){case ln:if(typeof o=="string"){let c=i.getColor(o);c&&(l.value=c);break}else{let c=o;l.value instanceof AT?l.value=new Xa(c.r,c.g,c.b,c.a):l.setRGBA(c);break}case au:if(typeof o=="string"){let c=i.getColor(o);c&&(l.value=c);break}else{let c=o;l.value instanceof AT?l.value=new Xa(c.r,c.g,c.b,c.a):l.value.setRGBA(c.r,c.g,c.b,c.a);break}case La:{let c=o;l.value.setX(c[0]),l.value.setY(c[1]);break}case Ko:{let c=o;l.value.setX(c[0]),l.value.setY(c[1]),l.value.setZ(c[2]);break}case gu:{kX(o,i,r);break}case vf:{l.value=o.map(c=>new ai(...c));break}default:{l.value=o;break}}}return a}var fp=(t,i,r)=>Math.max(0,Math.min(1,Number(i.getVariable(typeof t=="number"?t*100:t,r)??100)/100))??1,IE=class{constructor(t,i,r,n,a){this.id=t,this.uuid=i,this.data=r,this.uniforms={};for(let s in n)this.uniforms[`f${this.id}_${s}`]=n[s];for(let s in r)GX(s,this,r,a)}get type(){return this.data.type}static create(t,i,r,n){if(r.type==="light")return Qc.createLigherLayer(t,i,r,n);if(r.type==="texture"||r.type==="video"){let a=r.type==="texture"?n.uiBuffer(r.texture.image)??n.image(r.texture.image):n.video(r.texture.video),s=new SL(a,r.texture.wrapping,r.texture.minFilter??1008,r.texture.magFilter??1006),o=new g2e(a),l=new v2e(r.texture.repeat,r.texture.offset,r.texture.rotation??0),c=new Tt(r.crop?1:0),h=new _r(r.projection??0),u=new _r(["x","y","z"].indexOf(r.axis)??0),d=new _r(r.side??0),A=new La(r.
9944size?new Me(r.size[0],r.size[1]):new Me(100,100)),f=new Tt(r.blending??0),m=new Tt(fp(r.alpha,n)),g=new _r(r.mode??0),p=new Ls(r.isMask??!1),v=new aU(s,o,c,h,u,d,A,f,l,m,g,p),_=new Pr(v.calpha,"f");return new nn(t,i,r,{texture:s,textureSize:o,crop:c,projection:h,axis:u,side:d,size:A,blending:f,mat:l,alpha:m,mode:g,isMask:p},v,g,_,p,n)}else if(r.type==="matcap"){let a=n.image(r.texture.image),s=new SL(a,r.texture.wrapping,r.texture.minFilter??1008,r.texture.magFilter??1006),o=new Tt(fp(r.alpha,n)),l=new _r(r.mode??0),c=new Ls(r.isMask??!1),h=new Tt((r.texture.rotation??0)*Ct.DEG2RAD),u=new EX(s,o,l,c,h),d=new Pr(u.calpha,"f");return new nn(t,i,r,{texture:s,alpha:o,mode:l,isMask:c,rotation:h},u,l,d,c,n)}else if(r.type==="displace")if(r.displacementType==="noise"){let a=new Ko(new O(...r.offset)),s=new Tt(r.scale??10),o=new Tt(r.intensity??8),l=new Tt(r.movement??1),c=new _r(r.noiseType??0),h=new _r(r.voronoiStyle??0),u=new Tt(r.smoothness??.5),d=new Tt(r.seed??0),A=new Tt(r.highCut??1),f=new Tt(r.lowCut??0),m=new _r(r.quality??1),g=new PX(o,l,a,h,u,d,A,f,m,s,c);return new HX(t,i,r,{offset:a,scale:s,intensity:o,movement:l,noiseType:c,voronoiStyle:h,smoothness:u,seed:d,highCut:A,lowCut:f,quality:m},g,n)}else throw new Error;else return vDe(t,i,r,n)}updateByOp(t,i,r){let n=t;if(n.path[0]===void 0){if(n.type===0)return"type"in n.props||"category"in n.props||"visible"in n.props?(r.scene.markNeedsUpdateRendererDirty(),!0):pDe(n.props,r.shared,this,i)}else if(n.path[0]==="texture")return"texture"in i||"video"in i?kX(n.props,r.shared,this):!0;return!1}dispose(){if(mDe(this)){let t=this.uniforms[`f${this.id}_texture`];if(!t)return!1;let i=t;i.image instanceof Yd||i.image.deref()}}hasValueByKey(t){return this.uniforms[t]!==void 0}hasValue(t){return this.hasValueByKey(`f${this.id}_${t}`)}setValue(t,i){let r=`f${this.id}_${t}`;this.hasValueByKey(r)&&i!==void 0&&(this.uniforms[r].value=i)}getNode(t){let i=`f${this.id}_${t}`;if(this.hasValueByKey(i))return this.uniforms[i]}getValue(t){let i=`f${this.id}_${t}`;if(this.hasValueByKey(i))return this.uniforms[i].value}getName(t){let i=/f\d+_(.*)/.exec(t);if(i&&i.length>1)return i[1];console.log(`Layer.getName: error ${t}`)}getNames(){let t=[];for(let i in this.uniforms){let r=this.getName(i);r&&t.push(r)}return t}},nn=class extends IE{constructor(t,i,r,n,a,s,o,l,c){super(t,i,r,n,c),this.params=n,this.color=a,this.mode=s,this.alpha=o,this.isMask=l}},HX=class extends IE{constructor(t,i,r,n,a,s){super(t,i,r,n,s),this.position=a}},Qc=class extends IE{constructor(t,i,r,n,a,s){super(t,i,r,a,s),this.node=n}static createLigherLayer(t,i,r,n){let a,s=new Tt(fp(r.alpha,n)),o=new _r(r.mode),l=new Tt(r.bumpMapIntensity),c=new Tt(fp(r.alphaOverride,n)),h;if(!r.visible)a=new oU,h={};else if(r.category==="lambert"){a=new w2e;let u=new ln(n.color(r.emissive)??0),d=new Ls(r.occlusion??!0);h={emissive:u,occlusion:d},a.emissive=u,a.occlusion=d}else if(r.category==="toon"){a=new C2e;let u=new Tt(r.shininess??30),d=new ln(n.color(r.specular)??1118481);h={shininess:u,specular:d},a.shininess=u,a.specular=d}else if(r.category==="physical"){a=new S2e;let u=new Tt(r.roughness??.3),d=new Tt(r.metalness??0),A=new Tt(r.reflectivity??.5),f=new Ls(r.occlusion??!0);h={roughness:u,metalness:d,reflectivity:A,occlusion:f},a.roughness=u,a.metalness=d,a.reflectivity=A,a.occlusion=f}else{a=new b2e;let u=new Tt(r.shininess??30),d=new ln(r.specular!==void 0?n.color(r.specular)??1118481:1118481),A=new Ls(r.occlusion??!0);h={shininess:u,specular:d,occlusion:A},a.shininess=u,a.specular=d,a.occlusion=A}return a.alpha=new Tt(1),a.shadingAlpha=s,a.shadingBlend=o,a.bumpMapIntensity=l,a.alphaOverride=c,h.alpha=a.shadingAlp
9944ha,h.mode=a.shadingBlend,h.bumpMapIntensity=a.bumpMapIntensity,h.alphaOverride=a.alphaOverride,new Qc(t,i,r,a,h,n)}get category(){return this.node.category}};function mDe(t){let i=t instanceof IE?t.type:t;return i==="texture"||i==="video"||i==="displace_map"||i==="matcap"}function zo(t){return{alpha:new Tt(t.alpha??1),mode:new _r(t.mode??0),isMask:new Ls(t.isMask??!1)}}function gDe(t,i,r,n,a){switch(t.type){case"color":{let s=new ln(n.color??No),o=zo(n),l=new CL(s,o.alpha),c=new Pr(l.calpha,"f");return new nn(i,r,t,{color:s,...o},l,o.mode,c,o.isMask,a)}case"fresnel":{let s=new ln(n.color??16777215),o=new Tt(n.bias??.1),l=new Tt(n.scale??1),c=new Tt(n.intensity??2),h=new Tt(n.factor??1),u=zo(n),d=new _2e(s,o,l,c,h,u.alpha,u.mode,u.isMask),A=new Pr(d.calpha,"f");return new nn(i,r,t,{color:s,bias:o,scale:l,intensity:c,factor:h,...u},d,u.mode,A,u.isMask,a)}case"rainbow":{let s=new Tt(n.filmThickness??30),o=new Tt(n.movement??0),l=new Ko(n.wavelengths??new O(0,0,0)),c=new Tt(n.noiseStrength??0),h=new Tt(n.noiseScale??1),u=new Ko(n.offset??new O(0,0,0)),d=zo(n),A=new MX(s,o,l,c,h,u,d.alpha,d.isMask),f=new Pr(A.calpha,"f");return new nn(i,r,t,{filmThickness:s,movement:o,wavelengths:l,noiseStrength:c,noiseScale:h,offset:u,...d},A,d.mode,f,d.isMask,a)}case"transmission":{let s=new Tt(n.thickness??10),o=new Tt(n.ior??1.5),l=new Tt(n.roughness??.5),c=zt.transmissionSize,h=zt.transmissionRenderTarget,u=zt.transmissionRenderTargetDepth,d=window.innerWidth,A=window.innerHeight,f=d>=A?new La(A/d,1):new La(1,d/A),m=zo(n),g=new IX(s,o,l,c,h,u,f,m.alpha),p=new Pr(g.calpha,"f");return new nn(i,r,t,{thickness:s,ior:o,roughness:l,aspectRatio:f,...m},g,m.mode,p,m.isMask,a)}case"toon":{let s=new _r(n.positioning??0),o;n.colors?o=new vf(n.colors.length,n.colors):(o=new vf(10,new ai(0,0,0,1)),o.value[1]=new ai(1,1,1,1));let l;n.steps?l=new gf(n.steps.length,n.steps):(l=new gf(10,1),l.value[0]=0);let c=new Ko(n.source??new O(0,0,0)),h=new Ls(n.isWorldSpace??!0),u=new Tt(n.noiseStrength??0),d=new Tt(n.noiseScale??1),A=new au(n.shadowColor),f=new Ko(n.offset??new O(0,0,0)),m=zo(n),g=new RX(s,o,l,c,h,u,d,A,f,m.alpha),p=new Pr(g.calpha,"f");return new nn(i,r,t,{positioning:s,colors:o,steps:l,source:c,isWorldSpace:h,noiseStrength:u,noiseScale:d,shadowColor:A,offset:f,...m},g,m.mode,p,m.isMask,a)}case"outline":{let s=new ln(n.outlineColor??16777215),o=new ln(n.contourColor??16777215),l=new Tt(n.outlineWidth??.1),c=new Tt(n.contourWidth??.1),h=new Tt(n.outlineThreshold??.1),u=new Tt(n.contourThreshold??.1),d=new Tt(n.outlineSmoothing??.1),A=new Tt(n.contourFrequency??.1),f=new Ko(n.contourDirection??new O(0,1,0)),m=new Ls(n.positionalLines??!1),g=new Ls(n.compensation??!0),p=zt.normalRenderTarget,v=zt.normalRenderTargetDepth,_=zt.pixelRatioNode,y=zt.resolution,w=zo(n),b=new SX(s,o,l,c,h,u,d,A,f,m,g,y,p,v,_,w.alpha),E=new Pr(b.calpha,"f");return new nn(i,r,t,{outlineColor:s,contourColor:o,outlineWidth:l,contourWidth:c,outlineThreshold:h,contourThreshold:u,outlineSmoothing:d,contourFrequency:A,contourDirection:f,positionalLines:m,compensation:g,...w},b,w.mode,E,w.isMask,a)}case"depth":{let s=new _r(n.gradientType??0),o=new Ls(n.smooth??!1),l=new Tt(n.near??50),c=new Tt(n.far??200),h=new Tt(n.isVector??1),u=new Tt(n.isWorldSpace??0),d=new Ko(n.origin??new O),A=new Ko(n.direction??new O),f;n.colors?f=new vf(n.colors.length,n.colors):(f=new vf(2,new ai(0,0,0,1)),f.value[1]=new ai(1,1,1,1));let m;n.steps?m=new gf(n.steps.length,n.steps):(m=new gf(2,1),m.value[0]=0);let g=zo(n),p=new gX(s,o,l,c,h,u,d,A,f,m,g.alpha,g.isMask),v=new Pr(p.calpha,"f");return new nn(i,r,t,{gradientType:s,smooth:o,near:l,far:c,isVector:h,isWorldSpace:u,origin:d,direction:A,colors:f,steps:m,...g},p,g.mode,v,g.isMask,a)}case"noise":{let s=new Tt(n.scale??1),o=new Ko(n.size??new O(100,100,100)),l=new Tt(n.move??1),c=new La(n.fA??new Me(1.7,9.2)),h=new La(n.fB??new Me(8.3,2.8)),u=new La(n.distortion??new Me(1,1)),d=new au(n.colorA),A=new au(n.colorB),f=new au(n.colorC),m=new au(n.colorD),g=new _r(n.noiseType??0),p=new _r(n.voronoiStyle??0),v=new Tt(n.highCut??1),_=new Tt(n.lowCut??0),y=new Tt(n.smoothness??.5),w=new Tt(n.seed??.5),b=new _r(n.quality??1),E=zo(n),M=new wX(s,o,l,c,h,u,d,A,f,m,E.alpha,g,E.isMask,p,v,_,y,w,b),S=new Pr(M.calpha,"f");return new nn(i,r,t,{scale:s,size:o,move:l,fA:c,fB:h,distortion:u,colorA:d,colorB:A,colorC:f,colorD:m,noiseType:g,...E,voronoiStyle:p,highCut:v,lowCut:_,smoothness:y,seed:w,quality:b},M,E.mode,S,E.isMask,a)}case"normal":{let s=new Ko(n.cnormal??new O(1,1,1)),o=zo(n),l=new mX(s,o.alpha),c=new Pr(l.calpha,"f");return new nn(i,r,t,{cnormal:s,...o},l,o.mode,c,o.isMask,a)}case"gradient":{let s=new _r(n.gradientType??0),o=new Ls(n.smooth??!1),l;n.colors?l=new vf(n.colors.length,n.colors):(l=new vf(10,new ai(0,0,0,1)),l.value[1]=new ai(1,1,1,1));let c;n.steps?c=new gf(n.steps.length,n.steps):(c=new gf(10,1),c.value[0]=0);let h=new La(n.offset??new Me(0,0)),u=new La(n.morph??new Me(0,0)),d=new Tt(n.angle??0),A=zo(n),f=new _X(s,o,l,c,h,u,d,A.alpha,A.isMask),m=new Pr(f.calpha,"f");return new nn(i,r,t,{gradientType:s,smooth:o,colors:l,steps:c,offset:h,morph:u,angle:d,...A},f,A.mode,m,A.isMask,a)}case"pattern":{let s=new _r(n.style??0),o=new _r(n.projection??0),l=new _r(["x","y","z"].indexOf(n.axis)??0),c=new Tt(n.blending??0),h=new La(n.offset??new Me(0,0)),u=new au(n.colorA),d=new au(n.colorB),A=new La(n.frequency??new Me(10,10)),f=new Tt(n.size??.5),m=new Tt(n.variation??0),g=new Tt(n.smoothness??.5),p=new Tt(n.zigzag??0),v=new Tt(n.rotation??0),_=new La(n.vertical??new Me(0,1)),y=new La(n.horizontal??new Me(0,1)),w=new _r(n.sides??6),b=zo(n),E=new CX(s,o,l,c,h,u,d,A,f,m,g,p,v,_,y,w,b.alpha,b.isMask),M=new Pr(E.calpha,"f");return new nn(i,r,t,{style:s,projection:o,axis:l,blending:c,offset:h,colorA:u,colorB:d,frequency:A,size:f,variation:m,smoothness:g,zigzag:p,rotation:v,vertical:_,horizontal:y,sides:w,...b},E,b.mode,M,b.isMask,a)}default:{let s=new ln(1,0,0,1),o=zo(n),l=new CL(s,o.alpha),c=new Pr(l.calpha,"f");return new nn(i,r,t,{color:s,...o},l,o.mode,c,o.isMask,a)}}}function vDe(t,i,r,n){let a=$2e(r,n);return gDe(r,t,i,a,n)}function GX(t,i,r,n){if(r.type==="displace"&&(t==="intensity"||t==="visible")){let a=i.uniforms[`f${i.id}_intensity`];
9944return a?(a.value=r.intensity*(r.visible?1:0),a):void 0}if(r.type!=="displace"&&(t==="alpha"||t==="visible")){let a=i.uniforms[`f${i.id}_alpha`];if(!a)return;if(a.value=fp(r.alpha,n)*(r.visible?1:0),r.type==="outline"&&t==="visible"){let s=i.uniforms[`f${i.id}_compensation`];s&&(s.value=r.compensation&&r.visible)}return a}}function pg(t,i){let r=0,n=t.layers.find(a=>a.data.type==="light");if(n){let a=n.data,s=Number(i.getVariable(a.alphaOverride));if((typeof a.alphaOverride=="string"?s/100:a.alphaOverride)<1)return!0}for(let a of t.layers){if(a.data.type!=="displace"&&a.data.isMask)return!0;if(a.data.type!=="displace"&&"alpha"in a.data&&a.data.type!=="light"&&a.data.type!=="fresnel"&&a.data.type!=="texture"&&a.data.type!=="matcap"&&a.data.type!=="rainbow"&&a.data.type!=="outline"&&a.data.type!=="pattern"){let s=a.data.visible?a.data.alpha:0;if(typeof s=="string"&&(s=Math.max(0,Math.min(1,Number(i.getVariable(s)??100)/100))),s===1&&a.data.type==="depth"||a.data.type==="gradient"){for(let o of a.data.colors)if(o[3]<1){s=o[3];break}}else if(s===1&&a.data.type==="noise"){let o=i.color(a.data.colorA).a,l=i.color(a.data.colorB).a,c=i.color(a.data.colorC).a,h=i.color(a.data.colorD).a,u=Math.min(o,Math.min(l,Math.min(c,h)));u<1&&(s=u)}r+=(1-r)*s}}return r<1}var LA=class extends Xi{constructor(){super(void 0),this.flatShading=!1,this.needsJitter=!0,this.nodeContextUuid=0,this.fog=!0,this.dithering=!0,this.vertexColors=!0,this.transparent=!0}customProgramCacheKey(){return""}},_De=class extends LA{constructor(t,i,r,n){super(),this.flatShading=t,this.side=i,this.wireframe=r,this.root=n}updateAfterBuild(){let t=this.root;this.lights=t.lights,this.vertexShader=t.vertexShader,this.fragmentShader=t.fragmentShader,this.defines=t.defines,this.uniforms=t.uniforms,this.extensions=t.extensions,this.transparent=t.transparent,this.cacheKey=t.customProgramCacheKey()+"flat"+this.flatShading+this.side}onBeforeCompile(t,i){this.root.onBeforeCompile(t)}get data(){return this.root.data}get category(){return this.root.category}get hasAO(){return this.root.hasAO}getFlavor(t,i,r){return this.root.getFlavor(t,i,r)}get layers(){return this.root.layers}get fragment(){return this.root.fragment}getLayersOfType(t){return this.root.getLayersOfType(t)}getLayerByUuid(t){return this.root.getLayerByUuid(t)}updateByOp(t,i,r){this.root.updateByOp(t,i,r)}nodeMaterialDispose(){this.root.nodeMaterialDispose()}},lU=class extends LA{constructor(t,i,r=!0){super(),this.data=t,this.allowVariableSaves=r,this.layerIdGen=0,this.flavors=[],this.masks={},this.type="NodeMaterial",this.updaters=[],this.needsJitter=i.shared.needsJitter,Yn.startContext(this),this.reset0(t,i),Yn.endContext(this)}get nodeMaterial(){return this}getFlavor(t,i,r){let n=r?6:(t?3:0)+i;if(n===0)return this;this.flavors===void 0&&(this.flavors=[]),n-=1;let a=this.flavors[n];return a===void 0&&(a=new _De(t,i,r,this),a.needsJitter=this.needsJitter,this.flavors[n]=a,a.flatShading=t,a.side=i,a.updateAfterBuild()),a}get fragment(){return this.lightLayer.node}get category(){return this.lightLayer.category}get hasAO(){var t;return((t=this.lightLayer.getNode("occlusion"))==null?void 0:t.value)??!1}reset(t,i,r=!1){Yn.startContext(this),(this.data!==t||r)&&this.reset0(t,i),Yn.endContext(this)}reset0(t,i){this.data=t;let r=t.layers??Wa.defaultTwoLayerData("phong").layers;try{this.layers=r.map(n=>IE.create(this.layerIdGen++,n.id,n.data,i.shared))}catch{this.layers=[]}this.layers.reverse(),this.name=t.name??"Untitled Material",this.onUpdate(i.shared),this.transparent=pg(t,i.shared),this.saveVariableLocations(i)}onVariableUpdate(t,i,r){if(t[0]==="alphaOverride")this.transparent=pg(this.data,r.shared),this.lightLayer.setValue("alphaOverride",Math.max(0,Math.min(Number(i)/100,1)));else if(t[0]==="layer"){let n=t[1],a=t[2];if(n&&a){let s=this.layers.find(o=>o.uuid===n);s!=null&&s.hasValue(a)&&(a==="alpha"?(this.transparent=pg(this.data,r.shared),s.setValue(a,Math.max(0,Math.min(Number(i)/100,1)))):s.setValue(a,i))}}}saveVariableLocations(t){if(!this.allowVariableSaves)return;let i=this.data.layers.find(r=>r.data.type==="light");i&&t.shared.getVariable(i.data.alphaOverride,["material",this.uuid,"alphaOverride"]),this.data.layers.forEac
vendor: 4,308 bytes, line 9944
9944h(r=>{"alpha"in r.data&&typeof r.data.alpha=="string"&&t.shared.getVariable(r.data.alpha,["material",this.uuid,"layer",r.id,"alpha"])})}getLayersOfType(t){return this.layers.filter(i=>i.type===t)}getLayerByUuid(t){return this.layers.find(i=>i.uuid===t)}onUpdate(t){this.lightLayer=this.layers.find(i=>i instanceof Qc),this.lightLayer===void 0&&(this.lightLayer=new Qc(0,"",{...ua.defaultData("light","phong"),visible:!1},new oU,{},t)),this.dispose();for(let i of this.flavors)i&&i.dispose();this.applyTextureMaps(),this.applyMasks(),this.blendColors(),this.blendAfterColors(),this.blendPositions(),this.build(),this.nodeContextUuid=0}applyTextureMaps(){let t=this.layers.find(a=>a instanceof Qc);if(!t)return;let i=t.data,r=i.bumpMap,n=i.roughnessMap;t.node.bumpMap=void 0,t.node.roughnessMap=void 0;for(let a=0;a<this.layers.length;++a){let s=this.layers[a];s instanceof nn&&s.color instanceof aU&&(s.uuid===r&&(t.node.bumpMap=s.color),s.uuid===n&&(t.node.roughnessMap=s.color))}}updateByOp(t,i,r){if(Yn.startContext(this),i!==void 0?this.data=i:i=this.data,this.transparent=pg(i,r.shared),t.path[0]==="layers"){let n=r.shared,a=t.path[1];if(a===void 0)r.scene.markNeedsUpdateRendererDirty(),this.reset0(i,r);else{t.type===0&&t.props.occlusion!==void 0&&r.scene.markNeedsUpdateRendererDirty();let s=this.layers.find(o=>o.uuid===a);if(s){let o=i.layers.data(a),l;t.type===0&&("alpha"in t.props||"alphaOverride"in t.props)&&("alpha"in t.props?l={...t.props,alpha:fp(t.props.alpha,n,["material",this.uuid,"layer",a,"alpha"])}:l={...t.props,alphaOverride:fp(t.props.alphaOverride,n,["material",this.uuid,"alphaOverride"])}),s.updateByOp({...t,...l?{props:l}:{},path:t.path.slice(2)},o,r)&&this.reset0(i,r)}}}else this.reset0(i,r);Yn.endContext(this)}applyMasks(){for(let t=0;t<this.layers.length;++t){let i=this.layers[t];i instanceof nn?i.color.mask=void 0:i instanceof Qc&&(i.node.mask=void 0)}for(let t=0;t<this.layers.length;++t){let i=this.layers[t];if(i instanceof nn&&i.isMask.value&&i.data.visible&&t>0){let r=t-1,n=this.layers[r];n instanceof Qc?n.node.mask=new qs(i.color,i.alpha,qs.MUL):n instanceof nn&&(n.isMask.value||(n.color.mask=new qs(i.color,i.alpha,qs.MUL)))}}}blendColors(){let t=this.layers.findIndex(r=>r instanceof nn),i=this.layers.findIndex(r=>r instanceof Qc);if(t!==-1&&t<i){let r=this.layers[t].color;for(let n=t+1;n<i;++n){let a=this.layers[n];if(a instanceof nn){if(a.isMask.value)continue;r=new f6(r,a.color,a.alpha,a.mode)}}this.fragment.color=r}else this.fragment.color=void 0}blendAfterColors(){let t=new Pr("outgoingLight","f"),i=this.layers.findIndex(r=>r instanceof Qc);if(this.layers.length>i+1){for(let r=i+1;r<this.layers.length;++r){let n=this.layers[r];if(n instanceof nn){if(n.isMask.value)continue;t=new f6(t,n.color,n.alpha,n.mode)}}this.fragment.afterColor=t}else this.fragment.afterColor=void 0}blendPositions(){let t=this.layers.filter(i=>i instanceof HX);if(t.length>0){let i=t[0].position;for(let r=1;r<t.length;++r)t[r]&&(i=new qs(i,t[r].position,qs.ADD),i=new qs(i,new Tt(.5).setReadonly(!0),qs.MUL));this.fragment.position=i}else this.fragment.position=void 0}getDefines(){return this.defines}getUniforms(){return this.uniforms}getVertexShader(){return this.vertexShader}getFragmentShader(){return this.fragmentShader}onBeforeCompile(t){t.defines=this.defines,t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.extensionDerivatives=this.extensions.derivatives===!0,t.extensionFragDepth=this.extensions.fragDepth===!0,t.extensionDrawBuffers=this.extensions.drawBuffers===!0,t.extensionShaderTextureLOD=this.extensions.shaderTextureLOD===!0}clampUniformsForPreview(t,i){let r=(n,a,s)=>Math.min(Math.max(n,a),s);for(let n of this.layers)if(n.type==="displace"){let a=r(n.uniforms[`f${n.id}_intensity`].value,t,i);n.uniforms[`f${n.id}_intensity`].value=a}}updateFrame(t){for(let i=0;i<this.updaters.length;++i)t.updateNode(this.updaters[i])}build(){let t=new dX;t.needsJitter=this.needsJitter,this.lights=this.lightLayer.data.visible,t.build(this.fragment,this.fragment),this.vertexShader=t.getCode("vertex"),this.fragmentShader=t.getCode("fragment"),this.defines=t.defines,this.uniforms=t.uniforms,this.extensions=t.extensions,this.updaters=t.updaters;for(let i of this.flavors)i&&i.updateAfterBuild();return this}
9944nodeMaterialDispose(){this.layers.forEach(t=>t.dispose()),super.dispose();for(let t of this.flavors)t&&t.dispose()}assetsLoaded(){for(let t of this.layers)if(t instanceof nn){let i=t.params.texture;if(i instanceof SL&&!i.image.loaded)return!1}return!0}};Object.defineProperties(LA.prototype,{properties:{get:function(){return this.fragment.properties}}});var xL=class extends lU{constructor(t,i,r){super(t,i,!1),this.uuid=r,this.allowVariableSaves=!0,this.saveVariableLocations(i)}},S6=new Map;function yDe(t){if(typeof t=="string")return t;let i=S6.get(t);return i||(i={url:URL.createObjectURL(new Blob([t]))},S6.set(t,i)),i.url}var zX,EDe=new Promise(t=>{zX=t}),C6=!1,Ob;function wDe(){if(C6)return;if(Ob)return Ob;async function t(){await VA(()=>import("./howler-1fc51ff6.js").then(i=>i.h),[],import.meta.url),zX(window!==void 0?window:global),C6=!0}return Ob=t(),Ob}var QX;EDe.then(t=>QX=t);function bDe(t){let i=!1;return t.scene.objects.traverse((r,n)=>{if(n.events===void 0||Array.isArray(n.events)===!1)return!0;let a=[];n.events.forEach(s=>{"dragDropActions"in s.data?(a.push(...s.data.dragDropActions.drag),a.push(...s.data.dragDropActions.drop)):"inActions"in s.data?(a.push(...s.data.inActions),a.push(...s.data.outActions)):"gameActions"in s.data?(a.push(...s.data.gameActions.idle),a.push(...s.data.gameActions.move),a.push(...s.data.gameActions.jump),a.push(...s.data.gameActions.run)):"breakpoints"in s.data?s.data.breakpoints.forEach(o=>{a.push(...o.data.actions)}):"actions"in s.data&&a.push(...s.data.actions),i=i||a.some(o=>o.data.type==="Audio")})}),i}var T_=class{constructor({src:t,volume:i,delay:r,loop:n}){this._volume=1,this.delay=0,this._loop=1,this.loopsRemaining=0,this._status="stopped",this.onEnd=()=>{this.loopsRemaining===1/0?this.replay():this.loopsRemaining>1?(this.replay(),this.loopsRemaining--):(this._status="stopped",this.loopsRemaining=this._loop)};let a;typeof t=="string"?a={src:t}:a={src:yDe(t),format:"wav"},this.sound=new QX.Howl(a),this.sound.on("end",this.onEnd),this.src=t,i!==void 0&&(this.volume=i),r!==void 0&&(this.delay=r),n!==void 0&&(this.loop=n)}get status(){return this._status}get volume(){return this._volume}set volume(t){this._volume=t,this.sound.volume(t)}get loop(){return this._loop}set loop(t){this._loop=t,this.loopsRemaining=t}replay(){this.clearDelay(),this.delayTimerId=window.setTimeout(()=>{this.sound.play(),this.clearDelay()},this.delay)}fade(t,i=1e3){t?(this.sound.volume(this._volume),this.clearFade(),this.fadeTimerId=window.setTimeout(()=>{this.sound.fade(this._volume,0,i),this.clearFade()},t)):this.sound.fade(this._volume,0,i)}on(t,i,r){this.sound.on(t,i,r)}off(t,i,r){this.sound.off(t,i,r)}play(){this._status==="playing"||this.sound.playing()||(this._status==="paused"?(this.sound.seek()===0?this.replay():this.sound.play(),this._status="playing"):this._status==="stopped"&&(this.replay(),this._status="playing"))}pause(){this._status==="playing"&&(this.sound.pause(),this.clearFade(),this.clearDelay(),this._status="paused")}stop(){this.sound.stop(),this.loopsRemaining=this._loop,this.clearFade(),this.clearDelay(),this._status="stopped"}clearFade(){this.fadeTimerId&&(clearTimeout(this.fadeTimerId),delete this.fadeTimerId)}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}dispose(t=!1){this.off(),this.stop(),this.clearFade(),this.clearDelay()}},SDe=class{constructor(){this.type="ShapePath",this.color=new Ht,this.subPaths=[],this.currentPath=null}moveTo(t,i){return this.currentPath=new xC,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,i),this}lineTo(t,i){var r;return(r=this.currentPath)==null||r.lineTo(t,i),this}quadraticCurveTo(t,i,r,n){var a;return(a=this.currentPath)==null||a.quadraticCurveTo(t,i,r,n),this}bezierCurveTo(t,i,r,n,a,s){var o;return(o=this.currentPath)==null||o.bezierCurveTo(t,i,r,n,a,s),this}splineThru(t){var i;return(i=this.currentPath)==null||i.splineThru(t),this}toShapes(){let t={ORIGIN:0,DESTINATION:1,BETWEEN:2,LEFT:3,RIGHT:4,BEHIND:5,BEYOND:6},i={loc:t.ORIGIN,t:0};function r(f,m,g,p){let v=f.x,_=m.x,y=g.x,w=p.x,b=f.y,E=m.y,M=g.y,S=p.y,T=(w-y)*(b-M)-(S-M)*(v-y),C=(_-v)*(b-M)-(E-b)*(v-y),x=(S-M)*(_-v)-(w-y)*(E-b),R=T/x,L=C/x;if(x===0&&T!==0||R<=0||R>=1||L<0||L>1)return null;if(T===0&&x===0){for(let I=0;I<2;I++)if(n(I===0?g:p,f,m),i.loc===t.ORIGIN){let F=I===0?g:p;return{x:F.x,y:F.y,t:i.t}}else if(i.loc===t.BETWEEN){let F=+(v+i.t*(_-v)).toPrecision(10),Y=+(b+i.t*(E-b)).toPrecision(10);return{x:F,y:Y,t:i.t}}return null}else{for(let Y=0;Y<2;Y++)if(n(Y===0?g:p,f,m),i.loc===t.ORIGIN){let D=Y===0?g:p;return{x:D.x,y:D.y,t:i.t}}let I=+(v+R*(_-v)).toPrecision(10),F=+(b+R*(E-b)).toPrecision(10);return{x:I,y:F,t:R}}}function n(f,m,g){let p=g.x-m.x,v=g.y-m.y,_=f.x-m.x,y=f.y-m.y,w=p*y-_*v;if(f.x===m.x&&f.y===m.y){i.loc=t.ORIGIN,i.t=0;return}if(f.x===g.x&&f.y===g.y){i.loc=t.DESTINATION,i.t=1;return}if(w<-Number.EPSILON){i.loc=t.LEFT;return}if(w>Number.EPSILON){i.loc=t.RIGHT;return}if(p*_<0||v*y<0){i.loc=t.BEHIND;return}if(Math.sqrt(p*p+v*v)<Math.sqrt(_*_+y*y)){i.loc=t.BEYOND;return}let b;p!==0?b=_/p:b=y/v,i.loc=t.BETWEEN,i.t=b}function a(f,m){let g=[],p=[];for(let v=1;v<f.length;v++){let _=f[v-1],y=f[v];for(let w=1;w<m.length;
9944w++){let b=m[w-1],E=m[w],M=r(_,y,b,E);M!==null&&g.find(S=>S.t<=M.t+Number.EPSILON&&S.t>=M.t-Number.EPSILON)===void 0&&(g.push(M),p.push(new Me(M.x,M.y)))}}return p}function s(f,m,g){let p=new Me;m.getCenter(p);let v=[];return g.forEach(_=>{_.boundingBox.containsPoint(p)&&a(f,_.points).forEach(y=>{v.push({identifier:_.identifier,isCW:_.isCW,point:y})})}),v.sort((_,y)=>_.point.x-y.point.x),v}function o(f,m,g,p,v){(v==null||v==="")&&(v="nonzero");let _=new Me;f.boundingBox.getCenter(_);let y=[new Me(g,_.y),new Me(p,_.y)],w=s(y,f.boundingBox,m);w.sort((C,x)=>C.point.x-x.point.x);let b=[],E=[];w.forEach(C=>{C.identifier===f.identifier?b.push(C):E.push(C)});let M=b[0].point.x,S=[],T=0;for(;T<E.length&&E[T].point.x<M;)S.length>0&&S[S.length-1]===E[T].identifier?S.pop():S.push(E[T].identifier),T++;if(S.push(f.identifier),v==="evenodd"){let C=S.length%2===0,x=S[S.length-2];return{identifier:f.identifier,isHole:C,for:x}}else if(v==="nonzero"){let C=!0,x=null,R=null;for(let L=0;L<S.length;L++){let I=S[L];m[I]&&(C?(R=m[I].isCW,C=!1,x=I):R!==m[I].isCW&&(R=m[I].isCW,C=!0))}return{identifier:f.identifier,isHole:C,for:x}}else console.warn('fill-rule: "'+v+'" is currently not implemented.')}let l=0,c=999999999,h=-999999999,u=[];this.subPaths.forEach(f=>{let m=f.getPoints(),g=-999999999,p=999999999,v=-999999999,_=999999999;for(let y=0;y<m.length;y++){let w=m[y];w.y>g&&(g=w.y),w.y<p&&(p=w.y),w.x>v&&(v=w.x),w.x<_&&(_=w.x)}h<=v&&(h=v+1),c>=_&&(c=_-1),m.length&&u.push({curves:f.curves,points:m,isCW:Y7.isClockWise(m),identifier:l++,boundingBox:new aY(new Me(_,p),new Me(v,g))})});let d=u.map(f=>{var m;return o(f,u,c,h,(m=this.userData)==null?void 0:m.style.fillRule)}),A=[];return u.forEach(f=>{let m=d[f.identifier];if(m&&!m.isHole){let g=new RC;g.curves=f.curves,d.filter(p=>(p==null?void 0:p.isHole)&&p.for===f.identifier).forEach(p=>{if(p){let v=u[p.identifier],_=new xC;_.curves=v.curves,g.holes.push(_)}}),A.push(g)}}),A}},VX=!1,WX,T6=new Promise(t=>{WX=t}),M6=!1,Nb;function CDe(){if(VX=!0,M6)return;if(Nb)return Nb;async function t(){let i=await VA(()=>import("./opentype-fc28cde9.js"),[],import.meta.url);WX(i),M6=!0}return Nb=t(),Nb}var TDe=class{async load(t,i,r=()=>{}){let{load:n}=await T6;n(t,(a,s)=>{a||!s?r(a??"Something went wrong"):i(s)})}async parse(t){let{parse:i,Bidi:r}=await T6;try{let n=i(t),a=new r,s=o=>n.charToGlyphIndex(o.char);return a.registerModifier("glyphIndex",null,s),a.applyFeatures(n,n.defaultRenderOptions.features),{font:n,bidi:a}}catch(n){console.error(n)}}};async function MDe(t){return await(await fetch(t)).arrayBuffer()}var xDe=new TDe;async function x6(t){let i,r,n=!1;if(t.url?(i=await MDe(t.url),r=t.url,n=t.url.startsWith("/")):t.data&&(i=t.data.buffer.slice(t.data.byteOffset,t.data.byteOffset+t.data.byteLength)),i)if(VX){let a=await xDe.parse(i);if(a)return{font:a.font,url:r,intercepted:n,arr:i,bidi:a.bidi}}else return{font:void 0,url:r,intercepted:n,arr:i,bidi:null}}function RDe(t,i){return i.state.glyphIndex===t||i.state.fina===t||i.state.medi===t||i.state.init===t}var BDe=class{constructor(t){this._arrayBuffer=new ArrayBuffer(1),this._isLoaded=!1,this._intercepted=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=x6(t).then(i=>{i&&(this._arrayBuffer=i.arr,this._url=i.url,this.font=i.font,this._intercepted=i.intercepted,this._isLoaded=!0,this._bidi=i.bidi)})}update(t){this._isLoaded=!1,this._isUserFont=t.isUserFont??!1,this._loadingPromise=x6(t).then(i=>{i&&(this._arrayBuffer=i.arr,this._url=i.url,this.font=i.font,this._intercepted=i.intercepted,this._isLoaded=!0,this._bidi=i.bidi)})}get url(){return this._url}get intercepted(){return this._intercepted}get isLoaded(){return this._isLoaded}get loadingPromise(){return this._loadingPromise}reverseLigaturesTable(t,i,r){if(!this._bidi)return[];let n=this._bidi;n.getTextGlyphs(i);let a=n.tokenizer.tokens,s=[],o=0,l=r.length===a.length;for(let c=0;c<r.length;c++){let h=r[c].index,u=String.fromCharCode(r[c].unicode),d=a[o];if(RDe(h,d)||l)s.push({char:u,index:h,replacements:[d.state.glyphIndex],replacementChars:[d.char]}),o++;else{let A=d.char,f="",m=[d.state.glyphIndex],g=[],p=!1;for(;!p;)o++,f=i.charAt(o),A+=f,m.push(t.charToGlyphIndex(f)),g=t.stringToGlyphs(A),g.length===1&&g[0].index===h&&(p=!0),o>i.length&&(p=!0);s.push({char:u,index:h,replacements:m,replacementChars:Array.from(A)}),o++}}return s}generateShapes(t,i){if(!this._isLoaded)return;let r=this.font,n=i.fontSize/this.unitsPerEm,a=i.fontSize*i.lineHeight,s=t.map(v=>this.getTextWidth(v,i)),o=i.width,l=this.getCharWidth(` 9945`,i),c=i.horizontalAlign===1?l:0,h=this.computeSpaceWidthForLine(t,0,i),u=this.getLineInitialOffsetX(s[0],o,i.horizontalAlign,t[0],l),d=this.getLineInitialOffsetY(a,t.length,i.height,n,i.verticalAlign),A=[],f=t.map(v=>[]),m=t.map(v=>[]),g;for(let v=0;v<t.length;v++){let _=t[v],y={features:{liga:!0}},w=[];try{w=r.stringToGlyphs(_,y)}catch(E){console.warn(E)}u=this.getLineInitialOffsetX(s[v],o,i.horizontalAlign,_,l);let b=[];try{b=this.reverseLigaturesTable(r,_,w)}catch(E){console.warn(E)}h=this.computeSpaceWidthForLine(t,v,i);for(let E=0;E<w.length;E++){let M=w[E],S=M.index===0?` 9946`:M.unicode?String.fromCharCode(M.unicode):void 0,T=b[E],C=0,x=0;E===0&&i.horizontalAlign===2&&M.leftSideBearing!==void 0&&(x=-M.leftSideBearing*n),g&&(C=r.getKerningValue(M,g)*n),u+=x+C;let R=0;if(S===` 9947`)R=c;else if(S===" ")R=h;else{let L=this.createPath(M,n,u,d,i);L&&(R=L.offsetX-(C+x),A.push(L.path))}if(T.replacements.length===1)m[v].push([u,d]),f[v].push(R);else{let L=T.replacements.map(D=>(r.glyphs.get(D).advanceWidth??0)*n),I=L.reduce((D,U)=>D+=U,0),F=L.map(D=>D/I),Y=u;for(let D=0;D<F.length;D++){let U=R*F[D];m[v].push([Y,d]),f[v].push(U),Y+=U}}u+=R,g=M}d-=a}let p=[];for(let v=0,_=A.length;v<_;v++)p.push(...A[v].toShapes());return{shapes:p,charWidths:f,lineWidths:s,charCoords:m}}get isUserFont(){return this._isUserFont}get arrayBuffer(){return this._arrayBuffer}get ascender(){var t;return((t=this.font)==null?void 0:t.ascender)??0}get descender(){var t;return((t=this.font)==null?void 0:t.descender)??0}get familyName(){var t;return((t=this.font)==null?void 0:t.names.fontFamily)??""}
9947get subfamilyName(){var t;return((t=this.font)==null?void 0:t.names.fontSubfamily)??""}get unitsPerEm(){var t;return((t=this.font)==null?void 0:t.unitsPerEm)??1}getLineInitialOffsetX(t,i,r,n,a){return(r===3||r===2)&&n.indexOf(` 9948`)>=0&&(t-=a),r===3?i*.5-t*.5:r===2?i-t:0}getLineInitialOffsetY(t,i,r,n,a){let s=i*t,o=Math.abs(this.ascender-this.descender)*n,l=t-o,c=-this.ascender*n-l/2;return a===3?-(r-s-c):a===2?-(r*.5-s*.5-c):c}createPath(t,i,r,n,a){var c;let s=t.getPath(r,-n,a.fontSize,{kerning:!1,letterSpacing:a.letterSpacing});if(!s){console.error('THREE.Font: character "'+t+'" does not exists in font family '+this.familyName+".");return}let o=new SDe,l=(t.advanceWidth??1)*i;if(t)for(let h of s.commands){let u=(c=o.currentPath)==null?void 0:c.currentPoint;if(!(u&&h.type!=="Z"&&u.x===h.x&&-u.y===h.y))switch(h.type){case"M":o.moveTo(h.x,-h.y);break;case"L":o.lineTo(h.x,-h.y);break;case"Q":o.quadraticCurveTo(h.x1,-h.y1,h.x,-h.y);break;case"C":o.bezierCurveTo(h.x1,-h.y1,h.x2,-h.y2,h.x,-h.y);break}}return o.subPaths.forEach(h=>{let u=IDe(h.curves);u!==void 0&&h.currentPoint.distanceTo(u)>0&&h.lineTo(u.x,u.y)}),{offsetX:l+a.fontSize*a.letterSpacing,path:o}}getCharWidth(t,i){var r;return((r=this.font)==null?void 0:r.getAdvanceWidth(t,i.fontSize,{kerning:!0,letterSpacing:i.letterSpacing}))??0}getTextWidth(t,i){var r;return((r=this.font)==null?void 0:r.getAdvanceWidth(t,i.fontSize,{kerning:!0,letterSpacing:i.letterSpacing}))??0}computeSpaceWidthForLine(t,i,r){let n=this.getCharWidth(" ",r),a=t[i];if(a){let s=this.countSpaces(a.trimEnd());if(r.horizontalAlign===4&&i<t.length-1&&s){let o=r.width,l=this.getTextWidth(a,r);return(o-(l-s*n))/s}}return n}countSpaces(t){return(t.match(/ /g)||[]).length}};function IDe(t){if(t.length){let i=t[0];if(i instanceof dc)return i.v1;if(i instanceof nc||i instanceof DA)return i.v0}}var DDe=class{constructor(){this.objects=new Map,this.unreachable=new Set}getCached(t){return this.objects.get(t)}get size(){return this.objects.size}get(t,i,r){let n=this.objects.get(t);return n===void 0?(n=this.createObject(t,i,r),this.objects.set(t,n)):n.isShared=!0,n}forceDelete(t){let i=this.objects.get(t);i&&(this.disposeObject(i),this.objects.delete(t))}mutateIfUnique(t,i){let r=this.objects.get(t);if(r&&r.isShared!==!0)return this.objects.delete(t),this.objects.set(i,r),r}startGc(){this.unreachable=new Set(this.objects.keys())}markAsReachable(t,i){let r=this.objects.get(t);i===r&&this.unreachable.delete(t)}endGc(){this.unreachable.forEach(t=>{this.disposeObject(this.objects.get(t)),this.objects.delete(t)}),this.unreachable.clear()}dispose(){this.objects.forEach(t=>{this.disposeObject(t)}),this.objects.clear()}},R6=class extends DDe{constructor(t){super(),this.flatShading=t}disposeObject(t){t.dispose()}createObject(t,i,r){let n=jy(t,i,this.flatShading,r);return n.computeBoundingSphere(),n}},PDe={markNeedsUpdateRendererDirty:()=>{}};function cU(t){return{all:t=t||new Map,on:function(i,r){var n=t.get(i);n?n.push(r):t.set(i,[r])},off:function(i,r){var n=t.get(i);n&&(r?n.splice(n.indexOf(r)>>>0,1):t.set(i,[]))},emit:function(i,r){var n=t.get(i);n&&n.slice().map(function(a){a(r)}),(n=t.get("*"))&&n.slice().map(function(a){a(i,r)})}}}var LDe=class{constructor(t,i,r){var n;this.id=t,this.userAPI=i,this.result=void 0,this.error="null",this.isPrefetched=!1,this.isLoading=!1,this.isLoaded=!1,this.prefetchPromise=new Promise(a=>a()),this.emitter=cU(),((n=i==null?void 0:i.integration)==null?void 0:n.type)==="OpenAI"?this.result={content:""}:i.method==="GET"&&i.url!==""&&(this.prefetchPromise=this.prefetch(r))}async prefetch(t){await this.callUserAPI(t)}async callUserAPI(t){var i,r,n;this.emitter.emit("start",{userAPIId:this.id}),this.isLoading=!0,this.isLoading=!1;try{this.result=await kDe(this.userAPI,t),this.error="null",this.emitter.emit("success",{userAPIId:this.id})}catch(a){let s=((n=(r=(i=a.message)==null?void 0:i.split("_:_"))==null?void 0:r[0])==null?void 0:n.replace("status:",""))??"null";this.error=s,this.result=null,this.emitter.emit("error",{userAPIId:this.id})}this.isLoading=!1,this.isPrefetched=!0,this.isLoaded=!0}update(t,i){this.userAPI=t,this.userAPI.url!==""&&this.userAPI.method==="GET"&&this.prefetch(i)}retrieveValue(t){if(this.result)try{return Zn.zoom(this.result,t)}catch(i){console.error(i)}}retrieveZoomedKeyValues(t){if(this.result){let i=t&&t.length?Zn.zoom(this.result,t):this.result;if(FDe(i))return Object.entries(i);if(UDe(i))return i.map((r,n)=>[n.toString(),r]);throw NDe(i)?new Error("This path points to a value, use retrieveValue() instead. "+(t==null?void 0:t.join("."))):new Error("Path error"+(t==null?void 0:t.join(".")))}}dispose(){}on(t,i){this.emitter.on(t,i)}off(t,i){this.emitter.off(t,i)}get autostart(){return this.userAPI.autoStart}};function ODe(t){let i=new Headers;
9948return t.headers.forEach(r=>{r.data.key!==""&&i.append(r.data.key,r.data.value)}),i}function NDe(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===null}function UDe(t){return Array.isArray(t)}function FDe(t){return typeof t=="object"&&t!==null}async function kDe(t,i,r=new AbortController){var s,o;let n;if(((s=t.integration)==null?void 0:s.type)==="OpenAI"){let l=DS(t.integration.prompt===""?"":JSON.parse(t.integration.prompt),i),c=t.integration.behavior===""?"":DS(JSON.parse(t.integration.behavior),i);n=`{ 9949 "model": "${t.integration.model}", 9950 "messages": [${t.integration.useBehavior?` 9951 { 9952 "role": "system", 9953 "content": "${c}" 9954 },`:""} 9955 { 9956 "role": "user", 9957 "content": "${l}" 9958 } 9959 ] 9960 }`}else t.method==="POST"&&t.body&&(n=DS(JSON.parse(t.body),i));let a=await fetch(t.url,{method:t.method,headers:ODe(t),signal:r.signal,body:n});if(!a.ok)throw new Error("status:"+a.status+"_:_"+a.statusText);return((o=t.integration)==null?void 0:o.type)==="OpenAI"?{content:(await a.json()).choices[0].message.content}:await a.json()}var jX=(t,i)=>{if(typeof t=="string"){let r=i.getVariable(t);if(r)return jX(r,i)}return ja.isBoolean(t)?ja.getDisplayedValue(t).toLowerCase():ja.getDisplayedValue(t)},DS=(t,i)=>t.map((r,n)=>{if("text"in r)return r.text;if("type"in r){if(r.type==="paragraph")return(n>0?` 9961`:"")+DS(r.children,i);if(r.type==="variable"){let a=i.getVariable(r.variableId);if(a!==void 0)return jX(a,i)}}return""}).join(""),PS=1e3,B6=512*PS;function HDe(t,i){let r=typeof t;return!!((i==="string"||i==="number")&&r===i||i==="boolean"&&(t==="true"||t==="false"||t===!0||t===!1)||i==="image"&&r==="string"&&t.startsWith("http"))}var GDe="https://hooks.spline.design",zDe=`${GDe}/events?hashFile=`,QDe=class{constructor(t,i){this.id=t,this.userWebhook=i,this.result=void 0,this._connected=!1,this.emitter=cU(),this.reconnectWaitFor=PS,this._onError=r=>{var n,a,s;(n=this.eventSource)==null||n.removeEventListener("message",this._onMessage),(a=this.eventSource)==null||a.removeEventListener("error",this._onError),(s=this.eventSource)==null||s.removeEventListener("open",this._onConnected),this._scheduleReconnect()},this._onConnected=r=>{clearTimeout(this.scheduledReconnectHandle),this.reconnectWaitFor=PS,this._connected=!0},this._onDisconnected=()=>{clearTimeout(this.scheduledReconnectHandle),this.reconnectWaitFor=PS,this._connected=!1},this._onMessage=r=>{let n=r.data,a;try{a=JSON.parse(n)}catch(s){console.error("Error parsing webhook message",s)}if(a){let s=!1;this.userWebhook.parametersSchemas.forEach(({data:o})=>{a[o.name]!==void 0&&HDe(a[o.name],o.type)&&(this.result===void 0&&(this.result={}),this.result[o.name]=a[o.name],s=!0)}),s&&this.emitter.emit("message",{userWebhookId:this.id})}}}connect(){clearTimeout(this.scheduledReconnectHandle),this.userWebhook.url&&(this.eventSource=new EventSource(zDe+this.userWebhook.url),this.eventSource.addEventListener("message",this._onMessage),this.eventSource.addEventListener("error",this._onError),this.eventSource.addEventListener("open",this._onConnected))}disconnect(){var t,i,r,n;(t=this.eventSource)==null||t.removeEventListener("message",this._onMessage),(i=this.eventSource)==null||i.removeEventListener("error",this._onError),(r=this.eventSource)==null||r.removeEventListener("open",this._onConnected),(n=this.eventSource)==null||n.close(),this._onDisconnected(),clearTimeout(this.scheduledReconnectHandle)}_scheduleReconnect(){this.reconnectWaitFor*=2,this.reconnectWaitFor>B6&&(this.reconnectWaitFor=B6),clearTimeout(this.scheduledReconnectHandle),this.scheduledReconnectHandle=setTimeout(()=>{this.scheduledReconnectHandle=void 0,this.connect()},this.reconnectWaitFor)}update(t){this.userWebhook=t}dispose(){this._connected&&this.disconnect()}get connected(){return this._connected}on(t,i){this.emitter.on(t,i)}off(t,i){this.emitter.off(t,i)}getParametersKeys(){return this.userWebhook.parametersSchemas.map(t=>t.data.name)}getParameterValue(t){var i;if(this.getParametersKeys().includes(t)){if(this.result)return(i=this.result)==null?void 0:i[t];for(let r of this.userWebhook.parametersSchemas)if(r.data.name===t)return iL.defaultParameterValueByType(r.data.type)}}};function RL(t){return"variable_"+t}var VDe=class extends B2e{constructor(t){super(),this.shared=t}create(t){return new OX(t,this.shared)}},hU=class{constructor(t,i={},r=!0,n=!1){if(this.data=t,this.needsJitter=r,this.enableLocalStorageForPersistentVariables=n,this.geometryCache=new R6(!0),this.geometryCache2=new R6(!1),this.imageHolderCache=new VDe(this),this.thisContext={scene:PDe,shared:this},this.deletedMaterial=new xL(Wa.defaultTwoLayerData("phong"),this.thisContext,""),this.deletedImage=new Yd(nL.emptyImage,this),this.deletedVideo=new Yd(qC.defaultVideo,this),this.materials={},this.images={},this.uiBuffers={},this.videos={},this.colors={},this.audios={},this.particles={},this.fonts={},this.variables={},this.userAPIs={},this.userWebhooks={},this.mouseProperty=null,this.raycastProperty=null,this.requestRender=()=>{this._requestRender&&this._requestRender()},i.images)for(let[a,s]of Object.entries(i.images))this.addImage(a,s);if(i.videos)for(let[a,s]of Object.entries(i.videos))this.addVideo(a,s);if(i.audios)for(let[a,s]of Object.entries(i.audios))this.addAudio(a,s);if(i.particles)for(let[a,s]of Object.entries(i.particles))this.addParticle
vendor: 4,805 bytes, line 9961
9961(a,s);this.reset(t)}setRequestRender(t){this._requestRender=t}getImageLoadPromises(){return Object.values(this.images).map(t=>t.loadPromise)}setEntityOpContext(t){this.entityOpContext=t}reset(t,i=!1){this.data=t,this.resetLib(t.lib);for(let{id:r,data:n}of t.variables)this.addVariableHolder(r,n),i&&this.updateVariableHolder(r,n);for(let[r,n]of Object.entries(t.userAPIs))this.addUserAPI(r,n);for(let[r,n]of Object.entries(t.userWebhooks))this.addUserWebhook(r,n);for(let[r,n]of Object.entries(t.images))this.addImage(r,n);for(let[r,n]of Object.entries(t.videos))this.addVideo(r,n);for(let[r,n]of Object.entries(t.colors))this.addColor(r,n);for(let[r,n]of Object.entries(t.materials))this.addMaterial(r,n);for(let[r,n]of Object.entries(t.audios))this.addAudio(r,n);for(let[r,n]of Object.entries(t.particles))this.addParticle(r,n);for(let[r,n]of Object.entries(t.fonts))this.addFont(r,n)}addMaterial(t,i){if(this.materials[t]){let r=this.materials[t];r.reset(i,this.thisContext),r.dispose()}else{let r=new xL(i,this.thisContext,t);this.materials[t]=r}}deleteMaterial(t){this.materials[t]&&(this.materials[t].nodeMaterialDispose(),delete this.materials[t])}getMaterial(t){return this.materials[t]}getMaterialOrDeletedPlaceholder(t){return this.materials[t]??this.deletedMaterial}material(t){return typeof t=="string"?this.getMaterialOrDeletedPlaceholder(t):t==null?(console.error("material is undefined or null"),this.deletedMaterial):new lU(t,this.thisContext)}getMaterials(){return this.materials}addImage(t,i){return this.images[t]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),this.images[t].updateSrc(i.data),!0):(this.images[t]=new Yd(i,this),!1)}deleteImage(t){let i=this.images[t];i&&(i.dispose(),delete this.images[t])}getDefaultImage(){return this.images.image_0}getImage(t){return this.images[t]??this.deletedImage}image(t){return typeof t=="string"?this.getImage(t):this.imageHolderCache.load(t)}addUIBuffer(t,i){return this.uiBuffers[t]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),this.uiBuffers[t].updateSrc(i),!0):(this.uiBuffers[t]=new Yd(i,this),!1)}uiBuffer(t){return this.uiBuffers[t]}addVideo(t,i){return this.videos[t]?(this.videos[t].updateSrc(i.data),!0):(this.videos[t]=new Yd(i,this),!1)}deleteVideo(t){let i=this.videos[t];i&&(i.dispose(),delete this.videos[t])}getVideo(t){return this.videos[t]??this.deletedVideo}video(t){return typeof t=="string"?this.getVideo(t):this.imageHolderCache.load(t)}addColor(t,i){return this.colors[t]?(this.onColorOrImageUpdate&&this.onColorOrImageUpdate(),"a"in i?this.colors[t].setRGBA(i.r,i.g,i.b,i.a):this.colors[t].setRGBA(i.r,i.g,i.b,1),!0):("a"in i?this.colors[t]=new AT(i.r,i.g,i.b,i.a):this.colors[t]=new AT(i.r,i.g,i.b,1),!1)}updateColor(t,i){if(this.colors[t]){this.onColorOrImageUpdate&&this.onColorOrImageUpdate();let r=this.colors[t];return this.colors[t].r=i.r??r.r,this.colors[t].g=i.g??r.g,this.colors[t].b=i.b??r.b,this.colors[t].a=i.a??r.a,!0}return!1}deleteColor(t){this.colors[t]&&delete this.colors[t]}getColor(t){return this.colors[t]}color(t){let i;if(typeof t=="string"){let r=this.getColor(t);r?i=r:(console.warn("Tried to create color layer params with a color key that does not exist in the assets manager"),i=new Xa(0,0,0,0))}else return"a"in t?new Xa(t.r,t.g,t.b,t.a):new Xa(t.r,t.g,t.b,1);return i}addAudio(t,i){this.audios[t]=i}getAudio(t){let i=this.audios[t];if(i instanceof T_)return i;{let r=new T_({src:i.data});return this.audios[t]=r,r}}addParticle(t,i){this.particles[t]=i}getParticle(t){return this.particles[t]}deleteParticle(t){this.particles[t]&&delete this.particles[t]}deleteAudio(t){let i=this.audios[t];i&&(i instanceof T_&&i.dispose(),delete this.audios[t])}addFont(t,i){this.fonts[t]=new BDe(i),this.fonts[t].loadingPromise.then(()=>this.requestRender())}getFont(t){return this.fonts[t]}deleteFont(t){this.fonts[t]&&delete this.fonts[t]}dispose(){Object.keys(this.materials).forEach(t=>this.deleteMaterial(t)),this._requestRender=void 0,Object.values(this.audios).forEach(t=>{t instanceof T_&&t.dispose()}),this.audios={},this.particles={},this.geometryCache.dispose(),this.geometryCache2.dispose()}addVariableHolder(t,i){if(this.variables[t]===void 0){let r=i.value;if(this.enableLocalStorageForPersistentVariables&&i.persistent){let n=localStorage.getItem(RL(t));r=n!==null?JSON.parse(n):i.value}return this.variables[t]={value:r,locations:[],persistent:i.persistent},"dynamicVariableType"in i&&(this.variables[t].dynamicVariablePlayState="Playing",this.variables[t].dynamicVariableToggleIsForward=void 0),!0}return this.variables[t].value=i.value,!1}resetDynamicVariablePlayState(){for(let t in this.variables)this.variables[t].dynamicVariablePlayState!==void 0&&(this.variables[t].dynamicVariablePlayState="Playing",this.variables[t].dynamicVariableToggleIsForward=void 0)}
9961updateVariableHolder(t,i){this.updateVariable(t,i.value)}updateVariable(t,i){if(this.variables[t]===void 0)return!1;this.variables[t].value=i,this.enableLocalStorageForPersistentVariables&&this.variables[t].persistent&&localStorage.setItem(RL(t),JSON.stringify(i));let r=i;for(;typeof r=="string";)r=this.variables[r].value;let n=this.entityOpContext.scene;for(let a=this.variables[t].locations.length-1;a>=0;a--){let s=this.variables[t].locations[a];if(s[0]==="material"){let o=s[1],l=r,c={scene:n,shared:this},h=s.slice(2);n.traverseMaterial(d=>{let A=d.root??d;A.uuid===o&&A.onVariableUpdate(h,l,c)});let u=this.materials[o];u&&u.onVariableUpdate(h,l,c)}else{let o=n.find(s[0]);if(o===void 0){this.variables[t].locations.splice(a,1);continue}if(s[1]!=="geometry"&&s[1]!=="particles"){for(let l=1;l<s.length-1;l++)o=o[s[l]];s[1]==="rotation"?o[s[s.length-1]]=r*Ct.DEG2RAD:o[s[s.length-1]]=r}if(o=n.find(s[0]),o.type==="ParticleEmitter"&&o.updateVariableState(r,s),Oi.is(o)){if(s[1]==="position"||s[1]==="rotation"||s[1]==="scale")o.onVariableUpdate();else if(s[1]==="geometry"){let l=o;o.component&&(l=o.component);let c=l.dataPatched;l.chooseGeoemtryCache(this).forceDelete(c.geometry),l.createGeometryDelayed(this.entityOpContext),l.onVariableUpdate(!0),l.instances.forEach(h=>{let u=h.dataPatched;h.chooseGeoemtryCache(this).forceDelete(u.geometry),h.createGeometryDelayed(this.entityOpContext),h.onVariableUpdate(!0)})}}}}return this.requestRender(),!0}deleteVariable(t){this.variables[t]&&delete this.variables[t]}getVariable(t,i){var r,n,a;if(Array.isArray(t)){if(t[0]==="mouse")return((r=this.mouseProperty)==null?void 0:r[t[1]])??0;if(t[0]==="raycast")return((n=this.raycastProperty)==null?void 0:n[t[1]])??0;let s=this.entityOpContext.scene.find(t[0]);if(t[1]==="width"||t[1]==="height"||t[1]==="depth")return s.geometry.userData.parameters[t[1]];for(let o=1;o<t.length;o++)s=s[t[o]];return t[1]==="rotation"&&(s*=Ct.RAD2DEG),s}for(let s in this.variables){if(i===void 0)break;let o=this.variables[s],l=(a=o.locations)==null?void 0:a.findIndex(c=>Zn.equal(c,i));l!==void 0&&l!==-1&&o.locations.splice(l,1)}if(typeof t=="string"){let s=t,o=t;do{if(o=s,this.variables[s]===void 0)break;let l=this.variables[s].value;i&&this.variables[o]!==void 0&&this.variables[o].locations.push(i),s=l}while(typeof s=="string");return s}else return t}getVariables(){return this.variables}getDynamicVariablePlayState(t){var i;return(i=this.variables[t])==null?void 0:i.dynamicVariablePlayState}setDynamicVariablePlayState(t,i){this.variables[t]!==void 0&&(this.variables[t].dynamicVariablePlayState=i)}getDynamicVariableToggleIsForward(t){var i;return(i=this.variables[t])==null?void 0:i.dynamicVariableToggleIsForward}setDynamicVariableToggleIsForward(t,i){this.variables[t]!==void 0&&(this.variables[t].dynamicVariableToggleIsForward=i)}resetLib(t){for(let[i,r]of Object.entries(t.images))this.addImage(i,r.asset);for(let[i,r]of Object.entries(t.audios))this.addAudio(i,r.asset);for(let[i,r]of Object.entries(t.particles))this.addParticle(i,r.asset);for(let[i,r]of Object.entries(t.colors))this.addColor(i,r.asset);for(let[i,r]of Object.entries(t.fonts))this.addFont(i,r.asset);for(let[i,r]of Object.entries(t.materials))this.addMaterial(i,r.asset);for(let[i,r]of Object.entries(t.videos))this.addVideo(i,r.asset);for(let[i,r]of Object.entries(t.variables))this.addVariableHolder(i,r.asset)}updateLibByOp(t,i){t.path[0]==="images"?t.path.length===1&&t.type===1?this.addImage(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteImage(t.id):t.path[0]==="videos"?t.path.length===1&&t.type===1?this.addVideo(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteVideo(t.id):t.path[0]==="audios"?t.path.length===1&&t.type===1?this.addAudio(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteAudio(t.id):t.path[0]==="particles"?t.path.length===1&&t.type===1?this.addParticle(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteParticle(t.id):t.path[0]==="colors"?t.path.length===1&&t.type===1?this.addColor(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteColor(t.id):t.path[0]==="materials"?t.path.length===1&&t.type===1?this.addMaterial(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteMaterial(t.id):t.path[0]==="fonts"?t.path.length===1&&t.type===1?this.addFont(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteFont(t.id):t.path[0]==="variables"?t.path.length===1&&t.type===1?this.addVariableHolder(t.id,t.data.asset):t.path.length===1&&t.type===2&&this.deleteVariable(t.id):t.path[0]==="components"&&i.updateByLibOp(t,this)}updateByOp(t,i,r){var n,a;if(this.data=i,t.path[0]==="images")t.path.length===2&&t.type===0?t.props.data&&this.getImage(t.path[1]).updateSrc(t.props.data):t.path.length===1&&t.type===1?this.addImage(t.id,t.data):t.path.length===1&&t.type===2&&this.deleteImage(t.id);else if(t.path[0]==="videos")t.path.length===2&&t.type===0?t.props.data&&this.getVideo(t.path[1]).updateSrc(t.props.data):t.path.length===1&&t.type===1?this.addVideo(t.id,t.data):t.path.length===1&&t.type===2&&this.deleteVideo(t.id);else if(t.path[0]==="audios")t.path.length===2&&t.type===0?t.props.data&&this.addAudio(t.path[1],i.audios[t.path[1]]):t.path.length===1&&t.type===1?this.addAudio(t.id,t.data):t.path.length===1&&t.type===2&&this.deleteAudio(t.id);else if(t.path[0]==="particles")t.path.length===2&&t.type===0?t.props.data&&this.addParticle
9961(t.path[1],i.particles[t.path[1]]):t.path.length===1&&t.type===1?this.addParticle(t.id,t.data):t.path.length===1&&t.type===2&&this.deleteParticle(t.id);else if(t.path[0]==="colors")t.path.length===2&&t.type===0?this.updateColor(t.path[1],t.props):t.path.length===1&&t.type===1?this.addColor(t.id,t.data):t.path.length===1&&t.type===2&&this.deleteColor(t.id);else if(t.path[0]==="materials")t.path.length===1&&t.type===1?this.addMaterial(t.id,t.data):t.path.length===1&&t.type===2?this.deleteMaterial(t.id):t.path.length>1&&this.getMaterial(t.path[1]).updateByOp(ya.drop(t,2),i.materials[t.path[1]],{shared:this,scene:r});else if(t.path[0]==="fonts")t.path.length===2&&t.type===0?this.updateFont(t.path[1],t,r):t.path.length===1&&t.type===1?this.addFont(t.id,t.data):t.path.length===1&&t.type===2&&this.deleteFont(t.id);else if(t.path[0]==="variables")t.path.length===2&&t.type===0?"value"in t.props?this.updateVariable(t.path[1],t.props.value):"persistent"in t.props&&(this.variables[t.path[1]].persistent=t.props.persistent):t.path.length===1&&t.type===4?this.addVariableHolder(t.id,t.data):t.path.length===1&&t.type===5&&this.deleteVariable(t.id);else if(t.path[0]==="userAPIs"){if(t.path.length===1&&t.type===1)this.addUserAPI(t.id,t.data);else if(t.path.length===1&&t.type===2)this.deleteUserAPI(t.id);else if(typeof t.path[1]=="string"){let s=i.userAPIs[t.path[1]];s&&((n=this.getUserAPI(t.path[1]))==null||n.update(s,this))}}else if(t.path[0]==="userWebhooks"){if(t.path.length===1&&t.type===1)this.addUserWebhook(t.id,t.data);else if(t.path.length===1&&t.type===2)this.deleteUserWebhook(t.id);else if(typeof t.path[1]=="string"){let s=i.userWebhooks[t.path[1]];s&&((a=this.getUserWebhook(t.path[1]))==null||a.update(s))}}else t.path[0]==="lib"&&this.updateLibByOp(ya.drop(t,1),r)}updateFont(t,i,r){if(i.props.url){let n=this.getFont(t),a={...this.data.fonts[t],url:i.props.url};n.update(a),n.loadingPromise.then(()=>this.requestRender()),r.updateFont(t,this)}}addUserAPI(t,i){return this.userAPIs[t]?(this.userAPIs[t].update(i,this),!0):(this.userAPIs[t]=new LDe(t,i,this),!1)}getUserAPI(t){return this.userAPIs[t]}getUserAPIs(){return this.userAPIs}deleteUserAPI(t){let i=this.userAPIs[t];i&&(i.dispose(),delete this.userAPIs[t])}addUserWebhook(t,i){return this.userWebhooks[t]?(this.userWebhooks[t].update(i),!0):(this.userWebhooks[t]=new QDe(t,i),!1)}getUserWebhook(t){return this.userWebhooks[t]}getUserWebhooks(){return this.userWebhooks}deleteUserWebhook(t){let i=this.userWebhooks[t];i&&(i.dispose(),delete this.userWebhooks[t])}};new hU(Jo.emptyData());var K0=class extends zs{updateByPatchedOp(t,i,r){if(super.updateByPatchedOp(t,i,r),Exe(t.path,["materials"])!==null&&t.type===0&&Array.isArray(this.material))for(let[n,a]of Object.entries(t.props)){let s=r.shared.material(a);this.material[Number(n)]=s}else if(Er(t.path,["material"])&&this.material instanceof LA)"material"in i&&typeof i.material!="string"&&this.material.updateByOp(ya.drop(t,1),i.material,r);else if(Er(t.path,["materials","*"])&&Array.isArray(this.material)){let n=t.path[1];if("materials"in i&&n<this.material.length){let a=i.materials[n];typeof a!="string"&&this.material[n].updateByOp(ya.drop(t,2),a,r)}}}get needsAO(){return this.material!==void 0?(Array.isArray(this.material)?this.material[0]:this.material).hasAO:!1}updateState(t,i){var n,a;super.updateState(t,i),t.castShadow!==void 0&&(this.castShadow=t.castShadow),t.receiveShadow!==void 0&&(this.receiveShadow=t.receiveShadow);let r=this.dataPatched;if(((n=t.geometry)==null?void 0:n.type)!=="NonParametricGeometry"&&"material"in t&&t.material!==void 0&&(this.disposeMaterial(),this.material=i.shared.material(t.material).getFlavor(r.flatShading,r.side,r.wireframe),i.scene.markNeedsUpdateRendererDirty()),(((a=t.geometry)==null?void 0:a.type)==="NonParametricGeometry"||"materials"in t)&&("materials"in t&&t.materials!==void 0?(this.disposeMaterial(),this.material=t.materials.map(s=>i.shared.material(s).getFlavor(r.flatShading,r.side,r.wireframe)),i.scene.markNeedsUpdateRendererDirty()):"material"in t&&t.material!==void 0&&(this.disposeMaterial(),this.material=[i.shared.material(t.material).getFlavor(r.flatShading,r.side,r.wireframe)],i.scene.markNeedsUpdateRendererDirty())),t.flatShading!==void 0||t.wireframe
9961!==void 0||t.side!==void 0)if(Array.isArray(this.material))for(let s=0;s<this.material.length;s++)this.material[s]=this.material[s].getFlavor(r.flatShading,r.side,r.wireframe);else this.material=this.material.getFlavor(r.flatShading,r.side,r.wireframe)}disposeMaterial(){this.material&&VY(this.material).forEach(t=>{t instanceof LA&&(t instanceof xL||t.nodeMaterialDispose())})}dispose(){this.disposeMaterial(),super.dispose()}},I6=new O,D6=new ai,P6=new ai,WDe=new O,L6=new ht,ds=class extends K0{constructor(t,i,r){super(t,i),this.data=i,this.isSkinnedMesh=!1,this.localGeometry=void 0,i.bindMode&&i.bindMatrix&&(this.bindMode=i.bindMode,this.bindMatrix=new ht().fromArray(i.bindMatrix),this.bindMatrixInverse=new ht)}chooseGeoemtryCache(t){return t.geometryCache}markGeometryAsReachable(t){this.geometryCreateDeleyed instanceof Lt&&this.chooseGeoemtryCache(t).markAsReachable(this.dataPatched.geometry,this.geometryCreateDeleyed)}get geometry(){if(this.localGeometry!==void 0)return this.localGeometry;if(this.geometryCreateDeleyed instanceof hU){let t=this.geometryCreateDeleyed,i=this.chooseGeoemtryCache(t);this.geometryCreateDeleyed=i.get(this.dataPatched.geometry,t,this)}return this.geometryCreateDeleyed}set geometry(t){this.localGeometry=t}get is2DAndNoDepth(){let t=this.dataPatched.geometry;return $C.is2DParametricMesh(t.type)&&t.depth===0}get is2DType(){return $C.is2DParametricMesh(this.geometry.userData.type)}get isNonParametric(){return this.geometry.userData.type==="NonParametricGeometry"}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),Er(t.path,["geometry"])&&this.updateByPatchedOpGeometry(ya.drop(t,1),i.geometry,r)}removeInteractionGeometry(t){var i;(i=this.localGeometry)==null||i.dispose(),this.localGeometry=void 0}updateGeometryInteractions(t,i){var n;this.invalidateDownstreamBooleanData();let r=this.data.geometry.type;if(r==="NonParametricGeometry"||r==="SubdivGeometry"){let a=t;if(this.localGeometry===void 0){let h={...this.data.geometry,...a};this.localGeometry=jy(h,i,this.data.flatShading,this)}let s,o,l;a.scaleBaked?[s,o,l]=a.scaleBaked:{width:s,height:o,depth:l}=a;let c=this.localGeometry.userData;c.sxPrev!==void 0&&wL(this.localGeometry.attributes,s/c.sxPrev,o/c.syPrev,l/c.szPrev),c.sxPrev=s,c.syPrev=o,c.szPrev=l}else{let a={...this.data.geometry,...t};(n=this.localGeometry)==null||n.dispose(),this.localGeometry=jy(a,i,this.data.flatShading,this)}}refreshAttachedClonersInteractions(){for(let t of this.attachedSurfaceCloners)t.update()}refreshAttachedCloners(t){for(let i of this.attachedSurfaceCloners)t.scene.addPendingUpdateCloner(i.object)}refreshAttachedPaths(t){for(let i of this.attachedPaths)t.scene.addPendingCommand(()=>i.updateShape())}createGeometryDelayed(t){this.geometryCreateDeleyed=t.shared,this.refreshAttachedCloners(t),this.refreshAttachedPaths(t)}updateByPatchedOpGeometry(t,i,r){var a;let n=!1;t.type===0&&t.path.length===0&&Object.keys(t.props).includes("scaleBaked")&&this.geometryCreateDeleyed instanceof Rs&&this.chooseGeoemtryCache(r.shared).mutateIfUnique(this.geometryCreateDeleyed.data,i)===this.geometryCreateDeleyed&&(n=!0,this.geometryCreateDeleyed.mutateDirectlyScaleBaked(i,t.props.scaleBaked),this.refreshAttachedCloners(r),this.refreshAttachedPaths(r)),n||((a=r.scene)==null||a.markGeometryCacheDirty(),this.createGeometryDelayed(r)),this.resetBBoxNeedsUpdate(),this.invalidateDownstreamBooleanData()}updateGeometryOnStateUpdate(t,i){this.createGeometryDelayed(i)}updateState(t,i){t.geometry!==void 0&&this.updateGeometryOnStateUpdate(t.geometry,i),super.updateState(t,i)}updateGeometryGroupsIfNeeded(){var t;Array.isArray(this.material)&&this.geometry.groups.length===0&&this.geometry.addGroup(0,Math.max(((t=this.geometry.getIndex())==null?void 0:t.count)??0,this.geometry.getAttribute("position").count),0)}updateEntityBoxSize(t,i){let r=this.geometry.userData.parameters;this.is2DType?t.set(0,0,r.depth*.5):this.isNonParametric?(t.setScalar(0),this.geometry.boundingSphere&&t.copy(this.geometry.boundingSphere.center),i.set(r.width,r.height,r.depth??0).multiplyScalar(.5)):t.setScalar(0),i.set(r.width,r.height,r.depth??0).multiplyScalar(.5)}updateMatrixWorld(t){super.updateMatrixWorld(t),this.bindMode==="attached"?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode==="detached"&&this.bindMatrixInverse.copy(this.bindMatrix).invert()}bind(t,i){this.skeleton=t,this.isSkinnedMesh=!0,i===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),i=this.matrixWorld),this.bindMatrix.copy(i),this.bindMatrixInverse.copy(i).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(t){let i=new ai,r=this.geometry.attributes.skinWeight;for(let n=0,a=r.count;n<a;n++){i.fromBufferAttribute(r,n);let s=1/i.manhattanLength();s!==1/0?i.multiplyScalar(s):i.set(1,0,0,0),r.setXYZW(n,i.x,i.y,i.z,i.w)}}boneTransform(t,i){let r=this.skeleton;if(r===void 0)return;let n=this.geometry;D6.fromBufferAttribute(n.attributes.skinIndex,t),P6.fromBufferAttribute(n.attributes.skinWeight,t),I6.copy(i).applyMatrix4(this.bindMatrix),i.set(0,0,0);for(let a=0;a<4;a++){let s=P6.getComponent(a);if(s!==0){let o=D6.getComponent(a);L6.multiplyMatrices(r.bones[o].matrixWorld,r.boneInverses[o]),i.addScaledVector(WDe.copy(I6).applyMatrix4(L6),s)}}return i.applyMatrix4(this.bindMatrixInverse)}};function jDe(t){var o,l;if(t.geometry.attributes.extrudeNormal||!t.geometry.attributes.position||!t.geometry.attributes.normal)return;let i=new Map,r=t.geometry.attributes,n=r.position.array,a=r.normal.array,s=new Float32Array(n.length);for(let c=0;c<n.length;c+=3){let h=`${n[c]}_${n[c+1]}_${n[c+2]}`,u=new O(a[c],a[c+1],a[c+2]);i.has(h)?(o=i.get(h))==null||o.normals.push(u):i.set(h,{normals:[u],result:new O})}i.forEach((c,h)=>{for(let u of c.normals)c.result.add(u);c.result.divideScalar(c.normals.length)});for(let c=0;c<n.length;c+=3){let h=`${n[c]}_${n[c+1]}_${n[c+2]}`,u=(l=i.get(h))==null?void 0:l.result;
9961u&&(s[c]=u.x,s[c+1]=u.y,s[c+2]=u.z)}t.geometry.setAttribute("extrudeNormal",new Et(s,3))}function YDe(t){if(t.geometry.attributes.extrudeNormals||!t.geometry.attributes.position)return;let i=t.geometry.attributes.position.array,r=new Float32Array(i.length),n=new O;for(let a=0;a<i.length;a+=3)n.set(i[a],i[a+1],i[a+2]).normalize(),r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z;t.geometry.setAttribute("extrudeNormal",new Et(r,3))}function uU(t){if(Array.isArray(t.material)){for(let i of t.material)if(i.getLayersOfType("outline").length===0)return}else if(!(t.material instanceof LA)||t.material.getLayersOfType("outline").length===0)return;t instanceof ds&&t.is2DAndNoDepth?YDe(t):jDe(t)}function dU(t){if(!t.geometry.attributes.position)return;let i=t.geometry.attributes.position.array,r=new Float32Array(i.length),n=parseInt(t.uuid.replace(/\D/g,"")),a=[Ct.seededRandom(n),Ct.seededRandom(n+1e4),Ct.seededRandom(n+2e4)];for(let s=0;s<i.length;s++)r[s]=a[s%3];t.geometry.setAttribute("randomColor",new ei(r,3))}var Ic=new Sn,jv=new O;function KDe(t){let i=!1;return t.scene.objects.traverse((r,n)=>{n.type==="Mesh"&&n.geometry.type==="SubdivGeometry"&&(i=!0)}),i}var Yy=class extends ds{constructor(t,i,r){super(t,i,r),this.data=i,this.hiddenMatrixOld=new ht,this.smoothShading=!0,this.skipReactionUpdate=!1}chooseGeoemtryCache(t){return this.dataPatched.flatShading?t.geometryCache:t.geometryCache2}get subdivPointerNew(){return this.localGeometry!==void 0?this.subdivPointer:this.geometry.ensureSubdivPointer()}get originalGeometryNew(){return this.localGeometry!==void 0?this.originalGeometry:this.geometry.originalGeometry}get phongAngle(){return this.data.geometry.phongAngle??45}updateEntityBoxSize(t,i){let r=this.geometry.userData.parameters;t.copy(this.originalGeometryNew.boundingSphere.center),i.set(r.width,r.height,r.depth??0).multiplyScalar(.5)}createGeometryByControls(t){var s,o,l;if(this.skipReactionUpdate===!0)return;let i=(s=this.localGeometry)==null?void 0:s.uuid,{originalGeometry:r,subdividedGeometry:n,subdivPointer:a}=Rs.build(t,this.subdivPointer,this.smoothShading,this.hasNonUniformScale?this.shearScale:void 0);this.subdivPointer=a,r!==void 0&&((o=this.originalGeometry)==null||o.dispose(),this.originalGeometry=r),n!==void 0&&((l=this.subdividedGeometry)==null||l.dispose(),this.subdividedGeometry=n??void 0),this.localGeometry=this.subdividedGeometry??this.originalGeometry,uU(this),dU(this),this.calcBoundingBox(),i&&(this.localGeometry.uuid=i)}updateState(t,i){if(super.updateState(t,i),t.flatShading!==void 0){let r=this.material;this.material=Array.isArray(r)?r.map(n=>n.getFlavor(!1,n.side,n.wireframe)):r.getFlavor(!1,r.side,r.wireframe),this.smoothShading=!t.flatShading,this.createGeometryDelayed(i)}}updateMesh(t=!1){Rs.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1,this.originalGeometry,t&&this.hasNonUniformScale?this.shearScaleInv:void 0),this.subdividedGeometry&&Rs.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1,this.subdividedGeometry,t&&this.hasNonUniformScale?this.shearScaleInv:void 0)}updateTopology(){this.originalGeometry.dispose(),this.originalGeometry=Rs.buildLevel(this.subdivPointer,!0,this.smoothShading?this.phongAngle:-1),this.subdividedGeometry&&(this.subdividedGeometry.dispose(),this.subdividedGeometry=Rs.buildLevel(this.subdivPointer,!1,this.smoothShading?this.phongAngle:-1)),this.localGeometry=this.subdividedGeometry??this.originalGeometry}raycast(t,i){let r=this.localGeometry;this.localGeometry=this.originalGeometryNew,zs.prototype.raycast.call(this,t,i),this.localGeometry=r}activateSVDCompensation(){!this.hasNonUniformScale||(this.matrix.copy(this.matrixWorldRigid),this.hiddenMatrixOld.copy(this.hiddenMatrix),this.hiddenMatrix.copy(this.parent.matrixWorld).invert())}deactivateSVDCompensation(){!this.hasNonUniformScale||(this.updateMatrix(),this.hasNonUniformScale=void 0,this.hiddenMatrix.copy(this.hiddenMatrixOld))}calcBoundingBox(){let t=this.originalGeometry;t.boundingSphere===null&&(t.boundingSphere=new ho,this.subdividedGeometry&&(this.subdividedGeometry.boundingSphere=t.boundingSphere));
9961let i=t.attributes.position,r=t.boundingSphere.center;Ic.setFromBufferAttribute(i),Ic.getCenter(r),t.boundingSphere.radius=r.distanceTo(Ic.max),isNaN(t.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this),Ic.getSize(jv),this.hasNonUniformScale&&jv.divide(this.scale);let n={width:jv.x,height:jv.y,depth:jv.z};return this.geometry.userData.parameters=n,n}updateBoundingSphere(t){let i=this.originalGeometry;Ic.min.set(t[0],t[2],t[4]),Ic.max.set(t[1],t[3],t[5]),this.hasNonUniformScale&&(Ic.min.applyMatrix4(this.shearScaleInv),Ic.max.applyMatrix4(this.shearScaleInv)),i.boundingSphere===null&&(i.boundingSphere=new ho);let r=i.boundingSphere.center;Ic.getCenter(r),i.boundingSphere.radius=r.distanceTo(Ic.max)}freeSubdivPointer(){var t,i;this.subdivPointer&&(Rs.freeSubdivPointer(this.subdivPointer),this.subdivPointer=0),this.localGeometry=void 0,(t=this.originalGeometry)==null||t.dispose(),(i=this.subdividedGeometry)==null||i.dispose()}dispose(){super.dispose(),this.freeSubdivPointer()}updateByPatchedOpGeometry(t,i,r){super.updateByPatchedOpGeometry(t,i,r),this.localGeometry&&this.createGeometryByControls(i)}},O6=-1,XDe=1,qDe={x:[1,0,0],"-x":[-1,0,0],y:[0,1,0],"-y":[0,-1,0],z:[0,0,1],"-z":[0,0,-1]},ZDe={polygon_center:0,edge:1,vertex:2},Ub=(t,i)=>(r,n)=>!i||r===0||t===0?0:t*n/100,mi=(t,i)=>{let r=Math.abs(i),n=r*-1;return(t-O6)*(r-n)/(XDe-O6)+n};function JDe(t){let i=[],r={};for(var n=0,a=t.length;n<a;n++){var s=JSON.stringify(t[n].pos.map(o=>Math.round(o*1e4)/1e4));r[s]||(i.push(t[n]),r[s]=!0)}return i}var $De=new O,Fb=new O,ePe=new O,tPe=new O;function Fg(t,i){let r=ePe.fromArray(t),n=tPe.fromArray(i);Fb.copy(n).sub(r);let a=Fb.length();return Fb.normalize().multiplyScalar(a*.5),$De.copy(r).add(Fb).toArray()}var tl=new za,kb=new O,fT=new O,Cf=new O;function iPe(t){let i=[];for(let r=0;r<=t.index.count;r++)if(kb.fromArray(t.index.array,r*3),tl.setFromAttributeAndIndices(t.attributes.position,kb.x,kb.y,kb.z),tl.getNormal(fT),tl.getMidpoint(Cf),!(isNaN(Cf.x)||isNaN(Cf.y)||isNaN(Cf.z))){let{a:n,b:a,c:s}=tl,o=n.toArray(),l=a.toArray(),c=s.toArray(),h=n.distanceTo(a),u=a.distanceTo(s),d=s.distanceTo(n),A=Fg(o,l),f=Fg(l,c),m=Fg(c,o),g=[h,u,d],p=Math.max(...g),v=g.filter(w=>Math.round(w)===Math.round(p)).length>1,_=[],y=tl.getMidpoint(Cf).toArray();p===h&&!v&&(_=[f,m,m],y=A),p===u&&!v&&(_=[A,m,m],y=f),p===d&&!v&&(_=[A,f,f],y=m),v&&(_=[A,f,m]),i.push({vertices:[o,l,c],faceCenters:_,midpoint:y,norm:tl.getNormal(fT).toArray()})}return i}function rPe(t){let i=[],{position:r}=t.attributes;for(let n=0;n<r.count;n++){tl.setFromAttributeAndIndices(r,n*3,n*3+1,n*3+2),tl.getNormal(fT),tl.getMidpoint(Cf);let a=tl.a.toArray(),s=tl.b.toArray(),o=tl.c.toArray();i.push({vertices:[a,s,o],faceCenters:[Fg(a,s),Fg(s,o),Fg(o,a)],midpoint:Cf.toArray(),norm:fT.toArray()})}return i}var nPe=4,aPe=.5,GI=t=>.5*(1-Math.cos(t*Math.PI)),sPe=class{constructor(){this.perlin=new Array(4095+1)}noise(t,i=0,r=0){if(this.perlin==null){this.perlin=new Array(4095+1);for(let p=0;p<4095+1;p++)this.perlin[p]=Math.random()}t<0&&(t=-t),i<0&&(i=-i),r<0&&(r=-r);let n=Math.floor(t),a=Math.floor(i),s=Math.floor(r),o=t-n,l=i-a,c=r-s,h,u,d=0,A=.5,f,m,g;for(let p=0;p<nPe;p++){let v=n+(a<<4)+(s<<8);h=GI(o),u=GI(l),f=this.perlin[v&4095],f+=h*(this.perlin[v+1&4095]-f),m=this.perlin[v+16&4095],m+=h*(this.perlin[v+16+1&4095]-m),f+=u*(m-f),v+=256,m=this.perlin[v&4095],m+=h*(this.perlin[v+1&4095]-m),g=this.perlin[v+16&4095],g+=h*(this.perlin[v+16+1&4095]-g),m+=u*(g-m),f+=GI(c)*(m-f),d+=f*A,A*=aPe,n<<=1,o*=2,a<<=1,l*=2,s<<=1,c*=2,o>=1&&(n++,o--),l>=1&&(a++,l--),c>=1&&(s++,c--)}return d}noiseSeed(t){let i=(()=>{let r,n;return{setSeed(a){n=r=(a??Math.random()*4294967296)>>>0},getSeed(){return r},rand(){return n=(1664525*n+1013904223)%4294967296,n/4294967296}}})();i.setSeed(t),this.perlin=new Array(4095+1);for(let r=0;r<4095+1;r++)this.perlin[r]=i.rand()}},oPe=sPe,N6=new O,U6=new ht,F6=new L0;function k6(t){let i=!1;return t.scene.objects.traverse((r,n)=>{n.type==="Mesh"&&n.geometry.type==="TextGeometry"&&(i=!0)}),i}var AU=class extends ds{constructor(t,i,r){super(t,i,r),this.data=i}get textGeometry(){return this.geometry}get charWidths(){return this.textGeometry.charWidths}get charCoords(){return this.textGeometry.charCoords}get wrappedText(){return this.textGeometry.wrappedText}get font(){return this.textGeometry.font}get initialOffsetY(){var i;let t=this.dataPatched;return((i=this.font)==null?void 0:i.getLineInitialOffsetY(this.lineHeight,this.wrappedText.length,t.geometry.height,this.fontScale,t.geometry.verticalAlign))??0}get fontScale(){let t=this.dataPatched;return this.font?t.geometry.fontSize/this.font.unitsPerEm:1}get AD(){return Math.abs(this.ascender-this.descender)}get ascender(){var t;return(((t=this.font)==null?void 0:t.ascender)??1)*this.fontScale}get descender(){var t;return(((t=this.font)==null?void 0:t.descender)??1)*this.fontScale}get lineHeight(){let t=this.dataPatched;return t.geometry.fontSize*t.geometry.lineHeight}raycast(t,i){let{matrixWorld:r}=this;if(!(isNaN(t.ray.origin.x)||this.scale.x===0||this.scale.y===0||this.scale.z===0)&&(U6.copy(r).invert(),F6.copy(t.ray).applyMatrix4(U6),F6.intersectBox(this.singleBBox,N6))){let n=N6.applyMatrix4(r),a=t.ray.origin.distanceTo(n);i.push({distance:a,point:n.clone(),object:this})}}},ws=1e-4,Dc,YX,KX,XX,H6=new O,G6=new O;rX.then(t=>{Dc=t,YX=[Dc.get_face_center,Dc.get_edge_midpoint,Dc.get_vertex_position],KX=[Dc.get_face_normal,Dc.get_edge_normal,Dc.get_vertex_normal],XX=[Dc.face_count,Dc.edge_count,Dc.vertex_count]});var lPe=new ht,cPe=new ht,vd=new O,Hb=new O,Yv=new O,zI=new O,hPe=new O,uPe=new O,Qh=new oPe,sc=class extends YN(lr){constructor(t,i){super(),this.parameters=i,this.objectForSample=void 0,this._pendingMediaLoad=!1,this.object=t}resetOnMove(){this.removeFromParent(),this.parent=null}expandClones(t){if(this.parent===null)this.updateState(this.parameters,t);else for(let i of this.children)i instanceof us&&i.expand()}invalidateTransform(t){this.matrixWorldNeedsUpdate=!0,this.traverse(i=>{i instanceof us&&i.object===t&&(i.matrixWorldNeedsUpdate=!0)})}onObjUpdateMatrix(){this.parameters.type!=="toObject"&&(this.matrixWorldNeedsUpdate=!0)}update(){switch(this._updateCount(),this.parameters.type){case"radial":this._updateRadial(this.parameters);break;case"linear":this._updateLinear(this.parameters);break;case"grid":this._updateGrid(this.parameters);break;case"toObject":this._updateToObject(this.parameters)}for(let t of this.children)t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldSVD())}_updateCount(t){let i;if(t!==void 0?i=t:i=this.parameters.type==="grid"?Math.round(this.parameters.grid.count[0])*Math.round(this.parameters.grid.count[1])*Math.round(this.parameters.grid.count[2]):this.parameters.count,this.parameters.type==="toObject"&&!this.parameters.toObject.object&&(i=0),this.parameters.type==="toObject"&&this.objectForSample){for(let n=0,a=this.children.length;n<a;++n)this.remove(this.children[0]);let r=this.children;if(r.length===i)return;if(r.length<i)for(let n=0,a=i-r.length;n<a;++n){let s=new us(this.object);s.expand(),this.add(s)}else for(let n=0,a=r.length-i;n<a;++n)this.remove(r[n])}else{if(this.children.length===i)return;if(this.children.length<i)for(let r=0,n=i-this.children.length;r<n;++r){let a=new us(this.object);a.expand(),this.add(a)}else for(let r=0,n=this.children.length-i;r<n;++r)this.remove(this.children[0])}}_updateRadial(t){let i=t.radial,r=i.start*Ct.DEG2RAD,n=i.end*Ct.DEG2RAD,a=r-n,s=new qn(i.rotation[0],i.rotation[1],i.rotation[2]),o;switch(i.axis){case"z":o=new O(0,0,1);break;case"y":o=new O(0,1,0);break;default:case"x":o=new O(1,0,0);break}let l=t.randomnessObject??rA.defaultData([1,1,1]).randomnessObject,c=l.noiseType==="perlin";Qh.noiseSeed(l.seed);let h=yI((0,Gv.default)(l.seed)),u=Ub(l.strength,this.parameters.randomness);for(let[d,A]of this.children.entries()){let f=d*(l.freqScale/10)+l.movement,m=c?Qh.noise(f):h(f,f),g=d+1;
9961A.scale.x=i.scale[0]+u(g,mi(m,l.scale[0]))||ws,A.scale.y=i.scale[1]+u(g,mi(m,l.scale[1]))||ws,A.scale.z=i.scale[2]+u(g,mi(m,l.scale[2]))||ws,A.position.setScalar(0);let p=a/t.count*d-r;switch(i.axis){case"x":A.rotation.set(0,p,0);break;case"y":A.rotation.set(0,0,p);break;case"z":A.rotation.set(p,0,0);break}A.translateOnAxis(o,i.radius),A.position.x+=i.position[0]+u(g,mi(m,l.position[0])),A.position.y+=i.position[1]+u(g,mi(m,l.position[1])),A.position.z+=i.position[2]+u(g,mi(m,l.position[2]));let v=u(g,mi(m,l.rotation[0])),_=u(g,mi(m,l.rotation[1])),y=u(g,mi(m,l.rotation[2]));i.alignment===!0?(A.rotation.x+=s.x+v,A.rotation.y+=s.y+_,A.rotation.z+=s.z+y):A.rotation.set(s.x+v,s.y+_,s.z+y)}}_updateLinear(t){if(t.type!=="linear")throw new Error;let i=t.linear,r=new qn(i.rotation[0],i.rotation[1],i.rotation[2]),n=t.randomnessObject??rA.defaultData([1,1,1]).randomnessObject,a=n.noiseType==="perlin";Qh.noiseSeed(n.seed);let s=yI((0,Gv.default)(n.seed)),o=Ub(n.strength,this.parameters.randomness);for(let[l,c]of this.children.entries()){let h=l*(n.freqScale/10)+n.movement,u=a?Qh.noise(h):s(h,h),d=l+1,A=o(d,mi(u,n.rotation[0])),f=o(d,mi(u,n.rotation[1])),m=o(d,mi(u,n.rotation[2]));c.scale.x=1+(i.scale[0]-1)*l+o(d,mi(u,n.scale[0]))||ws,c.scale.y=1+(i.scale[1]-1)*l+o(d,mi(u,n.scale[1]))||ws,c.scale.z=1+(i.scale[2]-1)*l+o(d,mi(u,n.scale[2]))||ws,c.rotation.x=r.x*l+A,c.rotation.y=r.y*l+f,c.rotation.z=r.z*l+m,c.position.x=i.position[0]*l+o(d,mi(u,n.position[0])),c.position.y=i.position[1]*l+o(d,mi(u,n.position[1])),c.position.z=i.position[2]*l+o(d,mi(u,n.position[2]))}}_updateGrid(t){let i=0,r=t.grid,n=t.randomnessObject??rA.defaultData([1,1,1]).randomnessObject,a=Ub(n.strength,this.parameters.randomness),s=n.noiseType==="perlin";Qh.noiseSeed(n.seed);let o=rBe((0,Gv.default)(n.seed));if(r.useCenter===!0){let l={x:r.count[0]%2===0?2:1,y:r.count[1]%2===0?2:1,z:r.count[2]%2===0?2:1},c=new O(r.size[0]*(r.count[0]-l.x)*.5,r.size[1]*(r.count[1]-l.y)*.5,r.size[2]*(r.count[2]-l.z)*.5);for(let h=0;h<r.count[0];h++)for(let u=0;u<r.count[1];u++)for(let d=0;d<r.count[2];d++){let A=[(h+1)*(n.freqScale/10)+n.movement,(u+1)*(n.freqScale/10)+n.movement,(d+1)*(n.freqScale/10)+n.movement],f=s?Qh.noise(...A):o(...A),m=this.children[i++];m.scale.x=1+a(i,mi(f,n.scale[0]))||ws,m.scale.y=1+a(i,mi(f,n.scale[1]))||ws,m.scale.z=1+a(i,mi(f,n.scale[2]))||ws;let g=a(i,mi(f,n.rotation[0])),p=a(i,mi(f,n.rotation[1])),v=a(i,mi(f,n.rotation[2]));m.rotation.set(g,p,v),m.position.x=r.size[0]*h-c.x+a(i,mi(f,n.position[0])),m.position.y=r.size[1]*u-c.y+a(i,mi(f,n.position[1])),m.position.z=r.size[2]*d-c.z+a(i,mi(f,n.position[2]))}}else for(let l=0;l<r.count[0];l++)for(let c=0;c<r.count[1];c++)for(let h=0;h<r.count[2];h++){let u=[(l+1)*(n.freqScale/10)+n.movement,(c+1)*(n.freqScale/10)+n.movement,(h+1)*(n.freqScale/10)+n.movement],d=s?Qh.noise(...u):o(...u),A=this.children[i++];A.scale.x=1+a(i,mi(d,n.scale[0]))||ws,A.scale.y=1+a(i,mi(d,n.scale[1]))||ws,A.scale.z=1+a(i,mi(d,n.scale[2]))||ws;let f=a(i,mi(d,n.rotation[0])),m=a(i,mi(d,n.rotation[1])),g=a(i,mi(d,n.rotation[2]));A.rotation.set(f,m,g),A.position.x=r.size[0]*l+a(i,mi(d,n.position[0])),A.position.y=-r.size[1]*c+a(i,mi(d,n.position[1])),A.position.z=-r.size[2]*h+a(i,mi(d,n.position[2]))}}_updateToObject(t){var g;if(t.type!=="toObject")throw new Error;let{toObject:i}=t,r=new qn(i.rotation[0],i.rotation[1],i.rotation[2]),n=t.randomnessObject??rA.defaultData([1,1,1]).randomnessObject,a=n.noiseType==="perlin";Qh.noiseSeed(n.seed);let s=yI((0,Gv.default)(n.seed)),o=Ub(n.strength,this.parameters.randomness);if(!i.object){for(let[,p]of this.children.entries())p.position.set(0,0,0),p.scale.setScalar(1),p.rotation.set(0,0,0);this.objectForSample=void 0;return}if(!this.objectForSample)return;if(this.objectForSample instanceof AU)if(!((g=this.objectForSample.font)!=null&&g.isLoaded)||this.objectForSample.geometry.attributes.position===void 0){this._pendingMediaLoad=!0;return}else this._pendingMediaLoad=!1;if(this.objectForSample.geometry===void 0&&this.objectForSample.isAncestorOf(this.object.uuid)){console.warn(`Oh no! The object "${this.object.name}" (${this.object.uuid}) seem to be a child/descendant of the object it's being cloned to. Please re-parent it so that they are siblings instead.`);return}let l=this.getSubdivData(),c=[],h=p=>{let v=p.length,_=p.map(b=>b[0]).reduce((b,E)=>b+E,0),y=p.map(b=>b[1]).reduce((b,E)=>b+E,0),w=p.map(b=>b[2]).reduce((b,E)=>b+E,0);return[_/v,y/v,w/v]},u=p=>Math.round(p*1e6)/1e6;l.forEach(p=>{let v=l.filter(_=>u(p.pos[0])===u(_.pos[0])&&u(p.pos[1])===u(_.pos[1])&&u(p.pos[2])===u(_.pos[2]));v.length>1?c.push({pos:p.pos,norm:h(v.map(_=>_.norm))}):c.push(p)});let d=JDe(c);if(d.length>0){let p=Math.round(d.length*i.count/100);this._updateCount(p)}else{let p=this.objectForSample.geometry.getAttribute("position");if(!p||isNaN(p.count)||p.count===0){console.warn(`Oh no! The object "${this.object.name}" (${this.object.uuid}) cannot be cloned on the surface of "${this.objectForSample.name}" (${this.objectForSample.uuid}) because the latter does not have a valid geometry.`);return}}this.objectForSample.updateMatrixWorld();let A=new nBe(this.objectForSample).build(),f=qDe[i.axis],m=this.children;A.setRandomGenerator((0,Gv.default)(this.object.uuid+i.seed));for(let[p,v]of m.entries()){let _=p*(n.freqScale/10)+n.movement,y=a?Qh.noise(_):s(_,_),w=p+1,b=o(w,mi(y,n.rotation[0])),E=o(w,mi(y,n.rotation[1])),M=o(w,mi(y,n.rotation[2]));i.spreadType==="random"?A.sample(Yv,zI):(d.length&&(Yv.fromArray(d[p].pos),zI.fromArray(d[p].norm)),this.objectForSample instanceof Yy&&Yv.applyMatrix4(lPe.copy(this.objectForSample.matrixWorld).invert())),Yv.applyMatrix4(this.object.hiddenMatrix.clone().invert()),v.position.copy(Yv),vd.fromArray(f);let S=i.align==="normal"?zI:this.object.getWorldDirection(uPe),T=Hb.fromArray(i.position);Hb.x+=o(w,mi(y,n.position[0])),Hb.y+=o(w,mi(y,n.position[1])),Hb.z+=o(w,mi(y,n.position[2]));let C=Math.acos(S.dot(vd)),x=hPe.crossVectors(vd,S).normalize(),R=cPe.makeRotationAxis(x,C),L=S.clone().cross(this.object.up).normalize(),I=L.clone().cross(S).normalize(),F=new ht().makeBasis(L,S,I),Y=ne
9961w O(vd.y,vd.z,vd.x).normalize(),D=Y.clone().cross(vd).normalize(),U=new ht().makeBasis(Y,vd,D).invert(),j=new ht().multiplyMatrices(F,U);v.rotation.setFromRotationMatrix(j),T.applyMatrix4(R),v.position.add(T),v.rotation.x=v.rotation.x+r.x+b,v.rotation.y=v.rotation.y+r.y+E,v.rotation.z=v.rotation.z+r.z+M,v.scale.setScalar(1),v.scale.x=v.scale.x+i.scale[0]+o(w,mi(y,n.scale[0]))||ws,v.scale.y=v.scale.y+i.scale[1]+o(w,mi(y,n.scale[1]))||ws,v.scale.z=v.scale.z+i.scale[2]+o(w,mi(y,n.scale[2]))||ws,v.scale.multiply(this.object.scale),v.hiddenMatrix=this.object.hiddenMatrix}}getSubdivData(){if(!this.objectForSample)return[];let t=this.parameters.toObject.spreadType;if(t==="random")return[];if(this.objectForSample instanceof Yy){let i=this.objectForSample,r=ZDe[t],n=XX[r],a=YX[r],s=KX[r],o=[],l=n(i.subdivPointerNew);for(let c=0;c<=l-1;c++){let h=a(i.subdivPointerNew,c),u=s(i.subdivPointerNew,c);H6.fromArray(h).applyMatrix4(i.matrixWorld),G6.fromArray(u),o.push({pos:H6.toArray(),norm:G6.toArray()})}return o}else return(this.objectForSample.geometry.index?iPe(this.objectForSample.geometry):rPe(this.objectForSample.geometry)).map((i,r)=>t==="polygon_center"?{pos:i.midpoint,norm:i.norm}:t==="vertex"?[{pos:i.vertices[0],norm:i.norm},{pos:i.vertices[1],norm:i.norm},{pos:i.vertices[2],norm:i.norm}]:t==="edge"?[{pos:i.faceCenters[0],norm:i.norm},{pos:i.faceCenters[1],norm:i.norm},{pos:i.faceCenters[2],norm:i.norm}]:[]).flat()}updateState(t,i){var r;if(this.parameters=gM(t),this.parameters.type!=="toObject")(this.parent===null||this.parent!==this.object)&&(this.removeFromParent(),(r=this.object.parent)==null||r.add(this),this.matrix=this.object.matrix,this.hiddenMatrix=this.object.hiddenMatrix,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1);else if(this.parent===null||this.parent.uuid!==this.parameters.toObject.object){this.removeFromParent();let n=i.find(this.parameters.toObject.object);n instanceof zs?this.objectForSample=n:this.objectForSample=void 0,this.matrix=new ht,this.hiddenMatrix=new ht,this.matrixWorldNeedsUpdate=!0,this.matrixAutoUpdate=!1,n&&n.add(this)}this.update()}get pendingMediaLoad(){return this._pendingMediaLoad}},DE=t=>{var i;return i=class extends t{},i.geometryHelper=new gc(30,30,30),i},Gb=new L0,QI=new ho,z6=new ht,PE=(t,i,r,n,a=!1,s=t)=>{let o=i,l=s.matrixWorld;if(o.boundingSphere===null&&o.computeBoundingSphere(),QI.copy(o.boundingSphere),QI.applyMatrix4(l),r.ray.intersectsSphere(QI)===!1||(z6.copy(l).invert(),Gb.copy(r.ray).applyMatrix4(z6),o.boundingBox!==null&&Gb.intersectsBox(o.boundingBox)===!1))return;let c,h,u,d,A=o.index,f=o.attributes.position,m=o.drawRange,g,p;if(a===!1){let _=Math.max(0,m.start),y=Math.min(A.count,m.start+m.count);for(g=_,p=y;g<p;g+=3)if(h=A.getX(g),u=A.getX(g+1),d=A.getX(g+2),c=v(t,r,Gb,f,h,u,d),c){c.faceIndex=Math.floor(g/3),n.push(c);return}}else{let _=o.attributes.position,y=new O,w=new O,b=new O,E=new O,M=2,S=1/((s.scale.x+s.scale.y+s.scale.z)/3),T=S*S,C=Math.max(0,m.start),x=Math.min(_.count,m.start+m.count);for(let R=C,L=x-1;R<L;R+=M){if(y.fromBufferAttribute(_,R),w.fromBufferAttribute(_,R+1),Gb.distanceSqToSegment(y,w,E,b)>T)continue;E.applyMatrix4(s.matrixWorld);let I=r.ray.origin.distanceTo(E);I<r.near||I>r.far||n.push({distance:I,point:b.clone().applyMatrix4(s.matrixWorld),object:t})}}function v(_,y,w,b,E,M,S){let T=new O,C=new O,x=new O,R=new O,L=new O;if(T.fromBufferAttribute(b,E),C.fromBufferAttribute(b,M),x.fromBufferAttribute(b,S),w.intersectTriangle(T,C,x,!1,R)===null)return null;L.copy(R),L.applyMatrix4(_.matrixWorld);let I=y.ray.origin.distanceTo(L);return I<y.near||I>y.far?null:{faceIndex:1,distance:I,point:L.clone(),object:_}}},zb=new O,Qo=new Bp,dPe=class extends bE{constructor(t){let i=new Lt,r=new WA({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],a=[],s={},o=new Ht(15711266),l=new Ht(15711266),c=new Ht(2857471);h("n1","n2",o),h("n2","n4",o),h("n4","n3",o),h("n3","n1",o),h("f1","f2",o),h("f2","f4",o),h("f4","f3",o),h("f3","f1",o),h("n1","f1",o),h("n2","f2",o),h("n3","f3",o),h("n4","f4",o),h("p","n1",l),h("p","n2",l),h("p","n3",l),h("p","n4",l),h("u1","u2",c),h("u2","u3",c),h("u3","u1",c);function h(d,A,f){u(d,f),u(A,f)}function u(d,A){n.push(0,0,0),a.push(A.r,A.g,A.b),s[d]===void 0&&(s[d]=[]),s[d].push(n.length/3-1)}i.setAttribute("position",new Et(n,3)),i.setAttribute("color",new Et(a,3)),super(i,r),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){let t=this.geometry,i=this.pointMap;Qo.projectionMatrixInverse.elements=[.5112609807824982,-0,-0,-0,-0,.41421356237309503,-0,-0,-0,-0,-0,-.099999,-0,-0,-1.0000000000000002,.100001];let r=1,n=1,a=.8;Ql("n1",i,t,Qo,-r,-n,a),Ql("n2",i,t,Qo,r,-n,a),Ql("n3",i,t,Qo,-r,n,a),Ql("n4",i,t,Qo,r,n,a);let s=a;Ql("f1",i,t,Qo,-r,-n,s),Ql("f2",i,t,Qo,r,-n,s),Ql("f3",i,t,Qo,-r,n,s),Ql("f4",i,t,Qo,r,n,s);let o=s,l=.5;Ql("u1",i,t,Qo,r*.7*l,n*1.1,o),Ql("u2",i,t,Qo,-r*.7*l,n*1.1,o),Ql("u3",i,t,Qo,0,n*(1.1+.9*l),o),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}};function Ql(t,i,r,n,a,s,o){zb.set(a,s,o).unproject(n);let l=i[t];if(l!==void 0){let c=r.getAttribute("position");for(let h=0,u=l.length;h<u;h++)c.setXYZ(l[h],zb.x,zb.y,zb.z)}}var APe=class extends DE(dPe){constructor(t){super(t),this.object=t,this.object=t,this.name=`CombinedCameraHelper: ${t.uuid}`}updateMatrixWorld(t){super.updateMatrixWorld(t),this.updateTarget()}updateTarget(){let t=this.object.getTarget();this.updateWorldMatrix(!0,!1),this.worldToLocal(t)}raycast(t,i){PE(this.object,this.geometry,t,i,!0)}},BL;(t=>t.is=i=>"objectHelper"in i)(BL||(BL={}));var X0=(t,i)=>class extends KN(t){constructor(){super(...arguments),this.objectHelper=new i(this),this.gizmos={}}get geometryHelper(){return i.geometryHelper}raycast(r,n){this.objectHelper.raycast(r,n)}showGizmos(){for(let r in this.gizmos){let n=this.gizmos[r];n instanceof LC&&(n.visible=!0)}}updateEntityBoxSize(r,n){this.objectHelper.visible&&this.geometryHelper instanceof gc?(r.setScalar(0),n.set(this.geometryHelper.parameters.width,this.geometryHelper.parameters.height,this.geometryHelper.parameters.height).multiplyScalar(.5)):super.updateEntityBoxSize(r,n)}hideGizmos(){for(let r in this.gizmos){let n=this.gizmos[r];n instanceof LC&&(n.visible=!1)}}},Qb=790,Nm=new O,VI=new O,WI=new ri,jI=new O,Kv=new O,YI=new O,ms=class extends X0(Bp,APe){constructor(t="",i={...Fy.defaultData,name:""}
vendor: 6,238 bytes, line 9961
9961){super(),this._cameraType="OrthographicCamera",this.targetOffset=d0.DefaultTargetOffset,this.isUpVectorFlipped=!1,this.angleOffsetFromUp=0,this.wasMovedByUser=!1,this.wasMovedBySwitchCameraAction=!1,this.super_Entity(t,i),this.previousProjectionMatrix=new ht,this.matrixAutoUpdate=!0,this.width=window.innerWidth,this.height=window.innerHeight;let r=this.width,n=this.height;this.orthoCamera=new oM(r*-.5,r*.5,n*.5,n*-.5,-5e4,1e4),this.perspCamera=new as(45,r/n,50,1e4),this.left=this.orthoCamera.left,this.right=this.orthoCamera.right,this.top=this.orthoCamera.top,this.bottom=this.orthoCamera.bottom,this.far=this.orthoCamera.far,this.view=this.orthoCamera.view,this.aspect=this.perspCamera.aspect,this.focus=this.perspCamera.focus,this.filmGauge=this.perspCamera.filmGauge,this.filmOffset=this.perspCamera.filmOffset,this.objectHelper.update()}get isPerspectiveCamera(){return this.cameraType==="PerspectiveCamera"}get isOrthographicCamera(){return!this.isPerspectiveCamera}get cameraType(){return this._cameraType}set fov(t){this.perspCamera.fov=t}get fov(){return this.perspCamera.fov}setNear(t,i){t==="PerspectiveCamera"?this.perspCamera.near=i:this.orthoCamera.near=i}setZoom(t,i){i>=0&&(t==="PerspectiveCamera"?this.perspCamera.zoom=i:this.orthoCamera.zoom=i)}set cameraType(t){t==="PerspectiveCamera"?this.toPerspective():t==="OrthographicCamera"&&this.toOrthographic()}get near(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.near:this.orthoCamera.near}set near(t){this._cameraType==="PerspectiveCamera"?this.perspCamera.near=t:this.orthoCamera.near=t}get zoom(){return this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom:this.orthoCamera.zoom}set zoom(t){t>=0&&(this._cameraType==="PerspectiveCamera"?this.perspCamera.zoom=t:this.orthoCamera.zoom=t)}lookAt(t,i,r){typeof t=="number"&&(t=new O(t,i,r)),super.lookAt(t),this.getWorldPosition(Nm),this.targetOffset=Nm.distanceTo(t)}getTarget(t=new O){return this.getWorldDirection(VI),this.getWorldPosition(Nm),VI.multiplyScalar(this.targetOffset),t.copy(Nm).add(VI),t}getDistanceToTarget(){let t=this.getTarget();return this.getWorldPosition(Nm),Nm.distanceTo(t)}updateUp(){this.getWorldQuaternion(WI),jI.set(0,0,1).applyQuaternion(WI),Kv.copy(lr.DEFAULT_UP),this.isUpVectorFlipped&&Kv.negate(),Kv.applyQuaternion(WI),YI.copy(lr.DEFAULT_UP).projectOnPlane(jI),this.angleOffsetFromUp=YI.angleTo(Kv),this.angleOffsetFromUp*=YI.cross(Kv).dot(jI)>=0?1:-1}updateTransformState(t,i){let r=super.updateTransformState(t,i);return t.isUpVectorFlipped!==void 0&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateUp(),r}getViewFrontToObject(t){let i=t.getWorldPosition(new O),r=t.getWorldDirection(new O).multiplyScalar(this.targetOffset);return{position:i.clone().add(r),target:i}}getViewToTarget(t){let i=this.getWorldDirection(new O).multiplyScalar(this.targetOffset);return{position:t.clone().sub(i),target:t}}getViewToObject(t){let i=new O;return t.getWorldPosition(i),this.getViewToTarget(i)}setViewplaneSize(t,i,r=!1){if(this.aspect=t/i,r){let n=t>i?this.aspect:1,a=t>i?1:this.aspect;this.left=-Qb*.5*n,this.right=Qb*.5*n,this.top=Qb*.5*(1/a),this.bottom=-Qb*.5*(1/a)}else this.left=-t*.5,this.right=t*.5,this.top=i*.5,this.bottom=-i*.5;this.updateProjectionMatrix()}copyViewPlaneSize(t){this.aspect=t.aspect,this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.updateProjectionMatrix()}toOrthographic(){this.orthoCamera.left=this.left,this.orthoCamera.right=this.right,this.orthoCamera.top=this.top,this.orthoCamera.bottom=this.bottom,this.orthoCamera.view=this.view,this.orthoCamera.far=this.far,this.orthoCamera.updateProjectionMatrix(),this.projectionMatrix=this.orthoCamera.projectionMatrix,this.projectionMatrixInverse=this.orthoCamera.projectionMatrixInverse,this._cameraType="OrthographicCamera",this.objectHelper&&this.objectHelper.update()}toPerspective(){this.perspCamera.aspect=this.aspect,this.perspCamera.fov=this.fov,this.perspCamera.view=this.view,this.perspCamera.far=this.far,this.perspCamera.updateProjectionMatrix(),this.projectionMatrix=this.perspCamera.projectionMatrix,this.projectionMatrixInverse=this.perspCamera.projectionMatrixInverse,this._cameraType="PerspectiveCamera",this.objectHelper&&this.objectHelper.update()}setFocalLength(t){this.perspCamera.setFocalLength(t),this.toPerspective()}getFocalLength(){return this.perspCamera.getFocalLength()}getEffectiveFOV(){return this.perspCamera.getEffectiveFOV()}getFilmWidth(){return this.perspCamera.getFilmWidth()}getFilmHeight(){return this.perspCamera.getFilmHeight()}setViewOffset(t,i,r,n,a,s){this._cameraType==="PerspectiveCamera"?this.perspCamera.setViewOffset(t,i,r,n,a,s):this.orthoCamera.setViewOffset(t,i,r,n,a,s)}clearViewOffset(){this._cameraType==="PerspectiveCamera"?(this.perspCamera.clearViewOffset(),this.toPerspective()):(this.orthoCamera.clearViewOffset(),this.toOrthographic())}copyHistory(){this.previousProjectionMatrix&&this.previousProjectionMatrix.copy(this.projectionMatrix)}updateProjectionMatrix(){this._cameraType==="PerspectiveCamera"?this.toPerspective():this._cameraType==="OrthographicCamera"&&this.toOrthographic()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,i){super.updateWorldMatrix(t,i),this.matrixWorldInverse.copy(this.matrixWorld).invert()}copy(t,i){return super.copy(t,i),this.parent=t.parent,this.orthoCamera.copy(t.orthoCamera),this.perspCamera.copy(t.perspCamera),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.far=t.far,this.view=t.view===null?null:Object.assign({},t.view),this._cameraType=t._cameraType,this.aspect=t.aspect,this.fov=t.fov,this.focus=t.focus,this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this.targetOffset=t.targetOffset,this.updateProjectionMatrix(),this}toCameraState(t=[]){let i={type:this.cameraType,far:this.far,orthographic:{near:this.orthoCamera.near,zoom:this.orthoCamera.zoom},perspective:{near:this.perspCamera.near,fov:this.perspCamera.fov,zoom:this.perspCamera.zoom},up:this.up.toArray(),targetOffset:this.targetOffset,isUpVectorFlipped:this.isUpVectorFlipped};return bP(i,t)}updateCameraSubtype(t,i){let r=t==="perspective"?"PerspectiveCamera":"Orthogra
9961phicCamera";i.zoom!==void 0&&this.setZoom(r,i.zoom),i.near!==void 0&&this.setNear(r,i.near),i.fov!==void 0&&r==="PerspectiveCamera"&&(this.fov=i.fov)}updateState(t,i){this.updateCameraState(t,i)}updateCameraState(t,i){this.updateState_Entity(t,i),t.far!==void 0&&(this.far=t.far),t.orthographic!==void 0&&this.updateCameraSubtype("orthographic",t.orthographic),t.perspective!==void 0&&this.updateCameraSubtype("perspective",t.perspective),t.type!==void 0&&(this.cameraType=t.type),t.up!==void 0&&this.up.fromArray(t.up),t.targetOffset!==void 0&&(this.targetOffset=t.targetOffset),t.isUpVectorFlipped!==void 0&&(this.isUpVectorFlipped=t.isUpVectorFlipped),this.updateProjectionMatrix()}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),t.path.length===1&&t.type===0&&this.updateCameraSubtype(t.path[0],t.props)}toState(t){return{...super.toState(t),...this.toCameraState(t),type:this.cameraType}}},Um=new ht,fPe=new ht;function Q6(t){let i=!1;return t.scene.objects.traverse((r,n)=>{var a;((a=n.geometry)==null?void 0:a.type)==="BooleanGeometry"&&(i=!0)}),i}var pp=class extends K0{constructor(t,i,r){super(t,i),this.data=i,this.meshSetAddresses=[],this.needsTransformForDownstream=!1,this.geometry=new Lt,this.onAfterRender=(n,a,s,o,l,c)=>{super.onAfterRender(n,a,s,o,l,c),this.recomputeBoolean()},this.geometry.userData.parameters={width:0,height:0,depth:0}}get booleanOp(){return this.data.geometry.operation}get phongAngle(){return this.data.geometry.phongAngle??45}get isLOD(){return this.recomputeBoolean(),!1}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),t.path.length===1&&t.path[0]==="geometry"&&t.type===0&&t.props.operation!==void 0&&(this.freeBooleanPointer(),this.resetBBoxNeedsUpdate())}freeBooleanPointer(){super.freeBooleanPointer(),this.geometry.dispose()}recomputeBoolean(t,i=!0){var n;if(this.booleanMeshSetAddress!==-1&&!t)return;for(let a=0;a<this.children.length;a++){let s=this.children[a];s instanceof pp&&s.dataPatched.visible===!0&&s.recomputeBoolean(t===!0,i)}this.meshSetAddresses=[];for(let a=0;a<this.children.length;a++){let s=this.children[a];if(s instanceof zs&&s.dataPatched.visible===!0&&((n=s.geometry.attributes.position)==null?void 0:n.count)>0&&s.geometry.drawRange.count>0&&s.booleanMeshSetAddress!==0){Um.multiplyMatrices(s.hiddenMatrix,s.matrix);try{if(s.booleanMeshSetAddress===-1){if((s.geometry.index??s.geometry.getAttribute("position")).count/3<15e5&&(s.booleanMeshSetAddress=nu.getMeshSet(s.geometry,t===!0,i)),s.booleanMeshSetAddress===-1)return;nu.transformMeshSet(s.booleanMeshSetAddress,Um),s.booleanMatrixInvOld.copy(Um).invert(),s.booleanWasTransformed=!1}else s instanceof pp&&s.needsTransformForDownstream===!0?(nu.transformMeshSet(s.booleanMeshSetAddress,Um),s.needsTransformForDownstream=!1):s.booleanWasTransformed===!0&&(nu.transformMeshSet(s.booleanMeshSetAddress,fPe.multiplyMatrices(Um,s.booleanMatrixInvOld)),s.booleanMatrixInvOld.copy(Um).invert(),s.booleanWasTransformed=!1)}catch(o){console.error(o),s.booleanMeshSetAddress=0,s.geometry.userData.booleanOperationDidFail=!0;continue}nu.hasOpenEdges(s.booleanMeshSetAddress)===!1||a===this.children.length-1&&this.booleanOp===2?(this.meshSetAddresses.push(s.booleanMeshSetAddress),s.geometry.userData.booleanOperationDidFail=!1):s.geometry.userData.booleanOperationDidFail="openEdges"}}if(this.meshSetAddresses.length===0){this.geometry.setAttribute("position",new Et([],0)),this.geometry.setDrawRange(0,0);return}if(t===!0)return nu.calcBooleanTopological(this.meshSetAddresses,this.booleanOp);let r=this.geometry;r.dispose(),this.geometry=new Lt,this.geometry.userData=r.userData,this.geometry.boundingSphere=r.boundingSphere;try{this.booleanMeshSetAddress=nu.calcBoolean(this.meshSetAddresses,this.booleanOp,this.geometry,this.phongAngle)}catch(a){this.booleanMeshSetAddress=0,this.geometry.userData.booleanOperationDidFail=!0,console.error(a)}this.booleanMatrixInvOld.copy(this.matrix).invert(),this.needsTransformForDownstream=!0,uU(this),dU(this)}dispose(){super.dispose(),this.geometry.dispose()}},IL;(t=>{function i(r){return Oi.is(r)&&r instanceof TE}t.is=i})(IL||(IL={}));var fU=(t,i)=>class extends X0(t,i){updateState_Light(r,n){this.updateState_Entity(r,n),r.color!==void 0&&(this.color=n.shared.color(r.color)),r.intensity!==void 0&&(this.intensity=r.intensity),r.depth!==void 0&&(this.shadow.camera.far=r.depth,this.shadow.needsUpdate=!0),r.shadows!==void 0&&(this.castShadow=r.shadows)}},$l=t=>t instanceof zs,xu=t=>t!==null&&t instanceof pp,pPe=t=>t instanceof ms,mPe=t=>IL.is(t),DL=t=>BL.is(t),gPe=new O(1,1,1),V6=new O,vPe=new O,W6=new ri,LE=class extends DE(bye){constructor(t,i=15){super(i),this.object=t,this.dummy=new Tu,this.object.updateMatrixWorld(),this.name=`EmptyObjectHelper: ${t.uuid}`,this.matrix=this.dummy.matrixWorld,this.matrixAutoUpdate=!1,this.object.isBone&&(this.visible=!1)}raycast(t,i){PE(this.object,LE.geometryHelper,t,i,!1,this.dummy)}update(){}updateMatrix(){}updateMatrixWorld(t){this.object.matrixWorld.decompose(V6,W6,vPe),this.matrix.compose(V6,W6,gPe),super.updateMatrixWorld(t)}updateWorldMatrix(t,i){}},kg=class extends X0(Tu,LE){constructor(t,i){super(),this.super_Entity(t,i),this.objectHelper.update(
vendor: 16,384 bytes, lines 9961-10108
9961)}updateState(t,i){this.updateState_Entity(t,i),"buffer"in t&&Object.keys(t).length===1&&i.scene.reloadSplats()}},LS=class extends X0(Tu,LE){constructor(t,i,r){super(),this.super_Entity(t,i),this.context=r,this.objectHelper.update()}updateState(t,i){this.updateState_Entity(t,i)}},qX={RED:0,GREEN:1,BLUE:2,ALPHA:3},OE="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",_Pe=`#ifdef FRAMEBUFFER_PRECISION_HIGH 9962uniform mediump sampler2D inputBuffer; 9963#else 9964uniform lowp sampler2D inputBuffer; 9965#endif 9966uniform lowp sampler2D cocBuffer;uniform vec2 texelSize;uniform float scale;uniform vec4 kernel64[32];varying vec2 vUv;void main(){ 9967#ifdef FOREGROUND 9968vec2 CoCNearFar=texture2D(cocBuffer,vUv).rg;float CoC=CoCNearFar.r*scale; 9969#else 9970float CoC=texture2D(cocBuffer,vUv).g*scale; 9971#endif 9972if(CoC==0.0){gl_FragColor=texture2D(inputBuffer,vUv);}else{ 9973#ifdef FOREGROUND 9974vec2 step=texelSize*max(CoC,CoCNearFar.g*scale); 9975#else 9976vec2 step=texelSize*CoC; 9977#endif 9978vec4 acc=vec4(0.0);for(int i=0;i<32;++i){vec4 kernel=kernel64[i];vec2 uv=step*kernel.xy+vUv;acc+=texture2D(inputBuffer,uv);uv=step*kernel.zw+vUv;acc+=texture2D(inputBuffer,uv);}gl_FragColor=acc/64.0;}}`,Vb=class extends Xi{constructor(t=!1,i=!1){super({name:"BokehMaterial",defines:{PASS:t?"2":"1"},uniforms:{kernel64:new at(null),kernel16:new at(null),inputBuffer:new at(null),cocBuffer:new at(null),texelSize:new at(new Me),scale:new at(1)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:_Pe,vertexShader:OE}),this.toneMapped=!1,i&&(this.defines.FOREGROUND="1"),this.generateKernel()}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}set cocBuffer(t){this.uniforms.cocBuffer.value=t}setCoCBuffer(t){this.uniforms.cocBuffer.value=t}get scale(){return this.uniforms.scale.value}set scale(t){this.uniforms.scale.value=t}getScale(t){return this.uniforms.scale.value=t}setScale(t){this.uniforms.scale.value=t}generateKernel(){let t=2.39996323,i=new Float32Array(128),r=new Float32Array(32),n=0,a=0;for(let l=0;l<80;++l){let c=l*t,h=Math.sqrt(l)/Math.sqrt(80),u=h*Math.cos(c),d=h*Math.sin(c);l%5===0?(r[a++]=u,r[a++]=d):(i[n++]=u,i[n++]=d)}let s=[],o=[];for(let l=0;l<128;)s.push(new ai(i[l++],i[l++],i[l++],i[l++]));for(let l=0;l<32;)o.push(new ai(r[l++],r[l++],r[l++],r[l++]));this.uniforms.kernel64.value=s,this.uniforms.kernel16.value=o}setTexelSize(t,i){this.uniforms.texelSize.value.set(t,i)}setSize(t,i){this.uniforms.texelSize.value.set(1/t,1/i)}};function j6(t,i,r){return t*(i-r)-i}function PL(t,i,r){return Math.min(Math.max((t+i)/(i-r),0),1)}var yPe=`#include <common> 9979#include <packing> 9980#ifdef GL_FRAGMENT_PRECISION_HIGH 9981uniform highp sampler2D depthBuffer; 9982#else 9983uniform mediump sampler2D depthBuffer; 9984#endif 9985uniform float focusDistance;uniform float focusRange;uniform float cameraNear;uniform float cameraFar;varying vec2 vUv;float readDepth(const in vec2 uv){ 9986#if DEPTH_PACKING == 3201 9987return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 9988#else 9989return texture2D(depthBuffer,uv).r; 9990#endif 9991}void main(){float depth=readDepth(vUv); 9992#ifdef PERSPECTIVE_CAMERA 9993float viewZ=perspectiveDepthToViewZ(depth,cameraNear,cameraFar);float linearDepth=viewZToOrthographicDepth(viewZ,cameraNear,cameraFar); 9994#else 9995float linearDepth=depth; 9996#endif 9997float signedDistance=linearDepth-focusDistance;float magnitude=smoothstep(0.0,focusRange,abs(signedDistance));gl_FragColor.rg=magnitude*vec2(step(signedDistance,0.0),step(0.0,signedDistance));}`,EPe=class extends Xi{constructor(t){super({name:"CircleOfConfusionMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new at(null),focusDistance:new at(0),focusRange:new at(0),cameraNear:new at(.3),cameraFar:new at(1e3)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:yPe,vertexShader:OE}),this.toneMapped=!1,this.uniforms.focalLength=this.uniforms.focusRange,this.adoptCameraSettings(t)}get near(){return this.uniforms.cameraNear.value}get far(){return this.uniforms.cameraFar.value}set depthBuffer(t){this.uniforms.depthBuffer.value=t}set depthPacking(t){this.defines.DEPTH_PACKING=t.toFixed(0),this.needsUpdate=!0}setDepthBuffer(t,i=ed){this.depthBuffer=t,this.depthPacking=i}get focusDistance(){return this.uniforms.focusDistance.value}set focusDistance(t){this.uniforms.focusDistance.value=t}get worldFocusDistance(){return-j6(this.focusDistance,this.near,this.far)}set worldFocusDistance(t){this.focusDistance=PL(-t,this.near,this.far)}getFocusDistance(t){this.uniforms.focusDistance.value=t}setFocusDistance(t){this.uniforms.focusDistance.value=t}get focalLength(){return this.focusRange}set focalLength(t){this.focusRange=t}get focusRange(){return this.uniforms.focusRange.value}set focusRange(t){this.uniforms.focusRange.value=t}get worldFocusRange(){return-j6(this.focusRange,this.near,this.far)}set worldFocusRange(t){this.focusRange=PL(-t,this.near,this.far)}getFocalLength(t){return this.focusRange}setFocalLength(t){this.focusRange=t}adoptCameraSettings(t){t&&(this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,t instanceof as?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},wPe=`#include <common> 9998#include <dithering_pars_fragment> 9999#ifdef FRAMEBUFFER_PRECISION_HIGH 10000uniform mediump sampler2D inputBuffer; 10001#else 10002uniform lowp sampler2D inputBuffer; 10003#endif 10004varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; 10005#include <encodings_fragment> 10006#include <dithering_fragment> 10007}`,bPe="uniform vec2 texelSize;uniform vec2 halfTexelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize*vec2(kernel)+halfTexelSize)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",Y6=class extends Xi{constructor(t=new Me){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new at(null),texelSize:new at(new Me),halfTexelSize:new at(new Me),kernel:new at(0),scale:new at(1)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:wPe,vertexShader:bPe}),this.toneMapped=!1,this.setTexelSize(t.x,t.y)}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.inputBuffer=t}get scale(){return this.uniforms.scale.value}set scale(t){this.uniforms.scale.value=t}getScale(){return this.uniforms.scale.value}setScale(t){this.uniforms.scale.value=t}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(t){this.uniforms.kernel.value=t}setKernel(t){this.kernel=t}setTexelSize(t,i){this.uniforms.texelSize.value.set(t,i),this.uniforms.halfTexelSize.value.set(t,i).multiplyScalar(.5)}setSize(t,i){let r=this.uniforms;r.texelSize.value.set(1/t,1/i),r.halfTexelSize.value.copy(r.texelSize.value).multiplyScalar(.5)}},SPe=`#ifdef FRAMEBUFFER_PRECISION_HIGH 10008uniform mediump sampler2D inputBuffer; 10009#else 10010uniform lowp sampler2D inputBuffer; 10011#endif 10012uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; 10013#include <encodings_fragment> 10014}`,CPe=class extends Xi{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new at(null),opacity:new at(1)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:SPe,vertexShader:OE}),this.toneMapped=!1}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}getOpacity(t){return this.uniforms.opacity.value}setOpacity(t){this.uniforms.opacity.value=t}},TPe=`varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; 10015#if THREE_REVISION < 143 10016#define luminance(v) linearToRelativeLuminance(v) 10017#endif 10018#if EDGE_DETECTION_MODE != 0 10019varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; 10020#endif 10021#if EDGE_DETECTION_MODE == 1 10022#include <common> 10023#endif 10024#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1 10025#ifdef GL_FRAGMENT_PRECISION_HIGH 10026uniform highp sampler2D depthBuffer; 10027#else 10028uniform mediump sampler2D depthBuffer; 10029#endif 10030float readDepth(const in vec2 uv){ 10031#if DEPTH_PACKING == 3201 10032return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 10033#else 10034return texture2D(depthBuffer,uv).r; 10035#endif 10036}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);} 10037#elif PREDICATION_MODE == 2 10038uniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);} 10039#endif 10040#if PREDICATION_MODE != 0 10041vec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);} 10042#endif 10043#if EDGE_DETECTION_MODE != 0 10044uniform sampler2D inputBuffer; 10045#endif 10046void main(){ 10047#if EDGE_DETECTION_MODE == 0 10048const vec2 threshold=vec2(DEPTH_THRESHOLD); 10049#elif PREDICATION_MODE != 0 10050vec2 threshold=calculatePredicatedThreshold(); 10051#else 10052const vec2 threshold=vec2(EDGE_THRESHOLD); 10053#endif 10054#if EDGE_DETECTION_MODE == 0 10055vec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0); 10056#elif EDGE_DETECTION_MODE == 1 10057float l=luminance(texture2D(inputBuffer,vUv).rgb);float lLeft=luminance(texture2D(inputBuffer,vUv0).rgb);float lTop=luminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=luminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=luminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=luminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=luminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); 10058#elif EDGE_DETECTION_MODE == 2 10059vec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0); 10060#endif 10061}`,MPe=`uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1; 10062#if EDGE_DETECTION_MODE != 0 10063varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5; 10064#endif 10065void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0); 10066#if EDGE_DETECTION_MODE != 0 10067vUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0); 10068#endif 10069gl_Position=vec4(position.xy,1.0,1.0);}`,TM={DEPTH:0,LUMA:1,COLOR:2},xPe={DISABLED:0,DEPTH:1,CUSTOM:2},RPe=class extends Xi{constructor(t=new Me,i=TM.COLOR){super({name:"EdgeDetectionMaterial",defines:{THREE_REVISION:P0.replace(/\D+/g,""),LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new at(null),depthBuffer:new at(null),predicationBuffer:new at(null),texelSize:new at(t)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:TPe,vertexShader:MPe}),this.toneMapped=!1,this.edgeDetectionMode=i}set depthBuffer(t){this.uniforms.depthBuffer.value=t}set depthPacking(t){this.defines.DEPTH_PACKING=t.toFixed(0),this.needsUpdate=!0}setDepthBuffer(t,i=ed){this.depthBuffer=t,this.depthPacking=i}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(t){this.defines.EDGE_DETECTION_MODE=t.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(t){this.edgeDetectionMode=t}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(t){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=t.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(t){this.localContrastAdaptationFactor=t}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(t){this.defines.EDGE_THRESHOLD=t.toFixed("6"),this.defines.DEPTH_THRESHOLD=(t*.1).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(t){this.edgeDetectionThreshold=t}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(t){this.defines.PREDICATION_MODE=t.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(t){this.predicationMode=t}set predicationBuffer(t){this.uniforms.predicationBuffer.value=t}setPredicationBuffer(t){this.uniforms.predicationBuffer.value=t}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(t){this.defines.PREDICATION_THRESHOLD=t.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(t){this.predicationThreshold=t}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(t){this.defines.PREDICATION_SCALE=t.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(t){this.predicationScale=t}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(t){this.defines.PREDICATION_STRENGTH=t.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(t){this.predicationStrength=t}setSize(t,i){this.uniforms.texelSize.value.set(1/t,1/i)}},BPe=`#include <common> 10070#include <packing> 10071#include <dithering_pars_fragment> 10072#define packFloatToRGBA(v) packDepthToRGBA(v) 10073#define unpackRGBAToFloat(v) unpackRGBAToDepth(v) 10074#ifdef FRAMEBUFFER_PRECISION_HIGH 10075uniform mediump sampler2D inputBuffer; 10076#else 10077uniform lowp sampler2D inputBuffer; 10078#endif 10079#ifdef GL_FRAGMENT_PRECISION_HIGH 10080uniform highp sampler2D depthBuffer; 10081#else 10082uniform mediump sampler2D depthBuffer; 10083#endif 10084uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv; 10085#if THREE_REVISION < 143 10086#define luminance(v) linearToRelativeLuminance(v) 10087#endif 10088#if THREE_REVISION >= 137 10089vec4 sRGBToLinear(const in vec4 value){return 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);} 10090#endif 10091float readDepth(const in vec2 uv){ 10092#if DEPTH_PACKING == 3201 10093return unpackRGBAToDepth(texture2D(depthBuffer,uv)); 10094#else 10095return texture2D(depthBuffer,uv).r; 10096#endif 10097}float getViewZ(const in float depth){ 10098#ifdef PERSPECTIVE_CAMERA 10099return perspectiveDepthToViewZ(depth,cameraNear,cameraFar); 10100#else 10101return orthographicDepthToViewZ(depth,cameraNear,cameraFar); 10102#endif 10103}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0; 10104#ifdef ENCODE_OUTPUT 10105#include <encodings_fragment> 10106#endif 10107#include <dithering_fragment> 10108}`,IPe="unifor
10108m vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}",Vl={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},LL=class extends Xi{constructor(t,i,r,n,a=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:P0.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new at(null),depthBuffer:new at(null),resolution:new at(new Me),texelSize:new at(new Me),cameraNear:new at(.3),cameraFar:new at(1e3),aspect:new at(1),time:new at(0)},blending:Un,depthWrite:!1,depthTest:!1,dithering:a}),this.toneMapped=!1,t&&this.setShaderParts(t),i&&this.setDefines(i),r&&this.setUniforms(r),this.adoptCameraSettings(n)}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(t){this.uniforms.depthBuffer.value=t}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(t){this.defines.DEPTH_PACKING=t.toFixed(0),this.needsUpdate=!0}setDepthBuffer(t,i=ed){this.depthBuffer=t,this.depthPacking=i}setShaderParts(t){return this.fragmentShader=BPe.replace(Vl.FRAGMENT_HEAD,t.get(Vl.FRAGMENT_HEAD)).replace(Vl.FRAGMENT_MAIN_UV,t.get(Vl.FRAGMENT_MAIN_UV)).replace(Vl.FRAGMENT_MAIN_IMAGE,t.get(Vl.FRAGMENT_MAIN_IMAGE)),this.vertexShader=IPe.replace(Vl.VERTEX_HEAD,t.get(Vl.VERTEX_HEAD)).replace(Vl.VERTEX_MAIN_SUPPORT,t.get(Vl.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(t){for(let i of t.entries())this.defines[i[0]]=i[1];return this.needsUpdate=!0,this}setUniforms(t){for(let i of t.entries())this.uniforms[i[0]]=i[1];return this}setExtensions(t){this.extensions={};for(let i of t)this.extensions[i]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(t){this.encodeOutput!==t&&(t?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(t){return this.encodeOutput}setOutputEncodingEnabled(t){this.encodeOutput=t}get time(){return this.uniforms.time.value}set time(t){this.uniforms.time.value=t}setDeltaTime(t){this.uniforms.time.value+=t}adoptCameraSettings(t){t&&(this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,t instanceof as?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(t,i){let r=this.uniforms;r.resolution.value.set(t,i),r.texelSize.value.set(1/t,1/i),r.aspect.value=t/i}static get Section(){return Vl}},DPe=`#include <common> 10109#if THREE_REVISION < 143 10110#define luminance(v) linearToRelativeLuminance(v) 10111#endif 10112#ifdef FRAMEBUFFER_PRECISION_HIGH 10113uniform mediump sampler2D inputBuffer; 10114#else 10115uniform lowp sampler2D inputBuffer; 10116#endif 10117#ifdef RANGE 10118uniform vec2 range; 10119#elif defined(THRESHOLD) 10120uniform float threshold;uniform float smoothing; 10121#endif 10122varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb); 10123#ifdef RANGE 10124float low=step(range.x,l);float high=step(l,range.y);l*=low*high; 10125#elif defined(THRESHOLD) 10126l=smoothstep(threshold,threshold+smoothing,l); 10127#endif 10128#ifdef COLOR 10129gl_FragColor=vec4(texel.rgb*l,l); 10130#else 10131gl_FragColor=vec4(l); 10132#endif 10133}`,PPe=class extends Xi{constructor(t=!1,i=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:P0.replace(/\D+/g,"")},uniforms:{inputBuffer:new at(null),threshold:new at(0),smoothing:new at(1),range:new at(null)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:DPe,vertexShader:OE}),this.toneMapped=!1,this.colorOutput=t,this.luminanceRange=i}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}get threshold(){return this.uniforms.threshold.value}set threshold(t){this.smoothing>0||t>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=t}getThreshold(){return this.threshold}setThreshold(t){this.threshold=t}get smoothing(){return this.uniforms.smoothing.value}set smoothing(t){this.threshold>0||t>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=t}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(t){this.smoothing=t}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(t){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(t){t?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(t){return this.colorOutput}setColorOutputEnabled(t){this.colorOutput=t}get useRange(){return this.luminanceRange!==null}set useRange(t){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(t){t!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=t,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(t){this.luminanceRange=t}},LPe=`#ifdef FRAMEBUFFER_PRECISION_HIGH 10134uniform mediump sampler2D inputBuffer; 10135#else 10136uniform lowp sampler2D inputBuffer; 10137#endif 10138#ifdef MASK_PRECISION_HIGH 10139uniform mediump sampler2D maskTexture; 10140#else 10141uniform lowp sampler2D maskTexture; 10142#endif 10143#if MASK_FUNCTION != 0 10144uniform float strength; 10145#endif 10146varying vec2 vUv;void main(){ 10147#if COLOR_CHANNEL == 0 10148float mask=texture2D(maskTexture,vUv).r; 10149#elif COLOR_CHANNEL == 1 10150float mask=texture2D(maskTexture,vUv).g; 10151#elif COLOR_CHANNEL == 2 10152float mask=texture2D(maskTexture,vUv).b; 10153#else 10154float mask=texture2D(maskTexture,vUv).a; 10155#endif 10156#if MASK_FUNCTION == 0 10157#ifdef INVERTED 10158mask=step(mask,0.0); 10159#else 10160mask=1.0-step(mask,0.0); 10161#endif 10162#else 10163mask=clamp(mask*strength,0.0,1.0); 10164#ifdef INVERTED 10165mask=1.0-mask; 10166#endif 10167#endif 10168#if MASK_FUNCTION == 2 10169gl_FragColor=vec4(mask*texture2D(inputBuffer,vUv).rgb,mask); 10170#else 10171gl_FragColor=mask*texture2D(inputBuffer,vUv); 10172#endif 10173}`,ZX={DISCARD:0,MULTIPLY:1,MULTIPLY_RGB_SET_ALPHA:2},OPe=class extends Xi{constructor(t=null){super({name:"MaskMaterial",uniforms:{maskTexture:new at(t),inputBuffer:new at(null),strength:new at(1)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:LPe,vertexShader:OE}),this.toneMapped=!1,this.setColorChannel(qX.RED),this.setMaskFunction(ZX.DISCARD)}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}set maskTexture(t){this.uniforms.maskTexture.value=t,delete this.defines.MASK_PRECISION_HIGH,t.type!==gs&&(this.defines.MASK_PRECISION_HIGH="1"),this.needsUpdate=!0}setMaskTexture(t){this.maskTexture=t}set colorChannel(t){this.defines.COLOR_CHANNEL=t.toFixed(0),this.needsUpdate=!0}setColorChannel(t){this.colorChannel=t}set maskFunction(t){this.defines.MASK_FUNCTION=t.toFixed(0),this.needsUpdate=!0}setMaskFunction(t){this.maskFunction=t}get inverted(){return this.defines.INVERTED!==void 0}set inverted(t){this.inverted&&!t?delete this.defines.INVERTED:t&&(this.defines.INVERTED="1"),this.needsUpdate=!0}isInverted(){return this.inverted}setInverted(t){this.inverted=t}get strength(){return this.uniforms.strength.value}set strength(t){this.uniforms.strength.value=t}getStrength(){return this.strength}setStrength(t){this.strength=t}},NP
vendor: 7,737 bytes, lines 10173-10198
10173e=`#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize) 10174#if __VERSION__ < 300 10175#define round(v) floor(v + 0.5) 10176#endif 10177#ifdef FRAMEBUFFER_PRECISION_HIGH 10178uniform mediump sampler2D inputBuffer; 10179#else 10180uniform lowp sampler2D inputBuffer; 10181#endif 10182uniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x>end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x<end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.y>end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;i++){if(!(texCoord.y<end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ 10183#if !defined(DISABLE_CORNER_DETECTION) 10184vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0); 10185#endif 10186}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){ 10187#if !defined(DISABLE_CORNER_DETECTION) 10188vec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0); 10189#endif 10190}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){ 10191#if !defined(DISABLE_DIAG_DETECTION) 10192weights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){ 10193#endif 10194vec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d); 10195#if !defined(DISABLE_DIAG_DETECTION) 10196}else{e.r=0.0;} 10197#endif 10198}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}`,
vendor: 16,803 bytes, line 10198
10198UPe="uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}",FPe=class extends Xi{constructor(t=new Me,i=new Me){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new at(null),searchTexture:new at(null),areaTexture:new at(null),resolution:new at(i),texelSize:new at(t)},blending:Un,depthWrite:!1,depthTest:!1,fragmentShader:NPe,vertexShader:UPe}),this.toneMapped=!1}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(t){this.uniforms.searchTexture.value=t}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(t){this.uniforms.areaTexture.value=t}setLookupTextures(t,i){this.searchTexture=t,this.areaTexture=i}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(t){let i=Math.min(Math.max(t,0),112);this.defines.MAX_SEARCH_STEPS_INT=i.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=i.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(t){this.orthogonalSearchSteps=t}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(t){let i=Math.min(Math.max(t,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=i.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=i.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(t){this.diagonalSearchSteps=t}get diagonalDetection(){return this.defines.DISABLE_DIAG_DETECTION===void 0}set diagonalDetection(t){t?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(t){this.diagonalDetection=t}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(t){let i=Math.min(Math.max(t,0),100);this.defines.CORNER_ROUNDING=i.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(i/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(t){this.cornerRounding=t}get cornerDetection(){return this.defines.DISABLE_CORNER_DETECTION===void 0}set cornerDetection(t){t?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(t){this.cornerDetection=t}setSize(t,i){let r=this.uniforms;r.texelSize.value.set(1/t,1/i),r.resolution.value.set(t,i)}},kPe=new Bp,_d=null;function HPe(){if(_d===null){let t=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),i=new Float32Array([0,0,2,0,0,2]);_d=new Lt,_d.setAttribute!==void 0?(_d.setAttribute("position",new ei(t,3)),_d.setAttribute("uv",new ei(i,2))):(_d.addAttribute("position",new ei(t,3)),_d.addAttribute("uv",new ei(i,2)))}return _d}var Vs=class{constructor(t="Pass",i=new ch,r=kPe){this.name=t,this.renderer=null,this.scene=i,this.camera=r,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(t){if(this.rtt===t){let i=this.getFullscreenMaterial();i!==null&&(i.needsUpdate=!0),this.rtt=!t}}setRenderer(t){this.renderer=t}isEnabled(){return this.enabled}setEnabled(t){this.enabled=t}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(t){let i=this.screen;i!==null?i.material=t:(i=new Zr(HPe(),t),i.frustumCulled=!1,this.scene===null&&(this.scene=new ch),this.scene.add(i),this.screen=i)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(t){this.fullscreenMaterial=t}getDepthTexture(){return null}setDepthTexture(t,i=ed){}render(t,i,r,n,a){throw new Error("Render method not implemented!")}setSize(t,i){}initialize(t,i,r){}dispose(){for(let t of Object.keys(this)){let i=this[t];if(i!==null&&typeof i=="object"&&typeof i.dispose=="function"){if(i instanceof ch||i===this.renderer)continue;this[t].dispose()}}}},OL=class extends Vs{constructor(t,i=!0){super("CopyPass"),this.fullscreenMaterial=new CPe,this.needsSwap=!1,this.renderTarget=t,t===void 0&&(this.renderTarget=new $i(1,1,{minFilter:Ei,magFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=i}get resize(){return this.autoResize}set resize(t){this.autoResize=t}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(t){this.autoResize=t}render(t,i,r,n,a){this.fullscreenMaterial.inputBuffer=i.texture,t.setRenderTarget(this.renderToScreen?null:this.renderTarget),t.render(this.scene,this.camera)}setSize(t,i){this.autoResize&&this.renderTarget.setSize(t,i)}initialize(t,i,r){r!==void 0&&(this.renderTarget.texture.type=r,r!==gs?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":t.outputEncoding===gi&&(this.renderTarget.texture.encoding=gi))}},GPe=class extends Vs{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(t,i,r,n,a){let s=t.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},KI=new Ht,pU=class extends Vs{constructor(t=!0,i=!0,r=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=t,this.depth=i,this.stencil=r,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(t,i,r){this.color=t,this.depth=i,this.stencil=r}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(t){this.overrideClearColor=t}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(t){this.overrideClearAlpha=t}render(t,i,r,n,a){let s=this.overrideClearColor,o=this.overrideClearAlpha,l=t.getClearAlpha(),c=s!==null,h=o>=0;c?(KI.copy(t.getClearColor(KI)),t.setClearColor(s,h?o:l)):h&&t.setClearAlpha(o),t.setRenderTarget(this.renderToScreen?null:i),t.clear(this.color,this.depth,this.stencil),c?t.setClearColor(KI,l):h&&t.setClearAlpha(l)}},yd=-1,oo=class extends Ja{constructor(t,i=yd,r=yd,n=1){super(),this.resizable=t,this.base=new Me(1,1),this.preferred=new Me(i,r),this.target=this.preferred,this.s=n}get width(){let{base:t,preferred:i,scale:r}=this,n;return i.width!==yd?n=i.width:i.height!==yd?n=Math.round(i.height*(t.width/Math.max(t.height,1))):n=Math.round(t.width*r),n}set width(t){this.preferredWidth=t}get height(){let{base:t,preferred:i,scale:r}=this,n;return i.height!==yd?n=i.height:i.width!==yd?n=Math.round(i.width/Math.max(t.width/Math.max(t.height,1),1)):n=Math.round(t.height*r),n}set height(t){this.preferredHeight=t}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(t){this.s!==t&&(this.s=t,this.preferred.setScalar(yd),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getScale(){return this.scale}setScale(t){this.scale=t}get baseWidth(){return this.base.width}set baseWidth(t){this.base.width!==t&&(this.base.width=t,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseWidth(){return this.base.width}setBaseWidth(t){this.base.width!==t&&(this.base.width=t,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get baseHeight(){return this.base.height}set baseHeight(t){this.base.height!==t&&(this.base.height=t,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(t){this.baseHeight=t}setBaseSize(t,i){(this.base.width!==t||this.base.height!==i)&&(this.base.set(t,i),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}get preferredWidth(){return this.preferred.width}set preferredWidth(t){this.preferred.width!==t&&(this.preferred.width=t,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(t){this.preferredWidth=t}get preferredHeight(){return this.preferred.height}set preferredHeight(t){this.preferred.height!==t&&(this.preferred.height=t,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(t){this.preferredHeight=t}setPreferredSize(t,i){(this.preferred.width!==t||this.preferred.height!==i)&&(this.preferred.set(t,i),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height))}copy(t){this.base.set(t.getBaseWidth(),t.getBaseHeight()),this.preferred.set(t.getPreferredWidth(),t.getPreferredHeight()),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.base.width,this.base.height)}static get AUTO_SIZE(){return yd}},XI=!1,K6=class{constructor(t=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(t),this.meshCount=0,this.replaceMaterial=i=>{if(i.isMesh){let r;if(i.material.flatShading)switch(i.material.side){case hs:r=this.materialsFlatShadedDoubleSide;break;case Ea:r=this.materialsFlatShadedBackSide;break;default:r=this.materialsFlatShaded;break}else switch(i.material.side){case hs:r=this.materialsDoubleSide;break;case Ea:r=this.materialsBackSide;break;default:r=this.materials;break}this.originalMaterials.set(i,i.material),i.isSkinnedMesh?i.material=r[2]:i.isInstancedMesh?i.material=r[1]:i.material=r[0],++this.meshCount}}}setMaterial(t){if(this.disposeMaterials(),this.material=t,t!==null){let i=this.materials=[t.clone(),t.clone(),t.clone()];for(let r of i)r.uniforms=Object.assign({},t.uniforms),r.side=pc;i[2].skinning=!0,this.materialsBackSide=i.map(r=>{let n=r.clone();return n.uniforms=Object.assign({},t.uniforms),n.side=Ea,n}),this.materialsDoubleSide=i.map(r=>{let n=r.clone();return n.uniforms=Object.assign({},t.uniforms),n.side=hs,n}),this.materialsFlatShaded=i.map(r=>{let n=r.clone();return n.uniforms=Object.assign({},t.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=i.map(r=>{let n=r.clone();return n.uniforms=Object.assign({},t.uniforms),n.flatShading=!0,n.side=Ea,n}),this.materialsFlatShadedDoubleSide=i.map(r=>{let n=r.clone();return n.uniforms=Object.assign({},t.uniforms),n.flatShading=!0,n.side=hs,n})}}render(t,i,r){let n=t.shadowMap.enabled;if(t.shadowMap.enabled=!1,XI){let a=this.originalMaterials;this.meshCount=0,i.traverse(this.replaceMaterial),t.render(i,r);for(let s of a)s[0].material=s[1];this.meshCount!==a.size&&a.clear()}else{let a=i.overrideMaterial;i.overrideMaterial=this.material,t.render(i,r),i.overrideMaterial=a}t.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){let t=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(let i of t)i.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return XI}static set workaroundEnabled(t){XI=t}},zPe=class extends Vs{constructor(t,i,r=null){super("RenderPass",t,i),this.needsSwap=!1,this.clearPass=new pU,this.overrideMaterialManager=r===null?null:new K6(r),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}get renderToScreen(){return super.renderToScreen}set renderToScreen(t){super.renderToScreen=t,this.clearPass.renderToScreen=t}get overrideMaterial(){let t=this.overrideMaterialManager;return t!==null?t.material:null}set overrideMaterial(t){let i=this.overrideMaterialManager;t!==null?i!==null?i.setMaterial(t):this.overrideMaterialManager=new K6(t):i!==null&&(i.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(t){this.overrideMaterial=t}get clear(){return this.clearPass.enabled}set clear(t){this.clearPass.enabled=t}getSelection(){return this.selection}setSelection(t){this.selection=t}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(t){this.ignoreBackground=t}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(t){this.skipShadowMapUpdate=t}getClearPass(){return this.clearPass}render(t,i,r,n,a){let s=this.scene,o=this.camera,l=this.selection,c=o.layers.mask,h=s.background,u=t.shadowMap.autoUpdate,d=this.renderToScreen?null:i;l!==null&&o.layers.set(l.getLayer()),this.skipShadowMapUpdate&&(t.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(t,i),t.setRenderTarget(d),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(t,s,o):t.render(s,o),o.layers.mask=c,s.background=h,t.shadowMap.autoUpdate=u}},X6=class extends Vs{constructor(t,i,{resolutionScale:r=1,width:n=oo.AUTO_SIZE,height:a=oo.AUTO_SIZE,renderTarget:s}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new zPe(t,i,new N7({depthPacking:w7}));let o=this.renderPass;o.skipShadowMapUpdate=!0,o.ignoreBackground=!0;let l=o.getClearPass();l.overrideClearColor=new Ht(16777215),l.overrideClearAlpha=1,this.renderTarget=s,this.renderTarget===void 0&&(this.renderTarget=new $i(1,1,{minFilter:tr,magFilter:tr,stencilBuffer:!1}),this.renderTarget.texture.name="DepthPass.Target");let c=this.resolution=new oo(this,n,a,r);c.addEventListener("change",h=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(t){this.resolution.scale=t}render(t,i,r,n,a){let s=this.renderToScreen?null:this.renderTarget;this.renderPass.render(t,s)}setSize(t,i){let r=this.resolution;r.setBaseSize(t,i),this.renderTarget.setSize(r.width,r.height)}},Hi={SKIP:0,ADD:1,ALPHA:2,AVERAGE:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,EXCLUSION:8,LIGHTEN:9,MULTIPLY:10,DIVIDE:11,NEGATION:12,NORMAL:13,OVERLAY:14,REFLECT:15,SCREEN:16,SOFT_LIGHT:17,SUBTRACT:18},QPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}",VPe="vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}",WPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}",jPe="float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",YPe="float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",KPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}",XPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}",qPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}",ZPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}",JPe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}",$Pe="float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",eLe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}",tLe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*
10198opacity+x*(1.0-opacity);}",iLe="float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",rLe="float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",nLe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}",aLe="float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}",sLe="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}",oLe=new Map([[Hi.SKIP,null],[Hi.ADD,QPe],[Hi.ALPHA,VPe],[Hi.AVERAGE,WPe],[Hi.COLOR_BURN,jPe],[Hi.COLOR_DODGE,YPe],[Hi.DARKEN,KPe],[Hi.DIFFERENCE,XPe],[Hi.EXCLUSION,qPe],[Hi.LIGHTEN,ZPe],[Hi.MULTIPLY,JPe],[Hi.DIVIDE,$Pe],[Hi.NEGATION,eLe],[Hi.NORMAL,tLe],[Hi.OVERLAY,iLe],[Hi.REFLECT,rLe],[Hi.SCREEN,nLe],[Hi.SOFT_LIGHT,aLe],[Hi.SUBTRACT,sLe]]),lLe=class extends Ja{constructor(t,i=1){super(),this.f=t,this.opacity=new at(i)}getOpacity(){return this.opacity.value}setOpacity(t){this.opacity.value=t}get blendFunction(){return this.f}set blendFunction(t){this.f=t,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(t){this.blendFunction=t}getShaderCode(){return oLe.get(this.blendFunction)}},hh={NONE:0,DEPTH:1,CONVOLUTION:2},Sh=class extends Ja{constructor(t,i,{attributes:r=hh.NONE,blendFunction:n=Hi.SCREEN,defines:a=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:l=null}={}){super(),this.name=t,this.renderer=null,this.attributes=r,this.fragmentShader=i,this.vertexShader=l,this.defines=a,this.uniforms=s,this.extensions=o,this.blendMode=new lLe(n),this.blendMode.addEventListener("change",c=>this.setChanged())}getName(){return this.name}setRenderer(t){this.renderer=t}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(t){this.attributes=t,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(t){this.fragmentShader=t,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(t){this.vertexShader=t,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(t,i=ed){}update(t,i,r){}setSize(t,i){}initialize(t,i,r){}dispose(){for(let t of Object.keys(this)){let i=this[t];if(i!==null&&typeof i=="object"&&typeof i.dispose=="function"){if(i instanceof ch||i===this.renderer)continue;this[t].dispose()}}}};function q6(t,i,r){for(let n of i){let a="$1"+t+n.charAt(0).toUpperCase()+n.slice(1),s=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(let o of r.entries())o[1]!==null&&r.set(o[0],o[1].replace(s,a))}}function cLe(t,i,r,n,a,s,o){let l=new Map([["fragment",i.getFragmentShader()],["vertex",i.getVertexShader()]]),c=l.get("fragment")!==void 0&&/mainImage/.test(l.get("fragment")),h=l.get("fragment")!==void 0&&/mainUv/.test(l.get("fragment")),u=[],d=[],A=!1,f=!1;if(l.get("fragment")===void 0)console.error("Missing fragment shader",i);else if(h&&o&hh.CONVOLUTION)console.error("Effects that transform UV coordinates are incompatible with convolution effects",i);
vendor: 19,361 bytes, lines 10198-10223
10198else if(!c&&!h)console.error("The fragment shader contains neither a mainImage nor a mainUv function",i);else{let m=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,g=LL.Section;if(h){let v=` ${t}MainUv(UV); 10199`;r.set(g.FRAGMENT_MAIN_UV,r.get(g.FRAGMENT_MAIN_UV)+v),A=!0}if(l.get("vertex")!==null&&/mainSupport/.test(l.get("vertex"))){let v=` ${t}MainSupport(`;v+=/mainSupport *\([\w\s]*?uv\s*?\)/.test(l.get("vertex"))?`vUv); 10200`:`); 10201`,r.set(g.VERTEX_MAIN_SUPPORT,r.get(g.VERTEX_MAIN_SUPPORT)+v),u=u.concat([...l.get("vertex").matchAll(/(?:varying\s+\w+\s+(\w*))/g)].map(_=>_[1])),d=d.concat(u).concat([...l.get("vertex").matchAll(m)].map(_=>_[1]))}d=d.concat([...l.get("fragment").matchAll(m)].map(v=>v[1])),d=d.concat([...i.defines.keys()].map(v=>v.replace(/\([\w\s,]*\)/g,""))),d=d.concat([...i.uniforms.keys()]),i.uniforms.forEach((v,_)=>s.set(t+_.charAt(0).toUpperCase()+_.slice(1),v)),i.defines.forEach((v,_)=>a.set(t+_.charAt(0).toUpperCase()+_.slice(1),v)),q6(t,d,a),q6(t,d,l);let p=i.blendMode;if(n.set(p.blendFunction,p),c){let v=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/,_=`${t}MainImage(color0, UV, `;o&hh.DEPTH&&v.test(l.get("fragment"))&&(_+="depth, ",f=!0),_+=`color1); 10202 `;let y=t+"BlendOpacity";s.set(y,p.opacity),_+=`color0 = blend${p.blendFunction}(color0, color1, ${y}); 10203 10204 `,r.set(g.FRAGMENT_MAIN_IMAGE,r.get(g.FRAGMENT_MAIN_IMAGE)+_),_=`uniform float ${y}; 10205 10206`,r.set(g.FRAGMENT_HEAD,r.get(g.FRAGMENT_HEAD)+_)}r.set(g.FRAGMENT_HEAD,r.get(g.FRAGMENT_HEAD)+l.get("fragment")+` 10207`),l.get("vertex")!==null&&r.set(g.VERTEX_HEAD,r.get(g.VERTEX_HEAD)+l.get("vertex")+` 10208`)}return{varyings:u,transformedUv:A,readDepth:f}}var pT=class extends Vs{constructor(t,...i){super("EffectPass"),this.fullscreenMaterial=new LL(null,null,null,t),this.effects=i.sort((r,n)=>n.attributes-r.attributes),this.skipRendering=!1,this.uniformCount=0,this.varyingCount=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(t){this.fullscreenMaterial.encodeOutput=t}get dithering(){return this.fullscreenMaterial.dithering}set dithering(t){let i=this.fullscreenMaterial;i.dithering=t,i.needsUpdate=!0}verifyResources(){let t=this.renderer.capabilities,i=Math.min(t.maxFragmentUniforms,t.maxVertexUniforms);this.uniformCount>i&&console.warn("The current rendering context doesn't support more than "+i+" uniforms, but "+this.uniformCount+" were defined"),i=t.maxVaryings,this.varyingCount>i&&console.warn("The current rendering context doesn't support more than "+i+" varyings, but "+this.varyingCount+" were defined")}updateMaterial(){let t=LL.Section,i=new Map([[t.FRAGMENT_HEAD,""],[t.FRAGMENT_MAIN_UV,""],[t.FRAGMENT_MAIN_IMAGE,""],[t.VERTEX_HEAD,""],[t.VERTEX_MAIN_SUPPORT,""]]),r=new Map,n=new Map,a=new Map,s=new Set,o=0,l=0,c=0,h=!1,u=!1;for(let A of this.effects)if(A.blendMode.blendFunction===Hi.SKIP)c|=A.getAttributes()&hh.DEPTH;else if(c&A.getAttributes()&hh.CONVOLUTION)console.error("Convolution effects cannot be merged",A);else{c|=A.getAttributes();let f="e"+o++,m=cLe(f,A,i,r,n,a,c);if(l+=m.varyings.length,h=h||m.transformedUv,u=u||m.readDepth,A.extensions!==null)for(let g of A.extensions)s.add(g)}let d=/\bblend\b/g;for(let A of r.values()){let f=A.getShaderCode().replace(d,`blend${A.blendFunction}`);i.set(t.FRAGMENT_HEAD,i.get(t.FRAGMENT_HEAD)+f+` 10209`)}if(c&hh.DEPTH){if(u){let A=`float depth = readDepth(UV); 10210 10211 `;i.set(t.FRAGMENT_MAIN_IMAGE,A+i.get(t.FRAGMENT_MAIN_IMAGE))}this.needsDepthTexture=this.getDepthTexture()===null}else this.needsDepthTexture=!1;if(h){let A=`vec2 transformedUv = vUv; 10212`;i.set(t.FRAGMENT_MAIN_UV,A+i.get(t.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")}else n.set("UV","vUv");i.forEach((A,f,m)=>m.set(f,A.trim().replace(/^#/,` 10213#`))),this.uniformCount=a.size,this.varyingCount=l,this.skipRendering=o===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderParts(i).setExtensions(s).setUniforms(a).setDefines(n)}recompile(){this.updateMaterial(),this.verifyResources()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(t,i=ed){this.fullscreenMaterial.depthBuffer=t,this.fullscreenMaterial.depthPacking=i;for(let r of this.effects)r.setDepthTexture(t,i)}render(t,i,r,n,a){for(let s of this.effects)s.update(t,i,n);if(!this.skipRendering||this.renderToScreen){let s=this.fullscreenMaterial;s.inputBuffer=i.texture,s.time+=n,t.setRenderTarget(this.renderToScreen?null:r),t.render(this.scene,this.camera)}}setSize(t,i){this.fullscreenMaterial.setSize(t,i);for(let r of this.effects)r.setSize(t,i)}initialize(t,i,r){this.renderer=t;for(let n of this.effects)n.initialize(t,i,r),n.addEventListener("change",a=>this.handleEvent(a));this.updateMaterial(),this.verifyResources(),r!==void 0&&r!==gs&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(let t of this.effects)t.dispose()}handleEvent(t){switch(t.type){case"change":this.recompile();break}}},hLe=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],mU=class extends Vs{constructor({resolutionScale:t=.5,width:i=oo.AUTO_SIZE,height:r=oo.AUTO_SIZE,kernelSize:n=MM.LARGE}={}){super("KawaseBlurPass"),this.renderTargetA=new $i(1,1,{minFilter:Ei,magFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";let a=this.resolution=new oo(this,i,r,t);a.addEventListener("change",s=>this.setSize(a.baseWidth,a.baseHeight)),this.blurMaterial=new Y6,this.ditheredBlurMaterial=new Y6,this.ditheredBlurMaterial.uniforms.scale=this.blurMaterial.uniforms.scale,this.ditheredBlurMaterial.dithering=!0,this.dithering=!1,this.kernelSize=n}getResolution(){return this.resolution}get width(){return this.resolution.width}set width(t){this.resolution.preferredWidth=t}get height(){return this.resolution.height}set height(t){this.resolution.preferredHeight=t}get scale(){return this.blurMaterial.scale}set scale(t){this.blurMaterial.scale=t}getScale(){return this.blurMaterial.scale}setScale(t){this.blurMaterial.scale=t}getKernelSize(){return this.kernelSize}setKernelSize(t){this.kernelSize=t}getResolutionScale(){return this.resolution.scale}setResolutionScale(t){this.resolution.scale=t}render(t,i,r,n,a){let s=this.scene,o=this.camera,l=this.renderTargetA,c=this.renderTargetB,h=hLe[this.kernelSize],u=this.blurMaterial,d=i,A,f;for(this.fullscreenMaterial=u,A=0,f=h.length-1;A<f;++A){let m=A&1?c:l;u.kernel=h[A],u.inputBuffer=d.texture,t.setRenderTarget(m),t.render(s,o),d=m}this.dithering&&(u=this.ditheredBlurMaterial,this.fullscreenMaterial=u),u.kernel=h[A],u.inputBuffer=d.texture,t.setRenderTarget(this.renderToScreen?null:r),t.render(s,o)}setSize(t,i){let r=this.resolution;r.setBaseSize(t,i);let n=r.width,a=r.height;this.renderTargetA.setSize(n,a),this.renderTargetB.setSize(n,a),this.blurMaterial.setSize(n,a),this.ditheredBlurMaterial.setSize(n,a)}initialize(t,i,r){r!==void 0&&(this.renderTargetA.texture.type=r,this.renderTargetB.texture.type=r,r!==gs?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.ditheredBlurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):t.outputEncoding===gi&&(this.renderTargetA.texture.encoding=gi,this.renderTargetB.texture.encoding=gi))}static get AUTO_SIZE(){return oo.AUTO_SIZE}},uLe=class extends Vs{constructor({width:t=oo.AUTO_SIZE,height:i=oo.AUTO_SIZE,renderTarget:r,luminanceRange:n,colorOutput:a}={}){super("LuminancePass"),this.fullscreenMaterial=new PPe(a,n),this.needsSwap=!1,this.renderTarget=r,this.renderTarget===void 0&&(this.renderTarget=new $i(1,1,{minFilter:Ei,magFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target",this.renderTarget.texture.generateMipmaps=!1);let s=this.resolution=new oo(this,t,i);s.addEventListener("change",o=>this.setSize(s.baseWidth,s.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(t,i,r,n,a){let s=this.fullscreenMaterial;s.inputBuffer=i.texture,t.setRenderTarget(this.renderToScreen?null:this.renderTarget),t.render(this.scene,this.camera)}setSize(t,i){let r=this.resolution;r.setBaseSize(t,i),this.renderTarget.setSize(r.width,r.height)}initialize(t,i,r){r!==void 0&&r!==gs&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},dLe=class extends Vs{constructor(t,i){super("MaskPass",t,i),this.needsSwap=!1,this.clearPass=new pU(!1,!1,!0),this.inverse=!1}get inverted(){return this.inverse}set inverted(t){this.inverse=t}get clear(){return this.clearPass.enabled}set clear(t){this.clearPass.enabled=t}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(t){this.inverted=t}render(t,i,r,n,a){let s=t.getContext(),o=t.state.buffers,l=this.scene,c=this.camera,h=this.clearPass,u=this.inverted?0:1,d=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(d),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?h.render(t,null):(h.render(t,i),h.render(t,r))),this.renderToScreen?(t.setRenderTarget(null),t.render(l,c)):(t.setRenderTarget(i),t.render(l,c),t.setRenderTarget(r),t.render(l,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}},il=class extends Vs{constructor(t,i="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=t,this.inputBufferUniform=null,this.setInput(i)}setInput(t){if(this.inputBufferUniform=null,this.fullscreenMaterial!==null){let i=this.fullscreenMaterial.uniforms;i!==void 0&&i[t]!==void 0&&(this.inputBufferUniform=i[t])}}render(t,i,r,n,a){this.inputBufferUniform!==null&&i!==null&&(this.inputBufferUniform.value=i.texture),t.setRenderTarget(this.renderToScreen?null:r),t.render(this.scene,this.camera)}initialize(t,i,r){r!==void 0&&r!==gs&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},qI=1/1e3,ALe=1e3,fLe=class{constructor(){this.previousTime=0,this.currentTime=0,this.delta=0,this.fixedDelta=1e3/60,this.elapsed=0,this.timescale=1,this.fixedDeltaEnabled=!1,this.autoReset=!1}setFixedDeltaEnabled(t){return this.fixedDeltaEnabled=t,this}isAutoResetEnabled(t){return this.autoReset}setAutoResetEnabled(t){return typeof document<"u"&&document.hidden!==void 0&&(t?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this.autoReset=t),this}getDelta(){return this.delta*qI}getFixedDelta(){return this.fixedDelta*qI}setFixedDelta(t){return this.fixedDelta=t*ALe,this}getElapsed(){return this.elapsed*qI}getTimescale(){return this.timescale}setTimescale(t){return this.timescale=t,this}update(t){return this.fixedDeltaEnabled?this.delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=t!==void 0?t:performance.now(),this.delta=this.currentTime-this.previousTime),this.delta*=this.timescale,this.elapsed+=this.delta,this}reset(){return this.delta=0,this.elapsed=0,this.currentTime=performance.now(),this}handleEvent(t){document.hidden||(this.currentTime=performance.now())}dispose(){this.setAutoResetEnabled(!1)}},MM={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},pLe=`#ifdef FRAMEBUFFER_PRECISION_HIGH 10214uniform mediump sampler2D map; 10215#else 10216uniform lowp sampler2D map; 10217#endif 10218uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=clamp(texture2D(map,uv)*intensity,0.0,1.0);}`,mLe=class extends Sh{constructor({blendFunction:t=Hi.SCREEN,luminanceThreshold:i=.9,luminanceSmoothing:r=.025,resolutionScale:n=.5,intensity:a=1,width:s=oo.AUTO_SIZE,height:o=oo.AUTO_SIZE,kernelSize:l=MM.LARGE}={}){super("BloomEffect",pLe,{blendFunction:t,uniforms:new Map([["map",new at(null)],["intensity",new at(a)]])}),this.renderTarget=new $i(1,1,{minFilter:Ei,magFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.renderTarget.texture.generateMipmaps=!1,this.uniforms.get("map").value=this.renderTarget.texture,this.luminancePass=new uLe({renderTarget:this.renderTarget,colorOutput:!0}),this.luminanceMaterial.threshold=i,this.luminanceMaterial.smoothingFactor=r,this.blurPass=new mU({resolutionScale:n,width:s,height:o,kernelSize:l});let c=this.blurPass.getResolution();c.addEventListener("change",h=>this.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(t){this.resolution.preferredWidth=t}get height(){return this.resolution.height}set height(t){this.resolution.preferredHeight=t}get dithering(){return this.blurPass.dithering}set dithering(t){this.blurPass.dithering=t}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(t){this.blurPass.kernelSize=t}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(t){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(t){this.uniforms.get("intensity").value=t}getIntensity(){return this.intensity}setIntensity(t){this.intensity=t}getResolutionScale(){return this.resolution.scale}setResolutionScale(t){this.resolution.scale=t}update(t,i,r){let n=this.renderTarget;this.luminancePass.enabled?(this.luminancePass.render(t,i,n),this.blurPass.render(t,n,n)):this.blurPass.render(t,i,n)}setSize(t,i){let r=this.resolution;r.setBaseSize(t,i),this.renderTarget.setSize(r.width,r.height),this.luminancePass.resolution.copy(r)}initialize(t,i,r){this.blurPass.initialize(t,i,r),r!==void 0&&(this.renderTarget.texture.type=r,t.outputEncoding===gi&&(this.renderTarget.texture.encoding=gi))}},gLe="uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",vLe=class extends Sh{constructor({blendFunction:t=Hi.NORMAL,brightness:i=0,contrast:r=0}={}){super("BrightnessContrastEffect",gLe,{blendFunction:t,uniforms:new Map([["brightness",new at(i)],["contrast",new at(r)]])})}get brightness(){return this.uniforms.get("brightness").value}set brightness(t){this.uniforms.get("brightness").value=t}getBrightness(t){return this.brightness}setBrightness(t){this.brightness=t}get contrast(){return this.uniforms.get("contrast").value}set contrast(t){this.uniforms.get("contrast").value=t}getContrast(t){return this.contrast}setContrast(t){this.contrast=t}},_Le="void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=vec4(vec3(average(inputColor.rgb)),inputColor.a);}",yLe=class extends Sh{constructor(t=Hi.NORMAL){super("ColorAverageEffect",_Le,{blendFunction:t})}},ELe="varying vec2 vUvR;varying vec2 vUvB;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec2 ra=texture2D(inputBuffer,vUvR).ra;vec2 ba=texture2D(inputBuffer,vUvB).ba;outputColor=vec4(ra.x,inputColor.g,ba.x,max(max(ra.y,ba.y),inputColor.a));}",wLe="uniform vec2 offset;varying vec2 vUvR;varying vec2 vUvB;void mainSupport(const in vec2 uv){vec2 shift=offset*vec2(1.0,aspect);vUvR=uv+shift;vUvB=uv-shift;}",bLe=class extends Sh{constructor({blendFunction:t=Hi.NORMAL,offset:i=new Me(.001,5e-4)}={}){super("ChromaticAberrationEffect",ELe,{vertexShader:wLe,blendFunction:t,attributes:hh.CONVOLUTION,uniforms:new Map([["offset",new at(i)]])})}get offset(){return this.uniforms.get("offset").value}set offset(t){this.uniforms.get("offset").value=t}getOffset(){return this.offset}setOffset(t){this.offset=t}},SLe=`#ifdef FRAMEBUFFER_PRECISION_HIGH 10219uniform mediump sampler2D nearColorBuffer;uniform mediump sampler2D farColorBuffer; 10220#else 10221uniform lowp sampler2D nearColorBuffer;uniform lowp sampler2D farColorBuffer; 10222#endif 10223uniform lowp sampler2D nearCoCBuffer;uniform float scale;void mainImage(const in vec4 inputColor,const in vec2 uv,const in float depth,out vec4 outputColor){vec4 colorNear=texture2D(nearColorBuffer,uv);vec4 colorFar=texture2D(farColorBuffer,uv);float CoCNear=texture2D(nearCoCBuffer,uv).r;CoCNear=min(CoCNear*scale,1.0);vec4 result=inputColor*(1.0-colorFar.a)+colorFar;result=mix(result,colorNear,CoCNear);outputColor=result;}`,CLe=class extends Sh{constructor(t,{blendFunction:i=Hi.NORMAL,worldFocusDistance:r,worldFocusRange:n,focusDistance:a=0,focalLength:s=.1,focusRange:o=s,bokehScale:l=1,width:c=oo.AUTO_SIZE,height:h=oo.AUTO_SIZE}={}){super("DepthOfFieldEffect",SLe,{blendFunction:i,attributes:hh.DEPTH,uniforms:new Map([["nearColorBuffer",new at(null)],["farColorBuffer",new at(null)],["nearCoCBuffer",new at(null)],["scale",new at(1)]])}),this.camera=t,this.renderTarget=new $i(1,1,{minFilter:Ei,magFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="DoF.Intermediate",this.renderTarget.texture.generateMipmaps=!1,this.renderTargetMasked=this.renderTarget.clone(),this.renderTargetMasked.texture.name="DoF.Masked.Far",this.renderTargetNear=this.renderTarget.clone(),this.renderTargetNear.texture.name="DoF.Bokeh.Near",this.uniforms.get("nearColorBuffer").value=this.renderTargetNear.texture,this.renderTargetFar=this.renderTarget.clone(),this.renderTargetFar.texture.name="DoF.Bokeh.Far",this.uniforms.get("farColorBuffer").value=this.renderTargetFar.texture,this.renderTargetCoC=this.renderTarget.clone(),this.renderTargetCoC.texture.name="DoF.CoC",this.renderTargetCoCBlurred=this.renderTargetCoC.clone(),this.renderTargetCoCBlurred.texture.name="DoF.CoC.Blurred",this.uniforms.get("nearCoCBuffer").value=this.renderTargetCoCBlurred.texture,this.cocPass=new il(new EPe(t));let u=this.cocMaterial;u.focusDistance=a,u.focusRange=o,r!==void 0&&(u.worldFocusDistance=r),n!==void 0&&(u.worldFocusRange=n),this.blurPass=new mU({kernelSize:MM.MEDIUM,width:c,height:h});let d=this.blurPass.getResolution();d.addEventListener("change",f=>this.setSize(d.getBaseWidth(),d.getBaseHeight())),this.maskPass=new il(new OPe(this.renderTargetCoC.texture));let A=this.maskPass.fullscreenMaterial;A.maskFunction=ZX.MULTIPLY,A.colorChannel=qX.GREEN,this.bokehNearBasePass=new il(new Vb(!1,!0)),this.bokehNearBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehNearFillPass=new il(new Vb(!0,!0)),this.bokehNearFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoCBlurred.texture,this.bokehFarBasePass=new il(new Vb(!1,!1)),this.bokehFarBasePass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.bokehFarFillPass=new il(new Vb(!0,!1)),this.bokehFarFillPass.fullscreenMaterial.cocBuffer=this.renderTargetCoC.texture,this.target=null,this.bokehScale=l}get cocTexture(){return this.renderTargetCoC.texture}
10223get cocMaterial(){return this.cocPass.fullscreenMaterial}get circleOfConfusionMaterial(){return this.cocMaterial}getCircleOfConfusionMaterial(){return this.circleOfConfusionMaterial}getBlurPass(){return this.blurPass}get resolution(){return this.blurPass.getResolution()}getResolution(){return this.blurPass.getResolution()}get bokehScale(){return this.uniforms.get("scale").value}set bokehScale(t){let i=[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];for(let r of i)r.fullscreenMaterial.setScale(t);this.maskPass.fullscreenMaterial.setStrength(t),this.uniforms.get("scale").value=t}getBokehScale(){return this.bokehScale}setBokehScale(t){this.bokehScale=t}getTarget(){return this.target}setTarget(t){this.target=t}calculateFocusDistance(t){let i=this.camera,r=i.position.distanceTo(t);return PL(-r,i.near,i.far)}setDepthTexture(t,i=ed){this.circleOfConfusionMaterial.depthBuffer=t,this.circleOfConfusionMaterial.depthPacking=i}update(t,i,r){let n=this.renderTarget,a=this.renderTargetCoC,s=this.renderTargetCoCBlurred,o=this.renderTargetMasked;if(this.target!==null){let l=this.calculateFocusDistance(this.target);this.circleOfConfusionMaterial.focusDistance=l}this.cocPass.render(t,null,a),this.blurPass.render(t,a,s),this.maskPass.render(t,i,o),this.bokehFarBasePass.render(t,o,n),this.bokehFarFillPass.render(t,n,this.renderTargetFar),this.bokehNearBasePass.render(t,i,n),this.bokehNearFillPass.render(t,n,this.renderTargetNear)}setSize(t,i){let r=this.resolution;r.setBaseSize(t,i);let n=r.width,a=r.height,s=[this.cocPass,this.blurPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass];
vendor: 3,695 bytes, lines 10223-10229
10223s.push(this.renderTargetCoC,this.renderTargetMasked),s.forEach(o=>o.setSize(t,i)),s=[this.renderTarget,this.renderTargetNear,this.renderTargetFar,this.renderTargetCoCBlurred],s.forEach(o=>o.setSize(n,a)),[this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(o=>o.fullscreenMaterial.setSize(n,a))}initialize(t,i,r){[this.cocPass,this.maskPass,this.bokehNearBasePass,this.bokehNearFillPass,this.bokehFarBasePass,this.bokehFarFillPass].forEach(n=>n.initialize(t,i,r)),this.blurPass.initialize(t,i,gs),r!==void 0&&(this.renderTarget.texture.type=r,this.renderTargetNear.texture.type=r,this.renderTargetFar.texture.type=r,this.renderTargetMasked.texture.type=r,t.outputEncoding===gi&&(this.renderTarget.texture.encoding=gi,this.renderTargetNear.texture.encoding=gi,this.renderTargetFar.texture.encoding=gi,this.renderTargetMasked.texture.encoding=gi))}};new O;new ht;var TLe="uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",MLe=class extends Sh{constructor({blendFunction:t=Hi.NORMAL,hue:i=0,saturation:r=0}={}){super("HueSaturationEffect",TLe,{blendFunction:t,uniforms:new Map([["hue",new at(new O)],["saturation",new at(r)]])}),this.hue=i}get saturation(){return this.uniforms.get("saturation").value}set saturation(t){this.uniforms.get("saturation").value=t}getSaturation(){return this.saturation}setSaturation(t){this.saturation=t}get hue(){let t=this.uniforms.get("hue").value;return Math.acos((t.x*3-1)/2)}set hue(t){let i=Math.sin(t),r=Math.cos(t);this.uniforms.get("hue").value.set((2*r+1)/3,(-Math.sqrt(3)*i-r+1)/3,(Math.sqrt(3)*i-r+1)/3)}getHue(){return this.hue}setHue(t){this.hue=t}};new Ht;var xLe=`void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 noise=vec3(rand(uv*time)); 10224#ifdef PREMULTIPLY 10225outputColor=vec4(min(inputColor.rgb*noise,vec3(1.0)),inputColor.a); 10226#else 10227outputColor=vec4(noise,inputColor.a); 10228#endif 10229}`,RLe=class extends Sh{constructor({blendFunction:t=Hi.SCREEN,premultiply:i=!1}={}){super("NoiseEffect",xLe,{blendFunction:t}),this.premultiply=i}get premultiply(){return this.defines.has("PREMULTIPLY")}set premultiply(t){this.premultiply!==t&&(t?this.defines.set("PREMULTIPLY","1"):this.defines.delete("PREMULTIPLY"),this.setChanged())}isPremultiplied(){return this.premultiply}setPremultiplied(t){this.premultiply=t}},BLe="uniform bool active;uniform vec2 d;void mainUv(inout vec2 uv){if(active){uv=vec2(d.x*(floor(uv.x/d.x)+0.5),d.y*(floor(uv.y/d.y)+0.5));}}",ILe=class extends Sh{constructor(t=30){super("PixelationEffect",BLe,{uniforms:new Map([["active",new at(!1)],["d",new at(new Me)]])}),this.resolution=new Me,this.d=0,this.granularity=t}get granularity(){return this.d}set granularity(t){let i=Math.floor(t);i%2>0&&(i+=1),this.d=i,this.uniforms.get("active").value=i>0,this.setSize(this.resolution.width,this.resolution.height)}getGranularity(){return this.granularity}setGranularity(t){this.granularity=t}setSize(t,i){this.resolution.set(t,i),this.uniforms.get("d").value.setScalar(this.d).divide(this.resolution)}};new O;new O;var Z6="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC",J6
vendor: 6,469 bytes, line 10229
10229="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAYAAAABNmBHAAAgAElEQVR4Xuy9CbhlV1ktOvbpq09DkiIkUBI6kxASIH0DlAQiIK1wRfSJTx+i4JX7vKIigs8HXpXvqVcvrcC9agQ7IDTSSWgqCQQliDRBJKkkhDSkqVPNqVOnP+8b//rH3P+eZ+199tlznVTlvVrft7+1T7OaueZY42/m37QALKNk2wHg1pITlB17mC+Pp11W3X/LHyT32vhg48/5SOv+PnwpsHA70JoGlueB1iKApeqzvOzn44GatTB76Xzhd7suBR7+WWADgDEAwwCG/L54b/poDLrHuvvm70Z2Avhsc+PVcxscBU8F8C8ADg5+ipIjD/PlGwfgju8B924E5seARUfLsiNmqQW0IjL8+7L2NYD/7COBzfcCm+aB8SVgdAkYIRCXKyDax4EdAanL5PuNPllNvXDlAHwFgP8AcC2AhRIoDXbsYb48dl5WkVFTE3LGDcC9m4CZCWBuFFgeAZaGAYJQQCRqDHT+McJrVb8zwATUXH02MHYfMHEIGFsAxgjApQqACYQORjtd/B7Axt/z79sC0+cMPgjjlwPwVwHcA+DfAHzTxcVgWBroqMN8+cYBeM71wH0TwKExYHYUWCIAHYRLTlkCYgcIBcAgU/n3qy8GRu4HRgnAOWBkERhddPAJhGJDBxkvw7cqimr+zFM/ZLnZF64cgL8BYD+AWwB8x/dlWuWagHiYL984AJ/0RWBy1AE4AizyM1yxYAcTigW55xMbAkxEiwEdkJ/ZCQxPAiOHgBECcKEC4TBZcKkSv+mTieNcNPNC26mLNsj45QD8LQDTAO4GcJt/7iw2bfoG4WG+vAGwm9ExiEg69zpg/wgwPQLMjgALzn4E4aIzoJjQ9g4024uygkj+pyuAoX0VAIfngOH5NgCHMhAm8Sv2y3XDZeBhNIp8OzJE8OsBzAKYBHAXgDt8/4O+MVT0j4f58o0D8Pxrgf3DwMwIMEPQEYRkNwfgsuuDZLskip0No0gWMD/9HGDoADAkAC4Aw/wsAgZAgs2Z0ABI0GU6IVmKv+f28KDnHxkA/G0A8y6G73N9kOCjXnh/Ebb6OvgwX75xAF5wLTA1VIHPADgMLDj4yIA5AAm6aCUnv4oz46eeDwxNAUMzwJAz4BABSNDFTwSfg7DDKHE23MG5PqIY8A1u/dINs9dBdy8AgnGPM2NfUBrsnw7z5RsH4IXXAAcJviFgluAbygBINnSLWOAjGxJ4pgOKDV0v/OSLKp8iGXBovhLBBOCQM2ACoTOhnYrAdItYbCij5JFzRyIAqRccAnDAQUjg6UNQ7hsMXP0cRQAexss3DsCLCECCLwCQzMcPwUi2MwAScAKbfnY/YRLFQ8DHX+IAJAMSfDkAF13kLvleIjhjQQHxUVS3jjgGpKeeNzYVQEjgUS8k+PghONdhIwAP4+XXBYCHKIJbwJyDTgaIAdCBJx3Q2M8tYAHP9m4df/ylQOsQ0JqtRLCx30K1wtLBggScQOgsKBGcWHAJeOwRC0BSM1mQIKRbhh+Bj98JQP6t4U0APEyXXxcAEnxkQAFwoVUxID9kvQg+c1C7vidRbIDkc24B//hTQGumDcCWA5DgMxASdNIFBUI5pCML8v8API5zfEQx4BudgqiczviSnJhQwCP4BMCGl+wO8+U7AJi/W4O4YS6+pmK/2ciADsAOBhTIIiAJnPB7AvNjP+0AnANaYkAHX2JBAc+tYaJXOqBZv24Vc386XW5dtkHGW+4HFAJonpOe+YYQZAShgKjv3PNvPQaxVoI8zJdfFwASfPzMUwS3Kt1v0UFIlos6oDFdAGFcliMAP/ryAEAGNwQRnDOgLbdlIEwrIs6AZ/QgkMMHQF6ZAKQcJAsSYPwIeAIk9wJgoPK1gi7+PwF4GC/fOAAvIQPSs0URTPBJ/Pp3GSEGRHfBCIQ0xowBtUbcAj7ys5X4Jfu1HIAGQrIgQRXEsAFQIORDFhiDY/rMHmrU4QUgR08AkgUjCAW6CD6CkwBsAIQC4GG6fPMA3OXiNzCg2I9gNCMksmAAoemDzoimFwL48M85AKkiuQVMAAp8CYRRDAt8GQiJ67N6GJODAXAHlsGguscA2AJg1IPGYmxOpBxFWkRN9LsATgIwXnNs/v/5z/9XCf8BO3YAtxbc/46/KDt+5+ea1Yku2VUxHz/z0v24FwMGK1gWsK2OUUxHHdCBeRUB6OxHABr4ZICIBd0QWSF+XRdMTAjgCdTrG9cBNwE4F8CpDkICyYLGsuhFt6zs+gISwUen8zEAjgMw4cfx2H6O/90yAFo84Cbg4ID3/9TfLTt+5+ebnRABkODjx0SwPi5ec/FrYpmqSAxM8Dn60CsqAFI6GfhqAMiDE/gokmvEr0C4PgDkBQm40wE8zMFEUDKEVoxIMLl/KS73mE7H9d+vcKHQQcjwW0Yu9nP8m8sAmOIBuWY6wP2/4s0ezjjg8TuvaR6ABJ70vxUApGrm7EbGE+i472BAB+WHfqHS/eoAaEwY2E9+wLSXTqhI7CXgnB6LCoOJ4BiST+hTnG0HcCwAglCx3ARoZEVFXnBPp/O/A/hXACc7CPs9/i1lAOyIB+RDX+P9/+pbQjjjAMfv/PL6AFDs1wFAgs/9fgKfgdE/ZEpuiQlbwAde6QAMBgiRmsSwA9BY0JfjovGRDBMH4TlcXGhcBOc6HkF0gjPhZgchxTLZMAci/04W/B6Ab3t09EPXcPyflgFwRTwgJ2MN9/8bf5qFM67x+B/aW4XQz42FeL0YrRyikztUFw0704mf9kXgxhOAqc3AAsPyRxxQCs/PdXOFY0W1KHy3QIUGtx+6vdnx1vsB+dsTncm2AogglFgVEAlUWrOMB2RyEmMCGQ/Y7/HvKns6tfGAnJQ+r/9b76oJZ1zD8WdyQjYBh8aBhVEHjELouQ8ukQ7VRSCJAALwkr+sALhnGzDD3JAJYJHg9uhoi4bx8ytkWUtvHT/7+Zc4dw1uZ3612fH2dkQf7yxIEEockwkJQn4IQoq8unhAhmPRKKFx0uv4K8ueTs94wD7u//VX9ghn7OP4c+4G7h8HpseB+dF2AKlFLwuAIZ8jD6NPrOhAffmfA9/ZBuzZCkyRWSeqBCWyoYGQ5yQrBpDbum/ME1HoPo0XEkSD2zlfbna8q6+EUJcTCxKEtHL5EQjP6BEPyIgYAZBvYt3xHyx7OqvGA65y/7/9wVXCGVc5/sl7qxD66dEqiYgRzAqhN1A4CBNAAlDyAFI+iZ9/N3DLJuC+jcDUBmCWyUnOrmTYCMIOkNclLg0B8/RsNLg9+UvNjnd1APLmmQpFHyEBROuWACQT8nN+H/GAvY7/VNnT6SsesMf13/CpahGnZzhjj+PPmwX2MYdDIfQexWyBAwEUOQDrRDN/98p3A7dvAO6fAA5sqHJDBEAyoUVGkwEd6HR12XU4kwzfl6fCXTZzjy57vvnR513X7Hj7AyDvggAUi9EyFgiZqNxPQF6345nOWbD1HQ/Y5fpvuLa/2+82/vNHgAPDFQDnhoF5j2C2qBWCI8bw1eRw5CL5l94L3DEOTI4DB8Y9OWmsEu/zBJ3rgsaybqBob/7A4C7jtWcooRrczr+u2fH2D0AOQgAUCxKEP7aGgLy64+m6KdjWFA9Yc/03/Osa4glrjr+AupqHz1sEs0cxG0BC9HIePLoit9eNkVf9L+DuUWByDJgaq4ybGYLPAWgiXmLedUE7dwC7saL7CqfPKXi4NYdaykCD410bAHlDEsNiwZ9wAPYbkJcfz6T2gm3N8YDZ9d/wHxUA+739fPwXPrSKYGb+BuP3jAFDElFH9HIWwbzCIGkBr/or4J4RYO8oMOW6ZVcAuvi1Cgoha04BCwT5gfMKHm7NoRde2+x41w5A3hQZkADk5+cGiAeMx3+/7AENFA8Yrv/G71cAXFM4Yzj+otOAaQLQA0gZxaIIZtMDFTigKJV8H9Iq6aZ59ZXAvSPAvpEKgBTtBODcSCWCZeRYtpzrmLyeGNCAyFl1v+Hei8qeb370Rdc2O97BAMi7EgB/2QG41nhAHU9LuWAbOB7Qr//GPRUA13r7Gv9FZwIMoVcEswEwfDoimEP0shKKtIphaZQAXv1+YM+wA3DEdcvRKkGJADQQEsQuhi1Tjt95vBsh5nx2IO59SsHDrTmUOStNjndwAAqEry0IyCMICkOyiuIBNwBvPFQQT7gBuPjc9oRYAIHyOEL4vIFEYVNaOou5vCGE/tV/A0wOVcnpzI47NOri3QFIBpSeaSDUdYLOSWvYImSGgftpJDa4MWJbAGxivGUA5MAOc0Be6eVLj7/4Mk+hzCOYPYpZDBiNkLh+G/M3yFyv/ltgL3W3YQfgcFUhgRY2PwY+Z7/EhAR1SFyXCOb57r28QfQBsJQBMn5D4y0HYLPje9Cd7RIC0PM3EiMofF4gVCBp1P840ix/gyz56r+vAMjk9Gl375iB4+CzveuZdLkkEPJ8ZEfX/6R73vOjzT5Si9hucLxHAVg4PwJgRwh9CKOXK8YA4ZEqKZXSQWh5P+5AftXfA/uGKvYjCKn72cctbFrZNECka5L5CPwIPtMH3TVz17MLB5gdLgA2Nd6jACycHwLQxFEUSR5ASvARDB0h9AQb9bXIgCGk6lUfAPYTgEPAITKgg1BObk58srTJgG58WMkWMaAbQQT1nc8rHGANAJsc71EAFs4PAagQestgC1lsBJ4BMCSOK6dDUcwqqaFiQr/0QeAAAdjy+jBiQQeeMSBZT3nCPUDIa9z+/MIB1gCwyfEeBWDh/BCAeQSzgkjFfGLBBD5nxQ4DxN0wv3hVxX5TBGDwL5obxvVA5YqYL5BeMLd66YYxJpRB0gK+96LCAdYAsMnxHgVg4fwIgMrhUPKQ2C+Bz0PmBTqBMQehAbDlIjj4F80KJguSVZ0FuXpjoCOgXawLjALhbT9eOMAuAGxqvEcBWDg/l1IE05Ed0ygZnyHdz0VwCqEPIfNyx0QQvvLDFQCp+8nfZk5und8tXwIgWcHSNX0N2CJmnAl3v6RwgNnhl17T7HiPArBwfghAS7mV/hey2JS9FvM3BLpUUi1YwDRMXvkRYJoAlAh2l0dcZ04s6JUTDIjyBcrl4yDc/dLCAdYAsMnxHgVg4fxwKVwJgGEJNmWtxpQMpX9on2eRhVA+O56AjMfnP+e3Xvf3NwG4xIPTleiY55bpGh6UbafNU0l0z0p+5Jh5HqYJ6b51nP6XP8cx12XNHQVgIQB/bFPVg2OC7Q+WgVFWng/FvtWLI06uWh5oguKEcXVS/9sEAF//VGD7t4ETDgJbF4CNi8CGZWBs2fPL/H6Vwp2KEtVk4fJ+v/EIYPN9wKa5qu+IncfPwXHVZe/aOL3EbwS7xv8A1rQvnO0j8PArTgTGZ4BxFv9mIxhOCGsv+0OPYDRghcLfkWkEuq0+G00x4OtfDGz+d2DbHmDLjL8si8AYP/7CGIAiEEMTG92zXqSbH+d9R2aA0XnvO+JjthiIrOVDHHPOkBrzUQAWAPsZp3oPDpa/Xag6EVkLBK+5rAnJC3/nYk/APD704WiEAV8OTHwX2LQH2DgFbJgFNrBhjd8r79deGoEwsllgNBOzy8CdjweG9wBj08AIAci2D6HafmyAk4/Z7SJ72hGYRwFYAMDLTwOGp4FRFgD3HhzqRGQiyeurqOdG6r0Rm8IEZjzRlkiqCWoEgK8Axm4BJu4HJhyAbFhDxmbDGnZO4j0SgLGDkpibgEq66TJw/1nA0F5gdLpq+zDqFfd5LMeWqu5HNST0uJOIllg+qgMWgI+HPv0xwLA3gWHpW2sC441gCECbmKziaGrnUdMO4aHeh6MxAP4SMHI7ML4HGD8AjHvHJGNAgpDgY/ck3stipRemvVhc+uASMPUEYGh/9dIRgGx8Y+MNbR/00uVtH0wEx94j/v0oAxaA8Ed+GBieAYZZg5kADC0QWGOFzGJlcGPzl1BxNLXD8sk4xftwNAbA/wwM3wGMUmxOOQBnHXzetIYvibonmSiuYTNjriVg7glAiwBk0fNZH6+PmX9P6kfNmCXGpftJ7TgKwBIAnln14BAAYxMYm5C6RjCyCoOyr0qkD/c+HI0B8DXA8N3AyCQwesD1VQKH7EcASm1Q+y4CkN9pUKiVF5nLvy+fBbTUd8QBaH1HvNBROiZvfsNnrF4kcvPwpdsBLBeU18Nf7AB23Dp4ecHC8oBgUlJJecLS+7+WOpE3gbE+HKw+yoevCYkMGKqPJrdEKARutaFYRs1fiEZ0wP8CDN8LDO8FRqYq3W10pgKgfYLaYCzootgA6KXaTA90y374TKB1sBozy77xHFZ536utRgAmEaw6g5kUSFZwSXnA330qsOlfgHMPDlZesLA8IOjoLypPWHj/11EnCiVwkz7kAExtsGraYUWdSDX5TmsagL8KDBGA7Bd30JsW0oWivnEOQNP7yGTSB
vendor: 60,312 bytes, line 10229
10229R101AlZSUtGyfgZDkCWY1HnJdcBVe6325hTvelg2CQjZNDygG/2An0j1wKnL6y9vGBheUC8prQ8YeH9X39OVQSc7Mc6fCaKvAeHdCIVf4yMYCynTpX+nb97NJmlSQb8r8DQHm9YOFUZTKOzoXGhs6AxF0HIexcLBvWBuiHN8s2ne98R3qc6L4Vyb2oBVjfm9MIFHbjDCh6kPOBbQoG+oW8CO5bWVl6wsDwgfr20PGHh/X/1iaEIuDcCTIW/1Q4rFv8OnYiW3c+W2iKwUjKbyjQNwL1uuR6sAEgDgq1brXOmV81PxhNB6DUDBSYzQJwFtz623XcktX1Q1VWKaTF/zZhVazBVYA1tX5MazsGvobwe/jQr0Ne6BTh5uf/ygoXlAfG60vKEhff/rSe1i4DnTWDUACY1guFTDqLYdCBvf6DJYSMYATBfOx1kLfj1v1axH10nQ3Sd0GUkBnTfpemtBJgseIKQAHLQcVxa2TnuMW0Aqui5es8xBIegVdVVE8VhzHnLh65WMB9An+X18K6aAn2tO4ETl6vqbKuVFywsDwhevqg8YeH93/Rk70JE90nowxZbIJjvS3WYNSGUwGHJTpPxwwcbBuBrgRYBeKACn7VtpdUu/c0NJxO9BIxcKu4TTODzbkonPLoaL0vyUQRb2y8HsL1ckfWzMeuFi40Qezqi+yiPhyt7FOjr6/gCFwgP7Xb5vssTFt7/nQRg6MGRWmDRoeyTlpgw68GRTwgZgo1gGmXAX6/8dtaylSKY/koyID9BhzML3q1gAos2AcOrZYSoq/pJp1VtODRm9Z3LS/7WjVkvXOzEtOpKyGrlAT+4SoG+VY8vBGCvy/dVnrDw/vee65NBJiAjBIVcAJQjOm+DkCZEeiGAMw6sAwDZsJrAdhFM9rPGhd4904Co5oVuCZPV6kD40Ec6+9W8dBTBsfdc3nkpvnB82fp2RPcs79dHgb51LA9ofsDV6vut5/3PnxcAmLVBiDqgevDaJLkYrpuQxzcNwN8AWgIgRbB8loEBzXDwl4cGiDGft58SCOWGedgjvOJ+bPvgRkiuA+ZjzhnQQOiFNVbloa7l/fos0LdO5QENgEXlCfs8Qbf7HyMA3QVjYihYhLENgjX9y/qwxQmRU/asfd0ZcLU2CHVGyusJQLKfVi98CS12T5f7iECkHpsMkAhCF8+nshWH2I/jXsOYO144GV/9ApAIrS3vt4YCfetQHtAA2G+/4PW4/2PPbzMgmUMi2NoeSCRxIt2/FvuxWURIWCXg357gfTjEDNIHnTRXRCpH5ugKwGl3HpMBXQc0v6WLYVm/5limj04rG762K2uYY9jBkr9+rI03NL5ZbczS/dJ+LQyoga4o77fGAn0NlwdMAOy3vl/T938KAcj121z8Bn+Y9eWQJRz8Y6kNagDh2ey5EvxjxQD8TWdAuneCCO4An1vw5vdzQMmdktwq7pLZQR+dM34+ZumAxvY1Y04uqOAJ6FsExzeto7zfAAX6GiwPaLWR1lrfr8n7f/Rl3QGzmsis+/uO71V9OFgP2gpPhgr7TGRqRUT6dyvr4aIs/pm/2zVUNbBSv6G8e5pEv0Cvec7Po7+bTtjlBRlkvAMBkDeQyvsNWKCvofKACYBrre/X1P0/oWEAnnFD1YdjhtXxR73mX10FfCHHE9pVWcGAI/S0gKsfA2y+twrFZw6Hxf/F0Pk8Ri/kpGSnMuDx5T0iACgQHioo0NdAecBUHW6QdsV2/cL7v/Cyqr5gnc42CCOcfX1VIZ/V8We9IDmTzVXwPDJiXuKXPxtDBma8+lzP4WAgKkPxCUAPE4v5GzEuMX0PYJPLhB6FJsc7MAMmkVxaYC/K9gG+F1++8AQ7Gwbgk78I7GFpXgIwFiRXOwaJZPUbiR0yCUDRk+cHf+YpwMj9HgfI8ClGPyvsSiH0WSKRuYlitLb/zHM/JOSs5C/YIC9cMQDZr/dwxgOW9gtGYUBi0wA8l304vDQvAchilFbpIBQhZ7Ejq6ZQ0/Yhil8y4j89Axie9DAsD6FX9HOK3QtROTFkviN83kG4felIY8DCeLrSeMDSfsEovAECUFsTjHD+tcB+tkFgcXKvBRir7qtFl9owmO4Xy/1G3bAFfPrZHorFNWBFwHjQAFctIghj2kBarw06If/+MM9ZqTN6DgsDojCerjQesLRfMApvoGkAWh8Ob/tgAPSKWCp8ngNQtadjmTdltvNvn3peFYhgQQgh+iUmEaUAUoXM1yRLmWuFLaE9Z+XIAWBhPF1pPGBpv2AU3kDTALzwmqo6qtVh9kJErAudABia38TC5wJgS2xIhAwBn3yhByL4EhzXfRXxYsDTJ4IvrNN2JFMxZcBzVo4cABbG05XGA5b2C0bhDTQNQLZBYH1AVsQSAAU+imI1obHyblnjG/kJk3U8BHz8xVUQAhnQIl5CyNgKAGp5LKSSCoAySh5Jj79vTagcxUaIBeRNe79g9gq+DXig4wGzy+PONfT7RWFA4noAkGXZVAhcBckJQgNgrLiaNb3paIDo1vHHX+oA9LQBi4DxJcOUPJUnTgU2NJUyROs8irGARxQAC+PpCtsFd40H/AEf0gMQkLgeACT41PiGoLOKqyrJq3K/Ya9mNyr5FusN/uPLPIeDa8Bc+w3rtyl4VFHaMZc3i9RWBM9jjzgAFsbTFbYLRmm/YBTeQNMAtD4cBKDXBTQGdAB2MGBo8SCLmEuS1AFVAJ3A/NhPt0PoCcA8bSDG76XI7aySg6JYuGfKwJHFgH0E5B3ueMCe/Y4L+xVHAOZ+9EHcEgQgwbeiEYx6jwTdz4qfu7EhEJqxGqruf/RnHIAEnxgwBM0aC8aUAYWNBRCmoIll4HTqO122QcZbrgMWxtMVtgvuOx6wa7/jwhtoGoDWh4MBJ16WN4lfr8AqI0TVV1O1fa9BbQzovkAy4Ed+NgCQUSxZCFWvCOaOFREXyUwZOPIA2GdA3uGOB6wPaOz+QPv5S+MA3OXiN9aclghW+d3IgupBF2pPqxcxGenDPxfSRh2ASiKKiVP2PaZScvAKoA0VDc6cOlIB2GdA3uGOB1zR77iwX/F6AFB9ONSOQW0frA50sILVcckWJyIDSgwPAVcJgFbYuZ3FJvAlEHbJ3IsgJLGedeBIA+AAAXmHOx6wo99xYb/i9QKg2iAIfDJEJHqj4SExbEty0gkdhB/6P9oZbBZIGiKYVb9GKaN50lRHBLOvhDxh/5EKwDUG5B3ueMB2QGM/grb7/6wHAPNGMAY+GSGUjC52VX2f2CD4+HO0gqkZfegXKgBaHkcWtS0AWii9xG1ImrLlN5XR8L8fmQD05BVrmEENmpYSP9QX+KHiqj2/82+HqqDWwnbBRfGATdzAegGwru2DpRq7Mzq2fpAf0Nq0Rl2wBXzglZ4yUAPAmDSVWDBPHQjLcgTqOZ6zUvdKHh4ruDCerox/Dnu7YqwXAC1NI/QcEQuK6WK/kdgCTGC0PYAP/KIDMBgglq+hIkrOfsaCviLSofcJgJ5AdM7kkSaCj/HqQKVIGvD4swF8bcBjmzjsaQ2H5D/6acBd9wALB4DFWWB5AVherMp4GKIYEOp7+26UF0aSfT/xYuDG7wDjrIpAERytXf2vajj7ueryQXSFl10K/ON3gIWDwCLvjfGB8Z54O+Ee4ve6513uB2R1yzsqC+twbC8HcNVhfAeaBuDP/TvwtS3A/ePAIfYFVlPq2HHTuyulZCTlhbjhETF5yxTQGgPGhoHhIWC4VSXGD3n0tLkMHXHxu+YyB+MlPwDuZs5K6FlsbCzdVO9DuKfkHM8AEkP7B8fOkwDcD+B7np42+JkGOvKdAL4E4K8P0zvQdET0b14D3DgB3D0B7B8HZka9WzrD88N6sFm+YcUjrn7E1ZDvMtF9DBgeAYaHgSGB0PNHCD4BLwLRsByAyX/ij0/dDUxuqlIG5hix7eFhvLcOVUAtyPSydAFmOQNe6EYGV/9ZESiKgIEgtbaD/gHALQC4ovY5r5KwtjOU/XfTAHzzLuCmIeDuMWDvKHBwpMoN0WQzNtAaYSs0K4ZlOSAjGG9kPjCBRwZ0ABKEBJexYAZEAU3A7Oi1BeDym4EDnjQ1TwCGWMW8MXcKks0YOyZNlQOQjcgYIUHllEzYQ0ktm+r6oz8G4F4AXwXwRd8/kO9A0wB8y65KmPxgGJgcqYJTKYpTv2CCzyddQJRDOjKivn+Deh8BF8BnwBtaCUA+YYEyAU8h+c6Az9gNHHRmrgOgmDA3jHQ+iWupCeUAvNSrA9HNwqx+muk9nJVNg/CTfrmbAPwbgK8D+PcHkIibjob5o13A3XypWsAkG1cPA9PDFQDZM1id0i1KxsWfOrKnAFXlifCFFMMRcASigOcs2MGAIfE9iWXplS6On7UbmPaUUTXQrgsVMzcRj5Folg2V5ayUA5BWYKwOxKUafnosWjcJwk+7W5F2EKvlE3xcXaNYfiCYsGkA/smuqug6hcleAnAImPbO6YwRpMgjCAVAm/yQmKTv5hNsAf/i7SyNBSl2a8Qv/4/M1yF+BZSYlNQCnnVrpbC+mToAACAASURBVJcaI7sOSEY2NpaDXLqpR+vE/OVksDgImgGgghHoYJbTWc7oJtFWc65/cg2AYvh2ALsB3AzgVv95nS/f4QdsIkT9T3cBrGtITWZfC5hqtQHInsEGQn3UDDvEDEY/ICf7SxMOrAg8T+c00JGkvHGd2DABUYZIAONzCUDppCFhSukCBsLQrFtZe/IixYQpSyEoJoqnuPWrVRAubQh83HNlZB23z7j1ywmj6CIIqUPxw2Xeu9bx2jx10wz4Z7sqTYZaDD8EIDuoE3hMVEphWg66JIp90k0sBxBcy+iPIIaT1RtEsHS/yIAqw+VSNPWQfe5tlVEk8auXgVa5BUsEJuT5uoliAbE5AGotmIAjCPnR9xDG3TQernYAUupTdBGEFMf83OkApHG+XlvTAPwfuyrgSZOhas3u6cwTsUBVn2gTwyFMi8wjHZAA1M9fYGHDULJD1m8Cpa8fRxDad+l+Ykf/3XNvd11U+qiL39SxXevSsshdDFvgbI1O2AwAtRZMZzTBRuDFjxe1Xg8QEIB8yyj5yYIUxfQIkfkIRnmHCM712JoG4FsdgHHp3ACoMH2G6jM4lWzoQarSvwQ6MSB/vporVaFkh+mCLlpVR8Z+dqDZLoDOpHSiQeAFDkBjPrlgCHgCUaFifg67H/9uYjn4Ai1vpTERTAASBaoQJBAKeNqHlL6mwPDZYAOROag/EYRkPX34MwHIvzW9rQcA+TLpI22G7EcQKlJGsYIJhC6ClUMiXfBTbFUQAej6nPS/OuAl9pOOqIc2BLzg++3VmWgIEUz82cRuCAtLIHQQm0gO52uOAb22sC3JEWgRfPpZf2sQBQIgLydPEIFGwPEj8MlF2bSbsulghLftqsCXq9HGgHysznrGgi5qzTUTFH8FLhAUn3hIJwCN0HLncw37qaF2zoYvuKNivmQIuUNc7GvWt6sHNs26twA6vhyq8NEMAHlyntFrDCcQehyaPTl+FwAbXDcmAKMRThakEk8Q8kPg8SPL0qzLBl+A9QCgR6uZGs3vfHz8TtBZvkgGQrEPBVAUg2Sij50QAOjiVKI3saADJRm7dSLYWfSFDkCem/dhZeMy9pPY5QvSDYQyUJoDIK8qMezh3wY6fSL49PcGgCAA8pScJLIgAUYQEmz8RPA17StvGoBv39W24eREiBoNQSgWNI1HBkdgxJSw1AI+dFIbgOYmkjimQ1r6XXC3rAbCHycAgytohf8vsB/r2KRaRq7zpZ+D37HMX0s3DDcCUGLYaw53MJ4YUODzusqlGCQAOQCejuxA8UULUkxIwAmMAp8Wa3qkN/R9W+sBwOhIEPjk5SLr8HeKFbTQfb77csPIMHGl/4MPbReslPhNe4+MiTpi9AFGV4nI7MfvagNQLh/pfrYnDAS8aJQ42A2w4em2cAyWQUuJVQTGWLs1uL7DG9J1RjhA+jvYk4t3KXeMqijpzrud4At9z3XtP16yGfjKZmCGooYh1tZzvv8xXPFl4PoJYC97k9FlwZWD+Azi/deMZWeP13eQCGEyoERudChIjbb3mJYwH7V0QIKuCwj/gfMj0asn2I0FXRSHXfL/iRkNgLyeVj8ccMY//J1fyxzTAXT2+xoQViKYD/1hDqLxPiYxTgSvQrphphG97tz4Slqafnj7uk1kIQDZrvWTw8B3jwEW+RLxPgSiCERdPwPR7+wCPg/gulFgfruDkOMQkFc5x84e708JAMmCuRNBXi4TIg5CGRzGiBGE/D4E/C2r2vcAYJoify62i0aJSMhB+2IHoNwu0fkcjQ85pu3ack5nIBREqneYFyWLkAXIJHESe00Cyx5QyeL6F/tyEcDcrOW2n7fX8df0mME+/vQ/PQjhoy3gzo3AISYf80MQaQx1peH9wb7v2mrtmCBkIMMejp3jIJD1MsaxaMZ8v5N/67INAsB3BAYU4JL4DSo1J15AFPAEwuQHZJzkKfUAtOHLJSOQRWndBYQvCQA01cfnNopfsaCJaD2baBn79QjSTiOEP1EcawIpkq2kegBTNgHWEpOKF8Uwq2NRFPM4AqCf46/rA2U9/uVDvurB01zvAJpiiwOl3fEeciCGF+Ij11f+QkbSfMPfIzqw57mEFZ9Dl3Ps5HXWAYByHJAJKV7N+s0cCQQhwSlfm4lGZ0KB8C/rABgZUS6ZHITBSEhCowUYAAksF7cStWREyxRwtuPpOlgw+5s9sq6OaIJIIlUgEhA1edoTgHxa9HVw5jibZNF+j/9yGQA/7pbujZ4bwv2+cWB6tFo0NzYnkxFA+cvEAo43VBoEo2e+48EMXEOmD9F6xhCE8RwZEJ80VblKvDlmzwicfqy93/o+8K8TwB2jVSgW138FrJQTXBNlnJgmrjZwanow9CBP/rL9wF0jwAGWDtFyoN9PHutnIHT05mPXz93dMGQAPniJsjiBXiTbxDZFMF9NLUPQxKR5qezz1Y6/YZDH0D6GkdAkYJIvRalAdHAMmPZoYhb6NhDWvEyf/ma737CXN7R1ZC7hUbPgcFgqt/ZZjADnM1xqEVhYBpb4CUk5UsL7jQvj///5buDrLeCOEeD+YQchYwG9VIfyg1NaZszFiCH6DkRGLze5/dgk8IMWcMCjdCiCzR8od1B8OTwvJM8JEShFut1fzMhi+eRJr6LI7hYP2M/xVLwKNoZjUTwRMAQQmYyhWGQxsSADOflZ4kukj7PhZ75bETjBpkAGahMkcrGgwhsXeCyBHBj1wmOBQwvAwqKzoFeRV8ZaerjKYAuirmPY/o9X7q5Cyr7fAvYMAftCPGAEoYlBiVtFwLjtp2U4irj7yOANbi+crHyrfCbTquJV44O0F1FrwQGIMZFqdQDyP/gGSZ8TC0ZRRsOlVzzgasd/u+zpMByLehAfCgMQCDyGZJHFCCgLZ2f8mgI5qauEcVx9e5vACTgCTwEMWr5TdIpWKJb5MvrnoocDswvAPAG4VLGg6UKeqmi4iuDz4er30oX0FP7u5moMvIf7W8B+jwlUNAzFnlZCIhvGFRCeWzrgXSSIBreXTFZSgVLHAp4UHOFuociEEsn2PJwl/XEk0dzfSojeerFg1IOo5BKAveIBex1P67lgUzgWQaJwLAKRH04i14ItgDKEtGsRnWx49b2Vkk9wUefTGrKCF7R0JxZMqxN8cmPAxWcAcxGABKEAKPA5u9lEaAbCmKMI+sDN1X3z+ro24wEZFc0VEE64ABgT180PF9ZdBcDb6JpqcPtPk+1ACbmKjJnllwyuILunEAWjZHkBsrsRUnfD0qEiC5IJfyisgMhzWhcP2O14Ro4WbASgAMQJ48SJwchmBCDFa8qpyBbSP7OvU4PQ0p2W7+LSnSJUFOrI4V7w5IoBTQQTfJ6oTSYk2mQcpGRyH2syGjIF6EM3V/fM++C1CfwUExhCsmzCaQT43lZC3e1hBpEHh36XEqrB7Scmq5dV0XZxmV8WuDFzAF9iwhow9seAGoBcGtKjqAc+1l9rLb/1igesO55ysmCrC8ei6IxRMAKTWNBi6Xw98xNTFUi0jEcmpYgRAPhddpVi9OIEPP5cYD4CcLkCooHPwaW9kV+iwWrQHT8uA1fd3F7DFvgUHUP2k8jTiogAqLoxFpDgbMj9jXSuN7i9dLIdaxzBp5XVBMIMgFEnFAPKT9qPd6A9BIGI7MfPmf4U+40HzI8nWgq2PBxL4FEkjKJixGRRFyQQPzzd1iAUzCAQas1YOmAEoFjwkecDC/PAwhKw6CxIkCXwOdVJLxTobMjBdyIgfvimNvNJ7Evf4jWtdnRYD1YNGVuG93VWuWs4Jf+mlZCCZxwP/cnJ6mXVKk2+tK8lQQVHRTGc64SDAZB3Ey3JcxyACkToJx4wHl+YwqloGDICmYmTFgMQFBET8yyYzyAG/AfWX8mCGQg0BTRoHwt9KVaPE/HQ890AIfgWK+CRAaMRYnVdxHbhdY8Wslw1V93UDsmPIj9GxgiAioRRMIJNvoti+SW/Ikd0gwAU8+XxJcbGITJPDvI6XdCFREFSknTB83xka40H1PGF9dnycCxFwygkK0bASJQSVAbAYeD98xUAe5U3jKIwBosSgNsuABYogl3/IwgFPrOIg1Xc4ZrpAsSrvruykl2ucykapkMMh4CExD5DwJfWAYAxwk4MKPAJgOIjGSEGwuCakRhemw6Yv0UUwRf7L00L9pnsNx6Qx4feY4O8pDEcixOjsoTKKpMYjSFYYjOC8Eq3Wnnr0YYS+0Tmi2HysrPGLqwASNYzBnT2Mz2QD91laxLB0gs12GAh81cf/o/OcHyJ+qj0S/zxnhUZbSyYWaL8+Rq2S29wowiWkJPan4MvgrDDGAlRe7KIywDIgR3meEDWg9HbJgApNTkXo8o0i7oVgxnEgFr8F7jEdnU5GvqfJQKQKyEOPlsNIQvyvupAGHS/Okv4qv9oh+PHxMLk8ggBCRxvAmEN+AiEzz2iQfQBeNmkh4K52hJBKOaNe/FSLobLRXCz43rQnu2yi9oMSMDxs2jo8303ERz1wsCGZECF4kd3DwEYYwJjhoNlQrgIjlYodbBPrwMAZfEmyzcIv27gs6XDzC/IR1DOgA9a6DRz4wZAsZ+LYXvQYsHoD4ziOFklna6YD3+nnU6dZ7bGDAcBUImIAmEUw/zbJ1i/scGNDJiLXmle3RhQ+l/aq57gUQCWzwwBKPeLsZ/LFrGg/ShRXAe64Ajkv30kALAjF8R11Dy3K7KRwJcsUTaqWScARou3w/INVnCH+A36n8RvM3nB5XP4oD6DATBYwGb5ajlOLOh6X8JaBKRG77+7ygGYp1bn+V25/01AzBnwQ1ypanD7KWfA1QDYC3zJIj7KgOUzc9nFbetX/r+O5biwNhyX5uSEDr5o0xsJwLp8/m4A7GaJUv/j3/5+HQFYJ3oFPPkho/hNeqBcMkcB2BAA6XrxmMBkfFAci/m0JpwzXw0TXvXtzrz+PKc/Ml/ugzM9MDqCAbz/keVjjGcQA/YLvjoguo1mRslRI6RwfsiA5nqhL5D6nscF8gfTdfxpS+/hLzvWfzMQCoB1Fq/8b3VWaPIDZqsRV64DALsZHVHs1gEvsqFAeBSApQC8pHK90Oql4UEAyvCwNeGcBXNLOPMLftgZsI75ouUr9ousp2TEyIJ/sU4AzC1e+WIFshyAHPZREVwItrrD3wGAhibTYBhxVpe/xePyrNBuWaoNp3DgFwC81O+RAepK/a5Lfe51jxr7JwA83nPXYgq1asl0yX5N48+f4VEGLATlK1vAo5YB1gBSRmsM+NFE57lcfPD5pPFWCJImtyvGgGfOAacBYO59zFglgHgPefZsXV6/gPXBYeC0RVgyJNOGYuJjPka9eHWgjL9bWzhWk0/n/wPn+k8bgFNmgYcsVflZnBRmIShtJM/m7JGibGBoOIIez9wKPP4AcNpylfbNlGfdI+9NjBjz8JVzppckZuJ+dBw4aQ44drk6j1LIY9JkPD7P4s2lwVEGLHwJnncscNIh4Nh5YMsSsHm5ndOu1BGFThJ8/K6JrZtoslST2+XHA6ftB05ZAE5crgAups5TfaL6EF+UyIif3gAcOwtsXep82eIYY9JkXpMgMp/AeZQBC2b8OduBYw8C2+aALQvARgJwGZhY7swEzbNa88IRvAVO1qkF91J36DNOBE7eD2yfB45fqphLnevzdGeBKBfL8UX5/CZgyyyweRHYsFwxYHzRNK6oetSBMDLjUQAWTPqPngpsnQK2zgKbCMAlYMMSME4ALrcnR6JYQIwsoUnjpDRstOLy7cBJB4CHUGwuAtuW2nUDVH1EFUhycSwWjGD64mZg0xywcaECoI0z5P3X5P6nWlHdgHgUgAUAfOYOYMtBYNMssHEe2LgITBCADkIzSJZXpCOnIg25uPrhgnupO/TyhwLHHwSOmwW2LVSik2pCrDsQskzNIBGIpBdGI+VfNgMb5oENCxX4yPRjPj4xaJ0+WGeEHRXBDUz2Mx4FbDoIbJypADixUAFwzAFI8KUJChMV2SUaAGc1cE/xFJef3FYRti64nkqWDrqqEhbrsm5zvZCdPCd8nHzJOLZuABRz9hTHZwPL7LnLnoNMIY2VyaKcjtZLHOAbNgNPngKe4BacfGF1pnydD+hphQ/8XV5UiEueLGnDN1tWXj/3/4cTwAUzwGPcRcFJiDpPt3FLmf5vjwE2HAQ2zPrEzDv7OQg5OSM+ScYQy5Xbo8465u/ZfLTJ7fKHAdumKxVh8wKwealSE6inEoSy2MWCdbUHIghv3AqMzwHji9VLZuDzD8cXxxWZs5c7apmW0fMBnIHKn5X7d6I5npvRz94O7LgXuGIReJSb+Xl1tzqflybwRwqf9i97BQRWomWJQ7oZVFtJoqDX/b/oGODsvcBTATB9gsfGqmzdjtVz+G+PAyamgYmZCoDjFE2anCVg1CeJwOMnTRB/DmUINVkkgia3y08BtkwDW+YqAFJFMD1VAAw6XG61R31O9/fdrcDYPDDmY0zjc1UjivBuAMx1QdMB+WAYXU8dhEU16dOSkppbcHFSrng8MHwnsGMPcN5ypURHp2xMIa7zDz2z8Gn/kVe0YomO0wEwBYKujL7v/zHA6C3AxfOVh58g5AsZxx4fZM7sf3h6BcDxWWeGBZ+cMEFiwGEHHRnDzun7ONHs/djkRgBunql0VDOSHIDU3cxSD4aEajhFXS4H4S1bgVGN0V8we7E0Fh9jVDG6Obr1LJMRwn+kOCaTEYT0dsfqZHXl/p7PrLi9wIY7gO0H2yAgCAWCWCowKrYE8nMLn/a7PQn9X7zIJPPkCcK+758y7x7guNsB6l98gZjLLYet3Ay5n0sv4R+fCYxPA2MOwLEAQLIDPyP8uBg2cRYmzFweAYilKkn+OC8/Fdh0CNhEA4nGA40kd6FES13WLO8v1qHKAfh9B+DoYjU2Ak/js/8NAIwg7OUb7LCC+WAfB4CpBJoIiTRNRmS1l13kqWh3Adv2A8cdqqp1MB+aIOSxWv6pq5D2kkIAvt8rF7BLJksN/jMqfa7v+7/Ak4B3A6ceqpasKMq5akAmlLWY37t8ZW97PDB2qALg2BxgAFwANEGcnI5JcrDZRPlkaXL4u1KJUAfAjbTQ59x6dSvdLPXAgGYshZWR6JIRaXB/NwFI8C1WwLMXzMeSwLfcXuKrA2G+wrLCDcN/IIg4ERRn0qvyySAQX6mG1XuA4fuAbTOVwktRRr2MLCoQyvEZ/UY/WwjAj3jtFJZkU79g1ghkgEBf98+0Umb/3A2M3lkBl/fOcdMok2EjkZyv8773LAfgHDDKjwNwxEUw9yailpwdxBAEYhBbAuGzG3aKkQEJwAkCkOCjlb7Y6SYyf2UwlAS+vKYnAXjfNmDEX7DEfA5CjUcsnzvbu1nDtUMmCDkRZEEyGdlAk6G6lQTSa6m0MP6HuY73AxNTlcJLZ6WOJYC5/CNxLpHMgdKIKNl69Qvu6/75AjHOiTU87gKOOViJb748BKCWrnK/maTA+58AjM0Ao7PA6Lx/xBAupoYDC9okBRAmPdBZ47lNA/DhwMRsxX7mPgl+SrmK5EaRNRslXFQ9CKB9DkADn79cZtkHFkysJ103eBbqlh97DpmTQTYgk9VNxu+xYbXKU3lhFoJPOgdFGY+lPkgQxokkgF9Xgj4AvfoFs84eX4Ke9x9fIC+tRfDxvvniif358sSir2LCj5wNjBKAc8CIi2AxxLCzIAGY9L7AhGIKgpATw4l8wToB0JjPrfTkp+SLQbHrOqm5jNyajS6VCMIpApDAWwQ4LrGgXqzIfnq5cv0vN0ZXHTInME5GBNLb1DGdOYQsI7AfGKFjlgqve8wJwG4T+fuFAFytXzCLb+VgWnH/fIGYfc46Hs7iHC8ZkPcdXx4VfVXJw8+cA4wIgM6AHSLKWZCTESfLfg7WsIyRF3ckiRQ+HACXkwHptyP4KHrpJvKVGnOhRF9eBF9wE0mUEogz2wC+WGI/vVxiQQIxAs9+rmHA6E1YFYB8DJwQMZl0OrLZ++i7sfT8zroYHLS9df4RACWKxSZvLXzG/fQLZqk2gqn2/vUCUQ9UZaM9wDaPeSPrC4A5C1KV+NITKwCS/SiCR/jRBDlLmP7nHynsxno1IPwJSyRpbiMADXzuPDYfZfBTEoAmcuVQdiaW0zwXwQsCYDYmMaDA1wG8TBSvaoR0G77EcGSET6hjOvVApfRPAUN0zjr45JzVcSqiTxD+VeGzXku/4Nr7JwDJOkxFIwt6j6+RqUrlkO4bXzp1gCAAv04AzgLDDsBhKugLFUvQUhTwCEKbnKCw14HwJ9cDgGQ9WegRgDI8XEcVEDvAl7lVlglAgi+I4CR+Zf1mLGgMmDFhBGFfDCicRJFERviSABjLS7FC0MFKMU+07wOPE0kGvaoQgGvtF9z1/iODkwn3VWoEXxres5ib9xx1wZufBAwLgAQexbAD0JiQwJOuJBA68/H3Zhk6+3CifqqwWNMKN8wjKgbk6gWJgC+FMaBb5vJVmsUbV2vCqo3cRWZcCIACoax53+ulkqNd7iqOcU1WcC9cxEm5kQBUdZ+sTnSL/jEtTWngi21jhJNJBivZBukXvOL+yYBkcOqxKjJ4AGgxzMrBVwdAMmHrZOAYF2l6y/mwV6xD17zmWo6MbRyeWtOHwxJ91IIhr6rqZS70DPPLXDVUrfBwzHKr1EUp6/h0T/6L/GcCqslt4IhoTcwdAqDSs7I60WQH6R329pHuFyuXDJmEjuOSbdB+wSvuP5bGUjmsA5XoUvcvBXKKAQnApUdXwah0b8jXR2YzJTsC0ZHB33FL+2yiX3h/1YeD1fFZGT81g/H6yqkVa9YEpqMhTADle8erHA6t7Mh6j4ZBXdBGjFyO4CSIm9wGBiBvgqxwIAJQlXIyEJLyI/i0SkAG/FbhaEr6BXfcv+5dLKhCg4z1C1HEBJ8+BODQGZXfk/quAZC6ketAZEQCTWAU8PIJt0fgwHzZvVWNaKqi7JLOmtDWFy42g1FxH/XfqGkII0C+a0tnDkfsGxQjn3VPsk7tXmuy+Xp0JhtoJosAaFcUAJUYKiYJxcqHqKAH9rPlG2cMrmCUbMX9guMLpGTcCMKDlZGhMK8IPnPIn1X5PA2AwegwEEYmDGBMjOI5whGQP3NPBT7VJlRNaKvF4t2IWHbDErtDlSk1p4lJ7/zd246tglGZryIfrFhQ7pU8WCAX0ZENG+57U14Z4YrCeLrSxXdev6TfLwrbxT7znMrfKQXfHLQCnyvmRIv0Q3430ezMmL98P393G3wqz6am1NYzzoGn+svqRmTAU2citctqAX/2EI8F9ACEmLHXLZGoFxtSl2xyK2bAYwrj6Xr12+1noL/jUTCD9vvFrn6u0v1/nvGkaoVBAQi0eummMAuXQHMWJAA7gCixG8U0gFfcXdlBKk4Z6zELgAJfZEKrxpC1xOIl/+Sk7jkcdYlSco90y9+gK6vJrRiADD0piad7RuFo3udNCgft94vCdrGXn+tujgV3QAcHLcFnroelivHkchEL8ue0uQ74S3eubAITS3IQhKkMRjBMokgWG3L//2z3VSnP4VDgQWxUEEUxAZFHL0eR3HDfm3IRbDHkBfF0zy4EIKNhSvr9goGEBdvTz/MIYQLQdVsTwRTFDj5jQmdArRDYJQNDSs961R3tPhx5NXoVgoxleHnarjohgLec3D2HI492yQNvIwvqO9fJm9zKGbAwnu6FhaP5pFuMg/b7tTbpBdvTz68cz/zI8azVj8iAHTqgmFHXDUB89R2dtaC7tUGw4kDOgFb0R2wYRDGZ8g9O8aU4XwPOczhiwGlMjqqLWiFYGu570wADFsbTvaxg8nkow7E8nM/atfKzln6/1mS4YHv6BQ4+Z0BbqHcd0NwwYbVD3+1yWhXJxPBrbq8AqE/XApSqAxiBV2MZ/54DMOZwKE00rnDUWcR5KiV/brjtSAMALIyn+/mCyeehjIYp6fdrvVELth8RAClyHXxmhPi6r1m8FM0ucgk8+y4RHC1kAK/5XgW+2hZYofafWcPq1B5AqDqEYsQ3nepR2gqhV2yiol1COkD0C+aOaoGx4aL7DQCwMJ7uVwomn4fm7VrX2u/XAlELth+5sHPtN+l/Ap6sX2dCsZ/phZkIJgv9l++1wbcq+2WFv2NXIjNKAPzuw7MUAV8DTuynFIEsQy83RgTAhiv+NgBABaQOGE/3mwWTLwAqHnaQfr9GnwUbARgDNBUlkpzQboyYCyYDYdILdf0l4NduW9kGoa4geNdazLElKoA3Prx7DofiETtC6XvE7hGEzJlpcis3Qgrj6d5UOJoYDcMglrX2+y0NPtl5UZUjkfx/Hqbecoe0OZzdF1gHQrln9Bhee4s3f3Zxm4MvAk9VSFdUIw0i+Q2PaBtISiBSSFgCYMjMW00MP7pwvvLDmwFgQTzdHxcOSGvBg/b7ZRZByWYAlOERluKM3Ra9CKWc0q73dTBhMFT4ZwIw9l5Lrpes+HjeBiGCUOKXeuBvPcKTiEIOR0f+RhDBMYi0Lhea4GTaa5NbOQAVDzhgPB1La5RssV3rIP1+7yy5OAADoAchEHBkFbKfGRpiweAPtMs5IFNokyOGk/7rAYC9OhBFwNXVY1at5tftCBHaWVS2AJdEcEinrDNC+Lumiyc1B8AB4+muLARAXTDCWvr93lR4/Z0Xt6ODFQkj8WtumEwHTKDLQejAfN3uds/dfjoQdatGLxb8jQBAYz6/boxiFgAVudzNIc2/s3xLk1szAORoB4yn+2DhaATAGJCtbpkCYq9+v4V+aBgAQ4i66XtaC85YkDog/zdZvzUgfN1N7a633Xqv6fe9msDIHfNaB6Ay2JRE1AHAEDIfI5nzZCLeN4Nbm9yaA+CA8XSsul6yqV0rJ2WQfr+splCyCYBR/HJyKX4phs0PKBZ0lqOYTpvniAiUAmAd+HKjo1cvDjHgr+3wPJQsVCymUZrPMuRsRBDG4AQCsunyJtFGHwAAIABJREFUcc0BUJlxQoH62q8ST8cggpKNAFRGwCD9fkuvbwAkyGgJE3C+Nz1P1q9/T3F1EZBxvZh50s6AEYC5yyUHXt5/Q8zI5/KrAmAIkkipkyGPYwXz1aRT8v5ZO6jJrRyAvKOvNXlLazsXs9bo/ztc29Pohgotp5J49Rcj/pzfIwGS//3OM4CNd1dpntQpFUmjEH4LYIgnyn/OLjL8FeDGhwJbNgFjI8DIEDA8BAy1PFK7FSKf43cNKrvHx+8C/vmxwMgmYHgEaA35J0StpvvzL/nP8RbLAfhyT207TChgDRiu/ZL9DsfWNABvYzbhCDBKoBAk/pEobGWTqp819hzQ1/0k0PoaMDEJbJjxVZFgDad0SaUO5LksWVj+XScDmw5UEUDJ6U4d0nVbC91S3ovfVHp5al64cgC+k7mZAP768KCA0WD3A/ieLz090CDceVmlAuhBljLgrfcAw6PAyDAwPFwBkCAbItM4a/FiNtERjBl76W9ffD2AbwJDdwFj+6syImRXrd5Y2FjIYcnzWPLEqnsfC0zsr6qBMQmfIDR/pyJ6xMhKyMrSDiKD2xja6TADTt0/AGAs1KcAUCFrOLF6tbtiRVFavT/wuMCa7MfVTlH098YBeBcwNAIMEYAUlS4uBULOmK3LCnwOPANlEIOSoF9+C4DvVoWXhvdWZVOYqWgi3vOXDUQhgieB0EElViMYJ08HxqeqnG8D4IIDkAzo51DKQQJvBKUmKACzbM4+5hUivwrgiwC4LzvjmgCh6nBcgiMTcv9Abo0D8E6g5eCjfpUA6AxoQIzgi8ALmWwC4z//DxcPPwBak8DQFDB8yJPpPZHeGCyC0KN5DFCByfh9/+OAsekKgEzCTwD047X0SCPM1IYQjCv2E/MJoGVwUUQoPboq0MdqkWVn7RtDDMahB4g+P6qhXFpjVtkDtRGA2nKjos7IyOyHFUbIrXe0FXsTuzIYfNb4O2M3ATGIYQOmPn6hG6gi3eUkQQAeAIYOAUOzALMVh2pAlESqGFBAXAYOMQVjxll03iO/yYKRAT0FQXkwZkjp1pz51LO2XAT3KtD3AIAwj4Wg05kfiuUHYlsXAJLVnP0INLM0OYFx78AzcRySeTsw2AJueI+Dj2Fne4EWKz5MA0MzDkCCkAByUWqsJzarEanzj2zXwjEGFHuGY+pYsMojzZL1G9EBexXou339IRBrC3lJGmNDuSHX+w7WC4Cm6wWxm8DngLTImgC8pBcGBuTXf/1fXnyTugnFwxTQOgi0CECyIFlsvvJfEnh0mhsYI/s5uxFYi1xZof7oOqSAawwYjRGBzYGXbtWXaCIrlvHUagX6SP/ruMVYCEbEqECXAMjfree2HgA0ESur1/0vtnNwGSsG0RsZME20/+/XWH6Mugk/yngPAGy5GDYALjiIHIgRUIrsZjM7Ax+BSx1S4pfffQVIep8dL7dMDsTGjJB+CvQxTHmdtrw4l0CovFruC2NOe975egDQsCXRK/eK634JhBK90q2C7I1i+Gt0jxF40k1cPJAB7UP2m3MGJAAFQrGei9iUTH9yBUDTHfU3B5+BOIKQ43BWtNtPcWIOzEZE8FoK9K0DCGNxLi3FqaKA9gTgeoFwPQAoI0OulWT11oEwiFz7cwbErzNxWtEYBB+VY76Vh4DWrH8IOoGQ7Ocg1CqMRLPltmxvs1/SHaP4dcAJePYyyUCRIzrTB8tE8FoL9DUMwl61kQQ87Rmy2PS2rgB0a1ci18RudEJH57OsY02y/+83/sZdBKr4FXQTApBvprGgQCg9UEAM+h9F6ugJDkC3gJPBEvRGrYoYCBX9IxEcS5K4i6cZAHIw8oXQ4mLBb35YH5d7OekadtTV1UZSjaEIPH4nQzYNwgjAHNwDuWGYpZc7lzPfX1cQur5oBorfzDf+zi0yVTuSkuxBI2Q+PhQDIUEnMLo1TBCZLufGw/ixbQa0KB8CTODjPohdY78IQmfDjmW7Yo/doAX6GqIiAtDHaYswSmeMubV81kp11L6hy2PdAcgblfslOKC1IiKRmyRxZgV/8++DS8BFrxXi5Hd/U6MeSKdqEsEKhpBRsgRMbAtuG4KU/+9ry5brzP/lPVMv1EPOQegharrVcgZUhVHFxNPcp9VFtlOWkL437C0WABWypFRGsV0sb5Hn2zYBwvUGoKl10v1knDgo0y7XA8Pfv0UACnjaK33Co9gJQAOe64FkNvtZAHQdjz9v2Nz2GSa3jYej2W3KGuZ9ixGdIVSoKT13B2s5AHkGheST6qn0erHv5AIgAAU+LVfw/wq3CEAV7clBKDDGZG9/5oVXx/oyYARczcqH5GyH8eFplTawFvAtrtXLGpNrQDGbejupB3omlIHQGc/ErzOcGSRs8zrhAbbuL1Tco/JfbLlNwHOmi2kIcs3owbdwNpYtynDQhsFcgvuG9/YapGFvYX22zZcAU0/GwA2LJ/4AmGF9mwEbBu98Y3cMF+uAGQCj2HVp3BbPuo3IlqxAy5wHAq4OfARmEBXGfNIBa0BIsG0ecwC67merHgRpZLwocrWaovuTxew/V0txJQ2DWeae3WAGbdhb2DB4+wRw7w5g8Qpv88liyGtoWHzMi4C9fAEHbBi8kwUKu2xNAdBxaGBLbJdZux1LwAGECYAEm6wyfpelJrEgFnRDxESwgyUxIUsVMwjVy5AYO0bG89Auu1/5BF38KqjBHlUAYXsteNCGwTeWNuwtk4JMkrlzGNizA1hm69g1Nix+zDOBW0aBeRZZGqBh8M4emfWNADDT+zqMjQyESdQFHfDbZECCLRgdHeCTe8CBaKJY1rDnBRCIAuGW4TYAZeFG8ZuMkGiQ1IEwGCJtHZBmy1obBsvVMnDD3jIAerti3LEBOMjGcOpa3WfD4ic9t6oveDtLfw7QMHjnH6wPAybW6yaG4+8D4HIQfvtDIVtLejpBFsVvUI7NIBHw3DUjRzL3rDVtsYPOkAScuX3coNDynT2VYJCkn+PjqvUD8hVbS8NgjphGxcANe8sAGNoVY/824BCBtIaGxRe8pLKZdpMkTvXiJ2toGHzSNHDPScAyq3er4qPyGaNc7JCRXWLT2TjwGmCOeQashq6+qSpZmp8vojQpheF58ncdZVjLnjWPHr4VWKTKxrHGUqq97qXu3jp0wPy+eEC/DYNZsZAO6IEb9pY9lNCuGPcNV830ZmkM9dmw+OKfbdcXvJMPdY0Ng0/7GnDXKcDMccBS7MwdKz8KCAKQIgY0MWGCtr4TOHAasMwOkTqf6unyuLykfd254nkb7qsw/iVg7jhgmSX31Vpd9yRHeLx+zRhjEGRbB6wDYT8NdymyubzDzCCGfpMJWfSRYfr9HP/aMgBm7YoxNQHMbQHm+ID6aFh8yS93tAvGQb7da2gYfPoXgbtPAqaPA+a3AEubgGU1RM6B060fgkRoCzj+TcD+04CFE4BldZdRc4/YxlxgjJMewSiwN1zWfsOngdljq3EmY08vm5i/7j5yIMqpvupKyGoNg9lngYosl9wY/0dZdrMzYl8Ne8sAWNOu2MA3zw/F2CoNiy99XbvftrcLriz6PhsGn3U9cM9xMODObQYWCMANwPJ49UliuW6SaqqBn/gGYP8pwPyJwNIxwDK76ahDeN6uXYCuYyABkEza4LbpY5WEWdSLxjF26/dQB0SJ6r4ByAN6NQxmkWcqrnQ00x1DEDJFjR8CcNWGvWVPp6ZdMQ6OVOCb3wAscPJ6NCy+7PerkP5Q3tBY1PrT9tEw+JwbgPu2AlNbgVkCcCOwtAFYcgAuiwWlM/XqDjMEbP9t4MB2YO54YJFMo/5gHIcALV1TRZ17FXOhPtvgtvkqf9H4kvHDlyKK4l6VzvVSBF22uwjOb7pbw+CfcwBSkyeFEHAUx/yw9JTyEbo27C17Ol3aFWNuAlgIn9QxO2tYfNlbK6MvaxeMRYquvL9rTcPgJ30TuH8LcHAzMOugX3QALo21WXBZLEHwRF1OgHS2eOgbgIPHA7PHAezNu7QFWFZ7JnXJ5rnqxHEulvlzwyVNN3+wern5Yovl7SXLGwvn4riLWO4fgMRJXcPd/+pmOymELEhRzBxJAo9gVL4kwVnbsLccgHEpWi3epocCAMeBRU5eTcPiy/6qtl0wpvhA+2gYfO7NwOQm4OBGYGaDs+5ExYDGgqP+ccAkINaVpB8GTv4d4OBxwNw2YGFrxYCmV0YxLNYheCXau7EhV3ga3Lb8g4+R45uoGLADgHWqhsBXA8K1AZADyRvuvtkBSArh+i9DsQhCOtf0UUgW/7aiYW/Z0+nRrhizoxXwFhyAi5y4rGHxU66qAFhT3rDSIVdpGHzencDejcDBDcDsBDBP1uX1CMJRwFiQIBzxieL3KIY1YW5MPOxNwLRb8gs0aghAss1GZ1O+SFHsdRPt0i/PLHu++dFb/x4mXfhcbWxhfCtYMFr/uWvKxfDaAcg7ipPCvFOVpuo3HrCjYW/ZA+rRrti6TS6MVQ+L4NPH2nx698GnXF0BsKa8Iab4dFZpGHz+JLBvApieqAA4J8CPOQuOBBAOV0CUYbIskRkAecrvAdNbXc/aDCxSpyT4CEIyTgRgneiLIp3nP6fs+a4A4N8B8/48CUC+ZGJA29fpuLmxJW+5h5kNFg2jiWHSi0r0Uv4pCoZsxw8DUfnhd4Vk0XGdGvaWPaBV2hVjdjgA0BlpkQ/K9bmn/HOVqtClvKEBqlfD4AtmgP3jDsBxB6DA7tdbcvYzJvQJkii2n4NOeMpbgJktbYPGACiF3wFoEx1ZMNe/4jnPLXu+KwD4t/5SO/iMBcXuesHylyACMBPDgzGg7opM8mEHIGdwrfGA1rC37AH10a64Yr4APvvOSdwEPOVbKxu+K2pdKRTmdI3dqkPPVgbSTBGAY8AsATjWniBdx0QxJylOFCcr6HBiw1P/CDgU3EgEIMW52M8YkLolQRddIN1AyKWiBretf9MJQN6HsaCPxe4rvgDdHOcOxDIAcmDFDXvLnk4f7Yqt63gEIB/Yoj+4p9xaAbBHeUPM8qF2aRh84QQwNQYcGgdmx4C50WqCFngNsgSvQ+Dxu4MuiawhwIAXVk1O+e/A7CZgThY1dcno1nHL2oDIyZULpBsAFTBZ9pjT0QQgn2V6ufRicS8QRgbs5ZYpEsENDejBfpoLrwAOjgIzZMBRZ0AHoUC+SOA56xJwNlEyTFw5FxBPeWvlzpnbANCdQ1eSGTRybMuydgMggVBsKmtYoC6Mt8znZxsZMLzAxoAOvsh+ydDqtXx4FIDl8L/omQ7A0QqA82S/ERdTI22mNfaTuBIIxR4BhKe+y61punQC+MytI/Zz/c9EuvyBeetLAfGZ5WOMZ9j2/gqABB1fMLsHAVBqhfTcyH5d9MByEdzs+B50Z7voGZX+NzNSsd8cwUcG5ASRKYbdHRNYwhhDIHRgGmO0gFP+HJh15jOXjnyKblVT5Cbfoq+yJOszF8P8+VnNPlICkMAzds/YLxlYznrJwIpO6egTPMqA5ZNDAB6iCCYAyYBcBqTRQ0e4630SxZyQJQIvMJ8mSeLrYe+p/GzGfnTpEIBy6US/out+K1wg+brs88rHmDOgAVCMnrEfxxMte1Mt6j7u9zzKgIXzczEBOJIB0BnCJoqgIfDEhM58SWzJEPGJe9hfVH42un/Mfxl9bgSiBySIBWnAJBDGEDAB8QWFA8wO3/a+wH4+rg4RLPYLul8tCI8CsJmJMQAOuwFC9qMI9g9Z0CxhZz65K0wfFBPqu7PEyVdWAOTHVlTcpxhXHZLz1w0ZA6EDLhkCskRf0sw4dRYC0PQ/vVSRAYPo7QCdj7GqVOSMeBSAzUzMxZcDMwLgcKX/zbv45SQlHXDIgagJc+bjZBqAWhUoH/Y+B2D0J7rFa6LYDRmzomsAaOeKqxEvbWacHQB08JkRIteSXiSBLYJOLB+X4xrzAzY7vgfd2S4RAKkDDgPzNEAIxMASSWF38WsgkuXLyXTRSRCe/DduSZMBMwe6ObTd8JBj24Aot07uDObPP9XsIzUGFPs5+JJ/M6oT4buxHv9X7BeY8KgOWDg/Z58GTC9Xq5FxTXOw9c3Cm6k5fPcjgbHbgAlvVG2tH1T3Oavoq6BlniZ+12n5u/2sDbOvasqoFg8x2Lnbcd1GdhSAhXN+7qMrAC4sA8sORJ6yHwD28z+Ft4fdv8UyqUDrDmCEBcpZ39kLS6aq9l4D2rLb/KYsFTPWdfbvh86vQu2s1K/K+zIjTsXIVQ9a59Egs4Y6sZfIA/EcSp/jEXv8BWcAhxaA+SVgSQAkGAMICcwVlNLlqTc9Gbv/HAA7MrL4+f1VlXwrUq7SvCoyGcrrWpGhuur2fNGYwM8YT67hT3s1LaZvqn5MLM0bzmHMmIFSgdFNj/mIBct63NhFZwEzDsBFgpDPeanNgATfCtGsX9TIKwNrg9tuVkhlng7TI/YArX1VkXKrEe1l2SynN1RCsFJsqnQv3UIMxhwIRjU5AGN9QUteVz3BUAvahuNgjC3HxLAND7nBp/cgONXF5wCz8xUDGgCjKPbvevlzcKUHH2ag6cnYzepYBB9Zi2FxDJdjoXJv1WDFiLJ6MKqKZUzoQFTfj2HmwTKcTpVWvcxHKm6kKgoORAEvVclPD6NdzLXpMT8IYNPcLV7yJGB2AVhYrAC4SNA5AxKM9ryDPE5fs6eeVKWGZ2M3S3MQfEyJUKV8L1ZpJXpVJ9pLilmlAxWkVJHKwIhjjD9TtVXVm1HdOy/pJiaMFRWM+bo0rWl4yM1N7oPhTJecC8wRgAttBjQWdBBGESwgSiV0Pb9DRgu0TY19N+M1mRKh8niqFx3rRDsLqjgl9yaGXT80vcL1wnE252PAZCzAHQCoiqoW3yYWFIt664fUpKaREr1NPakH6XkuOQ+YDwy4FMSwgU8GSRSz0UJx3Vx/5vFNbrs/EiLRY+v4ACITww6iJEodQKwBIyBRv9vwhKzUW6z66TUGEwhDS3ezqusAyNxnJn8xa1KRPSFts9YfFB/QDZcAm78CnDBT5U8rCqjfc3yh8Gn/hGd/MsKf1+QzYJ4891Jye13iy1cAE9cDJ+6FpYrEkidxDN3OtXR+FwBGMezoMmxJLOumAuD4J4rxJrfdH/XCoLGFVKiUbw+LAPQqWWaMMLrd6/+JycSIm85w9lOpt1j1MwAwFTiqAWEUxeYH5ENn/jInUVHeMXQ/f/jRePvCa4DhTwLHfBc4frGqqaNJzLPw6iZxV+HTplFGvZrXZT45N39+HW3TujlZv8D6fp8HRq8Dts9XIOR5YtakgBgdrrrt5Qsq8Ssd0BhQ4HMwmVitAWHAY/LbLDQNQDaTVJ8Q6W4qVB51OOqDZDPVB3TLOBepW5jmqaLbec3jGgBGMSxvvemDYkQ9GoKF1ShUCSKCqBeQrvmfVZPC1keBjXcCmw911tTJ8q5XgOLaQgA+x/OdWA2EGZ98gbjleTHdQHQN+2iwls3nK3/Zhj3VeQhovYzdxmArSwQgDRA3QiSCJUrTnjfl4KozRCSCCeYmt90EoJJbVCk/1+FiCwFZxLk4dRfLFia6x8LbYkD9v9cXtLG6+O4AYQRfrgPygVIcqyhTXcWFOJH8fh3rz7EKwnUArq8mcGwK2MCC1i7WY7Zenh56feHT/jE3yliE4TZncd636gPFCKWavGhcRx2J+cvs9MlSw0Ty3cCm+c7n0G0MExdW4BMIbTXE9UCynvyCCX+Ovm4gbByA/xisVgJPpXrzLj4EoRJjJIZrWHArS9iprK+KcefgiyB0XVKGjOmCmW9xhRVMUSyRFnNeFGEdI2q+/HFXclkp9WsAbgTG9wGj08CI64WxRk/OTDcUAvBHXSLQxcVCDMQSWbzv+1e7WVbz+k5w2tJtsbcCYV6WJY7hmAsDA7r1Sz3OgOgoM+KTOJbcjSI5yGIaNE1uuwlAAU/MF+tF5/0sIghVLdVdM2S0bSzHx2Mi+FTxXf8X925NC4BycK8QwfmgVX1LlcFiykEMcL2BndJJ7aQfijKfxLGDwAhByM7aC5U4qwPzNwufNnNuOH4VZaCPlPo2AahqFqoPVFc14ga2m+WEEL0cAz9kdPrOmMu8r1o/rTsXz7f9oswFs+jO6LAqkvC3Ggg5Fg6mwW03CUI6X12h8lyfcz3QHqr3DIl64DbqaQKc9mI87QXACD6vpJqY0EVxz2CEyCI5eMSGX2e7VtI5J4yTRyZhscrvt1nQuivOAaNLlYESwcySgiVbr37Bfd0/u31yEgg2FVaiPCeVOguqAfGov0iR0R9JABJ0bnwk9nMxw+fOh55EbgRhzozrBUA1polN9CLwok5HEEUQBjFMQB7D+j656PW+IrJ8O/bBCo4sGFdGejqiyYCx3mKe9/JtTiBvmI5OFiTisg9LtJFF7gZGDrUbHKs79+hyu5hSaUvh1foFr3r/6vZJCiXgCDwVVFJ7MVmRLsrGltuFCc68yFdACMDAflwR4QM3HPoKgIExt4gz42SuaQb8hBOE2oZmlu+KFlKR3QSssMJxDPWbbjpfLoJrxG8CYT8MKGZSVTCxYFTIb84nkCxCIPLDiby30gXFghaF4c2ReR466Uu2fvoFr3r/fKAEFxvpqMcd9yonIrkuK5LLV7MVCM+/uDJCyIC2J8a0z1iwqyESgMl15Sa33QKgmtPEBnp11mwuXgO70Ud4DHWzfgDYC3zBEOk7HlA6XKyHQzb8HgGoCSQLqsxorIy1Bxie7Wx0rFaf+wr9Xv32C+56/7HbJ5VHtRYT+GJrsehHcya57PyKAQk6+vBkBZPpjPEExlwU59awg3C24W6KBsC6tqHR+MidyVG3i3rdAnAsH2T093XT+zLr197MTA80h3SfsZP2UqpCrPQ46oF317VrpeiKXTJ9MhMLkgGdCacKG/mupV9w1/vnwyGgCDCKWzJe3lqsyzLWZWe6/kc/oKzgKH4jC7oolhdC4jiuzM0WPo+cPQ2AsX1obFCTO5Jzn566PwbReiwnfTWjI4KvDoh1juh+aT+WKSYD3i8Aql2rJk+VsVQly5kkddv2FvHT61icqO7Fr71/IkLNXOi0FQjV0046oBy6wZ922Q95ICqDEaL4XWw3COcf9Mw73DFB9AqE6wZAAS8XuzGQIDKf+oVkqxt00ttAc+YT0PJ9qRFSB8xoye5Xu1ZVeCSgCLbYLVNswoncHxoeLwCzBGjBNki/4BX3z9lXgUCyIIGmhova83cRgO5Te9yLgP3MfmsBS8xs8/U67ePQOqy9umBUruDchqo8sHSd3PMfT5ifo+ack8eFHI6QEcnT5GvdOnVdXof+ptJ+BVPWceiaRHA8Us/nkACo8mzqlqmWrbFDppT5A5UIZm7CPA2Vgm3QfsEd909kKIqB1qJAKCBG8ZstZz3xHOAAiwmpDIdng1maZQAkZzsHZ537YfQrwNyxoQ+HakrnS0h1mUA1C96TdJTmORyhC3oeqdwROi+GDhkFI6bYNrcNDEDeAkXwQizPRpmnIs3OdqZPSaRFUcbchHlgie6agq2kX7Dd/+d8lUJVXuUzk8ERmS+2vfd4uvN2VOV5rSwb0y3JhgIh9wJeN3YMQCIgR78Q+nDEVYBYZUrUpbXFnM7COSdf7N4IPvtDnT2BY/h8Chh10MXQeYGS+7GGjaQiABpuNIFiECnzdWJMIUHcazLptC7YivsF8/7FgLFMqpiQL5TuNbKfA/DC46rqqAbAwIKWK+timRUBEiNGsOQsyQm+Gpjd4n046hbT84KPuYjOmHHyp92gcgDS2OoIuVIeh/xyUkaVwyEWdLrewHE3uBUDcKIwnq40HpDXL+n3CzbaKdguel5VnFJl2awaghLQBTzteZ0cjLq2A2n0M6EPh2pC57Wg41poLzZsAZNso0Hw6eVR/J8bF9YjWGmVCpGKwQLBRCcrbiSxNLgVAxCF8XSl8YDHHFPW7xeFBRwv/rGqOKUBkODzqgdWPYAM53vTASMQu4Bx9J+69OHIF+N71F1O1gUB+AsBfFqKC+4Wi4BWX+CYgOTAU36wdMVNVKka3MoBWBhPxyiuko3xkSX9fvGMkqsDlzzHC1N6SQ4DoINOe7KelWWTheziObeKCdARApD1AdVnRH048gKUAmAEYi6Oh4DJV4VoGDWqjq4XLbO5o1jBoimEPhPJmwu9FvnTLgdgYTwd2wyXbMyRKen3i2eXXB245FlVYUpVxUpGiLtmGBlrTEhVUwV8dEkVKAq3MHJ1uzRbRx+OOgDWFX6MsXJU/36lJoEoA2AKvw8+uwTEDIBbStdOs8ddDsDCeDom7ZdszBIs6fcL9ror2C75US9IxJJsEsHdGFBil4yYuUwknofJgF4XcEUfjrz+X7fKo4EJJ//PkMORO6FrVjQMeL5kJhZMMXzLwNZCt1nzDFgYT8cQwpLt4hDON0i/X7ys5OrAJVe0S/ISgFY7j9ZvnQ7I3+lyqpYaL98CWp/N+nDkZdhi6bW8An1kP3fRTLKVWlwF6RZCH2L4zDDR0k1IqeTNb2OQSYNbOQMWxtMxeqtkY6I+ny9VEz6btfb7xc+XXB249AoXv85+tIBVgJJ6n4lf6oV+mfjdDJNMH0wAVFX90GMk1f5TxlS3Fggh92DyN0IORy5665KIfCktsl+K3VsGtpVOWOMiuDCerlSnjQ2rB+n3C+pIBdulz8wqonrNPLKgwKaC5B3s53qhXVq6oDNg6sOhqvqhEr3V2VNLBjmnSSNdrOLJ1zkAu6VPRjFcFz4fXDJ8i45hG94Gt3IGjOFYA8TTlQZ/qGH1oP1+8ZtlT1MAtHK8mQg25zOZUSCLIliWcbw8wfW5Ln04ssqnHX04euiCk6/3de66MPpuAQVZAEFkw2MKFw6a1wEL4+lSBvmAOMhD8vkOkFX77feLNw14YT/ssmc4A6oOdHBEkwXlgjH2k4Nal6wB4fIuX9LzZjAmorNeHMo5Tc0OewHwDTUh9HXxfGJsYkAbAAAgAElEQVS/uvCpoAcew6zBBrdyBlQwwoDxdLZWXLDFkHyF8xGE/fb7xR8XXByAAVC1oB18HQYIT+8uGfP75SCUs1o64he8v4j6cIQ+IqkPhxrBCHjdjBH6AblQkAeY1ondukSiELmsUPpjbyp7XuvDgAXxdNZVvWCLIfmKg6Bbhrjup98v3lVwcQLw8gqA5v9zC9jErutltg8gMxDWWMBaMVkmANWFyEV6R0uH2I1IzW7ypbkQOTP5f2ch9KsFkwp0kQlDAOmxzHpscGuGAQvi6VD4RgmAg/b7xZVlT5MATNXwqQc6KGwf2U2uGV2uzg3D4ua7fDnPwZcKgIdq9GaIBPZb0YdD7hgyIFWMXiH0eQ5vXS5HcMkc++9lz2t9GLAgns7KxxZsCkgdtN8vWD+vYDMAUpcja7lOR9eLVcIP4tcuob/3AOHCdW02VTX62ApB4Mv1v24gnPy9HiH03fJ366KYHYTHsgBBg1s5AxbG0+HLZaOp65i+ln6/YM5EwdYBwGj1cmUkE7+8THLNdAHhwrUOXtcrO/pwhF4cct2oN68BMDCfmsJM/n6PEPoYPp8bH3kCkbtjji2tJJA962YAWBBPZ0WBCrbYsFoOf9pDAiENk179fkuvf9nTXewKcBSjsn7ldonWbgQpx+26otaLIwAlfi2QQSJY3Yjy5i9dmsFM/oEDMM/Z7Uf0RiYUA7J+ToNbOQC3e0WBBm9qLad6HICG1ZK1XB5PoxnuOOIcxSXe/Of8xHV/P+FpwN47gKUpYHmuSve0pKZgCKSq5wqniWE1WZz/xouBm74KTMwBI17lVBXwtWSs+8/vL45Ff3vhpcAnvwos8d48DZX3M2hx9XIAnu0IIO0chu35AOgLL0yuG/jOmwbg028G/mNz1YWdETbm4I5BrFlov+EtD2wIo7l+Atg8D2xY7iw3V5diEqO54mnj6XdMAYcU+6gon7A3NSO2qFjlyZYDkAX6uD5Iam44YaUfVNDNxaJcLIPXcGGpfi6PnZdVD1wPspQBX/wl4OaNwN6Jqg+xwrxslcVFuYJblehkcYYZGPS3L20BxueBcS8nwg5H5kZkx6TQSbXFZcCQKadx5Cz5mPurAFxrRaa17pAR2PFC+ElSHKQ/0QjQcgCyGyM9v3SnsDBRJgL6msWCf6IfWeUJac8UFlpY8500DcCfvgb43hiwZwyYVhd2D/VSrKGAmIDnBkiafEcN9cprHgKMzgNjS1V7rRjRlceyrqif6KAkMgXIM+6tAnDl+zSL36O9+U8p9jGHQo285/2XA/AnXeNnKAorDXH/AILwbSvLEz6Ql2+cAf/3XcCdw8DkKHBwpOpFbE2wadzIdyh3jjNQirYWEwYq+/zJwMh8pf+xKNSwM6DZMmzNRRbM2K+2Ii6TlFrAWfd5V3i/F7IgT2LBF5LbIdkqxLPWvtzlAGQ3RpU3Y7AiixMxLOUB2t7pKQ8M0qCTnp8HkojJgNqaMEJesQv4AR3Iw8DB4QqAs+6SWRiqgJgY0HVDAdBA4Ba4xN7ndlSFAAjAYX4IPO5dBDMAdS2i+Jx7XTf1eEdTDfgAQnR34p/wQkRmjNAoByDT/ugFphXAmjAEn8qaPQAgZCs0lSckCNmVigEbFMsPBBE3DcBX7gLuawH7hoAD7EM8DMw48AhATrjtQwiXoqkTEwWd7LOneXNCbz6Tiq/TInb2M8ZzIFrTQbGiy92oGz7pXl/7jvdAJnb2470IbB3T77Sai+hyAP5voTqW6sKwFAc/TAdc5+3dvcsTrvPVYSK4SQb8xV3+6IaAqSHg0FDVh3iOIFTIFxtit9orL5Z/LD1Q4s+B8OnHVuXwhhdd5DoLGsgCCJ04q66X/Ju/vSaeAxDPvbdtmdtKDV90gVEPIl/xySkviOhmAEjrlzSkwj40SlQZYZ39I+8JBMx8mZryhOsKwqYB+KpdVSDFvhYwPVR9BD7uyX4SwRS59nNI+bRck/DzJ05v12M0nY8fAk8iWL5BB5qASPGRCi8EVjzv3mqpkC9ACrrwhKukB67GhpqRRowQMqCiYbj8oOoHeUWpdYIBAUj8c8WjrjyhNIJ1unzjDPjqXdUjJAAP8TMEzLYq9uOHICQALe/EwWe+QgddAqCzzD8+vgIgg0qp+5nYjaDzCgjmnCYone0klqP4JSgvvK+6LoFPoFMlkPGh+0rPWta4RHTNJJQz4M8EAGoNTPVU8opS64CC9zoAWTFChcq7lCdch6s3L4J/2QFIEBKA1P9mHIBmhPh3Ai354RyAAmWsR/PRs6vOR8Z8FMPS97yxtIlYgVB/I7jC0rIKSfLXF1EEB+BFFjQ3jCLA49OWsRTTEPzvzQEwry7VrZ5KwzAQAPssT9jw1dcHgCrORQCS/bgn+1HsCYQSveaHkzvGv1scgU/6R55Y1YIxhvOm1EZekQWl8wVDxJgwc88QiJc6AKX/meHDawX9z16M/Em7bO8Q08GBP/jEkAEVjMBoAFWXUjRA3KtNwOBXW3EkAZhrALktpC6lKtTV4OU7RHB+3kHWgv/zrnYZl2kCkF4uF8MGQGc+MqEYUCA0n1tkwxbw4ScHAHr71Q7W4++c8czwcBAmHVB/c7Bcek9b3FuwbdD/kjGWgzJjQ3thGmVA3jhfOyU+RxB6FamOFp8NrhsTgLy8Cpzm5QlVptAU+6CiNgXCaIQ0BcDYV8b0P4pi30vfIxD5+w72C9aliegW8MHzqrmh/meuFhYi0pKbs6D9fsh/n1XFMrYMbPgUByCZz6J+uEknDA9AornWFRb01WZEsACoHhOqyC7wdetT0QAK2KqOb5MCUvPyhLE0oQxzqaYNXL5xBvyVXe12vByLADjXAvgxBvSPGFGMIjCmJbEW8HfntxtQmxT0cmxp9UPAdKAZ1upA6EB7qgDo6oCUxXRtPVSpAwJpnUhuxAqWCCYK1MBExZljY5S8SYr+pxAFAuBayhNG26jw8usCQLX0SAAkwwcAEngyQizaXoziIli+Oe7/9kJvNk1LmBMe9ECO3XRB7aPeF0EYHNVPdT8gj016YBcWtBfBVYJuz7mF7VgGY/pO8f5WdQ1/7U67nIKNS7j0wIbDPFZsyNHHY7od/xdlEHj8CcC3TgCWHgGAPSxiSdt4312u/8SPAl8/Dlh4pDeZW2PD4J1c9+uyDaIDkgEJQKnTfG/N8nUAmu5HUnMW5ARbPfEuIHy/ACjRK7FL5pOR4RaxgTHofKl8r/S1ZWBnAGDKefbn3AFIPRPXB7sFiVQimKVgGdl5ooNwLQ1/1U+DQGSXQ9r5Evy1q9rZbP1lGQDZsPpzI8APHgXgod7qUx11YtBbFzC+/C+BL7SAWwhgdoLkONSLqy5oLogYft3ZI1F7EAC+phsAnekokhP4HIzml/PvthQWmPB9LJ7jxkcSr14jWj4/0wFlgJD5eoDw6fe4DzAYPHokWhHJZ3TFSkn4h7YOSOBwEtiMTv1aY0uktFYTmI2/43EMQmCuAJmUE0gmVD8EFdPpdnxhVhqzDr8F4NMtYM9Jfg98EVTeNu9Q2OFZBX7vr9vtgm/lcezczZ61ZNN8DCvilYCdPXqNDQpAlfGTKm0M6AA0PTAyoMSx64cRfPQHXsniOTI+fEWDFGp+Qb9BeySRBV2kpl0QxxGAlHDmkI56X6z+EP7UDYSdRgh/IouwIZ36lHabBE0GJ0r10Rgb/xA/tt/j/6aMAf+7R4CxzuBXWRGULwBfIrY6UNfpvLae7n0I+LO/reoLMqiVMbW38oUhkNkQIzZO7tIweGePcmWlAFTjAYHPVGwXxWoLYblEDkLuTT8MDPhXLJ4jALpaJB+ggU6xfgJknT7IKXIQXh4Y0FZCog+wxiUTwSkXUbSMV1rB/A31OXWuFpPUda/mRHKi1e6U+hA7Zq7l+A+UAfDtHg/LrptkQpZ727cRWOL9542Pa3rOvuOqagUltgtmJM08j4/PILbIDKz6w5PAHsbraTnMGdZWIwIzxIfeK0rn578J3LAVuH8CODRahV/FFQ/1IumIvXP1QudNfyNT8oVqcHviPcBd48A0g2RDuoDqHdb2SalZAdG9dnfDkAE0gXnH5ijWCDbKCq5/MRiV0QD8HgHQ63jG0hdsLGxA3x9Bw1Asli7hO3BwApgng/Gjvq01IHrXJ7q3Cz7E++YziF2rs1ZLZ+8H9jJsSoECWXj6igmR87aLgfbGq4GvbgLu2gjsHwdmCEIPSI1h+SkCRjpfUC3iNWcpoRrcnrYbuGsUOMBo7QBCxSTG/igxVcBIVGPWM1h1JYQPnyKNExGZMDIJ9b66eEBGxPDY1Y5nv+GCjfGAxD+DDpiawphABWZPjwNzNLAEIH4XCH0M7/5c93bBfI8Yk2cgVAdvdT10ifDkBWC/r9lGH51NhIsnsWHOfPmEUKT94WeAG8eAO8aAfWPAwVEHISNQlKQUglJjJExqC+H6Nq93kOpUg9szbwLuHa66QzFWkaFieXxi6hgVHOMCYGRuJ+5V4jYJIDKI9KlsAvFDq8QDrnb8NWVPh9EwdFkQ79TlSMIsN0Mi5s9MoOGno4U6f3YAvefL7Y7rvdoFLxOANSA8f7xSgWmd0kCQbmZ6mTLEnJ0UqWLhUkxlrBn6n3wWuGkYuGukCsufGq2iojnRFpafsU7MDxErJuZhYCsJosHtWTcBe1oeq+hxigJgXBrMmTBPnJKLrr+VED54ibHYvZos8sO+DNcrHrDX8YVVyglAKud0LtMjFPtNMz6QLDY7VomLJd671AEH4Xu+3g7nWq28ISvX58/hguOBg8vtFQvV/hEzxfqOevuTfpjri8vAWz8L3NYCfjBc6ZYHmBcitnFd06pxyb8W4gPlgonBqffTtdTg9pybqiVNBssyUsdUD7eGO9amnf3sXtxQipl7Wg/sD4A8AwHIyZMYky50Tp/xgN2OL8y051qw2hXzwRCEdT2nmck1RxHG+w5jeO9NFQBpR6ldMIMXlFWgVndqF2dVFsJzuOgRwMElB6DcI6rznemD0RnbwQiSRS3g7Z+tVIl7PC9kahiYZm6IizuLigliT/VoUog+p8P9l3wJ7qGEanB77k3VczroUToWLCsABud4ypaLCUoxf9i/9w9ADiICULrQRWuIB6w7nuZrwaZwLBGwClSqSyz3AhHbaRGEFGOmC44D72UVgjW2C2Z4lIF4ArjodODQcqUGqAxfcpG4mJVuVqcL5tbs2z/veV0tYK/nhTAqesYNHdO5PCJZos+WuzxHJIViuXFyJxupNLg976ZK2lizUKodilGUgzyGhokF8yw5Mf+qRkjdjfuDtwkkm7DTkNaBaQ2ox1q3eMD8+B6O3H6em8Kx1Ccx9ptWl9iYIUAAWrI3I3nHgPdOtsO5eOuxXXBdj0V1vOL/so3Cxef60tlSpYwveKf0pAu6ohfdJ8k4CUqgvr5jV6VGTBKALeCAh+VbZLTnh5gu6D44A6H8cVlkNK95O1WkBrfn31R5HSy+JCwPplAxRegE/2T+AloGncNmbQyogUQx/KwB4gHj8YWNTwRAOW0FIIIndoqNkTAxz/bd09XDGLBdMM6/pLKi5whAX60gCK2ujxzEAqGL2pQ1Jis5AJEAFHvTujYAKjRf+SEugm1d2COQLU/DAwQ44caEw8AtZzSIPgAvuKkdrWMM6M7xCMBoiBn4YpCE2NCfxWAA5MEuwvCCEICwlnhAHV+YORfDsWJGgPpMKwg1b9QpFnzHbD2BK2JGul9s8KkYW17vLALQRTCBpzXZpS4gtCXXMAkduuAy8E7PijPWprXJ5CR38ygw1fJDohh2BlRAgq2OeN7uTWc1D0AFNtmL54ESBsCaJcLkDajxj5ZXRiCIGA0waDwgjy8sk5+HY+X9ppUbJSCp6TnFCMXwny1WAFQ8rUAc2wUrRL6mXTAefWnFfnz3FpbagQKLAqAzoZjAKkkpXkNO5GCEvOMLFXOnnC4xIKOjnQGNdWSM+GqHQGd7JSsxUf+JzQLwhTdV4je1nQvr1MkPGtlf9yP2Dy+gAqZ6rQytfvdHSDxgLwBF8AmAYjHWluEDiKGMiqOVvtejXTBOuRSYJwDJAARgZAGWL9Nk+IM3SzgTydE4eec1nZHbtDaNAf1Dpd/SMx2END6kD0oXtFhBXmcY+OY6AFChnKnzl7NfdMR3qCAae2B+VVMYXASvDs3/X/zHJZcB84vuiqABEo0QPnhnwqQLyRURmZBPytnwHde0M1vN2lR6picoKULaxHDIEdHkW2iWg4/7b5zb7DSQAVd0/griV2JYojfpwRGEYsGBrOBmx/OgP5sAKANkcbFzNWTRnX/GSGImMYH/LYlk+gGvdT+bW+SWH+Ig1GqL5QeTtR2EYj5LVHfjw/ZDwL8yJ6TB7UU3VVoTjTYxYDK+Ivv7dzNAZIxpZSiU8jjKgIWTcykZkBawDBBnQdMr5QeTKI5iWCB09AmEb7+ucnOQ/aTPWn6wuzyS4u+R0Ob6CUGqJpIDA97AdqINbgRgBJ69CG4Jp6q/ckjXqB/RKla4WpkO2ODgHoynigA0JiLwaNiEt95YQKJ4FRC+7brKzRH9jZbN6iJYuSHm9I5iOAOhHNJfZkh+gxsBKPbLu3+JgaWDdojhMO5kkDWSlNTg4B6MpyIAjf3IggJgMD4MCARjFMU9QCgAykhSKnUCYHB9JB0wy5aTRUxmup4h+Q1uAmDs+hpXgFLnB6ULONOn5xACNJqxghsc3IPxVBGAiQG9aLeilWUJW1FvVXEN0TKp1C6At19TMSCBpz1dHtT/JH7N9yaxp6QkF73KBxYIr10nAMproB44qQGTj6sjUrtOFPtLeFQHLES9AdDFrq1E6M13MaxVCTNAXNFThIylLcor40zxtgDAPKuVwDMrOKw+SBTbtR2MND7sZwC7Qvm4wqHa4T/uIrhb+7n0EgbQdTijoyg+agWXT8llDsAFWr/B8qP1K7bT0pvtVwHhW6+t2C/m8svvZlawi2CKe37nhFtapkDnILRqBQA+v04AjMyn79EIkXO/DnzyCBwVweX4wxs9B4rRZgyPVFqykgDd+5JSpBU5r0vHyHz+jsc3ub0KABsZMCyQgeExKyFPVIz3lmcM6OfPAGCADYPE67Jfs6h7G0o+xvi7oyK4cLZfOgpsXwC2Lq9MwuuVERonKn4nSJrcXnQKcM7dwMMXgYcsVxkSebJgzOWPqdB1ad2f3gpsnwK2LXWeR9m3danUIV1lBSCPArBwtp+7DThuBti6UDWDmWA/DvXk8LRptfPtNUlihYZTOPCi04GH3wFsnwGOW6iAs5n3GeJJ+KLoE+9VDClQ8R6vOQHYegDYwuY3S6H/iJ8jb11ck0q9Qhoc9QMWgPBZJwFbpoFN88DGRWBiqQIgWyJY3lPozaGJ1KTEPh36zpTkJrcXPRE44S7g+Cng2DlgyyKwaclfFoIwvCwx9Zn3Q1DmIPx/2/sSaMuusszvjfXq1ZRUElJkKsBEGQyYhJCBSkUqAW1tsBdpuxEVaBzowXZqe1g90G2LotjQdmMjKqtBxQERdAWUAkUlZNBGkQRNyIAEMAkxpFKpqjfUG3t9//m/c/+737njPq9uVeqcte66b7jnnn32/s6///3v//++Tz0dmD0KzC4DM6vAFpd/0L3Gh6yTDgnvLwKzAWDGiH/ThcC2OWDrErB1pRgQisIQhAa+AED+HEEY6uNLyrRnZLSl6tSbrgLOeBQ44yiw8ziwfaV4UGbdegmA5QMTLFlqsfn7XecDW+eAmePAltXiXnkuZSBkRcm4UGXtU2uo3xsAZgz6y54JzMwDWzkgBOAqMMVBCSAUObh8QuN/CiTgcWAuyWhL1amvvBbY+VgxbW477paa7gIBqCnUrbUBiQuhAKDUot13IbBlDtiyBEyvtO5VDxvvVfxW/JkWNFrCeK8NAGsY7BsvKQC4hQCkJNaKy2LRIsg6SJ3IQSe1onKKC2CsOYMeN+0Dtj0ObDsGbFsEZmWp5S74g2Ir2uA22BScAJGA+dJFwPQ8ML0ETAUAkgDTPq9zdK/+sMWpPF19NxYwA4g3PtsHxAE4SQC6FdSgmGWRRIJLZJll8EGKjHiX1jwaN10HzD4BbD0GzC4WrsKMW2pNobZoCu6CLCDfCTqzgg6sr+wFphaAKQfgZHKvpRSYg7HN5XCL2AbAZwPrZGaj6ippXhgn0kqmU1woxnHedg5AATuWHig2FE1uVRwoxoX+Wcbg89S3AqCKPONcCi8oPtVP+9++G3j+oSK2xRBFDElUxbTS+3nvc4FpDsjxllXQoJg8FgdCQoGJJTTicLcQ6vPL6wbg9cDM4cJv27oAzFA5ky9/UOSvmg8oP86n0dICBn25JwjARWDSAUgBHN6vfdbv10AbARh8X91vDM2ss+NvAECKPVLCsHoyUgRqrlbnRwB933OBc+4DXrIC0IEmiLnE75di8HsyAcjzWUVGUi6uICMpVwwJVMXdeOk3XAxc+Hng+vV2esAYw+sWoP31r3eLcLwQBeQUrEHh4Jo2h4vDmJPuAyMLGAeEn7uqbgB+I7DlSWBGCwe31Gb9aL20kGDb/EGRxY6WTz8f2wtM8l4pgL1SgM8esHCvsuylME4nn9cfQLtldg6TZ0kUKorAfij23vAPCmqp3fcCl60XFINid1PlZrf41/dnApB6wSQjutUfIDJR8CGIQOwWEH7DywpKrWc8CFzqRLHkVYrB2jS2FQH5vkuBycXCAlIUUAAkCM2iRBA6+ARCe7DjYmQduLYTleiQ/XTTS4DpI+6nLhZW2nzVCEBaMLd+soIGqjD1ampdugiYWCpeBKA9bBJC9ActAk8LES26SqsftInLZ44dQif4Igdhym5WLrPDyuYH/7HTCNwDnPko8LXrBccjQaioe6BiKad3+QY/MGTH6rS3OBvCnQDuAIyqhiDkQ9RX+29yE3on8IwjxQPI8zkTiApGU3oVkD/4fGDieAuAdMw5MFQjEgg1DYsUku+a3uI0TGBfV7PotwHwaOEmbHEATvuDIutni6UAQoFRIFRYhfe/dhEw7tbe9Of0Si1g8HkrwRcevDajz07gIJ7n05rYyWIpb4ya/7vv8PRdFpj/LXDmkQLAnA4jCCOlTBRN/rFMAJKgkkVHpGUjySSBSFeg7/azqk8EgbSEq8UDRACLKDXSyaQ7Br//DcA4LSCtwnKhTEkQcmAIQhtM+Uaajl0uS9NatITXWzpzfcdNB4DpY+6nBgDaCtanYLN6fCj4u1ay0QIqtML/EYC61wSA9tAJeP6eWsAoDysFpg1eB0HIQRCIIkVeCqQf/05P3WCB+UPA+CPAzvmCaFWDKEuYcl1yMN+Y2dckqGTeHPEvvWDSNhOAfbefX0A6rS8CUw8X9066bFIfdqMHJID++DJgLACQumyc3gyAEYRRKFCLD1eu5ODLF6QvXedx0w3A1BwwxdAJLTXjd8seQnGrZ9bPFxLyA7WIKON63tYtCQBN/sv9QPm6BkLp0vl9t/m6ietR6fbyBA4gnXtORwRRpNnTtPpW6gWLH83lKqcOFTEnDiKtoHwy8RNFhrefyeztbnrBfbWfgttsP+kIyO32ELD1cHHvInrlvWs6TsnB7qAUlg/suFtAWkE55zYQ0QpqcALoNCXTEt7A3KoaDwGQfqoAOEUBa7fUbKctltwCajVbxvSiyvoasM0BaBKwwdKb9fN7NfcqBWGiSWykWXER0umeacUEonQgCKRfIgDFjya5yq8Wfsfs8dYgiuMxgpAg/vnMzu6mF0z6Zj5APdvPQec0TEosnvQosGOhaLuIYvnwEYSithE52F1XFAA0p5yigD4otCqygFKnpHUpLYP0OcKURYv6Mj4MNR433QhM0gL6QongawOg+6rl9CswKoSkEIxPyTsuAPigCYBmAXVfYcVf+n0SRYw6dP1YwNgHsgSajiJP429RrpWOM6cxDiJB6NINM4w7LbUGMQUwB/M9mZ3dSy+YVG0EoBiDBST5ddZ+PkCsAiIlQZDa3LVatJ0WXG2PbL98AB+4omB3oP/HgTUhmGgBfRqWf2TTrUSjExDSP/qWzQDgfAFAWyzR8rkFtDAKX75jo6nUguZxZ8NByHbvvqBQ36T1swcsBaBAGGRg40Ir+rt9WUDhQ5ZAU7Es2e9LLzglqHRxNkbeuW+oQRRls5jaMjnK0a9ecNf2R4LAwO829kQB3LTtEYQPUwzQAWgW0AGo8AQH0ljp/V17pm0KRcEifGuNOnocO1rACQbKPXhs8TtNwVr5uh+n6Zf3wDgu29g2FdMtOc8B6PdpFj08ZFrplw+ZA5FTvAQQ0/BT36FPDkRqBT9Jag7xYlQItY0f88j78sZzCcKPZlrAQfSCK9uvB4h577SCotUiEJ8opq8IQFl/PUBPEoBLxbRE62LSqG4dFB8r5bHcOtiOQSqT5T7RKzYDgJx+BUCCTxZQCwhaQc9oKcEnEBKknj5FsJ1LAPo9xoWWPWDy+6IIoqbeaO0VA+zHB0zxIQDKkn1GgtXiRxMIAx0Vn0Db+lkuFjLRCt5WEwD71Qvu2H5OfekD5FaciQay/GIbFgBXriwAyGmJADR1ck3DwTE3TQ4B0LetzBJErTYAr2BBSI3HTS8tLKBZPo/fWQDZp197Z3scjGb5BDp/L3+njMweB6B83Gj9wj3atOsPWin9WgXCFlVO/3ctf4iD8XkBkH5USlAZlNPZAQqARr5vxu1yjmH0givbX0UQKI63o0Wun/xHuR8E4VnPK5JQLd4VNttTBvK2uoiKOUf/f+GjwMNBh0NMV6J0c0NpcRv7mrYv3kh8/uHxYp+bVpwLp3R7sts2YzouSq3KGa+q7+x7Co4nazAerRKsVlV1QitF59dyyFZaYY0HMu9mWL3gtvZXMbymBIFMZ1ov2h0B+LTLisxgW+Eq5uU92iZ72ud9vvR+4JFp4NjkRh2ONi0OB1/UBCkvEYRhfuNs4OmhhiPKnFQlx6aAjMnSXJUAACAASURBVPjmz1w41nnwO4cCIBvBwZgTAOUHRq3gyDExD4zRGVYEnpm5LqmQc0M5esFt7acFl0SlHiBxuTkYxxdaihUC4QVXFu5FCUD5QtJl85sjGA0ziQxqeu/fem+hw0F2fLLQGxFlYMRvo7v1WmIVtpt1DFkXvOR7LwJ2HSkyoZmEypoVVe8p7b6qEMnidGG/Vl/L2aPOIwuA1pAIQE3DAmFa4j9f7CPaFpCHKujr5xzZesGdHqAqKz5X+FLRAl58le+jui+kTBALMcgZ73CDBkpN2/7+bfcWOhwUyCEAjQTcAVhKdjkPc2RajewKyu/n1//qJcA2uhBMRGXQOcn9U6JIOjXHQqSYOsVoQp1HNgAvz8yny80H5PVz9H6RqVd849WtXQ/zA0Ow2ayGLJ474L0G79vvbulwkJi8BGCg4S01SKqofoNvSIC+5zkhFUupV8rUTpJN06KpaBkFQm5M1HlkA3AyM5/u9Zl38zrk6f0iU6/4hmscgK5ISUtCTowyDqb7UxwsqFJW3fo/vbuIBJEZ1YRgyHwQKNi0KEl1OKTCZJdxtPDn//v8ooaDaVgqFyiTD2IKfcjZS4Fo+7g+HXOPv84jG4DIzKfLzQf8KVfI/FNKrQ6h94tfz+vOA9cGAAbrpylY2SDlVTTt+uCnV3/V3a7DQQAysJAwobZJgUXi78Qayhd812WeiOAZzEyUiAkHMeu5BF5FwZQAWLPwknkLQy9CrPMy8+lIHZFzvN3T+YbV+8X7c64OHHix74V6zIxB+RJ0wQ+UU992tYoFy3fcXcTDxQkoPsCUhFIczKVCegSg5B8A/PILN9ZwxBSxtiKiUAOi7JW0dLTustF8AGbm0/1o3vjjnSGdj+lYlGwdRO8XN+c1wABIoHk6k61yuSCJITq3jDY9Vx0BqK++uwAfX6JkI/hME0SC1EGguiQ+isqcQRLrF6/0jO2w+6FMnZhyZYsQ1W50qOHgPX1NXndtODsfgMwHzMin+0+ZN0S9YOllMzWfLwKQSS396P3iY3kNOLDPM1y065H4gOW3p4uTDkB8zWdb7FgbdDhEgJkCUDRvogTmd/vPv3BVAUBuvylNzAAYi4hisVQnEHoIqWblrxqm4Mx8ujfljT+YjsWBYgIOc0oJPsq1slCpH71fKybJOEoAuuVTRSCnYlmU6P/Z4iSJEcbLv+Yu9/1EAh7JKEXDKxq4ChUiKymRbwjgHdcUWTARgLYXHSr2LOU+BV7MVwzxwOfkOWybYAGZD5iRT0edjpxD6VhcOQ6j94tP51wdOHBdMeXa9OqWRcmWXA1XLUIUH6zyCwlAs3z+YBkfs1u+VIejJEF3ckrjI9T0y/aMA2+/tgAg08VURKT8vbKMUgAMIGzzAcOi5HknHQAz8+l+MW/829KxhtH7tTz+jIMAJPCYMULAWd6fvi+EY9ouoZBM/Kx/4LUBgFLgNC5o16FrE8JJVJgkiFhaQQBv3+dVbMrWVsC8UxFRkjjaVsW2DtRdOJ/vAyohVYK7A+bTvTdj8HlqTMcaRu/XxHkzjgNkIOWuDr8jnYYDKDutgpUhra0uAlAyCCUAK8BXcjBXgLCk/h0D/hcByDxFAdAzoFUqUBYRJTUcMWdPP7ONL6i5bLQeALJRQ+bT/W7G4AuAOXq/lsGdcRgAY+glLkYclJVTsa6ptCX3uQjAKINQstFrAZKIwWxQIhIJuovB/Nx+r2LzFCwlj8Y0evl/MYk0kieVtcvrwGUnHQCVjjVkPl3mItQsIPuElx9G79dOzDgMgGkAWlNyBJn8xKprBRC+zgEo4LWRgcdVcOCjjlNvmx84DrzNAahaFZWLygKWxUNibIhTcPD9BMLLa65bzreAMSGVoXvJ/Cgh1WUfO+XTZS5CDYDs9GH1fnOrIDcAkABTTDCCLYK0Cwi/586WcKJUiEpC8CCBYDsiiSplqUIUmOjf+o2tIiKVUJbgU5uSWl4DWwX4+PcXnrQATBNS+8yny1yEopdcay+930y5YhgAg+9n2OoUeI5TdQer+32fdhmGoOBZanBo+g1yEKU4dYgFSvqB//vZBIBt9RshkTbW8ZZZ2hUgvDL3iU3uux4LSBM0ZD7dPRnTH08VAIfV+2XAOucQAMuVcKfFSD/+IAABsEoGwYAoHZIKEEYxRIHwLS8pUuhjFVs6/ZZhIVWyxVKBBIRXnbQATBNS+8ynI4tBzkEACv+chlUVIKE/5cRGsWmlKfIzudc3APLQSlg3E2OCyVRc1kpU3DgBmKoQsWtlBcswjPu+nfTYtBL+GQdgOf16GCZW6pXlBCqWSgqJypoOAFfXXDifbwFJLvi5HAjlnUsiIe6AjOp4iQNQHRlT2PlgJCUbbc2s+v/hFwFb/q7gm6HlYpBbmTV2sscQyy/qFBj2v0/cAdz/HGD7NDA1AUyOOU+1CwWOewNjKj6/O03F1/WuugW4/XJgfBoYmwDGdH7IxB5kLPIB+I8AfNwZgga5ck2fJbEm8V9zNWPfrasbgMuPAcuseJ8Exsb9FdBhA+7gaQNKB6TfcgCYug+YJT+g89aoBDMmIMScP12uTKj13uDv8zsKig/uJ1uQOsnojm3qB5P5ACRBH3OhPuzzRN9DV88HqQLEWPJnvTy5nm/t/1s4BcuSpRZtGAu4fi+wtBVYEyccrYwn6hF8/FkJp9bKxAKVFsn/d8urgbHPA9NPOEOWl4+2cfoFHhfVrJTZPKHSj5daOtup6JyCpPx8rHWRVQ7WOlrYCMx8AHIzlxkALPD9c0VB+x/A3E/+E2fUYHXdF7KTGwdvTd0AHP9r4PgWYG0KWBdfsBdsMPfPrKKsoL9XAVLAvO2fFylCE4cKliyrDVZNcGS1CqEYhWFiAZV+XntaURdTLmpCEbpchTYLqi6NrkMCzLzt5Xc4HwyJmmkJ+Z73jQOh4NWeDUZiK1K08f0EXt7CMHVawIk7gaVpYJUA9LI1Ao8bzKX1cytoFtFfpdCIWz7rgzHgth8u0oPGDwETc8CEMySUzFaikgtlpW1Ta8JqNba7lVljSRgW+Q6ZP/57WQvj6fydBjXfAjKbgEvMLwWCvhNoipgNpnQshlS4IGFWzIk6ylWwAz93ETLxGWB5ClidLABoIOS7pmGfG+33YAG5mND0G8F4678vkiPJczNOAC4UyQm2N8w94kirFlfIAl7i402d6dbPWWAtrsjOFiuCvAJZOQE0pHTFsckHYDeCvhNgipQNxoAz8/8IPr5nbvH2jd+6AThJAE4AqwTdZKEBLDoDgU4+YVkPHIBoPwareOt/BkDexsMFAFnbzNJYm0IDnVwbt4uyur1kwL7Tp+iZM/08WT9Rc7DHUmuYTr/x+6o4ovvu9fjBbgR9JyA+omwwxvZI5ULg6ZW7y9FPf9QNwKm/CgCcKABovh8ByVy/UCtJq2f+X1yYJPGU27lIZLbuEWDsWBHesZeDz4iURLUWa1TE47LqK12fZmd3OXidFctqm92KatVs1jAEsNv6sdymaa2g8+xUL4I+Pn2beCgbLGWHI/h8G3oTr45iK86POlbBU9yKI/AcfLR+ouQwH9BfmmbLlTHboOnZ/T9+5vaf8FUaAThXsFOQ45mUcgZCWTAxe0UQ+urYMO1/37GtxQmoLCBtRSp30LrDp2SFdzYMgk/R+VNwvwR9mwQDsaspGSfJgYDYNTbp8psCQFJxEIBkQjDrxt8dXCUIY+COH5MVFPi8SOn2n/QYLZ9Gp0cxANIP5IvAkzVzxivRydnKNzBa8fddM84b6AFyAriMF2pajk9kYIeoClXmA3AQgr5NQEHMBqMVFMNaIOayNRL/vhlH3RZwmhbQQUcAasrVVGz4EtjCu/3dfb/ID3PbT7uKAZ/MhcIC0vqRTo4W0IBIEAmEtFwCYqjW03bcmdwBYeoWgetUbrR8snrloiR2drpACf+rD4D9EvTVjIJu7HBV+781X752Czj9lwUZkTEgcPoNPp5Nv4oBRhCG6dd+1DkMz1JIhR1BAHJ7zwqO3fIRRM5tmDK5CoQKsSgOeBYBKFZULTqcB9r6Ni5KYmd3WKDUA0BlhNLM8EbT1QBXBU72aI5ZjUcVOxz7WLkQ8d37vsart/uA6RcPsxNSAtAXHDYNC1AEpf9s01kKwuBwGU7HgVt/1jtD1e60fgQigSe/j5bQp+KYpGB+H62jT7P8/ZypBIC8Dhcx8eY9wF015abhmnoAyJ5WSrKeNgKO9SHxnT/LSasJBim5lRjWBEIVeROInKL1qunybRawLgASdEy74qjaNNzJCgqEEYzBGvK0297mAFSHEIB6ebKDgc8J1ksmV8t29f1en6L5v6cxIK5iK6Xne/5jCTiFcTqVn/r/tWDPWwXnEPTVgIKUHU7ljASawKefIwDpMdRxRB+wFgD+RREDJABpwSzz2c0LfxczVjkVKwaYgtBBezu3SvX08d39P5uO3QKahXMQciourZRAGKZWar/YZ1xXRPe8wQr2AUK7TvbOVTZBXx4MBECRnConUBSFEXT6mf/TK+/qmzAF/0UBOPqBZYF52HrTFCw2LH5G8UCzJEko5nZqmRnPh/uCXmpnVpDTsIPPwKApOaSA2QLDLSHf97iPx0tpISLfz7bl4iFfsUsnj+HZWEeOYDCDnDmCvZkEgedcCjxGseIhBYt3vx049HwMLRh8gA9gh2MoH9ABqKJzxf0McO7XlSAU4HzhYYFq+5D7hwBu/98OQLlIBCKnW39SlXNY+nqeiq2dkQg+gnGPb9/ZpT0lq6MV5D96gLCwgDmCwbdnCvZmCgY/dxy47xxg5SWuUjigYPHFbwA+fyGwfr2rXrMvPB+vp3L3GHCgi9JOHQCkRVPppeUBigXLFymyejYTB4YsgfA20ofRAlYB0FfAlvQqP0/TsX5PLOB5DNu471cmIwiBaRww/F01J+mz2pqChxUMZvpJlmBv3iTocsW4dzewfhkGFix+2febXDAeJO/YEILBB7pU1g8LQFo98QASVGYNQ6DZfEG3fnEqrgLhbf/HV15anbkFNCvohWSl9XPQ2XTM/2s3I4DwPIZwBEDfgitH0Ek6N6x+u/iD7T4g/YdBBYPpWHEaHlqwNw+AQa4Yj54JrJO+aQDB4pt+oCAyYvOPEIQDCgYfeF/9U3AbAMX7ItAlVtAspKZdz5SOlvA2pstxjES3wJ+92NgAGK2gwi78QoVfEhBeQACqNNP1RdoA18kKdgDhxkUI/zKIYDCnqyzB3jwAJnLFOEIW7QEEi1/1Y21ywVglCAcQDD5/Efj7M4CVrZ5AKlkhxeQUaxBI4nvFzxf8IfCVC4HV7cC6ZEX5nen3VX1vAGLZq8ysrvHY+QBwbGfI2E6JpLvdX+ksthpUvQrmX/sVDGZVUJZgb17vJHLFeGQcmCdVb5+Cxd/5xjZ6QzzMLOQBBIOfTV2Ps4HFHQ7CLQUQmUrV0rgKJMsCjsxGAqTn/hzw0EXA4tnAyg5gbTYBorKkUyLnkB9YVhTxu+kT13iccwtwdBewPAus+b2ar9xJAafqfgMQO4dh+J9+BHe5gqZZZzYok1JJUcpaR6bp93P+W/N6p0KuGIemgEWKgPQhWPxdP7NBLhiHKYHUp2DwpZ8rLOD8tmJQVplOLxAqmbRKC6EDYC7/CeCRPcCx3cDSrsISrs04CPm9ArZk55UvKAspYLqPaPdR4/H0g8DRHcDyVr/X6VabLHk2PhjpPVZY7d5xwF6CwS9y/4LbbVyQsEKIufGiKe0p2JvXOx3kinF0GjhOQY+oNRtljji9TQPf/fOV9IZY4Gq4D8Hgy/4W+Oo2YG5bUUy04vUcLCqSJVRWszJbNgxSmMau+q/Ao2cBR88EjtOqbgNWWaTkIFz3YiWrF4nAjtN0nBZrJnU+/8PA3CxwfMYB6LUra3oglL0tps6wlVha5rLiqd9AdDfB4Je6U0s/0BXTDYh80Sr2FOzNA2AXuWIszABL1JaKWq1R+nwGeM17OsoFY5XTVw/B4Cv+Djg0C8xvLYqJCECzgsxmZlq9T8e0XGUyaUizavPtxoFr/zvw2BnA0Z3A8e2FVV3x6c4sqwObckeyhiXAowUSADhD1XhceDMwx37lvU4XxVN2n3rJIocygkr/Vbs7fe+EdBLcfaXXQ3IPWIrpBB6XlnwpR76jYG9e7/SQKzarxM7qJFj8mg8UarMV9IZ4gvNDD8HgKx8HDs8A8zMFAFnPYQPDl0Co2g4fpDZLqKCxT0/7fhJ4fCdwbFvhRiwRgJruCOwUgCpeCvUjZmEFxhfk9W969kW/B8xvKQqnVgg+B6CB0MsI7P70AHgmd2n1NQ0rv7FvALIlVYK73MnQCDLThSGZoDpuP7uCeuX5n8zroB5yxThGnQ0CgyBMxY63Aq/5aBHG6EBviDlOLV0Eg1+0AByZLgbl+HRxnZXJoqqttA4ODovlJZVuSjTQFtq+NwNPbHMAzramdVpVs6wEoPtdNg37wJfvsYiJP9NFqvHY+7vAwjSwxAeNxVO8T6aNVRRRlT6hHrJ0Ovaw0WDJCKng7g86APvNB9wg2JvXO33IFWOBgn8EIf2nRLD4tbe1+AU7yAWbZeskGHwVdd2mgAUCcNKnJgLQrZ/V9/Jnn5JUYmnAE3hCmv3+t8AWQfSzyPK/POOgJgDdsgqA5nfJAvLdLV+bz0kK4RqPZ3wQWJxyAPqDVhZQyQr7gyaXI9axWCFVAGLvRUhV46PgLnUWBs0HbBPszeudPuWKsTRZAJDTo8l8ui/42juL5veQC7ZpsEow+OrZQlqVVuH4FLA8WVyDAOTAmHUQCAWQkOlsQAwDt/9/AE8SgPQpNa07+AhAA6HLXbb5Xr4IaAMfv/eGvP5NzyYA7UGjBWTWjh40v9fSyscHLtaxhJWxFVsNNAXH1khw983+DYPmA5aCvXkdNIBccemfceooAfhAAcA+6A2xLuAGucxrzgKOMexDfV9OwbS2BB/BEoqLSrBoYGgJ3E8qLcIEsP/ngCPuUy7S13L3wb6PU56/m/Xj4Ps0TKCXQA6AXuNeZY3HMz5QANAeND1kwcKXlj6wOZQ+b7R+Pi0PD0DeFAfk590CKg8qncfoFzIRVWVqfFfBhgn25vXOAHLFWCDbvPstBsJZ4LUPt+jdesgFg+qVptWq11bg2gtgfuLiRAAgQeg+oEmsOujsXb5SsAoCIN/3vx04OlNM6Yv0tdx1MKvK7/TFjVmeCD4HQQQhf159eV7/pmc/kwCcKABoeYvR0oept7SEoZQ0Tr1lPuPQFlAtO0nyAcWhpzw/FSjFzGjLx+RGvxzoSeC1hwsA9klvaFN5FAy+9mJgnhaQ0qqagglADo4c9AhCDpJPl5ZommQ8738HcGw6AJBW1VecZv0cePwOY0/wl1lAD/WUCx0mMlDLr8bjmb+Dwp3x4nkDYbD0thIO5aNtfmDi/xGEeRawxhs7Vb/q2huABQJwAlhyy2cC0xoggjAAUCWWAkksOiIY978TmOOqeqqwqAx3WGhHK06n7TDwOcAV/iipPAKjwgrZm2o8nkUA0gKmAHTrp+o9MTrEYvq44o9pZIOtgmu8mafCV72YAKT/RwAy5OPOuVlAAk9Oule6xQRTWUKlWtkU/IvAHAHti5oIwDK841ZPFtCmdr0U8PaC9hVultd4CIC8P2Ztt/m5/qC11TJXlJDGGpfGAmYODgFoCxACkLpuWh3KCgqE8gNVZK4KtxgjJAB/2X1Krao1rfN7CWZf3LSBT4uAEIyWBVpipL7GgwA0AW25GbGENBTRx3rm1M2w39mmrFVwjTd1Kn+VAZALEE5LtIDyMWUBvbLNLGHgd5H/V07BDp7r3uU+Jadgn3ptxekA5MBri0/Wp4wzBjDbCnkMWMqVpE8GJwLQqvfc0pqbkVj5aNk7gbCxgJno30cAjntowtXNaZ1suvSKNhsYTcVKmw9F5xGE+94dfEoP+JYhD/8OC8eIPUsUHokVVKB78XszbzAF4Pvd//PCKVGIpOAr78mn4DZOm8YC1jco+w6EFTDDPJqeCEBZBa5GffVbhmQ8DtZW5TYOvPhXip0GTuu22lTMLSw+aAVl9QhEWjurI/aQiLJkTMLsX9R3r/ymZ73fp1+37OU9hunXSkdl7T3QrhKCtlCM59k2i5CMMSIAGdqxEIwrmptzTsCEut5yilKoJLAcxCq3fe8tLCDBFwO+tKjyuxSCMdYEXoeDrHcHvu0tTwLzmwHA4N/Gh6zNCqqeOSxC2lb8tQSiMwbuqXIqAcjFh2JjBKGJyShQG6ygVbfJegULWBYcMR3rvb6oCRaQwFPgl1M5rR7/JtBZOIZWx/0+s4QeY5z/1/X2tFnAxPpFELaVkdLN8MWGVr4pCBsfMHN8bmTKfCjZ0Ncp456/x58zLzfw6Qf3ABd8pUgEYmqk5bGyek06IQl1bkXScnlN/u8L24Gdx1qVq91KQvrpgwaAAw9p+wnXPw1YjyWMGtDo2ASOFGMU7SIEUzdYD34vMPmXwLbHgdkFYAtlGiim6DpxJtvq9LtlVr/aWKEB8pUXAOOPAFPzwBTZ9r04vdQ9Ts4pAZ3cd+yHxgfMAOH+vcA69/9Uxijmz/AerYpdar1lNSMYzV+vWY/34I8DY58Gph8Bpo8A04vAFEFIknIHohGVR62QhFRSYjQE6qFri2z3iaPAhHNNlxKwArI0Q1IAxwfReacbC5gBPp66/5ICgLKCtqnsrKKlrFZUFPKOr7osMTtdsxzqQRZ93Q1MPARMPllohUxRqkEK6gShOP0S+dY2hlRv99y+ovRi7IiTnTvLqmg6xDPYpqAUgRgsoR7MxgJmgHD/c4E1FXu7FRRbvEgd7evXWlbPpp9EgUjiJpwe6zwOMlvpAWCMVusJYPIYMOlSDZRpoGiNxKzbdIQlXONMWJbGtw4svdgz3El47nzTRvPrrKptAJT6ZrzfintvAJgx4vsvdQvIXK5VYF3sUZxmJUvgA1FOvwF8spKyBtM1y6EepI4LqVMedbEaTp0EIKdPKh5FqYYqSxgo2jgFr13j6XXHnOiSZOeBVSvyC8qC2r05FVvVw9cAMAOA178AWPMp2LJaaekiCPXExwHw660n1oB/niGQazwOkkSepbJ/72I1x4CJ+cJ6lYI1riccrVicUuVSmIW82pkwnHHVOKbFsOozQGkFkwewnBES37ABYMaAX39ZAUCCb82nIlo+40p2gNnvsoKunxH1xGwA/LOzdQOQJPIuHzV2GBg7Cow7AI0l33XfjOsv6oVodes6ISbBsAZMX+kJxU56KY7pkmFVhOciuvTzSt05v0+ryuT/9gDrZNe4wPMsI7VJP3GcP7gUOOdvgL1rRYJ0ZI5IV3hV4/wrGYPPU3/AiRhYusy2K7mU999P+z90ObD7LuBZK0Xdkeq9NSX2+o4HLwfWlopFCC0fgciBMtAFC8CGrYXVoVjnU2G7rTXrzh4kfRzLY1kyGwBoeiGcPiXb5eAzdXWnazPCSScb4j3xfmav8Cx2p50lAMW0VXINitCogl2r9H2dcctWwQxQsn6ZTBbMNtcgdKIbiZj51VcBk38CXPxoQcfCUg8pjcYgZScw/momACnXyr4leBhs5QaBTHpf7X8dMPYJYO8XgAv9e8QJlAZZq8D4xSuANYKPJQn0AR2AHKy1MACKe9nfFI6IEqduEWoHIJ9wlsVKLekoMCa9EAegSTYQeM4TXco2SEMkAHEbBZoj4bbYtdyCVrFqGXgTSxgXYTZeHLi9AMjEQRCVUXP/n4KUaaT8vVTi+Rtg7GPAuYcAWlMCgUVkQfJ2Q12yBvPXMwHImhDWwf81imsTiLSEvHZkr+jY/p9CQRD4p8DOBwteItai05qn31FFdfLlFxYWgCDUIkRkj/TxbCEi/89jfPZ3X2VqYSJQbmUNQY3HQT7hbv2sLoerVwKQHNEEoCsm8R4MhPRjXUGzVEIKIoY7yaEYuY4dgGb5RXruoSgtSCLLarkICQ9f6QNykGjFdjsIBaI4kGlt8W+Rg5g0HJ8qAp47nihAzFpuWtPIMBZJlASILvR6fQ0DCVbJCkJOJCqnk4pGpb99tZ8MopyiKDX7WWDiwYKXiEQOehCrgKh+eJQ+EQHo1Lby/zRlyf8TIbf9XS5ftIb8I92YugH4ay2pLusorl7dAoonWtMwQSTdOFuQSLTGHyIC8kxSIQuA4hwU2WUAoO4/grBcDbsfWElSzg+JCoYDoEGM1ixSkHzgF/wG7y8sIa3J7JPAGWuFJSQIaU01iJHUiYP4e33BrPOHmG/JMaOfTZVYRhwGav87vWKPJ9/rSH4IOGO5sITqg/ggxXs4TOaBAECbeoOsgfl+DrQShFqcEIhyyt0MbMusEkx76iAZXKM8BvXiZAGlF+KaIbaadYpem4aDgpJZQz6YJABV5VcHAJZ0v4FxX6KG5UpYs0KnqjhRuagEVgPglYAl9ciHf8mdUrJh0Qx9vkDBzBywfbkYQIGwahA/kglATsHsDzKA0BATiPyZ4NEDwIeoa/uFYKKXL2f24nQoIgd9R3yQCMTFqwIAfdBWI7+yB5ZLECYLETd85YJl+2YAUNosLIel/xYlu4Jsl6bhNhD6it4WJCvA2Zc4Gxo73RcgJeOqFmGR6rcChLYACyGojmEYdj59KnZ+tIQRhH9IvWA2hiREjDeRI9Cly7fMF3EtWRFawhQIf5IJwE56wdTIYdt7tp9ys1K8JnoJvod9Wn682PNkP4hUy1ndWgstAtBDMLYN5/6PAc5DGNoF4SrZfN+4+IhT8jqwg2Cp8ThIJ5vfSWBXAVCrWN9SMxDK+skaOvhoAc8me654pmUB3f0wyt+E8FyRAGmPlOEoiSD2qgvmAKoOm52fAuiTDHSyIRxx+lI0QxxADubfF5vffMmSajrWlP7nmZ3dSy+4r/ZzAUEHnQ8R70HsXlK+PgJsW68G4XYGZj0EY2EYATCAT6tAhmE0DXcC4faapcwMgAIfLb0kuzT9Qmw5uwAAIABJREFUSi+EfeALkSrpBovbrQDnkm8wAo8/E3i+CCsZ98NCpAp8cUekZyBavI4ET/TnaAk/RQCyAXy6uNSPA0i+wMeB6ePA5HFgZq2wpNGK3FUDAHmv3fSCe7afX8CB4UNEEOolVi/3obastNwJ9cO5BOBKEQMsAcifHWzRAigWWAlCn5K2bQYAOe1KMjTIR2kRUhKVS7IrLia0v+3xwHMZMCbYNP0KfG79zAqK5DxOvyEuWu6VD5KSHy2YAEQAfpaRdl5UkuUctIpBnCIIl4psD03FtIIP1ADAlBuJM47EqqUX3LX9kSBQcuuyftK78xUkHyQ+RLqHZ3Fv1KcgLj5kAQ1s0Qo6IA1nHhNLQzA8ZxvBXuNx8DcS5UYpNnoYxsCnUIqvZo0F3wPTMa7Hv53HOJVbS/l+5bumX7d+5WLE44hxIRJB2NMCqj9ixwuE90svWCaIA6bAp959EKeWChAyA0PTOV2unGMQveCO7bfqHbcS4rJR7Ewqnw5AWhLuImg2uFQAXAVs8RGmntW4+g2hB3P79L/EJ9zGvqrxOPibiVihAOgrWQOf/EBfBcsPNBBqW9Hv6zzGqFzmoXz3B9AePgXiq6bgiv4YOB9QHS8AfpkAFMMjrWAcQA0iO9XJiQyAnos2vV7ESHOOQfWCO7Zf7F40mZFQScRKAYBaSU6vAVcTgN7xXHiUFpDTMK2dFh56912BTiDcvpkATIXzCL4g3WXTZ4jpGfjoF/oihL+fx+0yWUABLwIwtYKKIabgCzHQvi2ggBKn0McEQDaKT5cGkIOo6SuyYzEfjQB0EM5nZgAPoxe8of3sgSqCQM3jkdFLvpRvR13+7UVRuhUFSavNO6otwp88ZZ3+t4M6HLtch6OT9AG/q9cmtf//gV1JDYcnQ2zY6/YakfSrU+Pg1M45NqPt3IEtoM7WFHokyrWKkooglCMWLYjiUXMtK3g8Uzd1WL3gDe3vRRCoUEYCwGtYFxxqgA2E/jI20F5hhmQod98BHNnlxOTig1aGiDanO21yV4DygWuB8YeB6fnC9WEtiKVVKeE0ZGiXWczeJoWMIig5a9V5DA1ANoKDeDylZ9NSXxyAsiKawrQqmCv2HVf5e8aRoxfc1n7xs+khItAUvojvyWryxVcWJZksVSyZoQRA3dcAoHzax4Gj2wtu6FVKM7gMgti02jbV476oUJJs1j/AbA1mQ3Pm8eTRsoZDtR+xZKCiEKmMXTIeXHPGdhYArX8FwG4DGMEnAHIK4yvT58nWC2b73cexaZgWWaEKgU1gjNbPP7PvOYGsUSBkv3hBtmRWNzxjTk9RWktvxp6POj0vARjY9sWkFel8RWxegjIF4RjwAOnZWMPBTGjqvHmszxJOBUD3xyznL2bqROvoP3N3q84jG4C7M/PpcvMBef0cvV9k6hXv+2Yno5QfGArRbaCC0mWv2YtF3ecerNDhkNZIIsXQRv5dlTtGADJSz2gEE1EJQM//026HdIEZLC8B6A0tk0g1Ja8DuzJdphS82QBEZj5dbj7gxZN5er/IZI+67pscgE7QaDOUMyC0Wb8+gXjuR4F5J6YsaXnFhBoAGEVvUhb60jISgCQnoh/OLBgvIrL8v7DdFkEYM5dtNg97tvz5zJqzdfIBmJlPl5sP+DJP5xtW7xffnzeh7H+Z+3+RpkyWT1YxuURJYVtx6T0fCTocouQV85VkHRIGegEuEv/YKpkA/JceVmL8kv6t5/9pu62tfiPWcFQVEa0DZ9WcLJEPwMx8uvfnjT9IgZyj94t/ldeA/S9tMaGa9SNdmsIxbvVscVJ1GScoMt4UPwhAsmMZ0aXzQBsvdGRBjQz0FUpEJRAJQOq4KAnBdz+sfiPJ3bOYn8fsykyVWMfiN3BOzckS+QDMzKe7OW/88aqQzsfE5kH1fvGjeQ0wADodmVGwOeiMsUqHrGOnS4UFy9P/wAEojkEnI+IqOIJQNLgpCXhcmLAtD/D+kgQE235L93tj+YBqgTX9BiCeW/NedT4AmQ+YkU/3sbzxBymQuZhm8g1T+QbV+wWFdjKO/Te2mEFNlCb6gPF708VJ1TXHgKd91GnZpDfi1k/gM2vqU3DUnCuBmNQe3P9vw6pe229KOvB0K1k+ZS+rnrfM2AlA3JMZtah/EZKZT3drxuDz1O/yxAwu9JgJxr3lQfR+8aa8Buy/wdWQZAVl+ZzCrG3q9c/YrkmHy3IRYryAAqAkEBIlopJxNNUbER+fA/H+/+AAdP9PmS9dazicJybm7mlB8nR2dI1HvgVkOlZGPt2nM29GCamcGZjAwlQ+vvrV+8X/zGsAAUiLVPp/wd+zaTMFWw+/kAA0GQQnpCw5mDsAMIrcRB5mC/+MAffTwgfwKY2KfmCZ6ZIkUShrxXxBX4yYaV8Hzmcn13jUA8CMfDqWYeQcSkhVOl8U6uxH7xekrsg49h8oiCENgC5TUG5vKxxT8f2aRtOtcAKQ1s8soPuOVUIwpchNlEEIOyNSIrrvv3hwnckWIZPZsnbcDyzTpvg3lU8mpZQqozyfK74aj3wAKh1LgrsD5tMxiz/nkGD1sHq/YNFOxkEAcuW7oqmXlisuQOT7VV2jwi/kTgj1RkoZhBje8Z83SCAEEJZW0C3gff8tADCt4VASaWIBK0HI9q8BF5yUAMzIp8tNx5Jg9bB6v/jdDPSRns0BWIZeUitIo9IhHmhXTvzCPQddccnZ76U1V/IvC4SBCFyg26DFNg7c++Mhhb6qiCikT7WVUmr6lYn2nRKyrdZ51GMBlZIc07GUBdMjny6XCiUmpA6j94vMZbgBMFo552pu27PXAqXTyAUQcitOQjAm9xX0N9pIwIPmSCmH5QuPqER0L4kDYgp9zOUL6fYxkbZcFceyAreAF3GlV+NRDwAz8uksnT3jiILVSmpWNlhMze+k94vMZfgGAPJeHDjpCrgM01Tdry9OzvmYAzAqLVWIwEShwzbRwwSEn+MqP6bQK5tZlWyhjCCCsC19Xv7gOnBRbgp7cu/5AOyVjqVMmA75dJZ9nHF0yohWNlhMxKnS+0XmMtwAmFq4imnYbrEqNJPc+9kfd62RKh0On8qV9hXZ9askEPgAfI56ziocUgVbzGT28lEtRMoKtg7lBHtznfZNA+CQ+XQWM8k4uglWK/NLYKzS+8U9GReXD0g/Tyvh4Ne17Yb4Zbr6g6y7/aNWcoPpjKRTsJIags5IJwkEAv6en05S6GUBfRWsUExZyVZVQCQwrgN7Wfdd41GPBczIp8ODeXfTSbBa6YYxlY8/p3q/udc3C+jTbtvqt2oadnB2m4oNgMn0W0p+hYWHWbwg9yU/0Kb9EIy+5y2hiCit4UgKyTeAkN8Valk4Le/ldlONRz4AWWBRM6fdIPfHstw/G+SE5rMnVQ/kA5AkLHS0ak7V7reXfhgACaBqDtD3e/nmc5k9kA/A80JReq+U38zGVp3ObJo/BvAOD3dtwiWar9zEHsgHIGlFubqSx7+Jja36anLLcDvvgwA+NDpDfILv+qlzuXwAXuSjrkKemlO2e3U1uWUYnL8dwB/5e2apca9LNv+vsQfyAUheX4VguB+mzIsaG9ntqxhF4Xbe3QD+n7/uHLAW9wQ1tblMRQ/UA0CaHC7plXEh+q4T0OWcfhleYTSHBK0EH/mi+fcRuKQn4I6fWpeoB4AevCz3HOOm9yb3F5mBlZBNclYCj1aRfyfrbgPCTR6AzK+vD4CyglX7jpmN7HY66d1E0ctdIrEEE4wEIMlam+Pk7YF6AMj7EwAVbU82vTerCwhAXopJN9zVI+AYrOeULLZgErY2x8nZA/kAJGWr0naUWdFpy2cT+oCWjpdjLFxE5UzYIBBpEUX5nLnlvAktb76SPVAfAOUHpiAMm96bsVtCAMaKALICMyxDq6cXfycA+b/mOLl6oF4AiqBRIEzBp7/X2Af0+fi1XIioMIlAI+AIPIGPmeROWV3j1Zuvyu2B+gHoFfZiDS2lC0LiY52WUADkQoTTMH1BFSYRdHoRfKSu5v9qrizMHYPT+vx6ARhSuDcAzzmDo5ZGHT1PAKYMwQxME2jiSo/gEwBrrq+u41ZOy++oD4BaCcsXTPiSI3ey8s4KGoG8QwCMFM+0ggQhLR0BF19SXuD/ayakz7uR0/TsMcxg3SjfqWNA0hsrga/ojaq/8WPcC+YIk4Ke4CMSuB2XVht1Oj8zIfXlU8BtU8DhmYRXWdfrdF1fgr3+S8At48CD04DVjXQSDO70PTUnaJ5uOCwsIIFHSSFy1pKPWCDsZxCpw8UVgKSPxLXM937OzxxAljzcPAbcswU4Qh4V3UN8mKoeKm/bu78IfKJQa8VD48CylHQiL3O3/qg5Rf30BKACMtJXjXKQcfBSK8Dfqc3KVCwuN2VFGRnm/yKZtq4Re5ifyQQgM2A+BeB3GHaZBo5MAIue0l7Kt3cC4xhw+5eL7TuCkJk1jBtyerbUfYG5ExjZ/pqrxE5fAOrOq5SmowVIrRp1IyT2R6+fg0bgVYG4CsyZe2UsaiOGKXr4Sfp9k8CxCYAFSKyvXeY1o1BxQux91yMtfsHPutgnnyUuUvhc0ZsgUXib+nVkq6+ZKaABIHsgVZnuwD9sVo66rrR4ImdhLGSQ8zPL/JgBQxeU1ouWkO9PTgDzbgmXxrzMkatl3keivfG5x4r4IRcz5BfkO5vEZ0kgpIfBZ8yKjlL17syy0tMNcOn9dl4Fy6dLFabj1Mpvow9Ify+I4Nlo9Xt+ZqU9VdJpqZh4QDDyxUyYOYJwHDg+DhgI/WUVZl7aSEt93+GO9Ia2iuZKOfA7lhp9JpvAVy61w2mOwO5hmCgMHC1H9O24gu6UD9jP+ZmbtLRaSsei9SL4XDPbAEh/kGQ/pSUcc0lbApFWb67lQUhpVnLBsoKqqZclFMmUtrxPcwxl3X7vOCAtYLSCcugFQmqhdssH7HU+RznjiOlYXA8wqkOfkItTAom+oKygca4ES8jY+N3z7fSG4hfUtp3ihUHruVSsFy1iRvNP+1N7A5BdJACmVpAgZPhGOyCigEjlPLudn7kvFtOxuB4g6OjD8UWLRkCZFRwrLCEXJQQhp2K+37lQeBCRX1A7KPQto1prFEmSYn2mB9EAsO+kYfk8KQhZF8yjVz5gp/MztyOUjiW9bCUhEBhKRCCgSis45uQ/PhX/xfFWMgOnWu2gxB0TF/o0kEZ/kCDM1Ts+3RHYnwVUL6XhDFrAswfIB6w6P1MrTulY0sum1VICglKwCEACqvQFCUK3gHcsFQCM/ILayqP1k9JshVqrncMalOYYvgcGAyCvIwuod8YBJQmZpmGJeyRwkGw4n8jJOJQNw3idLFhMRNB0SgASTJyKoy/4ieXCeFfJBUeV2SoAclFyR0bbm1OHTUiN0/DTAwD7zQeM52dqj8VsGEkVE2jKetG7AEhQ0frJAv6RC0trC1skl+IWlNinGLbSaZg7Mc0xfA8MbgF1LQV1z08A2G8+oM7PVF9Ms2GUE0gQyp+Lwu2yagLgR9ZaYpkSypQ6a6Q2DCqzpkvietXIFdoZfuieGmcOD0DeP0HEbBhNwYPmA/L8zJQsATAKnguEqS+XTqkE4YfWWwCUFZTksYAYwZfIBeN9Tw0cjOwu8gDIZqsoSSvhEeQDiiGYFoyWiSDRypWgi69UP5sc5fIcquSCNeXqe2X9ZAHfM7Khe2pcOB+AT41+aO5iRD3QAHBEHd9ctuiBBoANEkbaAw0AR9r9zcUbADYYGGkPNAAcafc3F28A2GBgpD3QAHCk3d9cvAFgg4GR9kADwJF2f3PxBoANBkbaAw0AR9r9zcUbADYYGGkPNAAcafc3F28A2GBgpD3QAHCk3d9cfOxqYJ2au9RdPtdp/khoEOlglDYT39V1PzQFXLsMXAlgt9PCxJKPbufyf8/KHIPfBPAZABf79Xc5XQ0ZQ1Q7360NbxoHrlsDvs5ZRsgo0une06by6X1mZvtP99PNAp4F4LsBXA5gjw8EGTeqaGF4QhzQF80CX7cAvGIdeDYAfhdZ2sTKUcVrpE7nd31N5gj8e2dIo2osk7NZpMdK0Z19tv+bJ4F9K8D1ACj8yfNSikHeg+5Z969m57Y/8/ZP+dPLKZhP/rcA+AYAF7g1oRUhEMUzFMt6eSJfX78b2DkPfM0i8GIAX+uWlAMppreUUErn8p2gzTl+2flg/sDbTkvIOik+CP20//mzwAXzwDcCuNTPJeFXpEpM6QEjIHm/zTF8D7T5gATYNQCe69aAloRTGulfBESBSYNyxR5g/Bhw7hKwZwl4vk9LnM5JmsBzUyDGAX3B8G23Mz/g9BuUa/0IiutfMkj7zwKmngAuXSvOpUvAWYBtF4BTnspIj/O8zPaf7qdvWITw6eZA0JLQEhKEGgxZhUj/dz3NzSKwbR44exnYvVKcy+mM5Km0JhxInUtrGkmzCPicg3W5LMGkQiZZTm9xS9Z3+4m2o8C5c4X15pTKW2Lb+fCx7WLtjYxzqiql29Icw/dA5SqYf6RTTilg+lYCIXmICKQ4IK9wxfSJY8AZK8CuFWDnanEua9ZTAMsaCog3Dt92O/MvnRGBtGwkqKRmMEkqCaa+2k+0LQDTh4rP88UHj74kF1WaATo9QHQ7mmP4HugYhtEKj4PB6ZQ+FS0hQahpldPya1kXTOqNY8DscgG+HavAttUCvBxInitrkgL4lcO33c7spBdM3kAuSnq2nx9gQfAh4JyVwvrxwel2z3p4aMlzH6DM2z/lT+8aB+Q/OT4EEqckWQSBkGD6EQKQnDCLwBSnYgcf32fXioGUFawC4esyu7CXXnDP9tOCsyD4KLB1rmgvX7zfbu2WG/Jtme0/3U/vKxBNAMoi0KcjkATCN3HOEr3UAjDrwOP71rXixYEkeKMFlSX8ocwR6KUXTJ7AaNE2tF8WfA4Ye7Kw1mwvX/yZn+eKnvcrfzC6IK/ObP/pfnpfAGQnySoISBqUXyAASS1AK0JfagWYcRDOrAF66TxZQU7jBOEbM0egH71gcgXSFZAV54NQtj9YcNIpbONCyh8Ygi8CVospApDuB63g92W2/3Q/vW8AsqM4gLIKBBIH8bcJwMCNMX68BTqBb8s6sGWtsIA6jwDk662ZI9CvXjA5A6NVa2t/IAicnC/aGV+8T74IQPm/AmGuBc+8/VP+9IEAyLslAKMV/LgAyIUInfnjwPQqMOOgI/DstQ5Mr7UAqMF8V2YXDqoXXNl+EQQ6N9v29aKdesUpWJZbAPyPme0/3U8fGIDssDid/pUASCvCaXgJmFguAEfgEXT27gDkuwaUg/nbmSMwjF7whvbLhSDL5TwwvdRqo9oqHzACkCB8U2b7T/fThwIgO01T1IMCoAZxGRhbKoAXQUcQTjkI+a4B5e5FzjGsXvCG9gdqrLGFYrpVG/UuHzBOw2/LaXxzbh43DKeoJwlAHqLndSs4udoCoIBHQE45EPk3DuitmYOQoxdctp8+rFwIWsGFYiFFoLGNchcEQC6e+OJC5J2Z7T/dTx/aApYdJ37AyJK/DIwvFxYvWr0IwEn/H1Opco5sveDUhSAAF4HJpQJkWixp6k2n4IYfMGf0amDHev2I8+l4/UbvNw8Eozw72wJePOJ8und7EkKj9ztKGA1/7WwATo44n45pWI3e7/AAGPWZ2QBkYHCU+XTMfGGQmYIxjd7vqOE0+PXzATjifDrKtTZ6v4MP/MlyRj4AR5xPF+VaqZLJF1UzKdPV6P2eLDDr3I58AI44n07ZMARbo/d78gMubWE+AEecT8e9YOn2Uheu0fs9tUCYD8AR59MpG6bR+z21gKfW1gNAz4geRT5dTEZo9H5PPRDmAzBmRM8BJzqfLiYjSKKr0fs9dYBYDwBHmE9XtRfMsIz04aQZ1+j9npygrA+Akqs8wfl0BCCTWRq935MTYL1aVQ8Ao1zlAnAi8+kEQGZTNXq/vYb75Pt/fQAcUT5dBGCj93vyAaxXi+oDoFLyT3A+3Rcavd9eY3xS/z8fgCQX/LPR3SOzkon55jg1eyAfgD8M4NcAPD6aDmBtB1e4NMDNcer1QD4AbwbwxwDe4UvRE9wHZG1gNSXDLlwLNcep1QP5APxzzwj9IIAPnXhT5ORc5EYCA9HNcWr1QD4AmRH6FQBMTSZZH98ZmD5Bh5g1FopiNns1x6nTA/kAvAfAEwDudnI+EvQxPfkEzYfaCXRSBluQMB7YHKdGD+QDsBNBH/9+AkAobqTADGK7Inw1x8nfA/kA7EXQt8kgrGAGMfBxZ5Cv5ji5eyAfgL0I+r68uR0QmUFoBQU8vfNvzXHy9kA9AORoMw7CdGQCjoUZDwL4kv/+8OZ1gJhBIjGDgMh3vTavBc035/RAPgD7JegjODfhiMwgoqeJwNPPTaB6Ezq/hq+sB4AcXeXEP+ZhGVo9vRimIQD5v5oPAZCupgDI9wg8/qz/1Xz55usyeyAfgMMQ9GU2Op4eAchpOIJQQEz/VuPlm6/K7IH6AMjgGzdl6QtyX5jWjpQFevF3lq3xf6yhrOlIAUgQCojR8gmE+l9Nl2++JrMH6gEgR5UA5KYsc+AZmCbQCDi+IvgEQMob1XBEAHIajgBMLV+0kCdws6aGu3zqfkV9AGTwjftg3JRVVRAtHQEXX/wbAcoXP5d5CID8GoJKvqDAloKOoIz/y7x8c3pmD4zhaqwjRzCYyQg5gr2ZgsFTLweWr8XQgsXjbwLWrnNtMlKgNoLBmZAa7PTCAuYIBlMvlWQswwr2UlUw45jdDSx8HbD+Ctd+HVCwePKbgJV9aASDM8Yg59TWFDysYPBtmYK91IbNOHaPA/M7gUXKXA4hWDz79cA8+W0aweCMURj+1HYfcBjBYO54MMY3tGDv8I3nmWSHOzYOLJ0LLPGXAQWLz3oB8MQUsEa16kYwOG8whjh74yJkUMFgbsNlCfYO0epwissVY34bsHw2sEIRkAEEi/dcU0SP5qhF1ggG5w3GEGdXr4L5134Fg4kAjuDQgr1DtDqcUmZETwArZwAru4BVqsv0KVh8/o3F4v0QXZBGMDhvMIY4u3MYhv95Zh+Cu1xBcxuOU/HfeDIq5cv7FuwdotXhlCBXjOXZAnyrO4BV6in0IVh8wStLuWCsUAyvEQzOG5ABz+4eB+R/ewnu/kOP/3G/l4kJTERlljQtIot2e53/IwO2OPl4FLtcnCqAp9cahT56CBZf+LpSLhhz1N5qBIPzBmTAs/sLRHcTDKbiNHdBGGymOC/3hglEvgjAnoK9A7Y4+XgiV4zVWYDAs/etxaubYPFFP1QkLtCIP8neaASD8wZkwLP7AyC/tJNg8L/xLNBu+YBdBXsHbHEFAINcMVamgdWZAoRrfPdXm8KitLdmgYveWAq+2y7iMqfuRjA4b1AGOLt/APJLqwSD3+y5T1yI0AoSbAxMMzGV1o8/My2ro2DvAK2t+GgiV4zj4+3AIwDXtwBrVJeuECze+9aW4Dut4PxkIhYsdetGMDhvoDqcPRgA+SWp4O4veQ5Uv/mAGwR78+6rQq4Yq9PAOi2fA4/vBkKudKVU7VZw77uKvWFuZbtcMNb5v0YwOG9g+jx7cADyi6Pg7gccgIxlcA5TKhaD01yYKBmVFpBZMfx/m2Bvny3t8LGqoqTliZbVI+gMgHwnMAnCIFi897cLAAZ6QyzFzzSCwXkD1OPs4QDIL5XgLmk5JHk/SD5gKdibd38VcsVYGmuBTaAzEHLHgyCcaokB7/1IkUET5IKxwF5pBIPzBqbPs4cHIC/AaeqvPL9pmHxAE+zts6VdLCD/lcgVY3UyWD0Bj1ZwqgCggXA7sPfWAoAJvaEtZBrB4Lyx6efsPADyCtmCvf00s/NnOsgVY3m8BTRZPZuGBUACdArY+5lWDqGmYbIrLHEx0ggG5w1OH2fnA7CPizQfaXqgUw80AGywMdIeaAA40u5vLt4AsMHASHugAeBIu7+5eAPABgMj7YEGgCPt/ubiDQAbDIy0BxoAjrT7m4s3AGwwMNIeaAA40u5vLt4AsMHASHugAeBIu7+5eAPABgMj7YEGgCPt/ubiDQAbDIy0B8ZYNMbkX+ZekpuIiOQrPar+xs889HJg6jZg5jAwvVZ8B+ll9PlO5/Fc/o+ECjnHfi8zYfkvM5ulmp4qJXVqx5deD4zfAkw/CGxdAZgoHfuh131QkaI5hu8Bs4Ds8B0AWLnIRGCBsFfn87JffDMwdjOw5R5g8giwZa34jnQQUwDo99wBfJ4TM7COiNdlaj2rA/jeV/vfDeATAP4UGH8I2Lrc6gc+SHqY4oMZ74VSKM0xfA+UUzB/oBUUCKMl6zSQ/PsXqZD5KQC/A0w/DEwcAcYXgYnVwppwADuBkefnCim90FmBWXwnK87Uen53BI8sbuwqaz9p5UgnQhBS+ZN1zE8Ak0utviCwq8DI8/nx5hi+Bzb4gJzKZE1SEFZZgS9/2pWR/gTAJ4HJQ8DEMWB8ARhfBsaWCwDquwQKvvNgHXvOcYVbPFJPkw+dDxC/W1Y4tWDpw/Rlgo4lo1T4/KxTihDNpJwj3/UiMLXemprjffC7eWpzDN8DlYsQDiKtVxzEqoHkyX9HRizW+nIgaQnvAiaeBCbmC0s4tgSMu2rMePAR9X252jXklaTFU108K0MHav/nvJ6ZxVVk9OI7GR2IZoGQNc/HgbHgIwqILIVujuF7oOMqWFawCoRxkfEIB5CWgkREBCNf9wMTc8A4QciBWyoGz16rwNgaML5eWKpctYZL3N+TWLX0gvtuP0HHk2n16JDyxXmVhfU0qywbJbr5GSuXKxA/sV5Y9UYWdnjwyS3qKKgarWA69Wg6fjQOIK0HadnIjPVFB+AiME4AuiUkCFnESyCSkmAuU7Cjm15wX+2X2ifBRn9A8mKcW2UFjULVQcgVDl80u40SYh763FfvquhLCxitoBYUsoJfjXKttByMq9CKcHn4sPuCbgXNJwyWkECcz5Q376UX3LNncZyQAAADEklEQVT9fFgIJs6lBBwtn3Tt6FpIz4RWnuQxPh2XIGzm4CwQ9hWIFgBTK0gQHiIAJddKq0ELQh+KL1qUR4MvSEsoENIKrgALHNiMox+94K7tl9qnnMio8MSf6SNwGpYVjCDk/Ju7isq496fCqX0BkDeqlWwKwic1gAQSpzGREnFgREz01eALLvvq2Kfi45m6cf3qBXdsfxRbJMho8dimqOhEK8cXQRr9QVpvPoDNMXQP9A3ACELFxPh+jACkP0fLIKFCCRRqKuPUdqjlC9o07JZwKVNHeBC94DQcZO0XAAkmgotAk9QYrR9f/BvByYfMSATDVMzwTXMM3QMDAVAgVHCZ7/MaQK4QZUHiNCbBQlqUw74YCb7gcmYkelC9YFlwvVv7RRAorTuBkECU9asCID9/x9B935zYzyKkqpfiNHxcA0gLQgvBAaPVkCqm3h2AtC5m/RyEqzw/4xhGL3hD++MmslgqCbgUfLKAcRrmTlBzDN0DA1tAXUlWcDm1IOIIJAjlT/Fd05lbFQFwjdtgGcewesFt7Rc/Gx8iWjUCjGCT1YvWT1MwgUqrf3NG45tTbcu0aximWx9xENcEQHGbcYAEwtSXSqY0gnCdgeuMI0cvuGx/FUGgFhwEYrR80QckWN+X0fjm1DwAWv8RgJFilJZBznz0pQg+AZAAlVWh1GvGka0XzB0cCQi30aSGVa9AF62fLOB7MhrfnJoPwPER59Px+o3e76mL5Kwp2G57xPl0kxc3er+nLvyKtLmhfUC78RHn081ONnq/pzcAR5xPR9mRRu/31IVgvgUccT4dNaobvd/TGYAjzqejumqj93s6A3DE+XRUg2VSCjdaGr3fUw+I+VPwiPPpqJjO8J1Nw43e7ymHwHoAKMFd7QErAeEE5NNJMb3R+z3lsGcNzgfgiPPpomJ6o/d76oGwPgCOKJ8uKqY3er+nKwBHmE+noqRG7/fUA199U/AI8+kEwEbv93QHoEhZTnA+nYqSGr3fBoAtaiqBUImdm5hPJwA2er+nKwBHnE+X1gUzSbnR+z11wPj/AeCpPDD3t7rvAAAAAElFTkSuQmCC"
vendor: 7,460 bytes, lines 10229-10235
10229,DLe="uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",PLe="varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",Tf={LOW:0,MEDIUM:1,HIGH:2,ULTRA:3},JX=class extends Sh{constructor({preset:t=Tf.MEDIUM,edgeDetectionMode:i=TM.COLOR,predicationMode:r=xPe.DISABLED}={}){super("SMAAEffect",DLe,{vertexShader:PLe,blendFunction:Hi.NORMAL,attributes:hh.CONVOLUTION|hh.DEPTH,uniforms:new Map([["weightMap",new at(null)]])});let n,a;arguments.length>1&&(n=arguments[0],a=arguments[1],arguments.length>2&&(t=arguments[2]),arguments.length>3&&(i=arguments[3])),this.renderTargetEdges=new $i(1,1,{minFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new pU(!0,!1,!1),this.clearPass.overrideClearColor=new Ht(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new il(new RPe),this.edgeDetectionMaterial.edgeDetectionMode=i,this.edgeDetectionMaterial.predicationMode=r,this.weightsPass=new il(new FPe);let s=new tY;s.onLoad=()=>{let o=new en(n);o.name="SMAA.Search",o.magFilter=tr,o.minFilter=tr,o.generateMipmaps=!1,o.needsUpdate=!0,o.flipY=!0,this.weightsMaterial.searchTexture=o;let l=new en(a);l.name="SMAA.Area",l.magFilter=Ei,l.minFilter=Ei,l.generateMipmaps=!1,l.needsUpdate=!0,l.flipY=!1,this.weightsMaterial.areaTexture=l,this.dispatchEvent({type:"load"})},s.itemStart("search"),s.itemStart("area"),n!==void 0&&a!==void 0?(s.itemEnd("search"),s.itemEnd("area")):typeof Image<"u"&&(n=new Image,a=new Image,n.addEventListener("load",()=>s.itemEnd("search")),a.addEventListener("load",()=>s.itemEnd("area")),n.src=Z6,a.src=J6),this.applyPreset(t)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(t){this.edgeDetectionMaterial.edgeDetectionThreshold=t}setOrthogonalSearchSteps(t){this.weightsMaterial.orthogonalSearchSteps=t}applyPreset(t){let i=this.edgeDetectionMaterial,r=this.weightsMaterial;switch(t){case Tf.LOW:i.edgeDetectionThreshold=.15,r.orthogonalSearchSteps=4,r.diagonalDetection=!1,r.cornerDetection=!1;break;case Tf.MEDIUM:i.edgeDetectionThreshold=.1,r.orthogonalSearchSteps=8,r.diagonalDetection=!1,r.cornerDetection=!1;break;case Tf.HIGH:i.edgeDetectionThreshold=.1,r.orthogonalSearchSteps=16,r.diagonalSearchSteps=8,r.cornerRounding=25,r.diagonalDetection=!0,r.cornerDetection=!0;break;case Tf.ULTRA:i.edgeDetectionThreshold=.05,r.orthogonalSearchSteps=32,r.diagonalSearchSteps=16,r.cornerRounding=25,r.diagonalDetection=!0,r.cornerDetection=!0;break}}setDepthTexture(t,i=ed){this.edgeDetectionMaterial.depthBuffer=t,this.edgeDetectionMaterial.depthPacking=i}update(t,i,r){this.clearPass.render(t,this.renderTargetEdges),this.edgeDetectionPass.render(t,i,this.renderTargetEdges),this.weightsPass.render(t,this.renderTargetEdges,this.renderTargetWeights)}setSize(t,i){this.edgeDetectionMaterial.setSize(t,i),this.weightsMaterial.setSize(t,i),this.renderTargetEdges.setSize(t,i),this.renderTargetWeights.setSize(t,i)}dispose(){let{searchTexture:t,areaTexture:i}=this.weightsMaterial;t!==null&&i!==null&&(t.dispose(),i.dispose()),super.dispose()}static get searchImageDataURL(){return Z6}static get areaImageDataURL(){return J6}},LLe=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; 10230#if VIGNETTE_TECHNIQUE == 0 10231float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); 10232#else 10233vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); 10234#endif 10235outputColor=vec4(color,inputColor.a);}`,Wb={DEFAULT:0,ESKIL:1},OLe=class extends Sh{constructor({blendFunction:t=Hi.NORMAL,technique:i=Wb.DEFAULT,eskil:r=!1,offset:n=.5,darkness:a=.5}={}){super("VignetteEffect",LLe,{blendFunction:t,defines:new Map([["VIGNETTE_TECHNIQUE",i.toFixed(0)]]),uniforms:new Map([["offset",new at(n)],["darkness",new at(a)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(t){this.technique!==t&&(this.defines.set("VIGNETTE_TECHNIQUE",t.toFixed(0)),this.setChanged())}get eskil(){return this.technique===Wb.ESKIL}set eskil(t){this.technique=t?Wb.ESKIL:Wb.DEFAULT}getTechnique(){return this.technique}setTechnique(t){this.technique=t}get offset(){return this.uniforms.get("offset").value}set offset(t){this.uniforms.get("offset").value=t}getOffset(){return this.offset}setOffset(t){this.offset=t}get darkness(){return this.uniforms.get("darkness").value}set darkness(t){this.uniforms.get("darkness").value=t}getDarkness(){return this.darkness}setDarkness(t){this.darkness=t}},td=class{constructor(t,i){this.enabled=!1,this.effect=new t(i),Object.defineProperty(this,"opacity",{enumerable:!0,set(r){this.effect.blendMode.opacity.value=r},get(){return this.effect.blendMode.opacity.value}}),Object.defineProperty(this,"blendFunction",{enumerable:!0,set(r){this.effect.blendMode.setBlendFunction(Number(r))},get(){return this.effect.blendMode.blendFunction}}),this.blendFunction=Hi.NORMAL}},NLe=class extends td{constructor(){super(mLe),this.blendFunction=Hi.SCREEN}set intensity(t){this.effect.intensity=t}get intensity(){return this.effect.intensity}set luminanceThreshold(t){this.effect.luminanceMaterial.threshold=t}get luminanceThreshold(){return this.effect.luminanceMaterial.threshold}set luminanceSmoothing(t){this.effect.luminanceMaterial.smoothing=t}get luminanceSmoothing(){return this.effect.luminanceMaterial.smoothing}set blurScale(t){this.effect.blurPass.scale=t}get blurScale(){return this.effect.blurPass.scale}set kernelSize(t){this.effect.blurPass.kernelSize=t}get kernelSize(){return this.effect.blurPass.kernelSize}},ULe=class extends td{constructor(){super(vLe)}set contrast(t){this.effect.uniforms.get("contrast").value=t}
10235get contrast(){return this.effect.uniforms.get("contrast").value}set brightness(t){this.effect.uniforms.get("brightness").value=t}get brightness(){return this.effect.uniforms.get("brightness").value}},FLe=class extends td{constructor(){super(bLe),this.effect.offset=new Me(.01,.01)}set offset(t){this.effect.offset.set(t[0]/1e3,t[1]/1e3)}get offset(){return[this.effect.offset.x*1e3,this.effect.offset.y*1e3]}},kLe=class extends td{constructor(){super(yLe)}},HLe=class extends td{constructor(){super(MLe),this._hue=0}set hue(t){this._hue=t,this.effect.setHue(t)}get hue(){return this._hue}set saturation(t){this.effect.uniforms.get("saturation").value=t}get saturation(){return this.effect.uniforms.get("saturation").value}},GLe=class extends td{constructor(){super(RLe),this.blendFunction=Hi.OVERLAY}},zLe=class extends td{constructor(){super(OLe)}get eskil(){return this.effect.eskil}set eskil(t){this.effect.eskil=t}get darkness(){return this.effect.uniforms.get("darkness").value}set darkness(t){this.effect.uniforms.get("darkness").value=t}get offset(){return this.effect.uniforms.get("offset").value}set offset(t){this.effect.uniforms.get("offset").value=t}},QLe=class extends td{constructor(t){super(CLe)}set focalLength(t){this.effect.circleOfConfusionMaterial.uniforms.focalLength.value=t/2e3}get focalLength(){return this.effect.circleOfConfusionMaterial.uniforms.focalLength.value}set focusDistance(t){this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value=this.isPerspectiveCamera?t/2e3:(t+992)/2e3}get focusDistance(){return this.effect.circleOfConfusionMaterial.uniforms.focusDistance.value}get bokehScale(){return this.effect.bokehScale}set bokehScale(t){this.effect.bokehScale=t}setCamera(t){let i=!1;(t.isPerspectiveCamera&&this.isPerspectiveCamera===!1||!t.isPerspectiveCamera&&this.isPerspectiveCamera===!0)&&(i=!0),t.isPerspectiveCamera?(this.effect.circleOfConfusionMaterial.adoptCameraSettings(t.perspCamera),this.isPerspectiveCamera=!0):(this.effect.circleOfConfusionMaterial.adoptCameraSettings(t),this.isPerspectiveCamera=!1),i&&this.effect.setChanged()}},VLe=class extends td{constructor(){super(ILe)}get granularity(){return this.effect.getGranularity()}set granularity(t){this.effect.setGranularity(t)}},WLe=`#define GLSLIFY 1 10236varying vec2 vUv;varying vec2 vTexCoords[9];uniform vec2 resolution;void main(){vUv=position.xy*0.5+0.5;vec2 texelSize=vec2(1.0)/resolution;vTexCoords[0]=vUv+vec2(-texelSize.x,-texelSize.y);vTexCoords[1]=vUv+vec2(0.0,-texelSize.y);vTexCoords[2]=vUv+vec2(texelSize.x,-texelSize.y);vTexCoords[3]=vUv+vec2(-texelSize.x,0.0);vTexCoords[4]=vUv+vec2(0.0,0.0);vTexCoords[5]=vUv+vec2(texelSize.x,0.0);vTexCoords[6]=vUv+vec2(-texelSize.x,texelSize.y);vTexCoords[7]=vUv+vec2(0.0,texelSize.y);vTexCoords[8]=vUv+vec2(texelSize.x,texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}`,jLe=`#define GLSLIFY 1 10237#include <common> 10238varying vec2 vUv;varying vec2 vTexCoords[9];uniform sampler2D inputBuffer;uniform sampler2D historyBuffer;uniform sampler2D velocityBuffer;uniform sampler2D depthBuffer;uniform vec2 resolution; 10239#define USE_YCOCG 10240#define USE_CATMULL_ROM 10241const float feedback_min=0.5;const float feedback_max=0.95;vec3 RGB_YCoCg(vec3 c){return vec3(c.x/4.0+c.y/2.0+c.z/4.0,c.x/2.0-c.z/2.0,-c.x/4.0+c.y/2.0-c.z/4.0);}vec3 YCoCg_RGB(vec3 c){return clamp(vec3(c.x+c.y-c.z,c.x+c.z,c.x-c.y-c.z),vec3(0.0),vec3(1.0));}vec4 sample_color(sampler2D tex,vec2 uv){ 10242#ifdef USE_YCOCG 10243vec4 c=texture(tex,uv);return vec4(RGB_YCoCg(c.rgb),c.a); 10244#else 10245return texture(tex,uv); 10246#endif 10247}vec4 sample_catmull_rom(sampler2D tex,vec2 uv,vec2 texSize){vec2 samplePos=uv*texSize;vec2 texPos1=floor(samplePos-0.5)+0.5;vec2 f=samplePos-texPos1;vec2 w0=f*(-0.5+f*(1.0-0.5*f));vec2 w1=1.0+f*f*(-2.5+1.5*f);vec2 w2=f*(0.5+f*(2.0-1.5*f));vec2 w3=f*f*(-0.5+0.5*f);vec2 w12=w1+w2;vec2 offset12=w2/(w1+w2);vec2 texPos0=texPos1-1.0;vec2 texPos3=texPos1+2.0;vec2 texPos12=texPos1+offset12;texPos0/=texSize;texPos3/=texSize;texPos12/=texSize;vec4 result=vec4(0.0);result+=texture2D(tex,vec2(texPos12.x,texPos0.y))*w12.x*w0.y;result+=texture2D(tex,vec2(texPos0.x,texPos12.y))*w0.x*w12.y;result+=texture2D(tex,vec2(texPos12.x,texPos12.y))*w12.x*w12.y;result+=texture2D(tex,vec2(texPos3.x,texPos12.y))*w3.x*w12.y;result+=texture2D(tex,vec2(texPos12.x,texPos3.y))*w12.x*w3.y;return result;}vec3 choose_motion_vector(){ 10248#ifdef CHOOSE_LONGEST_MOTION_VECTOR 10249float longest=-1.0;vec3 v_choose=vec3(-1.0);for(int i=0;i<9;i++){vec3 v=texture2D(velocityBuffer,vTexCoords[i]).rgb;float l=length(v.xy);if(l>longest){longest=l;v_choose=v;}}return v_choose; 10250#else 10251float closest_depth=1000.0;vec2 closest_uv_offset=vec2(0.0);for(int i=0;i<9;i++){float neighbor_depth=texture2D(depthBuffer,vTexCoords[i]).r;if(neighbor_depth<closest_depth){closest_uv_offset=vTexCoords[i];closest_depth=neighbor_depth;}}return texture2D(velocityBuffer,closest_uv_offset).rgb; 10252#endif 10253}vec4 clipAabb(vec3 aabb_min,vec3 aabb_max,vec4 avg,vec4 input_texel){const float FLT_EPS=0.00000001;vec3 p_clip=0.5*(aabb_max+aabb_min);vec3 e_clip=0.5*(aabb_max-aabb_min)+FLT_EPS;vec4 v_clip=input_texel-vec4(p_clip,avg.w);vec3 v_unit=v_clip.xyz/e_clip;vec3 a_unit=abs(v_unit);float ma_unit=max(a_unit.x,max(a_unit.y,a_unit.z));if(ma_unit>1.0){return vec4(p_clip,avg.w)+v_clip/ma_unit;}else{return input_texel;}}vec3 clip_aabb_variance(in vec3 cOld,in vec3 cNew,in vec3 centre,in vec3 halfSize){if(all(lessThanEqual(abs(cOld-centre),halfSize))){return cOld;}vec3 dir=(cNew-cOld);vec3 near=centre-sign(dir)*halfSize;vec3 tAll=(near-cOld)/dir;float t=0.0001;for(int i=0;i<3;i++){if(tAll[i]>=0.0&&tAll[i]<t){t=tAll[i];}}if(t>=0.0001){return cOld;}return cOld+dir*t;}void main(){vec3 v=choose_motion_vector();vec2 velocity=v.rg;vec2 previousPixelPos=vUv-velocity;vec4 currentColor=sample_color(inputBuffer,vUv); 10254#ifdef USE_CATMULL_ROM 10255vec4 previousColor=sample_catmull_rom(historyBuffer,previousPixelPos,resolution); 10256#else 10257vec4 previousColor=sample_color(historyBuffer,previousPixelPos); 10258#endif 10259#ifdef USE_YCOCG 10260previousColor=vec4(RGB_YCoCg(previousColor.rgb),previousColor.a); 10261#endif 10262vec4 ctl=sample_color(inputBuffer,vTexCoords[0]);vec4 ctc=sample_color(inputBuffer,vTexCoords[1]);vec4 ctr=sample_color(inputBuffer,vTexCoords[2]);vec4 cml=sample_color(inputBuffer,vTexCoords[3]);vec4 cmc=sample_color(inputBuffer,vTexCoords[4]);vec4 cmr=sample_color(inputBuffer,vTexCoords[5]);vec4 cbl=sample_color(inputBuffer,vTexCoords[6]);vec4 cbc=sample_color(inputBuffer,vTexCoords[7]);vec4 cbr=sample_color(inputBuffer,vTexCoords[8]);vec4 cmin=min(ctl,min(ctc,min(ctr,min(cml,min(cmc,min(cmr,min(cbl,min(cbc,cbr))))))));vec4 cmax=max(ctl,max(ctc,max(ctr,max(cml,max(cmc,max(cmr,max(cbl,max(cbc,cbr))))))));
10262vec4 cavg=(ctl+ctc+ctr+cml+cmc+cmr+cbl+cbc+cbr)/9.0;vec4 cmin5=min(ctc,min(cml,min(cmc,min(cmr,cbc))));vec4 cmax5=max(ctc,max(cml,max(cmc,max(cmr,cbc))));vec4 cavg5=(ctc+cml+cmc+cmr+cbc)/5.0;cmin=0.5*(cmin+cmin5);cmax=0.5*(cmax+cmax5);cavg=0.5*(cavg+cavg5); 10263#ifdef USE_YCOCG 10264vec2 chroma_extent=vec2(0.25*0.5*(cmax.r-cmin.r));vec2 chroma_center=currentColor.gb;cmin.yz=chroma_center-chroma_extent;cmax.yz=chroma_center+chroma_extent;cavg.yz=chroma_center; 10265#endif 10266vec4 previousColorClipped=clamp(previousColor,cmin,cmax); 10267#ifdef LUMINANCE_DIFFERENCES 10268#ifdef USE_YCOCG 10269float lum0=currentColor.r;float lum1=previousColorClipped.r; 10270#else 10271float lum0=luminance(currentColor.rgb);float lum1=luminance(previousColorClipped.rgb); 10272#endif 10273float unbiased_diff=abs(lum0-lum1)/max(lum0,max(lum1,0.2));float unbiased_weight=1.0-unbiased_diff;float unbiased_weight_sqr=unbiased_weight*unbiased_weight;float k_feedback=mix(feedback_min,feedback_max,unbiased_weight_sqr);vec4 result=mix(currentColor,previousColorClipped,vec4(k_feedback)); 10274#else 10275const float alpha=0.1;vec4 result=mix(currentColor,previousColorClipped,1.0-alpha); 10276#endif 10277#ifdef USE_YCOCG 10278gl_FragColor=vec4(YCoCg_RGB(result.rgb).rgb,result.a); 10279#else 10280gl_FragColor=result; 10281#endif 10282}`,YLe=`#define GLSLIFY 1 10283varying vec2 vUv;void main(){gl_Position=vec4(position.xy,1.0,1.0);vUv=position.xy*0.5+0.5;}`,KLe=`#define GLSLIFY 1 10284layout(location=1)out vec4 gVelocity;varying vec2 vUv;uniform sampler2D inputBuffer;void main(){gl_FragColor=texture2D(inputBuffer,vUv);gVelocity=vec4(0.0);}`,NL=class extends Xi{constructor(){super({name:"PassthroughMaterial",uniforms:{inputBuffer:new at(null)},blending:Un,depthWrite:!1,depthTest:!1,vertexShader:YLe,fragmentShader:KLe})}set inputBuffer(t){this.uniforms.inputBuffer.value=t}},XLe=class extends Vs{constructor(){super("TAAResolvePass"),this.MRTCompatible=!0,this.needsSwap=!1,this.passThroughMaterial=new NL,this.resolutionVector=new Me,this.resolveMaterial=new Xi({name:"TAAResolveMaterial",uniforms:{inputBuffer:new at(null),historyBuffer:new at(null),velocityBuffer:new at(null),depthBuffer:new at(null),resolution:new at(new Me)},blending:Un,depthWrite:!1,depthTest:!1,vertexShader:WLe,fragmentShader:jLe}),this.historyRenderTarget=new $i(1024,1024,{minFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.historyRenderTarget.texture.name="TAA.History",this.resultRenderTarget=new $i(1024,1024,{minFilter:Ei,stencilBuffer:!1,depthBuffer:!1}),this.resultRenderTarget.texture.name="TAA.Output"}setSize(t,i){this.historyRenderTarget.setSize(t,i),this.resultRenderTarget.setSize(t,i)}render(t,i){this.fullscreenMaterial=this.resolveMaterial,this.resolveMaterial.uniforms.inputBuffer.value=i.texture[0],this.resolveMaterial.uniforms.velocityBuffer.value=i.texture[1],this.resolveMaterial.uniforms.depthBuffer.value=i.depthTexture,this.resolveMaterial.uniforms.historyBuffer.value=this.historyRenderTarget.texture,this.resolveMaterial.uniforms.resolution.value.set(i.width,i.height),t.setRenderTarget(this.resultRenderTarget),t.render(this.scene,this.camera),this.fullscreenMaterial=this.passThroughMaterial,this.passThroughMaterial.inputBuffer=this.resultRenderTarget.texture,t.setRenderTarget(this.historyRenderTarget),t.render(this.scene,this.camera);let r=this.renderToScreen?null:i;this.fullscreenMaterial=this.passThroughMaterial,this.passThroughMaterial.inputBuffer=this.resultRenderTarget.texture,t.setRenderTarget(r),t.render(this.scene,this.camera)}dispose(){this.resultRenderTarget.dispose(),this.historyRenderTarget.dispose(),this.resolveMaterial.dispose(),this.passThroughMaterial.dispose()}},qLe=class extends Vs{constructor(t,i,r){super("TransmissionPass",void 0,i),this.MRTCompatible=!0,this.depthPass=new X6(t,i,{renderTarget:r.transmissionDepthTarget}),this.passThroughMaterial=new NL,this.splineScene=t,this.needsSwap=!1}updatePasses(t){this.passThroughMaterial=new NL,this.depthPass=new X6(this.splineScene,this.camera,{renderTarget:t.transmissionDepthTarget})}setCamera(t){this.camera=t}setScene(t){this.splineScene=t}render(t,i,r){let n=this.camera.layers.mask,a=t;a.setRenderTarget(a.transmissionRenderTarget),this.fullscreenMaterial=this.passThroughMaterial,this.passThroughMaterial.inputBuffer=i.texture[0],a.clear(),a.render(this.scene,this.camera),this.camera.layers.disable(3),this.depthPass.render(t,i,r),a.shadowMap.needsUpdate=!1,a.shadowMap.autoUpdate=!1;let s=this.renderToScreen?null:i;this.camera.layers.set(3),t.setRenderTarget(s),t.render(this.splineScene,this.camera),this.camera.layers.mask=n}},$6=new ch,ZLe=new Xi({transparent:!0,vertexShader:` 10285 void main() { 10286 gl_Position = vec4(0.0); 10287 } 10288 `,fragmentShader:` 10289 layout(location = 1) out vec4 gVelocity; 10290 10291 void main() { 10292 gl_FragColor = vec4(0.0); 10293 gVelocity = vec4(0.0); 10294 } 10295 `}),UL=class extends Vs{constructor(t,i,r){super("OpaquePass",i??$6,r),this.MRTCompatible=!0,this.hasTransmissionPass=!1,this.clear=!0,this.clearColorOnly=!1,this.clearDepth=!1,this.needsSwap=!1,this.originalMaterials=new Map,this.MRTCompatible=t}setCamera(t){this.camera=t}setScene(t){this.scene=t??$6}getScene(){return this.scene}render(t,i){this.camera.layers.enable(3),this.hasTransmissionPass&&(this.originalMaterials.clear(),this.scene.traverse(n=>{n.layers.isEnabled(3)&&n instanceof zs&&(this.originalMaterials.set(n.id,n.material),n.material=ZLe)}),t.shadowMap.needsUpdate=!0,t.shadowMap.autoUpdate=!0),this.camera.layers.enable(8);let r=this.renderToScreen?null:i;t.setRenderTarget(r),this.clearColorOnly&&t.clear(!0,!1,!0),this.clear&&t.clear(),t.render(this.scene,this.camera),this.clearDepth&&t.clear(!1,!0,!1),this.hasTransmissionPass&&this.originalMaterials.forEac
10295h((n,a)=>{let s=this.scene.getObjectById(a);s&&(s.material=n)})}},JLe=class{constructor(t,{depthBuffer:i=!0,stencilBuffer:r=!1,multisampling:n=0,frameBufferType:a=0}={}){this.renderer=t,this.helperStartIndex=0,this.copyPass=new OL,this.depthTexture=null,this.timer=new fLe,this._width=1,this._height=1,this.passes=[],this.helperPasses=[],this.autoRenderToScreen=!0,this.inputBuffer=this.createBuffer(i,r,a,n,!0,"input buffer mrt"),this.inputBufferSingle=this.createBuffer(i,r,a,n,!1," input buffer single"),this.inputBufferSingle.texture.dispose(),this.inputBufferSingle.depthTexture.dispose(),this.inputBufferSingle.texture=this.inputBuffer.texture[0],this.inputBufferSingle.depthTexture=this.inputBuffer.depthTexture,this.outputBuffer=this.inputBuffer.clone(),this.outputBuffer.name="output buffer mrt",this.outputBufferSingle=this.createBuffer(i,r,a,n,!1,"output buffer single"),this.outputBufferSingle.texture.dispose(),this.outputBufferSingle.depthTexture.dispose(),this.outputBufferSingle.texture=this.outputBuffer.texture[0],this.outputBufferSingle.depthTexture=this.outputBuffer.depthTexture,this.setRenderer(t)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(t){let i=this.inputBuffer,r=this.multisampling;r>0&&t>0?(this.inputBuffer.samples=t,this.outputBuffer.samples=t,this.inputBuffer.dispose(),this.outputBuffer.dispose()):r!==t&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),console.log("creating new input buffer"),this.inputBuffer=this.createBuffer(i.depthBuffer,i.stencilBuffer,i.texture.type,t,!0,"new input buffer"),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(t){var i;if(this.renderer=t,t!==null){let r=t.getSize(new Me),n=((i=t.getContext().getContextAttributes())==null?void 0:i.alpha)??!1,a=this.inputBuffer.texture[0].type;a===gs&&t.outputEncoding===gi&&(this.inputBuffer.texture[0].encoding=gi,this.outputBuffer.texture[0].encoding=gi,this.inputBuffer.dispose(),this.outputBuffer.dispose(),console.log("doing some kinda dispose??")),t.autoClear=!1,this.setSize(r.width,r.height,!1);for(let s of this.passes)s.initialize(t,n,a)}}replaceRenderer(t,i=!0){let r=this.renderer,n=r.domElement.parentNode;return this.setRenderer(t),i&&n!==null&&(n.removeChild(r.domElement),n.appendChild(t.domElement)),r}createDepthTexture(){let t=this.depthTexture=new o0(this._width,this._height);return this.inputBuffer.depthTexture=t,this.inputBuffer.stencilBuffer?(t.format=up,t.type=$f):t.type=Su,t}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(let t of this.passes)t.setDepthTexture(null)}}createBuffer(t,i,r,n,a,s){let o=this.renderer,l=o===null?new Me:o.getDrawingBufferSize(new Me),c={minFilter:Ei,magFilter:Ei,wrapS:Gr,wrapT:Gr,stencilBuffer:i,depthBuffer:t},h;return n>0?(h=new $i(l.width,l.height,c),h.samples=n):(a?(h=new fpe(l.width,l.height,2,c),h.texture[1].type=Hu):h=new $i(l.width,l.height,c),h.depthTexture=new o0(2048,2048),h.depthTexture.type=On),r===gs&&o!==null&&o.outputEncoding===gi&&(Array.isArray(h.texture)?h.texture.forEach(u=>u.encoding=gi):h.texture.encoding=gi),Array.isArray(h.texture)?h.texture.forEach((u,d)=>{u.name=`EffectComposer.Buffer ${a} ${d}`,u.generateMipmaps=!1}):(h.texture.name=`EffectComposer.Buffer ${a}`,h.texture.generateMipmaps=!1),h.name=s,h}addPass(t,i){var l;let r=this.passes,n=this.renderer,a=n.getDrawingBufferSize(new Me),s=((l=n.getContext().getContextAttributes())==null?void 0:l.alpha)??!1,o;if(t.MRTCompatible&&(o=this.inputBuffer.texture[0].type),t.MRTCompatible||(o=this.inputBuffer.texture.type),t.setRenderer(n),t.setSize(a.width,a.height),t.initialize(n,s,o),this.autoRenderToScreen&&(r.length>0&&(r[r.length-1].renderToScreen=!1),t.renderToScreen&&(this.autoRenderToScreen=!1)),i!==void 0?r.splice(i,0,t):r.push(t),this.autoRenderToScreen&&(r[r.length-1].renderToScreen=!0),t.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){let c=this.createDepthTexture();for(t of r)t.setDepthTexture(c)}else t.setDepthTexture(this.depthTexture)}setHelperStartIndex(t){this.helperStartIndex=t}removePass(t){let i=this.passes,r=i.indexOf(t);if(r!==-1&&i.splice(r,1).length>0){if(this.depthTexture!==null){let n=(a,s)=>a||s.needsDepthTexture;i.reduce(n,!1)||t.getDepthTexture()===this.depthTexture&&t.setDepthTexture(null)}this.autoRenderToScreen&&r===i.length&&(t.renderToScreen=!1,i.length>0&&(i[i.length-1].renderToScreen=!0))}}removeAllPasses(){let t=this.passes;t.length>0&&(this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!1),this.passes=[])}render(t){let i=this.renderer,r=this.copyPass,n=this.inputBuffer,a=this.outputBuffer,s=this.inputBufferSingle,o=this.outputBufferSingle,l=!1,c,h,u,d;
vendor: 7,998 bytes, lines 10295-10340
10295t===void 0&&(t=this.timer.update().getDelta());for(let A of this.passes)A.enabled&&(A.MRTCompatible?A.render(i,n,a,t,l):A.render(i,s,o,t,l),A.needsSwap&&(l&&(r.renderToScreen=A.renderToScreen,c=i.getContext(),h=i.state.buffers.stencil,h.setFunc(c.NOTEQUAL,1,4294967295),r.render(i,n,a,t,l),h.setFunc(c.EQUAL,1,4294967295)),u=n,d=s,n=a,s=o,a=u,o=d),A instanceof dLe?l=!0:A instanceof GPe&&(l=!1))}setSize(t,i,r){let n=this.renderer;if(this._width=t,this._height=i,t===void 0||i===void 0){let s=n.getSize(new Me);t=s.width,i=s.height}n.setSize(t,i,r);let a=n.getDrawingBufferSize(new Me);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height),this.inputBufferSingle.setSize(a.width,a.height),this.outputBufferSingle.setSize(a.width,a.height);for(let s of this.passes)s.setSize(a.width,a.height)}reset(){let t=this.timer.isAutoResetEnabled();this.dispose(),this.autoRenderToScreen=!0,this.timer.setAutoResetEnabled(t)}dispose(){for(let t of this.passes)t.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.inputBufferSingle!==null&&this.inputBufferSingle.dispose(),this.outputBufferSingle!==null&&this.outputBufferSingle.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},$Le=new Xi({name:"CombineMaterial",uniforms:{inputBufferA:new at(null),inputBufferB:new at(null)},blending:Un,depthWrite:!1,depthTest:!1,vertexShader:` 10296varying vec2 vUv; 10297void main() { 10298 gl_Position = vec4(position.xy, 1.0, 1.0); 10299 vUv = position.xy * 0.5 + 0.5; 10300} 10301`,fragmentShader:` 10302 varying vec2 vUv; 10303 uniform sampler2D inputBufferA; 10304 uniform sampler2D inputBufferB; 10305 10306 // TODO: Why do we need these when postpro of framemode is enabled??? 10307 layout(location = 1) out vec4 gVelocity; 10308 10309 void main() { 10310 vec4 resA = texture2D(inputBufferA, vUv); 10311 vec4 resB = texture2D(inputBufferB, vUv); 10312 float a = resA.a + resB.a * ( 1.0 - resA.a ); 10313 10314 vec4 res; 10315 res.rgb = resA.rgb + (resB.rgb * (1.0 - resA.a)); 10316 res.a = resA.a + resB.a * (1.0 - resA.a); 10317 gl_FragColor = res; 10318 gVelocity = vec4(0.0); 10319 } 10320`}),eOe=class extends Vs{constructor(t){super("HelperPass",void 0,t),this.MRTCompatible=!1,this.fullscreenMaterial=$Le,this.helperPass=new UL(!1,void 0,this.camera),this.helperPass.hasTransmissionPass=!1,this.helperPass.clear=!1,this.helperPass.renderToScreen=!1,this.helperPassOnTop=new UL(!1,void 0,this.camera),this.helperPassOnTop.hasTransmissionPass=!1,this.helperPassOnTop.clear=!1,this.helperPassOnTop.renderToScreen=!1;let i=new JX({preset:Tf.LOW,edgeDetectionMode:TM.COLOR});this.effectPass=new pT(this.camera,i),this.rt=new $i(10,10,{minFilter:Ei,magFilter:Ei,wrapS:Gr,wrapT:Gr,depthBuffer:!0})}setSize(t,i){this.rt.setSize(t,i),this.effectPass.setSize(t,i)}set sceneHelpers(t){this.helperPass.setScene(t)}get sceneHelpers(){return this.helperPass.getScene()}set sceneHelpersOnTop(t){this.helperPassOnTop.setScene(t)}get sceneHelpersOnTop(){return this.helperPassOnTop.getScene()}setCamera(t){this.helperPass.setCamera(t),this.helperPassOnTop.setCamera(t)}initialize(t,i,r){super.initialize(t,i,r),this.effectPass.initialize(t,i,r)}dispose(){super.dispose(),this.rt.dispose(),this.effectPass.dispose()}render(t,i,r){this.rt.depthTexture=i.depthTexture;let n=t.getClearAlpha();t.setClearAlpha(0),this.helperPass.clearDepth=!0,this.helperPass.clearColorOnly=!0,this.helperPass.render(t,this.rt),this.helperPassOnTop.render(t,this.rt),this.effectPass.renderToScreen=!1,this.effectPass.render(t,this.rt,r),this.fullscreenMaterial.uniforms.inputBufferA.value=r.texture,this.fullscreenMaterial.uniforms.inputBufferB.value=i.texture,t.setClearAlpha(n),t.setRenderTarget(null),t.clear(),t.render(this.scene,this.camera)}},tOe=`#define GLSLIFY 1 10321#include <skinning_pars_vertex> 10322out vec3 n;void main(){ 10323#include <beginnormal_vertex> 10324#include <skinbase_vertex> 10325#include <skinnormal_vertex> 10326#include <defaultnormal_vertex> 10327#include <begin_vertex> 10328#include <skinning_vertex> 10329vec4 view_space=viewMatrix*modelMatrix*vec4(transformed,1.0);gl_Position=projectionMatrix*view_space;n=normalize(transformedNormal);}`,iOe=`#define GLSLIFY 1 10330in vec3 n;void main(){gl_FragColor=vec4(n,1.0);}`,rOe=`#define GLSLIFY 1 10331out vec2 v_uv;void main(){v_uv=uv;gl_Position=vec4(position.xy,1.0,1.0);}`,nOe=`#define GLSLIFY 1 10332in vec2 v_uv;const float pi=3.14159265;const float num_steps=4.0;const float num_directions=4.0;uniform float near;uniform float far;uniform float fov;uniform vec4 proj_info;uniform bool is_ortho;uniform vec2 resolution;uniform float radius_of_influence;uniform float radius_in_screen_space;uniform float exponent;uniform vec3 ao_color;uniform float bias;uniform sampler2D texture_depth;uniform sampler2D texture_normals;uniform sampler2D texture_blue_noise;uniform sampler2D texture_blue_noise_in_disk;uniform sampler2D texture_color_pass;uniform int frame_index;uniform bool fog_enabled;uniform float fog_near;uniform float fog_far;vec3 uv_to_view_space(vec2 uv,float eye_z){return vec3((uv*proj_info.xy+proj_info.zw)*(is_ortho ? 1.0 : eye_z),eye_z);}float linearize_depth(float depth_sampled){float z=is_ortho ? depth_sampled : depth_sampled*2.0-1.0;return mix((2.0*near*far)/(far+near-z*(far-near)),near+z*(far-near),float(is_ortho));}vec3 get_view_position(vec2 uv_coords){float linear_depth=linearize_depth(texture(texture_depth,uv_coords).x);return uv_to_view_space(uv_coords,linear_depth);}vec3 min_difference(vec3 p,vec3 right,vec3 left){vec3 v1=right-p;vec3 v2=p-left;return(dot(v1,v1)<dot(v2,v2))? v1 : v2;}vec3 rebuild_normal(in vec2 uv,in vec3 p){vec2 one_over_resolution=1.0/resolution;vec3 r=get_view_position(uv+vec2(one_over_resolution.x,0));vec3 l=get_view_position(uv+vec2(-one_over_resolution.x,0));vec3 t=get_view_position(uv+vec2(0,one_over_resolution.y));vec3 b=get_view_position(uv+vec2(0,-one_over_resolution.y));return normalize(cross(min_difference(p,r,l),min_difference(p,t,b)));}float falloff(float distance_squared){float neg_inv_r2=-1.0/(radius_of_influence*radius_of_influence);return distance_squared*neg_inv_r2+1.0;}float ao_contribution(vec3 P,vec3 N,vec3 S){vec3 to_sample=S-P;float norm_squared=dot(to_sample,to_sample);float norm=sqrt(norm_squared);float cos_theta=dot(N,to_sample)/norm;return clamp(cos_theta-bias,0.0,1.0)*clamp(falloff(norm_squared),0.0,1.0);}float compute_ambient_occlusion(vec2 uv,float radius_in_screen_space,vec3 pc,vec3 view_space_n){vec2 one_over_resolution=1.0/resolution;ivec2 noise_uv=ivec2(int(mod(gl_FragCoord.x,128.0)),int(mod(gl_FragCoord.y,128.0)));float noise=texelFetch(texture_blue_noise,noise_uv,0).r;noise=fract(noise+0.61803398875*float(frame_index));float theta=noise*2.0*3.1415;float ct=cos(theta);float st=sin(theta);float step_size=radius_in_screen_space/(num_steps+1.0);const float angle_step=2.0*pi/num_directions;float contribution=0.0;for(int i=0;i<int(num_directions);++i){float current_pixel=step_size+1.0;for(int j=0;j<int(num_steps);++j){int index=i*int(num_steps)+j;vec2 blue_noise_sample=texelFetch(texture_blue_noise_in_disk,ivec2(index,0),0).rg;vec2 disk_point;disk_point.x=blue_noise_sample.x*ct-blue_noise_sample.y*st;disk_point.y=blue_noise_sample.x*st+blue_noise_sample.y*ct;vec2 sample_direction=disk_point;vec2 snapped_uv=round(current_pixel*sample_direction)*one_over_resolution+uv;vec3 ps=get_view_position(snapped_uv);current_pixel+=step_size;contribution+=ao_contribution(pc,view_space_n,ps);}}float mult=1.0/(1.0-bias);contribution*=mult/(num_directions*num_steps);return clamp(1.0-contribution*2.0,0.0,1.0);} 10333#define USE_GBUFFER_NORMALS 10334void main(){vec3 view_space_p=get_view_position(v_uv); 10335#ifdef USE_GBUFFER_NORMALS 10336vec3 view_space_n=texture(texture_normals,v_uv).rgb;view_space_n.z*=-1.0; 10337#else 10338vec3 view_space_n=-rebuild_normal(v_uv,view_space_p); 10339#endif 10340float radius_ss=radius_in_screen_space/(is_ortho ? 1.0 : view_space_p.z);float ao=compute_ambient_occlusion(v_uv,radius_ss,view_space_p,view_space_n);float final=pow(ao,exponent);if(view_space_p.z>
10340=far){final=1.0;}vec3 color=mix(ao_color,vec3(1.0),final);if(fog_enabled){float fog_factor=smoothstep(fog_near,fog_far,view_space_p.z);color=mix(color,vec3(1.0),fog_factor);}gl_FragColor=vec4(color,1.0);}`,aOe=`#define GLSLIFY 1 10341out vec2 v_uv;void main(){gl_Position=vec4(position.xy,1.0,1.0);v_uv=uv;}`,sOe=`#define GLSLIFY 1 10342in vec2 v_uv;uniform sampler2D texture_ao_lrez;uniform sampler2D texture_depth_lrez;uniform sampler2D texture_depth_hrez;uniform float near;uniform float far;float linearize_depth(float depth_sampled){float z=depth_sampled*2.0-1.0;return(2.0*near*far)/(far+near-z*(far-near));}vec2 nearest_depth_filter(in vec2 uv){vec2 resolution=vec2(textureSize(texture_depth_lrez,0));vec2 texel_size=1.0/resolution;vec2 offset=uv-0.5*texel_size;float d_hrez=texture(texture_depth_hrez,uv).r;float a=abs(d_hrez-texture(texture_depth_lrez,offset).r);float b=abs(d_hrez-texture(texture_depth_lrez,offset+vec2(texel_size.x,0.0)).r);float c=abs(d_hrez-texture(texture_depth_lrez,offset+vec2(0.0,texel_size.y)).r);float d=abs(d_hrez-texture(texture_depth_lrez,offset+vec2(texel_size.x,texel_size.y)).r);float min_diff=min(a,min(b,min(c,d)));if(min_diff==a)return offset;if(min_diff==b)return offset+vec2(texel_size.x,0.0);if(min_diff==c)return offset+vec2(0.0,texel_size.y);if(min_diff==d)return offset+vec2(texel_size.x,texel_size.y);}void main(){ 10343#ifdef DEBUG 10344float d_lrez=texture(texture_depth_lrez,v_uv).r;float d_hrez=texture(texture_depth_hrez,v_uv).r;float output_d=mix(linearize_depth(d_lrez)/far,linearize_depth(d_hrez)/far,step(0.5,v_uv.x));gl_FragColor=vec4(vec3(output_d),1.0); 10345#else 10346vec2 filtered_uv=nearest_depth_filter(v_uv);vec4 ao=texture(texture_ao_lrez,filtered_uv);gl_FragColor=vec4(ao.rgb,1.0);gl_FragColor=ao; 10347#endif 10348}`,Xv=[[.478712,.875764],[-.337956,-.793959],[-.955259,-.028164],[.864527,.325689],[.209342,-.395657],[-.106779,.672585],[.156213,.235113],[-.413644,-.082856],[-.415667,.323909],[.141896,-.93998],[.954932,-.182516],[-.766184,.410799],[-.434912,-.458845],[.415242,-.078724],[.728335,-.491777],[-.058086,-.066401],[.20299,.686837],[-.808362,-.556402],[.507386,-.640839],[-.723494,-.22924],[.48974,.317826],[-.622663,.765301],[-.01064,.929347],[.663146,.647618],[-.096674,-.413835],[.525945,-.321063],[-.122533,.366019],[.195235,-.687983],[-.563203,.098748],[.418563,.561335],[-.378595,.800367],[.826922,.001024],[-.085372,-.766651],[-.92192,.183673],[-.590008,-.721799],[.167751,-.164393],[.032961,-.56253],[.6329,-.107059],[-.46408,.569669],[-.173676,-.958758],[-.242648,-.234303],[-.275362,.157163],[.382295,-.795131],[.562955,.115562],[.190586,.470121],[.770764,-.297576],[.237281,.93105],[-.666642,-.455871],[-.905649,-.298379],[.33952,.157829],[.701438,-.7041],[-.062758,.160346],[-.220674,.957141],[.642692,.432706],[-.77339,-.015272],[-.671467,.24688],[.158051,.062859],[.806009,.527232],[-.05762,-.247071],[.333436,-.51671],[-.550658,-.315773],[-.652078,.589846],[.008818,.530556],[-.210004,.519896]],oOe=new Xi({vertexShader:tOe,fragmentShader:iOe}),Fm=new Xi({vertexShader:aOe,fragmentShader:sOe,uniforms:{texture_ao_lrez:new at(null),texture_depth_lrez:new at(null),texture_depth_hrez:new at(null),near:new at(null),far:new at(null)}}),lOe=class extends Vs{constructor(t,i){super("AmbientOcclusionPass",void 0,i),this.fogEnabled=!1,this.fogNear=1,this.fogFar=1e3,this.frameIndex=0,this._runHalfRes=!0,this._width=1,this._height=1;let r=1024,n=1024;this.gBuffer=new $i(r,n,{type:RE?Hu:On,depthTexture:new o0(r,n),minFilter:Ei,magFilter:Ei}),this.depthBufferHighRes=new $i(r,n,{depthTexture:new o0(r,n)}),this.aoBuffer=new $i(r,n,{minFilter:Ei,magFilter:Ei}),this.splineScene=t,this.splineCamera=i;let a=new Float32Array(Xv.length*2);for(let o=0;o<Xv.length;o++){let l=o*2;a[l+0]=Xv[o][0],a[l+1]=Xv[o][1]}this.blueNoiseInDiskTexture=new ul(a,Xv.length,1,EC,On),this.blueNoiseInDiskTexture.wrapS=bu,this.blueNoiseInDiskTexture.wrapT=bu,this.blueNoiseInDiskTexture.needsUpdate=!0,this.hbaoMaterial=new Xi({vertexShader:rOe,fragmentShader:nOe,uniforms:{near:new at(null),far:new at(null),fov:new at(null),proj_info:new at(new ai),is_ortho:new at(!1),resolution:new at(new Me),radius_of_influence:new at(8),radius_in_screen_space:new at(1),exponent:new at(1),ao_color:new at(new O),bias:new at(.5),texture_depth:new at(null),texture_normals:new at(null),texture_blue_noise:new at(null),texture_blue_noise_in_disk:new at(this.blueNoiseInDiskTexture),frame_index:new at(0),fog_enabled:new at(!1),fog_near:new at(1),fog_far:new at(1e3)}}),this.radius=128,this.aoColor={r:0,g:0,b:0},this.bias=.5,this.hbaoMaterial.uniforms.texture_depth.value=this.gBuffer.depthTexture,this.hbaoMaterial.uniforms.texture_normals.value=this.gBuffer.texture,this.needsSwap=!0,this.aaBuffer=new $i(r,n,{minFilter:Ei,magFilter:Ei,wrapS:Gr,wrapT:Gr,depthBuffer:!1,type:On});let s=new JX({preset:Tf.ULTRA,edgeDetectionMode:TM.COLOR});this.effectPass=new pT(this.camera,s)}initialize(t,i,r){super.initialize(t,i,r),this.effectPass.initialize(t,i,r)}setBlueNoiseTexture(t){this.hbaoMaterial.uniforms.texture_blue_noise.value=t}setSize(t,i){this._width=t,this._height=i,this.depthBufferHighRes.setSize(t,i);let r=this._runHalfRes?.5:1,n=t*r,a=i*r;this.gBuffer.setSize(n,a),this.aoBuffer.setSize(n,a),this.hbaoMaterial.uniforms.resolution.value.set(n,a),this.aaBuffer.setSize(n,a),this.effectPass.setSize(n,a)}get runHalfRes(){return this._runHalfRes}set runHalfRes(t){this._runHalfRes=t,this.setSize(this._width,this._height)}setCamera(t){this.splineCamera=t}setScene(t){this.splineScene=t}setDepthTexture(t){this.depthBufferHighRes.depthTexture=t,Fm.uniforms.texture_depth_hrez.value=t,Fm.needsUpdate=!0}render(t,i,r){this.splineScene.overrideMaterial=oOe;let n=this.splineCamera.layers.mask;if(this.splineCamera.layers.set(5),t.setRenderTarget(this.gBuffer),t.clear(),t.render(this.splineScene,this.splineCamera),t.setRenderTarget(this.depthBufferHighRes),t.clear(),t.render(this.splineScene,this.splineCamera),this.splineScene.overrideMaterial=null,this.splineCamera.layers.mask=n,this.hbaoMaterial.uniforms.radius_of_influence.value=this.radius,this.hbaoMaterial.uniforms.ao_color.value.set(this.aoColor.r,this.aoColor.g,this.aoColor.b),this.hbaoMaterial.uniforms.bi
vendor: 4,125 bytes, lines 10348-10401
10348as.value=this.bias,this.hbaoMaterial.uniforms.fog_enabled.value=this.fogEnabled,this.hbaoMaterial.uniforms.fog_near.value=this.fogNear,this.hbaoMaterial.uniforms.fog_far.value=this.fogFar,this.hbaoMaterial.uniforms.frame_index.value=this.frameIndex,this.frameIndex++,this.splineCamera.isPerspectiveCamera){this.hbaoMaterial.uniforms.near.value=this.splineCamera.perspCamera.near,this.hbaoMaterial.uniforms.far.value=this.splineCamera.perspCamera.far;let a=this.splineCamera.perspCamera.projectionMatrix.elements,s=2/a[0],o=2/a[5],l=-(1-a[8])/a[0],c=-(1+a[9])/a[5];this.hbaoMaterial.uniforms.proj_info.value.set(s,o,l,c);let h=this.splineCamera.perspCamera.fov*(Math.PI/180),u=this.hbaoMaterial.uniforms.resolution.value.y/(Math.tan(h*.5)*2),d=this.hbaoMaterial.uniforms.radius_of_influence.value*.5*u;this.hbaoMaterial.uniforms.radius_in_screen_space.value=d,this.hbaoMaterial.uniforms.is_ortho.value=!1}else{this.hbaoMaterial.uniforms.near.value=this.splineCamera.orthoCamera.near,this.hbaoMaterial.uniforms.far.value=this.splineCamera.orthoCamera.far;let a=this.splineCamera.orthoCamera.projectionMatrix.elements,s=2/a[0],o=2/a[5],l=-(1+a[12])/a[0],c=-(1-a[13])/a[5];this.hbaoMaterial.uniforms.proj_info.value.set(s,o,l,c);let h=.5*(this.hbaoMaterial.uniforms.resolution.value.y/o),u=this.hbaoMaterial.uniforms.radius_of_influence.value*h;this.hbaoMaterial.uniforms.radius_in_screen_space.value=u,this.hbaoMaterial.uniforms.is_ortho.value=!0}this.runHalfRes?(this.fullscreenMaterial=this.hbaoMaterial,t.setRenderTarget(this.aoBuffer),t.clear(),t.render(this.scene,this.camera),this.fullscreenMaterial=Fm,Fm.uniforms.texture_ao_lrez.value=this.aoBuffer.texture,Fm.uniforms.texture_depth_lrez.value=this.gBuffer.depthTexture,Fm.uniforms.texture_depth_hrez.value=this.depthBufferHighRes.depthTexture,t.setRenderTarget(t.aoRenderTarget),t.clear(),t.render(this.scene,this.camera)):(this.fullscreenMaterial=this.hbaoMaterial,t.setRenderTarget(this.aaBuffer),t.clear(),t.render(this.scene,this.camera),this.effectPass.renderToScreen=!1,this.effectPass.render(t,this.aaBuffer,t.aoRenderTarget))}dispose(){this.gBuffer.dispose(),this.depthBufferHighRes.dispose(),this.aoBuffer.dispose()}},cOe=` 10349varying vec2 vUv; 10350void main() { 10351 vUv = uv; 10352 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 10353}`,hOe=` 10354uniform sampler2D tInput; 10355uniform sampler2D tMap; 10356uniform vec2 resolution; 10357varying vec2 vUv; 10358 10359uniform vec2 uResolution; 10360uniform vec2 uCoords; 10361 10362// Draws a rectangle at center <st> with size <size> 10363float rectangle(vec2 st, vec2 size) { 10364 size = vec2(0.5) - size * 0.5; 10365 vec2 uv = vec2(step(size.x, st.x), step(size.y, st.y)); 10366 uv *= vec2(step(size.x, 1.0 - st.x), step(size.y, 1.0 - st.y)); 10367 10368 return uv.x * uv.y; 10369} 10370 10371uniform vec2 uSize; 10372uniform float uScale; 10373uniform float uDPR; 10374uniform float uCurrent; 10375uniform vec3 uSceneColor; 10376 10377void main() { 10378 vec2 screenUv = gl_FragCoord.xy / uResolution.xy; 10379 screenUv *= 1.0 / uDPR; 10380 10381 vec2 center = vec2(0.5, -0.5); 10382 vec2 outsideUv = screenUv; 10383 outsideUv += center; 10384 outsideUv -= uCoords.xy / uResolution.xy; 10385 outsideUv = (outsideUv - 0.5) + 0.5; 10386 outsideUv -= center; 10387 vec2 s = (uSize / uResolution) * uScale; 10388 float isOutside = 1.0 - rectangle(outsideUv, s); 10389 10390 vec2 mid = vec2(0.5); 10391 vec2 insideUv = (screenUv - mid + s * mid) / s; 10392 vec4 background = texture2D(tInput, screenUv); 10393 vec4 image = texture2D(tMap, insideUv); 10394 gl_FragColor = mix(image, background, isOutside); 10395} 10396`,uOe=class extends il{constructor(){super(new Xi({vertexShader:cOe,fragmentShader:hOe,uniforms:{tInput:new at(null),tMap:new at(null),uResolution:new at(new Me),uSize:new at(new Me),uCoords:new at(new Me),uScale:new at(1),uSceneColor:new at(new Ht(16711680)),uDPR:new at(1),uCurrent:new at(0)}}),"tInput"),this.needsSwap=!0}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.tMap.value}set texture(t){this.uniforms.tMap.value=t}},dOe=` 10397void main() { 10398 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 10399}`,AOe=` 10400uniform sampler2D toScene; 10401uniform sampler2D fromScene;
10402uniform vec2 resolution; 10403 10404uniform vec2 uResolution; 10405uniform float uDPR; 10406 10407uniform float mixRatio; 10408uniform sampler2D tMixTexture; 10409uniform int useTexture; 10410uniform float threshold; 10411 10412void main() { 10413 vec2 screenUv = gl_FragCoord.xy / uResolution.xy; 10414 screenUv *= 1.0 / uDPR; 10415 10416 vec4 texel1 = texture2D( fromScene, screenUv ); 10417 vec4 texel2 = texture2D( toScene, screenUv ); 10418 10419 if (useTexture==1) { 10420 10421 vec4 transitionTexel = texture2D( tMixTexture, screenUv ); 10422 float r = mixRatio * (1.0 + threshold * 2.0) - threshold; 10423 float mixf=clamp((transitionTexel.r - r)*(1.0/threshold), 0.0, 1.0); 10424 10425 gl_FragColor = mix( texel1, texel2, mixf ); 10426 } else { 10427 10428 gl_FragColor = mix( texel1, texel2, mixRatio ); 10429 10430 } 10431} 10432`,fOe=[],pOe=class extends il{constructor(){super(new Xi({vertexShader:dOe,fragmentShader:AOe,uniforms:{toScene:new at(null),fromScene:new at(null),uResolution:new at(new Me),uDPR:new at(1),mixRatio:new at(0),threshold:new at(.1),useTexture:new at(0),tMixTexture:{value:fOe[0]}}}),"toScene"),this.needsSwap=!0}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.fromScene.value}set texture(t){this.uniforms.fromScene.value=t}},mOe=` 10433void main() { 10434 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 10435}`,gOe=` 10436uniform sampler2D inputBuffer; 10437uniform sampler2D blurredInputBuffer; 10438uniform sampler2D overlay; 10439uniform float blurIntensity; 10440 10441uniform vec2 uResolution; 10442uniform float uDPR; 10443 10444void main() { 10445 vec2 screenUv = gl_FragCoord.xy / uResolution.xy; 10446 screenUv *= 1.0 / uDPR; 10447 10448 vec4 texel1 = texture2D( overlay, screenUv ); 10449 vec4 texel2 = texture2D( inputBuffer, screenUv ); 10450 vec4 texel3 = texture2D( blurredInputBuffer, screenUv ); 10451 10452 float blurMask2 = max(sign(texel1.a), 0.0) * blurIntensity; 10453 gl_FragColor = mix( mix(texel2, texel3, blurMask2), texel1, texel1.a ); 10454} 10455`,vOe=class extends il{constructor(){super(new Xi({vertexShader:mOe,fragmentShader:gOe,uniforms:{inputBuffer:new at(null),blurredInputBuffer:new at(null),overlay:new at(null),uResolution:new at(new Me),uDPR:new at(1),blurIntensity:new at(0)}})),this._blurEnabled=!1,this.blurTarget=new $i(1,1,{minFilter:Ei,magFilter:Ei,wrapS:Gr,wrapT:Gr}),this.blurPass=new mU({width:window.innerWidth,height:window.innerHeight,kernelSize:MM.HUGE,resolutionScale:.25}),this.blurPass.renderToScreen=!1,this.uniforms.blurredInputBuffer.value=this.blurTarget.texture}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.overlay.value}set texture(t){this.uniforms.overlay.value=t}setResolution(t,i,r=1){this.uniforms.uResolution.value.set(t,i),this.uniforms.uDPR.value=r,this.blurPass.setSize(t,i),this.blurTarget.setSize(t,i),this.blurPass.setSize(t,i)}get uiCanvas(){return this._uiCanvas}set uiCanvas(t){this._uiCanvas=t,t.texture&&(this.uniforms.overlay.value=t.texture);let i=t.frame;if(i){let r=i.data.backgroundBlur,n=r.radius;this._blurEnabled=r.enabled,this.uniforms.blurIntensity.value=this._blurEnabled?1:0,this.blurPass.scale=n/3}}render(t,i,r,n,a){this._blurEnabled&&(this.blurPass.setDepthTexture(this.getDepthTexture()),this.blurPass.render(t,i,this.blurTarget,n,a)),super.render(t,i,r,n,a)}},_Oe=` 10456varying vec2 vUv; 10457void main() { 10458 vUv = uv; 10459 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 10460}`,yOe=` 10461uniform sampler2D tInput; 10462uniform sampler2D tOverlayImage; 10463varying vec2 vUv; 10464uniform vec2 uResolution; 10465uniform vec2 uRightBottom; 10466uniform vec2 uImageSize; 10467uniform float uScale; 10468uniform float uDPR; 10469 10470vec3 blendNormal(vec3 base, vec3 blend) { 10471 return blend; 10472} 10473 10474vec3 blendNormal(vec3 base, vec3 blend, float opacity) { 10475 return (blendNormal(base, blend) * opacity + base * (1.0 - opacity)); 10476} 10477 10478vec4 drawFixedSizeImage(sampler2D image, vec2 screenUV, vec2 imageSize, vec2 imageCoords, vec2 screenSize, float dpr) { 10479 vec2 uv = (screenUV * screenSize * dpr - imageCoords) / (imageSize * dpr); 10480 if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) { 10481 return vec4(0.0); 10482 } 10483 return texture2D(image, uv); 10484} 10485 10486void main() { 10487 vec2 screenUV = gl_FragCoord.xy / (uResolution.xy * uDPR); 10488 vec2 imageCoords = vec2(uResolution.x * uDPR - uImageSize.x * uScale * uDPR - uRightBottom.x * uDPR, uRightBottom.y * uDPR); 10489 vec4 background = texture2D(tInput, screenUV); 10490 vec4 image = drawFixedSizeImage(tOverlayImage, screenUV, uImageSize * uScale, imageCoords, uResolution, uDPR); 10491 gl_FragColor = vec4(blendNormal(background.rgb, image.rgb, image.a), max(background.a, image.a)); 10492} 10493`,EOe=class extends il{constructor(){super(new Xi({vertexShader:_Oe,fragmentShader:yOe,uniforms:{tInput:new at(null),tOverlayImage:new at(null),uResolution:new at(new Me),uImageSize:new at(new Me),uRightBottom:new at(new Me(20,20)),uScale:new at(.25),uDPR:new at(1)}}),"tInput")}get uniforms(){return this.fullscreenMaterial.uniforms}get texture(){return this.uniforms.tOverlayImage.value}set texture(t){this.uniforms.tOverlayImage.value=t,this.uniforms.uImageSize.value.set(t.image.width,t.image.height)}};function eV(t,i){return i&&i.enabled&&t.push(i.effect),t}var wOe=t=>Object.values(Hi).includes(t)?t:Hi.NORMAL,bOe=class extends Ja{constructor(t,i){super(),this._needsDOFResize=i,this.postprocessingState=eT.defaultData,this._scene=new ch,this._camera=new ms,this.effects=new Map,this.blueNoiseTexture=new ul,this._renderToScreen=!0,this._isUIOverlayEnabled=!1,this.clock=new sye,this.renderer=t,this.debug=!1,this.effects.set("bloom",new NLe),this.effects.set("chromaticAberration",new FLe),this.effects.set("vignette",new zLe),this.effects.set("noise",new GLe),this.effects.set("colorAverage",new kLe),this.effects.set("hueSaturation",new HLe),this.effects.set("brightnessContrast",new ULe),this.effects.set("depthOfField",new QLe),this.effects.set("pixelation",new VLe),this.effectComposer=new JLe(this.renderer),this.effectComposer.autoRenderToScreen=!1,this.opaquePass=new UL(!0,this.scene,this.camera),this.opaquePass.clear=!0,this.transmissionPass=new qLe(this.scene,this.camera,this.renderer),this.aoPass=new lOe(this.scene,this.camera),this.taaPass=new XLe,this.taaPass.renderToScreen=!1,this.helperPass=new eOe(this.camera),this.helperPass.renderToScreen=!1,this.stylesOverlayPass=new uOe,this.stylesOverlayPass.enabled=!1,this.uiOverlayPass=new vOe,this.uiOverlayPass.enabled=!1,this.logoOverlayPass=new EOe,this.logoOverlayPass.enabled=!1,this.sceneTransitionPass=new pOe,this.sceneTransitionPass.enabled=!1,this._initCopyPass(),this._initPasses()}set overlayTexture(t){t!==void 0?(this.stylesOverlayPass.texture=t,this.stylesOverlayPass.enabled=!0):this.stylesOverlayPass.enabled=!1}get overlayTexture(){return this.stylesOverlayPass.texture}set sceneHelpers(t){this.helperPass.sceneHelpers=t}get sceneHelpers(){return this.helperPass.sceneHelpers}set sceneHelpersOnTop(t){this.helperPass.sceneHelpersOnTop=t}get sceneHelpersOnTop(){return this.helperPass.sceneHelpersOnTop}get scene(){return this._scene}set scene(t){this._scene=t,this.opaquePass.setScene(t),this.transmissionPass.setScene(t),this.aoPass.setScene(t)}get camera(){return this._camera}set camera(t){let i=this._camera!==t;this._camera=t,this.opaquePass.setCamera(t),this.transmissionPass.setCamera(t),i&&this.transmissionPass.updatePasses(this.renderer),this.aoPass.setCamera(t),this.helperPass.setCamera(t),this.effects.get("depthOfField").setCamera(t)}updateRenderToScreen(){let t=!1;for(let i=this.effectComposer.passes.length-1;i>=0;i--){let r=this.effectComposer.passes[i];if(r.enabled===!0&&!t&&this._renderToScreen){r.renderToScreen=!0,t=!0;continue}r.renderToScreen=!1}}get isUIOverlayEnabled(){return this._isUIOverlayEnabled}disableUIOverlay(){this._isUIOverlayEnabled=!1}enableUIOverlay(){this._isUIOverlayEnabled=!0}disableHelpers(){this.helperPass.enabled=!1,this.updateRenderToScreen()}enableHelpers(){this.helperPass.enabled=!0,this.updateRenderToScreen()}updateBlueNoiseTexture(t){this.blueNoiseTexture=new ul(t,128,128),this.blueNoiseTexture.wrapS=bu,this.blueNoiseTexture.wrapT=bu,this.blueNoiseTexture.minFilter=tr,this.blueNoiseTexture.magFilter=tr,this.blueNoiseTexture.needsUpdate=!0}setAmbientOcclusionParams(t,i,r,n,a,s,o,l){this.aoPass.enabled=t,this.aoPass.radius=i,this.aoPass.bias=r,this.aoPass.aoColor=n,this.aoPass.fogEnabled=a,this.aoPass.fogNear=s,this.aoPass.fogFar=o,this.aoPass.runHalfRes!==!l&&(this.aoPass.runHalfRes=!l)}setTransmissionPassEnabled(t){this.transmissionPass.enabled=t,this.opaquePass.hasTransmissionPass=t}_initPasses(){var t,i,r;
10493if((t=this.uvEffectPass)==null||t.dispose(),(i=this.effectPass)==null||i.dispose(),this.effectComposer.removeAllPasses(),this.transmissionPass.updatePasses(this.renderer),this.effectComposer.addPass(this.aoPass),this.effectComposer.addPass(this.opaquePass),this.effectComposer.addPass(this.transmissionPass),this.effectComposer.addPass(this.taaPass),this.postprocessingState.enabled){let n=[this.effects.get("pixelation")].reduce(eV,[]);n.length>0&&(this.uvEffectPass=new pT(this.camera,...n),this.uvEffectPass.renderToScreen=!1,this.effectComposer.addPass(this.uvEffectPass));let a=[this.effects.get("chromaticAberration"),this.effects.get("bloom"),this.effects.get("depthOfField"),this.effects.get("colorAverage"),this.effects.get("hueSaturation"),this.effects.get("brightnessContrast"),this.effects.get("vignette"),this.effects.get("noise")].reduce(eV,[]);if(a.length>0&&(this.effectPass=new pT(this.camera,...a),this.effectPass.renderToScreen=!1,this.effectComposer.addPass(this.effectPass),this._needsDOFResize&&((r=this.effects.get("depthOfField"))==null?void 0:r.enabled)&&window!==void 0)){let s=this.renderer.viewportWidth,o=this.renderer.viewportHeight;this.renderer.setSize(s-1,o-1),this.renderer.setSize(s,o)}}this.effectComposer.addPass(this.stylesOverlayPass),this.effectComposer.addPass(this.uiOverlayPass),this.effectComposer.addPass(this.sceneTransitionPass),this.effectComposer.addPass(this.helperPass),this.effectComposer.addPass(this.logoOverlayPass)}_initCopyPass(){if(this._savePass)return;let t=new Me;this.renderer.getDrawingBufferSize(t),this._rt=new $i(t.x,t.y,{depthBuffer:!1,stencilBuffer:!1,wrapS:bu,wrapT:bu}),this._rt.samples=0,this._savePass=new OL(this._rt,!1),this._savePass.renderToScreen=!1}setCopyPass(t){this._rt=t,this._savePass=new OL(this._rt,!1),this.renderToScreen=!1}get renderToScreen(){return this._renderToScreen}set renderToScreen(t){if(this._renderToScreen===t)return;let i=this.effectComposer;!i||(t===!0?i.removePass(this._savePass):i.addPass(this._savePass),this._renderToScreen=t,this.updateRenderToScreen())}set sceneTransitionFromTexture(t){t!==this.sceneTransitionPass.texture&&(t!==null?this.sceneTransitionPass.enabled=!0:(this.sceneTransitionPass.enabled=!1,this.updateRenderToScreen()),this.sceneTransitionPass.texture=t)}setWatermark(t){this.logoOverlayPass.enabled=t!==null,t&&(this.logoOverlayPass.texture=t)}get texture(){return this._rt&&this._rt.texture}get renderTarget(){return this._rt}updatePostprocessing(t){let{enabled:i,...r}=t,n=!1;i!==this.postprocessingState.enabled&&(n=!0);for(let a of Object.entries(r)){let s=a[1],o=this.effects.get(a[0]);if(o){o.enabled!==s.enabled&&(n=!0),o.enabled=s.enabled;for(let[l,c]of Object.entries(s))l==="blendFunction"?o.blendFunction=wOe(c):o[l]=c}}this.postprocessingState=t,n&&this._initPasses()}render(){this.effectComposer.render(this.clock.getDelta())}setScissor(t,i,r,n){t instanceof ai?(this.effectComposer.inputBuffer.scissor.set(t.x,t.y,t.z,t.w),this.effectComposer.outputBuffer.scissor.set(t.x,t.y,t.z,t.w)):(this.effectComposer.inputBuffer.scissor.set(t,i,r,n),this.effectComposer.outputBuffer.scissor.set(t,i,r,n));let a=this.renderer.getPixelRatio();this.effectComposer.inputBuffer.scissor.multiplyScalar(a),this.effectComposer.outputBuffer.scissor.multiplyScalar(a),this.renderer.setScissor(t,i,r,n)}setScissorTest(t){this.effectComposer.inputBuffer.scissorTest=t,this.effectComposer.outputBuffer.scissorTest=t,this.renderer.setScissorTest(t)}setViewport(t,i,r,n){t instanceof ai?(this.effectComposer.inputBuffer.viewport.copy(t),this.effectComposer.outputBuffer.viewport.copy(t)):(this.effectComposer.inputBuffer.viewport.set(t,i,r,n),this.effectComposer.outputBuffer.viewport.set(t,i,r,n))}resize(t,i,r){if(this.effectComposer.setSize(t,i,r),this._rt){let n=this.renderer.getPixelRatio();this._rt.setSize(t*n,i*n)}}dispose(){var t,i;
10493(t=this.uvEffectPass)==null||t.dispose(),(i=this.effectPass)==null||i.dispose(),this.effectComposer.dispose()}},SOe=t=>` 10494 10495// PCSS implementation based on: 10496// https://www.gamedev.net/articles/programming/graphics/contact-hardening-soft-shadows-made-fast-r4906/ 10497// NOTE: This number affects how big the shadow blur can 10498// possibly get. Bigger number == bigger blur, but less precise results 10499 10500const float gPenumbraFilterSize = 80.0; 10501const int gPenumbraSamples = ${t}; 10502const int gShadowSamples = ${t}; 10503const float gShadowSamplesRpc = 1.0f / float(gShadowSamples); 10504 10505#ifdef USE_SHADOWMAP 10506 #if NUM_DIR_LIGHT_SHADOWS > 0 10507 10508 uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; 10509 varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; 10510 10511 struct DirectionalLightShadow { 10512 float shadowBias; 10513 float shadowNormalBias; 10514 float shadowRadius; 10515 vec2 shadowMapSize; 10516 }; 10517 10518 uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; 10519 10520 #endif 10521 10522 #if NUM_SPOT_LIGHT_SHADOWS > 0 10523 10524 uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; 10525 varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_SHADOWS ]; 10526 10527 struct SpotLightShadow { 10528 float shadowBias; 10529 float shadowNormalBias; 10530 float shadowRadius; 10531 vec2 shadowMapSize; 10532 }; 10533 10534 uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; 10535 10536 #endif 10537 10538 #if NUM_POINT_LIGHT_SHADOWS > 0 10539 10540 uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; 10541 varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; 10542 10543 struct PointLightShadow { 10544 float shadowBias; 10545 float shadowNormalBias; 10546 float shadowRadius; 10547 vec2 shadowMapSize; 10548 float shadowCameraNear; 10549 float shadowCameraFar; 10550 }; 10551 10552 uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; 10553 10554 #endif 10555 10556 /* 10557 #if NUM_RECT_AREA_LIGHTS > 0 10558 10559 // TODO (abelnation): create uniforms for area light shadows 10560 10561 #endif 10562 */ 10563 10564float computePenumbra(int index, sampler2D shadowMap, float temporalAngle, float texelSize, vec2 uv, float compare, float texelScalar, float shadowRadius) 10565{ 10566 float penumbra = 1.0; 10567 float blockerDepthAvg = 0.0; 10568 float blockerCount = 0.0; 10569 10570 #pragma unroll_loop_start 10571 for(int i = 0; i < gPenumbraSamples; i ++) 10572 { 10573 vec2 offset = (vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize) * texelScalar; 10574 float depth = unpackRGBAToDepth( texture2D( shadowMap, uv + offset ) ); 10575 10576 if(depth < compare + 0.0001) 10577 { 10578 blockerDepthAvg += depth; 10579 blockerCount++; 10580 } 10581 } 10582 #pragma unroll_loop_end 10583 10584 if (blockerCount > 0.0) 10585 { 10586 blockerDepthAvg /= blockerCount; 10587 10588 // Compute penumbra 10589 penumbra = (compare - blockerDepthAvg) / (blockerDepthAvg); 10590 penumbra *= penumbra; 10591 penumbra *= 200.0 * penumbraSize[min(index, 5 - 1)]; // Magic number that affects how quickly the penumbra grows 10592 10593 return clamp(penumbra, 0.00, 1.0); 10594 } 10595 return 0.0; 10596} 10597 10598float vogelShadow(int index, sampler2D shadowMap, vec2 uv, float texelSize, float compare, float shadowRadius) 10599{ 10600 float shadow = 0.0f; 10601 10602 // NOTE: When using TAA, we should use screen space interleaved gradient noise 10603 vec2 halton = haltonSequence[frameIndex]; 10604 float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton); 10605 float temporalAngle = temporalOffset * PI2; 10606 10607 float texelScalar = (gPenumbraFilterSize) / (texelSize * 1024.); 10608 float penumbra = computePenumbra(index, shadowMap, temporalAngle, texelSize, uv, compare, texelScalar, shadowRadius); 10609 if (penumbra == -1.0) { 10610 return 1.0; 10611 } 10612 10613 #pragma unroll_loop_start 10614 for (int i = 0; i < gShadowSamples; i++) 10615 { 10616 vec2 vogelSample = vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize; 10617 // Overall blurring offset 10618 vec2 offset = vogelSample * (shadowRadius * 2.); 10619 10620 // Penumbra offset 10621 offset += vogelSample * (penumbra * texelScalar); 10622 10623 shadow += step( compare, unpackRGBAToDepth( texture2D( shadowMap, uv + offset ) ) ); 10624 } 10625 #pragma unroll_loop_end 10626 10627 return shadow * gShadowSamplesRpc; 10628} 10629 10630 10631 float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { 10632 10633 return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); 10634 10635 } 10636 10637 vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { 10638 10639 return unpackRGBATo2Half( texture2D( shadow, uv ) ); 10640 10641 } 10642 10643 float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ 10644 10645 float occlusion = 1.0; 10646 10647 vec2 distribution = texture2DDistribution( shadow, uv ); 10648 10649 float hard_shadow = step( compare , distribution.x ); // Hard Shadow 10650 10651 if (hard_shadow != 1.0 ) { 10652 10653 float distance = compare - distribution.x ; 10654 float variance = max( 0.00000, distribution.y * distribution.y ); 10655 float softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality 10656 softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed 10657 occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); 10658 10659 } 10660 return occlusion; 10661 10662 } 10663 10664 float getShadow( int i, sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { 10665 10666 float shadow = 1.0; 10667 10668 shadowCoord.xyz /= shadowCoord.w; 10669 shadowCoord.z += shadowBias; 10670 10671 // if ( something && something ) breaks ATI OpenGL shader compiler 10672 // if ( all( something, something ) ) using this instead 10673 10674 bvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 ); 10675 bool inFrustum = all( inFrustumVec ); 10676 10677 bvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 ); 10678 10679 bool frustumTest = all( frustumTestVec ); 10680 10681 if ( frustumTest ) { 10682 10683 #if defined( SHADOWMAP_TYPE_PCF ) 10684 10685 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 10686 return vogelShadow(i, shadowMap, shadowCoord.xy, texelSize.x, shadowCoord.z, shadowRadius ); 10687 10688 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 10689 10690 vec2 texelSize = vec2( 1.0 ) / shadowMapSize; 10691 float dx = texelSize.x; 10692 float dy = texelSize.y; 10693 10694 vec2 uv = shadowCoord.xy;
10695 vec2 f = fract( uv * shadowMapSize + 0.5 ); 10696 uv -= f * texelSize; 10697 10698 shadow = ( 10699 texture2DCompare( shadowMap, uv, shadowCoord.z ) + 10700 texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + 10701 texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + 10702 texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + 10703 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), 10704 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), 10705 f.x ) + 10706 mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), 10707 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), 10708 f.x ) + 10709 mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), 10710 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), 10711 f.y ) + 10712 mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), 10713 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), 10714 f.y ) + 10715 mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), 10716 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), 10717 f.x ), 10718 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), 10719 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), 10720 f.x ), 10721 f.y ) 10722 ) * ( 1.0 / 9.0 ); 10723 10724 #elif defined( SHADOWMAP_TYPE_VSM ) 10725 10726 shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); 10727 10728 #else // no percentage-closer filtering: 10729 10730 shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); 10731 10732 #endif 10733 10734 } 10735 10736 return shadow; 10737 10738 } 10739 10740 // cubeToUV() maps a 3D direction vector suitable for cube texture mapping to a 2D 10741 // vector suitable for 2D texture mapping. This code uses the following layout for the 10742 // 2D texture: 10743 // 10744 // xzXZ 10745 // y Y 10746 // 10747 // Y - Positive y direction 10748 // y - Negative y direction 10749 // X - Positive x direction 10750 // x - Negative x direction 10751 // Z - Positive z direction 10752 // z - Negative z direction 10753 // 10754 // Source and test bed: 10755 // https://gist.github.com/tschw/da10c43c467ce8afd0c4 10756 10757 vec2 cubeToUV( vec3 v, float texelSizeY ) { 10758 10759 // Number of texels to avoid at the edge of each square 10760 10761 vec3 absV = abs( v ); 10762 10763 // Intersect unit cube 10764 10765 float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); 10766 absV *= scaleToCube; 10767 10768 // Apply scale to avoid seams 10769 10770 // two texels less per square (one texel will do for NEAREST) 10771 v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); 10772 10773 // Unwrap 10774 10775 // space: -1 ... 1 range for each square 10776 // 10777 // #X## dim := ( 4 , 2 ) 10778 // # # center := ( 1 , 1 ) 10779 10780 vec2 planar = v.xy; 10781 10782 float almostATexel = 1.5 * texelSizeY; 10783 float almostOne = 1.0 - almostATexel; 10784 10785 if ( absV.z >= almostOne ) { 10786 10787 if ( v.z > 0.0 ) 10788 planar.x = 4.0 - v.x; 10789 10790 } else if ( absV.x >= almostOne ) { 10791 10792 float signX = sign( v.x ); 10793 planar.x = v.z * signX + 2.0 * signX; 10794 10795 } else if ( absV.y >= almostOne ) { 10796 10797 float signY = sign( v.y ); 10798 planar.x = v.x + 2.0 * signY + 2.0; 10799 planar.y = v.z * signY - 2.0; 10800 10801 } 10802 10803 // Transform to UV space 10804 10805 // scale := 0.5 / dim 10806 // translate := ( center + 0.5 ) / dim 10807 return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); 10808 10809 } 10810 10811 float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { 10812 10813 float shadow = 1.0; 10814 vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); 10815 10816 // for point lights, the uniform @vShadowCoord is re-purposed to hold 10817 // the vector from the light to the world-space position of the fragment. 10818 vec3 lightToPosition = shadowCoord.xyz; 10819 10820 // dp = normalized distance from light to fragment position 10821 float compare = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); // need to clamp? 10822 compare += shadowBias; 10823 10824 // bd3D = base direction 3D 10825 vec3 bd3D = normalize( lightToPosition ); 10826 10827 vec2 halton = haltonSequence[frameIndex]; 10828 float temporalOffset = getNoiseInterleavedGradient(gl_FragCoord.xy + halton); 10829 float temporalAngle = temporalOffset * PI2; 10830 10831 #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_VSM ) 10832 for (int i = 0; i < gShadowSamples; i++) { 10833 vec2 vogelSample = vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize; 10834 10835 // Overall blurring offset 10836 vec3 offset = vec3(vogelSample.x, vogelSample.y, -vogelSample.x) * (shadowRadius + 5.); 10837 10838 // NOTE: Removed for now 10839 // Penumbra offset 10840 //offset += vec3(vogelSample.x, vogelSample.y, vogelSample.y) * (penumbra * gPenumbraFilterSize); 10841 10842 shadow += texture2DCompare( shadowMap, cubeToUV( bd3D + offset, texelSize.y ), compare ); 10843 10844 } 10845 return shadow * gShadowSamplesRpc; 10846 10847 #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) 10848 for (int i = 0; i < 16; i++) { 10849 vec2 vogelSample = vogelDiskSample(i, gShadowSamples, temporalAngle) * texelSize; 10850 10851 // Overall blurring offset 10852 vec3 offset = vec3(vogelSample.x, vogelSample.y, -vogelSample.x) * (shadowRadius + 5.); 10853 10854 shadow += texture2DCompare( shadowMap, cubeToUV( bd3D + offset, texelSize.y ), compare ); 10855 10856 } 10857 return shadow * (1.0 / 16.0); 10858 #else // no percentage-closer filtering 10859 10860 return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), compare ); 10861 10862 #endif 10863 10864 } 10865 10866#endif 10867`,COe=_i.lights_fragment_begin,TOe=_i.shadowmask_pars_fragment,tV=null,MOe=t=>{switch(t){case"low":return 8;case"medium":return 16;case"high":return 32;default:return 16}},xOe=(t="medium")=>{if(tV===t)return!1;tV=t;let i=MOe(t);_i.shadowmap_pars_fragment=SOe(i);let r=COe.slice();r=r.replace("getShadow( spotShadowMap[ i ]","getShadow( UNROLLED_LOOP_INDEX + 3, spotShadowMap[ i ]"),r=r.replace("getShadow( directionalShadowMap[ i ]","getShadow( UNROLLED_LOOP_INDEX, directionalShadowMap[ i ]"),_i.lights_fragment_begin=r;let n=TOe.slice();return n=n.replaceAll("getShadow(","getShadow( UNROLLED_LOOP_INDEX, "),_i.shadowmask_pars_fragment=n,!0},ROe=` 10868attribute vec3 randomColor; 10869varying vec3 vNormal; 10870flat out vec3 vColor; 10871#include <skinning_pars_vertex> 10872 10873void main() 10874{ 10875#include <beginnormal_vertex> 10876#include <skinbase_vertex> 10877#include <skinnormal_vertex> 10878vec3 transformed = vec3(position); 10879#include <skinning_vertex> 10880 10881vNormal = normal; 10882vColor = randomColor; 10883gl_Position = projectionMatrix * (modelViewMatrix * vec4(transformed, 1.0)); 10884} 10885`,BOe=` 10886uniform float depthContrast; 10887varying vec3 vNormal; 10888flat in vec3 vColor; 10889void main() 10890{ 10891vec3 normal = (normalize(vNormal)).rgb; 10892 10893float contrastDepth = (gl_FragCoord.z - 0.5) * depthContrast + 0.5; 10894 10895vec3 resultColor = mix(mix(vColor, normal, 0.2), vec3(contrastDepth), 0.4); 10896gl_FragColor = vec4(resultColor, vColor.r); 10897gl_FragColor = vec4(resultColor, vColor.r); 10898} 10899`,ZI=new Xi({vertexShader:ROe,fragmentShader:BOe,uniforms:{depthContrast:{value:1}}}),iV=new en,rV=new Me,IOe=class extends U7{constructor(t){super(t),this._pixelRatio=this.getPixelRatio(),this.viewportWidth=1,this.viewportHe
10899ight=1,this.resolution=new Me,this.dummyCamera=new ms,this.sceneTransitionDuration=0,this.sceneTransitionTimeRemaining=-1,this.isXRCopyPassSet=!1,this.clear=(a=!0,s=!0,o=!0)=>{let l=this.getContext(),c=0;a&&(c|=l.COLOR_BUFFER_BIT),s&&(c|=l.DEPTH_BUFFER_BIT),o&&(c|=l.STENCIL_BUFFER_BIT),l.clear(c),l.clearBufferfv(l.COLOR,1,[0,0,0,1])},this.pipeline=new bOe(this,(t==null?void 0:t.needsDOFResize)??!1),this.autoClear=!1;let i=this.setPixelRatio.bind(this),r=this.setSize.bind(this);this.shadowMap.enabled=!0,this.shadowMap.type=tN,this.dummyCamera.matrixAutoUpdate=!1,this.domElement.removeAttribute("data-engine");let n=this.getContext();if(n&&"drawingBufferColorSpace"in n)try{n.drawingBufferColorSpace="display-p3"}catch(a){console.warn(a)}this.setPixelRatio=a=>{this._pixelRatio!==a&&(this._pixelRatio=a,i(a))},this.setSize=(a,s,o=!0)=>{var l,c;(this.viewportWidth!==a||this.viewportHeight!==s)&&(this.viewportWidth=a,this.viewportHeight=s,r(a,s,o),(l=this.normalRenderTarget)==null||l.setSize(a*this._pixelRatio,s*this._pixelRatio),this._resizeTransmission(a,s),(c=this.transmissionDepthTarget)==null||c.setSize(a*this._pixelRatio/2,s*this._pixelRatio/2),this.pipeline.resize(a,s,o))},this._superDispose=this.dispose,this.dispose=this._currentDispose}createAORenderTarget(){this.aoRenderTarget===void 0&&(this.aoRenderTarget=new $i(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio,{generateMipmaps:!1,minFilter:Ei,magFilter:Ei,wrapS:Gr,wrapT:Gr,depthBuffer:!1}))}_resizeTransmission(t,i){var r,n;(r=this.transmissionRenderTarget)==null||r.setSize(t*this._pixelRatio/(this.hdTransmission?1:2),i*this._pixelRatio/(this.hdTransmission?1:2)),(n=this.aoRenderTarget)==null||n.setSize(t*this._pixelRatio/1,i*this._pixelRatio/1)}get hdTransmission(){return zt.transmissionLod.value===1}set hdTransmission(t){zt.transmissionLod.value=t===!0?1:2,this._resizeTransmission(this.viewportWidth,this.viewportHeight)}createTransmissionRenderTarget(){this.transmissionRenderTarget===void 0&&(this.transmissionRenderTarget=new $i(this.viewportWidth*this._pixelRatio/(this.hdTransmission?1:2),this.viewportHeight*this._pixelRatio/(this.hdTransmission?1:2),{generateMipmaps:!0,minFilter:a0,magFilter:Ei,wrapS:Gr,wrapT:Gr,depthBuffer:!1}),this.transmissionDepthTarget=new $i(this.viewportWidth*this._pixelRatio/2,this.viewportHeight*this._pixelRatio/2,{minFilter:tr,magFilter:tr,depthBuffer:!1}))}createNormalRenderTarget(){this.normalRenderTarget===void 0&&(this.normalRenderTarget=new $i(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio,{generateMipmaps:!1,minFilter:tr,magFilter:tr,type:On,depthTexture:new o0(this.viewportWidth*this._pixelRatio,this.viewportHeight*this._pixelRatio)}))}renderNormal(t,i,r){this.normalRenderTarget&&(this.setClearColor(0),r.layers.enable(8),r.layers.disable(0),r.layers.disable(3),i.traverseEntity(n=>{n.layers.isEnabled(8)&&(n.copyPreviousMatrix=!1)}),this.setRenderTarget(this.normalRenderTarget),this.clear(),r instanceof ms?ZI.uniforms.depthContrast.value=(r.far-r.near)/1e4:ZI.uniforms.depthContrast.value=1,i.overrideMaterial=ZI,this.render(i,r),this.setClearColor(i.bgColor,i.bgColor.a),this.setRenderTarget(null),i.overrideMaterial=t.wireframeState?VL:null,r.layers.enable(0),r.layers.enable(3),i.traverseEntity(n=>{n.layers.isEnabled(8)&&(n.copyPreviousMatrix=!0)}))}renderSplineSceneWithDummyCamera(t,i,r=1){this.dummyCamera.updateCameraState(i.dataPatched),this.dummyCamera.matrix.copy(i.matrixWorld);let n=i.height,a=i.width,s=this.viewportWidth/this.viewportHeight;a<n?a=n*s:n=a/s,this.dummyCamera.setViewplaneSize(a,n);for(let o=0;o<r;o++)this.renderSplineScene(t,this.dummyCamera)}renderSplineScene(t,i,{sceneHelpers:r=this.sceneHelpers,sceneHelpersOnTop:n=this.sceneHelpersOnTop,overrideTransmission:a=void 0,overrideNormal:s=void 0}={}){var A;let o=t instanceof SU?t.activePage:t,l=o.visible;o.visible=!0;let c=o.scene;this.xr.enabled&&(this.isXRCopyPassSet===!1&&this.getRenderTarget()!==null&&(this.pipeline.setCopyPass(this.getRenderTarget()),this.isXRCopyPassSet=!0),this.xr.updateCamera(i)),this.setClearColor(o.bgColor,o.bgColor.a),o.penumbraSizeArray.forEach((f,m)=>{zt.penumbraSize.value[m]=f}),zt.pixelRatioNode.value=this.getPixelRatio(),this.resolution.x!==0&&this.resolution.y!==0?zt.resolution.value.set(this.resolution.x,this.resolution.y):zt.resolution.value.set(this.viewportWidth*this._pixelRatio,this.viewportHe
10899ight*this._pixelRatio),s!==void 0?(zt.normalRenderTarget.value=s,zt.normalRenderTargetDepth.value=iV):c.needsNormal()&&(this.createNormalRenderTarget(),zt.normalRenderTarget.value=this.normalRenderTarget.texture,zt.normalRenderTargetDepth.value=this.normalRenderTarget.depthTexture,this.renderNormal(c,o,i));let h=o.data.ao,u=h.occlusion;if(u&&(this.createAORenderTarget(),zt.aoRenderTarget.value=this.aoRenderTarget.texture),zt.aoEnabled.value=u,this.pipeline.setAmbientOcclusionParams(h.occlusion,h.radius,h.bias,o.aoColor,o.fog!==null,o.backupFog.near,o.backupFog.far,h.aoFullRes&&!RE),this.pipeline.aoPass.setBlueNoiseTexture(this.pipeline.blueNoiseTexture),this.pipeline.isUIOverlayEnabled&&((A=o.uiCanvas)==null?void 0:A.enabled)&&o.uiCanvas.texture&&o.uiCanvas.texture.image.width>0){let f=this.getSize(rV),m=this.getPixelRatio();(o.uiCanvas.width!==this.viewportWidth||o.uiCanvas.height!==this.viewportHeight||o.uiCanvas.dpr!==m)&&o.uiCanvas.applySize({width:this.viewportWidth,height:this.viewportHeight},m),o.uiCanvas.render(this),this.pipeline.uiOverlayPass.uiCanvas=o.uiCanvas,this.pipeline.uiOverlayPass.enabled=!0,this.pipeline.uiOverlayPass.setResolution(f.x,f.y,m),this.pipeline.updateRenderToScreen()}else this.pipeline.uiOverlayPass.enabled=!1,this.pipeline.updateRenderToScreen();if(this.pipeline.logoOverlayPass.enabled){let f=this.getSize(rV),m=this.getPixelRatio();this.pipeline.logoOverlayPass.uniforms.uResolution.value.set(f.x,f.y),this.pipeline.logoOverlayPass.uniforms.uDPR.value=m}let d=!1;if(a!==void 0)zt.transmissionRenderTarget.value=a,zt.transmissionRenderTargetDepth.value=iV,this.pipeline.setTransmissionPassEnabled(!1);else{let f=c.needsTransmission();f&&(this.transmissionRenderTarget===void 0&&(d=!0),this.createTransmissionRenderTarget(),zt.transmissionRenderTarget.value=this.transmissionRenderTarget.texture,zt.aspectRatio.value=E2e(this.viewportWidth,this.viewportHeight),zt.transmissionRenderTargetDepth.value=this.transmissionDepthTarget.texture),this.pipeline.setTransmissionPassEnabled(f)}i.layers.enable(3),i.layers.enable(8),this.pipeline.sceneHelpers=r,this.pipeline.sceneHelpersOnTop=n,this.pipeline.scene=o,this.pipeline.camera=i,d&&this.pipeline.transmissionPass.updatePasses(this),this.pipeline.postprocessingState!==o.postprocessing&&(this.pipeline.updatePostprocessing(o.postprocessing),!r&&!n&&this.pipeline.disableHelpers()),this.clearAlphaOverride!==void 0&&this.setClearAlpha(this.clearAlphaOverride),o.overrideMaterial=c.wireframeState?VL:null,this.pipeline.render(),zt.frameIndex.value=(zt.frameIndex.value+1)%16,i instanceof ms&&i.copyHistory(),o.visible=l}renderFromSceneForSceneTransitionPass(t,i,r){this.pipeline.renderToScreen=!1,this.pipeline.renderTarget,this.renderSplineScene(t,i),this.pipeline.sceneTransitionFromTexture=this.pipeline.renderTarget.texture,this.sceneTransitionDuration=r,this.sceneTransitionTimeRemaining=r,this.pipeline.renderToScreen=!0;let n=this.pipeline.sceneTransitionPass.uniforms;n.uDPR.value=window.devicePixelRatio,n.uResolution.value.set(this.domElement.width,this.domElement.height).divideScalar(window.devicePixelRatio)}_currentDispose(){var t,i,r,n,a,s;this._superDispose(),this.pipeline.dispose(),(t=this.aoRenderTarget)==null||t.dispose(),(i=this.transmissionRenderTarget)==null||i.dispose(),(r=this.transmissionDepthTarget)==null||r.dispose(),(n=this.normalRenderTarget)==null||n.dispose(),(s=(a=this.normalRenderTarget)==null?void 0:a.depthTexture)==null||s.dispose()}},$X=class extends DE(wye){constructor(t,i=15,r=10066329){super(t,i,r),this.object=t,this.added=!1,this.name=`DirectionalLightHelper: ${t.uuid}`}raycast(t,i){PE(this.object,$X.geometryHelper,t,i)}},eq=class extends DE(Eye){constructor(t,i=15,r=6710886){super(t,i,r),this.object=t,this.name=`PointLightHelper: ${t.uuid}`}raycast(t,i){PE(this.object,eq.geometryHelper,t,i)}},FL=class extends DE(yye){constructor(t,i=6710886){super(t,i),this.object=t,this.name=`SpotLightHelper: ${t.uuid}`}raycast(t,i){PE(this.object,FL.geometryHelper,t,i)}update(){if(this.object!==void 0){let t=FL._vector,i=this.object.distance?this.object.distance:1e3,r=i*Math.tan(this.object.angle);this.cone.scale.set(r,r,i),t.setFromMatrixPosition(this.object.target.matrixWorld),this.cone.lookAt(t);let n=this.color!==void 0?this.color:this.light.color;if(this.cone.material instanceof Array)for(let a=0,s=this.cone.material.length;a<s;a++)this.cone.material[a].color.set(n);else this.cone.material.color.set(n)}}},tq=FL;tq._vector=new O;var iq=class extends Tu{constructor(){super(),this.caretIndex=0,this._caretVisibleAlpha=1,this._selectionVisibleAlpha=.3,this.current={start:0,end:void 0},this.matrixAutoUpdate=!1,this.caretMesh=new Zr(new zu(1,1),new Gu({transparent:!0,opacity:0,side:hs})),this.add(this.caretMesh),this.selectionMesh=new Zr(new zu(1,1),new Gu({color:2857471,transparent:!0,depthTest:!1,depthWrite:!1,opacity:0,side:hs})),this.add(this.selectionMesh),this.hide()}get caretHeight(){var t;return((t=this.object)==null?void 0:t.AD)??0}
vendor: 4,554 bytes, lines 10899-10900
10899show(t){this.visible=!0,this.object=t,this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.y=-this.caretHeight*.5,this.setCaretPosition(this.caretIndex),this.update()}hide(){this.visible=!1}update(){if(this.object===void 0)return;this.updateHelperMatrix();let{depth:t}=this.object.geometry.userData.parameters;this.caretMesh.position.z=t,this.selectionMesh.position.z=t}updateHelperMatrix(){if(this.object===void 0)return;let t=this.object,i=t.parent;i!==null&&i.updateWorldMatrix(!0,!1),t.matrixAutoUpdate&&t.updateMatrix(),i!==null?(this.matrixWorld.multiplyMatrices(i.matrixWorld,t.hiddenMatrix),this.matrixWorld.multiplyMatrices(this.matrixWorld,t.matrix)):this.matrixWorld.multiplyMatrices(t.hiddenMatrix,t.matrix),this.matrix.copy(this.matrixWorld);for(let r of this.children)r.matrixWorld.copy(this.matrixWorld);t.updateWorldMatrix(!0,!0)}setCaretColor(t){let i=this.caretMesh.material;i.color.setRGB(t.r,t.g,t.b);let r=this._caretVisibleAlpha===i.opacity;this._caretVisibleAlpha=t.a,r&&(i.opacity=this._caretVisibleAlpha)}setSelectionColor(t){this.selectionMesh.material.color.setRGB(t.r,t.g,t.b)}setCaretPosition(t,i={}){if(this.object===void 0)return;this.caretIndex=t;let r=this.object.wrappedText,[n,a]=mT(r,t),[s,o]=t>0?mT(r,t-1):[null,null];(t>0&&r.length?r[s].charAt(o):null)===` 10900`&&(n++,a=0),this.current.start=t,this.current.end=void 0;let[l,c]=JI(this.object,n,a),{AD:h,descender:u}=this.object,d=u+h*.5,{width:A,height:f,depth:m}=this.object.geometry.userData.parameters,g=typeof A=="string"?0:A,p=typeof f=="string"?0:f;this.caretMesh.scale.set(1,this.caretHeight,1),this.caretMesh.position.set(l-g*.5,c+d+p*.5,m),this.hideSelectionMesh(),this.showCaretMesh()}setSelection(t,i){if(this.object===void 0)return;let r=this.object.wrappedText;this.current.start=t,this.current.end=i;let n=[],a=[],s=DOe(r,t,i),{lineHeight:o,AD:l,descender:c}=this.object,h=c+l*.5-o*.5;for(let[p,v,_]of s)if(v!==_){let[y,w]=JI(this.object,p,v),[b,E]=JI(this.object,p,_);w+=h,E+=h,E+=o;let M=n.length/3;n.push(y,w,0),n.push(b,w,0),n.push(b,E,0),n.push(y,E,0),a.push(M+0,M+1,M+2),a.push(M+2,M+3,M+0)}let u=new Lt;u.setIndex(a),u.setAttribute("position",new Et(n,3));let{width:d,height:A,depth:f}=this.object.geometry.userData.parameters,m=typeof d=="string"?0:d,g=typeof A=="string"?0:A;this.selectionMesh.geometry.dispose(),this.selectionMesh.geometry=u,this.selectionMesh.position.x=-m*.5,this.selectionMesh.position.y=g*.5,this.selectionMesh.position.z=f,this.showSelectionMesh(),this.hideCaretMesh()}getSelectionFromPosition(t,i,r="previous"){if(this.object===void 0||this.object.font===void 0)return;let n=this.object.wrappedText,a=n.length,s=this.object.lineHeight,o=a*s,{height:l,verticalAlign:c}=this.object.geometry.userData.parameters,h=typeof l=="string"?0:l,u=0;c===3?u=h-o:c===2&&(u=h*.5-o*.5);let d=Math.min(Math.floor(Math.max(Math.min(-i-u,o),0)/s),a-1),A=this.object.charCoords[d],f=this.object.charWidths[d],m=0,g=!1;if(r==="previous"){for(let p=0;p<A.length;p++)if(A[p][0]+f[p]*.5-t>0){m=p,g=!0;break}}else if(r==="closest"){let p=1/0;for(let v=0;v<A.length;v++){let _=A[v][0]+f[v]*.5,y=Math.abs(_-t);y<p&&(p=y,m=v,g=!0)}}else for(let p=0;p<A.length;p++){let v=A[p][0],_=A[p][0]+f[p];if(t>=v&&t<_){m=p,g=!0;break}}return g||(m=A.length),{index:this.getGlobalIndexFromLineAndCharIndexes(n,d,m),lineIndex:d,characterIndex:m}}getGlobalIndexFromLineAndCharIndexes(t,i,r){return t.slice(0,i).reduce((n,a)=>n+=a.length,0)+r}showSelectionMesh(){this.selectionMesh.material.opacity=this._selectionVisibleAlpha}hideSelectionMesh(){this.selectionMesh.material.opacity=0}showCaretMesh(){this.caretMesh.material.opacity=this._caretVisibleAlpha}hideCaretMesh(){this.caretMesh.material.opacity=0}};function JI(t,i,r){let{charCoords:n,charWidths:a,initialOffsetY:s,lineHeight:o}=t;if(n[i]&&n[i].length===0||n.length===0){let u=0,{horizontalAlign:d}=t.data.geometry,A=t.wrappedText,{width:f}=t.geometry.userData.parameters;return A.length===1&&A[0].length===0&&(d===3?u=f*.5:d===2&&(u=f)),[u,s-o*i]}let l=n[i];if(l===void 0||l.length===0)return[0,0];let[c,h]=l[Math.min(r,l.length-1)];return r>=l.length&&(c+=a[i][r-1]),[c,h]}function mT(t,i){var n;let r=0;for(let a=0;a<t.length;a++){let s=t[a],o=i-r;if(o<=s.length)return[a,o];r+=s.length}return[Math.max(0,t.length-1),((n=t[t.length-1])==null?void 0:n.length)??0]}function DOe(t,i,r){let[n,a]=mT(t,i),[s,o]=mT(t,r),l=[];a>=t[n].length&&(n++,a=0);for(let c=n;c<=s;c++){let h=t[c],u=c===n?a:0,d=c===s?o:h.length;l.push([c,u,d])}return l}function POe(t,i){let r=ka.fromHex(3223857),n=.8;
10900for(let a of t.layers){if(a.data.type==="light"||a.data.type==="displace"||a.data.type==="fresnel"||a.data.type==="matcap"||a.data.type==="texture"||a.data.type==="toon"||a.data.type==="outline"||a.data.type==="transmission"||a.data.type==="noise")continue;let s=typeof a.data.alpha=="string"?Number(i.getVariable(a.data.alpha)):a.data.alpha;if(a.data.type==="color"&&s>.3){r=LOe(a.data.color,i),n=s;break}else if((a.data.type==="depth"||a.data.type==="gradient")&&s>.3){let o=OOe(a.data);r={r:o[0],g:o[1],b:o[2]},n=typeof a.data.alpha=="string"?1:a.data.alpha;break}}return{...r,a:n}}function LOe(t,i){return typeof t=="string"?i.data.colors[t]:t}function OOe(t){return t.colors[0]}function NOe(t,i){t.shadow.camera.right=i/2,t.shadow.camera.left=-i/2,t.shadow.camera.top=i/2,t.shadow.camera.bottom=-i/2,t.shadow.needsUpdate=!0}var rq=class extends fU(aye,$X){constructor(t,i,r){super(),this.super_Entity(t,i),this.castShadow=!0,this.shadow.mapSize.width=2048,this.shadow.mapSize.height=2048,this.shadow.normalBias=1,this.layers.enable(3);let n=this.shadow.camera;n.top=1250,n.bottom=-1250,n.right=1250,n.left=-1250,n.near=-1e4,n.far=2500;let a=new PC(this.shadow.camera);a.visible=!1,this.gizmos.shadowmap=a}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this.gizmos){let i=this.gizmos[t];i instanceof PC&&i.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.objectHelper&&this.objectHelper.update()}updateState(t,i){this.updateState_Light(t,i);let r=t.depth!==void 0&&t.depth!==this.shadow.camera.far||t.size!==void 0&&t.size/2!==this.shadow.camera.right;t.size!==void 0&&NOe(this,t.size),t.shadowRadius!==void 0&&(this.shadow.radius=t.shadowRadius),t.shadowResolution!==void 0&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null)),t.penumbraSize!==void 0&&i.scene.markPenumbraSizeDirty(),r&&this.update()}},nV=new O,aV=new O,sV=new ri,nq=class extends fU(tye,tq){constructor(t,i,r){super(),this.super_Entity(t,i),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let n=this.shadow.camera;n.fov=Ct.RAD2DEG*2*this.angle,n.aspect=1,n.near=100,n.far=2500;let a=new PC(this.shadow.camera);a.visible=!1,this.gizmos.shadowmap=a,this.update()}update(){this.shadow.camera.updateProjectionMatrix();for(let t in this.gizmos){let i=this.gizmos[t];i instanceof PC&&i.update()}}updateMatrixWorld(t){super.updateMatrixWorld(t),aV.setFromMatrixPosition(this.matrixWorld),sV.setFromRotationMatrix(this.matrixWorld),nV.copy(this.up).applyQuaternion(sV).negate().multiplyScalar(this.distance),this.target.position.copy(aV).add(nV),this.target.updateMatrixWorld(),this.objectHelper&&this.objectHelper.update()}updateState(t,i){this.updateState_Light(t,i),t.distance!==void 0&&(this.distance=t.distance),t.decay!==void 0&&(this.decay=t.decay),t.angle!==void 0&&(this.angle=t.angle),t.penumbra!==void 0&&(this.penumbra=t.penumbra),t.shadowRadius!==void 0&&(this.shadow.radius=t.shadowRadius),t.penumbraSize!==void 0&&i.scene.markPenumbraSizeDirty(),t.shadowResolution!==void 0&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}};function UOe(t){let i=(t[0][0]+t[1][1])/2,r=(t[0][0]-t[1][1])/2,n=(t[1][0]+t[0][1])/2,a=(t[1][0]-t[0][1])/2,s=Math.sqrt(i*i+a*a),o=Math.sqrt(r*r+n*n),l=s+o,c=s-o,h=Math.atan2(n,r),u=Math.atan2(a,i),d=(u-h)/2,A=(u+h)/2,f=[[Math.cos(A),Math.sin(A)],[-Math.sin(A),Math.cos(A)]],m=[[l,0],[0,c]],g=[[Math.cos(d),Math.sin(d)],[-Math.sin(d),Math.cos(d)]];return f[0][0]*=-1,f[0][1]*=-1,g[0][0]*=-1,g[1][0]*=-1,[f,m,g]}function OS(t,i){return[[t[0][0]*i[0][0]+t[0][1]*i[1][0],t[0][0]*i[0][1]+t[0][1]*i[1][1]],[t[1][0]*i[0][0]+t[1][1]*i[1][0],t[1][0]*i[0][1]+t[1][1]*i[1][1]]]}function oV(t){return[[t[0][0],t[1][0]],[t[0][1],t[1][1]]]}function FOe(t){let[i,r,n]=UOe(t),a=OS(i,oV(n)),s=OS(OS(n,r),oV(n)),o=Math.atan2(a[1][0],a[0][0]),l=[s[0][0],s[1][1]],c=[s[0][1]/s[1][1],s[1][0]/s[0][0]];return{rotation:o,scale:l,shear:c}}function kOe({rotation:t,scale:i,shear:r}){let n=Math.cos(t),a=Math.sin(t),s=[[n,-a],[a,n]],o=[[i[0],r[0]*i[1]],[r[1]*i[0],i[1]]],l=OS(s,o);return[l[0][0],l[1][0],l[0][1],l[1][1]]}var Vi;(t=>{function i(){return[1,0,0,0,1,0,0,0,1]}t.identity=i;function r(E,M=t.identity()){for(let S=0,T=E.length;S<T;S++)M[S]=E[S];return M}t.copy=r;function n(E,M,S,T,C,x){return t.setAbcdef(t.identity(),E,M,S,T,C,x)}t.create=n;function a(E,M,S,T,C,x,R){return E[0]=M,E[1]=T,E[2]=x,E[3]=S,E[4]=C,E[5]=R,E}t.setAbcdef=a;function s(E,M){let[S,T,C,x,R,L]=l(E),[I,F,Y,D,U,j]=l(M),J=I*S+F*C,z=I*T+F*x,$=Y*S+D*C,te=Y*T+D*x,ae=U*S+j*C+R,ve=U*T+j*x+L;return t.create(J,z,$,te,ae,ve)}t.append=s;function o(E,M){let[S,T,C,x,R,L]=l(E),[I,F,Y,D,U,j]=l(M),J=S,z=T,$=C,te=x;(I!==1||F!==0||Y!==0||D!==1)&&(J=S*I+T*Y,z=S*F+T*D,$=C*I+x*Y,te=C*F+x*D);
vendor: 9,509 bytes, line 10900
10900let ae=R*I+L*Y+U,ve=R*F+L*D+j;return t.create(J,z,$,te,ae,ve)}t.prepend=o;function l(E){return[E[0],E[3],E[1],E[4],E[2],E[5]]}t.getAbcdef=l;function c(E){let[M,S,T,C,x,R]=t.getAbcdef(E),L=M*C-S*T,I=C/L,F=-S/L,Y=-T/L,D=M/L,U=(T*R-C*x)/L,j=-(M*R-S*x)/L;return t.create(I,F,Y,D,U,j)}t.invert=c;function h([E,M],S){let[T,C,x,R,L,I]=t.getAbcdef(S);return[T*E+x*M+L,C*E+R*M+I]}t.apply=h;function u(E,M){let[S,T,C,x,R,L]=t.getAbcdef(M),I=1/(S*x+C*-T),[F,Y]=E;return[x*I*F+-C*I*Y+(L*C-R*x)*I,S*I*Y+-T*I*F+(-L*S+R*T)*I]}t.applyInverse=u;function d(E,M,S=M){let[T,C,x,R,L,I]=t.getAbcdef(E);return t.setAbcdef(E,T*M,C*S,x*M,R*S,L*M,I*S),E}t.scale=d;function A(E,M){let S=Math.cos(M),T=Math.sin(M),[C,x,R,L,I,F]=t.getAbcdef(E);return t.setAbcdef(E,C*S-x*T,C*T+x*S,R*S-L*T,R*T+L*S,I*S-F*T,I*T+F*S),E}t.rotate=A;function f(E,M,S){let[T,C]=S,x=t.translate(E,-T,-C);return x=t.rotate(x,M),x=t.translate(x,T,C),x}t.rotateAround=f;function m(E,M,S){let[T,C,x,R,L,I]=t.getAbcdef(E);return t.setAbcdef(E,T,C,x,R,L+M,I+S),E}t.translate=m;function g(E,M,S){let[T,C,x,R]=t.getAbcdef(E);return t.setAbcdef(E,T,C,x,R,M,S),E}t.setTranslate=g;function p(E,M,S){let[T,C,x,R]=t.getAbcdef(E);return t.setAbcdef(E,T,C,x,R,M,S),E}t.setPosition=p;function v(E){let[M,S,T,C]=t.getAbcdef(E),x=Math.sqrt(M*M+S*S),R=Math.sqrt(T*T+C*C);return[x,R]}t.getScale=v;function _(E){let[,,,,M,S]=t.getAbcdef(E);return[M,S]}t.getPosition=_;function y(E,M){return t.decompose(E,M).rotation}t.getRotation=y;function w(E,M){let[S,T,C,x,R,L]=t.getAbcdef(E),{rotation:I,scale:F,shear:Y}=FOe([[S,C],[T,x]]);return{position:[R+(M[0]*S+M[1]*C)-M[0],L+(M[0]*T+M[1]*x)-M[1]],scale:F,rotation:I,shear:Y,pivot:M}}t.decompose=w;function b(E,M,S,T,C=[0,0]){let[x,R]=E,[L,I]=T,[F,Y,D,U]=kOe({rotation:S,scale:M,shear:C}),j=x-(L*F+I*D)+L,J=R-(L*Y+I*U)+I;return t.create(F,Y,D,U,j,J)}t.compose=b})(Vi||(Vi={}));var HOe=Math.PI/180;function GOe(t,i,r,n,a,s){let o=t-r,l=i-n;return o*o/(a*a)+l*l/(s*s)<=1}function zOe(t){return t*HOe}var Ca=class{constructor(t,i,r){this.uuid=t,this.data=i,this.localMatrix=Vi.identity(),this.worldMatrix=Vi.identity(),this.ignoreCameraZoom=!1,this.visible=!0,this._singleBBox=new kL,this._recursiveBBox=new kL,this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0,this.stateSelection=null,this.prevState=null,this.currentState=null,this.reversibleToState=null,this.currentTransitionEvent=null,this.previousAction=null,this.name="",this.position=[0,0],this.scale=[1,1],this.rotation=0,this.shear=[0,0],this.emitter=cU(),this.dpr=r.dpr??1,this.dataPatched=i}project(t,i){let r=this.worldMatrix;return i&&(r=Vi.append(i.worldMatrix,r)),Vi.applyInverse(t,r)}intersects(t,i,r,n=!1){return this.visible&&!this.data.raycastLock&&this.intersectsInLocalSpace(...this.project([t,i],r),n)}intersectsInLocalSpace(t,i,r=!1){let{min:n,max:a}=r?this.recursiveBBox:this.singleBBox;return t>=n[0]&&t<=a[0]&&i>=n[1]&&i<=a[1]}applyTransforms(t){t.setTransform(this.worldMatrix,this.ignoreCameraZoom)}get singleBBox(){return this.singleBBoxNeedsUpdate&&(this.singleBBoxNeedsUpdate=!1,this._singleBBox.setFromObjectSize(this,!1),this._singleBBox.computeVertices(),this._singleBBox.computeEdges()),this._singleBBox}get recursiveBBox(){return this.recursiveBBoxNeedsUpdate&&(this.recursiveBBoxNeedsUpdate=!1,this._recursiveBBox.setFromObjectSize(this,!0),this._recursiveBBox.computeVertices(),this._recursiveBBox.computeEdges()),this._recursiveBBox}updateLocalMatrix(){this.localMatrix=Vi.compose(this.position,this.scale,zOe(this.rotation),rp.getPivot(this.dataPatched),this.shear)}updateWorldMatrix(t,i,r){let n=this.parent;i&&n!==null&&n!==void 0&&n.updateWorldMatrix(t,!0,!1),t&&this.updateLocalMatrix(),this.parent?this.worldMatrix=Vi.append(this.parent.worldMatrix,this.localMatrix):this.worldMatrix=Vi.copy(this.localMatrix),this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}get pivot(){return rp.getPivot(this.data)}getCenter(){return[0,0]}getHalfSize(){return[0,0]}get id(){return this.uuid}resetBBoxNeedsUpdateSelf(){this.singleBBoxNeedsUpdate=!0,this.recursiveBBoxNeedsUpdate=!0}resetBBoxNeedsUpdate(){this.resetBBoxNeedsUpdateSelf(),this.traverseAncestors(t=>{t.resetBBoxNeedsUpdateSelf()})}updateTransformState(t){let i=!1;t.position!==void 0&&(i=!0,this.position=t.position),t.rotation!==void 0&&(i=!0,this.rotation=t.rotation),t.scale!==void 0&&(i=!0,this.scale=t.scale),t.shear!==void 0&&(i=!0,this.shear=t.shear),i&&(this.updateWorldMatrix(!0,!1,!0),this.resetBBoxNeedsUpdate())}updateByOp(t,i,r){t.type===0&&t.props.visible!==void 0&&(this.visible=t.props.visible),this.data=i,this.data=i;let n=t,a=Er(t.path,["states","*"]);if(a!==null){if(t.type===0){let[s]=a;if((this==null?void 0:this.stateSelection)===s){let o={...t.props};if(delete o.name,Object.values(t.props).some(l=>l===void 0)){let l=this.data;if(l!==void 0){let c=Zn.zoom(l,t.path.slice(2));if(c)for(let h in t.props)t.props[h]===void 0&&h in c&&(o[h]=c[h])}}n={...t,props:o,path:t.path.slice(2)}}}}else if(t.type===0){let s=this.stateSelection?this.data.states.data(this.stateSelection):void 0;if(s!==void 0){if(t.props.name!==void 0&&s.name){let{name:l,...c}=s;s=c}let o=Zn.removeOverridden(t.path,t.props,s);n={...t,props:o}}}this.updateByPatchedOpBase(n,Of.patch(this.data,this.stateSelection?this.data.states.data(this.stateSelection):void 0),r)}changeSelectedState(t,i,r=!1){if(!(this.data.states.length===0&&!r)){for(let n of this.data.states)Of.toOps(this.data,n.data).forEach(a=>{let s=VC.replaceProps(a,this.data);this.dataPatched=this.data,this.updateByPatchedOp(s,this.data,i)});if(t!==null){let n=this.data.states.data(t);n&&(this.dataPatched=Of.patch(this.data,n),Of.toOps(this.data,n).forEach(a=>{this.updateByPatchedOp(a,this.dataPatched,i)}))}r&&this.updateTransformState(this.dataPatched),this.stateSelection=t}}updateState(t,i){t.name!==void 0&&(this.name=t.name),t.visible!==void 0&&(this.visible=t.visible),this.updateTransformState(t)}updateByPatchedOpBase(t,i,r){this.dataPatched=i,this.updateByPatchedOp(t,i,r)}updateByPatchedOp(t,i,r){t.path.length===0&&t.type===0&&this.updateState(t.props,r),this.requestRender()}traverseFrameAncestors(t){this.traverseAncestors(i=>{i.data.type==="frame2d"&&t(i)})}traverseAncestors(t){let i=this.parent;for(;i;)t(i),i=i.parent}requestRender(){this.traverseFrameAncestors(t=>{t.requestRender()})}clone(t){let i=new Ca(this.uuid,this.data,t);return i.parent=void 0,i}addEventListener(t,i){this.emitter.on(t,i)}removeEventListener(t,i){this.emitter.off(t,i)}dispatchEvent(t){this.emitter.emit(t.type,{...t,target:t.target??this})}traverseSortNextHelper(){let t=this.parent;if(t){let i=t.children;if(i){let r=i.indexOf(this)+1;return i[r]?i[r]:t.traverseSortNextHelper()}}}sortNext(){let t=this.children;return t&&t.length>0&&t[0]?t[0]:this.traverseSortNextHelper()}isDescendantOf(t){t instanceof Ca&&(t=t.uuid);let i=this;for(;i.parent;){if(i.parent.uuid===t)return!0;i=i.parent}return!1}},ec=class extends Ca{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this.context=r,this.children=[]}add(t){t.parent&&t.parent instanceof ec&&t.parent.remove(t),this.children.push(t),t.parent=this}remove(t){let i=this.children.indexOf(t);i>=0&&(this.children.splice(i,1),t.parent=void 0)}traverse(t){let i=t(this);if(i!==!0)for(let r of this.children)r instanceof ec?r.traverse(t):i=t(r)}intersectsChildrenHelper(t,i,r,n,a){for(let s of this.children)if(s.intersects(t,i,r,!1)&&(a.push(s),n)||s instanceof ec&&s.intersectsChildrenHelper(t,i,r,n,a))return!0;return!1}intersectsChildren(t,i,r,n=!1,a=[],s=!1){return this.intersectsChildrenHelper(t,i,r,n,a),a}intersectsChildrenHelperReverse(t,i,r,n,a){for(let s of this.children)if(s instanceof ec&&s.intersectsChildrenHelperReverse(t,i,r,n,a)||s.intersects(t,i,r,!1)&&(a.push(s),n))return!0;return!1}intersectsChildrenReverse(t,i,r,n=!1,a=[],s=!1){return this.intersectsChildrenHelperReverse(t,i,r,n,a),a}updateWorldMatrix(t,i,r){if(super.updateWorldMatrix(t,i,r),r&&this.children)for(let n of this.children)n.updateWorldMatrix(t,!1,!0)}find(t){let i;return this.traverse(r=>{r.uuid===t&&(i=r)}),i}innerDrawChildren(t){for(let i=this.children.length-1;i>=0;i--)this.children[i].draw(t)}resetBBoxNeedsUpdate(){super.resetBBoxNeedsUpdate(),this.traverse(t=>{t.resetBBoxNeedsUpdateSelf()})}clone(t){let i=new ec(this.uuid,this.data,t);i.parent=void 0;for(let r of this.children)i.add(r.clone(t));return i}},OA=class extends ec{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this.updateState(i,r)}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.innerDrawChildren(t),t.restore())}clone(t){let i=new OA(this.uuid,this.data,t);i.parent=void 0;for(let r of this.children)i.add(r.clone(t));return i}};function QOe(t,i){let[[r,n],[a,s]]=t,[[o,l],[c,h]]=i,u=(r-a)*(l-h)-(n-s)*(o-c);if(u===0)return!1;let d=((r-o)*(l-h)-(n-l)*(o-c))/u,A=-((r-a)*(n-l)-(n-s)*(r-o))/u;return d>=0&&d<=1&&A>=0&&A<=1}var aq=[[-1,1],[-1,-1],[1,-1],[1,1]],lV=(t,i,r)=>{let n=t.getCenter(),a=t.getHalfSize(),s=Vi.append(i,t.worldMatrix);a[0]===0&&a[1]===0?r.push(Vi.apply(n,s)):aq.forEach(o=>{let l=[o[0]*a[0]+n[0],o[1]*a[1]+n[1]];r.push(Vi.apply(l,s))})},kL=class{constructor(){this.matrix=Vi.identity(),this.min=[1/0,1/0],this.max=[-1/0,-1/0],this.vertices=[],this.edges=[]}setFromObjectSize(t,i=!1){t.updateWorldMatrix(),this.makeEmpty(),Vi.copy(t.worldMatrix,this.matrix);let r=Vi.invert(t.worldMatrix);this.expandByObjectSize(t,r,i)}expandByObjectSize(t,i,r=!1){let n=[];r===!0&&t instanceof ec?t.traverse(a=>{a.visible&&lV(a,i,n)}):lV(t,i,n),this.setFromPoints(n)}
10900setFromSize(t,i,r){this.makeEmpty(),Vi.copy(r,this.matrix),this.expandBySize(t,i,r)}expandBySize(t,i,r){[Vi.apply([0,0],r),Vi.apply([0,i],r),Vi.apply([t,i],r),Vi.apply([t,0],r)].forEach(n=>this.expandByPoint(n))}getCenter(){let[t,i]=this.min,[r,n]=this.getHalfSize();return Vi.apply([t+r,i+n],this.matrix)}getSize(){return[this.max[0]-this.min[0],this.max[1]-this.min[1]]}getHalfSize(){return[(this.max[0]-this.min[0])*.5,(this.max[1]-this.min[1])*.5]}makeEmpty(){this.min=[1/0,1/0],this.max=[-1/0,-1/0]}setFromPoints(t){this.makeEmpty();for(let i of t)this.expandByPoint(i)}expandByPoint(t){this.min=[Math.min(this.min[0],t[0]),Math.min(this.min[1],t[1])],this.max=[Math.max(this.max[0],t[0]),Math.max(this.max[1],t[1])]}computeVertices(){let[t,i]=this.getHalfSize(),r=this.getCenter(),[n,a,s,o]=Vi.getAbcdef(this.matrix),l=Vi.create(n,a,s,o,r[0],r[1]);this.vertices=aq.map(([c,h])=>Vi.apply([c*t,h*i],l))}computeEdges(){this.edges=[];for(let t=0,i=this.vertices.length;t<i;++t)this.edges.push([this.vertices[t],this.vertices[(t+1)%i]])}project(t,i){let r=this.matrix;return i&&(r=Vi.append(i.worldMatrix,r)),Vi.applyInverse(t,r)}intersects(t,i,r){return this.intersectsInLocalSpace(...this.project([t,i],r))}intersectsInLocalSpace(t,i){let{min:r,max:n}=this;return t>=r[0]&&t<=n[0]&&i>=r[1]&&i<=n[1]}containsPoint(t){let[i,r]=t,[n,a]=this.min,[s,o]=this.max;return i>=n&&i<=s&&r>=a&&r<=o}intersectsBBox2D(t){for(let i=0,r=this.edges.length;i<r;i++){let n=this.edges[i];for(let a=0,s=t.edges.length;a<s;a++){let o=t.edges[a];if(QOe(n,o))return!0}}for(let i=0,r=t.vertices.length;i<r;i++){let n=t.vertices[i];if(this.containsPoint(n))return!0}return!1}ensureMinMax(){let t=this.min,i=this.max;this.min=[Math.min(t[0],i[0]),Math.min(t[1],i[1])],this.max=[Math.max(t[0],i[0]),Math.max(t[1],i[1])]}copy(t){this.min=[...t.min],this.max=[...t.max],Vi.copy(t.matrix,this.matrix),this.computeVertices(),this.computeEdges()}clone(){let t=new kL;return t.copy(this),t}},sq,VOe=new Promise(t=>{sq=t}),cV=!1,jb;function WOe(){if(cV)return;if(jb)return jb;async function t(){let i=await VA(()=>import("./ui-dad2f740.js"),[],import.meta.url);sq(i.default??i),cV=!0}return jb=t(),jb}function hV(t){let i=!1;return t.scene.objects.traverse((r,n)=>{(n.type==="Mesh"&&n.geometry.type==="UIGeometry"||n.type==="Page"&&n.uiFrame!==void 0)&&(i=!0)}),i}var ci,$I;async function jOe(t){let i=await VOe;ci||($I||($I=i({locateFile:()=>t})),ci=await $I)}var uV=Vi.identity(),oq=class{constructor(t,i=1){this.canvas=t,this._dpr=i,this._width=0,this._height=0,this._strokeMode="inside",this._layerBlur=0,this._backgroundBlur=0,this._dropShadowBlur=0,this._dropShadowOffsetX=0,this._dropShadowOffsetY=0,this._dropShadowColor=Ar.transparent,this._innerShadowBlur=0,this._innerShadowOffsetX=0,this._innerShadowOffsetY=0,this._innerShadowSpread=0,this._innerShadowColor=Ar.transparent,this._fonts=new Map,this._isSizeDirty=!1;try{let r=t.getBoundingClientRect();t.width=r.width*i,t.height=r.height*i}catch{console.log(t.width,i)}this._currentM3Transform=uV,this._currentTransform=new Float32Array(uV)}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this._isSizeDirty=!0}
10900async init(){var t,i;if(!this.wasmURL)throw Error("Your must set the wasm binary url with renderer.wasmURL = ... before you can call renderer.init");await jOe(this.wasmURL),this._surface=ci.MakeWebGLCanvasSurface(this.canvas),this.ctx=(t=this._surface)==null?void 0:t.getCanvas(),this._paint=new ci.Paint,this._paint.setAntiAlias(!0),this._paintFill=this._paint.copy(),this._paintFill.setStyle(ci.PaintStyle.Fill),this._paintStroke=this._paint.copy(),this._paintStroke.setStyle(ci.PaintStyle.Stroke),(i=this.ctx)==null||i.scale(this.dpr,this.dpr)}get currentTransform(){return this._currentM3Transform}get currentTransformBuffer(){return this._currentTransform}set currentTransform(t){this._currentM3Transform=t,this._currentTransform.set(t)}async loadFont(t,i){let r=await(await fetch(t)).arrayBuffer();this.registerFont(r,i)}registerFont(t,i){if(this._fonts.has(i))return;let r=ci.FontMgr.FromData(t);if(r)this._fonts.set(i,r);else throw new Error("Invalid font data for "+i)}get width(){return this._width}get height(){return this._height}set strokeColor(t){this._paintStroke&&this._paintStroke.setColor(Yb(t),ci.ColorSpace.DISPLAY_P3)}set fillColor(t){this._paintFill&&this._paintFill.setColor(Yb(t),ci.ColorSpace.DISPLAY_P3)}set lineWidth(t){this._paintStroke&&this._paintStroke.setStrokeWidth(this._strokeMode==="center"?t:t*2)}set strokeMode(t){this._strokeMode=t}set dropShadowBlur(t){this._dropShadowBlur=t}set dropShadowColor(t){this._dropShadowColor=t}set dropShadowOffsetX(t){this._dropShadowOffsetX=t}set dropShadowOffsetY(t){this._dropShadowOffsetY=t}set innerShadowBlur(t){this._innerShadowBlur=t}set innerShadowColor(t){this._innerShadowColor=t}set innerShadowOffsetX(t){this._innerShadowOffsetX=t}set innerShadowOffsetY(t){this._innerShadowOffsetY=t}set innerShadowSpread(t){this._innerShadowSpread=t}set layerBlur(t){this._layerBlur=t}set backgroundBlur(t){this._backgroundBlur=t}clear(){var t;(t=this.ctx)==null||t.clear(ci.TRANSPARENT)}save(){var t;(t=this.ctx)==null||t.save()}restore(){var t;(t=this.ctx)==null||t.restore()}beginPath(){var t;(t=this._currentPath)==null||t.delete(),this._currentPath=new ci.Path}closePath(){let t=this._currentPath;if(t){if(t.isEmpty())return;let i=t.getBounds();(i[3]-i[1]||i[2]-i[0])&&t.close()}}fill(){this._paintInner(this._paintFill,!0)}stroke(){this._paintInner(this._paintStroke,!1)}clipRect(t,i,r,n,a=0,s=0,o=0,l=0){var h,u;let c=ci.XYWHRect(t,i,r,n);if(a===0&&s===0&&l===0&&o===0)(h=this.ctx)==null||h.clipRect(c,ci.ClipOp.Intersect,!0);else{let d=ci.RRectXY(c,a,a);d[4]=d[5]=a,d[6]=d[7]=s,d[8]=d[9]=o,d[10]=d[11]=l,(u=this.ctx)==null||u.clipRRect(d,ci.ClipOp.Intersect,!0)}}_applyShadowOffsetMatrix(){if(this.ctx){let t=Vi.invert(this.currentTransform);this.ctx.concat(t);let i=Vi.translate(Vi.identity(),this._dropShadowOffsetX,this._dropShadowOffsetY);this.ctx.concat(i),this.ctx.concat(this._currentTransform)}}_applyEffectsToPaint(t,i,r=!0){var n,a,s,o;if(this.ctx&&this._currentPath){let l,c=!1;if(r&&this._hasDropShadow()){let h=t.copy();h.setColor(Yb(this._dropShadowColor));let u;this._dropShadowBlur>0&&(u=ci.MaskFilter.MakeBlur(ci.BlurStyle.Normal,this._dropShadowBlur*this.dpr*(((n=this.camera)==null?void 0:n.scale)??1),!1),h.setMaskFilter(u)),this.ctx.save(),this.ctx.clipPath(this._currentPath,ci.ClipOp.Difference,!0),this._applyShadowOffsetMatrix(),i(h),this.ctx.restore(),h.delete(),u==null||u.delete()}if(this._backgroundBlur>0&&r){this.ctx.save(),this.ctx.clipPath(this._currentPath,ci.ClipOp.Intersect,!0);let h=ci.ImageFilter.MakeBlur(this._backgroundBlur,this._backgroundBlur,ci.TileMode.Clamp,null),u=t.copy();u.setImageFilter(h),u.setAlphaf(1);let d=this._currentPath.computeTightBounds();this.ctx.saveLayer(u,d,null,ci.SaveLayerInitWithPrevious),this.ctx.drawColor(t.getColor()),this.ctx.restore(),this.ctx.restore(),u.delete(),h.delete(),c=!0}if(this._layerBlur>0){let h=t.copy();l=ci.MaskFilter.MakeBlur(ci.BlurStyle.Normal,this._layerBlur*this.dpr*(((a=this.camera)==null?void 0:a.scale)??1),!1),h.setMaskFilter(l),i(h),h.delete(),l.delete(),c=!0}if(c||i(t),r&&this._hasInnerShadow()){let h=new ci.Paint;h.setAntiAlias(!0),h.setStyle(ci.PaintStyle.Fill),h.setColor(Yb(this._innerShadowColor));let u;this._innerShadowBlur>0&&(u=ci.MaskFilter.MakeBlur(ci.BlurStyle.Normal,this._innerShadowBlur*this.dpr*(((s=this.camera)==null?void 0:s.scale)??1),!1),h.setMaskFilter(u));let d=this._currentPath.computeTightBounds(),[A,f,m,g]=d,p=m-A,v=g-f;this.ctx.save(),this.ctx.clipPath(this._currentPath,ci.ClipOp.Intersect,!0),this.ctx.saveLayer(h,d,null,ci.SaveLayerInitWithPrevious),(o=this.ctx)==null||o.translate(this._innerShadowOffsetX,this._innerShadowOffsetY),this.ctx.drawRect(ci.XYWHRect(-1e3-this._innerShadowOffsetX,-1e3-this._innerShadowOffsetY,2e3+p+Math.abs(this._innerShadowOffsetX*2),2e3+v+Math.abs(this._innerShadowOffsetY*2)),h),h.setBlendMode(ci.BlendMode.Clear),this.ctx.drawPath(this._currentPath,h),this.ctx.restore(
10900),this.ctx.restore(),h.delete(),u==null||u.delete()}}}_paintInner(t,i=!0){if(this.ctx&&this._currentPath&&t){let r=this.ctx,n=this._currentPath;this._applyEffectsToPaint(t,a=>{let s=!1;!i&&this._strokeMode!=="center"&&(r.save(),r.clipPath(n,this._strokeMode==="outside"?ci.ClipOp.Difference:ci.ClipOp.Intersect,!0),s=!0),r.drawPath(n,a),s&&r.restore()},i)}}_hasDropShadow(){var t;return((t=this._dropShadowColor)==null?void 0:t.a)>0}_hasInnerShadow(){var t;return((t=this._innerShadowColor)==null?void 0:t.a)>0}path(t){var i;(i=this._currentPath)==null||i.addPath(ci.Path.MakeFromSVGString(t))}ellipse(t,i,r,n,a,s,o,l){var h;if(!dV([t,i,r,n])||!this._currentPath)return;if(r<0||n<0)throw Error("radii cannot be negative");let c=ci.XYWHRect(t-r,i-n,r*2,n*2);(h=this._currentPath)==null||h.addOval(c)}rect(t,i,r,n,a=0,s=0,o=0,l=0){var h,u;let c=ci.XYWHRect(t,i,r,n);if(dV(c))if(a===0&&s===0&&l===0&&o===0)(h=this._currentPath)==null||h.addRect(c);else{let d=ci.RRectXY(c,a,a);d[4]=d[5]=a,d[6]=d[7]=s,d[8]=d[9]=o,d[10]=d[11]=l,(u=this._currentPath)==null||u.addRRect(d)}}getHorizontalAlign(t){switch(t){case 2:return ci.TextAlign.Right;case 3:return ci.TextAlign.Center;case 4:return ci.TextAlign.Justify;case 1:default:return ci.TextAlign.Left}}drawTextInner(t,i,r,[n,a,s,o],l,c,h=!0){let u=0,{ctx:d}=this;if(!d)return u;let A=c.copy(),f=c.copy();return f.setAlphaf(0),this._applyEffectsToPaint(A,m=>{i.pushPaintStyle(r,m,f),i.addText(t);let g=i.build();g.layout(s);let p=a;l===2?p+=(o-g.getHeight())/2:l===3&&(p+=o-g.getHeight()),d.drawParagraph(g,n,p),u=g.getHeight(),i.reset(),g.delete()},h),A.delete(),f.delete(),u}drawText(t,i){let r=0,n=this._fonts.get(i.font),{ctx:a,_paintFill:s,_paintStroke:o}=this;if(n&&a){let l=new ci.TextStyle({fontFamilies:[i.font],fontSize:i.fontSize,heightMultiplier:i.lineHeight,letterSpacing:i.letterSpacing}),c=new ci.ParagraphStyle({textStyle:l,textAlign:this.getHorizontalAlign(i.horizontalAlign)}),h=ci.XYWHRect(i.x,i.y,i.width,i.height),u=ci.ParagraphBuilder.Make(c,n);s&&(r=this.drawTextInner(t,u,l,h,i.verticalAlign,s,!0)),o&&(r=this.drawTextInner(t,u,l,h,i.verticalAlign,o,!1)),u.delete()}return{height:r}}render(){var t;(t=this._surface)==null||t.flush()}moveTo(t,i){var r;(r=this._currentPath)==null||r.moveTo(t,i)}lineTo(t,i){var r;(r=this._currentPath)==null||r.lineTo(t,i)}bezierCurveTo(t,i,r,n,a,s){var o;(o=this._currentPath)==null||o.cubicTo(t,i,r,n,a,s)}quadraticCurveTo(t,i,r,n){var a;(a=this._currentPath)==null||a.quadTo(t,i,r,n)}setTransform(t,i=!1){var a,s,o,l,c;if(!this.ctx)return;let r=this.ctx.getTotalMatrix(),n=Vi.invert(r);if(n&&this.ctx.concat(n),(a=this.ctx)==null||a.scale(this.dpr,this.dpr),((s=this.camera)==null?void 0:s.enabled)&&((o=this.ctx)==null||o.concat(this.camera.worldMatrix),i)){let h=Vi.getScale(this.camera.worldMatrix);(l=this.ctx)==null||l.scale(1/h[0],1/h[1])}(c=this.ctx)==null||c.concat(t),this.currentTransform=t}transform(t){var i;(i=this.ctx)==null||i.concat(t)}setSize(t,i){var r;!this._isSizeDirty&&t===this._width&&i===this._height||(this._isSizeDirty=!1,this._width=t,this._height=i,this.canvas.style.width=t+"px",this.canvas.style.height=i+"px",this.canvas.width=t*this.dpr,this.canvas.height=i*this.dpr,this._surface&&(this._surface=ci.MakeWebGLCanvasSurface(this.canvas),this.ctx=(r=this._surface)==null?void 0:r.getCanvas()))}};function dV(t){for(let i=0;i<t.length;i++)if(t[i]!==void 0&&!Number.isFinite(t[i]))return!1;return!0}function Yb({r:t,g:i,b:r,a:n}){return ci.Color4f(t,i,r,n)}var AV=class{constructor(t,i,r){this.uuid=t,this.data=i,this.enabled=!1,this.color=Ar.transparent,this.blurRadius=0,this.offset=[0,0],this.spread=0,this.update(i)}update(t){t.color!==void 0&&(this.color=t.color),t.enabled!==void 0&&(this.enabled=t.enabled),t.blurRadius!==void 0&&(this.blurRadius=t.blurRadius),t.offset!==void 0&&(this.offset=t.offset),t.spread!==void 0&&(this.spread=t.spread)}},fV=class{constructor(t,i,r){this.uuid=t,this.data=i,this.enabled=!1,this.radius=0,this.update(i)}update(t){t.enabled!==void 0&&(this.enabled=t.enabled),t.radius!==void 0&&(this.radius=t.radius)}},YOe=class{constructor(t,i,r){this.uuid=t,this.data=i,this.enabled=!1,this.color=Ar.transparent,this.update(i)}update(t){t.enabled!==void 0&&(this.enabled=t.enabled),t.color!==void 0&&(this.color=t.color)}},KOe=class{constructor(t,i,r){this.uuid=t,this.data=i,this.enabled=!1,this.color=Ar.transparent,this.thickness=0,this.mode="inside",this.update(i)}update(t){t.enabled!==void 0&&(this.enabled=t.enabled),t.color!==void 0&&(this.color=t.color),t.thickness!==void 0&&(this.thickness=t.thickness),t.mode!==void 0&&(this.mode=t.mode)}},ga=class extends Ca{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this.autoClose=!0,this.fill=new YOe(t+"-fill",i.fill,r),this.stroke=new KOe(t+"-stroke",i.stroke,r),this.dropShadow=new AV(t+"-dropShadow",i.dropShadow,r),this.innerShadow=new AV(t+"-innerShadow",i.innerShadow,r),this.backgroundBlur=new fV(t+"-backgroundBlur",i.backgroundBlur,r),this.layerBlur=new fV(t+"-layerBlur",i.layerBlur,r)}
vendor: 11,468 bytes, line 10900
10900applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:Ar.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:Ar.transparent,t.strokeMode=this.stroke.mode,t.lineWidth=this.stroke.thickness}applyFilters(t){this.layerBlur.enabled?t.layerBlur=this.layerBlur.radius*5:t.layerBlur=0,this.backgroundBlur.enabled?t.backgroundBlur=this.backgroundBlur.radius*5:t.backgroundBlur=0,this.dropShadow.enabled?(t.dropShadowBlur=this.dropShadow.blurRadius*5,t.dropShadowColor=this.dropShadow.color,t.dropShadowOffsetX=this.dropShadow.offset[0],t.dropShadowOffsetY=this.dropShadow.offset[1]):t.dropShadowColor=Ar.transparent,this.innerShadow.enabled?(t.innerShadowSpread=this.innerShadow.spread,t.innerShadowBlur=this.innerShadow.blurRadius*5,t.innerShadowColor=this.innerShadow.color,t.innerShadowOffsetX=this.innerShadow.offset[0],t.innerShadowOffsetY=this.innerShadow.offset[1]):t.innerShadowColor=Ar.transparent}innerDraw(t){}draw(t){!this.visible||(t.save(),this.applyTransforms(t),this.applyFilters(t),this.applyFillStroke(t),t.beginPath(),this.innerDraw(t),this.autoClose&&t.closePath(),this.fill.enabled&&t.fill(),this.stroke.enabled&&t.stroke(),t.restore())}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),t.type===0&&(Er(t.path,["fill"])?this.fill.update(t.props):Er(t.path,["stroke"])?this.stroke.update(t.props):Er(t.path,["dropShadow"])?this.dropShadow.update(t.props):Er(t.path,["innerShadow"])?this.innerShadow.update(t.props):Er(t.path,["layerBlur"])?this.layerBlur.update(t.props):Er(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}updateState(t,i){super.updateState(t,i),t.fill!==void 0&&this.fill.update(t.fill),t.stroke!==void 0&&this.stroke.update(t.stroke),t.dropShadow!==void 0&&this.dropShadow.update(t.dropShadow),t.innerShadow!==void 0&&this.innerShadow.update(t.innerShadow),t.layerBlur!==void 0&&this.layerBlur.update(t.layerBlur),t.backgroundBlur!==void 0&&this.backgroundBlur.update(t.backgroundBlur)}clone(t){let i=new ga(this.uuid,this.data,t);return i.parent=void 0,i}},gU=class extends ga{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this.width=0,this.height=0,this.updateState(i,r)}innerDraw(t){t.ellipse(this.width*.5,this.height*.5,this.width*.5,this.height*.5,0,0,Math.PI*2)}intersectsInLocalSpace(t,i){return GOe(t,i,this.width*.5,this.height*.5,this.width*.5,this.height*.5)}getCenter(){return[this.width*.5,this.height*.5]}getHalfSize(){return[this.width*.5,this.height*.5]}updateSizeState(t){let i=!1;t.width!==void 0&&(this.width=typeof t.width=="number"?t.width:this.width,i=!0),t.height!==void 0&&(this.height=typeof t.height=="number"?t.height:this.height,i=!0),i&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,i){super.updateState(t,i),this.updateSizeState(t)}clone(t){let i=new gU(this.uuid,this.data,t);return i.parent=void 0,i}},NE=class extends ga{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this.width=0,this.height=0,this.cornerRadius=[0,0,0,0],this.updateState(i,r)}innerDraw(t){t.rect(0,0,this.width,this.height,...this.cornerRadius)}getCenter(){return[this.width*.5,this.height*.5]}getHalfSize(){return[this.width*.5,this.height*.5]}updateCornerState(t){t.cornerRadius!==void 0&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let i=!1;t.width!==void 0&&(this.width=typeof t.width=="number"?t.width:this.width,i=!0),t.height!==void 0&&(this.height=typeof t.height=="number"?t.height:this.height,i=!0),i&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,i){super.updateState(t,i),this.updateSizeState(t),this.updateCornerState(t)}clone(t){let i=new NE(this.uuid,this.data,t);return i.parent=void 0,i}},vU=class extends ga{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this._textHeight=0,this._textHeightDirty=!0,this.width=0,this.height=0,this.updateState(i,r)}get textHeight(){return this._textHeight}applyFillStroke(t){t.fillColor=this.fill.enabled?this.fill.color:Ar.transparent,t.strokeColor=this.stroke.enabled&&this.stroke.thickness>0?this.stroke.color:Ar.transparent,t.strokeMode="center",t.lineWidth=this.stroke.thickness}innerDraw(t){var s;(s=this._fontHolder)!=null&&s.arrayBuffer&&this._fontHolder.arrayBuffer.byteLength>1&&this.data.font&&t.registerFont(this._fontHolder.arrayBuffer,this.data.font);let i=this.data.textTransform,r=this.data.text.textValue.toString(),n=i===2?r.toUpperCase():i===3?r.toLowerCase():r,{height:a}=t.drawText(n,{x:0,y:0,width:this.width,height:this.height,fontSize:this.data.fontSize,lineHeight:this.data.lineHeight??1,letterSpacing:this.data.letterSpacing??0,horizontalAlign:this.data.horizontalAlign,verticalAlign:this.data.verticalAlign,font:this.data.font});this._textHeight=a}getCenter(){return[this.width*.5,this.height*.5]}getHalfSize(){return[this.width*.5,this.height*.5]}updateSizeState(t){let i=!1;t.width!==void 0&&(this.width=typeof t.width=="number"?t.width:this.width,i=!0),t.height!==void 0&&(this.height=typeof t.height=="number"?t.height:this.height,i=!0),i&&this.updateWorldMatrix(!0,!1,!0)}updateFontState(t,{shared:i}){t.font!==void 0&&(this._fontHolder=i.getFont(t.font),this._fontHolder&&!this._fontHolder.isLoaded&&this._fontHolder.loadingPromise.then(()=>{this.requestRender()}))}updateState(t,i){super.updateState(t,i),this.updateSizeState(t),this.updateFontState(t,i)}clone(t){let i=new vU(this.uuid,this.data,t);return i.parent=void 0,i}},lq=class extends ga{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this.curves=[],this.extremasBBox={min:[0,0],max:[0,0]},this.updateState(i,r)}computeExtremas(){this.curves.length===0&&this.computeCurves();let t=this.curves.map(n=>gT.extremas(n)),i=[1/0,1/0],r=[-1/0,-1/0];for(let n=0,a=t.length;n<a;n++){let s=t[n];s[0][0]<i[0]&&(i[0]=s[0][0]),s[0][1]<i[1]&&(i[1]=s[0][1]),s[1][0]>r[0]&&(r[0]=s[1][0]),s[1][1]>r[1]&&(r[1]=s[1][1])}return this.extremasBBox.min=[i[0],i[1]],this.extremasBBox.max=[r[0],r[1]],this.extremasBBox}computeCurves(){this.curves=[];for(let r=1,n=this.data.points.length;r<n;r++){let a=this.data.points[r].data,s=this.data.points[r-1].data,o={start:s.position,cp1:s.controlNext.position,cp2:a.controlPrevious.position,end:a.position};this.curves.push(o)}let t=this.data.points[0].data,i=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let r={start:i.position,cp1:i.controlNext.position,cp2:t.controlPrevious.position,end:t.position};this.curves.push(r)}}getCenter(){let[t,i]=this.extremasBBox.min,[r,n]=this.getHalfSize();return[t+r,i+n]}getHalfSize(){let{min:t,max:i}=this.extremasBBox;return[(i[0]-t[0])*.5,(i[1]-t[1])*.5]}innerDraw(t){for(let n=0,a=this.data.points.length;n<a;n++){let s=this.data.points[n].data;if(n===0){let[o,l]=s.position;t.moveTo(o,l)}else{let o=this.data.points[n-1].data,[l,c]=o.controlNext.position,[h,u]=s.controlPrevious.position,[d,A]=s.position,f={start:o.position,cp1:o.controlNext.position,cp2:s.controlPrevious.position,end:s.position};gT.derive(f),t.bezierCurveTo(l,c,h,u,d,A)}}let i=this.data.points[0].data,r=this.data.points[this.data.points.length-1].data;if(this.data.isClosed){let[n,a]=r.controlNext.position,[s,o]=i.controlPrevious.position,[l,c]=i.position;t.bezierCurveTo(n,a,s,o,l,c)}}updateState(t,i){super.updateState(t,i),this.computeExtremas()}clone(t){let i=new lq(this.uuid,this.data,t);return i.parent=void 0,i}},gT;(t=>{function i(o){let l=o.start,c=o.cp1,h=o.cp2,u=o.end,d=[3*(c[0]-l[0]),3*(c[1]-l[1])],A=[3*(h[0]-c[0]),3*(h[1]-c[1])],f=[3*(u[0]-h[0]),3*(u[1]-h[1])],m={start:d,cp:A,end:f};return o.derivative=m,m.derivative=HL.derive(m),m}t.derive=i;function r(o,l,c,h=!1){let u=o-2*l+c;if(u!==0){let d=-Math.sqrt(Math.abs(l*l-o*c)),A=-o+l,f=-(d+A)/u,m=-(-d+A)/u;return[f,m]}else if(l!==c&&u===0)return[(2*l-c)/(2*(l-c))];return[]}function n(o){let l=o.derivative??t.derive(o),c=l.start,h=l.cp,u=l.end;return[r(c[0],h[0],u[0]),r(c[1],h[1],u[1])]}t.droot=n;function a(o){let[l,c]=t.droot(o),h=[o.start[0],o.end[0]],u=[o.start[1],o.end[1]];for(let d of l)h.push(t.compute(o,Math.min(1,Math.max(0,d)))[0]);for(let d of c)u.push(t.compute(o,Math.min(1,Math.max(0,d)))[1]);return h.sort((d,A)=>d-A),u.sort((d,A)=>d-A),[[h[0],u[0]],[h[h.length-1],u[u.length-1]]]}t.extremas=a;function s(o,l){if(l===0)return[...o.start];if(l===1)return[...o.end];let c=1-l,h=c*c,u=l*l,d=h*c,A=h*l*3,f=c*u*3,m=l*u;return[d*o.start[0]+A*o.cp1[0]+f*o.cp2[0]+m*o.end[0],d*o.start[1]+A*o.cp1[1]+f*o.cp2[1]+m*o.end[1]]}t.compute=s})(gT||(gT={}));var HL;(t=>{function i(a){let s=a.start,o=a.cp,l=a.end,c=[2*(o[0]-s[0]),2*(o[1]-s[1])],h=[2*(l[0]-o[0]),2*(l[1]-o[1])],u={start:c,end:h};return u.derivative=GL.derive(u),a.derivative=u,u}t.derive=i;function r(a){let s=a.derivative??t.derive(a),o=s.start,l=s.end;return[o[0]!==l[0]?o[0]/(o[0]-l[0]):0,o[1]!==l[1]?o[1]/(o[1]-l[1]):0]}t.droot=r;function n(a,s){if(s===0)return[...a.start];if(s===1)return[...a.end];let o=1-s,l=o*o,c=s*s,h=l,u=o*s*2,d=c;return[h*a.start[0]+u*a.cp[0]+d*a.end[0],h*a.start[1]+u*a.cp[1]+d*a.end[1]]}t.compute=n})(HL||(HL={}));var GL;(t=>{function i(n){let a=n.start,s=n.end,o=[s[0]-a[0],s[1]-a[1]];return n.derivative=o,n.derivative}t.derive=i;function r(n,a){if(a===0)return[...n.start];if(a===1)return[...n.end];let s=n.start,o=n.end;return[s[0]+(o[0]-s[0])*a,s[1]+(o[1]-s[1])*a]}t.compute=r})(GL||(GL={}));var uh=class extends ec{constructor(t,i,r){super(t,i,r),this.uuid=t,this.width=0,this.height=0,this.clipped=!0,this.background=new NE(t+"-background",Gy.defaultData,r),this.background.parent=this,this.updateState(i,r)}get fill(){return this.background.fill}get stroke(){return this.background.stroke}get backgroundBlur(){return this.background.backgroundBlur}get layerBlur(){return this.background.layerBlur}get dropShadow(){return this.background.dropShadow}get innerShadow(){return this.background.innerShadow}get cornerRadius(){return this.background.cornerRadius}set cornerRadius(t){this.background.cornerRadius=t}updateLocalMatrix(){var t;super.updateLocalMatrix(),(t=this.background)==null||t.updateLocalMatrix()}updateWorldMatrix(t,i,r){var n;super.updateWorldMatrix(t,i,r),(n=this.background)==null||n.updateWorldMatrix(t,i,r)}draw(t){if(!this.visible)return;t.save();let i=this.width,r=this.height;this.applyTransforms(t),this.background.width=i,this.background.height=r,this.background.draw(t),this.clipped&&t.clipRect(0,0,i,r,...this.cornerRadius),this.innerDrawChildren(t),t.restore()}getCenter(){return[this.width*.5,this.height*.5]}getHalfSize(){return[this.width*.5,this.height*.5]}updateCornerState(t){t.cornerRadius!==void 0&&(this.cornerRadius=t.cornerRadius)}updateSizeState(t){let i=!1;t.width!==void 0&&(this.width=typeof t.width=="number"?t.width:this.width,i=!0),t.height!==void 0&&(this.height=typeof t.height=="number"?t.height:this.height,i=!0),i&&this.updateWorldMatrix(!0,!1,!0)}updateState(t,i){super.updateState(t,i),this.updateSizeState(t),this.updateCornerState(t),t.fill!==void 0&&this.fill.update(t.fill),t.stroke!==void 0&&this.stroke.update(t.stroke),t.dropShadow!==void 0&&this.dropShadow.update(t.dropShadow),t.innerShadow!==void 0&&this.innerShadow.update(t.innerShadow),t.layerBlur!==void 0&&this.layerBlur.update(t.layerBlur),t.backgroundBlur!==void 0&&this.backgroundBlur.update(t.backgroundBlur),t.clipped!==void 0&&(this.clipped=t.clipped)}requestRender(){super.requestRender(),this.dispatchEvent({type:"render"})}dispose(){this.removeEventListener("render")}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),t.type===0&&(Er(t.path,["fill"])?this.fill.update(t.props):Er
10900(t.path,["stroke"])?this.stroke.update(t.props):Er(t.path,["dropShadow"])?this.dropShadow.update(t.props):Er(t.path,["innerShadow"])?this.innerShadow.update(t.props):Er(t.path,["layerBlur"])?this.layerBlur.update(t.props):Er(t.path,["backgroundBlur"])?this.backgroundBlur.update(t.props):this.resetBBoxNeedsUpdate())}clone(t){let i=new uh(this.uuid,this.data,t);i.parent=void 0;for(let r of this.children)i.add(r.clone(t));return i}},XOe=$u(A7(),1),xM=class extends ga{constructor(t,i,r){super(t,i,r),this.uuid=t,this.data=i,this._pathBBox=new DOMRect,this.path="",this.updateState(i,r),this.autoClose=!1,this.computeSVGBBox()}computeSVGBBox(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg"),i=document.createElementNS("http://www.w3.org/2000/svg","path");document.body.appendChild(t),i.setAttribute("d",this.path),t.appendChild(i),this._pathBBox=i.getBBox(),t.remove()}innerDraw(t){t.path(this.path)}intersectsInLocalSpace(t,i){return t>=this._pathBBox.x&&t<=this._pathBBox.x+this._pathBBox.width&&i>=this._pathBBox.y&&i<=this._pathBBox.y+this._pathBBox.height}getCenter(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}getHalfSize(){return[(this._pathBBox.x+this._pathBBox.width)/2,(this._pathBBox.y+this._pathBBox.height)/2]}updateState(t,i){super.updateState(t,i),t.path!==void 0&&(this.path=t.path,this.computeSVGBBox())}clone(t){let i=new xM(this.uuid,this.data,t);return i.parent=void 0,i}};function qOe(t,i=1,r=1){if(i<=0||r<=0)return t;let n=(0,XOe.parseSVG)(t).map(a=>{let s={...a};return"x"in s&&(s.x=s.x*i),"y"in s&&(s.y=s.y*r),"x1"in s&&(s.x1=s.x1*i),"x2"in s&&(s.x2=s.x2*i),"y1"in s&&(s.y1=s.y1*r),"y2"in s&&(s.y2=s.y2*r),"rx"in s&&(s.rx=s.rx*i),"ry"in s&&(s.ry=s.ry*r),s});return ZOe(n)}function ZOe(t){let i=["rx","ry","xAxisRotation","largeArc","sweep","x1","y1","x2","y2","x","y"],r;return t.map(n=>{let a=[];i.forEach(o=>{if(o in n){let l=n[o]*1;a.length&&l>=0&&a.push(","),a.push(l)}});let s=(r===n.code?a[0]<0?"":",":n.code)+a.join("");return r=n.code,s}).join("")}function JOe(t,i,r){switch(i.type){case"ellipse2d":return new gU(t,i,r);case"rectangle2d":return new NE(t,i,r);case"text2d":return new vU(t,i,r);case"vector2d":return new lq(t,i,r);case"path2d":return new xM(t,i,r);case"frame2d":return new uh(t,i,r);case"group2d":default:return new OA(t,i,r)}}var cq=class{constructor(t,i,r){this.uuid=t,this.data=i,this.group=new OA(cq.GROUP_ID,{...cT.defaultData},r),this.createChildrenObjects(i.objects,this.group,r)}createObject(t,i,r,n,a,s){let o=JOe(t,i,s);o&&(n.add(o),n.children.splice(a,0,n.children.pop()),o.updateWorldMatrix(),r.length>0&&(o instanceof OA||o instanceof uh)&&this.createChildrenObjects(r,o,s))}createChildrenObjects(t,i,r){let n=0;for(let a of t)this.createObject(a.id,a.data,a.children,i,n,r),n+=1}draw(t){this.group.draw(t)}updateEntityByOp(t,i,r,n){let a=this.find(t);if(a)try{a.updateByOp(i,r,{shared:n})}catch(s){console.error(s)}}updateTreeByOp(t,i){if(t.path.length===0&&t.type===7){let r=t.parent===null?this.group:this.find(t.parent);r!==void 0&&r instanceof ec&&(this.createObject(t.id,t.data,t.children,r,t.localIndex,i),r.requestRender())}else if(t.path.length===0&&t.type===8){let r=this.find(t.id);if(r!==void 0&&r.parent!==void 0&&r.parent instanceof ec){let n=r.parent;r.resetBBoxNeedsUpdate(),n==null||n.remove(r),n==null||n.requestRender()}}else if(t.path.length===0&&t.type===9){let r=this.find(t.id);if(r!==void 0){let n=r.parent,a=t.parent===null?this:this.find(t.parent);if(a instanceof ec||a===this){a.add(r);let s=t.localIndex;a.children.splice(s,0,a.children.pop()),r.updateWorldMatrix(!0,!1,!0),n==null||n.requestRender(),r.requestRender()}r.resetBBoxNeedsUpdate()}}}add(t){this.group.add(t)}remove(t){this.group.remove(t)}traverse(t){this.group.traverse(i=>{i!==this.group&&t(i)})}intersectsChildren(t,i,r,n=!1,a=[]){return this.group.intersectsChildren(t,i,r,n,a,!0)}intersectsChildrenReverse(t,i,r,n=!1,a=[]){return this.group.intersectsChildrenReverse(t,i,r,n,a,!0)}find(t){return this.group.find(t)}get children(){return this.group.children}project(t,i){return this.group.project(t,i)}getWithSortKey(t){let i=this.find(t);if(i===void 0)return;let r=[],n=i;for(;n!==this.group;){let a=n;n=n.parent;let s=n.children.indexOf(a);r.splice(0,0,s)}return{entity:i,sortKey:r}}getAllSorted(t){let i=[];for(let r of t){let n=this.getWithSortKey(r.id);n!==void 0&&i.push(n)}return i.sort((r,n)=>WY(r.sortKey,n.sortKey)),i.map(r=>r.entity)}},_U=cq;_U.GROUP_ID="scene2d";function hq({constraints:t,newParentWidth:i,newParentHeight:r,initialParentWidth:n,initialParentHeight:a,objectInitialWidth:s,objectInitialHeight:o,objectInitialPosition:l}){let{horizontalConstraint:c,verticalConstraint:h}=t,u=i-n,d=r-a,A=s,f=o,m=l[0],g=l[1];if(c!==0){if(c===1)m+=u;else if(c===3)m+=u/2;else if(c===2)A=Math.max(1,A+u);else if(c===4){let p=i/n;A*=p,m*=p}}if(h!==0){if(h===1)g+=d;else if(h===3)g+=d/2;else if(h===2)f=Math.max(1,f+d);else if(h===4){let p=r/a;f*=p,g*=p}}return{width:A,height:f,position:[m,g]}}$u(A7(),1);var $Oe=` 10901 varying vec2 vUv; 10902 void main() { 10903 vUv = uv; 10904 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); 10905 }`,eNe=` 10906 uniform sampler2D tDiffuse; 10907 varying vec2 vUv; 10908 void main() { 10909 vec4 texel = texture2D( tDiffuse, vUv ); 10910 gl_FragColor = texel; 10911 }`,tNe=new oM(-1,1,1,-1,0,1),iNe=class extends Lt{constructor(){super(),this.setAttribute("position",new Et([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new Et([0,2,0,0,2,0],2))}},rNe=new iNe,nNe=class{constructor(t){this._mesh=new Zr(rNe,t)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,tNe)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}},uq=new Xi({defines:{},uniforms:{tDiffuse:new at(null)},vertexShader:$Oe,fragmentShader:eNe}),aNe=new nNe(uq),e2=null,t2=null,sNe=()=>
10911(e2===null&&(e2=document.createElement("canvas")),e2),oNe=t=>(t2===null&&(t2=new oq(t)),t2),lNe=Vi.identity(),dq=class{constructor(t,i,r,n){this.uuid=t,this.width=i,this.height=r,this.context=n,this.enabled=!0,this.isScreenSpace=!1,this.dpr=window.devicePixelRatio,this.isFrameDirty=!1,this.onRenderRequestedDownstream=()=>{this.isFrameDirty=!0,this.context.shared.requestRender()},this._innerApplySize=()=>{let a=this.width,s=this.height,o=this.dpr;this.renderer.dpr=this.isScreenSpace?o:Math.floor(2048/Math.max(a,s)),this.renderer.setSize(a,s)},this.onFrameOverrideObjectEvent=a=>{var s,o;if(((s=a.target)==null?void 0:s.uuid)!==void 0){let l=(o=this.frameRoot)==null?void 0:o.find(a.target.uuid);l&&l.dispatchEvent({...a,target:l})}},this.scene2d=new _U(Ct.generateUUID(),hL.defaultData,{dpr:window.devicePixelRatio,shared:n.shared}),this.canvas=sNe(),this.renderer=oNe(this.canvas),this.promise=this.init(),this.renderTarget=new $i(1,1,{type:Hu,stencilBuffer:!1,depthBuffer:!1}),n.shared.addUIBuffer(this.uuid,this.renderTarget),this.textureHolder=n.shared.uiBuffer(this.uuid)}get canvasTexture(){return this._canvasTexture||(this._canvasTexture=new f_e(this.canvas)),this._canvasTexture}async init(){this.renderer instanceof oq&&(this.renderer.wasmURL=LX.skiaWasmUrl),await this.renderer.init()}render(t){var i,r;if(this.isFrameDirty){this.isFrameDirty=!1,this._innerApplySize(),this.renderer.clear(),(i=this.frameOverride)==null||i.draw(this.renderer),this.renderer.render(),uq.uniforms.tDiffuse.value=this.canvasTexture,this.canvasTexture.needsUpdate=!0;let n=t.getRenderTarget();t.setRenderTarget(this.renderTarget),t.clear(),aNe.render(t),t.setRenderTarget(n),(r=this.textureHolder)==null||r.setNeedsUpdate(!0)}}updateEntity2DByOp(t,i,r,n){this.scene2d.updateEntityByOp(t,i,r,n),this.applySize()}updateTreeByOp(t,i){this.scene2d.updateTreeByOp(t,i),this.applySize()}applyOverrides(t){if(this.frameOverride&&this.frameRoot){this.frameOverride.position=[0,0],this.frameOverride.rotation=0;let i=(t==null?void 0:t.width)??this.width,r=(t==null?void 0:t.height)??this.height;this.frameOverride.width=i,this.frameOverride.height=r,this.frameOverride.localMatrix=lNe,this.isScreenSpace&&(this.frameOverride.fill.color=Ar.from0to1([0,0,0,0])),this.frameOverride.data={...this.frameOverride.data,width:i,height:r},Aq({objectOverride:this.frameOverride,objectRoot:this.frameRoot,newParentWidth:this.frameOverride.width,newParentHeight:this.frameOverride.height,initialParentWidth:this.frameRoot.width,initialParentHeight:this.frameRoot.height}),this.frameOverride.updateWorldMatrix(!0,!1,!0)}}applySize(t,i=window.devicePixelRatio){var l,c;let r=Math.max(1,(t==null?void 0:t.width)??this.width),n=Math.max(1,(t==null?void 0:t.height)??this.height);this.dpr=i,this.width=r,this.height=n,this._innerApplySize();let a=1,s=512,o=512;(r*i<s||n*i<o)&&(a=Math.max(s/(r*i),o/(n*i))),this.renderTarget.setSize(r*i*a,n*i*a),(l=this._canvasTexture)==null||l.dispose(),this._canvasTexture=void 0,this.applyOverrides(t),(c=this.frameOverride)==null||c.requestRender()}applyFrame(t){var r,n;let i=this.context.scene.find2D(t);if(!(!i||!(i instanceof uh)))return this.disposeFrameOverride(),this.frameRoot=i,this.frameOverride=i.clone({dpr:this.renderer.dpr,shared:this.context.shared}),this.scene2d.add(this.frameOverride),this.applySize(),(r=this.frame)==null||r.addEventListener("render",this.onRenderRequestedDownstream),this.frameOverride.traverse(a=>{a.addEventListener("beginState",this.onFrameOverrideObjectEvent)}),this.frameOverride.traverse(a=>{a.addEventListener("completeState",this.onFrameOverrideObjectEvent)}),(n=this.frame)==null||n.requestRender(),i}get frame(){return this.frameOverride}get frameId(){var t;return(t=this.frame)==null?void 0:t.uuid}find(t){return this.scene2d.find(t)}get texture(){var t;return(t=this.textureHolder)==null?void 0:t.getTexture(1001)}disposeFrameOverride(){var t,i,r;(t=this.frameOverride)==null||t.removeEventListener("render",this.onRenderRequestedDownstream),(i=this.frameOverride)==null||i.traverse(n=>{n.removeEventListener("beginStateChange",this.onFrameOverrideObjectEvent)}),(r=this.frameOverride)==null||r.traverse(n=>{n.removeEventListener("completeState",this.onFrameOverrideObjectEvent)}),this.frameOverride&&this.scene2d.remove(this.frameOverride)}};function Aq({objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:n,initialParentWidth:a,initialParentHeight:s}){if(t instanceof uh&&i instanceof uh||t instanceof OA&&i instanceof OA)for(let o=0,l=t.children.length;o<l;o++){let c=t.children[o],h=i.children[o];c&&h&&c.uuid===h.uuid&&hNe({objectOverride:c,objectRoot:h,newParentWidth:r,newParentHeight:n,initialParentWidth:a,initialParentHeight:s})}}function cNe(t){if(zL(t))return[t.width,t.height];if(t instanceof xM){let[i,r]=t.getHalfSize();return[i*2,r*2]}else if(t instanceof OA){let[i,r]=t.recursiveBBox.getHalfSize();return[i*2,r*2]}return[0,0]}function hNe({objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:n,initialParentWidth:a,initialParentHeight:s}){let[o,l]=cNe(i),{width:c,height:h,position:u}=hq({constraints:t.data,newParentWidth:r,newParentHeight:n,initialParentWidth:a,initialParentHeight:s,objectInitialWidth:o,objectInitialHeight:l,objectInitialPosition:i.position});if(t.position=u,t.data={...t.data,position:u},t.states)for(let d in t.states)uNe({stateId:d,objectOverride:t,objectRoot:i,newParentWidth:r,newParentHeight:n,initialParentWidth:a,initialParentHeight:s});if(zL(t)||t instanceof OA)zL(t)&&(t.width=c,t.height=h,t.data={...t.data,width:c,height:h}),Aq({objectOverride:t,objectRoot:i,newParentWidth:c,newParentHeight:h,initialParentWidth:o,initialParentHeight:l});
10911else if(t instanceof xM){let d=i,A=o!==0?c/o:1,f=l!==0?h/l:1;t.path=qOe(d.path,A,f),t.data={...t.data,path:t.path}}}function uNe({stateId:t,objectOverride:i,objectRoot:r,newParentWidth:n,newParentHeight:a,initialParentWidth:s,initialParentHeight:o}){var h,u;let l=(h=i.states)==null?void 0:h[t],c=(u=r.states)==null?void 0:u[t];if(l&&c){let{width:d,height:A,position:f}=hq({constraints:i.data,newParentWidth:n,newParentHeight:a,initialParentWidth:s,initialParentHeight:o,objectInitialWidth:rp.isResizeable(c)?c.width:0,objectInitialHeight:rp.isResizeable(c)?c.height:0,objectInitialPosition:c.position});Object.assign(i.states[t],{position:f}),rp.isResizeable(l)&&Object.assign(i.states[t],{width:d,height:A})}}function zL(t){return t instanceof NE||t instanceof uh||t instanceof gU||t instanceof vU}var fa=class extends KN(ch){constructor(t,i,r){super(),this.data=i,this.bgColor=new Xa(1,1,1,1),this.fog=null,this.backupFog=new F7(16777215,.1,2e3),this.fogUseBGColor=!1,this.isActive=!1,this.aoColor=new Ht,this.penumbraSizeArrayCache=null,this.super_Entity(t,i),this.personalCamera=new ms(W0,{...Fy.defaultData,...i.camera,name:"Personal Camera"}),this.personalCamera.objectHelper.visible=!1,this.add(this.personalCamera),this.activeCamera=this.personalCamera,this.ambientLight=new $_e(13882323,8553090,.75),this.ambientLight.name="Default Ambient Light",this.ambientLight.layers.enable(3),this.ambientLight.removeFromParent(),this.add(this.ambientLight),i.uiScene?this.uiScene=new _U((Array.isArray(t)?t[0]:t)+"-ui",i.uiScene,{dpr:window.devicePixelRatio,shared:r.shared}):i.uiFrame&&this.createUICanvas(i.uiFrame,r)}get scene(){return this.parent}get postprocessing(){return this.data.postprocessing}get frameId(){return this.data.uiFrame}get frame(){var t;return(t=this.uiCanvas)==null?void 0:t.frame}createUICanvas(t,i){this.uiCanvas=new dq(this.uuid+"-uiscreen",window.innerWidth,window.innerHeight,i),this.uiCanvas.isScreenSpace=!0,this.uiCanvas.promise.then(()=>{var r,n;(r=this.uiCanvas)==null||r.applyFrame(t),(n=this.uiCanvas)==null||n.applySize()})}updateVisible(){}setBackgroundColor(t){this.bgColor=t,this.fogUseBGColor===!0&&(this.backupFog.color=t)}entityChildrenCount(){return this.uiScene?this.uiScene.children.length:super.entityChildrenCount()}updateAmbientLight(t,i){t.color!==void 0&&(this.ambientLight.color=Us(t.color,i)),t.intensity!==void 0&&(this.ambientLight.intensity=t.intensity),t.enabled!==void 0&&(t.enabled?this.add(this.ambientLight):this.remove(this.ambientLight))}onDeactive(){this.isActive=!1}onActive(t){this.isActive=!0,t.fog=this.fog,this.traverseEntity(i=>{i instanceof pp&&i.recomputeBoolean()}),this.updateShadow(this.data.shadow)}forceMaterialsUpdate(){this.traverseEntity(t=>{if(t instanceof K0)if(Array.isArray(t.material))for(let i of t.material)i.needsUpdate=!0;else t.material.needsUpdate=!0,t.material.dispose()})}updateShadow(t){t.softShadowQuality!==void 0&&this.isActive&&xOe(t.softShadowQuality)&&this.forceMaterialsUpdate()}updateFog(t,i){if(t.enabled?this.fog=this.backupFog:this.fog=null,this.isActive){let r=this.scene;r.fog=this.fog}this.fogUseBGColor=t.useBackgroundColor,t.useBackgroundColor?this.backupFog.color.set(this.bgColor):this.backupFog.color=Us(t.color,i),this.backupFog.near=t.near,this.backupFog.far=t.far}updateAo(t,i){t.aoColor!==void 0&&(this.aoColor=Us(t.aoColor,i))}updateByOp(t,i,r,n){let a=this.data.uiFrame;super.updateByOp(t,i,r,n);let s=i;Er(t.path,["fog"])?this.updateFog(s.fog,r.shared):Er(t.path,["ao"])?this.updateAo(s.ao,r.shared):Er(t.path,["ambient"])?this.updateAmbientLight(s.ambient,r.shared):Er(t.path,["shadow"])?this.updateShadow(s.shadow):t.type===0&&t.path.length===0&&(t.props.uiFrame!==void 0||a!==s.uiFrame)&&this.updateUIFrame(t.props.uiFrame,r)}updateUIFrame(t,i){t?(this.uiCanvas||this.createUICanvas(t,i),this.uiCanvas.enabled=!0,this.uiCanvas.applyFrame(t)):this.uiCanvas&&(this.uiCanvas.enabled=!1)}updateState(t,i){this.updateState_Entity(t,i),t.backgroundColor!==void 0&&this.setBackgroundColor(Us(t.backgroundColor,i.shared)),t.fog!==void 0&&this.updateFog(t.fog,i.shared),t.ambient!==void 0&&this.updateAmbientLight(t.ambient,i.shared),t.ao!==void 0&&this.updateAo(t.ao,i.shared),t.shadow!==void 0&&this.updateShadow(t.shadow)}createFrame(t,i){}raycast(t,i){super.raycast(t,i)}switchActiveCamera(t){t&&t.isDescendantOf(this)&&(this.activeCamera!==this.personalCamera&&(this.activeCamera.objectHelper.visible=!0),this.activeCamera=t,t.objectHelper.visible=!1)}get playCamera(){var t;return((t=this.scene)==null?void 0:t.find(this.data.publish.playCamera))??this.personalCamera}switchToPlayCamera(){this.switchActiveCamera(this.playCamera)}get penumbraSizeArray(){return this.penumbraSizeArrayCache===null&&this.updatePenumbraSizeArray(),this.penumbraSizeArrayCache}updatePenumbraSizeArray(){this.penumbraSizeArrayCache=new Array(5).fill(.5);let t=0,i=0;this.traverseEntity(r=>{if(!r.visible)return!0;r instanceof rq&&r.visible&&t<3&&(this.penumbraSizeArrayCache[t]=r.data.penumbraSize??.5,t+=1),r instanceof nq&&r.visible&&t<5-3&&(this.penumbraSizeArrayCache[3+i]=r.data.penumbraSize??.5,i+=1)})}
10911raycastWithClones(t){let i=[],r=n=>{for(let a of n.children){let s=a.cloner;Oi.is(a)&&(a.visible||s!=null&&s.object.data.visible)&&(($l(a)||DL(a)&&this.scene.enableHelpers&&a.objectHelper.visible)&&(t.intersectObject(a,!1,i),QL(a,t,i,!0)),r(a))}};return r(this),i}updateEntity2DByOp(t,i,r,n){var a;(a=this.uiCanvas)==null||a.updateEntity2DByOp(t,i,r,n)}},dNe=class extends fU(rye,eq){constructor(t,i,r){super(),this.super_Entity(t,i),this.castShadow=!0,this.shadow.mapSize.width=1024,this.shadow.mapSize.height=1024,this.shadow.normalBias=1,this.layers.enable(3);let n=this.shadow.camera;n.fov=90,n.aspect=1,n.near=100,n.far=2500;let a=new O(-n.far+this.position.x,-n.far+this.position.y,-n.far+this.position.z),s=new O(n.far+this.position.x,n.far+this.position.y,n.far+this.position.z),o=new Sn(a,s),l=new LC(o,new Ht(16755200));l.visible=!1,this.gizmos.shadowmap=l,this.update()}update(){if(this.shadow&&(this.shadow.camera.updateProjectionMatrix(),this.gizmos))for(let t in this.gizmos){let i=this.gizmos[t];if(i instanceof LC){let r=this.shadow.camera,n=new O(-r.far+this.position.x,-r.far+this.position.y,-r.far+this.position.z),a=new O(r.far+this.position.x,r.far+this.position.y,r.far+this.position.z);i.box.set(n,a),i.updateMatrixWorld(!0)}}}updateMatrixWorld(t){super.updateMatrixWorld(t),this.objectHelper&&this.objectHelper.update()}updateState(t,i){this.updateState_Light(t,i),t.distance!==void 0&&(this.distance=t.distance),t.decay!==void 0&&(this.decay=t.decay),t.shadowRadius!==void 0&&(this.shadow.radius=t.shadowRadius),t.shadowResolution!==void 0&&(this.shadow.mapSize.set(t.shadowResolution,t.shadowResolution),this.shadow.map&&(this.shadow.map.dispose(),this.shadow.map=null))}},ANe=class extends ds{get forceComputeSize(){return!0}get shape(){return this.geometry.userData.shape}updateEntityBoxSize(t,i){let r=this.geometry.getAttribute("position");r!==void 0?iU(r,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:r.count,t,i):super.updateEntityBoxSize(t,i)}},yU=class extends ds{constructor(t,i,r){super(t,i,r),this._shapeId=null,this._context=r}updateState(t,i){super.updateState(t,i),this.updateShape()}updateShape(){var n;let t={...this.data.geometry.extrusion.shape};for(let a in t)typeof t[a]=="string"&&(t[a]=this._context.shared.getVariable(t[a],[this.uuid,"geometry","extrusion","shape",a]));let i;if(t.type==="Custom"){let a=t.shapeId;if(a!==this._shapeId&&this.detachShape(),a){this._shapeId=a;let s=this._context.scene.find(a);s!=null&&s.data&&(s.attachedPaths.add(this),i=(n=s.geometry.userData)==null?void 0:n.shape),i||this._context.scene.addPendingCommand(()=>this.updateShape())}}else{let a;switch(t.type){case"Rectangle":a=tU;break;case"Ellipse":a=eU;break;case"Polygon":a=JK;break;case"Star":a=$K;break;default:throw new Error(`Unknown shape type: ${t.type}`)}i=a.create({parameters:t}).userData.shape}let r=this.geometry;i&&r.inputs&&(r.inputs.shapeData=i,r.build(),this.attachedSurfaceCloners.forEach(a=>a.update()))}detachShape(){var t;this._shapeId!==null&&((t=this._context.scene.find(this._shapeId))==null||t.attachedPaths.delete(this))}createGeometryDelayed(t){this.geometryCreateDeleyed=t.shared,this.updateShape(),this.refreshAttachedPaths(t)}updateTransformState(t,i){return super.updateTransformState(t,i)}updateGeometryInteractions(t,i){super.updateGeometryInteractions(t,i),this.updateShape()}updateEntityBoxSize(t,i){let r=this.geometry.getAttribute("position");r!==void 0?iU(r,this.geometry.drawRange.start,this.geometry.drawRange.count<1/0?this.geometry.drawRange.count:r.count,t,i):super.updateEntityBoxSize(t,i)}},EU=class extends AU{constructor(t,i,r){super(t,i,r),this.data=i}},Hg=class extends X0(Tu,LE){constructor(t,i,r){super(),i.type==="Instance"&&typeof t=="string"&&(i=this.transformAssignData(i,r)),this.super_Entity(t,i),this.objectHelper.update()}get isComponentRoot(){return this.data.type==="Component"&&typeof this.identity=="string"}get isInstanceRoot(){return this.data.type==="Instance"&&typeof this.identity=="string"}transformAssignData(t,i){let r=aT.getComponentData({scene:i.scene.data,shared:i.shared.data},t.component);if(r){let n,a;for(let s of nA.rootOverrideProps)t[s]===void 0?(n===void 0&&(n={...t}),n[s]=r.data[s]):(a===void 0&&(a={}),a[s]=t[s],n===void 0&&(n={...t}
vendor: 4,093 bytes, line 10911
10911),n[s]=wA.apply(r.data[s],t[s]));return this.overrideData=a,n}else return{...wa.defaultData,...t,...Pu(wa.defaultData,nA.rootOverrideProps)}}updateByOp(t,i,r,n){let a;if(this.isInstanceRoot&&!n){if(i=this.transformAssignData(i,r),t.type===0&&t.path.length===0&&this.component)for(let s of nA.rootOverrideProps)s in t.props&&t.props[s]===void 0&&(a===void 0&&(a={...t,props:{...t.props}}),a.props[s]=this.component.data[s]);else if(t.type===0&&t.path.length>0&&nA.rootOverrideProps.includes(t.path[0])){let s=t.path[0];a===void 0&&(a={...t,path:[],props:{[s]:i[s]}})}}super.updateByOp(a??t,i,r,n)}updateState(t,i){this.updateState_Entity(t,i)}expandInstanceChildren(t){let i=this.data;if(this.component===void 0){let r=t.scene.find(i.component)??null,n=!1;if(r!==this.oldComponent){if(this.oldComponent){let a=0;for(let s of this.children)if(Oi.is(s))t.scene.disposeAndUnregisterEntityRecursivelyIfNotReregistered(s),wU(s),a+=1;else break;this.children.splice(0,a)}n=!0}if(r){let a={};fq(t,[this.uuid],i.overrides,this,r,r,0,n,a);for(let s of this.children)if(Oi.is(s)){let o=s.data;o.type==="Empty"&&o.animations&&s.traverseEntity(l=>{let c=l.dataPatched;if(l instanceof ds&&c.bones&&c.boneInverses){let h=l.dataPatched;if(h.bones&&h.boneInverses){let u=h.bones.map(f=>t.scene.find(a[f])),d=h.boneInverses.map(f=>new ht().fromArray(f)),A=new cN(u,d);l.bind(A,l.bindMatrix)}}else l.matrixAutoUpdate=!0})}}this.oldComponent=this.component}}};function wU(t){if(t.component){let i=t.component.instances.indexOf(t);i>=0&&t.component.instances.splice(i,1);for(let r of t.children)Oi.is(r)&&wU(r)}}function pV(t,i,r,n){return t.component===i&&ON(t.identity,n)?t.overrideData===r?2:1:0}function fq(t,i,r,n,a,s,o,l,c){if(o>50)return!1;if(n.component!==a){if(n.component){let u=n.component.instances.indexOf(n);u>=0&&n.component.instances.splice(u,1)}a.instances.find(u=>u===n)||a.instances.push(n),n.component=a}a instanceof Hg&&a.isInstanceRoot&&a.expandInstanceChildren(t);let h=0;for(let u of a.children)if(Oi.is(u)){let d=[...i,...typeof u.identity=="string"?[u.identity]:u.identity],A=tT.resolve(r,d,1);A!=null&&!(A instanceof Fn)&&(Object.setPrototypeOf(A,Fn.prototype),console.error("wrong prototype"));let f=null,m;if(!l){let g=n.children[h];if(f=Oi.is(g)?g:null,f!==null){let p=pV(f,u,A,d);m=p>=1?f.stateSelection:void 0,p!==2&&(f=null)}if(f===null&&(f=t.scene.findInstance(d)??null,f!==null)){let p=pV(f,u,A,d);if(m=p>=1?f.stateSelection:void 0,p!==2)f=null;else{let v=f.parent.children.indexOf(f);f.parent.children.splice(v,1),n.children.splice(h,0,f),f.parent===n?v<=h&&console.error("not possible"):(f.parent=n,f.matrixWorldNeedsUpdate=!0,f.resetBBoxNeedsUpdate(),f.updateVisible(),t.pendingDeletes.delete(f))}}}if(f===null){let g=A?wA.apply(u.data,A):u.data;Ap.is(g.type)&&(g={...g,type:"Empty"}),f=sA.createEntity(d,g,t),f.overrideData=A,n.add(f),n.children.splice(n.children.length-1,1),n.children.splice(h,0,f),f.updateState(f.data,t),m&&f.changeSelectedState(m,t),t.scene.registerInstanceAndSetUuid(f)}if(f.isBone){let g=f.identity[f.identity.length-1];c[g]=f.uuid}h+=1,fq(t,i,r,f,u,s,o+1,l,c)}if(!l){let u=h;for(;;){let d=n.children[h];if(Oi.is(d))t.pendingDeletes.add(d);else break;h+=1}n.children.splice(u,h-u)}return!0}var fNe=class extends X0(k7,LE){constructor(t,i){super(),this.super_Entity(t,i),this.objectHelper.update(),this.matrixAutoUpdate=!0}updateState(t,i){this.updateState_Entity(t,i)}},ls=class extends ds{constructor(t,i,r){super(t,i,r),this.onBeforeRender=n=>{this.uiCanvas.render(n)},this.uiCanvas=new dq(t+"-canvas",i.geometry.width,i.geometry.height,r),this.uiCanvas.promise.then(()=>{this.applyFrame(this.dataPatched.geometry.frame,r.shared)})}updateByPatchedOpGeometry(t,i,r){super.updateByPatchedOpGeometry(t,i,r),t.type===0&&(t.props.frame!==void 0&&this.applyFrame(t.props.frame,r.shared),(t.props.width!==void 0||t.props.height!==void 0)&&this.applySize(t.props,r.shared))}applySize(t,i){let r=(t==null?void 0:t.width)??this.dataPatched.geometry.width,n=(t==null?void 0:t.height)??this.dataPatched.geometry.height;this.uiCanvas.applySize({width:r,height:n}
10911),this.applyGeometryParametersFromFrame(i)}applyFrame(t,i){this.uiCanvas.applyFrame(t),this.applyGeometryParametersFromFrame(i),this.applyMaterialParametersFromFrame({shared:i})}applyGeometryParametersFromFrame(t){var r;let i=this.frame;i&&(Object.assign(this.data,{geometry:Object.assign(this.data.geometry,{cornerRadius:i.cornerRadius,cornerType:0})}),Object.assign(this.dataPatched,{geometry:Object.assign(this.dataPatched.geometry,{cornerRadius:i.cornerRadius,cornerType:0})}),(r=this.localGeometry)==null||r.dispose(),this.localGeometry=jy(this.dataPatched.geometry,t,this.data.flatShading,this))}applyMaterialParametersFromFrame(t){let i=this.frame;if(i){let r=i.data.backgroundBlur;Object.assign(this.data.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.data.material.layers[1].data,{roughness:r.radius,alpha:r.enabled?1:0}),Object.assign(this.dataPatched.material.layers[0].data.texture,{image:this.uiCanvas.uuid}),Object.assign(this.dataPatched.material.layers[1].data,{roughness:r.radius,alpha:r.enabled?1:0}),this.material.reset(this.dataPatched.material,t,!0)}}updateEntity2DByOp(t,i,r,n){this.uiCanvas.updateEntity2DByOp(t,i,r,n),t===this.frameId&&i.type===0&&(i.props.cornerRadius!==void 0?this.applyGeometryParametersFromFrame(n):Er(i.path,["backgroundBlur"])&&this.applyMaterialParametersFromFrame({shared:n}))}get frame(){return this.uiCanvas.frame}get frameId(){var t;return(t=this.frame)==null?void 0:t.uuid}removeInteractionGeometry(t){super.removeInteractionGeometry(t),this.applySize({},t)}updateGeometryInteractions(t,i){super.updateGeometryInteractions(t,i),this.applySize({width:t.width,height:t.height},i)}},pNe=class{constructor(t,i,r){this.variables=[],this.currentTextureIndex=0;let n=On,a=new ch,s=new Bp;s.position.z=1;let o={passThruTexture:{value:null}},l=u(A(),o),c=new Zr(new zu(2,2),l);a.add(c),this.setDataType=function(f){return n=f,this},this.addVariable=function(f,m,g){let p=this.createShaderMaterial(m),v={name:f,initialValueTexture:g,material:p,dependencies:null,renderTargets:[],wrapS:null,wrapT:null,minFilter:tr,magFilter:tr};return this.variables.push(v),v},this.setVariableDependencies=function(f,m){f.dependencies=m},this.init=function(){if(r.capabilities.isWebGL2===!1&&r.extensions.has("OES_texture_float")===!1)return"No OES_texture_float support for float textures.";if(r.capabilities.maxVertexTextures===0)return"No support for vertex shader textures.";for(let f=0;f<this.variables.length;f++){let m=this.variables[f];m.renderTargets[0]=this.createRenderTarget(t,i,m.wrapS,m.wrapT,m.minFilter,m.magFilter),m.renderTargets[1]=this.createRenderTarget(t,i,m.wrapS,m.wrapT,m.minFilter,m.magFilter),this.renderTexture(m.initialValueTexture,m.renderTargets[0]),this.renderTexture(m.initialValueTexture,m.renderTargets[1]);let g=m.material,p=g.uniforms;if(m.dependencies!==null)for(let v=0;v<m.dependencies.length;v++){let _=m.dependencies[v];if(_.name!==m.name){let y=!1;for(let w=0;w<this.variables.length;w++)if(_.name===this.variables[w].name){y=!0;break}if(!y)return"Variable dependency not found. Variable="+m.name+", dependency="+_.name}p[_.name]={value:null},g.fragmentShader=` 10912uniform sampler2D `+_.name+`; 10913`+g.fragmentShader}}return this.currentTextureIndex=0,null},this.compute=function(){let f=this.currentTextureIndex,m=this.currentTextureIndex===0?1:0;for(let g=0,p=this.variables.length;g<p;g++){let v=this.variables[g];if(v.dependencies!==null){let _=v.material.uniforms;for(let y=0,w=v.dependencies.length;y<w;y++){let b=v.dependencies[y];_[b.name].value=b.renderTargets[f].texture}}this.doRenderTarget(v.material,v.renderTargets[m])}this.currentTextureIndex=m},this.getCurrentRenderTarget=function(f){return f.renderTargets[this.currentTextureIndex]},this.getAlternateRenderTarget=function(f){return f.renderTargets[this.currentTextureIndex===0?1:0]},this.dispose=function(){c.geometry.dispose(),c.material.dispose();let f=this.variables;for(let m=0;m<f.length;m++){let g=f[m];g.initialValueTexture&&g.initialValueTexture.dispose();let p=g.renderTargets;for(let v=0;v<p.length;v++)p[v].dispose()}};function h(f){f.defines.resolution="vec2( "+t.toFixed(1)+", "+i.toFixed(1)+" )"}this.addResolutionDefine=h;function u(f,m){m=m||{};let g=new Xi({uniforms:m,vertexShader:d(),fragmentShader:f});return h(g),g}this.createShaderMaterial=u,this.createRenderTarget=function(f,m,g,p,v,_){return f=f||t,m=m||i,g=g||Gr,p=p||Gr,v=v||tr,_=_||tr,new $i(f,m,{wrapS:g,wrapT:p,minFilter:v,magFilter:_,format:_a,type:n,depthBuffer:!1})},this.createTexture=function(){let f=new Float32Array(t*i*4),m=new ul(f,t,i,_a,On);return m.needsUpdate=!0,m},this.renderTexture=function(f,m){o.passThruTexture.value=f,this.doRenderTarget(l,m),o.passThruTexture.value=null},this.doRenderTarget=function(f,m){let g=r.getRenderTarget(),p=r.xr.enabled,v=r.shadowMap.autoUpdate,_=r.outputEncoding,y=r.toneMapping;r.xr.enabled=!1,r.shadowMap.autoUpdate=!1,r.outputEncoding=mc,r.toneMapping=lh,c.material=f,r.setRenderTarget(m),r.render(a,s),c.material=l,r.xr.enabled=p,r.shadowMap.autoUpdate=v,r.outputEncoding=_,r.toneMapping=y,r.setRenderTarget(g)};function d(){return`void main() { 10914 10915 gl_Position = vec4( position, 1.0 ); 10916 10917} 10918`}function A(){return`uniform sampler2D passThruTexture; 10919 10920void main() { 10921 10922 vec2 uv = gl_FragCoord.xy / resolution.xy; 10923 10924 gl_FragColor = texture2D( passThruTexture, uv ); 10925 10926} 10927`}}},Da=new za,Kb=new O,mNe=class{constructor(t){let i=t.geometry;if(!i.isBufferGeometry||i.attributes.position.itemSize!==3)throw new Error("THREE.MeshSurfaceSampler: Requires BufferGeometry triangle mesh.");
vendor: 4,813 bytes, lines 10927-10970
10927i.index&&(console.warn("THREE.MeshSurfaceSampler: Converting geometry to non-indexed BufferGeometry."),i=i.toNonIndexed()),this.geometry=i,this.randomFunction=Math.random,this.positionAttribute=this.geometry.getAttribute("position"),this.colorAttribute=this.geometry.getAttribute("color"),this.weightAttribute=null,this.distribution=null}setWeightAttribute(t){return this.weightAttribute=t?this.geometry.getAttribute(t):null,this}build(){let t=this.positionAttribute,i=this.weightAttribute,r=new Float32Array(t.count/3);for(let a=0;a<t.count;a+=3){let s=1;i&&(s=i.getX(a)+i.getX(a+1)+i.getX(a+2)),Da.a.fromBufferAttribute(t,a),Da.b.fromBufferAttribute(t,a+1),Da.c.fromBufferAttribute(t,a+2),s*=Da.getArea(),r[a/3]=s}this.distribution=new Float32Array(t.count/3);let n=0;for(let a=0;a<r.length;a++)n+=r[a],this.distribution[a]=n;return this}setRandomGenerator(t){return this.randomFunction=t,this}sample(t,i,r){let n=this.distribution[this.distribution.length-1],a=this.binarySearch(this.randomFunction()*n);return this.sampleFace(a,t,i,r)}binarySearch(t){let i=this.distribution,r=0,n=i.length-1,a=-1;for(;r<=n;){let s=Math.ceil((r+n)/2);if(s===0||i[s-1]<=t&&i[s]>t){a=s;break}else t<i[s]?n=s-1:r=s+1}return a}sampleFace(t,i,r,n){let a=this.randomFunction(),s=this.randomFunction();return a+s>1&&(a=1-a,s=1-s),Da.a.fromBufferAttribute(this.positionAttribute,t*3),Da.b.fromBufferAttribute(this.positionAttribute,t*3+1),Da.c.fromBufferAttribute(this.positionAttribute,t*3+2),i.set(0,0,0).addScaledVector(Da.a,a).addScaledVector(Da.b,s).addScaledVector(Da.c,1-(a+s)),r!==void 0&&Da.getNormal(r),n!==void 0&&this.colorAttribute!==void 0&&(Da.a.fromBufferAttribute(this.colorAttribute,t*3),Da.b.fromBufferAttribute(this.colorAttribute,t*3+1),Da.c.fromBufferAttribute(this.colorAttribute,t*3+2),Kb.set(0,0,0).addScaledVector(Da.a,a).addScaledVector(Da.b,s).addScaledVector(Da.c,1-(a+s)),n.r=Kb.x,n.g=Kb.y,n.b=Kb.z),this}};function gNe(t){let i=new Float32Array(t*t*2);for(let r=0;r<t;r++)for(let n=0;n<t;n++){let a=r*t+n;i[a*2+0]=r/(t-1),i[a*2+1]=n/(t-1)}return i}function vNe(t){let i=Math.ceil(Math.sqrt(t));return Math.max(i,1)}function _Ne(t,i){let r=new Zr(t.geometry,t.material),n=[],a=[],s=new O,o=new O;r.geometry.index!==null&&(r.geometry=r.geometry.toNonIndexed());let l=new mNe(r).build();for(let u=0;u<i;u++)l.sample(s,o),n.push(s.x,s.y,s.z),a.push(o.x,o.y,o.z);let c=new Float32Array(n),h=new Float32Array(a);return{positions:c,normals:h}}function mV(t,i){let r=t,n=new Float32Array(4*i*i);for(let s=0;s<i*i;s++)n[4*s]=r[3*s],n[4*s+1]=r[3*s+1],n[4*s+2]=r[3*s+2],n[4*s+3]=0;let a=new ul(n,i,i,_a,On);return a.needsUpdate=!0,a}function yNe({size:t}){let i=new Float32Array(4*t*t);for(let n=0;n<t*t;n++)i[4*n]=n,i[4*n+1]=0,i[4*n+2]=0,i[4*n+3]=0;let r=new ul(i,t,t,_a,On);return r.needsUpdate=!0,r}function ENe(t){let i=new Float32Array(4*t*t);for(let n=0;n<t*t;n++)i[4*n]=0,i[4*n+1]=0,i[4*n+2]=0,i[4*n+3]=0;let r=new ul(i,t,t,_a,On);return r.needsUpdate=!0,r}var wNe=` 10928// uniform sampler2D uCurrentPosition; // Pass in the variable from GPGPU 10929// uniform sampler2D uCurrentVelocity; // Pass in the variable from GPGPU 10930// uniform sampler2D uCurrentEmissionRate; // Pass in the variable from GPGPU 10931uniform sampler2D uOriginalPosition; 10932uniform float uTime; 10933uniform float uSpeed; // update speed of the particles 10934uniform vec3 uWorldOffset; 10935uniform vec4 uWorldQuaternion; 10936uniform float uMaxLifeTime; 10937uniform vec3 uEmitterSize; 10938uniform float uFPSRatio; // 1 for 60 FPS 10939 10940float random (vec2 st) { 10941 return fract(sin(dot(st.xy, 10942 vec2(12.9898,78.233)))* 10943 43758.5453123); 10944} 10945vec3 applyQuaternionToVector( vec4 q, vec3 v ){ 10946 return v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v ); 10947} 10948 10949vec3 applyForce(vec3 force, float mass) { 10950 vec3 acceleration = force / mass; 10951 10952 return acceleration; 10953 } 10954 10955 10956void main() { 10957 vec2 vUv = gl_FragCoord.xy / resolution.xy; 10958 vec3 position = texture2D( uCurrentPosition, vUv ).xyz; 10959 float currentLife = texture2D( uCurrentPosition, vUv ).w; // from 1 to 0 10960 float isSpawning = texture2D( uCurrentEmissionRate, vUv ).r; // 1. = spawning, 0. = not spawning 10961 float isActive = texture2D( uCurrentEmissionRate, vUv ).g; // 1. = active, 0. = not active 10962 float timeStart = texture2D( uCurrentEmissionRate, vUv ).b; // timeStart in seconds when the particle was emitted 10963 vec3 originalPosition = ((texture2D( uOriginalPosition, vUv ).xyz) * uEmitterSize); 10964 vec3 velocity = texture2D( uCurrentVelocity, vUv ).xyz; 10965 float collisionFlag = texture2D( uCurrentVelocity, vUv ).w; // 1. = collided, 0. = not collided 10966 float lifeTime = uMaxLifeTime; 10967 10968 // Calculate the position adjustment based on collision 10969 // if (collisionFlag > .5) { 10970 float isColliding = step(0.5, collisionFlag);
10970 // 1.0 if collisionFlag > 0.5, otherwise 0.0 10971 float bounceOffset = 3.0 * isColliding; // Becomes 3.0 if colliding, 0.0 otherwise 10972 vec3 collisionAdjustedVelocity = velocity * (1.0 + bounceOffset); 10973 10974 // Update position based on collision or normal movement 10975 vec3 fpsVelocity = velocity * min(uFPSRatio, 5.0); 10976 position += mix(fpsVelocity, collisionAdjustedVelocity, isColliding); 10977 10978 // EMISSION RATE - BIRTH 10979 // if (isSpawning == 1.0) { 10980 // Better Approach to avoid If statement 10981 vec3 newPosition = applyQuaternionToVector(uWorldQuaternion, originalPosition) + uWorldOffset; 10982 originalPosition = mix(originalPosition, newPosition, isSpawning); 10983 position = mix(position, originalPosition, isSpawning);; 10984 timeStart = mix(timeStart, uTime, isSpawning); 10985 10986 // Calculate timeLeft for life normalization 10987 float timeLeft = max(lifeTime - (uTime - timeStart), 0.0); 10988 float life_Normalize = timeLeft / lifeTime; 10989 10990 // Use isActive to blend between the calculated color and black 10991 vec4 activeColor = vec4(position, life_Normalize); 10992 // if (isActive == 1.0) { 10993 gl_FragColor = mix(vec4(0.0), activeColor, isActive); 10994 10995} 10996`,bNe=` 10997 10998 vec3 mod289(vec3 x) { 10999 return x - floor(x * (1.0 / 289.0)) * 289.0; 11000 } 11001 11002 vec4 mod289(vec4 x) { 11003 return x - floor(x * (1.0 / 289.0)) * 289.0; 11004 } 11005 11006 vec4 permute(vec4 x) { 11007 return mod289(((x*34.0)+1.0)*x); 11008 } 11009 11010 vec4 taylorInvSqrt(vec4 r) 11011 { 11012 return 1.79284291400159 - 0.85373472095314 * r; 11013 } 11014 11015 vec3 fade(vec3 t) { 11016 return t*t*t*(t*(t*6.0-15.0)+10.0); 11017} 11018 11019 float snoise(vec3 v) 11020 { 11021 const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; 11022 const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); 11023 vec3 i = floor(v + dot(v, C.yyy) ); 11024 vec3 x0 = v - i + dot(i, C.xxx) ; 11025 vec3 g = step(x0.yzx, x0.xyz); 11026 vec3 l = 1.0 - g; 11027 vec3 i1 = min( g.xyz, l.zxy ); 11028 vec3 i2 = max( g.xyz, l.zxy ); 11029 vec3 x1 = x0 - i1 + C.xxx; 11030 vec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y 11031 vec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y 11032 11033 // Permutations 11034 i = mod289(i); 11035 vec4 p = permute( permute( permute( 11036 i.z + vec4(0.0, i1.z, i2.z, 1.0 )) 11037 + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) 11038 + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); 11039 11040 // Gradients: 7x7 points over a square, mapped onto an octahedron. 11041 // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 11042 float n_ = 0.142857142857; // 1.0/7.0 11043 vec3 ns = n_ * D.wyz - D.xzx; 11044 11045 vec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p,7*7) 11046 11047 vec4 x_ = floor(j * ns.z); 11048 vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) 11049 11050 vec4 x = x_ *ns.x + ns.yyyy; 11051 vec4 y = y_ *ns.x + ns.yyyy; 11052 vec4 h = 1.0 - abs(x) - abs(y); 11053 11054 vec4 b0 = vec4( x.xy, y.xy ); 11055 vec4 b1 = vec4( x.zw, y.zw ); 11056 11057 vec4 s0 = floor(b0)*2.0 + 1.0; 11058 vec4 s1 = floor(b1)*2.0 + 1.0; 11059 vec4 sh = -step(h, vec4(0.0)); 11060 11061 vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; 11062 vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; 11063 11064 vec3 p0 = vec3(a0.xy,h.x); 11065 vec3 p1 = vec3(a0.zw,h.y); 11066 vec3 p2 = vec3(a1.xy,h.z); 11067 vec3 p3 = vec3(a1.zw,h.w); 11068 11069 //Normalise gradients 11070 vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); 11071 p0 *= norm.x; 11072 p1 *= norm.y; 11073 p2 *= norm.z; 11074 p3 *= norm.w; 11075 11076 // Mix final noise value 11077 vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); 11078 m = m * m; 11079 return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), 11080 dot(p2,x2), dot(p3,x3) ) ); 11081 } 11082 11083 vec3 snoiseVec3( vec3 x ){ 11084 11085 float s = snoise(vec3( x )); 11086 float s1 = snoise(vec3( x.y - 19.1 , x.z + 33.4 , x.x + 47.2 )); 11087 float s2 = snoise(vec3( x.z + 74.2 , x.x - 124.5 , x.y + 99.4 )); 11088 vec3 c = vec3( s , s1 , s2 ); 11089 return c; 11090 11091 } 11092 11093 11094 vec3 curlNoise( vec3 p, float seed){ 11095 p += seed; 11096 const float e = .1; 11097 vec3 dx = vec3( e , 0.0 , 0.0 ); 11098 vec3 dy = vec3( 0.0 , e , 0.0 );
11099 vec3 dz = vec3( 0.0 , 0.0 , e ); 11100 11101 vec3 p_x0 = snoiseVec3( p - dx ); 11102 vec3 p_x1 = snoiseVec3( p + dx ); 11103 vec3 p_y0 = snoiseVec3( p - dy ); 11104 vec3 p_y1 = snoiseVec3( p + dy ); 11105 vec3 p_z0 = snoiseVec3( p - dz ); 11106 vec3 p_z1 = snoiseVec3( p + dz ); 11107 11108 float x = p_y1.z - p_y0.z - p_z1.y + p_z0.y; 11109 float y = p_z1.x - p_z0.x - p_x1.z + p_x0.z; 11110 float z = p_x1.y - p_x0.y - p_y1.x + p_y0.x; 11111 11112 const float divisor = 1.0 / ( 2.0 * e ); 11113 return normalize( vec3( x , y , z ) * divisor ); 11114 11115 } 11116 11117 11118// Classic Perlin noise 11119float cnoise(vec3 P) 11120{ 11121 vec3 Pi0 = floor(P); // Integer part for indexing 11122 vec3 Pi1 = Pi0 + vec3(1.0); // Integer part + 1 11123 Pi0 = mod289(Pi0); 11124 Pi1 = mod289(Pi1); 11125 vec3 Pf0 = fract(P); // Fractional part for interpolation 11126 vec3 Pf1 = Pf0 - vec3(1.0); // Fractional part - 1.0 11127 vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 11128 vec4 iy = vec4(Pi0.yy, Pi1.yy); 11129 vec4 iz0 = Pi0.zzzz; 11130 vec4 iz1 = Pi1.zzzz; 11131 11132 vec4 ixy = permute(permute(ix) + iy); 11133 vec4 ixy0 = permute(ixy + iz0); 11134 vec4 ixy1 = permute(ixy + iz1); 11135 11136 vec4 gx0 = ixy0 * (1.0 / 7.0); 11137 vec4 gy0 = fract(floor(gx0) * (1.0 / 7.0)) - 0.5; 11138 gx0 = fract(gx0); 11139 vec4 gz0 = vec4(0.5) - abs(gx0) - abs(gy0); 11140 vec4 sz0 = step(gz0, vec4(0.0)); 11141 gx0 -= sz0 * (step(0.0, gx0) - 0.5); 11142 gy0 -= sz0 * (step(0.0, gy0) - 0.5); 11143 11144 vec4 gx1 = ixy1 * (1.0 / 7.0); 11145 vec4 gy1 = fract(floor(gx1) * (1.0 / 7.0)) - 0.5; 11146 gx1 = fract(gx1); 11147 vec4 gz1 = vec4(0.5) - abs(gx1) - abs(gy1); 11148 vec4 sz1 = step(gz1, vec4(0.0)); 11149 gx1 -= sz1 * (step(0.0, gx1) - 0.5); 11150 gy1 -= sz1 * (step(0.0, gy1) - 0.5); 11151 11152 vec3 g000 = vec3(gx0.x,gy0.x,gz0.x); 11153 vec3 g100 = vec3(gx0.y,gy0.y,gz0.y); 11154 vec3 g010 = vec3(gx0.z,gy0.z,gz0.z); 11155 vec3 g110 = vec3(gx0.w,gy0.w,gz0.w); 11156 vec3 g001 = vec3(gx1.x,gy1.x,gz1.x); 11157 vec3 g101 = vec3(gx1.y,gy1.y,gz1.y); 11158 vec3 g011 = vec3(gx1.z,gy1.z,gz1.z); 11159 vec3 g111 = vec3(gx1.w,gy1.w,gz1.w); 11160 11161 vec4 norm0 = taylorInvSqrt(vec4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); 11162 g000 *= norm0.x; 11163 g010 *= norm0.y; 11164 g100 *= norm0.z; 11165 g110 *= norm0.w; 11166 vec4 norm1 = taylorInvSqrt(vec4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); 11167 g001 *= norm1.x; 11168 g011 *= norm1.y; 11169 g101 *= norm1.z; 11170 g111 *= norm1.w; 11171 11172 float n000 = dot(g000, Pf0); 11173 float n100 = dot(g100, vec3(Pf1.x, Pf0.yz)); 11174 float n010 = dot(g010, vec3(Pf0.x, Pf1.y, Pf0.z)); 11175 float n110 = dot(g110, vec3(Pf1.xy, Pf0.z)); 11176 float n001 = dot(g001, vec3(Pf0.xy, Pf1.z)); 11177 float n101 = dot(g101, vec3(Pf1.x, Pf0.y, Pf1.z)); 11178 float n011 = dot(g011, vec3(Pf0.x, Pf1.yz)); 11179 float n111 = dot(g111, Pf1); 11180 11181 vec3 fade_xyz = fade(Pf0); 11182 vec4 n_z = mix(vec4(n000, n100, n010, n110), vec4(n001, n101, n011, n111), fade_xyz.z); 11183 vec2 n_yz = mix(n_z.xy, n_z.zw, fade_xyz.y); 11184 float n_xyz = mix(n_yz.x, n_yz.y, fade_xyz.x); 11185 return 2.2 * n_xyz; 11186} 11187 11188 11189vec3 fbm_vec3(vec3 p, float frequency, float offset) 11190{ 11191 return vec3( 11192 cnoise((p+vec3(offset))*frequency), 11193 cnoise((p+vec3(offset+20.0))*frequency), 11194 cnoise((p+vec3(offset-30.0))*frequency) 11195 ); 11196} 11197 11198`,SNe=` 11199 #ifdef USE_COLLIDER 11200 float restitution = max(uBounce * 2., .01); // Energy Loss 11201 // SPHERE COLLIDER 11202 // ************************************************************** 11203 #ifdef USE_SPHERE_COLLIDER 11204 // Convert collider size to radii (assuming uColliderSize is the diameter in each axis) 11205 vec3 radii = uColliderSize; 11206 // Adjust position relative to collider 11207 vec3 relPos = position - uColliderPos; 11208 // Apply rotation of the collider to the relative position 11209 relPos = applyQuaternionToVector(uColliderQuaternionInvert, relPos); 11210 // Scale relative position by radii (for ellipsoid collision detection) 11211 vec3 scaledPos = relPos / radii; 11212 // Calculate ellipsoidal distance 11213 float dist = length(scaledPos); // Distance in terms of ellipsoid 11214
11215 // Check for collision 11216 if (dist <= 1. + particleSize / length(radii) && collisionFlag == 0.0) { 11217 // Compute the normal at the collision point, accounting for particle size 11218 vec3 adjustedPos = scaledPos * (1.0 + particleSize / length(radii)); 11219 // Compute the normal at the collision point 11220 vec3 normal = ellipsoidNormal(adjustedPos, radii); 11221 // Rotate the normal back to world space 11222 normal = applyQuaternionToVector(uColliderQuaternion, normal); 11223 // Reflect the velocity vector off the normal 11224 velocity = reflect(velocity, normal) * restitution; 11225 11226 collisionFlag = 1.0; 11227 } else { 11228 collisionFlag = 0.0; 11229 } 11230 #endif 11231 11232 // BOX COLLIDER or PLANE COLLIDER 11233 // ************************************************************** 11234 #ifdef USE_BOX_COLLIDER 11235 // Box dimensions and repulsion variables 11236 vec3 boxHalfSize = uColliderSize / 2.0; 11237 // Convert world position to box's local space 11238 vec3 localPos = applyQuaternionToVector(uColliderQuaternionInvert, position - uColliderPos); 11239 // Collision detection 11240 vec3 localDistance = abs(localPos) - boxHalfSize; 11241 float distToSurface = max(localDistance.x, max(localDistance.y, localDistance.z)); 11242 11243 // Collision Detected 11244 if (distToSurface <= particleSize * 0.5 && collisionFlag == 0.0) { 11245 // Find the nearest face normal for bounce direction 11246 vec3 normal; 11247 if (localDistance.x > localDistance.y && localDistance.x > localDistance.z) { 11248 normal = vec3(sign(localPos.x), 0.0, 0.0); 11249 } else if (localDistance.y > localDistance.z) { 11250 normal = vec3(0.0, sign(localPos.y), 0.0); 11251 } else { 11252 normal = vec3(0.0, 0.0, sign(localPos.z)); 11253 } 11254 // Rotate normal back to world space 11255 normal = applyQuaternionToVector(uColliderQuaternion, normal); 11256 // Reflect velocity and apply repulsion force 11257 velocity = reflect(velocity, normal) * restitution; 11258 11259 collisionFlag = 1.0; 11260 } else { 11261 collisionFlag = 0.0; 11262 } 11263 #endif 11264 #endif 11265 // END COLLIDER 11266`,CNe=` 11267 #ifdef USE_ATTRACTOR 11268 11269 #ifdef USE_SPHERE_COLLIDER 11270 // Convert collider size to radii (assuming uColliderSize is the diameter in each axis) 11271 vec3 radii = uColliderSize; 11272 // Adjust position relative to collider 11273 vec3 relPos = position - uColliderPos; 11274 // Apply rotation of the collider to the relative position 11275 relPos = applyQuaternionToVector(uColliderQuaternionInvert, relPos); 11276 // Scale relative position by radii (for ellipsoid collision detection) 11277 vec3 scaledPos = relPos / radii; 11278 // Calculate ellipsoidal distance 11279 float distToSurface = length(scaledPos); // Distance in terms of ellipsoid 11280 float insideCheck = 1.0; 11281 11282 #endif 11283 11284 11285 #ifdef USE_BOX_COLLIDER 11286 // Box dimensions 11287 vec3 boxHalfSize = uColliderSize / 2.0; 11288 // Convert world position to box's local space 11289 vec3 localPos = applyQuaternionToVector(uColliderQuaternionInvert, position - uColliderPos); 11290 vec3 localDistance = abs(localPos) - boxHalfSize; 11291 float distToSurface = max(localDistance.x, max(localDistance.y, localDistance.z)); 11292 float insideCheck = particleSize; 11293 #endif 11294 11295 // Apply vortex force inside the Helper 11296 #ifdef USE_FORCE_LOCAL_SPACE 11297 if (distToSurface <= insideCheck ) { 11298 // Define parameters for the attractor field 11299 #ifdef USE_SPHERE_COLLIDER 11300 float attractorStrength = (1.0 - distToSurface ) * uForceIntensity; // Adjust as needed 11301 #endif 11302 11303 #ifdef USE_BOX_COLLIDER 11304 float attractorStrength = max((1.0 - insideCheck / distToSurface), 0.) * uForceIntensity; // Adjust as needed 11305 #endif 11306 11307 float attractorDamping = uForceDamping; // Adjust as needed (higher values will attenuate velocity more) 11308 11309 // Use the same radii calculation code as for the collider 11310 vec3 attractorRadii = uColliderSize; 11311 // Adjust position relative to attractor center 11312 vec3 relPos = position - uColliderPos; 11313 // Apply rotation of the collider to the relative position 11314 relPos = applyQuaternionToVector(uColliderQuaternionInvert, relPos); 11315 // Scale relative position by radii (for ellipsoid attraction) 11316 vec3 scaledPos = relPos / attractorRadii; 11317 11318 // Calculate ellipsoidal distance as attractor radius 11319 float attractorRadius = length(scaledPos); 11320 // Calculate the distance from the attractor center 11321 vec3 relativePosition = position - uColliderPos; 11322 // Calculate the force vector towards the attractor center 11323 vec3 attractorForce = normalize(relativePosition) * attractorStrength; 11324 // Apply the attractor force to the particle 11325 velocity -= attractorForce; 11326 // Attenuate the particle's velocity 11327 velocity *= attractorDamping; 11328 } 11329 #else 11330 // Calculate the distance from the attractor center 11331 vec3 relativePosition = position - uColliderPos; 11332 // Calculate the force vector towards the attractor center 11333 vec3 attractorForce = normalize(relativePosition) * uForceIntensity; 11334 // Apply the attractor force to the particle 11335 velocity -= attractorForce; 11336 // Attenuate the particle's velocity 11337 velocity *= uForceDamping; 11338 #endif 11339 #endif 11340`,TNe=` 11341 #ifdef USE_VORTEX 11342 // Box dimensions 11343 vec3 boxHalfSize = uColliderSize / 2.0; 11344 // Convert world position to box's local space 11345 vec3 localPos = applyQuaternionToVector(uColliderQuaternionInvert, position - uColliderPos); 11346 vec3 localDistance = abs(localPos) - boxHalfSize; 11347 float distToSurface = max(localDistance.x, max(localDistance.y, localDistance.z)); 11348 11349 // Apply vortex force inside the box 11350 if (distToSurface <= particleSize) { 11351 float vortexStrength = uForceIntensity; 11352 vec3 localTopCenter = vec3(0.0, 0., 0.0); 11353 11354 // Transform the local top center to the world space 11355 vec3 vortexCenter = uColliderPos + applyQuaternionToVector(uColliderQuaternion, localTopCenter); 11356 // Calculate the vector from particle to vortex center 11357 vec3 vortexVector = vortexCenter - position; 11358 11359 // Calculate the rotation axis from the inverse of the collider's quaternion and the fixed up vector 11360 // Note: important to add a tiny z component to the up vector to avoid instability 11361 vec3 upVector = vec3(0.0, 1.0, 0.01); 11362 vec3 rotationAxis = cross(upVector, applyQuaternionToVector(uColliderQuaternion, vortexVector)); 11363 rotationAxis = normalize(rotationAxis); 11364 11365 // Add rotational component to velocity 11366 float rotationSpeed = length(vortexVector * vortexStrength * 3.0) ; 11367 11368 vec3 rotationVelocity = rotationAxis * rotationSpeed; 11369 // velocity += rotationVelocity * 0.005 ; 11370 velocity = rotationVelocity * 0.005 ; 11371 11372 // Calculate vortex force 11373 // vec3 vortexForce = normalize(vortexVector) * uSpeed * .1 ; 11374 // Apply the vortex force to the particle 11375 vec3 originDirection = applyQuaternionToVector(uWorldQuaternion, directions); 11376 velocity += applyForce( originDirection * uSpeed * (1. - uForceDamping) , mass * .5); 11377 } 11378 #endif 11379`,MNe=` 11380// uniform sampler2D uCurrentPosition; // Pass in the variable from GPGPU 11381// uniform sampler2D uCurrentVelocity; // Pass in the variable from GPGPU 11382// uniform sampler2D uCurrentEmissionRate; // Pass in the variable from GPGPU 11383uniform sampler2D uOriginalPosition; 11384uniform sampler2D uDirections; 11385uniform vec3 uDirectionsAxis; 11386uniform vec4 uWorldQuaternion; 11387uniform vec3 uGravity; 11388uniform float uNoiseStrength; // Variation of the noise 11389uniform float uNoiseScale; // Scale of the noise 11390uniform float uNoiseSeed; // Seed of the noise 11391uniform float particleSize; 11392uniform float uSpeed; // update speed of the particles
11393uniform float uRandomMassFactor; 11394 11395// COLLIDER 11396uniform vec3 uColliderPos; // Collider Position 11397uniform vec3 uColliderSize; // Collider Dimension 11398uniform vec4 uColliderQuaternion; // Collider Rotation 11399uniform vec4 uColliderQuaternionInvert; // Collider Rotation 11400uniform float uBounce; // Bounce factor 11401uniform float uForceDamping; 11402uniform float uForceIntensity; 11403 11404 11405`+bNe+` 11406float rand(vec2 co){ 11407 return fract(sin(dot(co, vec2(12.9898, 78.233))) * 43758.5453); 11408} 11409vec3 applyQuaternionToVector( vec4 q, vec3 v ){ 11410 return v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v ); 11411 } 11412vec3 applyForce(vec3 force, float mass) { 11413 vec3 acceleration = force / mass; 11414 11415 return acceleration; 11416} 11417 11418vec4 conjugate(vec4 q) { 11419 return vec4(q.w, -q.x, -q.y, -q.z); 11420} 11421 11422// Function to compute the normal of the ellipsoid at a given point 11423vec3 ellipsoidNormal(vec3 p, vec3 radii) { 11424 return normalize(p / (radii * radii)); 11425} 11426 11427float friction = .3; 11428 11429void main() { 11430 vec2 vUv = gl_FragCoord.xy / resolution.xy; 11431 vec3 position = texture2D( uCurrentPosition, vUv ).xyz; 11432 vec3 originalPosition = texture2D( uOriginalPosition, vUv ).xyz; 11433 float timeLeft = texture2D( uCurrentPosition, vUv ).w; 11434 vec3 directions = texture2D( uDirections, vUv ).xyz; 11435 vec3 velocity = texture2D( uCurrentVelocity, vUv ).xyz; 11436 float mass = rand(originalPosition.xy) * 0.5 + 0.5; 11437 float isSpawning = texture2D( uCurrentEmissionRate, vUv ).x; // 1. = spawning, 0. = not spawning 11438 float isActive = texture2D( uCurrentEmissionRate, vUv ).y; // 1. = active, 0. = not active 11439 float collisionFlag =texture2D( uCurrentVelocity, vUv ).w; // Indicate collision 11440 11441 // Randomness Mass 11442 mass = (1.0 - (uRandomMassFactor * mass)); 11443 11444 if (isActive == 1.0) { 11445 // ************************************************************** 11446 // FORCES NOISES 11447 // ************************************************************** 11448 #ifdef USE_CURL_NOISE 11449 if (uNoiseScale > 0.0 ) { 11450 velocity = curlNoise(position * uNoiseScale * .002, uNoiseSeed) * ( uNoiseStrength + 1.0) * .05 * uSpeed; 11451 } 11452 // Variation of the noise Over Time 11453 if (uNoiseStrength > 0.0 && uNoiseScale == 0.0 ) { 11454 velocity += curlNoise( position, uNoiseSeed) * uNoiseStrength * 0.05 * uSpeed; 11455 } 11456 #endif 11457 // ************************************************************** 11458 #ifdef USE_SIMPLEX_NOISE 11459 if (uNoiseScale > 0.0 ) { 11460 velocity = vec3(snoise(position * uNoiseScale * .001) * ( uNoiseStrength + 1.0) * .1); 11461 velocity *= uSpeed; 11462 } 11463 // Variation of the noise Over Time 11464 if (uNoiseStrength > 0.0 && uNoiseScale == 0.0) { 11465 velocity += vec3(snoise(position * uNoiseStrength * .001) * .05 * uSpeed); 11466 } 11467 #endif 11468 // ************************************************************** 11469 #ifdef USE_FBM_NOISE 11470 if (uNoiseScale > 0.0 ) { 11471 velocity = fbm_vec3(position * uNoiseScale * .001, ( uNoiseStrength + 1.0), uNoiseSeed); 11472 velocity *= uSpeed; 11473 } 11474 // Variation of the noise Over Time 11475 if (uNoiseStrength > 0.0 && uNoiseScale == 0.0 ) { 11476 velocity += fbm_vec3(position * uNoiseStrength * .001, ( uNoiseStrength + 1.0), uNoiseSeed) * .1 * uSpeed; 11477 } 11478 #endif 11479 11480 // COLLIDER 11481 ${SNe} 11482 // ATTRACTION 11483 ${CNe} 11484 // VORTEX 11485 ${TNe} 11486 } 11487 // End isActive 11488 11489 // SPAWN BIRTH 11490 // ************************************************************** 11491 // if (isSpawning == 1.) 11492 #ifdef USE_NORMALS 11493 velocity = mix(velocity, applyQuaternionToVector(uWorldQuaternion, directions) * uSpeed, isSpawning); 11494 #else 11495 velocity = mix(velocity, applyQuaternionToVector(uWorldQuaternion, uDirectionsAxis) * uSpeed, isSpawning); 11496 #endif 11497 11498 // if (collisionFlag == 0.0) 11499 velocity += applyForce(uGravity, mass * .5) * (1.0 - collisionFlag); 11500 11501 gl_FragColor = vec4(velocity, collisionFlag); 11502} 11503`,pq=` 11504 11505 // Linear Fade In 11506 float linearFadeIn(float t) { 11507 return t; 11508 } 11509 11510 11511 // linear fade out 11512 float linearFadeOut(float t) { 11513 return 1.0 - t; 11514 } 11515 11516 float linearInOut(float t) { 11517 return t < 0.5 ? t : (1.0 - t); 11518 } 11519 11520 // lerp 11521 float lerp(float a, float b, float t) { 11522 return a + (b - a) * t; 11523 } 11524 11525 // Ease In Out Quart 11526 float exponentialInOut(float t) { 11527 return t < 0.4 ? lerp(0.0, 1.0, t / 0.4) : 11528 t > 0.6 ? lerp(1.0, 0.0, (t - 0.6) / 0.4) : 11529 1.0; 11530 } 11531 11532 // constant 11533 float constant(float t) { 11534 return 1.0; 11535 } 11536`,xNe=` 11537 11538float rand(vec3 co){ 11539 return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); 11540} 11541 11542vec3 applyQuaternionToVector( vec4 q, vec3 v ){ 11543 return v + 2.0 * cross( q.xyz, cross( q.xyz, v ) + q.w * v ); 11544} 11545 11546vec3 applyForce(vec3 force, float mass) { 11547 vec3 acceleration = force / mass; 11548 11549 return acceleration; 11550} 11551`,RNe=` 11552vec3 rgb2xyz (in vec3 rgb) { 11553 float r = rgb.r; 11554 float g = rgb.g; 11555 float b = rgb.b; 11556 11557 r = r > 0.04045 ? pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92); 11558 g = g > 0.04045 ? pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92); 11559 b = b > 0.04045 ? pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92); 11560 11561 float x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805); 11562 float y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722); 11563 float z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505); 11564 11565 vec3 xyz = vec3( 11566 (r * 0.4124) + (g * 0.3576) + (b * 0.1805) * 100.0, 11567 (r * 0.2126) + (g * 0.7152) + (b * 0.0722) * 100.0, 11568 (r * 0.0193) + (g * 0.1192) + (b * 0.9505) * 100.0 11569 ); 11570 return(xyz); 11571} 11572 11573vec3 xyz2lab (in vec3 xyz) { 11574 float x = xyz.x / 95.047; 11575 float y = xyz.y / 100.0; 11576 float z = xyz.z / 108.883; 11577 11578 x = x > 0.008856 ? pow(x, 1.0 / 3.0) : (7.787 * x) + (16.0 / 116.0);
11579 y = y > 0.008856 ? pow(y, 1.0 / 3.0) : (7.787 * y) + (16.0 / 116.0); 11580 z = z > 0.008856 ? pow(z, 1.0 / 3.0) : (7.787 * z) + (16.0 / 116.0); 11581 11582 vec3 lab = vec3((116.0 * y) - 16.0, 500.0 * (x - y), 200.0 * (y - z)); 11583 return(lab); 11584} 11585 11586vec3 rgb2lab(in vec3 rgb) { 11587 vec3 xyz = rgb2xyz(rgb); 11588 vec3 lab = xyz2lab(xyz); 11589 return(lab); 11590} 11591 11592vec3 xyz2rgb (in vec3 xyz) { 11593 float x = xyz.x / 100.0; 11594 float y = xyz.y / 100.0; 11595 float z = xyz.z / 100.0; 11596 11597 11598 float r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986); 11599 float g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415); 11600 float b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570); 11601 11602 r = r > 0.0031308 ? ((1.055 * pow(r, 1.0 / 2.4)) - 0.055) : r * 12.92; 11603 g = g > 0.0031308 ? ((1.055 * pow(g, 1.0 / 2.4)) - 0.055) : g * 12.92; 11604 b = b > 0.0031308 ? ((1.055 * pow(b, 1.0 / 2.4)) - 0.055) : b * 12.92; 11605 11606 r = min(max(0.0, r), 1.0); 11607 g = min(max(0.0, g), 1.0); 11608 b = min(max(0.0, b), 1.0); 11609 11610 return(vec3(r, g, b)); 11611} 11612 11613vec3 lab2xyz (in vec3 lab) { 11614 float l = lab.x; 11615 float a = lab.y; 11616 float b = lab.z; 11617 11618 float y = (l + 16.0) / 116.0; 11619 float x = a / 500.0 + y; 11620 float z = y - b / 200.0; 11621 11622 float y2 = pow(y, 3.0); 11623 float x2 = pow(x, 3.0); 11624 float z2 = pow(z, 3.0); 11625 11626 y = y2 > 0.008856 ? y2 : (y - 16.0 / 116.0) / 7.787; 11627 x = x2 > 0.008856 ? x2 : (x - 16.0 / 116.0) / 7.787; 11628 z = z2 > 0.008856 ? z2 : (z - 16.0 / 116.0) / 7.787; 11629 11630 x *= 95.047; 11631 y *= 100.0; 11632 z *= 108.883; 11633 11634 return(vec3(x, y, z)); 11635} 11636vec3 lab2rgb (in vec3 lab) { 11637 vec3 xyz = lab2xyz(lab); 11638 vec3 rgb = xyz2rgb(xyz); 11639 return(rgb); 11640} 11641 11642`,BNe=` 11643 uniform sampler2D uPosition; 11644 uniform float uSize; 11645 uniform float uSizeEnd; 11646 uniform vec3 uWorldOffset; 11647 uniform vec4 uWorldQuaternion; 11648 // Billboard Behavior - Currently at Zero, but we can change that 11649 uniform float uRotation; 11650 uniform float uRotationEnd; 11651 uniform vec2 center; 11652 11653 // Randomness 11654 uniform float uRandScaleFactor; 11655 uniform float uRandRotationFactor; 11656 11657 attribute vec2 ref; 11658 11659 varying float v_LifeLeft; // normalized lifetime 1 to 0 11660 varying vec2 vUv; 11661 varying vec2 vRef; 11662 11663 ${xNe} 11664 ${pq} 11665`,INe=({easeSize:t="linearFadeOut"})=>` 11666 vUv = uv; 11667 vRef = ref; 11668 // Normalized LifeTime 1 to 0 11669 float lifeLeft = texture2D(uPosition, ref).w; 11670 v_LifeLeft = lifeLeft; 11671 // Position From DataTexture Simulation 11672 vec3 pos = texture2D(uPosition, ref).rgb - uWorldOffset; 11673 // Apply World Quaternion 11674 pos = applyQuaternionToVector(uWorldQuaternion, pos); 11675 11676 #ifdef USE_SIZE_END 11677 // Scaled Over Time 11678 float t = 1. - lifeLeft; 11679 float currentSize = mix(uSize, uSizeEnd, t); // Linearly interpolate between uSize and uSizeEnd 11680 vec3 scaledPosition = position * vec3(currentSize); 11681 #else 11682 // Change Size Behavior over LifeTime 11683 float easeSize = ${t}(1. - lifeLeft); 11684 // Scaled Over Time 11685 vec3 scaledPosition = position * vec3(uSize * easeSize); 11686 #endif 11687 11688 // Billboard Behavior 11689 vec2 scale; 11690 scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); 11691 scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); 11692 // Randomness 11693 float randRef = rand(ref); 11694 scale *= (1.0 - (uRandScaleFactor * randRef)); 11695 // Rotation 11696 float randRotation = 2.0 * PI * ( uRandRotationFactor * randRef); 11697 float originalRotation = (1.0 - uRotation) * 2.0 * PI; 11698 float originalRotationEnd = (1.0 - uRotationEnd) * 2.0 * PI; 11699 // OverTime 11700 float finalRotation = mix(originalRotation + randRotation, originalRotationEnd + randRotation, lifeLeft); 11701 11702 vec2 alignedPosition = ( scaledPosition.xy - ( center - vec2( 0.5 ) ) ) * scale; 11703 vec2 rotatedPosition; 11704 rotatedPosition.x = cos( finalRotation ) * alignedPosition.x - sin( finalRotation ) * alignedPosition.y; 11705 rotatedPosition.y = sin( finalRotation ) * alignedPosition.x + cos( finalRotation ) * alignedPosition.y; 11706 11707 mat4 instanceMatrix = mat4( 11708 vec4(1.0, 0.0, 0.0, 0.0), 11709 vec4(0.0, 1.0, 0.0, 0.0), 11710 vec4(0.0, 0.0, 1.0, 0.0), 11711 vec4(pos.x, pos.y, pos.z, 1.0) 11712 ); 11713 11714 mvPosition = modelViewMatrix * instanceMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); 11715 mvPosition.xy += rotatedPosition; 11716 gl_Position = projectionMatrix * mvPosition; 11717`,DNe=` 11718 uniform vec4 uColor; // start color 11719 uniform vec4 uColor2; // end color 11720 uniform sampler2D uTexture; // texture 11721 varying float v_LifeLeft; // normalized lifetime 1 to 0 11722 varying vec2 vUv; 11723 varying vec2 vRef; 11724 11725 float random(vec2 co) { 11726 return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); 11727 } 11728 `+pq+` 11729 ${RNe} 11730 11731`,PNe=({easeOpacity:t="linearFadeOut"})=>` 11732 // if Particle is dead, hide it 11733 if (v_LifeLeft <= 0.005 ) { 11734 discard; 11735 } 11736 11737 #ifdef USE_RANDOM_COLORING 11738 float randVal = random(vRef); // Generate a random value based on the reference 11739 vec4 color = mix(uColor, uColor2, randVal); // Interpolate between the two colors 11740 #else 11741 vec4 color = mix(uColor, uColor2, 1. - v_LifeLeft); 11742 #endif 11743 11744 // Opacity over Life Time 11745 float finalAlpha = ${t}(1. - v_LifeLeft); 11746 vec4 textureColor = texture2D(uTexture, vUv).rgba; 11747 finalColor = textureColor.rgb * color.rgb; 11748 finalAlpha = color.a * textureColor.a * finalAlpha; 11749 11750 gl_FragColor = vec4(finalColor, finalAlpha); 11751 11752`,LNe=class extends Xi{constructor(t,i){super(),this.needsJitter=!0,this.type="ParticleMaterial",this.easeOpacity="linearFadeIn",this.easeSize="linearFadeIn",this.useSizeEnd=!1,this.isColoringRandom=!1,this.init(t,i),this.context=i}reset(){}init(t,i){this.transparent=!0,this.depthTest=!0,this.depthWrite=!1,this.easeOpacity=t.ease,this.easeSize=t.easeSize,this.layers=[],Yn.startContext(Yn.globalContext),this.lightLayer=new Qc(0,"",{...ua.defaultData("light","phong"),visible:!1},new oU,{},i.shared),Yn.endContext(Yn.globalContext),this.build()}updateState(t){t.coloring!==void 0&&(this.isColoringRandom=t.coloring==="random"),t.color!==void 0&&(t.color instanceof Array?this.uniforms.uColor.value=t.color:this.uniforms.uColor.value=this.context.shared.color(t.color)),t.color2!==void 0&&(t.color2 instanceof Array?this.uniforms.uColor2.value=t.color2:this.uniforms.uColor2.value=this.context.shared.color(t.color2)),t.size!==void 0&&(this.uniforms.uSize.value=t.size[0],this.uniforms.uSizeEnd.value=t.size[1],t.size[0]!==t.size[1]?this.useSizeEnd=!0:this.useSizeEnd=!1),t.ease!==void 0&&(this.easeOpacity=t.ease,this.build()),t.easeSize!==void 0&&(this.easeSize=t.easeSize,this.build()),this.needsUpdate=!0}onBeforeCompile(t){this.build(),t.defines=this.defines,t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader}build(){let t=new dX;return t.needsJitter=this.needsJitter,t.addFragmentParsCode(d2e),t.buildShader("vertex",this.fragment),t.buildShader("fragment",this.fragment),t.addFragmentFinalCode(A2e),this.isColoringRandom&&t.define("USE_RANDOM_COLORING"),this.useSizeEnd&&t.define("USE_SIZE_END"),t.addVertexParsCode(BNe),t.addFragmentParsCode(DNe),t.addVertexFinalCode(INe({easeSize:this.easeSize})),t.addFragmentFinalCode(PNe({easeOpacity:this.easeOpacity})),this.vertexShader=t.getCode("vertex"),this.fragmentShader=t.getCode("fragment"),this.defines=t.defines,this.uniforms={...t.uniforms,...this.uniforms},this.extensions=t.extensions,this}get nodeMaterial(){return this}get fragment(){return this.lightLayer.node}getDefines(){return this.defines}
11752nodeMaterialDispose(){this.layers.forEach(t=>t.dispose()),super.dispose()}},i2=class{constructor(t,i,r,n){this.type="SphereEmitterShape",this.targetMesh=void 0,this.size=t,this.type=r,this.textureSize=vNe(i);let a=1;this.targetMesh=(n==null?void 0:n.type)==="Mesh"&&n?n:this.getMesh(r,a);let{positions:s,dataTexture:o,dataTextureNormals:l}=this.createPositions(this.textureSize,this.targetMesh??this.getMesh(r,a));this.positionsTexture=o,this.positionsAttribute=s,this.directionsTexture=l}createPositions(t,i){let{positions:r,normals:n}=_Ne(i,t*t),a=mV(r,t),s=mV(n,t);return{dataTexture:a,positions:r,dataTextureNormals:s}}getMesh(t,i){let r=null;switch(t){case"SphereEmitterShape":{r=new Bg(i*.5,32,32);break}case"TorusEmitterShape":{r=new X7(i*.5,.3,15,40);break}case"ConeEmitterShape":{r=new AN(i,i,15);break}case"BoxEmitterShape":{r=new gc(i,i,i);break}case"PlaneEmitterShape":{r=new zu(i,i),r.rotateX(-Math.PI/2);break}case"MeshEmitterShape":{r=new Bg(i,32,32);break}default:{r=new Bg(i,32,32);break}}return new Zr(r,new Gu({color:16711680}))}applyToShader(t,i){this.size=new O().fromArray(i.size),t.uEmitterSize.value=this.size}dispose(){this.positionsTexture.dispose(),this.directionsTexture.dispose(),this.positionsAttribute=new Float32Array}};function ag(t){let i={...t},r=XC.defaultData;i.forceFieldObjectId&&(i.colliderEntityId=i.forceFieldObjectId);let n={...r.shape,...i.shape},a={...r.renderMaterial,...i.renderMaterial};return{...r,...i,shape:n,renderMaterial:a}}var ONe=` 11753// uniform sampler2D uCurrentPosition; // Pass in the variable from GPGPU 11754// uniform sampler2D uCurrentVelocity; // Pass in the variable from GPGPU 11755// uniform sampler2D uCurrentEmissionRate; // Pass in the variable from GPGPU 11756 11757uniform sampler2D uIndex; // Texture with corresponding index 11758uniform float uLastIndexEmitted; // Last emitted index 11759uniform float uParticlesToEmit; // Number of particles to emit on that frame 11760uniform float uTime; 11761 11762void main() { 11763 vec2 vUv = gl_FragCoord.xy / resolution.xy; 11764 float particleIndex = texture(uIndex, vUv).x; 11765 float timeLeft = texture2D( uCurrentPosition, vUv ).w; 11766 float isActive = texture2D( uCurrentEmissionRate, vUv ).g; // 1. = active, 0. = not active 11767 float timeStart = texture2D( uCurrentEmissionRate, vUv ).b; 11768 11769 11770 // ********** Detect Colision to Create a flag and use it in position ********** 11771 // We are doing this here, so 11772 11773 // ********** Emit Particles ********** 11774 // X = isSpawning 0.0 or 1.0 11775 // Y = isActive 0.0 or 1.0 11776 // Check if the vertex index is between the first value and the last value 11777 // if (particleIndex >= uLastIndexEmitted && particleIndex < uLastIndexEmitted + uParticlesToEmit) { 11778 // // Emit a particle by writing 1 to the red channel of the color output 11779 // // r: 1. == emit the particle 11780 // // g: 1. == particle is now active 11781 // timeStart = uTime; 11782 // gl_FragColor = vec4(1.0, 1.0, timeStart, 1.0); 11783 // } else { 11784 // // The Particle is either already emitted or not in the range of the particles to emit 11785 // // Do not emit a particle by writing 0 to the red channel of the color output 11786 // gl_FragColor = vec4(0.0, isActive, timeStart, 1.0); 11787 // } 11788 // Determine if the particle is within the emission range 11789 float emitLowerBound = step(uLastIndexEmitted, particleIndex); 11790 float emitUpperBound = step(particleIndex, uLastIndexEmitted + uParticlesToEmit - 1.0); 11791 float emitParticle = emitLowerBound * emitUpperBound; // 1.0 if in range, 0.0 otherwise 11792 11793 // Set timeStart and color 11794 timeStart = mix(timeStart, uTime, emitParticle); 11795 gl_FragColor = vec4(emitParticle, mix(isActive, 1.0, emitParticle), timeStart, 1.0); 11796 11797 11798} 11799`,r2=10,NNe=class extends lr{constructor(t,i){super(),this.type="ParticleEmitter",this.debugMode=!1,this.worldSpace=!0,this.rootObject=null,this.gpuCompute=null,this.positionSimRT=null,this.velocitySimRT=null,this.emissionRateSimRT=null,this.emitterShape=void 0,this.isEmitting=!1,this.hasBeenReset=!1,this.emittedParticlesAmount=0,this.lastEmitTime=0,this.globalTime=0,this.targetFPS=60,this.previousRatio=1,this.lerpFactor=.4,this.particlesAmount=0,this.noiseStrength=0,this.noiseScale=0,this.isBillboardBased=!0,this.simFeaturesDefinition={USE_COLLIDER:!1,USE_ATTRACTOR:!1,USE_VORTEX:!1,USE_SPHERE_COLLIDER:!1,USE_BOX_COLLIDER:!1,USE_FORCE_LOCAL_SPACE:!1,USE_NORMALS:!1,USE_CURL_NOISE:!0,USE_SIMPLEX_NOISE:!1,USE_FBM_NOISE:!1},this.textureLoader=new J_e,this.currentWorldPosition=new O,this.systemQuaternion=new ri,this.worldGravity=new O(0,0,0),this.directionAxis=new O(0,0,0),this.colliderV3=new O(0,0,0),this.colliderQuaternion=new ri(0,0,0,1),this.matrixAutoUpdate=!0,this.renderer=t,this.system=i,this.shared=i.context.shared;let r=i.data;this.material=new LNe(r.renderMaterial,i.context),this.material.uniforms={uSize:{value:0},uSizeEnd:{value:0},uColor:{value:r.renderMaterial.color},uColor2:{value:r.renderMaterial.color2},uPosition:{value:new O(0,0,0)},uEmissionData:{value:new O(0,0,0)},uTexture:{value:this.defaultTexture},uWorldOffset:{value:new O(0,0,0)},uWorldQuaternion:{value:new ai(0,0,0,1)},uRandScaleFactor:{value:r.randomScale??0},uRandRotationFactor:{value:r.randomRotation??0},uRotation:{value:r.renderMaterial.spriteRotation[0]??0},uRotationEnd:{value:r.renderMaterial.spriteRotation[1]??0}},this.setTexture(this.material.uniforms,r.renderMaterial.texture),this.init(r)}setTexture(t,i){let r=i.data;if(typeof i=="string"){let n=this.shared.image(i),a=new en(n.img);a.needsUpdate=!0,t.uTexture.value=a;return}if(typeof r!="string"){let n=new Image;n.onload=()=>{let o=new en(n);o.needsUpdate=!0,t.uTexture.value=o};let a=new Blob([r],{type:"image/*"}),s=URL.createObjectURL(a);n.src=s}}updateGeometryAttributes(t,i){var n;let r=gNe(i);!((n=this.emitterShape)!=null&&n.positionsAttribute)||t.geometry.setAttribute("ref",new xy(r,2))}
vendor: 10,503 bytes, line 11799
11799applyWorldSpace(){if(!this.system.started||!this.worldSpace||!this.positionSimRT||!this.velocitySimRT)return;let t=this.system;t.getWorldQuaternion(this.systemQuaternion),this.systemQuaternion.invert(),t.getWorldPosition(this.currentWorldPosition),this.material.uniforms.uWorldOffset.value=this.currentWorldPosition,this.material.uniforms.uWorldQuaternion.value.copy(this.systemQuaternion.normalize()),this.positionSimRT.material.uniforms.uWorldOffset.value=this.currentWorldPosition,this.systemQuaternion.invert(),this.positionSimRT.material.uniforms.uWorldQuaternion.value.copy(this.systemQuaternion.normalize()),this.velocitySimRT.material.uniforms.uWorldQuaternion.value.copy(this.systemQuaternion.normalize())}update(t,i){var o;if(!this.gpuCompute||!this.positionSimRT||!this.velocitySimRT||!this.emissionRateSimRT||this.hasBeenReset)return;if(this.checkIfAllParticlesAreDead()&&!this.hasBeenReset){this.reset();return}this.applyWorldSpace(),this.globalTime=t,this.positionSimRT.material.uniforms.uTime.value=t,this.emissionRateSimRT.material.uniforms.uTime.value=t;let r=1e3/i,n=this.targetFPS/r,a=this.previousRatio+(n-this.previousRatio)*this.lerpFactor;this.positionSimRT.material.uniforms.uFPSRatio.value=a,this.previousRatio=a;let s=this.isEmitting?this.GoEmitSomeParticles(t,this.system.data.birthRatePerSec):0;this.emissionRateSimRT.material.uniforms.uLastIndexEmitted.value=this.emittedParticlesAmount,this.emissionRateSimRT.material.uniforms.uParticlesToEmit.value=s,this.material.uniforms.uPosition.value=(o=this.gpuCompute.getCurrentRenderTarget(this.positionSimRT))==null?void 0:o.texture,this.system.colliderEntities.length>0&&this.renderColliders(),this.gpuCompute.compute()}renderColliders(){if(!this.velocitySimRT)return;let t=this.system.colliderEntities[0],i=this.simFeaturesDefinition.USE_COLLIDER||this.simFeaturesDefinition.USE_ATTRACTOR||this.simFeaturesDefinition.USE_VORTEX;if(t.destroyedInAction&&i&&this.init(ag({...this.system.data,colliderEntityId:null})),!t||t.destroyedInAction)return;t.getWorldPosition(this.colliderV3),this.colliderV3.y===0&&(this.colliderV3.y=1e-4),this.velocitySimRT.material.uniforms.uColliderPos.value.copy(this.colliderV3);let r=t.data.size;this.colliderV3.fromArray(r),this.velocitySimRT.material.uniforms.uColliderSize.value.copy(this.simFeaturesDefinition.USE_SPHERE_COLLIDER?this.colliderV3.multiplyScalar(.5):this.colliderV3),t.getWorldQuaternion(this.colliderQuaternion),this.velocitySimRT.material.uniforms.uColliderQuaternion.value.copy(this.colliderQuaternion.normalize()),this.velocitySimRT.material.uniforms.uColliderQuaternionInvert.value.copy(this.colliderQuaternion.normalize().invert())}updateState(t){!this.velocitySimRT||!this.positionSimRT||(t.renderMaterial&&this.updateMaterialState(t.renderMaterial),this.updateParticleState(t))}updateVariableState(t,i){if(!this.velocitySimRT||!this.positionSimRT)return;i[2]==="size"&&this.material.updateState({size:[t,this.material.uniforms.uSizeEnd.value]}),i[2]==="sizeEnd"&&this.material.updateState({size:[this.material.uniforms.uSize.value,t]});let r=(n,a)=>{let s=[...this.system.data.shape.size];s[n]=a,this.updateParticleState({shape:{...this.system.data.shape,size:s}})};i[2]==="shape_size_0"&&r(0,t),i[2]==="shape_size_1"&&r(1,t),i[2]==="shape_size_2"&&r(2,t),i[2]==="speed"&&(this.velocitySimRT.material.uniforms.uSpeed.value=t/r2),i[2]==="gravity"&&this.worldGravity.set(0,t/100,0),i[2]==="noiseStrength"&&(this.noiseStrength=t,this.velocitySimRT.material.uniforms.uNoiseStrength.value=this.noiseStrength),i[2]==="noiseScale"&&(this.noiseScale=t,this.velocitySimRT.material.uniforms.uNoiseScale.value=this.noiseScale),i[2]==="direction_x"&&(this.directionAxis=this.getDirectionAxis([Number(t),this.system.data.direction[1],this.system.data.direction[2]])),i[2]==="direction_y"&&(this.directionAxis=this.getDirectionAxis([this.system.data.direction[0],Number(t),this.system.data.direction[2]])),i[2]==="direction_z"&&(this.directionAxis=this.getDirectionAxis([this.system.data.direction[0],this.system.data.direction[1],Number(t)]))}updateMaterialState(t){this.material.updateState({...t,size:t.size?[Number(this.shared.getVariable(t.size[0],[this.uuid,"particles","size"])),Number(this.shared.getVariable(t.size[1],[this.uuid,"particles","sizeEnd"]))]:[0,0]}),t.texture&&(this.setTexture(this.material.uniforms,t.texture),this.material.needsUpdate=!0)}updateParticleState(t){var i,r,n;if(!(!this.positionSimRT||!this.velocitySimRT)){if(this.shouldReInitGPUCompute(t)&&this.init(ag(this.system.data)),t.life!==void 0&&(this.positionSimRT.material.uniforms.uMaxLifeTime.value=t.life),t.speed!==void 0&&(this.velocitySimRT.material.uniforms.uSpeed.value=Number(this.shared.getVariable(t.speed,[this.uuid,"particles","speed"]))/r2),t.collisionBounce!==void 0&&(this.velocitySimRT.material.uniforms.uBounce.value=t.collisionBounce),t.noiseStrength!==void 0&&(this.noiseStrength=Number(this.shared.getVariable(t.noiseStrength,[this.uuid,"particles","noiseStrength"])),this.velocitySimRT.material.uniforms.uNoiseStrength.value=this.noiseStrength),t.noiseScale!==void 0&&(this.noiseScale=Number(this.shared.getVariable(t.noiseScale,[this.uuid,"particles","noiseScale"])),this.velocitySimRT.material.uniforms.uNoiseScale.value=this.noiseScale),t.noiseSeed!==void 0&&(this.velocitySimRT.material.uniforms.uNoiseSeed.value=t.noiseSeed),t.randomMass!==void 0&&(this.velocitySimRT.material.uniforms.uRandomMassFactor.value=t.randomMass),((i=t.renderMaterial)==null?void 0:i.size)!==void 0){let a=this.shared.getVariable(t.renderMaterial.size[0],[this.uuid,"particles","size"]);this.velocitySimRT.material.uniforms.particleSize.value=Number(a)}if(((r=t.renderMaterial)==null?void 0:r.spriteRotation)!==void 0&&(this.material.uniforms.uRotation.value=t.renderMaterial.spriteRotation[0],this.material.uniforms.uRotationEnd.value=t.renderMaterial.spriteRotation[1]),t.shape!==void 0){let a=t.shape.size??this.system.data.shape.size,s=[Number(this.shared.getVariable(a[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(a[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(a[2],[this.uuid,"particles","shape_size_2"]))],o={...ag(this.system.data).shape,size:s};(n=this.emitterShape)==null||n.applyToShader(this.positionSimRT.material.uniforms,o)}if(t.gravity!==void 0&&(this.worldGravity.set(0,Number(this.shared.getVariable(this.system.data.gravity,[this.uuid,"particles","gravity"]))/100,0),this.velocitySimRT.material.uniforms.uGravity={value:this.worldGravity}),t.direction!==void 0){let a=this.getDirectionFromVariable(t.direction);this.directionAxis=this.getDirectionAxis(a),this.velocitySimRT.material.uniforms.uDirectionsAxis.value=this.directionAxis}t.randomRotation!==void 0&&(this.material.uniforms.uRandRotationFactor.value=t.randomRotation),t.randomScale!==void 0&&(this.material.uniforms.uRandScaleFactor.value=t.randomScale)}}updateForceFieldParameters(t){!this.velocitySimRT||(t.forceIntensity!==void 0&&(this.velocitySimRT.material.uniforms.uForceIntensity.value=t.forceIntensity),t.forceDambing!==void 0&&(this.velocitySimRT.material.uniforms.uForceDamping.value=t.forceDambing))}getDirectionAxis(t){let i=[Number(t[0])*Ct.DEG2RAD,Number(t[1])*Ct.DEG2RAD,Number(t[2])*Ct.DEG2RAD],r=new qn(i[0],i[1],i[2],"XYZ");return this.directionAxis.set(0,1,0).applyEuler(r).normalize(),this.velocitySimRT&&(this.velocitySimRT.material.uniforms.uDirectionsAxis.value=this.directionAxis),this.directionAxis}shouldReInitGPUCompute(t){let{birthRatePerSec:i,rootObjectType:r,colliderEntityId:n,shape:a,emitTimeDuration:s,emitTimeCycle:o,life:l,directionMode:c,noiseType:h}=t;return i!==void 0||r!==void 0||n||n===null||o!==void 0||a!==void 0||l!==void 0||s!==void 0||c!==void 0||h!==void 0}init(t){this.dispose(),this.particlesAmount=this.getMaxParticlesAmount({birthRatePerSecond:t.birthRatePerSec,particleMaxLifeTime:t.life,loopDuration:t.emitTimeCycle==="infinity"?0:t.emitTimeDuration}),this.particlesAmount>1e5&&(console.warn("The maximum number of particles is limited to 100000."),this.particlesAmount=1e5),this.emitterShape=this.createShape(t.shape,this.particlesAmount);let i=setInterval(()=>{if(this.emitterShape)if(isNaN(this.emitterShape.positionsTexture.source.data.data[0])){this.init(t);return}else clearInterval(i)},100);if(!this.emitterShape)return;let r=new pNe(this.emitterShape.textureSize,this.emitterShape.textureSize,this.renderer),n=this.updateSimulationDefinition(t),a=r.addVariable("uCurrentPosition",n+wNe,this.emitterShape.positionsTexture),s=r.addVariable("uCurrentVelocity",n+MNe,this.emitterShape.directionsTexture),o=r.addVariable("uCurrentEmissionRate",ONe,ENe(this.emitterShape.textureSize));r.setVariableDependencies(a,[a,s,o]),r.setVariableDependencies(s,[a,s,o]),r.setVariableDependencies(o,[a,s,o]);let l=yNe({size:this.emitterShape.textureSize}),c={uOriginalPosition:{value:this.emitterShape.positionsTexture},uWorldOffset:{value:new O(0,0,0)},uWorldQuaternion:{value:new ai(0,0,0,1)},uTime:{value:0},uFPSRatio:{value:1},uMaxLifeTime:{value:t.life},uEmitterSize:{value:new O(Number(this.shared.getVariable(t.shape.size[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(t.shape.size[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(t.shape.size[2],[this.uuid,"particles","shape_size_2"])))},particleSize:{value:0}};a.material.uniforms=c;let h=this.getDirectionFromVariable(t.direction);this.directionAxis=this.getDirectionAxis(h),this.worldGravity.set(0,Number(this.shared.getVariable(this.system.data.gravity,[this.uuid,"particles","gravity"]))/100,0),this.noiseStrength=Number(this.shared.getVariable(t.noiseStrength,[this.uuid,"particles","noiseStrength"])),this.noiseScale=Number(this.shared.getVariable(t.noiseScale,[this.uuid,"particles","noiseScale"]));let u=t.colliderEntityId&&this.system.getColliderData(t.colliderEntityId),d={uOriginalPosition:{value:this.emitterShape.positionsTexture},uDirections:{value:this.emitterShape.directionsTexture},uDirectionsAxis:{value:this.directionAxis},uWorldQuaternion:{value:new ai(0,0,0,1)},uColliderPos:{value:new O(0,0,0)},uColliderSize:{value:new O(0,0,0)},uForceIntensity:{value:u?u.forceIntensity:0},uForceDamping:{value:u?u.forceDambing:0},uColliderQuaternion:{value:new ai(0,0,0,1)},uColliderQuaternionInvert:{value:new ai(0,0,0,1)},particleSize:{value:0},uGravity:{value:this.worldGravity},uNoiseStrength:{value:this.noiseStrength},uNoiseScale:{value:this.noiseScale},uNoiseSeed:{value:t.noiseSeed}
11799,uRandomMassFactor:{value:t.randomMass},uBounce:{value:t.collisionBounce},uSpeed:{value:Number(this.shared.getVariable(t.speed,[this.uuid,"particles","speed"]))/r2}};s.material.uniforms=d;let A={uIndex:{value:l},uTime:{value:0},uLastIndexEmitted:{value:0},uParticlesToEmit:{value:0}};o.material.uniforms=A;let f=[Number(this.shared.getVariable(t.shape.size[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(t.shape.size[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(t.shape.size[2],[this.uuid,"particles","shape_size_2"]))],m={...ag(this.system.data).shape,size:f};this.emitterShape.applyToShader(a.material.uniforms,m),r.init(),this.gpuCompute=r,this.positionSimRT=a,this.velocitySimRT=s,this.emissionRateSimRT=o,this.rootObject=this.createPrimaryEmitter(this.emitterShape.textureSize),this.add(this.rootObject),this.material.needsUpdate=!0}getDirectionFromVariable(t){let i=Number(this.shared.getVariable(t[0],[this.uuid,"particles","direction_x"])),r=Number(this.shared.getVariable(t[1],[this.uuid,"particles","direction_y"])),n=Number(this.shared.getVariable(t[2],[this.uuid,"particles","direction_z"]));return[i,r,n]}updateSimulationDefinition(t){if(this.simFeaturesDefinition.USE_COLLIDER=!1,this.simFeaturesDefinition.USE_ATTRACTOR=!1,this.simFeaturesDefinition.USE_VORTEX=!1,this.simFeaturesDefinition.USE_SPHERE_COLLIDER=!1,this.simFeaturesDefinition.USE_BOX_COLLIDER=!1,this.simFeaturesDefinition.USE_FORCE_LOCAL_SPACE=!1,this.simFeaturesDefinition.USE_NORMALS=!1,this.simFeaturesDefinition.USE_CURL_NOISE=!1,this.simFeaturesDefinition.USE_SIMPLEX_NOISE=!1,this.simFeaturesDefinition.USE_FBM_NOISE=!1,t.colliderEntityId&&this.system.colliderEntities.length>0){let r=this.system.getColliderData(t.colliderEntityId);switch(r==null?void 0:r.forceType){case"attractor":this.simFeaturesDefinition.USE_ATTRACTOR=!0;break;case"collider":this.simFeaturesDefinition.USE_COLLIDER=!0;break;case"vortex":this.simFeaturesDefinition.USE_VORTEX=!0;break}let n=r==null?void 0:r.colliderType;n==="sphere"&&(this.simFeaturesDefinition.USE_SPHERE_COLLIDER=!0),n==="box"&&(this.simFeaturesDefinition.USE_BOX_COLLIDER=!0),(r==null?void 0:r.forceRange)==="helper"&&(this.simFeaturesDefinition.USE_FORCE_LOCAL_SPACE=!0)}t.directionMode==="normals"&&(this.simFeaturesDefinition.USE_NORMALS=!0),t.noiseType==="curl"&&(this.simFeaturesDefinition.USE_CURL_NOISE=!0),t.noiseType==="simplex"&&(this.simFeaturesDefinition.USE_SIMPLEX_NOISE=!0),t.noiseType==="fbm"&&(this.simFeaturesDefinition.USE_FBM_NOISE=!0);let i="";for(let[r,n]of Object.entries(this.simFeaturesDefinition))n&&(i+=`#define ${r} 11800`);return i}createShape(t,i){this.emitterShape&&this.emitterShape.dispose();let r=new O(Number(this.shared.getVariable(t.size[0],[this.uuid,"particles","shape_size_0"])),Number(this.shared.getVariable(t.size[1],[this.uuid,"particles","shape_size_1"])),Number(this.shared.getVariable(t.size[2],[this.uuid,"particles","shape_size_2"])));if(t.type==="MeshEmitterShape"){let n=null;return this.system.context.scene.traverseEntity(a=>{a.uuid===t.fromMeshId&&(n=a)}),n?new i2(r,i,t.type,n):new i2(r,i,"SphereEmitterShape")}else return new i2(r,i,t.type)}createPrimaryEmitter(t){let i,r=t*t;return i=new d_e(new zu(1,1,1),this.material,r),this.updateGeometryAttributes(i,t),this.material.needsUpdate=!0,i.onBeforeRender=()=>{this.applyWorldSpace()},i}getMaxParticlesAmount({birthRatePerSecond:t,particleMaxLifeTime:i,loopDuration:r=0}){return Math.ceil(t*(i+r))}dispose(){var t,i,r;!this.gpuCompute||((i=(t=this.rootObject)==null?void 0:t.parent)==null||i.remove(this.rootObject),this.gpuCompute.dispose(),this.material.nodeMaterialDispose(),(r=this.emitterShape)==null||r.dispose())}GoEmitSomeParticles(t,i){let r=t-this.lastEmitTime,n=1/i;if(r>=n){let a=Math.max(1,Math.floor(r/n));return this.lastEmitTime=t,this.emittedParticlesAmount+a>this.particlesAmount&&(this.emittedParticlesAmount=0),this.emittedParticlesAmount+=a,a}return 0}checkIfAllParticlesAreDead(){return this.lastEmitTime+this.system.data.life+1<this.globalTime}reset(){this.hasBeenReset=!0,this.lastEmitTime=0,this.emittedParticlesAmount=0,this.gpuCompute&&this.init(
11800ag(this.system.data))}startEmitting(t){this.isEmitting=!0,this.hasBeenReset=!1,this.lastEmitTime=t}stopEmitting(){this.isEmitting=!1}},NS=class extends zs{constructor(t,i,r){super(t,i),this.type="ParticleSystem",this.geometry=new Lt,this.actualTime=0,this.currentLoopTime=0,this.started=!1,this.stopped=!1,this.timeoutId=void 0,this.isFrozen=!1,this.isIdle=!0,this.emitter=null,this.colliderEntities=[],this.renderer=null,this.isPreWarm=!1,this._hasOnAfterRenderBeenCalled=!1,this.onAfterRender=n=>{this._hasOnAfterRenderBeenCalled||(this._hasOnAfterRenderBeenCalled=!0,this.init(n))},this.context=r,this.data={...i,...ag(i)},this.geometry.setAttribute("position",new Et([],3)),this.material=new Gu({colorWrite:!1}),this.frustumCulled=!1}init(t){this.renderer=t,this.emitter=new NNe(t,this),this.add(this.emitter),this.updateParticleState(this.data)}update(t){if(!this.isReady||!this.started||this.isFrozen||this.isIdle)return;this.actualTime+=t,this.stopped||(this.currentLoopTime+=t);let i=this.data.emitTimeCycle==="one_time";if((this.data.emitTimeCycle==="loop"||i)&&this.currentLoopTime>this.data.emitTimeDuration*1e3&&(this.stopped||(this.stop(),i||this.start(this.data.emitTimeDelay*1e3))),this.emitter&&this.started){let r=this.actualTime/1e3;this.emitter.update(r,t)}this.scale.set(1,1,1),this.updateMatrix()}isReady(){return!!this.emitter}hasCollider(t){return this.colliderEntities.some(i=>i.identity===t)}getColliderData(t){let i=this.colliderEntities.find(r=>r.identity===t);return i?i.data:null}updateByPatchedOp(t,i,r){super.updateByPatchedOp(t,i,r),Er(t.path,["renderMaterial"])&&this.updateParticleState({renderMaterial:{...this.data.renderMaterial,...ya.drop(t,1).props}}),Er(t.path,["shape"])&&this.updateParticleState({shape:{...this.data.shape,...ya.drop(t,1).props}})}updateState(t,i){super.updateState(t,i),this.updateParticleState(t)}updateParticleState(t){if(this.emitter){if(t.colliderEntityId!==void 0&&t.colliderEntityId!==null){let i=this.context.scene.find(t.colliderEntityId);this.colliderEntities=i?[i]:[]}t.colliderEntityId===null&&(this.colliderEntities=[]),this.emitter.updateState(t),t.emitTimeCycle&&this.started&&this.start()}}updateFromColliderEntity(t){!this.emitter||(this.emitter.updateForceFieldParameters(t),this.stop(),this.start())}start(t=0){var i;if(this.currentLoopTime=0,t){this.timeoutId=window.setTimeout(()=>{this.start(0)},t);return}this.started=!0,this.stopped=!1,this.isFrozen=!1,(i=this.emitter)==null||i.startEmitting(this.actualTime/1e3)}froze(){this.isFrozen=!0}unFroze(){this.isFrozen=!1}stop(){var t;this.stopped=!0,this.currentLoopTime=0,(t=this.emitter)==null||t.stopEmitting(),clearTimeout(this.timeoutId)}reset(){var t;this.started=!1,this.stopped=!1,(t=this.emitter)==null||t.reset()}wakeUp(){this.isIdle=!1}sleep(){this.isIdle=!0,this.reset()}};function UNe(){try{let t=window.location.href;if(t.includes("reducesubdiv=")){let i=t.indexOf("reducesubdiv=")+13;return parseInt(t.slice(i,i+1))}}catch{}}var n2=UNe();function FNe(t,i,r){var a;n2!==void 0&&(((a=i==null?void 0:i.geometry)==null?void 0:a.subdivisions)??0)>n2&&(console.log("reducing subdivisions",i.name,i.geometry.subdivisions),i.geometry.subdivisions=n2);let n;return i.geometry.type==="TextGeometry"?new AU(t,i,r):i.geometry.type==="InputGeometry"?new EU(t,i,r):(i.geometry.type==="SubdivGeometry"?n=new Yy(t,i,r):i.geometry.type==="PathGeometry"?n=new yU(t,i,r):i.geometry.type==="VectorGeometry"?n=new ANe(t,i,r):i.geometry.type==="BooleanGeometry"?n=new pp(t,i,r):i.geometry.type==="UIGeometry"?n=new ls(t,i,r):n=new ds(t,i,r),n)}function bU(t,i,r){return console.assert(i.type!==void 0),i.type==="Mesh"?FNe(t,i,r):i.type==="Empty"?new kg(t,i):i.type==="Particle"?new NS(t,i,r):i.type==="ParticleCollider"?new LS(t,i,r):i.type==="Splat"?new kg(t,i):i.type==="Bone"?new fNe(t,i):i.type==="Page"?new fa(t,i,r):i.type==="PointLight"?new dNe(t,i,r):i.type==="SpotLight"?new nq(t,i,r):i.type==="DirectionalLight"?new rq(t,i,r):i.type==="Component"||i.type==="Instance"?new Hg(t,i,r):Ap.is(i.type)?new ms(t,i):(console.error(i),new kg(t,i))}sA.createEntity=bU;
11800function kNe(t,i,r){let n=bU(t.identity,i,r),a=t.children,s=t.attachedPaths,o=t.parent,l=t.component,c=t.instances,h=t.overrideData,u=t.uuid,d=t.stateSelection;t.dispose();for(let A of Object.keys(t))delete t[A];Object.setPrototypeOf(t,Object.getPrototypeOf(n));for(let A of Object.keys(n))t[A]=n[A];t.children=[...t.children,...a],t.attachedPaths=s,t.parent=o,t.component=l,t.instances=c,t.uuid=u,t.overrideData=h,t.updateState(t.data,r),d&&t.changeSelectedState(d,r),t.resetBBoxNeedsUpdate()}sA.changeEntityProptotype=kNe;sA.Cloner=sc;function HNe(t,i,r,n){t.updateByOp(i,r,n,!1)}function gV(t,i){let r=!1,n=i.getLayersOfType("transmission"),a=i.getLayersOfType("outline");return a.length>0&&(t.layers.set(8),n.length>0&&t.layers.enable(3),r=!0,dU(t),uU(t)),n.length===0&&a.length===0&&t.layers.set(0),t instanceof K0&&t.needsAO&&t.layers.enable(5),r}function vV(t,i){if(!i.layers)return!1;let r=!1,n=i.getLayersOfType("transmission").filter(s=>s.data.visible),a=i.getLayersOfType("outline").filter(s=>s.data.visible);return n.length>0&&(t.layers.set(3),a.length>0&&t.layers.enable(8),r=!0),n.length===0&&a.length===0&&t.layers.set(0),t.needsAO&&t.layers.enable(5),r}function GNe(t){let i=!1;return t.traverseEntity(r=>{if(r instanceof K0)if(Array.isArray(r.material))for(let n=0;n<r.material.length;n++)gV(r,r.material[n])&&(i=!0);else gV(r,r.material)&&(i=!0)}),i}function zNe(t){let i=!1;return t.traverseEntity(r=>{if(r instanceof K0)if(Array.isArray(r.material))for(let n=0;n<r.material.length;n++)vV(r,r.material[n])&&(i=!0);else vV(r,r.material)&&(i=!0)}),i}var QNe=new nY,VNe=new ht,WNe=new L0;function QL(t,i,r,n=!1){let a=t.cloner;if(a)for(let s of a.children){let o=VNe.copy(s.matrixWorld).invert(),l=WNe.copy(i.ray).applyMatrix4(o),c=t.matrixWorld;l.applyMatrix4(c);let h=QNe;h.set(l.origin,l.direction),h.near=i.near,h.far=i.far;let u=h.intersectObject(t,!1);u.length>0&&r.push({...u[0],object:n?s:t})}}var jNe=class{constructor(){this._constraints=new Map}setConstraint(t,i){i===null?this._constraints.delete(t):this._constraints.set(t,i)}removeDependencies(t){this._constraints.delete(t)}applyConstraints(t){let i=new Set;this._constraints.forEach((r,n)=>{let a=[n,r],s=r;for(;this._constraints.has(s);){if(s=this._constraints.get(s),a.includes(s)){console.warn(`circular dependency detected: ${a.join(" -> ")}`);break}i.has(s)||a.push(s)}for(let o=a.length-2;o>=0;o--)if(!i.has(a[o])){let l=t.find(a[o]);l?l.applyPathSnapping(t):console.warn(`missing entity ${a[o]}`),i.add(a[o])}})}findDependency(t,i){let r=t;for(;this._constraints.has(r);)if(r=this._constraints.get(r),r===i)return!0;return!1}},YNe="AGFzbQEAAAAADwhkeWxpbmsuMAEEAAAAAAETA2AAAGAIf39/f39/f38AYAABfwISAQNlbnYGbWVtb3J5AgMAgIAEAwQDAAECBzkDEV9fd2FzbV9jYWxsX2N0b3JzAAALc29ydEluZGV4ZXMAARNlbXNjcmlwdGVuX3Rsc19pbml0AAIK3gMDAwABC9IDAwF/BnwBfgJAIAdFDQAgAysDUCEMIAMrAzAhDSADKwMQIQ5BACEDRP///////+9/IQtEAAAAAAAAEAAhCgNAIAIgA0ECdGoCfyAOIAEgA0EMbGoiCCoCALuiIA0gCCoCBLuioCAMIAgqAgi7oqBEAAAAAAAAsECiIgmZRAAAAAAAAOBBYwRAIAmqDAELQYCAgIB4CzYCACAJIAsgCSALYxshCyAJIAogCSAKZBshCiADQQFqIgMgB0cNAAsgB0UNACAGuCAKIAuhoyEJQQAhAwNAAn8gCSACIANBAnRqIgEoAgC3IAuhoiIKmUQAAAAAAADgQWMEQCAKqgwBC0GAgICAeAshCCABIAg2AgAgBCAIQQJ0aiIBIAEoAgBBAWo2AgAgA0EBaiIDIAdHDQALCyAGQQJPBEAgBCgCACEIQQEhAwNAIAQgA0ECdGoiASABKAIAIAhqIgg2AgAgA0EBaiIDIAZHDQALCyAHQQFrIgGtIQ8DQCAEIAIgD6dBAnQiA2ooAgBBAnRqIgcgBygCAEEBayIHNgIAIAUgASAHa0ECdGogACADaigCADYCACAPUCEDIA9CAX0hDyADRQ0ACyAGBEAgBEEAIAZBAnT8CwALCwQAQQAL",lA=class{};g_(lA,"DepthMapRange",65536),g_(lA,"MemoryPageSize",65536),g_(lA,"BytesPerFloat",4),g_(lA,"BytesPerInt",4);function KNe(t){let i,r,n,a,s,o,l,c,h,u,d,A,f,m,g,p;function v(x){let R=new Float64Array(u,o,16);for(let I=0;I<16;I++)R[I]=x[I];let L;if(n>
118001){i.exports.sortIndexes(a,s,h,o,l,c,A.DepthMapRange,n);let I=new Uint32Array(n);L=I.buffer,I.set(new Uint32Array(u,c,n))}else if(n===1){let I=new Uint32Array(n);I[0]=new Uint32Array(u,a,r)[0],L=I.buffer}else L=new ArrayBuffer(0);t.postMessage({sortDone:!0,indexesBuffer:L},[L])}function _(x,R,L){let I=new Float32Array(u,s,r*3);n=0;let F=new Uint32Array(u,a,r);for(let Y=0;Y<L.length-1;Y++){let D=R[Y],U=x[Y].elements,j=D.filter(z=>z.enabled&&z.mode==="Include").map(z=>z.type==="Box"?E(z):T(z)),J=D.filter(z=>z.enabled&&z.mode==="Exclude").map(z=>z.type==="Box"?E(z):T(z));for(let z=L[Y];z<L[Y+1];z++){let $=f[z*3],te=f[z*3+1],ae=f[z*3+2];if((j.length===0||w($,te,ae,j))&&(J.length===0||!w($,te,ae,J))){let ve=1/(U[3]*$+U[7]*te+U[11]*ae+U[15]);I[n*3]=(U[0]*$+U[4]*te+U[8]*ae+U[12])*ve,I[n*3+1]=(U[1]*$+U[5]*te+U[9]*ae+U[13])*ve,I[n*3+2]=(U[2]*$+U[6]*te+U[10]*ae+U[14])*ve,F[n]=z,n++}}}}function y(x,R){let L=[],I=R.filter(D=>D.enabled&&D.mode==="Include").map(D=>D.type==="Box"?E(D):T(D)),F=R.filter(D=>D.enabled&&D.mode==="Exclude").map(D=>D.type==="Box"?E(D):T(D)),Y=x.length;for(let D=0;D<Y;D+=3){let U=x[D],j=x[D+1],J=x[D+2];(I.length===0||w(U,j,J,I))&&(F.length===0||!w(U,j,J,F))||L.push(D/3)}return L}function w(x,R,L,I,F){return I[F==="Intersect"?"every":"some"](Y=>{let D=b(x,R,L,Y.invRotationMatrix,Y.cropCenter);return Array.isArray(Y)?S(D.x,D.y,D.z,Y):C(D.x,D.y,D.z,Y)})}function b(x,R,L,I,F){let Y=x-F[0],D=R-F[1],U=L-F[2],j=1/(I[3]*Y+I[7]*D+I[11]*U+I[15]);return{x:(I[0]*Y+I[4]*D+I[8]*U+I[12])*j+F[0],y:(I[1]*Y+I[5]*D+I[9]*U+I[13])*j+F[1],z:(I[2]*Y+I[6]*D+I[10]*U+I[14])*j+F[2]}}function E(x){let R=x.cropSize[0]/2,L=x.cropSize[1]/2,I=x.cropSize[2]/2,F=[x.cropCenter[0]-R,x.cropCenter[1]-L,x.cropCenter[2]-I,x.cropCenter[0]+R,x.cropCenter[1]+L,x.cropCenter[2]+I],Y=M(x.cropRotation);return Object.assign(F,{invRotationMatrix:Y,cropCenter:x.cropCenter})}function M(x){let R=[],L=x[0]*Math.PI/180,I=x[1]*Math.PI/180,F=x[2]*Math.PI/180,Y=Math.cos(L),D=Math.sin(L),U=Math.cos(I),j=Math.sin(I),J=Math.cos(F),z=Math.sin(F),$=Y*J,te=Y*z,ae=D*J,ve=D*z;return R[0]=U*J,R[1]=-U*z,R[2]=j,R[4]=te+ae*j,R[5]=$-ve*j,R[6]=-D*U,R[8]=ve-$*j,R[9]=ae+te*j,R[10]=Y*U,R[12]=0,R[13]=0,R[14]=0,R[3]=0,R[7]=0,R[11]=0,R[15]=1,R}function S(x,R,L,I){return x>=I[0]&&x<=I[3]&&R>=I[1]&&R<=I[4]&&L>=I[2]&&L<=I[5]}function T(x){let R=2/x.cropSize[0],L=2/x.cropSize[1],I=2/x.cropSize[2],F=M(x.cropRotation);return{invRadiusX:R,invRadiusY:L,invRadiusZ:I,cropCenter:x.cropCenter,invRotationMatrix:F}}function C(x,R,L,I){let F=(x-I.cropCenter[0])*I.invRadiusX,Y=(R-I.cropCenter[1])*I.invRadiusY,D=(L-I.cropCenter[2])*I.invRadiusZ;return F*F+Y*Y+D*D<=1}t.onmessage=x=>{if(x.data.getCroppedIndexes){let R=new Uint32Array(y(new Float32Array(x.data.positions),x.data.crops)).buffer;t.postMessage({outOfBoundsIndexes:R},[R])}else if(x.data.positions)d=x.data.positions,f=new Float32Array(d),g=x.data.meshMatrixWorlds,p=x.data.cropsArray,m=x.data.meshIndexIntervals,_(g,p,m),t.postMessage({sortSetupComplete:!0});else if(x.data.sort||x.data.newMatrixWorlds||x.data.newCropsArray)(x.data.newMatrixWorlds||x.data.newCropsArray)&&(p=x.data.newCropsArray||p,g=x.data.newMatrixWorlds||g,_(g,p,m)),v(x.data.sort.view,x.data.sort.cameraPosition);else if(x.data.init){A=x.data.init.Constants,r=x.data.init.splatCount;let R=A.BytesPerInt,L=A.BytesPerFloat*3,I=new Uint8Array(x.data.init.sorterWasmBytes),F=R+L,Y=r*F,D=r*A.BytesPerInt*2+A.DepthMapRange*A.BytesPerInt*2,U=A.MemoryPageSize*32,j=Y+D+U,J=Math.floor(j/A.MemoryPageSize)+1,z={module:{},env:{memory:new WebAssembly.Memory({initial:J*2,maximum:J*3,shared:!0})}};WebAssembly.compile(I).then($=>WebAssembly.instantiate($,z)).then($=>{i=$,a=0,s=r*R,o=s+r*L,h=o+16*A.BytesPerFloat*2,l=h+r*A.BytesPerInt,c=l+A.DepthMapRange*A.BytesPerInt,u=z.env.memory.buffer,t.postMessage({sortSetupPhase1Complete:!0})})}}}function XNe(t){let i=new Worker(URL.createObjectURL(new Blob(["(",KNe.toString(),")(self)"],{type:"application/javascript"}))),r=atob(YNe),n=new Uint8Array(r.length);for(let a=0;a<r.length;a++)n[a]=r.charCodeAt(a);return i.postMessage({init:{sorterWasmBytes:n.buffer,splatCount:t,Constants:{BytesPerFloat:lA.BytesPerFloat,BytesPerInt:lA.BytesPerInt,DepthMapRange:lA.DepthMapRange,MemoryPageSize:lA.MemoryPageSize}}}),i}var a2=function(){let t=new Float32Array(1),i=new Int32Array(t.buffer);return function(r){return t[0]=r,i[0]}}(),qNe=function(t,i,r,n){return t+(i<<8)+(r<<16)+(n<<24)},Xb=new Me;function _V(t){let i=!1;return t.scene.objects.traverse((r,n)=>{if(n.visible===!1)return!0;n.type==="Splat"&&(i=!0)}),i}var US=class extends Zr{constructor(t,i,r,n,a=!1,s=1,o,l){super(r,n),this.splatCount=i,this.meshIndexIntervals=o,this.meshMatrixWorlds=l,this.splatBuffers=t,this.geometry=r,this.material=n,this.splatDataTextures=null,this.halfPrecisionCovariancesOnGPU=a,this.devicePixelRatio=s,this.resetLocalSplatDataAndTexturesFromSplatBuffer()}static buildMesh(t,i,r=!1,n=1,a,s){let o=US.buildGeomtery(i),l=US.buildMaterial(a);return new US(t,i,o,l,r,n,a,s)}static buildMaterial(t){let i=` 11801 precision highp float; 11802 #include <common> 11803 11804 attribute uint splatIndex; 11805 11806 uniform highp sampler2D covariancesTexture; 11807 uniform highp usampler2D centersColorsTexture; 11808 uniform vec2 focal; 11809 uniform vec2 viewport; 11810 uniform vec2 basisViewport; 11811 uniform vec2 covariancesTextureSize; 11812 uniform vec2 centersColorsTextureSize; 11813 uniform highp sampler2D meshMatrixWorldsTexture; 11814 uniform uint meshIndexIntervals[257]; 11815 uniform float orthoZoom; 11816 11817 varying vec4 vColor; 11818 varying vec2 vUv; 11819 11820 varying vec2 vPosition; 11821 11822 const vec4 encodeNorm4 = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0); 11823 const uvec4 mask4 = uvec4(uint(0x000000FF), uint(0x0000FF00), uint(0x00FF0000), uint(0xFF000000)); 11824 const uvec4 shift4 = uvec4(0, 8, 16, 24); 11825 vec4 uintToRGBAVec (uint u) { 11826 uvec4 urgba = mask4 & u; 11827 urgba = urgba >> shift4; 11828 vec4 rgba = vec4(urgba) * encodeNorm4; 11829 return rgba; 11830 } 11831 11832 vec2 getDataUV(in int stride, in int offset, in vec2 dimensions) { 11833 vec2 samplerUV = vec2(0.0, 0.0); 11834 float d = float(splatIndex * uint(stride) + uint(
11834offset)) / dimensions.x; 11835 samplerUV.y = float(floor(d)) / dimensions.y; 11836 samplerUV.x = fract(d); 11837 return samplerUV; 11838 } 11839 11840 void main () { 11841 uvec4 sampledCenterColor = texture(centersColorsTexture, getDataUV(1, 0, centersColorsTextureSize)); 11842 vec3 splatCenter = uintBitsToFloat(uvec3(sampledCenterColor.gba)); 11843 vColor = uintToRGBAVec(sampledCenterColor.r); 11844 11845 vPosition = position.xy * 2.0; 11846 11847 uint meshIndex; 11848 for (int i = 1; i < 257; i++) { 11849 if (splatIndex < meshIndexIntervals[i]) { 11850 meshIndex = uint(i - 1); 11851 break; 11852 } 11853 } 11854 11855 float strideMulmeshIndex = float(4u*meshIndex); 11856 float meshMatrixWorldsTextureLength = float(256*4); 11857 11858 mat4 modelMat = mat4( 11859 texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+0.0)/meshMatrixWorldsTextureLength, 0)), 11860 texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+1.0)/meshMatrixWorldsTextureLength, 0)), 11861 texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+2.0)/meshMatrixWorldsTextureLength, 0)), 11862 texture(meshMatrixWorldsTexture, vec2((strideMulmeshIndex+3.0)/meshMatrixWorldsTextureLength, 0)) 11863 ); 11864 mat4 modelViewMat = viewMatrix * modelMat; 11865 vec4 viewCenter = modelViewMat * vec4(splatCenter, 1.0); 11866 vec4 clipCenter = projectionMatrix * viewCenter; 11867 11868 vec2 sampledCovarianceA = texture(covariancesTexture, getDataUV(3, 0, covariancesTextureSize)).rg; 11869 vec2 sampledCovarianceB = texture(covariancesTexture, getDataUV(3, 1, covariancesTextureSize)).rg; 11870 vec2 sampledCovarianceC = texture(covariancesTexture, getDataUV(3, 2, covariancesTextureSize)).rg; 11871 11872 vec3 cov3D_M11_M12_M13 = vec3(sampledCovarianceA.rg, sampledCovarianceB.r); 11873 vec3 cov3D_M22_M23_M33 = vec3(sampledCovarianceB.g, sampledCovarianceC.rg); 11874 11875 // Compute the 2D covariance matrix from the upper-right portion of the 3D covariance matrix 11876 mat3 Vrk = mat3( 11877 cov3D_M11_M12_M13.x, cov3D_M11_M12_M13.y, cov3D_M11_M12_M13.z, 11878 cov3D_M11_M12_M13.y, cov3D_M22_M23_M33.x, cov3D_M22_M23_M33.y, 11879 cov3D_M11_M12_M13.z, cov3D_M22_M23_M33.y, cov3D_M22_M23_M33.z 11880 ); 11881 float s = 1.0 / (viewCenter.z * viewCenter.z); 11882 11883 mat3 W = transpose(mat3(modelViewMat)); 11884 mat3 T = orthoZoom > 0.0 ? W : W * mat3( 11885 focal.x / viewCenter.z, 0., -(focal.x * viewCenter.x) * s, 11886 0., focal.y / viewCenter.z, -(focal.y * viewCenter.y) * s, 11887 0., 0., 0. 11888 ); 11889 mat3 cov2Dm = transpose(T) * Vrk * T; 11890 cov2Dm[0][0] += 0.3; 11891 cov2Dm[1][1] += 0.3; 11892 11893 // We are interested in the upper-left 2x2 portion of the projected 3D covariance matrix because 11894 // we only care about the X and Y values. We want the X-diagonal, cov2Dm[0][0], 11895 // the Y-diagonal, cov2Dm[1][1], and the correlation between the two cov2Dm[0][1]. We don't 11896 // need cov2Dm[1][0] because it is a symetric matrix. 11897 vec3 cov2Dv = vec3(cov2Dm[0][0], cov2Dm[0][1], cov2Dm[1][1]); 11898 11899 vec3 ndcCenter = clipCenter.xyz / clipCenter.w; 11900 11901 // We now need to solve for the eigen-values and eigen vectors of the 2D covariance matrix 11902 // so that we can determine the 2D basis for the splat. This is done using the method described 11903 // here: https://people.math.harvard.edu/~knill/teaching/math21b2004/exhibits/2dmatrices/index.html 11904 // 11905 // This is a different approach than in the original work at INRIA. In that work they compute the 11906 // max extents of the 2D covariance matrix in screen space to form an axis aligned bounding rectangle 11907 // which forms the geometry that is actually rasterized. They then use the inverse 2D covariance 11908 // matrix (called 'conic') to determine fragment opacity. 11909 float a = cov2Dv.x; 11910 float d = cov2Dv.z;
11911 float b = cov2Dv.y; 11912 float D = a * d - b * b; 11913 float trace = a + d; 11914 float traceOver2 = 0.5 * trace; 11915 float term2 = sqrt(trace * trace / 4.0 - D); 11916 float eigenValue1 = traceOver2 + term2; 11917 float eigenValue2 = max(traceOver2 - term2, 0.00); // prevent negative eigen value 11918 11919 const float maxSplatSize = 1024.0; 11920 vec2 eigenVector1 = normalize(vec2(b, eigenValue1 - a)); 11921 // since the eigen vectors are orthogonal, we derive the second one from the first 11922 vec2 eigenVector2 = vec2(eigenVector1.y, -eigenVector1.x); 11923 vec2 basisVector1 = eigenVector1 * min(sqrt(2.0 * eigenValue1), maxSplatSize); 11924 vec2 basisVector2 = eigenVector2 * min(sqrt(2.0 * eigenValue2), maxSplatSize); 11925 11926 vec2 ndcOffset = vec2(vPosition.x * basisVector1 + vPosition.y * basisVector2) * basisViewport; 11927 11928 if (orthoZoom > 0.0) { 11929 ndcOffset *= orthoZoom; 11930 } 11931 11932 gl_Position = vec4(ndcCenter.xy + ndcOffset, ndcCenter.z, 1.0); 11933 }`,r=` 11934 precision highp float; 11935 #include <common> 11936 11937 uniform vec3 debugColor; 11938 11939 varying vec4 vColor; 11940 varying vec2 vUv; 11941 11942 varying vec2 vPosition; 11943 layout(location = 1) out vec4 gVelocity; 11944 11945 void main () { 11946 // compute the negative squared distance from the center of the splat to the 11947 // current fragment in the splat's local space. 11948 float A = -dot(vPosition, vPosition); 11949 if (A < -4.0) discard; 11950 vec3 color = vColor.rgb; 11951 A = exp(A) * vColor.a; 11952 gl_FragColor = vec4(color.rgb, A); 11953 gVelocity = vec4(0.0); // so it is ignored by TAA 11954 }`,n={covariancesTexture:{type:"t",value:null},centersColorsTexture:{type:"t",value:null},meshIndexIntervals:{value:t},meshMatrixWorldsTexture:{type:"t",value:null},focal:{type:"v2",value:new Me},viewport:{type:"v2",value:new Me},basisViewport:{type:"v2",value:new Me},debugColor:{type:"v3",value:new Ht},covariancesTextureSize:{type:"v2",value:new Me(1024,1024)},centersColorsTextureSize:{type:"v2",value:new Me(1024,1024)},orthoZoom:{type:"f",value:-1}};return new Xi({uniforms:n,vertexShader:i,fragmentShader:r,transparent:!0,alphaTest:1,blending:Jf,depthTest:!0,depthWrite:!1,side:hs})}static buildGeomtery(t){let i=new Lt;i.setIndex([0,1,2,0,2,3]);let r=new Float32Array(4*3),n=new ei(r,3);i.setAttribute("position",n),n.setXYZ(0,-1,-1,0),n.setXYZ(1,-1,1,0),n.setXYZ(2,1,1,0),n.setXYZ(3,1,-1,0),n.needsUpdate=!0;let a=new iY().copy(i),s=new Uint32Array(t),o=new xy(s,1,!1);return o.setUsage(Zfe),a.setAttribute("splatIndex",o),a.instanceCount=t,a}
vendor: 5,678 bytes, line 11954
11954resetLocalSplatDataAndTexturesFromSplatBuffer(){this.updateLocalSplatDataFromSplatBuffer(),this.allocateAndStoreLocalSplatDataInTextures()}updateLocalSplatDataFromSplatBuffer(){this.splatBuffers.forEach(n=>n.buildPreComputedBuffers()),this.covariances=new Float32Array(this.splatCount*6),this.colors=new Uint8Array(this.splatCount*4),this.centers=new Float32Array(this.splatCount*3);let t=0,i=0,r=0;for(let n of this.splatBuffers){let a=n.nsplats;this.colors.subarray(t,t+a*4).set(n.colorsA),t+=a*4,this.centers.subarray(i,i+a*3).set(n.decoded.xyz.denormDequant().data),i+=a*3,this.covariances.subarray(r,r+a*6).set(new Float32Array(n.precomputedCovarianceBufferData)),r+=a*6}}allocateAndStoreLocalSplatDataInTextures(){let t=this.splatCount,i=new Me(4096,1024);for(;i.x*i.y*2<t*6;)i.y*=2;let r=new Me(4096,1024);for(;r.x*r.y*4<t*4;)r.y*=2;let n,a;if(this.halfPrecisionCovariancesOnGPU){a=new Uint16Array(i.x*i.y*2);for(let u=0;u<this.covariances.length;u++)a[u]=Mye.toHalfFloat(this.covariances[u]);n=new ul(a,i.x,i.y,EC,Hu)}else a=new Float32Array(i.x*i.y*2),a.set(this.covariances),n=new ul(a,i.x,i.y,EC,On);n.needsUpdate=!0,this.material.uniforms.covariancesTexture.value=n,this.material.uniforms.covariancesTextureSize.value.copy(i);let s=new Uint32Array(r.x*r.y*4);for(let u=0;u<t;u++){let d=u*4,A=u*3,f=u*4;s[f]=qNe(this.colors[d],this.colors[d+1],this.colors[d+2],this.colors[d+3]),s[f+1]=a2(this.centers[A]),s[f+2]=a2(this.centers[A+1]),s[f+3]=a2(this.centers[A+2])}let o=new ul(s,r.x,r.y,_7,Su);o.internalFormat="RGBA32UI",o.needsUpdate=!0,this.material.uniforms.centersColorsTexture.value=o,this.material.uniforms.centersColorsTextureSize.value.copy(r);let l=256*4,c=new Float32Array(256*16);for(let u=0;u<this.meshMatrixWorlds.length;u++)c.set(this.meshMatrixWorlds[u].elements,u*16);let h=new ul(c,l,1,_a,On);h.needsUpdate=!0,this.material.uniforms.meshMatrixWorldsTexture.value=h,this.material.uniformsNeedUpdate=!0,this.splatDataTextures={covariances:{data:a,texture:n,size:i},centerColors:{data:s,texture:o,size:r},meshMatrixWorlds:{data:c,texture:h}}}updateIndexes(t){let i=this.geometry;i.attributes.splatIndex.set(t),i.attributes.splatIndex.needsUpdate=!0,i.instanceCount=t.length}updateUniforms(t,i,r,n){this.splatCount>0&&(Xb.set(t.x*this.devicePixelRatio,t.y*this.devicePixelRatio),this.material.uniforms.viewport.value.copy(Xb),this.material.uniforms.basisViewport.value.set(2/Xb.x,2/Xb.y),this.material.uniforms.focal.value.set(i,r),this.material.uniforms.orthoZoom.value=n,this.material.uniformsNeedUpdate=!0)}getSplatDataTextures(){return this.splatDataTextures}getSplatCount(){return this.splatCount}getCenters(){return this.centers}getColors(){return this.colors}getCovariances(){return this.covariances}dispose(){this.geometry.dispose(),this.material.dispose(),this.splatDataTextures&&(this.splatDataTextures.covariances.texture.dispose(),this.splatDataTextures.centerColors.texture.dispose(),this.splatDataTextures.meshMatrixWorlds.texture.dispose()),this.removeFromParent()}},mq,ZNe=new Promise(t=>{mq=t}),yV=!1,qb;function JNe(){if(yV)return;if(qb)return qb;async function t(){let i=await VA(()=>import("./gaussian-splat-compression-f68e3207.js"),[],import.meta.url);mq(i),yV=!0}return qb=t(),qb}var gq;ZNe.then(t=>gq=t);var $Ne=class{constructor(t={}){g_(this,"updateView",function(){let i=new ht,r=[],n=new O(0,0,-1),a=new O(0,0,-1),s=new O,o=new O;return function(l=!1,c){let h=this.updateMatrixWorldsInWorkerIfNeeded(),u=this.cropsChanged();if(!l){a.set(0,0,-1).applyQuaternion(c.quaternion);let A=!1,f=!1;if(a.dot(n)<=.95&&(A=!0),o.copy(c.position).sub(s).length()>=1&&(f=!0),!A&&!f&&!h&&!u&&!this.needsInitialRender)return}this.needsInitialRender=!1,s.copy(c.position),n.copy(a),i.copy(c.matrixWorld).invert(),i.premultiply(this.dummyPerspectiveMatrix),r[0]=c.position.x,r[1]=c.position.y,r[2]=c.position.z;let d={sort:{view:i.elements,cameraPosition:r,splatRenderCount:this.splatRenderCount,splatSortCount:this.splatRenderCount},...h?{newMatrixWorlds:this.meshMatrixWorlds}:{},...u?{newCropsArray:this.cropsArray}:{}};this.sortRunning?this.queuedMessage=d:(this.queuedMessage=null,this.sortRunning=!0,this.sortWorker.postMessage(d))}}()),this.scene=t.scene,this.currentPage=null,this.devicePixelRatio=window.devicePixelRatio,this.sortWorker=null,this.splatRenderCount=0,this.splatSortCount=0,this.splatMesh=null,this.sortRunning=!1,this.meshMatrixWorlds=null,this.meshMatrixWorldsOld=null,this.cropsArray=null,this.splatEntries=null,this.queuedMessage=null,this.needsInitialRender=!0,this.dummyPerspectiveMatrix=new ht().makePerspective(-1,1,-1,1,.1,1e3)}updateSplatMeshUniforms(t,i){let r=new Me;this.splatMesh!==null&&this.splatMesh.getSplatCount()>0&&(t.getSize(r),this.cameraFocalLengthX=i.projectionMatrix.elements[0]*this.devicePixelRatio*r.x*.45,this.cameraFocalLengthY=i.projectionMatrix.elements[5]*this.devicePixelRatio*r.y*.45,this.splatMesh.updateUniforms(r,this.cameraFocalLengthX,this.cameraFocalLengthY,i.isPerspectiveCamera?-1:i.zoom*this.devicePixelRatio))}loadSplat(t={}){this.activePage=this.scene.activePage,t.position&&(t.position=new O().fromArray(t.position)),t.orientation&&(t.orientation=new ri().fromArray(t.orientation)),t.halfPrecisionCovariances=!!t.halfPrecisionCovariances;let i=[];if(this.splatEntries=i,this.activePage.traverseVisibleEntity(s=>{s.data.type==="Splat"&&i.push(s)}),this.splatMesh&&this.splatMesh.dispose(),i.length===0)return this.splatMesh=null,!1;this.meshMatrixWorlds=i.map(s=>s.matrixWorld),this.meshMatrixWorldsOld=i.map(s=>s.matrixWorld.clone()),this.cropsArray=i.map(s=>s.data.crops.map(o=>o.data));let r=i.map(s=>new gq.GSplineBuffer(new Uint8Array(s.data.buffer).buffer)),n=0,a=[0];
11954for(let s of r)n+=s.getSplatCount(),a.push(n);return this.setupSplatMesh(r,n,t.position,t.orientation,t.halfPrecisionCovariances,this.devicePixelRatio,a,this.meshMatrixWorlds),this.setupSortWorker(n),!0}updateMatrixWorldsInWorkerIfNeeded(){let t=this.splatDataTextures.meshMatrixWorlds.data;for(let i=0;i<this.meshMatrixWorlds.length;i++)t.set(this.meshMatrixWorlds[i].elements,i*16);return this.splatDataTextures.meshMatrixWorlds.texture.needsUpdate=!0,this.meshMatrixWorlds.every((i,r)=>i.equals(this.meshMatrixWorldsOld[r]))?!1:(this.meshMatrixWorldsOld=this.meshMatrixWorlds.map(i=>i.clone()),!0)}cropsChanged(){let t=!1;return this.splatEntries.forEach((i,r)=>{var n;i.data.crops.forEach((a,s)=>{this.cropsArray[r][s]===void 0?(t=!0,this.cropsArray[r][s]=a.data):Object.entries(a.data).forEach(([o,l])=>{var c;Array.isArray(l)&&l.some((h,u)=>h!==this.cropsArray[r][s][o][u])?(t=!0,this.cropsArray[r][s][o]=l):l!==((c=this.cropsArray[r][s])==null?void 0:c[o])&&(t=!0,this.cropsArray[r][s][o]=l)})}),i.data.crops.length!==((n=this.cropsArray[r])==null?void 0:n.length)&&(this.cropsArray[r].length=i.data.crops.length,t=!0)}),t}setupSplatMesh(t,i,r=new O,n=new ri,a=!1,s=1,o,l){this.splatMesh=US.buildMesh(t,i,a,s,o,l),this.splatMesh.position.copy(r),this.splatMesh.quaternion.copy(n),this.splatMesh.frustumCulled=!1,this.splatMesh.renderOrder=99999,this.splatRenderCount=i,this.splatMesh.onBeforeRender=(c,h,u)=>this.update(c,u)}setupSortWorker(t){this.sortWorker=XNe(t),this.sortWorker.onmessage=i=>{var r;i.data.sortDone?(this.sortRunning=!1,(r=this.splatMesh)==null||r.updateIndexes(new Uint32Array(i.data.indexesBuffer)),this.lastSortTime=i.data.sortTime,this.queuedMessage&&(this.sortWorker.postMessage(this.queuedMessage),this.queuedMessage=null)):i.data.sortCanceled?this.sortRunning=!1:i.data.sortSetupPhase1Complete?this.sortWorker.postMessage({positions:this.splatMesh.getCenters().buffer,meshMatrixWorlds:this.splatMesh.meshMatrixWorlds,meshIndexIntervals:this.splatMesh.meshIndexIntervals,cropsArray:this.cropsArray}):i.data.sortSetupComplete&&(this.splatDataTextures=this.splatMesh.getSplatDataTextures(),this.scene.activePage.add(this.splatMesh),this.needsInitialRender=!0)}}update(t,i){this.splatMesh!==null&&(this.updateSplatMeshUniforms(t,i),this.updateView(!1,i))}getSplatMesh(){return this.splatMesh}},VL=new Gu;VL.wireframe=!0;var EV=new O,SU=class extends ch{constructor(t,i){super(),this.data=t,this.sharedAssets=i,this.enableHelpers=!1,this.wireframeState=!1,this.needsTransmissionDirty=!0,this.needsNormalDirty=!0,this._needsTransmission=!1,this._needsNormal=!1,this.geometryCacheChanged=!1,this.splatViewer=null,this.entityByUuid={},this.entityIdentityToEntity={},this.toExpandCloner=new Set,this.toUpdateCloner=new Set,this.pendingCommands=[],this.pathConstraints=new jNe,this.invisibleObjects=new kg("jflkdsafjasdifjaslk",{...ZP.defaultData,visible:!1,name:"buildin invisible"}),this.needsRecomputeInstances=!1,this.init(t,i),this.matrixAutoUpdate=!1,this.errorPage=new fa("fdasfa",{...m0.defaultData,name:""},{shared:i,scene:this})}markGeometryCacheDirty(){this.geometryCacheChanged=!0}markNeedsUpdateRendererDirty(){this.needsTransmissionDirty=!0,this.needsNormalDirty=!0}needsTransmission(){return this.needsTransmissionDirty&&(this._needsTransmission=zNe(this),this.needsTransmissionDirty=!1),this._needsTransmission}needsNormal(){return this.needsNormalDirty&&(this._needsNormal=GNe(this),this.needsNormalDirty=!1),this._needsNormal}registerInstanceAndSetUuid(t){let i=t.identity.join("-"),r=this.entityIdentityToEntity[i];r&&(t.uuid=r.uuid),this.entityIdentityToEntity[i]=t,this.entityByUuid[t.uuid]=t}markPenumbraSizeDirty(){for(let t of this.children)t instanceof fa&&(t.penumbraSizeArrayCache=null)}findInstance(t){return this.entityIdentityToEntity[t.join("-")]}get bgColor(){return this.activePage.bgColor}get postprocessing(){return this.activePage.data.postprocessing}getWithSortKey(t){let i=this.find(t);if(i===void 0)return;let r=[],n=i;for(;n!==this;){let a=n;n=n.parent;let s=n.children.indexOf(a);r.splice(0,0,s)}return{entity:i,sortKey:r}}getAllSorted(t){let i=[];for(let r of t){let n=this.getWithSortKey(r.id);n!==void 0&&i.push(n)}return i.sort((r,n)=>WY(r.sortKey,n.sortKey)),i.map(r=>r.entity)}nonExistOrDescendantOf(t,i){let r=this.find(t);if(r===void 0)return!0;for(;r;){if(r.uuid===i)return!0;r=r.parent}return!1}find(t){if(this.activePage&&this.activePage.personalCamera.parent){if(t==="f23858d0-4a3b-4bd8-8173-66ed0af7f6fb-personalCamera")return this.activePage.personalCamera;if(t===W0)return this.activePage.personalCamera}if(t===""||t===void 0)return;let i=this.entityByUuid[t];return i===void 0?this.getObjectByProperty("uuid",t):i}find2D(t){for(let i of this.children)if(i instanceof fa&&i.uiScene){let r=i.uiScene.find(t);if(r)return r}}findScene2DfromObject2D(t){for(let i of this.children)if(i instanceof fa&&i.uiScene&&i.uiScene.find(t))return i.uiScene}find2DInUIObjects(t){let i;return this.traverseEntity(r=>{i===void 0&&r instanceof ls&&(i=r.uiCanvas.find(t))}),i}traverse2D(t){for(let i of this.children)i instanceof fa&&i.uiScene&&i.uiScene.traverse(t)}debugEnsureEntity(t){let i=this.find(t);if(i){if(Array.isArray(i.identity)&&this.findInstance(i.identity)===void 0){console.error("not found instance");debugger}}else{console.error("not found");debugger}}
11954addPendingExpandCloner(t){this.toExpandCloner.add(t)}addPendingUpdateCloner(t){this.toUpdateCloner.add(t)}markToExpandCloner(t){this.toExpandCloner.add(t),t.traverseEntityAncestors(i=>{this.toExpandCloner.add(i)})}doPendingExpandCloner(){this.toExpandCloner.forEach(t=>{t.expandCloner(this)}),this.toExpandCloner.clear()}doPendingUpdateCloner(){this.toUpdateCloner.forEach(t=>{var i;(i=t.cloner)==null||i.update()}),this.toUpdateCloner.clear()}doPendingUpdates(){this.doPendingExpandCloner(),this.doPendingUpdateCloner(),this.applyPendingCommands()}addPendingCommand(t){this.pendingCommands.push(t)}applyPendingCommands(){this.pendingCommands.forEach(t=>t()),this.pendingCommands.length=0}updateByLibOp(t,i){t.path.length===1&&t.path[0]==="components"&&t.type===1&&this.createChildrenObjects([{...t.data.asset,id:t.id}],this.invisibleObjects,i)}updateTreeByOp(t,i){var r;if(t.path.length===0&&t.type===7){let n=t.parent===null?this:this.find(t.parent);if(n===void 0)throw new Error("unexpected");let a=this.createObject(t.id,t.data,t.children,n,t.localIndex,i);a.updateVisible(this),a.resetBBoxNeedsUpdate(),$l(a)&&xu(a.parent)&&(a.invalidateUpstreamBooleanData(),a.parent.invalidateDownstreamBooleanData().recomputeBoolean()),this.markNeedsRecomputeInstancesForAncessors(n),this.markNeedsRecomputeInstancesForChildren(a),this.markToExpandCloner(a),this.markPenumbraSizeDirty(),a.updatePathSnapping()}else if(t.path.length===0&&t.type===8){let n=this.find(t.id);if(n===void 0)throw new Error("unexpected");this.markToExpandCloner(n),n.resetBBoxNeedsUpdate(),this.unregisterObject(n);let a=n.parent;this.markNeedsRecomputeInstancesForAncessors(a),this.markNeedsRecomputeInstancesForChildren(n),this.markPenumbraSizeDirty(),n.parent.remove(n),xu(n.parent)&&(n.parent.invalidateUpstreamBooleanData(),n.parent.invalidateDownstreamBooleanData().recomputeBoolean()),$l(n)&&(n.freeBooleanPointer(),a instanceof pp&&a.invalidateDownstreamBooleanData().recomputeBoolean()),n instanceof yU&&n.detachShape(),this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(n),this.pathConstraints.removeDependencies(n.uuid),n.updatePathSnapping()}else if(t.path.length===0&&t.type===9){let n=this.find(t.id);if(n===void 0)throw new Error("unexpected");this.markNeedsRecomputeInstancesForChildren(n);let a=n.parent;this.markNeedsRecomputeInstancesForAncessors(a),(r=n.cloner)==null||r.resetOnMove(),this.markToExpandCloner(n);let s=t.parent===null?this:this.find(t.parent);if(s===void 0)throw new Error("unexpected");s.add(n),this.markNeedsRecomputeInstancesForAncessors(s),this.markToExpandCloner(n),n.invalidateClonerTransform(n),n.updateVisible(this),n.resetBBoxNeedsUpdate(),this.markPenumbraSizeDirty();let o=t.localIndex;s.children.splice(o,0,s.children.pop()),$l(n)&&(n.invalidateUpstreamBooleanData(),xu(n.parent)?n.parent.invalidateDownstreamBooleanData().recomputeBoolean():a instanceof pp&&a.invalidateDownstreamBooleanData().recomputeBoolean()),n.updatePathSnapping()}this.markNeedsUpdateRendererDirty(),this.markGeometryCacheDirty()}get playPage(){return this.find(this.data.publish.playPage)??this.errorPage}updatePage(t){var i;this.activePage&&this.activePage.onDeactive(),this.activePage=this.errorPage;for(let r of this.children)r instanceof fa&&(r.visible=r.uuid===t,r.visible&&(this.activePage=r,this.activePage.onActive(this)));this.activePage!==((i=this.splatViewer)==null?void 0:i.activePage)&&this.reloadSplats()}updateEntityByOp(t,i,r,n){if(i.type===0){if(("overrides"in i.props||"component"in i.props)&&this.markNeedsRecomputeInstances(),"visible"in i.props&&this.markPenumbraSizeDirty(),i.path.includes("overrides")&&"states"in i.props){let{rest:s}=i.props;i={...i,props:s},this.markNeedsRecomputeInstances()}i.path[0]==="pathSnapping"&&i.props.pathId!==void 0&&this.pathConstraints.setConstraint(t,i.props.pathId)}let a=this.find(t);if(a)try{HNe(a,i,r,{scene:this,shared:n}),a instanceof ds&&a.updateGeometryGroupsIfNeeded()}catch(s){console.error(s)}}updateEntity2DByOp(t,i,r,n,a,s=[]){t.updateEntityByOp(i,r,n,a),this.traverseEntity(o=>{(o instanceof ls||o instanceof fa)&&(s.includes(o.frameId??"")||o.frameId===i)&&o.updateEntity2DByOp(i,r,n,a)})}get activeCamera(){return this.activePage.activeCamera}switchActiveCamera(t){this.activePage.switchActiveCamera(t)}isInvisibleObjects(t){return t===this.invisibleObjects||t.hasAnccestor(this.invisibleObjects)}init(t,i){let r=Object.entries(i.data.lib.components).map((n,a)=>({data:n[1].asset.data,children:n[1].asset.children,id:n[0],fi:a}));this.invisibleObjects.updateState(this.invisibleObjects.data,{scene:this,shared:i}),this.add(this.invisibleObjects),this.createChildrenObjects(r,this.invisibleObjects,i),this.createChildrenObjects(t.objects,this,i),this.updatePage(t.publish.playPage),this.activePage.switchToPlayCamera(),this.expandInstances(i,!0),this.traverseEntity(n=>{n instanceof ms&&n.updateUp()}),this.doPendingExpandCloner(),this.applyPendingCommands()}markNeedsRecomputeInstances(){this.needsRecomputeInstances=!0}markNeedsRecomputeInstancesForChildren(t){t.traverseEntity(i=>{(i.data.type==="Component"||i.data.type==="Instance")&&this.markNeedsRecomputeInstances()})}markNeedsRecomputeInstancesForAncessors(t){Oi.is(t)&&(t.data.type==="Component"&&this.markNeedsRecomputeInstances(),t.traverseAncestors(i=>{Oi.is(i)&&i.data.type==="Component"&&this.markNeedsRecomputeInstances()}))}relativeizeInner(t,i,r,n,a,s,o){if(t){let l=n.find(t);l&&l!==n&&a.forInstancesRec(c=>{c.data=Uy(c.data,h=>{let u=h.events.data(o.id),d=c.goUp(s);
vendor: 4,110 bytes, line 11954
11954if(d){let A=[...VY(d.identity),t].join("-"),f=this.entityIdentityToEntity[A];if(f){let m=f.uuid,g=Zn.zoom(u,i);g[r]=m}else console.warn("cannot find instance")}}).data})}}rewriteActions(t,i,r,n,a,s){t.forEach(o=>{o.data.type==="Transition"?this.relativeizeInner(o.data.object,[...i,o.id],"object",r,n,a,s):o.data.type==="Animation"?this.relativeizeInner(o.data.object,[...i,o.id],"object",r,n,a,s):o.data.type==="Conditional"&&(this.rewriteActions(o.data.ifActions,[...i,o.id,"ifActions"],r,n,a,s),this.rewriteActions(o.data.elseActions,[...i,o.id,"elseActions"],r,n,a,s))})}rewriteEventsBeforeGoToPlayMode(){this.traverseEntity(t=>{if(t instanceof Hg&&typeof t.identity=="string"&&t.data.type==="Component")return t.traverseEntity((i,r)=>{i.data.events.forEach(n=>{if(n.data.type==="GameControl"){let a=!1;if(i.forInstancesRec(s=>{s.data=Uy(s.data,o=>{s.isInstanceRoot||(o.events.delete(n.id),a=!0)}).data}),a===!1)for(let s of rT.list)this.rewriteActions(n.data.gameActions[s],["gameActions",s],t,i,r,n)}else n.data.type==="Conditional"?(n.data.condition.type==="Distance"?(this.relativeizeInner(n.data.condition.fromObject,["condition"],"fromObject",t,i,r,n),this.relativeizeInner(n.data.condition.toObject,["condition"],"toObject",t,i,r,n)):n.data.condition.type==="State"?this.relativeizeInner(n.data.condition.object,["condition"],"object",t,i,r,n):n.data.condition.type==="Comparison"&&(n.data.condition.lOperand.type==="Property"&&this.relativeizeInner(n.data.condition.lOperand.value[0],["condition","lOperand","value"],0,t,i,r,n),n.data.condition.rOperand.type==="Property"&&this.relativeizeInner(n.data.condition.rOperand.value[0],["condition","rOperand","value"],0,t,i,r,n)),this.rewriteActions(n.data.inActions,["inActions"],t,i,r,n),this.rewriteActions(n.data.outActions,["outActions"],t,i,r,n)):"actions"in n.data&&this.rewriteActions(n.data.actions,["actions"],t,i,r,n)})}),!0})}expandInstances(t,i,r){let n=new Set;this.traverseEntity(a=>{if(a instanceof Hg&&a.isInstanceRoot)return a.expandInstanceChildren({scene:this,shared:t,pendingDeletes:n}),i||a.resetBBoxNeedsUpdate(),r&&a.traverseEntity(s=>{r.addClip(s)}),!0});for(let a of n)this.disposeAndUnregisterEntityRecursivelyIfNotReregistered(a),wU(a)}recomputeInstances(t,i){this.needsRecomputeInstances&&(this.needsRecomputeInstances=!1,this.traverseEntity(r=>{r instanceof Hg&&r.isInstanceRoot&&(r.component=void 0)}),this.expandInstances(t,!1,i))}disposeAndUnregisterEntityRecursivelyIfNotReregistered(t){t.traverseEntity(i=>{let r=typeof i.identity=="string"?i.identity:i.identity.join("-");this.entityIdentityToEntity[r]===i&&(delete this.entityByUuid[i.uuid],delete this.entityIdentityToEntity[r]),i.dispose()})}clearScene(){for(let t of this.children)Oi.is(t)&&t.disposeRecursively();this.children.length=0}resetAfterClear(t,i){this.init(t,i)}raycast(t){return this.raycast1(t,!1)}raycast1(t,i){let r=[],n=a=>{for(let s of a.children){let o=s.cloner;if(Oi.is(s)&&!s.raycastLock&&(s.visible||o!=null&&o.object.data.visible))if(i===!0&&s.isInstanceRoot){let l=[];if(t.intersectObject(s,!0,l),l.length){let c=l[0];c.object=s,c.point.applyMatrix4(c.object.matrixWorld);let h=s.matrixWorld.clone().invert();c.point.applyMatrix4(h),r.push(c)}}else($l(s)||DL(s)&&this.enableHelpers&&s.objectHelper.visible)&&(t.intersectObject(s,!1,r),QL(s,t,r)),n(s)}};return n(this.activePage),r}raycastWithClones(t){let i=[],r=n=>{for(let a of n.children){let s=a.cloner;Oi.is(a)&&(a.visible||s!=null&&s.object.data.visible)&&(($l(a)||DL(a)&&this.enableHelpers&&a.objectHelper.visible)&&(t.intersectObject(a,!1,i),QL(a,t,i,!0)),r(a))}};return r(this),i}forEachEntity(t){for(let i of this.children)Oi.is(i)&&t(i)}traverseConcreteEntity(t){for(let i of this.children)Oi.is(i)&&i.isConcreteEntity&&i.traverseEntity(t)}traverseEntity(t){for(let i of this.children)Oi.is(i)&&i.traverseEntity(t)}updateFont(t,i){this.traverseEntity(r=>{if(r instanceof ds&&r.data.type==="Mesh"&&(r.data.geometry.type==="TextGeometry"||r.data.geometry.type==="InputGeometry")&&r.data.geometry.font===t){let n=r.geometry,a=r.data.geometry;n.updateFont(t,i).then(()=>{n.update(a);
11954let s=r.invalidateDownstreamBooleanData();xu(s)&&s.recomputeBoolean()})}})}traverseObject(t){for(let i of this.children)Wy.is(i)&&i.traverseObject(t)}traverseVisibleEntity(t){for(let i of this.children)Oi.is(i)&&i.visible&&i.traverseVisibleEntity(t)}dispose(){this.clearScene()}createChildrenObjects(t,i,r){let n=0;for(let a of t)this.createObject(a.id,a.data,a.children,i,n,r),n+=1}registerObjectCreatedInLegacy(t){this.entityByUuid[t.uuid]=t}unregisterObject(t){delete this.entityByUuid[t.uuid];for(let i of t.children)this.unregisterObject(i)}createObject(t,i,r,n,a,s){var c;let o={scene:this,shared:s},l=bU(t,i,o);return l&&(this.entityByUuid[t]=l,n.add(l),n.children.splice(a,0,n.children.pop()),r.length>0&&(l.isInstanceRoot?console.error("instance should not have children!"):this.createChildrenObjects(r,l,s)),l.updateState(i,o),l instanceof ds&&l.updateGeometryGroupsIfNeeded(),l.updateVisible(this),l.cloner&&this.toExpandCloner.add(l),(c=i.pathSnapping)!=null&&c.pathId&&this.pathConstraints.setConstraint(t,i.pathSnapping.pathId)),i.type==="Empty"&&i.animations&&l.traverseEntity(h=>{let u=h.dataPatched;if(h instanceof ds&&u.bones&&u.boneInverses){let d=u.bones.map(m=>this.find(m)),A=u.boneInverses.map(m=>new ht().fromArray(m)),f=new cN(d,A);h.bind(f,h.bindMatrix)}else h.matrixAutoUpdate=!0}),l}getCenter(t){let i=[];for(let n=0,a=t.length;n<a;++n){let{id:s,recursive:o}=t[n],l=this.find(s),c=o?l.recursiveBBox:l.singleBBox;i.push(...c.vertices)}let r=new Sn;return r.setFromPoints(i),r.getCenter(EV),EV}copyMatrixWorld(t,i){if(t===null){i.identity();return}let r=this.find(t);r?i.copy(r.matrixWorld):i.identity()}copyParentMatrixWorld(t,i){var n;if(t===null){i.identity();return}let r=(n=this.find(t))==null?void 0:n.parent;r?i.copy(r.matrixWorld):i.identity()}traverseMaterial(t){this.traverseEntity(i=>{if(i instanceof zs)if(Array.isArray(i.material))for(let r=0;r<i.material.length;r++)i.material[r]instanceof LA&&t(i.material[r]);else i.material instanceof LA&&t(i.material)})}updateViewPlaneSize(t,i,r=!1){this.traverseConcreteEntity(n=>{n instanceof ms&&n.setViewplaneSize(t,i,r)})}initializeSplatViewer(){this.splatViewer=new $Ne({scene:this}),this.reloadSplats()}reloadSplats(){var t;(t=this.splatViewer)==null||t.loadSplat()}},FS=(t,i)=>{let r=i.x-t.x,n=i.y-t.y;return Math.sqrt(r*r+n*n)},eUe=(t,i)=>{let r=i.x-t.x,n=i.y-t.y;return iUe(Math.atan2(n,r))},tUe=(t,i,r)=>{let n={x:0,y:0};return r=WL(r),n.x=t.x-i*Math.cos(r),n.y=t.y-i*Math.sin(r),n},WL=t=>t*(Math.PI/180),iUe=t=>t*(180/Math.PI),rUe=t=>isNaN(t.buttons)?t.pressure!==0:t.buttons!==0,s2=new Map,wV=t=>{s2.has(t)&&clearTimeout(s2.get(t)),s2.set(t,setTimeout(t,100))},vT=(t,i,r)=>{let n=i.split(/[ ,]+/g),a;for(let s=0;s<n.length;s+=1)a=n[s],t.addEventListener?t.addEventListener(a,r,!1):t.attachEvent&&t.attachEvent(a,r)},bV=(t,i,r)=>{let n=i.split(/[ ,]+/g),a;for(let s=0;s<n.length;s+=1)a=n[s],t.removeEventListener?t.removeEventListener(a,r):t.detachEvent&&t.detachEvent(a,r)},vq=t=>(t.preventDefault(),t.type.match(/^touch/)?t.changedTouches:t),SV=()=>{if(typeof window>"u")return;let t=window.pageXOffset!==void 0?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,i=window.pageYOffset!==void 0?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;return{x:t,y:i}},jL=(t,i)=>{i.top||i.right||i.bottom||i.left?(t.style.top=i.top,t.style.right=i.right,t.style.bottom=i.bottom,t.style.left=i.left):(t.style.left=i.x+"px",t.style.top=i.y+"px")},CU=(t,i,r)=>{let n=_q(t);for(let a in n)if(n.hasOwnProperty(a))if(typeof i=="string")n[a]=i+" "+r;else{let s="";for(let o=0,l=i.length;o<l;o+=1)s+=i[o]+" "+r+", ";n[a]=s.slice(0,-2)}return n},nUe=(t,i)=>{let r=_q(t);for(let n in r)r.hasOwnProperty(n)&&(r[n]=i);return r},_q=t=>{let i={};return i[t]="",["webkit","Moz","o"].forEach(function(r){i[r+t.charAt(0).toUpperCase()+t.slice(1)]=""}),i},o2=(t,i)=>{for(let r in i)i.hasOwnProperty(r)&&(t[r]=i[r]);return t},aUe=(t,i)=>{let r={};for(let n in t)t.hasOwnProperty(n)&&i.hasOwnProperty(n)?r[n]=i[n]:t.hasOwnProperty(n)&&(r[n]=t[n]);return r},YL=(t,i)=>{if(t.length)for(let r=0,n=t.length;r<n;r+=1)i(t[r]);else i(t)},sUe=(t,i,r)=>({x:Math.min(Math.max(t.x,i.x-r),i.x+r),y:Math.min(Math.max(t.y,i.y-r),i.y+r)});typeof window<"u"&&(yq="ontouchstart"in window,Eq=!!window.PointerEvent,wq
vendor: 5,368 bytes, line 11954
11954=!!window.MSPointerEvent);var yq,Eq,wq,qv={touch:{start:"touchstart",move:"touchmove",end:"touchend, touchcancel"},mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},pointer:{start:"pointerdown",move:"pointermove",end:"pointerup, pointercancel"},MSPointer:{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}},mg,Ky={};Eq?mg=qv.pointer:wq?mg=qv.MSPointer:yq?(mg=qv.touch,Ky=qv.mouse):mg=qv.mouse;function Op(){}Op.prototype.on=function(t,i){var r=this,n=t.split(/[ ,]+/g),a;r._handlers_=r._handlers_||{};for(var s=0;s<n.length;s+=1)a=n[s],r._handlers_[a]=r._handlers_[a]||[],r._handlers_[a].push(i);return r};Op.prototype.off=function(t,i){var r=this;return r._handlers_=r._handlers_||{},t===void 0?r._handlers_={}:i===void 0?r._handlers_[t]=null:r._handlers_[t]&&r._handlers_[t].indexOf(i)>=0&&r._handlers_[t].splice(r._handlers_[t].indexOf(i),1),r};Op.prototype.trigger=function(t,i){var r=this,n=t.split(/[ ,]+/g),a;r._handlers_=r._handlers_||{};for(var s=0;s<n.length;s+=1)a=n[s],r._handlers_[a]&&r._handlers_[a].length&&r._handlers_[a].forEach(function(o){o.call(r,{type:a,target:r},i)})};Op.prototype.config=function(t){var i=this;i.options=i.defaults||{},t&&(i.options=aUe(i.options,t))};Op.prototype.bindEvt=function(t,i){var r=this;return r._domHandlers_=r._domHandlers_||{},r._domHandlers_[i]=function(){typeof r["on"+i]=="function"?r["on"+i].apply(r,arguments):console.warn('[WARNING] : Missing "on'+i+'" handler.')},vT(t,mg[i],r._domHandlers_[i]),Ky[i]&&vT(t,Ky[i],r._domHandlers_[i]),r};Op.prototype.unbindEvt=function(t,i){var r=this;return r._domHandlers_=r._domHandlers_||{},bV(t,mg[i],r._domHandlers_[i]),Ky[i]&&bV(t,Ky[i],r._domHandlers_[i]),delete r._domHandlers_[i],this};var TU=Op;function ra(t,i){return this.identifier=i.identifier,this.position=i.position,this.frontPosition=i.frontPosition,this.collection=t,this.defaults={size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,mode:"dynamic",zone:document.body,lockX:!1,lockY:!1,shape:"circle"},this.config(i),this.options.mode==="dynamic"&&(this.options.restOpacity=0),this.id=ra.id,ra.id+=1,this.buildEl().stylize(),this.instance={el:this.ui.el,on:this.on.bind(this),off:this.off.bind(this),show:this.show.bind(this),hide:this.hide.bind(this),add:this.addToDom.bind(this),remove:this.removeFromDom.bind(this),destroy:this.destroy.bind(this),setPosition:this.setPosition.bind(this),resetDirection:this.resetDirection.bind(this),computeDirection:this.computeDirection.bind(this),trigger:this.trigger.bind(this),position:this.position,frontPosition:this.frontPosition,ui:this.ui,identifier:this.identifier,id:this.id,options:this.options},this.instance}ra.prototype=new TU;ra.constructor=ra;ra.id=0;ra.prototype.buildEl=function(t){return this.ui={},this.options.dataOnly?this:(this.ui.el=document.createElement("div"),this.ui.back=document.createElement("div"),this.ui.front=document.createElement("div"),this.ui.el.className="nipple collection_"+this.collection.id,this.ui.back.className="back",this.ui.front.className="front",this.ui.el.setAttribute("id","nipple_"+this.collection.id+"_"+this.id),this.ui.el.appendChild(this.ui.back),this.ui.el.appendChild(this.ui.front),this)};ra.prototype.stylize=function(){if(this.options.dataOnly)return this;var t=this.options.fadeTime+"ms",i=nUe("borderRadius","50%"),r=CU("transition","opacity",t),n={};return n.el={position:"absolute",opacity:this.options.restOpacity,display:"block",zIndex:999},n.back={position:"absolute",display:"block",width:this.options.size+"px",height:this.options.size+"px",marginLeft:-this.options.size/2+"px",marginTop:-this.options.size/2+"px",background:"rgba(255, 255, 255, .4)",border:"solid 2px rgba(0, 0, 0, .1)"},n.front={width:this.options.size/2+"px",height:this.options.size/2+"px",position:"absolute",display:"block",marginLeft:-this.options.size/4+"px",marginTop:-this.options.size/4+"px",background:"rgba(255, 255, 255, .8)",border:"solid 2px rgba(0, 0, 0, .1)"},o2(n.el,r),this.options.shape==="circle"&&o2(n.back,i),o2(n.front,i),this.applyStyles(n),this};ra.prototype.applyStyles=function(t){for(var i in this.ui)if(this.ui.hasOwnProperty(i))for(var r in t[i])this.ui[i].style[r]=t[i][r];return this};ra.prototype.addToDom=function(){return this.options.dataOnly||document.body.contains(this.ui.el)?this:(this.options.zone.appendChild(this.ui.el),this)};ra.prototype.removeFromDom=function(){return this.options.dataOnly||!document.body.contains(this.ui.el)?this:(this.options.zone.removeChild(this.ui.el),this)};ra.prototype.destroy=function(){clearTimeout(this.removeTimeout),clearTimeout(this.showTimeout),clearTimeout(this.restTimeout),this.trigger("destroyed",this.instance),this.removeFromDom(),this.off()};ra.prototype.show=function(t){var i=this;return i.options.dataOnly||(clearTimeout(i.removeTimeout),clearTimeout(i.showTimeout),clearTimeout(i.restTimeout),i.addToDom(),i.restCallback(),setTimeout(function(){i.ui.el.style.opacity=1},0),i.showTimeout=setTimeout(function(){i.trigger("shown",i.instance),typeof t=="function"&&t.call(this)},i.options.fadeTime)),i};ra.prototype.hide=function(t){var i=this;if(i.options.dataOnly)return i;if(i.ui.el.style.opacity=i.options.restOpacity,clearTimeout(i.removeTimeout),clearTimeout(i.showTimeout),clearTimeout(i.restTimeout),i.removeTimeout=setTimeout(function(){var r=i.options.mode==="dynamic"?"n
11954one":"block";i.ui.el.style.display=r,typeof t=="function"&&t.call(i),i.trigger("hidden",i.instance)},i.options.fadeTime),i.options.restJoystick){let r=i.options.restJoystick,n={};n.x=r===!0||r.x!==!1?0:i.instance.frontPosition.x,n.y=r===!0||r.y!==!1?0:i.instance.frontPosition.y,i.setPosition(t,n)}return i};ra.prototype.setPosition=function(t,i){var r=this;r.frontPosition={x:i.x,y:i.y};var n=r.options.fadeTime+"ms",a={};a.front=CU("transition",["top","left"],n);var s={front:{}};s.front={left:r.frontPosition.x+"px",top:r.frontPosition.y+"px"},r.applyStyles(a),r.applyStyles(s),r.restTimeout=setTimeout(function(){typeof t=="function"&&t.call(r),r.restCallback()},r.options.fadeTime)};ra.prototype.restCallback=function(){var t=this,i={};i.front=CU("transition","none",""),t.applyStyles(i),t.trigger("rested",t.instance)};ra.prototype.resetDirection=function(){this.direction={x:!1,y:!1,angle:!1}};ra.prototype.computeDirection=function(t){var i=t.angle.radian,r=Math.PI/4,n=Math.PI/2,a,s,o;if(i>r&&i<r*3&&!t.lockX?a="up":i>-r&&i<=r&&!t.lockY?a="left":i>-r*3&&i<=-r&&!t.lockX?a="down":t.lockY||(a="right"),t.lockY||(i>-n&&i<n?s="left":s="right"),t.lockX||(i>0?o="up":o="down"),t.force>this.options.threshold){var l={},c;for(c in this.direction)this.direction.hasOwnProperty(c)&&(l[c]=this.direction[c]);var h={};this.direction={x:s,y:o,angle:a},t.direction=this.direction;for(c in l)l[c]===this.direction[c]&&(h[c]=!0);if(h.x&&h.y&&h.angle)return t;(!h.x||!h.y)&&this.trigger("plain",t),h.x||this.trigger("plain:"+s,t),h.y||this.trigger("plain:"+o,t),h.angle||this.trigger("dir dir:"+a,t)}else this.resetDirection();return t};var oUe=ra;function Cn(t,i){var r=this;r.nipples=[],r.idles=[],r.actives=[],r.ids=[],r.pressureIntervals={},r.manager=t,r.id=Cn.id,Cn.id+=1,r.defaults={zone:document.body,multitouch:!1,maxNumberOfNipples:10,mode:"dynamic",position:{top:0,left:0},catchDistance:200,size:100,threshold:.1,color:"white",fadeTime:250,dataOnly:!1,restJoystick:!0,restOpacity:1,lockX:!1,lockY:!1,shape:"circle",dynamicPage:!1,follow:!1},r.config(i),(r.options.mode==="static"||r.options.mode==="semi")&&(r.options.multitouch=!1),r.options.multitouch||(r.options.maxNumberOfNipples=1);let n=getComputedStyle(r.options.zone.parentElement);return n&&n.display==="flex"&&(r.parentIsFlex=!0),r.updateBox(),r.prepareNipples(),r.bindings(),r.begin(),r.nipples}Cn.prototype=new TU;Cn.constructor=Cn;Cn.id=0;Cn.prototype.prepareNipples=function(){var t=this,i=t.nipples;i.on=t.on.bind(t),i.off=t.off.bind(t),i.options=t.options,i.destroy=t.destroy.bind(t),i.ids=t.ids,i.id=t.id,i.processOnMove=t.processOnMove.bind(t),i.processOnEnd=t.processOnEnd.bind(t),i.get=function(r){if(r===void 0)return i[0];for(var n=0,a=i.length;n<a;n+=1)if(i[n].identifier===r)return i[n];return!1}};Cn.prototype.bindings=function(){var t=this;t.bindEvt(t.options.zone,"start"),t.options.zone.style.touchAction="none",t.options.zone.style.msTouchAction="none"};Cn.prototype.begin=function(){var t=this,i=t.options;if(i.mode==="static"){var r=t.createNipple(i.position,t.manager.getIdentifier());r.add(),t.idles.push(r)}};Cn.prototype.createNipple=function(t,i){var r=this,n=r.manager.scroll,a={},s=r.options,o={x:r.parentIsFlex?n.x:n.x+r.box.left,y:r.parentIsFlex?n.y:n.y+r.box.top};if(t.x&&t.y)a={x:t.x-o.x,y:t.y-o.y};else if(t.top||t.right||t.bottom||t.left){var l=document.createElement("DIV");l.style.display="hidden",l.style.top=t.top,l.style.right=t.right,l.style.bottom=t.bottom,l.style.left=t.left,l.style.position="absolute",s.zone.appendChild(l);var c=l.getBoundingClientRect();s.zone.removeChild(l),a=t,t={x:c.left+n.x,y:c.top+n.y}}var h=new oUe(r,{color:s.color,size:s.size,threshold:s.threshold,fadeTime:s.fadeTime,dataOnly:s.dataOnly,restJoystick:s.restJoystick,restOpacity:s.restOpacity,mode:s.mode,identifier:i,position:t,zone:s.zone,frontPosition:{x:0,y:0},shape:s.shape});return s.dataOnly||(jL(h.ui.el,a),jL(h.ui.front,h.frontPosition)),r.nipples.push(h),r.trigger("added "+h.identifier+":added",h),r.manager.trigger("added "+h.identifier+":added",h),r.bindNipple(h),h};Cn.prototype.updateBox=function(){var t=this;t.box=t.options.zone.getBoundingClientRect()};Cn.prototype.bindNipple=function(t){var i=this,r,n=function(a,s){r=
vendor: 4,387 bytes, line 11954
11954a.type+" "+s.id+":"+a.type,i.trigger(r,s)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",n),t.on("dir:up dir:right dir:down dir:left",n),t.on("plain:up plain:right plain:down plain:left",n)};Cn.prototype.pressureFn=function(t,i,r){var n=this,a=0;clearInterval(n.pressureIntervals[r]),n.pressureIntervals[r]=setInterval((function(){var s=t.force||t.pressure||t.webkitForce||0;s!==a&&(i.trigger("pressure",s),n.trigger("pressure "+i.identifier+":pressure",s),a=s)}).bind(n),100)};Cn.prototype.onstart=function(t){var i=this,r=i.options,n=t;t=vq(t),i.updateBox();var a=function(s){i.actives.length<r.maxNumberOfNipples?i.processOnStart(s):n.type.match(/^touch/)&&(Object.keys(i.manager.ids).forEach(function(o){if(Object.values(n.touches).findIndex(function(c){return c.identifier===o})<0){var l=[t[0]];l.identifier=o,i.processOnEnd(l)}}),i.actives.length<r.maxNumberOfNipples&&i.processOnStart(s))};return YL(t,a),i.manager.bindDocument(),!1};Cn.prototype.processOnStart=function(t){var i=this,r=i.options,n,a=i.manager.getIdentifier(t),s=t.force||t.pressure||t.webkitForce||0,o={x:t.pageX,y:t.pageY},l=i.getOrCreate(a,o);l.identifier!==a&&i.manager.removeIdentifier(l.identifier),l.identifier=a;var c=function(u){u.trigger("start",u),i.trigger("start "+u.id+":start",u),u.show(),s>0&&i.pressureFn(t,u,u.identifier),i.processOnMove(t)};if((n=i.idles.indexOf(l))>=0&&i.idles.splice(n,1),i.actives.push(l),i.ids.push(l.identifier),r.mode!=="semi")c(l);else{var h=FS(o,l.position);if(h<=r.catchDistance)c(l);else{l.destroy(),i.processOnStart(t);return}}return l};Cn.prototype.getOrCreate=function(t,i){var r=this,n=r.options,a;return/(semi|static)/.test(n.mode)?(a=r.idles[0],a?(r.idles.splice(0,1),a):n.mode==="semi"?r.createNipple(i,t):(console.warn("Coudln't find the needed nipple."),!1)):(a=r.createNipple(i,t),a)};Cn.prototype.processOnMove=function(t){var i=this,r=i.options,n=i.manager.getIdentifier(t),a=i.nipples.get(n),s=i.manager.scroll;if(!rUe(t)){this.processOnEnd(t);return}if(!a){console.error("Found zombie joystick with ID "+n),i.manager.removeIdentifier(n);return}if(r.dynamicPage){var o=a.el.getBoundingClientRect();a.position={x:s.x+o.left,y:s.y+o.top}}a.identifier=n;var l=a.options.size/2,c={x:t.pageX,y:t.pageY};r.lockX&&(c.y=a.position.y),r.lockY&&(c.x=a.position.x);var h=FS(c,a.position),u=eUe(c,a.position),d=WL(u),A=h/l,f={distance:h,position:c},m,g;if(a.options.shape==="circle"?(m=Math.min(h,l),g=tUe(a.position,m,u)):(g=sUe(c,a.position,l),m=FS(g,a.position)),r.follow){if(h>l){let y=c.x-g.x,w=c.y-g.y;a.position.x+=y,a.position.y+=w,a.el.style.top=a.position.y-(i.box.top+s.y)+"px",a.el.style.left=a.position.x-(i.box.left+s.x)+"px",h=FS(c,a.position)}}else c=g,h=m;var p=c.x-a.position.x,v=c.y-a.position.y;a.frontPosition={x:p,y:v},r.dataOnly||jL(a.ui.front,a.frontPosition);var _={identifier:a.identifier,position:c,force:A,pressure:t.force||t.pressure||t.webkitForce||0,distance:h,angle:{radian:d,degree:u},vector:{x:p/l,y:-v/l},raw:f,instance:a,lockX:r.lockX,lockY:r.lockY};_=a.computeDirection(_),_.angle={radian:WL(180-u),degree:180-u},a.trigger("move",_),i.trigger("move "+a.id+":move",_)};Cn.prototype.processOnEnd=function(t){var i=this,r=i.options,n=i.manager.getIdentifier(t),a=i.nipples.get(n),s=i.manager.removeIdentifier(a.identifier);!a||(r.dataOnly||a.hide(function(){r.mode==="dynamic"&&(a.trigger("removed",a),i.trigger("removed "+a.id+":removed",a),i.manager.trigger("removed "+a.id+":removed",a),a.destroy())}),clearInterval(i.pressureIntervals[a.identifier]),a.resetDirection(),a.trigger("end",a),i.trigger("end "+a.id+":end",a),i.ids.indexOf(a.identifier)>=0&&i.ids.splice(i.ids.indexOf(a.identifier),1),i.actives.indexOf(a)>=0&&i.actives.splice(i.actives.indexOf(a),1),/(semi|static)/.test(r.mode)?i.idles.push(a):i.nipples.indexOf(a)>=0&&i.nipples.splice(i.nipples.indexOf(a),1),i.manager.unbindDocument(),/(semi|static)/.test(r.mode)&&(i.manager.ids[s.id]=s.identifier))};Cn.prototype.onDestroyed=function(t,i){var r=this;r.nipples.indexOf(i)>=0&&r.nipples.splice(r.nipples.indexOf(i),1),r.actives.indexOf(i)>=0&&r.actives.splice(r.actives.indexOf(i),1),r.idles.indexOf(i)>=0&&r.idles.splice(r.idles.indexOf(i),1),r.ids.indexOf(i.identifier)>=0&&r.ids.splice(r.ids.indexOf(i.identifier),1),r.manager.removeIdentifier(i.identifier),r.manager.unbindDocument()};Cn.prototype.destroy=function(){var t=this;
11954t.unbindEvt(t.options.zone,"start"),t.nipples.forEach(function(r){r.destroy()});for(var i in t.pressureIntervals)t.pressureIntervals.hasOwnProperty(i)&&clearInterval(t.pressureIntervals[i]);t.trigger("destroyed",t.nipples),t.manager.unbindDocument(),t.off()};var lUe=Cn;function Ma(t){var i=this;i.ids={},i.index=0,i.collections=[],i.scroll=SV(),i.config(t),i.prepareCollections();var r=function(){var a;i.collections.forEach(function(s){s.forEach(function(o){a=o.el.getBoundingClientRect(),o.position={x:i.scroll.x+a.left,y:i.scroll.y+a.top}})})};if(typeof window>"u")return i.collections;vT(window,"resize",function(){wV(r)});var n=function(){i.scroll=SV()};return vT(window,"scroll",function(){wV(n)}),i.collections}Ma.prototype=new TU;Ma.constructor=Ma;Ma.prototype.prepareCollections=function(){var t=this;t.collections.create=t.create.bind(t),t.collections.on=t.on.bind(t),t.collections.off=t.off.bind(t),t.collections.destroy=t.destroy.bind(t),t.collections.get=function(i){var r;return t.collections.every(function(n){return r=n.get(i),!r}),r}};Ma.prototype.create=function(t){return this.createCollection(t)};Ma.prototype.createCollection=function(t){var i=this,r=new lUe(i,t);return i.bindCollection(r),i.collections.push(r),r};Ma.prototype.bindCollection=function(t){var i=this,r,n=function(a,s){r=a.type+" "+s.id+":"+a.type,i.trigger(r,s)};t.on("destroyed",i.onDestroyed.bind(i)),t.on("shown hidden rested dir plain",n),t.on("dir:up dir:right dir:down dir:left",n),t.on("plain:up plain:right plain:down plain:left",n)};Ma.prototype.bindDocument=function(){var t=this;t.binded||(t.bindEvt(document,"move").bindEvt(document,"end"),t.binded=!0)};Ma.prototype.unbindDocument=function(t){var i=this;(!Object.keys(i.ids).length||t===!0)&&(i.unbindEvt(document,"move").unbindEvt(document,"end"),i.binded=!1)};Ma.prototype.getIdentifier=function(t){var i;return t?(i=t.identifier===void 0?t.pointerId:t.identifier,i===void 0&&(i=this.latest||0)):i=this.index,this.ids[i]===void 0&&(this.ids[i]=this.index,this.index+=1),this.latest=i,this.ids[i]};Ma.prototype.removeIdentifier=function(t){var i={};for(var r in this.ids)if(this.ids[r]===t){i.id=r,i.identifier=this.ids[r],delete this.ids[r];break}return i};Ma.prototype.onmove=function(t){var i=this;return i.onAny("move",t),!1};Ma.prototype.onend=function(t){var i=this;return i.onAny("end",t),!1};Ma.prototype.oncancel=function(t){var i=this;return i.onAny("end",t),!1};Ma.prototype.onAny=function(t,i){var r=this,n,a="processOn"+t.charAt(0).toUpperCase()+t.slice(1);i=vq(i);var s=function(l,c,h){h.ids.indexOf(c)>=0&&(h[a](l),l._found_=!0)},o=function(l){n=r.getIdentifier(l),YL(r.collections,s.bind(null,l,n)),l._found_||r.removeIdentifier(n)};return YL(i,o),!1};Ma.prototype.destroy=function(){var t=this;t.unbindDocument(!0),t.ids={},t.index=0,t.collections.forEach(function(i){i.destroy()}),t.off()};Ma.prototype.onDestroyed=function(t,i){var r=this;if(r.collections.indexOf(i)<0)return!1;r.collections.splice(r.collections.indexOf(i),1)};var cUe=Ma,CV=new cUe,hUe={create:function(t){return CV.create(t)},factory:CV},bq=new Map,ey=new Map,Uf=class{constructor(t,i,r,n){this.data=i;let{audio:a,volume:s,delay:o,loop:l}=i;if(!a)throw new Error("Missing property");let c=typeof a=="string"?n.getAudio(a).src:a.data;this.audioPlayer=new T_({src:c,volume:s,delay:o,loop:l}),ey.has(r.uuid)?ey.get(r.uuid).push(this):ey.set(r.uuid,[this]),bq.set(t,this)}playByToggle(){this.data.toggle==="stop"?this.audioPlayer.status==="playing"?this.audioPlayer.stop():(this.audioPlayer.stop(),this.audioPlayer.play()):this.data.toggle==="pause"?this.audioPlayer.status==="playing"?this.audioPlayer.pause():this.audioPlayer.play():(this.audioPlayer.stop(),this.audioPlayer.play())}dispose(){this.audioPlayer.stop()}},KL=class{constructor(t){this.data=t}dispatch(){this.data.playAudio?this.pauseAudio(this.data.playAudio):this.data.object?this.pauseAllAudiosFromObject(this.data.object):this.pauseAllAudios()}pauseAudio(t){let i=bq.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.audioPlayer[this.data.interaction](),this.disposeDelay()},this.data.delay)):i.audioPlayer[this.data.interaction]())}pauseAllAudiosFromObject(t){let i=ey.get(t);!(i!=null&&i.length)||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>
vendor: 7,475 bytes, line 11954
11954{i.forEach(r=>r.audioPlayer[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(r=>r.audioPlayer[this.data.interaction]()))}pauseAllAudios(){let t=[...ey.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(i=>{i.forEach(r=>{r.audioPlayer[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(i=>{i.forEach(r=>{r.audioPlayer[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},Sq=class{constructor(t,i,r,n,a){if(this.data=i,this.shared=n,this.condition=a,i.interaction==="play")this.interaction=new Uf(t,i,r,n);else if(i.interaction==="pause"||i.interaction==="stop")this.interaction=new KL(i);else throw new Error("Missing property")}dispatchBasic(){if(Or(this.shared,this.condition)===!1)return!1;this.interaction instanceof Uf?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(Or(this.shared,this.condition)===!1)return!1;this.interaction instanceof Uf?this.interaction.audioPlayer.play():this.interaction.dispatch()}dispatchGameControl(t){if(Or(this.shared,this.condition)===!1)return!1;this.interaction instanceof Uf&&(t==="start"?this.interaction.audioPlayer.play():this.interaction.audioPlayer.stop())}dispose(){this.interaction.dispose()}},Cq=class{constructor(t,i,r,n){this.data=t,this.page=i,this.shared=r,this.condition=n,this.delay=0,this.emission=t.emission,t.delay!==void 0&&(this.delay=t.delay),this.particleSystem=this.page.scene.find(this.data.emitterObjectId)}toggleEmitting(){this.particleSystem.started&&!this.particleSystem.stopped?this.stop(this.delay):this.start(this.delay)}toggleFroze(){this.particleSystem.started&&!this.particleSystem.isFrozen?this.freeze(this.delay):this.unFreeze(this.delay)}start(t=0){if(t){this.delayTimerId=window.setTimeout(()=>{this.start(0),this.clearDelay()},t);return}this.particleSystem.start()}stop(t=0){if(t){this.delayTimerId=window.setTimeout(()=>{this.stop(0),this.clearDelay()},t);return}this.particleSystem.stop()}freeze(t=0){if(t){this.delayTimerId=window.setTimeout(()=>{this.freeze(0),this.clearDelay()},t);return}this.particleSystem.froze()}unFreeze(t=0){if(t){this.delayTimerId=window.setTimeout(()=>{this.unFreeze(0),this.clearDelay()},t);return}this.particleSystem.unFroze()}reset(t=0){if(t){this.delayTimerId=window.setTimeout(()=>{this.reset(0),this.clearDelay()},t);return}this.particleSystem.reset()}reverseFromCurrent(){switch(this.emission){case"emitToggle":this.toggleEmitting();break;case"pauseToggle":this.toggleFroze();break}}dispatchBasic(){if(Or(this.shared,this.condition)===!1||!this.particleSystem)return!1;switch(this.emission){case"start":this.start(this.delay);break;case"emitToggle":this.toggleEmitting();break;case"pause":this.freeze(this.delay);break;case"pauseToggle":this.toggleFroze();break;case"stop":this.stop(this.delay);break;case"reset":this.reset(this.delay);break}}dispatchConditional(){if(Or(this.shared,this.condition)===!1||!this.particleSystem)return!1;switch(this.emission){case"start":this.start(this.delay);break;case"stop":this.stop(this.delay);break;case"reset":this.reset(this.delay);break}}dispatchGameControl(t){if(Or(this.shared,this.condition)===!1||!this.particleSystem)return!1;t==="start"?this.start(this.delay):this.stop(this.delay)}dispose(){!this.particleSystem||(this.particleSystem.reset(),this.clearDelay())}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}},uUe="text/plain",dUe="us-ascii",TV=(t,i)=>i.some(r=>r instanceof RegExp?r.test(t):r===t),AUe=(t,{stripHash:i})=>{let r=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(t);if(!r)throw new Error(`Invalid URL: ${t}`);let{type:n,data:a,hash:s}=r.groups,o=n.split(";");s=i?"":s;let l=!1;o[o.length-1]==="base64"&&(o.pop(),l=!0);let c=(o.shift()||"").toLowerCase(),h=[...o.map(u=>{let[d,A=""]=u.split("=").map(f=>f.trim());return d==="charset"&&(A=A.toLowerCase(),A===dUe)?"":`${d}${A?`=${A}`:""}`}).filter(Boolean)];return l&&h.push("base64"),(h.length>0||c&&c!==uUe)&&h.unshift(c),`data:${h.join(";")},${l?a.trim():a}${s?`#${s}`:""}`};function fUe(t,i){if(i={defaultProtocol:"http:",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,sortQueryParameters:!0,...i},t=t.trim(),/^data:/i.test(t))return AUe(t,i);if(/^view-source:/i.test(t))throw new Error("`view-source:` is not supported as it is a non-standard protocol");let r=t.startsWith("//");!r&&/^\.*\//.test(t)||(t=t.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,i.defaultProtocol));let n=new URL(t);if(i.forceHttp&&i.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(i.forceHttp&&n.protocol==="https:"&&(n.protocol="http:"),i.forceHttps&&n.protocol==="http:"&&(n.protocol="https:"),i.stripAuthentication&&(n.username="",n.password=""),i.stripHash?n.hash="":i.stripTextFragment&&(n.hash=n.hash.replace(/#?:~:text.*?$/i,"")),n.pathname){let s=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g,o=0,l="";for(;;){let h=s.exec(n.pathname);if(!h)break;let u=h[0],d=h.index,A=n.pathname.slice(o,d);l+=A.replace(/\/{2,}/g,"/"),l+=u,o=d+u.length}let c=n.pathname.slice(o,n.pathname.length);l+=c.replace(/\/{2,}/g,"/"),n.pathname=l}if(n.pathname)try{n.pathname=decodeURI(n.pathname)}catch{}if(i.removeDirectoryIndex===!0&&(i.removeDirectoryIndex=[/^index\.[a-z]+$/]),Array.isArray(i.removeDirectoryIndex)&&i.removeDirectoryIndex.length>0){let s=n.pathname.split("/"),o=s[s.length-1];TV(o,i.removeDirectoryIndex)&&(s=s.slice(0,-1),n.pathname=s.slice(1).join("/")+"/")}if(n.hostname&&(n.hostname=n.hostname.replace(/\.$/,""),i.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test(n.hostname)&&(n.hostname=n.hostname.replace(/^www\./,""))),Array.isArray(i.removeQueryParameters))for(let s of[...n.searchParams.keys()])TV(s,i.removeQueryParameters)&&n.searchParams.delete(s);if(i.removeQueryParameters===!0&&(n.search=""),i.sortQueryParameters){n.searchParams.sort();try{n.search=decodeURIComponent(n.search)}catch{}}i.removeTrailingSlash&&(n.pathname=n.pathname.replace(/\/$/,""));let a=t;return t=n.toString(),!i.removeSingleSlash&&n.pathname==="/"&&!a.endsWith("/")&&n.hash===""&&(t=t.replace(/\/$/,"")),(i.removeTrailingSlash||n.pathname==="/")&&n.hash===""&&i.removeSingleSlash&&(t=t.replace(/\/$/,"")),r&&!i.normalizeProtocol&&(t=t.replace(/^http:\/\//,"//")),i.stripProtocol&&(t=t.replace(/^(?:https?:)?\/\//,"")),t}var pUe=class{constructor({url:t,context:i},r,n,a){if(this.controlsManager=r,this.shared=n,this.condition=a,!t)throw new Error("Missing property");this.url=t.startsWith("mailto:")?t:fUe(t,{removeTrailingSlash:!1,removeSingleSlash:!1,stripWWW:!1}),this.context=i??"tab"}dispatch(){var t;if(Or(this.shared,this.condition)===!1)return!1;RE?window.location.assign(this.url):(this.context==="tab"||QY&&this.context==="none"?window.open(this.url,"_blank"):this.context==="window"?window.open(this.url,"_blank",`width=${window.innerWidth}, height=${window.innerHeight}`):window.open(this.url,"_parent"),(t=this.controlsManager.orbitControls)==null||t.onPointerUp(jt[0]),rxe())}},Tq=class{constructor(t,i,r,n,a){this.data=t,this.page=i,this.controlsManager=r,this.shared=n,this.condition=a,this.timeoutIdQueue=[],this.dispatchInner=()=>
11954{this.objects.forEach(this.destroyCallback)},this.destroyCallback=s=>{var h,u;this.timeoutIdQueue.shift();let o=this.page.scene.find(s);if(o===void 0)return;let l=this.controlsManager.sharedGameControlGlobals.rapierWorld,c=l?(h=o.dataPatched.physics)==null?void 0:h.fusedBody:!0;if(o.cloner){for(let d of o.cloner.children)c?(d.playModeVisible=!1,d.rigidBody&&((u=o.dataPatched.physics)==null?void 0:u.rigidBody)==="positioned"&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(d.rigidBody.collider(0).handle),l.removeRigidBody(d.rigidBody),d.rigidBody=void 0),d.bvhGeometry&&(d.bvhGeometry=void 0)):this.clone===void 0||this.clone===d?(d.playModeVisible=!1,d.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(d.rigidBody.collider(0).handle),l.removeRigidBody(d.rigidBody),d.rigidBody=void 0)):d.playModeVisible===void 0&&(d.playModeVisible=!0);(c||this.clone===void 0||this.clone===!1)&&(o.visible=!1,o.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(o.rigidBody.collider(0).handle),l.removeRigidBody(o.rigidBody),o.rigidBody=void 0),o.bvhGeometry&&(o.bvhGeometry=void 0))}else o.rigidBody&&(this.controlsManager.sharedGameControlGlobals.colliderToEntity.delete(o.rigidBody.collider(0).handle),l.removeRigidBody(o.rigidBody),o.rigidBody=void 0),o.bvhGeometry&&(o.bvhGeometry=void 0),o.visible=!1;l===void 0?this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim=this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter(d=>d.bvhGeometry!==void 0):this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim=this.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.filter(d=>d.rigidBody!==void 0),o.destroyedInAction=!0,this.controlsManager.requestRender()},this.objects=[...t.objects]}dispatch(t){if(Or(this.shared,this.condition)===!1)return!1;this.clone=t,this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,this.data.delay*1e3)):this.dispatchInner()}dispatchFromStart(){if(Or(this.shared,this.condition)===!1)return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,this.data.delay*1e3))}dispose(){this.timeoutIdQueue.forEach(t=>window.clearTimeout(t))}},Mq=class{constructor(t,i,r,n,a){this.data=t,this.page=i,this.shared=r,this.eventManager=n,this.condition=a,this.shared=r}dispatch(){if(Or(this.shared,this.condition)===!1)return!1;clearTimeout(this.timeoutId),delete this.timeoutId,this.timeoutId=window.setTimeout(()=>{var t;this.shared.reset(this.shared.data,!0),UU(this.page,this.shared,!0),this.eventManager.reset(),(t=this.eventManager.controlsManager.gameControl)==null||t.reset(!0),this.page.switchToPlayCamera(),this.eventManager.controlsManager.requestRender(),delete this.timeoutId},(this.data.delay??0)*1e3)}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},xq={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,timelineChangeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0,rewind:!0},MU={duration:1e3,delay:0,endDelay:0,startOnceDelay:0,pingPongDelayCorrection:0,pingPongEndDelayCorrection:0,easing:"easeOutElastic(1, .5)",round:0},mUe=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],_T={CSS:{},springs:{}};function oc(t,i,r){return Math.min(Math.max(t,i),r)}function ty(t,i){return t.indexOf(i)>-1}function l2(t,i){return t.apply(null,i)}var $t={arr:function(t){return Array.isArray(t)},obj:function(t){return ty(Object.prototype.toString.call(t),"Object")},pth:function(t){return $t.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return!("isNode"in t)&&(t.nodeType||$t.svg(t))},str:function(t){return typeof t=="string"},fnc:function(t){return typeof t=="function"},und:function(t){return typeof t>"u"},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return $t.hex(t)||$t.rgb(t)||$t.hsl(t)},key:function(t){return!xq.hasOwnProperty(t)&&!MU.hasOwnProperty(t)&&t!=="targets"&&t!=="keyframes"}};function Rq(t){var i=/\(([^)]+)\)/.exec(t);return i?i[1].split(",").map(function(r){return parseFloat(r)}):[]}function Bq(t,i){var r=Rq(t),n=oc($t.und(r[0])?1:r[0],.1,100),a=oc($t.und(r[1])?100:r[1],.1,100),s=oc($t.und(r[2])?10:r[2],.1,100),o=oc($t.und(r[3])?0:r[3],.1,100),l=Math.sqrt(a/n),c=s/(2*Math.sqrt(a*n)),h=c<1?l*Math.sqrt(1-c*c):0,u=1,d=c<1?(c*l+-o)/h:-o+l;function A(m){var g=i?i*m/1e3:m;
11954return c<1?g=Math.exp(-g*c*l)*(u*Math.cos(h*g)+d*Math.sin(h*g)):g=(u+d*g)*Math.exp(-g*l),m===0||m===1?m:1-g}function f(){var m=_T.springs[t];if(m)return m;for(var g=1/6,p=0,v=0;;)if(p+=g,A(p)===1){if(v++,v>=16)break}else v=0;var _=p*g*1e3;return _T.springs[t]=_,_}return i?A:f}function gUe(t){return t===void 0&&(t=10),function(i){return Math.ceil(oc(i,1e-6,1)*t)*(1/t)}}var vUe=function(){var t=11,i=1/(t-1);function r(u,d){return 1-3*d+3*u}function n(u,d){return 3*d-6*u}function a(u){return 3*u}function s(u,d,A){return((r(d,A)*u+n(d,A))*u+a(d))*u}function o(u,d,A){return 3*r(d,A)*u*u+2*n(d,A)*u+a(d)}function l(u,d,A,f,m){var g,p,v=0;do p=d+(A-d)/2,g=s(p,f,m)-u,g>0?A=p:d=p;while(Math.abs(g)>1e-7&&++v<10);return p}function c(u,d,A,f){for(var m=0;m<4;++m){var g=o(d,A,f);if(g===0)return d;var p=s(d,A,f)-u;d-=p/g}return d}function h(u,d,A,f){if(!(0<=u&&u<=1&&0<=A&&A<=1))return;var m=new Float32Array(t);if(u!==d||A!==f)for(var g=0;g<t;++g)m[g]=s(g*i,u,A);function p(v){for(var _=0,y=1,w=t-1;y!==w&&m[y]<=v;++y)_+=i;--y;var b=(v-m[y])/(m[y+1]-m[y]),E=_+b*i,M=o(E,u,A);return M>=.001?c(v,E,u,A):M===0?E:l(v,_,_+i,u,A)}return function(v){return u===d&&A===f||v===0||v===1?v:s(p(v),d,f)}}return h}(),Iq=function(){var t={linear:function(){return function(n){return n}}},i={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var a,s=4;n<((a=Math.pow(2,--s))-1)/11;);return 1/Math.pow(4,3-s)-7.5625*Math.pow((a*3-2)/22-n,2)}},Elastic:function(n,a){n===void 0&&(n=1),a===void 0&&(a=.5);var s=oc(n,1,10),o=oc(a,.1,2);return function(l){return l===0||l===1?l:-s*Math.pow(2,10*(l-1))*Math.sin((l-1-o/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/o)}}},r=["Quad","Cubic","Quart","Quint","Expo"];return r.forEach(function(n,a){i[n]=function(){return function(s){return Math.pow(s,a+2)}}}
vendor: 4,582 bytes, line 11954
11954),Object.keys(i).forEach(function(n){var a=i[n];t["easeIn"+n]=a,t["easeOut"+n]=function(s,o){return function(l){return 1-a(s,o)(1-l)}},t["easeInOut"+n]=function(s,o){return function(l){return l<.5?a(s,o)(l*2)/2:1-a(s,o)(l*-2+2)/2}}}),t}();function xU(t,i){if($t.fnc(t))return t;var r=t.split("(")[0],n=Iq[r],a=Rq(t);switch(r){case"spring":return Bq(t,i);case"cubicBezier":return l2(vUe,a);case"steps":return l2(gUe,a);default:return l2(n,a)}}function Dq(t){try{var i=document.querySelectorAll(t);return i}catch{return}}function RM(t,i){for(var r=t.length,n=arguments.length>=2?arguments[1]:void 0,a=[],s=0;s<r;s++)if(s in t){var o=t[s];i.call(n,o,s,t)&&a.push(o)}return a}function BM(t){return t.reduce(function(i,r){return i.concat($t.arr(r)?BM(r):r)},[])}function MV(t){return $t.arr(t)?t:($t.str(t)&&(t=Dq(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function RU(t,i){return t.some(function(r){return r===i})}function BU(t){var i={};for(var r in t)i[r]=t[r];return i}function XL(t,i){var r=BU(t);for(var n in t)r[n]=i.hasOwnProperty(n)?i[n]:t[n];return r}function IM(t,i){var r=BU(t);for(var n in i)r[n]=$t.und(t[n])?i[n]:t[n];return r}function _Ue(t){var i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(t);return i?"rgba("+i[1]+",1)":t}function yUe(t){var i=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,r=t.replace(i,function(l,c,h,u){return c+c+h+h+u+u}),n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),a=parseInt(n[1],16),s=parseInt(n[2],16),o=parseInt(n[3],16);return"rgba("+a+","+s+","+o+",1)"}function EUe(t){var i=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),r=parseInt(i[1],10)/360,n=parseInt(i[2],10)/100,a=parseInt(i[3],10)/100,s=i[4]||1;function o(A,f,m){return m<0&&(m+=1),m>1&&(m-=1),m<1/6?A+(f-A)*6*m:m<1/2?f:m<2/3?A+(f-A)*(2/3-m)*6:A}var l,c,h;if(n==0)l=c=h=a;else{var u=a<.5?a*(1+n):a+n-a*n,d=2*a-u;l=o(d,u,r+1/3),c=o(d,u,r),h=o(d,u,r-1/3)}return"rgba("+l*255+","+c*255+","+h*255+","+s+")"}function wUe(t){if($t.rgb(t))return _Ue(t);if($t.hex(t))return yUe(t);if($t.hsl(t))return EUe(t)}function Ou(t){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(i)return i[1]}function bUe(t){if(ty(t,"translate")||t==="perspective")return"px";if(ty(t,"rotate")||ty(t,"skew"))return"deg"}function qL(t,i){return $t.fnc(t)?t(i.target,i.id,i.total):t}function ih(t,i){return t.getAttribute(i)}function IU(t,i,r){var n=Ou(i);if(RU([r,"deg","rad","turn"],n))return i;var a=_T.CSS[i+r];if(!$t.und(a))return a;var s=100,o=document.createElement(t.tagName),l=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;l.appendChild(o),o.style.position="absolute",o.style.width=s+r;var c=s/o.offsetWidth;l.removeChild(o);var h=c*parseFloat(i);return _T.CSS[i+r]=h,h}function Pq(t,i,r){if(i in t.style){var n=i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=t.style[i]||getComputedStyle(t).getPropertyValue(n)||"0";return r?IU(t,a,r):a}}function DU(t,i){if($t.dom(t)&&!$t.inp(t)&&(ih(t,i)||$t.svg(t)&&t[i]))return"attribute";if($t.dom(t)&&RU(mUe,i))return"transform";if($t.dom(t)&&i!=="transform"&&Pq(t,i))return"css";if(t[i]!=null)return"object"}function Lq(t){if($t.dom(t)){for(var i=t.style.transform||"",r=/(\w+)\(([^)]*)\)/g,n=new Map,a;a=r.exec(i);)n.set(a[1],a[2]);return n}}function SUe(t,i,r,n){var a=ty(i,"scale")?1:0+bUe(i),s=Lq(t).get(i)||a;return r&&(r.transforms.list.set(i,s),r.transforms.last=i),n?IU(t,s,n):s}function PU(t,i,r,n){switch(DU(t,i)){case"transform":return SUe(t,i,n,r);case"css":return Pq(t,i,r);case"attribute":return ih(t,i);default:return t[i]||0}}function LU(t,i){var r=/^(\*=|\+=|-=)/.exec(t);if(!r)return t;var n=Ou(t)||0,a=parseFloat(i),s=parseFloat(t.replace(r[0],""));switch(r[0][0]){case"+":return a+s+n;case"-":return a-s+n;case"*":return a*s+n}}function Oq(t,i){if($t.col(t))return wUe(t);if(/\s/g.test(t))return t;var r=Ou(t),n=r?t.substr(0,t.length-r.length):t;return i?n+i:n}function OU(t,i){return Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))}function CUe(t){return Math.PI*2*ih(t,"r")}function TUe(t){return ih(t,"width")*2+ih(t,"height")*2}function MUe(t){return OU({x:ih(t,"x1"),y:ih(t,"y1")},{x:ih(t,"x2"),y:ih(t,"y2")})}function Nq(t){for(var i=t.points,r=0,n,a=0;a<i.numberOfItems;a++){var s=i.getItem(a);a>0&&(r+=OU(n,s)),n=s}return r}function xUe(t){var i=t.points;return Nq(t)+OU(i.getItem(i.numberOfItems-1),i.getItem(0))}function Uq(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return CUe(t);
11954case"rect":return TUe(t);case"line":return MUe(t);case"polyline":return Nq(t);case"polygon":return xUe(t)}}function RUe(t){var i=Uq(t);return t.setAttribute("stroke-dasharray",i),i}function BUe(t){for(var i=t.parentNode;$t.svg(i)&&$t.svg(i.parentNode);)i=i.parentNode;return i}function Fq(t,i){var r=i||{},n=r.el||BUe(t),a=n.getBoundingClientRect(),s=ih(n,"viewBox"),o=a.width,l=a.height,c=r.viewBox||(s?s.split(" "):[0,0,o,l]);return{el:n,viewBox:c,x:c[0]/1,y:c[1]/1,w:o/c[2],h:l/c[3]}}function IUe(t,i){var r=$t.str(t)?Dq(t)[0]:t,n=i||100;return function(a){return{property:a,el:r,svg:Fq(r),totalLength:Uq(r)*(n/100)}}}function DUe(t,i){function r(l){l===void 0&&(l=0);var c=i+l>=1?i+l:0;return t.el.getPointAtLength(c)}var n=Fq(t.el,t.svg),a=r(),s=r(-1),o=r(1);switch(t.property){case"x":return(a.x-n.x)*n.w;case"y":return(a.y-n.y)*n.h;case"angle":return Math.atan2(o.y-s.y,o.x-s.x)*180/Math.PI}}function xV(t,i){var r=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=Oq($t.pth(t)?t.totalLength:t,i)+"";return{original:n,numbers:n.match(r)?n.match(r).map(Number):[0],strings:$t.str(t)||i?n.split(r):[]}}function kq(t){var i=t?BM($t.arr(t)?t.map(MV):MV(t)):[];return RM(i,function(r,n,a){return a.indexOf(r)===n})}function Hq(t){var i=kq(t);return i.map(function(r,n){return{target:r,id:n,total:i.length,transforms:{list:Lq(r)}}})}function PUe(t,i){var r=BU(i);if(/^spring/.test(r.easing)&&(r.duration=Bq(r.easing)),$t.arr(t)){var n=t.length,a=n===2&&!$t.obj(t[0]);a?t={value:t}:$t.fnc(i.duration)||(r.duration=i.duration/n)}var s=$t.arr(t)?t:[t];return s.map(function(o,l){var c=$t.obj(o)&&!$t.pth(o)?o:{value:o};return $t.und(c.delay)&&(c.delay=l?0:i.delay),$t.und(c.endDelay)&&(c.endDelay=l===s.length-1?i.endDelay:0),c}).map(function(o){return IM(o,r)})}function LUe(t){for(var i=RM(BM(t.map(function(s){return Object.keys(s)})),function(s){return $t.key(s)}).reduce(function(s,o){return s.indexOf(o)<0&&s.push(o),s},[]),r={},n=function(s){var o=i[s];r[o]=t.map(function(l){var c={};for(var h in l)$t.key(h)?h==o&&(c.value=l[h]):c[h]=l[h];return c})},a=0;a<i.length;a++)n(a);return r}function OUe(t,i){var r=[],n=i.keyframes;n&&(i=IM(LUe(n),i));for(var a in i)$t.key(a)&&r.push({name:a,tweens:PUe(i[a],t)});return r}function NUe(t,i){var r={};for(var n in t){var a=qL(t[n],i);$t.arr(a)&&(a=a.map(function(s){return qL(s,i)}),a.length===1&&(a=a[0])),r[n]=a}return r.duration=parseFloat(r.duration),r.delay=parseFloat(r.delay),r}function UUe(t,i){var r;return t.tweens.map(function(n){var a=NUe(n,i),s=a.value,o=$t.arr(s)?s[1]:s,l=Ou(o),c=PU(i.target,t.name,l,i),h=r?r.to.original:c,u=$t.arr(s)?s[0]:h,d=Ou(u)||Ou(c),A=l||d;return $t.und(o)&&(o=h),a.from=xV(u,A),a.to=xV(LU(o,u),A),a.start=r?r.end:0,a.end=a.start+a.delay+a.duration+a.endDelay,a.easing=xU(a.easing,a.duration),a.isPath=$t.pth(s),a.isColor=$t.col(a.from.original),a.isColor&&(a.round=1),r=a,a})}var Gq={css:function(t,i,r){return t.style[i]=r},attribute:function(t,i,r){return t.setAttribute(i,r)},object:function(t,i,r){return t[i]=r},transform:function(t,i,r,n,a){if(n.list.set(i,r),i===n.last||a){var s="";n.list.forEach(function(o,l){s+=l+"("+o+") "}),t.style.transform=s}}};function zq(t,i){var r=Hq(t);r.forEach(function(n){for(var a in i){var s=qL(i[a],n),o=n.target,l=Ou(s),c=PU(o,a,l,n),h=l||Ou(c),u=LU(Oq(s,h),c),d=DU(o,a);Gq[d](o,a,u,n.transforms,!0)}})}function FUe(t,i){var r=DU(t.target,i.name);if(r){var n=UUe(i,t),a=n[n.length-1];return{type:r,property:i.name,animatable:t,tweens:n,duration:a.end,delay:n[0].delay,endDelay:a.endDelay}}}function kUe(t,i){return RM(BM(t.map(function(r){return i.map(function(n){return FUe(r,n)})})),function(r){return!$t.und(r)})}function Qq(t,i){var r=t.length,n=function(s){return s.timelineOffset?s.timelineOffset:0},a={};return a.duration=r?Math.max.apply(Math,t.map(function(s){let o=s.startOnceDelay??0,l=s.pingPongDelayCorrection??0,c=s.pingPongEndDelayCorrection??0;return n(s)+o+l+c+s.duration*(s.loop??1)})):i.duration,a.delay=r?Math.min.apply(Math,t.map(function(s){let o=s.startOnceDelay??0,l=s.pingPongDelayCorrection??0;return n(s)+o+l+s.delay})):i.delay,a.endDelay=r?a.duration-Math.max.apply(Math,t.map(function(s){let o=s.startOnceDelay??0,l=s.pingPongDelayCorrection??0,c=s.pingPongEndDelayCorrection??0;return n(s)+o+l+s.duration*(s.loop??1)-s.endDelay-c})):i.endDelay,a}var RV=0;function HUe(t){var i=XL(xq,t),r=XL(MU,t),n=OUe(r,t),a=Hq(t.targets),s=kUe(a,n),o=Qq(s,r),l=RV;return RV++,IM(i,{id:l,children:[],animatables:a,animations:s,duration:o.duration,delay:o.delay,endDelay:o.endDelay,startOnceDelay:r.startOnceDelay,pingPongDelayCorrection:r.pingPongDelayCorrection,pingPongEndDelayCorrection:r.pingPongEndDelayCorrection})}var _l=[],BV=[],kS,GUe=function(){function t(){kS=requestAnimationFrame(i)}function i(r){var n=_l.length;if(n){for(var a=0;a<n;){var s=_l[a];s.paused?(_l.splice(a,1),n-=1):(s.tick(r),a++)}t()}else kS=cancelAnimationFrame(kS)}return t}();function zUe(t){document.hidden?(_l.forEach(function(i){return i.pause(t.timeStamp)}),BV=_l.slice(0),bn.running=_l=[]):BV.forEach(function(i){return i.play(t.t
11954imeStamp)})}typeof document<"u"&&document.addEventListener("visibilitychange",zUe);function bn(t){t===void 0&&(t={});var i=0,r=0,n=0,a,s,o=0,l=null;function c(E){var M=window.Promise&&new Promise(function(S){return l=S});return E.finished=M,M}var h=HUe(t);c(h);function u(){var E=h.direction;E!=="alternate"&&(h.direction=E!=="normal"?"normal":"reverse"),h.reversed=!h.reversed,s.forEach(function(M){(M.loop===1||M.loop%2===0)&&(M.reversed=h.reversed)})}function d(){h.direction="normal",h.reversed=!1,s.forEach(function(E){return E.reversed=!1})}function A(E){return h.reversed?h.duration-E:E}function f(){i=0,r=A(h.currentTime)*(1/bn.speed)}function m(E,M,S=!1){M&&(h.reversed?M.seek(M.duration*M.loop-(E-M.timelineOffset-M.pingPongDelayCorrection),S):M.seek(E-M.timelineOffset-M.startOnceDelay-M.pingPongDelayCorrection,S))}function g(E,M=!1){if(h.reversed)for(var S=o;S--;)m(E,s[S],M);else for(var T=0;T<o;T++)m(E,s[T],M)}function p(E){var K,X,N,k,Z,V,re,Ae,pe,ce;var M=0,S=h.animations,T=S.length;for(h.direction!=="alternate"&&((K=h.parent)==null?void 0:K.direction)==="alternate"?((X=h.parent)==null?void 0:X.rewind)===!1&&h.reversePlayback===!0&&h.rewind===!1&&((N=h.parent)!=null&&N.reversed&&h.direction==="alternate"?E=h.duration-h.delay+h.endDelay-E:E=h.duration+h.delay-h.endDelay-E):w(!1,(k=h.parent)==null?void 0:k.rewind,h.rewind,(Z=h.parent)==null?void 0:Z.reversePlayback,h.reversePlayback)&&((V=h.parent)!=null&&V.reversed&&h.direction==="alternate"?E=h.duration-h.delay+h.endDelay-E:E=h.duration+h.delay-h.endDelay-E);M<T;){var C=S[M],x=C.animatable,R=C.tweens,L=R.length-1,I=R[L];L&&(I=RM(R,function(me){return E<me.end})[0]||I);let _e;(re=h.parent)!=null&&re.reversed&&h.direction==="alternate"?_e=oc(E-I.start-I.endDelay,0,I.duration)/I.duration:_e=oc(E-I.start-I.delay,0,I.duration)/I.duration;for(var F=isNaN(_e)?1:I.easing(_e),Y=I.to.strings,D=I.round,U=[],j=I.to.numbers.length,J=void 0,z=0;z<j;z++){var $=void 0;let me,le;h.direction!=="alternate"?((Ae=h.parent)==null?void 0:Ae.rewind)===!1&&h.reversePlayback===!0&&h.rewind===!1?(me=I.to.numbers[z],le=I.from.numbers[z]||0):(le=I.to.numbers[z],me=I.from.numbers[z]||0):w(!0,(pe=h.parent)==null?void 0:pe.rewind,h.rewind,(ce=h.parent)==null?void 0:ce.reversePlayback,h.reversePlayback)?(me=I.to.numbers[z],le=I.from.numbers[z]||0):(le=I.to.numbers[z],me=I.from.numbers[z]||0),I.isPath?$=DUe(I.value,F*le):$=me+F*(le-me),D&&(I.isColor&&z>2||($=Math.round($*D)/D)),U.push($)}var te=Y.length;if(!te)J=U[0];else{J=Y[0];for(var ae=0;ae<te;ae++){Y[ae];var ve=Y[ae+1],oe=U[ae];isNaN(oe)||(ve?J+=oe+ve:J+=oe+" ")}}Gq[C.type](x.target,C.property,J,x.transforms),C.currentValue=J,M++}}function v(E){h[E]&&!h.passThrough&&h[E](h)}function _(){h.remaining&&h.remaining!==!0&&h.remaining--}let y={0:!1,1:!0,2:!1,3:!0,4:!1,5:!1,6:!1,7:!1,8:!1,9:!0,10:!0,11:!1,12:!1,13:!1,14:!0,15:!0,16:!1,17:!0,18:!0,19:!1,20:!1,21:!1,22:!0,23:!0,24:!1,25:!0,26:!1,27:!0,28:!1,29:!1,30:!1,31:!1};function w(E,M,S,T,C){return y[E<<4|M<<3|S<<2|T<<1|C]}function b(E,M=!1){var R;var S=h.duration;let T=h.delay,C=S-h.endDelay;(R=h.parent)!=null&&R.reversed&&h.direction==="alternate"&&(T=h.endDelay,C=S-h.delay);var x=A(E);if(h.progress=oc(x/S*100,0,100),M||(h.reversePlayback=x<h.currentTime),o&&g(x,M),!h.began&&h.currentTime>=0&&(h.began=!0,v("begin")),!h.loopBegan&&h.currentTime>0&&(h.loopBegan=!0,v("loopBegin")),(h.reversed||x>=0)&&x<=T&&h.currentTime!==0&&(p(0),v("change")),(x>=C&&h.currentTime!==S+h.pingPongDelayCorrection||!S)&&(p(S),v("change")),x>T&&x<C?(h.changeBegan||(h.changeBegan=!0,h.changeCompleted=!1,v("changeBegin")),p(x),v("change")):h.changeBegan?(h.changeCompleted=!0,h.changeBegan=!1,v("change"),o&&v("timelineChangeComplete")):h.began&&x>C&&v("changeComplete"),h.currentTime=oc(x,0,S+h.pingPongDelayCorrection),h.began&&v("update"),E>=S)if(_(),!h.remaining)h.paused=!0,h.completed||(h.completed=!0,v("loopComplete"),v("complete"),!h.passThrough&&"Promise"in window&&(l(),c(h)));else{o?i+=h.duration/bn.speed:i+=h.duration;for(let L of s)L.setStartTime(0),L.remaining=L.loop;v("loopComplete"),h.loopBegan=!1,h.direction==="alternate"?u():o&&d()}}return h.reset=function(){var E=h.direction;h.passThrough=!1,h.currentTime=0,h.progress=0,h.paused=!0,h.began=!1,h.loopBegan=!1,h.changeBegan=!1,h.completed=!1,h.changeCompleted=!1,h.reversePlayback=!1,h.reversed=E==="reverse",h.remaining=h.loop,s=h.children,o=s.length;for(var M=o;M--;)h.children[M].reset();p(h.reversed?h.duration:0)},h.setStartTime=function(E){i=E},h.set=function(E,M){return zq(E,M),h},h.tick=function(E){n=E,i||(i=n),b((n+(r-i))*bn.speed)},h.seek=function(E,M=!1){b(E-i,M)},h.pause=function(E){h.paused=!0,o&&(a=E??performance.now())},h.play=function(E){!h.paused||(h.completed&&h.reset(),h.paused=!1,_l.push(h),o&&a!==void 0&&(i+=(E??performance.now())-a),kS||GUe())},h.reverse=function(){u(),h.completed=!h.reversed,f()},h.restart=function(){h.reset(),h.play()},h.reset(),h.autoplay&&h.play(),h}function IV(t,i){for(var r=i.length;r--;)RU(t,i[r].animatable.target)&&i.splice(r,1)}function QUe(t){for(var i=kq(t),r=_l.length;r--;){var n=_l[r],a=n.animations,s=n.children;IV(i,a);for(var o=s.length;o--;){var l=s[o],c=l.animations;IV(i,c),!c.length&&!l.children.length&&s.splice(o,1)}!a.length&&!s.length&&n.pause()}}function VUe(t,i){i===void 0&&(i={});var r=i.direction||"normal",n=i.easing?xU(i.easing):null,a=i.grid,s=i.axis,o=i.from||0,l=o==="first",c=o==="center",h=o==="last",u=$t.arr(t),d=parseFloat(u?t[0]:t),A=u?parseFloat(t[1]):0,f=Ou(u?t[1]:t)||0,m=i.start||0+(u?d:0),g=[],p=0;return function(v,_,y){if(l&&(o=0),c&&(o=(y-1)/2),h&&(o=y-1),!g.length){for(var w=0;w<y;w++){if(!a)g.push(Math.abs(o-w));else{var b=c?(a[0]-1)/2:o%a[0],E=c?(a[1]-1)/2:Math.floor(o/a[0]),M=w%a[0],S=Math.floor(w/a[0]),T=b-M,C=E-S,x=Math.sqrt(T*T+C*C);s==="x"&&(x=-T),s==="y"&&(x=-C),g.push(x)}p=Math.max.apply(Math,g)}n&&(g=g.map(function(L){return n(L/p)*p})),r==="reverse"&&(g=g.map(function(L){return s?L<0?L*-1:-L:Math.abs(p-L)}))}var R=u?(A-d)/p:d;return m+R*(Math.round(g[_]*100)/100)+f}}function WUe(t){t===void 0&&(t={});var i=bn(t);return i.duration=0,i.add=function(r,n){var a=_l.indexOf(i),s=i.children;a>-1&&_l.splice(a,1);function o(A){A.passThrough=!0}for(var l=0;l<s.length;l++)o(s[l]);var c=IM(r,XL(MU,t));c.targets=c.targets||t.targets;var h=i.duration;c.autoplay=!1,c.timelineOffset=$t.und(n)?h:LU(n,h),o(i);var u=bn(c);o(u),s.push(u),u.parent=i;var d=Qq(s,t);return i.delay=d.delay,i.endDelay=d.endDelay,i.duration=d.duration,u.loop===!0&&(i.duration=1/0),i.seek(0),i.reset(),i.autoplay&&i.play(),i},i}bn.version="3.2.0";bn.speed=1;bn.running=_l;bn.remove=QUe;bn.get=PU;bn.set=zq;bn.convertPx=IU;bn.path=IUe;bn.setDashoffset=RUe;bn.stagger=VUe;bn.timeline=WUe;
vendor: 4,786 bytes, line 11954
11954bn.easing=xU;bn.penner=Iq;bn.random=function(t,i){return Math.floor(Math.random()*(i-t+1))+t};var Vq=bn,DV=new O,PV=new O,LV=new ri;function jUe(t,i,r,n){if(n===0)return r.copy(t);if(n===1)return r.copy(i);let a=t.w*i.w+t.x*i.x+t.y*i.y+t.z*i.z;if(a>=1)return r.copy(t);let s=1-a*a;if(s<=Number.EPSILON){let u=1-n;return r.w=u*t.w+n*i.w,r.x=u*t.x+n*i.x,r.y=u*t.y+n*i.y,r.z=u*t.z+n*i.z,r.normalize(),r}let o=Math.sqrt(s),l=Math.atan2(o,a),c=Math.sin((1-n)*l)/o,h=Math.sin(n*l)/o;return r.w=t.w*c+i.w*h,r.x=t.x*c+i.x*h,r.y=t.y*c+i.y*h,r.z=t.z*c+i.z*h,r}function Oa(t,i,r,n,a,s){let o=r[t]!==void 0?r[t]:void 0,l=n[t];if(l==null)return;let c=o!=null?typeof o=="string"?Number(a.getVariable(o)??0):o:i[t],h=typeof l=="string"?Number(a.getVariable(l)??0):l;if(c!==h)return{update:u=>{let d=Ct.lerp(c,h,u);s?i[t]=Math.trunc(d):i[t]=d},start:()=>{i[t]=c},end:()=>{i[t]=h}}}function NU(t,i,r,n,a,s){let o=r[t]?r[t]:void 0,l=n[t];if(!l)return;let c=i[t],h=[...o??c].map(d=>typeof d=="string"?Number(a.getVariable(d)??0):d),u=[...l].map(d=>typeof d=="string"?Number(a.getVariable(d)??0):d);if(!(h.length!==u.length||ON(h,u)))return{update:d=>{h.forEach((A,f)=>{let m=Ct.lerp(A,u[f],d);i[t][f]=s?Math.trunc(m):m})},start:()=>{Object.assign(i[t],h)},end:()=>{Object.assign(i[t],u)}}}function yT(t,i,r){return i.forEach((n,a)=>{t.setComponent(a,typeof n=="string"?Number(r.getVariable(n)??0):n)}),t}function OV(t,i,r,n,a){let s=r[t]?r[t]:void 0,o=n[t];if(!o)return;let l=i[t],c=s?yT(new O,s,a):l.clone(),h=yT(new O,o,a);if(!c.equals(h))return{update:u=>{l.lerpVectors(c,h,u)},start:()=>{l.copy(c)},end:()=>{l.copy(h)}}}function NV(t,i,r){return i.forEach((n,a)=>{t.setComponent(a,typeof n=="string"?Number(r.getVariable(n)??0):n)}),t}function ET(t,i,r,n,a){let s=r[t]?r[t]:void 0,o=n[t];if(!o)return;let l=i[t],c=!(l instanceof Me),h=l instanceof Me?l:new Me().fromArray(l),u=s?NV(new Me,s,a):h.clone(),d=NV(new Me,o,a);if(!u.equals(d))return{update:A=>{h.lerpVectors(u,d,A),c&&(i[t]=h.toArray())},start:()=>{h.copy(u),c&&(i[t]=h.toArray())},end:()=>{h.copy(d),c&&(i[t]=h.toArray())}}}function YUe(t,i,r,n){let a=r[t]?r[t]:void 0,s=n[t];if(!s)return;let o=i[t],l=a?new ht().fromArray(a):o.clone(),c=new O,h=new ri,u=new O;l.decompose(c,h,u);let d=new ht().fromArray(s),A=new O,f=new ri,m=new O;if(d.decompose(A,f,m),!l.equals(d))return{update:g=>{LV.slerpQuaternions(h,f,g),DV.lerpVectors(c,A,g),PV.lerpVectors(u,m,g),o.compose(DV,LV,PV)},start:()=>{o.compose(c,h,u)},end:()=>{o.compose(A,f,m)}}}function KUe(t,i,r,n,a){let s=r[t]?r[t]:void 0,o=n[t];if(!o)return;let l=i[t],c=s?typeof s=="string"?a.getColor(s).clone():new Ht().setRGB(s.r,s.g,s.b):l.clone(),h=typeof o=="string"?a.getColor(o).clone():new Ht().setRGB(o.r,o.g,o.b);if(c.equals(h))return;let u=l.clone();return i[t]=u,{update:d=>{u.lerpColors(c,h,d)},start:()=>{u.copy(c)},end:()=>{u.copy(h)}}}function Zb(t,i,r,n,a){let s=r[t]?r[t]:void 0,o=n[t];if(!o)return;let l=i[t],c=new Xa(l.r,l.g,l.b,l.a),h=s?typeof s=="string"?a.getColor(s).clone():new Xa(s.r,s.g,s.b,s.a):c.clone(),u=typeof o=="string"?a.getColor(o).clone():new Xa(o.r,o.g,o.b,o.a);if(!h.equals(u))return{update:d=>{c.lerpColors(h,u,d);let A=Ct.lerp(h.a,u.a,d);c.a=A,i[t]={r:c.r,g:c.g,b:c.b,a:c.a}},start:()=>{c.copy(h)},end:()=>{c.copy(u)}}}function jA(t,i,r,n,a){if(typeof i[t]=="number")return Oa(t,i,r??{},n,a);if(Array.isArray(i[t]))return NU(t,i,r??{},n,a)}function XUe(t,i,r,n){var l,c,h,u;let a=[],s=t.cameraType==="OrthographicCamera"?(l=i.orthographic)==null?void 0:l.zoom:(c=i.perspective)==null?void 0:c.zoom,o=t.cameraType==="OrthographicCamera"?(h=r.orthographic)==null?void 0:h.zoom:(u=r.perspective)==null?void 0:u.zoom;if(o!==void 0){let d=s??t.zoom,A=o;d!==A&&a.push({update:f=>{t.zoom=Ct.lerp(d,A,f),t.updateProjectionMatrix()},start:()=>{t.zoom=d,t.updateProjectionMatrix()},end:()=>{t.zoom=A,t.updateProjectionMatrix()}})}if(r.targetOffset!==void 0){let d=Oa("targetOffset",t,i,r,n);d&&a.push(d)}return a}function qUe(t,i,r,n){if(r.scaleBaked===void 0)return;let a=(i.scaleBaked??t.data.geometry.scaleBaked).map(l=>typeof l=="string"?Number(n.getVariable(l)??0):l),s=r.scaleBaked.map(l=>typeof l=="string"?Number(n.getVariable(l)??0):l);if(ip.isEqual(a,s))return;let o=[];return o.push({update:l=>{t.updateGeometryInteractions({scaleBaked:[Ct.lerp(a[0],s[0],l),Ct.lerp(a[1],s[1],l),Ct.lerp(a[2],s[2],l)]},n),t.invalidateDownstreamBooleanData(),t.refreshAttachedClonersInteractions()},start:()=>{t.updateGeometryInteractions({scaleBaked:a},n),t.invalidateDownstreamBooleanData(),t.refreshAttachedClonersInteractions()},end:()=>{t.updateGeometryInteractions({scaleBaked:s},n),t.invalidateDownstreamBooleanData(),t.refreshAttachedClonersInteractions()}}),o}function ZUe(t,i,r,n){if(!r.extrusion)return;let a=t.extrusion,s=i.extrusion??{},o=r.extrusion,l=[];
11954return TK.forEach(c=>{let h=jA(c,a,s,o,n);h&&l.push(h)}),l}function JUe(t,i,r,n){let a=[];if(!("geometry"in r))return a;let s=t.geometry.userData.parameters,o="geometry"in i?i.geometry:{},l=r.geometry;if(t instanceof Yy){let c=qUe(t,o,l,n);c&&a.push(...c)}else{let c={};if(Object.assign(c,Pu(s,cQ)),cQ.forEach(h=>{let u=jA(h,c,o,l,n);u&&a.push(u)}),t instanceof yU){Object.assign(c,{extrusion:{...s.extrusion}});let h=ZUe(c,o,l,n);h&&a.push(...h)}a.length&&a.push({update:h=>{t.updateGeometryInteractions(c,n),t.updateGeometryGroupsIfNeeded(),t.refreshAttachedClonersInteractions()},start:h=>{t.updateGeometryInteractions(c,n),t.updateGeometryGroupsIfNeeded(),t.refreshAttachedClonersInteractions()},end:h=>{t.updateGeometryInteractions(c,n),t.updateGeometryGroupsIfNeeded(),t.refreshAttachedClonersInteractions()}})}return a}function $Ue(t,i,r,n){let a=[];if(r.intensity!==void 0){let s=Oa("intensity",t,i,r,n);s&&a.push(s)}if(r.color!==void 0){let s=KUe("color",t,i,r,n);s&&a.push(s)}return a}function e3e(t,i,r,n){let a=[];if(Array.isArray(t.material)){if(!("materials"in r&&r.materials))return a;let s="materials"in i&&i.materials?i.materials:[],o=r.materials;t.material.forEach((l,c)=>{if(!o[c])return;let h=s[c]??{},u=o[c];typeof h=="string"||typeof u=="string"||a.push(...UV(l,h,u,n))})}else{if(!("material"in r&&r.material))return a;let s="material"in i&&i.material?i.material:{},o=r.material;if(typeof s=="string"||typeof o=="string")return a;a.push(...UV(t.material,s,o,n))}return a}function UV(t,i,r,n){var o;let a=[],s=pg(r,n)||!!i.layers&&pg(i,n);a.push(c3e(t,s));for(let l of t.layers){let c=(o=i.layers)==null?void 0:o.data(l.uuid),h=r.layers.data(l.uuid);if(!h||l.type!=="light"&&(!(l.visible??!0)||!(h.visible??!0)))continue;let u=l.getNames().filter(d=>!bK.some(A=>d.includes(A)));for(let d of u)try{let A=l.getValue(d),f;if(d==="colors")f=o3e(l,c,h,d);else if(Array.isArray(A))d==="steps"&&(f=s3e(l,c,h,d));else if(typeof A=="number")f=t3e(l,c,h,d,n);else{if(typeof A=="boolean")continue;A instanceof Me?f=i3e(l,c,h,d):A instanceof O?f=r3e(l,c,h,d,n):A instanceof Xa?f=a3e(l,c,h,d,n):A instanceof Ht?f=n3e(l,c,h,d,n):"isTexture"in A&&(f=l3e(l,c,h,d))}f&&(Array.isArray(f)?a.push(...f):a.push(f))}catch(A){console.error(`lerpMaterial: unexpected material layer for ${d}`,A)}}return a}function t3e(t,i,r,n,a){if(!t.hasValue(n)||!(n in r))return;let s=i?i[n]:t.getValue(n),o=r[n],l=typeof s=="string"?Number(a.getVariable(s)??0):s,c=typeof o=="string"?Number(a.getVariable(o)??0):o;if(l!==c)return{update:h=>{t.setValue(n,Ct.lerp(l,c,h))},start:()=>{t.setValue(n,l)},end:()=>{t.setValue(n,c)}}}function i3e(t,i,r,n){if(!t.hasValue(n)||!(n in r))return;let a=t.getValue(n),s=i?new Me().fromArray(i[n]):a.clone(),o=new Me().fromArray(r[n]);if(!s.equals(o))return{update:l=>{a.lerpVectors(s,o,l)},start:()=>{a.copy(s)},end:()=>{a.copy(o)}}}function r3e(t,i,r,n,a){if(!t.hasValue(n)||!(n in r))return;let s=t.getValue(n),o=i?i[n]:void 0,l=r[n],c=o?yT(new O,o,a):s.clone(),h=yT(new O,l,a);if(!c.equals(h))return{update:u=>{s.lerpVectors(c,h,u)},start:()=>{s.copy(c)},end:()=>{s.copy(h)}}}function n3e(t,i,r,n,a){if(!t.hasValue(n)||!(n in r))return;let s=i?i[n]:void 0,o=r[n],l=t.getValue(n),c=s?typeof s=="string"?a.getColor(s).clone():new Ht().setRGB(s.r,s.g,s.b):l.clone(),h=typeof o=="string"?a.getColor(o).clone():new Ht().setRGB(o.r,o.g,o.b);if(c.equals(h))return;let u=l.clone();return{update:d=>{t.getValue(n)!==u&&t.setValue(n,u),u.lerpColors(c,h,d)},start:()=>{u.copy(c)},end:()=>{u.copy(h)}}}function a3e(t,i,r,n,a){if(!t.hasValue(n)||!(n in r))return;let s=i?i[n]:void 0,o=r[n],l=t.getValue(n),c=s?typeof s=="string"?a.getColor(s).clone():new Ht().setRGB(s.r,s.g,s.b):l.clone(),h=typeof o=="string"?a.getColor(o).clone():new Xa(o.r,o.g,o.b,o.a);if(c.equals(h))return;let u=l.clone();return{update:d=>{t.getValue(n)!==u&&t.setValue(n,u),u.lerpColors(c,h,d)},start:()=>{u.copy(c)},end:()=>{u.copy(h)}}}function s3e(t,i,r,n="steps"){if(!t.hasValue(n)||!(n in r))return;let a=[],s=t.getValue(n),o=i?i[n]:s,l=r[n];return ON(o,l)||a.push({update:c=>{let h=[...s];for(let u=0;u<s.length;++u){let d=o[u],A=l[u];h[u]=Ct.lerp(d,A,c)}t.setValue(n,h)},start:()=>{t.setValue(n,o)},end:()=>{t.setValue(n,l)}}),a.length?a:void 0}function o3e(t,i,r,n="colors"){if(!t.hasValue(n)||!(n in r))return;let a=[],s=t.getValue(n),o=i?i[n]:s.map(c=>c.toArray()),l=r[n];for(let c=0;c<s.length;++c){let h=[...o[c]],u=[...l[c]];KC.isEqual(h,u)||a.push({update:d=>{s[c].fromArray(KC.lerp(h,u,d))},start:()=>{s[c].fromArray(h)},end:()=>{s[c].fromArray(u)}})}return a.length?a:void 0}function l3e(t,i,r,n="texture"){var p,v;if(!t.hasValue(n)||!(n in r))return;let a=t.getNode("rotation"),s=((p=i==null?void 0:i[n])==null?void 0:p.rotation)??0,o=((v=r[n])==null?void 0:v.rotation)??0;if(a&&s!==o)return{update:_=>{a.value=Ct.lerp(s,o,_)*Ct.DEG2RAD},start:()=>{a.value=s*Ct.DEG2RAD},end:()=>{a.value=o*Ct.DEG2RAD}};let l=t.getNode("mat");if(!l)return;let c=i?i[n]:l,h=r[n],u=[...c.repeat],d=[...c.offset],A=[...h.repeat],f=[...h.offset],m=c.rotation??0,g=h.rotation??0;if(!Mu.isEqual(u,A)||!Mu.isEqual(d,f)||m!==g)return{update:_=>{l.repeat=Mu.lerp(u,A,_),l.offset=Mu.lerp(d,f,_),l.rotation=Ct.lerp(m,g,_),l.updateMatrix()},start:()=>{l.repeat=[...u],l.offset=[...d],l.rotation=m,l.updateMatrix()},end:()=>{l.repeat=[...A],l.offset=[...f],l.rotation=g,l.updateMatrix()}}}function c3e(t,i){return{update:()=>{t.transparent=i}}}var c2=new O,FV=new qn;function h3e(t,i,r,n,a){var m,g,p,v,_,y;let s=[],o,l,c,h,u,d,A,f;if(t instanceof Ca?(o=ET("position",t,i,r,a),o&&s.push(o),c=Oa("rotation",t,i,r,a),c&&s.push(c),h=ET("shear",t,i,r,a),h&&s.push(h)):(f={slide:((m=i.pathSnapping)==null?void 0:m.slide)??((g=t.updatedPathSnapping)==null?void 0:g.slide)??((p=t.dataPatched.pathSnapping)==null?void 0:p.slide)??0,offset:((v=i.pathSnapping)==null?void 0:v.offset)??((_=t.updatedPathSnapping)==null?void 0:_.offset)??((y=t.dataPatched.pathSnapping)==null?void 0:y.offset)??0},d=Oa("slide",f,i.pathSnapping??t.updatedPathSnapping??t.dataPatched.pathSnapping,r.pathSnapping??t.dataPatched.pathSnapping,a),d&&s.push(d),A=Oa("offset",f,i.pathSnapping??t.updatedPathSnapping??t.dataPatched.pathSnapping,r.pathSnapping??t.dataPatched.pathSnapping,a),A&&s.push(A),!d&&!A&&(o=OV("position",t,i,r,a),o&&s.push(o),l=OV("scale",t,i,r,a),l&&s.push(l),c=u3e(t,i,r,n,a),c&&s.push(c),u=YUe("hiddenMatrix",t,i,r),u&&s.push(u))),o||l||c||u||d||A){let w=t instanceof Ca?()=>{t.updateWorldMatrix(!0)}:()=>{var b;t.updateMatrix(),t.hasNonUniformScale&&(t.updateMatrixWorld(),t.updateMatrixWorldSVD()),(b=t.parent)!=null&&b.matrixWorldFusedFalse&&(t.matrixWorld.multiplyMatrices(t.parent.matrixWorldFusedFalse,t.matrix),t.matrixWorldNeedsUpdate=!1),$l(t)&&xu(t.parent)&&t.invalidateDownstreamBooleanData(!0),t.updatePathSnapping(Object.assign({},i.pathSnapping,f))};s.push({update:w,start:w,end:w})}return s}function u3e(t,i,r,n,a){var u;let s=i!=null&&i.rotation?i.rotation.map(d=>
11954(typeof d=="string"?Number(a.getVariable(d)??0):d)*Ct.DEG2RAD):void 0,o=(u=r.rotation)==null?void 0:u.map(d=>(typeof d=="string"?Number(a.getVariable(d)??0):d)*Ct.DEG2RAD);if(!o)return;let l=s?new O().fromArray(s):new O().setFromEuler(t.rotation),c=new O().fromArray(o);if(l.equals(c))return;let h=c2.subVectors(c,l);if(n&&h.toArray().every(d=>Math.abs(d)<2*Math.PI)){let d=new ri().setFromEuler(FV.setFromVector3(l)),A=new ri().setFromEuler(FV.setFromVector3(c));return{update:f=>{jUe(d,A,t.quaternion,f)},start:()=>{t.rotation.setFromVector3(l)},end:()=>{t.rotation.setFromVector3(c)}}}else return{update:d=>{c2.lerpVectors(l,c,d),t.rotation.setFromVector3(c2)},start:()=>{t.rotation.setFromVector3(l)},end:()=>{t.rotation.setFromVector3(c)}}}function d3e(t,i,r,n){let a=[];if(!("cloner"in r)||!t.cloner)return a;let s=t.cloner,o="cloner"in i?i.cloner:{},l=r.cloner;gK.forEach(f=>{let m;f==="count"?m=Oa("count",s.parameters,o,l,n,!0):m=jA(f,s.parameters,o??{},l,n),m&&a.push(m)});let c=A3e(s,o,l,n);c!=null&&c.length&&a.push(...c);let h=f3e(s,o,l,n);h!=null&&h.length&&a.push(...h);let u=p3e(s,o,l,n);u!=null&&u.length&&a.push(...u);let d=m3e(s,o,l,n);d!=null&&d.length&&a.push(...d);let A=g3e(s,o,l,n);return A!=null&&A.length&&a.push(...A),a.length&&a.push({update:()=>{s.update()}}),a}function A3e(t,i,r,n){if(t.parameters.type!=="radial")return;let a=i.radial,s=r.radial;if(!s)return;let o=t.parameters.radial,l=[];return vK.forEach(c=>{let h=jA(c,o,a??{},s,n);h&&l.push(h)}),l}function f3e(t,i,r,n){if(t.parameters.type!=="linear")return;let a=i.linear,s=r.linear;if(!s)return;let o=[],l=t.parameters.linear;return _K.forEach(c=>{let h=jA(c,l,a??{},s,n);h&&o.push(h)}),o}function p3e(t,i,r,n){if(t.parameters.type!=="grid")return;let a=i.grid,s=r.grid;if(!s)return;let o=[],l=t.parameters.grid;return yK.forEach(c=>{let h;c==="count"?h=NU(c,l,a??{},s,n,!0):h=jA(c,l,a??{},s,n),h&&o.push(h)}),o}function m3e(t,i,r,n){if(t.parameters.type!=="toObject")return;let a=i.toObject,s=r.toObject;if(!s)return;let o=[],l=t.parameters.toObject;return EK.forEach(c=>{let h;c==="count"?h=Oa(c,l,a??{},s,n,!0):h=jA(c,l,a??{},s,n),h&&o.push(h)}),o}function g3e(t,i,r,n){if(!t.parameters.randomness)return;let a=i.randomnessObject,s=r.randomnessObject;if(!s)return;let o=[],l=t.parameters.randomnessObject;return wK.forEach(c=>{let h=jA(c,l,a??{},s,n);h&&o.push(h)}),o}function v3e(t,i){return{update:()=>{t instanceof ga&&(t.fill.enabled=i)}}}function _3e(t,i){return{update:()=>{t instanceof ga&&(t.stroke.enabled=i)}}}function y3e(t,i){return{update:()=>{t instanceof ga&&(t.dropShadow.enabled=i)}}}function E3e(t,i){return{update:()=>{t instanceof ga&&(t.innerShadow.enabled=i)}}}function w3e(t,i){return{update:()=>{t instanceof ga&&(t.backgroundBlur.enabled=i)}}}function b3e(t,i){return{update:()=>{t instanceof ga&&(t.layerBlur.enabled=i)}}}function S3e(t,i,r,n,a){let s=[],o,l,c,h,u,d,A,f,m,g,p,v,_,y,w;if("width"in t&&(o=Oa("width",t,i,r,a),o&&s.push(o)),"height"in t&&(l=Oa("height",t,i,r,a),l&&s.push(l)),t instanceof ga||t instanceof uh){let b={...i.fill},E={...r.fill};b.enabled!==void 0&&b.enabled!==E.enabled&&(s.push(v3e(t,!0)),b.enabled||Object.assign(b,{enabled:!0,color:{...b.color,a:0}}),E.enabled||Object.assign(E,{enabled:!0,color:{...E.color,a:0}})),c=Zb("color",t.fill,b,E,a),c&&s.push(c)}if(t instanceof ga){let b={...i.stroke},E={...r.stroke};(b.enabled||E.enabled)&&(s.push(_3e(t,!0)),b.enabled||Object.assign(b,{enabled:!0,color:{...b.color,a:0}}),E.enabled||Object.assign(E,{enabled:!0,color:{...E.color,a:0}})),h=Zb("color",t.stroke,b,E,a),h&&s.push(h),u=Oa("thickness",t.stroke,b,E,a),u&&s.push(u)}if(t instanceof ga){let b={...i.dropShadow},E={...r.dropShadow};(b.enabled||E.enabled)&&(s.push(y3e(t,!0)),b.enabled||Object.assign(b,{enabled:!0,color:{...b.color,a:0}}),E.enabled||Object.assign(E,{enabled:!0,color:{...E.color,a:0}})),d=Zb("color",t.dropShadow,b,E,a),d&&s.push(d),A=Oa("blurRadius",t.dropShadow,b,E,a),A&&s.push(A),m=Oa("spread",t.dropShadow,b,E,a),m&&s.push(m),f=ET("offset",t.dropShadow,b,E,a),f&&s.push(f)}if(t instanceof ga){let b={...i.innerShadow},E={...r.innerShadow};(b.enabled||E.enabled)&&(s.push(E3e(t,!0)),b.enabled||Object.assign(b,{enabled:!0,color:{...b.color,a:0}}),E.enabled||Object.assign(E,{enabled:!0,color:{...E.color,a:0}})),g=Zb("color",t.innerShadow,b,E,a),g&&s.push(g),p=Oa("blurRadius",t.innerShadow,b,E,a),p&&s.push(p),_=Oa("spread",t.innerShadow,b,E,a),_&&s.push(_),v=ET("offset",t.innerShadow,b,E,a),v&&s.push(v)}if(t instanceof ga||t instanceof uh){let b={...i.backgroundBlur},E={...r.backgroundBlur};(b.enabled||E.enabled)&&(s.push(w3e(t,!0)),b.enabled||Object.assign(b,{enabled:!0,radius:0}),E.enabled||Object.assign(E,{enabled:!0,radius:0})),y=Oa("radius",t.backgroundBlur,b,E,a),y&&s.push(y)}if(t instanceof ga){let b={...i.layerBlur},E={...r.layerBlur};(b.enabled||E.enabled)&&(s.push(b3e(t,!0)),b.enabled||Object.assign(b,{enabled:!0,radius:0}),E.enabled||Object.assign(E,{enabled:!0,radius:0})),w=Oa("radius",t.layerBlur,b,E,a),w&&s.push(w)}if(t instanceof uh||t instanceof NE){let b=NU("cornerRadius",t,i,r,a);b&&s.push(b)}return s}function kV(t,i,r,n,a){let s=[];return t.data.visible&&s.push(...h3e(t,i,r,a,n)),t instanceof Ca?s.push(...S3e(t,i,r,a,n)):(t.data.visible&&s.push(...d3e(t,i,r,n)),$l(t)?(t instanceof ds&&t.data.visible&&s.push(...JUe(t,i,r,n)),t.data.visible&&s.push(...e3e(t,i,r,n))):mPe(t)?t.data.visible&&s.push(...$Ue(t,i,r,n)):pPe(t)&&s.push(...XUe(t,
11954i,r,n))),s.length?{update:o=>{s.forEach(l=>l.update(o))},start:o=>{s.forEach(l=>{var c;return(c=l.start)==null?void 0:c.call(l,o)})},end:o=>{s.forEach(l=>{var c;return(c=l.end)==null?void 0:c.call(l,o)})}}:void 0}var HV=new O;function UU(t,i,r=!1){var s;let n=[],a=o=>{let l=o.data;delete o.states,o.currentState=null,o.reversibleToState=null,o.currentTransitionEvent=null;for(let c of l.states){let h={...c.data};o.states||(o.states={}),o.states[c.id]=Of.patch(l,h)}zV(t.scene,o,null,i,l.events.find(c=>c.data.type==="Follow"||c.data.type==="LookAt")!==void 0),GV(t)};t.scene.traverse2D(a),t.traverseChildren(o=>{var u,d,A,f,m,g;if(r&&((u=o.rigidBody)==null||u.setTranslation(o.position0,!0),(d=o.rigidBody)==null||d.setRotation(o.rotation0,!0),(A=o.rigidBody)==null||A.setLinvel(HV,!0),(f=o.rigidBody)==null||f.setAngvel(HV,!0)),!Oi.is(o))return;let l=o.uuid,c=o.data;if(delete o.states,o.uuid===W0)return;let h=!1;n.some(p=>{var v;return(v=t.scene.find(l))==null?void 0:v.isDescendantOf(p)})?h=!0:((m=c.physics)==null?void 0:m.fusedBody)===!0&&c.physics.rigidBody==="dynamic"&&n.push(l),o.data=c,o.currentState=null,o.reversibleToState=null,o.currentTransitionEvent=null;for(let p of c.states){let v={...p.data};t.data.globalPhysics.usePhysics===!0&&c.physics&&(c.physics.rigidBody==="dynamic"||h)&&(p.data.position!==void 0&&delete v.position,p.data.rotation!==void 0&&delete v.rotation,p.data.hiddenMatrix!==void 0&&delete v.hiddenMatrix),o.states||(o.states={}),o.states[p.id]=Df.patch(c,v)}zV(t.scene,o,null,i,c.events.find(p=>p.data.type==="Follow"||p.data.type==="LookAt")!==void 0),GV(t),o instanceof ls&&o.frame&&(o.frame.traverse(p=>a(p)),(g=o.uiCanvas)==null||g.applySize())}),t.frame&&(t.frame.traverse(o=>a(o)),(s=t.uiCanvas)==null||s.applySize())}function GV(t){t.traverseEntity(i=>{for(let r of i.data.events){let n=[];switch(r.data.type){case"Follow":case"MouseHover":case"Scroll":case"MouseDown":case"MouseUp":case"MousePress":case"KeyUp":case"KeyDown":case"KeyPress":case"Collision":n.push(...r.data.actions);break;case"GameControl":for(let a of Object.values(r.data.gameActions))n.push(...a);break;case"DragDrop":n.push(...r.data.dragDropActions.drag,...r.data.dragDropActions.drop);break;case"Conditional":n.push(...r.data.inActions,...r.data.outActions);break}for(let a of n)if(a.data.type==="Create"&&a.data.hideBase==="Yes"){let s=t.scene.find(a.data.object);s&&(s.visible=!1)}}})}function zV(t,i,r,n,a=!1){if(i instanceof ds&&i.removeInteractionGeometry(n),i instanceof Ca?i.changeSelectedState(r,{shared:n},a):i.changeSelectedState(r,{scene:t,shared:n},a),i instanceof ds&&i.updateGeometryGroupsIfNeeded(),i instanceof ms&&i.updateCameraState(i.dataPatched,{scene:t,shared:n}),!(i instanceof Ca)){if(i.cloner)for(let s of i.cloner.children)s.playModeVisible=void 0;i.updateVisible()}}function Wq(t){let i;if(t.easing===5){let{control1:r,control2:n}=t;i=`cubicBezier( 11955 ${r[0]}, ${r[1]}, ${n[0]}, ${n[1]} 11956 )`}else if(t.easing===6){let{mass:r,stiffness:n,damping:a,velocity:s}=t;i=`spring( ${r}, ${n}, ${a}, ${s} )`}else{let r;switch(t.easing){case 0:r=Fd.linear;break;case 1:r=Fd.ease;break;case 2:r=Fd.easeIn;break;case 3:r=Fd.easeOut;break;case 4:r=Fd.easeInOut;break;default:r=Fd.linear}let[n,a,s,o]=r;i=`cubicBezier( ${n}, ${a}, ${s}, ${o} )`}return{duration:Math.max(t.duration,1e-4),easing:i}}function ZL(t){let i={delay:0,loop:t.repeat===-1?!0:t.repeat+1};if(t.repeat===0)i.direction="normal",i.rewind=!1;else switch(t.direction){case"pingpong":i.direction="alternate",i.rewind=!1;break;case"pingpong-rewind":i.direction="alternate",i.rewind=!0;break;default:i.direction="normal",i.rewind=!1;break}switch(i.delay=0,i.endDelay=0,i.startOnceDelay=0,i.pingPongDelayCorrection=0,i.pingPongEndDelayCorrection=0,t.delayDirection){case"start-once":i.startOnceDelay=t.delay;break;case"start":i.delay=t.delay;break;case"end":i.endDelay=t.delay;break;case"start-end":case void 0:i.delay=t.delay,i.endDelay=t.delay;break}return i.direction==="alternate"&&(i.delay/=2,i.endDelay/=2,t.delayDirection==="start"?(i.pingPongDelayCorrection=i.delay,typeof i.loop=="number"&&i.loop%2===0&&(i.pingPongEndDelayCorrection=i.delay)):t.delayDirection==="end"?typeof i.loop=="number"&&i.loop%2!==0&&(i.pingPongEndDelayCorrection=i.endDelay):t.delayDirection==="start-end"&&(i.pingPongDelayCorrection=i.delay,i.pingPongEndDelayCorrection=i.endDelay)),i}var C3e={type:"beginState"},T3e={type:"completeState",isfromEntity:!1}
11956,QV=class{constructor(t,i,r,n,a,s){if(this.object=t,this.data=n,this.sharedAssets=a,this.allowSlerp=s,this.targets={t:0},this.firstLoop=!0,this._changeBegan=!1,this._changeCompleted=!0,this.onChange=()=>{this.callback&&(this.callback.update(this.targets.t),this.object.requestRender()),this.targets.t===0||this.targets.t===1?this._changeCompleted||(this._changeCompleted=!0,this._changeBegan=!1,this.onChangeComplete()):(this._changeCompleted&&(this._changeCompleted=!1),this._changeBegan||(this._changeBegan=!0,this.onChangeBegin()))},this.onChangeBegin=()=>{this.object.reversibleToState=this.to.id;let o=this.targets.t>.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=o,this.object.dispatchEvent({type:"beginState",state:o}),this.object instanceof Ca||this.object.traverseEntity(l=>{l!==this.object&&l instanceof ms&&l.dispatchEvent(C3e)})},this.onChangeComplete=()=>{this.firstLoop&&(this.onFirstLoop(),this.firstLoop=!1),this.object.reversibleToState=this.to.id;let o=this.targets.t<.5?this.from.id:this.to.id;this.object.prevState!==this.object.currentState&&(this.object.prevState=this.object.currentState),this.object.currentState=o,this.object.dispatchEvent({type:"completeState",state:o}),this.object instanceof Ca||this.object.traverseEntity(l=>{l!==this.object&&l instanceof ms&&l.dispatchEvent(T3e)})},this.onFirstLoop=()=>{this.useCurrentState&&(this.callback=kV(this.object,this.from.data,this.to.data,this.sharedAssets,this.allowSlerp))},i===void 0){let o=HS(this.object,this.object.currentState===r?this.object.prevState:this.object.currentState);if(!o)throw new Error("Missing property");this.from=o}else{let o=HS(this.object,i);if(!o)throw new Error("Missing property");this.from=o}if(r===void 0)throw new Error("Missing property");{let o=HS(this.object,r);if(!o)throw new Error("Missing property");this.to=o}this.useCurrentState=i===void 0||r===void 0,this.params={targets:this.targets,t:1,autoplay:!1,...ZL(n),...Wq(n),change:this.onChange},this.callback=kV(this.object,i===void 0?{}:this.from.data,r===void 0?{}:this.to.data,this.sharedAssets,this.allowSlerp)}get changeBegan(){return this._changeBegan}get changeCompleted(){return this._changeCompleted}},jq=class extends Ja{constructor(t,i,r,n,a){var o;if(super(),this.eventType=t,this.data=i,this.page=r,this.shared=n,this.condition=a,this.toggleIsForward=!1,this.timelineNeedsRebuild=!1,this.hasPlayedOnce=!1,this.onTimelineChangeComplete=()=>{var l;this.data.tweens[0].data.direction!=="normal"&&(this.toggleIsForward=!this.toggleIsForward),this.timelineNeedsRebuild!==!1&&((l=this.timeline)==null||l.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!1,isRebuild:!0}),this.timeline.play())},!i.object)throw new Error("Missing property");let s=this.page.scene.find(i.object)??((o=this.page.uiCanvas)==null?void 0:o.find(i.object))??this.page.scene.find2DInUIObjects(i.object);if(!s)throw new Error("Missing property");if(!s.states)throw new Error("Missing property");if(this.object=s,i.tweens.length<2)throw new Error("Missing property");this.tweens=Array(this.data.tweens.length-1),this.startOnceDelay=i.tweens[0].data.delayDirection==="start-once"?i.tweens[0].data.delay:0,this.init()}get playing(){var t;return((t=this.timeline)==null?void 0:t.paused)===!1}get changeBegan(){return this.tweens.some(t=>t.changeBegan)??!1}init(){this.initialCurrentState=HS(this.object,this.object.currentState).id,this.toggleIsForward=!1}get currentState(){return this.data.runMode==="Toggle"&&Vz(this.eventType)?this.initialCurrentState:this.object.currentState}buildTimeline({isForward:t=!0,needsRebuild:i=!1,isRebuild:r=!1}={}){var n,a,s,o;try{let l=ZL(this.data.tweens[0].data);r&&typeof l.loop=="number"&&l.loop--,(n=this.timeline)==null||n.pause(),this.timeline=Vq.timeline({autoplay:!1,...l,...l.loop===!0||l.loop>1?{timelineChangeComplete:this.onTimelineChangeComplete}:{}});let c=this.tweens.findIndex(h=>h==null?void 0:h.changeBegan);if(i===!0&&(this.timelineNeedsRebuild=!0),t){let h=c===-1?0:c;for(let u=h;u<this.data.tweens.length-1;u++){let d=this.data.tweens[u],A=this.data.tweens[u+1],f;
11956u===h&&(this.object.wasMovedByUser===!0||((a=this.object.previousAction)==null?void 0:a.changeBegan)===!0)?(f=void 0,this.object instanceof ms&&(this.object.wasMovedByUser=!1)):f=d.data.state===void 0?this.currentState:d.data.state;let m=new QV(this.object,f,A.data.state===void 0?this.currentState:A.data.state,A.data,this.shared,this.data.allowSlerp??!1);c!==-1&&u===h&&Object.assign(m.params,{startOnceDelay:0}),this.tweens[u]=m,this.timeline.add(m.params,this.timeline.duration+(u===h?l.delay:0))}this.timeline.duration+=l.endDelay}else{let h=c===-1?this.data.tweens.length-1:c+1;for(let u=h;u>0;u--){let d=this.data.tweens[u],A=this.data.tweens[u-1],f;u===h&&(this.object.wasMovedByUser===!0||((s=this.object.previousAction)==null?void 0:s.changeBegan)===!0)?(f=void 0,this.object instanceof ms&&(this.object.wasMovedByUser=!1)):f=d.data.state===void 0?this.currentState:d.data.state;let m=new QV(this.object,f,A.data.state===void 0?this.currentState:A.data.state,d.data,this.shared,this.data.allowSlerp??!1);c!==-1&&u===h&&Object.assign(m.params,{startOnceDelay:0}),this.tweens[u-1]=m,this.timeline.add(m.params,this.timeline.duration+(u===h?l.endDelay:0))}this.timeline.duration+=l.delay}}catch(l){l instanceof Error&&console.error(l.message)}((o=this.object.previousAction)==null?void 0:o.playing)===!0&&this.object.previousAction.pause(),this.object.previousAction=this}play(){if(Or(this.shared,this.condition)===!1||Vz(this.eventType)&&this.data.runMode==="Once"&&this.hasPlayedOnce||(this.hasPlayedOnce=!0,this.playing))return!1;clearTimeout(this.timeoutId);let t=ZL(this.data.tweens[0].data).pingPongDelayCorrection;this.timeoutId=window.setTimeout(()=>{try{this.buildTimeline(),this.timeline.play()}catch(i){i instanceof Error&&console.error(i.message)}},this.startOnceDelay+t)}pause(){var t;(t=this.timeline)==null||t.pause(),clearTimeout(this.timeoutId),this.tweens=Array(this.data.tweens.length-1),delete this.timeoutId}stop(){this.pause();let t=this.data.tweens[0].data.state===void 0?this.initialCurrentState:this.data.tweens[0].data.state;this.object instanceof Ca?this.object.changeSelectedState(t,{shared:this.shared}):this.object.changeSelectedState(t,{scene:this.page.scene,shared:this.shared}),this.object.currentState=t}seek(t){var i;if(Or(this.shared,this.condition)===!1)return!1;this.timeline===void 0&&this.buildTimeline(),(i=this.timeline)==null||i.seek(t*this.timeline.duration,!0)}toggle(t){var i;if(Or(this.shared,this.condition)===!1)return!1;clearTimeout(this.timeoutId),this.toggleIsForward=t??!this.toggleIsForward,this.playing?((i=this.timeline)==null||i.pause(),this.buildTimeline({isForward:this.toggleIsForward,needsRebuild:!0}),this.timeline.play()):this.timeoutId=window.setTimeout(()=>{var r;(r=this.timeline)==null||r.pause(),this.buildTimeline({isForward:this.toggleIsForward}),this.timeline.play()},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause()}};function HS(t,i){var a;let r,n;if(typeof i=="string"?(r=i,n=(a=t.states)==null?void 0:a[r]):i===null&&(r=null,n=t.data),!(r===void 0||n===void 0))return{id:r,data:n}}var M3e={type:"beginState"},VV={type:"completeState",isfromEntity:!1},WV={type:"requestRender"},Yq=class extends Ja{constructor(t,i,r,n){super(),this.data=t,this.page=i,this.shared=r,this.condition=n,this.toggleIsForward=!1,this.posStart=new O,this.posEnd=new O,this.qStart=new ri,this.qEnd=new ri,this.zoomStart=1,this.zoomEnd=1}init(){}get playing(){return this.animation&&this.animation.began&&!this.animation.completed}buildAnimation(t=!1){if(!this.data.animate)return;let i=this.page.scene.find(this.data.targetCamera);if(!i||!i.visible)throw new ReferenceError("Target camera not founded or not visible");let r={t:0};this.posStart.copy(this.page.activeCamera.position),this.qStart.copy(this.page.activeCamera.quaternion),this.zoomStart=this.page.activeCamera.zoom,this.animation=Vq({targets:r,t:1,...Wq(this.data),update:()=>{r.t===0&&(this.data.runMode==="Toggle"&&!this.toggleIsForward?this.fromCamera&&(this.posEnd.copy(this.fromCamera.position),this.qEnd.copy(this.fromCamera.quaternion),this.zoomEnd=this.fromCamera.zoom,this.switchCamera(this.fromCamera.uuid)):(this.posEnd.copy(i.position),this.qEnd.copy(i.quaternion),this.zoomEnd=i.zoom,this.fromCamera=this.page.activeCamera,this.switchCamera(i.uuid)),this.page.activeCamera.dispatchEvent(M3e));let n=this.page.activeCamera;n.position.lerpVectors(this.posStart,this.posEnd,r.t),n.quaternion.slerp
11956Quaternions(this.qStart,this.qEnd,r.t),n.zoom=this.zoomStart+(this.zoomEnd-this.zoomStart)*r.t,n.wasMovedBySwitchCameraAction=!0,n.updateMatrix(),n.updateMatrixWorld(),n.updateProjectionMatrix(),n.dispatchEvent(WV),r.t===1&&n.dispatchEvent(VV)}})}switchCamera(t){let i=this.page.activeCamera,r=this.page.scene.find(t);if(!r||!r.visible)throw new ReferenceError("Target camera not founded or not visible");this.page.switchActiveCamera(r),i.dispatchEvent({type:"cameraChange",camera:r})}play(){if(Or(this.shared,this.condition)===!1)return!1;if(!this.playing&&this.page.activeCamera.uuid!==this.data.targetCamera)try{clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{var t;delete this.timeoutId,this.data.animate?(this.buildAnimation(),(t=this.animation)==null||t.play()):this.switchCamera(this.data.targetCamera)},this.data.delay*1e3)}catch{}}pause(){var t;(t=this.animation)==null||t.pause(),clearTimeout(this.timeoutId),delete this.timeoutId}toggle(t){var i,r;if(Or(this.shared,this.condition)===!1)return!1;if(window.clearTimeout(this.timeoutId),delete this.timeoutId,t!==this.toggleIsForward)try{this.playing?((i=this.animation)==null||i.pause(),this.toggleIsForward=t??!this.toggleIsForward,this.buildAnimation(!0),(r=this.animation)==null||r.play()):this.timeoutId=window.setTimeout(()=>{var n,a;this.toggleIsForward=t??!this.toggleIsForward,this.data.animate?((n=this.animation)==null||n.pause(),this.buildAnimation(),(a=this.animation)==null||a.play()):(this.toggleIsForward?(this.fromCamera=this.page.activeCamera,this.switchCamera(this.data.targetCamera)):this.fromCamera&&this.switchCamera(this.fromCamera.uuid),this.page.activeCamera.dispatchEvent(VV),this.page.activeCamera.dispatchEvent(WV))},this.data.delay*1e3)}catch{}}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){this.pause(),this.toggleIsForward=!1}};function Kq(t){let i=t==null?void 0:t.tracks.filter(r=>r.ValueTypeName==="vector"||r.ValueTypeName==="quaternion").map(r=>r.times.length);if(i!=null&&i.length){let r=MMe(i);return r&&r>2?r:2}return 2}var Xq=class extends Ja{constructor(t,i,r,n,a){var c,h,u;super(),this.data=t,this.page=i,this.animationControls=r,this.shared=n,this.condition=a,this.startOnceDelay=0,this.toggleIsForward=!1;let s=t.object,o=i.scene.find(t.object);o&&Array.isArray(o.identity)&&(s=o.identity[0]),this.data={...t,object:s};let l=this.animationControls.clipIdToAction[t.clipId+"/"+s];if(this.duration=((c=l==null?void 0:l.getClip())==null?void 0:c.duration)??1,this.data.crop2){let d=Kq(l==null?void 0:l.getClip());this.leftFrameTime=this.data.crop2[0]/(d-1)*this.duration,this.rightFrameTime=this.data.crop2[1]/(d-1)*this.duration}else{let d=(u=(h=l==null?void 0:l.getClip())==null?void 0:h.tracks[0])==null?void 0:u.times.length;d&&d>1?(this.leftFrameTime=this.data.crop[0]/d*this.duration,this.rightFrameTime=this.data.crop[1]/d*this.duration):(this.leftFrameTime=0,this.rightFrameTime=this.duration)}this.startOnceDelay=t.delay}get playing(){var t;return((t=this.threeAnimAction)==null?void 0:t.isRunning())??!1}play(t=!1){if(Or(this.shared,this.condition)===!1)return!1;window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{var r;if(this.threeAnimAction=this.animationControls.play(this.data),!this.threeAnimAction)return;this.threeAnimAction.reset(),this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime;let i=this.data.object;Object.entries(this.animationControls.clipIdToAction).forEach(([n,a])=>{let s=n.split("/")[1];this.threeAnimAction!==a&&s===i&&a.isRunning()&&(t?a.fadeOut(.2):a.stop())}),t&&((r=this.threeAnimAction)==null||r.fadeIn(.2))},this.startOnceDelay)}pause(){this.threeAnimAction&&(this.threeAnimAction.paused=!0),window.clearTimeout(this.timeoutId),delete this.timeoutId}stop(){var t;(t=this.threeAnimAction)==null||t.fadeOut(.2)}seek(t){this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction&&(this.threeAnimAction.paused=!0,this.threeAnimAction.time=Ct.clamp(this.threeAnimAction.time+1/60*t,this.leftFrameTime,this.rightFrameTime-16e-5),this.animationControls.needsUpdate=!0,this.animationControls.requestRender())}toggle(t,i=!1){if(Or(this.shared,this.condition)===!1)return!1;this.toggleIsForward=t??!this.toggleIsForward,this.threeAnimAction&&(this.threeAnimAction._loopCount=0),this.playing?this.threeAnimAction&&(this.threeAnimAction.timeScale=this.toggleIsForward?1:-1,this.toggleIsForward?(this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime)):this.timeoutId=window.setTimeout(()=>{var r;if(this.threeAnimAction=this.animationControls.play(this.data),this.threeAnimAction){this.toggleIsForward?(this.threeAnimAction.time=this.leftFrameTime,this.threeAnimAction._clip.start=this.leftFrameTime,this.threeAnimAction._clip.duration=this.rightFrameTime):(this.threeAnimAction.time=this.rightFrameTime,this.threeAnimAction._clip.start=this.rightFrameTime,this.threeAnimAction._clip.duration=this.leftFrameTime),this.threeAnimAction.paused=!1,this.threeAnimAction.timeScale=this.toggleIsForward?1:-1;let n=this.data.clipId.split("/")[1];
11956Object.entries(this.animationControls.clipIdToAction).forEach(([a,s])=>{let o=a.split("/")[1];this.threeAnimAction!==s&&o===n&&s.isRunning()&&(i?s.fadeOut(.2):s.stop())}),i&&((r=this.threeAnimAction)==null||r.fadeIn(.2))}},this.startOnceDelay)}playFromCurrent(){this.toggle(!0)}reverseFromCurrent(){this.toggle(!1)}dispose(){var i;let t=(i=this.animationControls.clipIdToAction[this.data.clipId+"/"+this.data.object])==null?void 0:i.getClip();t&&(t.duration=this.duration),this.pause()}},qq=class{constructor(t,i,r,n,a){this.data=t,this.page=i,this.eventManager=r,this.shared=n,this.condition=a,this.timeOutId=-1,this.scene=i.scene}dispatch(){if(Or(this.shared,this.condition)===!1)return!1;this.data.target!==this.page.uuid&&(window.clearTimeout(this.timeOutId),this.timeOutId=window.setTimeout(()=>{this.play()},this.data.delay*1e3))}dispose(){window.clearTimeout(this.timeOutId)}play(){if(this.scene.children.every(i=>i.uuid!==this.data.target))return;this.data.transition==="fade"&&this.data.duration>0&&this.eventManager.eventContext.renderer.renderFromSceneForSceneTransitionPass(this.scene,this.scene.activeCamera,this.data.duration*1e3),this.eventManager.deactivate(),this.eventManager.controlsManager.deactivate();let t=this.scene.activeCamera;this.scene.updatePage(this.data.target),this.scene.traverseVisibleEntity(i=>{i.type==="ParticleSystem"&&(i.sleep(),i.wakeUp(),i.data.autoPlay?i.start():i.stop())}),this.scene.activePage.switchToPlayCamera(),this.scene.activeCamera.copyViewPlaneSize(t),UU(this.scene.activePage,this.shared),this.eventManager.activate(),this.eventManager.controlsManager.activate(this.eventManager)}},Zq=class{constructor(t,i,r,n){this.data=t,this.page=i,this.shared=r,this.condition=n,this.evaluatedCondition=!1}checkConditions(){this.evaluatedCondition=Or(this.shared,this.condition)}dispatch(){if(this.evaluatedCondition===!1)return!1;let t=this.shared.getVariable(this.data.variableId),i=eX(this.data.expression,this.shared,ja.typeOfVariable(t));i!==void 0&&this.shared.updateVariable(this.data.variableId,typeof i=="string"?{textValue:i}:i)}dispose(){}},Jq=class{constructor(t,i,r,n){this.data=t,this.page=i,this.shared=r,this.condition=n,this.timeoutId=null}dispatchInner(){if(Or(this.shared,this.condition)===!1)return!1;let t=this.shared.getDynamicVariablePlayState(this.data.variableId);if(this.data.mode==="PlayPause")this.shared.getDynamicVariableToggleIsForward(this.data.variableId)===void 0&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,t==="Playing"?"Paused":"Playing");else if(this.data.mode==="Play"&&t!=="Playing")this.shared.getDynamicVariableToggleIsForward(this.data.variableId)===void 0&&this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!0),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing");else if(this.data.mode==="Stop"&&t!=="Stopped")this.shared.setDynamicVariablePlayState(this.data.variableId,"Stopped");else if(this.data.mode==="Pause"&&t!=="Paused")this.shared.setDynamicVariablePlayState(this.data.variableId,"Paused");else if(this.data.mode==="Restart")this.shared.setDynamicVariablePlayState(this.data.variableId,"Restarted");else if(this.data.mode==="Toggle"){let i=this.shared.getDynamicVariableToggleIsForward(this.data.variableId);t==="Playing"?this.shared.setDynamicVariableToggleIsForward(this.data.variableId,i===void 0?!1:!i):(this.shared.setDynamicVariableToggleIsForward(this.data.variableId,!i),this.shared.setDynamicVariablePlayState(this.data.variableId,"Playing"))}}dispatch(){let t=this.data.delay,i=this.shared.getDynamicVariablePlayState(this.data.variableId);this.data.mode==="PlayPause"&&i==="Playing"&&(t=this.data.pauseDelay),t!==0?(this.timeoutId&&window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout(()=>{this.timeoutId=null,this.dispatchInner()},t)):this.dispatchInner()}dispose(){this.timeoutId&&window.clearTimeout(this.timeoutId)}},x3e=class{constructor(t,i,r,n){this.data=t,this.page=i,this.shared=r,this.condition=n}dispatch(){if(Or(this.shared,this.condition)===!1)return!1;(this.data.target==="single"?this.data.variableId?[this.data.variableId]:[]:Object.keys(this.shared.getVariables())).forEac
11956h(t=>{var r;this.shared.getVariable(t);let i=(r=this.shared.data.variables.data(t))==null?void 0:r.value;i!==void 0&&this.shared.updateVariable(t,i),this.shared.enableLocalStorageForPersistentVariables&&localStorage.removeItem(RL(t))})}dispose(){}},R3e=class{constructor(t,i,r,n){this.data=t,this.page=i,this.shared=r,this.condition=n}dispatch(){var t;if(Or(this.shared,this.condition)===!1)return!1;this.data.userAPIId&&((t=this.shared.getUserAPI(this.data.userAPIId))==null||t.callUserAPI(this.shared))}dispose(){}};function Or(t,i){if(i===void 0)return!0;if(i.expression.length===0)return!1;let r=eX(i.expression,t,"boolean");return i.negate?!r:!!r}function xa(t,i,r,n,a,s){let o={Audio:[],Video:[],Particles:[],Link:[],Destroy:[],Create:[],Reset:[],Transition:[],SwitchCamera:[],Animation:[],SceneTransition:[],SetVariable:[],DynamicVariablePlay:[],ClearLocalStorage:[],UserAPI:[]},l=c=>({id:h,data:u})=>{try{u.type==="Audio"?rs[t.type].includes("Audio")&&o.Audio.push(new Sq(h,u,s,n,c)):u.type==="Video"&&!(s instanceof Ca)?rs[t.type].includes("Video")&&o.Video.push(new eZ(h,u,s,n,c)):u.type==="Particles"?rs[t.type].includes("Particles")&&o.Particles.push(new Cq(u,r,n,c)):u.type==="Link"?rs[t.type].includes("Link")&&o.Link.push(new pUe(u,a.controlsManager,n,c)):u.type==="Create"?rs[t.type].includes("Create")&&o.Create.push(new tZ(u,r,a.controlsManager,n,c)):u.type==="Destroy"?rs[t.type].includes("Destroy")&&o.Destroy.push(new Tq(u,r,a.controlsManager,n,c)):u.type==="Reset"?rs[t.type].includes("Reset")&&o.Reset.push(new Mq(u,r,n,a,c)):u.type==="Transition"?rs[t.type].includes("Transition")&&o.Transition.push(new jq(t.type,u,r,n,c)):u.type==="SwitchCamera"?rs[t.type].includes("SwitchCamera")&&o.SwitchCamera.push(new Yq(u,r,n,c)):u.type==="SceneTransition"?rs[t.type].includes("SceneTransition")&&o.SceneTransition.push(new qq(u,r,a,n,c)):u.type==="Animation"?rs[t.type].includes("Animation")&&o.Animation.push(new Xq(u,r,a.animationControls,n,c)):u.type==="SetVariable"?rs[t.type].includes("SetVariable")&&o.SetVariable.push(new Zq(u,r,n,c)):u.type==="DynamicVariablePlay"?rs[t.type].includes("DynamicVariablePlay")&&o.DynamicVariablePlay.push(new Jq(u,r,n,c)):u.type==="Conditional"?rs[t.type].includes("Conditional")&&(u.ifActions.forEach(l({expression:u.condition,negate:!1})),u.elseActions.forEach(l({expression:u.condition,negate:!0}))):u.type==="ClearLocalStorage"?rs[t.type].includes("ClearLocalStorage")&&o.ClearLocalStorage.push(new x3e
11956(u,r,n,c)):u.type==="UserAPI"&&rs[t.type].includes("UserAPI")&&o.UserAPI.push(new R3e(u,r,n,c))}catch{}};return i.forEach(l()),o}function ba(t){Object.values(t).forEach(i=>{i.forEach(r=>{(r instanceof Sq||r instanceof eZ||r instanceof Cq||r instanceof Xq||r instanceof jq||r instanceof tZ||r instanceof Tq||r instanceof Yq||r instanceof qq||r instanceof Mq||r instanceof Zq||r instanceof Jq)&&r.dispose()})})}function B3e(t,i){let r;if("material"in t){let n=t.material;Array.isArray(n)?r=t.material[0].layers.find(a=>a.uuid===i):r=t.material.layers.find(a=>a.uuid===i)}if(r)return r.color.texture.image.img instanceof HTMLVideoElement?r.color.texture.image.img:void 0}var $q=new Map,iy=new Map,Gg=class{constructor(t,i,r){this.data=i,this.delay=0,this.status="stopped";let{layerId:n,loop:a,volume:s,delay:o}=i;if(this.object=r,n===void 0)throw new Error("Missing property");let l=B3e(r,n);l&&(this.videoElement=l,this.videoElement.loop=a===1/0,RE&&(this.videoElement.autoplay=!0),s!==void 0&&(this.videoElement.volume=s)),o!==void 0&&(this.delay=o),iy.has(r.uuid)?iy.get(r.uuid).push(this):iy.set(r.uuid,[this]),$q.set(t,this),this.pause()}mute(){!this.videoElement||(this.videoElement.muted=!0)}unMute(){!this.videoElement||(this.videoElement.muted=!1)}play(t){if(!this.videoElement)return;let i=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t?(this.mute(),this.delay+=150):i?(this.mute(),window.setTimeout(()=>{this.unMute()},100)):this.unMute(),this.delayTimerId=window.setTimeout(()=>{if(!this.videoElement)return;let r=this.videoElement.play();r!==void 0&&r.then(n=>{}).catch(n=>{this.play()}),this.clearDelay()},this.delay),this.status="playing"}clearDelay(){this.delayTimerId&&(clearTimeout(this.delayTimerId),delete this.delayTimerId)}pause(){!this.videoElement||(this.videoElement.pause(),this.status="paused")}stop(){!this.videoElement||(this.videoElement.pause(),this.videoElement.currentTime=0,this.status="stopped",this.clearDelay())}playByToggle(){this.data.toggle==="stop"?this.status==="playing"?this.stop():(this.stop(),this.play()):this.data.toggle==="pause"?this.status==="playing"?this.pause():this.play():(this.stop(),this.play())}dispose(){!this.videoElement||(this.stop(),this.videoElement.muted=!0)}},JL=class{constructor(t){this.data=t}dispatch(){this.data.playVideo?this.pauseVideo(this.data.playVideo):this.data.object?this.pauseAllVideosFromObject(this.data.object):this.pauseAllVideos()}pauseVideo(t){let i=$q.get(t);!i||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i[this.data.interaction](),this.disposeDelay()},this.data.delay)):i[this.data.interaction]())}pauseAllVideosFromObject(t){let i=iy.get(t);!(i!=null&&i.length)||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{i.forEach(r=>r[this.data.interaction]()),this.disposeDelay()},this.data.delay)):i.forEach(r=>r[this.data.interaction]()))}pauseAllVideos(){let t=[...iy.values()];!t.length||(this.data.delay>0?(this.disposeDelay(),this.timeoutId=window.setTimeout(()=>{t.forEach(i=>{i.forEach(r=>{r[this.data.interaction]()})}),this.disposeDelay()},this.data.delay)):t.forEach(i=>{i.forEach(r=>{r[this.data.interaction]()})}))}disposeDelay(){clearTimeout(this.timeoutId),delete this.timeoutId}dispose(){clearTimeout(this.timeoutId),delete this.timeoutId}},eZ=class{constructor(t,i,r,n,a){if(this.data=i,this.shared=n,this.condition=a,i.interaction==="play")this.interaction=new Gg(t,i,r);else if(i.interaction==="pause"||i.interaction==="stop")this.interaction=new JL(i);else throw new Error("Missing property")}dispatchBasic(){if(Or(this.shared,this.condition)===!1)return!1;this.interaction instanceof Gg?this.interaction.playByToggle():this.interaction.dispatch()}dispatchConditional(){if(Or(this.shared,this.condition)===!1)return!1;this.interaction instanceof Gg?this.interaction.play():this.interaction.dispatch()}dispose(){this.interaction.dispose()}},jV=(()=>{let t,i,r,n;function a(l){!t&&!YV()&&(i==null?void 0:i.sharedGameControlGlobals.createdObjects.length)>0&&(t=requestAnimationFrame(s)),l&&(i=l,n=l.requestRender)}function s(l){let c=r?l-r:0,h=i.sharedGameControlGlobals.createdObjects,u=i.sharedGameControlGlobals.nCreatedPerAction,d=h.length,A=0;for(;A<d;){let f=h[A];f.userData.createdTime===void 0&&(f.userData.createdTime=l),f.userData.lifetime===void 0&&f.userData.quantity===void 0||f.userData.lifetime&&l-f.userData.createdTime<f.userData.lifetime||f.userData.quantity&&u[f.userData.actionId]<=f.userData.quantity?(f.userData.velocity&&(f.position.addScaledVector(f.userData.velocity,c/1e3),f.updateMatrix(),n()),A++):(u[f.userData.actionId]>f.userData.quantity&&u[f.userData.actionId]--,h.splice(A,1),f.removeFromParent(),i.sharedGameControlGlobals.rapierWorld&&f.rigidBody?(i.sharedGameControlGlobals.colliderToEntity.delete(f.rigidBody.collider(0).handle),i.sharedGameControlGlobals.rapierWorld.removeRigidBody(f.rigidBody)):(f.bvhGeometry=void 0,i.sharedGameControlGlobals.entitiesWithTransformAnim=i.sharedGameControlGlobals.entitiesWithTransformAnim.filter(m=>m.bvhGeometry!==void 0)),d--,n())}t=A>0?requestAnimationFrame(s):void 0,r=A>0?l:void 0}function o(){YV()?t&&(cancelAnimationFrame(t),t=void 0,r=void 0):a()}return typeof document<"u"&&document.addEventListener("visibilitychange",o),a})();function YV(){return!!document&&document.hidden}var KV=new ri,I3e=new O,D3e=new O,tZ=class{constructor(t,i,r,n,a){this.data=t,this.page=i,this.controlsManager=r,this.shared=n,this.condition=a,this.intervalId=null,this.timeoutIdQueue=[],this.uniqueId=Ct.generateUUID(),this.dispatch=()=>
11956{if(Or(this.shared,this.condition)===!1)return!1;this.data.delay?this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,this.data.delay*1e3)):this.dispatchInner()},this.dispatchFromStart=()=>{if(Or(this.shared,this.condition)===!1)return!1;this.timeoutIdQueue.push(window.setTimeout(this.dispatchInner,this.data.delay*1e3))},this.dispatchThrottled=WMe(this.dispatch,1e3/this.data.creationSpeed),this.dispatchStart=()=>{this.intervalId===null&&(this.intervalId=window.setInterval(this.dispatch,1e3/this.data.creationSpeed))},this.dispatchStop=()=>{this.intervalId!==null&&(window.clearInterval(this.intervalId),this.intervalId=null)},this.dispatchInner=()=>{this.timeoutIdQueue.shift();let o=new us(this.object);if(o.playModeVisible=!0,o.expand(),this.data.coordinateSystem!=="world"){let c=this.data.coordinateSystem,h=this.page.scene.find(c);h&&(h.updateMatrixWorldSVD(),o.hiddenMatrix.copy(h.matrixWorldRigid))}o.scale.copy(this.object.scale),o.position.fromArray(this.data.position),o.rotation.fromArray(this.data.rotation),o.updateMatrix(),this.page.add(o);let l=this.controlsManager.sharedGameControlGlobals;l.createdObjects.push(o),l.nCreatedPerAction[this.uniqueId]===void 0?l.nCreatedPerAction[this.uniqueId]=1:l.nCreatedPerAction[this.uniqueId]++,o.updateWorldMatrix(!0,!0),o.traverseObject(this.traverseObjectCB),jV(),this.controlsManager.requestRender()},this.traverseObjectCB=o=>{var u,d,A,f;o.hasNonUniformScale&&o.updateMatrixWorldSVD();let l;if(this.controlsManager.sharedGameControlGlobals.rapierWorld){if(o instanceof sc)if(o.objectForSample){if(o.objectForSample.dataPatched.physics.fusedBody)return;l=o.object}else return o.object.dataPatched.physics.fusedBody===!0&&o.object.dataPatched.physics.rigidBody==="dynamic"?!0:void 0;else if(o instanceof us)l=o.object;else if(l=o,(u=l.dataPatched.cloner)==null?void 0:u.hideBase)return!0}else{if(o instanceof sc)return;o instanceof us?l=o.object:l=o}this.data.destroy==="Time"?o.userData.lifetime=this.data.lifetime*1e3:this.data.destroy==="Quantity"&&(o.userData.quantity=this.data.destroyAfterQuantity,o.userData.actionId=this.uniqueId);let c=new O().fromArray(this.data.velocity),h=l.dataPatched;if(!(h.physics.enabled==="visibility"?!h.visible:!h.physics.enabled)&&(this.controlsManager.sharedGameControlGlobals.rapierWorld?(this.controlsManager.addRigidBody(o,l,{fromCreate:!0,dynamic:this.data.dynamic}),this.data.destroy==="Collision"&&((d=o.rigidBody)==null||d.collider(0).setActiveEvents(1),o.userData.hasCollisionDestroy=!0),o.matrixWorld.decompose(I3e,KV,D3e),c.applyQuaternion(KV),this.data.velocity.some(m=>m!==0)&&this.data.dynamic&&((A=o.rigidBody)==null||A.setLinvel(c.divideScalar(this.controlsManager.pixelsPerMeter),!0))):("geometry"in o.object&&this.controlsManager.addBoundsTree(o),this.data.velocity.some(m=>m!==0)&&this.data.dynamic&&(o.userData.velocity=c)),((f=l.dataPatched.physics)==null?void 0:f.fusedBody)===!0))return!0};let s=this.page.scene.find(this.data.object);if(!s)throw new Error("Missing Property");if(this.object=s,this.data.coordinateSystem!=="world"&&!this.page.scene.find(this.data.coordinateSystem))throw new Error("Missing Property");jV(r)}dispose(){this.intervalId!==null&&(window.clearInterval(this.intervalId),this.intervalId=null),this.timeoutIdQueue.forEach(t=>window.clearTimeout(t)),this.dispatchThrottled.cancel(),this.page.remove(...this.controlsManager.sharedGameControlGlobals.createdObjects),this.controlsManager.sharedGameControlGlobals.createdObjects=[]}},iZ=200,h2=.02,u2=.3,P3e=65;new O;var XV=new O,qV=new O,L3e=new O,bs=new O,Ys=new O,Ed=new O,d2=new ht,ZV=new ht,O3e=new ht;new ht;var Wl=new ri,Vh=new ri,Pc=new qn(0,0,0,"YXZ"),N3e=new O(1,0,0),jl=new O(0,1,0),U3e=new O(0,0,1),JV=new O(1,1,1);new ho;var F3e=1,k3e=.025,H3e=16e-6,$V=12,G3e=20,sa=new vl,Vo=new Sn,z3e={type:"requestRender"},Q3e={type:"updateMatrix"},e8=Math.PI/6,$L=class extends Ja{constructor(t,i,r,n,a,s,o,l,c){var m;super(),this.object=t,this.domElement=i,this.data=r,this.gloabalPhysics=n,this.controlsManager=a,this.cameraFollow=s,this.camera=o,this.page=l,this.sharedAssets=c,this.enableDamping=!0,this.hiddenMatrix0=new ht,this.target0=new O,this.zoom0=1,this.rotForce=1,this.moveForce=1,this.pixelsPerMeter=iZ,this.euler0=new qn(0,0,0,"YXZ"),this.position0Cam=new O,this.quat0Cam=new ri,this.scale0Cam=new O,this.hiddenMatrix0Cam=new ht,this.threshEndTranslate=.01,this.threshEndRotate=1e-8,this.threshEndRotVel=.005,this.collider={type:"capsule",radius:40,segment:new vl(new O(0,-40,0),new O(0,40,0
11956)),matrix:new ht,position:new O,rotation:new ri},this.euler=new qn(0,0,0,"YXZ"),this.eulerDelta=new O,this.lastPosition=new O,this.lastCameraQuaternion=new ri,this.lastCameraPosition=new O,this.PI_2=Math.PI/2,this.prevMouse=new Me,this.velocityTarget=new O,this.velocity=new O,this.directionXZ=new O,this.rotVelocityStick=new O,this.rotVelocityTarget=new O,this.rotVelocity=new O,this.rotDirection=new O,this.nonColliderRotOffset=new ht,this.nonColliderPosOffset=new ht,this.firstPointerId=-1,this.rot=new O,this.path=[],this.movementState={moveNegZ:0,movePosZ:0,moveNegX:0,movePosX:0,moveNegY:0,movePosY:0,rotPosX:0,rotNegX:0,rotPosY:0,rotNegY:0,jump:0,run:0},this.vrEulerYOffset=0,this.onObject=!1,this.actionState={},this.keyAssignments=[["moveNegZ","W"],["moveNegX","A"],["movePosZ","S"],["movePosX","D"],["rotPosX","ArrowUp"],["rotPosY","ArrowLeft"],["rotNegX","ArrowDown"],["rotNegY","ArrowRight"],["jump"," "]],this.collisionEnabled=!0,this.offsetMatrix=new ht,this.objectToTarget=new O,this.objectToTarget0=new O,this.objectToCamXZ=new O,this.objectToCamXZ0=new O,this.targetToCamera=new O,this.targetToCamera0=new O,this.cameraPolarAxis0=new O,this.targetPos=new O,this.targetQuat=new ri,this.lerpFactorPos=new O().setScalar(.3),this.lerpFactorPosStart=.3,this.lerpFactorPosEnd=.3,this.lerpFactorRotStart=.3,this.lerpFactorRotEnd=.3,this.lerpFactorPosCamera=.3,this.lerpFactorRotCamera=.3,this.objXZQuat=new ri,this.objXZQuatInv=new ri,this.objXZRotMat=new ht,this.isFirstPerson=!1,this.didHit=!1,this.groundVelocity=new O,this.pushedVelocity=new O,this.groundYRotation=0,this.objectRealQuat=new ri,this.colliderWorldQuat=new ri,this.groundNormal=new O,this.groundTilt=new ri,this.groundTiltInv=new ri,this.lastHitObj=null,this.isFirstFrame=!0,this.rotationAccumWhenOrientWithCamera=0,this.navMeshPathDest=null,this.position=new O,this.quaternion=new ri,this.scale=new O,this.initialAction=!0,this.onPointerDown=g=>{var p;!(g.target===this.domElement||g.target instanceof HTMLElement&&g.target.tagName==="SPLINE-VIEWER"&&((p=g.target.shadowRoot)!=null&&p.contains(this.domElement)))||this.firstPointerId!==-1||(this.firstPointerId=g.pointerId,this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp),this.rotBy!=="keys"&&!Do&&!Rz&&this.domElement.requestPointerLock(),this.prevMouse.set(g.clientX,g.clientY))},this.onPointerUp=g=>{this.firstPointerId=-1,this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.domElement.ownerDocument.removeEventListener("pointerup",this.onPointerUp),g.pointerType==="mouse"&&this.domElement.ownerDocument.exitPointerLock()},this.onPointerMove=g=>{if(g.pointerId!==this.firstPointerId)return;let p=g.clientX-this.prevMouse.x,v=g.clientY-this.prevMouse.y;this.prevMouse.set(g.clientX,g.clientY),g.pointerType==="mouse"&&this.rotBy!=="keys"&&(Rz&&txe<15.5&&!Do?(this.eulerDelta.y=-p*this.mouseOrbitSensitivity,this.eulerDelta.x=-v*this.mouseOrbitSensitivity):(this.eulerDelta.y=-g.movementX*this.mouseOrbitSensitivity,this.eulerDelta.x=-g.movementY*this.mouseOrbitSensitivity)),g.pointerType!=="mouse"&&this.rotByTouch==="drag"&&(this.eulerDelta.y=-p*this.mouseOrbitSensitivity*5,this.eulerDelta.x=-v*this.mouseOrbitSensitivity*5),this.controlsManager.requestRender()},this.onPointerlockChange=g=>{this.domElement.ownerDocument.pointerLockElement===this.domElement?$L.isLocked=!0:$L.isLocked=!1},this.onPointerlockError=()=>{console.error("SPE.GameControls: Unable to use Pointer Lock API")},this.handleVisibilityChange=()=>{if(document!=null&&document.hidden)for(let g in this.movementState)this.movementState[g]=0},this.onKeyDown=g=>{!(g.target instanceof HTMLInputElement)&&(g.code==="ArrowLeft"||g.code==="ArrowUp"||g.code==="ArrowRight"||g.code==="ArrowDown"||g.code==="Space")&&g.preventDefault();for(let p of this.keyAssignments)if(g.key.toUpperCase()===p[1]||g.key===p[1]){this.movementState[p[0]]=1;break}this.controlsManager.requestRender()},this.onKeyUp=g=>{for(let p of this.keyAssignments)if(g.key.toUpperCase()===p[1]||g.key===p[1]||g.code.slice(3,g.code.length).toUpperCase()===p[1]){this.movementState[p[0]]=0;break}},this.copyVRGamePadValues=(g,p)=>{for(let v=2;v<4;
11956v++){let _=g.axes[v];p===0?v===2?this.movementState.movePosX=_:this.movementState.movePosZ=_:(g.buttons[3].pressed?this.movementState.jump=1:this.movementState.jump=0,v===2?(Math.abs(this.movementState.rotPosY)<.3&&Math.abs(_)>=.3&&(this.vrEulerYOffset+=_<0?1:-1),this.movementState.rotPosY=_):this.moveMode==="fly"&&(this.movementState.moveNegY=_))}},this.sharedGameControlGlobals=a.sharedGameControlGlobals,t===o&&(this.isFirstPerson=!0),this.hiddenMatrix0.copy(this.object.hiddenMatrix),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.euler0.setFromQuaternion(this.quaternion,"YXZ");let h=this.euler0.clone(),u=h.y;if(this.objectRealQuat.copy(this.quaternion),h.y=0,this.quaternion.setFromEuler(h),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),h.set(0,u,0),this.quaternion.setFromEuler(h),this.rot.setFromEuler(h),this.object.matrixAutoUpdate=!1,(this.isFirstPerson||this.cameraFollow===!0)&&(this.target0.copy(this.camera.getTarget()),this.zoom0=this.camera.zoom),this.cameraFollow===!0){this.position0Cam.copy(this.camera.position),this.quat0Cam.copy(this.camera.quaternion),this.scale0Cam.copy(this.camera.scale),this.hiddenMatrix0Cam.copy(this.camera.hiddenMatrix),this.camera.parent?(this.camera.hiddenMatrix.copy((m=this.camera)==null?void 0:m.parent.matrixWorld),this.camera.matrix.copy(this.camera.matrixWorld)):this.camera.hiddenMatrix.identity(),this.camera.matrix.copy(this.camera.matrixWorld),this.camera.matrix.decompose(this.camera.position,this.camera.quaternion,this.camera.scale),this.camera.matrixAutoUpdate=!1,this.offsetMatrix.copy(this.object.matrix).invert().multiply(this.camera.matrix);let g=new O(0,0,-1).applyQuaternion(this.camera.quaternion),p=new O().subVectors(this.position,this.camera.position);this.objectToCamXZ.copy(p),this.objectToCamXZ.y=0,this.objectToCamXZ0.copy(this.objectToCamXZ);let v,_;Math.abs(g.y)<1e-6?(p.y=0,g.y=0,_=p.projectOnVector(g)):p.y/g.y>0?_=g.multiplyScalar(p.y/g.y):_=g.multiplyScalar(p.length()),this.targetToCamera0.copy(_).negate(),v=this.camera.position.clone().add(_),this.objectToTarget0.subVectors(v,this.position);let y=new qn().setFromQuaternion(this.camera.quaternion,"YXZ");this.cameraPolarOffset=-y.x,y.x=0,y.z=0,y.y-=Math.PI/2,this.cameraPolarAxis0.set(0,0,-1).applyEuler(y)}if(this.object instanceof ms&&(this.object.matrixAutoUpdate=!1),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.rotByTouch=r.rotByTouch??"joystick",this.rotBy=r.rotBy??"keys",this.rotationMode=r.rotationMode??"normal",this.moveMode=r.moveMode??"walk",this.collisionEnabled=r.collisionEnabled,this.speedTranslate=(r.speedTranslate??250)*F3e,this.speedOrbit=(r.speedRotate??100)*k3e,this.mouseOrbitSensitivity=(r.speedRotate??100)*H3e,this.keyAssignments=r.keyAssignments.map(g=>{let p=[g[0],g[1]];return p[1]==="â²"?p[1]="ArrowUp":p[1]==="â"?p[1]="ArrowLeft":p[1]==="â¼"?p[1]="ArrowDown":p[1]==="â¶"?p[1]="ArrowRight":p[1]==="â§"?p[1]="Shift":p[1]==="âµ"?p[1]="Enter":p[1]==="Space"?p[1]=" ":p[1]==="â"?p[1]="Meta":p[1]==="Ctrl"?p[1]="Control":p[1]==="Esc"&&(p[1]="Escape"),p}),r.rotBy==="mouse"){let g;g=this.keyAssignments.findIndex(p=>p[0]==="rotNegX"),g!==-1&&(this.keyAssignments[g][1]=""),g=this.keyAssignments.findIndex(p=>p[0]==="rotPosX"),g!==-1&&(this.keyAssignments[g][1]=""),g=this.keyAssignments.findIndex(p=>p[0]==="rotPosY"),g!==-1&&(this.keyAssignments[g][1]=""),g=this.keyAssignments.findIndex(p=>p[0]==="rotNegY"),g!==-1&&(this.keyAssignments[g][1]="")}this.lerpFactorPosStart=1-.02**(1/((r.delayPos[0]??.3)*60)),this.lerpFactorPosEnd=1-.02**(1/((r.delayPos[1]??.3)*60)),this.lerpFactorPos.setScalar(this.lerpFactorPosStart),this.lerpFactorRotStart=1-.02**(1/((r.delayRot[0]??.3)*60)),this.lerpFactorRotEnd=1-.02**(1/((r.delayRot[1]??.3)*60)),this.lerpFactorPosCamera=1-.02**(1/((r.delayPosCamera??.3)*60)),this.lerpFactorRotCamera=1-.02**(1/((r.delayRotCamera??.3)*60)),this.gravity=(this.gloabalPhysics.gravity??f0.defaultData.gravity)*$V,this.usePhysics=this.gloabalPhysics.usePhysics??f0.defaultData.usePhysics,this.jumpPower=r.jumpPower*G3e,this.resetYPosition=this.position.y+Math.abs(r.resetYPosition)*(this.gravity>0?1:-1),this.alignToGround=r.alignToGround??!1,this.orientMode=r.autoOrientMove?r.orientMode:"none",this.orientWith=r.orientWith??nT.defaultDataThirdPerson.orientWith,this.slopeThresh=P3e*Math.PI/180,r.collider.type==="capsule"?(this.collider.radiu
vendor: 5,147 bytes, line 11956
11956s=r.collider.radius,this.collider.segment.start.y=r.collider.height/2-r.collider.radius,this.collider.segment.end.y=-this.collider.segment.start.y,this.offset=r.collider.height*h2/this.pixelsPerMeter,this.stepThresh=r.collider.height*u2/this.pixelsPerMeter,this.colliderHeight=r.collider.height):r.collider.type==="sphere"?(this.collider.radius=r.collider.radius,this.collider.segment.start.y=0,this.collider.segment.end.y=0,this.offset=2*r.collider.radius*h2/this.pixelsPerMeter,this.stepThresh=2*r.collider.radius*u2/this.pixelsPerMeter,this.colliderHeight=r.collider.radius*2):(this.offset=r.collider.height*h2/this.pixelsPerMeter,this.stepThresh=r.collider.height*u2/this.pixelsPerMeter,this.colliderHeight=r.collider.height),this.collider.type=r.collider.type;let d=new O().fromArray(r.collider.position),A=new ri().setFromEuler(new qn().fromArray([...r.collider.rotation,"XYZ"]));this.collider.position.copy(d).multiply(this.scale),this.collider.rotation.copy(A),this.collider.matrix.compose(d,A,JV),r.cameraXAxis!==void 0&&(this.cameraXAxis=r.cameraXAxis,this.cameraYAxis=r.cameraYAxis,this.minPolarAngle=r.cameraRotXLimits[0],this.maxPolarAngle=r.cameraRotXLimits[1],this.minAzimuthAngleRel=r.cameraRotYLimits[0],this.maxAzimuthAngleRel=r.cameraRotYLimits[1]),this.forwardDir=r.forwardDirection??"-z",this.isFirstPerson&&(this.forwardDir="-z"),this.runMultiplier=r.runMultiplier??2;let f=r.navmesh.destinationHelperRadius*2;if(f>0){let g=new Pt;g.push({fi:0,data:{...ua.defaultData("light","phong"),alpha:0},id:"layer1"}),g.push({fi:0,data:{...ua.defaultData("color"),color:r.navmesh.destinationHelperColor,alpha:r.navmesh.destinationHelperColor.a},id:"layer2"});let p=new lU({layers:g},{scene:this.page.scene,shared:this.sharedAssets});this.navMeshPathDest=new Zr(OK.create({parameters:{width:f,height:f/10,hollow:.7}}),p),this.navMeshPathDest.material.userData.opacity0=r.navmesh.destinationHelperColor.a}this.activate()}reset(t=!1){if(this.object.hiddenMatrix.copy(this.hiddenMatrix0),t){this.object.updateMatrix(),this.object.updateMatrixWorld(),this.object.matrix.copy(this.object.matrixWorld),this.object.matrix.decompose(this.position,this.quaternion,this.scale),this.object.parent?this.object.hiddenMatrix.copy(this.object.parent.matrixWorld).invert():this.object.hiddenMatrix.identity();let i=new qn().setFromQuaternion(this.quaternion,"YXZ"),r=i.y;this.objectRealQuat.copy(this.quaternion),i.y=0,this.quaternion.setFromEuler(i),this.objXZQuat.copy(this.quaternion),this.objXZQuatInv.copy(this.objXZQuat).invert(),this.objXZRotMat.makeRotationFromQuaternion(this.quaternion),i.set(0,r,0),this.quaternion.setFromEuler(i),this.rot.setFromEuler(i),this.euler.setFromQuaternion(this.quaternion,"YXZ"),this.velocityTarget.set(0,0,0),this.velocity.set(0,0,0)}else this.object instanceof ms?this.object.matrixAutoUpdate=!0:this.object.updateMatrix();this.cameraFollow===!0&&(this.camera.quaternion.copy(this.quat0Cam),this.camera.position.copy(this.position0Cam),this.camera.scale.copy(this.scale0Cam),this.camera.hiddenMatrix.copy(this.hiddenMatrix0Cam),this.camera.matrixAutoUpdate=!0),this.controlsManager.requestRender()}activate(){this.instantiateActions(),this.domElement.ownerDocument.addEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.addEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.addEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.addEventListener("visibilitychange",this.handleVisibilityChange)}deactivate(){this.disposeActions(),this.domElement.ownerDocument.removeEventListener("pointerdown",this.onPointerDown),this.domElement.ownerDocument.removeEventListener("keydown",this.onKeyDown),this.domElement.ownerDocument.removeEventListener("keyup",this.onKeyUp),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError),this.domElement.ownerDocument.removeEventListener("visibilitychange",this.handleVisibilityChange)}dispose(){var t;this.deactivate(),(t=this.navMeshPathDest)!=null&&t.parent&&this.page.remove(this.navMeshPathDest)}instantiateActions(){let t=this.data,i=this.sharedAssets;t.gameActions!==void 0&&(this.actions={},rT.list.forEach(r=>{this.actions[r]=xa({...t,disabled:!1,type:"GameControl"},t.gameActions[r],this.page,i,this.controlsManager.eventManager,this.object)})),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"),this.initialAction&&(this.initialAction=!1)}disposeActions(){this.initialAction=!1,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),ba(this.actions.idle),ba(this.actions.move),ba(this.actions.run),ba(this.actions.jump)}dispatchStartEvent(t){this.actions[t]!==void 0&&(this.actionState[t]||(this.actionState[t]=!0,this.actions[t].Transition.forEach(i=>
11956{i.play()}),this.actions[t].Animation.forEach(i=>{i.play(this.initialAction===!1)}),this.actions[t].Create.forEach(i=>{i.dispatchStart()}),this.actions[t].Audio.forEach(i=>{i.dispatchGameControl("start")}),this.actions[t].Particles.forEach(i=>{i.dispatchGameControl("start")})))}dispatchStopEvent(t){this.actions[t]!==void 0&&(!this.actionState[t]||(this.actionState[t]=!1,this.actions[t].Transition.forEach(i=>{i.stop(),i.object.currentState!==null&&i.object.changeSelectedState(null,{scene:this.page.scene,shared:this.sharedAssets})}),this.actions[t].Create.forEach(i=>{i.dispatchStop()}),this.actions[t].Audio.forEach(i=>{i.dispatchGameControl("stop")}),this.actions[t].Particles.forEach(i=>{i.dispatchGameControl("stop")})))}get colliderWorldPosition(){return bs.copy(this.collider.position).applyQuaternion(this.objectRealQuat).add(this.position)}update(t,i,r){var l,c,h,u,d,A,f,m,g;if(this.gravity<0?this.position.y<this.resetYPosition:this.position.y>this.resetYPosition)return this.reset(!0),!0;this.sharedGameControlGlobals.gamePads.forEach(this.copyVRGamePadValues);let n=(this.isFirstFrame?16.6:t)/1e3;this.isFirstFrame&&(this.isFirstFrame=!1);let a=n*60,s=!1;if(this.usePhysics&&this.collisionEnabled){let p=Ys.set(0,(this.velocity.y===0?this.pixelsPerMeter*Math.max(Math.abs(this.gravity)/(10*$V),1)*(this.gravity>0?1:-1):this.velocity.y)*n,0).divideScalar(this.pixelsPerMeter),v=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter),this.colliderWorldQuat,p,(l=this.object.rigidBody)==null?void 0:l.collider(0).shape,1,!1,16,void 0,void 0,this.object.rigidBody);if(v){this.onObject=!0,this.groundNormal.set(v.normal2.x,v.normal2.y,v.normal2.z).applyQuaternion(this.colliderWorldQuat).negate(),this.alignToGround&&this.groundTiltAdjustment(this.groundNormal),Math.acos(this.groundNormal.y)<this.slopeThresh&&(s=!0),((c=v.collider.parent())==null?void 0:c.bodyType())===0&&Math.acos(this.groundNormal.y)*(180/Math.PI)>45&&(this.onObject=!1);let _=v.collider.parent();this.groundYRotation=0,this.groundVelocity.set(0,0,0);for(let y of this.sharedGameControlGlobals.entitiesWithTransformAnim)if(y.rigidBody===_&&y.userData.isFollowingObj!==this.object.uuid){(y.hasNonUniformScale?y.matrixWorldRigid:y.matrixWorld).decompose(bs,Vh,Ys),this.groundVelocity.subVectors(bs,y.prevT),this.object.getWorldPosition(Ys).add(this.collider.position).sub(bs),this.groundYRotation=Pc.setFromQuaternion(Vh).y-y.prevR.y,Ed.copy(Ys).applyAxisAngle(jl,this.groundYRotation),this.groundVelocity.add(Ed.sub(Ys)).divideScalar(n);break}}else this.onObject=!1}if(this.moveMode==="walk"&&this.collisionEnabled&&(this.movementState.jump===1&&this.onObject&&(this.velocityTarget.y=this.jumpPower,this.movementState.jump=0,this.dispatchStopEvent("idle"),this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.dispatchStopEvent("jump"),this.dispatchStartEvent("jump"),this.onObject=!1),this.onObject?this.velocityTarget.y/=2:this.velocityTarget.y+=this.gravity*a),this.moveMode==="fly"&&(this.velocityTarget.y=(this.movementState.movePosY-this.movementState.moveNegY)*this.speedTranslate),this.directionXZ.z=this.movementState.movePosZ-this.movementState.moveNegZ,this.directionXZ.x=this.movementState.movePosX-this.movementState.moveNegX,this.forwardDir==="+z"&&this.directionXZ.multiplyScalar(-1),this.directionXZ.manhattanLength()>0&&(this.path=[]),this.navMeshPathDest){let p=this.navMeshPathDest.material;if(this.moveMode==="walk"&&this.path.length>1){this.navMeshPathDest.position.copy(this.path[this.path.length-1]),this.navMeshPathDest.parent||this.page.add(this.navMeshPathDest);let v=bs.subVectors(this.path[1],this.position),_=Ys.subVectors(this.path[1],this.path[0]);v.dot(_)<0?this.path.shift():(this.directionXZ.x=_.x,this.directionXZ.z=_.z),p.opacity=p.userData.opacity0}else p.opacity-=.05*p.userData.opacity0,this.navMeshPathDest.material.opacity<=0&&this.navMeshPathDest.parent&&this.page.remove(this.navMeshPathDest)}this.directionXZ.normalize(),this.movementState.run?this.moveForce=this.runMultiplier:this.moveForce=1,this.velocityTarget.z=this.directionXZ.z*this.speedTranslate*this.moveForce,this.velocityTarget.x=this.directionXZ.x*this.speedTranslate*this.moveForce,(this.moveMode==="walk"?this.velocityTarget.x+this.velocityTarget.z===0:this.velocityTarget.manhattanLength()===0)?this.lerpFactorPos.setScalar(this.lerpFactorPosEnd):this.lerpFactorPos.setScalar(this.lerpFactorPosStart),this.moveMode==="walk"&&(this.lerpFactorPos.y=1),this.didHit===!1&&this.pushedVelocity.manhattanLength()===0||this.usePhysics===!1?(this.velocity.x+=(this.velocityTarget.x-this.velocity.x)*(1-(1-this.lerpFactorPos.x)**a),this.velocity.y+=(this.velocityTarget.y-this.velocity.y)*(1-(1-this.lerpFactorPos.y)**a),this.velocity.z+=(this.velocityTarget.z-this.velocity.z)*(1-(1-this.lerpFactorPos.z)**a)):this.velocity.copy(this.velocityTarget),(this.moveMode==="walk"?this.velocity.x**2+this.velocity.z**2<this.speedTranslate:this.velocity.lengthSq()<this.speedTranslate)?(this.dispatchStopEvent("move"),this.dispatchStopEvent("run"),this.onObject&&(this.dispatchStopEvent("jump"),this.dispatchStartEvent("idle"))):(this.dispatchStopEvent("idle"),this.onObject&&(this.dispatchStopEvent("jump"),this.movementState.run?(this.dispatchStopEvent("move"),this.dispatchStartEvent("run")):(this.dispatchStopEvent("run"),this.dispatchStartEvent("move"))));let o=L3e.copy(this.velocity);if(this.orientMode!=="none"&&this.isFirstPerson===!1){let p=Ys.copy(o);p.y=0,o.set(0,o.y,p.length()*(this.forwardDir==="+z"?1:-1))}if(this.directionXZ.manhattanLength()>0&&this.orientMode!=="none"&&this.isFirstPerson===!1)if(this.orientWith==="camera"&&this.path.length<=1){let p=bs;this.camera.getWorldDirection(p);let v=Ed.copy(jl).multiplyScalar(p.dot(jl));p.sub(v);let _=Ys.copy(this.directionXZ);_.x*=-1,this.rot.y=p.angleTo(_)*(p.cross(_).y>0?-1:1)+this.rotationAccumWhenOrientWithCamera}else this.rot.y=(this.path.length>1?0:this.euler.y)+Math.atan2(-this.directionXZ.z,this.directionXZ.x)+Math.PI/2*(this.forwardDir==="+z"?1:-1);
11956if(Pc.setFromVector3(this.rot),this.moveMode==="walk"&&(Pc.x=0),o.applyEuler(Pc),s&&(Vh.setFromUnitVectors(jl,this.groundNormal),o.applyQuaternion(Vh)),r){let p=Pc.set(0,this.vrEulerYOffset*e8,0);r.applyEuler(p),o.x+=r.x,o.z+=r.z,this.nonColliderPosOffset.elements[13]+=r.y*n}if(this.usePhysics===!0){let p=Ys;this.pushedVelocity.set(0,0,0);for(let v of this.sharedGameControlGlobals.entitiesWithTransformAnim){let _=Ed.setFromMatrixPosition(v.matrixWorld).sub(v.prevT).divideScalar(n).divideScalar(this.pixelsPerMeter),y=v.rigidBody.collider(0).castCollider(_,this.object.rigidBody.collider(0),bs.copy(o).divideScalar(this.pixelsPerMeter),n,!1);_.multiplyScalar(this.pixelsPerMeter);let w=Oi.is(v)?v:v.object;if(y!==null&&this.lastHitObj!==w){let b;v instanceof us&&(b=v);let E=this.sharedGameControlGlobals.entityToCollisionEvents[w.uuid];if(E)for(let M of E)M.data.target==="character"&&(M.dispatch(b),w.dispatchEvent(tO));this.lastHitObj=w}if(y!==null){this.pushedVelocity.copy(_),p.copy(y.normal1).applyQuaternion(v.quaternion);break}}if(this.pushedVelocity.manhattanLength()!==0){let v=p.dot(o);v<0&&o.addScaledVector(p,-v),o.add(this.pushedVelocity)}else o.add(this.groundVelocity)}if(this.rotDirection.y=Number(this.movementState.rotPosY)-Number(this.movementState.rotNegY),this.rotDirection.x=Number(this.movementState.rotPosX)-Number(this.movementState.rotNegX),this.rotDirection.normalize(),this.rotationMode==="normal"&&(this.movementState.rotPosX||this.movementState.rotNegX)||this.rotationMode==="steer"&&(this.movementState.rotPosX||this.movementState.rotNegX)&&(this.movementState.movePosZ||this.movementState.moveNegZ||this.moveMode==="walk")?this.rotVelocityStick.x=-this.rotDirection.x*this.speedOrbit*this.rotForce:this.rotVelocityStick.x=0,this.rotationMode==="normal"&&(this.movementState.rotPosY||this.movementState.rotNegY)||this.rotationMode==="steer"&&(this.movementState.rotPosY||this.movementState.rotNegY)&&(this.movementState.movePosZ||this.movementState.moveNegZ)?this.rotVelocityStick.y=-this.rotDirection.y*this.speedOrbit*this.rotForce:this.rotVelocityStick.y=0,this.rotVelocityTarget.subVectors(this.eulerDelta.divideScalar(n),this.rotVelocityStick),this.rotVelocityTarget.manhattanLength()===0?this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotEnd)**a):this.rotVelocity.lerp(this.rotVelocityTarget,1-(1-this.lerpFactorRotStart)**a),this.euler.x+=this.rotVelocity.x*n,this.euler.y+=this.rotVelocity.y*n+this.groundYRotation,this.rotVelocityTarget.y===0&&this.directionXZ.manhattanLength()===0?this.rotationAccumWhenOrientWithCamera=0:(this.cameraFollow===!1||this.cameraYAxis==="Locked")&&(this.rotationAccumWhenOrientWithCamera+=this.rotVelocity.y*n),this.isFirstPerson===!1&&this.orientMode!=="none"&&this.directionXZ.manhattanLength()>0){if(this.orientMode==="radial"){this.objectToCamXZ.copy(this.objectToCamXZ0).applyAxisAngle(jl,this.euler.y-this.euler0.y);let p=Ys.copy(this.objectToCamXZ).normalize(),v=Ed.copy(o).multiplyScalar(n);v.y=0;let _=v.sub(bs.copy(p).multiplyScalar(v.dot(p))).cross(p).y;this.euler.y-=Math.atan2(_,this.objectToCamXZ.length())}}else this.rot.y+=this.rotVelocity.y*n+this.groundYRotation,this.rotVelocityTarget.y!==0&&(this.cameraFollow===!1||this.cameraYAxis==="Locked")&&(this.euler.y=this.rot.y);if(this.cameraFollow===!0&&(this.moveMode==="walk"?this.cameraXAxis==="Limit"?this.euler.x=Ct.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):this.euler.x=Ct.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset,this.PI_2+this.cameraPolarOffset):this.cameraXAxis==="Limit"&&(this.euler.x=Ct.clamp(this.euler.x,-this.PI_2,this.PI_2))),this.moveMode==="fly"?this.rot.x=this.euler.x:this.isFirstPerson&&(i?(Pc.copy(i),Pc.y=0):(Pc.copy(this.euler),Pc.y=0),this.nonColliderRotOffset.makeRotationFromEuler(Pc)),i&&(this.moveMode==="walk"?(this.rot.y=i.y,this.rot.x=0,this.rot.z=0):this.rot.setFromEuler(i),this.rot.y+=this.vrEulerYOffset*e8),Wl.setFromAxisAngle(N3e,this.rot.x),Vh.setFromAxisAngle(jl,this.rot.y),Vh.multiply(Wl),Wl.setFromAxisAngle(U3e,this.rot.z),Vh.multiply(Wl),this.quaternion.copy(Vh),this.objectRealQuat.multiplyQuaternions(this.quaternion,this.objXZQuat),this.colliderWorldQuat.copy(this.objectRealQuat).multiply(this.collider.rotation),this.collisionEnabled)if(this.usePhysics){let p=Ys.copy(o).multiplyScalar(n/this.pixelsPerMeter),v=null;this.didHit=!1;let _=new O;for(let y=0;y<5;y++){let w=p.length(),b=Ed.copy(p).normalize();if(v=this.sharedGameControlGlobals.rapierWorld.castShape(this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(_),this.colliderWorldQuat,b,(h=this.object.rigidBody)==null?void 0:h.collider(0).shape,w,!1,24,void 0,void 0,this.object.rigidBody),v!==null){this.didHit=!0;let E=this.sharedGameControlGlobals.colliderToEntity.get(v.collider.handle);if(E!==this.lastHitObj&&y===0){this.lastHitObj=E;let C=this.sharedGameControlGlobals.entityToCollisionEvents[E==null?void 0:E.uuid];if(C){for(let x of C)if(x.data.target==="character"){let R=((u=this.sharedGameControlGlobals.rapierWorld)==null?void 0:u.getCollider(v.collider.handle))._parent,L;
11956if(E.cloner){for(let I of E.cloner.children)if(I.rigidBody===R){L=I;break}}x.dispatch(L),E.dispatchEvent(tO)}}}let M=XV.set(v.normal2.x,v.normal2.y,v.normal2.z).applyQuaternion(this.colliderWorldQuat),S=qV.copy(b).multiplyScalar(v.toi).dot(M),T=v.toi;if(T===0&&(this.position.y+=this.offset*this.pixelsPerMeter),S>this.offset&&(T=v.toi*(S-this.offset)/S,_.addScaledVector(b,T)),p.copy(b).multiplyScalar(w-T),Math.acos(-M.y)>this.slopeThresh){let C=this.colliderWorldPosition.divideScalar(this.pixelsPerMeter).add(_),x=Ed.copy(v.witness2).applyQuaternion(this.colliderWorldQuat);x.y=0;let R=C.add(x);R.y+=this.stepThresh;let L=this.sharedGameControlGlobals.rapierWorld.castShape(R,this.colliderWorldQuat,p,(d=this.object.rigidBody)==null?void 0:d.collider(0).shape,1,!1,24,void 0,void 0,this.object.rigidBody);L!==null&&L.toi===0&&(M.y=0,M.normalize())}p.addScaledVector(M,-p.dot(M))}else{y===0&&this.directionXZ.manhattanLength()!==0&&(this.lastHitObj=null),_.add(p);break}}this.position.addScaledVector(_,this.pixelsPerMeter),(A=this.object.rigidBody)==null||A.setTranslation(bs.copy(this.position).divideScalar(this.pixelsPerMeter),!0),(f=this.object.rigidBody)==null||f.setRotation(Wl.copy(this.quaternion).premultiply(this.groundTilt).multiply(this.objXZQuat),!0)}else{let p=this.onObject?1:5,v=o.multiplyScalar(n/p);for(let _=0;_<p;_++)this.position.add(v),this.collisionAdjustment(n/p)}else this.position.addScaledVector(o,n);if(this.moveMode==="walk"&&this.onObject&&(this.velocityTarget.y=0,this.velocity.y=0),this.quaternion.premultiply(this.groundTilt).multiply(this.objXZQuat),this.object.matrix.compose(this.position,this.quaternion,this.scale),this.object.matrixWorldNeedsUpdate=!0,this.object.matrix.multiply(this.nonColliderPosOffset).multiply(this.nonColliderRotOffset),this.quaternion.premultiply(this.groundTiltInv).multiply(this.objXZQuatInv),this.cameraFollow===!0){this.updateFollowArms();let p=this.objectToTarget.add(this.position),v=this.targetToCamera.add(p);d2.lookAt(v,p,jl).setPosition(v),d2.decompose(this.targetPos,this.targetQuat,bs),this.camera.quaternion.slerp(this.targetQuat,1-(1-this.lerpFactorRotCamera)**a),this.camera.position.lerp(this.targetPos,1-(1-this.lerpFactorPosCamera)**a),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.cameraYAxis==="Limit"&&this.orientMode==="cartesian"&&(this.euler.y=Ct.clamp(this.euler.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel)),this.euler.x=Ct.clamp(this.euler.x,-this.PI_2+(this.cameraPolarOffset<0?this.cameraPolarOffset:0),this.PI_2+(this.cameraPolarOffset>0?this.cameraPolarOffset:0))}return this.eulerDelta.set(0,0,0),this.object.dispatchEvent(Q3e),this.path.length<2&&this.lastPosition.distanceToSquared(this.position)<this.threshEndTranslate&&Math.abs(this.rotVelocity.x)<this.threshEndRotVel&&Math.abs(this.rotVelocity.y)<this.threshEndRotVel&&(this.camera===void 0||this.isFirstPerson||this.lastCameraPosition.distanceToSquared(this.camera.position)<this.threshEndTranslate&&8*(1-this.lastCameraQuaternion.dot(this.camera.quaternion))<this.threshEndRotate)&&(this.moveMode==="fly"||this.onObject===!0||this.collisionEnabled===!1)&&(this.navMeshPathDest===null||this.navMeshPathDest.material.opacity<-.04*((g=(m=this.navMeshPathDest)==null?void 0:m.material)==null?void 0:g.userData.opacity0))?!1:(this.camera&&(this.lastCameraPosition.copy(this.camera.position),this.lastCameraQuaternion.copy(this.camera.quaternion)),this.lastPosition.copy(this.position),this.object.dispatchEvent(z3e),!0)}updateFollowArms(){this.objectToTarget.copy(this.objectToTarget0),this.targetToCamera.copy(this.targetToCamera0);let t=Wl.setFromAxisAngle(jl,this.cameraYAxis==="Limit"&&this.orientMode!=="radial"?Ct.clamp(this.euler.y-this.euler0.y,this.minAzimuthAngleRel,this.maxAzimuthAngleRel):this.euler.y-this.euler0.y);(this.cameraYAxis!=="Locked"||this.orientMode==="radial")&&this.objectToTarget.applyQuaternion(t);let i;this.cameraXAxis==="Limit"?i=Ct.clamp(this.euler.x,-this.maxPolarAngle+this.cameraPolarOffset+1e-6,-this.minPolarAngle+this.cameraPolarOffset-1e-6):i=Ct.clamp(this.euler.x,-this.PI_2+this.cameraPolarOffset+1e-6,this.PI_2+this.cameraPolarOffset-1e-6);let r=bs.copy(this.cameraPolarAxis0);(this.cameraYAxis!=="Locked"||this.orientMode==="radial")&&r.applyQuaternion(t);let n=Vh.setFromAxisAngle(r,i);this.cameraYAxis!=="Locked"&&this.targetToCamera.applyQuaternion(t),this.cameraXAxis!=="Locked"&&this.targetToCamera.applyQuaternion(n)}groundTiltAdjustment(t){jl.angleTo(t)*180/Math.PI<15||jl.angleTo(t)*180/Math.PI>85?Wl.identity():Wl.setFromUnitVectors(jl,t),this.groundTilt.slerp(Wl,.06),this.groundTiltInv.copy(this.groundTilt).invert()}collisionAdjustment(t){var a;let i=qV.set(0,0,0);this.object.matrix.compose(this.position,this.quaternion,this.scale);
11956let r=d2.multiplyMatrices(this.object.matrix,this.objXZRotMat).multiply(this.collider.matrix).decompose(bs,Wl,Ys).compose(bs,Wl,JV);this.sharedGameControlGlobals.entitiesWithTransformAnim.forEach(s=>{if(s===this.object||s.isDescendantOf(this.object))return;Vo.makeEmpty(),s.updateMatrixWorldSVD();let o=s.matrixWorldRigid,l=ZV.copy(o).invert(),c=O3e.copy(ZV).multiply(r);sa.copy(this.collider.segment),sa.start.applyMatrix4(c),sa.end.applyMatrix4(c);let h=XV.copy(this.position).applyMatrix4(l);Vo.expandByPoint(sa.start),Vo.expandByPoint(sa.end),Vo.min.addScalar(-this.collider.radius),Vo.max.addScalar(this.collider.radius),s.bvhGeometry.boundsTree.shapecast({traverseBoundsOrder(u){return u.distanceToPoint(sa.end)},intersectsBounds:u=>u.intersectsBox(Vo),intersectsTriangle:u=>{let d=bs,A=Ys,f=u.closestPointToSegment(sa,d,A);if(f<this.collider.radius){let m=this.collider.radius-f,g=A.sub(d).normalize(),p=Ed.copy(h);p.addScaledVector(g,m);let v=p.applyMatrix4(o).sub(this.position);i.add(v),sa.start.addScaledVector(g,m),sa.end.addScaledVector(g,m)}}})}),Vo.makeEmpty(),sa.copy(this.collider.segment),sa.start.applyMatrix4(r),sa.end.applyMatrix4(r),Vo.expandByPoint(sa.start),Vo.expandByPoint(sa.end),Vo.min.addScalar(-this.collider.radius),Vo.max.addScalar(this.collider.radius),(a=this.sharedGameControlGlobals.staticMeshBVH)==null||a.shapecast({traverseBoundsOrder(s){return s.distanceToPoint(sa.end)},intersectsBounds:s=>s.intersectsBox(Vo),intersectsTriangle:s=>{let o=bs,l=Ys,c=s.closestPointToSegment(sa,o,l);if(c<this.collider.radius){let h=this.collider.radius-c,u=l.sub(o).normalize();this.alignToGround&&this.groundTiltAdjustment(u),i.addScaledVector(u,h),sa.start.addScaledVector(u,h),sa.end.addScaledVector(u,h)}}}),this.onObject=Math.abs(i.y)>Math.abs(t*this.velocity.y*.25),this.onObject&&this.dispatchStopEvent("jump");let n=Math.max(0,i.length()-1e-5);i.normalize().multiplyScalar(n),this.position.add(i)}},rZ=$L;rZ.isLocked=!1;var V3e=$u(d7());function hu(t,i){let r=new Lt;if(!t.getAttribute("position"))return r.setAttribute("position",new Et([],3)),r.setIndex([]),r;let{positions:n,triIndices:a}=CM(t.getAttribute("position"),t.getIndex());return r.setAttribute("position",new Et(n,3)),r.setIndex(a),i&&r.applyMatrix4(i),r}var W3e=new ht,j3e=new ht,Lc=[[0,0,0],[0,0,0],[0,0,0]];function nZ(t){let i=t.elements;Lc[0][0]=i[0],Lc[0][1]=i[4],Lc[0][2]=i[8],Lc[1][0]=i[1],Lc[1][1]=i[5],Lc[1][2]=i[9],Lc[2][0]=i[2],Lc[2][1]=i[6],Lc[2][2]=i[10];let{u:r,v:n}=(0,V3e.SVD)(Lc),a=W3e.set(r[0][0],r[0][1],r[0][2],0,r[1][0],r[1][1],r[1][2],0,r[2][0],r[2][1],r[2][2],0,0,0,0,1),s=j3e.set(n[0][0],n[0][1],n[0][2],0,n[1][0],n[1][1],n[1][2],0,n[2][0],n[2][1],n[2][2],0,0,0,0,1);return a.multiply(s.transpose())}var Y3e=class extends nY{constructor(){super(),this.layers.enable(3),this.layers.enable(8)}setFromCamera(t,i){i.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(i),this.ray.direction.set(0,0,-1).transformDirection(i.matrixWorld),this.camera=i):i.isPerspectiveCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(i),this.ray.direction.set(t.x,t.y,.5).unproject(i).sub(this.ray.origin).normalize(),this.camera=i):console.error("Raycaster: Unsupported camera type.")}intersectVisibleObjects(t,i=!0,r=[]){return t.forEach(n=>{n.visible&&this.intersectObject(n,i,r)}),r}createRaycastLineHelper(){let t=new WA({color:65280,linewidth:10}),i=new O(this.ray.origin.x,this.ray.origin.y,this.ray.origin.z),r=new O(this.ray.direction.x,this.ray.direction.y,this.ray.direction.z),n=this.camera.far-this.camera.near,a=new O().addVectors(i,r.multiplyScalar(n)),s=new Lt;return s.setFromPoints([i,a]),new MC(s,t)}},aZ=t=>t instanceof kg||t instanceof Hg;function K3e(t,i){return t.distance-i.distance}function sZ(t,i,r){if(!(!cu(i)||!i.visible)){$l(i)&&i.raycast(t,r);for(let n of i.children)sZ(t,n,r)}}function GS(t,i,r,n=!1){if(!n&&!r.some(s=>wT(t,s)!==void 0))return[];let a=[];return i.children.forEach(s=>sZ(t,s,a)),a.sort(K3e),a}function eO(t){let i=[];if(t.length){let r=t[0].object;cu(r)&&i.push(r);let n=r.parent;for(;n;)aZ(n)&&i.push(n),n=n.parent}return i}function uu(t,i,r,n){let a=t.frame;if(a){let s=i[0]*a.width,o=(1-i[1])*a.height;for(let l of r){let c=l===a.uuid?a:a.find(l);if(c!=null&&c.intersects(s,o))return n(c),!0}}return!1}
11956function wT(t,i){if($l(i)){if(i.visible){let r=[];return i.raycast(t,r),r.length?r[0]:void 0}}else if(aZ(i))return oZ(t,i)}function oZ(t,i){if(!(!cu(i)||!i.visible)){if($l(i)){let r=[];if(i.raycast(t,r),r.length)return r[0]}for(let r of i.children){let n=oZ(t,r);if(n)return n}}}function X3e(t,i,r){return{x:(t-(r.left+window.scrollX))/r.width*2-1,y:-((i-(r.top+window.scrollY))/r.height)*2+1}}function q3e(t,i,r){return{x:(t-(r.left+window.scrollX))/r.width,y:1-(i-(r.top+window.scrollY))/r.height}}var Z3e=class{constructor(t,i,r,n,a,s,o,l){this.renderer=t,this.publish=i,this.scene=r,this.getCamera=n,this.sharedAssets=a,this.requestRender=s,this.isExport=o,this.frame=l,this.raycaster=new Y3e,this._useWindowEvents=!1,this.pointerWorld={x:0,y:0},this.pointerScreen={x:0,y:0},this._useWindowEvents=i.mouseEventTarget==="window",this.domElement=t.domElement,this.eventElement=this._useWindowEvents?window:t.domElement,this._domRect=this.domElement.getBoundingClientRect()}get stopRaycast(){return this.publish.stopRaycast}get page(){return this.scene.activePage}set useWindowEvents(t){this._useWindowEvents=t,this.eventElement=t?window:this.renderer.domElement}get useWindowEvents(){return this._useWindowEvents}set domRect(t){this._domRect=t}get domRect(){return this._domRect}updateRaycaster(t){var n;let{pageX:i,pageY:r}=((n=t.touches)==null?void 0:n.length)>0?t.touches[0]:t;this.pointerWorld=X3e(i,r,this._domRect),this.pointerScreen=q3e(i,r,this._domRect),this.raycaster.setFromCamera(this.pointerWorld,this.getCamera())}},vo=class{constructor(t){this.eventContext=t,this.domEventsNeeded=new Set,this.hasVideoAction=!1}connect(){}disconnect(){}},FU=[["start","Start"],["keyDown","KeyDown"],["keyUp","KeyUp"],["mouseDown","MouseDown"],["mouseUp","MouseUp"],["mouseHover","MouseHover"],["collision","Collision"],["lookAt","LookAt"],["follow","Follow"],["scroll","Scroll"]],lZ=t=>{var i;return(i=FU.find(([r,n])=>n===t))==null?void 0:i[0]},UE=t=>{var i;return(i=FU.find(([r])=>r===t))==null?void 0:i[1]},J3e=(t,i)=>{let r=lZ(t);if(r){let n=new CustomEvent(r,{bubbles:!0});return Object.defineProperty(n,"target",{writable:!1,value:i}),n}},$3e=class extends vo{constructor(){super(...arguments),this.objectsPerEvents=new Map,this.splineEvents={},this.onBeginEvent=t=>{var n;if(!t.eventName||!t.target||t.eventName==="Scroll")return;let i=(n=this.splineEvents[lZ(t.eventName)])==null?void 0:n[t.target.uuid];if(!i)return;t.eventName==="Scroll"&&t.deltaY!==void 0&&Object.assign(i,{deltaY:t.deltaY});let{domElement:r}=this.eventContext;r.dispatchEvent(i)}}connect(){let{page:t}=this.eventContext;t.traverseEntity(i=>{var r,n;if((r=i.data)!=null&&r.events.length){for(let[a,s]of FU)if(i.data.events.some(o=>o.data.type===s&&!o.data.disabled)){this.objectsPerEvents.has(a)?(n=this.objectsPerEvents.get(a))==null||n.push(i):this.objectsPerEvents.set(a,[i]);let o={id:i.uuid,name:i.name},l=J3e(s,o),c=this.splineEvents[a];c?c[i.uuid]=l:this.splineEvents[a]={[i.uuid]:l}}}}),this.objectsPerEvents.forEach(i=>{i.forEach(r=>{r.addEventListener("beginEvent",this.onBeginEvent)})})}disconnect(){this.objectsPerEvents.forEach(t=>{t.forEach(i=>{i.removeEventListener("beginEvent",this.onBeginEvent)})})}},eFe=class{constructor(t,i,r,n,a,s){if(this.id=t,this.data=i,this.object=r,this.entered=!1,(i.type==="KeyDown"||i.type==="KeyUp"||i.type==="KeyPress")&&!i.key)throw new Error("Missing property");this.actions=xa(i,i.actions,n,a,s,r)}disconnect(){ba(this.actions)}dispatchHeld(t){this.actions.Create.forEach(i=>{t&&i.dispatchThrottled.cancel(),i.dispatchThrottled()})}dispatch(t=!1){this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),this.data.type==="MousePress"||this.data.type==="KeyPress"?this.entered||(this.entered=!0,this.actions.Transition.forEach(i=>i.playFromCurrent()),this.actions.Animation.forEach(i=>i.playFromCurrent()),this.actions.SwitchCamera.forEach(i=>i.playFromCurrent()),this.actions.Create.forEach(i=>i.dispatchStart())):(this.actions.Transition.some(i=>i.playing&&i.data.runMode!=="Toggle")||this.actions.Transition.forEach(i=>
vendor: 2,041 bytes, line 11956
11956{i.data.runMode==="Toggle"?i.toggle():i.play()}),this.actions.SwitchCamera.some(i=>i.playing&&i.data.runMode!=="Toggle")||this.actions.SwitchCamera.forEach(i=>{i.data.runMode==="Toggle"?i.toggle():i.play()}),this.actions.Animation.forEach(i=>{i.data.runMode==="Toggle"?i.toggle():i.play()})),this.actions.Link.forEach(i=>{i.dispatch()}),this.actions.SceneTransition.forEach(i=>{i.dispatch()}),t===!1&&this.actions.Create.forEach(i=>{i.dispatch()}),this.actions.Destroy.forEach(i=>{i.dispatch()}),this.actions.Reset.forEach(i=>{i.dispatch()}),this.actions.Audio.forEach(i=>{i.dispatchBasic()}),this.actions.Video.forEach(i=>{i.dispatchBasic()}),this.actions.Particles.forEach(i=>{i.dispatchBasic()}),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch())}dispatchRelease(){this.entered&&(this.entered=!1,this.actions.Transition.forEach(t=>t.reverseFromCurrent()),this.actions.Particles.forEach(t=>t.reverseFromCurrent()),this.actions.Animation.forEach(t=>t.reverseFromCurrent()),this.actions.SwitchCamera.forEach(t=>t.reverseFromCurrent()),this.actions.Create.forEach(t=>t.dispatchStop()))}dispatchUserEvent(t){this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),t?(this.actions.Transition.forEach(i=>i.reverseFromCurrent()),this.actions.Animation.forEach(i=>i.reverseFromCurrent()),this.actions.SwitchCamera.forEach(i=>i.reverseFromCurrent())):(this.actions.Transition.forEach(i=>i.playFromCurrent()),this.actions.Animation.forEach(i=>i.playFromCurrent()),this.actions.SwitchCamera.forEach(i=>i.playFromCurrent())),this.actions.Link.forEach(i=>{i.dispatch()}),this.actions.SceneTransition.forEach(i=>{i.dispatch()}),this.actions.Create.forEach(i=>{i.dispatch()}),this.actions.Destroy.forEach(i=>{i.dispatch()}),this.actions.Reset.forEach(i=>{i.dispatch()}
11956),this.actions.Audio.forEach(i=>{i.dispatchBasic()}),this.actions.Video.forEach(i=>{i.dispatchBasic()}),this.actions.Particles.forEach(i=>{i.dispatchBasic()}),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch())}},tFe=class extends vo{constructor(t,i,r){super(t),this.eventManager=i,this.useForRaycastProperty=r,this.objectsPerTypes={MouseDown:[],MouseUp:[],MousePress:[],KeyDown:[],KeyUp:[],KeyPress:[]},this.canvasMouseEvents=[],this.eventsPerObjects={MouseDown:{},MouseUp:{},MousePress:{},KeyDown:{},KeyUp:{},KeyPress:{}},this.heldKeys={},this.heldKeysPress={},this._prevObjects=[],this.sceneInterects=null,this.onCanvasRaycast=n=>{if(this.useForRaycastProperty===!0&&this.sceneInterects===null){this.eventContext.updateRaycaster(n);let{raycaster:a,page:s}=this.eventContext,o=GS(a,s,[],!0);this.sceneInterects=o,o.length&&(this.eventContext.sharedAssets.raycastProperty={x:o[0].point.x,y:o[0].point.y,z:o[0].point.z,objX:o[0].object.matrixWorld.elements[12],objY:o[0].object.matrixWorld.elements[13],objZ:o[0].object.matrixWorld.elements[14]})}},this.onCanvasMouseDown=n=>{(n.target===this.eventContext.domElement||n.target.tagName==="SPLINE-VIEWER")&&this.canvasMouseEvents.forEach(a=>{(a.data.type==="MouseDown"||a.data.type==="MousePress")&&(this.onCanvasRaycast(n),a.dispatch())})},this.onCanvasMouseUp=n=>{(n.target===this.eventContext.domElement||n.target.tagName==="SPLINE-VIEWER")&&this.canvasMouseEvents.forEach(a=>{a.data.type==="MouseUp"?(this.onCanvasRaycast(n),a.dispatch()):a.data.type==="MousePress"&&a.dispatchRelease()})},this.onMouseDown=n=>{jt.length>1||(this.eventContext.updateRaycaster(n),this.handleMouseEvent("MouseDown"))},this.onMouseUp=n=>{jt.length>1||(this.eventContext.updateRaycaster(n),this.handleMouseEvent("MouseUp"))},this.onMousePressDown=n=>{jt.length>1||(this.eventContext.updateRaycaster(n),this.handleMousePressEvent())},this.onMousePressRelease=n=>{jt.length>1||(this.eventContext.updateRaycaster(n),this.handleMousePressEvent(!0))},this.onKeyDown=n=>{this.heldKeys[n.key]||(this.handleKeyEvent(n,"KeyDown"),this.handleKeyEventHeld(n,"KeyDown",!0)),this.heldKeys[n.key]=!0},this.onKeyUp=n=>{this.handleKeyEvent(n,"KeyUp"),this.handleKeyEventHeld(n,"KeyUp",!0)},this.onKeyPressDown=n=>{this.heldKeysPress[n.key]?this.handleKeyEventHeld(n,"KeyPress"):(this.handleKeyEvent(n,"KeyPress"),this.handleKeyEventHeld(n,"KeyPress",!0)),this.heldKeysPress[n.key]=!0},this.onKeyPressUp=n=>{this.handleKeyEvent(n,"KeyPress",!0)},this.releaseHeldKey=n=>{delete this.heldKeys[n.key]},this.releaseHeldKeyPress=n=>{delete this.heldKeysPress[n.key]},this._onUserEvent=({eventName:n,target:a,reverse:s})=>{var l,c,h,u;if(!n||!a)return;let o=UE(n);o&&(o==="MouseDown"||o==="MouseUp"||o==="MousePress"?(a.dispatchEvent({type:"beginEvent",eventName:o}),(c=(l=this.eventsPerObjects[o])==null?void 0:l[a.uuid])==null||c.forEach(d=>{d.dispatchUserEvent(s)})):(o==="KeyDown"||o==="KeyUp"||o==="KeyPress")&&(a.dispatchEvent({type:"beginEvent",eventName:o}),(u=(h=this.eventsPerObjects[o])==null?void 0:h[a.uuid])==null||u.forEach(d=>{d.dispatchUserEvent()})))}}connect(){var a,s,o,l,c,h;let{page:t,sharedAssets:i,domElement:r}=this.eventContext,n=(u,d)=>{var f,m;if(!((f=u.data)!=null&&f.events.length))return;let A=["MouseDown","MouseUp","MousePress","KeyDown","KeyUp","KeyPress"];for(let g of A){let p=this.eventsPerObjects[g];u.data.events.filter(({data:v})=>v.type===g&&v.disabled!==!0).forEach(({id:v,data:_})=>{try{let y=new eFe(v,_,u,t,i,this.eventManager);y.actions.Video.length&&(this.hasVideoAction=!0),(_.type==="MouseDown"||_.type==="MouseUp"||_.type==="MousePress")&&(_.mode==="Canvas"||_.mode==="Window")?this.canvasMouseEvents.push(y):p[u.uuid]?p[u.uuid].some(w=>w.id===y.id)||p[u.uuid].push(y):p[u.uuid]=[y]}catch{}}),(m=p[u.uuid])!=null&&m.length&&this.objectsPerTypes[g].push(u instanceof Ca&&(g==="MouseDown"||g==="MouseUp"||g==="MousePress")?d:u)}};t.traverseEntity(u=>{var d;(u instanceof ls||u instanceof fa)&&((d=u.frame)==null||d.traverse(A=>{n(A,u)})),n(u)}),this.heldKeys={},this.heldKeysPress={},this.domEventsNeeded.clear(),r.addEventListener("pointerdown",this.onCanvasMouseDown),r.addEventListener("pointerup",this.onCanvasMouseUp),((a=this.objectsPerTypes.MouseDown)!=null&&a.length||this.useForRaycastProperty)&&(this.domEventsNeeded.add("pointerdown"),r.addEventListener("pointerdown",this.onMouseDown)),(s=this.objectsPerTypes.MouseUp)!=null&&s.length&&(this.domEventsNeeded.add("pointerup"),r.addEventListener("pointerup",this.onMouseUp)),(o=this.objectsPerTypes.MousePress)!=null&&o.length&&(this.domEventsNeeded.add("pointerdown"),r.addEventListener("pointerdown",this.onMousePressDown),this.domEventsNeeded.add("pointerup"),r.addEventListener("pointerup",this.onMousePressRelease)),(l=this.objectsPerTypes.KeyDown)!=null&&l.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.releaseHeldKey)),(c=this.objectsPerTypes.KeyUp)!=null&&c.length&&(this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyUp)),(h=this.objectsPerTypes.KeyPress)!=null&&h.length&&(this.domEventsNeeded.add("keydown"),document.addEventListener("keydown",this.onKeyPressDown),document.addEventListener("keyup",this.releaseHeldKeyPress),this.domEventsNeeded.add("keyup"),document.addEventListener("keyup",this.onKeyPressUp)),Object.entries(this.objectsPerTypes).forEac
11956h(([u,d])=>{d.forEach(A=>{A.addEventListener("userEvent",this._onUserEvent)})})}disconnect(){let{domElement:t}=this.eventContext;this.domEventsNeeded.clear(),this.heldKeys={},this.heldKeysPress={},t.removeEventListener("pointerdown",this.onCanvasMouseDown),t.removeEventListener("pointerup",this.onCanvasMouseUp),t.removeEventListener("pointerdown",this.onMouseDown),t.removeEventListener("pointerdown",this.onMousePressDown),t.removeEventListener("pointerup",this.onMouseUp),t.removeEventListener("pointerup",this.onMousePressRelease),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("keydown",this.onKeyPressDown),document.removeEventListener("keyup",this.onKeyPressUp),document.removeEventListener("keyup",this.releaseHeldKey),Object.values(this.eventsPerObjects).forEach(i=>{Object.values(i).forEach(r=>{r.forEach(n=>{n.disconnect()})})}),this.canvasMouseEvents.forEach(i=>{i.disconnect()}),Object.entries(this.objectsPerTypes).forEach(([i,r])=>{r.forEach(n=>{n.removeEventListener("userEvent",this._onUserEvent)})})}handleMouseEvent(t){var l,c,h,u;let{stopRaycast:i,raycaster:r,page:n,pointerScreen:a}=this.eventContext,s=this.objectsPerTypes[t],o=s.filter(d=>!(d instanceof Ca));if(!(!s.length&&!this.useForRaycastProperty)&&!(n.uiCanvas&&uu(n,[a.x,a.y],Object.keys(this.eventsPerObjects[t]),d=>{this.handleObjectMouseEventDispatch(d,t)}))){if(i||this.useForRaycastProperty){let d;if(this.sceneInterects===null?d=GS(r,n,o,this.useForRaycastProperty):(d=this.sceneInterects,this.sceneInterects=null),this.useForRaycastProperty&&d.length&&(this.eventContext.sharedAssets.raycastProperty={x:d[0].point.x,y:d[0].point.y,z:d[0].point.z,objX:d[0].object.matrixWorld.elements[12],objY:d[0].object.matrixWorld.elements[13],objZ:d[0].object.matrixWorld.elements[14]}),i){let A=[((c=(l=d[0])==null?void 0:l.uv)==null?void 0:c.x)??0,((u=(h=d[0])==null?void 0:h.uv)==null?void 0:u.y)??0];eO(d).forEach(f=>{f instanceof ls&&uu(f,A,Object.keys(this.eventsPerObjects[t]),m=>{this.handleObjectMouseEventDispatch(m,t)}),this.eventsPerObjects[t][f.uuid]&&this.handleObjectMouseEventDispatch(f,t)})}}i||o.forEach(d=>{var f,m;let A=wT(r,d);A&&(this.handleObjectMouseEventDispatch(d,t),d instanceof ls&&uu(d,[((f=A==null?void 0:A.uv)==null?void 0:f.x)??0,((m=A==null?void 0:A.uv)==null?void 0:m.y)??0],Object.keys(this.eventsPerObjects[t]),g=>{this.handleObjectMouseEventDispatch(g,t)}))})}}handleMousePressEvent(t=!1){let i="MousePress",r=this.objectsPerTypes[i],n=r.filter(s=>!(s instanceof Ca)),a=[];if(r.length){if(!t){let{stopRaycast:s,raycaster:o,page:l,pointerScreen:c}=this.eventContext,h=!1;if(l.uiCanvas&&(h=uu(l,[c.x,c.y],Object.keys(this.eventsPerObjects[i]),u=>{a.push(u)})),s&&!h){let u=GS(o,l,n);a=eO(u),u.forEach(d=>{var A,f;d.object instanceof ls&&uu(d.object,[((A=d==null?void 0:d.uv)==null?void 0:A.x)??0,((f=d==null?void 0:d.uv)==null?void 0:f.y)??0],Object.keys(this.eventsPerObjects[i]),m=>{a.push(m)})})}else n.forEach(u=>{var A,f;let d=wT(o,u);d&&(a.push(u),u instanceof ls&&uu(u,[((A=d==null?void 0:d.uv)==null?void 0:A.x)??0,((f=d==null?void 0:d.uv)==null?void 0:f.y)??0],Object.keys(this.eventsPerObjects[i]),m=>{a.push(m)}))})}this._prevObjects.length&&this._prevObjects.forEach(s=>{a.includes(s)||this.handleObjectMouseEventDispatchRelease(s,i)}),a.length&&a.forEach(s=>{this.handleObjectMouseEventDispatch(s,i)}),this._prevObjects=a}}handleObjectMouseEventDispatch(t,i){var r,n;t.dispatchEvent({type:"beginEvent",eventName:i}),(n=(r=this.eventsPerObjects[i])==null?void 0:r[t.uuid])==null||n.forEach(a=>{a.dispatch()})}handleObjectMouseEventDispatchRelease(t,i){var r,n;t.dispatchEvent({type:"beginEvent",eventName:i}),(n=(r=this.eventsPerObjects[i])==null?void 0:r[t.uuid])==null||n.forEach(a=>{a.dispatchRelease()})}
11956handleKeyEvent(t,i,r=!1){this.objectsPerTypes[i].forEach(n=>{let a=this.eventsPerObjects[i][n.uuid];a.some(({data:s})=>"key"in s&&s.key===t.key)&&n.dispatchEvent({type:"beginEvent",eventName:i}),a.forEach(s=>{"key"in s.data&&s.data.key===t.key&&(r?s.dispatchRelease():s.dispatch(!0))})})}handleKeyEventHeld(t,i,r=!1){this.objectsPerTypes[i].forEach(n=>{this.eventsPerObjects[i][n.uuid].forEach(a=>{"key"in a.data&&a.data.key===t.key&&a.dispatchHeld(r)})})}},iFe=new O,rFe=new O,cZ=class{constructor(t,i,r,n,a){this.actionsIn=xa(t,t.inActions,r,n,a,i),this.actionsOut=xa(t,t.outActions,r,n,a,i)}disconnect(){ba(this.actionsIn),ba(this.actionsOut)}},nFe=class extends cZ{constructor(t,i,r,n,a,s){super(i,r,n,a,s),this.id=t,this.data=i,this.object=r,this.stage="out",this.objects=[],this.onUpdateMatrixWorld=()=>{for(let A of this.objects)if(!A.visible)return;let h=iFe.setFromMatrixPosition(this.objects[0].matrixWorld),u=rFe.setFromMatrixPosition(this.objects[1].matrixWorld),d=h.distanceTo(u)<=this.distance?"in":"out";if(this.stage!==d){this.stage=d;let A=d==="in"?this.actionsIn:this.actionsOut;
vendor: 1,396 bytes, line 11956
11956A.Audio.forEach(f=>f.dispatchConditional()),A.Particles.forEach(f=>f.dispatchConditional()),A.Video.forEach(f=>f.dispatchConditional()),A.Link.forEach(f=>f.dispatch()),A.Create.forEach(f=>f.dispatch()),A.Destroy.forEach(f=>f.dispatch()),A.Reset.forEach(f=>f.dispatch()),A.Transition.forEach(f=>{f.object.currentTransitionEvent!==this&&(f.object.currentTransitionEvent=this),f.init()}),A.Transition.forEach(f=>f.play()),A.Animation.forEach(f=>f.play()),A.SwitchCamera.forEach(f=>f.play()),A.SceneTransition.forEach(f=>f.dispatch()),A.SetVariable.forEach(f=>f.checkConditions()),A.SetVariable.forEach(f=>f.dispatch()),A.DynamicVariablePlay.forEach(f=>f.dispatch()),A.ClearLocalStorage.forEach(f=>f.dispatch()),A.UserAPI.forEach(f=>f.dispatch())}};let{distance:o,fromObject:l,toObject:c}=i.condition;this.distance=o;for(let h of[l,c]){if(!h)throw new Error("Missing property");let u=n.find(h);if(!u)throw new Error("Missing property");this.objects.push(u)}}connect(){window.setTimeout(()=>{this.objects.forEach(t=>{t.addEventListener("updateMatrixWorld",this.onUpdateMatrixWorld)}),this.onUpdateMatrixWorld()},0)}disconnect(){super.disconnect(),this.stage="out",this.objects.forEach(t=>{t.removeEventListener("updateMatrixWorld",this.onUpdateMatrixWorld)})}},aFe=class extends cZ{constructor(t,i,r,n,a,s){var c;super(i,r,n,a,s),this.id=t,this.data=i,this.object=r,this.onBegin=({target:h,state:u})=>
11956{this.toState!==u&&(this.actionsOut.Audio.forEach(d=>d.dispatchConditional()),this.actionsOut.Particles.forEach(d=>d.dispatchConditional()),this.actionsOut.Video.forEach(d=>d.dispatchConditional()),this.actionsOut.Link.forEach(d=>d.dispatch()),this.actionsOut.Create.forEach(d=>d.dispatch()),this.actionsOut.Destroy.forEach(d=>d.dispatch()),this.actionsOut.Reset.forEach(d=>d.dispatch()),this.actionsIn.Transition.forEach(d=>d.pause()),this.object.currentTransitionEvent=this,this.actionsOut.Transition.forEach(d=>d.play()),this.actionsOut.Animation.forEach(d=>d.play()),this.actionsIn.SwitchCamera.forEach(d=>d.pause()),this.actionsOut.SwitchCamera.forEach(d=>d.play()),this.actionsOut.SceneTransition.forEach(d=>d.dispatch()),this.actionsOut.SetVariable.forEach(d=>d.checkConditions()),this.actionsOut.SetVariable.forEach(d=>d.dispatch()),this.actionsOut.DynamicVariablePlay.forEach(d=>d.dispatch()),this.actionsOut.ClearLocalStorage.forEach(d=>d.dispatch()),this.actionsOut.UserAPI.forEach(d=>d.dispatch()))},this.onComplete=({target:h,state:u})=>
11956{this.toState===u&&(this.actionsIn.Audio.forEach(d=>d.dispatchConditional()),this.actionsIn.Particles.forEach(d=>d.dispatchConditional()),this.actionsIn.Video.forEach(d=>d.dispatchConditional()),this.actionsIn.Link.forEach(d=>d.dispatch()),this.actionsIn.Create.forEach(d=>d.dispatch()),this.actionsIn.Destroy.forEach(d=>d.dispatch()),this.actionsIn.Reset.forEach(d=>d.dispatch()),this.actionsOut.Transition.forEach(d=>d.pause()),this.actionsOut.Transition.forEach(d=>d.pause()),this.object.currentTransitionEvent=this,this.actionsIn.Transition.forEach(d=>d.play()),this.actionsIn.Animation.forEach(d=>d.play()),this.actionsOut.SwitchCamera.forEach(d=>d.pause()),this.actionsIn.SwitchCamera.forEach(d=>d.play()),this.actionsIn.SceneTransition.forEach(d=>d.dispatch()),this.actionsIn.SetVariable.forEach(d=>d.checkConditions()),this.actionsIn.SetVariable.forEach(d=>d.dispatch()),this.actionsIn.DynamicVariablePlay.forEach(d=>d.dispatch()),this.actionsOut.ClearLocalStorage.forEach(d=>d.dispatch()),this.actionsOut.UserAPI.forEach(d=>d.dispatch()))};let{condition:o}=i;if(!o.object)throw new Error("Missing property");let l=n.find(o.object)??n.scene.find2D(o.object);if(!l)throw new Error("Missing property");if(this.toObject=l,o.state&&!((c=this.toObject.states)!=null&&c[o.state]))throw new Error("Missing property");this.toState=o.state}connect(){Rf(this.actionsOut).forEach(t=>{var i;(i=this.actionsOut[t])!=null&&i.length&&this.toObject.addEventListener("beginState",this.onBegin)}),Rf(this.actionsIn).forEach(t=>{var i;(i=this.actionsIn[t])!=null&&i.length&&this.toObject.addEventListener("completeState",this.onComplete)})}disconnect(){super.disconnect(),Rf(this.actionsOut).forEach(t=>{var i;(i=this.actionsIn[t])!=null&&i.length&&this.toObject.removeEventListener("beginState",this.onBegin)}),Rf(this.actionsIn).forEach(t=>{var i;(i=this.actionsIn[t])!=null&&i.length&&this.toObject.removeEventListener("completeState",this.onComplete)})}},sFe=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.eventsPerConditions={Comparison:[],Distance:[],State:[]},this.hasVideoAction=!1}connect(){super.connect();let{page:t,sharedAssets:i}=this.eventContext;t.traverseEntity(r=>{var n;if((n=r.data)!=null&&n.events.length){for(let{id:a,data:s}of r.data.events)if(!s.disabled&&s.type==="Conditional")try{let o;s.condition.type==="Comparison"||(s.condition.type==="Distance"?o=new nFe(a,s,r,t,i,this.eventManager):s.condition.type==="State"&&(o=new aFe(a,s,r,t,i,this.eventManager))),o&&(this.eventsPerConditions[s.condition.type].push(o),(o.actionsIn.Video.length||o.actionsOut.Video.length)&&(this.hasVideoAction=!0))}catch{}}}),Object.values(this.eventsPerConditions).forEach(r=>r.forEach(n=>n.connect()))}disconnect(){super.disconnect(),Object.values(this.eventsPerConditions).forEach(t=>t.forEach(i=>i.disconnect()))}},Zv=new O,wd=new O,lf=new O,t8=new eo,oFe=.01,er=new O,Qn=new O,i8=new O,Ff=new ri,A2=new qn,lFe=new ht,f2=new Nn,km=new O,Oc=new O,Hm=.2;function p2(t,i){!i||(i[0]<i[1]&&(t.x=Math.min(Math.max(t.x,i[0]),i[1])),i[2]<i[3]&&(t.y=Math.min(Math.max(t.y,i[2]),i[3])),i[4]<i[5]&&(t.z=Math.min(Math.max(t.z,i[4]),i[5])))}var cFe=function(){let t=new ht;return(i,r,n)=>{let a=i.obj;t.copy(a.hiddenMatrix),a.parent!==null&&t.premultiply(a.parent.matrixWorld),t.invert(),a.position.copy(r),i.reference==="global"&&p2(a.position,i.limits),a.position.applyMatrix4(t),i.reference==="parent"?p2(a.position,i.limits):i.reference==="local"&&(Ff.copy(i.quat0).invert(),a.position.sub(i.position0),a.position.applyQuaternion(Ff),p2(a.position,i.limits),Ff.invert(),a.position.applyQuaternion(Ff),a.position.add(i.position0)),t.multiply(n??a.matrixWorld).decompose(er,a.quaternion,Qn),a.updateMatrix(),a.hasNonUniformScale&&(a.updateMatrixWorld(),a.updateMatrixWorldSVD()),a instanceof zs&&xu(a.parent)&&a.invalidateDownstreamBooleanData(!0)}}(),hFe=class{constructor(t,i,r,n,a,s,o){this.object=t,this.id=i,this.data=r,this.dropDestIds=[],this.activeIdx=null,this.wasDragEventTriggered=!1,this.resetDampingFactor=this.data.resetSpeed===0?1:8/this.data.resetSpeed+1,this.snapDampingFactor=this.data.snapSpeed===0?1:8/this.data.snapSpeed+1,this.actionsDrag=xa(r,r.dragDropActions.drag,n,a,s,this.object),this.actionsDrop=xa(r,r.dragDropActions.drop,n,a,s,this.object);let l=[];
11956this.data.objects.forEach(c=>{let h=n.find(c);!h||h.data.visible!==!1&&(l.push(h),o[h.uuid]&&o[h.uuid].forEach(u=>{let d=n.find(u);!d||d.data.visible!==!1&&l.push(d)}))}),this.data.dropDestinations.forEach(c=>{let h=n.find(c);!h||h.data.visible!==!1&&(this.dropDestIds.push(h.uuid),o[h.uuid]&&o[h.uuid].forEach(u=>{let d=n.find(u);!d||d.data.visible!==!1&&this.dropDestIds.push(d.uuid)}))}),this.dragItems=l.map(c=>(this.data.planeMode==="locked"&&(c.userData.lockedPlane=!0),c.userData.worldPosition0=new O().setFromMatrixPosition(c.matrixWorld),{obj:c,fromPosition:new O().setFromMatrixPosition(c.matrixWorld),pointStart:new O,pointEnd:new O,paused:!0,currentDampingFactor:this.data.dampingFactor,reset:!1,position0:new O().copy(c.position),quat0:new ri().copy(c.quaternion),snapped:!1,orientationMatrix:new ht,limits:this.data.limits,reference:this.data.referenceFrame}))}get activeDragItem(){return this.activeIdx!==null?this.dragItems[this.activeIdx]:null}dispose(){ba(this.actionsDrag),ba(this.actionsDrop),this.dragItems.forEach(t=>{t.fromPosition.copy(t.obj.userData.worldPosition0),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart),t.obj.recursiveBBoxNeedsUpdate=!0,t.obj.userData.lockedPlane=void 0,t.obj.position.copy(t.position0),t.obj.quaternion.copy(t.quat0),t.obj.updateMatrix()})}},uFe=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.events=[],this.lastDropDestination=null,this.dragTimeout=null,this.onPointerDown=r=>{var o;if(jt.length>1)return;this.eventContext.updateRaycaster(r);let{raycaster:n,page:a}=this.eventContext,s=a.raycastWithClones(n);if(this.lastDropDestination=null,s.length===0){this.activeEvent=null;return}for(let l of this.events){let c=0;for(let{obj:h,pointEnd:u,pointStart:d}of l.dragItems){if(h===s[0].object||h===s[0].object.object||Oi.is(h)&&h.isAncestorOf(s[0].object.uuid)){if(l.activeIdx=c,l.activeDragItem.reset=!1,l.activeDragItem.currentDampingFactor=l.data.dampingFactor,l.activeDragItem.snapped=!1,l.data.cursor==="hand"&&this.setCursor("grabbing"),this.eventManager.controlsManager.usePhysics){l.activeDragItem.obj.rigidBody&&l.activeDragItem.obj.rigidBody.setBodyType(2,!0);let A=l.activeDragItem.obj;h.hasNonUniformScale&&h.updateMatrixWorldSVD(),(A.hasNonUniformScale?A.matrixWorldRigid:A.matrixWorld).decompose(er,Ff,Qn),A2.setFromQuaternion(Ff),A.prevR===void 0?(A.prevR=A2.clone(),A.prevT=er.clone()):(A.prevR.copy(A2),A.prevT.copy(er)),this.eventManager.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.push(l.activeDragItem.obj)}this.calcPlaneIntersectPos(h,d,l.data.plane,l.data.referenceFrame),u.copy(d),(this.eventManager.controlsManager.usePhysics&&((o=h.data.physics)==null?void 0:o.rigidBody)==="dynamic"||l.data.drop===!1||l.data.resetOnSnapFail===!1)&&l.activeDragItem.fromPosition.setFromMatrixPosition(l.activeDragItem.obj.matrixWorld),this.activeEvent=l,this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1);return}c++}}this.activeEvent=null},this.onPointerMove=r=>{var o,l,c,h;if(jt.length>1)return;this.eventContext.updateRaycaster(r);let{raycaster:n,page:a}=this.eventContext,s=a.raycastWithClones(n);if(jt.length===0){let u=!1;for(let d of this.events){for(let{obj:A}of d.dragItems)if(A===((o=s[0])==null?void 0:o.object)||A===((c=(l=s[0])==null?void 0:l.object)==null?void 0:c.object)||Oi.is(A)&&A.isAncestorOf((h=s[0])==null?void 0:h.object.uuid)){switch(u=!0,d.data.cursor){case"hand":this.setCursor("grab");break;case"move":this.setCursor("move");break}break}if(u)break}u||this.setCursor("default");return}if(this.activeEvent&&this.activeEvent.activeDragItem){let u=this.activeEvent.activeDragItem;u.snapped=!1;let d;if(this.activeEvent.data.drop&&(d=s.filter(A=>u.obj!==A.object&&!u.obj.isAncestorOf(A.object.uuid)&&!(A.object instanceof kg)&&(this.activeEvent.data.dropOn==="all"||this.activeEvent.dropDestIds.some(f=>f===A.object.uuid||a.scene.find(f).isAncestorOf(A.object.uuid))))[0]),d){let A=i8.copy(d.face.normal).applyMatrix3(f2.getNormalMatrix(d.object.matrixWorld));if(this.activeEvent.data.snapTo==="center")u.fromPosition.setFromMatrixPosition(d.object.matrixWorld);else if(this.activeEvent.data.snapTo==="surface"){if(u.fromPosition.copy(d.point),this.activeEvent.data.snapSurfaceMode==="bbox"){er.copy(A).applyMatrix3(f2.setFromMatrix4(u.obj.matrixWorld).transpose());let f=u.obj;er.x>Hm?Qn.x=-f.recursiveBBox.min.x:er.x<-Hm&&(Qn.x=-f.recursiveBBox.max.x),er.y>Hm?Qn.y=-f.recursiveBBox.min.y:er.y<-Hm&&(Qn.y=-f.recursiveBBox.max.y),er.z>Hm?Qn.z=-f.recursiveBBox.min.z:er.z<-Hm&&(Qn.z=-f.recursiveBBox.max.z),Qn.applyMatrix3(f2.invert())}else Qn.copy(A).multiplyScalar(this.activeEvent.data.snapSurfaceOffset);u.fromPosition.add(Qn)}
vendor: 2,415 bytes, line 11956
11956this.activeEvent.data.autoOrient&&(er.set(0,1,0).cross(A),er.length()<1e-4&&er.set(-1,0,0).cross(A),Qn.crossVectors(i8,er),u.orientationMatrix.makeBasis(er,Qn,A)),u.pointStart.copy(u.fromPosition),u.pointEnd.copy(u.pointStart),u.currentDampingFactor=this.activeEvent.snapDampingFactor,u.snapped=!0,this.lastDropDestination!==d.object&&(this.lastDropDestination=d.object,this.activeEvent.actionsDrop.Transition.forEach(f=>{f.play()}),this.activeEvent.actionsDrop.Animation.forEach(f=>{f.play()}),this.activeEvent.actionsDrop.Audio.forEach(f=>{f.dispatchGameControl("start")}),this.activeEvent.actionsDrop.Particles.forEach(f=>{f.dispatchGameControl("start")}),this.activeEvent.actionsDrop.Create.forEach(f=>{f.dispatchThrottled()}))}else u.orientationMatrix.makeRotationFromQuaternion(u.quat0),this.lastDropDestination=null,u.currentDampingFactor=this.activeEvent.data.dampingFactor,this.calcPlaneIntersectPos(u.obj,u.pointEnd,this.activeEvent.data.plane,this.activeEvent.data.referenceFrame),this.activeEvent.actionsDrop.Transition.forEach(A=>{A.stop(),A.object.currentState!==null&&A.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrop.Animation.forEach(A=>{A.stop()}),this.activeEvent.actionsDrop.Audio.forEach(A=>{A.dispatchGameControl("stop")}),this.activeEvent.actionsDrop.Particles.forEach(A=>{A.dispatchGameControl("stop")});this.activeEvent.actionsDrag.Create.forEach(A=>{A.dispatchThrottled()}),this.activeEvent.actionsDrag.SetVariable.forEach(A=>A.checkConditions()),this.activeEvent.actionsDrag.SetVariable.forEach(A=>A.dispatch()),this.activeEvent.actionsDrag.DynamicVariablePlay.forEach(A=>A.dispatch()),this.activeEvent.actionsDrag.ClearLocalStorage.forEach(A=>A.dispatch()),this.activeEvent.actionsDrag.UserAPI.forEach(A=>A.dispatch()),this.activeEvent.wasDragEventTriggered===!1&&(this.activeEvent.wasDragEventTriggered=!0,this.activeEvent.actionsDrag.Transition.forEach(A=>{A.play()}),this.activeEvent.actionsDrag.Animation.forEach(A=>{A.play()}),this.activeEvent.actionsDrag.Audio.forEach(A=>{A.dispatchGameControl("start")}),this.activeEvent.actionsDrag.Particles.forEach(A=>{A.dispatchGameControl("start")})),this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>{!this.activeEvent||(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Audio.forEac
11956h(A=>{A.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Particles.forEach(A=>{A.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Transition.forEach(A=>{A.stop(),A.object.currentState!==null&&A.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrag.Animation.forEach(A=>{A.stop()}))},500),this.updateDragItem(u),u.obj.dispatchEvent({type:"requestRender"})}},this.onPointerUp=r=>{var n;if(this.activeEvent&&this.activeEvent.activeDragItem){this.activeEvent.data.cursor==="hand"&&this.setCursor("grab");let a=((n=this.activeEvent.activeDragItem.obj.data.physics)==null?void 0:n.rigidBody)==="dynamic";this.activeEvent.activeDragItem.snapped===!1&&this.activeEvent.data.drop&&this.activeEvent.data.resetOnSnapFail&&(this.eventManager.controlsManager.usePhysics===!1||!a)&&(this.activeEvent.activeDragItem.reset=this.activeEvent.data.resetOnSnapFail,this.activeEvent.activeDragItem.paused=!1,this.activeEvent.activeDragItem.currentDampingFactor=this.activeEvent.resetDampingFactor),this.eventManager.controlsManager.usePhysics&&a&&(this.eventManager.controlsManager.sharedGameControlGlobals.entitiesWithTransformAnim.pop(),this.activeEvent.activeDragItem.obj.rigidBody.setBodyType(0,!0),this.activeEvent.activeDragItem.paused=!0),this.activeEvent.wasDragEventTriggered===!0&&(this.activeEvent.wasDragEventTriggered=!1,this.activeEvent.actionsDrag.Transition.forEach(s=>{s.stop(),s.object.currentState!==null&&s.object.changeSelectedState(null,{scene:this.eventContext.page.scene,shared:this.eventContext.sharedAssets})}),this.activeEvent.actionsDrag.Animation.forEach(s=>{s.stop()}
11956),this.activeEvent.actionsDrag.Audio.forEach(s=>{s.dispatchGameControl("stop")}),this.activeEvent.actionsDrag.Particles.forEach(s=>{s.dispatchGameControl("stop")}),this.activeEvent.actionsDrop.SetVariable.forEach(s=>s.checkConditions()),this.activeEvent.actionsDrop.SetVariable.forEach(s=>s.dispatch()),this.activeEvent.actionsDrop.DynamicVariablePlay.forEach(s=>s.dispatch()),this.activeEvent.actionsDrop.ClearLocalStorage.forEach(s=>s.dispatch()),this.activeEvent.actionsDrop.UserAPI.forEach(s=>s.dispatch())),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0)}}}connect(){let t={};if(this.eventContext.page.traverseEntity(r=>{r.component&&(t[r.component.uuid]?t[r.component.uuid].push(r.uuid):t[r.component.uuid]=[r.uuid])}),this.eventContext.page.traverseEntity(r=>{var n;(n=r.data)==null||n.events.filter(a=>a.data.type==="DragDrop"&&!a.data.disabled).forEach(a=>{this.events.push(new hFe(r,a.id,a.data,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager,t))})}),!this.events.length)return;this.domEventsNeeded.clear(),this.domEventsNeeded.add("pointerdown");let i=this.eventContext.domElement;i.addEventListener("pointerdown",this.onPointerDown),i.addEventListener("pointermove",this.onPointerMove),i.addEventListener("pointerup",this.onPointerUp),this.domEventsNeeded.add("pointermove")}disconnect(){if(!this.events.length)return;this.domEventsNeeded.clear();let t=this.eventContext.domElement;t.removeEventListener("pointerdown",this.onPointerDown),t.removeEventListener("pointermove",this.onPointerMove),t.removeEventListener("pointerup",this.onPointerUp),this.events.forEach(i=>i.dispose())}setCursor(t){this.eventContext.domElement.style.cursor=t}onAnimationFrameDamping(){for(let t of this.events)for(let i of t.dragItems)i.paused||this.updateDragItem(i,!0)}calcPlaneIntersectPos(t,i,r,n){let{getCamera:a,raycaster:s}=this.eventContext;a().getWorldDirection(wd),wd.negate();let o=Ff.identity();switch(n==="parent"?lFe.multiplyMatrices(t.parent.matrixWorld,t.hiddenMatrix).decompose(er,o,Qn):n==="local"&&t.matrixWorld.decompose(er,o,Qn),r){case"x":er.set(1,0,0).applyQuaternion(o),km.copy(wd).cross(er),Oc.copy(er).cross(km);break;case"y":er.set(0,1,0).applyQuaternion(o),km.copy(wd).cross(er),Oc.copy(er).cross(km);break;case"z":er.set(0,0,1).applyQuaternion(o),km.copy(wd).cross(er),Oc.copy(er).cross(km);break;case"xy":Oc.set(0,0,1).applyQuaternion(o);break;case"yz":Oc.set(1,0,0).applyQuaternion(o);break;case"xz":Oc.set(0,1,0).applyQuaternion(o);break;case"adaptive":wd.angleTo(Qn.set(0,1,0))>Math.PI/6?(er.crossVectors(Qn.set(0,1,0),wd),Oc.crossVectors(er,Qn)):Oc.set(0,1,0);break;default:Oc.copy(wd);break}lf.setFromMatrixPosition(t.matrixWorld);let l=t.userData.lockedPlane?t.userData.worldPosition0:lf;if(t8.setFromNormalAndCoplanarPoint(Oc,l),!!s.ray.intersectPlane(t8,i)&&(r==="x"||r==="y"||r==="z")){let c=Qn.subVectors(i,l).dot(er);i.copy(l).addScaledVector(er,c)}}updateDragItem(t,i=!1){var r,n;lf.setFromMatrixPosition(t.obj.matrixWorld),t.reset==="current"?Zv.subVectors(t.fromPosition,lf).divideScalar(t.currentDampingFactor):t.reset==="original"?(Zv.subVectors(t.obj.userData.worldPosition0,lf).divideScalar(t.currentDampingFactor),t.fromPosition.copy(t.obj.userData.worldPosition0),t.pointStart.copy(t.fromPosition),t.pointEnd.copy(t.pointStart)):Zv.subVectors(t.pointEnd,t.pointStart).add(t.fromPosition).sub(lf).divideScalar(t.currentDampingFactor),t.paused=t.currentDampingFactor>1?Zv.length()<oFe:!0,(this.activeEvent&&this.activeEvent.data.dampingFactor===1||i)&&cFe(t,Zv.add(lf),(r=this.activeEvent)!=null&&r.data.drop&&((n=this.activeEvent)!=null&&n.data.autoOrient)?t.orientationMatrix:null),t.obj.dispatchEvent({type:"beginEvent",eventName:"DragDrop"}),this.eventManager.requestRender()}},Gm=new O,m2=new O,Wh=new O,jh=new O,r8=new eo,dFe=.01,AFe={type:"requestRender"},fFe=function(){let t=new O,i=new O;return(r,n,a)=>a>0?(t.subVectors(r,n),t.length()<=a?r:i.copy(n).add(t.normalize().multiplyScalar(a))):n}(),n8=function(){let t=new ht;return(i,r)=>{i.position.copy(r),i.parent!==null&&(t.copy(i.parent.matrixWorld).invert(),i.position.applyMatrix4(t)),t.copy(i.hiddenMatrix).invert(),i.position.applyMatrix4(t),i.updateMatrix(),i.hasNonUniformScale&&(i.updateMatrixWorld(),i.updateMatrixWorldSVD()),i instanceof zs&&xu(i.parent)&&i.invalidateDownstreamBooleanData(!0)}}(),pFe=class{constructor(t,i,r,n,a,s){this.data=t,this.id=i,this.object=r,this.paused=!1,this.currentDampingFactor=1,this.snapComplete=!1,this.isReset=!1,this.worldPosition0=new O,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...IP.defaultData,...t,...t.resetOnPointerLeave===void 0&&{resetOnPointerLeave:!1}},t.target===void 0||t.target==="cursor"||(this.target=n.find(t.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.resetDampingFactor=80/this.data.resetSpeed+1,this.object.getWorldPosition(this.worldPosition0),this.actions=xa(t,t.actions,n,a,s,r)}},mFe=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.events=[],this.pairOfEventListeners=[],this.onMouseMove=r=>{if(!(jt.length>1)){this.eventContext.updateRaycaster(r);for(let n of this.events)n.target===void 0&&this.updateSingleEvent(n)}},this.onMouseEnter=r=>{for(let n of this.events)n.target===void 0&&(n.isReset=!1,n.currentDampingFactor=n.data.dampingFactor)},this.onMouseLeave=r=>{for(let n of this.events)n.target===void 0&&(n.data.resetOnPointerLeave&&(n.isReset=!0,n.currentDampingFactor=n.resetDampingFactor),this.updateSingleEvent(n))},this.onTargetChange=r=>()=>{this.updateSingleEvent(r)}}connect(){let{page:t}=this.eventContext;if(t.traverseEntity(n=>{var s,o;let a=(s=n.data)==null?void 0:s.events.find(l=>l.data.type==="Follow"&&!l.data.disabled);a&&(!t.data.globalPhysics.usePhysics||((o=n.dataPatched.physics)==null?void 0:o.rigidB
11956ody)!=="dynamic")&&this.events.push(new pFe(a.data,a.id,n,t,this.eventContext.sharedAssets,this.eventManager))}),!this.events.length)return;let{domElement:i,eventElement:r}=this.eventContext;this.domEventsNeeded.clear(),Do&&(this.domEventsNeeded.add("pointerdown"),i.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),r.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents||(i.addEventListener("pointerenter",this.onMouseEnter),i.addEventListener("pointerleave",this.onMouseLeave));for(let n of this.events)if(n.target!==void 0){let a=n.target,s=this.onTargetChange(n);this.pairOfEventListeners.push([a,s]),a.addEventListener("requestRender",s)}}disconnect(){if(!this.events.length)return;let{domElement:t,eventElement:i}=this.eventContext;this.domEventsNeeded.clear(),Do&&t.removeEventListener("pointerdown",this.onMouseMove),i.removeEventListener("pointermove",this.onMouseMove),t.removeEventListener("pointerenter",this.onMouseEnter),t.removeEventListener("pointerleave",this.onMouseLeave);for(let[r,n]of this.pairOfEventListeners)r.removeEventListener("requestRender",n);for(let r of this.events)r.paused=!0,r.isReset=!1,ba(r.actions)}onAnimationFrameDamping(){for(let t of this.events)t.paused||this.updateSingleEvent(t,!0)}updateSingleEvent(t,i=!1){var o;this.events.forEach(l=>{l.actions.Create.forEach(c=>{c.dispatchThrottled()})});let{plane:r,limitDistance:n,limitDistanceEnabled:a}=t.data;if(t.object.getWorldPosition(Wh),t.isReset)jh.copy(t.worldPosition0);else if(t.target)t.target.getWorldPosition(jh);else{let{getCamera:l,raycaster:c}=this.eventContext;if(r==="custom"?(l().getWorldDirection(m2),m2.negate(),Gm.copy(m2)):r==="xy"?Gm.set(0,0,1):r==="xz"?Gm.set(0,1,0):r==="yz"&&Gm.set(1,0,0),r8.setFromNormalAndCoplanarPoint(Gm,Wh),!c.ray.intersectPlane(r8,jh))return}if(!t.isReset){if(jh.distanceTo(t.worldPosition0)>n&&a&&t.target)if(t.snapComplete=!1,t.data.snapDelay&&(t.delayFinished=!1,typeof window<"u"&&t.timeoutId!==null&&(window.clearTimeout(t.timeoutId),t.timeoutId=null)),t.wasOutside=!0,t.data.resetAfterDistanceLimit)jh.copy(t.worldPosition0),t.currentDampingFactor=t.resetDampingFactor;else return;else if(t.wasOutside&&(t.data.snapDelay&&typeof window<"u"&&(t.timeoutId=window.setTimeout(()=>{t.delayFinished=!0,t.paused=!1,this.updateSingleEvent(t)},t.data.snapDelay*1e3)),t.currentDampingFactor=t.data.dampingFactor,t.wasOutside=!1),t.delayFinished===!1)return}t.data.enabledTranslation[0]===!1&&(jh.x=Wh.x),t.data.enabledTranslation[1]===!1&&(jh.y=Wh.y),t.data.enabledTranslation[2]===!1&&(jh.z=Wh.z);let s=fFe(Wh,jh,t.wasOutside?0:t.data.maxDelta);if(t.currentDampingFactor>1){let l=Gm.subVectors(s,Wh).divideScalar(t.currentDampingFactor);Wh.add(l),i&&n8(t.object,Wh),t.paused=l.length()<dFe}else n8(t.object,s),t.paused=!0;(o=t.object)==null||o.dispatchEvent({type:"beginEvent",eventName:"Follow"}),t.object.dispatchEvent(AFe)}},Jv=new O,Jb=new O,$v=new ht,zm=new ri,bd=new ri,e_=new O,t_=new O,cf=new O,Yh=new O,g2=new eo,gFe=1e-6,vFe={type:"requestRender"},_Fe={type:"changeRotation"},a8=function(){let t=new ht;return function(i,r){i.parent!==null?t.multiplyMatrices(i.parent.matrixWorld,i.hiddenMatrix):t.copy(i.hiddenMatrix),r.premultiply(nZ(t).invert()),i.rotation.setFromRotationMatrix(r),i.updateMatrix(),i instanceof zs&&xu(i.parent)&&i.invalidateDownstreamBooleanData(!0)}}(),yFe=class{constructor(t,i,r,n){this.id=i,this.object=r,this.paused=!1,this.currentDampingFactor=1,this.isReset=!1,this.worldQuaternion0=new ri,this.timeoutId=null,this.delayFinished=!0,this.wasOutside=!1,this.data={...DP.defaultData,...t,...t.resetOnPointerLeave===void 0&&{resetOnPointerLeave:!1}},t.target===void 0||t.target==="cursor"||(this.target=n.find(t.target)),this.data.dampingFactor&&(this.currentDampingFactor=this.data.dampingFactor),this.object.getWorldQuaternion(this.worldQuaternion0),this.resetDampingFactor=80/this.data.resetSpeed+1}},EFe=class extends vo{constructor(){super(...arguments),this.events=[],this.pairOfEventListeners=[],this.pairOfUserEventListeners=[],this.onMouseMove=t=>{if(!(jt.length>1)){this._lastMouseEvent=t,this.eventContext.updateRaycaster(t);for(let i of this.events)i.target===void 0&&this.updateSingleEvent(i)}},this.onMouseEnter=t=>{for(let i of this.events)i.target===void 0&&(i.isReset=!1,i.currentDampingFactor=i.data.dampingFactor)},this.onMouseLeave=t=>{for(let i of this.events)i.target===void 0&&(i.data.resetOnPointerLeave&&(i.isReset=!0,i.currentDampingFactor=i.resetDampingFactor),this.updateSingleEvent(i))},this.onScroll=t=>{if(this._lastMouseEvent){let i=new PointerEvent("pointermove",{clientX:this._lastMouseEvent.clientX,clientY:this._lastMouseEvent.clientY,bubbles:!0,cancelable:!0,view:window});this.eventContext.eventElement.dispatchEvent(i)}},this.onTargetChange=t=>()=>{this.updateSingleEvent(t)},this.createUserEventListener=t=>({eventName:i,target:r})=>{if(!i||!r)return;let n=UE(i);n&&n==="LookAt"&&this.updateSingleEvent(t)}}connect(){let{page:t}=this.eventContext;if(t.traverseEntity(n=>{var s,o;let a=(s=n.data)==null?void 0:s.events.find(l=>l.data.type==="LookAt"&&!l.data.disabled);a&&(!t.data.globalPhysics.usePhysics||((o=n.dataPatched.physics)==null?void 0:o.rigidB
vendor: 4,184 bytes, line 11956
11956ody)!=="dynamic")&&this.events.push(new yFe(a.data,a.id,n,t))}),!this.events.length)return;let{domElement:i,eventElement:r}=this.eventContext;this.domEventsNeeded.clear(),Do&&(this.domEventsNeeded.add("pointerdown"),i.addEventListener("pointerdown",this.onMouseMove)),this.domEventsNeeded.add("pointermove"),r.addEventListener("pointermove",this.onMouseMove),this.eventContext.useWindowEvents?r.addEventListener("scroll",this.onScroll):(i.addEventListener("pointerenter",this.onMouseEnter),i.addEventListener("pointerleave",this.onMouseLeave));for(let n of this.events){if(n.target!==void 0){let o=this.onTargetChange(n),l=n.target;this.pairOfEventListeners.push([l,o]),l.addEventListener("requestRender",o)}let a=this.createUserEventListener(n),s=n.object;this.pairOfUserEventListeners.push([s,a]),s.addEventListener("userEvent",a)}}disconnect(){if(!this.events.length)return;let{domElement:t,eventElement:i}=this.eventContext;this.domEventsNeeded.clear(),Do&&t.removeEventListener("pointerdown",this.onMouseMove),i.removeEventListener("pointermove",this.onMouseMove),t.removeEventListener("pointerenter",this.onMouseEnter),t.removeEventListener("pointerleave",this.onMouseLeave),i.removeEventListener("scroll",this.onScroll);for(let[r,n]of this.pairOfEventListeners)r.removeEventListener("requestRender",n);for(let[r,n]of this.pairOfUserEventListeners)r.removeEventListener("userEvent",n);for(let r of this.events)r.paused=!0,r.isReset=!1}onAnimationFrameDamping(){for(let t of this.events)t.paused||this.updateSingleEvent(t)}updateSingleEvent(t){var A;let{tilt:i,axis:r,distance:n,plane:a,limitDistance:s,enabledRotation:o,limitDistanceEnabled:l}=t.data,{getCamera:c,raycaster:h}=this.eventContext,{object:u,target:d}=t;if(u.getWorldPosition(e_),!t.isReset)if(t.target)t.target.getWorldPosition(t_);else{if(a==="custom"?(c().getWorldDirection(Jb),Jb.negate(),g2.setFromNormalAndCoplanarPoint(Jb,e_)):(a==="xy"?Jv.set(0,0,1):a==="xz"?Jv.set(0,1,0):a==="yz"&&Jv.set(1,0,0),g2.setFromNormalAndCoplanarPoint(Jv,e_)),!h.ray.intersectPlane(g2,t_))return;n>0&&(a==="custom"||a===void 0)&&t_.addScaledVector(Jb,n)}if(t.isReset||(d?i==="target"?cf.copy(d.up).applyMatrix4($v.extractRotation(d.matrixWorld)).normalize():o.some(f=>f===!1)?(r==="x"?(Yh.set(0,0,1),o[2]===!1&&Yh.set(0,1,0)):r==="y"?(Yh.set(1,0,0),o[0]===!1&&Yh.set(0,0,1)):(Yh.set(0,1,0),o[1]===!1&&Yh.set(1,0,0)),cf.copy(Yh).applyQuaternion(t.worldQuaternion0).normalize()):cf.set(0,1,0):a==="custom"?cf.set(0,1,0):cf.copy(Jv)),t.isReset)bd.copy(t.worldQuaternion0);else if(e_.distanceTo(t_)>s&&l&&d)if(t.data.snapDelay&&(t.delayFinished=!1,typeof window<"u"&&t.timeoutId!==null&&(window.clearTimeout(t.timeoutId),t.timeoutId=null)),t.wasOutside=!0,t.data.resetAfterDistanceLimit)bd.copy(t.worldQuaternion0),t.currentDampingFactor=t.resetDampingFactor;else return;else{if(t.wasOutside&&(t.data.snapDelay&&typeof window<"u"&&(t.timeoutId=window.setTimeout(()=>{t.delayFinished=!0,t.paused=!1,this.updateSingleEvent(t)},t.data.snapDelay*1e3)),t.currentDampingFactor=t.data.dampingFactor,t.wasOutside=!1),t.delayFinished===!1)return;wFe($v,t_,e_,cf,r,Yh),bd.setFromRotationMatrix($v),zm.setFromUnitVectors(Yh.applyQuaternion(bd),cf),o.some(f=>f===!1)&&i!=="target"&&bd.premultiply(zm).normalize()}t.currentDampingFactor>1?(u.updateWorldMatrix(!0,!1),zm.setFromRotationMatrix(nZ(u.matrixWorld)),zm.slerp(bd,1/t.currentDampingFactor),a8(u,$v.makeRotationFromQuaternion(zm)),t.paused=8*(1-zm.dot(bd))<gFe):(a8(u,$v.makeRotationFromQuaternion(bd)),t.paused=!0),(A=t.object)==null||A.dispatchEvent({type:"beginEvent",eventName:"LookAt"}),u.dispatchEvent(vFe),u.dispatchEvent(_Fe)}},Wo=new O,zn=new O,mn=new O;function wFe(t,i,r,n,a,s){let o=t.elements;mn.subVectors(i,r),mn.lengthSq()===0&&(mn.z=1),mn.normalize(),zn.crossVectors(n,mn),zn.lengthSq()===0&&(Math.abs(n.z)===1?mn.x+=1e-4:mn.z+=1e-4,mn.normalize(),zn.crossVectors(n,mn)),zn.normalize(),Wo.crossVectors(mn,zn),a==="x"?s.z===1?[zn,Wo,mn]=[mn,zn,Wo]:(zn.negate(),[zn,mn]=[mn,zn]):a==="y"?s.x===1?[zn,Wo,mn]=[Wo,mn,zn]:(zn.negate(),[Wo,mn]=[mn,Wo]):s.x===1&&(zn.negate(),[zn,Wo]=[Wo,zn]),o[0]=zn.x,o[4]=Wo.x,o[8]=mn.x,o[1]=zn.y,o[5]=Wo.y,o[9]=mn.y,o[2]=zn.z,o[6]=Wo.z,o[10]=m
11956n.z}var bFe=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.entered=!1,this.actions=xa(i,i.actions,n,a,s,r)}disconnect(){ba(this.actions)}dispatchEnter(){this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.entered||(this.entered=!0,this.actions.Transition.forEach(t=>t.playFromCurrent()),this.actions.Animation.forEach(t=>t.play()),this.actions.Create.forEach(t=>t.dispatchStart()),this.actions.Particles.forEach(t=>t.dispatchBasic()),this.actions.Destroy.forEach(t=>t.dispatch()),this.actions.SwitchCamera.forEach(t=>t.playFromCurrent()),this.actions.SceneTransition.forEach(t=>t.dispatch()),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}dispatchLeave(){this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.entered&&(this.entered=!1,this.actions.Create.forEach(t=>t.dispatchStop()),this.actions.Transition.forEach(t=>t.reverseFromCurrent()),this.actions.Particles.forEach(t=>t.reverseFromCurrent()),this.actions.SwitchCamera.forEach(t=>t.reverseFromCurrent()))}dispatchUserEvent(t){this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),t?(this.actions.Transition.forEach(i=>i.reverseFromCurrent()),this.actions.Particles.forEach(i=>i.reverseFromCurrent()),this.actions.Animation.forEach(i=>i.reverseFromCurrent()),this.actions.SwitchCamera.forEach(i=>i.reverseFromCurrent())):(this.actions.Transition.forEach(i=>i.playFromCurrent()),this.actions.Animation.forEach(i=>i.playFromCurrent()),this.actions.Create.forEach(i=>i.dispatch()),this.actions.Particles.forEach(i=>i.dispatchBasic()),this.actions.Destroy.forEach(i=>i.dispatch()),this.actions.SwitchCamera.forEach(i=>i.playFromCurrent())),this.actions.SceneTransition.forEach(i=>i.dispatch()),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch())}},SFe=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.eventsPerObjects={},this.objects=[],this.objects2D=[],this._prevObjects=[],this.onMouseDown=r=>{jt.length>1||(this.eventContext.updateRaycaster(r),this.handleMouseHoverEvent())},this.onMouseUp=r=>{jt.length>1||this.handleMouseHoverEvent(!0)},this.onMouseMove=r=>{jt.length>1||(this.eventContext.updateRaycaster(r),this.handleMouseHoverEvent())},this.onUserEvent=({eventName:r,target:n,reverse:a})=>{var o;if(!r||!n)return;let s=UE(r);s&&s==="MouseHover"&&(n.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),(o=this.eventsPerObjects[n.uuid])==null||o.forEach(l=>l.dispatchUserEvent(a)))}}connect(){let{page:t,sharedAssets:i}=this.eventContext,r=(a,s)=>{var o,l;if(!(!a.visible||!((o=a.data)!=null&&o.events.length))){for(let{id:c,data:h}of a.data.events)if(!h.disabled&&h.type==="MouseHover")try{let u=new bFe(c,h,a,t,i,this.eventManager);this.eventsPerObjects[a.uuid]?this.eventsPerObjects[a.uuid].push(u):this.eventsPerObjects[a.uuid]=[u]}catch{}(l=this.eventsPerObjects[a.uuid])!=null&&l.length&&this.objects.push(a instanceof Ca?s:a)}};if(t.traverseEntity(a=>{var s;(a instanceof ls||a instanceof fa)&&((s=a.frame)==null||s.traverse(o=>{r(o,a)})),r(a)}),!this.objects.length)return;let{domElement:n}=this.eventContext;this.domEventsNeeded.clear(),Do&&(this.domEventsNeeded.add("pointerdown"),n.addEventListener("pointerdown",this.onMouseDown),this.domEventsNeeded.add("pointerup"),n.addEventListener("pointerup",this.onMouseUp)),this.domEventsNeeded.add("pointermove"),n.addEventListener("pointermove",this.onMouseMove),this.objects.forEach(a=>{a.addEventListener("userEvent",this.onUserEvent)})}disconnect(){if(!this.objects.length)return;let{domElement:t}=this.eventContext;this.domEventsNeeded.clear(),Do&&(t.removeEventListener("pointerdown",this.onMouseDown),t.removeEventListener("pointerup",this.onMouseUp)),t.removeEventListener("pointermove",this.onMouseMove),Object.values(this.eventsPerObjects).forEac
11956h(i=>{i.forEach(r=>{r.disconnect()})}),this.objects.forEach(i=>{i.removeEventListener("userEvent",this.onUserEvent)})}handleMouseHoverEvent(t=!1){let i=[];if(!t){let{stopRaycast:r,raycaster:n,page:a,pointerScreen:s}=this.eventContext,o=!1;if(a.uiCanvas&&(o=uu(a,[s.x,s.y],Object.keys(this.eventsPerObjects),l=>{i.push(l)})),r&&!o){let l=GS(n,a,this.objects);i=eO(l),l.forEach(c=>{var h,u;c.object instanceof ls&&uu(c.object,[((h=c==null?void 0:c.uv)==null?void 0:h.x)??0,((u=c==null?void 0:c.uv)==null?void 0:u.y)??0],Object.keys(this.eventsPerObjects),d=>{i.push(d)})})}else this.objects.forEach(l=>{var h,u;let c=wT(n,l);c&&(i.push(l),l instanceof ls&&uu(l,[((h=c==null?void 0:c.uv)==null?void 0:h.x)??0,((u=c==null?void 0:c.uv)==null?void 0:u.y)??0],Object.keys(this.eventsPerObjects),d=>{i.push(d)}))})}this._prevObjects.length&&this._prevObjects.forEach(r=>{var n;i.includes(r)||(r.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),(n=this.eventsPerObjects[r.uuid])==null||n.forEach(a=>a.dispatchLeave()))}),i.length&&i.forEach(r=>{var n;r.dispatchEvent({type:"beginEvent",eventName:"MouseHover"}),(n=this.eventsPerObjects[r.uuid])==null||n.forEach(a=>a.dispatchEnter())}),this._prevObjects=i}},CFe=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.scrollCounter=0,this.actions=xa(i,i.actions,n,a,s,r)}connect(){this.scrollCounter=0}disconnect(){ba(this.actions)}dispatch(t){this.actions.Transition.forEach(n=>{n.object.currentTransitionEvent!==this&&(n.object.currentTransitionEvent=this,n.init())});let i=t>0?1:-1;this.scrollCounter+=i,this.scrollCounter=Math.min(Math.max(this.scrollCounter,0),this.data.steps);let r=this.scrollCounter/this.data.steps;this.actions.Transition.forEach(n=>n.seek(r)),this.actions.Animation.forEach(n=>n.seek(i)),this.actions.Create.forEach(n=>n.dispatchThrottled()),this.actions.SetVariable.forEach(n=>n.checkConditions()),this.actions.SetVariable.forEach(n=>n.dispatch()),this.actions.DynamicVariablePlay.forEach(n=>n.dispatch()),this.actions.ClearLocalStorage.forEach(n=>n.dispatch()),this.actions.UserAPI.forEach(n=>n.dispatch())}dispatchUserEvent(t){this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),t?(this.actions.Transition.forEach(i=>i.reverseFromCurrent()),this.actions.Animation.forEach(i=>i.reverseFromCurrent())):(this.actions.Transition.forEach(i=>{i.playFromCurrent()}),this.actions.Animation.forEach(i=>{i.playFromCurrent()})),this.actions.Create.forEach(i=>i.dispatchThrottled()),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch())}},TFe=class{constructor(t,i,r,n,a,s,o){this.id=t,this.data=i,this.object=r,this.domElement=s,this.eventManager=o,this.scrollStart=0,this.scrollEnd=0,this.actions=xa(i,i.actions,n,a,o,r)}getStickyParentElement(){let t=this.domElement;for(;t;){if(window.getComputedStyle(t).position==="sticky")return t;t=t.parentElement}return null}computeScrollBounds(){let t=this.getStickyParentElement(),i=t==null?void 0:t.parentElement,r=this.domElement.getBoundingClientRect(),n={top:r.top,bottom:r.bottom,left:r.left,right:r.right,width:r.width,height:r.height};if(i){let h=i.getBoundingClientRect(),u=window.getComputedStyle(t),d=parseFloat(u.marginTop)+parseFloat(u.marginBottom),A=parseFloat(u.top),f=parseFloat(u.bottom),m=h.height-d;if(!isNaN(A))r.top===A?(n.top+=h.top-A,n.bottom+=h.top-A):r.top<0&&(n.top-=m-r.height,n.bottom-=m-r.height);else if(!isNaN(f)){let g=document.body.clientHeight??window.innerHeight,p=window.innerWidth-(document.documentElement.clientWidth??window.innerWidth);r.bottom===g-f?(n.top+=h.top-r.height+f+p,n.bottom+=h.top-r.height+f+p):r.bottom<g-f&&(n.top-=m-r.height,n.bottom-=m-r.height)}}let a=document.body,s=document.documentElement,o=window.pageYOffset||s.scrollTop||a.scrollTop,l=s.clientTop||a.clientTop||0,c=Math.round(n.top+o-l);if(this.data.startFrom==="enter"){let h=window.innerHeight,u=n.height,d=this.data.enterAnchor,A=d==="top"?h:d==="bottom"?h-u:h-u*.5;this.scrollStart=c-A}else this.scrollStart=0;this.scrollStart+=this.data.startOffset??0,this.scrollEnd=this.scrollStart+(this.data.endAfter??400),this.box=n,this.computeScroll({x:window.scrollX,y:window.scrollY})}connect(){this.computeScrollBounds()}disconnect(){ba(this.actions)}handleResize(){this.computeScrollBounds()}get isInvalidBox(){return this.box===void 0||this.box.width===0&&this.box.height===0&&this.box.top===0&&this.box.bottom===0}computeScroll({x:t,y:i}){this.actions.Transition.forEach(a=>{a.object.currentTransitionEvent!==this&&(a.object.currentTransitionEvent=this,a.init())});let r=this.scrollEnd-this.scrollStart,n=Math.min(1,Math.max(0,(i-this.scrollStart)/r));this.actions.Transition.forEach(a=>a.seek(n)),this.actions.Animation.forEach(a=>a.seek(n)),this.actions.Create.forEach(a=>a.dispatchThrottled()),this.actions.SetVariable.forEach(a=>a.checkConditions()),this.actions.SetVariable.forEach(a=>a.dispatch()),this.actions.DynamicVariablePlay.forEach(a=>a.dispatch()),this.actions.ClearLocalStorage.forEach(a=>a.dispatch()),this.actions.UserAPI.forEach(a=>a.dispatch())}dispatch(t){this.isInvalidBox&&this.computeScrollBounds(),this.computeScroll(t)}
11956dispatchUserEvent(t){this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),t?(this.actions.Transition.forEach(i=>i.reverseFromCurrent()),this.actions.Animation.forEach(i=>i.reverseFromCurrent())):(this.actions.Transition.forEach(i=>{i.playFromCurrent()}),this.actions.Animation.forEach(i=>{i.playFromCurrent()})),this.actions.Create.forEach(i=>i.dispatchThrottled()),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch())}},MFe=class extends vo{constructor(t,i){super(t),this.managers=i,this.wheelEventsPerObject=new Map,this.scrollEventsPerObject=new Map,this.isInview=!0,this.handleResize=()=>{[...this.scrollEventsPerObject.entries()].forEach(([r,n])=>{n.forEach(a=>a.handleResize())})},this.onScroll=r=>{if(!this.isInview)return;let n={y:window.scrollY,x:window.scrollX};[...this.scrollEventsPerObject.entries()].forEach(([a,s])=>{a.dispatchEvent({type:"beginEvent",eventName:"Scroll",scroll:n}),s.forEach(o=>o.dispatch(n))})},this.onWheel=r=>{!this.isInview||r.ctrlKey||[...this.wheelEventsPerObject.entries()].forEach(([n,a])=>{n.dispatchEvent({type:"beginEvent",eventName:"Scroll",deltaY:r.deltaY}),a.forEach(s=>s.dispatch(r.deltaY))})},this.onUserEvent=({eventName:r,target:n,reverse:a})=>{var o;if(!r||!n)return;let s=UE(r);s&&s==="Scroll"&&(n.dispatchEvent({type:"beginEvent",eventName:"Scroll"}
11956),(o=this.wheelEventsPerObject.get(n))==null||o.forEach(l=>{l.dispatchUserEvent(a)}))}}connect(){let{page:t,sharedAssets:i,domElement:r,isExport:n}=this.eventContext,a=s=>{var o,l,c;if((o=s.data)!=null&&o.events.length){for(let{id:h,data:u}of s.data.events)if(!u.disabled&&u.type==="Scroll")if(u.trigger==="load"||!n){let d=new CFe(h,u,s,t,i,this.managers);this.wheelEventsPerObject.has(s)?(l=this.wheelEventsPerObject.get(s))==null||l.push(d):this.wheelEventsPerObject.set(s,[d])}else{let d=new TFe(h,u,s,t,i,r,this.managers);this.scrollEventsPerObject.has(s)?(c=this.scrollEventsPerObject.get(s))==null||c.push(d):this.scrollEventsPerObject.set(s,[d])}}};t.traverseEntity(s=>{var o;(s instanceof ls||s instanceof fa)&&((o=s.frame)==null||o.traverse(l=>{a(l)})),a(s)}),this.intersectionObserver=new IntersectionObserver(s=>{let o=s[0];o&&(this.isInview=o.isIntersecting)},{root:null}),this.intersectionObserver.observe(this.eventContext.domElement),[...this.wheelEventsPerObject.entries()].forEach(([s,o])=>{o.forEach(l=>l.connect()),s.addEventListener("userEvent",this.onUserEvent)}),[...this.scrollEventsPerObject.entries()].forEach(([s,o])=>{o.forEach(l=>l.connect()),s.addEventListener("userEvent",this.onUserEvent)}),[...this.wheelEventsPerObject.values()].some(s=>s.length)&&(this.domEventsNeeded.add("wheel"),window.addEventListener("wheel",this.onWheel)),[...this.scrollEventsPerObject.values()].some(s=>s.length)&&(this.domEventsNeeded.add("scroll"),window.addEventListener("scroll",this.onScroll),window.addEventListener("resize",this.handleResize))}disconnect(){window.removeEventListener("wheel",this.onWheel),window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.handleResize),this.intersectionObserver.unobserve(this.eventContext.domElement),this.domEventsNeeded.clear(),[...this.wheelEventsPerObject.entries()].forEach(([t,i])=>{i.forEach(r=>r.disconnect()),t.removeEventListener("userEvent",this.onUserEvent)}),[...this.scrollEventsPerObject.entries()].forEach(([t,i])=>{i.forEach(r=>r.disconnect()),t.removeEventListener("userEvent",this.onUserEvent)})}},xFe=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.actions=xa(i,i.actions,n,a,s,r)}disconnect(){ba(this.actions)}dispatch(){this.actions.Transition.forEach(t=>{t.play()}),this.actions.Animation.forEach(t=>{t.play()}),this.actions.SwitchCamera.forEach(t=>{t.play()}),this.actions.SceneTransition.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>t.dispatch()),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()),this.actions.Create.forEach(t=>{t.dispatchFromStart()}),this.actions.Destroy.forEach(t=>{t.dispatchFromStart()})}
11956dispatchAfter(t){this.actions.Audio.forEach(i=>{(i.interaction.data.triggerAfter??"any")===t&&(i.interaction instanceof Uf?i.interaction.audioPlayer.play():i.interaction instanceof KL&&i.interaction.dispatch())}),this.actions.Video.forEach(i=>{let r=i.interaction.data.triggerAfter??"autoplay";r===t&&(i.interaction instanceof Gg?i.interaction.play(r==="autoplay"):i.interaction instanceof JL&&i.interaction.dispatch())}),this.actions.Particles.forEach(i=>{(i.data.triggerAfter??"any")===t&&i.dispatchBasic()})}dispatchUserEvent(t){this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),t?(this.actions.Transition.forEach(i=>i.reverseFromCurrent()),this.actions.Animation.forEach(i=>i.reverseFromCurrent()),this.actions.SwitchCamera.forEach(i=>i.reverseFromCurrent())):(this.actions.Transition.forEach(i=>i.playFromCurrent()),this.actions.Animation.forEach(i=>i.playFromCurrent()),this.actions.SwitchCamera.forEach(i=>i.playFromCurrent())),this.actions.SceneTransition.forEach(i=>i.dispatch()),this.actions.Reset.forEach(i=>i.dispatch()),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch()),this.actions.Create.forEach(i=>{i.dispatch()}),this.actions.Destroy.forEach(i=>{i.dispatch()}
11956),this.actions.Audio.forEach(i=>{i.interaction instanceof Uf?i.interaction.audioPlayer.play():i.interaction instanceof KL&&i.interaction.dispatch()}),this.actions.Video.forEach(i=>{i.interaction instanceof Gg?i.interaction.play():i.interaction instanceof JL&&i.interaction.dispatch()}),this.actions.Particles.forEach(i=>{i.dispatchBasic()})}},RFe=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.eventsPerObject=new Map,this.eventsAfterPerObject=new Map,this.onMouseDown=()=>{[...this.eventsAfterPerObject.entries()].forEach(([r,n])=>{r.dispatchEvent({type:"beginEvent",eventName:"Start"}),n.forEach(a=>{a.dispatchAfter("mouseDown")})})},this.onKeyDown=()=>{[...this.eventsAfterPerObject.entries()].forEach(([r,n])=>{r.dispatchEvent({type:"beginEvent",eventName:"Start"}),n.forEach(a=>{a.dispatchAfter("keyDown")})})},this.onAny=()=>{let{domElement:r,isExport:n}=this.eventContext,a=n?document:r;a.removeEventListener("pointerdown",this.onAny),a.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([s,o])=>{s.dispatchEvent({type:"beginEvent",eventName:"Start"}),o.forEach(l=>{l.dispatchAfter("any")})})},this.onSceneTransitionAudioVideoPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach(([r,n])=>{r.dispatchEvent({type:"beginEvent",eventName:"Start"}),n.forEach(a=>
11956{a.actions.Audio.forEach(s=>{s.interaction instanceof Uf&&s.interaction.audioPlayer.play()}),a.actions.Video.forEach(s=>{let o=s.interaction.data.triggerAfter??"autoplay";s.interaction instanceof Gg&&s.interaction.play(o==="autoplay")}),a.actions.Particles.forEach(s=>{s.dispatchBasic()})})})},this.onPlay=()=>{[...this.eventsAfterPerObject.entries()].forEach(([r,n])=>{r.dispatchEvent({type:"beginEvent",eventName:"Start"}),n.forEach(a=>{a.dispatchAfter("autoplay")})})},this.onUserEvent=({eventName:r,target:n,reverse:a})=>{var o,l;if(!r||!n)return;let s=UE(r);s&&s==="Start"&&(n instanceof Ca||n.dispatchEvent({type:"beginEvent",eventName:"Start"}),(o=this.eventsPerObject.get(n))==null||o.forEach(c=>{c.dispatchUserEvent(a)}),(l=this.eventsAfterPerObject.get(n))==null||l.forEach(c=>{c.dispatchUserEvent(a)}))}}connect(){let{sharedAssets:t,page:i}=this.eventContext,r=n=>{var a,s,o,l,c;if((a=n.data)!=null&&a.events.length)for(let{id:h,data:u}of n.data.events){if(u.disabled||u.type!=="Start")continue;let d=new xFe(h,u,n,i,t,this.eventManager);(d.actions.Transition.length||d.actions.Animation.length||d.actions.SwitchCamera.length||d.actions.Create.length||d.actions.Destroy.length||d.actions.SceneTransition.length||d.actions.Reset.length||d.actions.SetVariable.length||d.actions.DynamicVariablePlay.length||d.actions.ClearLocalStorage.length||d.actions.UserAPI.length)&&(this.eventsPerObject.has(n)?(s=this.eventsPerObject.get(n))==null||s.push(d):this.eventsPerObject.set(n,[d])),d.actions.Audio.length&&(this.eventsAfterPerObject.has(n)?(o=this.eventsAfterPerObject.get(n))==null||o.push(d):this.eventsAfterPerObject.set(n,[d])),d.actions.Video.length&&(this.hasVideoAction=!0,this.eventsAfterPerObject.has(n)?(l=this.eventsAfterPerObject.get(n))==null||l.push(d):this.eventsAfterPerObject.set(n,[d])),d.actions.Particles.length&&(this.eventsAfterPerObject.has(n)?(c=this.eventsAfterPerObject.get(n))==null||c.push(d):this.eventsAfterPerObject.set(n,[d]))}};if(i.traverseEntity(n=>{var a;(n instanceof ls||n instanceof fa)&&((a=n.frame)==null||a.traverse(s=>{r(s)})),r(n)}),[...this.eventsAfterPerObject.values()].some(n=>n.length)){if(this.eventManager.activateCount===0){let{domElement:n,isExport:a}=this.eventContext,s=a?document:n;s.addEventListener("pointerdown",this.onMouseDown,{once:!0}),s.addEventListener("mousedown",this.onMouseDown,{once:!0}),document.addEventListener("keydown",this.onKeyDown,{once:!0}),s.addEventListener("pointerdown",this.onAny),s.addEventListener("mousedown",this.onAny),document.addEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([o,l])=>{o.addEventListener("userEvent",this.onUserEvent)})}else this.onSceneTransitionAudioVideoPlay();this.onPlay()}[...this.eventsPerObject.entries()].forEach(([n,a])=>{n.dispatchEvent({type:"beginEvent",eventName:"Start"}),a.forEach(s=>s.dispatch()),n.addEventListener("userEvent",this.onUserEvent)})}disconnect(){if([...this.eventsAfterPerObject.values()].some(t=>t.length)){let{domElement:t,isExport:i}=this.eventContext,r=i?document:t;r.removeEventListener("pointerdown",this.onMouseDown),r.removeEventListener("mousedown",this.onMouseDown),document.removeEventListener("keydown",this.onKeyDown),r.removeEventListener("pointerdown",this.onAny),r.removeEventListener("mousedown",this.onAny),document.removeEventListener("keydown",this.onAny),[...this.eventsAfterPerObject.entries()].forEach(([n,a])=>{n.removeEventListener("userEvent",this.onUserEvent),a.forEach(s=>s.disconnect())})}[...this.eventsPerObject.entries()].forEach(([t,i])=>{t.removeEventListener("userEvent",this.onUserEvent),i.forEach(r=>r.disconnect())}),this.eventsPerObject.clear(),this.eventsAfterPerObject.clear()}},BFe=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.initialDisabled=!1,this.actions=xa(i,i.actions,n,a,s,r),this.target=i.target}disconnect(){ba(this.actions)}dispatch(t){this.initialDisabled||(this.actions.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this,i.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Collision"}),this.actions.Transition.forEach(i=>
vendor: 7,824 bytes, line 11956
11956{i.data.runMode==="Toggle"?i.toggle():i.play()}),this.actions.Animation.forEach(i=>{i.data.runMode==="Toggle"?i.toggle():i.play()}),this.actions.Reset.forEach(i=>{i.dispatch()}),this.actions.Link.forEach(i=>{i.dispatch()}),this.actions.Reset.forEach(i=>{i.dispatch()}),this.actions.Create.forEach(i=>{i.dispatch()}),this.actions.Destroy.forEach(i=>{i.dispatch(t??!1)}),this.actions.SetVariable.forEach(i=>i.checkConditions()),this.actions.SetVariable.forEach(i=>i.dispatch()),this.actions.DynamicVariablePlay.forEach(i=>i.dispatch()),this.actions.Audio.forEach(i=>{i.dispatchBasic()}),this.actions.Particles.forEach(i=>{i.dispatchBasic()}),this.actions.Video.forEach(i=>{i.dispatchBasic()}),this.actions.ClearLocalStorage.forEach(i=>i.dispatch()),this.actions.UserAPI.forEach(i=>i.dispatch()))}},IFe=class extends vo{constructor(t,i,r,n,a){super(t),this.sharedVariables=i,this.eventManager=r,this.needsMouse=n,this.needsRaycast=a,this.dynamicVars=[],this.variablesToWatch=[],this.prevMouseProperty=null,this.prevRaycastProperty=null,this.pauseTime=0,this.isOutOfFocus=!1,this.events=[],this.onFrame=s=>{let o=this.eventContext.sharedAssets;if(this.rafId=window.requestAnimationFrame(this.onFrame),this.isOutOfFocus)return;let l=new Date,c=[],h=[];for(let A=0;A<this.propertiesToWatch.length;A++){let{objectId:f,property:m,prevValue:g}=this.propertiesToWatch[A],p=this.eventContext.scene.find(f),v=LP.propertyPaths[m];if(v[0]==="width"||v[0]==="height"||v[0]==="depth")p=p.geometry.userData.parameters[v[0]];else for(let _=0;_<v.length;_++)p=p[v[_]];g===null?this.propertiesToWatch[A].prevValue=p instanceof O?p.clone():p:(p instanceof O?!p.equals(g):g!==p)&&(h.push({objId:f,property:m}),p instanceof O?this.propertiesToWatch[A].prevValue.copy(p):this.propertiesToWatch[A].prevValue=p)}for(let A=0;A<this.variablesToWatch.length;A++){let{id:f,prevValue:m}=this.variablesToWatch[A],g=o.getVariable(f);g!==m&&(c.push(f),this.variablesToWatch[A].prevValue=g)}for(let A=0;A<this.dynamicVars.length;A++){let{id:f,expectedTime:m,last:g,data:p,timerSeconds:v,startValue:_}=this.dynamicVars[A],y=1e3;if((p.dynamicVariableType==="timer"||p.dynamicVariableType==="stopwatch")&&p.format==="number3decimal"?y=1:p.dynamicVariableType==="counter"?y=p.updateInterval:p.dynamicVariableType==="random"&&(y=p.isStatic?1/0:p.updateInterval),m===-1){this.dynamicVars[A].last=s,this.dynamicVars[A].expectedTime=s+y;continue}if(!((o.getDynamicVariablePlayState(f)==="Stopped"||o.getDynamicVariablePlayState(f)==="Restarted")&&(this.dynamicVars[A].last=s,this.dynamicVars[A].expectedTime=s+y,p.dynamicVariableType==="counter"&&o.getVariable(f)!==_&&(o.updateVariable(f,_),this.eventManager.requestRender()),(p.dynamicVariableType==="timer"||p.dynamicVariableType==="stopwatch")&&this.dynamicVars[A].timerSeconds!==_&&(this.dynamicVars[A].timerSeconds=_,o.updateVariable(f,Jo.getFormattedTimerTime(_,p)),this.eventManager.requestRender()),o.getDynamicVariablePlayState(f)==="Restarted"&&o.setDynamicVariablePlayState(f,"Playing"),o.getDynamicVariablePlayState(f)==="Stopped"))){if(o.getDynamicVariablePlayState(f)==="Paused"){this.dynamicVars[A].deltaToExpectedTime===void 0&&(this.dynamicVars[A].deltaToExpectedTime=Math.max(this.dynamicVars[A].expectedTime-s,0)),this.dynamicVars[A].last=s-(y-this.dynamicVars[A].deltaToExpectedTime),this.dynamicVars[A].expectedTime=s+this.dynamicVars[A].deltaToExpectedTime;continue}else this.dynamicVars[A].deltaToExpectedTime=void 0;if(s>=m)if(this.dynamicVars[A].last=s,this.dynamicVars[A].expectedTime+=y,p.dynamicVariableType==="random"){let w=p.min+Math.random()*(p.max-p.min),b=p.decimals;w=Math.round(w*Math.pow(10,b))/Math.pow(10,b),o.updateVariable(f,w),c.push(f),this.eventManager.requestRender()}else if(p.dynamicVariableType==="counter"){let w=o.getVariable(f),b=o.getDynamicVariableToggleIsForward(f)??!0,E=o.getVariable(f)+p.increment*(b?1:-1);p.hasEnd&&(E=p.increment>0?Ct.clamp(E,_,p.endValue):Ct.clamp(E,p.endValue,_),E===_&&o.setDynamicVariableToggleIsForward(f,void 0),p.repeat?E===p.endValue&&(E=_):(E===_||E===p.endValue)&&o.setDynamicVariablePlayState(f,"Paused")),E!==w&&(c.push(f),o.updateVariable(f,E),this.eventManager.requestRender())}else if(p.dynamicVariableType==="time"){let w=o.getVariable(f),b=b6(l,p);if(typeof w=="object"&&"textValue"in w&&typeof b=="object"&&"textValue"in b){if(Array.isArray(w.textValue)&&Array.isArray(b.textValue)){if(w.textValue.every((E,M)=>E===b.textValue[M]))continue}else if(w.textValue===b.textValue)continue}else if(w===b)continue;o.updateVariable(f,b),c.push(f),this.eventManager.requestRender()}else{let w=ja.isTextValue(p.endValue)?s8(p.endValue.textValue):p.endValue,b=o.getDynamicVariableToggleIsForward(f)??!0,E=v+(s-g)/1e3*(p.dynamicVariableType==="timer"?-1:1)*(b?1:-1);E=Math.max(E,0),p.hasEnd&&(E=p.dynamicVariableType==="stopwatch"?Ct.clamp(E,_,w):Ct.clamp(E,w,_),E===_&&o.setDynamicVariableToggleIsForward(f,void 0),p.repeat?Math.abs(E-w)<(p.format==="number3decimal"?1e-4:.1)&&(E=_):(Math.abs(E-_)<(p.format==="number3decimal"?1e-4:.1)||Math.abs(E-w)<(p.format==="number3decimal"?1e-4:.1))&&o.setDynamicVariablePlayState(f,"Paused")),E!==v&&(c.push(f),this.dynamicVars[A].timerSeconds=E,o.updateVariable(f,Jo.getFormattedTimerTime(E,p)),this.eventManager.requestRender())}}}let u=!1;o.mouseProperty!==this.prevMouseProperty&&(this.prevMouseProperty=o.mouseProperty,u=!0);let d=!1;o.raycastProperty!==this.prevRaycastProperty&&(this.prevRaycastProperty=o.raycastProperty,d=!0),this.events.forEach(A=>{(c.includes(A.data.variableId)||h.find(f=>f.objId===A.data.objectId&&f.property===A.data.property)||A.data.variableId==="mouseProperty"&&u||A.data.variableId==="raycastProperty"&&d)&&(A.dispatch(),this.eventManager.requestRender())})},this.onBlur=()=>{this.pause()},this.onFocus=()=>{this.resume()}}pause(){this.isOutOfFocus||(this.isOutOfFocus=!0,this.pauseTime=Date.now())}resume(){if(!this.isOutOfFocus)return;this.isOutOfFocus=!1;let t=Date.now()-this.pauseTime;for(let i=0;i<this.dynamicVars.length;i++)this.dynamicVars[i].last+=t,this.dynamicVars[i].expectedTime+=t}connect(){this.eventContext.page.traverseEntity(i=>{var r;(r=i.data)==null||r.events.filter(n=>n.data.type==="VariableChange"&&!n.data.disabled).forEach(n=>{this.events.push(new DFe(n.id,n.data,i,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),this.propertiesToWatch=this.events.filter(i=>i.data.variableId==="objectProperty"&&i.data.objectId!==null).map(i=>({objectId:i.data.objectId,property:i.data.property,prevValue:null}));let t=this.eventContext.sharedAssets;this.sharedVariables.forEach(({id:i,data:r})=>{if(!("dynamicVariableType"in r)){this.events.find(a=>a.data.variableId===i)&&this.variablesToWatch.push({id:i,prevValue:t.getVariable(i)});return}let n;if(r.dynamicVariableType==="timer"||r.dynamicVariableType==="stopwatch"){let a;if(ja.isTextValue(r.value)&&Array.isArray(r.value.textValue)){let s=r.value.textValue;s.length===3?a=s[2]+s[1]*60+s[0]*3600:a=s[1]+s[0]*60}else a=r.value;n=a,this.dynamicVars.push({id:i,last:-1,expectedTime:-1,data:r,timerSeconds:a,startValue:n})}else r.dynamicVariableType==="time"&&t.updateVariable(i,b6(new Date,r)),r.dynamicVariableType==="counter"&&(n=ja.isTextValue(r.value)?s8(r.value.textValue):r.value),this.dynamicVars.push({id:i,last:-1,expectedTime:-1,data:r,startValue:n})}),this.rafId=window.requestAnimationFrame(this.onFrame),window.addEventListener("blur",this.onBlur),window.addEventListener("focus",this.onFocus)}disconnect(){window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.rafId&&(window.cancelAnimationFrame(this.rafId),this.rafId=void 0),this.events.forEach(t=>t.dispose())}},DFe=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.actions=xa(i,i.actions,n,a,s,r)}dispatch(){let t=this.actions;
11956t.Audio.forEach(i=>i.dispatchConditional()),t.Particles.forEach(i=>i.dispatchConditional()),t.Video.forEach(i=>i.dispatchConditional()),t.Create.forEach(i=>i.dispatch()),t.Destroy.forEach(i=>i.dispatch()),t.Reset.forEach(i=>i.dispatch()),t.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this),i.init()}),t.Transition.forEach(i=>i.play()),t.Animation.forEach(i=>i.play()),t.SwitchCamera.forEach(i=>i.play()),t.SceneTransition.forEach(i=>i.dispatch()),t.SetVariable.forEach(i=>i.checkConditions()),t.SetVariable.forEach(i=>i.dispatch()),t.DynamicVariablePlay.forEach(i=>i.dispatch()),t.ClearLocalStorage.forEach(i=>i.dispatch()),t.UserAPI.forEach(i=>i.dispatch())}dispose(){ba(this.actions)}};function s8(t){return t.length===3?t[2]+t[1]*60+t[0]*3600:t[1]+t[0]*60}var PFe="https://unpkg.com/@splinetool/[email protected]/build/",LFe="https://unpkg.com/@splinetool/[email protected]/build/",OFe=` 11957(async function() { 11958 const [wasmImport, wasmBinary] = await Promise.all([ 11959 import('${PFe}' + 'navmesh.js'), 11960 fetch('${LFe}' + 'navmesh.wasm').then((res) => res.arrayBuffer()), 11961 ]); 11962 const wasmModule = wasmImport.default; 11963 self.module = await wasmModule({ wasmBinary }); 11964 postMessage('ready'); 11965})(); 11966`,NFe=` 11967(async function() { 11968 const [wasmImport, wasmBinary] = await Promise.all([ 11969 import(self.location.origin + '/_libraries/navmesh.js'), 11970 fetch(self.location.origin + '/_libraries/navmesh.wasm').then((res) => res.arrayBuffer()), 11971 ]); 11972 const wasmModule = wasmImport.default; 11973 self.module = await wasmModule({ wasmBinary }); 11974 postMessage('ready'); 11975})(); 11976`,UFe=` 11977 11978onmessage = function(messageEvent) { 11979 const meshData = messageEvent.data; 11980 const positions = meshData[0]; 11981 const offset = meshData[1]; 11982 const indices = meshData[2]; 11983 const indicesLength = meshData[3]; 11984 const parameters = meshData[4]; 11985 11986 const module = self.module; 11987 const rc = new module.rcConfig(); 11988 rc.cs = parameters.cs; 11989 rc.ch = parameters.ch; 11990 rc.borderSize = parameters.borderSize ? parameters.borderSize : 0; 11991 rc.tileSize = parameters.tileSize ? parameters.tileSize : 0; 11992 rc.walkableSlopeAngle = parameters.walkableSlopeAngle; 11993 rc.walkableHeight = parameters.walkableHeight; 11994 rc.walkableClimb = parameters.walkableClimb; 11995 rc.walkableRadius = parameters.walkableRadius; 11996 rc.maxEdgeLen = parameters.maxEdgeLen; 11997 rc.maxSimplificationError = parameters.maxSimplificationError; 11998 rc.minRegionArea = parameters.minRegionArea; 11999 rc.mergeRegionArea = parameters.mergeRegionArea; 12000 rc.maxVertsPerPoly = parameters.maxVertsPerPoly; 12001 rc.detailSampleDist = parameters.detailSampleDist; 12002 rc.detailSampleMaxError = parameters.detailSampleMaxError; 12003 12004 if (!self.navMesh) { 12005 self.navMesh = new module.NavMesh(); 12006 } 12007 self.navMesh.build(positions, offset, indices, indicesLength, rc); 12008 12009 const navmeshData = navMesh.getNavmeshData(); 12010 const arrView = new Uint8Array(module.HEAPU8.buffer, navmeshData.dataPointer, navmeshData.size); 12011 const ret = new Uint8Array(navmeshData.size); 12012 ret.set(arrView); 12013 navMesh.freeNavmeshData(navmeshData); 12014 12015 postMessage(ret); 12016} 12017`,FFe=.001,kFe={cs:6,ch:2,walkableSlopeAngle:90,walkableHeight:20,walkableClimb:5,walkableRadius:0,maxEdgeLen:12,maxSimplificationError:1.3,minRegionArea:8,mergeRegionArea:20,maxVertsPerPoly:6,detailSampleDist:6,detailSampleMaxError:1},hZ,Ii,Pa;sxe.then(t=>{hZ=t,Ii=new t.Vec3,Pa=new t.Vec3});var HFe=new O,GFe=class{constructor(t=!1,i=!1){this.usePhysics=t,this.isExport=i,this.onPointerDown=r=>{if(jt.length!==1)return;let{raycaster:n,page:a}=this.eventContext;this.eventContext.updateRaycaster(r);let s=a.raycastWithClones(n);if(s.length!==0){if(this.gameControl){let o=HFe.copy(this.gameControl.colliderWorldPosition);o.y-=this.gameControl.colliderHeight/2,this.gameControl.path=this.computePath(o,s[0].point)}this.eventContext.requestRender()}},this.traverseWithPhysics=(r,n)=>a=>{var A,f,m,g,p,v,_;let s;if(a instanceof sc)if(a.objectForSample){if(a.objectForSample.dataPatched.physics.fusedBody)return;s=a.object}else return a.object.dataPatched.physics.fusedBody===!0&&a.object.dataPatched.physics.rigidBody==="dynamic"?!0:void 0;else if(a instanceof us)s=a.object;else if(s=a,((A=s.dataPatched.cloner)==null?void 0:A.disabled)===!1&&((f=s.dataPatched.cloner)==null?void 0:f.hideBase)&&((m=s.dataPatched.physics)==null?void 0:m.fusedBody)!==!0)return!0;
12017if(n&&!s.userData.navmesh)return;let o=s.dataPatched;if(!o.visible&&((g=o.physics)==null?void 0:g.enabled)!==!0)return!0;a.updateMatrixWorldSVD();let l=bT(o),c=s.userData.hasDestroy,h=s.userData.hasDrag,u=!1,d=!1;for(let y of o.events)y.data.disabled!==!0&&(y.data.type==="GameControl"?u=!0:y.data.type==="Follow"&&(d=!0));if(u||l||d||c||h)return!0;if(this.usePhysics&&((p=o.physics)==null?void 0:p.rigidBody)==="dynamic"){if(this.usePhysics&&((v=o.physics)!=null&&v.fusedBody))return!0}else if("geometry"in a&&a.geometry&&r.push(hu(a.geometry,a.matrixWorld)),this.usePhysics&&((_=o.physics)==null?void 0:_.fusedBody))return a.traverseObject((y,w)=>{var M,S;if(w===0)return;let b;if(y instanceof sc)if(y.objectForSample){if(y.objectForSample.dataPatched.physics.fusedBody)return;b=y.object}else return y.object.dataPatched.physics.fusedBody===!0&&y.object.dataPatched.physics.rigidBody==="dynamic"?!0:void 0;else if(y instanceof us)b=y.object;else if(b=y,(M=y.dataPatched.cloner)==null?void 0:M.hideBase)return!0;let E=b.dataPatched;if(!E.visible&&((S=E.physics)==null?void 0:S.enabled)!==!0)return!0;"geometry"in y&&y.geometry&&r.push(hu(y.geometry,y.matrixWorld))}),!0},this.traverseNoPhysics=(r,n)=>a=>{let s;if(a instanceof sc)return;a instanceof us?s=a.object:s=a;let o=s.dataPatched;if(o.physics.enabled==="visibility"?!o.visible:!o.physics.enabled)return!0;if(n&&!s.userData.navmesh)return;let l=a.geometry,c=s.userData.hasDestroy===!0,h=s.userData.hasDrag===!0;if(bT(o)||c||h||s.dataPatched.events.some(u=>u.data.disabled!==!0&&u.data.type==="GameControl"))return!0;l&&r.push(hu(l,a.matrixWorld))},this.navmeshWasm=hZ,this.navMesh=new this.navmeshWasm.NavMesh,this._workerURL=URL.createObjectURL(new Blob([(i?OFe:NFe)+UFe])),this._worker=new Worker(this._workerURL)}init(t,i,r){this.gameControl=i,this.eventContext=r,this.setDefaultQueryExtent(new O().setScalar(t.ch*t.walkableRadius*1.2)),this._worker.onmessage=()=>{this.createNavMesh(r.page,t,n=>{this.buildFromNavmeshData(n.data)})},this.eventContext.renderer.domElement.addEventListener("pointerdown",this.onPointerDown)}createNavMesh(t,i,r){i.objects.forEach(c=>{var u;let h=t.scene.find(c);h.traverseEntity(d=>{d.userData.navmesh=!0}),(u=h.cloner)==null||u.traverseObject(d=>{d.userData.navmesh=!0})});let n=[],a=(this.usePhysics?this.traverseWithPhysics:this.traverseNoPhysics)(n,i.zones==="custom");if(t.traverseChildren(a),i.objects.forEach(c=>{var u;let h=t.scene.find(c);h.traverseEntity(d=>{d.userData.navmesh=void 0}),(u=h.cloner)==null||u.traverseObject(d=>{d.userData.navmesh=void 0})}),n.length===0)return!1;let s=Nf(n),{positions:o,triIndices:l}=CM(s.getAttribute("position"),s.getIndex());return this._worker.postMessage([o,o.length/3,l,l.length,{...kFe,...i}]),this._worker.onmessage=r,!0}createDebugNavGeometry(){let t,i,r=this.navMesh.getDebugNavMesh(),n=r.getTriangleCount(),a=new Uint32Array(n*3),s=new Float32Array(n*3*3);for(t=0;t<n*3;t++)a[t]=t;for(t=0;t<n;t++)for(i=0;i<3;i++){let l=r.getTriangle(t).getPoint(i);s[t*9+i*3+0]=l.x,s[t*9+i*3+1]=l.y,s[t*9+i*3+2]=l.z}let o=new Lt;return o.setIndex(new ei(a,1)),o.setAttribute("position",new ei(s,3)),o}getClosestPoint(t){return Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,this.navMesh.getClosestPoint(Ii)}getClosestPointToRef(t,i){Ii.x=t.x,Ii.y=t.y,Ii.z=t.z;let r=this.navMesh.getClosestPoint(Ii);i.set(r.x,r.y,r.z)}getRandomPointAround(t,i){return Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,this.navMesh.getRandomPointAround(Ii,i)}getRandomPointAroundToRef(t,i,r){Ii.x=t.x,Ii.y=t.y,Ii.z=t.z;let n=this.navMesh.getRandomPointAround(Ii,i);r.set(n.x,n.y,n.z)}moveAlong(t,i){return Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,Pa.x=i.x,Pa.y=i.y,Pa.z=i.z,this.navMesh.moveAlong(Ii,Pa)}moveAlongToRef(t,i,r){return Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,Pa.x=i.x,Pa.y=i.y,Pa.z=i.z,this.navMesh.moveAlong(Ii,Pa)}computePath(t,i){let r=this.getClosestPoint(i);if(Pa.x=r.x,Pa.y=r.y,Pa.z=r.z,Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)+Math.pow(i.z-r.z,2))>this.getDefaultQueryExtent().y)return[];this.getClosestPoint(t);let n=this.navMesh.computePath(Ii,Pa),a=n.getPointCount(),s=[];for(let o=0;o<a;o++){let l=n.getPoint(o);s.push(new O(l.x,l.y,l.z))}return s}createCrowd(t,i){return new zFe(this,t,i)}setDefaultQueryExtent(t){Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,this.navMesh.setDefaultQueryExtent(Ii)}getDefaultQueryExtent(){return this.navMesh.getDefaultQueryExtent()}buildFromNavmeshData(t){let i=t.length*t.BYTES_PER_ELEMENT,r=this.navmeshWasm._malloc(i),n=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,r,i);n.set(t);let a=new this.navmeshWasm.NavmeshData;a.dataPointer=n.byteOffset,a.size=t.length,this.navMesh.buildFromNavmeshData(a),this.navmeshWasm._free(n.byteOffset)}getNavmeshData(){let t=this.navMesh.getNavmeshData(),i=new Uint8Array(this.navmeshWasm.HEAPU8.buffer,t.dataPointer,t.size),r=new Uint8Array(t.size);return r.set(i),this.navMesh.freeNavmeshData(t),r}getDefaultQueryExtentToRef(t){let i=this.navMesh.getDefaultQueryExtent();t.set(i.x,i.y,i.z)}dispose(){var t;this.navMesh.destroy(),this._worker.terminate(),URL.revokeObjectURL(this._workerURL),(t=this.eventContext)==null||t.renderer.domElement.removeEventListener("pointerdown",this.onPointerDown)}addCylinderObstacle(t,i,r){return Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,this.navMesh.addCylinderObstacle(Ii,i,r)}addBoxObstacle(t,i,r){return Ii.x=t.x,Ii.y=t.y,Ii.z=t.z,Pa.x=i.x,Pa.y=i.y,Pa.z=i.z,this.navMesh.addB
12017oxObstacle(Ii,Pa,r)}removeObstacle(t){this.navMesh.removeObstacle(t)}isSupported(){return this.navmeshWasm!==void 0}},zFe=class{constructor(t,i,r){this.navmeshWasmWrapper=t,this.transforms=[],this.agents=new Array,this.reachRadii=new Array,this._agentDestinationArmed=new Array,this._agentDestination=new Array,this.crowd=new this.navmeshWasmWrapper.navmeshWasm.Crowd(i,r,this.navmeshWasmWrapper.navMesh.getNavMesh())}onReachTarget(t,i){}addAgent(t,i,r){let n=new this.navmeshWasmWrapper.navmeshWasm.dtCrowdAgentParams;n.radius=i.radius,n.height=i.height,n.maxAcceleration=i.maxAcceleration,n.maxSpeed=i.maxSpeed,n.collisionQueryRange=i.collisionQueryRange,n.pathOptimizationRange=i.pathOptimizationRange,n.separationWeight=i.separationWeight,n.updateFlags=7,n.obstacleAvoidanceType=0,n.queryFilterType=0,n.userData=0;let a=this.crowd.addAgent(new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z),n);return this.transforms.push(r),this.agents.push(a),this.reachRadii.push(i.reachRadius?i.reachRadius:i.radius),this._agentDestinationArmed.push(!1),this._agentDestination.push(new O(0,0,0)),a}getAgentPosition(t){return this.crowd.getAgentPosition(t)}getAgentPositionToRef(t,i){let r=this.crowd.getAgentPosition(t);i.set(r.x,r.y,r.z)}getAgentVelocity(t){return this.crowd.getAgentVelocity(t)}getAgentVelocityToRef(t,i){let r=this.crowd.getAgentVelocity(t);i.set(r.x,r.y,r.z)}getAgentNextTargetPath(t){return this.crowd.getAgentNextTargetPath(t)}getAgentNextTargetPathToRef(t,i){let r=this.crowd.getAgentNextTargetPath(t);i.set(r.x,r.y,r.z)}getAgentState(t){return this.crowd.getAgentState(t)}overOffmeshConnection(t){return this.crowd.overOffmeshConnection(t)}agentGoto(t,i){this.crowd.agentGoto(t,new this.navmeshWasmWrapper.navmeshWasm.Vec3(i.x,i.y,i.z));let r=this.agents.indexOf(t);r>-1&&(this._agentDestinationArmed[r]=!0,this._agentDestination[r].set(i.x,i.y,i.z))}agentTeleport(t,i){this.crowd.agentTeleport(t,new this.navmeshWasmWrapper.navmeshWasm.Vec3(i.x,i.y,i.z))}updateAgentParameters(t,i){let r=this.crowd.getAgentParameters(t);i.radius!==void 0&&(r.radius=i.radius),i.height!==void 0&&(r.height=i.height),i.maxAcceleration!==void 0&&(r.maxAcceleration=i.maxAcceleration),i.maxSpeed!==void 0&&(r.maxSpeed=i.maxSpeed),i.collisionQueryRange!==void 0&&(r.collisionQueryRange=i.collisionQueryRange),i.pathOptimizationRange!==void 0&&(r.pathOptimizationRange=i.pathOptimizationRange),i.separationWeight!==void 0&&(r.separationWeight=i.separationWeight),this.crowd.setAgentParameters(t,r)}removeAgent(t){this.crowd.removeAgent(t);let i=this.agents.indexOf(t);i>-1&&(this.agents.splice(i,1),this.transforms.splice(i,1),this.reachRadii.splice(i,1),this._agentDestinationArmed.splice(i,1),this._agentDestination.splice(i,1))}getAgents(){return this.agents}update(t){if(this.navmeshWasmWrapper.navMesh.update(),t<=FFe)return;let i=1/60,r=10;{let n=Math.floor(t/i);n>r&&(n=r),n<1&&(n=1);let a=t/n;for(let s=0;s<n;s++)this.crowd.update(a)}for(let n=0;n<this.agents.length;n++){let a=this.agents[n],s=this.getAgentPosition(a);if(this.transforms[n].copy(s),this._agentDestinationArmed[n]){let o=s.x-this._agentDestination[n].x,l=s.z-this._agentDestination[n].z,c=this.reachRadii[n],h=this._agentDestination[n].y-this.reachRadii[n],u=this._agentDestination[n].y+this.reachRadii[n],d=o*o+l*l;s.y>h&&s.y<u&&d<c*c&&(this.onReachTarget(a,this._agentDestination[n]),this._agentDestinationArmed[n]=!1)}}}setDefaultQueryExtent(t){let i=new this.navmeshWasmWrapper.navmeshWasm.Vec3(t.x,t.y,t.z);this.crowd.setDefaultQueryExtent(i)}getDefaultQueryExtent(){return this.crowd.getDefaultQueryExtent()}getDefaultQueryExtentToRef(t){let i=this.crowd.getDefaultQueryExtent();t.set(i.x,i.y,i.z)}getCorners(t){let i,r=this.crowd.getCorners(t),n=r.getPointCount(),a=[];for(i=0;i<n;i++){let s=r.getPoint(i);a.push(new O(s.x,s.y,s.z))}return a}dispose(){this.crowd.destroy()}};function QFe(t){let i=!1;return t.scene.objects.forEach(r=>{r.data.type==="Page"&&!i&&r.data.publish.gameControlObject&&ky.traverseModuleInstances(t,r.id,(n,a,s)=>{for(let o of s)o.data.type==="GameControl"&&o.data.navmesh.enabled&&(i=!0)})}),i}var VFe={type:"change"},o8={type:"changeZoom"},WFe={type:"changePan"},hf={type:"start"},uf={type:"end",changed:!0},jFe={type:"end",changed:!1},v2=new ri,l8=new Me,YFe=2*Math.PI,KFe=1e-8,XFe=.01,_2=new O,$b=new Me,y2=new O,eS=new ri,c8=new ht,qFe={type:"requestRender"},uZ=class extends Ja{constructor(t,i,r={isPlayMode:!1,isExport:!1}){super(),this.object=t,this.domElement=i,this.options=r,this.enabled=!0,this.useKeyEvents=!0,this.enableDamping=!1,this.enableZoom=!0,this.enableRotate=!0,this.enablePan=!0,this.autoRotate=!1,this.rotationLimitsMode=0,this.panLimitsMode=0,this.rotationSoftLimit=2,this.panSoftLimit=2,this.hoverRotatePanMode=0,this.zoomLimitsEnabled=!1,this.mouseButtons=[0,5],this.mouseButtonsPlay=[3,4,5],this.touches=[null,Ho.DOLLY_ROTATE,Ho.PAN],this.offset=new O,this.eye=new O,this.lastPosition=new O,this.lastQuaternion=new ri,this.current=ne
12017w Me,this.overShoot=new Me,this.overRatio=new Me,this.spherical=new GG,this.sphericalDelta=new GG,this.panOffset=new O,this.panLeftV=new O,this.panUpV=new O,this.panV=new O,this.rotateStart=new Me,this.rotateEnd=new Me,this.rotateDelta=new Me,this.panStart=new Me,this.panEnd=new Me,this.panDelta=new Me,this.dollyStart=new Me,this.dollyEnd=new Me,this.dollyDelta=new Me,this.rotationRangeFactor=new Me,this.panRangeFactor=new Me,this.state=-1,this.zoomChanged=!1,this.isPointerDown=!1,this.isThetaFlipped=!1,this.prevScale=0,this.scale=1,this.gesture=!1,this.timer=-1,this.timerHover=-1,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPhi=0,this.maxPhi=Math.PI,this.minTheta=-1/0,this.maxTheta=1/0,this.minH=0,this.maxH=Math.PI,this.minV=-1/0,this.maxV=1/0,this.autoRotateClockwise=!0,this.isPanOverShoot=!1,this.isRotateOverShoot=!1,this.resetHoverEffectOnPointerLeave=!1,this.hasChange=!1,this.useWindowEvents=!1,this.isTouchZoom=!0,this.autoRotateSpeed=2,this.dampingFactor=.125,this.zoomSpeed=2,this.rotateSpeed=1,this.panSpeed=1,this.hoverRotatePanStrength=.1,this.hoverRotateDamping=this.dampingFactor,this.thetaIsFree=!1,this.phiIsFree=!1,this.needsUpdate=!0,this.onCameraChange=n=>{this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange),this.object=n.camera,this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)},this.update=()=>{this.object.updateWorldMatrix(!0,!1),this.object.matrixWorld.decompose(y2,eS,_2),this.offset.copy(y2).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.autoRotate&&this.state===-1&&this.rotateLeft((this.autoRotateClockwise===!0?1:-1)*this.getAutoRotationAngle()),this.rotationLimitsMode!==0&&this.applyLimits(this.sphericalDelta,this.rotationLimitsMode,this.rotationSoftLimit,this.maxTheta,this.minTheta,this.maxPhi,this.minPhi,this.rotationRangeFactor),this.rotationLimitsMode!==2&&(this.spherical.phi+=this.sphericalDelta.phi),(this.rotationLimitsMode!==1||this.autoRotate===!0)&&(this.spherical.theta+=this.sphericalDelta.theta),this.spherical.radius*=this.scale,this.zoomLimitsEnabled&&this.object.isPerspectiveCamera&&(this.spherical.radius=Math.max(this.minDistance,Math.min(this.maxDistance,this.spherical.radius))),this.panLimitsMode!==0&&(this.target.applyQuaternion(v2.copy(eS).invert()),this.panOffset.applyQuaternion(v2),this.applyLimits(this.panOffset,this.panLimitsMode,this.panSoftLimit,this.maxH,this.minH,this.maxV,this.minV,this.panRangeFactor),this.target.applyQuaternion(eS),this.panOffset.applyQuaternion(eS)),this.panLimitsMode===2&&(this.panOffset.y=0),this.panLimitsMode===1&&(this.panOffset.x=0),this.state===-1&&!this.gesture?(this.panOffset.multiplyScalar(1-this.dampingFactor),this.target.add(this.panOffset)):(this.target.add(this.panOffset),this.panOffset.set(0,0,0)),this.offset.setFromSpherical(this.spherical),y2.copy(this.target).add(this.offset),this.object.position.copy(this.target).add(this.offset),this.object.parent&&(c8.copy(this.object.parent.matrixWorld).invert(),this.object.position.applyMatrix4(c8));let n=this.spherical.phi%YFe;if(this.eye.copy(this.offset).normalize(),this.object.up.copy(lr.DEFAULT_UP).applyAxisAngle(this.eye,this.object.angleOffsetFromUp),n>0&&n>Math.PI||n<0&&n>-Math.PI?(this.object.up.negate(),this.object.lookAt(this.target),this.object.isUpVectorFlipped=!0):(this.object.lookAt(this.target),this.object.isUpVectorFlipped=!1),this.state===-1||this.enableDamping===!0){let a=this.hoverRotatePanMode===1?this.hoverRotateDamping:this.dampingFactor;this.sphericalDelta.theta*=1-a,this.sphericalDelta.phi*=1-a}else this.sphericalDelta.set(0,0,0);return this.scale=1,this.zoomChanged||this.lastPosition.distanceToSquared(this.object.position)>XFe||8*(1-this.lastQuaternion.dot(this.object.quaternion))>KFe?(this.dispatchEvent(VFe),this.object.dispatchEvent(qFe),this.lastPosition.copy(this.object.position),this.lastQuaternion.copy(this.object.quaternion),this.zoomChanged=!1,!0):(this.isPanOverShoot=!1,this.isRotateOverSho
12017ot=!1,this.object.wasMovedBySwitchCameraAction=!1,this.sphericalDelta.set(0,0,0),this.panOffset.set(0,0,0),!1)},this.onPointerDown=n=>{this.enabled!==!1&&(n.pointerType==="touch"||n.pointerType==="pen"&&Do?this.onPointerDownTouch(n):this.onPointerDownMouse(n),this.state!==-1&&(this.isPointerDown=!0,this.dispatchEvent(hf),this.domElement.addEventListener("pointermove",this.onPointerMove),this.domElement.addEventListener("pointerup",this.onPointerUp),n.stopPropagation(),n.pointerType==="touch"||n.pointerType==="pen"&&Do||this.domElement.setPointerCapture(n.pointerId)))},this.onPointerLeave=n=>{this.resetHoverEffectOnPointerLeave&&!this.useWindowEvents?(this.hoverRotatePanMode===1?(this.sphericalDelta.theta=-this.spherical.theta,this.sphericalDelta.phi=-this.spherical.phi,_2.subVectors(this.position0,this.target0),this.spherical.setFromVector3(_2),this.sphericalDelta.theta+=this.spherical.theta,this.sphericalDelta.phi+=this.spherical.phi,this.sphericalDelta.theta/=8,this.sphericalDelta.phi/=8):this.hoverRotatePanMode===2&&this.panOffset.subVectors(this.target0,this.target).divideScalar(8),this.update()):this.pointerLeaveEvent=n},this.onPointerEnter=n=>{this.resetHoverEffectOnPointerLeave||this.pointerLeaveEvent===void 0?$b.set(n.clientX-this.domElement.clientWidth/2,n.clientY-this.domElement.clientHeight/2):$b.set(n.clientX-this.pointerLeaveEvent.clientX,n.clientY-this.pointerLeaveEvent.clientY),this.hoverRotatePanMode===1?(this.rotateDelta.copy($b).multiplyScalar(this.rotateSpeed*this.hoverRotatePanStrength).rotateAround(l8,-this.object.angleOffsetFromUp),this.rotateLeft(2*Math.PI*this.rotateDelta.x/this.domElement.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/this.domElement.clientHeight),this.rotateStart.set(n.clientX,n.clientY)):this.hoverRotatePanMode===2&&(this.panDelta.copy($b).multiplyScalar(this.panSpeed*this.hoverRotatePanStrength),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.set(n.clientX,n.clientY)),this.update()},this.onPointerMove=n=>{this.enabled!==!1&&(this.checkRaycastLock()||(n.pointerType==="touch"||n.pointerType==="pen"&&Do?this.onPointerMoveTouch(n):this.onPointerMoveMouse(n),n.stopPropagation()))},this.onPointerUp=n=>{this.isPointerDown=!1,jt.length===0&&(this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)),jt.length>1&&n.preventDefault(),this.hasChange?this.dispatchEvent(uf):this.dispatchEvent(jFe),this.state=-1,n&&(n.stopPropagation(),n.pointerType==="touch"||n.pointerType==="pen"&&Do||this.domElement.releasePointerCapture(n.pointerId))},this.onPointerDownMouse=n=>{let a;switch(this.useKeyEvents?a=this.mouseButtons[n.button]:a=this.mouseButtonsPlay[n.button],a){case 0:if(n.altKey===!0&&!n.shiftKey&&!ub(n)){if(this.enableRotate===!1)return;this.handleMouseDownRotate(n),this.state=0}else if(this.key===" "){if(this.enablePan===!1)return;this.handleMouseDownPan(n),this.state=2}break;case 4:if(this.enablePan===!1)return;this.handleMouseDownPan(n),this.state=2;break;case 3:if(ub(n)||n.shiftKey){if(this.enablePan===!1)return;this.handleMouseDownPan(n),this.state=2}else{if(this.enableRotate===!1)return;this.handleMouseDownRotate(n),this.state=0}break;case 5:if(ub(n)||n.shiftKey){if(this.enableRotate===!1)return;this.handleMouseDownRotate(n),this.state=0}else{if(this.enablePan===!1)return;this.handleMouseDownPan(n),this.state=2}break;default:this.state=-1}},this.onPointerMoveMouse=n=>{switch(this.state){case 0:if(this.enableRotate===!1)return;this.handleMouseMoveRotate(n);break;case 1:if(this.enableZoom===!1)return;this.handleMouseMoveDolly(n);break;case 2:if(this.enablePan===!1)return;this.handleMouseMovePan(n);break}this.object.wasMovedByUser=!0},this.onPointerDownTouch=n=>{switch(jt.length>1&&n.preventDefault(),this.touches[jt.length-1]){case Ho.ROTATE:if(this.enableRotate===!1){this.state=-1;return}this.handleTouchStartRotate(),this.state=3;break;case Ho.PAN:if(this.enablePan===!1){this.state=-1;return}this.handleTouchStartPan(),this.state=4;break;case Ho.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchStartDollyPan(),this.state=5;break;case Ho.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchStartDollyRotate(),this.state=6;break;default:this.state=-1}},this.onPointerMoveTouch=n=>{switch(jt.length>1&&n.preventDefault(),this.state){case 3:if(this.enableRotate===!1)return;this.handleTouchMoveRotate(n),this.update();break;case 4:if(this.enablePan===!1)return;this.handleTouchMovePan(n),this.update();break;case 5:if(this.enableZoom===!1&&this.enablePan===!1)return;this.handleTouchMoveDollyPan(n),this.update();break;case 6:if(this.enableZoom===!1&&this.enableRotate===!1)return;this.handleTouchMoveDollyRotate(n),this.update();break;default:this.state=-1}this.object.wasMovedByUser=!0},this.dispatchEndDebounced=LN(()=>this.dispatchEvent(uf),33),this.onMouseWheel=n=>{this.enabled===!1||this.enableZoom===!1&&this.enablePan===!1||this.checkRaycastLock()||(!this.options.isExport&&this.domElement.clientHeight===document.body.clientHeight&&this.domElement.clientWidth===document.body.clientWidth&&n.preventDefault(),this.dispatchEvent(hf),this.handleMouseWheel(n),this.dispatchEndDebounced(),this.object.wasMovedByUser=!0)},this.onGesture=n=>{if(n.preventDefault(),this.enabled!==!1&&!this.checkRaycastLock()&&!RE)if(n.type==="gesturechange"){if(this.enableZoom===!1||this.isTouchZoom===!1)return;this.dispatchEvent(hf),n.scale>this.prevScale?this.dollyIn(this.getZoomScale()):n.scale<this.prevScale&&this.dollyOut(this.getZoomScale()),this.prevScale=n.scale,this.update(),this.object.wasMovedByUser=!0}else this.dispatchEvent(uf)},this.onContextMenu=n=>{n.preventDefault()},this.onTouchEnd=n=>{n.preventDefault()},this.onKeyDown=n=>{this.enabled!==!1&&(this.key=n.key,n.key===" "&&this.dispatchEvent(hf))},this.onKeyUp=n=>{this.enabled!==!1&&(this.key=void 0,this.state!==-1&&n.key==="Alt"&&this.onPointerUp(jt[0]),n.key===" "&&this.dispatchEvent(uf))},this.onPointerHover=n=>{n.pointerType!=="mouse"||this.enabled===!1||this.state!==-1||this.hoverRotatePanMode===2&&this.isPanOverShoot||this.hoverRotatePanMode===1&&this.isRotateOverSho
vendor: 16,219 bytes, line 12017
12017ot||(this.isPointerDown=!0,this.hoverRotatePanMode===2?this.handleMouseMovePan(n,this.hoverRotatePanStrength):this.hoverRotatePanMode===1&&this.handleMouseMoveRotate(n,this.hoverRotatePanStrength))},this.onBeginState=()=>{this.enabled=!1,this.needsUpdate=!1},this.onCompleteState=n=>{n.isfromEntity&&this.options.isPlayMode||(this.enabled=!0,this.needsUpdate=!0,this.object.updateUp(),this.object.getTarget(this.target))},this.target=this.object.getTarget(),this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.quat0=this.object.quaternion.clone(),this.isUpVectorFlipped0=this.object.isUpVectorFlipped,this.offset.copy(this.object.position).sub(this.target),this.spherical.setFromVector3(this.offset),this.object.isUpVectorFlipped&&(this.spherical.phi*=-1,this.spherical.theta-=Math.PI),this.initialSphericalRadius=this.spherical.radius,this.addEventListenersToCamera()}dispatchEvent(t){t.type==="start"?this.hasChange=!1:this.hasChange=!0,super.dispatchEvent(t)}addEventListenersToCamera(){this.object.addEventListener("beginState",this.onBeginState),this.object.addEventListener("completeState",this.onCompleteState),this.object.addEventListener("cameraChange",this.onCameraChange)}removeEventListenersFromCamera(){this.object.removeEventListener("beginState",this.onBeginState),this.object.removeEventListener("completeState",this.onCompleteState),this.object.removeEventListener("cameraChange",this.onCameraChange)}updateUseWindowEvents(t){if(window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("pointermove",this.onPointerHover),this.useWindowEvents=t,this.hoverRotatePanMode!==0&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover)),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.hoverRotatePanMode!==0&&!this.useWindowEvents){let i=this.useWindowEvents?window:this.domElement;i.addEventListener("pointerleave",this.onPointerLeave),i.addEventListener("pointerenter",this.onPointerEnter)}}fromJSON(t,i){this.setEnableDampingSpeed(t.enableDamping),this.enablePan=t.enablePan,this.enableZoom=t.enableZoom,this.enableRotate=t.enableRotate,this.rotationLimitsMode=t.rotationLimitsMode,this.thetaIsFree=t.rotationHorizontalOffset.min===t.rotationHorizontalOffset.max&&t.rotationHorizontalOffset.min===Math.PI,this.phiIsFree=t.rotationVerticalOffset.min===t.rotationVerticalOffset.max&&t.rotationVerticalOffset.min===Math.PI,this.panLimitsMode=t.panLimitsMode,this.panSoftLimit=t.panSoftLimit,this.rotationSoftLimit=t.rotationSoftLimit,this.hoverRotatePanMode=t.hoverRotatePanMode,this.hoverRotateDamping=t.hoverRotateDamping??this.dampingFactor,this.useWindowEvents=i==="window",this.hoverRotatePanMode!==0&&(this.useWindowEvents?window.addEventListener("pointermove",this.onPointerHover):this.domElement.addEventListener("pointermove",this.onPointerHover));let r=t.hoverRotatePanStrength/100;this.hoverRotatePanStrength=r**2,this.zoomLimitsEnabled=t.zoomLimitsEnabled,this.minZoom=t.zoomLimits.min,this.maxZoom=Math.max(t.zoomLimits.min,t.zoomLimits.max),this.minDistance=1e3/t.zoomLimits.max,this.maxDistance=Math.max(this.minDistance,1e3/t.zoomLimits.min),this.autoRotate=t.autoRotate,this.autoRotateSpeed=t.autoRotateSpeed,this.autoRotateClockwise=t.autoRotateClockwise;let n=this.object.getTarget().applyQuaternion(v2.copy(this.object.quaternion).invert());this.minV=-t.panVerticalOffset.min+n.y,this.maxV=t.panVerticalOffset.max+n.y,this.minH=-t.panHorizontalOffset.min+n.x,this.maxH=t.panHorizontalOffset.max+n.x,this.panRangeFactor.set(this.maxH-this.minH,this.maxV-this.minV).divideScalar(2),this.rotationRangeFactor.setScalar(Math.PI).divideScalar(4),this.minPhi=Nc(this.spherical.phi-t.rotationVerticalOffset.min),this.maxPhi=Nc(this.spherical.phi+t.rotationVerticalOffset.max),this.minTheta=Nc(Nc(this.spherical.theta)-t.rotationHorizontalOffset.min),this.maxTheta=Nc(Nc(this.spherical.theta)+t.rotationHorizontalOffset.max),this.isThetaFlipped=this.minTheta>this.maxTheta,t.orbitTouches===1&&(this.touches[0]=Ho.ROTATE),t.panTouches===1&&(this.touches[0]=Ho.PAN),t.orbitTouches===2&&(this.touches[1]=Ho.DOLLY_ROTATE),t.panTouches===2&&(this.touches[1]=Ho.DOLLY_PAN),t.orbitTouches===3&&(this.touches[2]=Ho.ROTATE),t.panTouches===3&&(this.touches[2]=Ho.PAN),this.isTouchZoom=t.isTouchZoom,this.resetHoverEffectOnPointerLeave=t.resetHoverEffectOnPointerLeave??!1}connect(){if(this.domElement.addEventListener("contextmenu",this.onContextMenu),this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("wheel",this.onMouseWheel),window.addEventListener("keydown",this.onKeyDown,!1),window.addEventListener("keyup",this.onKeyUp,!1),this.domElement.addEventListener("gesturestart",this.onGesture),this.domElement.addEventListener("gesturechange",this.onGesture),this.domElement.addEventListener("gestureend",this.onGesture),this.domElement.addEventListener("touchend",this.onTouchEnd),this.hoverRotatePanMode!==0&&!this.useWindowEvents){let t=this.useWindowEvents?window:this.domElement;t.addEventListener("pointerleave",this.onPointerLeave),t.addEventListener("pointerenter",this.onPointerEnter)}this.pointerLeaveEvent=void 0}dispose(){this.removeEventListenersFromCamera(),this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("wheel",this.onMouseWheel),window.removeEventListener("keydown",this.onKeyDown,!1),window.removeEventListener("keyup",this.onKeyUp,!1),this.domElement.removeEventListener("pointermove",this.onPointerHover),window.removeEventListener("pointermove",this.onPointerHover),this.domElement.removeEventListener("gesturestart",this.onGesture),this.domElement.removeEventListener("gesturechange",this.onGesture),this.domElement.removeEventListener("gestureend",this.onGesture),this.domElement.removeEventListener("touchend",this.onTouchEnd),this.domElement.removeEventListener("pointerleave",this.onPointerLeave),this.domElement.removeEventListener("pointerenter",this.onPointerEnter),window.removeEventListener("pointerleave",this.onPointerLeave),window.removeEventListener("pointerenter",this.onPointerEnter),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp)}applyLimits(t,i,r,n,a,s,o,l){this.overShoot.set(0,0);let c,h,u;t instanceof O?(c=t.x,h=t.y,this.current.set(this.target.x,this.target.y),u=!0):(c=t.theta,h=t.phi,this.current.set(Nc(this.spherical.theta),Nc(this.spherical.phi)),u=!1),r===0&&(this.current.x+=c,this.current.y+=h),(i===3||i===2)&&(!u&&this.isThetaFlipped?this.current.x>n&&this.current.x<0?this.overShoot.x=n-this.current.x:this.current.x<a&&this.current.x>0&&(this.overShoot.x=a-this.current.x):this.current.x>n?this.overShoot.x=n-this.current.x:this.current.x<a&&(this.overShoot.x=a-this.current.x)),(i===3||i===1)&&(this.current.y>s?this.overShoot.y=s-this.current.y:this.current.y<o&&(this.overShoot.y=o-this.current.y)),u||(this.overShoot.x=Nc(this.overShoot.x),this.overShoot.y=Nc(this.overShoot.y)),r!==0?(this.overRatio.copy(this.overShoot).divide(l),this.overRatio.x=Math.min(Math.abs(this.overRatio.x),1),this.overRatio.y=Math.min(Math.abs(this.overRatio.y),1),r===1&&(this.overRatio.x=h8(Math.abs(this.overRatio.x)),this.overRatio.y=h8(Math.abs(this.overRatio.y))),this.isPointerDown||r===1?r===2&&(this.overRatio.x>.9&&!this.thetaIsFree||this.overRatio.y>.9&&!this.phiIsFree)?this.isPointerDown=!1:(c*this.overShoot.x<0&&!this.thetaIsFree&&(c*=1-this.overRatio.x),h*this.overShoot.y<0&&!this.phiIsFree&&(h*=1-this.overRatio.y)):r===2&&(!u&&(this.overRatio.x>.002&&!this.thetaIsFree||this.overRatio.y>.002&&!this.phiIsFree)||u&&(Math.abs(this.overShoot.x)>2||Math.abs(this.overShoot.y)>2)?(this.thetaIsFree||(c=this.overShoot.x*.05),this.phiIsFree||(h=this.overShoot.y*.05),u?this.isPanOverShoot=!0:this.isRotateOverShoot=!0):u?this.isPanOverShoot=!1:this.isRotateOverShoot=!1)):(c+=this.overShoot.x,h+=this.overShoot.y),t instanceof O?(t.x=c,t.y=h):(this.thetaIsFree||(t.theta=c),this.phiIsFree||(t.phi=h))}setEnableDampingSpeed(t){this.enableDamping=t,this.rotateSpeed=t===!0?.2:1}stopDamping(){this.sphericalDelta.theta=0,this.sphericalDelta.phi=0}getAutoRotationAngle(){return 2*Math.PI/60/60*this.autoRotateSpeed}getZoomScale(){return Math.pow(.95,this.zoomSpeed)}rotateLeft(t){this.sphericalDelta.theta-=t}rotateUp(t){this.sphericalDelta.phi-=t}panLeft(t,i){this.panLeftV.setFromMatrixColumn(i,0),this.panLeftV.multiplyScalar(-t),this.panOffset.add(this.panLeftV)}panUp(t,i){this.panUpV.setFromMatrixColumn(i,1),this.panUpV.multiplyScalar(t),this.panOffset.add(this.panUpV)}pan(t,i){let r=this.domElement;if(r&&this.object.isPerspectiveCamera){let n=this.object.position;this.panV.copy(n).sub(this.target);let a=this.panV.length();a*=Math.tan(this.object.fov/2*Math.PI/180),this.panLeft(2*t*a/r.clientHeight,this.object.matrixWorld),this.panUp(2*i*a/r.clientHeight,this.object.matrixWorld)}else r&&this.object.isOrthographicCamera&&(this.panLeft(t*(this.object.right-this.object.left)/this.object.zoom/r.clientWidth,this.object.matrixWorld),this.panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/r.clientHeight,this.object.matrixWorld));this.dispatchEvent(WFe)}dollyOut(t){this.object.isPerspectiveCamera?this.scale/=t:this.object.isOrthographicCamera&&(this.object.zoom*=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(o8)}dollyIn(t){this.object.isPerspectiveCamera?this.scale*=t:this.object.isOrthographicCamera&&(this.object.zoom/=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0),this.dispatchEvent(o8)}zoomOut(t=this.getZoomScale()){this.dispatchEvent(hf),this.dollyOut(t),this.dispatchEvent(uf)}zoomIn(t=this.getZoomScale()){this.dispatchEvent(hf),this.dollyIn(t),this.dispatchEvent(uf)}setZoom(t){if(this.dispatchEvent(hf),this.object.isPerspectiveCamera){let i=this.initialSphericalRadius/t/this.spherical.radius;this.scale=i}else this.object.isOrthographicCamera&&(this.object.zoom=t,this.zoomLimitsEnabled&&(this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom))),this.object.updateProjectionMatrix(),this.zoomChanged=!0);this.dispatchEvent(uf)}handleMouseDownRotate(t){this.rotateStart.set(t.clientX,t.clientY)}handleMouseDownDolly(t){this.dollyStart.set(t.clientX,t.clientY)}handleMouseDownPan(t){this.panStart.set(t.clientX,t.clientY)}handleMouseMoveRotate(t,i=1){t.movementX!==void 0?this.rotateDelta.set(t.movementX,t.movementY):(this.rotateEnd.set(t.clientX,t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateStart.copy(this.rotateEnd)),this.rotateDelta.multiplyScalar(this.rotateSpeed*i).rotateAround(l8,-this.object.angleOffsetFromUp);let r=this.domElement,n=this.useWindowEvents?window.innerHeight:r.clientHeight,a=2*Math.PI*this.rotateDelta.x/n,s=2*Math.PI*this.rotateDelta.y/n;this.rotateLeft(a),this.rotateUp(s),this.update()}handleMouseMoveDolly(t){this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(this.getZoomScale()):this.dollyDelta.y<0&&this.dollyIn(this.getZoomScale()),this.dollyStart.copy(this.dollyEnd),this.update()}handleMouseMovePan(t,i=1){t.movementX!==void 0?this.panDelta.set(t.movementX,t.movementY):(this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.panStart.copy(this.panEnd)),this.panDelta.multiplyScalar(this.panSpeed*i),this.pan(this.panDelta.x,this.panDelta.y),this.update()}handleMouseWheel(t){if(exe===!1&&ub(t)===!1&&ixe(t)===!0){if(this.enablePan===!1)return;this.gesture?(this.panDelta.set(-t.deltaX,-t.deltaY).multiplyScalar(this.panSpeed),this.panDelta.x=Math.min(Math.abs(this.panDelta.x),100)*(this.panDelta.x<0?-1:1),this.panDelta.y=Math.min(Math.abs(this.panDelta.y),100)*(this.panDelta.y<0?-1:1),t.altKey?this.pan(0,this.panDelta.y):t.shiftKey?this.pan(this.panDelta.x,0):this.pan(this.panDelta.x,this.panDelta.y),this.update()):(this.gesture=!0,this.isPointerDown=!0),window.clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.gesture=!1,this.isPointerDown=!1},30)}else{if(this.enableZoom===!1||this.gesture)return;t.deltaY===0?t.deltaX<0?this.dollyIn(this.getZoomScale()):t.deltaX>0&&this.dollyOut(this.getZoomScale()):t.deltaY<0?this.dollyIn(this.getZoomScale()):t.deltaY>0&&this.dollyOut(this.getZoomScale()),this.update(),this.gesture=!1,this.isPointerDown=!1}}handleTouchStartRotate(){if(jt.length===2){let t=.5*(jt[0].pageX+jt[1].pageX),i=.5*(jt[0].pageY+jt[1].pageY);this.rotateStart.set(t,i)}else this.rotateStart.set(jt[0].pageX,jt[0].pageY)}handleTouchStartPan(){if(jt.length===2){let t=.5*(jt[0].pageX+jt[1].pageX),i=.5*(jt[0].pageY+jt[1].pageY);this.panStart.set(t,i)}else this.panStart.set(jt[0].pageX,jt[0].pageY)}handleTouchStartDolly(){let t=jt[0].pageX-jt[1].pageX,i=jt[0].pageY-jt[1].pageY,r=Math.sqrt(t*t+i*i);this.dollyStart.set(0,r)}handleTouchStartDollyPan(){this.enableZoom&&this.isTouchZoom===!0&&this.handleTouchStartDolly(),this.enablePan&&this.handleTouchStartPan()}handleTouchStartDollyRotate(){this.enableZoom&&this.isTouchZoom===!0&&this.handleTouchStartDolly(),this.enableRotate&&this.handleTouchStartRotate()}handleTouchMoveRotate(t){if(jt.length===2){let r=cI(t),n=.5*(t.pageX+r.x),a=.5*(t.pageY+r.y);this.rotateEnd.set(n,a)}else{if(t.pointerId!==jt[0].pointerId)return;this.rotateEnd.set(t.pageX,t.pageY)}this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart).multiplyScalar(this.rotateSpeed);let i=this.domElement;i&&(this.rotateLeft(2*Math.PI*this.rotateDelta.x/i.clientHeight),this.rotateUp(2*Math.PI*this.rotateDelta.y/i.clientHeight)),this.rotateStart.copy(this.rotateEnd)}handleTouchMovePan(t){if(jt.length===2){let i=cI(t),r=.5*(t.pageX+i.x),n=.5*(t.pageY+i.y);this.panEnd.set(r,n)}else{if(t.pointerId!==jt[0].pointerId)return;this.panEnd.set(t.pageX,t.pageY)}this.panDelta.subVectors(this.panEnd,this.panStart).multiplyScalar(this.panSpeed),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}handleTouchMoveDolly(t){let i=cI(t),r=t.pageX-i.x,n=t.pageY-i.y,a=Math.sqrt(r*r+n*n);this.dollyEnd.set(0,a),this.dollyDelta.set(0,Math.pow(this.dollyEnd.y/this.dollyStart.y,this.zoomSpeed)),this.dollyOut(this.dollyDelta.y),this.dollyStart.copy(this.dollyEnd)}handleTouchMoveDollyPan(t){this.enableZoom&&this.isTouchZoom===!0&&this.handleTouchMoveDolly(t),this.enablePan&&this.handleTouchMovePan(t)}handleTouchMoveDollyRotate(t){this.enableZoom&&this.isTouchZoom===!0&&this.handleTouchMoveDolly(t),this.enableRotate&&this.handleTouchMoveRotate(t)}checkRaycastLock(){var t;if(this.object.data.raycastLock){if(this.options.isPlayMode)return!1;{let i=(t=this.options)==null?void 0:t.showCameraLock;return i&&i(),!0}}else return!1}};function Nc(t){let i=Math.PI*2;for(;t<=-Math.PI;)t+=i;for(;t>Math.PI;)t-=i;return t}function h8(t){return 1-Math.pow(1-t,4)}var u8=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.page=n,this.currentIntersectedObjects=[],this.actions=xa(i,i.actions,n,a,s,r),this.target=i.target,this.triggeringObjects=[];for(let o of i.triggeringObjects){let l=n.scene.find(o);l&&this.triggeringObjects.push(l)}}isValidTriggeringObject(t){return this.target==="all"?!0:this.triggeringObjects.some(i=>i===t||i.isAncestorOf(t.uuid)||t.isAncestorOf(i.uuid))}disconnect(){ba(this.actions)}dispatch(){this.object.destroyedInAction||(this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.object.dispatchEvent({type:"beginEvent",eventName:"Trigger"}),this.actions.Transition.forEach(t=>
12017{t.data.runMode==="Toggle"?t.toggle():t.play()}),this.actions.SwitchCamera.forEach(t=>{t.data.runMode==="Toggle"?t.toggle():t.play()}),this.actions.Link.forEach(t=>{t.dispatch()}),this.actions.Reset.forEach(t=>{t.dispatch()}),this.actions.Create.forEach(t=>{t.dispatch()}),this.actions.Destroy.forEach(t=>{t.dispatch(!1)}),this.actions.Audio.forEach(t=>{t.dispatchBasic()}),this.actions.Particles.forEach(t=>{t.dispatchBasic()}),this.actions.Video.forEach(t=>{t.dispatchBasic()}),this.actions.SceneTransition.forEach(t=>{t.dispatch()}),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch()))}},Fi;lxe.then(t=>Fi=t);var Rn=new O,Yl=new ri,Sd=new O,E2=new qn(0,0,0,"YXZ"),d8=new qn(0,0,0,"XYZ"),Kl=new O,w2=new O,b2=new O(1,1,1),Qm=new ri,tS=new ht,A8=new ht,ZFe={type:"updateMatrix"},f8=new ri,S2=new ho,tO={type:"beginEvent",eventName:"Collision"},JFe={type:"beginEvent",eventName:"Trigger"};function $Fe(t){if(ky.physicsEnabled(t.scene.objects))return!0;let i=!1;return t.scene.objects.traverse((r,n)=>{if(n.events){if(Array.isArray(n.events)){for(let a of n.events)if(a.data.disabled!==!0&&a.data.type==="GameControl"&&a.data.collisionEnabled){i=!0;break}}else for(let a of Object.values(n.events))if(a.disabled!==!0&&a.type==="GameControl"&&a.collisionEnabled){i=!0;break}}}),i}var bT=t=>t.states.some(i=>i.data.position!==void 0||i.data.rotation!==void 0||i.data.hiddenMatrix!==void 0||i.data.cloner!==void 0||i.data.pathSnapping!==void 0),e4e=class{constructor(t){this.eventContext=t,this.isEnabled=!1,this.gameControl=null,this.joysticks=[],this.joystickToGameControls=[],this.sharedGameControlGlobals={entitiesWithTransformAnim:[],entityToCollisionEvents:{},colliderToEntity:new Map,triggers:[],gamePads:[],createdObjects:[],nCreatedPerAction:{}},this.sensorToTriggerEvent={},this.eventManager=void 0,this.needsCollisionDetection=!1,this.initializationCounter=-1,this.rigidBodyToMesh=new Map,this.nActiveRigidBodies=0,this.collisionEvents=[],this.isExport=!1,this.processRigidBody=i=>{if(i.bodyType()!==Fi.RigidBodyType.Dynamic)return;i.isSleeping()||this.nActiveRigidBodies++;let[r,n,a]=this.rigidBodyToMesh.get(i.handle);if(Rn.copy(i.translation()).multiplyScalar(this.pixelsPerMeter),Yl.copy(i.rotation()),r.matrixWorld.compose(Rn,Yl,n),r.hasNonUniformScale&&r.matrixWorld.multiply(r.shearScale),r.dispatchEvent(ZFe),a){let s=r.cloner;if(s&&s.objectForSample===void 0){s.matrixWorld.copy(r.matrixWorld);for(let o of s.children)o.updateMatrixWorld(!0)}for(let o of r.children)o.updateMatrixWorld(!0)}},this.accumulator=0,this.handleCollisionEvents=(i,r,n)=>{var o,l,c,h;if(n===!1)return;let a,s;if(this.sensorToTriggerEvent[i]?(a=this.sensorToTriggerEvent[i],s=this.sharedGameControlGlobals.colliderToEntity.get(r)):this.sensorToTriggerEvent[r]&&(a=this.sensorToTriggerEvent[r],s=this.sharedGameControlGlobals.colliderToEntity.get(i)),a&&s&&a.isValidTriggeringObject(s)){a.dispatch();return}for(let u=this.sharedGameControlGlobals.createdObjects.length-1;u>=0;u--){let d=this.sharedGameControlGlobals.createdObjects[u];if(d.userData.hasCollisionDestroy&&(((o=d.rigidBody)==null?void 0:o.collider(0).handle)===i||((l=d.rigidBody)==null?void 0:l.collider(0).handle)===r)){this.sharedGameControlGlobals.createdObjects.splice(u,1),d.removeFromParent(),requestAnimationFrame(()=>{var A;return(A=this.sharedGameControlGlobals.rapierWorld)==null?void 0:A.removeRigidBody(d.rigidBody)});break}}if(((c=this.gameControl)==null?void 0:c.object)!==void 0&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(i)){let u=this.sharedGameControlGlobals.colliderToEntity.get(r),d=this.sharedGameControlGlobals.entityToCollisionEvents[u.uuid];if(d===void 0)return;for(let A of d)A.data.target==="character"&&this.dispatchCollisionEvent(A,u,r)}else if(((h=this.gameControl)==null?void 0:h.object)!==void 0&&this.gameControl.object===this.sharedGameControlGlobals.colliderToEntity.get(r)){let u=this.sharedGameControlGlobals.colliderToEntity.get(i),d=this.sharedGameControlGlobals.entityToCollisionEvents[u.uuid];if(d===void 0)return;for(let A of d)A.data.target==="character"&&this.dispatchCollisionEvent(A,u,i)}else{let u=this.sharedGameControlGlobals.colliderToEntity.get(i),d=this.sharedGameControlGlobals.entityToCollisionEvents[u.uuid];if(d!==void 0)for(let m of d)m.data.target==="scene"&&this.dispatchCollisionEvent(m,u,i);let A=this.sharedGameControlGlobals.colliderToEntity.get(r),f=this.sharedGameControlGlobals.entityToCollisionEvents[A==null?void 0:A.uuid];if(f!==void 0)for(let m of f)m.data.target==="scene"&&this.dispatchCollisionEvent(m,A,r)}},this.isExport=t.isExport,this.sharedAssets=t.sharedAssets,this.renderer=t.renderer,this.requestRender=t.requestRender,this.domElement=this.renderer.domElement,this.pixelsPerMeter=iZ,this.gravity=this.page.data.globalPhysics.gravity}get page(){return this.eventContext.page}attachVRControllers(t){t.forEach(i=>
12017{i.addEventListener("connected",r=>{"gamepad"in r.data&&"axes"in r.data.gamepad&&this.sharedGameControlGlobals.gamePads.push(r.data.gamepad)})})}markIsDestroyTarget(){this.page.traverseVisibleEntity(t=>{var r,n;let i=t.dataPatched;for(let a of i.events){if(a.data.disabled===!0)continue;let s=(n=(r=a.data.actions)==null?void 0:r.find(o=>o.data.type==="Destroy"))==null?void 0:n.data;if(s)for(let o of s.objects){let l=this.page.scene.find(o);l&&(l.userData.hasDestroy=!0)}}})}markIsDragObject(){this.page.traverseVisibleEntity(t=>{let i=t.dataPatched;for(let r of i.events)if(!(r.data.disabled===!0||r.data.type!=="DragDrop"))for(let n of r.data.objects){let a=this.page.scene.find(n);a&&(a.userData.hasDrag=!0)}})}initBVH(){let t=[];if(this.page.traverseChildren(i=>{var h,u;let r,n=i instanceof LS,a=i instanceof NS;if(i instanceof sc||n||a)return;i instanceof us?r=i.object:r=i;let s=r.dataPatched;if(((h=s.physics)==null?void 0:h.enabled)==="visibility"?!s.visible:!((u=s.physics)!=null&&u.enabled))return!0;let o=i.geometry,l=r.userData.hasDestroy===!0,c=r.userData.hasDrag===!0;if(bT(s)||l||c||r.dataPatched.events.some(d=>d.data.disabled!==!0&&d.data.type==="GameControl"))return i.updateMatrixWorldSVD(),this.addBoundsTree(i),!0;o&&t.push(hu(o,i.matrixWorld))}),t.length>0){let i=Nf(t,!1);this.sharedGameControlGlobals.staticMeshBVH=new J_(i)}}addRigidBody(t,i,r){let n=[],a="geometry"in t?t.geometry:void 0,s=i.dataPatched;if((a==null?void 0:a.getAttribute("position"))!==void 0&&n.push(hu(a,t.shearScale)),s.physics.fusedBody){let o=this.gatherChildrenGeom(t,n);t.traverseObject(o),t.children.forEach(c=>c.updateMatrixWorld(!0));let l=t.cloner;l&&l.objectForSample===void 0&&s.physics.rigidBody==="dynamic"&&(l.traverseObject(o),l.children.forEach(c=>c.updateMatrixWorld(!0)))}if(n.length>0){let o,l=!r.fromCreate&&s.physics.rigidBody==="dynamic"||r.fromCreate&&r.dynamic;l?(o=Fi.RigidBodyDesc.dynamic(),o.setLinearDamping(s.physics.damping).setAngularDamping(s.physics.damping).setAdditionalMass(1e-9).setGravityScale(s.physics.gravityScale).enabledRotations(...s.physics.enabledRotation).enabledTranslations(...s.physics.enabledTranslation)):(r.hasTransformAnim||r.hasFollow||r.hasDrag)&&!r.fromCreate?(o=Fi.RigidBodyDesc.kinematicPositionBased(),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(t)):o=Fi.RigidBodyDesc.fixed();let c=Nf(n);(t.hasNonUniformScale?t.matrixWorldRigid:t.matrixWorld).decompose(Rn,Yl,Sd),t.position0=Rn.clone().divideScalar(this.pixelsPerMeter),t.rotation0=Yl.clone(),Rn.divideScalar(this.pixelsPerMeter),o.setTranslation(Rn.x,Rn.y,Rn.z).setRotation(Yl),a?c==null||c.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter):c==null||c.scale(Sd.x/this.pixelsPerMeter,Sd.y/this.pixelsPerMeter,Sd.z/this.pixelsPerMeter);let h=this.sharedGameControlGlobals.rapierWorld.createRigidBody(o);l&&this.rigidBodyToMesh.set(h.handle,[t,Sd.clone(),s.physics.fusedBody]);let u=!(s.geometry===void 0||s.geometry.type==="SubdivGeometry"||s.geometry.type==="NonParametricGeometry"||s.geometry.type==="BooleanGeometry"||s.geometry.type==="VectorGeometry"||s.geometry.type==="StarGeometry"||s.geometry.type==="RectangleGeometry"||s.geometry.type==="EllipseGeometry"||s.geometry.type==="TriangleGeometry"||s.geometry.type==="TorusGeometry"||s.geometry.type==="HelixGeometry");try{this.addCollider(h,s.physics,c,i,u)}catch{try{this.addCollider(h,s.physics,c,i,!1)}catch(d){console.error(d)}}t.rigidBody=h}}addBoundsTree(t){var r,n;let i=[];if(((r=t.geometry)==null?void 0:r.getAttribute("position"))!==void 0&&((n=t.geometry)==null?void 0:n.getAttribute("position").count)>0&&i.push(hu(t.geometry,t.shearScale)),t.traverseObject(this.gatherChildrenGeom(t,i)),t.children.forEach(a=>a.updateMatrixWorld(!0)),i.length>0){let a=Nf(i,!1);t.bvhGeometry=a,a.getAttribute("position").count>0&&(t.bvhGeometry.boundsTree=new J_(a),this.sharedGameControlGlobals.entitiesWithTransformAnim.push(t))}}addCollider(t,i,r,n,a=!0){var l,c;if((r==null?void 0:r.getAttribute("position").count)===0||((l=r==null?void 0:r.getIndex())==null?void 0:l.count)===0)return;let s;r&&(i.colliderType==="trimesh"?s=Fi.ColliderDesc.trimesh(r.getAttribute("position").array,r.getIndex().array):s=Fi.ColliderDesc.convexMesh(r.getAttribute("position").array,a?r.getIndex().array:void 0)),s.setFrictionCombineRule(Fi.CoefficientCombineRule.Average).setRestitutionCombineRule(Fi.CoefficientCombineRule.Average).setDensity(i.density).setFriction(i.friction).setRestitution(i.restitution);let o=this.sharedGameControlGlobals.rapierWorld.createCollider(s,t);this.sharedGameControlGlobals.colliderToEntity.set(o.handle,n),(c=this.sharedGameControlGlobals.entityToCollisionEvents[n.uuid])!=null&&c.some(h=>h.target==="scene")&&o.setActiveEvents(Fi.ActiveEvents.COLLISION_EVENTS)}gatherChildrenGeom(t,i){return(r,n)=>{var l;if(n===0)return;let a;if(r instanceof sc)if(r.objectForSample){if(r.objectForSample.dataPatched.physics.fusedBody)return;a=r.object}else return r.object.dataPatched.physics.fusedBody===!0&&r.object.dataPatched.physics.rigidBody==="dynamic"?!0:void 0;else if(r instanceof us)a=r.object;else if(a=r,(l=a.dataPatched.cloner)==null?void 0:l.hideBase)return!0;let s=a.dataPatched;
12017if(s.physics.enabled==="visibility"?!s.visible:!s.physics.enabled)return!0;n===1?t.hasNonUniformScale?r.matrixWorld.multiplyMatrices(t.shearScale,r.hiddenMatrix):r.matrixWorld.copy(r.hiddenMatrix):r.matrixWorld.multiplyMatrices(r.parent.matrixWorld,r.hiddenMatrix),r.matrixWorld.multiply(r.matrix);let o=r.geometry;(o==null?void 0:o.getAttribute("position"))!==void 0&&i.push(hu(o,r.matrixWorld))}}activate(t){var A,f;if(this.isEnabled)return;this.isEnabled=!0,this.eventManager=t,this.usePhysics=this.page.data.globalPhysics.usePhysics;let i=this.page.playCamera,r=!1,n=5,a=8,s=9,o="drag",l=this.page.data.publish.gameControlObject,c=l!==null?this.page.find(l):null,h=null;if(c)for(let m of c.data.events){if(m.data.disabled||m.data.type!=="GameControl")continue;let g=c;for(;this.usePhysics&&((A=g=g.parent)==null?void 0:A.parent)!==null;)(f=g.data.physics)==null||f.fusedBody;m.data.collisionEnabled&&(this.needsCollisionDetection=!0),h===null&&(h=m.data)}if(this.page.traverseEntity(m=>{for(let g of m.dataPatched.events)if(g.data.disabled===!1&&g.data.type==="Trigger")return this.needsCollisionDetection=!0,!0}),c&&h&&(c.data.visible===!0||c.data.physics.enabled===!0)){r=r||h.camera===i.uuid||c.uuid===i.uuid;let m=new rZ(c,this.renderer.domElement,h,this.eventContext.page.data.globalPhysics,this,c.uuid!==i.uuid&&h.camera===i.uuid,i,this.page,this.sharedAssets);this.gameControl=m,n=h.joystickPosLoc,a=h.joystickRotLoc,s=h.jumpTouchButtonLoc,o=h.rotByTouch,Do&&h.touchControl&&(this.joystickToGameControls[n]="pos",h.moveMode==="walk"&&(this.joystickToGameControls[s]="jmp"),o==="joystick"&&(this.joystickToGameControls[a]="rot"))}if(this.gameControl&&this.gameControl.data.navmesh.enabled){let m=this.gameControl.data;if(!this.navigationMeshWrapper){this.navigationMeshWrapper=new GFe(this.usePhysics,this.isExport);let g;m.collider.type==="sphere"?g=m.collider.radius*2:g=m.collider.height,g=Math.floor(g/m.navmesh.ch-1),this.navigationMeshWrapper.init({...m.navmesh,walkableHeight:g},this.gameControl,this.eventContext)}}if(r===!1){let{enableRotate:m,enablePan:g,enableZoom:p,autoRotate:v,hoverRotatePanMode:_}=this.eventManager.publish.orbitControls;(m||g||p||v||_!==0)&&(this.orbitControls=new uZ(i,this.renderer.domElement,{isExport:this.isExport,isPlayMode:!0}),this.orbitControls.addEventListener("change",this.requestRender),this.orbitControls.addEventListener("end",this.requestRender),this.orbitControls.addEventListener("start",this.requestRender),this.orbitControls.fromJSON(this.eventManager.publish.orbitControls,this.eventManager.publish.mouseEventTarget),this.orbitControls.useKeyEvents=!1,this.orbitControls.addEventListenersToCamera(),this.orbitControls.connect(),this.orbitControls.update())}let u=this.renderer.domElement.width/this.renderer.getPixelRatio(),d=this.renderer.domElement.height/this.renderer.getPixelRatio();this.joystickToGameControls.forEach((m,g)=>{let p=document.body.appendChild(document.createElement("div")),[v,_,y]=this.eventManager.eventContext.publish.joystickSizeAndXYOffset[g],w=(u-5*v)/4+v,b={},E=m==="jmp",M=E?0:v;g<10?(g<5?b.top=M/2:b.bottom=M/2,b.left=M/2+g%5*w):g===10?(b.left=M/2,b.top=d/2):(b.right=M/2,b.top=d/2),b.top?b.top-=_[1]:b.bottom+=_[1],b.left?b.left+=_[0]:b.right-=_[0];for(let C in b)b[C]+="px";if(E){let C=p.appendChild(document.createElement("div"));Object.assign(C.style,b,{position:"absolute",width:v+"px",height:v+"px",backgroundColor:`rgba(255,255,255,${y==="show"?.4:0})`,zIndex:"9999",borderRadius:v+"px",border:y==="show"?"solid 2px rgba(0, 0, 0, .1)":"none",display:"flex",alignItems:"center",justifyContent:"center",touchAction:"none"});let x=v/16*16*.4;y==="show"&&(C.innerHTML=` 12018 <svg width="${x}" height="${v*.4}" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> 12019 <path d="M2 10L8 4L14 10" stroke="black" stroke-opacity="40%" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> 12020 </svg> 12021 `),C.addEventListener("pointerdown",()=>{this.gameControl.movementState.jump=1,this.requestRender()}),C.addEventListener("touchend",R=>R.preventDefault()),this.joysticks[g]=[void 0,p];return}let S={zone:p,mode:"static",position:b,size:v};y==="hide"&&(S.restOpacity=0);let T=hUe.create(S);T.on("move",(C,x)=>{let R=this.gameControl;m==="pos"?x.force<.2?R.moveForce=0:(R.movementState.movePosZ=Math.sin(-x.angle.radian),R.movementState.movePosX=Math.cos(-x.angle.radian),x.force>1.2?R.movementState.run=1:R.movementState.run=0,x.force<.3?R.moveForce=(x.force-.2)/.1:R.moveForce=1):m==="rot"&&(x.force<.2?R.rotForce=0:(R.movementState.rotPosX=x.vector.y,R.movementState.rotPosY=-x.vector.x,x.force<.3?R.rotForce=(x.force-.2)/.1:R.rotForce=1)),this.requestRender()}),T.on("end",(C,x)=>{let R=this.gameControl;m==="pos"?(R.movementState.movePosZ=0,R.movementState.movePosX=0,R.moveForce=1):m==="rot"&&(R.movementState.rotPosX=0,R.movementState.rotPosY=0,R.rotForce=1)}),this.joysticks[g]=[T,p]}),this.markIsDestroyTarget(),this.markIsDragObject(),this.rebuildBVH(),this.initializationCounter++,window.setTimeout(()=>
12021{this.collisionEvents.forEach(m=>m.initialDisabled=!1)},80)}initPhysics(){var o;(o=this.sharedGameControlGlobals.rapierWorld)==null||o.free(),this.sharedGameControlGlobals.rapierWorld=new Fi.World(new Fi.Vector3(0,this.gravity,0)),this.events=new Fi.EventQueue(!0);let t=[],i=[];if(this.page.traverseChildren(l=>{var v,_,y,w;let c;if(l instanceof sc)if(l.objectForSample){if(l.objectForSample.dataPatched.physics.fusedBody)return;c=l.object}else return l.object.dataPatched.physics.fusedBody===!0&&l.object.dataPatched.physics.rigidBody==="dynamic"?!0:void 0;else if(l instanceof us)c=l.object;else{if(l instanceof NS||l instanceof LS)return;if(c=l,((v=c.dataPatched.cloner)==null?void 0:v.disabled)===!1&&((_=c.dataPatched.cloner)==null?void 0:_.hideBase)&&((y=c.dataPatched.physics)==null?void 0:y.fusedBody)!==!0)return!0}let h=c.dataPatched,u;for(let b of h.events)b.data.disabled!==!0&&b.data.type==="GameControl"&&(u=b.data);if(!h.physics||(h.physics.enabled==="visibility"?!h.visible:!h.physics.enabled))return!0;l.updateMatrixWorldSVD();let d=bT(h),A=!1,f=c.userData.hasDestroy,m=c.userData.hasDrag,g=!1;for(let b of h.events)if(b.data.disabled!==!0){if(b.data.type==="Collision"){A=!0;let E=new BFe(b.id,b.data,c,this.page,this.sharedAssets,this.eventManager);E.initialDisabled=!0,this.collisionEvents.push(E),this.sharedGameControlGlobals.entityToCollisionEvents[c.uuid]&&this.sharedGameControlGlobals.entityToCollisionEvents[c.uuid].every(M=>M.id!==b.id)?this.sharedGameControlGlobals.entityToCollisionEvents[c.uuid].push(E):this.sharedGameControlGlobals.entityToCollisionEvents[c.uuid]=[E]}else if(b.data.type==="Follow"){g=!0;let E=b.data.target;l.traverseVisible(M=>{M.userData.isFollowingObj=E})}}h.physics.rigidBody==="dynamic"&&h.physics.fusedBody===!1&&(l.matrixWorldFusedFalse=l.matrixWorld.clone());let p=l.geometry;if(u!==void 0){let b=Fi.RigidBodyDesc.kinematicPositionBased();(l.hasNonUniformScale?l.matrixWorldRigid:l.matrixWorld).decompose(Rn,Yl,Sd),l.position0=Rn.clone().divideScalar(this.pixelsPerMeter),l.rotation0=Yl.clone(),Rn.divideScalar(this.pixelsPerMeter),b.setTranslation(Rn.x,Rn.y,Rn.z).setRotation(Yl);let E=this.sharedGameControlGlobals.rapierWorld.createRigidBody(b);l.rigidBody=E;let M;u.collider.type==="sphere"?M=Fi.ColliderDesc.ball(u.collider.radius/this.pixelsPerMeter):u.collider.type==="capsule"?M=Fi.ColliderDesc.capsule((u.collider.height/2-u.collider.radius)/this.pixelsPerMeter,u.collider.radius/this.pixelsPerMeter):M=Fi.ColliderDesc.cuboid(u.collider.width/this.pixelsPerMeter/2,u.collider.height/this.pixelsPerMeter/2,u.collider.depth/this.pixelsPerMeter/2),M.setFrictionCombineRule(Fi.CoefficientCombineRule.Average).setRestitutionCombineRule(Fi.CoefficientCombineRule.Average).setDensity(h.physics.density).setFriction(h.physics.friction).setRestitution(h.physics.restitution);let S=this.sharedGameControlGlobals.rapierWorld.createCollider(M,E);this.sharedGameControlGlobals.colliderToEntity.set(S.handle,c),Rn.fromArray(u.collider.position).multiply(Sd.setFromMatrixScale(c.matrixWorld)).divideScalar(this.pixelsPerMeter),S.setTranslationWrtParent(Rn);let T=new ri().setFromEuler(new qn().setFromVector3(new O().fromArray(u.collider.rotation)));S.setRotationWrtParent(T),S.setActiveEvents(Fi.ActiveEvents.COLLISION_EVENTS),this.generateSensorColliderDescs(c,!0)}else h.physics.rigidBody==="dynamic"||d||g||f||m||A?(this.addRigidBody(l,c,{hasFollow:g,hasTransformAnim:d,hasDrag:m}),this.generateSensorColliderDescs(c,h.physics.fusedBody)):(p&&t.push(hu(p,l.matrixWorld)),h.physics.fusedBody&&l.traverseObject((b,E)=>{var C;if(E===0)return;let M;if(b instanceof sc)if(b.objectForSample){if(b.objectForSample.dataPatched.physics.fusedBody)return;M=b.object}else return b.object.dataPatched.physics.fusedBody===!0&&b.object.dataPatched.physics.rigidBody==="dynamic"?!0:void 0;else{if(b instanceof NS||b instanceof LS)return;if(b instanceof us)M=b.object;else if(M=b,(C=M.dataPatched.cloner)==null?void 0:C.hideBase)return!0}let S=M.dataPatched;if(S.physics.enabled==="visibility"?!S.visible:!S.physics.enabled)return!0;let T=b.geometry;(T==null?void 0:T.getAttribute("position"))!==void 0&&t.push(hu(T,b.matrixWorld))}),this.generateSensorColliderDescs(c,h.physics.fusedBody,i));if(((w=h.physics)==null?void 0:w.fusedBody)===!0||u)return!0}),t.length===0)return;let r=Nf(t);r.scale(1/this.pixelsPerMeter,1/this.pixelsPerMeter,1/this.pixelsPerMeter);let n=Fi.RigidBodyDesc.fixed(),a=this.sharedGameControlGlobals.rapierWorld.createRigidBody(n),s=Fi.ColliderDesc.trimesh(r.getAttribute("position").array,r.getIndex().array).setFrictionCombineRule(Fi.CoefficientCombineRule.Multiply).setRestitutionCombineRule(Fi.CoefficientCombineRule.Multiply).setFriction(1).setRestitution(1);this.sharedGameControlGlobals.rapierWorld.createCollider(s,a);for(let[l,c]of i){let h=this.sharedGameControlGlobals.rapierWorld.createCollider(l,a);this.sensorToTriggerEvent[h.handle]=c}}updatePositions(){return this.nActiveRigidBodies=0,this.sharedGameControlGlobals.rapierWorld.forEachRigidBody(this.processRigidBody),this.nActiveRigidBodies>0}rebuildBVH(){this.usePhysics?this.initPhysics():(this.page.traverseEntity(t=>{for(let i of t.dataPatched.events)if(i.data.type==="Trigger"&&i.data.disabled!==!0){let r=new u8(i.id,i.data,t,this.page,this.sharedAssets,this.eventManager),n=new ht().compose(Kl.fromArray(i.data.position),Qm.setFromEuler(d8.fromArray(i.data.rotation)),b2);if(i.data.triggerZone==="box"){let a=new Sn;a.min.fromArray(i.data.size).multiplyScalar(-.5),a.max.fromArray(i.data.size).multiplyScalar(.5),this.sharedGameControlGlobals.triggers.push([a,n,t,r])}else this.sharedGameControlGlobals.triggers.push([i.data.radius,n,t,r])}}),this.needsCollisionDetection&&this.initBVH())}
12021disconnectEvents(){this.collisionEvents.forEach(t=>t.disconnect()),this.sharedGameControlGlobals.triggers.forEach(t=>t[3].disconnect()),this.sharedGameControlGlobals.triggers.length=0}deactivate(){var t,i,r,n;if(this.isEnabled){this.isEnabled=!1,this.page.traverse(a=>{let s=a;s.matrixWorldFusedFalse&&(s.matrixWorldFusedFalse=void 0),s.rigidBody&&(s.rigidBody=void 0),s.position0&&(s.position0=void 0),s.rotation0&&(s.rotation0=void 0)}),(t=this.sharedGameControlGlobals.rapierWorld)==null||t.free(),this.sharedGameControlGlobals.rapierWorld=void 0,this.sharedGameControlGlobals.staticMeshBVH=void 0,this.accumulator=0,this.sharedGameControlGlobals.entitiesWithTransformAnim=[],this.disconnectEvents(),(i=this.gameControl)==null||i.reset(),(r=this.gameControl)==null||r.dispose(),this.gameControl=null,this.initializationCounter=-1,this.joysticks.forEach(([a,s])=>{a==null||a.destroy(),s.remove()}),this.joystickToGameControls=[],this.joysticks=[],this.orbitControls&&(this.orbitControls.dispose(),this.orbitControls=void 0),(n=this.navigationMeshWrapper)==null||n.dispose(),this.navigationMeshWrapper=void 0;for(let a of Object.values(this.sharedGameControlGlobals.entityToCollisionEvents))a.forEach(s=>s.disconnect());this.sharedGameControlGlobals.entityToCollisionEvents={},this.page.updateMatrixWorld(!0)}}update(t,i,r){if(!this.isEnabled)return!0;let n=!0;if(this.orbitControls!==void 0&&this.orbitControls.needsUpdate&&(n=!this.orbitControls.update()),this.initializationCounter>=0&&this.initializationCounter<2?(this.initializationCounter++,n=!1):this.initializationCounter===2&&this.gameControl&&(n=!this.gameControl.update(t,i,r)&&n),this.usePhysics===!1&&this.checkTrigger(),this.usePhysics){let a=.016666666666666666;if(t===0)n=this.stepPhysics()&&n;else{let s=t/1e3;s<a&&s>a*.55&&(s=a),this.accumulator+=s;let o=performance.now(),l=0,c=6;for(;this.accumulator>=a&&l<c&&(n=this.stepPhysics()&&n,this.accumulator-=a,l++,!(performance.now()-o>a*1e3)););this.accumulator=this.accumulator%a}}return n}stepPhysics(){var t;for(let i of this.sharedGameControlGlobals.entitiesWithTransformAnim){(i.hasNonUniformScale?i.matrixWorldRigid:i.matrixWorld).decompose(Rn,Yl,Sd),E2.setFromQuaternion(Yl);let r=i;r.prevR===void 0?(r.prevR=E2.clone(),r.prevT=Rn.clone()):(r.prevR.copy(E2),r.prevT.copy(Rn)),i.rigidB
vendor: 5,019 bytes, line 12021
12021ody&&(i.rigidBody.setNextKinematicTranslation(Rn.divideScalar(this.pixelsPerMeter)),i.rigidBody.setNextKinematicRotation(Yl))}return this.sharedGameControlGlobals.rapierWorld.step(this.events),(t=this.events)==null||t.drainCollisionEvents(this.handleCollisionEvents),!this.updatePositions()}dispatchCollisionEvent(t,i,r){var s;let n=((s=this.sharedGameControlGlobals.rapierWorld)==null?void 0:s.getCollider(r))._parent,a;if(i.cloner){for(let o of i.cloner.children)if(o.rigidBody===n){a=o;break}}t.dispatch(a),i.dispatchEvent(tO)}updateUseWindowEvents(t){var i;(i=this.orbitControls)==null||i.updateUseWindowEvents(t)}generateSensorColliderDescs(t,i,r){let n=A8.copy(t.matrixWorld).invert();t.traverseEntity((a,s)=>{if(i===!1&&s===1)return!0;for(let o of a.dataPatched.events)if(o.data.type==="Trigger"&&o.data.disabled!==!0){let l=new u8(o.id,o.data,a,this.page,this.sharedAssets,this.eventManager),c;if(o.data.triggerZone==="box"?c=Fi.ColliderDesc.cuboid(...o.data.size.map(h=>h/(2*this.pixelsPerMeter))):c=Fi.ColliderDesc.ball(o.data.radius/this.pixelsPerMeter),c.setDensity(0).setSensor(!0).setActiveEvents(Fi.ActiveEvents.COLLISION_EVENTS),Kl.fromArray(o.data.position),Qm.setFromEuler(d8.fromArray(o.data.rotation)),tS.compose(Kl,Qm,b2).premultiply(a.matrixWorld),r?(tS.decompose(Kl,Qm,w2),c.setActiveCollisionTypes(Fi.ActiveCollisionTypes.KINEMATIC_FIXED|Fi.ActiveCollisionTypes.DYNAMIC_FIXED)):(tS.premultiply(n).decompose(Kl,Qm,w2),t.rigidBody.bodyType()===Fi.RigidBodyType.Dynamic||(t.rigidBody.bodyType()===Fi.RigidBodyType.Fixed?c.setActiveCollisionTypes(Fi.ActiveCollisionTypes.KINEMATIC_FIXED|Fi.ActiveCollisionTypes.DYNAMIC_FIXED):c.setActiveCollisionTypes(Fi.ActiveCollisionTypes.KINEMATIC_KINEMATIC|Fi.ActiveCollisionTypes.DYNAMIC_KINEMATIC))),Kl.divideScalar(this.pixelsPerMeter),c.setTranslation(Kl.x,Kl.y,Kl.z),c.setRotation(Qm),r)r.push([c,l]);else{let h=this.sharedGameControlGlobals.rapierWorld.createCollider(c,t.rigidBody);this.sensorToTriggerEvent[h.handle]=l}}})}checkTrigger(){let t;for(let i=0;i<this.sharedGameControlGlobals.triggers.length;i++){let[r,n,a,s]=this.sharedGameControlGlobals.triggers[i];for(let o=0;o<this.sharedGameControlGlobals.entitiesWithTransformAnim.length;o++){let l=this.sharedGameControlGlobals.entitiesWithTransformAnim[o];if(a===l||s.isValidTriggeringObject(Oi.is(l)?l:l.object)===!1)continue;let c=A8.copy(a.matrixWorld).decompose(Kl,f8,w2).compose(Kl,f8,b2).multiply(n),h=tS.copy(l.matrixWorld).invert().multiply(c);r instanceof Sn?t=l.bvhGeometry.boundsTree.intersectsBox(r,h):(S2.radius=r,S2.center.setFromMatrixPosition(h),t=l.bvhGeometry.boundsTree.intersectsSphere(S2)),t?s.currentIntersectedObjects.indexOf(l)===-1&&(s.currentIntersectedObjects.push(l),s.dispatch(),a.dispatchEvent(JFe)):s.currentIntersectedObjects=s.currentIntersectedObjects.filter(u=>u!==l)}}}};function t4e(t){let i=this._clip.duration,r=this._clip.start??0,n=this.loop,a=this.time+t,s=this._loopCount,o=n===iN;if(t===0)return s===-1?a:o&&(s&1)===1?i-(a-r):a;if(n===y7){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=i)a=i;else if(a<0)a=0;else{this.time=a;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(s===-1&&(t>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),a>=i||a<r){let l=Math.floor((a-r)/(i-r));a-=(i-r)*l,s+=Math.abs(l);let c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,o||(a=t>0?i:r,this.repetitions===1&&(a=i)),this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(c===1){let h=t<0;this._setEndings(h,!h,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:l})}}else this.time=a;if(o&&(s&1)===1)return i-(a-r)}return a}var p8=!1,i4e=class{constructor(t,i,r,n){this.scene=t,this.requestRender=i,this.updateDisplayProgress=r,this.animationInspectorState=n,this.clipIdToAction={},this.activeClip=null,this.needsUpdate=!1,this.addClip=a=>{a.data.type==="Empty"&&a.data.animations&&a.data.animations.forEach((s,o)=>{let l=s[0]+"/";if(Array.isArray(a.identity)?l+=a.identity[0]:l+=a.uuid,this.clipIdToAction[l])return;let c=AP.parse(JSON.parse(s[2]));a.animations[o]=c;let h=this.mixer.clipAction(c,a);p8===!1&&(Object.getPrototypeOf(h)._updateTime=t4e,p8=!0),h.clampWhenFinished=!0,this.clipIdToAction[l]=h})},this.mixer=new _ye(t),this.scene.traverseEntity(this.addClip)}deleteClip(t,i){let r=this.scene.find(i);if(!r)return;let n=r.animations.find(s=>s.uuid===t);if(!n)return;let a=this.clipIdToAction[t];!a||(a.stop(),this.mixer.uncacheClip(n),delete this.clipIdToAction[t],r.animations=r.animations.filter(s=>s.uuid!==t))}get isPlaying(){return Object.values(this.clipIdToAction).some(t=>t.isRunning())}playFromInspector(t){this.mixer.stopAllAction();let i=this.clipIdToAction[t];!i||(i.play(),this.activeClip=i.getClip(),this.requestRender())}
12021onExitPlayMode(){Object.values(this.clipIdToAction).forEach(t=>{t.repetitions=1/0,t.loop=E7}),this.mixer.stopAllAction(),this.requestRender()}play(t){let i=t.clipId+"/"+t.object,r=this.clipIdToAction[i];if(r)return t&&(t.repeat>=0&&(r.repetitions=t.repeat+1),t.direction==="pingpong"&&t.repeat!==0&&(r.loop=iN)),r.play(),r.paused=!1,this.requestRender(),r}resumeFromInspector(t){let i=this.clipIdToAction[t];!i||(i.play(),i.paused=!1,this.requestRender())}pauseFromInspector(t){let i=this.clipIdToAction[t];!i||(i.paused=!0)}stop(){this.mixer.stopAllAction(),this.requestRender()}update(t){var i;if(this.needsUpdate)this.needsUpdate=!1;else if(this.isPlaying===!1||(i=this.animationInspectorState)!=null&&i.isScrubbing)return;this.mixer.update(t/1e3),this.activeClip&&this.updateDisplayProgress(Math.round(this.mixer.time/this.activeClip.duration*(this.maxFrames-1)%(this.maxFrames-1))),this.requestRender()}get maxFrames(){return Kq(this.activeClip??void 0)}setProgressFromInspector(t,i){if(!this.clipIdToAction[i])return;this.activeClip!==this.clipIdToAction[i].getClip()&&this.playFromInspector(i);let r=this.clipIdToAction[i].paused;this.clipIdToAction[i].paused=!1,this.mixer.setTime(Math.min(t/(this.maxFrames-1),.9999)*this.activeClip.duration),this.requestRender(),r&&(this.clipIdToAction[i].paused=!0)}},C2=new WeakMap,r4e=class extends CE{constructor(t){super(t),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(t){return this.decoderPath=t,this}setDecoderConfig(t){return this.decoderConfig=t,this}setWorkerLimit(t){return this.workerLimit=t,this}load(t,i,r,n){let a=new fP(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(t,s=>{this.decodeDracoFile(s,i).catch(n)},r,n)}decodeDracoFile(t,i,r,n){let a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:n||this.defaultAttributeTypes,useUniqueIDs:!!r};return this.decodeGeometry(t,a).then(i)}decodeGeometry(t,i){let r=JSON.stringify(i);if(C2.has(t)){let l=C2.get(t);if(l.key===r)return l.promise;if(t.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n,a=this.workerNextTaskID++,s=t.byteLength,o=this._getWorker(a,s).then(l=>(n=l,new Promise((c,h)=>{n._callbacks[a]={resolve:c,reject:h},n.postMessage({type:"decode",id:a,taskConfig:i,buffer:t},[t])}))).then(l=>this._createGeometry(l.geometry));return o.catch(()=>!0).then(()=>{n&&a&&this._releaseTask(n,a)}),C2.set(t,{key:r,promise:o}),o}_createGeometry(t){let i=new Lt;t.index&&i.setIndex(new ei(t.index.array,1));for(let r=0;r<t.attributes.length;r++){let n=t.attributes[r],a=n.name,s=n.array,o=n.itemSize;i.setAttribute(a,new ei(s,o))}return i}_loadLibrary(t,i){let r=new fP(this.manager);return r.setPath(this.decoderPath),r.setResponseType(i),r.setWithCredentials(this.withCredentials),new Promise((n,a)=>{r.load(t,n,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let t=typeof WebAssembly!="object"||this.decoderConfig.type==="js",i=[];return t?i.push(this._loadLibrary("draco_decoder.js","text")):(i.push(this._loadLibrary("draco_wasm_wrapper.js","text")),i.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(i).then(r=>{let n=r[0];t||(this.decoderConfig.wasmBinary=r[1]);let a=n4e.toString(),s=["/* draco decoder */",n,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(` 12022`);this.workerSourceURL=URL.createObjectURL(new Blob([s]))}),this.decoderPending}_getWorker(t,i){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){let n=new Worker(this.workerSourceURL);n._callbacks={},n._taskCosts={},n._taskLoad=0,n.postMessage({type:"init",decoderConfig:this.decoderConfig}),n.onmessage=function(a){let s=a.data;switch(s.type){case"decode":n._callbacks[s.id].resolve(s);break;case"error":n._callbacks[s.id].reject(s);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+s.type+'"')}},this.workerPool.push(n)}else this.workerPool.sort(function(n,a){return n._taskLoad>a._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[t]=i,r._taskLoad+=i,r})}_releaseTask(t,i){t._taskLoad-=t._taskCosts[i],delete t._callbacks[i],delete t._taskCosts[i]}debug(){console.log("Task load: ",this.workerPool.map(t=>t._taskLoad))}dispose(){for(let t=0;t<this.workerPool.length;++t)this.workerPool[t].terminate();return this.workerPool.length=0,this.workerSourceURL!==""&&URL.revokeObjectURL(this.workerSourceURL),this}};function n4e(){let t,i;onmessage=function(o){let l=o.data;switch(l.type){case"init":t=l.decoderConfig,i=new Promise(function(u){t.onModuleLoaded=function(d){u({draco:d})},DracoDecoderModule(t)});break;case"decode":let c=l.buffer,h=l.taskConfig;i.then(u=>{let d=u.draco,A=new d.Decoder,f=new d.DecoderBuffer;f.Init(new Int8Array(c),c.byteLength);try{let m=r(d,A,f,h),g=m.attributes.map(p=>p.array.buffer);m.index&&g.push(m.index.array.buffer),self.postMessage({type:"decode",id:l.id,geometry:m},g)}catch(m){console.error(m),self.postMessage({type:"error",id:l.id,error:m.message})}finally{d.destroy(f),d.destroy(A)}});break}};function r(o,l,c,h){let u=h.attributeIDs,d=h.attributeTypes,A,f,m=l.GetEncodedGeometryType(c);if(m===o.TRIANGULAR_MESH)A=new o.Mesh,f=l.DecodeBufferToMesh(c,A);else if(m===o.POINT_CLOUD)A=new o.PointCloud,f=l.DecodeBufferToPointCloud(c,A);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!f.ok()||A.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+f.error_msg());let g={index:null,attributes:[]};for(let p in u){let v=self[d[p]],_,y;if(h.useUniqueIDs)y=u[p],_=l.GetAttributeByUniqueId(A,y);else{if(y=l.GetAttributeId(A,o[u[p]]),y===-1)continue;_=l.GetAttribute(A,y)}g.attributes.push(a(o,l,A,p,v,_))}return m===o.TRIANGULAR_MESH&&(g.index=n(o,l,A)),o.destroy(A),g}function n(o,l,c){let h=c.num_faces()*3,u=h*4,d=o._malloc(u);l.GetTrianglesUInt32Array(c,u,d);let A=new Uint32Array(o.HEAPF32.buffer,d,h).slice();return o._free(d),{array:A,itemSize:1}}function a(o,l,c,h,u,d){let A=d.num_components(),f=c.num_points()*A,m=f*u.BYTES_PER_ELEMENT,g=s(o,u),p=o._malloc(m);l.GetAttributeDataArrayForAllPoints(c,d,g,m,p);let v=new u(o.HEAPF32.buffer,p,f).slice();return o._free(p),{name:h,array:v,itemSize:A}}function s(o,l){switch(l){case Float32Array:return o.DT_FLOAT32;case Int8Array:return o.DT_INT8;case Int16Array:return o.DT_INT16;case Int32Array:return o.DT_INT32;case Uint8Array:return o.DT_UINT8;case Uint16Array:return o.DT_UINT16;case Uint32Array:return o.DT_UINT32}}}var cA;function a4e(){return cA||(cA=new r4e,cA.setDecoderPath("https://www.gstatic.
12022com/draco/versioned/decoders/1.5.2/").preload()),cA.decoderPending}async function s4e(t){if(cA){let i={attributeIDs:cA.defaultAttributeIDs,attributeTypes:cA.defaultAttributeTypes,useUniqueIDs:!1},r;try{r=await cA.decodeGeometry(new Int8Array(t).buffer,i)}catch(n){console.error(n)}if(r)return{index:r.index?{array:r.index.array}:void 0,attributes:Object.entries(r.attributes).map(([n,a])=>({name:n,itemSize:a.itemSize,array:a.array}))}}return null}async function o4e(t,i){let[r,n]=nK(RP.deserialize(new Uint8Array(t)));return RK(r),i&&i(r),n.result().data}function l4e(t){let i=[];return t.scene.objects.traverse((r,n)=>{n.type==="Mesh"&&n.geometry.type==="NonParametricGeometry"&&n.geometry.data.draco!==void 0&&i.push(n)}),i}async function c4e(t){for(let i of t){let r=await s4e(i.geometry.data.draco);if(r){let n=i.geometry.data;r.index&&(n.index={array:r.index.array,itemSize:1,normalized:!1,type:"Uint32Array"});let a={};r.attributes.forEach(({name:s,array:o,itemSize:l})=>{a[s]={array:o,itemSize:l,type:"Float32Array",normalized:!1}}),n.attributes=a,n.draco=void 0}}}var h4e=class{constructor(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0],this._delay=500,this._distance=2,this._onMouseDown=t=>{let i=[t.clientX,t.clientY],r=new Date().getTime();if(this._clickCount>0){let n=i[0]-this._lastPosition[0],a=i[1]-this._lastPosition[1];Math.sqrt(n*n+a*a)>this._distance&&(this._clickCount=0)}this._lastPosition=i,this._clickCount=r-this._lastTime>this._delay?1:this._clickCount+1,this._lastTime=r},this._onMouseUp=t=>{}}start(t,i=500,r=2){this._target&&this.stop(),this.reset(),this._delay=i,this._distance=r,this._target=t,this._target.addEventListener("pointerdown",this._onMouseDown,!1),this._target.addEventListener("pointerup",this._onMouseUp,!1)}stop(){this._target&&(this._target.removeEventListener("pointerdown",this._onMouseDown,!1),this._target.removeEventListener("pointerup",this._onMouseUp,!1),this._target=void 0)}get clickCount(){return this._clickCount}reset(){this._clickCount=0,this._lastTime=0,this._lastPosition=[0,0]}},u4e=class{constructor(t,i,r,n,a,s,o,l){this.eventId=t,this.id=i,this.data=r,this.dataEvent=n,this.object=a,this.stage=!1,this.actions=xa(n,r.actions,s,o,l,a)}disconnect(){ba(this.actions)}
12022dispatchIn(){this.actions.Audio.forEach(t=>t.dispatchBasic()),this.actions.Particles.forEach(t=>t.dispatchBasic()),this.actions.Video.forEach(t=>t.dispatchBasic()),this.actions.Create.forEach(t=>t.dispatch()),this.actions.Destroy.forEach(t=>t.dispatch()),this.actions.Reset.forEach(t=>t.dispatch()),this.actions.Link.forEach(t=>t.dispatch()),this.actions.Transition.forEach(t=>{t.object.currentTransitionEvent!==this&&(t.object.currentTransitionEvent=this,t.init())}),this.actions.Transition.forEach(t=>t.toggle()),this.actions.Animation.forEach(t=>t.play()),this.actions.SwitchCamera.forEach(t=>t.play()),this.actions.SceneTransition.forEach(t=>t.dispatch()),this.actions.SetVariable.forEach(t=>t.checkConditions()),this.actions.SetVariable.forEach(t=>t.dispatch()),this.actions.DynamicVariablePlay.forEach(t=>t.dispatch()),this.actions.ClearLocalStorage.forEach(t=>t.dispatch()),this.actions.UserAPI.forEach(t=>t.dispatch())}dispatchOut(){this.actions.Transition.forEach(t=>{t.toggle()})}},d4e=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.breakpoints=[],this.resize=(r,n)=>{this.breakpoints.forEach(a=>{let s=PP.deviceToSize(a.data.size),o=a.dataEvent.orientation==="horizontal"?r:n,l;switch(a.data.operator){case"<":l=o<s[0];break;case">":l=o>s[0];break;case"<>":l=o>s[0]&&o<s[1];break}a.stage!==l&&(a.stage=l,a.stage?a.dispatchIn():a.dispatchOut())})},this.onResizeObserver=new ResizeObserver(r=>{for(let n of r){let{width:a,height:s}=n.contentRect;this.resize(a,s)}})}connect(){let{page:t,sharedAssets:i,domElement:r}=this.eventContext;this.onResizeObserver.observe(r);let n=a=>{var s;if(!(!a.visible||!((s=a.data)!=null&&s.events.length)))for(let{data:o,id:l}of a.data.events)o.disabled||o.type==="Resize"&&o.breakpoints.forEach(({data:c,id:h})=>{try{let u=new u4e(l,h,c,o,a,t,i,this.eventManager);this.breakpoints.push(u)}catch{}})};t.traverseEntity(a=>{var s;(a instanceof ls||a instanceof fa)&&((s=a.frame)==null||s.traverse(o=>{n(o)})),n(a)})}disconnect(){this.onResizeObserver.disconnect(),this.breakpoints.forEach(t=>{t.disconnect()}),this.breakpoints=[]}},A4e=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.userAPIs={},this.events=[],this.onSuccess=({userAPIId:r})=>{this.events.forEach(n=>{n.data.userAPIId===r&&n.dispatchSuccess()})},this.onError=({userAPIId:r})=>{this.events.forEach(n=>{n.data.userAPIId===r&&n.dispatchError()})},this.userAPIs=t.sharedAssets.getUserAPIs()}connect(){this.eventContext.page.traverseEntity(t=>{var i;(i=t.data)==null||i.events.filter(r=>r.data.type==="API"&&!r.data.disabled).forEach(r=>{this.events.push(new f4e(r.id,r.data,t,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),Object.entries(this.userAPIs).forEach(([t,i])=>{i.on("success",this.onSuccess),i.on("error",this.onError),i.autostart&&i.callUserAPI(this.eventContext.sharedAssets)})}disconnect(){Object.entries(this.userAPIs).forEach(([t,i])=>{i.off("success",this.onSuccess),i.off("error",this.onError)})}},f4e=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.successActions=xa(i,i.successActions,n,a,s,r),this.errorActions=xa(i,i.errorActions,n,a,s,r)}dispatchSuccess(){this.dispatchActions(this.successActions)}dispatchError(){this.dispatchActions(this.errorActions)}
12022dispatchActions(t){t.Audio.forEach(i=>i.dispatchConditional()),t.Particles.forEach(i=>i.dispatchConditional()),t.Video.forEach(i=>i.dispatchConditional()),t.Create.forEach(i=>i.dispatch()),t.Destroy.forEach(i=>i.dispatch()),t.Reset.forEach(i=>i.dispatch()),t.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this),i.init()}),t.Transition.forEach(i=>i.play()),t.Animation.forEach(i=>i.play()),t.SwitchCamera.forEach(i=>i.play()),t.SceneTransition.forEach(i=>i.dispatch()),t.SetVariable.forEach(i=>i.checkConditions()),t.SetVariable.forEach(i=>i.dispatch()),t.DynamicVariablePlay.forEach(i=>i.dispatch()),t.ClearLocalStorage.forEach(i=>i.dispatch()),t.UserAPI.forEach(i=>i.dispatch())}},p4e=class extends vo{constructor(t,i){super(t),this.eventManager=i,this.userWebhooks={},this.events=[],this.onMessage=({userWebhookId:r})=>{this.events.forEach(n=>{n.data.userWebhookId===r&&n.dispatch()})},this.userWebhooks=t.sharedAssets.getUserWebhooks()}connect(){this.eventContext.page.traverseEntity(t=>{var i;(i=t.data)==null||i.events.filter(r=>r.data.type==="WEBHOOK"&&!r.data.disabled).forEach(r=>{this.events.push(new m4e(r.id,r.data,t,this.eventContext.page,this.eventContext.sharedAssets,this.eventManager))})}),Object.entries(this.userWebhooks).forEach(([t,i])=>{i.connect(),i.on("message",this.onMessage)})}disconnect(){Object.entries(this.userWebhooks).forEach(([t,i])=>{i.off("message",this.onMessage),i.disconnect()})}},m4e=class{constructor(t,i,r,n,a,s){this.id=t,this.data=i,this.object=r,this.actions=xa(i,i.actions,n,a,s,r)}dispatch(){let t=this.actions;
12022t.Audio.forEach(i=>i.dispatchConditional()),t.Particles.forEach(i=>i.dispatchConditional()),t.Video.forEach(i=>i.dispatchConditional()),t.Create.forEach(i=>i.dispatch()),t.Destroy.forEach(i=>i.dispatch()),t.Reset.forEach(i=>i.dispatch()),t.Transition.forEach(i=>{i.object.currentTransitionEvent!==this&&(i.object.currentTransitionEvent=this),i.init()}),t.Transition.forEach(i=>i.play()),t.Animation.forEach(i=>i.play()),t.SwitchCamera.forEach(i=>i.play()),t.SceneTransition.forEach(i=>i.dispatch()),t.SetVariable.forEach(i=>i.checkConditions()),t.SetVariable.forEach(i=>i.dispatch()),t.DynamicVariablePlay.forEach(i=>i.dispatch()),t.ClearLocalStorage.forEach(i=>i.dispatch()),t.UserAPI.forEach(i=>i.dispatch())}};function g4e(){let t=document.createElement("textarea");return t.style.position="fixed",t.style.top="200px",t.style.left="400px",t.style.zIndex="-1",t.style.border="1px solid rgba(255,0,0,0.5)",t.style.width="10px",t.style.height="500px",t.style.color="white",t.style.opacity="0.5",t.style.background="transparent",t.style.display="none",t.style.margin="0px",t.style.padding="0px",t.style.boxSizing="content-box",t.style.pointerEvents="none",t}var v4e=new O(0,0,1),m8=new O,g8=new O,v8=new Nn,_4e=class{constructor(t,i,r,n,a){this.containerScene=t,this.raycaster=i,this.sharedAssets=r,this.requestRender=n,this.onExit=a,this.htmlInput=null,this.virtualInput=null,this.helper=new iq,this.doubleClickHandler=new h4e,this.isDragging=!1,this.plane=new eo,this.caretInterval=0,this.planeIntersection=new O,this.projected=new Me,this._lastIndex=0,this._isFirstDragMove=!1,this.selectionOnDragStart=0,this.onTextMaterialChanged=()=>{var o;let s=(o=this.virtualInput)==null?void 0:o.data;if(this.virtualInput!==void 0&&s){let l=s.material,c=typeof l=="string"?this.sharedAssets.data.materials[l]:l,h=POe(c,this.sharedAssets);this.helper.setCaretColor(h)}},this.stopAnimateTextCursor=()=>{clearInterval(this.caretInterval),this.helper&&(this.helper.caretMesh.visible=!1)},this.startAnimateTextCursor=()=>{this.stopAnimateTextCursor(),this.helper&&(this.helper.caretMesh.visible=!0,this.caretInterval=setInterval(()=>{this.helper&&(this.helper.caretMesh.visible=!this.helper.caretMesh.visible),this.requestRender()},600))},this.handleCaretUpdate=s=>{if(!this.htmlInput||!this.virtualInput)return;let o=this.helper,l=(s==null?void 0:s.key)==="ArrowLeft"||(s==null?void 0:s.key)==="ArrowRight",c=(s==null?void 0:s.key)==="ArrowUp"||(s==null?void 0:s.key)==="ArrowDown";this.htmlInput.selectionStart===this.htmlInput.selectionEnd?(o.setCaretPosition(this.htmlInput.selectionStart,{horizontalKeyMove:l,verticalKeyMove:c}),this.startAnimateTextCursor()):o.setSelection(this.htmlInput.selectionStart,this.htmlInput.selectionEnd),this.requestRender()},this.containerScene.add(this.helper)}createInput(){return this.htmlInput=g4e(),this.htmlInput}connect(){}disconnect(){var t;this.stopAnimateTextCursor(),this.helper.hide(),(t=this.htmlInput)==null||t.remove(),this.doubleClickHandler.stop()}handleMouseDown(){var s;if(!this.htmlInput||!this.virtualInput)return!0;this.getPointOnPlane();let t=this.doubleClickHandler.clickCount,{index:i,lineIndex:r,characterIndex:n}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,t>1?"inside":"previous")??{index:0,lineIndex:0,characterIndex:0};((s=this.virtualInput)==null?void 0:s.wrappedText[r][Math.max(0,n-1)])===` 12023`&&(i--,n--),this._lastIndex=i,this._isFirstDragMove=!0;let a=this.checkClickedObject();if(t===1){if(a===null)return this.onExit(this.virtualInput),!0;this.selectionOnDragStart=i,this.isDragging=!0,this.setInputSelection(i)}else a===this.virtualInput&&(t===2?this.selectClosestWord(r,n):t>2&&(this.setInputSelection(0,this.htmlInput.value.length),this.doubleClickHandler.reset()))}handleMouseUp(){this.applyRangeToTextInput(),this.isDragging=!1,this._isFirstDragMove=!1}handleMouseMove(){!this.virtualInput||(this._isFirstDragMove&&this.doubleClickHandler.clickCount>1&&(this.selectionOnDragStart=this._lastIndex,this.isDragging=!0,this.setInputSelection(this._lastIndex)),this._isFirstDragMove=!1,this.getPointOnPlane(),this.applyRangeToTextInput())}focus(t){var i;if(this.virtualInput=t,this.updateTextInputStyles(),this.htmlInput)if(t){let r=(i=this.data)==null?void 0:i.geometry.text;this.htmlInput.value=typeof r=="string"?"":(r==null?void 0:r.textValue.toString())??""}else this.htmlInput.value=""}blur(){}get data(){let{virtualInput:t}=this;if(t)return t.dataPatched}
12023applyRangeToTextInput(){var a;if(!this.isDragging||!this.virtualInput||!this.htmlInput)return;let t=this.selectionOnDragStart,{index:i,lineIndex:r,characterIndex:n}=this.helper.getSelectionFromPosition(this.projected.x,this.projected.y,this.doubleClickHandler.clickCount>2?"inside":"previous")??{index:0};r!==void 0&&n!==void 0&&((a=this.virtualInput)==null?void 0:a.wrappedText[r][n-1])===` 12024`&&i--,this.htmlInput.setSelectionRange(Math.min(t,i),Math.max(t,i))}checkClickedObject(){if(this.virtualInput){let t=this.raycaster.intersectObject(this.virtualInput,!1);if(t.length>0){let i=t[0];if(i.object instanceof EU)return i.object}}return null}selectClosestWord(t,i){if(!this.virtualInput)return;let r=this.virtualInput.wrappedText,n=r[t],a=i+1,s=i;n[i]!==" "&&(a=this.findNextCharOccurence(n,i,"forward"," "),s=this.findNextCharOccurence(n,i,"backward"," "),s>0&&s++,a>=n.length-1&&t===r.length-1&&a++);let o=this.helper,l=o.getGlobalIndexFromLineAndCharIndexes(r,t,s),c=o.getGlobalIndexFromLineAndCharIndexes(r,t,a);this.setInputSelection(l,c)}findNextCharOccurence(t,i,r,n=" "){let a=Math.max(0,t.length-1),s=r==="forward"?a:0,o=r==="forward"?1:-1,l=Math.max(Math.min(i,a),0);for(;l!==s;)if(l+=o,t.charAt(l)===n)return l;return s}getPointOnPlane(){var i;let t=(i=this.virtualInput)==null?void 0:i.data;if(!(!this.virtualInput||!t)&&this.raycaster.ray.intersectsPlane(this.plane)){this.planeIntersection===null&&(this.planeIntersection=new O);let r=this.raycaster.ray.intersectPlane(this.plane,this.planeIntersection);if(r){this.planeIntersection.copy(this.virtualInput.worldToLocal(r));let n=typeof t.geometry.width=="number"?t.geometry.width:1,a=typeof t.geometry.height=="number"?t.geometry.height:1;this.projected.set(r.x+n*.5,r.y-a*.5)}}}updatePlane(){var i;let t=(i=this.virtualInput)==null?void 0:i.data;this.virtualInput&&t&&(v8.getNormalMatrix(this.virtualInput.matrixWorld),m8.copy(v4e).applyMatrix3(v8).normalize(),this.virtualInput.localToWorld(g8.set(0,0,t.geometry.depth)),this.plane.setFromNormalAndCoplanarPoint(m8,g8))}setInputSelection(t,i=t){var r;(r=this.htmlInput)==null||r.setSelectionRange(t,i),setTimeout(()=>{var n;(n=this.htmlInput)==null||n.focus()})}updateTextInputStyles(){var i;let t=(i=this.virtualInput)==null?void 0:i.data;this.virtualInput&&t&&this.htmlInput&&(this.htmlInput.style.fontSize=t.geometry.fontSize+"px",this.htmlInput.style.letterSpacing=t.geometry.letterSpacing*t.geometry.fontSize+"px",this.htmlInput.style.lineHeight=t.geometry.fontSize*t.geometry.lineHeight+"px",this.htmlInput.style.width=t.geometry.width+"px",this.htmlInput.style.height=t.geometry.height+"px",this.htmlInput.style.textAlign=y4e(t.geometry.horizontalAlign))}};function y4e(t){return t===4?"justify":t===2?"right":t===3?"center":"left"}var dZ=(t,i)=>{if(typeof t=="string"){let r=i.data(t);if(r)return dZ(r.value,i)}return ja.getDisplayedValue(t)};function _8(t,i){let r=t.text,n="";if(typeof r=="string"){let a=i.variables.data(n);a&&(n=dZ(a.value,i.variables))}else n=r.textValue.toString();return n}var E4e=class extends vo{constructor(t,i){super(t),this.eventManager=i,this._textInputs=[],this.sceneHelpers=new ch,this.helper=new iq,this._onMouseDownFocusIn=r=>{if(jt.length>1)return;this.eventContext.updateRaycaster(r);let n=null;if(this.eventContext.raycaster){for(let a of this._textInputs)if(this.eventContext.raycaster.intersectObject(a,!0).length>0){n=a;break}}this.focusOnTextInput(n),this._onCaretUpdate(),this._onMouseUp(),this.textInputManager.doubleClickHandler.start(this.eventContext.domElement),this.textInputManager.doubleClickHandler._onMouseDown(r),this._onMouseDown(r)},this.onExit=()=>{let{virtualInput:r}=this.textInputManager;if(r===null)return;let n=this.textInputManager.htmlInput;this.helper.hide(),n==null||n.setSelectionRange(n.value.length,n.value.length),this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!0);let{domElement:a}=this.eventContext;a.removeEventListener("pointerdown",this._onMouseDown,!1),a.removeEventListener("pointerup",this._onMouseUp,!1),a.removeEventListener("pointermove",this._onMouseMove,!1),window.removeEventListener("keydown",this._onKeyPress),this.textInputManager.doubleClickHandler.reset(),a.addEventListener("pointerdown",this._onMouseDownFocusIn),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers()},this._onMouseDown=r=>{this.eventContext.updateRaycaster(r),this.textInputManager.handleMouseDown(),this.textInputManager.virtualInput&&this.eventContext.raycaster.intersectObject(this.textInputManager.virtualInput,!0).length>0&&this.eventManager.controlsManager.orbitControls&&(this.eventManager.controlsManager.orbitControls.enabled=!1)},this._onMouseUp=()=>{this.textInputManager.handleMouseUp(),this.eventManager.controlsManager.orbitControls&&!this.eventManager.controlsManager.orbitControls.enabled&&(this.eventManager.controlsManager.orbitControls.enabled=!0)},this._onMouseMove=r=>{this.eventContext.updateRaycaster(r),this.textInputManager.handleMouseMove()},this._onTextEdit=r=>{let{htmlInput:n,virtualInput:a,helper:s}=this.textInputManager;if(!n||!a)return;let o=n.value;a.textGeometry.setText(o).then(()=>{this.eventContext.requestRender()});let l=a.data;s.update();let c=l.geometry.text;if(typeof c=="string"){let h=c;
12024this.eventContext.sharedAssets.updateVariable(h,{textValue:o})}this.textInputManager.updateTextInputStyles(),this._onCaretUpdate()},this._onCaretUpdate=r=>{this.textInputManager.handleCaretUpdate(r)},this._onKeyPress=r=>{r.key==="Escape"&&this.onExit()},this.textInputManager=new _4e(this.sceneHelpers,t.raycaster,t.sharedAssets,t.requestRender,this.onExit)}connect(){let t=[];if(this.eventContext.scene.traverseEntity(n=>{n instanceof EU&&t.push(n)}),this._textInputs=t,t.length===0)return;let{domElement:i}=this.eventContext;i.addEventListener("pointerdown",this._onMouseDownFocusIn),this.textInputManager.connect();let r=this.textInputManager.createInput();document.body.appendChild(r),r.style.display="none",r.addEventListener("keyup",this._onCaretUpdate),r.addEventListener("keydown",this._onCaretUpdate),r.addEventListener("beforeinput",this._onCaretUpdate),r.addEventListener("paste",this._onCaretUpdate),r.addEventListener("cut",this._onCaretUpdate),r.addEventListener("select",this._onCaretUpdate),r.addEventListener("selectstart",this._onCaretUpdate)}disconnect(){let t=this.textInputManager.htmlInput,{domElement:i}=this.eventContext;i.removeEventListener("pointerdown",this._onMouseDownFocusIn),t==null||t.removeEventListener("keyup",this._onCaretUpdate),t==null||t.removeEventListener("keydown",this._onCaretUpdate),t==null||t.removeEventListener("beforeinput",this._onCaretUpdate),t==null||t.removeEventListener("paste",this._onCaretUpdate),t==null||t.removeEventListener("cut",this._onCaretUpdate),t==null||t.removeEventListener("select",this._onCaretUpdate),t==null||t.removeEventListener("selectstart",this._onCaretUpdate),this._textInputs.forEach(r=>{let n=_8(r.data.geometry,this.eventContext.sharedAssets.data);r.textGeometry.setText(n)}),i.removeEventListener("pointerdown",this._onMouseDown,!1),i.removeEventListener("pointerup",this._onMouseUp,!1),i.removeEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress),this.eventContext.renderer.sceneHelpersOnTop=void 0,this.eventContext.renderer.pipeline.disableHelpers(),this.textInputManager.disconnect()}focusOnTextInput(t){this.textInputManager.focus(t),this.textInputManager.onTextMaterialChanged();let i=this.textInputManager.htmlInput;if(!i||t===null)return;this.textInputManager.updateTextInputStyles(),this.eventContext.renderer.sceneHelpersOnTop=this.sceneHelpers,this.eventContext.renderer.pipeline.enableHelpers(),this.textInputManager.isDragging=!1;let r=_8(t.textGeometry.userData.parameters,this.eventContext.sharedAssets.data);i.value=r,i.setSelectionRange(0,0),this.textInputManager.helper.show(t),i.style.display="block",i.addEventListener("input",this._onTextEdit),this.textInputManager.updatePlane();let{domElement:n}=this.eventContext;n.removeEventListener("pointerdown",this._onMouseDownFocusIn),n.addEventListener("pointerdown",this._onMouseDown,!1),n.addEventListener("pointerup",this._onMouseUp,!1),n.addEventListener("pointermove",this._onMouseMove,!1),window.addEventListener("keydown",this._onKeyPress)}},w4e=class{constructor(t,i,r,n,a){this.publish=t,this.controlsManager=i,this.animationControls=r,this.eventContext=n,this.sharedVariables=a,this.isEnabled=!1,this.activateCount=0,this.needsMouse=!1,this.needsRaycast=!1,this.onTouchMovePreventScroll=s=>{let o=window.parent!==window,l=document.documentElement.scrollHeight>document.documentElement.clientHeight||document.documentElement.scrollWidth>document.documentElement.clientWidth;(s.touches.length>1||this.preventTouchScroll||o===!1&&l===!1)&&s.preventDefault()},this.onMouseWheelPreventScroll=s=>{this.preventScroll&&s.preventDefault()},this.onMouseMove=s=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(s),pressed:s.buttons>0}},this.onMouseDown=s=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(s),pressed:!0}},this.onMouseUp=s=>{this.eventContext.sharedAssets.mouseProperty={...this.getMousePosition(s),pressed:!1}},this.getMousePosition=s=>{var h;let{domRect:o}=this.eventContext,{pageX:l,pageY:c}=((h=s.touches)==null?void 0:h.length)>0?s.touches[0]:s;return{x:l-(o.left+window.scrollX),y:c-(o.top+window.scrollY)}},this.stopRaycast=t.stopRaycast,this.preventScroll=t.preventScroll,this.preventTouchScroll=t.preventTouchScroll,this.hideCursor=t.hideCursor,this.requestRender=n.requestRender}activate(){if(this.isEnabled)return;this.isEnabled=!0,this.initializeActionsDependentStates(),this.needsMouse&&(this.eventContext.domElement.addEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.addEventListener("pointerdown",this.onMouseDown)),this.handlers={Spline:new $3e(this.eventContext),VariableChange:new IFe(this.eventContext,this.sharedVariables,this,this.needsMouse,this.needsRaycast),API:new A4e(this.eventContext,this),WEBHOOK:new p4e(this.eventContext,this),Conditional:new sFe(this.eventContext,this),Start:new RFe(this.eventContext,this),Basic:new tFe(this.eventContext,this,this.needsRaycast),MouseHover:new SFe(this.eventContext,this),Scroll:ne
12024w MFe(this.eventContext,this),Follow:new mFe(this.eventContext,this),DragDrop:new uFe(this.eventContext,this),LookAt:new EFe(this.eventContext),Resize:new d4e(this.eventContext,this),Textfields:new E4e(this.eventContext,this)};let{page:t,domElement:i}=this.eventContext;this.hideCursor&&(i.style.cursor="none"),t.traverseEntity(r=>{r.addEventListener("requestRender",this.requestRender)}),Object.values(this.handlers).forEach(r=>r.connect()),i.addEventListener("wheel",this.onMouseWheelPreventScroll),i.addEventListener("touchmove",this.onTouchMovePreventScroll),this.activateCount++}deactivate(){var r;if(!this.isEnabled)return;this.isEnabled=!1,this.eventContext.domElement.removeEventListener("pointermove",this.onMouseMove),this.eventContext.domElement.removeEventListener("pointerdown",this.onMouseDown),this.eventContext.domElement.removeEventListener("pointerup",this.onMouseUp),this.eventContext.sharedAssets.mouseProperty=null,this.eventContext.sharedAssets.raycastProperty=null;let{page:t,domElement:i}=this.eventContext;i.style.cursor="",Object.values(this.handlers).forEach(n=>n.disconnect()),(r=this.controlsManager.gameControl)==null||r.disposeActions(),this.controlsManager.disconnectEvents(),t.traverseEntity(n=>{n.removeEventListener("requestRender",this.requestRender),n.destroyedInAction=!1}),i.removeEventListener("touchmove",this.onTouchMovePreventScroll),i.removeEventListener("wheel",this.onMouseWheelPreventScroll),this.animationControls.onExitPlayMode()}get isPaused(){return this.isEnabled}pause(){this.deactivate()}resume(){this.activate()}reset(){this.deactivate(),this.activate(),this.controlsManager.page.updateMatrixWorld(!0),this.controlsManager.rebuildBVH()}updateUseWindowEvents(t){let i=this.isEnabled;i&&this.deactivate(),this.eventContext.useWindowEvents=t,i&&this.activate()}initializeActionsDependentStates(){let t=this.eventContext.sharedAssets;t.resetDynamicVariablePlayState();let i=r=>{if(r.data.type==="Conditional"&&(r.data.ifActions.forEach(i),r.data.elseActions.forEach(i)),r.data.type==="Conditional"||r.data.type==="SetVariable")for(let n of r.data.type==="Conditional"?r.data.condition:r.data.expression)"id"in n&&Array.isArray(n.id)&&(n.id[0]==="mouse"&&(this.needsMouse=!0),n.id[0]==="raycast"&&(this.needsRaycast=!0));r.data.type==="DynamicVariablePlay"&&r.data.variableId!==""&&(r.data.mode==="Play"||r.data.mode==="PlayPause"||r.data.mode==="Toggle")&&t.setDynamicVariablePlayState(r.data.variableId,"Stopped")};this.eventContext.page.traverseEntity(r=>{var n;if((n=r.data)!=null&&n.events.length)for(let a of r.data.events)if(a.data.type==="VariableChange"&&(a.data.variableId==="mouseProperty"&&(this.needsMouse=!0),a.data.variableId==="raycastProperty"&&(this.needsRaycast=!0)),a.data.type==="Conditional")for(let s of["inActions","outActions"])a.data[s].forEach(i);else if(a.data.type==="DragDrop")for(let s of["drag","drop"])a.data.dragDropActions[s].forEach(i);else if(a.data.type==="GameControl")for(let s of["idle","move","jump","run"])a.data.gameActions[s].forEach(i);else if(a.data.type==="Resize")for(let s of a.data.breakpoints)s.data.actions.forEach(i);else a.data.type==="LookAt"||a.data.type==="API"||a.data.actions.forEach(i)})}},b4e=class{constructor(t,i,r,n,a){this._aspect=1,this.enableResponsive=!1,this._renderer=t,this._camera=i,this._frameSize=new Me().copy(r),this._editorSize=new Me().copy(n),this._aspect=i.aspect,this._fov=a??i.fov}set frameSize(t){this._frameSize.copy(t)}updateRenderer(){!this._renderer||this._renderer.setSize(this._frameSize.x,this._frameSize.y)}updateViewport(){if(!this._renderer||!this._camera||this._camera.cameraType!=="PerspectiveCamera")return;let t=this._frameSize.x,i=this._frameSize.y,r=this._editorSize.y;this._aspect=t/i,i<=r&&(this._camera.zoom*=r/i),this._renderer.setViewport(0,0,t,i)}updateCamera(t=!0){if(this._camera)if(this._camera.cameraType==="PerspectiveCamera"){let i=this._frameSize.y,r=this._editorSize.y,n=this._fov;if(t&&i>r){let a=S4e(i,1080,2160,1,15)/100;n*=i/r,n*=1-a}this._camera.aspect=this._aspect,this._camera.fov=n,this._camera.updateProjectionMatrix()}else this._camera.setViewplaneSize(this._frameSize.x,this._frameSize.y,this.enableResponsive)}setCamera(t){this._camera=t,this._aspect=t.aspect,this._fov=t.fov}revert(){let t=window.innerWidth,i=window.innerHeight;this._renderer&&(this._renderer.setViewport(0,0,t,i),this._renderer.setSize(t,i)),this._camera&&(this._camera.aspect=t/i,this._camera.fov=this._fov,this._camera.setViewplaneSize(t,i,this.enableResponsive),this._camera.updateProjectionMatrix())}};function S4e(t,i,r,n,a){return(t-i)/(r-i)*(a-n)+n}var C4e=class{get sharedAssets(){return this.shared}constructor(t,i={},r=!0){this.shared=new hU(t.shared,i,!0,r),this.scene=new SU(t.scene,this.sharedAssets),this.shared.setEntityOpContext({scene:this.scene,shared:this.shared})}reset(t,i){this.scene.clearScene(),this.sharedAssets.reset(t.shared),this.scene.resetAfterClear(t.sce
12024ne,this.sharedAssets)}resetPersonalCameraFromDocumentData(){for(let t of this.scene.children)t instanceof fa&&!t.uiScene&&t.personalCamera.updateState(t.data.camera,{scene:this.scene,shared:this.shared})}dispose(){this.scene.dispose(),this.shared.dispose()}gc(){this.shared.geometryCache.startGc(),this.shared.geometryCache2.startGc(),this.scene.traverseEntity(t=>{t instanceof ds&&t.markGeometryAsReachable(this.shared)}),this.shared.geometryCache.endGc(),this.shared.geometryCache2.endGc()}},T4e=class{constructor({x:t=10,y:i=10}){this._startTime=0;let r=document.getElementById("spe-perfs");r?this.element=r:(this.element=document.createElement("div"),document.body.appendChild(this.element),this.element.style.position="absolute",this.element.style.zIndex="10000",this.element.style.fontFamily="monospace",this.element.style.background="black",this.element.style.color="white",this.element.style.padding="10px",this.element.style.opacity="0.5",this.element.style.fontSize="11px",this.element.setAttribute("id","spe-perfs")),this.element.style.left=`${t}px`,this.element.style.top=`${i}px`}dispose(){var t;(t=this.element.parentElement)==null||t.removeChild(this.element)}start(){this._startTime=performance.now()}end(){let t=performance.now()-this._startTime;this.element.innerHTML=t.toFixed(3)+" ms"}};function M4e(t){let i;if(t.index)for(let r=0;r<t.index.array.length;r+=3)i=t.index.array[r],t.index.array[r]=t.index.array[r+2],t.index.array[r+2]=i}function ry(t){return t instanceof Yy?"SubdivObject":t.geometry.type==="NonParametricGeometry"?"NonParametric":"Mesh"}function x4e(t,i){let r={};return t.traverseEntity(n=>{var c;if(!n.visible||!(n instanceof zs)||n.type!=="Mesh"||Array.isArray(n.material)||n.states&&Object.keys(n.states).length)return;let a=n.parent;for(;a;){if(a instanceof zs&&n.states&&Object.keys(n.states).length)return;a=a.parent}let s=n.material.uuid,o=i.shared.materials[s];if(o){if(!Wa.isMergable(o))return}else{let h=(c=i.scene.objects.get(n.uuid))==null?void 0:c.data;if(h&&"material"in h&&typeof h.material!="string"){if(!Wa.isMergable(h.material))return;s=Wa.getHash(h.material)}}r[s]||(r[s]={});let l=r[s][ry(n)];if(l){if(l.push(n),n.cloner)for(let h of n.cloner.children)l.push(h)}else if(r[s][ry(n)]=[n],n.cloner)for(let h of n.cloner.children)r[s][ry(n)].push(h)}),r}function R4e(t){let i=0;return Object.values(t).forEach(r=>{Object.values(r).forEach(n=>{let a=n.length;a>i&&(i=a)})}),i}function B4e(t,i){let r=x4e(i,t),n=R4e(r),a=new Array(n),s=0,o=new Array(n),l=0,c=new Array(n),h=0,u=new Array(n),d=0;for(let[A,f]of Object.entries(r))for(let m of Object.values(f)){if(l=0,h=0,m.forEach(p=>{p instanceof zs&&(o[l++]=p.geometry.clone(),c[h++]=p)}),h<2)continue;for(let p=0;p<h;p++)c[p].updateWorldMatrix(!0,!1),o[p].applyMatrix4(c[p].matrixWorld),c[p].matrixWorld.determinant()<0&&M4e(o[p]);let g=Nf(o.slice(0,l),!1);if(g){let p;switch(A){case"SubdivObject":{console.warn("Turning subdiv object into mesh"),p=new Zr(g,c[0].material);break}default:{p=new Zr(g,c[0].material);break}}p.castShadow=c[0].castShadow,p.receiveShadow=c[0].receiveShadow,i.add(p);let v=_=>{d=0;for(let y of _)y.children&&v(y.children),y instanceof zs&&(Array.isArray(y.material)||r[y.material.uuid]&&r[y.material.uuid][ry(y)]&&r[y.material.uuid][ry(y)].length>1||(u[d++]=y));for(let y=0;y<d;y++)i.attach(u[y])};for(let _=0;_<h;_++){let y=c[_];v(y.children),a[s++]=y}}}for(let A=0;A<s;A++)a[A].removeFromParent()}var I4e=$u(rfe(),1),D4e=new Me;function P4e(t){let i="The Spline Runtime only accepts .splinecode files that are generated from Spline export panel.";t.endsWith(".spline")?console.warn(i+" The .spline files are only meant to be used by the Editor."):t.endsWith(".splinecode")||console.warn(i)}var L4e=class{constructor(t,{renderOnDemand:i,renderMode:r="auto"}={}){this._viewportMode=1,this._viewportWidth=window.innerWidth,this._viewportHeight=window.innerHeight,this._proxyObjectCache=new Map,this._variablesCache=new Map,this._isPaused=!1,this._renderRequested=!1,this._skipRender=!1,this.time=performance.now(),this.dt=0,this.currentTAAFrame=0,this.disposed=!1,this._requestRenderAutoMode=()=>{this._skipRender=!1},this.requestRender=()=>{this._renderRequested=!0},this.render=n=>{var a,s,o,l,c,h,u,d,A,f,m,g,p;if(this.time=n,this._lastTime&&(this.dt=this.time-this._lastTime),this._lastTime=this.time,(a=this._perfs)==null||a.start(),!this._renderer){(s=this._perfs)==null||s.end();return}if(!this._isPaused&&(this.renderMode==="manual"&&!this._renderRequested||this.renderMode==="auto"&&this._skipRender)){(o=this._perfs)==null||o.end();return}if(this._renderRequested=!1,this._skipRender=!0,this._controls&&(this._skipRender=this._controls.update(this.dt)),this._eventManager&&((l
12024=this._eventManager.handlers)!=null&&l.Start.hasVideoAction||(c=this._eventManager.handlers)!=null&&c.Basic.hasVideoAction||(h=this._eventManager.handlers)!=null&&h.Conditional.hasVideoAction)&&(this._skipRender=!1),(u=this._animationControls)==null||u.update(this.dt),this._skipRender?(this.currentTAAFrame++,this.currentTAAFrame<32?this._skipRender=!1:this.currentTAAFrame=0):this.currentTAAFrame=0,(d=this._scene)==null||d.traverseVisibleEntity(v=>{v.type==="ParticleSystem"&&(v.update(this.dt),this._skipRender=!1)}),this._scene&&this._scene.activeCamera!==this._camera&&(this._camera=this._scene.activeCamera),(A=this._eventManager)!=null&&A.isEnabled&&(((f=this._eventManager.handlers)==null?void 0:f.Follow).onAnimationFrameDamping(),((m=this._eventManager.handlers)==null?void 0:m.LookAt).onAnimationFrameDamping(),((g=this._eventManager.handlers)==null?void 0:g.DragDrop).onAnimationFrameDamping()),this._scene&&this._camera){if(this._scene.pathConstraints.applyConstraints(this._scene),this._renderer.sceneTransitionTimeRemaining>0){this._renderer.sceneTransitionTimeRemaining-=this.dt;let v=1-this._renderer.sceneTransitionTimeRemaining/this._renderer.sceneTransitionDuration;this._renderer.pipeline.sceneTransitionPass.uniforms.mixRatio.value=v,this._skipRender=!1}else this._renderer.pipeline.sceneTransitionFromTexture=null;this._renderer.renderSplineScene(this._scene,this._camera)}this.canvas.dispatchEvent(this._renderedEvent),(p=this._perfs)==null||p.end()},this._resize=n=>{var a,s,o,l,c,h,u,d,A,f;if(this._renderer){if(this._viewportMode===1&&this._frameView&&(this._frameView.frameSize=D4e.set(this._viewportWidth,this._viewportHeight)),n){let m=this._viewportWidth,g=this._viewportHeight;this._renderer.setSize(m-1,g-1,!1),this._renderer.setSize(m,g,!1)}else this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1);if(this._camera=(a=this._scene)==null?void 0:a.activeCamera,(u=this._scene)==null||u.updateViewPlaneSize(((o=(s=this._frameView)==null?void 0:s.frameSize)==null?void 0:o.x)??this._viewportWidth,((c=(l=this._frameView)==null?void 0:l.frameSize)==null?void 0:c.y)??this._viewportHeight,((h=this._frameView)==null?void 0:h.enableResponsive)??!1),this._camera){let m=Object.values(((d=this._data)==null?void 0:d.frames)??{})[0].preset??"fullscreen";(A=this._frameView)==null||A.setCamera(this._camera),(f=this._frameView)==null||f.updateCamera(m!=="fullscreen"),this._camera.cameraType==="PerspectiveCamera"&&(this._camera.aspect=this._viewportWidth/this._viewportHeight),this._camera.updateProjectionMatrix()}this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect()),this._requestRenderAutoMode()}},this._debouncedResize=LN(this._resize,10),this._onScroll=n=>{this.eventManager&&(this.eventManager.eventContext.domRect=this.canvas.getBoundingClientRect())},this.canvas=t,this.renderMode=i?"auto":r,this._renderedEvent=new CustomEvent("rendered",{bubbles:!0}),Object.defineProperty(this._renderedEvent,"target",{writable:!1,value:this}),window.location.search.includes("perfs")&&(this._perfs=new T4e({x:10,y:10})),nxe(t)}async load(t,i,r){P4e(t),this.disposed=!1;let n=await(await fetch(t,r)).arrayBuffer();await this.start(n,{variables:i})}async start(t,{interactive:i=!0,variables:r}={}){var c,h,u,d;if(this.disposed)return;let n=await o4e(t);this._data=n;let a=l4e(n);n.version&&(0,I4e.default)(n.version,"1.9.25")>0&&console.warn("Your .splinecode file is more recent than the library. Please upgrade @splinetool/runtime to the latest version."),await Promise.all([a.length&&a4e(),Q6(n)&&VIe(),KDe(n)&&HIe(),ky.physicsEnabled(n.scene.objects)&&cxe(),k6(n)&&CDe(),_V(n)&&JNe(),bDe(n)&&wDe(),hV(n)&&WOe(),QFe(n)&&oxe()].filter(Boolean)),a.length&&await c4e(a),(c=this._eventManager)==null||c.deactivate(),(h=this._controls)==null||h.deactivate(),(u=this._scene)==null||u.dispose();let s=new C4e(n);if(s.resetPersonalCameraFromDocumentData(),this._scene=s.scene,this._sharedAssetsManager=s.sharedAssets,this._camera=this._scene.activeCamera,window.location.search.includes("merge-geometries")){let A=performance.now();B4e(n,s.scene);let f=performance.now();console.log("Merged geometries in ",f-A," ms")}Q6(n)&&this._scene.traverse(A=>{xu(A)&&A.recomputeBoolean()}),this._sharedAssetsManager.setRequestRender(()=>{var A;this._requestRenderAutoMode(),(A=this._scene)==null||A.traverse(f=>
12024{f instanceof sc&&f.pendingMediaLoad&&f.update()})}),(d=this._scene)==null||d.traverse(A=>{A.type==="ParticleSystem"&&(A.wakeUp(),A.data.autoPlay?A.start():A.stop())});let o=Object.keys(n.shared.fonts).map(A=>this._sharedAssetsManager.getFont(A).loadingPromise);if(Promise.all(o).then(()=>{s.scene.markNeedsUpdateRendererDirty(),this._requestRenderAutoMode()}),k6(n)&&$Fe(n)&&await Promise.all(o),hV(n)){let A=[];this._scene.traverseEntity(f=>{(f instanceof ls||f instanceof fa)&&f.uiCanvas&&A.push(f.uiCanvas)}),await Promise.all(A.map(f=>f.promise))}if(this._scene.rewriteEventsBeforeGoToPlayMode(),UU(this._scene.activePage,this._sharedAssetsManager),!this._renderer&&(this._renderer=new IOe({canvas:this.canvas,antialias:!1,alpha:!0,stencil:!1,depth:!1,powerPreference:"high-performance"}),this._renderer.hdTransmission=n.scene.publish.hdTransmission===!0,this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.pipeline.enableUIOverlay(),this._renderer.pipeline.addEventListener("smaaloaded",this._requestRenderAutoMode),n.shared.images.SplineWatermark)){let A=this._sharedAssetsManager.getImage("SplineWatermark");await A.loadPromise;let f=A.getTexture(1001);this._renderer.pipeline.setWatermark(f)}_V(n)&&this._scene.initializeSplatViewer(),n.scene.blueNoiseTextureData!==void 0&&this._renderer.pipeline.updateBlueNoiseTexture(n.scene.blueNoiseTextureData);let l=Object.values(n.frames)[0];if(this._frameView?this._frameView.setCamera(this._camera):(l.preset==="fullscreen"?(this._viewportMode=1,this.canvas.style.display="block",this.canvas.parentElement&&(this._viewportWidth=this.canvas.parentElement.clientWidth||300,this.canvas.style.width="100%"),this.canvas.parentElement&&(this._viewportHeight=this.canvas.parentElement.clientHeight||150,this.canvas.style.height="100%")):(this._viewportMode=2,this._viewportWidth=l.size[0],this._viewportHeight=l.size[1],this.canvas.style.width=`${this._viewportWidth}px`,this.canvas.style.height=`${this._viewportHeight}px`),this._renderer.setSize(this._viewportWidth,this._viewportHeight,!1),this._frameView=new b4e(this._renderer,this._camera,new Me(this._viewportWidth,this._viewportHeight),new Me(window.innerWidth,window.innerHeight)),this._frameView.enableResponsive=(l.allowResponsive??!1)&&l.preset==="fullscreen"),i){let A=new Z3e(this._renderer,this.data.scene.publish,this._scene,()=>this._scene.activeCamera,this._sharedAssetsManager,this._requestRenderAutoMode,!0,l);this._scene.updateMatrixWorld(!0),this._controls=new e4e(A),this._animationControls=new i4e(this._scene,this._requestRenderAutoMode),this._eventManager=new w4e(n.scene.publish,this._controls,this._animationControls,A,n.shared.variables),this._eventManager.activate(),this._controls.activate(this._eventManager)}this._resize(),this._scene.activePage.data.postprocessing.depthOfField.enabled&&Promise.all(this._sharedAssetsManager.getImageLoadPromises()).then(()=>{this._resize(!0)}),r!==void 0&&this.setVariables(r),this.dt===0&&(this.render(performance.now()),setTimeout(()=>{var A;(A=this._renderer)==null||A.setAnimationLoop(this.render)},0)),this._resizeObserverTimeout=setTimeout(()=>{!this._resizeObserver&&this.canvas.parentElement&&(this._resizeObserver=new ResizeObserver(()=>{this._viewportWidth=this.canvas.clientWidth,this._viewportHeight=this.canvas.clientHeight,this._debouncedResize()}),this._resizeObserver.observe(this.canvas.parentElement))},300),document.addEventListener("scroll",this._onScroll)}setVariables(t){if(this._data!==void 0){let i=Object.entries(t);for(let[r,n]of i)this.setVariable(r,n)}}setVariable(t,i){var n;let r=this._getVariableByName(t);if(r&&!("dynamicVariableType"in r.data)){let a=i;typeof r.data.value=="number"?a=typeof i=="number"?i:typeof i=="boolean"?i===!0?1:0:parseFloat(i):typeof r.data.value=="boolean"?a=typeof i=="number"?!!i:typeof i=="boolean"?i:i.toLocaleLowerCase()==="false"?!1:!!i:typeof r.data.value!="string"&&r.data.value.textValue!==void 0&&(a=i.toString());let s=typeof a=="string"?{textValue:a}:a;(n=this._sharedAssetsManager)==null||n.updateVariable(r.id,s),this.requestRender(),this._requestRenderAutoMode()}else r===void 0?console.warn(`No variable named ${t} was found in your Spline file. Make sure to create it from Spline editor.`):"dynamicVariableType"in r.data&&console.warn(`Dynamic variables like ${t} cannot be updated from code.`)}
12024getVariables(){let t={};return this._data&&this._data.shared.variables.forEach(i=>{t[i.data.name]===void 0&&(t[i.data.name]=this._getVariableValue(this._sharedAssetsManager.getVariable(i.id)))}),t}getVariable(t){let i=this._getVariableByName(t);if(i){let r=this._sharedAssetsManager.getVariable(i.id);return this._getVariableValue(r)}}_getVariableValue(t){return typeof t!="string"&&ja.isTextValue(t)?ja.getDisplayedValue(t):t}_getVariableByName(t){if(this._data){if(this._variablesCache.has(t))return this._variablesCache.get(t);let i=this._data.shared.variables.find(r=>r.data.name===t);return i&&this._variablesCache.set(t,i),i}}findObjectById(t){var r;let i=(r=this._scene)==null?void 0:r.getObjectByProperty("uuid",t);return this._createProxyObject(i)}findObjectByName(t){var r;let i=(r=this._scene)==null?void 0:r.getObjectByName(t);return this._createProxyObject(i)}getAllObjects(){var i;let t=[];return(i=this._scene)==null||i.traverseEntity(r=>{if(r.uuid!==W0&&!this._scene.isInvisibleObjects(r)&&!(r instanceof fa)){let n=this._createProxyObject(r);
12024n&&t.push(n)}}),t}getSplineEvents(){var t,i;return((i=(t=this._eventManager)==null?void 0:t.handlers)==null?void 0:i.Spline).splineEvents}emitEvent(t,i){var r;(r=this.findObjectById(i)||this.findObjectByName(i))==null||r.emitEvent(t)}emitEventReverse(t,i){var r;(r=this.findObjectById(i)||this.findObjectByName(i))==null||r.emitEventReverse(t)}addEventListener(t,i){this.canvas.addEventListener(t,i)}removeEventListener(t,i){this.canvas.removeEventListener(t,i)}setZoom(t){var i,r;((i=this._controls)==null?void 0:i.orbitControls)instanceof uZ&&((r=this._controls)==null||r.orbitControls.setZoom(t))}get eventManager(){return this._eventManager}get controls(){return this._controls}setSize(t,i){this._viewportWidth=t,this._viewportHeight=i,this._viewportMode=2,this._resize()}setBackgroundColor(t){var o;let{r:i,g:r,b:n,a}={r:0,g:0,b:0,a:1},s=new Xa(i,r,n,a);try{s.setStyle(t)}catch{console.error("This is not a valid css color",t)}(o=this._scene)==null||o.activePage.setBackgroundColor(s),this._requestRenderAutoMode()}dispose(){var t,i,r,n,a,s,o;this.disposed=!0,(t=this._eventManager)==null||t.deactivate(),(i=this._scene)==null||i.dispose(),(r=this._sharedAssetsManager)==null||r.dispose(),this._proxyObjectCache.forEach(l=>{ZG.unsubscribe(l)}),this._variablesCache.clear(),(n=this._renderer)==null||n.setAnimationLoop(null),(a=this._renderer)==null||a.dispose(),this._renderer=void 0,(s=this._sharedAssetsManager)==null||s.dispose(),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),this._resizeObserverTimeout!==void 0&&clearTimeout(this._resizeObserverTimeout),this.canvas.style.width="",this.canvas.style.height="",this.canvas.removeAttribute("width"),this.canvas.removeAttribute("height"),this._frameView&&(this._frameView=void 0),(o=this._controls)==null||o.deactivate(),this.dt=0,axe(this.canvas),document.removeEventListener("scroll",this._onScroll)}get isStopped(){return this._isPaused}stop(){var t,i,r;this._isPaused||((t=this._renderer)==null||t.setAnimationLoop(null),this._isPaused=!0,(i=this._eventManager)==null||i.pause(),(r=this._controls)!=null&&r.orbitControls&&(this._controls.orbitControls.enabled=!1))}play(){var t,i,r;!this._isPaused||(this._isPaused=!1,(t=this._eventManager)==null||t.resume(),(i=this._controls)!=null&&i.orbitControls&&(this._controls.orbitControls.enabled=!0),(r=this._renderer)==null||r.setAnimationLoop(this.render))}setGlobalEvents(t){var i;(i=this._eventManager)==null||i.updateUseWindowEvents(t)}get data(){return this._data}_createProxyObject(t){var a;if(t==null)return;if(this._proxyObjectCache.has(t.uuid))return this._proxyObjectCache.get(t.uuid);let i;t.traverseAncestors(s=>{s instanceof fa&&(i=s.name)});let r={name:t.name,uuid:t.uuid,visible:t.visible,intensity:t.intensity,position:t.position,rotation:t.rotation,scale:t.scale,type:t.data.type,page:i,parentUuid:t.parent instanceof fa||t instanceof SU||(a=t.parent)==null?void 0:a.uuid,emitEvent(s){t.dispatchEvent({type:"userEvent",eventName:s})},emitEventReverse(s){t.dispatchEvent({type:"userEvent",eventName:s,reverse:!0})}},n=ZG(r,(s,o)=>{var l;typeof t[s]!="object"&&((l=Object.getOwnPropertyDescriptor(t,s))!=null&&l.writable)&&(t[s]=o),this._requestRenderAutoMode(),t.updateMatrix()});return this._proxyObjectCache.set(t.uuid,n),n}setUIWasmUrl(t){LX.skiaWasmUrl=t}},FE=`varying vec3 vNormal;\r 12025 12026void main() {\r 12027 \r 12028 gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); 12029 12030 vNormal = normal; \r 12031}`,kE=`uniform vec3 lightDirection;\r 12032uniform vec3 color;\r 12033varying vec3 vNormal; 12034 12035void main() {\r 12036 vec3 normal = normalize(vNormal); \r 12037 float intensity = dot(normal, lightDirection); 12038 12039 12040 if (intensity > 0.6) intensity = 0.7;\r 12041 else intensity = 0.8; 12042 12043 gl_FragColor = vec4(color * intensity, 1.0);\r 12044}`,AZ=`uniform float outlineThickness; 12045 12046void main() {\r 12047 vec3 inflatedPosition = position + normal * outlineThickness;\r 12048 gl_Position = projectionMatrix * modelViewMatrix * vec4(inflatedPosition, 1.0
12048);\r 12049}`,fZ=`uniform vec3 color; 12050 12051void main() {\r 12052 gl_FragColor = vec4(color, 1.0);\r 12053}`,HE={},hA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";HE.encode=function(t,i){for(var r="",n,a,s,o,l,c,h,u=0;u<t.length;)n=t.charCodeAt(u++),a=t.charCodeAt(u++),s=t.charCodeAt(u++),o=n>>2,l=(n&3)<<4|a>>4,c=(a&15)<<2|s>>6,h=s&63,isNaN(a)?c=h=64:isNaN(s)&&(h=64),r=r+hA.charAt(o)+hA.charAt(l)+hA.charAt(c)+hA.charAt(h);return r};HE.decode=function(t,i){var r="",n,a,s,o,l,c,h,u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");u<t.length;)o=hA.indexOf(t.charAt(u++)),l=hA.indexOf(t.charAt(u++)),c=hA.indexOf(t.charAt(u++)),h=hA.indexOf(t.charAt(u++)),n=o<<2|l>>4,a=(l&15)<<4|c>>2,s=(c&3)<<6|h,r=r+String.fromCharCode(n),c!=64&&(r=r+String.fromCharCode(a)),h!=64&&(r=r+String.fromCharCode(s));return r};var Fs={},iS;Fs.base64=!0;Fs.array=!0;Fs.string=!0;Fs.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u";Fs.nodebuffer=typeof Buffer<"u";Fs.uint8array=typeof Uint8Array<"u";if(typeof ArrayBuffer>"u")iS=Fs.blob=!1;else{var y8=new ArrayBuffer(0);try{iS=Fs.blob=new Blob([y8],{type:"application/zip"}).size===0}catch{try{var O4e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,E8=new O4e;E8.append(y8),iS=Fs.blob=E8.getBlob("application/zip").size===0}catch{iS=Fs.blob=!1}}}var bc={},GE={},q0={},id={};(function(t){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";t.assign=function(a){for(var s=Array.prototype.slice.call(arguments,1);s.length;){var o=s.shift();if(o){if(typeof o!="object")throw new TypeError(o+"must be non-object");for(var l in o)o.hasOwnProperty(l)&&(a[l]=o[l])}}return a},t.shrinkBuf=function(a,s){return a.length===s?a:a.subarray?a.subarray(0,s):(a.length=s,a)};var r={arraySet:function(a,s,o,l,c){if(s.subarray&&a.subarray){a.set(s.subarray(o,o+l),c);return}for(var h=0;h<l;h++)a[c+h]=s[o+h]},flattenChunks:function(a){var s,o,l,c,h,u;for(l=0,s=0,o=a.length;s<o;s++)l+=a[s].length;for(u=new Uint8Array(l),c=0,s=0,o=a.length;s<o;s++)h=a[s],u.set(h,c),c+=h.length;return u}},n={arraySet:function(a,s,o,l,c){for(var h=0;h<l;h++)a[c+h]=s[o+h]},flattenChunks:function(a){return[].concat.apply([],a)}};t.setTyped=function(a){a?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,n))},t.setTyped(i)})(id);var zE={},Ch={},Z0={},N4e=id,U4e=4,w8=0,b8=1,F4e=2;function J0(t){for(var i=t.length;--i>=0;)t[i]=0}var k4e=0,pZ=1,H4e=2,G4e=3,z4e=258,kU=29,QE=256,Xy=QE+1+kU,zg=30,HU=19,mZ=2*Xy+1,kf=15,T2=16,Q4e=7,GU=256,gZ=16,vZ=17,_Z=18,iO=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],zS=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],V4e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],yZ=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],W4e=512,du=new Array((Xy+2)*2);J0(du);var ny=new Array(zg*2);J0(ny);var qy=new Array(W4e);J0(qy);var Zy=new Array(z4e-G4e+1);J0(Zy);var zU=new Array(kU);J0(zU);var ST=new Array(zg);J0(ST);function M2(t,i,r,n,a){this.static_tree=t,this.extra_bits=i,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=t&&t.length}var EZ,wZ,bZ;function x2(t,i){this.dyn_tree=t,this.max_code=0,this.stat_desc=i}function SZ(t){return t<256?qy[t]:qy[256+(t>>>7)]}function Jy(t,i){t.pending_buf[t.pending++]=i&255,t.pending_buf[t.pending++]=i>>>8&255}function lo(t,i,r){t.bi_valid>T2-r?(t.bi_buf|=i<<t.bi_valid&65535,Jy(t,t.bi_buf),t.bi_buf=i>>T2-t.bi_valid,t.bi_valid+=r-T2):(t.bi_buf|=i<<t.bi_valid&65535,t.bi_valid+=r)}function Jc(t,i,r){lo(t,r[i*2],r[i*2+1])}function CZ(t,i){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--i>0);return r>>>1}function j4e(t){t.bi_valid===16?(Jy(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function Y4e(t,i){var r=i.dyn_tree,n=i.max_code,a=i.stat_desc.static_tree,s=i.stat_desc.has_stree,o=i.stat_desc.extra_bits,l=i.stat_desc.extra_base,c=i.stat_desc.max_length,h,u,d,A,f,m,g=0;for(A=0;A<=kf;A++)t.bl_count[A]=0;for(r[t.heap[t.heap_max]*2+1]=0,h=t.heap_max+1;h<mZ;
vendor: 14,941 bytes, line 12053
12053h++)u=t.heap[h],A=r[r[u*2+1]*2+1]+1,A>c&&(A=c,g++),r[u*2+1]=A,!(u>n)&&(t.bl_count[A]++,f=0,u>=l&&(f=o[u-l]),m=r[u*2],t.opt_len+=m*(A+f),s&&(t.static_len+=m*(a[u*2+1]+f)));if(g!==0){do{for(A=c-1;t.bl_count[A]===0;)A--;t.bl_count[A]--,t.bl_count[A+1]+=2,t.bl_count[c]--,g-=2}while(g>0);for(A=c;A!==0;A--)for(u=t.bl_count[A];u!==0;)d=t.heap[--h],!(d>n)&&(r[d*2+1]!==A&&(t.opt_len+=(A-r[d*2+1])*r[d*2],r[d*2+1]=A),u--)}}function TZ(t,i,r){var n=new Array(kf+1),a=0,s,o;for(s=1;s<=kf;s++)n[s]=a=a+r[s-1]<<1;for(o=0;o<=i;o++){var l=t[o*2+1];l!==0&&(t[o*2]=CZ(n[l]++,l))}}function K4e(){var t,i,r,n,a,s=new Array(kf+1);for(r=0,n=0;n<kU-1;n++)for(zU[n]=r,t=0;t<1<<iO[n];t++)Zy[r++]=n;for(Zy[r-1]=n,a=0,n=0;n<16;n++)for(ST[n]=a,t=0;t<1<<zS[n];t++)qy[a++]=n;for(a>>=7;n<zg;n++)for(ST[n]=a<<7,t=0;t<1<<zS[n]-7;t++)qy[256+a++]=n;for(i=0;i<=kf;i++)s[i]=0;for(t=0;t<=143;)du[t*2+1]=8,t++,s[8]++;for(;t<=255;)du[t*2+1]=9,t++,s[9]++;for(;t<=279;)du[t*2+1]=7,t++,s[7]++;for(;t<=287;)du[t*2+1]=8,t++,s[8]++;for(TZ(du,Xy+1,s),t=0;t<zg;t++)ny[t*2+1]=5,ny[t*2]=CZ(t,5);EZ=new M2(du,iO,QE+1,Xy,kf),wZ=new M2(ny,zS,0,zg,kf),bZ=new M2(new Array(0),V4e,0,HU,Q4e)}function MZ(t){var i;for(i=0;i<Xy;i++)t.dyn_ltree[i*2]=0;for(i=0;i<zg;i++)t.dyn_dtree[i*2]=0;for(i=0;i<HU;i++)t.bl_tree[i*2]=0;t.dyn_ltree[GU*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function xZ(t){t.bi_valid>8?Jy(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function X4e(t,i,r,n){xZ(t),n&&(Jy(t,r),Jy(t,~r)),N4e.arraySet(t.pending_buf,t.window,i,r,t.pending),t.pending+=r}function S8(t,i,r,n){var a=i*2,s=r*2;return t[a]<t[s]||t[a]===t[s]&&n[i]<=n[r]}function R2(t,i,r){for(var n=t.heap[r],a=r<<1;a<=t.heap_len&&(a<t.heap_len&&S8(i,t.heap[a+1],t.heap[a],t.depth)&&a++,!S8(i,n,t.heap[a],t.depth));)t.heap[r]=t.heap[a],r=a,a<<=1;t.heap[r]=n}function C8(t,i,r){var n,a,s=0,o,l;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],a=t.pending_buf[t.l_buf+s],s++,n===0?Jc(t,a,i):(o=Zy[a],Jc(t,o+QE+1,i),l=iO[o],l!==0&&(a-=zU[o],lo(t,a,l)),n--,o=SZ(n),Jc(t,o,r),l=zS[o],l!==0&&(n-=ST[o],lo(t,n,l)));while(s<t.last_lit);Jc(t,GU,i)}function rO(t,i){var r=i.dyn_tree,n=i.stat_desc.static_tree,a=i.stat_desc.has_stree,s=i.stat_desc.elems,o,l,c=-1,h;for(t.heap_len=0,t.heap_max=mZ,o=0;o<s;o++)r[o*2]!==0?(t.heap[++t.heap_len]=c=o,t.depth[o]=0):r[o*2+1]=0;for(;t.heap_len<2;)h=t.heap[++t.heap_len]=c<2?++c:0,r[h*2]=1,t.depth[h]=0,t.opt_len--,a&&(t.static_len-=n[h*2+1]);for(i.max_code=c,o=t.heap_len>>1;o>=1;o--)R2(t,r,o);h=s;do o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],R2(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=l,r[h*2]=r[o*2]+r[l*2],t.depth[h]=(t.depth[o]>=t.depth[l]?t.depth[o]:t.depth[l])+1,r[o*2+1]=r[l*2+1]=h,t.heap[1]=h++,R2(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Y4e(t,i),TZ(r,c,t.bl_count)}function T8(t,i,r){var n,a=-1,s,o=i[0*2+1],l=0,c=7,h=4;for(o===0&&(c=138,h=3),i[(r+1)*2+1]=65535,n=0;n<=r;n++)s=o,o=i[(n+1)*2+1],!(++l<c&&s===o)&&(l<h?t.bl_tree[s*2]+=l:s!==0?(s!==a&&t.bl_tree[s*2]++,t.bl_tree[gZ*2]++):l<=10?t.bl_tree[vZ*2]++:t.bl_tree[_Z*2]++,l=0,a=s,o===0?(c=138,h=3):s===o?(c=6,h=3):(c=7,h=4))}function M8(t,i,r){var n,a=-1,s,o=i[0*2+1],l=0,c=7,h=4;for(o===0&&(c=138,h=3),n=0;n<=r;n++)if(s=o,o=i[(n+1)*2+1],!(++l<c&&s===o)){if(l<h)do Jc(t,s,t.bl_tree);while(--l!==0);else s!==0?(s!==a&&(Jc(t,s,t.bl_tree),l--),Jc(t,gZ,t.bl_tree),lo(t,l-3,2)):l<=10?(Jc(t,vZ,t.bl_tree),lo(t,l-3,3)):(Jc(t,_Z,t.bl_tree),lo(t,l-11,7));l=0,a=s,o===0?(c=138,h=3):s===o?(c=6,h=3):(c=7,h=4)}}function q4e(t){var i;for(T8(t,t.dyn_ltree,t.l_desc.max_code),T8(t,t.dyn_dtree,t.d_desc.max_code),rO(t,t.bl_desc),i=HU-1;i>=3&&t.bl_tree[yZ[i]*2+1]===0;i--);return t.opt_len+=3*(i+1)+5+5+4,i}function Z4e(t,i,r,n){var a;for(lo(t,i-257,5),lo(t,r-1,5),lo(t,n-4,4),a=0;a<n;a++)lo(t,t.bl_tree[yZ[a]*2+1],3);M8(t,t.dyn_ltree,i-1),M8(t,t.dyn_dtree,r-1)}function J4e(t){var i=4093624447,r;for(r=0;r<=31;r++,i>>>=1)if(i&1&&t.dyn_ltree[r*2]!==0)return w8;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return b8;for(r=32;r<QE;r++)if(t.dyn_ltree[r*2]!==0)return b8;return w8}var x8=!1;function $4e(t){x8||(K4e(),x8=!0),t.l_desc=new x2(t.dyn_ltree,EZ),t.d_desc=new x2(t.dyn_dtree,wZ),t.bl_desc=new x2(t.bl_tree,bZ),t.bi_buf=0,t.bi_valid=0,MZ(t)}function RZ(t,i,r,n){lo(t,(k4e<<1)+(n?1:0),3),X4e(t,i,r,!0)}function eke(t){lo(t,pZ<<1,3),Jc(t,GU,du),j4e(t)}function tke(t,i,r,n){var a,s,o=0;t.level>0?(t.strm.data_type===F4e&&(t.strm.data_type=J4e(t)),rO(t,t.l_desc),rO(t,t.d_desc),o=q4e(t),a=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=a&&(a=s)):a=s=r+5,r+4<=a&&i!==-1?RZ(t,i,r,n):t.strategy===U4e||s===a?(lo(t,(pZ<<1)+(n?1:0),3),C8(t,du,ny)):(lo(t,(H4e<<1)+(n?1:0),3),Z4e(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),C8(t,t.dyn_ltree,t.dyn_dtree)),MZ(t),n&&xZ(t)}function ike(t,i,r){return t.pending_buf[t.d_buf+t.last_lit*2]=i>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=i&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,i===0?t.dyn_ltree[r*2]++:(t.matches++,i--,t.dyn_ltree[(Zy[r]+QE+1)*2]++,t.dyn_dtree[SZ(i)*2]++),t.last_lit===t.lit_bufsize-1}Z0._tr_init=$4e;Z0._tr_stored_block=RZ;Z0._tr_flush_block=tke;Z0._tr_tally=ike;Z0._tr_align=eke;function rke(t,i,r,n){for(var a=t&65535|0,s=t>>>16&65535|0,o=0;r!==0;){o=r>2e3?2e3:r,r-=o;do a=a+i[n++]|0,s=s+a|0;while(--o);a%=65521,s%=65521}return a|s<<16|0}var BZ=rke;function nke(){for(var t,i=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;i[r]=t}return i}var ake=nke();function ske(t,i,r,n){var a=ake,s=n+r;t^=-1;for(var o=n;o<s;o++)t=t>>>8^a[(t^i[o])&255];return t^-1}var IZ=ske,QU={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ds=id,yl=Z0,DZ=BZ,Dd=IZ,oke=QU,Np=0,lke=1,cke=3,TA=4,R8=5,$c=0,B8=1,El=-2,hke=-3,B2=-5,uke=-1,dke=1,rS=2,Ake=3,fke=4,pke=0,mke=2,DM=8,gke=9,vke=15,_ke=8,yke=29,Eke=256,nO=Eke+1+yke,wke=30,bke=19,Ske=2*nO+1,Cke=15,Gi=3,uA=258,Ac=uA+Gi+1,Tke=32,PM=42,aO=69,QS=73,VS=91,WS=103,Hf=113,M_=666,Jn=1,VE=2,mp=3,$0=4,Mke=3;function dA(t,i){return t.msg=oke[i],i}function I8(t){return(t<<1)-(t>4?9:0)}function Kd(t){for(var i=t.length;--i>=0;)t[i]=0}function Pd(t){var i=t.state,r=i.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Ds.arraySet(t.output,i.pending_buf,i.pending_out,r,t.next_out),t.next_out+=r,i.pending_out+=r,t.total_out+=r,t.avail_out-=r,i.pending-=r,i.pending===0&&(i.pending_out=0))}function Ya(t,i){yl._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,i),t.block_start=t.strstart,Pd(t.strm)}function qi(t,i){t.pending_buf[t.pending++]=i}function i_(t,i){t.pending_buf[t.pending++]=i>>>8&255,t.pending_buf[t.pending++]=i&255}function xke(t,i,r,n){var a=t.avail_in;return a>n&&(a=n),a===0?0:(t.avail_in-=a,Ds.arraySet(i,t.input,t.next_in,a,r),t.state.wrap===1?t.adler=DZ(t.adler,i,a,r):t.state.wrap===2&&(t.adler=Dd(t.adler,i,a,r)),t.next_in+=a,t.total_in+=a,a)}function PZ(t,i){var r=t.max_chain_length,n=t.strstart,a,s,o=t.prev_length,l=t.nice_match,c=t.strstart>t.w_size-Ac?t.strstart-(t.w_size-Ac):0,h=t.window,u=t.w_mask,d=t.prev,A=t.strstart+uA,f=h[n+o-1],m=h[n+o];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(a=i,!(h[a+o]!==m||h[a+o-1]!==f||h[a]!==h[n]||h[++a]!==h[n+1])){n+=2,a++;do;while(h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&h[++n]===h[++a]&&n<A);if(s=uA-(A-n),n=A-uA,s>o){if(t.match_start=i,o=s,s>=l)break;f=h[n+o-1],m=h[n+o]}}while((i=d[i&u])>c&&--r!==0);return o<=t.lookahead?o:t.lookahead}function gp(t){var i=t.w_size,r,n,a,s,o;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-Ac)){Ds.arraySet(t.window,t.window,i,i,0),t.match_start-=i,t.strstart-=i,t.block_start-=i,n=t.hash_size,r=n;do a=t.head[--r],t.head[r]=a>=i?a-i:0;while(--n);n=i,r=n;do a=t.prev[--r],t.prev[r]=a>=i?a-i:0;while(--n);s+=i}if(t.strm.avail_in===0)break;if(n=xke(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=Gi)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+Gi-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<Gi)););}while(t.lookahead<Ac&&t.strm.avail_in!==0)}function Rke(t,i){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(gp(t),t.lookahead===0&&i===Np)return Jn;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ya(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Ac&&(Ya(t,!1),t.strm.avail_out===0))return Jn}return t.insert=0,i===TA?(Ya(t,!0),t.strm.avail_out===0?mp:$0):(t.strstart>t.block_start&&(Ya(t,!1),t.strm.avail_out===0),Jn)}function I2(t,i){for(var r,n;;){if(t.lookahead<Ac){if(gp(t),t.lookahead<Ac&&i===Np)return Jn;if(t.lookahead===0)break}if(r=0,t.lookahead>=Gi&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Gi-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Ac&&(t.match_length=PZ(t,r)),t.match_length>=Gi)if(n=yl._tr_tally(t,t.strstart-t.match_start,t.match_length-Gi),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Gi){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Gi-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=yl._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ya(t,!1),t.strm.avail_out===0))return Jn}return t.insert=t.strstart<Gi-1?t.strstart:Gi-1,i===TA?(Ya(t,!0),t.strm.avail_out===0?mp:$0):t.last_lit&&(Ya(t,!1),t.strm.avail_out===0)?Jn:VE}function Vm(t,i){for(var r,n,a;;){if(t.lookahead<Ac){if(gp(t),t.lookahead<Ac&&i===Np)return Jn;if(t.lookahead===0)break}if(r=0,t.lookahead>=Gi&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Gi-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Gi-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Ac&&(t.match_length=PZ(t,r),t.match_length<=5&&(t.strategy===dke||t.match_length===Gi&&t.strstart-t.match_start>4096)&&(t.match_length=Gi-1)),t.prev_length>=Gi&&t.match_length<=t.prev_length){a=t.strstart+t.lookahead-Gi,n=yl._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Gi),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=a&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Gi-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Gi-1,t.strstart++,n&&(Ya(t,!1),t.strm.avail_out===0))return Jn}else if(t.match_available){if(n=yl._tr_tally(t,0,t.window[t.strstart-1]),n&&Ya(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Jn}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=yl._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Gi-1?t.strstart:Gi-1,i===TA?(Ya(t,!0),t.strm.avail_out===0?mp:$0):t.last_lit&&(Ya(t,!1),t.strm.avail_out===0)?Jn:VE}function Bke(t,i){for(var r,n,a,s,o=t.window;;){if(t.lookahead<=uA){if(gp(t),t.lookahead<=uA&&i===Np)return Jn;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Gi&&t.strstart>0&&(a=t.strstart-1,n=o[a],n===o[++a]&&n===o[++a]&&n===o[++a])){s=t.strstart+uA;do;while(n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&n===o[++a]&&a<s);t.match_length=uA-(s-a),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Gi?(r=yl._tr_tally(t,1,t.match_length-Gi),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=yl._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Ya(t,!1),t.strm.avail_out===0))return Jn}return t.insert=0,i===TA?(Ya(t,!0),t.strm.avail_out===0?mp:$0):t.last_lit&&(Ya(t,!1),t.strm.avail_out===0)?Jn:VE}function Ike(t,i){for(var r;;){if(t.lookahead===0&&(gp(t),t.lookahead===0)){if(i===Np)return Jn;break}if(t.match_length=0,r=yl._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Ya(t,!1),t.strm.avail_out===0))return Jn}return t.insert=0,i===TA?(Ya(t,!0),t.strm.avail_out===0?mp:$0):t.last_lit&&(Ya(t,!1),t.strm.avail_out===0)?Jn:VE}function Uc(t,i,r,n,a){this.good_length=t,this.max_lazy=i,this.nice_length=r,this.max_chain=n,this.func=a}var gg;gg=[new Uc(0,0,0,0,Rke),new Uc(4,4,8,4,I2),new Uc(4,5,16,8,I2),new Uc(4,6,32,32,I2),new Uc(4,4,16,16,Vm),new Uc(8,16,32,32,Vm),new Uc(8,16,128,128,Vm),new Uc(8,32,128,256,Vm),new Uc(32,128,258,1024,Vm),new Uc(32,258,258,4096,Vm)];function Dke(t){t.window_size=2*t.w_size,Kd(t.head),t.max_lazy_match=gg[t.level].max_lazy,t.good_match=gg[t.level].good_length,t.nice_match=gg[t.level].nice_length,t.max_chain_length=gg[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Gi-1,t.match_available=0,t.ins_h=0}function Pke(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=DM,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ds.Buf16(Ske*2),this.dyn_dtree=new Ds.Buf16((2*wke+1)*2),this.bl_tree=new Ds.Buf16((2*bke+1)*2),Kd(this.dyn_ltree),Kd(this.dyn_dtree),Kd(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ds.Buf16(Cke+1),this.heap=new Ds.Buf16(2*nO+1),Kd(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ds.Buf16(2*nO+1),Kd(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function LZ(t){var i;return!t||!t.state?dA(t,El):(t.total_in=t.total_out=0,t.data_type=mke,i=t.state,i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?PM:Hf,t.adler=i.wrap===2?0:1,i.last_flush=Np,yl._tr_init(i),$c)}function OZ(t){var i=LZ(t);return i===$c&&Dke(t.state),i}function Lke(t,i){return!t||!t.state||t.state.wrap!==2?El:(t.state.gzhead=i,$c)}
vendor: 4,315 bytes, line 12053
12053function NZ(t,i,r,n,a,s){if(!t)return El;var o=1;if(i===uke&&(i=6),n<0?(o=0,n=-n):n>15&&(o=2,n-=16),a<1||a>gke||r!==DM||n<8||n>15||i<0||i>9||s<0||s>fke)return dA(t,El);n===8&&(n=9);var l=new Pke;return t.state=l,l.strm=t,l.wrap=o,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Gi-1)/Gi),l.window=new Ds.Buf8(l.w_size*2),l.head=new Ds.Buf16(l.hash_size),l.prev=new Ds.Buf16(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Ds.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=(1+2)*l.lit_bufsize,l.level=i,l.strategy=s,l.method=r,OZ(t)}function Oke(t,i){return NZ(t,i,DM,vke,_ke,pke)}function Nke(t,i){var r,n,a,s;if(!t||!t.state||i>R8||i<0)return t?dA(t,El):El;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===M_&&i!==TA)return dA(t,t.avail_out===0?B2:El);if(n.strm=t,r=n.last_flush,n.last_flush=i,n.status===PM)if(n.wrap===2)t.adler=0,qi(n,31),qi(n,139),qi(n,8),n.gzhead?(qi(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),qi(n,n.gzhead.time&255),qi(n,n.gzhead.time>>8&255),qi(n,n.gzhead.time>>16&255),qi(n,n.gzhead.time>>24&255),qi(n,n.level===9?2:n.strategy>=rS||n.level<2?4:0),qi(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(qi(n,n.gzhead.extra.length&255),qi(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Dd(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=aO):(qi(n,0),qi(n,0),qi(n,0),qi(n,0),qi(n,0),qi(n,n.level===9?2:n.strategy>=rS||n.level<2?4:0),qi(n,Mke),n.status=Hf);else{var o=DM+(n.w_bits-8<<4)<<8,l=-1;n.strategy>=rS||n.level<2?l=0:n.level<6?l=1:n.level===6?l=2:l=3,o|=l<<6,n.strstart!==0&&(o|=Tke),o+=31-o%31,n.status=Hf,i_(n,o),n.strstart!==0&&(i_(n,t.adler>>>16),i_(n,t.adler&65535)),t.adler=1}if(n.status===aO)if(n.gzhead.extra){for(a=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=Dd(t.adler,n.pending_buf,n.pending-a,a)),Pd(t),a=n.pending,n.pending===n.pending_buf_size));)qi(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>a&&(t.adler=Dd(t.adler,n.pending_buf,n.pending-a,a)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=QS)}else n.status=QS;if(n.status===QS)if(n.gzhead.name){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=Dd(t.adler,n.pending_buf,n.pending-a,a)),Pd(t),a=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,qi(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>a&&(t.adler=Dd(t.adler,n.pending_buf,n.pending-a,a)),s===0&&(n.gzindex=0,n.status=VS)}else n.status=VS;if(n.status===VS)if(n.gzhead.comment){a=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>a&&(t.adler=Dd(t.adler,n.pending_buf,n.pending-a,a)),Pd(t),a=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,qi(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>a&&(t.adler=Dd(t.adler,n.pending_buf,n.pending-a,a)),s===0&&(n.status=WS)}else n.status=WS;if(n.status===WS&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Pd(t),n.pending+2<=n.pending_buf_size&&(qi(n,t.adler&255),qi(n,t.adler>>8&255),t.adler=0,n.status=Hf)):n.status=Hf),n.pending!==0){if(Pd(t),t.avail_out===0)return n.last_flush=-1,$c}else if(t.avail_in===0&&I8(i)<=I8(r)&&i!==TA)return dA(t,B2);if(n.status===M_&&t.avail_in!==0)return dA(t,B2);if(t.avail_in!==0||n.lookahead!==0||i!==Np&&n.status!==M_){var c=n.strategy===rS?Ike(n,i):n.strategy===Ake?Bke(n,i):gg[n.level].func(n,i);if((c===mp||c===$0)&&(n.status=M_),c===Jn||c===mp)return t.avail_out===0&&(n.last_flush=-1),$c;if(c===VE&&(i===lke?yl._tr_align(n):i!==R8&&(yl._tr_stored_block(n,0,0,!1),i===cke&&(Kd(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Pd(t),t.avail_out===0))return n.last_flush=-1,$c}return i!==TA?$c:n.wrap<=0?B8:(n.wrap===2?(qi(n,t.adler&255),qi(n,t.adler>>8&255),qi(n,t.adler>>16&255),qi(n,t.adler>>24&255),qi(n,t.total_in&255),qi(n,t.total_in>>8&255),qi(n,t.total_in>>16&255),qi(n,t.total_in>>24&255)):(i_(n,t.adler>>>16),i_(n,t.adler&65535)),Pd(t),n.wrap>
vendor: 4,203 bytes, line 12053
120530&&(n.wrap=-n.wrap),n.pending!==0?$c:B8)}function Uke(t){var i;return!t||!t.state?El:(i=t.state.status,i!==PM&&i!==aO&&i!==QS&&i!==VS&&i!==WS&&i!==Hf&&i!==M_?dA(t,El):(t.state=null,i===Hf?dA(t,hke):$c))}function Fke(t,i){var r=i.length,n,a,s,o,l,c,h,u;if(!t||!t.state||(n=t.state,o=n.wrap,o===2||o===1&&n.status!==PM||n.lookahead))return El;for(o===1&&(t.adler=DZ(t.adler,i,r,0)),n.wrap=0,r>=n.w_size&&(o===0&&(Kd(n.head),n.strstart=0,n.block_start=0,n.insert=0),u=new Ds.Buf8(n.w_size),Ds.arraySet(u,i,r-n.w_size,n.w_size,0),i=u,r=n.w_size),l=t.avail_in,c=t.next_in,h=t.input,t.avail_in=r,t.next_in=0,t.input=i,gp(n);n.lookahead>=Gi;){a=n.strstart,s=n.lookahead-(Gi-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[a+Gi-1])&n.hash_mask,n.prev[a&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=a,a++;while(--s);n.strstart=a,n.lookahead=Gi-1,gp(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=Gi-1,n.match_available=0,t.next_in=c,t.input=h,t.avail_in=l,n.wrap=o,$c}Ch.deflateInit=Oke;Ch.deflateInit2=NZ;Ch.deflateReset=OZ;Ch.deflateResetKeep=LZ;Ch.deflateSetHeader=Lke;Ch.deflate=Nke;Ch.deflateEnd=Uke;Ch.deflateSetDictionary=Fke;Ch.deflateInfo="pako deflate (from Nodeca project)";var Up={},LM=id,UZ=!0,FZ=!0;try{String.fromCharCode.apply(null,[0])}catch{UZ=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{FZ=!1}var $y=new LM.Buf8(256);for(var Cd=0;Cd<256;Cd++)$y[Cd]=Cd>=252?6:Cd>=248?5:Cd>=240?4:Cd>=224?3:Cd>=192?2:1;$y[254]=$y[254]=1;Up.string2buf=function(t){var i,r,n,a,s,o=t.length,l=0;for(a=0;a<o;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(i=new LM.Buf8(l),s=0,a=0;s<l;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?i[s++]=r:r<2048?(i[s++]=192|r>>>6,i[s++]=128|r&63):r<65536?(i[s++]=224|r>>>12,i[s++]=128|r>>>6&63,i[s++]=128|r&63):(i[s++]=240|r>>>18,i[s++]=128|r>>>12&63,i[s++]=128|r>>>6&63,i[s++]=128|r&63);return i};function kZ(t,i){if(i<65537&&(t.subarray&&FZ||!t.subarray&&UZ))return String.fromCharCode.apply(null,LM.shrinkBuf(t,i));for(var r="",n=0;n<i;n++)r+=String.fromCharCode(t[n]);return r}Up.buf2binstring=function(t){return kZ(t,t.length)};Up.binstring2buf=function(t){for(var i=new LM.Buf8(t.length),r=0,n=i.length;r<n;r++)i[r]=t.charCodeAt(r);return i};Up.buf2string=function(t,i){var r,n,a,s,o=i||t.length,l=new Array(o*2);for(n=0,r=0;r<o;){if(a=t[r++],a<128){l[n++]=a;continue}if(s=$y[a],s>4){l[n++]=65533,r+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&r<o;)a=a<<6|t[r++]&63,s--;if(s>1){l[n++]=65533;continue}a<65536?l[n++]=a:(a-=65536,l[n++]=55296|a>>10&1023,l[n++]=56320|a&1023)}return kZ(l,n)};Up.utf8border=function(t,i){var r;for(i=i||t.length,i>t.length&&(i=t.length),r=i-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?i:r+$y[t[r]]>i?r:i};function kke(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var HZ=kke,ay=Ch,sy=id,sO=Up,D8=QU,Hke=HZ,GZ=Object.prototype.toString,Gke=0,D2=4,Qg=0,P8=1,L8=2,zke=-1,Qke=0,Vke=8;function vp(t){if(!(this instanceof vp))return new vp(t);this.options=sy.assign({level:zke,method:Vke,chunkSize:16384,windowBits:15,memLevel:8,strategy:Qke,to:""},t||{});var i=this.options;i.raw&&i.windowBits>0?i.windowBits=-i.windowBits:i.gzip&&i.windowBits>0&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Hke,this.strm.avail_out=0;var r=ay.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(r!==Qg)throw new Error(D8[r]);if(i.header&&ay.deflateSetHeader(this.strm,i.header),i.dictionary){var n;if(typeof i.dictionary=="string"?n=sO.string2buf(i.dictionary):GZ.call(i.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(i.dictionary):n=i.dictionary,r=ay.deflateSetDictionary(this.strm,n),r!==Qg)throw new Error(D8[r]);this._dict_set=!0}}vp.prototype.push=function(t,i){var r=this.strm,n=this.options.chunkSize,a,s;if(this.ended)return!1;
vendor: 7,833 bytes, line 12053
12053s=i===~~i?i:i===!0?D2:Gke,typeof t=="string"?r.input=sO.string2buf(t):GZ.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new sy.Buf8(n),r.next_out=0,r.avail_out=n),a=ay.deflate(r,s),a!==P8&&a!==Qg)return this.onEnd(a),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===D2||s===L8))&&(this.options.to==="string"?this.onData(sO.buf2binstring(sy.shrinkBuf(r.output,r.next_out))):this.onData(sy.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&a!==P8);return s===D2?(a=ay.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Qg):(s===L8&&(this.onEnd(Qg),r.avail_out=0),!0)};vp.prototype.onData=function(t){this.chunks.push(t)};vp.prototype.onEnd=function(t){t===Qg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=sy.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function VU(t,i){var r=new vp(i);if(r.push(t,!0),r.err)throw r.msg;return r.result}function Wke(t,i){return i=i||{},i.raw=!0,VU(t,i)}function jke(t,i){return i=i||{},i.gzip=!0,VU(t,i)}zE.Deflate=vp;zE.deflate=VU;zE.deflateRaw=Wke;zE.gzip=jke;var WE={},Sc={},nS=30,Yke=12,Kke=function(i,r){var n,a,s,o,l,c,h,u,d,A,f,m,g,p,v,_,y,w,b,E,M,S,T,C,x;n=i.state,a=i.next_in,C=i.input,s=a+(i.avail_in-5),o=i.next_out,x=i.output,l=o-(r-i.avail_out),c=o+(i.avail_out-257),h=n.dmax,u=n.wsize,d=n.whave,A=n.wnext,f=n.window,m=n.hold,g=n.bits,p=n.lencode,v=n.distcode,_=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{g<15&&(m+=C[a++]<<g,g+=8,m+=C[a++]<<g,g+=8),w=p[m&_];t:for(;;){if(b=w>>>24,m>>>=b,g-=b,b=w>>>16&255,b===0)x[o++]=w&65535;else if(b&16){E=w&65535,b&=15,b&&(g<b&&(m+=C[a++]<<g,g+=8),E+=m&(1<<b)-1,m>>>=b,g-=b),g<15&&(m+=C[a++]<<g,g+=8,m+=C[a++]<<g,g+=8),w=v[m&y];i:for(;;){if(b=w>>>24,m>>>=b,g-=b,b=w>>>16&255,b&16){if(M=w&65535,b&=15,g<b&&(m+=C[a++]<<g,g+=8,g<b&&(m+=C[a++]<<g,g+=8)),M+=m&(1<<b)-1,M>h){i.msg="invalid distance too far back",n.mode=nS;break e}if(m>>>=b,g-=b,b=o-l,M>b){if(b=M-b,b>d&&n.sane){i.msg="invalid distance too far back",n.mode=nS;break e}if(S=0,T=f,A===0){if(S+=u-b,b<E){E-=b;do x[o++]=f[S++];while(--b);S=o-M,T=x}}else if(A<b){if(S+=u+A-b,b-=A,b<E){E-=b;do x[o++]=f[S++];while(--b);if(S=0,A<E){b=A,E-=b;do x[o++]=f[S++];while(--b);S=o-M,T=x}}}else if(S+=A-b,b<E){E-=b;do x[o++]=f[S++];while(--b);S=o-M,T=x}for(;E>2;)x[o++]=T[S++],x[o++]=T[S++],x[o++]=T[S++],E-=3;E&&(x[o++]=T[S++],E>1&&(x[o++]=T[S++]))}else{S=o-M;do x[o++]=x[S++],x[o++]=x[S++],x[o++]=x[S++],E-=3;while(E>2);E&&(x[o++]=x[S++],E>1&&(x[o++]=x[S++]))}}else if(b&64){i.msg="invalid distance code",n.mode=nS;break e}else{w=v[(w&65535)+(m&(1<<b)-1)];continue i}break}}else if(b&64)if(b&32){n.mode=Yke;break e}else{i.msg="invalid literal/length code",n.mode=nS;break e}else{w=p[(w&65535)+(m&(1<<b)-1)];continue t}break}}while(a<s&&o<c);E=g>>3,a-=E,g-=E<<3,m&=(1<<g)-1,i.next_in=a,i.next_out=o,i.avail_in=a<s?5+(s-a):5-(a-s),i.avail_out=o<c?257+(c-o):257-(o-c),n.hold=m,n.bits=g},O8=id,Wm=15,N8=852,U8=592,F8=0,P2=1,k8=2,Xke=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],qke=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],Zke=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],Jke=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],$ke=function(i,r,n,a,s,o,l,c){var h=c.bits,u=0,d=0,A=0,f=0,m=0,g=0,p=0,v=0,_=0,y=0,w,b,E,M,S,T=null,C=0,x,R=new O8.Buf16(Wm+1),L=new O8.Buf16(Wm+1),I=null,F=0,Y,D,U;for(u=0;u<=Wm;u++)R[u]=0;for(d=0;d<a;d++)R[r[n+d]]++;for(m=h,f=Wm;f>=1&&R[f]===0;f--);if(m>f&&(m=f),f===0)return s[o++]=1<<24|64<<16|0,s[o++]=1<<24|64<<16|0,c.bits=1,0;for(A=1;A<f&&R[A]===0;A++);for(m<A&&(m=A),v=1,u=1;u<=Wm;u++)if(v<<=1,v-=R[u],v<0)return-1;if(v>0&&(i===F8||f!==1))return-1;for(L[1]=0,u=1;u<Wm;u++)L[u+1]=L[u]+R[u];for(d=0;d<a;d++)r[n+d]!==0&&(l[L[r[n+d]]++]=d);if(i===F8?(T=I=l,x=19):i===P2?(T=Xke,C-=257,I=qke,F-=257,x=256):(T=Zke,I=Jke,x=-1),y=0,d=0,u=A,S=o,g=m,p=0,E=-1,_=1<<m,M=_-1,i===P2&&_>N8||i===k8&&_>U8)return 1;for(;;){Y=u-p,l[d]<x?(D=0,U=l[d]):l[d]>x?(D=I[F+l[d]],U=T[C+l[d]]):(D=32+64,U=0),w=1<<u-p,b=1<<g,A=b;do b-=w,s[S+(y>>p)+b]=Y<<24|D<<16|U|0;while(b!==0);for(w=1<<u-1;y&w;)w>>=1;if(w!==0?(y&=w-1,y+=w):y=0,d++,--R[u]===0){if(u===f)break;u=r[n+l[d]]}if(u>m&&(y&M)!==E){for(p===0&&(p=m),S+=A,g=u-p,v=1<<g;g+p<f&&(v-=R[g+p],!(v<=0));)g++,v<<=1;if(_+=1<<g,i===P2&&_>N8||i===k8&&_>U8)return 1;E=y&M,s[E]=m<<24|g<<16|S-o|0}}return y!==0&&(s[S+y]=u-p<<24|64<<16|0),c.bits=m,0},Po=id,oO=BZ,Fc=IZ,eHe=Kke,oy=$ke,tHe=0,zZ=1,QZ=2,H8=4,iHe=5,aS=6,_p=0,rHe=1,nHe=2,Cl=-2,VZ=-3,WZ=-4,aHe=-5,G8=8,jZ=1,z8=2,Q8=3,V8=4,W8=5,j8=6,Y8=7,K8=8,X8=9,q8=10,CT=11,Kh=12,L2=13,Z8=14,O2=15,J8=16,$8=17,eW=18,tW=19,sS=20,oS=21,iW=22,rW=23,nW=24,aW=25,sW=26,N2=27,oW=28,lW=29,jr=30,YZ=31,sHe=32,oHe=852,lHe=592,cHe=15,hHe=cHe;function cW(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function uHe(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Po.Buf16(320),this.work=new Po.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function KZ(t){var i;return!t||!t.state?Cl:(i=t.state,t.total_in=t.total_out=i.total=0,t.msg="",i.wrap&&(t.adler=i.wrap&1),i.mode=jZ,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new Po.Buf32(oHe),i.distcode=i.distdyn=new Po.Buf32(lHe),i.sane=1,i.back=-1,_p)}function XZ(t){var i;return!t||!t.state?Cl:(i=t.state,i.wsize=0,i.whave=0,i.wnext=0,KZ(t))}function qZ(t,i){var r,n;return!t||!t.state||(n=t.state,i<0?(r=0,i=-i):(r=(i>>4)+1,i<48&&(i&=15)),i&&(i<8||i>15))?Cl:(n.window!==null&&n.wbits!==i&&(n.window=null),n.wrap=r,n.wbits=i,XZ(t))}function ZZ(t,i){var r,n;return t?(n=new uHe,t.state=n,n.window=null,r=qZ(t,i),r!==_p&&(t.state=null),r):Cl}function dHe(t){return ZZ(t,hHe)}var hW=!0,U2,F2;function AHe(t){if(hW){var i;for(U2=new Po.Buf32(512),F2=new Po.Buf32(32),i=0;i<144;)t.lens[i++]=8;for(;i<256;)t.lens[i++]=9;for(;i<280;)t.lens[i++]=7;for(;i<288;)t.lens[i++]=8;for(oy(zZ,t.lens,0,288,U2,0,t.work,{bits:9}),i=0;i<32;)t.lens[i++]=5;oy(QZ,t.lens,0,32,F2,0,t.work,{bits:5}),hW=!1}t.lencode=U2,t.lenbits=9,t.distcode=F2,t.distbits=5}function JZ(t,i,r,n){var a,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Po.Buf8(s.wsize)),n>=s.wsize?(Po.arraySet(s.window,i,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>n&&(a=n),Po.arraySet(s.window,i,r-n,a,s.wnext),n-=a,n?(Po.arraySet(s.window,i,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0}function fHe(t,i){var r,n,a,s,o,l,c,h,u,d,A,f,m,g,p=0,v,_,y,w,b,E,M,S,T=new Po.Buf8(4),C,x,R=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Cl;r=t.state,r.mode===Kh&&(r.mode=L2),o=t.next_out,a=t.output,c=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,h=r.hold,u=r.bits,d=l,A=c,S=_p;e:for(;;)switch(r.mode){case jZ:if(r.wrap===0){r.mode=L2;break}for(;u<16;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(r.wrap&2&&h===35615){r.check=0,T[0]=h&255,T[1]=h>>>8&255,r.check=Fc(r.check,T,2,0),h=0,u=0,r.mode=z8;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",r.mode=jr;break}if((h&15)!==G8){t.msg="unknown compression method",r.mode=jr;break}if(h>>>
vendor: 4,397 bytes, line 12053
12053=4,u-=4,M=(h&15)+8,r.wbits===0)r.wbits=M;else if(M>r.wbits){t.msg="invalid window size",r.mode=jr;break}r.dmax=1<<M,t.adler=r.check=1,r.mode=h&512?q8:Kh,h=0,u=0;break;case z8:for(;u<16;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(r.flags=h,(r.flags&255)!==G8){t.msg="unknown compression method",r.mode=jr;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=jr;break}r.head&&(r.head.text=h>>8&1),r.flags&512&&(T[0]=h&255,T[1]=h>>>8&255,r.check=Fc(r.check,T,2,0)),h=0,u=0,r.mode=Q8;case Q8:for(;u<32;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}r.head&&(r.head.time=h),r.flags&512&&(T[0]=h&255,T[1]=h>>>8&255,T[2]=h>>>16&255,T[3]=h>>>24&255,r.check=Fc(r.check,T,4,0)),h=0,u=0,r.mode=V8;case V8:for(;u<16;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}r.head&&(r.head.xflags=h&255,r.head.os=h>>8),r.flags&512&&(T[0]=h&255,T[1]=h>>>8&255,r.check=Fc(r.check,T,2,0)),h=0,u=0,r.mode=W8;case W8:if(r.flags&1024){for(;u<16;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}r.length=h,r.head&&(r.head.extra_len=h),r.flags&512&&(T[0]=h&255,T[1]=h>>>8&255,r.check=Fc(r.check,T,2,0)),h=0,u=0}else r.head&&(r.head.extra=null);r.mode=j8;case j8:if(r.flags&1024&&(f=r.length,f>l&&(f=l),f&&(r.head&&(M=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Po.arraySet(r.head.extra,n,s,f,M)),r.flags&512&&(r.check=Fc(r.check,n,f,s)),l-=f,s+=f,r.length-=f),r.length))break e;r.length=0,r.mode=Y8;case Y8:if(r.flags&2048){if(l===0)break e;f=0;do M=n[s+f++],r.head&&M&&r.length<65536&&(r.head.name+=String.fromCharCode(M));while(M&&f<l);if(r.flags&512&&(r.check=Fc(r.check,n,f,s)),l-=f,s+=f,M)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=K8;case K8:if(r.flags&4096){if(l===0)break e;f=0;do M=n[s+f++],r.head&&M&&r.length<65536&&(r.head.comment+=String.fromCharCode(M));while(M&&f<l);if(r.flags&512&&(r.check=Fc(r.check,n,f,s)),l-=f,s+=f,M)break e}else r.head&&(r.head.comment=null);r.mode=X8;case X8:if(r.flags&512){for(;u<16;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(h!==(r.check&65535)){t.msg="header crc mismatch",r.mode=jr;break}h=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Kh;break;case q8:for(;u<32;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}t.adler=r.check=cW(h),h=0,u=0,r.mode=CT;case CT:if(r.havedict===0)return t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=l,r.hold=h,r.bits=u,nHe;t.adler=r.check=1,r.mode=Kh;case Kh:if(i===iHe||i===aS)break e;case L2:if(r.last){h>>>=u&7,u-=u&7,r.mode=N2;break}for(;u<3;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}switch(r.last=h&1,h>>>=1,u-=1,h&3){case 0:r.mode=Z8;break;case 1:if(AHe(r),r.mode=sS,i===aS){h>>>=2,u-=2;break e}break;case 2:r.mode=$8;break;case 3:t.msg="invalid block type",r.mode=jr}h>>>=2,u-=2;break;case Z8:for(h>>>=u&7,u-=u&7;u<32;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",r.mode=jr;break}if(r.length=h&65535,h=0,u=0,r.mode=O2,i===aS)break e;case O2:r.mode=J8;case J8:if(f=r.length,f){if(f>l&&(f=l),f>c&&(f=c),f===0)break e;Po.arraySet(a,n,s,f,o),l-=f,s+=f,c-=f,o+=f,r.length-=f;break}r.mode=Kh;break;case $8:for(;u<14;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(r.nlen=(h&31)+257,h>>>=5,u-=5,r.ndist=(h&31)+1,h>>>=5,u-=5,r.ncode=(h&15)+4,h>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=jr;break}r.have=0,r.mode=eW;case eW:for(;r.have<r.ncode;){for(;u<3;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}r.lens[R[r.have++]]=h&7,h>>>=3,u-=3}for(;r.have<19;)r.lens[R[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,C={bits:r.lenbits},S=oy(tHe,r.lens,0,19,r.lencode,0,r.work,C),r.lenbits=C.bits,S){t.msg="invalid code lengths set",r.mode=jr;break}r.have=0,r.mode=tW;case tW:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[h&(1<<r.lenbits)-1],v=p>>>24,_=p>>>16&255,y=p&65535,!(v<=u);){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(y<16)h>>>=v,u-=v,r.lens[r.have++]=y;else{if(y===16){for(x=v+2;u<x;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(h>>>=v,u-=v,r.have===0){t.msg="invalid bit length repeat",r.mode=jr;break}M=r.lens[r.have-1],f=3+(h&3),h>>>=2,u-=2}else if(y===17){for(x=v+3;u<x;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}h>>>=v,u-=v,M=0,f=3+(h&7),h>>>=3,u-=3}else{for(x=v+7;u<x;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}h>>>=v,u-=v,M=0,f=11+(h&127),h>>>=7,u-=7}if(r.have+f>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=jr;break}for(;f--;)r.lens[r.have++]=M}}if(r.mode===jr)break;
vendor: 4,190 bytes, line 12053
12053if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=jr;break}if(r.lenbits=9,C={bits:r.lenbits},S=oy(zZ,r.lens,0,r.nlen,r.lencode,0,r.work,C),r.lenbits=C.bits,S){t.msg="invalid literal/lengths set",r.mode=jr;break}if(r.distbits=6,r.distcode=r.distdyn,C={bits:r.distbits},S=oy(QZ,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,C),r.distbits=C.bits,S){t.msg="invalid distances set",r.mode=jr;break}if(r.mode=sS,i===aS)break e;case sS:r.mode=oS;case oS:if(l>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=l,r.hold=h,r.bits=u,eHe(t,A),o=t.next_out,a=t.output,c=t.avail_out,s=t.next_in,n=t.input,l=t.avail_in,h=r.hold,u=r.bits,r.mode===Kh&&(r.back=-1);break}for(r.back=0;p=r.lencode[h&(1<<r.lenbits)-1],v=p>>>24,_=p>>>16&255,y=p&65535,!(v<=u);){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(_&&!(_&240)){for(w=v,b=_,E=y;p=r.lencode[E+((h&(1<<w+b)-1)>>w)],v=p>>>24,_=p>>>16&255,y=p&65535,!(w+v<=u);){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}h>>>=w,u-=w,r.back+=w}if(h>>>=v,u-=v,r.back+=v,r.length=y,_===0){r.mode=sW;break}if(_&32){r.back=-1,r.mode=Kh;break}if(_&64){t.msg="invalid literal/length code",r.mode=jr;break}r.extra=_&15,r.mode=iW;case iW:if(r.extra){for(x=r.extra;u<x;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=rW;case rW:for(;p=r.distcode[h&(1<<r.distbits)-1],v=p>>>24,_=p>>>16&255,y=p&65535,!(v<=u);){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(!(_&240)){for(w=v,b=_,E=y;p=r.distcode[E+((h&(1<<w+b)-1)>>w)],v=p>>>24,_=p>>>16&255,y=p&65535,!(w+v<=u);){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}h>>>=w,u-=w,r.back+=w}if(h>>>=v,u-=v,r.back+=v,_&64){t.msg="invalid distance code",r.mode=jr;break}r.offset=y,r.extra=_&15,r.mode=nW;case nW:if(r.extra){for(x=r.extra;u<x;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=jr;break}r.mode=aW;case aW:if(c===0)break e;if(f=A-c,r.offset>f){if(f=r.offset-f,f>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=jr;break}f>r.wnext?(f-=r.wnext,m=r.wsize-f):m=r.wnext-f,f>r.length&&(f=r.length),g=r.window}else g=a,m=o-r.offset,f=r.length;f>c&&(f=c),c-=f,r.length-=f;do a[o++]=g[m++];while(--f);r.length===0&&(r.mode=oS);break;case sW:if(c===0)break e;a[o++]=r.length,c--,r.mode=oS;break;case N2:if(r.wrap){for(;u<32;){if(l===0)break e;l--,h|=n[s++]<<u,u+=8}if(A-=c,t.total_out+=A,r.total+=A,A&&(t.adler=r.check=r.flags?Fc(r.check,a,A,o-A):oO(r.check,a,A,o-A)),A=c,(r.flags?h:cW(h))!==r.check){t.msg="incorrect data check",r.mode=jr;break}h=0,u=0}r.mode=oW;case oW:if(r.wrap&&r.flags){for(;u<32;){if(l===0)break e;l--,h+=n[s++]<<u,u+=8}if(h!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=jr;break}h=0,u=0}r.mode=lW;case lW:S=rHe;break e;case jr:S=VZ;break e;case YZ:return WZ;case sHe:default:return Cl}return t.next_out=o,t.avail_out=c,t.next_in=s,t.avail_in=l,r.hold=h,r.bits=u,(r.wsize||A!==t.avail_out&&r.mode<jr&&(r.mode<N2||i!==H8))&&JZ(t,t.output,t.next_out,A-t.avail_out),d-=t.avail_in,A-=t.avail_out,t.total_in+=d,t.total_out+=A,r.total+=A,r.wrap&&A&&(t.adler=r.check=r.flags?Fc(r.check,a,A,t.next_out-A):oO(r.check,a,A,t.next_out-A)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Kh?128:0)+(r.mode===sS||r.mode===O2?256:0),(d===0&&A===0||i===H8)&&S===_p&&(S=aHe),S}function pHe(t){if(!t||!t.state)return Cl;var i=t.state;return i.window&&(i.window=null),t.state=null,_p}function mHe(t,i){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Cl:(r.head=i,i.done=!1,_p)}function gHe(t,i){var r=i.length,n,a,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==CT)?Cl:n.mode===CT&&(a=1,a=oO(a,i,r,0),a!==n.check)?VZ:(s=JZ(t,i,r,r),s?(n.mode=YZ,WZ):(n.havedict=1,_p))}Sc.inflateReset=XZ;Sc.inflateReset2=qZ;Sc.inflateResetKeep=KZ;Sc.inflateInit=dHe;Sc.inflateInit2=ZZ;Sc.inflate=fHe;Sc.inflateEnd=pHe;Sc.inflateGetHeader=mHe;Sc.inflateSetDictionary=gHe;Sc.inflateInfo="pako inflate (from Nodeca project)";var $Z={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ER
12053ROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};function vHe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var _He=vHe,ly=Sc,cy=id,lS=Up,Bn=$Z,yHe=QU,EHe=HZ,wHe=_He,uW=Object.prototype.toString;function yp(t){if(!(this instanceof yp))return new yp(t);this.options=cy.assign({chunkSize:16384,windowBits:0,to:""},t||{});var i=this.options;i.raw&&i.windowBits>=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(t&&t.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15||(i.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new EHe,this.strm.avail_out=0;var r=ly.inflateInit2(this.strm,i.windowBits);if(r!==Bn.Z_OK)throw new Error(yHe[r]);this.header=new wHe,ly.inflateGetHeader(this.strm,this.header)}yp.prototype.push=function(t,i){var r=this.strm,n=this.options.chunkSize,a=this.options.dictionary,s,o,l,c,h,u,d=!1;if(this.ended)return!1;o=i===~~i?i:i===!0?Bn.Z_FINISH:Bn.Z_NO_FLUSH,typeof t=="string"?r.input=lS.binstring2buf(t):uW.call(t)==="[object ArrayBuffer]"?r.input
12053=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new cy.Buf8(n),r.next_out=0,r.avail_out=n),s=ly.inflate(r,Bn.Z_NO_FLUSH),s===Bn.Z_NEED_DICT&&a&&(typeof a=="string"?u=lS.string2buf(a):uW.call(a)==="[object ArrayBuffer]"?u=new Uint8Array(a):u=a,s=ly.inflateSetDictionary(this.strm,u)),s===Bn.Z_BUF_ERROR&&d===!0&&(s=Bn.Z_OK,d=!1),s!==Bn.Z_STREAM_END&&s!==Bn.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===Bn.Z_STREAM_END||r.avail_in===0&&(o===Bn.Z_FINISH||o===Bn.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=lS.utf8border(r.output,r.next_out),c=r.next_out-l,h=lS.buf2string(r.output,l),r.next_out=c,r.avail_out=n-c,c&&cy.arraySet(r.output,r.output,l,c,0),this.onData(h)):this.onData(cy.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(d=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==Bn.Z_STREAM_END);return s===Bn.Z_STREAM_END&&(o=Bn.Z_FINISH),o===Bn.Z_FINISH?(s=ly.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Bn.Z_OK):(o===Bn.Z_SYNC_FLUSH&&(this.onEnd(Bn.Z_OK),r.avail_out=0),!0)};yp.prototype.onData=function(t){this.chunks.push(t)};yp.prototype.onEnd=function(t){t===Bn.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=cy.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function WU(t,i){var r=new yp(i);if(r.push(t,!0),r.err)throw r.msg;return r.result}function bHe(t,i){return i=i||{},i.raw=!0,WU(t,i)}WE.Inflate=yp;WE.inflate=WU;WE.inflateRaw=bHe;WE.ungzip=WU;var SHe=id.assign,CHe=zE,THe=WE,MHe=$Z,eJ={};SHe(eJ,CHe,THe,MHe);var xHe=eJ,tJ=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",iJ=xHe;q0.uncompressInputType=tJ?"uint8array":"array";q0.compressInputType=tJ?"uint8array":"array";q0.magic="\b\0";q0.compress=function(t,i){return iJ.deflateRaw(t,{level:i.level||-1})};q0.uncompress=function(t){return iJ.inflateRaw(t)};GE.STORE={magic:"\0\0",compress:function(t,i){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null};GE.DEFLATE=q0;var jU={exports:{}};jU.exports=function(t,i){return new Buffer(t,i)};jU.exports.test=function(t){return Buffer.isBuffer(t)};var YU=jU.exports;(function(t){var i=Fs,r=GE,n=YU;t.string2binary=function(h){for(var u="",d=0;d<h.length;d++)u+=String.fromCharCode(h.charCodeAt(d)&255);return u},t.arrayBuffer2Blob=function(h,u){t.checkSupport("blob"),u=u||"application/zip";try{return new Blob([h],{type:u})}catch{try{var d=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,A=new d;return A.append(h),A.getBlob(u)}catch{throw new Error("Bug : can't construct the Blob.")}}};function a(h){return h}function s(h,u){for(var d=0;d<h.length;++d)u[d]=h.charCodeAt(d)&255;return u}function o(h){var u=65536,d=[],A=h.length,f=t.getTypeOf(h),m=0,g=!0;try{switch(f){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,n(0));break}}catch{g=!1}if(!g){for(var p="",v=0;v<h.length;v++)p+=String.fromCharCode(h[v]);return p}for(;m<A&&u>1;)try{f==="array"||f==="nodebuffer"?d.push(String.fromCharCode.apply(null,h.slice(m,Math.min(m+u,A)))):d.push(String.fromCharCode.apply(null,h.subarray(m,Math.min(m+u,A)))),m+=u}catch{u=Math.floor(u/2)}return d.join("")}t.applyFromCharCode=o;function l(h,u){for(var d=0;d<h.length;d++)u[d]=h[d];return u}var c={};c.string={string:a,array:function(h){return s(h,new Array(h.length))},arraybuffer:function(h){return c.string.uint8array(h).buffer},uint8array:function(h){return s(h,new Uint8Array(h.length))},nodebuffer:function(h){return s(h,n(h.length))}},c.array={string:o,array:a,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return n(h)}},c.arraybuffer={string:function(h){return o(new Uint8Array(h))},array:function(h){return l(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:a,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return n(new Uint8Array(h))}},c.uint8array={string:o,array:function(h){return l(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:a,nodebuffer:function(h){return n(h)}},c.nodebuffer={string:o,array:function(h){return l(h,new Array(h.length))},arraybuffer:function(h){return c.nodebuffer.uint8array(h).buffer},uint8array:function(h){return l(h,new Uint8Array(h.length))},nodebuffer:a},t.transformTo=function(h,u){if(u||(u=""),!h)return u;t.checkSupport(h);var d=t.getTypeOf(u),A=c[d][h](u);return A},t.getTypeOf=function(h){if(typeof h=="string")return"string";if(Object.prototype.toString.call(h)==="[object Array]")return"array";if(i.nodebuffer&&n.test(h))return"nodebuffer";if(i.uint8array&&h instanceof Uint8Array)return"uint8array";if(i.arraybuffer&&h instanceof ArrayBuffer)return"arraybuffer"},t.checkSupport=function(h){var u=i[h.toLowerCase()];if(!u)throw new Error(h+" is not supported by this browser")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(h){var u="",d,A;
12053for(A=0;A<(h||"").length;A++)d=h.charCodeAt(A),u+="\\x"+(d<16?"0":"")+d.toString(16).toUpperCase();return u},t.findCompression=function(h){for(var u in r)if(r.hasOwnProperty(u)&&r[u].magic===h)return r[u];return null},t.isRegExp=function(h){return Object.prototype.toString.call(h)==="[object RegExp]"}})(bc);var RHe=bc,BHe=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],IHe=function(i,r){if(typeof i>"u"||!i.length)return 0;var n=RHe.getTypeOf(i)!=="string";typeof r>"u"&&(r=0);var a=0,s=0,o=0;r=r^-1;for(var l=0,c=i.length;l<c;l++)o=n?i[l]:i.charCodeAt(l),s=(r^o)&255,a=BHe[s],r=r>>>8^a;return r^-1},YA={};YA.LOCAL_FILE_HEADER="PK��";YA.CENTRAL_FILE_HEADER="PK��";YA.CENTRAL_DIRECTORY_END="PK��";YA.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK�\x07";YA.ZIP64_CENTRAL_DIRECTORY_END="PK��";YA.DATA_DESCRIPTOR="PK\x07\b";var Pl={};Pl.base64=!1;Pl.binary=!1;Pl.dir=!1;Pl.createFolders=!1;Pl.date=null;Pl.compression=null;Pl.compressionOptions=null;Pl.comment=null;Pl.unixPermissions=null;Pl.dosPermissions=null;function rJ(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}rJ.prototype={getContent:function(){return null},getCompressedContent:function(){return null}};var nJ=rJ,KU={},lO=bc,hy=Fs,DHe=YU,eE=new Array(256);for(var Td=0;Td<256;Td++)eE[Td]=Td>=252?6:Td>=248?5:Td>=240?4:Td>=224?3:Td>=192?2:1;eE[254]=eE[254]=1;var PHe=function(t){var i,r,n,a,s,o=t.length,l=0;for(a=0;a<o;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(hy.uint8array?i=new Uint8Array(l):i=new Array(l),s=0,a=0;s<l;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?i[s++]=r:r<2048?(i[s++]=192|r>>>6,i[s++]=128|r&63):r<65536?(i[s++]=224|r>>>12,i[s++]=128|r>>>6&63,i[s++]=128|r&63):(i[s++]=240|r>>>18,i[s++]=128|r>>>12&63,i[s++]=128|r>>>6&63,i[s++]=128|r&63);return i},LHe=function(t,i){var r;for(i=i||t.length,i>t.length&&(i=t.length),r=i-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?i:r+eE[t[r]]>i?r:i},dW=function(t){var i,r,n,a,s=t.length,o=new Array(s*2);for(r=0,i=0;i<s;){if(n=t[i++],n<128){o[r++]=n;continue}if(a=eE[n],a>4){o[r++]=65533,i+=a-1;continue}for(n&=a===2?31:a===3?15:7;a>1&&i<s;)n=n<<6|t[i++]&63,a--;if(a>1){o[r++]=65533;continue}n<65536?o[r++]=n:(n-=65536,o[r++]=55296|n>>10&1023,o[r++]=56320|n&1023)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),lO.applyFromCharCode(o)};KU.utf8encode=function(i){return hy.nodebuffer?DHe(i,"utf-8"):PHe(i)};KU.utf8decode=function(i){if(hy.nodebuffer)return lO.transformTo("nodebuffer",i).toString("utf-8");i=lO.transformTo(hy.uint8array?"uint8array":"array",i);for(var r=[],n=0,a=i.length,s=65536;n<a;){var o=LHe(i,Math.min(n+s,a));hy.uint8array?r.push(dW(i.subarray(n,o))):r.push(dW(i.slice(n,o))),n=o}return r.join("")};var OHe=bc,aJ=function(){this.data=[]};aJ.prototype={append:function(t){t=OHe.transformTo("string",t),this.data.push(t)},finalize:function(){return this.data.join("")}};var NHe=aJ,UHe=bc,sJ=function(t){this.data=new Uint8Array(t),this.index=0};sJ.prototype={append:function(t){t.length!==0&&(t=UHe.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}};var FHe=sJ,kHe=Fs,En=bc,XU=IHe,cO=YA,HHe=Pl,oJ=HE,hO=GE,TT=nJ,GHe=YU,MT=KU,zHe=NHe,QHe=FHe,lJ=function(t){if(t._data instanceof TT&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,En.getTypeOf(t._data)==="uint8array")){var i=t._data;t._data=new Uint8Array(i.length),i.length!==0&&t._data.set(i,0)}return t._data},uO=function(t){var i=lJ(t),r=En.getTypeOf(i);return r==="string"?!t.options.binary&&kHe.nodebuffer?GHe(i,"utf-8"):t.asBinary():i},AW=function(t){var i=lJ(this);return i===null||typeof i>"u"?"":(this.options.base64&&(i=oJ.decode(i)),t&&this.options.binary?i=AO.utf8decode(i):i=En.transformTo("string",i),!t&&!this.options.binary&&(i=En.transformTo("string",AO.utf8encode(i))),i)},qU=function(t,i,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=i,this.options=r,this._initialMetadata={dir:r.dir,date:r.date}};qU.prototype={asText:function(){return AW.call(this,!0)},asBinary:function(){return AW.call(this,!1)},asNodeBuffer:function(){var t=uO(this);return En.transformTo("nodebuffer",t)},asUint8Array:function(){var t=uO(this);return En.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}};
12053var rn=function(t,i){var r="",n;for(n=0;n<i;n++)r+=String.fromCharCode(t&255),t=t>>>8;return r},dO=function(){var t={},i,r;for(i=0;i<arguments.length;i++)for(r in arguments[i])arguments[i].hasOwnProperty(r)&&typeof t[r]>"u"&&(t[r]=arguments[i][r]);return t},VHe=function(t){return t=t||{},t.base64===!0&&(t.binary===null||t.binary===void 0)&&(t.binary=!0),t=dO(t,HHe),t.date=t.date||new Date,t.compression!==null&&(t.compression=t.compression.toUpperCase()),t},cJ=function(t,i,r){var n=En.getTypeOf(i),a;if(r=VHe(r),typeof r.unixPermissions=="string"&&(r.unixPermissions=parseInt(r.unixPermissions,8)),r.unixPermissions&&r.unixPermissions&16384&&(r.dir=!0),r.dosPermissions&&r.dosPermissions&16&&(r.dir=!0),r.dir&&(t=hJ(t)),r.createFolders&&(a=WHe(t))&&uJ.call(this,a,!0),r.dir||i===null||typeof i>"u")r.base64=!1,r.binary=!1,i=null,n=null;else if(n==="string")r.binary&&!r.base64&&r.optimizedBinaryString!==!0&&(i=En.string2binary(i));else{if(r.base64=!1,r.binary=!0,!n&&!(i instanceof TT))throw new Error("The data of '"+t+"' is in an unsupported format !");n==="arraybuffer"&&(i=En.transformTo("uint8array",i))}var s=new qU(t,i,r);return this.files[t]=s,s},WHe=function(t){t.slice(-1)=="/"&&(t=t.substring(0,t.length-1));var i=t.lastIndexOf("/");return i>0?t.substring(0,i):""},hJ=function(t){return t.slice(-1)!="/"&&(t+="/"),t},uJ=function(t,i){return i=typeof i<"u"?i:!1,t=hJ(t),this.files[t]||cJ.call(this,t,null,{dir:!0,createFolders:i}),this.files[t]},jHe=function(t,i,r){var n=new TT,a;return t._data instanceof TT?(n.uncompressedSize=t._data.uncompressedSize,n.crc32=t._data.crc32,n.uncompressedSize===0||t.dir?(i=hO.STORE,n.compressedContent="",n.crc32=0):t._data.compressionMethod===i.magic?n.compressedContent=t._data.getCompressedContent():(a=t._data.getContent(),n.compressedContent=i.compress(En.transformTo(i.compressInputType,a),r))):(a=uO(t),(!a||a.length===0||t.dir)&&(i=hO.STORE,a=""),n.uncompressedSize=a.length,n.crc32=XU(a),n.compressedContent=i.compress(En.transformTo(i.compressInputType,a),r)),n.compressedSize=n.compressedContent.length,n.compressionMethod=i.magic,n},YHe=function(t,i){var r=t;return t||(r=i?16893:33204),(r&65535)<<16},KHe=function(t,i){return(t||0)&63},XHe=function(t,i,r,n,a){r.compressedContent;var s=En.transformTo("string",MT.utf8encode(i.name)),o=i.comment||"",l=En.transformTo("string",MT.utf8encode(o)),c=s.length!==i.name.length,h=l.length!==o.length,u=i.options,d,A,f="",m="",g="",p,v;i._initialMetadata.dir!==i.dir?p=i.dir:p=u.dir,i._initialMetadata.date!==i.date?v=i.date:v=u.date;var _=0,y=0;p&&(_|=16),a==="UNIX"?(y=798,_|=YHe(i.unixPermissions,p)):(y=20,_|=KHe(i.dosPermissions)),d=v.getHours(),d=d<<6,d=d|v.getMinutes(),d=d<<5,d=d|v.getSeconds()/2,A=v.getFullYear()-1980,A=A<<4,A=A|v.getMonth()+1,A=A<<5,A=A|v.getDate(),c&&(m=rn(1,1)+rn(XU(s),4)+s,f+="up"+rn(m.length,2)+m),h&&(g=rn(1,1)+rn(this.crc32(l),4)+l,f+="uc"+rn(g.length,2)+g);var w="";w+=` 12054\0`,w+=c||h?"\0\b":"\0\0",w+=r.compressionMethod,w+=rn(d,2),w+=rn(A,2),w+=rn(r.crc32,4),w+=rn(r.compressedSize,4),w+=rn(r.uncompressedSize,4),w+=rn(s.length,2),w+=rn(f.length,2);var b=cO.LOCAL_FILE_HEADER+w+s+f,E=cO.CENTRAL_FILE_HEADER+rn(y,2)+w+rn(l.length,2)+"\0\0\0\0"+rn(_,4)+rn(n,4)+s+f+l;return{fileRecord:b,dirRecord:E,compressedObject:r}},AO={load:function(t,i){throw new Error("Load method is not defined. Is the file jszip-load.js included ?")},filter:function(t){var i=[],r,n,a,s;for(r in this.files)this.files.hasOwnProperty(r)&&(a=this.files[r],s=new qU(a.name,a._data,dO(a.options)),n=r.slice(this.root.length,r.length),r.slice(0,this.root.length)===this.root&&t(n,s)&&i.push(s));return i},file:function(t,i,r){if(arguments.length===1)if(En.isRegExp(t)){var n=t;return this.filter(function(a,s){return!s.dir&&n.test(a)})}else return this.filter(function(a,s){return!s.dir&&a===t})[0]||null;else t=this.root+t,cJ.call(this,t,i,r);return this},folder:function(t){if(!t)return this;if(En.isRegExp(t))return this.filter(function(a,s){return s.dir&&t.test(a)});var i=this.root+t,r=uJ.call(this,i),n=this.clone();return n.root=r.name,n},remove:function(t){t=this.root+t;var i=this.files[t];if(i||(t.slice(-1)!="/"&&(t+="/"),i=this.files[t]),i&&!i.dir)delete this.files[t];else for(var r=this.filter(function(a,s){return s.name.slice(0,t.length)===t}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(t){t=dO(t||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip"}),En.checkSupport(t.type),(t.platform==="darwin"||t.platform==="freebsd"||t.platform==="linux"||t.platform==="sunos")&&(t.platform="UNIX"),t.platform==="win32"&&(t.platform="DOS");var i=[],r=0,n=0,a,s,o=En.transformTo("string",this.utf8encode(t.comment||this.comment||""));for(var l in this.files)if(this.files.hasOwnProperty(l)){var c=this.files[l],h=c.options.compression||t.compression.toUpperCase(),u=hO[h];if(!u)throw new Error(h+" is not a valid compression method !");var d=c.options.compressionOptions||t.compressionOptions||{},A=jHe.call(this,c,u,d),f=XHe.call(this,l,c,A,r,t.platform);r+=f.fileRecord.length+A.compressedSize,n+=f.dirRecord.length,i.push(f)}var m="";m=cO.CENTRAL_DIRECTORY_END+"\0\0\0\0"+rn(i.length,2)+rn(i.length,2)+rn(n,4)+rn(r,4)+rn(o.length,2)+o;var g=t.type.toLowerCase();for(g==="uint8array"||g==="arraybuffer"||g==="blob"||g==="nodebuffer"?a=new QHe(r+n+m.length):a=new zHe(r+n+m.length),s=0;s<i.length;s++)a.append(i[s].fileRecord),a.append(i[s].compressedObject.compressedContent);for(s=0;s<i.length;s++)a.append(i[s].dirRecord);a.append(m);var p=a.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return En.transformTo(t.type.toLowerCase(),p);case"blob":return En.arrayBuffer2Blob(En.transformTo("arraybuffer",p),t.mimeType);case"base64":return t.base64?oJ.encode(p):p;default:return p}},crc32:function(t,i){return XU(t,i)},utf8encode:function(t){return En.transformTo("string",MT.utf8encode(t))},utf8decode:function(t){return MT.utf8decode(t)}},ZU=AO,qHe=bc;function dJ(t){this.data=null,this.length=0,this.index=0}dJ.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var i=0,r;for(this.checkOffset(t),r=this.index+t-1;r>=this.index;r--)i=(i<<8)+this.byteAt(r);return this.index+=t,i},readString:function(t){return qHe.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date((t>>25&127)+1980,(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(t&31)<<1)}};var AJ=dJ,ZHe=AJ,JHe=bc;function jE(t,i){this.data=t,i||(this.data=JHe.string2binary(this.data)),this.length=this.data.length,this.index=0}jE.prototype=new ZHe;jE.prototype.byteAt=function(t){return this.data.charCodeAt(t)};jE.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)};jE.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.index,this.index+t);return this.index+=t,i};var fJ=jE,$He=AJ;function YE(t){t&&(this.data=t,this.length=this.data.length,this.index=0)}YE.prototype=new $He;YE.prototype.byteAt=function(t){return this.data[t]};YE.prototype.lastIndexOfSignature=function(t){for(var i=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),a=t.charCodeAt(3),s=this.length-4;s>=0;--s)if(this.data[s]===i&&this.data[s+1]===r&&this.data[s+2]===n&&this.data[s+3]===a)return s;return-1};YE.prototype.readData=function(t){if(this.checkOffset(t),t===0)return new Uint8Array(0);var i=this.data.subarray(this.index,this.index+t);return this.index+=t,i};var pJ=YE,e5e=pJ;function JU(t){this.data=t,this.length=this.data.length,this.index=0}JU.prototype=new e5e;JU.prototype.readData=function(t){this.checkOffset(t);var i=this.data.slice(this.index,this.index+t);return this.index+=t,i};var t5e=JU,k2=fJ,Md=bc,i5e=nJ,df=ZU,r5e=0,n5e=3;function mJ(t,i){this.options=t,this.loadOptions=i}mJ.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},prepareCompressedContent:function(t,i,r){return function(){var n=t.index;t.setIndex(i);var a=t.readData(r);return t.setIndex(n),a}},prepareContent:function(t,i,r,n,a){return function(){var s=Md.transformTo(n.uncompressInputType,this.getCompressedContent()),o=n.uncompress(s);if(o.length!==a)throw new Error("Bug : uncompressed data size mismatch");return o}},readLocalPart:function(t){var i,r;if(t.skip(22),this.fileNameLength=t.readInt(2),r=t.readInt(2),this.fileName=t.readString(this.fileNameLength),t.skip(r),this.compressedSize==-1||this.uncompressedSize==-1)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");if(i=Md.findCompression(this.compressionMethod),i===null)throw new Error("Corrupted zip : compression "+Md.pretty(this.compressionMethod)+" unknown (inner file : "+this.fileName+")");if(this.decompressed=new i5e,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,i),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,i,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=Md.transformTo("string",this.decompressed.getContent()),df.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readInt(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=t.readString(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readString(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),t===r5e&&(this.dosPermissions=this.externalFileAttributes&63),t===n5e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileName.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var i=new k2(this.extraFields[1].value);
12054this.uncompressedSize===Md.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===Md.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===Md.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===Md.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(t){var i=t.index,r,n,a;for(this.extraFields=this.extraFields||{};t.index<i+this.extraFieldsLength;)r=t.readInt(2),n=t.readInt(2),a=t.readString(n),this.extraFields[r]={id:r,length:n,value:a}},handleUTF8:function(){if(this.useUTF8())this.fileName=df.utf8decode(this.fileName),this.fileComment=df.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();t!==null&&(this.fileName=t);var i=this.findExtraFieldUnicodeComment();i!==null&&(this.fileComment=i)}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var i=new k2(t.value);return i.readInt(1)!==1||df.crc32(this.fileName)!==i.readInt(4)?null:df.utf8decode(i.readString(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var i=new k2(t.value);return i.readInt(1)!==1||df.crc32(this.fileComment)!==i.readInt(4)?null:df.utf8decode(i.readString(t.length-5))}return null}};var a5e=mJ,s5e=fJ,o5e=t5e,l5e=pJ,kc=bc,xd=YA,c5e=a5e,h5e=Fs,u5e=ZU;function gJ(t,i){this.files=[],this.loadOptions=i,t&&this.load(t)}gJ.prototype={checkSignature:function(t){var i=this.reader.readString(4);if(i!==t)throw new Error("Corrupted zip or bug : unexpected signature ("+kc.pretty(i)+", expected "+kc.pretty(t)+")")},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2),this.zipComment=this.reader.readString(this.zipCommentLength),this.zipComment=u5e.utf8decode(this.zipComment)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t=this.zip64EndOfCentralSize-44,i=0,r,n,a;i<t;)r=this.reader.readInt(2),n=this.reader.readInt(4),a=this.reader.readString(n),this.zip64ExtensibleData[r]={id:r,length:n,value:a}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,i;for(t=0;t<this.files.length;t++)i=this.files[t],this.reader.setIndex(i.localHeaderOffset),this.checkSignature(xd.LOCAL_FILE_HEADER),i.readLocalPart(this.reader),i.handleUTF8(),i.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===xd.CENTRAL_FILE_HEADER;)t=new c5e({zip64:this.zip64},this.loadOptions),t.readCentralPart(this.reader),this.files.push(t)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(xd.CENTRAL_DIRECTORY_END);if(t===-1){var i=!0;try{this.reader.setIndex(0),this.checkSignature(xd.LOCAL_FILE_HEADER),i=!1}catch{}throw i?new Error("Can't find end of central directory : is this a zip file ? If it is, see http://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip : can't find end of central directory")}if(this.reader.setIndex(t),this.checkSignature(xd.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===kc.MAX_VALUE_16BITS||this.diskWithCentralDirStart===kc.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===kc.MAX_VALUE_16BITS||this.centralDirRecords===kc.MAX_VALUE_16BITS||this.centralDirSize===kc.MAX_VALUE_32BITS||this.centralDirOffset===kc.MAX_VALUE_32BITS){if(this.zip64=!0,t=this.reader.lastIndexOfSignature(xd.ZIP64_CENTRAL_DIRECTORY_LOCATOR),t===-1)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");this.reader.setIndex(t),this.checkSignature(xd.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(xd.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}},prepareReader:function(t){var i=kc.getTypeOf(t);
12054i==="string"&&!h5e.uint8array?this.reader=new s5e(t,this.loadOptions.optimizedBinaryString):i==="nodebuffer"?this.reader=new o5e(t):this.reader=new l5e(kc.transformTo("uint8array",t))},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var d5e=gJ,A5e=HE,f5e=d5e,p5e=function(t,i){var r,n,a,s;for(i=i||{},i.base64&&(t=A5e.decode(t)),n=new f5e(t,i),r=n.files,a=0;a<r.length;a++)s=r[a],this.file(s.fileName,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileComment.length?s.fileComment:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:i.createFolders});return n.zipComment.length&&(this.comment=n.zipComment),this},_o={},uo=bc;_o.string2binary=function(t){return uo.string2binary(t)};_o.string2Uint8Array=function(t){return uo.transformTo("uint8array",t)};_o.uint8Array2String=function(t){return uo.transformTo("string",t)};_o.string2Blob=function(t){var i=uo.transformTo("arraybuffer",t);return uo.arrayBuffer2Blob(i)};_o.arrayBuffer2Blob=function(t){return uo.arrayBuffer2Blob(t)};_o.transformTo=function(t,i){return uo.transformTo(t,i)};_o.getTypeOf=function(t){return uo.getTypeOf(t)};_o.checkSupport=function(t){return uo.checkSupport(t)};_o.MAX_VALUE_16BITS=uo.MAX_VALUE_16BITS;_o.MAX_VALUE_32BITS=uo.MAX_VALUE_32BITS;_o.pretty=function(t){return uo.pretty(t)};_o.findCompression=function(t){return uo.findCompression(t)};_o.isRegExp=function(t){return uo.isRegExp(t)};var fW=HE;function dh(t,i){if(!(this instanceof dh))return new dh(t,i);this.files={},this.comment=null,this.root="",t&&this.load(t,i),this.clone=function(){var r=new dh;for(var n in this)typeof this[n]!="function"&&(r[n]=this[n]);return r}}dh.prototype=ZU;dh.prototype.load=p5e;dh.support=Fs;dh.defaults=Pl;dh.utils=_o;dh.base64={encode:function(t){return fW.encode(t)},decode:function(t){return fW.decode(t)}};dh.compressions=GE;const Uo=new lse;Uo.setLibraryPath("https://cdn.jsdelivr.net/npm/[email protected]/");rM.init("phc_g2h9OmTk9dQYB8NCVdYWwLAEXfiauaO0d1QOjQuNIm1",{api_host:"https://us.i.posthog.com",person_profiles:"identified_only"});document.addEventListener("DOMContentLoaded",c3);document.addEventListener("DOMContentLoaded",function(){});const vJ={zoom:9.3,center:[4.75,52.15],pitch:0,bearing:0};mapboxgl.accessToken="pk.eyJ1IjoiZHJpcHZpc3VhbCIsImEiOiJjbHZ6ZHgwc3kwMjJsMmtwaHM5dmJlcGM4In0.qImLeHGO5fmMHpEAihJV8w";const B=new mapboxgl.Map({container:"map",style:"mapbox://styles/dripvisual/cm03tiwts00c801pdgj6sd35a",...vJ,antialias:!0,preserveDrawingBuffer:!0,maxBounds:[[-180,-90],[180,90]]}),su=document.getElementById("area-slider-min"),Hd=document.getElementById("area-slider-max"),m5e=document.getElementById("area-value-min"),g5e=document.getElementById("area-value-max"),pW=document.getElementById("slider-range-area"),ou=document.getElementById("price-slider-min"),Gd=document.getElementById("price-slider-max"),v5e=document.getElementById("price-value-min"),_5e=document.getElementById("price-value-max"),mW=document.getElementById("slider-range-price"),y5e=document.getElementById("filteredFlatsNo");su.addEventListener("input",$U);Hd.addEventListener("input",$U);ou.addEventListener("input",e3);Gd.addEventListener("input",e3);document.querySelectorAll(".bedrooms-checkbox").forEach(t=>t.addEventListener("change",E5e));document.querySelectorAll(".status-checkbox").forEach(t=>t.addEventListener("change",w5e));document.getElementById("reset-filters").addEventListener("click",t3);document.getElementById("navbarTopWhiteLabel").addEventListener("click",()=>{window.open("https://publictwin.info/","_blank")},!0);function $U(){const t=parseFloat(su.value),i=parseFloat(Hd.value);t>i-1&&(event.target===su?su.value=i-1:Hd.value=t+1),m5e.textContent=su.value,g5e.textContent=Hd.value,Vn.areaMin=parseFloat(su.value),Vn.areaMax=parseFloat(Hd.value);const r=(su.value-CJ.areaMin)/su.max*100,n=Hd.value/Hd.max*100;pW.style.left=r+"%",pW.style.width=n-r+"%",ev()}function e3(){const t=parseFloat(ou.value),i=parseFloat(Gd.value);t>i-.05&&(event.target===ou?ou.value=i-.05:Gd.value=t+.05),v5e.textContent=String(ou.value)+".000",_5e.textContent=String(Gd.value)+".000",Vn.priceMin=parseFloat(ou.value),Vn.priceMax=parseFloat(Gd.value);const r=(ou.value-CJ.priceMin)/ou.max*100,n=Gd.value/Gd.max*100;mW.style.left=r+"%",mW.style.width=n-r+"%",ev()}function E5e(){const t=Array.from(document.querySelectorAll(".bedrooms-checkbox:checked")).map(i=>String(i.value));Vn.bedrooms=t,ev()}function w5e(){const t=Array.from(document.querySelectorAll(".status-checkbox:checked")).map(i=>i.value);Vn.status=t,ev()}function t3(){Vn={areaMin:0,areaMax:150,priceMin:0,priceMax:1e3,bedrooms:[],status:[]},su.value=Vn.areaMin,Hd.value=Vn.areaMax,ou.value=Vn.priceMin,Gd.value=Vn.priceMax,document.querySelectorAll(".bedrooms-checkbox").forEach(t=>t.checked=!1),document.querySelectorAll(".status-checkbox").forEach(t=>t.checked=!1),$U(),e3(),ev()}function ev(){const t=document.getElementById("mainMenuMasterplan_SelectedFlats");t.innerHTML="";const i=SJ.filter(r=>{const n=Vn.bedrooms.length===0||Vn.bedrooms.includes(r.bedrooms),a=Vn.status.length===0||Vn.status.includes(r.status);return r.area>=Vn.areaMin&&r.area<=Vn.areaMax&&r.price>=Vn.priceMin&&r.price<=Vn.priceMax&&n&&a});
12054y5e.innerHTML=i.length,i.forEach(r=>{const n=document.createElement("div");n.style.width="auto",n.className="flat-item",r.status=="reserved"&&(n.className="flat-item grey"),n.style.cursor="pointer",n.addEventListener("click",()=>{var A=r.plan+"/"+r.id+"_Level-min.jpg";MJ.src=A,xJ.innerHTML=r.id,RJ.innerHTML=r.price,BJ.innerHTML=r.area,IJ.innerHTML=r.bedrooms,DJ.innerHTML=r.spaces,PJ.innerHTML=r.level,LJ.innerHTML=r.orientation,OJ.innerHTML=r.balcony,NJ.innerHTML=r.externalArea,r.status=="reserved"?DT.classList.add("grey"):DT.classList.remove("grey"),r.brokerWebsite!="-"?(nl.target="_blank",nl.href=r.brokerWebsite,nl.style.backgroundColor="#f9d235"):(nl.target="_self",nl.href="javascript:void(0);",nl.style.backgroundColor="#bdbdbd"),r.brokerEmail!="-"?(rl.target="_self",rl.href="mailto:"+r.brokerEmail+"?subject="+r.id,rl.style.backgroundColor="#f9d235"):(rl.target="_self",rl.href="javascript:void(0);",rl.style.backgroundColor="#bdbdbd"),r.gallery!="-"?(tc.target="_blank",tc.style.backgroundColor="#f9d235"):(tc.target="_self",tc.href="javascript:void(0);",tc.style.backgroundColor="#bdbdbd"),r.plan!="-"?(ic.target="_blank",ic.style.backgroundColor="#f9d235"):(ic.target="_self",ic.href="javascript:void(0);",ic.style.backgroundColor="#bdbdbd"),r.pdf!="-"?(al.target="_blank",al.href=r.pdf+"/"+r.id+".pdf",al.style.backgroundColor="#f9d235"):(al.target="_self",al.href="javascript:void(0);",al.style.backgroundColor="#bdbdbd");for(var f=0;f<ut.children.length;f++)if(ut.children[f].userData.attributes.flatID==r.id){ut.children[f].selected=!0,Sa=r.id;var m=ut.children[f]}let g={zoom:19.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};const p=Wf[1],v=Wf[0],_=m.geometry.boundingSphere.center.x,w=m.geometry.boundingSphere.center.y/111320,b=_/(111320*Math.cos(p*Math.PI/180)),E=p+w,M=v+b;g.center=[Ra.lng,Ra.lat],g.center=[M,E],r.orientation=="N,E"?(g.bearing=240,g.pitch=60):r.orientation=="N,W"?(g.bearing=130,g.pitch=40):r.orientation=="S,E"?(g.bearing=-40,g.pitch=60):r.orientation=="S,W"&&(g.bearing=20,g.pitch=40),Ri(g),yi.style.visibility="visible";for(var f=0;f<ut.children.length;f++)ut.children[f].userData.attributes.flatID!=Sa&&(ut.children[f].material=ut.children[f].defaultmaterial,ut.children[f].hover=!1,ut.children[f].selected=!1,zA.raycast([0,0,0],!1))});const a=document.createElement("div");a.style.width="50%",a.style.display="inline-block";const s=document.createElement("img");s.src=r.image,s.alt=`Image of flat ${r.id}`,s.style.width="100%",s.style.objectFit="cover",a.appendChild(s);const o=document.createElement("div");o.style.width="45%",o.style.marginLeft="5px",o.style.fontSize="10px",o.style.display="inline-block";const l=document.createElement("div");l.style.width="100%",l.style.margin="auto",l.style.display="block";const c=document.createElement("div");c.innerHTML=`<span>flat ID:</span> ${r.id}`;const h=document.createElement("div");h.innerHTML=`<span>price:</span> ${r.price}â¬`;const u=document.createElement("div");u.innerHTML=`<span>area:</span> ${r.area}m²`;const d=document.createElement("div");d.innerHTML=`<span>availability:</span> ${r.status}`,l.appendChild(c),l.appendChild(h),l.appendChild(u),l.appendChild(d),o.appendChild(l),n.appendChild(a),n.appendChild(o),t.appendChild(n)}),i.length===0&&(t.textContent="No flats match the selected filters."),ut.children.forEach(r=>{const n=r.userData.attributes.flatID,a=i.some(s=>s.id===n);r.filtered=!a}),zA.raycast([0,0,0],!1)}const NA=new vs({color:16117719,wireframe:!1}),qa=new vs({color:15982740,wireframe:!1}),dl=new vs({color:16372277,wireframe:!1}),Fp=new co({vertexShader:AZ,fragmentShader:fZ,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(4079166)},outlineThickness:{value:.1}},side:fs}),Tl=new co({vertexShader:FE,fragmentShader:kE,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(15004642)}},side:os}),tv=new co({vertexShader:FE,fragmentShader:kE,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(16372277)}},side:os}),iv=new co({vertexShader:AZ,fragmentShader:fZ,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(6319966)},outlineThickness:{value:.08}},side:fs});new co({vertexShader:FE,fragmentShader:kE,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(15004642)}},side:os});new co({vertexShader:FE,fragmentShader:kE,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(16777215)}},side:os});const i3=new vs({color:16777215});new vs({color:16249565});new vs({color:10790052});const H2=new vs({color:16372277,wireframe:!1,transparent:!0,opacity:.98}),gW=new vs({color:15982740,wireframe:!1,transparent:!0,opacity:.97}),b5e=new vs({color:15986136,wireframe:!1,transparent:!0,opacity:.88}),S5e=new vs({color:13684944,wireframe:!1,transparent:!0,opacity:.88}),C5e=new vs({color:16117719,wireframe:!1,transparent:!0,opacity:0}
12054),KE=new vs({color:16777215,transparent:!0,opacity:.05}),UA=new vs({color:16117719,wireframe:!1,transparent:!0,opacity:.5}),Nu=new vs({color:15982740,wireframe:!1,transparent:!0,opacity:.5}),Uu=new vs({color:16372277,wireframe:!1,transparent:!0,opacity:.7}),Vg=document.getElementById("getLocation");Vg.active="active";const fO=document.getElementById("refreshPage");fO.active="active";fO.addEventListener("click",function(){fO.active=="active"&&window.location.reload()});var tE=[[-180,-90],[180,90]],XE=null,x_=null,R_=null,Gf=null,G2=null,vW=null,Af=null,z2=null,pO=null;let r_=null;var _W=null,_J=0,y0=null,E0=null,w0=null,uy=null,yW=null,T5e=null,cS=null,mO=null,xT=null,EW=null,zf=null,vu=null,n_=null,qE=0,Ep=!1,jS=!1;let gO=null,Zo=null,Gc=null;var Ps=null,OM=!1,Qf=!1,Ah=!1,rh=null,Xr=null,Tn=[],Ml=!1,Wg=null,Br=!1,Yi=null,Dt=null,hi=null,ui=null,Ks=null,vO=null,Ut=null,Cr=!1,Yt=null,cn=null,$e=null,Ti=null,gt=null,Xt=null,ut=null,qt=null,Ci=null,Ai=null,ti=null,vi=null,fi=null,Wt=null,jm=null,ii=null,Sa=null,yJ=null,ur=null,un=null,Ra=null,ss="global",hS=null,jg=null,_O="public",r3=null,NM=null,EJ=null,NM=null,B_=null,wJ=null,MA=!1;const Ro=new mapboxgl.Popup({offset:25,closeOnClick:!1}),RT=new mapboxgl.Popup({offset:15,closeOnClick:!1}),bJ=new mapboxgl.Popup({offset:15,closeOnClick:!1}),Kn=new mapboxgl.Popup({offset:40,closeOnClick:!1,closeButton:!1}),ni=new mapboxgl.Popup({offset:15,closeOnClick:!1}),I_=new mapboxgl.Popup({offset:25,closeOnClick:!1}),M5e={_state:!1,get state(){return this._state},set state(t){this._state!==t&&(this._state=t,document.getElementById("loadingScreenMenu").style.display="none",document.getElementById("loadingScreenMenu").style.visibility="hidden")}};let SJ=[],Vn={areaMin:20,areaMax:150,priceMin:100,priceMax:950,bedrooms:[],status:[]},CJ={areaMin:20,areaMax:150,priceMin:100,priceMax:950,bedrooms:[],status:[]};var BT={type:"showcase",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.4973609791796605,51.895008731789375]},properties:{title:"Green Dijk Lane",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/01_Dijk.jpg",zoom:12.367223434380788,bearing:0,pitch:0,description:"test description 01",descriptionLong:"Green Dijk Lane can become a connector for the entire Rotterdam South. With a bike lane running across its entire length and public features supporting urban activites, the Dijk has a potential to become a catalyst of transformation.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4750899447728045,51.89504860254024]},properties:{title:"Important Connections",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/02_Important_Connections.jpg",zoom:13.456024913681416,bearing:0,pitch:0,description:"test description 01",descriptionLong:"To make sure that the Dijk becomes a flurishing place, it needs to connect to important axisies in the city. It can prolong existing lines and create new connections - making it esier to navigate around the district.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[4.47363,51.89526]},properties:{title:"Intervention Schemes",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/03_Intervention_Schemes.jpg",zoom:14.187,bearing:-12.241,pitch:32.003,description:"test description 01",descriptionLong:"In their proposal to revitalize the area, Mecanoo architects chose to focus on three main areas of potenitial development along the Dijk : Waalhaven, Dokhaven, and Tarwewijk. Each offering distinct qualities.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[4.46101,51.89089]},properties:{title:"Waalhaven Site",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/04_Waalhaven_Scheme_Google.jpg",zoom:16.434,bearing:-106.765,pitch:53.805,description:"test description 01",descriptionLong:"On Waalhaven site Mecanoo propose to create public spaces for sport and food production along the dijk and in the harbor. Series makers spaces, housing and adaptive reuse buildings on the east and new office buildings to the west.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[4.46593,51.89641]},properties:{title:"Dokhaven Site",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/05_Dokhaven_Scheme_Google.jpg",zoom:15.838,bearing:-40.241,pitch:62.001,description:"test description 01",descriptionLong:"On Dokhaven site Mecanoo propose to create a series of neighborhood activatig pavilions. Residential proposal is accompanied by open public lawns for sports and recreation. All elements of the neighborhood are connected with a green Dijkpark.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[4.48849,51.89741]},properties:{title:"Tarwewijk Site",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/06_Tarwewijk_Sc
12054heme_Google.jpg",zoom:16.127,bearing:97.57,pitch:64.183,description:"test description 01",descriptionLong:"On Tarwewijk site Mecanoo propose a creation of a floating bridge to connect to the Katendrecht. Waterfront is proposed to be activited by a promenade and floating developments. Neighborhood square creates a connection axis between the bridge and Tarwebuurt.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[4.47566,51.89466]},properties:{title:"Participatory engagement!",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/ShowcaseImages/07_Participate.jpg",zoom:14.154,bearing:-18.7,pitch:32.66,description:"test description 01",descriptionLong:"After getting familiar with the proposal we would like to invite you to engage in participation module. We would like to gather opinions and ideas that will help Mecanoo Architects shape the future of Rotterdam South.",participation:!0}}]},wW={type:"showcase",features:[{type:"Feature",geometry:{type:"Point",coordinates:[12.95762,55.58592]},properties:{title:"City of Malmö",image:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/ShowcaseImages/01_NyhavenCity.png",zoom:10.423,bearing:0,pitch:0,description:"test description 01",descriptionLong:"This is a digital version of Malmö and its future as imagined in 2050. Presented and created using PublicTwin.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[12.99732,55.61405]},properties:{title:"Malmö Harbor 2050",image:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/ShowcaseImages/02_NyhavenCityAI3.png",zoom:14.777,bearing:176.853,pitch:43.315,description:"test description 01",descriptionLong:"In 2025 the team Waves took on Nyhaven harbor and in collaboration with citizens proposed creative ideas for its transformation. In this digital twin you can immerse yourself in exploring that future.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[13.0016,55.61601]},properties:{title:"The Lowline",image:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/ShowcaseImages/03_TheLowline.png",zoom:15.802,bearing:160.543,pitch:59.59,description:"test description 01",descriptionLong:"In 2050 culture workers have been given spaces in the former industrial buildings during the areas transformation period into a residential area.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[13.00283,55.6149]},properties:{title:"Culture District",image:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/ShowcaseImages/04_CultureDistrict.png",zoom:15.802,bearing:67.852,pitch:66.665,description:"test description 01",descriptionLong:"The transformation of this former industrial harbor into a multifunctional blue-green recreational area by the waterfront turned the area into a vibrant and diverse destination.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[12.98992,55.61435]},properties:{title:"Floating Incubator",image:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/ShowcaseImages/05_FloatingIncubator.png",zoom:16.537,bearing:-109.129,pitch:63.671,description:"test description 01",descriptionLong:"The floating district has developed into a self sustainable test bed area with both lab, work and conference spaces to livable prototypes on student housing and outdoor activities.",participation:!1}},{type:"Feature",geometry:{type:"Point",coordinates:[12.99691,55.61438]},properties:{title:"AI Creation Points",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_2_DIJK_PARK_LANE-ezgif.com-video-to-gif-converter.gif",zoom:16.039,bearing:63.946,pitch:54.03,description:"test description 01",descriptionLong:'Now we would like to invite you to contribute to creating visions for the future of Malmo by clicking one of the <span>pins</span> <img src="https://publictwin.info/digital_maquette/AIPoint.png" class="inTextImage"></img> and selecting your preferences!',participation:!1}}]},li={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.35
12054750368195329,52.00342762662817]},properties:{title:"Nieuw Delft Masterplan",permissions:"public",image:"https://publictwin.info/digital_maquette/content/00_Projects/01_Nieuw_Delft_Masterplan.jpg",icon:"logo1",description:"A new city district with 2.100 homes. 20.000 m² city park and more than 40.000 m² of urban functions",descriptionLong:"Nieuw Delft is increasingly taking shape. A new city district with approximately 2.100 homes, a 20.000 m² city park and more than 40.000 m² of urban functions. Here, architecture, entrepreneurship and innovation are given space and we strengthen the economic position of the city. In Nieuw Delft, the future is literally at the door.",location:"Delft, Netherlands",status:"active",activeStatus:"activeMaquette",digitalTwin:"available",digitalTwinLink:"https://publictwin.info/nieuw_delft/digital_twin/",advancedSelection:"true",projectSelected:"false",modelID:"3d-model",origin:[4.35878,52.00115],cameraReset:{center:[4.35754,52.00343],zoom:16,bearing:35,pitch:60}}},{type:"Feature",geometry:{type:"Point",coordinates:[4.919963186247514,52.34312165602151]},properties:{title:"Circular City House",permissions:"public",image:"https://publictwin.info/digital_maquette/content/00_Projects/03_Circular_City_House.jpg",icon:"logo1",description:"Mixed-use building that honours De Omval's rich history.",descriptionLong:"Mixed-use building that honours De Omval's rich history. A detached iconic building with very exceptional sustainability features and a strong identity of its own! The location is very prominent on the water next to the NS Amstel Station. The building is characterized by a mix of offices, creative business lofts and with catering space on the ground floor.",location:"Amsterdam, Netherlands",status:"active",activeStatus:"activeMaquette",digitalTwin:"available",digitalTwinLink:"https://circularcityhouse.nl/digital-twin/",advancedSelection:"false",projectSelected:"false",modelID:"3d-model-CCH",origin:[4.919993449849471,52.34309103446975],cameraReset:{center:[4.91995,52.34313],zoom:16.979,bearing:35,pitch:60}}},{type:"Feature",geometry:{type:"Point",coordinates:[4.960029525595473,52.37670176698421]},properties:{title:"Sluisbuurt Masterplan",permissions:"public",image:"https://publictwin.info/digital_maquette/content/00_Projects/04_Sluisbuurt_Masterplan.jpg",icon:"logo1",description:"New high-rise district of 28 towers with 5.500 homes.",descriptionLong:"New high-rise district of 28 towers with 5.500 homes. The neighborhood, which includes up to 125 meters of high-rise buildings, will be geared towards cyclists and pedestrians and invites movement. It will be a healthy, modern urban district with a unique skyline on the IJ.",location:"Amsterdam, Netherlands",status:"active",activeStatus:"activeMaquette",digitalTwin:"available",digitalTwinLink:"https://www.dripvisual.com/sluisbuurt",advancedSelection:"false",projectSelected:"false",modelID:"3d-model-Sluisbuurt",origin:[4.956944002356522,52.373384647853584],cameraReset:{center:[4.95915,52.37656],zoom:15.679,bearing:35,pitch:60}}},{type:"Feature",geometry:{type:"Point",coordinates:[4.475626547069169,51.89513331314612]},properties:{title:"Dijk Park Masterplan",permissions:"public",image:"https://publictwin.info/digital_maquette/content/00_Projects/05_Dijk_Park_Masterplan.jpg",icon:"logo2",description:"Vision for a new connector in Rotterdam South proposed by Mecanoo architects!",descriptionLong:"Vision for a new connector in Rotterdam South proposed by Mecanoo architects!South needs an integrated urban vision for future development. What if the existing dyke infrastructure is transformed into a spectacular ten-kilometre-long dyke park, a reconciliation between port and city? A green ribbon where Southerners, both residents and port workers alike, can walk, stroll, and do sports?",location:"Rotterdam, Netherlands",status:"active",activeStatus:"activeMaquette",digitalTwin:"none",digitalTwinLink:"-",advancedSelection:"false",projectSelected:"false",modelID:"3d-model-DijkPark-Masterplan",origin:[4.477489149214534,51.89772187785269],cameraReset:{center:[4.47622,51.89577],zoom:14.259,bearing:1.001,pitch:37.993},participatoryModuleActive:!0,participatoryActions:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.4648,51.8961]},properties:{title:"Dijk Park Dokhaven",image:"https://publictwin.info/digital_maquette/content/00_Projects/05_Dijk_Park_Masterplan.jpg",icon:"participate",description:"Participatiory action focusing on Dokhaven part of Rotterdam South.",location:"Rotterdam, Netherlands",status:"active",openTill:"01.11.2024",participatoryForm:"https://eoxsnlhinp7.typeform.com/to/l224kQqZ",qrCode:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Participation/Dijk_Park_Rotterdam_Form_01_Dokhaven.png",center:[4.46563,51.89668],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4614,51.8915]},properties:{title:"Dijk Park Waalhaven",image:"https://publictwin.info/digital_maquette/content/00_Projects/05_Dijk_Park_Masterplan.jpg",icon:"participate",description:"Participatiory action focusing on Waalhaven part of Rotterdam South.",location:"Rotterdam, Netherlands",status:"active",openTill:"01.11.2024",participatoryForm:"https://eoxsnlhinp7.typeform.com/to/ektzf70c",qrCode:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Participation/Dijk_Park_Rotterdam_Form_03_Waalhaven.png",center:[4.46098,51.89153],zoom:17.07,bearing:-159.09,pitch:62.111}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4874,51.8958]},properties:{title:"Dijk Park Tarwewijk",image:"https://publictwin.info/digital_maquette/content/00_Projects/05_Dijk_Park_Masterplan.jpg",icon:"participate",description:"Participatiory action focusing on Tarwewijk part of Rotterdam South.",location:"Rotterdam, Netherlands",status:"active",openTill:"01.11.2024",participatoryForm:"https://eoxsnlhinp7.typeform.com/to/EyzcfO0M",qrCode:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Participation/Dijk_Park_Rotterdam_Form_02_Tarwewijk.png",center:[4.48748,51.89612],zoom:17.172,bearing:57.717,pitch:65.324}}]},beforeAndAfterPoints:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.4604,51.8909]},properties:{title:"Dijk Park Lane",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/DijkPark_Lane_Before.png",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_2_DIJK_PARK_LANE-ezgif.com-video-to-gif-converter.gif",icon:"camera",description:"Dijk Park Lane imagined with UrbanistAI.",location:"Rotterdam, Netherlands",status:"active",center:[4.4604,51.8909],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4664,51.8954]},properties:{title:"Dokhuis Neighborhood",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/Dokhaven_Before.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_3_DOKHUIS-ezgif.com-video-to-gif-converter.gif",icon:"camera",description:"Dokhuis Neighborhood imagined with UrbanistAI",location:"Rotterdam, Netherlands",status:"active",center:[4.4664,51.8954],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4867,51.8963]},properties:{title:"Tarwewijk Neighborhood",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/Tarwewijk_Bridge_Before.png",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_1_TARWEWIJK_BRIDGE-ezgif.com-video-to-gif-converter.gif",icon:"camera",description:"Tarwewijk Neighborhood imagined with UrbanistAI",location:"Rotterdam, Netherlands",status:"active",center:[4.4867,51.8963],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4871,51.8949]},properties:{title:"Tarwewijk Connection",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/Tarwewijk_Connection_Before.png",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_4_TARWEWIJK_CONNECTION-ezgif.com-video-to-gif-converter.gif",icon:"camera",description:"Tarwewijk Neighborhood imagined with UrbanistAI",location:"Rotterdam, Netherlands",status:"active",center:[4.4871,51.8949],zoom:16.178,bearing:-22.396,pitch:62.361}}]},panoramaPoints:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.4868,51.8957]},properties:{title:"Tarwewijk Panorama",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Panoramas/Panorama_01_Before.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Panoramas/Panorama_01_After.jpg",icon:"panorama",description:"360 Panorama showcasing the potential future of Tarwewijk area.",location:"Rotterdam, Netherlands",status:"active",center:[4.4868,51.8957],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4616,51.8911]},properties:{title:"Waalhaven Panorama",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Panoramas/Panorama_02_Before.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Panoramas/Panorama_02_After.jpg",icon:"panorama",description:"360 Panorama showcasing the potential future of Tarwewijk area.",location:"Rotterdam, Netherlands",status:"active",center:[4.4616,51.8911],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[4.4668,51.8954]},properties:{title:"Dokhaven Panorama",beforeImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Panoramas/Panorama_03_Before.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/Panoramas/Panorama_03_After.jpg",icon:"panorama",description:"360 Panorama showcasing the potential future of Tarwewijk area.",location:"Rotterdam, Netherlands",status:"active",center:[4.4668,51.8954],zoom:16.178,bearing:-22.396,pitch:62.361}}]},informPoints:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.46752,51.895715]},properties:{title:"Dokhuis Location",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/DijkPark_Lane_Before.png",icon:"info",description:"Join us at an event for everyone interested in the future of Rotterdam South!",location:"Rotterdam, Netherlands",status:"active",dates:"26.09.2024 - 14:30",center:[4.46358,51.89675],zoom:16.432,bearing:-46.499,pitch:71.353}},{type:"Feature",geometry:{type:"Point",coordinates:[4.433046,51.908633]},properties:{title:"Keilepand Location",image:"https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/DijkPark_Lane_Before.png",icon:"info",description:"Join us at Hear & Ahead event on Placemaking Week Europe!",location:"Rotterdam, Netherlands",status:"active",dates:"27.09.2024 - 10:00",center:[4.43765,51.90517],zoom:15.661,bearing:113.006,pitch:70.809}}]}}},{type:"Feature",geometry:{type:"Point",coordinates:[5.022972876
12054543804,52.36146782024929]},properties:{title:"Strandeiland Masterplan",permissions:"public",image:"https://publictwin.info/digital_maquette/content/00_Projects/02_Strandeiland_Masterplan.jpg",icon:"logo2",description:"Newly constructed island with 8.000 homes planed.",descriptionLong:"Newly constructed island with 8.000 homes planed. 40 percent will be social housing, 25 percent will be mid-priced rental and purchase and 35 percent will be private sector rental and purchase. A new city district for over 20.000 Amsterdam residents. It will be an island with a lot of contact with the water, a 750-meter city beach, 6 bridges, a harbor and a natural bay.",location:"Amsterdam, Netherlands",status:"in development",activeStatus:"maquetteInDevelopment",digitalTwin:"none",digitalTwinLink:"-",advancedSelection:"false",projectSelected:"false",modelID:"3d-model-Strandeiland",origin:[5.022972876543804,52.36146782024929],cameraReset:{center:[4.47622,51.89577],zoom:14.259,bearing:1.001,pitch:37.993}}},{type:"Feature",geometry:{type:"Point",coordinates:[13.001501437522961,55.60994296112665]},properties:{title:"Malmo Masterplan",permissions:"public",image:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/Master/NyhavenCity.png",icon:"logo1",description:"The Futures We Build Proposal by Team: WAVES.",descriptionLong:"The team Waves will explore how interaction between virtual and physical spaces can enable new ways of decision making for our built environment and the inclusion of all inhabitants needed for our cities to adapt to climate change. The team will focus on former industrial harbour spaces and how they can be transformed with accessibility for all citizens.",location:"Malmo, Sweden",status:"active",activeStatus:"activeMaquette",digitalTwin:"none",digitalTwinLink:"-",advancedSelection:"false",projectSelected:"false",modelID:"3d-model-Malmo-Detailed",origin:[12.99415,55.60795],cameraReset:{center:[12.95762,55.58592],zoom:10.423,bearing:0,pitch:0},participatoryModuleActive:!1,AIPoints:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[13.0012,55.6138]},properties:{title:"Old Ferry Terminal",AIPointNumber:1,beforeImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/OldDock-min.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/OldDock-min.jpg",icon:"camera",description:"Old Dock imagined with UrbanistAI.",location:"Malmo, Sweden",status:"active",center:[13.00184,55.61351],zoom:17.305,bearing:114.004,pitch:75.224,featurePrompts1:"3dprinted houses",featurePrompts2:"skate park",featurePrompts3:"urban farming",featurePrompts4:"outdoor gym",featurePrompts5:"music festival"}},{type:"Feature",geometry:{type:"Point",coordinates:[12.9974,55.6159]},properties:{title:"Old Warehouses Low",AIPointNumber:2,beforeImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/WarehousesLow-min.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/WarehousesLow-min.jpg",icon:"camera",description:"Old Warehouses Low imagined with UrbanistAI.",location:"Malmo, Sweden",status:"active",center:[12.99921,55.61576],zoom:17.363,bearing:87.179,pitch:79.105,featurePrompts1:"playground",featurePrompts2:"farmers market",featurePrompts3:"arts + culture",featurePrompts4:"urban green",featurePrompts5:"food trucks"}},{type:"Feature",geometry:{type:"Point",coordinates:[12.9999,55.6154]},properties:{title:"Old Silos",AIPointNumber:3,beforeImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/WarehousesHigh-min.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/WarehousesHigh-min.jpg",icon:"camera",description:"Old Warehouses High imagined with UrbanistAI.",location:"Malmo, Sweden",status:"active",center:[13.00059,55.61641],zoom:17.06,bearing:-20.8,pitch:79.605,featurePrompts1:"wild green",featurePrompts2:"urban green",featurePrompts3:"restaurant",featurePrompts4:"arts + culture",featurePrompts5:"water sports"}},{type:"Feature",geometry:{type:"Point",coordinates:[12.9921,55.614]},properties:{title:"Harbor Front",AIPointNumber:4,beforeImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/HarborFront-min.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/HarborFront-min.jpg",icon:"camera",description:"Harbor Front imagined with UrbanistAI.",location:"Malmo, Sweden",status:"active",center:[12.99342,55.61347],zoom:18.087,bearing:153.308,pitch:81.04,featurePrompts1:"floating housing",featurePrompts2:"timber deck",featurePrompts3:"sauna",featurePrompts4:"restaurant and bar",featurePrompts5:"water sports"}},{type:"Feature",geometry:{type:"Point",coordinates:[13.0045,55.6156]},properties:{title:"Harbor Birds Eye",AIPointNumber:5,beforeImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/HarborBirdsEye-min.jpg",afterImage:"https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/BeforeAndAfter/HarborBirdsEye-min.jpg",icon:"camera",description:"Harbor Birds Eye imagined with UrbanistAI.",location:"Malmo, Sweden",status:"active",center:[13.00411,55.61591],zoom:17.363,bearing:108.051,pitch:79.674,featurePrompts1:"marine farming",featurePrompts2:"housing collective",featurePrompts3:"water sports",featurePrompts4:"urban wetlands",featurePrompts5:"recreational area"}}]},beltPoints:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[12.8177,55.5613]}
12054,properties:{title:"Unesco Biosphere",icon:"waterPoints",description:"Ãresund has become a Biosphere Reserve within UNESCO under the MAB (Man and the Biosphere) program to promote a balance between human activities and nature conservation.",location:"Malmö, Sweden",center:[12.8177,55.5613],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[12.9161,55.6539]},properties:{title:"Marine Farming",icon:"waterPoints",description:"Marine farming is now part of Malmös coast. Not only used as a food source but also has strong climate benefits by absorbing carbon dioxide.",location:"Malmö, Sweden",center:[12.9161,55.6539],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[13.0156,55.6258]},properties:{title:"Urban Wetlands",icon:"waterPoints",description:"Incorporating urban wetlands in the transition from the former industrial harbor to residential areas provided numerous benefits for both residents and the local water system and most importantly for the water living creatures in the harbour areas.",location:"Malmö, Sweden",center:[13.0156,55.6258],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[12.947,55.5184]},properties:{title:"Rewilding Nature",icon:"greenPoints",description:"Large areas surrounding Malmö arehave now restored natural ecosystems. A powerful way to restore ecological functions, boost biodiversity, and contribute to climate stability,",location:"Malmö, Sweden",center:[12.947,55.5184],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[13.09,55.5332]},properties:{title:"Food Forests",icon:"greenPoints",description:"With food forests Malmö has gained a more sustainable agricultural model that supports a variation of species and human well-being, offering a long term, resilient approach to food production.",location:"Malmö, Sweden",center:[13.09,55.5332],zoom:16.178,bearing:-22.396,pitch:62.361}},{type:"Feature",geometry:{type:"Point",coordinates:[13.1298,55.5949]},properties:{title:"Eco Farming",icon:"greenPoints",description:"The transitioning to eco-farming collectives brought substantial benefits for both people and the planet, making it a powerful model for creating sustainable and resilient agricultural systems.",location:"Malmö, Sweden",center:[13.1298,55.5949],zoom:16.178,bearing:-22.396,pitch:62.361}}]}}},{type:"Feature",geometry:{type:"Point",coordinates:[18.678038830774312,50.29796860350277]},properties:{title:"Gliwice Browar Scobel",permissions:"private",image:"https://publictwin.info/digital_maquette/content/00_Projects/07_Gliwice_Browar_Scobel.jpg",icon:"logo1",description:"Large scale housing project with residential towers proposed by Franta Group.",descriptionLong:"Proposal prepared by Franta Group architects for Trust Investment. The scheme proposes 412 new flats within two 100m towers. The towers will be accompanied by 3 stories of underground parking contining total of 514 places.",location:"Gliwice, Poland",status:"active",activeStatus:"activeMaquette",digitalTwin:"none",digitalTwinLink:"-",advancedSelection:"false",projectSelected:"false",modelID:"3d-model-GliwiceBrowarScobel",origin:[18.678038830774312,50.29796860350277],cameraReset:{center:[18.67999,50.29863],zoom:16.954,bearing:70.327,pitch:66.843}}},{type:"Feature",geometry:{type:"Point",coordinates:[76.2142,10.5249]},properties:{title:"Thrissur Urban Study",permissions:"WSoA",image:"https://publictwin.info/digital_maquette/content/00_Projects/08_Thrissur_Urban_Study.jpg",icon:"logo1",description:"Urban Study by Livable Urabnism Unit from Cardiff University - Welsh School of Architecture",descriptionLong:"Cities occupy just 3% of the world's landmass, yet are home to some 50% of the global population and growing. Finding solutions to urban issues in quality of life, public wellbeing, the economy and the environment are critical to creating a more liveable human habitat for the future.",location:"Thrissur, India",status:"active",activeStatus:"activeMaquette",digitalTwin:"none",digitalTwinLink:"-",advancedSelection:"false",projectSelected:"false",participatoryModuleActive:!0,modelID:"3d-model-Thrissur",origin:[76.2142,10.5249],cameraReset:{center:[76.2142,10.5249],zoom:13.954,bearing:0,pitch:0},participatoryActions:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[76.214,10.5267]},properties:{title:"Thrissur Urban Study",image:"https://publictwin.info/digital_maquette/content/00_Projects/08_Thrissur_Urban_Study.jpg",icon:"participate",description:"Participatiory form with general questions about the quality of life.",location:"Thrissur, India",status:"active",openTill:"01.02.2025",participatoryForm:"https://eoxsnlhinp7.typeform.com/to/BG5XxRfD",qrCode:"https://publictwin.info/digital_maquette/content/Thrissur_Urban_Study/Participation/Thrissur_Urban_Study_General_Form.png",center:[76.214,10.5267],zoom:14.178,bearing:-22.396,pitch:62.361}}]}}},{type:"Feature",geometry:{type:"Point",coordinates:[19.4513,51.7788]},properties:{title:"Urban Future",permissions:"public",image:"https://publictwin.info/digital_maquette/content/00_Projects/09_UrbanFuture-min.jpg",icon:"logo1",description:"Snap & Chat: Urban Regeneration Walkshop",descriptionLong:"Communication is keyâbut how do we truly connect residents with city professionals? Today, digital tools make it easier than ever to involve people in shaping the places they live. In this walkshop, youâll head outdoors to explore the neighborhood, using your phone to qualitatively evaluate its features with geo-referenced pins, polls, and photosâcontributing to a shared database of insights.",location:"Lodz, Poland",status:"active",activeStatus:"activeMaquette",digitalTwin:"none",digitalTwinLink:"-",advancedSelection:"false",projectSelected:"false",participatoryModuleActive:!0,modelID:"3d-model-UrbanFuture",origin:[19.4513,51.7788],cameraReset:{center:[19.4513,51.7788],zoom:13.954,bearing:0,pitch:0},participatoryActions:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[19.4513,51.7788]},properties:{title:"Urban Future",image:"https://publictwin.info/digital_maquette/content/00_Projects/09_UrbanFuture-min.jpg",icon:"participate",description:"Participatiory form with general questions about the quality of life.",location:"Lodz, Poland",status:"active",openTill:"01.07.2025",participatoryForm:"https://eoxsnlhinp7.typeform.com/to/bT4Az155",qrCode:"https://publictwin.info/digital_maquette/content/Urban_Future/Participation/Urban_Future_General_Form.png",center:[19.4513,51.7788],zoom:14.5,bearing:-22.396,pitch:62.361}}]}}}]};document.getElementById("closeButton").addEventListener("click",XGe,!0);document.getElementById("closeButtonTools").addEventListener("click",qGe,!0);const Ki=document.getElementById("selectedURL"),IT=document.getElementById("logoImageDiv");IT.enabled="enabled";IT.addEventListener("click",()=>{IT.enabled=="enabled"&&window.open("https://publictwin.info/","_blank")},!0);const Nt=document.getElementById("smallMenu"),rv=document.getElementById("smallMenu_nameInfo"),nv=document.getElementById("smallMenu_neighbourhoodInfo"),av=document.getElementById("smallMenu_stageInfo"),sv=document.getElementById("smallMenu_Image"),TJ=document.getElementById("engagementButtonsSmallMenu");TJ.style.visibility="hidden";TJ.style.display="none";const vn=document.getElementById("smallMenuMarket"),x5e=document.getElementById("smallMenuMarket_Image"),R5e=document.getElementById("smallMenuMarket_locationBuildingInfo"),B5e=document.getElementById("smallMenuMarket_priceInfo"),I5e=document.getElementById("smallMenuMarket_areaInfo"),D5e=document.getElementById("smallMenuMarket_availabilityStatusInfo"),xl=document.getElementById("mainMenuWrapper"),DT=document.getElementById("mainMenu_InformationMarket");document.getElementById("mainMenu_GetInTouchMarket");document.getElementById("mainMenu_MediaMarket");const MJ=document.getElementById("mainMenuMarket_Image"),xJ=document.getElementById("mainMenuMarket_flatID"),RJ=document.getElementById("mainMenuMarket_flatPrice"),BJ=document.getElementById("mainMenuMarket_flatArea"),IJ=document.getElementById("mainMenuMarket_flatBedroomNo"),DJ=document.getElementById("mainMenuMarket_flatSpacesNo"),PJ=document.getElementById("mainMenuMarket_flatLevel"),LJ=document.getElementById("mainMenuMarket_flatOrientation"),OJ=document.getElementById("mainMenuMarket_flatBalcony"),NJ=document.getElementById("mainMenuMarket_flatExternalArea"),rl=document.getElementById("mainMenuMarket_buttonMail"),nl=document.getElementById("mainMenuMarket_buttonWebsite"),tc=document.getElementById("mainMenuMarket_buttonGallery"),ic=document.getElementById("mainMenuMarket_buttonPlan"),al=document.getElementById("mainMenuMarket_buttonPdf"),yi=document.getElementById("mainMenu"),Jr=document.getElementById("mainMenu_nameInfo"),wp=document.getElementById("mainMenu_Image"),_u=d
12054ocument.getElementById("mainMenu_Link"),iE=document.getElementById("mainMenu_stageInfo"),rE=document.getElementById("mainMenu_neighbourhoodInfo"),nE=document.getElementById("mainMenu_designerInfo"),aE=document.getElementById("mainMenu_developerInfo"),sE=document.getElementById("mainMenu_constructorInfo"),bp=document.getElementById("mainMenu_participationStatusInfo"),b0=document.getElementById("mainMenu_salesStatusInfo"),yO=document.getElementById("mainMenu_participationStatus"),EO=document.getElementById("mainMenu_digitalTwinStatus"),or=document.getElementById("mainMenu_buttonWebsite");document.getElementById("mainMenu_buttonMail");document.getElementById("mainMenu_buttonPhone");const Vt=document.getElementById("loadingInfo"),ZE=document.getElementById("neighbourhoodButton1"),JE=document.getElementById("neighbourhoodButton2"),$E=document.getElementById("neighbourhoodButton3"),e1=document.getElementById("stageButton1"),t1=document.getElementById("stageButton2"),i1=document.getElementById("stageButton3"),ov=document.getElementById("actionButton1"),lv=document.getElementById("actionButton2"),cv=document.getElementById("actionButton3"),P5e=document.getElementById("toggleQR"),L5e=document.getElementById("qrCodeCloseMenu"),UJ=document.getElementById("qrCodeMenu");P5e.addEventListener("click",eze,!0);L5e.addEventListener("click",tze,!0);const Sp=document.getElementById("showcaseToggleInform"),S0=document.getElementById("showcaseToggleParticipate");Sp.style.backgroundColor="#f9d235";Sp.addEventListener("click",function(){Sp.style.backgroundColor="#f9d235",S0.style.backgroundColor="#d0d0d0",Bi.click()},!0);S0.addEventListener("click",function(){Sp.style.backgroundColor="#d0d0d0",S0.style.backgroundColor="#f9d235",Wi.click()},!0);const PT=document.getElementById("mainMenuMasterplanWrapper"),Pn=document.getElementById("toggleButtonsTools"),O5e=document.getElementById("resetFilters"),N5e=document.getElementById("resetCameraPosition"),FJ=document.getElementById("planCameraPosition"),U5e=document.getElementById("toggleLayer"),F5e=document.getElementById("countyOverview"),FA=document.getElementById("buttonOpenForParticipation"),kA=document.getElementById("buttonOpenForSales"),Ka=document.getElementById("mainMasterplanMenu"),Hs=document.getElementById("mainMenuMasterplan_Image");document.getElementById("mainMenuMasterplan_Actions");const Al=document.getElementById("mainMenuMasterplan_NavigationControlls"),AA=document.getElementById("mainMenuMasterplan_Filters"),fA=document.getElementById("mainMenuMasterplan_Filter"),Aa=document.getElementById("mainMenuMasterplan_Information"),Ao=document.getElementById("mainMenuMasterplan_InformationText"),LT=document.getElementById("mainMenuMasterplan_InformationTitle"),HA=document.getElementById("mainMenuMasterplan_MainTitle"),vg=document.getElementById("mainMenuMasterplan_ProjectSelect"),nh=document.getElementById("mainMenuMasterplan_Toolset"),zd=document.getElementById("mainMenuMasterplan_ShowcaseTools");zd.style.display="none";zd.style.visibility="hidden";AA.style.display="none";AA.style.visibility="hidden";fA.style.display="none";fA.style.visibility="hidden";Al.style.display="none";Al.style.visibility="hidden";_u.style.display="none";_u.style.visibility="hidden";const r1=document.getElementById("worldOverviewButton");r1.addEventListener("click",$J,!0);r1.active="active";const k5e=document.getElementById("NieuwDelftMasterplanButton");k5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Nieuw Delft Masterplan"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const H5e=document.getElementById("CircularCityHouseButton");H5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Circular City House"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const G5e=document.getElementById("SluisbuurtMasterplanButton");G5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Sluisbuurt Masterplan"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const z5e=document.getElementById("DijkParkMasterplanButton");z5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Dijk Park Masterplan"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const Q5e=document.getElementById("MalmoMasterplanButton");Q5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Malmo Masterplan"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const V5e=document.getElementById("GliwiceScobelButton");V5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Gliwice Browar Scobel"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const W5e=document.getElementById("ThrissurMasterplanButton");W5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Thrissur Urban Study"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const j5e=document.getElementById("UrbanFutureButton");j5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Urban Future"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const Y5e=document.getElementById("StrandeilandMasterplanButton");Y5e.addEventListener("click",()=>{for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Strandeiland Masterplan"&&($e=li.features[t]);fo($e.properties.title,$e.geometry.coordinates)},!0);const lc=document.getElementById("toggleTypeform2min"),cc=document.getElementById("toggleTypeform5min");document.getElementById("toggleTypeform10min");document.getElementById("typeFromDiv");const fl=document.getElementById("mainMenu_participationResults"),ah=document.getElementById("mainMenu_participationPins");ah.style.display="none";ah.style.visibility="hidden";const K5e=document.getElementById("dropPinButton");K5e.addEventListener("click",function(){nze()},!0);const pA=document.getElementById("dropPinCoordinates"),va=new mapboxgl.Marker({draggable:!0,color:"#f9d235"}),sl=document.getElementById("mainMenu_Information"),vh=document.getElementById("mainMenu_Participation"),Ni=document.getElementById("mainMenu_Sales"),xs=document.getElementById("launchParticipationButton"),Mo=document.getElementById("launchMarketButton"),Zs=document.getElementById("launchDigitalTwinButton"),Rl=document.getElementById("mainMenu_userInformationPanel"),_h=document.getElementById("mainMenu_Title"),GA=document.getElementById("mainMenu_AI"),_c=document.getElementById("closeTypeForm");var Vf=!1;_c.addEventListener("click",function(){$Ge();try{Yg(_c)}catch{}},!0);_c.click();const X5e=document.getElementById("userEmail"),q5e=document.getElementById("userRole"),Z5e=document.getElementById("userPermissions"),Q2=d
12054ocument.getElementById("togglePassword"),V2=document.getElementById("togglePasswordConfirm"),W2=document.getElementById("togglePasswordLogin"),j2=document.getElementById("togglePasswordReset"),Y2=document.getElementById("togglePasswordResetConfirm"),C0=document.getElementById("getInTouchMenu"),J5e=document.getElementById("getStartedButton"),$5e=document.getElementById("bookAMeetingButton"),eGe=document.getElementById("closeGetInTouchMenu"),tGe=document.getElementById("bringBackGetInTouchMenu"),br=document.getElementById("mediaGalleryWrapper"),kJ=document.getElementById("closeMediaGallery"),kn=document.getElementById("mediaContainerGallery"),Qd=document.getElementById("mainMenu_ScanModule"),Zi=document.getElementById("mainMenu_digitalTwin");Qd.style.display="none";Qd.style.visibility="hidden";Zi.style.display="none";Zi.style.visibility="hidden";const HJ=document.getElementById("launchScanButton");HJ.style.backgroundColor="#f9d235";kJ.addEventListener("click",()=>{qE=0,Ep=!1,jS=!1,br.style.display="none",br.style.visibility="hidden",kn.innerHTML="",document.getElementById("galleryButtonMenu").style.display="block",Ps!=null&&(Ps.remove(),Ps=null,OM=!1),w0=null,E0=null,y0=null,uy=null},!0);tc.addEventListener("click",()=>{kn.innerHTML="";const t="OqEd3MQhQYU?si=ewuW7c_TxQK-WRJB",i=document.createElement("iframe");i.className="mediaGalleryContent youTubeContent",i.class="mediaGalleryContent",i.src=`https://www.youtube.com/embed/${t}`,i.title="YouTube video player",i.frameBorder="0",i.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",i.allowFullscreen=!0,kn.appendChild(i),br.style.display="block",br.style.visibility="visible"},!0);ic.addEventListener("click",()=>{kn.innerHTML="";const t=document.createElement("img");t.className="mediaGalleryContent",t.src=yJ,kn.appendChild(t),br.style.display="block",br.style.visibility="visible"},!0);wp.addEventListener("click",()=>{kn.innerHTML="";const t=document.createElement("img");t.className="mediaGalleryContent",t.src=wp.src,kn.appendChild(t),br.style.display="block",br.style.visibility="visible"},!0);HJ.addEventListener("click",()=>{kn.innerHTML="";var t=null;const i=document.createElement("canvas");i.className="mediaGalleryContent",kn.appendChild(i);const r=i;t=new L4e(r),t.load("https://prod.spline.design/vP5iCrv9FOhtP4S2/scene.splinecode"),br.style.display="block",br.style.visibility="visible"},!0);JJ();for(var K2=0;K2<Ka.children.length;K2++){var a_=Ka.children[K2];a_.id.includes("FlatFilter")&&a_.id.includes("mainMenuMasterplan")&&typeof a_!="string"&&(a_.style.display="none",a_.style.visibility="hidden")}J5e.onclick=function(){window.open("https://eoxsnlhinp7.typeform.com/to/vuLoitBh?typeform-source=publictwin.info","_blank")};$5e.onclick=function(){window.open("https://calendly.com/publictwin/30min","_blank")};tGe.onclick=function(){C0.style.transform="translate(0,0)",C0.classList.remove("closed")};eGe.addEventListener("click",JJ,!0);const iGe=document.getElementById("startProjectButton"),rGe=document.getElementById("bookMeetingButton");iGe.onclick=function(){window.open("https://eoxsnlhinp7.typeform.com/to/vuLoitBh?typeform-source=publictwin.info","_blank")};rGe.onclick=function(){window.open("https://calendly.com/publictwin/30min","_blank")};Q2.addEventListener("click",()=>{const t=document.querySelector("#password"),i=t.getAttribute("type")==="password"?"text":"password";t.setAttribute("type",i),Q2.classList.toggle("bi-eye-slash"),Q2.classList.toggle("bi-eye")});V2.addEventListener("click",()=>{const t=document.querySelector("#confirm_password"),i=t.getAttribute("type")==="password"?"text":"password";t.setAttribute("type",i),V2.classList.toggle("bi-eye-slash"),V2.classList.toggle("bi-eye")});W2.addEventListener("click",()=>{const t=document.querySelector("#passwordLogIn"),i=t.getAttribute("type")==="password"?"text":"password";t.setAttribute("type",i),W2.classList.toggle("bi-eye-slash"),W2.classList.toggle("bi-eye")});j2.addEventListener("click",()=>{const t=document.querySelector("#newPassword"),i=t.getAttribute("type")==="password"?"text":"password";t.setAttribute("type",i),j2.classList.toggle("bi-eye-slash"),j2.classList.toggle("bi-eye")});Y2.addEventListener("click",()=>{const t=document.querySelector("#confirmNewPassword"),i=t.getAttribute("type")==="password"?"text":"password";t.setAttribute("type",i),Y2.classList.toggle("bi-eye-slash"),Y2.classList.toggle("bi-eye")});const OT=document.getElementById("digitalTwinMenuWrapper");document.getElementById("digitalTwinMenu");const nGe=document.getElementById("closeDigitalTwinMenu");nGe.addEventListener("click",()=>{OT.style.display="none",OT.style.visibility="hidden",Application.stream.disconnect(),videoContainer.innerHTML="",console.log("disconecting arcware stream!")},!0);const bW=document.getElementById("navbarTop"),n3=document.getElementById("inactiveMenu"),aGe=document.getElementById("inactiveMenuContinue"),GJ=document.getElementById("inactiveMenuRestart");aGe.addEventListener("click",function(){n3.style.display="none",lE=!1});GJ.addEventListener("click",function(){lE=!1,kJ.click(),n3.style.display="none",Ru.innerHTML="let's start",Ru.click()});const sGe=document.getElementById("openMainGalleryButton");sGe.addEventListener("click",function(){console.log("opening gallery"),
12054XM("all",qE)});const T0=document.getElementById("loginMenu"),_g=document.getElementById("loadingScreenMenu");_g.style.display="none";_g.style.visibility="hidden";const zJ=document.getElementById("closeLoginMenu"),UM=document.getElementById("menuSwitchSignUpButton");UM.addEventListener("click",rze,!0);const oGe=document.getElementById("menuContinueAsGuestButton");oGe.addEventListener("click",()=>{zJ.click()},!0);zJ.addEventListener("click",()=>{T0.style.display="none",T0.style.visibility="hidden"},!0);const FM=document.getElementById("menuSwitchLogInButton");FM.addEventListener("click",l3,!0);const kM=document.getElementById("menuSignUpDiv"),HM=document.getElementById("menuLogInDiv"),lGe=document.getElementById("logoutButton"),cGe=document.getElementById("forgotPassword"),hGe=document.getElementById("forgotPasswordLogin");cGe.addEventListener("click",ize,!0);hGe.addEventListener("click",l3,!0);const GM=document.getElementById("passwordResetRequestDiv"),QJ=document.getElementById("passwordResetDiv");C0.classList.add("closed");C0.style.transform="translate(0,110%)";document.getElementById("typeformWrapper").style.transform="translate(100%,0)";window.onload=function(){const i=new URLSearchParams(window.location.search).get("token");WJ(),i&&(document.getElementById("passwordResetDiv").style.display="block",document.getElementById("token").value=i,kM.style.display="none",HM.style.display="none",GM.style.display="none")};document.getElementById("passwordResetForm").addEventListener("submit",function(t){t.preventDefault();var i=new gE(this);const r=document.getElementById("resetMessage"),n=document.getElementById("newPassword").value,a=document.getElementById("confirmNewPassword").value;if(n.length<8||!/[A-Z]/.test(n)||!/[0-9]/.test(n)){r.style.color="red",r.innerText="Password must be minimum 8 characters long, contain a capital letter, and a digit.";return}if(n!==a){r.style.color="red",r.innerText="Passwords do not match!";return}fetch("https://publictwin.info/digital_maquette/php_scripts/reset_password.php",{method:"POST",body:i}).then(s=>s.json()).then(s=>{s.success?(r.style.color="green",r.innerText=s.message,setTimeout(l3,500)):(r.style.color="red",r.innerText=s.message)}),rM.capture("passwordReset")});document.getElementById("passwordResetRequestForm").addEventListener("submit",function(t){t.preventDefault();var i=new gE(this);fetch("https://publictwin.info/digital_maquette/php_scripts/password_reset_request.php",{method:"POST",body:i}).then(r=>r.json()).then(r=>{const n=document.getElementById("resetRequestMessage");r.success?(n.style.color="green",n.innerText=r.message):(n.style.color="red",n.innerText=r.message)})});document.getElementById("menuLogInForm").addEventListener("submit",function(t){t.preventDefault();const i=new gE(t.target),r=document.getElementById("loginMessage");fetch("https://publictwin.info/digital_maquette/php_scripts/login.php",{method:"POST",body:i}).then(n=>n.json()).then(n=>{n.success?(r.style.color="green",r.innerText="Login successful!",setTimeout(c3,500),Sr.active="active",Sr.style.backgroundColor="#f9d235"):(r.style.color="red",r.innerText=n.message)}).catch(n=>{console.error("Error:",n),r.style.color="red",r.innerText="An error occurred. Please try again."}),rM.capture("userLogin")});document.getElementById("menuSignUpForm").addEventListener("submit",function(t){t.preventDefault();var i=new gE(this),r=String(i.get("password")),n=String(i.get("confirm_password")),a=r===n;const s=document.getElementById("signUpMessage");function o(c){var h=/[A-Z]/.test(c),u=/\d/.test(c);return c.length>=8&&h&&u}var l=o(r);if(!l){s.style.color="red",s.innerText="Password must be minimum 8 characters long, contain a capital letter, and a digit.";return}if(a)fetch("https://publictwin.info/digital_maquette/php_scripts/register.php",{method:"POST",body:i}).then(c=>c.json()).then(c=>{c.success?(s.style.color="green",s.innerText=c.message,setTimeout(c3,500)):(s.style.color="red",s.innerText=c.message)}),rM.capture("userSignUp");else{s.style.color="red",s.innerText="Passwords do not match!";return}});lGe.addEventListener("click",function(){var t=window.location.href,i=encodeURIComponent(t);window.location.href="https://publictwin.info/digital_maquette/php_scripts/logout.php?current_url="+i,Sr.active="inactive",Sr.style.backgroundColor="#616161"});const Fu=document.getElementById("toggleTools"),hv=document.getElementById("toggleNavigation"),xA=document.getElementById("toggleView"),zM=document.getElementById("toggleGuide"),Cp=document.getElementById("toggleShowcase");Fu.addEventListener("click",uGe,!0);hv.addEventListener("click",dGe,!0);xA.addEventListener("click",AGe,!0);zM.addEventListener("click",fGe,!0);Cp.addEventListener("click",pGe,!0);Fu.active="active";hv.active="active";xA.active="active";zM.active="active";Cp.active="active";function uGe(){if(Fu.active=="active"){n1(),Sr.style.opacity="50%",HA.innerHTML="⢠Toolset â¢";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.id=="toggleTools"?i.style.opacity="100%":i.style.opacity="50%"}for(var t=0;t<Ka.children.length;t++){var i=Ka.children[t];i.id.includes("Toolset")||i.id.includes("InformationTitle")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}if(cn=="market")for(var t=0;t<nh.children.length;t++){var i=nh.children[t];i.id.includes("Flat")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}else for(var t=0;t<nh.children.length;t++){var i=nh.children[t];i.id.includes("Flat")&&(i.style.display="none",i.style.visibility="hidden")}}}function dGe(){if(hv.active=="active"){n1(),Sr.style.opacity="50%",HA.innerHTML="⢠Navigation â¢";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.id=="toggleNavigation"?i.style.opacity="100%":i.style.opacity="50%"}for(var t=0;t<Ka.children.length;t++){var i=Ka.children[t];i.id.includes("Navigation")||i.id.includes("InformationTitle")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}ss=="global"?(Al.style.display="none",Al.style.visibility="hidden"):(Al.style.display="block",Al.style.visibility="visible")}}function AGe(){if(xA.active=="active"){n1(),Sr.style.opacity="50%",HA.innerHTML="⢠Dispay Settings â¢";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.id=="toggleView"?i.style.opacity="100%":i.style.opacity="50%"}for(var t=0;t<Ka.children.length;t++){var i=Ka.children[t];i.id.includes("View")||i.id.includes("InformationTitle")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}}}function fGe(){if(zM.active=="active"){n1(),Sr.style.opacity="50%",HA.innerHTML="⢠Software Guide â¢";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.id=="toggleGuide"?i.style.opacity="100%":i.style.opacity="50%"}for(var t=0;t<Ka.children.length;t++){var i=Ka.children[t];i.id.includes("Guide")||i.id.includes("InformationTitle")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}}}function pGe(){if(Cp.active=="active"){n1(),Sr.style.opacity="50%",HA.innerHTML="⢠Guided Showcase â¢";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.id=="toggleShowcase"?i.style.opacity="100%":i.style.opacity="50%"}for(var t=0;t<Ka.children.length;t++){var i=Ka.children[t];i.id.includes("Showcase")||i.id.includes("InformationTitle")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}}}function n1(){PT.style.transform="translate(0,0)",Ka.scrollTo(0,0)}const Bi=document.getElementById("toggleInformation"),Wi=document.getElementById("toggleData"),Sr=document.getElementById("toggleUser"),yr=document.getElementById("toggleMarket"),Bl=document.getElementById("toggleAI");Bi.active="active";Bi.style.backgroundColor="#f9d235";Bi.style.opacity="50%";Wi.active="inactive";Wi.style.backgroundColor="#616161";Wi.style.opacity="50%";Sr.active="inactive";Sr.enabled="enabled";Sr.style.backgroundColor="#616161";Sr.style.opacity="50%";yr.active="inactive";yr.style.backgroundColor="#616161";yr.style.opacity="50%";Bl.active="active";Bl.style.backgroundColor="#f9d235";Bl.style.opacity="50%";Wi.addEventListener("click",mGe,!0);function mGe(){if(Sp.style.backgroundColor="#d0d0d0",S0.style.backgroundColor="#f9d235",ji(),Wi.active=="active"){if(bp.innerHTML=="open"?(fl.style.display="block",fl.style.visibility="visible"):(fl.style.display="none",fl.style.visibility="hidden"),Rl.style.display="none",Rl.style.visibility="visible",_h.style.display="block",_h.style.visibility="visible",sl.style.display="none",sl.style.visibility="hidden",Aa.style.display="none",Aa.style.visibility="hidden",vh.style.display="block",vh.style.visibility="visible",Ni.style.display="none",
12054Ni.style.visibility="hidden",GA.style.display="none",GA.style.visibility="hidden",Wi.style.opacity="100%",Bl.style.opacity="50%",Bi.style.opacity="50%",Sr.style.opacity="50%",yr.style.opacity="50%",xl.classList.remove("closed"),xl.style.transform="translate(0,0)",yi.classList.remove("closed"),$e)try{$e.properties.beforeAndAfterPoints&&(B.getLayer("beforeAndAfterPoints")&&B.removeLayer("beforeAndAfterPoints"),B.getSource("beforeAndAfterPoints")&&B.removeSource("beforeAndAfterPoints")),$e.properties.informPoints&&(B.getLayer("informPoints")&&B.removeLayer("informPoints"),B.getSource("informPoints")&&B.removeSource("informPoints")),$e.properties.panoramaPoints&&(B.getLayer("panoramaPoints")&&B.removeLayer("panoramaPoints"),B.getSource("panoramaPoints")&&B.removeSource("panoramaPoints"))}catch{}if($e.properties.participatoryModuleActive==!0){if(ah.style.display="block",ah.style.visibility="visible",!(window.innerWidth<=768))try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch{}if(B.on("mouseenter","ParticipatoryActions",r=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer";const n=r.features[0].geometry.coordinates.slice();if(r.features[0].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(r.lngLat.lng-n[0])>180;)n[0]+=r.lngLat.lng>n[0]?360:-360;Ro.setLngLat(n).setHTML(`<h3>${r.features[0].properties.title}</h3> 12055 <img src="${r.features[0].properties.image}" style="width:100%;height:auto;"></img> 12056 <p><span class="boldPopUp">description:</span><span>${r.features[0].properties.description}</span></p> 12057 <p><span class="boldPopUp">status:</span><span>${r.features[0].properties.status}</span></p> 12058 <button id="participateButton-${r.features[0].properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">participate!</button>`).addTo(B);const a=document.querySelector(".mapboxgl-popup-content"),s=document.querySelector(".mapboxgl-popup-tip"),o=document.getElementById(`participateButton-${r.features[0].properties.title.replace(/\s+/g,"-")}`);o&&o.addEventListener("click",()=>{if(r.features[0].properties.status==="active"){Ro.remove(),D_(r.features[0].properties.participatoryForm);let l={zoom:r.features[0].properties.zoom,pitch:r.features[0].properties.pitch,bearing:r.features[0].properties.bearing,center:JSON.parse(r.features[0].properties.center)};ji(r.features[0].properties.zoom),Ri(l),Yg(o)}}),r.features[0].properties.status==="inactive"?(a.classList.add("maquetteInDevelopment"),s.classList.add("maquetteInDevelopment"),a.classList.remove("activeMaquette"),s.classList.remove("activeMaquette")):r.features[0].properties.status==="active"&&(a.classList.add("activeMaquette"),s.classList.add("activeMaquette"),a.classList.remove("maquetteInDevelopment"),s.classList.remove("maquetteInDevelopment"))}),B.on("touchstart","ParticipatoryActions",r=>{B.getCanvas().style.cursor="pointer";const n=r.features[0].geometry.coordinates.slice();r.features[0].properties.description;const a=r.features[0];if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(r.lngLat.lng-n[0])>180;)n[0]+=r.lngLat.lng>n[0]?360:-360;Ro.setLngLat(n).setHTML(`<h3>${r.features[0].properties.title}</h3> 12059 <img src="${r.features[0].properties.image}" style="width:100%;height:auto;"></img> 12060 <p><span class="boldPopUp">description:</span><span>${r.features[0].properties.description}</span></p> 12061 <p><span class="boldPopUp">status:</span><span>${r.features[0].properties.status}</span></p> 12062 <button id="participateButton-${r.features[0].properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">participate!</button>`).addTo(B);const s=document.querySelector(".mapboxgl-popup-content"),o=document.querySelector(".mapboxgl-popup-tip"),l=document.getElementById(`participateButton-${r.features[0].properties.title.replace(/\s+/g,"-")}`);l&&l.addEventListener("click",()=>{if(a.properties.status==="active"){Ro.remove(),D_(a.properties.participatoryForm);let c={zoom:a.properties.zoom,pitch:a.properties.pitch,bearing:a.properties.bearing,center:JSON.parse(a.properties.center)};ji(a.properties.zoom),Ri(c),Yg(l)}}),r.features[0].properties.status==="inactive"?(s.classList.add("maquetteInDevelopment"),o.classList.add("maquetteInDevelopment"),s.classList.remove("activeMaquette"),o.classList.remove("activeMaquette")):r.features[0].properties.status==="active"&&(s.classList.add("activeMaquette"),o.classList.add("activeMaquette"),s.classList.remove("maquetteInDevelopment"),o.classList.remove("maquetteInDevelopment"))}),B.on("mouseleave","ParticipatoryActions",()=>{Ut=!0,Cr=!1,B.getCanvas().style.cursor=""}),Dt)Dt.style.display="block",Dt.style.visibility="visible";
12062else{Dt=document.createElement("div"),Dt.classList="mainMenuSegment",yi.appendChild(Dt);let r=document.createElement("div");r.classList="mainMenuTitle",r.innerHTML="⢠participatory actions â¢",Dt.appendChild(r),Yi=$e.properties.participatoryActions.features;for(var t=0;t<Yi.length;t++){let n=document.createElement("div");n.classList="blockDisplay filterButton button100 clickableButton participatorySegment";let a=document.createElement("div");a.innerHTML=`<span>name:</span>${$e.properties.participatoryActions.features[t].properties.title}`;let s=document.createElement("div");s.innerHTML=`<span>status:</span>${$e.properties.participatoryActions.features[t].properties.status}`;let o=document.createElement("div");o.innerHTML=`<span>open untill:</span>${$e.properties.participatoryActions.features[t].properties.openTill}`;let l=document.createElement("img");l.classList="particpateSegmentImage",l.src=$e.properties.participatoryActions.features[t].properties.image,n.appendChild(a),n.appendChild(s),n.appendChild(o),Dt.appendChild(n),n.id=`participateButton-${Yi[t].properties.title.replace(/\s+/g,"-")}`,n.no=t,n&&(n.addEventListener("click",()=>{if(Br==!1){if(Yi[n.no].properties.status==="active"){Ro.remove(),D_(Yi[n.no].properties.participatoryForm);let h=Yi[n.no].properties.center,u={zoom:Yi[n.no].properties.zoom,pitch:Yi[n.no].properties.pitch,bearing:Yi[n.no].properties.bearing,center:h};ji(Yi[n.no].properties.zoom),Ri(u)}for(var c=0;c<Dt.children.length;c++)Dt.children[c].id.includes("participateButton")&&(Dt.children[c].style.backgroundColor="#d0d0d0");n.style.backgroundColor="#f9d235"}if(hi==null){hi=document.createElement("div"),hi.classList="mainMenuSegment",yi.appendChild(hi);let h=document.createElement("div");h.classList="mainMenuTitle",h.innerHTML="⢠active participation form QR â¢",hi.appendChild(h);let u=document.createElement("div");u.classList="QRImageDiv";let d=document.createElement("img");d.src=Yi[n.no].properties.qrCode,d.classList="QRDivImage marginAuto",u.appendChild(d),hi.appendChild(u)}else{hi.innerHTML="",hi.remove(),hi=document.createElement("div"),hi.classList="mainMenuSegment",yi.appendChild(hi);let h=document.createElement("div");h.classList="mainMenuTitle",h.innerHTML="⢠active participation form QR â¢",hi.appendChild(h);let u=document.createElement("div");u.classList="QRImageDiv";let d=document.createElement("img");d.src=Yi[n.no].properties.qrCode,d.classList="QRDivImage marginAuto",u.appendChild(d),hi.appendChild(u)}}),n.addEventListener("mouseover",function(){if(Br==!1){const c=Yi[n.no].geometry.coordinates.slice();if(Yi[n.no].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(e.lngLat.lng-c[0])>180;)c[0]+=e.lngLat.lng>c[0]?360:-360;Ro.setLngLat(c).setHTML(`<h3>${Yi[n.no].properties.title}</h3> 12063 <img src="${Yi[n.no].properties.image}" style="width:100%;height:auto;"></img> 12064 <p><span class="boldPopUp">description:</span><span>${Yi[n.no].properties.description}</span></p> 12065 <p><span class="boldPopUp">status:</span><span>${Yi[n.no].properties.status}</span></p> 12066 <button id="participateButton-${Yi[n.no].properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">participate!</button>`).addTo(B);const h=document.querySelector(".mapboxgl-popup-content"),u=document.querySelector(".mapboxgl-popup-tip"),d=document.getElementById(`participateButton-${Yi[n.no].properties.title.replace(/\s+/g,"-")}`);d&&d.addEventListener("click",()=>{if(Yi[n.no].properties.status==="active"&&Br==!1){Ro.remove(),D_(Yi[n.no].properties.participatoryForm);let A={zoom:Yi[n.no].properties.zoom,pitch:Yi[n.no].properties.pitch,bearing:Yi[n.no].properties.bearing,center:Yi[n.no].properties.center};ji(Yi[n.no].properties.zoom),Ri(A),Yg(n)}}),Yi[n.no].properties.status==="inactive"?(h.classList.add("maquetteInDevelopment"),u.classList.add("maquetteInDevelopment"),h.classList.remove("activeMaquette"),u.classList.remove("activeMaquette")):Yi[n.no].properties.status==="active"&&(h.classList.add("activeMaquette"),u.classList.add("activeMaquette"),h.
12066classList.remove("maquetteInDevelopment"),u.classList.remove("maquetteInDevelopment"))}}))}}}if(ss=="masterplan"&&(Jr.innerHTML=`⢠${$e.properties.title} â¢`),$e&&$e.properties.title=="Thrissur Urban Study")if(ah.style.display="none",ah.style.visibility="hidden",Zo)Zo.style.display="block",Gc.style.display="block";else{Zo=document.createElement("div"),Zo.className="gatherInsights mainMenuSegment";const i=document.createElement("div");i.innerHTML="⢠gather insights â¢",i.className="gatherInsightsTitle mainMenuTitle";const r=document.createElement("button");r.innerHTML='drop pin on the map <img class="guideIcon" src="https://publictwin.info/digital_maquette/content/00_Icons/Measure/Measure_Center.svg"/>',r.className="blockDisplay buttonCenter filterButton filterResetButton guideTitle button100 clickableButton",Gc=document.createElement("div"),Gc.className="exploreInsights mainMenuSegment";const n=document.createElement("div");n.innerHTML="⢠explore insights â¢",n.className="gatherInsightsTitle mainMenuTitle";const a=document.createElement("button");a.innerHTML='show participation results <img class="guideIcon" src="https://publictwin.info/digital_maquette/content/00_Icons/Measure/Measure_Center.svg"/>',a.className="blockDisplay buttonCenter filterButton filterResetButton guideTitle button100 clickableButton";const s=document.createElement("button");if(s.innerHTML="exit results exploration",s.className="blockDisplay buttonCenter filterButton filterResetButton guideTitle button100 clickableButton",Zo.appendChild(i),Zo.appendChild(r),Gc.appendChild(n),Gc.appendChild(a),Gc.appendChild(s),window.innerWidth<=768){const l=document.createElement("div");l.className="mobileParticipateButtonsDiv",l.appendChild(Zo),l.appendChild(Gc),document.body.appendChild(l)}else yi.appendChild(Zo),yi.appendChild(Gc);r.addEventListener("click",function(){aze()},!0),a.addEventListener("click",function(){gGe()},!0),s.addEventListener("click",function(){vGe()},!0)}yi.scrollTo(0,0),ji(),jM(),QM()}}function gGe(){if(document.getElementById("resultsPinButton").style.backgroundColor="#f9d235",$e)try{$e.properties.participatoryModuleActive==!0&&(console.log("removing participatory icons!"),B.getLayer("ParticipatoryActions")&&B.removeLayer("ParticipatoryActions"),B.getSource("ParticipatoryActions")&&B.removeSource("ParticipatoryActions"),Ro.remove())}catch{console.log("no participatory module")}Br=!0,_c.click(),Dt&&(Dt.style.display="none",Dt.style.visibility="hidden"),fetch("https://publictwin.info/digital_maquette/php_scripts/read_pinCardiff.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`table=${encodeURIComponent("ThrissurUrbanStudy_Pins")}`}).then(i=>i.json()).then(i=>{console.log(i),console.log(i.features),console.log(),B.getLayer("resultsPinCardiff")&&B.removeLayer("resultsPinCardiff"),B.getSource("resultsPinCardiff")&&B.removeSource("resultsPinCardiff"),B.addSource("resultsPinCardiff",{type:"geojson",data:i}),B.addLayer({id:"resultsPinCardiff",type:"circle",source:"resultsPinCardiff",paint:{"circle-radius":{base:1.75,stops:[[12,10],[22,100]]},"circle-opacity":.65,"circle-stroke-width":1,"circle-stroke-color":"#000000","circle-color":["match",["get","topic"],"transport","#919191","walkability","#dadada","environment","#82b03d","social","#f9d235","#ccc"]}})}).catch(i=>{console.error("Error fetching data:",i)})}function vGe(){if(B.getLayer("resultsPinCardiff")&&B.removeLayer("resultsPinCardiff"),B.getSource("resultsPinCardiff")&&B.removeSource("resultsPinCardiff"),document.getElementById("resultsPinButton").style.backgroundColor="#8f8f8f",!(window.innerWidth<=768))try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch(i){console.log("loading participatory icons error:",i)}ni.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible")}function Yg(t){for(var i=0;i<Dt.children.length;i++)if(Dt.children[i].id.includes("participateButton"))if(t.no)if(Dt.children[i].no==t.no)if(Dt.children[i].style.backgroundColor="#f9d235",hi==null){hi=document.createElement("div"),hi.classList="mainMenu
12066Segment",yi.appendChild(hi);let r=document.createElement("div");r.classList="mainMenuTitle",r.innerHTML="⢠active participation form QR â¢",hi.appendChild(r);let n=document.createElement("div");n.classList="QRImageDiv";let a=document.createElement("img");a.src=Yi[t.no].properties.qrCode,a.classList="QRDivImage marginAuto",n.appendChild(a),hi.appendChild(n)}else{hi.innerHTML="",hi.remove(),hi=document.createElement("div"),hi.classList="mainMenuSegment",yi.appendChild(hi);let r=document.createElement("div");r.classList="mainMenuTitle",r.innerHTML="⢠active participation form QR â¢",hi.appendChild(r);let n=document.createElement("div");n.classList="QRImageDiv";let a=document.createElement("img");a.src=Yi[t.no].properties.qrCode,a.classList="QRDivImage marginAuto",n.appendChild(a),hi.appendChild(n)}else Dt.children[i].style.backgroundColor="#d0d0d0";else if(Dt.children[i].id==t.id)if(Dt.children[i].style.backgroundColor="#f9d235",hi==null){hi=document.createElement("div"),hi.classList="mainMenuSegment",yi.appendChild(hi);let r=document.createElement("div");r.classList="mainMenuTitle",r.innerHTML="⢠active participation form QR â¢",hi.appendChild(r);let n=document.createElement("div");n.classList="QRImageDiv";let a=document.createElement("img");a.src=Yi[Dt.children[i].no].properties.qrCode,a.classList="QRDivImage marginAuto",n.appendChild(a),hi.appendChild(n)}else{hi.innerHTML="",hi.remove(),hi=document.createElement("div"),hi.classList="mainMenuSegment",yi.appendChild(hi);let r=document.createElement("div");r.classList="mainMenuTitle",r.innerHTML="⢠active participation form QR â¢",hi.appendChild(r);let n=document.createElement("div");n.classList="QRImageDiv";let a=document.createElement("img");a.src=Yi[Dt.children[i].no].properties.qrCode,a.classList="QRDivImage marginAuto",n.appendChild(a),hi.appendChild(n)}else Dt.children[i].style.backgroundColor="#d0d0d0"}Sr.addEventListener("click",_Ge,!0);function _Ge(){if(Sr.enabled=="enabled")if(Sr.active=="active"){Rl.style.display="block",Rl.style.visibility="visible",Sr.style.opacity="100%",HA.innerHTML="⢠User Information Panel â¢";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.id=="toggleUser"?i.style.opacity="100%":i.style.opacity="50%"}for(var t=0;t<Ka.children.length;t++){var i=Ka.children[t];i.id.includes("User")||i.id.includes("InformationTitle")?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}PT.classList.remove("closed"),PT.style.transform="translate(0,0)",Ka.classList.remove("closed"),Ka.scrollTo(0,0),jM()}else T0.style.display="block",T0.style.visibility="visible"}Bi.addEventListener("click",yGe,!0);function yGe(){if(ji(),ui&&(ui.innerHTML="",ui.remove()),Sp.style.backgroundColor="#f9d235",S0.style.backgroundColor="#d0d0d0",Br){Kn.remove(),va.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible"),document.getElementById("dropPinButton").style.backgroundColor="#8f8f8f";let i=[];i.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),M0(i)}if(B.getLayer("resultsPin")&&B.removeLayer("resultsPin"),B.getSource("resultsPin")){B.removeSource("resultsPin");let i=[];i.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),M0(i)}if(document.getElementById("resultsPinButton").style.backgroundColor="#8f8f8f",Bi.active=="active"){if(_c.click(),cn="inform",Ro.remove(),hi!=null&&(hi.remove(),hi=null),cn=="inform"&&(vn.style.display="none",vn.style.visibility="hidden"),Dt&&(Dt.style.display="none",Dt.style.visibility="hidden",ah.style.display="none",ah.style.visibility="hidden"),fl.style.display="none",fl.style.visibility="hidden",Rl.style.display="none",Rl.style.visibility="hidden",_h.style.display="block",_h.style.visibility="visible",vh.style.display="none",vh.style.visibility="hidden",GA.style.display="none",GA.style.visibility="hidden",ss=="poi"){console.log("current scale:",ss),$e.properties.title=="Malmo Masterplan"||$e.properties.title=="Dijk Park Masterplan"?(Aa.display="block",Aa.visibility="visible",console.log("making menu visible"),Ao.innerHTML=r3,Jr.innerHTML=NM):(sl.style.display="block",sl.style.visibility="visible",Aa.style.display="none",Aa.style.visibility="hidden",console.log("mainMenuMasterplan_Information - display:none"));try{ur.extraModules=="available"?(Ni.style.display="block",Ni.style.visibility="visible",Zi.style.display="block",Zi.style.visibility="visible"):(Ni.style.display="none",
12066Ni.style.visibility="hidden",Zi.style.display="none",Zi.style.visibility="hidden")}catch{Ni.style.display="none",Ni.style.visibility="hidden",Zi.style.display="none",Zi.style.visibility="hidden"}}if(ss=="global"&&(sl.style.display="none",sl.style.visibility="hidden",Ni.style.display="none",Ni.style.visibility="hidden",Zi.style.display="none",Zi.style.visibility="hidden",Aa.style.display="block",Aa.style.visibility="visible",Jr.innerHTML="⢠Digital Maquette â¢"),ss=="masterplan"?(sl.style.display="none",sl.style.visibility="hidden",Ni.style.display="none",Ni.style.visibility="hidden",Zi.style.display="none",Zi.style.visibility="hidden",Aa.style.display="block",Aa.style.visibility="visible",Jr.innerHTML=`⢠${$e.properties.title} â¢`,$e.properties.title=="Gliwice Browar Scobel"?(Qd.style.display="block",Qd.style.visibility="visible"):(Qd.style.display="none",Qd.style.visibility="hidden")):(Qd.style.display="none",Qd.style.visibility="hidden"),$e){try{$e.properties.participatoryModuleActive==!0&&(B.getLayer("ParticipatoryActions")&&B.removeLayer("ParticipatoryActions"),B.getSource("ParticipatoryActions")&&B.removeSource("ParticipatoryActions"))}catch{}try{$e.properties.beforeAndAfterPoints&&(B.addSource("beforeAndAfterPoints",{type:"geojson",data:$e.properties.beforeAndAfterPoints}),B.addLayer({id:"beforeAndAfterPoints",type:"symbol",source:"beforeAndAfterPoints",layout:{"icon-image":"camera","icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}}),B.addSource("informPoints",{type:"geojson",data:$e.properties.informPoints}),B.addLayer({id:"informPoints",type:"symbol",source:"informPoints",layout:{"icon-image":"info","icon-size":.015,"icon-padding":0,"icon-allow-overlap":!0}})),$e.properties.AIPoints&&(B.addSource("AIPoints",{type:"geojson",data:$e.properties.AIPoints}),B.addLayer({id:"AIPoints",type:"symbol",source:"AIPoints",layout:{"icon-image":"aipoint","icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})),$e.properties.beltPoints&&(B.addSource("beltPoints",{type:"geojson",data:$e.properties.beltPoints}),B.addLayer({id:"beltPoints",type:"symbol",source:"beltPoints",layout:{"icon-image":["case",["==",["get","icon"],"greenPoints"],"greenPoints",["==",["get","icon"],"waterPoints"],"waterPoints","logo1"],"icon-size":.02,"icon-padding":0,"icon-allow-overlap":!0}}))}catch{}try{$e.properties.panoramaPoints&&(B.addSource("panoramaPoints",{type:"geojson",data:$e.properties.panoramaPoints}),B.addLayer({id:"panoramaPoints",type:"symbol",source:"panoramaPoints",layout:{"icon-image":"panorama","icon-size":.025,"icon-padding":1,"icon-allow-overlap":!0}}))}catch{}const r=B.getStyle().layers;for(var t=0;t<r.length;t++)r[t].id.includes("AIPoints")&&B.moveLayer(r[t].id),r[t].id.includes("beltPoints")&&B.moveLayer(r[t].id),r[t].id.includes("beforeAndAfterPoints")&&B.moveLayer(r[t].id),r[t].id.includes("informPoints")&&B.moveLayer(r[t].id),r[t].id.includes("panoramaPoints")&&B.moveLayer(r[t].id),r[t].id.includes("textLabels")&&B.moveLayer(r[t].id)}try{$e&&$e.properties.title=="Thrissur Urban Study"&&Zo&&(Zo.style.display="none",Gc.style.display="none")}catch{}console.log("current scale:",ss),Bi.style.opacity="100%",Bl.style.opacity="50%",Sr.style.opacity="50%",Wi.style.opacity="50%",yr.style.opacity="50%",xl.classList.remove("closed"),xl.style.transform="translate(0,0)",yi.classList.remove("closed"),yi.scrollTo(0,0),ji(),jM(),QM()}OM==!0&&(Jr.innerHTML="⢠Imagine the future with AI! â¢",Ao.innerHTML="With the help of AI you can help us re-imagine how the areas of Malmo will look 25 years into the future. You have influence over areas indicated in the image. After generating an idea you can either <span>save to the gallery</span> or <span>reset</span> the process.",Hs.src="https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_2_DIJK_PARK_LANE-ezgif.com-video-to-gif-converter.gif")}yr.addEventListener("click",EGe,!0);function EGe(){if(yr.active=="active"){Nt.style.display="none",Nt.style.visibility="hidden",bO(),fl.style.display="none",fl.style.visibility="hidden",Rl.style.display="none",Rl.style.visibility="hidden",GA.style.display="none",GA.style.visibility="hidden",_h.style.display="block",_h.style.visibility="visible",sl.style.display="none",sl.style.visibility="hidden",vh.style.display="none",vh.style.visibility="hidden",Ni.style.display="none",
12066Ni.style.visibility="hidden",Zi.style.display="block",Zi.style.visibility="visible",Bi.style.opacity="50%",Sr.style.opacity="50%",Wi.style.opacity="50%",Bl.style.opacity="50%",yr.style.opacity="100%",xl.classList.remove("closed"),xl.style.transform="translate(0,0)",yi.classList.remove("closed"),yi.scrollTo(0,0),B.getLayer("NL_NDM_LND")||B.addLayer(zA,"waterway-label"),B.setLayoutProperty("NL_NDM_LND","visibility","visible"),B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("3d-model-CCH")&&B.setLayoutProperty("3d-model-CCH","visibility","none"),B.getLayer("3d-model-Sluisbuurt")&&B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),cn="market";for(var t=0;t<yi.children.length;t++){var i=yi.children[t];i.id.includes("Market")&&i.id.includes("mainMenu")&&typeof i!="string"&&(i.style.display="block",i.style.visibility="visible")}for(var t=0;t<nh.children.length;t++){var i=nh.children[t];i.id.includes("Flat")&&typeof i!="string"?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}let r={zoom:19.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};r.center=[ut.geolocatedCenterLongitude,ut.geolocatedCenterLatitude],Ri(r),B.getLayer("NL_NDM_LND")&&VJ(),bO(),ut&&t3(),Fu.click()}}function wGe(){Nt.style.display="none",Nt.style.visibility="hidden",fl.style.display="none",fl.style.visibility="hidden",Rl.style.display="none",Rl.style.visibility="hidden",_h.style.display="block",_h.style.visibility="visible",sl.style.display="none",sl.style.visibility="hidden",vh.style.display="none",vh.style.visibility="hidden",Ni.style.display="none",Ni.style.visibility="hidden",Zi.style.display="block",Zi.style.visibility="visible",Bi.style.opacity="50%",Sr.style.opacity="50%",Wi.style.opacity="50%",yr.style.opacity="100%",xl.classList.remove("closed"),xl.style.transform="translate(0,0)",yi.classList.remove("closed"),yi.scrollTo(0,0),B.getLayer("NL_NDM_LND")||B.addLayer(zA,"waterway-label"),B.setLayoutProperty("NL_NDM_LND","visibility","visible"),B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("3d-model-CCH")&&B.setLayoutProperty("3d-model-CCH","visibility","none"),B.getLayer("3d-model-Sluisbuurt")&&B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),cn="market";for(var t=0;t<yi.children.length;t++){var i=yi.children[t];i.id.includes("Market")&&i.id.includes("mainMenu")&&typeof i!="string"&&(i.style.display="block",i.style.visibility="visible")}for(var t=0;t<nh.children.length;t++){var i=nh.children[t];i.id.includes("Flat")&&typeof i!="string"?(i.style.display="block",i.style.visibility="visible"):(i.style.display="none",i.style.visibility="hidden")}let r={zoom:19.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};r.center=[ut.geolocatedCenterLongitude,ut.geolocatedCenterLatitude],Ri(r),Fu.click()}Bl.addEventListener("click",bGe,!0);function bGe(){if(ji(),ui&&(ui.innerHTML="",ui.remove()),Sp.style.backgroundColor="#f9d235",S0.style.backgroundColor="#d0d0d0",Br){Kn.remove(),va.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible"),document.getElementById("dropPinButton").style.backgroundColor="#8f8f8f";let t=[];t.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),M0(t)}if(B.getLayer("resultsPin")&&B.removeLayer("resultsPin"),B.getSource("resultsPin")){B.removeSource("resultsPin");let t=[];t.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),M0(t)}if(document.getElementById("resultsPinButton").style.backgroundColor="#8f8f8f",Bl.active=="active"){Jr.innerHTML="⢠Generative AI Toolset â¢",_c.click(),Ro.remove(),hi!=null&&(hi.remove(),hi=null),cn=="inform"&&(vn.style.display="none",vn.style.visibility="hidden"),Dt&&(Dt.style.display="none",Dt.style.visibility="hidden",a
12066h.style.display="none",ah.style.visibility="hidden"),fl.style.display="none",fl.style.visibility="hidden",Rl.style.display="none",Rl.style.visibility="hidden",_h.style.display="block",_h.style.visibility="visible",vh.style.display="none",vh.style.visibility="hidden",GA.style.display="block",GA.style.visibility="visible",Aa.style.display="none",Aa.style.visibility="hidden";try{$e&&$e.properties.title=="Thrissur Urban Study"&&Zo&&(Zo.style.display="none",Gc.style.display="none")}catch{}Bi.style.opacity="50%",Bl.style.opacity="100%",Sr.style.opacity="50%",Wi.style.opacity="50%",yr.style.opacity="50%",xl.classList.remove("closed"),xl.style.transform="translate(0,0)",yi.classList.remove("closed"),yi.scrollTo(0,0),ji(),QM()}}function VJ(){for(var t=[],i=0;i<ut.children.length;i++){var r={};r.id=ut.children[i].userData.attributes.flatID,r.image=ut.children[i].userData.attributes.flatPlan+"/"+r.id+".jpg",r.price=ut.children[i].userData.attributes.flatPrice,r.area=ut.children[i].userData.attributes.flatArea,r.bedrooms=ut.children[i].userData.attributes.flatBedroomNo,r.status=ut.children[i].userData.attributes.flatAvailabilityStatus,r.orientation=ut.children[i].userData.attributes.flatOrientation,r.cameraSide=ut.children[i].userData.attributes.flatCameraSide,r.balcony=ut.children[i].userData.attributes.flatBalcony,r.externalArea=ut.children[i].userData.attributes.flatExternalArea,r.spaces=ut.children[i].userData.attributes.flatSpacesNo,r.level=ut.children[i].userData.attributes.flatLevel,r.plan=ut.children[i].userData.attributes.flatPlan,r.locationMasterplan=ut.children[i].userData.attributes.locationMasterplan,r.locationBuildign=ut.children[i].userData.attributes.locationBuilding,r.pdf=ut.children[i].userData.attributes.flatPdf,r.gallery=ut.children[i].userData.attributes.flatGallery,r.brokerWebsite=ut.children[i].userData.attributes.flatBrokerWebsite,r.brokerEmail=ut.children[i].userData.attributes.flatBrokerEmail,t.push(r)}SJ=t}function QM(){B.getLayer("NL_NDM_LND")&&B.setLayoutProperty("NL_NDM_LND","visibility","none");for(var t=0;t<yi.children.length;t++){var i=yi.children[t];i.id.includes("Market")&&i.id.includes("mainMenu")&&typeof i!="string"&&(i.style.display="none",i.style.visibility="hidden")}for(var t=0;t<nh.children.length;t++){var i=nh.children[t];i.id.includes("Flat")&&typeof i!="string"&&(i.style.display="none",i.style.visibility="hidden")}cn="inform"}function SGe(){var t=B.getCanvas();document.getElementById("imagineMessage").innerHTML="",B.triggerRepaint();var i=t.toDataURL("image/png"),r=new gE;r.append("image",i),fetch("https://publictwin.info/digital_maquette/urbanistAImaquette/imageUpload.php",{method:"POST",body:r}).then(n=>n.json()).then(n=>{if(n.success){console.log("Image saved successfully:",n.filePath),B_="https://publictwin.info/digital_maquette/urbanistAImaquette/"+n.filePath,console.log(B_),kn.innerHTML="",br.style.display="block",br.style.visibility="visible";const a=document.createElement("div"),s=document.createElement("button"),o=document.createElement("button");s.innerHTML="<span>existing.</span>",o.innerHTML="<span>imagined with UrbanistAI!</span>";const l=document.createElement("div");s.className="clickableButton beforeAndAfterButton beforeButton",o.className="clickableButton beforeAndAfterButton afterButton";const c=document.createElement("img");a.className="mediaGalleryBeforeAndAfter",c.src=B_,c.className="mediaImageBeforeAndAfter flexGrow",a.appendChild(c),l.appendChild(s),l.appendChild(o),a.appendChild(l),l.className="buttonsDivBeforeAndAfter flexGrow",s.style.backgroundColor="#f9d235",s.addEventListener("click",function(){c.src=B_,s.style.backgroundColor="#f9d235",o.style.backgroundColor="#d0d0d0"},!0),o.addEventListener("click",function(){MA?(c.src=wJ,s.style.backgroundColor="#d0d0d0",o.style.backgroundColor="#f9d235"):document.getElementById("imagineMessage").innerHTML="AI generation not ready"},!0),kn.appendChild(a)}else console.log("Failed to save image:",n.error)}).catch(n=>{console.error("Error during image upload:",n)})}const CGe=async()=>{console.log("calling UrbanistAI API");
12066const t="https://app.urbanistai.com/api/pt/volume/generate",i="https://app.urbanistai.com/api/pt/volume/outputs_status/",r=document.getElementById("promptInput").value,n={img_url:B_,prompt:r};try{const a=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!a.ok)throw new Error(`POST Request Failed with status: ${a.status}`);const s=await a.json();console.log("POST Response:",s);const o=s.out_id;if(!o)throw new Error("Output ID not found in POST response");const l=`${i}${o}`;MA=!1;let c;for(;!MA;){const h=await fetch(l,{method:"GET",headers:{Accept:"application/json"}});if(!h.ok)throw new Error(`GET Request Failed with status: ${h.status}`);c=await h.json(),console.log("GET Response:",c),c&&c.complete=="true"?(console.log("Calculation is finished"),MA=!0,document.getElementById("imagineMessage").innerHTML="generation complete",wJ=c.res_urls[0],document.getElementsByClassName("afterButton")[0].click()):(console.log("Calculation not complete, retrying in 3 seconds..."),await new Promise(u=>setTimeout(u,3e3)),document.getElementById("imagineMessage").innerHTML="please wait, AI engine is generating your image...")}return{postData:s,getData:c}}catch(a){console.error("Error in generateAndCheckStatus:",a)}},TGe=async()=>{console.log("calling UrbanistAI API");
12066const t="https://app.urbanistai.com/api/pt/inpaint/generate/",i="https://app.urbanistai.com/api/pt/inpaint/outputs_status/",r=document.getElementsByClassName("PromptInput")[0].value;let n={view:Xr.properties.AIPointNumber,prompt:r,model:"urbanistai_a",detail:"true"},a=Xr.properties.AIPointNumber.toString(16);n.view=a;try{const o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!o.ok)throw new Error(`POST Request Failed with status: ${o.status}`);const l=await o.json();console.log("POST Response:",l);const c=l.out_id;if(!c)throw new Error("Output ID not found in POST response");const h=`${i}${c}`;MA=!1;let u;for(;!MA;){const d=await fetch(h,{method:"GET",headers:{Accept:"application/json"}});if(!d.ok)throw new Error(`GET Request Failed with status: ${d.status}`);if(u=await d.json(),console.log("GET Response:",u),u&&u.complete=="true"){console.log("Calculation is finished"),MA=!0;for(var s=0;s<document.getElementsByClassName("OptionCover").length;s++)document.getElementsByClassName("OptionCover")[s].classList.add("CoverHidden");document.getElementsByClassName("OptionDiv")[0].children[0].src=u.res_urls[0],document.getElementsByClassName("OptionDiv")[1].children[0].src=u.res_urls[1],document.getElementsByClassName("Option02")[0].children[0].classList.add("blinking4"),document.getElementsByClassName("Option01")[0].children[0].classList.add("blinking4"),Ep=!0,document.getElementsByClassName("OptionDiv")[0].click()}else console.log("Calculation not complete, retrying in 3 seconds..."),await new Promise(A=>setTimeout(A,3e3)),document.getElementsByClassName("PromptMessage")[0].innerHTML="please wait up to <span> 1min </span>, AI engine is generating your image..."}return{postData:l,getData:u}}catch(o){console.error("Error in generateAndCheckStatus:",o)}};document.getElementById("AIImagineButton").addEventListener("click",function(){jg=="KOM"||jg=="admin"?(document.getElementById("imagineMessage").innerHTML="please wait, AI engine is generating your image...",console.log(jg),MA=!1,CGe()):(console.log("you dont have the permission!"),document.getElementById("imagineMessage").innerHTML="you dont have the permission to generate immages! please log in.")});document.getElementById("AIbaseImageCaptureButton").addEventListener("click",SGe);xs.addEventListener("click",()=>{xs.active=="active"&&Wi.click()},!0);Mo.addEventListener("click",()=>{xs.active=="active"&&yr.click()},!0);Zs.addEventListener("click",()=>{if(Zs.active=="active"){OT.style.visibility="visible",OT.style.display="block",document.getElementById("digitalTwinLoading").src=ur.digitalTwinLoading,document.getElementById("video-cover").style.display="block",document.getElementById("video-cover").style.visibility="visible",document.getElementById("video-container").style.zIndex=10,document.getElementById("video-cover").style.zIndex=11;try{document.getElementById("stopBtn").click()}catch{}}},!0);ZE.state=!1;ZE.buttontype="neighbourhood";ZE.buttonname="Van Leeuwenhoekkwartier";JE.state=!1;JE.buttontype="neighbourhood";JE.buttonname="Coendersbuurt";$E.state=!1;$E.buttontype="neighbourhood";$E.buttonname="Abtswoudse Hof";e1.state=!1;e1.buttontype="stage";e1.buttonname="concept";t1.state=!1;t1.buttontype="stage";t1.buttonname="construction";i1.state=!1;i1.buttontype="stage";i1.buttonname="completed";ov.state=!1;ov.buttontype="action";ov.buttonname="participation";lv.state=!1;lv.buttontype="action";lv.buttonname="reports";cv.state=!1;cv.buttontype="action";cv.buttonname="sales";let ca=[];ca.push(ZE,JE,$E,e1,t1,i1,ov,lv,cv);ZE.addEventListener("click",rd,!0);JE.addEventListener("click",rd,!0);$E.addEventListener("click",rd,!0);e1.addEventListener("click",rd,!0);t1.addEventListener("click",rd,!0);i1.addEventListener("click",rd,!0);ov.addEventListener("click",rd,!0);lv.addEventListener("click",rd,!0);cv.addEventListener("click",rd,!0);O5e.addEventListener("click",bO,!0);U5e.addEventListener("click",KGe,!0);N5e.addEventListener("click",JGe,!0);F5e.addEventListener("click",$J,!0);lc.addEventListener("click",e$,!0);cc.addEventListener("click",function(){D_("https://eoxsnlhinp7.typeform.com/to/TOq4KF8Y")},!0);toggleTypeform10min.addEventListener("click",e$,!0);function WJ(){if(window.self!==window.top){bW.style.display="none",bW.style.visibility="hidden",T0.style.display="none",T0.style.visibility="hidden",_g.style.display="block",_g.style.visibility="visible",document.getElementById("navbarTopWhiteLabel").style.display="flex",document.getElementById("navbarTopWhiteLabel").style.visibility="visible";for(var t=0;t<li.features.length;t++)li.features[t].properties.title=="Nieuw Delft Masterplan"||li.features[t].properties.title=="Circular City House"||(li.features[t].properties.status="in development",li.features[t].properties.activeStatus="maquetteInDevelopment",li.features[t].properties.icon="logo2")}else document.getElementById("navbarTopWhiteLabel").style.display="none",document.getElementById("navbarTopWhiteLabel").style.visibility="hidden",_g.style.display="none",_g.style.visibility="hidden"}FJ.addEventListener("click",function(){var t={zoom:15.1,center:[],pitch:-90,bearing:0};$e.geometry&&(t.center=$e.geometry.coordinates,t.zoom=$e.properties.cameraReset.zoom,Ri(t)),Ri(t),B.setLayoutProperty("3d-model","visibility","visible")},!0);var gn=0,dy=0,oE=BT;const Ru=document.getElementById("showcaseReset");Ru.classList.add("blinking");gn=1;const jJ=document.getElementById("showcaseControlLeft"),YJ=document.getElementById("showcaseControlRight");jJ.classList.add("blinking");YJ.classList.add("blinking");document.getElementById("showcaseInformationText");const KJ=document.getElementById("currentShowcaseStepSpan"),MGe=document.getElementById("maxShowcaseStepSpan");KJ.innerHTML=gn;jJ.addEventListener("click",function(){a3("left",oE)},!0);YJ.addEventListener("click",function(){a3("right",oE)},!0);Ru.addEventListener("click",function(){xGe()},!0);wO(BT);function a3(t,i){Bi.click(),t=="left"&&(gn-=1,gn<1&&(gn=dy)),t=="right"&&(gn+=1,gn>dy&&(gn=1)),gn>1?(Ru.innerHTML="restart showcase!",Ru.classList.remove("blinking")):(Ru.innerHTML="let's start!",Ru.classList.add("blinking")),i.features[gn-1].properties.participation==!0&&gn==dy?Ks==null&&(Ks=document.createElement("button"),Ks.innerHTML="<span>start participation!</span>
12066",Ks.className="mainMenuSegment titleSegment loginSystemButton clickableButton",Ks.addEventListener("click",()=>{Wi.click(),yi.removeChild(Ks),Ks=null},!0),yi.appendChild(Ks)):Ks!=null&&(yi.removeChild(Ks),Ks=null),KJ.innerHTML=gn;let r={zoom:0,pitch:0,bearing:0,center:[0,0]};r.zoom=i.features[gn-1].properties.zoom,r.bearing=i.features[gn-1].properties.bearing,r.pitch=i.features[gn-1].properties.pitch,r.center=i.features[gn-1].geometry.coordinates,Jr.innerHTML=`⢠${i.features[gn-1].properties.title} â¢`,Ao.innerHTML=`${i.features[gn-1].properties.descriptionLong}`,Hs.src=i.features[gn-1].properties.image,document.getElementById("mainMenuMasterplan_Image").parentElement.addEventListener("click",function(){const n=document.createElement("div");n.className="EnlargeGalleryImageWrapper";const a=document.createElement("div");a.className="EnlargeGalleryImageDiv",n.appendChild(a);const s=document.createElement("button");s.className="closeEnlargeGallery closeButton filterButton filterResetButton",n.appendChild(s),a.className="EnlargeGalleryImageDiv";const o=document.createElement("img");o.src="https://publictwin.info/digital_maquette/content/00_Icons/Close_Button.svg",o.className="mainMenuIcon arrowIcon",s.appendChild(o);const l=document.createElement("img");l.className="EnlargeGalleryImage",l.src=Hs.src;const c=document.createElement("div");c.className="ImageSizedDiv",a.appendChild(c),c.appendChild(l),s.addEventListener("click",function(){n.remove(),document.getElementById("mediaGalleryWrapperImage").style.display="none"}),document.getElementById("madiaGalleryImage").appendChild(n),document.getElementById("mediaGalleryWrapperImage").style.display="block",document.getElementById("mediaGalleryWrapperImage").style.visibility="visible"}),Ri(r),setTimeout(ji(r.zoom),1e3)}function wO(t){dy=t.features.length,MGe.innerHTML=dy}function xGe(){Ru.innerHTML=="let's start!"?(gn=2,console.log("step set to 2")):(gn=1,console.log("step set to 1")),a3("none",oE)}function ji(t){let i=null;t?(i=t,console.log("target zoom",i)):i=B.getZoom(),i<15?(B.getLayer("3d-model")&&B.setLayoutProperty("3d-model","visibility","none"),B.getLayer("3d-model-CCH")&&B.setLayoutProperty("3d-model-CCH","visibility","none"),B.getLayer("3d-model-Sluisbuurt")&&B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","visible")):(B.getLayer("3d-model")&&Yt=="Nieuw Delft Masterplan"&&B.setLayoutProperty("3d-model","visibility","visible"),B.getLayer("3d-model-CCH")&&Yt=="Circular City House"&&B.setLayoutProperty("3d-model-CCH","visibility","visible"),B.getLayer("3d-model-Sluisbuurt")&&Yt=="Sluisbuurt Masterplan"&&B.setLayoutProperty("3d-model-Sluisbuurt","visibility","visible"),B.setLayoutProperty("PTProjects","visibility","none"));try{if($e.properties.title=="Dijk Park Masterplan"){const a=B.getStyle().layers;if(i>=12&&i<13.5)for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible");else if(i>=13.5&&i<15.5)for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible");else if(i>=15.5)for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","none");else for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","none");i>=12&&i<13.5?(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","none"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","none"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","none"),B.getLayer("3d-model-DijkPark-Masterplan")&&B.setLayoutProperty("3d-model-DijkPark-Masterplan","visibility","visible"),B.getLayer("3d-model-DijkPark-Schemes")&&B.setLayoutProperty("3d-model-DijkPark-Schemes","visibility","none"),B.getLayer("3d-model-DijkPark-Detailed")&&B.setLayoutProperty("3d-model-DijkPark-Detailed","visibility","none"),B.getLayer("3d-model-DijkPark-Assets")&&B.setLayoutProperty("3d-model-DijkPark-Assets","visibility","none")):i>=13.5&&i<15.5?(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","none"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","none"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","none"),B.getLayer("3d-model-DijkPark-Masterplan")&&B.setLayoutProperty("3d-model-DijkPark-Masterplan","visibility","none"),B.getLayer("3d-model-DijkPark-Schemes")&&B.setLayoutProperty("3d-model-DijkPark-Schemes","visibility","visible"),B.getLayer("3d-model-DijkPark-Detailed")&&B.setLayoutProperty("3d-model-DijkPark-Detailed","visibility","none"),B.getLayer("3d-model-DijkPark-Assets")&&B.setLayoutProperty("3d-model-DijkPark-Assets","visibility","none")):i>=15.5?(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","visible"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","visible"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","visible"),B.getLayer("3d-model-DijkPark-Masterplan")&&B.setLayoutProperty("3d-model-DijkPark-Masterplan","visibility","none"),B.getLayer("3d-model-DijkPark-Schemes")&&B.setLayoutProperty("3d-model-DijkPark-Schemes","visibility","none"),B.getLayer("3d-model-DijkPark-Detailed")&&B.setLayoutProperty("3d-model-DijkPark-Detailed","visibility","visible"),B.getLayer("3d-model-DijkPark-Assets")&&B.setLayoutProperty("3d-model-DijkPark-Assets","visibility","visible")):i<12&&(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","visible"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","none"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","none"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","none"),B.getLayer("3d-model-DijkPark-Masterplan")&&B.setLayoutProperty("3d-model-DijkPark-Masterplan","visibility","none"),B.getLayer("3d-model-DijkPark-Schemes")&&B.setLayoutProperty("3d-model-DijkPark-Schemes","visibility","none"),B.getLayer("3d-model-DijkPark-Detailed")&&B.setLayoutProperty("3d-model-DijkPark-Detailed","visibility","none"),B.getLayer("3d-model-DijkPark-Assets")&&B.setLayoutProperty("3d-model-DijkPark-Assets","visibility","none"))}}catch{}try{if($e.properties.title=="Malmo Masterplan"){const a=B.getStyle().layers;if(i>=12&&i<13.5)for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible"),a[r].id.includes("areaLabels")&&B.setLayoutProperty(a[r].id,"visibility","none"),a[r].id.includes("orientationLabels")&&B.setLayoutProperty(a[r].id,"visibility","none");else if(i>=13.5&&i<15.5)for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible"),a[r].id.includes("areaLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible"),a[r].id.includes("orientationLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible");else if(i>=15.5)for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","none"),a[r].id.includes("areaLabels")&&B.setLayoutProperty(a[r].id,"visibility","visible"),a[r].id.includes("orientationLabels")&&B.setLayoutProperty(a[r].id,"visibility","none");else for(var r=0;r<a.length;r++)a[r].id.includes("textLabels")&&B.setLayoutProperty(a[r].id,"visibility","none"),a[r].id.includes("areaLabels")&&B.setLayoutProperty(a[r].id,"visibility","none"),a[r].id.includes("orientationLabels")&&B.setLayoutProperty(a[r].id,"visibility","none");if(i<13.5){for(var r=0;r<document.getElementsByClassName("waterPoints").length;r++)document.getElementsByClassName("waterPoints")[r].classList.remove("CoverHidden");for(var r=0;r<document.getElementsByClassName("greenPoints").length;r++)document.getElementsByClassName("waterPoints")[r].classList.remove("CoverHidden")}else{for(var r=0;r<document.getElementsByClassName("waterPoints").length;r++)document.getElementsByClassName("waterPoints")[r].classList.add("CoverHidden");for(var r=0;r<document.getElementsByClassName("greenPoints").length;r++)document.getElementsByClassName("waterPoints")[r].classList.add("CoverHidden")}i>=10&&i<13.5?(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","none"),B.getLayer("AIPoints")&&B.setLayoutProperty("AIPoints","visibility","none"),B.getLayer("beltPoints")&&B.setLayoutProperty("beltPoints","visibility","visible"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","none"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","none"),B.getLayer("3d-model-Malmo-Masterplan")&&B.setLayoutProperty("3d-model-Malmo-Masterplan","visibility","visible"),B.getLayer("3d-model-Malmo-Schemes")&&B.setLayoutProperty("3d-model-Malmo-Schemes","visibility","none"),B.getLayer("3d-model-Malmo-Detailed")&&B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","none"),B.getLayer("3d-model-Malmo-Assets")&&B.setLayoutProperty("3d-model-Malmo-Assets","visibility","none")):i>=13.5&&i<15.5?(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","none"),B.getLayer("AIPoints")&&B.setLayoutProperty("AIPoints","visibility","visible"),B.getLayer("beltPoints")&&B.setLayoutProperty("beltPoints","visibility","none"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","none"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","none"),B.getLayer("3d-model-Malmo-Masterplan")&&B.setLayoutProperty("3d-model-Malmo-Masterplan","visibility","none"),B.getLayer("3d-model-Malmo-Schemes")&&B.setLayoutProperty("3d-model-Malmo-Schemes","visibility","visible"),B.getLayer("3d-model-Malmo-Detailed")&&B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","none"),B.getLayer("3d-model-Malmo-Assets")&&B.setLayoutProperty("3d-model-Malmo-Assets","visibility","none")):i>=15.5?(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","none"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","visible"),B.getLayer("AIPoints")&&B.setLayoutProperty("AIPoints","visibility","visible"),B.getLayer("beltPoints")&&B.setLayoutProperty("beltPoints","visibility","none"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","visible"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","visible"),B.getLayer("3d-model-Malmo-Masterplan")&&B.setLayoutProperty("3d-model-Malmo-Masterplan","visibility","none"),B.getLayer("3d-model-Malmo-Schemes")&&B.setLayoutProperty("3d-model-Malmo-Schemes","visibility","none"),B.getLayer("3d-model-Malmo-Detailed")&&B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","visible"),B.getLayer("3d-model-Malmo-Assets")&&B.setLayoutProperty("3d-model-Malmo-Assets","visibility","visible")):i<10&&(B.getLayer("PTProjects")&&B.setLayoutProperty("PTProjects","visibility","visible"),B.getLayer("beforeAndAfterPoints")&&B.setLayoutProperty("beforeAndAfterPoints","visibility","none"),B.getLayer("AIPoints")&&B.setLayoutProperty("AIPoints","visibility","none"),B.getLayer("beltPoints")&&B.setLayoutProperty("beltPoints","visibility","none"),B.getLayer("panoramaPoints")&&B.setLayoutProperty("panoramaPoints","visibility","none"),B.getLayer("informPoints")&&B.setLayoutProperty("informPoints","visibility","none"),B.getLayer("3d-model-Malmo-Masterplan")&&B.setLayoutProperty("3d-model-Malmo-Masterplan","visibility","none"),B.getLayer("3d-model-Malmo-Schemes")&&B.setLayoutProperty("3d-model-Malmo-Schemes","visibility","none"),B.getLayer("3d-model-Malmo-Detailed")&&B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","none"),B.getLayer("3d-model-Malmo-Assets")&&B.setLayoutProperty("3d-model-Malmo-Assets","visibility","none"))}}catch{}try{$e.properties.title=="Thrissur Urban Study"&&(i>=13.5?B.setLayoutProperty("PTProjects","visibility","none"):B.setLayoutProperty("PTProjects","visibility","visible"))}catch{}try{$e.properties.title=="Urban Future"&&window.innerWidth<=768&&B.setLayoutProperty("PTProjects","visibility","none")}catch{}}const wi=new Jt,X2={zoom:16,center:[4.35878,52.00236828785361],pitch:60,bearing:35};function RGe(){let t=window.location.href,i=new URL(t),r=new URLSearchParams(i.search),n=r.get("activeProject");
12066if(vO=r.get("selectedPOI"),n!==null){n=="Malmo Masterplan"&&(r1.active="inactive",Sr.enabled="disabled",Sr.style.backgroundColor="#616161",Sr.style.opacity="50%",IT.enabled="disabled"),n=="Urban Future"?(document.getElementById("closeMediaGalleryImage").style.display="none",document.getElementById("loginMenu").style.display="none"):(document.getElementById("UserMenuUrbanFuture").style.display="none",document.getElementById("UserMenuUrbanFuture").style.visibility="hidden"),gO=n;for(var a=0;a<li.features.length;a++)li.features[a].properties.title==n&&($e=li.features[a],fo($e.properties.title,$e.geometry.coordinates))}else document.getElementById("UserMenuUrbanFuture").style.display="none",document.getElementById("UserMenuUrbanFuture").style.visibility="hidden"}const s3=new MapboxGeocoder({accessToken:mapboxgl.accessToken,types:"country,region,place,postcode"});s3.addTo("#geocoder");const XJ=document.getElementsByClassName("mapboxgl-ctrl-geocoder")[0],qJ=document.getElementById("geocoderResult");s3.on("result",t=>{XJ.style.color="#f9d235";let i={zoom:10,pitch:0,bearing:0,center:[4.35878,52.00236828785361]};i.center=t.result.geometry.coordinates,Ri(i),qJ.innerText="Flying to selected location!"});s3.on("clear",()=>{XJ.style.color="#e4e3e3",qJ.innerText=""});const Wf=[4.35878,52.00115],BGe=[4.919993449849471,52.34309103446975],IGe=[4.956944002356522,52.373384647853584],DGe=[4.477489149214534,51.89772187785269],PGe=[12.99415,55.60795];function LGe(t){for(var i=0;i<li.features.length;i++)if(li.features[i].properties.title==t)var r=li.features[i].geometry.coordinates,n=0,a=mapboxgl.MercatorCoordinate.fromLngLat(r,n),s={translateX:a.x,translateY:a.y,translateZ:a.z,rotateX:Ta[0],rotateY:Ta[1],rotateZ:Ta[2],scale:a.meterInMercatorCoordinateUnits()};return s}const o3=0,OGe=0,NGe=0,Ta=[0,0,0];ss="global";Bi.click();hv.click();const uS=mapboxgl.MercatorCoordinate.fromLngLat(Wf,o3),dS=mapboxgl.MercatorCoordinate.fromLngLat(BGe,OGe),AS=mapboxgl.MercatorCoordinate.fromLngLat(IGe,NGe),fS=mapboxgl.MercatorCoordinate.fromLngLat(DGe,o3),pS=mapboxgl.MercatorCoordinate.fromLngLat(PGe,o3),da={translateX:uS.x,translateY:uS.y,translateZ:uS.z,rotateX:Ta[0],rotateY:Ta[1],rotateZ:Ta[2],scale:uS.meterInMercatorCoordinateUnits()},Xh={translateX:dS.x,translateY:dS.y,translateZ:dS.z,rotateX:Ta[0],rotateY:Ta[1],rotateZ:Ta[2],scale:dS.meterInMercatorCoordinateUnits()},qh={translateX:AS.x,translateY:AS.y,translateZ:AS.z,rotateX:Ta[0],rotateY:Ta[1],rotateZ:Ta[2],scale:AS.meterInMercatorCoordinateUnits()},Ui={translateX:fS.x,translateY:fS.y,translateZ:fS.z,rotateX:Ta[0],rotateY:Ta[1],rotateZ:Ta[2],scale:fS.meterInMercatorCoordinateUnits()},Mr={translateX:pS.x,translateY:pS.y,translateZ:pS.z,rotateX:Ta[0],rotateY:Ta[1],rotateZ:Ta[2],scale:pS.meterInMercatorCoordinateUnits()},a1={id:"3d-model",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,r.shadow.mapSize.width=1024,r.shadow.mapSize.height=1024,r.shadow.camera.near=.5,r.shadow.camera.far=5e3,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),n.intensity=1.4,n.castShadow=!1,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Masterplan/240520_Nieuw_Delft.3dm",s=>{gt=s,gt.children.length;for(var o=0;o<gt.children.length;o++)if(gt.children[o].defaultmaterial=gt.children[o].material,gt.children[o].selected=!1,gt.children[o].hover=!1,gt.children[o].filtered=!1,gt.children[o].default=!0,gt.children[o].onHoverMaterial=qa,gt.children[o].onSelectMaterial=dl,gt.children[o].onFilteredMaterial=NA,gt.children[o].name.includes("Building")){gt.children[o].material=i3;for(var l=gt.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="Neighbourhood"&&(gt.children[o].neighbourhood=l[c][1]),l[c][0]=="Stage"&&(gt.children[o].stage=l[c][1]),l[c][0]=="ParticipationStatus"&&(gt.children[o].userData.attributes.participationstatus=l[c][1]),l[c][0]=="SalesStatus"&&(gt.children[o].userData.attributes.salesstatus=l[c][1]),l[c][0]=="ReportAvailable"&&(gt.children[o].userData.attributes.reportstatus=l[c][1]),l[c][0]=="SalesModuleActive"&&(gt.children[o].userData.attributes.SalesModuleActive=l[c][1]),l[c][0]=="ParticipationModuleActive"&&(gt.children[o].userData.attributes.ParticipationModuleActive=l[c][1])}this.scene.add(gt),gt.traverse(Y=>{if(Y.isMesh&&(Y.name.includes("Building")||Y.name.includes("Participate"))){var D=new xp(Y.geometry),U=new Xu({color:7171437,linewidth:.1}),j=new Mp(D,U);this.scene.add(j)}}),gt.traverse(Y=>{if(Y.isMesh&&(Y.name.includes("Building")||Y.name.includes("Participate"))){const D=new Kr(Y.geometry,Fp);D.position.copy(Y.position),D.rotation.copy(Y.rotation),D.scale.copy(Y.scale);const U=1;D.scale.multiplyScalar(U),this.scene.add(D)}}),gt.traverse(Y=>{if(Y.isMesh&&Y.name.includes("Crown")){Y.material=Tl;const D=new Kr(Y.geometry,iv);D.position.copy(Y.position),D.rotation.copy(Y.rotation),D.scale.copy(Y.scale);const U=1;D.scale.multiplyScalar(U),this.scene.add(D)}}),gt.traverse(Y=>{Y.isMesh&&Y.name.includes("people")&&(Y.material=tv)}),gt.traverse(Y=>{Y.isMesh&&(Y.name.includes("bush")||Y.name.includes("grass"))&&(Y.material=Tl)});for(var o=0;o<gt.children.length;o++)gt.children[o].defaultmaterial=gt.children[o].material;if(Vt.style.visibility="hidden",Vt.style.display="none",gt.castShadow=!0,gt.receiveShadow=!0,vO){for(var o=0;o<this.scene.children[3].children.length;o++)if(this.scene.children[3].children[o].name==vO)var h=this.scene.children[3].children[o];if(h){Bi.active="active",Bi.style.backgroundColor="#f9d235",Bi.style.opacity="100%";for(var u=h.userData.attributes.userStrings,d,A,f,m,g,p,v,_,y,w,b,E,M,S,T,C,x,R,L,I,o=0;o<u.length;o++)u[o][0]=="Name"&&(d=u[o][1]),u[o][0]=="Neighbourhood"&&(f=u[o][1]),u[o][0]=="Stage"&&(A=u[o][1]),u[o][0]=="CoverImageLink"&&(m=u[o][1]),u[o][0]=="Designer"&&(g=u[o][1]),u[o][0]=="Developer"&&(p=u[o][1]),u[o][0]=="Constructor"&&(v=u[o][1]),u[o][0]=="ParticipationStatus"&&(_=u[o][1]),u[o][0]=="SalesStatus"&&(y=u[o][1]),u[o][0]=="Website"&&(w=u[o][1]),u[o][0]=="Email"&&u[o][1],u[o][0]=="Phone"&&u[o][1],u[o][0]=="TypeForm2min"&&(C=u[o][1]),u[o][0]=="TypeForm5min"&&(x=u[o][1]),u[o][0]=="TypeForm10min"&&(R=u[o][1]),u[o][0]=="CamSide"&&(b=u[o][1]),u[o][0]=="SalesModuleActive"&&(I=u[o][1]),u[o][0]=="ParticipationModuleActive"&&(L=u[o][1]),u[o][0]=="DigitalTwinStatus"&&(E=u[o][1]),u[o][0]=="DigitalTwinID"&&(S=u[o][1]),u[o][0]=="ExtraModules"&&(M=u[o][1]),u[o][0]=="DigitalTwinLoading"&&(T=u[o][1]);if(Jr.innerHTML=d,iE.innerHTML=A,rE.innerHTML=f,wp.src=m,nE.innerHTML=g,aE.innerHTML=p,sE.innerHTML=v,bp.innerHTML=_,yO.innerHTML=_,b0.innerHTML=y,EO.innerHTML=E,_=="open"?(xs.style.backgroundColor="#f9d235",xs.active="active"):(xs.style.backgroundColor="#616161",xs.active="inactive"),y=="open"?(Mo.style.backgroundColor="#f9d235",Mo.active="active"):(Mo.style.backgroundColor="#616161",Mo.active="inactive"),E=="open"?(Zs.style.backgroundColor="#f9d235",Zs.active="active"):(Zs.style.backgroundColor="#616161",Zs.active="inactive"),C!="-"?lc.style.backgroundColor="#f9d235":lc.style.backgroundColor="#bdbdbd",x!="-"?cc.style.backgroundColor="#f9d235":cc.style.backgroundColor="#bdbdbd",R!="-"?toggleTypeform10min.style.backgroundColor="#f9d235":toggleTypeform10min.style.backgroundColor="#bdbdbd",I=="active"?(yr.style.backgroundColor="#f9d235",yr.active="active"):(yr.style.backgroundColor="#616161",yr.active="inactive"),L=="active"?(Wi.style.backgroundColor="#f9d235",Wi.active="active"):(Wi.style.backgroundColor="#616161",Wi.active="inactive"),w!="-"?(or.target="_blank",or.href=w,or.style.backgroundColor="#f9d235"):(or.target="_self",or.href="javascript:void(0);",or.style.backgroundColor="#bdbdbd"),h.selected=!0,Sa=h.name,ur=h,ur.extraModules=M,ur.digitalTwinID=S,ur.digitalTwinLoading=T,h.name.includes("Building")){var F=h.geometry;F.boundingSphere||F.computeBoundingSphere();let Y=YGe(F.boundingSphere.center),D={zoom:17.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};D.center=Y,b=="E"?D.bearing=240:b=="W"?D.bearing=70:b=="S"?D.bearing=-10:b=="N"&&(D.bearing=200),Ri(D),h.material=dl,h.orientation=b,yi.style.visibility="visible"}for(var o=0;o<gt.children.length;o++)gt.children[o].name!=Sa&&(gt.children[o].material=gt.children[o].defaultmaterial,gt.children[o].hover=!1,gt.children[o].selected=!1);if(Ki.children.length<4)As(d);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(d)}Bi.click(),yr.click()}}Qf=!0},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block",Qf=!1},s=>{}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),da.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),da.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),da.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(da.translateX,da.translateY,da.translateZ).scale(new we(d
12066a.scale,-da.scale,da.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();if(this.raycaster.set(n,s),gt)var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&Qf&&o.length&&Ti>15&&Yt=="Nieuw Delft Masterplan"&&cn=="inform"){Yu(),Bi.active="active",Bi.style.backgroundColor="#f9d235",Bi.style.opacity="100%",YM(o[0].object.name);for(var l=o[0].object.userData.attributes.userStrings,c,h,u,d,A,f,m,g,p,v,_,y,w,b,E,M,S,T,C,x,R=0;R<l.length;R++)l[R][0]=="Name"&&(c=l[R][1]),l[R][0]=="Neighbourhood"&&(u=l[R][1]),l[R][0]=="Stage"&&(h=l[R][1]),l[R][0]=="CoverImageLink"&&(d=l[R][1]),l[R][0]=="Designer"&&(A=l[R][1]),l[R][0]=="Developer"&&(f=l[R][1]),l[R][0]=="Constructor"&&(m=l[R][1]),l[R][0]=="ParticipationStatus"&&(g=l[R][1]),l[R][0]=="SalesStatus"&&(p=l[R][1]),l[R][0]=="Website"&&(v=l[R][1]),l[R][0]=="Email"&&l[R][1],l[R][0]=="Phone"&&l[R][1],l[R][0]=="TypeForm2min"&&(M=l[R][1]),l[R][0]=="TypeForm5min"&&(S=l[R][1]),l[R][0]=="TypeForm10min"&&(T=l[R][1]),l[R][0]=="CamSide"&&(_=l[R][1]),l[R][0]=="SalesModuleActive"&&(x=l[R][1]),l[R][0]=="ParticipationModuleActive"&&(C=l[R][1]),l[R][0]=="DigitalTwinStatus"&&(y=l[R][1]),l[R][0]=="DigitalTwinID"&&(b=l[R][1]),l[R][0]=="ExtraModules"&&(w=l[R][1]),l[R][0]=="DigitalTwinLoading"&&(E=l[R][1]);if(Jr.innerHTML=c,iE.innerHTML=h,rE.innerHTML=u,wp.src=d,nE.innerHTML=A,aE.innerHTML=f,sE.innerHTML=m,bp.innerHTML=g,yO.innerHTML=g,b0.innerHTML=p,EO.innerHTML=y,g=="open"?(xs.style.backgroundColor="#f9d235",xs.active="active"):(xs.style.backgroundColor="#616161",xs.active="inactive"),p=="open"?(Mo.style.backgroundColor="#f9d235",Mo.active="active"):(Mo.style.backgroundColor="#616161",Mo.active="inactive"),y=="open"?(Zs.style.backgroundColor="#f9d235",Zs.active="active"):(Zs.style.backgroundColor="#616161",Zs.active="inactive"),M!="-"?lc.style.backgroundColor="#f9d235":lc.style.backgroundColor="#bdbdbd",S!="-"?cc.style.backgroundColor="#f9d235":cc.style.backgroundColor="#bdbdbd",T!="-"?toggleTypeform10min.style.backgroundColor="#f9d235":toggleTypeform10min.style.backgroundColor="#bdbdbd",x=="active"?(yr.style.backgroundColor="#f9d235",yr.active="active"):(yr.style.backgroundColor="#616161",yr.active="inactive"),C=="active"?(Wi.style.backgroundColor="#f9d235",Wi.active="active"):(Wi.style.backgroundColor="#616161",Wi.active="inactive"),v!="-"?(or.target="_blank",or.href=v,or.style.backgroundColor="#f9d235"):(or.target="_self",or.href="javascript:void(0);",or.style.backgroundColor="#bdbdbd"),parent.postMessage(o[0].object.name,"*"),o[0].object.selected=!0,Sa=o[0].object.name,ur=o[0],ur.extraModules=w,ur.digitalTwinID=b,ur.digitalTwinLoading=E,o[0].object.name.includes("Building")){Nt.style.display="block",Nt.style.visibility="visible";try{Yu()}catch{}let z={zoom:17.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};z.center=[Ra.lng,Ra.lat],_=="E"?z.bearing=240:_=="W"?z.bearing=70:_=="S"?z.bearing=-10:_=="N"&&(z.bearing=200),Ri(z),o[0].object.material=dl,o[0].object.orientation=_,yi.style.visibility="visible"}for(var R=0;R<gt.children.length;R++)gt.children[R].name!=Sa&&(gt.children[R].material=gt.children[R].defaultmaterial,gt.children[R].hover=!1,gt.children[R].selected=!1);if(Ki.children.length<4)As(c);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(c)}Bi.click()}if(o&&Qf)if(o[0]!=null){Ti>15&&Yt=="Nieuw Delft Masterplan"&&cn=="inform"&&Ut&&o[0].object.name.includes("Building")?(Nt.style.display="block",Nt.style.visibility="visible",KM(o[0].object.name)):Nt.style.visibility="hidden";var L=o[0].object.userData.attributes.userStrings,I,F,Y,D,U,j;if(L)for(var R=0;R<L.length;R++)L[R][0]=="Name"&&(I=L[R][1]),L[R][0]=="Neighbourhood"&&(Y=L[R][1]),L[R][0]=="Stage"&&(F=L[R][1]),L[R][0]=="CoverImageLink"&&(D=L[R][1]),L[R][0]=="SalesStatus"&&(j=L[R][1]),L[R][0]=="ParticipationStatus"&&(U=L[R][1]);rv.innerHTML=I,av.innerHTML=F,nv.innerHTML=Y,sv.src=D,j=="open"?kA.style.backgroundColor="#f9d235":kA.style.backgroundColor="#e4e3e3",U=="open"?FA.style.backgroundColor="#f9d235":FA.style.backgroundColor="#e4e3e3";var J=Nt.getBoundingClientRect();J.height,J.width/2,Nt.style.left=t.x+10+"px",Nt.style.top=t.y+10+"px",un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("Building")&&cn=="inform"&&(o[0].object.material=qa,o[0].object.hover=!0);for(var R=0;R<gt.children.length;R++)gt.children[R].name!=un&>.children[R].selected==!1&&cn=="inform"&&(gt.children[R].material=gt.children[R].defaultmaterial,gt.children[R].hover=!1)}else Nt.style.visibility="hidden";for(var R=0;R<gt.children.length;R++)gt.children[R].name&>.children[R].name.includes("Building")&&cn=="inform"&&(gt.children[R].selected==!0?gt.children[R].material=dl:gt.children[R].hover==!0?gt.children[R].material=qa:gt.children[R].filtered==!0?gt.children[R].material=NA:gt.children[R].material=gt.children[R].defaultmaterial)}},s1={id:"3d-model-CCH",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Circular_City_House/PublicTwin_CCH_simplified.3dm",s=>{Xt=s,Xt.children.length;for(var o=0;o<Xt.children.length;o++)if(Xt.children[o].defaultmaterial=Xt.children[o].material,Xt.children[o].selected=!1,Xt.children[o].hover=!1,Xt.children[o].filtered=!1,Xt.children[o].default=!0,Xt.children[o].onHoverMaterial=qa,Xt.children[o].onSelectMaterial=dl,Xt.children[o].onFilteredMaterial=NA,Xt.children[o].name.includes("Building")){Xt.children[o].material=i3;for(var l=Xt.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="Neighbourhood"&&(Xt.children[o].neighbourhood=l[c][1]),l[c][0]=="Stage"&&(Xt.children[o].stage=l[c][1]),l[c][0]=="ParticipationStatus"&&(Xt.children[o].userData.attributes.participationstatus=l[c][1]),l[c][0]=="SalesStatus"&&(Xt.children[o].userData.attributes.salesstatus=l[c][1]),l[c][0]=="ReportAvailable"&&(Xt.children[o].userData.attributes.reportstatus=l[c][1])}this.scene.add(Xt),Xt.traverse(h=>{if(h.isMesh&&(h.name.includes("Building")||h.name.includes("Participate"))){var u=new xp(h.geometry),d=new Xu({color:7171437,linewidth:.1}),A=new Mp(u,d);this.scene.add(A)}}),Xt.traverse(h=>{if(h.isMesh&&(h.name.includes("Building")||h.name.includes("Participate"))){const u=new Kr(h.geometry,Fp);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}}),Xt.traverse(h=>{if(h.isMesh&&h.name.includes("Crown")){h.material=Tl;const u=new Kr(h.geometry,iv);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}}),Xt.traverse(h=>{h.isMesh&&h.name.includes("people")&&(h.material=tv)}),Xt.traverse(h=>{h.isMesh&&(h.name.includes("bush")||h.name.includes("grass"))&&(h.material=Tl)});for(var o=0;o<Xt.children.length;o++)Xt.children[o].defaultmaterial=Xt.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none"},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Xh.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Xh.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Xh.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Xh.translateX,Xh.translateY,Xh.translateZ).scale(new we(Xh.scale,-Xh.scale,Xh.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&o.length&&Ti>15&&Yt=="Circular City House"){Bi.active="active",Bi.style.backgroundColor="#f9d235",Bi.style.opacity="100%",Yu(),YM(o[0].object.name);for(var l=o[0].object.userData.attributes.userStrings,c,h,u,d,A,f,m,g,p,v,_,y,w,b,E,M,S,T,C=0;C<l.length;C++)l[C][0]=="Name"&&(c=l[C][1]),l[C][0]=="Neighbourhood"&&(u=l[C][1]),l[C][0]=="Stage"&&(h=l[C][1]),l[C][0]=="CoverImageLink"&&(d=l[C][1]),l[C][0]=="Designer"&&(A=l[C][1]),l[C][0]=="Developer"&&(f=l[C][1]),l[C][0]=="Constructor"&&(m=l[C][1]),l[C][0]=="ParticipationStatus"&&(g=l[C][1]),l[C][0]=="SalesStatus"&&(p=l[C][1]),l[C][0]=="Website"&&(v=l[C][1]),l[C][0]=="Email"&&l[C][1],l[C][0]=="Phone"&&l[C][1],l[C][0]=="TypeForm2min"&&(M=l[C][1]),l[C][0]=="TypeForm5min"&&(S=l[C][1]),l[C][0]=="TypeForm10min"&&(T=l[C][1]),l[C][0]=="CamSide"&&(_=l[C][1]),l[C][0]=="SalesModuleActive"&&l[C][1],l[C][0]=="ParticipationModuleActive"&&l[C][1],l[C][0]=="DigitalTwinStatus"&&(y=l[C][1]),l[C][0]=="DigitalTwinID"&&(b=l[C][1]),l[C][0]=="ExtraModules"&&(w=l[C][1]),l[C][0]=="DigitalTwinLoading"&&(E=l[C][1]);if(Jr.innerHTML=c,iE.innerHTML=h,rE.innerHTML=u,wp.src=d,nE.innerHTML=A,aE.innerHTML=f,sE.innerHTML=m,bp.innerHTML=g,b0.innerHTML=p,yO.innerHTML=g,b0.innerHTML=p,EO.innerHTML=y,g=="open"?(xs.style.backgroundColor="#f9d235",xs.active="active"):(xs.style.backgroundColor="#616161",xs.active="inactive"),p=="open"?(Mo.style.backgroundColor="#f9d235",Mo.active="active"):(Mo.style.backgroundColor="#616161",Mo.active="inactive"),y=="open"?(Zs.style.backgroundColor="#f9d235",Zs.active="active"):(Zs.style.backgroundColor="#616161",Zs.active="inactive"),M!="-"?lc.style.backgroundColor="#f9d235":lc.style.backgroundColor="#bdbdbd",S!="-"?cc.style.backgroundColor="#f9d235":cc.style.backgroundColor="#bdbdbd",T!="-"?toggleTypeform10min.style.backgroundColor="#f9d235":toggleTypeform10min.style.backgroundColor="#bdbdbd",v!="-"?(or.target="_blank",or.href=v,or.style.backgroundColor="#f9d235"):(or.target="_self",or.href="javascript:void(0);",or.style.backgroundColor="#bdbdbd"),parent.postMessage(o[0].object.name,"*"),o[0].object.selected=!0,Sa=o[0].object.name,ur=o[0],ur.extraModules=w,ur.digitalTwinID=b,ur.digitalTwinLoading=E,o[0].object.name.includes("Building")){Yu();let j={zoom:17.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};j.center=[Ra.lng,Ra.lat],_=="E"?j.bearing=240:_=="W"?j.bearing=70:_=="S"?j.bearing=-10:_=="N"&&(j.bearing=200),Ri(j),o[0].object.material=dl,o[0].object.orientation=_,yi.style.visibility="visible"}for(var C=0;C<Xt.children.length;C++)Xt.children[C].name!=Sa&&(Xt.children[C].material=Xt.children[C].defaultmaterial,Xt.children[C].hover=!1,Xt.children[C].selected=!1);if(Ki.children.length<4)As(c);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(c)}Bi.click()}if(o[0]!=null){Ti>15&&Yt=="Circular City House"&&Ut&&o[0].object.name.includes("Building")?(Nt.style.visibility="visible",Nt.style.display="block",KM(o[0].object.name)):Nt.style.visibility="hidden";for(var x=o[0].object.userData.attributes.userStrings,R,L,I,F,Y,D,C=0;C<x.length;C++)x[C][0]=="Name"&&(R=x[C][1]),x[C][0]=="Neighbourhood"&&(I=x[C][1]),x[C][0]=="Stage"&&(L=x[C][1]),x[C][0]=="CoverImageLink"&&(F=x[C][1]),x[C][0]=="SalesStatus"&&(D=x[C][1]),x[C][0]=="ParticipationStatus"&&(Y=x[C][1]);rv.innerHTML=R,av.innerHTML=L,nv.innerHTML=I,sv.src=F,D=="open"?kA.style.backgroundColor="#f9d235":kA.style.backgroundColor="#e4e3e3",Y=="open"?FA.style.backgroundColor="#f9d235":FA.style.backgroundColor="#e4e3e3";var U=Nt.getBoundingClientRect();U.height,U.width/2,Nt.style.left=t.x+10+"px",Nt.style.top=t.y+10+"px",un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("Building")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var C=0;C<Xt.children.length;C++)Xt.children[C].name!=un&&Xt.children[C].selected==!1&&(Xt.children[C].material=Xt.children[C].defaultmaterial,Xt.children[C].hover=!1)}else Nt.style.visibility="hidden";for(var C=0;C<Xt.children.length;C++)Xt.children[C].name&&Xt.children[C].name.includes("Building")&&(Xt.children[C].selected==!0?Xt.children[C].material=dl:Xt.children[C].hover==!0?Xt.children[C].material=qa:Xt.children[C].filtered==!0?Xt.children[C].material=NA:Xt.children[C].material=Xt.children[C].defaultmaterial)}},o1={id:"3d-model-Sluisbuurt",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Sluisbuurt/PublicTwin_Sluisbuurt.3dm",s=>{qt=s,qt.children.length;for(var o=0;o<qt.children.length;o++)if(qt.children[o].defaultmaterial=qt.children[o].material,qt.children[o].selected=!1,qt.children[o].hover=!1,qt.children[o].filtered=!1,qt.children[o].default=!0,qt.children[o].onHoverMaterial=qa,qt.children[o].onSelectMaterial=dl,qt.children[o].onFilteredMaterial=NA,qt.children[o].name.includes("Building")){qt.children[o].material=i3;for(var l=qt.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="Neighbourhood"&&(qt.children[o].neighbourhood=l[c][1]),l[c][0]=="Stage"&&(qt.children[o].stage=l[c][1]),l[c][0]=="ParticipationStatus"&&(qt.children[o].userData.attributes.participationstatus=l[c][1]),l[c][0]=="SalesStatus"&&(qt.children[o].userData.attributes.salesstatus=l[c][1]),l[c][0]=="ReportAvailable"&&(qt.children[o].userData.attributes.reportstatus=l[c][1])}this.scene.add(qt),qt.traverse(h=>{if(h.isMesh&&(h.name.includes("Building")||h.name.includes("Participate"))){var u=new xp(h.geometry),d=new Xu({color:7171437,linewidth:.1}),A=new Mp(u,d);this.scene.add(A)}}),qt.traverse(h=>{if(h.isMesh&&(h.name.includes("Building")||h.name.includes("Participate"))){const u=new Kr(h.geometry,Fp);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}}),qt.traverse(h=>{if(h.isMesh&&h.name.includes("Crown")){h.material=Tl;const u=new Kr(h.geometry,iv);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}}),qt.traverse(h=>{h.isMesh&&h.name.includes("people")&&(h.material=tv)}),qt.traverse(h=>{h.isMesh&&(h.name.includes("bush")||h.name.includes("grass"))&&(h.material=Tl)});for(var o=0;o<qt.children.length;o++)qt.children[o].defaultmaterial=qt.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none"},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),qh.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),qh.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),qh.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(qh.translateX,qh.translateY,qh.translateZ).scale(new we(qh.scale,-qh.scale,qh.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,
120661).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&o.length&&Ti>15&&Yt=="Sluisbuurt Masterplan"){Yu(),Bi.active="active",Bi.style.backgroundColor="#f9d235",Bi.style.opacity="100%",YM(o[0].object.name);for(var l=o[0].object.userData.attributes.userStrings,c,h,u,d,A,f,m,g,p,v,_,y,w,b,E=0;E<l.length;E++)l[E][0]=="Name"&&(c=l[E][1]),l[E][0]=="Neighbourhood"&&(u=l[E][1]),l[E][0]=="Stage"&&(h=l[E][1]),l[E][0]=="CoverImageLink"&&(d=l[E][1]),l[E][0]=="Designer"&&(A=l[E][1]),l[E][0]=="Developer"&&(f=l[E][1]),l[E][0]=="Constructor"&&(m=l[E][1]),l[E][0]=="ParticipationStatus"&&(g=l[E][1]),l[E][0]=="SalesStatus"&&(p=l[E][1]),l[E][0]=="Website"&&(v=l[E][1]),l[E][0]=="Email"&&l[E][1],l[E][0]=="Phone"&&l[E][1],l[E][0]=="TypeForm2min"&&(y=l[E][1]),l[E][0]=="TypeForm5min"&&(w=l[E][1]),l[E][0]=="TypeForm10min"&&(b=l[E][1]),l[E][0]=="CamSide"&&(_=l[E][1]);if(Jr.innerHTML=c,iE.innerHTML=h,rE.innerHTML=u,wp.src=d,nE.innerHTML=A,aE.innerHTML=f,sE.innerHTML=m,bp.innerHTML=g,b0.innerHTML=p,y!="-"?lc.style.backgroundColor="#f9d235":lc.style.backgroundColor="#bdbdbd",w!="-"?cc.style.backgroundColor="#f9d235":cc.style.backgroundColor="#bdbdbd",b!="-"?toggleTypeform10min.style.backgroundColor="#f9d235":toggleTypeform10min.style.backgroundColor="#bdbdbd",v!="-"?(or.target="_blank",or.href=v,or.style.backgroundColor="#f9d235"):(or.target="_self",or.href="javascript:void(0);",or.style.backgroundColor="#bdbdbd"),parent.postMessage(o[0].object.name,"*"),o[0].object.selected=!0,Sa=o[0].object.name,ur=o[0],o[0].object.name.includes("Building")){Yu();let F={zoom:17.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};F.center=[Ra.lng,Ra.lat],_=="E"?F.bearing=240:_=="W"?F.bearing=70:_=="S"?F.bearing=-10:_=="N"&&(F.bearing=200),Ri(F),o[0].object.material=dl,o[0].object.orientation=_,yi.style.visibility="visible"}for(var E=0;E<qt.children.length;E++)qt.children[E].name!=Sa&&(qt.children[E].material=qt.children[E].defaultmaterial,qt.children[E].hover=!1,qt.children[E].selected=!1);if(Ki.children.length<4)As(c);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(c)}Bi.click()}if(o[0]!=null){Ti>15&&Yt=="Sluisbuurt Masterplan"&&Ut&&o[0].object.name.includes("Building")?(Nt.style.visibility="visible",Nt.style.display="block",KM(o[0].object.name)):Nt.style.visibility="hidden";for(var M=o[0].object.userData.attributes.userStrings,S,T,C,x,R,L,E=0;E<M.length;E++)M[E][0]=="Name"&&(S=M[E][1]),M[E][0]=="Neighbourhood"&&(C=M[E][1]),M[E][0]=="Stage"&&(T=M[E][1]),M[E][0]=="CoverImageLink"&&(x=M[E][1]),M[E][0]=="SalesStatus"&&(L=M[E][1]),M[E][0]=="ParticipationStatus"&&(R=M[E][1]);rv.innerHTML=S,av.innerHTML=T,nv.innerHTML=C,sv.src=x,L=="open"?kA.style.backgroundColor="#f9d235":kA.style.backgroundColor="#e4e3e3",R=="open"?FA.style.backgroundColor="#f9d235":FA.style.backgroundColor="#e4e3e3";var I=Nt.getBoundingClientRect();I.height,I.width/2,Nt.style.left=t.x+10+"px",Nt.style.top=t.y+10+"px",un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("Building")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var E=0;E<qt.children.length;E++)qt.children[E].name!=un&&qt.children[E].selected==!1&&(qt.children[E].material=qt.children[E].defaultmaterial,qt.children[E].hover=!1)}else Nt.style.visibility="hidden";for(var E=0;E<qt.children.length;E++)qt.children[E].name&&qt.children[E].name.includes("Building")&&(qt.children[E].selected==!0?qt.children[E].material=dl:qt.children[E].hover==!0?qt.children[E].material=qa:qt.children[E].filtered==!0?qt.children[E].material=NA:qt.children[E].material=qt.children[E].defaultmaterial)}},zA={id:"NL_NDM_LND",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Masterplan/market/NL_NDM_LND.3dm",s=>{ut=s,ut.children.length;for(var o=0;o<ut.children.length;o++)if(ut.children[o].defaultmaterial=ut.children[o].material,ut.children[o].selected=!1,ut.children[o].hover=!1,ut.children[o].filtered=!1,ut.children[o].default=!0,ut.children[o].onHoverMaterial=gW,ut.children[o].onSelectMaterial=H2,ut.children[o].onFilteredMaterial=NA,ut.children[o].name.includes("Flat")){for(var l=ut.children[o].userData.attributes.userStrings,c,h=0;h<l.length;h++)l[h][0]=="flatAvailabilityStatus"&&(c=l[h][1]);c=="available"?ut.children[o].material=b5e:c=="reserved"&&(ut.children[o].material=S5e);for(var u=ut.children[o].userData.attributes.userStrings,h=0;h<u.length;h++)u[h][0]=="flatPrice"&&(ut.children[o].userData.attributes.flatPrice=u[h][1]),u[h][0]=="flatID"&&(ut.children[o].userData.attributes.flatID=u[h][1]),u[h][0]=="flatOrientation"&&(ut.children[o].userData.attributes.flatOrientation=u[h][1]),u[h][0]=="flatBedroomNo"&&(ut.children[o].userData.attributes.flatBedroomNo=u[h][1]),u[h][0]=="flatAvailabilityStatus"&&(ut.children[o].userData.attributes.flatAvailabilityStatus=u[h][1]),u[h][0]=="flatArea"&&(ut.children[o].userData.attributes.flatArea=u[h][1]),u[h][0]=="flatBalcony"&&(ut.children[o].userData.attributes.flatBalcony=u[h][1]),u[h][0]=="flatExternalArea"&&(ut.children[o].userData.attributes.flatExternalArea=u[h][1]),u[h][0]=="flatSpacesNo"&&(ut.children[o].userData.attributes.flatSpacesNo=u[h][1]),u[h][0]=="flatLevel"&&(ut.children[o].userData.attributes.flatLevel=u[h][1]),u[h][0]=="flatPlan"&&(ut.children[o].userData.attributes.flatPlan=u[h][1]),u[h][0]=="locationMasterplan"&&(ut.children[o].userData.attributes.locationMasterplan=u[h][1]),u[h][0]=="locationBuilding"&&(ut.children[o].userData.attributes.locationBuilding=u[h][1]),u[h][0]=="flatPdf"&&(ut.children[o].userData.attributes.flatPdf=u[h][1]),u[h][0]=="flatGallery"&&(ut.children[o].userData.attributes.flatGallery=u[h][1]),u[h][0]=="flatBrokerWebsite"&&(ut.children[o].userData.attributes.flatBrokerWebsite=u[h][1]),u[h][0]=="flatBrokerEmail"&&(ut.children[o].userData.attributes.flatBrokerEmail=u[h][1]),u[h][0]=="flatCameraSide"&&(ut.children[o].userData.attributes.flatCameraSide=u[h][1])}this.scene.add(ut),ut.traverse(w=>{if(w.isMesh&&(w.name.includes("Building")||w.name.includes("Participate"))){var b=new xp(w.geometry),E=new Xu({color:7171437,linewidth:.1}),M=new Mp(b,E);this.scene.add(M)}}),ut.traverse(w=>{if(w.isMesh&&(w.name.includes("Building")||w.name.includes("Participate"))){const b=new Kr(w.geometry,Fp);b.position.copy(w.position),b.rotation.copy(w.rotation),b.scale.copy(w.scale);const E=1;b.scale.multiplyScalar(E),this.scene.add(b)}});for(var o=0;o<ut.children.length;o++)ut.children[o].defaultmaterial=ut.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none";var d=new B0().setFromObject(ut),A=new we;d.getCenter(A);let f={zoom:19.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};const m=Wf[1],g=Wf[0],p=A.x,_=A.y/111320,y=p/(111320*Math.cos(m*Math.PI/180)
12066);ut.geolocatedCenterLatitude=m+_,ut.geolocatedCenterLongitude=g+y,f.center=[ut.geolocatedCenterLongitude,ut.geolocatedCenterLatitude],Ri(f),VJ(),ev(),t3(),M5e.state=!0},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log("An error happened"),console.log(s)}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),da.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),da.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),da.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(da.translateX,da.translateY,da.translateZ).scale(new we(da.scale,-da.scale,da.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1),l=vn.getBoundingClientRect();if(l.height,l.width/2,vn.style.left=t.x+10+"px",vn.style.top=t.y+10+"px",i&&o.length&&Ti>15&&Yt=="Nieuw Delft Masterplan"&&cn=="market"&&!o[0].object.filtered){wGe();for(var c=o[0].object.userData.attributes.userStrings,h,u,d,A,f,m,g,p,v,_,y,w,b,E,M,S=0;S<c.length;S++)c[S][0]=="locationMasterplan"&&c[S][1],c[S][0]=="locationBuilding"&&c[S][1],c[S][0]=="flatSpacesNo"&&(h=c[S][1]),c[S][0]=="flatPrice"&&(u=c[S][1]),c[S][0]=="flatPlan"&&(d=c[S][1]),c[S][0]=="flatPdf"&&(A=c[S][1]),c[S][0]=="flatOrientation"&&(f=c[S][1]),c[S][0]=="flatLevelPlan"&&c[S][1],c[S][0]=="flatLevel"&&(m=c[S][1]),c[S][0]=="flatID"&&(g=c[S][1]),c[S][0]=="flatGallery"&&(p=c[S][1]),c[S][0]=="flatExternalArea"&&(v=c[S][1]),c[S][0]=="flatBrokerEmail"&&(_=c[S][1]),c[S][0]=="flatBrokerWebsite"&&(y=c[S][1]),c[S][0]=="flatBedroomNo"&&(w=c[S][1]),c[S][0]=="flatBalcony"&&(b=c[S][1]),c[S][0]=="flatAvailabilityStatus"&&(E=c[S][1]),c[S][0]=="flatArea"&&(M=c[S][1]),c[S][0]=="flatCameraSide"&&c[S][1];var T=d+"/"+g+"_Level-min.jpg",C=d+"/"+g+".jpg";if(MJ.src=T,xJ.innerHTML=g,RJ.innerHTML=u,BJ.innerHTML=M,IJ.innerHTML=w,DJ.innerHTML=h,PJ.innerHTML=m,LJ.innerHTML=f,OJ.innerHTML=b,NJ.innerHTML=v,E=="reserved"?DT.classList.add("grey"):DT.classList.remove("grey"),y!="-"?(nl.target="_blank",nl.href=y,nl.style.backgroundColor="#f9d235"):(nl.target="_self",nl.href="javascript:void(0);",nl.style.backgroundColor="#bdbdbd"),y!="-"?(rl.target="_self",rl.href="mailto:"+_+"?subject="+g,rl.style.backgroundColor="#f9d235"):(rl.target="_self",rl.href="javascript:void(0);",rl.style.backgroundColor="#bdbdbd"),p!="-"?(tc.target="_blank",tc.style.backgroundColor="#f9d235"):(tc.target="_self",tc.href="javascript:void(0);",tc.style.backgroundColor="#bdbdbd"),d!="-"?(ic.target="_blank",ic.style.backgroundColor="#f9d235"):(ic.target="_self",ic.href="javascript:void(0);",ic.style.backgroundColor="#bdbdbd"),A!="-"?(al.target="_blank",al.href=A+"/"+g+".pdf",al.style.backgroundColor="#f9d235"):(al.target="_self",al.href="javascript:void(0);",al.style.backgroundColor="#bdbdbd"),o[0].object.selected=!0,Sa=o[0].object.name,yJ=C,o[0].object.name.includes("Flat")){Yu();let j={zoom:19.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};const J=Wf[1],z=Wf[0],$=o[0].object.geometry.boundingSphere.center.x,ae=o[0].object.geometry.boundingSphere.center.y/111320,ve=$/(111320*Math.cos(J*Math.PI/180)),oe=J+ae,K=z+ve;j.center=[Ra.lng,Ra.lat],j.center=[K,oe],f=="N,E"?(j.bearing=240,j.pitch=60):f=="N,W"?(j.bearing=130,j.pitch=40):f=="S,E"?(j.bearing=-40,j.pitch=60):f=="S,W"&&(j.bearing=20,j.pitch=40),Ri(j),o[0].object.material=H2,yi.style.visibility="visible"}for(var S=0;S<ut.children.length;S++)ut.children[S].name!=Sa&&(ut.children[S].material=ut.children[S].defaultmaterial,ut.children[S].hover=!1,ut.children[S].selected=!1)}if(o[0]!=null){Ti>15&&Yt=="Nieuw Delft Masterplan"&&cn=="market"&&!o[0].object.filtered&&o[0].object.name.includes("Flat")?vn.style.visibility="visible":vn.style.visibility="hidden";for(var x=o[0].object.userData.attributes.userStrings,R,L,I,F,Y,D,S=0;S<x.length;S++)x[S][0]=="locationMasterplan"&&x[S][1],x[S][0]=="locationBuilding"&&(R=x[S][1]),x[S][0]=="flatSpacesNo"&&x[S][1],x[S][0]=="flatPlan"&&(I=x[S][1]),x[S][0]=="flatPrice"&&(L=x[S][1]),x[S][0]=="flatPdf"&&x[S][1],x[S][0]=="flatOrientation"&&x[S][1],x[S][0]=="flatLevelPlan"&&x[S][1],x[S][0]=="flatLevel"&&x[S][1],x[S][0]=="flatID"&&(F=x[S][1]),x[S][0]=="flatGallery"&&x[S][1],x[S][0]=="flatExternalArea"&&x[S][1],x[S][0]=="flatCameraSide"&&x[S][1],x[S][0]=="flatBrokerEmail"&&x[S][1],x[S][0]=="flatBedroomNo"&&x[S][1],x[S][0]=="flatBalcony"&&x[S][1],x[S][0]=="flatAvailabilityStatus"&&(Y=x[S][1]),x[S][0]=="flatArea"&&(D=x[S][1]);var U=I+"/"+F+".jpg";R=R.split(":")[1],R5e.innerHTML=R,D5e.innerHTML=Y,B5e.innerHTML=L,I5e.innerHTML=D,x5e.src=U;var l=vn.getBoundingClientRect();l.height,l.width/2,vn.style.left=t.x+10+"px",vn.style.top=t.y+10+"px",cn=="market"&&(vn.style.visibility="visible",vn.style.display="block"),un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("Flat")&&o[0].object.filtered==!1&&(o[0].object.material=qa,o[0].object.hover=!0);for(var S=0;S<ut.children.length;S++)ut.children[S].name!=un&&ut.children[S].selected==!1&&(ut.children[S].material=ut.children[S].defaultmaterial,ut.children[S].hover=!1)}else vn.style.visibility="hidden",vn.style.display="none",vn.style.left=t.x+10+"px",vn.style.top=t.y+10+"px";for(var S=0;S<ut.children.length;S++)ut.children[S].name&&ut.children[S].name.includes("Flat")&&(ut.children[S].selected==!0?ut.children[S].material=H2:ut.children[S].hover==!0?ut.children[S].filtered==!1&&(ut.children[S].material=gW):ut.children[S].filtered==!0?ut.children[S].material=C5e:ut.children[S].material=ut.children[S].defaultmaterial)}},VM={id:"3d-model-Malmo-Masterplan",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e9),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Malmo_Masterplan/SE_MALMO_MASTERPLAN.3dm",s=>{Ci=s,Ci.children.length;for(var o=0;o<Ci.children.length;o++)if(Ci.children[o].defaultmaterial=Ci.children[o].material,Ci.children[o].selected=!1,Ci.children[o].hover=!1,Ci.children[o].filtered=!1,Ci.children[o].default=!0,Ci.children[o].onHoverMaterial=Nu,Ci.children[o].onSelectMaterial=Uu,Ci.children[o].onFilteredMaterial=UA,Ci.children[o].name.includes("POI"))for(var l=Ci.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="zoom"&&(Ci.children[o].POIzoom=l[c][1]),l[c][0]=="pitch"&&(Ci.children[o].POIpitch=l[c][1]),l[c][0]=="name"&&(Ci.children[o].POIname=l[c][1]),l[c][0]=="center"&&(Ci.children[o].POIcenter=l[c][1]),l[c][0]=="bearing"&&(Ci.children[o].POIbearing=l[c][1]),l[c][0]=="image"&&(Ci.children[o].POIimage=l[c][1]),l[c][0]=="description"&&(Ci.children[o].POIdescription=l[c][1]),l[c][0]=="title"&&(Ci.children[o].POItitle=l[c][1]);this.scene.add(Ci);for(var o=0;o<Ci.children.length;o++)Ci.children[o].defaultmaterial=Ci.children[o].material;QGe(),Ut=!0},s=>{Ut=!1,Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.map.loadImage("./TheLowline.png",(s,o)=>
12066{if(s)throw s;this.map.addImage("TheLowline",o),this.map.addSource("areaLabels1",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[13.0012,55.6173]}}]}}),this.map.addLayer({id:"areaLabels1",type:"symbol",source:"areaLabels1",layout:{"icon-image":"TheLowline","icon-size":.25}})}),this.map.loadImage("./CultureDistrict.png",(s,o)=>{if(s)throw s;this.map.addImage("CultureDistrict",o),this.map.addSource("areaLabels2",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[12.9989,55.6148]}}]}}),this.map.addLayer({id:"areaLabels2",type:"symbol",source:"areaLabels2",layout:{"icon-image":"CultureDistrict","icon-size":.25}})}),this.map.loadImage("./FloatingIncubator.png",(s,o)=>{if(s)throw s;this.map.addImage("FloatingIncubator",o),this.map.addSource("areaLabels3",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[12.993,55.6137]}}]}}),this.map.addLayer({id:"areaLabels3",type:"symbol",source:"areaLabels3",layout:{"icon-image":"FloatingIncubator","icon-size":.25}})}),this.map.loadImage("./TurningTorso.png",(s,o)=>{if(s)throw s;this.map.addImage("TurningTorso",o),this.map.addSource("orientationLabels1",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[12.9762,55.6133]}}]}}),this.map.addLayer({id:"orientationLabels1",type:"symbol",source:"orientationLabels1",layout:{"icon-image":"TurningTorso","icon-size":.3}})}),this.map.loadImage("./CentralStation.png",(s,o)=>{if(s)throw s;this.map.addImage("CentralStation",o),this.map.addSource("orientationLabels2",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[13.0014,55.6092]}}]}}),this.map.addLayer({id:"orientationLabels2",type:"symbol",source:"orientationLabels2",layout:{"icon-image":"CentralStation","icon-size":.3}})}),this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Mr.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Mr.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Mr.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Mr.translateX,Mr.translateY,Mr.translateZ).scale(new we(Mr.scale,-Mr.scale,Mr.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){if(!Br){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&Ut&&Ti>=8&&Ti<13.5&&Yt=="Malmo Masterplan"&&o[0]&&o[0].object.name.includes("POI")){ui&&(ui.innerHTML="",ui.remove()),Jr.innerHTML=`⢠${o[0].object.POItitle} â¢`,Ao.innerHTML=`${o[0].object.POIdescription}`,Hs.src=o[0].object.POIimage;let c={zoom:16.303,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};c.zoom=o[0].object.POIzoom,c.pitch=o[0].object.POIpitch,c.bearing=o[0].object.POIbearing;let d=o[0].object.POIcenter.replace("[","").replace("]","").split(", ").map(Number);c.center=d,Ri(c),ji(c.zoom)}if(o&&Ut&&o[0]!=null&&!Br){Ti>=9&&Ti<13.5&&o[0].object.name.includes("POI"),un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("POI")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var l=0;l<Ci.children.length;l++)Ci.children[l].name!=un&&Ci.children[l].selected==!1&&(Ci.children[l].material=Ci.children[l].defaultmaterial,Ci.children[l].hover=!1)}for(var l=0;l<Ci.children.length;l++)Ci.children[l].name&&Ci.children[l].name.includes("POI")&&(Ci.children[l].selected==!0?Ci.children[l].material=Ci.children[l].onSelectMaterial:Ci.children[l].hover==!0?Ci.children[l].material=Ci.children[l].onHoverMaterial:Ci.children[l].material=Ci.children[l].defaultmaterial)}}},WM={id:"3d-model-Malmo-Schemes",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Malmo_Masterplan/SE_MALMO_SCHEMES.3dm",s=>{Ai=s,Ai.children.length;for(var o=0;o<Ai.children.length;o++)if(Ai.children[o].defaultmaterial=Ai.children[o].material,Ai.children[o].selected=!1,Ai.children[o].hover=!1,Ai.children[o].filtered=!1,Ai.children[o].default=!0,Ai.children[o].onHoverMaterial=Nu,Ai.children[o].onSelectMaterial=Uu,Ai.children[o].onFilteredMaterial=UA,Ai.children[o].name.includes("POI")){Ai.children[o].material=KE;for(var l=Ai.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="zoom"&&(Ai.children[o].POIzoom=l[c][1]),l[c][0]=="pitch"&&(Ai.children[o].POIpitch=l[c][1]),l[c][0]=="name"&&(Ai.children[o].POIname=l[c][1]),l[c][0]=="center"&&(Ai.children[o].POIcenter=l[c][1]),l[c][0]=="bearing"&&(Ai.children[o].POIbearing=l[c][1]),l[c][0]=="image"&&(Ai.children[o].POIimage=l[c][1]),l[c][0]=="description"&&(Ai.children[o].POIdescription=l[c][1]),l[c][0]=="title"&&(Ai.children[o].POItitle=l[c][1])}this.scene.add(Ai),Ai.traverse(h=>{if(h.isMesh&&(h.name.includes("Intervention")||h.name.includes("Participate"))){var u=new xp(h.geometry),d=new Xu({color:7171437,linewidth:.1}),A=new Mp(u,d);this.scene.add(A)}}),Ai.traverse(h=>{if(h.isMesh&&(h.name.includes("Intervention")||h.name.includes("Participate"))){const u=new Kr(h.geometry,Fp);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}});for(var o=0;o<Ai.children.length;o++)Ai.children[o].defaultmaterial=Ai.children[o].material;sh(),ji(),VGe()},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Mr.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Mr.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Mr.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Mr.translateX,Mr.translateY,Mr.translateZ).scale(new we(Mr.scale,-Mr.scale,Mr.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){if(!Br&&Ti>=13.5&&Ti<15.5){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&Ut&&Ti>=13.5&&Ti<15.5&&Yt=="Malmo Masterplan"&&o[0].object.name.includes("POI")){ui&&(ui.innerHTML="",ui.remove()),Jr.innerHTML=`⢠${o[0].object.POItitle} â¢`,Ao.innerHTML=`${o[0].object.POIdescription}`,Hs.src=o[0].object.POIimage;let c={zoom:16.303,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};c.zoom=o[0].object.POIzoom,c.pitch=o[0].object.POIpitch,c.bearing=o[0].object.POIbearing;let d=o[0].object.POIcenter.replace("[","").replace("]","").split(", ").map(Number);c.center=d,Ri(c),ji(c.zoom)}if(o&&o[0]!=null&&!Br){Ti>=13.5&&Ti<15.5&&o[0].object.name.includes("POI")&&(o[0].object.material=qa,o[0].object.hover=!0),un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("POI")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var l=0;l<Ai.children.length;l++)Ai.children[l].name!=un&&Ai.children[l].selected==!1&&(Ai.children[l].material=Ai.children[l].defaultmaterial,Ai.children[l].hover=!1)}for(var l=0;l<Ai.children.length;l++)Ai.children[l].name&&Ai.children[l].name.includes("POI")&&(Ai.children[l].selected==!0?Ai.children[l].material=Ai.children[l].onSelectMaterial:Ai.children[l].hover==!0?Ai.children[l].material=Ai.children[l].onHoverMaterial:Ai.children[l].material=Ai.children[l].defaultmaterial)}}},l1={id:"3d-model-Malmo-Detailed",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Malmo_Masterplan/SE_MALMO.3dm",s=>{ti=s,ti.children.length;for(var o=0;o<ti.children.length;o++)if(ti.children[o].defaultmaterial=ti.children[o].material,ti.children[o].selected=!1,ti.children[o].hover=!1,ti.children[o].filtered=!1,ti.children[o].default=!0,ti.children[o].onHoverMaterial=Nu,ti.children[o].onSelectMaterial=Uu,ti.children[o].onFilteredMaterial=UA,ti.children[o].name.includes("POI"))for(var l=ti.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="Neighbourhood"&&(ti.children[o].neighbourhood=l[c][1]),l[c][0]=="Stage"&&(ti.children[o].stage=l[c][1]),l[c][0]=="Name"&&(ti.children[o].POIname=l[c][1]),l[c][0]=="Designer"&&(ti.children[o].designer=l[c][1]),l[c][0]=="CoverImageLink"&&(ti.children[o].CoverImageLink=l[c][1]),l[c][0]=="CamSide"&&(ti.children[o].CamSide=l[c][1]),l[c][0]=="ARModule"&&(ti.children[o].ARModule=l[c][1]),l[c][0]=="ARLink"&&(ti.children[o].ARLink=l[c][1]);this.scene.add(ti),ti.traverse(h=>
12066{if(h.isMesh){if(h.name.includes("Crown")){h.material=Tl;const u=new Kr(h.geometry,iv);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}h.name.includes("people")&&(h.material=tv),(h.name.includes("bush")||h.name.includes("grass"))&&(h.material=Tl)}});for(var o=0;o<ti.children.length;o++)ti.children[o].defaultmaterial=ti.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none",Ah=!0,sh(),ji()},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block",Qf=!1},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Mr.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Mr.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Mr.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Mr.translateX,Mr.translateY,Mr.translateZ).scale(new we(Mr.scale,-Mr.scale,Mr.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){if(!Br&&Ti>15.5){var r=this.map.transform.width,n=this.map.transform.height;wi.x=t.x/r*2-1,wi.y=1-t.y/n*2;var a=this.camera.projectionMatrix.invert(),s=new we().applyMatrix4(a),o=new we(wi.x,wi.y,1).applyMatrix4(a),l=o.clone().sub(s).normalize();this.raycaster.set(s,l);var c;if(ti&&(c=this.raycaster.intersectObjects(this.scene.children[3].children,!1)),i&&Ah&&Ut&&c.length&&Ti>15){ur=c[0];for(var h=c[0].object.userData.attributes.userStrings,u,d,A,f,m,g,p,v,_=0;_<h.length;_++)h[_][0]=="Name"&&(u=h[_][1]),h[_][0]=="Neighbourhood"&&(A=h[_][1]),h[_][0]=="Stage"&&(d=h[_][1]),h[_][0]=="CoverImageLink"&&(f=h[_][1]),h[_][0]=="Designer"&&(m=h[_][1]),h[_][0]=="CamSide"&&(g=h[_][1]),h[_][0]=="Description"&&h[_][1],h[_][0]=="ARModule"&&(v=h[_][1]),h[_][0]=="ARLink"&&(p=h[_][1]);if(Jr.innerHTML=`⢠${u} â¢`,Hs.src=f,Ao.innerHTML=` 12067 <div><span>name:</span>${u}<div> 12068 <div><span>stage:</span>${d}<div> 12069 <div><span>designer:</span>${m}<div> 12070 <div><span>district:</span>${A}<div> 12071 `,EJ=f,NM=u,r3=` 12072 <div><span>name:</span>${u}<div> 12073 <div><span>stage:</span>${d}<div> 12074 <div><span>designer:</span>${m}<div> 12075 <div><span>district:</span>${A}<div> 12076 `,c[0].object.selected=!0,Sa=c[0].object.name,c[0].object.name.includes("POI")){let T={zoom:16.303,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};if(T.center=[Ra.lng,Ra.lat],A=="Culture District"?g=="E"?T.bearing=-54.162:g=="W"?T.bearing=116.482:g=="S"?T.bearing=11.682:g=="N"&&(T.bearing=161.971):A=="The Lowline"?g=="E"?T.bearing=-88.958:g=="W"?T.bearing=62.883:g=="S"?T.bearing=-23.511:g=="N"&&(T.bearing=161.971):A=="Floating Incubator"&&(g=="E"?(T.zoom=17,T.bearing=-95.202):g=="W"?(T.zoom=17,T.bearing=116.482):g=="S"?(T.zoom=17,T.bearing=11.682):g=="N"&&(T.zoom=17,T.bearing=161.971)),Ri(T),c[0].object.material=dl,c[0].object.orientation=g,yi.style.visibility="visible",v=="active")if(ui==null){ui=document.createElement("div"),document.getElementById("mainMenuMasterplan_Information").appendChild(ui);let C=document.createElement("div");C.classList="mainMenuTitle",C.innerHTML="⢠AR experience â¢",ui.appendChild(C);let x=document.createElement("div");x.classList="QRImageDiv";let R=document.createElement("img");R.src=p,R.classList="QRDivImage marginAuto",x.appendChild(R),ui.appendChild(x)}else{ui.innerHTML="",ui.remove(),ui=document.createElement("div"),document.getElementById("mainMenuMasterplan_Information").appendChild(ui);let C=document.createElement("div");C.classList="mainMenuTitle",C.innerHTML="⢠AR experience â¢",ui.appendChild(C);let x=document.createElement("div");
12076x.classList="QRImageDiv";let R=document.createElement("img");R.src=p,R.classList="QRDivImage marginAuto",x.appendChild(R),ui.appendChild(x),document.getElementById("mainMenuMasterplan_Information").appendChild(ui)}else ui==null||(ui.innerHTML="",ui.remove())}for(var _=0;_<ti.children.length;_++)ti.children[_].name!=Sa&&(ti.children[_].material=ti.children[_].defaultmaterial,ti.children[_].hover=!1,ti.children[_].selected=!1);if(Ki.children.length<4)As(u);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(u)}}if(c&&Ah&&Ut){if(c[0]!=null){Ti>15&&c[0].object.name.includes("POI")?(Nt.style.visibility="visible",Nt.style.display="block"):Nt.style.visibility="hidden";var y=c[0].object.userData.attributes.userStrings,w,b,E,M;if(y)for(var _=0;_<y.length;_++)y[_][0]=="Name"&&(w=y[_][1]),y[_][0]=="Neighbourhood"&&(E=y[_][1]),y[_][0]=="Stage"&&(b=y[_][1]),y[_][0]=="CoverImageLink"&&(M=y[_][1]),y[_][0]=="SalesStatus"&&(salesStatus=y[_][1]),y[_][0]=="ParticipationStatus"&&(participationStatus=y[_][1]);rv.innerHTML=w,av.innerHTML=b,nv.innerHTML=E,sv.src=M;var S=Nt.getBoundingClientRect();S.height,S.width/2,Nt.style.left=t.x+10+"px",Nt.style.top=t.y+10+"px",un=c[0].object.name,c[0].object.selected==!1&&c[0].object.name.includes("POI")&&(c[0].object.material=qa,c[0].object.hover=!0);for(var _=0;_<ti.children.length;_++)ti.children[_].name!=un&&ti.children[_].selected==!1&&(ti.children[_].material=ti.children[_].defaultmaterial,ti.children[_].hover=!1)}}else Nt.style.visibility="hidden";for(var _=0;_<ti.children.length;_++)ti.children[_].name&&ti.children[_].name.includes("POI")&&(ti.children[_].selected==!0?ti.children[_].material=ti.children[_].onSelectMaterial:ti.children[_].hover==!0?ti.children[_].material=ti.children[_].onHoverMaterial:ti.children[_].material=ti.children[_].defaultmaterial)}}},c1={id:"3d-model-GliwiceBrowarScobel",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Gliwice_Browar_Scobel/PL_GLI_SCOBEL.3dm",s=>{ii=s,ii.children.length;for(var o=0;o<ii.children.length;o++)if(ii.children[o].defaultmaterial=ii.children[o].material,ii.children[o].selected=!1,ii.children[o].hover=!1,ii.children[o].filtered=!1,ii.children[o].default=!0,ii.children[o].onHoverMaterial=Nu,ii.children[o].onSelectMaterial=Uu,ii.children[o].onFilteredMaterial=UA,ii.children[o].name.includes("Building")){ii.children[o].material=KE;for(var l=ii.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="Neighbourhood"&&(ii.children[o].neighbourhood=l[c][1]),l[c][0]=="Stage"&&(ii.children[o].stage=l[c][1]),l[c][0]=="ParticipationStatus"&&(ii.children[o].userData.attributes.participationstatus=l[c][1]),l[c][0]=="SalesStatus"&&(ii.children[o].userData.attributes.salesstatus=l[c][1]),l[c][0]=="ReportAvailable"&&(ii.children[o].userData.attributes.reportstatus=l[c][1])}this.scene.add(ii),ii.traverse(h=>{if(h.isMesh&&h.name.includes("Crown")){h.material=Tl;const u=new Kr(h.geometry,iv);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}}),ii.traverse(h=>{h.isMesh&&h.name.includes("people")&&(h.material=tv)}),ii.traverse(h=>{h.isMesh&&(h.name.includes("bush")||h.name.includes("grass"))&&(h.material=Tl)});for(var o=0;o<ii.children.length;o++)ii.children[o].defaultmaterial=ii.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none"},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){var r="Gliwice Browar Scobel",n=LGe(r);const a=new _t().makeRotationAxis(new we(1,0,0),n.rotateX),s=new _t().makeRotationAxis(new we(0,1,0),n.rotateY),o=new _t().makeRotationAxis(new we(0,0,1),n.rotateZ),l=new _t().fromArray(i),c=new _t().makeTranslation(n.translateX,n.translateY,n.translateZ).scale(new we(n.scale,-n.scale,n.scale)).multiply(a).multiply(s).multiply(o);this.camera.projectionMatrix=l.multiply(c),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&o.length&&Ti>15&&Yt=="Gliwice Browar Scobel"){Yu(),Bi.active="active",Bi.style.backgroundColor="#f9d235",Bi.style.opacity="100%",YM(o[0].object.name);for(var l=o[0].object.userData.attributes.userStrings,c,h,u,d,A,f,m,g,p,v,_,y,w,b,E=0;E<l.length;E++)l[E][0]=="Name"&&(c=l[E][1]),l[E][0]=="Neighbourhood"&&(u=l[E][1]),l[E][0]=="Stage"&&(h=l[E][1]),l[E][0]=="CoverImageLink"&&(d=l[E][1]),l[E][0]=="Designer"&&(A=l[E][1]),l[E][0]=="Developer"&&(f=l[E][1]),l[E][0]=="Constructor"&&(m=l[E][1]),l[E][0]=="ParticipationStatus"&&(g=l[E][1]),l[E][0]=="SalesStatus"&&(p=l[E][1]),l[E][0]=="Website"&&(v=l[E][1]),l[E][0]=="Email"&&l[E][1],l[E][0]=="Phone"&&l[E][1],l[E][0]=="TypeForm2min"&&(y=l[E][1]),l[E][0]=="TypeForm5min"&&(w=l[E][1]),l[E][0]=="TypeForm10min"&&(b=l[E][1]),l[E][0]=="CamSide"&&(_=l[E][1]);if(Jr.innerHTML=c,iE.innerHTML=h,rE.innerHTML=u,wp.src=d,nE.innerHTML=A,aE.innerHTML=f,sE.innerHTML=m,bp.innerHTML=g,b0.innerHTML=p,y!="-"?lc.style.backgroundColor="#f9d235":lc.style.backgroundColor="#bdbdbd",w!="-"?cc.style.backgroundColor="#f9d235":cc.style.backgroundColor="#bdbdbd",b!="-"?toggleTypeform10min.style.backgroundColor="#f9d235":toggleTypeform10min.style.backgroundColor="#bdbdbd",v!="-"?(or.target="_blank",or.href=v,or.style.backgroundColor="#f9d235"):(or.target="_self",or.href="javascript:void(0);",or.style.backgroundColor="#bdbdbd"),parent.postMessage(o[0].object.name,"*"),o[0].object.selected=!0,Sa=o[0].object.name,ur=o[0],o[0].object.name.includes("Building")){Yu();let F={zoom:17.5,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};F.center=[Ra.lng,Ra.lat],_=="E"?F.bearing=240:_=="W"?F.bearing=70:_=="S"?F.bearing=-10:_=="N"&&(F.bearing=200),Ri(F),o[0].object.material=Uu,o[0].object.orientation=_,yi.style.visibility="visible"}for(var E=0;E<ii.children.length;
12076E++)ii.children[E].name!=Sa&&(ii.children[E].material=ii.children[E].defaultmaterial,ii.children[E].hover=!1,ii.children[E].selected=!1);if(Ki.children.length<4)As(c);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(c)}Bi.click()}if(o[0]!=null){Ti>15&&Yt=="Gliwice Browar Scobel"&&Ut&&o[0].object.name.includes("Building")?(Nt.style.display="block",Nt.style.visibility="visible",KM(o[0].object.name)):Nt.style.visibility="hidden";for(var M=o[0].object.userData.attributes.userStrings,S,T,C,x,R,L,E=0;E<M.length;E++)M[E][0]=="Name"&&(S=M[E][1]),M[E][0]=="Neighbourhood"&&(C=M[E][1]),M[E][0]=="Stage"&&(T=M[E][1]),M[E][0]=="CoverImageLink"&&(x=M[E][1]),M[E][0]=="SalesStatus"&&(L=M[E][1]),M[E][0]=="ParticipationStatus"&&(R=M[E][1]);rv.innerHTML=S,av.innerHTML=T,nv.innerHTML=C,sv.src=x,L=="open"?kA.style.backgroundColor="#f9d235":kA.style.backgroundColor="#e4e3e3",R=="open"?FA.style.backgroundColor="#f9d235":FA.style.backgroundColor="#e4e3e3";var I=Nt.getBoundingClientRect();I.height,I.width/2,Nt.style.left=t.x+10+"px",Nt.style.top=t.y+10+"px",un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("Building")&&(o[0].object.material=Nu,o[0].object.hover=!0);for(var E=0;E<ii.children.length;E++)ii.children[E].name!=un&&ii.children[E].selected==!1&&(ii.children[E].material=ii.children[E].defaultmaterial,ii.children[E].hover=!1)}else Nt.style.visibility="hidden";for(var E=0;E<ii.children.length;E++)ii.children[E].name&&ii.children[E].name.includes("Building")&&(ii.children[E].selected==!0?ii.children[E].material=Uu:ii.children[E].hover==!0?ii.children[E].material=Nu:ii.children[E].filtered==!0?ii.children[E].material=UA:ii.children[E].material=ii.children[E].defaultmaterial)}},h1={id:"3d-model-DijkPark-Masterplan",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e9),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Dijk_Park_Rotterdam/NL_DJP_MASTERPLAN.3dm",s=>{vi=s,vi.children.length;for(var o=0;o<vi.children.length;o++)if(vi.children[o].defaultmaterial=vi.children[o].material,vi.children[o].selected=!1,vi.children[o].hover=!1,vi.children[o].filtered=!1,vi.children[o].default=!0,vi.children[o].onHoverMaterial=Nu,vi.children[o].onSelectMaterial=Uu,vi.children[o].onFilteredMaterial=UA,vi.children[o].name.includes("POI")){vi.children[o].material=KE;for(var l=vi.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="zoom"&&(vi.children[o].POIzoom=l[c][1]),l[c][0]=="pitch"&&(vi.children[o].POIpitch=l[c][1]),l[c][0]=="name"&&(vi.children[o].POIname=l[c][1]),l[c][0]=="center"&&(vi.children[o].POIcenter=l[c][1]),l[c][0]=="bearing"&&(vi.children[o].POIbearing=l[c][1]),l[c][0]=="image"&&(vi.children[o].POIimage=l[c][1]),l[c][0]=="description"&&(vi.children[o].POIdescription=l[c][1]),l[c][0]=="title"&&(vi.children[o].POItitle=l[c][1])}this.scene.add(vi);for(var o=0;o<vi.children.length;o++)vi.children[o].defaultmaterial=vi.children[o].material;HGe(),Ut=!0},s=>{Ut=!1,Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.map.loadImage("./Tarwewijk.png",(s,o)=>{if(s)throw s;this.map.addImage("Tarwewijk",o),this.map.addSource("textLabels1",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.4872,51.8959]}}]}}),this.map.addLayer({id:"textLabels1",type:"symbol",source:"textLabels1",layout:{"icon-image":"Tarwewijk","icon-size":.06}})}),this.map.loadImage("./Waalhaven.png",(s,o)=>{if(s)throw s;this.map.addImage("Waalhaven",o),this.map.addSource("textLabels2",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.461,51.8912]}}]}}),this.map.addLayer({id:"textLabels2",type:"symbol",source:"textLabels2",layout:{"icon-image":"Waalhaven","icon-size":.06}})}),this.map.loadImage("./Dokhaven.png",(s,o)=>
12076{if(s)throw s;this.map.addImage("Dokhaven",o),this.map.addSource("textLabels3",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[4.4656,51.8965]}}]}}),this.map.addLayer({id:"textLabels3",type:"symbol",source:"textLabels3",layout:{"icon-image":"Dokhaven","icon-size":.06}})}),this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Ui.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Ui.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Ui.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Ui.translateX,Ui.translateY,Ui.translateZ).scale(new we(Ui.scale,-Ui.scale,Ui.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){if(!Br){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&Ut&&Ti>=8&&Ti<13.5&&Yt=="Dijk Park Masterplan"&&o[0]&&o[0].object.name.includes("POI")){ui&&(ui.innerHTML="",ui.remove()),Jr.innerHTML=`⢠${o[0].object.POItitle} â¢`,Ao.innerHTML=`${o[0].object.POIdescription}`,Hs.src=o[0].object.POIimage;let c={zoom:16.303,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};c.zoom=o[0].object.POIzoom,c.pitch=o[0].object.POIpitch,c.bearing=o[0].object.POIbearing;let d=o[0].object.POIcenter.replace("[","").replace("]","").split(", ").map(Number);c.center=d,Ri(c),ji(c.zoom)}if(o&&Ut&&o[0]!=null&&!Br&&Ut){Ti>=9&&Ti<13.5&&o[0].object.name.includes("POI"),un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("POI")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var l=0;l<vi.children.length;l++)vi.children[l].name!=un&&vi.children[l].selected==!1&&(vi.children[l].material=vi.children[l].defaultmaterial,vi.children[l].hover=!1)}for(var l=0;l<vi.children.length;l++)vi.children[l].name&&vi.children[l].name.includes("POI")&&(vi.children[l].selected==!0?vi.children[l].material=vi.children[l].onSelectMaterial:vi.children[l].hover==!0?vi.children[l].material=vi.children[l].onHoverMaterial:vi.children[l].material=vi.children[l].defaultmaterial)}}},u1={id:"3d-model-DijkPark-Schemes",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Dijk_Park_Rotterdam/NL_DJP_SCHEMES.3dm",s=>{fi=s,fi.children.length;for(var o=0;o<fi.children.length;o++)if(fi.children[o].defaultmaterial=fi.children[o].material,fi.children[o].selected=!1,fi.children[o].hover=!1,fi.children[o].filtered=!1,fi.children[o].default=!0,fi.children[o].onHoverMaterial=Nu,fi.children[o].onSelectMaterial=Uu,fi.children[o].onFilteredMaterial=UA,fi.children[o].name.includes("POI")){fi.children[o].material=KE;for(var l=fi.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="zoom"&&(fi.children[o].POIzoom=l[c][1]),l[c][0]=="pitch"&&(fi.children[o].POIpitch=l[c][1]),l[c][0]=="name"&&(fi.children[o].POIname=l[c][1]),l[c][0]=="center"&&(fi.children[o].POIcenter=l[c][1]),l[c][0]=="bearing"&&(fi.children[o].POIbearing=l[c][1]),l[c][0]=="image"&&(fi.children[o].POIimage=l[c][1]),l[c][0]=="description"&&(fi.children[o].POIdescription=l[c][1]),l[c][0]=="title"&&(fi.children[o].POItitle=l[c][1])}this.scene.add(fi),fi.traverse(h=>{if(h.isMesh&&(h.name.includes("Intervention")||h.name.includes("Participate"))){var u=new xp(h.geometry),d=new Xu({color:7171437,linewidth:.1}),A=new Mp(u,d);this.scene.add(A)}}),fi.traverse(h=>{if(h.isMesh&&(h.name.includes("Intervention")||h.name.includes("Participate"))){const u=new Kr(h.geometry,Fp);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}});for(var o=0;o<fi.children.length;o++)fi.children[o].defaultmaterial=fi.children[o].material;sh(),ji(),GGe()},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block"},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Ui.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Ui.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Ui.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Ui.translateX,Ui.translateY,Ui.translateZ).scale(new we(Ui.scale,-Ui.scale,Ui.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){if(!Br&&Ti>=13.5&&Ti<15.5&&Ut){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o=this.raycaster.intersectObjects(this.scene.children[3].children,!1);if(i&&Ut&&Ti>=13.5&&Ti<15.5&&Yt=="Dijk Park Masterplan"&&o[0].object.name.includes("POI")){ui&&(ui.innerHTML="",ui.remove()),Jr.innerHTML=`⢠${o[0].object.POItitle} â¢`,Ao.innerHTML=`${o[0].object.POIdescription}`,Hs.src=o[0].object.POIimage;let c={zoom:16.303,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};c.zoom=o[0].object.POIzoom,c.pitch=o[0].object.POIpitch,c.bearing=o[0].object.POIbearing;let d=o[0].object.POIcenter.replace("[","").replace("]","").split(", ").map(Number);c.center=d,Ri(c),ji(c.zoom)}if(o&&Ut&&o[0]!=null&&!Br&&Ut){Ti>=13.5&&Ti<15.5&&o[0].object.name.includes("POI"),un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("POI")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var l=0;l<fi.children.length;l++)fi.children[l].name!=un&&fi.children[l].selected==!1&&(fi.children[l].material=fi.children[l].defaultmaterial,fi.children[l].hover=!1)}for(var l=0;l<fi.children.length;l++)fi.children[l].name&&fi.children[l].name.includes("POI")&&(fi.children[l].selected==!0?fi.children[l].material=fi.children[l].onSelectMaterial:fi.children[l].hover==!0?fi.children[l].material=fi.children[l].onHoverMaterial:fi.children[l].material=fi.children[l].defaultmaterial)}}},d1={id:"3d-model-DijkPark-Detailed",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Dijk_Park_Rotterdam/NL_DJP_DETAILED.3dm",s=>{Wt=s,Wt.children.length;for(var o=0;o<Wt.children.length;o++)if(Wt.children[o].defaultmaterial=Wt.children[o].material,Wt.children[o].selected=!1,Wt.children[o].hover=!1,Wt.children[o].filtered=!1,Wt.children[o].default=!0,Wt.children[o].onHoverMaterial=Nu,Wt.children[o].onSelectMaterial=Uu,Wt.children[o].onFilteredMaterial=UA,Wt.children[o].name.includes("POI")){Wt.children[o].material=KE;for(var l=Wt.children[o].userData.attributes.userStrings,c=0;c<l.length;c++)l[c][0]=="Neighbourhood"&&(Wt.children[o].neighbourhood=l[c][1]),l[c][0]=="Stage"&&(Wt.children[o].stage=l[c][1]),l[c][0]=="Name"&&(Wt.children[o].POIname=l[c][1]),l[c][0]=="Designer"&&(Wt.children[o].designer=l[c][1]),l[c][0]=="CoverImageLink"&&(Wt.children[o].CoverImageLink=l[c][1]),l[c][0]=="CamSide"&&(Wt.children[o].CamSide=l[c][1]),l[c][0]=="ARModule"&&(Wt.children[o].ARModule=l[c][1]),l[c][0]=="ARLink"&&(Wt.children[o].ARLink=l[c][1])}this.scene.add(Wt),Wt.traverse(h=>{if(h.isMesh&&(h.name.includes("Intervention")||h.name.includes("Participate"))){var u=new xp(h.geometry),d=new Xu({color:7171437,linewidth:.1}),A=new Mp(u,d);this.scene.add(A)}}),Wt.traverse(h=>{if(h.isMesh&&(h.name.includes("Intervention")||h.name.includes("Participate"))){const u=new Kr(h.geometry,Fp);u.position.copy(h.position),u.rotation.copy(h.rotation),u.scale.copy(h.scale);const d=1;u.scale.multiplyScalar(d),this.scene.add(u)}});for(var o=0;o<Wt.children.length;o++)Wt.children[o].defaultmaterial=Wt.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none",Ah=!0,sh(),ji(),WGe()},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block",Qf=!1},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Ui.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Ui.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Ui.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Ui.translateX,Ui.translateY,Ui.translateZ).scale(new we(Ui.scale,-Ui.scale,Ui.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){if(!Br&&Ti>15.5){wi.x=t.x/this.map.transform.width*2-1,wi.y=1-t.y/this.map.transform.height*2;var r=this.camera.projectionMatrix.invert(),n=new we().applyMatrix4(r),a=new we(wi.x,wi.y,1).applyMatrix4(r),s=a.clone().sub(n).normalize();this.raycaster.set(n,s);var o;if(Wt&&(o=this.raycaster.intersectObjects(this.scene.children[3].children,!1)),i&&Ah&&Ut&&o.length&&Ti>15){for(var l=o[0].object.userData.attributes.userStrings,c,h,u,d,A,f,m,g,p=0;p<l.length;p++)l[p][0]=="Name"&&(c=l[p][1]),l[p][0]=="Neighbourhood"&&(u=l[p][1]),l[p][0]=="Stage"&&(h=l[p][1]),l[p][0]=="CoverImageLink"&&(d=l[p][1]),l[p][0]=="Designer"&&(A=l[p][1]),l[p][0]=="CamSide"&&(f=l[p][1]),l[p][0]=="Description"&&l[p][
120761],l[p][0]=="ARModule"&&(g=l[p][1]),l[p][0]=="ARLink"&&(m=l[p][1]);if(Jr.innerHTML=`⢠${c} â¢`,Hs.src=d,Ao.innerHTML=` 12077 <div><span>name:</span>${c}<div> 12078 <div><span>stage:</span>${h}<div> 12079 <div><span>designer:</span>${A}<div> 12080 <div><span>district:</span>${u}<div> 12081 `,o[0].object.selected=!0,Sa=o[0].object.name,o[0].object.name.includes("POI")){let M={zoom:16.303,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};if(M.center=[Ra.lng,Ra.lat],u=="Tarwewijk"?f=="E"?M.bearing=-54.162:f=="W"?M.bearing=116.482:f=="S"?M.bearing=11.682:f=="N"&&(M.bearing=161.971):u=="Dokhaven"?f=="E"?M.bearing=-88.958:f=="W"?M.bearing=62.883:f=="S"?M.bearing=-23.511:f=="N"&&(M.bearing=161.971):u=="Waalhaven"&&(f=="E"?M.bearing=-95.202:f=="W"?M.bearing=116.482:f=="S"?M.bearing=11.682:f=="N"&&(M.bearing=161.971)),Ri(M),o[0].object.material=dl,o[0].object.orientation=f,yi.style.visibility="visible",g=="active")if(ui==null){ui=document.createElement("div"),document.getElementById("mainMenuMasterplan_Information").appendChild(ui);let S=document.createElement("div");S.classList="mainMenuTitle",S.innerHTML="⢠AR experience â¢",ui.appendChild(S);let T=document.createElement("div");T.classList="QRImageDiv";let C=document.createElement("img");C.src=m,C.classList="QRDivImage marginAuto",T.appendChild(C),ui.appendChild(T)}else{ui.innerHTML="",ui.remove(),ui=document.createElement("div"),document.getElementById("mainMenuMasterplan_Information").appendChild(ui);let S=document.createElement("div");S.classList="mainMenuTitle",S.innerHTML="⢠AR experience â¢",ui.appendChild(S);let T=document.createElement("div");T.classList="QRImageDiv";let C=document.createElement("img");C.src=m,C.classList="QRDivImage marginAuto",T.appendChild(C),ui.appendChild(T),document.getElementById("mainMenuMasterplan_Information").appendChild(ui)}else ui==null||(ui.innerHTML="",ui.remove())}for(var p=0;p<Wt.children.length;p++)Wt.children[p].name!=Sa&&(Wt.children[p].material=Wt.children[p].defaultmaterial,Wt.children[p].hover=!1,Wt.children[p].selected=!1);if(Ki.children.length<4)As(c);else{for(;Ki.children[1].nextSibling;)Ki.children[1].nextSibling.remove();As(c)}}if(o&&Ah&&Ut){if(o[0]!=null){Ti>15&&o[0].object.name.includes("POI")?(Nt.style.visibility="visible",Nt.style.display="block"):Nt.style.visibility="hidden";var v=o[0].object.userData.attributes.userStrings,_,y,w,b;if(v)for(var p=0;p<v.length;p++)v[p][0]=="Name"&&(_=v[p][1]),v[p][0]=="Neighbourhood"&&(w=v[p][1]),v[p][0]=="Stage"&&(y=v[p][1]),v[p][0]=="CoverImageLink"&&(b=v[p][1]),v[p][0]=="SalesStatus"&&(salesStatus=v[p][1]),v[p][0]=="ParticipationStatus"&&(participationStatus=v[p][1]);rv.innerHTML=_,av.innerHTML=y,nv.innerHTML=w,sv.src=b;var E=Nt.getBoundingClientRect();E.height,E.width/2,Nt.style.left=t.x+10+"px",Nt.style.top=t.y+10+"px",un=o[0].object.name,o[0].object.selected==!1&&o[0].object.name.includes("POI")&&(o[0].object.material=qa,o[0].object.hover=!0);for(var p=0;p<Wt.children.length;p++)Wt.children[p].name!=un&&Wt.children[p].selected==!1&&(Wt.children[p].material=Wt.children[p].defaultmaterial,Wt.children[p].hover=!1)}}else Nt.style.visibility="hidden";for(var p=0;p<Wt.children.length;p++)Wt.children[p].name&&Wt.children[p].name.includes("POI")&&(Wt.children[p].selected==!0?Wt.children[p].material=Wt.children[p].onSelectMaterial:Wt.children[p].hover==!0?Wt.children[p].material=Wt.children[p].onHoverMaterial:Wt.children[p].material=Wt.children[p].defaultmaterial)}}},UGe={id:"3d-model-DijkPark-Assets",type:"custom",renderingMode:"3d",onAdd:function(t,i){this.camera=new Rr(28,window.innerWidth/window.innerHeight,.1,1e6),this.scene=new mo,this.raycaster=new Dl,this.raycaster.near=-1,this.raycaster.far=1e6;const r=new zr(16777215);r.position.set(0,-70,100).normalize(),r.intensity=1.4,r.castShadow=!0,this.scene.add(r);const n=new zr(16777215);n.position.set(0,70,200).normalize(),r.intensity=1.4,this.scene.add(n);const a=new Il(16777215,1.3);this.scene.add(a),Uo.load("models/Dijk_Park_Rotterdam/NL_DJP_DETAILED_ASSETS.3dm",s=>{jm=s,this.scene.add(jm),jm.traverse(l=>
12081{if(l.isMesh){if(l.name.includes("Crown")){l.material=Tl;const c=new Kr(l.geometry,iv);c.position.copy(l.position),c.rotation.copy(l.rotation),c.scale.copy(l.scale);const h=1;c.scale.multiplyScalar(h),this.scene.add(c)}l.name.includes("people")&&(l.material=tv),(l.name.includes("bush")||l.name.includes("grass"))&&(l.material=Tl)}});for(var o=0;o<jm.children.length;o++)jm.children[o].defaultmaterial=jm.children[o].material;Vt.style.visibility="hidden",Vt.style.display="none",sh(),ji()},s=>{Vt.innerHTML=Math.round(s.loaded/s.total*100)+"%",Vt.style.visibility="visible",Vt.style.display="block",Qf=!1},s=>{console.log(s),console.log("An error happened")}),this.map=t,this.renderer=new Qs({canvas:t.getCanvas(),context:i,antialias:!0}),this.renderer.autoClear=!1},render:function(t,i){const r=new _t().makeRotationAxis(new we(1,0,0),Ui.rotateX),n=new _t().makeRotationAxis(new we(0,1,0),Ui.rotateY),a=new _t().makeRotationAxis(new we(0,0,1),Ui.rotateZ),s=new _t().fromArray(i),o=new _t().makeTranslation(Ui.translateX,Ui.translateY,Ui.translateZ).scale(new we(Ui.scale,-Ui.scale,Ui.scale)).multiply(r).multiply(n).multiply(a);this.camera.projectionMatrix=s.multiply(o),this.renderer.resetState(),this.renderer.render(this.scene,this.camera),this.map.triggerRepaint()},raycast:function(t,i){}};B.on("load",()=>{B.getStyle().layers,hS=0;function i(){hS++,hS>=2&&(B.addSource("PTProjects",{type:"geojson",data:li}),B.addLayer({id:"PTProjects",type:"symbol",source:"PTProjects",layout:{"icon-image":["case",["==",["get","activeStatus"],"maquetteInDevelopment"],"logo2",["==",["get","activeStatus"],"activeMaquette"],"logo1","logo1"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}}))}WJ(),B.loadImage("./PublicTwin_Marker_Logo_Yellow.png",(r,n)=>{if(r)throw r;B.addImage("logo1",n),i()}),B.loadImage("./PublicTwin_Marker_Logo_Grey.png",(r,n)=>{if(r)throw r;B.addImage("logo2",n),i()}),B.loadImage("./BeforeAndAfter.png",(r,n)=>{if(r)throw r;B.addImage("camera",n)}),B.loadImage("./Info.png",(r,n)=>{if(r)throw r;B.addImage("info",n)}),B.loadImage("./Participate.png",(r,n)=>{if(r)throw r;B.addImage("participate",n)}),B.loadImage("./Panorama.png",(r,n)=>{if(r)throw r;B.addImage("panorama",n)}),B.loadImage("./AIPoint.png",(r,n)=>{if(r)throw r;B.addImage("aipoint",n)}),B.loadImage("./greenPoints.png",(r,n)=>{if(r)throw r;B.addImage("greenPoints",n)}),B.loadImage("./waterPoints.png",(r,n)=>{if(r)throw r;B.addImage("waterPoints",n)}),B.on("mouseenter","PTProjects",r=>{B.getCanvas().style.cursor="pointer";const n=r.features[0].geometry.coordinates.slice();if(r.features[0].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(r.lngLat.lng-n[0])>180;)n[0]+=r.lngLat.lng>n[0]?360:-360;I_.setLngLat(n).setHTML(`<h3>${r.features[0].properties.title}</h3> 12082 <img src="${r.features[0].properties.image}" style="width:100%;height:auto;"></img> 12083 <p><span class="boldPopUp">description:</span><span>${r.features[0].properties.description}</span></p> 12084 <p><span class="boldPopUp">status:</span><span>${r.features[0].properties.status}</span></p> 12085 <button id="enterProjectButton-${r.features[0].properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">enter!</button>`).addTo(B);const a=document.querySelector(".mapboxgl-popup-content"),s=document.querySelector(".mapboxgl-popup-tip"),o=document.getElementById(`enterProjectButton-${r.features[0].properties.title.replace(/\s+/g,"-")}`);o&&o.addEventListener("click",()=>{for(var l=0;l<li.features.length;l++)li.features[l].properties.title==r.features[0].properties.title&&($e=li.features[l]);r.features[0].properties.activeStatus==="activeMaquette"&&(fo(r.features[0].properties.title,r.features[0].geometry.coordinates),I_.remove())}),r.features[0].properties.activeStatus==="maquetteInDevelopment"?(a.classList.add("maquetteInDevelopment"),s.classList.add("maquetteInDevelopment"),a.classList.remove("activeMaquette"),s.classList.remove("activeMaquette")):r.features[0].properties.activeStatus==="activeMaquette"&&(a.classList.add("activeMaquette"),s.classList.add("activeMaquette"),a.classList.remove("maquetteInDevelopment"),s.classList.remove("maquetteInDevelopment"))}),B.on("touchstart","PTProjects",r=>{B.getCanvas().style.cursor="pointer";const n=r.features[0].geometry.coordinates.slice();r.features[0].properties.description;const a=r.features[0];if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(r.lngLat.lng-n[0])>180;)n[0]+=r.lngLat.lng>n[0]?360:-360;I_.setLngLat(n).setHTML(`<h3>${r.features[0].properties.title}</h3> 12086 <img src="${r.features[0].properties.image}" style="width:100%;height:auto;"></img> 12087 <p><span class="boldPopUp">description:</span><span>${r.features[0].properties.description}</span></p> 12088 <p><span class="boldPopUp">status:</span><span>${r.features[0].properties.status}</span></p> 12089 <button id="enterProjectButton-${r.features[0].properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">enter!</button>`).addTo(B);const s=document.querySelector(".mapboxgl-popup-content"),o=document.querySelector(".mapboxgl-popup-tip"),l=document.getElementById(`enterProjectButton-${r.features[0].properties.title.replace(/\s+/g,"-")}`);l&&l.addEventListener("click",()=>{for(var c=0;c<li.features.length;c++)li.features[c].properties.title==a.properties.title&&($e=li.features[c]);a.properties.activeStatus==="activeMaquette"&&(fo(a.properties.title,a.geometry.coordinates),I_.remove())}),r.features[0].properties.activeStatus==="maquetteInDevelopment"?(s.classList.add("maquetteInDevelopment"),o.classList.add("maquetteInDevelopment"),s.classList.remove("activeMaquette"),o.classList.remove("activeMaquette")):r.features[0].properties.activeStatus==="activeMaquette"&&(s.classList.add("activeMaquette"),o.classList.add("activeMaquette"),s.classList.remove("maquetteInDevelopment"),o.classList.remove("maquetteInDevelopment"))}),B.on("mouseleave","PTProjects",()=>{B.getCanvas().style.cursor=""}),document.getElementById("lightPreset").addEventListener("change",function(){B.getLights();var r={color:"rgba(255.0, 255.0, 255.0, 1.0)",intensity:1,direction:[210,45],"cast-shadows":!0,"shadow-intensity":.9};this.value=="dawn"?r={color:"rgba(255.0, 255.0, 255.0, 1.0)",intensity:.8,direction:[90,65],"cast-shadows":!0,"shadow-intensity":.6}:this.value=="day"?r={color:"rgba(255.0, 255.0, 255.0, 1.0)",intensity:.8,direction:[210,45],"cast-shadows":!0,"shadow-intensity":.9}:this.value=="dusk"?r={color:"rgba(255.0, 255.0, 255.0, 1.0)",intensity:.8,direction:[210,45],"cast-shadows":!0,"shadow-intensity":.7}:r={color:"rgba(255.0, 255.0, 255.0, 1.0)",intensity:.1,direction:[270,90],"cast-shadows":!1,"shadow-intensity":.1},B.setLights([{id:"sun_light",type:"directional",properties:r}])}),document.getElementById("mapStylePreset").addEventListener("change",function(){B.setStyle("mapbox://styles/"+this.value),hS=0,B.getLayer("PTProjects")&&B.removeLayer("PTProjects"),B.getSource("PTProjects")&&B.removeSource("PTProjects"),B.loadImage("./PublicTwin_Marker_Logo_Yellow.png",(r,n)=>{if(r)throw r;B.addImage("logo1",n),i()}),B.loadImage("./PublicTwin_Marker_Logo_Grey.png",(r,n)=>{if(r)throw r;B.addImage("logo2",n),i()}),r1.click(),xA.click()}),B.addSource("eraser",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{coordinates:[[[12.997126121687899,55.61849860154845],[12.998682114988952,55.61861902093196],[13.006524134215397,55.61720292843478],[13.006353145946207,55.61682862568023],[13.007875984814916,55.61662416369961],[13.008108648471392,55.615200499592675],[13.00620825573668,55.61505483163552],[13.00584008448979,55.61470798994188],[13.006909980625323,55.6144188825279],[13.006631529845322,55.613854335836436],[13.00948120697899,55.613039478440015],[13.008902990624648,55.61262026123623],[13.00626647306629,55.61257440139045],[13.003846678366159,55.61312509390277],[13.003409025273157,55.612476051949585],[13.00408818221942,55.612334128568705],[13.004727938821333,55.61234417938837],[13.004878633613004,55.61214537755717],[13.005591731347778,55.61224907241268],[13.005595898265483,55.61179060411459],[13.004707755012703,55.6116966053425],[13.004817598737617,55.610924674497994],[13.00625694595351,55.611015050067124],[13.006161026620617,55.61139842482058],[13.00869276513825,55.61166056369089],[13.008739945243718,55.611160542836075],[13.009370291064698,55.61108914332556],[13.009463370045268,55.61059787180656],[13.002186109065832,55.61009281749233],[12.999499819025317,55.60993292026927],[12.999461304632547,55.610362758993034],[13.003845492696996,55.61091842676714],[13.003572233971738,55.61165369307216],[12.99790734124764,55.611208421995684],[12.998340248048237,55.609452171271556],[12.997667344627587,55.60935145008028],[12.997337636335146,55.61137548024138],[12.996972546991316,55.61213903988235],[12.99747398537221,55.61226788486243],[12.997795509024002,55.61162088059248],[12.998938337983788,55.61172885931245],[12.998825705541691,55.61226406627091],[12.99913812367214,55.61226081408131],[12.999322038570284,55.61171839622523],[13.000983678258763,55.61183686110138],[13.001678398856654,55.612292546628],[13.000508281118414,55.612615184822005],[12.99964314272188,55.61287791667348],[12.99914985636292,55.61334130724654],[12.997642143682526,55.613990875732185],[12.996941097188937,55.61334551912762],[12.996548734063197,55.613001430312636],[12.995588044558417,55.6123481687479],[12.99560424348897,55.611480674513786],[12.994619598533262,55.61140392623642],[12.994398985472571,55.61100643027558],[12.994798628941282,55.60939949474175],[12.993608516550609,55.609279662819574],[12.993737640616047,55.60857384625902],[12.992661178391188,55.60846990817183],[12.992523704533028,55.60931150974744],[12.990273955964398,55.60903077682056],[12.987395702078857,55.60865289935654],[12.987700299880402,55.60791322200359],[12.987115444984482,55.60786161054122],[12.9870101350445,55.60854073713091],[12.986825976023596,55.60945467009833],[12.986462488696276,55.610337953782164],[12.990060009418642,55.61061390391953],[12.98995112576776,55.6113251251675],[12.992090040766897,55.611484084478036],[12.992148859944308,55.61093109686044],[12.993426021703101,55.61095042655242],[12.994345563007926,55.61109736996383],[12.994646544901741,55.611591907741854],[12.994698340924117,55.61237605338465],[12.992903699355821,55.61318143199361],[12.991488292310322,55.61449774374017],[12.990970600460372,55.6143235158211],[12.99074183
120890428703,55.61473896439736],[12.991420242714554,55.61478377644116],[12.990948583528848,55.616199878928995],[12.991493652993825,55.6164957588625],[12.994044392913821,55.61755989015114],[12.9949959749232,55.61788215112213],[12.99582669567377,55.61813627370768],[12.997126121687899,55.61849860154845]]],type:"Polygon"}}]}}),B.addLayer({id:"eraser",type:"clip",source:"eraser",layout:{"clip-layer-types":["symbol","model"]}}),B.addSource("eraserGliwice",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{coordinates:[[[18.679571956139625,50.297867972237924],[18.679245991880407,50.29780790169232],[18.67880755978291,50.297872426619136],[18.67750472223267,50.298332387551056],[18.678040221171216,50.29883582704073],[18.67828418985988,50.29901773750214],[18.67840560882192,50.29900804912435],[18.67891146290677,50.298846197204085],[18.67901803465668,50.29895922155296],[18.679495410009167,50.29872899629714],[18.67992202002111,50.298736619195125],[18.68018122069813,50.298565424386226],[18.680457968093435,50.29838857043032],[18.680806654468256,50.29873047583345],[18.681895263194207,50.29826812897693],[18.681143454482253,50.29743533598926],[18.68110126495739,50.29747361611106],[18.68054319269214,50.29758955312559],[18.68059371430303,50.29763763055112],[18.67972902775091,50.29789173092931],[18.679571956139625,50.297867972237924]]],type:"Polygon"}}]}}),B.addLayer({id:"eraserGliwice",type:"clip",source:"eraserGliwice",layout:{"clip-layer-types":["symbol","model"]}}),B.addSource("eraserDijkPark",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{coordinates:[[[4.494728817176906,51.901153474708366],[4.496297503007185,51.901311231763145],[4.49549912567835,51.89850295045659],[4.495164215311775,51.89768063715192],[4.494488725501185,51.89737065476186],[4.493837889091367,51.89716971254347],[4.491481891699863,51.89665440061992],[4.490022346031907,51.89639493982179],[4.486095002655958,51.89570195821179],[4.483751640750285,51.89500030267294],[4.4798236851206354,51.894167709761035],[4.476458165139604,51.89342461164384],[4.476236256425324,51.893930405326614],[4.476194182076085,51.894345564393234],[4.481804173589609,51.89594758489639],[4.483633455422336,51.896867174395226],[4.490128608115782,51.89826500930002],[4.492710540813306,51.9006690048634],[4.494728817176906,51.901153474708366]]],type:"Polygon"}}]}}),B.addLayer({id:"eraserDijkPark",type:"clip",source:"eraserDijkPark",layout:{"clip-layer-types":["symbol","model"]}}),B.addSource("eraserDijkPark2",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:{coordinates:[[[4.473106221484727,51.89560447999281],[4.470584702804132,51.89708075064212],[4.469155687223406,51.89779026395536],[4.467751643213887,51.897969436849365],[4.467347725563542,51.89846221143958],[4.464453938337954,51.898201029134924],[4.462357993966492,51.897969436849365],[4.459862734084652,51.89780049041826],[4.45963386389036,51.89766759856056],[4.459648527306825,51.896025986804034],[4.4599172327634165,51.89525390854473],[4.459453729268034,51.89480856524989],[4.459168297756094,51.89399020524607],[4.46036757605151,51.89376858568741],[4.460227301062332,51.89332533193527],[4.460747693910861,51.89310891899751],[4.4600394505669385,51.89230422461662],[4.45966828771347,51.89153724609898],[4.459201799864331,51.89076122273747],[4.458496671958699,51.88870740966934],[4.461084776856495,51.888170885448744],[4.462053823762744,51.88965494302306],[4.4633525851397735,51.89162977143704],[4.46406776169016,51.89276859959594],[4.46472874566561,51.892617153806924],[4.466113206460278,51.89477979128313],[4.466710729621241,51.89480879323406],[4.466947188722742,51.89479070682066],[4.467878393334388,51.89409497170604],[4.469595191821696,51.89519239462521],[4.470134805691515,51.89511067031506],[4.471567841897524,51.894484728237785],[4.472316690337067,51.89462526078967],[4.473482891808828,51.89554791364915],[4.473106221484727,51.89560447999281]]],type:"Polygon"}}]}}),B.addLayer({id:"eraserDijkPark2",type:"clip",source:"eraserDijkPark2",layout:{"clip-layer-types":["symbol","model"]}}),RGe()});B.on("mousemove",t=>{if(Ti=B.getZoom(),$e)try{B.getLayoutProperty($e.properties.modelID,"visibility")==="visible"?(Ut=!0,Cr&&(Ut=!1)):$e.properties.title!=="Dijk Park Masterplan"&&(Ut=!1)}catch{}B.getLayer("3d-model")&&Yt=="Nieuw Delft Masterplan"&&cn=="inform"&&a1.raycast(t.point,!1),B.getLayer("3d-model-Sluisbuurt")&&Yt=="Sluisbuurt Masterplan"&&o1.raycast(t.point,!1),B.getLayer("3d-model-CCH")&&Yt=="Circular City House"&&s1.raycast(t.point,!1),B.getLayer("NL_NDM_LND")&&cn=="market"&&zA.raycast(t.point,!1),B.getLayer("3d-model-Malmo-Detailed")&&Yt=="Malmo Masterplan"&&l1.raycast(t.point,!1),B.getLayer("3d-model-Malmo-Schemes")&&Yt=="Malmo Masterplan"&&WM.raycast(t.point,!1),B.getLayer("3d-model-Malmo-Masterplan")&&Yt=="Malmo Masterplan"&&VM.raycast(t.point,!1),B.getLayer("3d-model-GliwiceBrowarScobel")&&Yt=="Gliwice Browar Scobel"&&c1.raycast(t.point,!1),B.getLayer("3d-model-DijkPark-Masterplan")&&h1.raycast(t.point,!1),B.getLayer("3d-model-DijkPark-Schemes")&&u1.raycast(t.point,!1),B.getLayer("3d-model-DijkPark-Detailed")&&Ah&&d1.raycast(t.point,!1)});B.on("touchmove",t=>{if(Ti=B.getZoom(),ji(),$e)try{B.getLayoutProperty($e.properties.modelID,"visibility")==="visible"?Cr||(Ut=!0):$e.properties.title!=="Dijk Park Masterplan"&&(Ut=!1)}catch{}B.getLayer("3d-model")&&Yt=="Nieuw Delft Masterplan"&&cn=="inform"&&a1.raycast(t.point,!1),B.getLayer("3d-model-Sluisbuurt")&&Yt=="Sluisbuurt Masterplan"&&o1.raycast(t.point,!1),B.getLayer("3d-model-CCH")&&Yt=="Circular City House"&&s1.raycast(t.point,!1),B.getLayer("NL_NDM_LND")&&cn=="market"&&zA.raycast(t.point,!1),B.getLayer("3d-model-Malmo-Detailed")&&Yt=="Malmo Masterplan"&&l1.raycast(t.point,!1),B.getLayer("3d-model-GliwiceBrowarScobel")&&Yt=="Gliwice Browar Scobel"&&c1.raycast(t.point,!1),B.getLayer("3d-model-DijkPark-Masterplan")&&h1.raycast(t.point,!1),B.getLayer("3d-model-DijkPark-Schemes")&&u1.raycast(t.point,!1),B.getLayer("3d-model-DijkPark-Detailed")&&Ah&&d1.raycast(t.point,!1)});
12089B.on("move",function(){Xze(),Nt.style.visibility="hidden"});const A1=new MapboxDraw({displayControlsDefault:!1,controls:{polygon:!0,trash:!0}});document.getElementById("custom-controls");A1.onAdd(B);document.getElementById("draw-polygon").addEventListener("click",()=>{A1.changeMode("draw_polygon"),document.getElementById("measurementResults").innerHTML="click on the map!<br>press enter when done.",document.getElementById("draw-polygon").style.backgroundColor="#f9d235"});document.getElementById("delete-shape").addEventListener("click",()=>{A1.deleteAll(),document.getElementById("measurementResults").innerHTML="polygon deleted!",document.getElementById("draw-polygon").style.backgroundColor="#8f8f8f"});document.getElementById("get-coordinates").addEventListener("click",()=>{const t=A1.getAll();if(t.features.length>0){const i=t.features.find(r=>r.geometry.type==="Polygon");if(i){const r=i.geometry.coordinates[0];if(r.length>2){const n=FGe(r);console.log(r),document.getElementById("measurementResults").innerHTML=`polygon center point: 12090`+JSON.stringify(n)}else document.getElementById("measurementResults").innerHTML="not enough points to calculate a centroid"}else document.getElementById("measurementResults").innerHTML="no polygon found. draw it first."}else document.getElementById("measurementResults").innerHTML="no polygon found. draw it first."});function FGe(t){let i=0,r=0;const n=t.length;for(const o of t)i+=o[0],r+=o[1];let a=(i/n).toFixed(8),s=(r/n).toFixed(8);return a=(i/n).toFixed(4),s=(r/n).toFixed(4),[parseFloat(a),parseFloat(s)]}document.getElementById("get-area").addEventListener("click",()=>{const t=A1.getAll();if(t.features.length>0){const i=t.features.find(r=>r.geometry.type==="Polygon");if(i){const r=turf.area(i);document.getElementById("measurementResults").innerHTML=`polygon area: 12091`+r.toFixed(0)+" square meters"}else document.getElementById("measurementResults").innerHTML="no polygon found. draw it first."}else document.getElementById("measurementResults").innerHTML="no polygon found. draw it first."});document.getElementById("get-camera-properties").addEventListener("click",()=>{let t=B.getCenter(),i=B.getZoom(),r=B.getBearing(),n=B.getPitch();document.getElementById("cameraResults").innerHTML=`latitude:${t.lat.toFixed(5)},<br>longitude:${t.lng.toFixed(5)},<br>zoom:${i.toFixed(3)},<br>bearing:${r.toFixed(3)},<br>pitch:${n.toFixed(3)}`});function kGe(){B.getLayer("3d-model-DijkPark-Masterplan")?(B.setLayoutProperty("3d-model-DijkPark-Masterplan","visibility","visible"),B.moveLayer("3d-model-DijkPark-Masterplan")):(B.addLayer(h1,"waterway-label"),B.setLayoutProperty("3d-model-DijkPark-Masterplan","visibility","visible"),B.moveLayer("3d-model-DijkPark-Masterplan"))}function HGe(){B.getLayer("3d-model-DijkPark-Schemes")?(B.setLayoutProperty("3d-model-DijkPark-Schemes","visibility","visible"),B.moveLayer("3d-model-DijkPark-Schemes")):(B.addLayer(u1,"waterway-label"),B.setLayoutProperty("3d-model-DijkPark-Schemes","visibility","visible"),B.moveLayer("3d-model-DijkPark-Schemes"))}function GGe(){B.getLayer("3d-model-DijkPark-Detailed")?(B.setLayoutProperty("3d-model-DijkPark-Detailed","visibility","visible"),B.moveLayer("3d-model-DijkPark-Detailed")):(B.addLayer(d1,"waterway-label"),B.setLayoutProperty("3d-model-DijkPark-Detailed","visibility","visible"),B.moveLayer("3d-model-DijkPark-Detailed"))}function zGe(){B.getLayer("3d-model-Malmo-Masterplan")?(B.setLayoutProperty("3d-model-Malmo-Masterplan","visibility","visible"),B.moveLayer("3d-model-Malmo-Masterplan")):(B.addLayer(VM,"waterway-label"),B.setLayoutProperty("3d-model-Malmo-Masterplan","visibility","visible"),B.moveLayer("3d-model-Malmo-Masterplan"))}function QGe(){B.getLayer("3d-model-Malmo-Schemes")?(B.setLayoutProperty("3d-model-Malmo-Schemes","visibility","visible"),B.moveLayer("3d-model-Malmo-Schemes")):(B.addLayer(WM,"waterway-label"),B.setLayoutProperty("3d-model-Malmo-Schemes","visibility","visible"),B.moveLayer("3d-model-Malmo-Schemes"))}function VGe(){B.getLayer("3d-model-Malmo-Detailed")?(B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","visible"),B.moveLayer("3d-model-Malmo-Detailed")):(B.addLayer(l1,"waterway-label"),B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","visible"),B.moveLayer("3d-model-Malmo-Detailed"))}function WGe(){B.getLayer("3d-model-DijkPark-Assets")?(B.setLayoutProperty("3d-model-DijkPark-Assets","visibility","visible"),B.moveLayer("3d-model-DijkPark-Assets")):(B.addLayer(UGe,"waterway-label"),B.setLayoutProperty("3d-model-DijkPark-Assets","visibility","visible"),B.moveLayer("3d-model-DijkPark-Assets"))}function sh(){for(var t=B.getStyle(),i=t.layers,r=0;r<i.length;r++)i[r].id.includes("AIPoints")&&B.moveLayer(i[r].id),i[r].id.includes("beforeAndAfterPoints")&&B.moveLayer(i[r].id),i[r].id.includes("informPoints")&&B.moveLayer(i[r].id),i[r].id.includes("panoramaPoints")&&B.moveLayer(i[r].id),i[r].id.includes("textLabels")&&B.moveLayer(i[r].id),i[r].id.includes("areaLabels")&&B.moveLayer(i[r].id),i[r].id.includes("orientationLabels")&&B.moveLayer(i[r].id),i[r].id.includes("ParticipatoryActions")&&B.moveLayer(i[r].id),i[r].id.includes("PTProjects")&&B.moveLayer(i[r].id)}function fo(t,i,r){if($e.properties.status=="active"){if($e.properties.participatoryModuleActive==!0?(Wi.active="active",Wi.style.backgroundColor="#f9d235"):(Wi.active="inactive",Wi.style.backgroundColor="#616161"),$e.properties.title=="Nieuw Delft Masterplan"){Yt="Nieuw Delft Masterplan";let s={zoom:16,pitch:60,bearing:35,center:[i[0],i[1]]};Ri(s),B.getLayer("3d-model")||B.addLayer(a1,"waterway-label"),B.setLayoutProperty("3d-model","visibility","visible"),B.setLayoutProperty("PTProjects","visibility","none"),B.setLayoutProperty("3d-model-CCH","visibility","none"),B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),Rd(t)}if($e.properties.title=="Circular City House"){Yt="Circular City House";let s={zoom:17,pitch:60,bearing:35,center:[i[0],i[1]]};Ri(s),B.getLayer("3d-model-CCH")||B.addLayer(s1,"waterway-label"),B.setLayoutProperty("3d-model-CCH","visibility","visible"),B.setLayoutProperty("PTProjects","visibility","none"),B.setLayoutProperty("3d-model","visibility","none"),B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),Rd(t)}if($e.properties.title=="Sluisbuurt Masterplan"){Yt="Sluisbuurt Masterplan";let s={zoom:17,pitch:60,bearing:35,center:[i[0],i[1]]};Ri(s),console.log("Loading Sluisbuurt Project!"),B.getLayer("3d-model-Sluisbuurt")||B.addLayer(o1,"waterway-label"),B.setLayoutProperty("3d-model-Sluisbuurt","visibility","visible"),B.setLayoutProperty("PTProjects","visibility","none"),B.setLayoutProperty("3d-model","visibility","none"),B.setLayoutProperty("3d-model-CCH","visibility","none"),Rd(t),setTimeout(()=>{const o={type:"Feature",geometry:{type:"Polygon",coordinates:[[[4.956935261924173,52.373377889375405],[4.96218240133453,52.37226128147401],[4.962636253533674,52.37479899402754],[4.96458914569223,52.376916934688154],[4.963770113237274,52.38003359913188],[4.960833561780078,52.382293317135634],[4.954230795880903,52.379720775915104],[4.95495330979486,52.37562864744612],[4.956935261924173,52.373377889375405]]]}},h=B.queryRenderedFeatures({layers:["building-extrusion"]}).filter(g=>turf.booleanIntersects(o,g)).map(g=>g.id);function u(g){let p=[];return g.forEach(v=>{p.includes(v)||p.push(v)}),p}var d=u(h);if(B.getFilter("building-extrusion"),h.length>0){var A=B.getFilter("building-extrusion"),f=["match",["id"],d,!1,!0],m;A?m=["all",A,f]:m=f,B.setFilter("building-extrusion",m)}},"1300")}if($e.properties.title=="Dijk Park Masterplan"){Yt="Dijk Park Masterplan",oE=BT,document.getElementById("mainMenuMasterplan_ShowcaseModeToggle").style.display="block",document.getElementById("countyOverview").style.display="block",wO(BT);let s={zoom:12.1,pitch:60,bearing:35,center:[i[0],i[1]]};ji(s.zoom),Ri(s),zd.style.visibility="visible",zd.style.display="block",kGe(),B.setLayoutProperty("PTProjects","visibility","none");try{B.getLayer("3d-model-CCH")&&B.setLayoutProperty("3d-model-CCH","visibility","none"),B.getLayer("3d-model-CCH")&&B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),B.getLayer("3d-model-CCH")&&B.setLayoutProperty("3d-model","visibility","none")}catch{}Rd(t),ji(s.zoom),sh()}else{zd.style.visibility="hidden",zd.style.display="none";for(var n=0;n<Pn.children.length;n++){var a=Pn.children[n];a.active="active",a.active=="inactive"?a.style.backgroundColor="#616161":a.style.backgroundColor="#f9d235"}}if($e.properties.title=="Malmo Masterplan"){document.getElementById("galleryButtonMenu").style.display="block",tE=[[12.5,55.4],[13.5,55.8]],Aze(),Yt="Malmo Masterplan",oE=wW,document.getElementById("mainMenuMasterplan_ShowcaseModeToggle").style.display="none",document.getElementById("countyOverview").style.display="none",wO(wW);let s={center:[12.93845,55.59959],zoom:10.596,bearing:-10.398,pitch:46.991};Ri(s),zd.style.visibility="visible",zd.style.display="block",B.getLayer("3d-model-Malmo-Detailed")||zGe(),Rd(t),ji(s.zoom),sh()}if($e.properties.title=="Thrissur Urban Study"){if(_O.includes("WSoA")){tE=[[75.816388,10.166054],[76.642592,10.827157]];let s;B.on("zoom",()=>{clearTimeout(s),s=setTimeout(()=>{console.log("Zoom event processed")},200)}),document.getElementById("countyOverview").style.display="none",Yt="Thrissur Urban Study";let o={zoom:13.5,pitch:0,bearing:0,center:[76.2142,10.5249]};Ri(o),Rd(t),ji(o.zoom),sh(),Wi.click()}else document.getElementById("accessStatus").innerHTML="you dont have permision to access this project!";try{sze("https://publictwin.info/digital_maquette/content/Thrissur_Urban_Study/Maps/Thrissur_Urban_Study_Road_Lines.shp")}catch{console.log(error)}}if($e.properties.title=="Urban Future"){window.innerWidth<=768&&(document.getElementById("closeMediaGalleryImage").style.display="none",document.getElementById("loginMenu").style.display="none"),B.setStyle("mapbox://styles/dripvisual/cmantxs6m01ii01skcbe76l1u"),B.once("style.load",function(){Nze()});let o;B.on("zoom",()=>{clearTimeout(o),o=setTimeout(()=>{console.log("Zoom event processed")},200)}),document.getElementById("countyOverview").style.display="none",Yt="Urban Future";let l={zoom:14.5,pitch:0,bearing:0,center:[19.4513,51.7788]};Ri(l),Rd(t),ji(l.zoom);try{sh()}catch{}document.getElementById("closeMediaGalleryImage").style.display="none",document.getElementById("loginMenu").style.display="none",window.addEventListener("load",function(){setTimeout(function(){window.scrollTo(0,1)},0)})}if($e.properties.title=="Gliwice Browar Scobel")if(jg=="KOM"||jg=="admin"){Yt="Gliwice Browar Scobel";let s={zoom:15.2,pitch:60,bearing:35,center:[i[0],i[1]]};Ri(s),console.log("Loading Gliwice Browar Scobel!"),B.getLayer("3d-model-GliwiceBrowarScobel")||B.addLayer(c1,"waterway-label"),B.setLayoutProperty("3d-model-GliwiceBrowarScobel","visibility","visible"),B.setLayoutProperty("places","visibility","none"),B.setLayoutProperty("3d-model","visibility","none"),B.setLayoutProperty("3d-model-CCH","visibility","none"),B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),B.setLayoutProperty("3d-model-Malmo-Detailed","visibility","none"),Rd(t)}else document.getElementById("accessStatus").innerHTML="you dont have permision to access this project!"}else accessStatus.innerHTML="projects is not active!"}function Rd(t){if(document.getElementById("accessStatus").innerHTML="",Jr.innerHTML=`⢠${$e.properties.title} â¢`,cn="inform",jM(),I_.remove(),Ki.children.length<2)As(t);else{for(;Ki.firstChild;)Ki.removeChild(Ki.firstChild);As(t)}Bi.click(),$e.properties.status=="active"&&(closeButtonTools.click(),$e.properties.title=="Dijk Park Masterplan"&&Cp.click(),$e.properties.title=="Malmo Masterplan"&&Cp.click())}function As(t){const i=document.createElement("div");i.className="urlDivider";const r=document.createElement("img");r.className="urlArrow",r.src="https://publictwin.info/digital_maquette/content/00_Icons/Arrow_Right_URL.svg",i.appendChild(r),Ki.appendChild(i);const n=document.createElement("button");n.innerHTML=t,n.className="urlItem loginSystemButton clickableButton",n.addEventListener("click",()=>{for(;n.nextSibling;)n.nextSibling.remove();if(Ki.children.length==2&&(Bi.click(),fo($e.properties.title,$e.geometry.coordinates),ji($e.properties.cameraReset.zoom)),Ki.children.length>2){var s={x:0,y:0};s.x=ur.object.geometry.boundingSphere.center.x,s.y=ur.object.geometry.boundingSphere.center.y;let o={zoom:17,pitch:60,bearing:240,center:[4.35878,52.00236828785361]};ur.object.orientation=="E"?o.bearing=240:ur.object.orientation=="W"?o.bearing=70:ur.object.orientation=="S"?o.bearing=-10:ur.object.orientation=="N"&&(o.bearing=200);let l=$e.properties.origin,c=null;typeof l=="string"?c=l.replace(/[\[\]]/g,"").split(",").map(Number):c=l;const h=c[1],u=c[0],d=s.x,f=s.y/111320,m=d/(111320*Math.cos(h*Math.PI/180)
12091),g=h+f,p=u+m;o.center=[p,g],Bi.click(),Ri(o)}ss=="global"&&(ur=null,yr.active="inactive",yr.style.backgroundColor="#616161",Wi.active="inactive",Wi.style.backgroundColor="#616161"),ss=="masterplan"&&(ur=null,yr.active="inactive",yr.style.backgroundColor="#616161",$e.properties.participatoryModuleActive!=!0&&(Wi.active="inactive",Wi.style.backgroundColor="#616161"))}),Ki.appendChild(n);var a=Ki.children.length;a<=0?ss="global":a>0&&a<=2?ss="masterplan":a>2&&a<=4?ss="poi":ss="unit"}function jM(){if($e&&(ss=="poi"?$e.properties.title=="Malmo Masterplan"||$e.properties.title=="Dijk Park Masterplan"?(Ao.innerHTML=r3,Jr.innerHTML=`⢠${NM} â¢`,Hs.src=EJ,Aa.style.display="block",Aa.style.visibility="visible"):(Aa.style.display="none",Aa.style.visibility="hidden"):(Ao.innerHTML=$e.properties.descriptionLong,Hs.src=$e.properties.image)),document.getElementById("mainMenuMasterplan_Image").parentElement.addEventListener("click",function(){const r=document.createElement("div");r.className="EnlargeGalleryImageWrapper";const n=document.createElement("div");n.className="EnlargeGalleryImageDiv",r.appendChild(n);const a=document.createElement("button");a.className="closeEnlargeGallery closeButton filterButton filterResetButton",r.appendChild(a),n.className="EnlargeGalleryImageDiv";const s=document.createElement("img");s.src="https://publictwin.info/digital_maquette/content/00_Icons/Close_Button.svg",s.className="mainMenuIcon arrowIcon",a.appendChild(s);const o=document.createElement("img");o.className="EnlargeGalleryImage",o.src=Hs.src;const l=document.createElement("div");l.className="ImageSizedDiv",n.appendChild(l),l.appendChild(o),a.addEventListener("click",function(){r.remove(),document.getElementById("mediaGalleryWrapperImage").style.display="none"}),document.getElementById("madiaGalleryImage").appendChild(r),document.getElementById("mediaGalleryWrapperImage").style.display="block",document.getElementById("mediaGalleryWrapperImage").style.visibility="visible"}),LT.style.display="block",LT.style.visibility="visible",$e){if($e.properties.status=="active"?(vg.style.display="none",vg.style.visibility="hidden",Al.style.display="block",Al.style.visibility="visible"):(vg.style.display="block",vg.style.visibility="visible",Al.style.display="none",Al.style.visibility="hidden"),$e.properties.digitalTwin=="available"?(_u.href=$e.properties.digitalTwinLink,_u.style.display="flex",_u.style.visibility="visible"):(_u.style.visibility="hidden",_u.style.display="none"),$e.properties.advancedSelection=="true"?(fA.style.display="block",AA.style.display="block",fA.style.visibility="visible",AA.style.visibility="visible"):(fA.style.display="none",AA.style.display="none",fA.style.visibility="hidden",AA.style.visibility="hidden"),$e.properties.title=="Dijk Park Masterplan"){Fu.active="inactive",xA.active="inactive";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.active=="inactive"&&(i.style.backgroundColor="#616161")}}if($e.properties.title=="Malmo Masterplan"){document.getElementById("interfaceLegendMalmo").style.display="block",document.getElementById("interfaceLegend").style.display="none",Fu.active="inactive",xA.active="inactive",Bl.active="inactive",Bl.style.backgroundColor="#616161",Vg.style.opacity="50%",Vg.active="inactive",Vg.style.backgroundColor="#616161",hv.active="inactive";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.active=="inactive"&&(i.style.backgroundColor="#616161")}}else document.getElementById("interfaceLegendMalmo").style.display="none",document.getElementById("interfaceLegend").style.display="block";if($e.properties.title=="Thrissur Urban Study"){Fu.active="active",xA.active="inactive",Cp.active="inactive";for(var t=0;t<Pn.children.length;t++){var i=Pn.children[t];i.active=="inactive"&&(i.style.backgroundColor="#616161")}}}}document.addEventListener("mousemove",jGe,!1);function jGe(t){Vt.style.left=t.clientX+"px",Vt.style.top=t.clientY+"px",Nt.style.left=t.clientX+10+"px",Nt.style.top=t.clientY+10+"px",document.elementFromPoint(t.clientX,t.clientY).className!="mapboxgl-canvas"?(Nt.style.visibility="hidden",Nt.style.display="none",vn.style.visibility="hidden",vn.style.display="none",Ut=!1):Cr||(Ut=!0)}function YGe(t){let i=$e.properties.origin,r=null;typeof i=="string"?r=i.replace(/[\[\]]/g,"").split(",").map(Number):r=i;const n=r[1],a=r[0],s=t.x,l=t.y/111320,c=s/(111320*Math.cos(n*Math.PI/180)
12091),h=n+l;return[a+c,h]}B.on("click",t=>{Ra=t.lngLat,B.getLayer("3d-model")&&Yt=="Nieuw Delft Masterplan"&&a1.raycast(t.point,!0),B.getLayer("3d-model-Sluisbuurt")&&Yt=="Sluisbuurt Masterplan"&&o1.raycast(t.point,!0),B.getLayer("3d-model-CCH")&&Yt=="Circular City House"&&s1.raycast(t.point,!0),B.getLayer("NL_NDM_LND")&&Yt=="Nieuw Delft Masterplan"&&zA.raycast(t.point,!0),B.getLayer("3d-model-Malmo-Detailed")&&Yt=="Malmo Masterplan"&&l1.raycast(t.point,!0),B.getLayer("3d-model-Malmo-Schemes")&&Yt=="Malmo Masterplan"&&WM.raycast(t.point,!0),B.getLayer("3d-model-Malmo-Masterplan")&&Yt=="Malmo Masterplan"&&VM.raycast(t.point,!0),B.getLayer("3d-model-GliwiceBrowarScobel")&&Yt=="Gliwice Browar Scobel"&&c1.raycast(t.point,!0),B.getLayer("3d-model-DijkPark-Detailed")&&Ah&&d1.raycast(t.point,!0),B.getLayer("3d-model-DijkPark-Schemes")&&u1.raycast(t.point,!0),B.getLayer("3d-model-DijkPark-Masterplan")&&h1.raycast(t.point,!0);try{ur.extraModules?cn=="inform"?ur.extraModules=="available"?(Ni.style.visibility="visible",Ni.style.display="block",Zi.style.display="block",Zi.style.visibility="visible"):(Ni.style.visibility="hidden",Ni.style.display="none",Zi.style.display="none",Zi.style.visibility="hidden"):(Ni.style.visibility="hidden",Ni.style.display="none"):(Ni.style.visibility="hidden",Ni.style.display="none",Zi.style.display="none",Zi.style.visibility="hidden")}catch{Ni.style.visibility="hidden",Ni.style.display="none",Zi.style.display="none",Zi.style.visibility="hidden"}});B.on("touchend",t=>{Ra=t.lngLat,B.getLayer("3d-model")&&Yt=="Nieuw Delft Masterplan"&&a1.raycast(t.point,!0),B.getLayer("3d-model-Sluisbuurt")&&Yt=="Sluisbuurt Masterplan"&&o1.raycast(t.point,!0),B.getLayer("3d-model-CCH")&&Yt=="Circular City House"&&s1.raycast(t.point,!0),B.getLayer("NL_NDM_LND")&&Yt=="Nieuw Delft Masterplan"&&zA.raycast(t.point,!0),B.getLayer("3d-model-Malmo-Detailed")&&Yt=="Malmo Masterplan"&&l1.raycast(t.point,!0),B.getLayer("3d-model-Malmo-Schemes")&&Yt=="Malmo Masterplan"&&WM.raycast(t.point,!0),B.getLayer("3d-model-Malmo-Masterplan")&&Yt=="Malmo Masterplan"&&VM.raycast(t.point,!0),B.getLayer("3d-model-GliwiceBrowarScobel")&&Yt=="Gliwice Browar Scobel"&&c1.raycast(t.point,!0),B.getLayer("3d-model-DijkPark-Detailed")&&Ah&&d1.raycast(t.point,!0),B.getLayer("3d-model-DijkPark-Schemes")&&u1.raycast(t.point,!0),B.getLayer("3d-model-DijkPark-Masterplan")&&h1.raycast(t.point,!0);try{ur.extraModules?cn=="inform"?ur.extraModules=="available"?(Ni.style.visibility="visible",Ni.style.display="block",Zi.style.display="block",Zi.style.visibility="visible"):(Ni.style.visibility="hidden",Ni.style.display="none",Zi.style.display="none",Zi.style.visibility="hidden"):(Ni.style.visibility="hidden",Ni.style.display="none"):(Ni.style.visibility="hidden",Ni.style.display="none",Zi.style.display="none",Zi.style.visibility="hidden")}catch{Ni.style.visibility="hidden",Ni.style.display="none",Zi.style.display="none",Zi.style.visibility="hidden"}});B.on("wheel",t=>{Ti=B.getZoom(),ji()});let Ay=null;B.on("touchstart",function(t){if(t.points.length===2){const i=t.points[0],r=t.points[1];Ay=ZJ(i,r)}t.points.length>=2?(console.log("multitouch detected"),Ml=!0,Ut=!1):Ml=!1});B.on("touchmove",function(t){if(t.points.length===2&&Ay!==null){const i=t.points[0],r=t.points[1],n=ZJ(i,r);n>Ay,Ti=B.getZoom(),ji(),Ay=n}t.points.length>=2?(Ml=!0,Ut=!0):Ml=!1,Ut=!1});B.on("touchend",function(t){t.points.length<2&&(Ay=null),Ml=!1,Ut=!0});function ZJ(t,i){const r=t.x-i.x,n=t.y-i.y;return Math.sqrt(r*r+n*n)}function KGe(){B.getLayoutProperty($e.properties.modelID,"visibility")==="visible"?B.setLayoutProperty($e.properties.modelID,"visibility","none"):B.setLayoutProperty($e.properties.modelID,"visibility","visible")}function XGe(){xl.classList.add("closed"),xl.style.transform="translate(-19vw,0)",Wi.style.opacity="50%",Bi.style.opacity="50%",Sr.style.opacity="50%",yr.style.opacity="50%",Bl.style.opacity="50%"}function qGe(){PT.style.transform="translate(19vw,0)",hv.style.opacity="50%",Fu.style.opacity="50%",xA.style.opacity="50%",zM.style.opacity="50%",Cp.style.opacity="50%"}function JJ(){C0.classList.add("closed"),C0.style.transform="translate(0,110%)"}function rd(t){if(gt){t.target.state=!t.target.state;var i=t.target.buttontype;for(var r in ca)ca[r].buttontype!=i&&(ca[r].state=!1);for(var r in ca)ca[r].state?ca[r].classList.add("active"):ca[r].classList.remove("active")}if(gt){if(i=="neighbourhood"){var n=[];for(var r in ca)ca[r].state&&n.push(ca[r].buttonname);for(var r=0;r<gt.children.length;r++)gt.children[r].name.includes("Building")&&(n.includes(gt.children[r].neighbourhood)?gt.children[r].filtered=!0:gt.children[r].filtered=!1)}else if(i=="stage"){var a=[];for(var r in ca)ca[r].state&&a.push(ca[r].buttonname);for(var r=0;r<gt.children.length;r++)gt.children[r].name.includes("Building")&&(a.includes(gt.children[r].stage)?gt.children[r].filtered=!0:gt.children[r].filtered=!1)}else if(i=="action"&>){const s=[];for(var r=0;r<gt.children.length;r++)gt.children[r].name.includes("Building")&&s.push(gt.children[r].userData.attributes);let o={participationstatus:"closed",reportstatus:"false",salesstatus:"closed"};ov.state?o.participationstatus="open":delete o.participationstatus,lv.state?o.reportstatus="true":delete o.reportstatus,cv.state?o.salesstatus="open":delete o.salesstatus;const l=ZGe(s,o),c=gt.children.filter(d=>l.some(A=>A.id===d.userData.attributes.id)),h=new Set(l.map(d=>d.id)),u=gt.children.filter(d=>!h.has(d.userData.attributes.id));for(var r=0;r<c.length;r++)c[r].filtered=!0;for(var r=0;r<u.length;r++)u[r].filtered=!1}for(var r=0;r<gt.children.length;r++)gt.children[r].filtered==!0?gt.children[r].material=NA:gt.children[r].material=gt.children[r].defaultmaterial}}function ZGe(t,i){return t.filter(r=>Object.keys(i).every(n=>i[n].includes(r[n])))}
12091function bO(){for(var t in ca)ca[t].state=!1,ca[t].style.backgroundColor="#d0d0d0",ca[t].classList.remove("active");for(var t=0;t<gt.children.length;t++)gt.children[t].material=gt.children[t].defaultmaterial,gt.children[t].filtered=!1}function JGe(){var t={zoom:0,center:[],pitch:0,bearing:0};t.zoom=X2.zoom,$e.properties.title=="Malmo Masterplan"&&(t.zoom=15.2),$e.properties.title=="Gliwice Browar Scobel"&&(t.zoom=16.5),t.pitch=X2.pitch,t.bearing=X2.bearing,t=$e.properties.cameraReset,$e.geometry&&(t.center=$e.geometry.coordinates,Ri(t),ji(t.zoom),B.setLayoutProperty("PTProjects","visibility","none"))}function $J(){if(r1.active=="active"){for(document.getElementById("galleryButtonMenu").style.display="none",fze(),tE=[[-180,-90],[180,90]],B.setMaxBounds(tE);Ki.firstChild;)Ki.removeChild(Ki.firstChild);ss="global",Ri(vJ),$e=[],Jr.innerHTML="⢠Digital Maquette â¢",Ao.innerHTML="Welcome to interactive PublicTwin digital maquette. Our platform has been developed with and for: municipalities, developers, architects, and community managers. Our goal? To revolutionize communication of urban development plans with interactive models, smart insights, and participatory decision-making!",Hs.src="https://publictwin.info/digital_maquette/content/00_Main_Graphics/PublicTwin_MainMasterplan.jpg",_u.style.display="none",_u.style.visibility="hidden",Al.style.display="none",Al.style.visibility="hidden",B.setLayoutProperty("3d-model","visibility","none"),B.setLayoutProperty("3d-model-CCH","visibility","none"),B.setLayoutProperty("3d-model-Sluisbuurt","visibility","none"),B.setLayoutProperty("PTProjects","visibility","visible"),vg.style.display="block",vg.style.visibility="visible",AA.style.display="none",AA.style.visibility="hidden",fA.style.display="none",fA.style.visibility="hidden",Aa.style.display="block",Aa.style.visibility="visible",LT.style.display="block",LT.style.visibility="visible",HA.style.display="block",HA.style.visibility="visible",Wi.active="inactive",Wi.style.backgroundColor="#616161",Wi.style.opacity="50%",yr.active="inactive",yr.style.backgroundColor="#616161",yr.style.opacity="50%",QM(),closeButton.click(),closeButtonTools.click()}}function Ri(t){Nt.style.visibility="hidden",window.innerWidth<=768?(()=>navigator.hardwareConcurrency&&navigator.hardwareConcurrency<4)()?B.jumpTo(t):B.easeTo({...t,duration:1e3,essential:!0}):B.flyTo({...t,duration:2e3,essential:!0}),setTimeout(()=>{B.setMaxBounds(tE)},2e3)}function e$(t){if(document.readyState==="complete"){if(bp.innerHTML=="open"){if(!Vf){var i=document.getElementsByClassName("tf-v1-sidetab-button");setTimeout(()=>{_c.style.display="block"},1500),i[0].click(),Vf=!0}}else if(t&&!Vf){var i=document.getElementsByClassName("tf-v1-sidetab-button"),r=document.getElementById("typeFormDiv");r.setAttribute("data-tf-sidetab",t),setTimeout(()=>{_c.style.display="block"},1500),i[0].click(),Vf=!0}}}function $Ge(){Vf&&(document.getElementById("typeformWrapper").style.transform="translate(100%,0)",Vf=!1,hi!=null&&(hi.innerHTML="",hi.remove()))}function YM(t){fetch("https://publictwin.info/digital_maquette/php_scripts/update_click.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"BuildingId="+encodeURIComponent(t)}).then(i=>i.text()).then(i=>{}).catch(i=>{console.error("Error:",i)})}function KM(t){fetch("https://publictwin.info/digital_maquette/php_scripts/get_click.php?BuildingId="+encodeURIComponent(t)).then(i=>i.json()).then(i=>{i.ClickCount!==void 0?document.getElementById("buttonEngagements").innerText=i.ClickCount:console.error("Error fetching click count:",i.error)}).catch(i=>{console.error("Error:",i)})}function Ym(t,i){const r={};return t.forEach(n=>{JSON.parse(n[i]).forEach(s=>{r[s]?r[s]++:r[s]=1})}),r}function Km(t,i,r){new Chart(t,{type:"bar",data:{labels:Object.keys(i),datasets:[{label:r,data:Object.values(i),backgroundColor:"rgba(249, 210, 53, 0.2)",borderColor:"rgba(249, 210, 53, 1)",borderWidth:1}]},options:{scales:{x:{ticks:{display:!1,minRotation:89,maxRotation:91,autoSkip:!1,sampleSize:1}},y:{beginAtZero:!0}},layout:{padding:{left:10,right:10,top:10,bottom:20}}}})}function Yu(){try{fetch("https://publictwin.info/digital_maquette/php_scripts/fetchData.php").then(t=>t.json()).then(t=>{const i=Ym(t,"CentralCourtyard"),r=Ym(t,"GroundFloorProgramme"),n=Ym(t,"RooftopFunction"),a=Ym(t,"PublicSpacePreferences"),s=Ym(t,"ArchitecturalLanguagePreferences"),o=Ym(t,"GreenSpacePreferences");Km(document.getElementById("centralCourtyardChart").getContext("2d"),i,"Central Courtyard"),Km(document.getElementById("groundFloorProgrammeChart").getContext("2d"),r,"Ground Floor Programme"),Km(document.getElementById("rooftopFunctionChart").getContext("2d"),n,"Rooftop Function"),Km(document.getElementById("publicSpacePreferencesChart").getContext("2d"),a,"Public Space Preferences"),Km(document.getElementById("architecturalLanguagePreferencesChart").getContext("2d"),s,"Architectural Language Preferences"),Km(document.getElementById("greenSpacePreferencesChart").getContext("2d"),o,"Green Space Preferences")}).catch(t=>console.error("Error fetching data:",t))}catch{}}function eze(){UJ.style.display="flex"}function tze(){UJ.style.display="none"}function D_(t){const i=document.getElementById("typeform-embed");Vf=!0,document.getElementById("typeformWrapper").style.transform="translate(0,0)",
12091i.innerHTML="",window.tf.createWidget(t,{container:i,width:"100%",height:"100%",hideScrollbars:!0}),i.style.display="block"}function l3(){kM.style.display="none",HM.style.display="block",UM.style.backgroundColor="#8f8f8f",FM.style.backgroundColor="#f9d235",GM.style.display="none",QJ.style.display="none"}function ize(){kM.style.display="none",HM.style.display="none",UM.style.backgroundColor="#8f8f8f",FM.style.backgroundColor="#f9d235",GM.style.display="block"}function rze(){kM.style.display="block",HM.style.display="none",UM.style.backgroundColor="#f9d235",FM.style.backgroundColor="#8f8f8f",GM.style.display="none",QJ.style.display="none"}function c3(){fetch("https://publictwin.info/digital_maquette/php_scripts/check_login_status.php").then(t=>t.json()).then(t=>{if(t.isLoggedIn){if(document.getElementById("loginMenu").style.display="none",document.getElementById("closeLoginMenu").click(),X5e.innerText=t.email,q5e.innerText=t.user_role,Z5e.innerText=t.user_permissions,jg=t.user_permissions,_O=t.project_permissions,t.email.includes("cardiff")&&(_O="public,WSoA"),Sr.active="active",Sr.style.backgroundColor="#f9d235",yi.classList.remove("closed"),yi.style.transform="translate(0,0)",yi.scrollTo(0,0),yi.style.visibility="visible",gO)for(var i=0;i<li.features.length;i++)li.features[i].properties.title==gO&&($e=li.features[i],fo($e.properties.title,$e.geometry.coordinates))}else document.getElementById("loginMenu").style.display="block"}).catch(t=>console.error("Error:",t))}function nze(){if($e)try{$e.properties.participatoryModuleActive==!0&&(B.getLayer("ParticipatoryActions")&&B.removeLayer("ParticipatoryActions"),B.getSource("ParticipatoryActions")&&B.removeSource("ParticipatoryActions"),Ro.remove())}catch{}let t=[];t.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),t$(t),Br=!0,_c.click(),Dt&&(Dt.style.display="none",Dt.style.visibility="hidden"),pA.innerHTML="position the pin on the map!",FJ.click(),document.getElementById("dropPinButton").style.backgroundColor="#f9d235",va.setLngLat($e.geometry.coordinates),va.addTo(B);const i=va.getLngLat();if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(e.lngLat.lng-i[0])>180;)i[0]+=e.lngLat.lng>i[0]?360:-360;Kn.setLngLat(i).setHTML(` 12092 <div class="participatePinPopupInputDiv"> 12093 <label for="noteInput" class="boldPopUpPin inLine participatePinPopupInput">comment:</label> 12094 <input type="text" id="noteInput"class="PopUpInput participatePinPopupInput inLine" placeholder="add your note here..." autocomplete="off"> 12095 </div> 12096 12097 <div class="participatePinPopupInputDiv"> 12098 <label for="noteType" class="boldPopUpPin participatePinPopupInput inLine">type:</label> 12099 <select id="noteType" class="PopUpInput participatePinPopupInput inLine"> 12100 <option value="general note" selected>general note</option> 12101 <option value="opportunity">opportunity</option> 12102 <option value="problem">problem</option> 12103 <option value="idea">idea</option> 12104 </select> 12105 </div> 12106 12107 <button id="finishPinDropping" class="enterButton ideaButton clickableButton smallPopUpButton">leave your idea!</button> 12108 <button id="exitPinDropping" class="enterButton clickableButton smallPopUpButton">exit</button> 12109 `).addTo(B),Kn._content.style.backgroundColor="#f6f6f6",Kn._content.style.boxShadow="2px 2px 5px #00000024, -2px -2px 5px #00000024",Kn._tip.style.display="none",document.getElementById("finishPinDropping").addEventListener("click",function(){const r=document.getElementById("noteInput").value,n=document.getElementById("noteType").value,a=va.getLngLat(),s=`${a.lng.toFixed(4)},${a.lat.toFixed(4)}`;pA.innerHTML=`<div><span>comment:</span>${r}</div><div><span>type:</span>${n}</div><div><span>coordinates:</span>${s}</div>`;let l=$e.properties.title.replace(/\s+/g,"");l=l+"_Pins",pA.innerHTML=`<div><span>comment:</span>${r}</div><div><span>type:</span>${n}</div><div><span>coordinates:</span>${s}</div>`,fetch("https://publictwin.info/digital_maquette/php_scripts/save_pin.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`note=${encodeURIComponent(r)}&type=${encodeURIComponent(n)}&coordinates=${encodeURIComponent(s)}&table=${encodeURIComponent(l)}`}).then(c=>c.text()).then(c=>{}).catch(c=>{console.error("Error:",c)}),Kn.remove(),va.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible"),document.getElementById("dropPinButton").style.backgroundColor="#8f8f8f";try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch{}},!0),document.getElementById("exitPinDropping").addEventListener("click",function(){Kn.remove(),va.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible"),document.getElementById("dropPinButton").style.backgroundColor="#8f8f8f";let r=[];r.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),r.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),r.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),r.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),M0(r);try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch{}pA.innerHTML="click above button to start!"},!0)}function aze(){if(window.innerWidth<=768&&(document.getElementsByClassName("mobileParticipateButtonsDiv")[0].style.display="none"),$e)try{$e.properties.participatoryModuleActive==!0&&(B.getLayer("ParticipatoryActions")&&B.removeLayer("ParticipatoryActions"),B.getSource("ParticipatoryActions")&&B.removeSource("ParticipatoryActions"),Ro.remove())}catch{console.log("no participatory module")}Br=!0,_c.click(),Dt&&(Dt.style.display="none",Dt.style.visibility="hidden"),pA.innerHTML="position the pin on the map!";let i={zoom:16,pitch:0,bearing:0,center:[4.35878,52.00236828785361]};i.center=B.getCenter(),Ri(i),document.getElementById("dropPinButton").style.backgroundColor="#f9d235",va.setLngLat(B.getCenter()),va.addTo(B);const r=va.getLngLat();if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(e.lngLat.lng-r[0])>180;)r[0]+=e.lngLat.lng>r[0]?360:-360;Kn.setLngLat(r).setHTML(` 12110 <div class="participatePinPopupInputDiv">
12111 <label for="projectIdentifier"class=" boldPopUpPin inLine participatePinPopupInput"></label> 12112 <input type="hidden" id="projectIdentifier" class="PopUpInput participatePinPopupInput inLine" name="WSoA"> 12113 </div> 12114 12115 <div class="participatePinPopupInputDiv"> 12116 12117 12118 <label for="noteIdentifier" class="boldPopUpPin inLine participatePinPopupInput">identifier:</label> 12119 <input type="text" id="noteIdentifier" class="PopUpInput participatePinPopupInput inLine" placeholder="input user ID..." autocomplete="off" tabindex="-1"> 12120 </div> 12121 12122 <div class="participatePinPopupInputDiv"> 12123 12124 <label for="userType" class="boldPopUpPin inLine participatePinPopupInput">user:</label> 12125 12126 <select id="userType" class="PopUpInput participatePinPopupInput inLine"> 12127 <option value="student">student</option> 12128 <option value="visitor">visitor</option> 12129 <option value="resident">resident</option> 12130 </select> 12131 12132 </div> 12133 12134 <div class="participatePinPopupInputDiv"> 12135 12136 <label for="noteTopic" class="boldPopUpPin participatePinPopupInput inLine">topic:</label> 12137 12138 <select id="noteTopic" class="PopUpInput participatePinPopupInput inLine"> 12139 <option value="walkability" selected>walkability</option> 12140 <option value="transport">transport</option> 12141 <option value="environment">environment</option> 12142 <option value="social">social</option> 12143 </select> 12144 12145 </div> 12146 12147 12148 <div class="participatePinPopupInputDiv increaseMarginTop" id="noteProblemSelectionDiv"> 12149 <label for="noteProblem" class="boldPopUpPin participatePinPopupInput inLine">problem:</label> 12150 </div> 12151 12152 <div class="participatePinPopupInputDiv" id="noteProblemOptionsDiv"> 12153 <div class="PopUpInput100"> 12154 <select id="noteProblem" class="PopUpInput100 participatePinPopupInput inLine"> 12155 <option value="poor-pavement-quality">Poor pavement quality</option> 12156 <option value="poor-street-lighting">Poor street lighting</option> 12157 <option value="stray-dogs">Stray dogs</option> 12158 <option value="noise-from-traffic">Noise from traffic</option> 12159 <option value="danger-at-night">Danger at night</option> 12160 <option value="obstructions-litter">Obstructions & litter</option> 12161 <option value="lack-of-shaded-areas">Lack of shaded areas</option> 12162 <option value="lack-of-wheelchair-ramps">Lack of wheelchair ramps</option> 12163 </select> 12164 </div> 12165 </div> 12166 12167 <div class="participatePinPopupInputDiv"> 12168 <label for="noteProblemRating" class="boldPopUpPin participatePinPopupInput inLine">rating:</label> 12169 </div> 12170 12171 <div class="PopUpInput100 increaseMarginBottom"> 12172 <input type="range" id="noteProblemRating" class="noteSlider" min="1" max="5" value="3" step="1"/> 12173 <div class="noteSliderLegend"> 12174 <span>1</span> 12175 <span>2</span> 12176 <span>3</span> 12177 <span>4</span> 12178 <span>5</span> 12179 </div> 12180 </div> 12181 12182 12183 <button id="finishPinDroppingCardiff" class="enterButton ideaButton clickableButton smallPopUpButton">submit!</button> 12184 <button id="exitPinDroppingCardiff" class="enterButton clickableButton smallPopUpButton">exit</button> 12185 `).addTo(B),document.getElementsByClassName("participatePinPopupInputDiv")[0].click(),document.getElementsByClassName("participatePinPopupInputDiv")[0].focus(),Kn._content.style.backgroundColor="#f6f6f6",Kn._content.style.boxShadow="2px 2px 5px #00000024, -2px -2px 5px #00000024",Kn._tip.style.display="none",document.getElementById("finishPinDroppingCardiff").addEventListener("click",function(){const n=document.getElementById("noteIdentifier").value,a=document.getElementById("userType").value,s=document.getElementById("noteTopic").value,o=document.getElementById("noteProblem").value,l=document.getElementById("noteProblemRating").value,c=va.getLngLat(),h=`${c.lng.toFixed(4)},${c.lat.toFixed(4)}`;pA.innerHTML=`<div><span>ID:</span>${n}</div><div><span>user type:</span>${a}</div><div><span>topic:</span>${s}</div><div><span>problem:</span>${o}</div><div><span>rating:</span>${l}</div><div><span>coordinates:</span>${h}</div>`;let d=$e.properties.title.replace(/\s+/g,"");if(d=d+"_Pins",pA.innerHTML=`<div><span>ID:</span>${n}</div><div><span>user type:</span>${a}</div><div><span>topic:</span>${s}</div><div><span>problem:</span>${o}</div><div><span>rating:</span>${l}</div><div><span>coordinates:</span>${h}</div>`,fetch("https://publictwin.info/digital_maquette/php_scripts/save_pinCardiff.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`identifier=${encodeURIComponent(n)}&usertype=${encodeURIComponent(a)}&topic=${encodeURIComponent(s)}&problem=${encodeURIComponent(o)}&rating=${encodeURIComponent(l)}&coordinates=${encodeURIComponent(h)}&table=${encodeURIComponent(d)}`}).then(f=>f.text()).then(f=>{window.innerWidth<=768&&(document.getElementsByClassName("mobileParticipateButtonsDiv")[0].style.display="block")}
12185).catch(f=>{console.error("Error:",f)}),Kn.remove(),va.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible"),document.getElementById("dropPinButton").style.backgroundColor="#8f8f8f",!(window.innerWidth<=768))try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch(f){console.log("loading participatory icons error:",f)}},!0),document.getElementById("exitPinDroppingCardiff").addEventListener("click",function(){window.innerWidth<=768&&(document.getElementsByClassName("mobileParticipateButtonsDiv")[0].style.display="block"),Kn.remove(),va.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible"),document.getElementById("dropPinButton").style.backgroundColor="#8f8f8f";try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch{}pA.innerHTML="click above button to start!"},!0),document.getElementById("noteTopic").addEventListener("change",function(){document.getElementById("noteProblemOptionsDiv").innerHTML="",document.getElementById("noteTopic").value=="walkability"?document.getElementById("noteProblemOptionsDiv").innerHTML=` 12186 <div class="PopUpInput100"> 12187 <select id="noteProblem" class="PopUpInput100 participatePinPopupInput inLine"> 12188 <option value="poor-pavement-quality">Poor pavement quality</option> 12189 <option value="poor-street-lighting">Poor street lighting</option> 12190 <option value="stray-dogs">Stray dogs</option> 12191 <option value="noise-from-traffic">Noise from traffic</option> 12192 <option value="danger-at-night">Danger at night</option> 12193 <option value="obstructions-litter">Obstructions & litter</option> 12194 <option value="lack-of-shaded-areas">Lack of shaded areas</option> 12195 <option value="lack-of-wheelchair-ramps">Lack of wheelchair ramps</option> 12196 </select> 12197 </div> 12198 `:document.getElementById("noteTopic").value=="transport"?document.getElementById("noteProblemOptionsDiv").innerHTML=` 12199 <div class="PopUpInput100"> 12200 <select id="noteProblem" class="PopUpInput100 participatePinPopupInput inLine"> 12201 <option value="traffic-levels-congestion">Traffic levels / congestion</option> 12202 <option value="delays-from-traffic">Delays from traffic</option> 12203 <option value="areas-of-high-risk">Areas of high risk</option> 12204 <option value="quality-of-public-transport">Quality of public transport</option> 12205 <option value="availability-of-public-transport">Availability of public transport</option> 12206 <option value="lack-of-cycle-paths">Lack of cycle paths</option> 12207 </select> 12208 </div> 12209 `:document.getElementById("noteTopic").value=="environment"?document.getElementById("noteProblemOptionsDiv").innerHTML=` 12210 <div class="PopUpInput100"> 12211 <select id="noteProblem" class="PopUpInput100 participatePinPopupInput inLine"> 12212 <option value="flooding-of-infrastructure">Flooding of infrastructure</option> 12213 <option value="lack-of-drainage">Lack of drainage</option> 12214 <option value="lack-of-green-space">Lack of green space</option> 12215 <option value="poor-water-quality">Poor water quality</option> 12216 <option value="lack-of-water-access">Lack of water access</option> 12217 <option value="blocked-waterways">Blocked waterways</option> 12218 <option value="lack-of-waste-management">Lack of waste management</option> 12219 <option value="poor-air-quality">Poor air quality</option 12220 </select> 12221 </div> 12222 `:document.getElementById("noteTopic").value=="social"&&(document.getElementById("noteProblemOptionsDiv").innerHTML=` 12223 <div class="PopUpInput100"> 12224 <select id="noteProblem" class="PopUpInput100 participatePinPopupInput inLine"> 12225 <option value="lack-of-seating-areas">Lack of seating areas</option> 12226 <option value="lack-of-play-spaces-for-children">Lack of play spaces for children</option> 12227 <option value="availability-of-public-facilities">Availability of public facilities</option> 12228 <option value="lack-of-affordable-shops">Lack of affordable shops</option> 12229 <option value="lack-of-affordable-cafes">Lack of affordable cafes</option> 12230 <option value="high-level-of-political-party-signage">High level of political party signage</option> 12231 <option value="lack-of-job-opportunities">Lack of job opportunities</option> 12232 </select> 12233 </div> 12234 `)})}async function sze(t){try{const i=await shp(t);B.addSource("shapefile-data",{type:"geojson",data:i}),B.addLayer({id:"shapefile-layer",type:"line",source:"shapefile-data",paint:{"line-color":"#d9d9d9","line-width":1.5,"line-opacity":.8}}),sh()}catch(i){console.error("Error loading shapefile:",i)}}function oze(){const t=va.getLngLat();Kn.setLngLat(t)}function lze(){const t=va.getLngLat();Kn.setLngLat(t),Kn._content.style.backgroundColor="#f6f6f6",Kn._c
12234ontent.style.boxShadow="2px 2px 5px #00000024, -2px -2px 5px #00000024",Kn._tip.style.display="none"}va.on("dragend",oze);va.on("drag",lze);document.getElementById("resultsPinButton").addEventListener("click",function(){if(document.getElementById("resultsPinButton").style.backgroundColor="#f9d235",$e)try{$e.properties.participatoryModuleActive==!0&&(B.getLayer("ParticipatoryActions")&&B.removeLayer("ParticipatoryActions"),B.getSource("ParticipatoryActions")&&B.removeSource("ParticipatoryActions"),Ro.remove())}catch{}Br=!0,_c.click(),Dt&&(Dt.style.display="none",Dt.style.visibility="hidden"),fetch("https://publictwin.info/digital_maquette/php_scripts/read_pin.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`table=${encodeURIComponent("DijkParkMasterplan_Pins")}`}).then(r=>r.json()).then(r=>{B.getLayer("resultsPin")&&B.removeLayer("resultsPin"),B.getSource("resultsPin")&&B.removeSource("resultsPin"),B.addSource("resultsPin",{type:"geojson",data:r}),B.addLayer({id:"resultsPin",type:"circle",source:"resultsPin",paint:{"circle-radius":{base:1.75,stops:[[12,10],[22,100]]},"circle-opacity":.65,"circle-stroke-width":1,"circle-stroke-color":"#000000","circle-color":["match",["get","type"],"general note","#ffffff","idea","#f9d235","opportunity","#f3e094","problem","#616161","#ccc"]}})}).catch(r=>{console.error("Error fetching data:",r)});let i=[];i.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),i.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),t$(i)});document.getElementById("resultsPinExitButton").addEventListener("click",function(){B.getLayer("resultsPin")&&B.removeLayer("resultsPin"),B.getSource("resultsPin")&&B.removeSource("resultsPin"),document.getElementById("resultsPinButton").style.backgroundColor="#8f8f8f";try{B.addSource("ParticipatoryActions",{type:"geojson",data:$e.properties.participatoryActions}),B.addLayer({id:"ParticipatoryActions",type:"symbol",source:"ParticipatoryActions",layout:{"icon-image":["case",["==",["get","status"],"inactive"],"participate",["==",["get","status"],"active"],"participate","participate"],"icon-size":.025,"icon-padding":0,"icon-allow-overlap":!0}})}catch{}ni.remove(),Br=!1,Dt&&(Dt.style.display="block",Dt.style.visibility="visible");let t=[];t.push(B.getLayer("3d-model-DijkPark-Masterplan").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Schemes").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Detailed").scene.children[3]),t.push(B.getLayer("3d-model-DijkPark-Assets").scene.children[3]),M0(t)});B.on("mouseenter","resultsPin",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer";const i=t.features[0].geometry.coordinates.slice();if(t.features[0].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;ni.setLngLat(i).setHTML(` 12235 <p><span class="boldPopUp">comment:</span><span>${t.features[0].properties.note}</span></p> 12236 <p><span class="boldPopUp">type:</span><span>${t.features[0].properties.type}</span></p> 12237 `).addTo(B),ni._content.style.setProperty("min-width","100px","important"),t.features[0].properties.type=="idea"?(ni._content.style.setProperty("background-color","#f9d235","important"),ni._tip.style.setProperty("border-top-color","#f9d235","important")):t.features[0].properties.type=="general note"?(ni._content.style.setProperty("background-color","#ffffff","important"),ni._tip.style.setProperty("border-top-color","#ffffff","important")):t.features[0].properties.type=="opportunity"?(ni._content.style.setProperty("background-color","#f3e094","important"),ni._tip.style.setProperty("border-top-color","#f3e094","important")):t.features[0].properties.type=="problem"?(ni._content.style.setProperty("background-color","#616161","important"),ni._tip.style.setProperty("border-top-color","#616161","important")):(ni._content.style.setProperty("background-color","#ccc","important"),ni._tip.style.setProperty("border-top-color","#ccc","important"))});B.on("touchend","resultsPin",t=>{if(!Ml){B.getCanvas().style.cursor="pointer";const i=t.features[0].geometry.coordinates.slice();if(t.features[0].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;ni.setLngLat(i).setHTML(` 12238 <p><span class="boldPopUp">comment:</span><span>${t.features[0].properties.note}</span></p> 12239 <p><span class="boldPopUp">type:</span><span>${t.features[0].properties.type}</span></p> 12240 `).addTo(B),ni._content.style.setProperty("min-width","100px","important"),t.features[0].properties.type=="idea"?(ni._content.style.setProperty("background-color","#f9d235","important"),ni._tip.style.setProperty("border-top-color","#f9d235","important")):t.features[0].properties.type=="general note"?(ni._content.style.setProperty("background-color","#ffffff","important"),ni._tip.style.setProperty("border-top-color","#ffffff","important")):t.features[0].properties.type=="opportunity"?(ni._content.style.setProperty("background-color","#f3e094","important"),ni._tip.style.setProperty("border-top-color","#f3e094","important")):t.features[0].properties.type=="problem"?(ni._content.style.setProperty("background-color","#616161","important"),ni._tip.style.setProperty("border-top-color","#616161","important")):(ni._content.style.setProperty("background-color","#ccc","important"),ni._tip.style.setProperty("border-top-color","#ccc","important"))}Ut=!0});B.on("mouseleave","resultsPin",()=>{Ut=!0,Cr=!1,B.getCanvas().style.cursor=""});B.on("mouseenter","resultsPinCardiff",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer";const i=t.features[0].geometry.coordinates.slice();if(t.features[0].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;ni.setLngLat(i).setHTML(` 12241 <p><span class="boldPopUp">topic:</span><span>${t.features[0].properties.topic}</span></p> 12242 <p><span class="boldPopUp">problem:</span><span>${t.features[0].properties.problem}</span></p> 12243 <p><span class="boldPopUp">rating:</span><span>${t.features[0].properties.rating}</span></p> 12244 `).addTo(B),ni._content.style.setProperty("min-width","100px","important"),t.features[0].properties.topic=="transport"?(ni._content.style.setProperty("background-color","#919191","important"),ni._tip.style.setProperty("border-top-color","#919191","important")):t.features[0].properties.topic=="walkability"?(ni._content.style.setProperty("background-color","#dadada","important"),ni._tip.style.setProperty("border-top-color","#dadada","important")):t.features[0].properties.topic=="environment"?(ni._content.style.setProperty("background-color","#82b03d","important"),ni._tip.style.setProperty("border-top-color","#82b03d","important")):t.features[0].properties.topic=="social"?(ni._content.style.setProperty("background-color","#f9d235","important"),ni._tip.style.setProperty("border-top-color","#f9d235","important")):(ni._content.style.setProperty("background-color","#ccc","important"),ni._tip.style.setProperty("border-top-color","#ccc","important"))});B.on("touchend","resultsPinCardiff",t=>{if(!Ml){B.getCanvas().style.cursor="pointer";const i=t.features[0].geometry.coordinates.slice();if(t.features[0].properties.description,["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;ni.setLngLat(i).setHTML(` 12245 <p><span class="boldPopUp">topic:</span><span>${t.features[0].properties.topic}</span></p> 12246 <p><span class="boldPopUp">problem:</span><span>${t.features[0].properties.problem}</span></p> 12247 <p><span class="boldPopUp">rating:</span><span>${t.features[0].properties.rating}</span></p> 12248 `).addTo(B),ni._content.style.setProperty("min-width","100px","important"),t.features[0].properties.topic=="transport"?(ni._content.style.setProperty("background-color","#919191","important"),ni._tip.style.setProperty("border-top-color","#919191","important")):t.features[0].properties.topic=="walkability"?(ni._content.style.setProperty("background-color","#dadada","important"),ni._tip.style.setProperty("border-top-color","#dadada","important")):t.features[0].properties.topic=="environment"?(ni._content.style.setProperty("background-color","#82b03d","important"),ni._tip.style.setProperty("border-top-color","#82b03d","important")):t.features[0].properties.topic=="social"?(ni._content.style.setProperty("background-color","#f9d235","important"),ni._tip.style.setProperty("border-top-color","#f9d235","important")):(ni._content.style.setProperty("background-color","#ccc","important"),ni._tip.style.setProperty("border-top-color","#ccc","important"))}Ut=!0});B.on("mouseleave","resultsPinCardiff",()=>{Ut=!0,Cr=!1,B.getCanvas().style.cursor=""});const cze=new vs({color:13684944,wireframe:!1,transparent:!0,opacity:.7,depthWrite:!1,depthTest:!0});new co({vertexShader:FE,fragmentShader:kE,uniforms:{lightDirection:{value:new we(1,1,1).normalize()},color:{value:new Kt(13684944)}},side:os});function t$(t){for(var i=0;i<t.length;i++)for(var r=0;r<t[i].children.length;r++)t[i].children[r].material=cze}function M0(t){for(var i=0;i<t.length;i++)for(var r=0;r<t[i].children.length;r++)t[i].children[r].material=t[i].children[r].defaultmaterial}B.on("mouseenter","beforeAndAfterPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",rh=t.features[0],Tn.unshift(t.features[0])});B.on("click","beforeAndAfterPoints",t=>{if(!(Tn.length>=2)){br.style.display="block",br.style.visibility="visible";const i=document.createElement("div"),r=document.createElement("button"),n=document.createElement("button");r.innerHTML="<span>existing.</span>",n.innerHTML="<span>imagine with UrbanistAI!</span>";
12248const a=document.createElement("div");r.className="clickableButton beforeAndAfterButton",n.className="clickableButton beforeAndAfterButton";const s=document.createElement("img");i.className="mediaGalleryBeforeAndAfter",s.src=rh.properties.beforeImage,s.className="mediaImageBeforeAndAfter flexGrow",i.appendChild(s),a.appendChild(r),a.appendChild(n),i.appendChild(a),a.className="buttonsDivBeforeAndAfter flexGrow",r.style.backgroundColor="#f9d235",r.addEventListener("click",function(){s.src=rh.properties.beforeImage,r.style.backgroundColor="#f9d235",n.style.backgroundColor="#d0d0d0"},!0),n.addEventListener("click",function(){s.src=rh.properties.afterImage,r.style.backgroundColor="#d0d0d0",n.style.backgroundColor="#f9d235"},!0),kn.appendChild(i)}},!0);B.on("touchstart","beforeAndAfterPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",rh=t.features[0],Tn.unshift(t.features[0])},!0);B.on("touchend","beforeAndAfterPoints",t=>{if(!(Tn.length>=2)){if(!Ml){B.getCanvas().style.cursor="pointer",rh=t.features[0],br.style.display="block",br.style.visibility="visible";const i=document.createElement("div"),r=document.createElement("button"),n=document.createElement("button");r.innerHTML="<span>existing.</span>",n.innerHTML="<span>imagine with UrbanistAI!</span>";const a=document.createElement("div");r.className="clickableButton beforeAndAfterButton",n.className="clickableButton beforeAndAfterButton";const s=document.createElement("img");i.className="mediaGalleryBeforeAndAfter",s.src=rh.properties.beforeImage,s.className="mediaImageBeforeAndAfter flexGrow",i.appendChild(s),a.appendChild(r),a.appendChild(n),i.appendChild(a),a.className="buttonsDivBeforeAndAfter flexGrow",r.style.backgroundColor="#f9d235",r.addEventListener("click",function(){s.src=rh.properties.beforeImage,r.style.backgroundColor="#f9d235",n.style.backgroundColor="#d0d0d0"},!0),n.addEventListener("click",function(){s.src=rh.properties.afterImage,r.style.backgroundColor="#d0d0d0",n.style.backgroundColor="#f9d235"},!0),kn.appendChild(i)}}Ut=!0,Cr=!1,Tn=[]},!0);B.on("mouseleave","beforeAndAfterPoints",()=>{B.getCanvas().style.cursor="",Ut=!0,Cr=!1,Tn=[]});function NT(){ji(16.5),document.getElementById("galleryButtonMenu").style.display="none";let t={zoom:Xr.properties.zoom,pitch:Xr.properties.pitch,bearing:Xr.properties.bearing,center:JSON.parse(Xr.properties.center)};Ri(t),br.style.display="none",br.style.visibility="hidden",kn.innerHTML="",br.style.display="block",br.style.visibility="visible";const i=document.createElement("div"),r=document.createElement("div");i.className="MediaAIGeneration columnFlex",r.className="PromptAIGeneration columnFlex";const n=document.createElement("button"),a=document.createElement("button");n.innerHTML='<span class="buttonTextAI"><img src="https://publictwin.info/digital_maquette/content/00_Icons/AIGenerate/resetAI.svg" class="buttonIconAI"></img>reset</span>',a.innerHTML='<span class="buttonTextAI"><img src="https://publictwin.info/digital_maquette/content/00_Icons/AIGenerate/saveAI.svg" class="buttonIconAI"></img> save to gallery</span>';const s=document.createElement("div");s.className="buttonsDivResetSave",n.className="clickableButton ResetSaveButton ResetButton",a.className="clickableButton ResetSaveButton SaveButton";const o=document.createElement("div");o.className="MarginDiv",s.appendChild(n),s.appendChild(o),s.appendChild(a),n.addEventListener("click",function(){c.src=Xr.properties.beforeImage,n.style.backgroundColor="#fef9e4",a.style.backgroundColor="#fef9e4";const ce=document.getElementsByClassName("ButtonsDiv01")[0],_e=document.getElementsByClassName("ButtonsDiv02")[0],me=document.getElementsByClassName("ButtonsDiv03")[0];for(var le=0;le<ce.children.length;le++)ce.children[le].style.backgroundColor="#fef9e4",ce.children[le].classList.add("blinking2");for(var le=0;le<_e.children.length;le++)_e.children[le].style.backgroundColor="#fef9e4";for(var le=0;le<me.children.length;le++)me.children[le].style.backgroundColor="#fef9e4";w0=null,E0=null,y0=null,uy=null,document.getElementsByClassName("ReimagineButton")[0].style.backgroundColor="#fef9e4";const De=document.getElementsByClassName("PromptInput")[0];De.value="",document.getElementsByClassName("PromptMessage")[0].innerHTML=""},!0),a.addEventListener("click",function(){jS&&(vze(),c.src=Xr.properties.afterImage,n.style.backgroundColor="#fef9e4",a.style.backgroundColor="#fef9e4",document.getElementsByClassName("AIgalleryButton")[0].style.opacity=1,document.getElementsByClassName("AIgenerateButton")[0].style.opacity=.5)},!0);const l=document.createElement("div");l.className="SelectedImageDiv";const c=document.createElement("img");c.src=Xr.properties.beforeImage,c.className="MediaSelectedImage",l.appendChild(c),l.addEventListener("click",function(){const ce=document.createElement("div");ce.className="EnlargeGalleryImageWrapper";const _e=document.createElement("div");_e.className="EnlargeGalleryImageDiv",ce.appendChild(_e);const me=document.createElement("button");
12248me.className="closeEnlargeGallery closeButton filterButton filterResetButton",ce.appendChild(me),_e.className="EnlargeGalleryImageDiv";const le=document.createElement("img");le.src="https://publictwin.info/digital_maquette/content/00_Icons/Close_Button.svg",le.className="mainMenuIcon arrowIcon",me.appendChild(le);const De=document.createElement("img");De.className="EnlargeGalleryImage",De.src=c.src;const Ve=document.createElement("div");Ve.className="ImageSizedDiv",_e.appendChild(Ve),Ve.appendChild(De),me.addEventListener("click",function(){ce.remove()}),document.getElementById("madiaGallery").appendChild(ce)});const h=document.createElement("div");h.className="OptionCover",h.innerHTML="ai generating...",l.appendChild(h),h.classList.add("CoverHidden");const u=document.createElement("div");u.className="OptionsDiv";const d=document.createElement("div");d.className="OptionDiv Option01";const A=document.createElement("img");A.src=Xr.properties.beforeImage,A.className="ImageOption",d.appendChild(A);const f=document.createElement("div");f.className="OptionCover",f.innerHTML="ai generating...",d.appendChild(f),f.classList.add("CoverHidden");const m=document.createElement("div");m.className="OptionDiv Option02";const g=document.createElement("img");g.src=Xr.properties.beforeImage,g.className="ImageOption",m.appendChild(g);const p=document.createElement("div");p.className="OptionCover",p.innerHTML="ai generating...",m.appendChild(p),p.classList.add("CoverHidden");const v=document.createElement("div");v.className="MarginDiv",u.appendChild(d),u.appendChild(v),u.appendChild(m),d.addEventListener("click",function(){Ep&&(SW("Option01"),A.style.opacity="100%",g.style.opacity="50%",jS=!0,d.children[0].classList.remove("blinking4"),document.getElementsByClassName("SaveButton")[0].style.backgroundColor="#f9d235")}),A.style.opacity="50%",m.addEventListener("click",function(){Ep&&(SW("Option02"),A.style.opacity="50%",g.style.opacity="100%",jS=!0,m.children[0].classList.remove("blinking4"),document.getElementsByClassName("SaveButton")[0].style.backgroundColor="#f9d235")}),g.style.opacity="50%";const _=document.createElement("div");_.className="HorizontalMarginDiv";const y=document.createElement("div");y.className="HorizontalMarginDiv",i.appendChild(u),i.appendChild(_),i.appendChild(l),i.appendChild(y),i.appendChild(s),XE=Xr.properties.AIPointNumber;const w=document.createElement("div");w.innerHTML=Xr.properties.title,w.className="PromptTitleDiv PromptTitles";const b=document.createElement("div");b.innerHTML="<span>select one option from each category</span> and reimagine selected neighborhood!",b.className="PromptDescriptionDiv";const E=document.createElement("div");E.className="PromptBuildingDiv";const M=document.createElement("div");M.className="TitleDiv PromptTitles",M.innerHTML="1: architectural style";const S=document.createElement("div");S.className="ButtonsDiv ButtonsDiv01";const T=document.createElement("button");T.className="PromptOptionsButton clickableButton ",T.innerHTML="traditional",T.classList.add("blinking2"),T.addEventListener("click",function(){Ss(T.innerHTML,"style")});const C=document.createElement("button");C.className="PromptOptionsButton clickableButton ",C.innerHTML="modern",C.classList.add("blinking2"),C.addEventListener("click",function(){Ss(C.innerHTML,"style")});const x=document.createElement("button");x.className="PromptOptionsButton clickableButton",x.innerHTML="organic",x.classList.add("blinking2"),x.addEventListener("click",function(){Ss(x.innerHTML,"style")});const R=document.createElement("button");R.className="PromptOptionsButton clickableButton",R.innerHTML="futuristic",R.classList.add("blinking2"),R.addEventListener("click",function(){Ss(R.innerHTML,"style")});const L=document.createElement("button");L.className="PromptOptionsButton clickableButton",L.innerHTML="natural",L.classList.add("blinking2"),L.addEventListener("click",function(){Ss(L.innerHTML,"style")}),S.appendChild(T),S.appendChild(C),S.appendChild(x),S.appendChild(R),S.appendChild(L),E.appendChild(M),E.appendChild(S);const I=document.createElement("div");I.className="PromptBuildingDiv";const F=document.createElement("div");F.className="TitleDiv PromptTitles",F.innerHTML="2: place type";const Y=document.createElement("div");Y.className="ButtonsDiv ButtonsDiv02";const D=document.createElement("button");D.className="PromptOptionsButton clickableButton",D.innerHTML="residential",D.addEventListener("click",function(){Ss(D.innerHTML,"place")});const U=document.createElement("button");U.className="PromptOptionsButton clickableButton",U.innerHTML="commercial",U.addEventListener("click",function(){Ss(U.innerHTML,"place")});const j=document.createElement("button");j.className="PromptOptionsButton clickableButton",j.innerHTML="public space",j.addEventListener("click",function(){Ss(j.innerHTML,"place")});
12248const J=document.createElement("button");J.className="PromptOptionsButton clickableButton",J.innerHTML="cultural",J.addEventListener("click",function(){Ss(J.innerHTML,"place")});const z=document.createElement("button");z.className="PromptOptionsButton clickableButton",z.innerHTML="green park",z.addEventListener("click",function(){Ss(z.innerHTML,"place")}),Y.appendChild(D),Y.appendChild(U),Y.appendChild(j),Y.appendChild(J),Y.appendChild(z);const $=document.createElement("div");$.className="PromptBuildingDiv";const te=document.createElement("div");te.className="TitleDiv PromptTitles",te.innerHTML="3: unique feature";const ae=document.createElement("div");ae.className="ButtonsDiv ButtonsDiv03";const ve=document.createElement("button");ve.className="PromptOptionsButton clickableButton",ve.innerHTML=Xr.properties.featurePrompts1,ve.addEventListener("click",function(){Ss(ve.innerHTML,"feature")});const oe=document.createElement("button");oe.className="PromptOptionsButton clickableButton",oe.innerHTML=Xr.properties.featurePrompts2,oe.addEventListener("click",function(){Ss(oe.innerHTML,"feature")});const K=document.createElement("button");K.className="PromptOptionsButton clickableButton",K.innerHTML=Xr.properties.featurePrompts3,K.addEventListener("click",function(){Ss(K.innerHTML,"feature")});const X=document.createElement("button");X.className="PromptOptionsButton clickableButton",X.innerHTML=Xr.properties.featurePrompts4,X.addEventListener("click",function(){Ss(X.innerHTML,"feature")});const N=document.createElement("button");N.className="PromptOptionsButton clickableButton",N.innerHTML=Xr.properties.featurePrompts5,N.addEventListener("click",function(){Ss(N.innerHTML,"feature")}),ae.appendChild(ve),ae.appendChild(oe),ae.appendChild(K),ae.appendChild(X),ae.appendChild(N),E.appendChild(M),E.appendChild(S),I.appendChild(F),I.appendChild(Y),$.appendChild(te),$.appendChild(ae);const k=document.createElement("div");k.className="PromptBuildingDiv";const Z=document.createElement("div");Z.className="TitleDiv PromptTitles ExtraTitle",Z.innerHTML="free text vision:";const V=document.createElement("textarea");V.className="PromptInput",V.placeholder="type your own imaginative idea here... this might take up to 40s.",V.addEventListener("input",function(){const ce=document.getElementsByClassName("ButtonsDiv01")[0],_e=document.getElementsByClassName("ButtonsDiv02")[0],me=document.getElementsByClassName("ButtonsDiv03")[0];for(var le=0;le<ce.children.length;le++)ce.children[le].style.backgroundColor="#fef9e4";for(var le=0;le<_e.children.length;le++)_e.children[le].style.backgroundColor="#fef9e4";for(var le=0;le<me.children.length;le++)me.children[le].style.backgroundColor="#fef9e4";w0=null,E0=null,y0=null,Ae.innerHTML=""}),V.autocomplete="off",k.appendChild(Z),k.appendChild(V);const re=document.createElement("div");re.className="SendPrompt";const Ae=document.createElement("div");Ae.className="PromptMessage",Ae.innerHTML="";const pe=document.createElement("button");pe.className="clickableButton ReimagineButton",pe.innerHTML='<span class="buttonTextAI"><img src="https://publictwin.info/digital_maquette/content/00_Icons/AIGenerate/reimagineAI.svg" class="buttonIconAI"></img>reimagine!</span>',pe.addEventListener("click",function(){hze()}),re.appendChild(Ae),re.appendChild(pe),r.appendChild(w),r.appendChild(b),r.appendChild(E),r.appendChild(I),r.appendChild($),r.appendChild(k),r.appendChild(re),kn.appendChild(i),kn.appendChild(r)}function hze(){const t=document.getElementsByClassName("PromptInput")[0];if(t.value==""?uy=null:uy=t.value,uy)if(pO="textinput",uze(),_J<650){for(var i=0;i<document.getElementsByClassName("OptionCover").length;i++)document.getElementsByClassName("OptionCover")[i].classList.remove("CoverHidden");document.getElementsByClassName("PromptMessage")[0].innerHTML="running an API based AI generation...",TGe()}else document.getElementsByClassName("PromptMessage")[0].innerHTML="<span>we are out</span> of AI generation tokens...";else if(!E0||!y0||!w0)document.getElementsByClassName("PromptMessage")[0].innerHTML="please select an option from each category!";
12248else if(x_=x_.split(" ").join("_"),R_=R_.split(" ").join("_"),Gf=Gf.split(" ").join("_"),_W=`/public_html/digital_maquette/content/Malmo_Nyhamnen/UrbanistAI/PrecomputedOptions/${XE}/${x_}/${R_}/${Gf}/`,G2=x_+R_+Gf,G2==vW)document.getElementsByClassName("PromptMessage")[0].innerHTML="please select a new prompt...";else{pO="buttonsinput",document.getElementsByClassName("PromptMessage")[0].innerHTML="running an AI generation...";for(var i=0;i<document.getElementsByClassName("OptionCover").length;i++)document.getElementsByClassName("OptionCover")[i].classList.remove("CoverHidden");vW=G2,setTimeout(()=>{try{T5e=pze(_W),Ep=!0}catch{}},"1900"),setTimeout(()=>{for(var r=0;r<document.getElementsByClassName("OptionCover").length;r++)document.getElementsByClassName("OptionCover")[r].classList.add("CoverHidden")},"2500")}}async function uze(){const t="https://publictwin.info/digital_maquette/php_scripts/updateUrbanistAICalls.php";try{const i=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"}});if(!i.ok){console.error("Failed to fetch:",i.status,i.statusText);return}const r=await i.json();r.success?(console.log("Updated Clicks Number:",r.updatedClicksNumber),_J=r.updatedClicksNumber):console.error("Error from server:",r.error)}catch(i){console.error("Error making request:",i)}}function Ss(t,i){const r=document.getElementsByClassName("ButtonsDiv01")[0],n=document.getElementsByClassName("ButtonsDiv02")[0],a=document.getElementsByClassName("ButtonsDiv03")[0];if(i=="style")for(var s=0;s<r.children.length;s++)t==r.children[s].innerHTML?(r.children[s].style.backgroundColor="#f9d235",y0=r.children[s].innerHTML,document.getElementsByClassName("PromptInput")[0].value="",r.children[s].classList.remove("blinking2"),x_=r.children[s].innerHTML):(r.children[s].style.backgroundColor="#fef9e4",r.children[s].classList.remove("blinking2"));else if(i=="place")for(var s=0;s<n.children.length;s++)t==n.children[s].innerHTML?(n.children[s].style.backgroundColor="#f9d235",E0=n.children[s].innerHTML,document.getElementsByClassName("PromptInput")[0].value="",R_=n.children[s].innerHTML):n.children[s].style.backgroundColor="#fef9e4";else if(i=="feature")for(var s=0;s<a.children.length;s++)t==a.children[s].innerHTML?(a.children[s].style.backgroundColor="#f9d235",w0=a.children[s].innerHTML,document.getElementsByClassName("PromptInput")[0].value="",Gf=a.children[s].innerHTML,a.children[s].innerHTML=="arts + culture"&&(Gf="arts and culture"),a.children[s].innerHTML=="3dprinted houses"&&(Gf="3d printed houses")):a.children[s].style.backgroundColor="#fef9e4";!E0||!y0||!w0?document.getElementsByClassName("ReimagineButton")[0].style.backgroundColor="#fef9e4":(document.getElementsByClassName("ReimagineButton")[0].style.backgroundColor="#f9d235",document.getElementsByClassName("PromptMessage")[0].innerHTML="")}B.on("mouseenter","AIPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",Xr=t.features[0],Tn.unshift(t.features[0])});B.on("click","AIPoints",t=>{if(!(Tn.length>=2)){if(Bi.click(),Jr.innerHTML="⢠Imagine the future with AI! â¢",Ao.innerHTML="With the help of AI you can help us re-imagine how the areas of Malmo will look 25 years into the future. You have influence over areas indicated in the image. After generating an idea you can either <span>save to gallery</span> or <span>reset</span> the process.",Hs.src="https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_2_DIJK_PARK_LANE-ezgif.com-video-to-gif-converter.gif",Ps==null){Ps=document.createElement("div"),Ps.className="mainMasterplanMenuSegment",OM=!0;const i=document.createElement("button"),r=document.createElement("button");i.innerHTML="<span>open gallery</span>",r.innerHTML="<span>open reimagine</span>",i.className="blockDisplay buttonCenter filterButton filterResetButton activeProject clickableButton AIgalleryButton",r.className="blockDisplay buttonCenter filterButton filterResetButton activeProject clickableButton AIgenerateButton",Ps.append(i),Ps.append(r),yi.appendChild(Ps),i.addEventListener("click",function(){XM(XE,qE),i.style.opacity=1,r.style.opacity=.5},!0),r.addEventListener("click",function(){NT(),Ep=!1,i.style.opacity=.5,r.style.opacity=1},!0),i.style.opacity=.5,r.style.opacity=1}NT()}},!0);B.on("touchstart","AIPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",Xr=t.features[0],Tn.unshift(t.features[0])},!0);B.on("touchend","AIPoints",t=>{if(!(Tn.length>=2)){if(!Ml){if(B.getCanvas().style.cursor="pointer",Xr=t.features[0],Bi.click(),Jr.innerHTML="⢠Imagine the future! â¢",Ao.innerHTML="With the help of AI you can help us re-imagine how the areas of Malmo will look 25 years into the future. You have influence over areas indicated in the image. After generating an idea you can either <span>save to gallery</span> or <span>reset</span> the process.",Hs.src="https://publictwin.info/digital_maquette/content/Dijk_Park_Masterplan/BeforeAndAfter/VIEW_2_DIJK_PARK_LANE-ezgif.com-video-to-gif-converter.gif",Ps==null){Ps=document.createElement("div"),Ps.className="mainMasterplanMenuSegment",OM=!0;const i=document.createElement("button"),r=document.createElement("button");i.innerHTML="<span>open gallery</span>",r.innerHTML="<span>open reimagine</span>",i.className="blockDisplay buttonCenter filterButton filterResetButton activeProject clickableButton AIgalleryButton",r.className="blockDisplay buttonCenter filterButton filterResetButton activeProject clickableButton AIgenerateButton",Ps.append(i),Ps.append(r),yi.appendChild(Ps),i.addEventListener("click",function(){XM(XE,qE),i.style.opacity=1,r.style.opacity=.5},!0),r.addEventListener("click",function(){NT(),Ep=!1,i.style.opacity=.5,r.style.opacity=1},!0),i.style.opacity=.5,r.style.opacity=1}NT()}}Ut=!0,Cr=!1,Tn=[]},!0);B.on("mouseleave","AIPoints",()=>{B.getCanvas().style.cursor="",Ut=!0,Cr=!1,Tn=[]});B.on("mouseenter","beltPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",t.features[0],Tn.unshift(t.features[0]);const i=t.features[0].geometry.coordinates.slice();t.features[0].properties.description;const r=t.features[0];if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;bJ.setLngLat(i).setHTML(`<h3>${r.properties.title}</h3> 12249 <p><span>${r.properties.description}</span></p> 12250 `).addTo(B);const n=document.querySelector(".mapboxgl-popup-content"),a=document.querySelector(".mapboxgl-popup-tip");r.properties.icon==="greenPoints"?(n.classList.add("greenPoints"),a.classList.add("greenPoints"),n.classList.remove("waterPoints"),a.classList.remove("waterPoints")):r.properties.icon==="waterPoints"&&(n.classList.add("waterPoints"),a.classList.add("waterPoints"),n.classList.remove("greenPoints"),a.classList.remove("greenPoints"))});B.on("touchend","beltPoints",t=>{if(!Ml){B.getCanvas().style.cursor="pointer",Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",t.features[0],Tn.unshift(t.features[0]);const i=t.features[0].geometry.coordinates.slice();t.features[0].properties.description;const r=t.features[0];if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;bJ.setLngLat(i).setHTML(`<h3>${r.properties.title}</h3> 12251 <p><span>${r.properties.description}</span></p> 12252 `).addTo(B);const n=document.querySelector(".mapboxgl-popup-content"),a=document.querySelector(".mapboxgl-popup-tip");r.properties.icon==="greenPoints"?(n.classList.add("greenPoints"),a.classList.add("greenPoints"),n.classList.remove("waterPoints"),a.classList.remove("waterPoints")):r.properties.icon==="waterPoints"&&(n.classList.add("waterPoints"),a.classList.add("waterPoints"),n.classList.remove("greenPoints"),a.classList.remove("greenPoints"))}Ut=!0,Cr=!1,Tn=[]},!0);B.on("mouseleave","beltPoints",()=>{B.getCanvas().style.cursor="",Ut=!0,Cr=!1,Tn=[]});B.on("mouseenter","informPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer";const i=t.features[0].geometry.coordinates.slice();t.features[0].properties.description;const r=t.features[0];if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;RT.setLngLat(i).setHTML(`<h3>${r.properties.title}</h3> 12253 <p><span class="boldPopUp">description:</span><span>${r.properties.description}</span></p> 12254 <p><span class="boldPopUp">dates:</span><span>${r.properties.dates}</span></p> 12255 <button id="zoomInButton-${r.properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">zoom in!</button>`).addTo(B);const n=document.querySelector(".mapboxgl-popup-content"),a=document.querySelector(".mapboxgl-popup-tip"),s=document.getElementById(`zoomInButton-${r.properties.title.replace(/\s+/g,"-")}`);s&&s.addEventListener("click",()=>{RT.remove();let o={zoom:r.properties.zoom,pitch:r.properties.pitch,bearing:r.properties.bearing,center:JSON.parse(r.properties.center)};ji(r.properties.zoom),Ri(o),Yg(participateButton)}),r.properties.status==="inactive"?(n.classList.add("maquetteInDevelopment"),a.classList.add("maquetteInDevelopment"),n.classList.remove("activeMaquette"),a.classList.remove("activeMaquette")):r.properties.status==="active"&&(n.classList.add("activeMaquette"),a.classList.add("activeMaquette"),n.classList.remove("maquetteInDevelopment"),a.classList.remove("maquetteInDevelopment"))});B.on("touchend","informPoints",t=>{if(!Ml){B.getCanvas().style.cursor="pointer";const i=t.features[0].geometry.coordinates.slice();t.features[0].properties.description;const r=t.features[0];if(["mercator","equirectangular"].includes(B.getProjection().name))for(;Math.abs(t.lngLat.lng-i[0])>180;)i[0]+=t.lngLat.lng>i[0]?360:-360;RT.setLngLat(i).setHTML(`<h3>${r.properties.title}</h3> 12256 <p><span class="boldPopUp">description:</span><span>${r.properties.description}</span></p> 12257 <p><span class="boldPopUp">dates:</span><span>${r.properties.dates}</span></p> 12258 <button id="zoomInButton-${r.properties.title.replace(/\s+/g,"-")}" class="enterButton clickableButton">zoom in!</button>`).addTo(B);const n=document.querySelector(".mapboxgl-popup-content"),a=document.querySelector(".mapboxgl-popup-tip"),s=document.getElementById(`zoomInButton-${r.properties.title.replace(/\s+/g,"-")}`);s&&s.addEventListener("click",()=>{RT.remove();let o={zoom:r.properties.zoom,pitch:r.properties.pitch,bearing:r.properties.bearing,center:JSON.parse(r.properties.center)};ji(r.properties.zoom),Ri(o),Yg(s)}),r.properties.status==="inactive"?(n.classList.add("maquetteInDevelopment"),a.classList.add("maquetteInDevelopment"),n.classList.remove("activeMaquette"),a.classList.remove("activeMaquette")):r.properties.status==="active"&&(n.classList.add("activeMaquette"),a.classList.add("activeMaquette"),n.classList.remove("maquetteInDevelopment"),a.classList.remove("maquetteInDevelopment"))}Ut=!0,Cr=!1,Tn=[]});B.on("mouseleave","informPoints",()=>{Ut=!0,Cr=!1,B.getCanvas().style.cursor=""});B.on("mouseenter","panoramaPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",Wg=t.features[0],Tn.unshift(t.features[0])});B.on("mouseleave","panoramaPoints",()=>{Ut=!0,Cr=!1,B.getCanvas().style.cursor="",Tn=[]});B.on("touchstart","panoramaPoints",t=>{Ut=!1,Cr=!0,B.getCanvas().style.cursor="pointer",rh=t.features[0],Tn.unshift(t.features[0])});B.on("click","panoramaPoints",t=>{const i=document.createElement("div");i.className="mediaGalleryBeforeAndAfter";const r=document.createElement("div");r.id="panoramaDiv",r.className="mediaImageBeforeAndAfter flexGrow panoDiv",i.appendChild(r),kn.appendChild(i);const n=document.createElement("button"),a=document.createElement("button");n.innerHTML="<span>before!</span>",a.innerHTML="<span>after!</span>";
12258const s=document.createElement("div");n.className="clickableButton beforeAndAfterButton",a.className="clickableButton beforeAndAfterButton",s.appendChild(n),s.appendChild(a),i.appendChild(s),s.className="buttonsDivBeforeAndAfter flexGrow",n.style.backgroundColor="#f9d235";const o=new mo,l=new Rr(75,r.clientWidth/r.clientHeight,.1,1e3);l.position.z=.1;const c=new Qs;c.setSize(r.clientWidth,r.clientHeight),r.appendChild(c.domElement);const h=new QT(500,60,40);h.scale(-1,1,1);const u=new LO,d=u.load(Wg.properties.beforeImage),A=u.load(Wg.properties.afterImage);let f=new GT({map:d});const m=new Kr(h,f);o.add(m);const g=new A9(l,c.domElement);g.enableZoom=!1,g.enablePan=!1,g.maxPolarAngle=Math.PI,g.minPolarAngle=0,g.update(),br.style.display="block",br.style.visibility="visible",n.addEventListener("click",function(){f.map=d,f.needsUpdate=!0,n.style.backgroundColor="#f9d235",a.style.backgroundColor="#d0d0d0"},!0),a.addEventListener("click",function(){f.map=A,f.needsUpdate=!0,n.style.backgroundColor="#d0d0d0",a.style.backgroundColor="#f9d235"},!0);function p(){const y=r.clientWidth,w=r.clientHeight;c.setSize(y,w),l.aspect=y/w,l.updateProjectionMatrix()}window.addEventListener("resize",p),new ResizeObserver(()=>{p()}).observe(r);function _(){requestAnimationFrame(_),g.update(),c.render(o,l)}_()},!0);B.on("touchend","panoramaPoints",t=>{if(!Ml){let p=function(){const y=r.clientWidth,w=r.clientHeight;c.setSize(y,w),l.aspect=y/w,l.updateProjectionMatrix()},_=function(){requestAnimationFrame(_),g.update(),c.render(o,l)};Wg=t.features[0];const i=document.createElement("div");i.className="mediaGalleryBeforeAndAfter";const r=document.createElement("div");r.id="panoramaDiv",r.className="mediaImageBeforeAndAfter flexGrow panoDiv",i.appendChild(r),kn.appendChild(i);const n=document.createElement("button"),a=document.createElement("button");n.innerHTML="<span>before!</span>",a.innerHTML="<span>after!</span>";
12258const s=document.createElement("div");n.className="clickableButton beforeAndAfterButton",a.className="clickableButton beforeAndAfterButton",s.appendChild(n),s.appendChild(a),i.appendChild(s),s.className="buttonsDivBeforeAndAfter flexGrow",n.style.backgroundColor="#f9d235";const o=new mo,l=new Rr(75,r.clientWidth/r.clientHeight,.1,1e3);l.position.z=.1;const c=new Qs;c.setSize(r.clientWidth,r.clientHeight),r.appendChild(c.domElement);const h=new QT(500,60,40);h.scale(-1,1,1);const u=new LO,d=u.load(Wg.properties.beforeImage),A=u.load(Wg.properties.afterImage);let f=new GT({map:d});const m=new Kr(h,f);o.add(m);const g=new A9(l,c.domElement);g.enableZoom=!1,g.enablePan=!1,g.maxPolarAngle=Math.PI,g.minPolarAngle=0,g.update(),br.style.display="block",br.style.visibility="visible",n.addEventListener("click",function(){f.map=d,f.needsUpdate=!0,n.style.backgroundColor="#f9d235",a.style.backgroundColor="#d0d0d0"},!0),a.addEventListener("click",function(){f.map=A,f.needsUpdate=!0,n.style.backgroundColor="#d0d0d0",a.style.backgroundColor="#f9d235"},!0),window.addEventListener("resize",p),new ResizeObserver(()=>{p()}).observe(r),_()}Ut=!0,Cr=!1,Tn=[]},!0);Vg.addEventListener("click",function(){Vg.active=="active"&&dze()});function dze(){navigator.geolocation&&navigator.geolocation.getCurrentPosition(t=>{const i=t.coords.longitude,r=t.coords.latitude;B.flyTo({center:[i,r],zoom:14}),new mapboxgl.Marker().setLngLat([i,r]).setPopup(new mapboxgl.Popup().setHTML("<h3>You are here!</h3>")).addTo(B)},t=>{console.error("Error getting location",t)})}let q2,Z2,UT=!1,lE=!1;function $s(){clearTimeout(q2),UT?q2=setTimeout(()=>{n3.style.display="block",lE=!0},25e3):q2=null}function Xm(){clearTimeout(Z2),lE?Z2=setTimeout(()=>{lE&&GJ.click()},5e3):Z2=null}function Aze(){UT||(window.addEventListener("mousemove",$s),window.addEventListener("keydown",$s),window.addEventListener("click",$s),window.addEventListener("scroll",$s),window.addEventListener("touchstart",$s),window.addEventListener("touchmove",$s),window.addEventListener("mousemove",Xm),window.addEventListener("keydown",Xm),window.addEventListener("click",Xm),window.addEventListener("scroll",Xm),window.addEventListener("touchstart",Xm),window.addEventListener("touchmove",Xm),$s(),UT=!0)}function fze(){window.removeEventListener("mousemove",$s),window.removeEventListener("keydown",$s),window.removeEventListener("click",$s),window.removeEventListener("scroll",$s),window.removeEventListener("touchstart",$s),window.removeEventListener("touchmove",$s),UT=!1,$s()}const pze=async t=>{const r=`https://publictwin.info/digital_maquette/php_scripts/getFileNames.php?target_dir=${encodeURIComponent(t)}`;try{const a=await(await fetch(r)).json();if(Array.isArray(a))return gze(a),document.getElementsByClassName("Option02")[0].children[0].classList.add("blinking4"),document.getElementsByClassName("Option01")[0].children[0].classList.add("blinking4"),a;a.error?console.error("Error:",a.error):console.error("Unexpected response:",a)}catch(n){console.error("Fetch Error:",n)}};function mze(t,i){if(t=Math.ceil(t),i=Math.floor(i),i-t<1)throw new Error("Range must include at least two different integers.");const r=Math.floor(Math.random()*(i-t+1))+t;let n;do n=Math.floor(Math.random()*(i-t+1))+t;while(n===r);return[r,n]}function gze(t){cS=mze(0,t.length-1),console.log(cS);let i=t[cS[0]],r=t[cS[1]];i=i.replace("/public_html/digital_maquette/",""),r=r.replace("/public_html/digital_maquette/",""),document.getElementsByClassName("OptionDiv")[0].children[0].src="https://publictwin.info/digital_maquette/"+i,document.getElementsByClassName("OptionDiv")[1].children[0].src="https://publictwin.info/digital_maquette/"+r,document.getElementsByClassName("OptionDiv")[0].click()}function SW(t){document.getElementsByClassName("SelectedImageDiv")[0].children[0].src=document.getElementsByClassName(t)[0].children[0].src,xT=document.getElementsByClassName("SelectedImageDiv")[0].children[0].src,mO=xT.replace("https://publictwin.info/digital_maquette/","/public_html/digital_maquette/")}function vze(){EW=mO.replace("PrecomputedOptions","SelectedOptions"),zf=xT.replace("PrecomputedOptions","SelectedOptions"),pO=="buttonsinput"?(_ze(mO,EW),n_=yze(xT),i$(zf,n_.image,n_.style,n_.place,n_.feature,"buttonsbased")):(zf=document.getElementsByClassName("SelectedImageDiv")[0].children[0].src,Eze(zf))}const _ze=async(t,i)=>{const n=`https://publictwin.info/digital_maquette/php_scripts/moveFile.php?source=${encodeURIComponent(t)}&target=${encodeURIComponent(i)}`;try{(await(await fetch(n)).json()).success}catch{}};async function i$(t,i,r,n,a,s){const o={httpadress:t,selectedImage:i,selectedStyle:r,selectedPlace:n,selectedFeature:a,generationType:s};try{(await(await fetch("https://publictwin.info/digital_maquette/php_scripts/saveImageToDatabase.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)})).json()).success&&XM(XE,qE)}catch{}}function yze(t){try{const i=t.split("/");if(i.length<10)throw new Error("Invalid URL structure");const r=i[8],n=i[9],a=i[10],s=i[11];return{image:r,style:n,place:a,feature:s}}catch(i){return console.error(i.message),null}}function XM(t,i,r="default"){fetch(`https://publictwin.info/digital_maquette/php_scripts/getGallery.p
12258hp?selectedImage=${encodeURIComponent(t)}&ImagesFilter=${encodeURIComponent(r)}`).then(n=>n.text()).then(n=>JSON.parse(n)).then(n=>{vu=n,jf(t,i);const a=document.getElementsByClassName("DateGalleryFilter")[0],s=document.getElementsByClassName("LikesGalleryFilter")[0];a.addEventListener("click",function(){CW(t,i,r="default"),vu.sort((o,l)=>new Date(l.created)-new Date(o.created)),jf(t,i,!1,!0),document.getElementsByClassName("DateGalleryFilter")[0].style.backgroundColor="#f9d235",document.getElementsByClassName("LikesGalleryFilter")[0].style.backgroundColor="#fef9e4"}),s.addEventListener("click",function(){CW(t,i,r="likes"),vu.sort((o,l)=>l.likes-o.likes),jf(t,i,!1,!0),document.getElementsByClassName("DateGalleryFilter")[0].style.backgroundColor="#fef9e4",document.getElementsByClassName("LikesGalleryFilter")[0].style.backgroundColor="#f9d235"})}).catch(n=>{console.error("Error fetching gallery data:",n)})}function CW(t,i,r="default"){fetch(`https://publictwin.info/digital_maquette/php_scripts/getGallery.php?selectedImage=${encodeURIComponent(t)}&ImagesFilter=${encodeURIComponent(r)}`).then(n=>n.text()).then(n=>JSON.parse(n)).then(n=>{vu=n}).catch(n=>{console.error("Error fetching gallery data:",n)})}function jf(t,i,r=!1,n=!1){if(r)Af=document.querySelector(".GalleryImagesDiv");else{br.style.display="none",br.style.visibility="hidden",kn.innerHTML="",br.style.display="block",br.style.visibility="visible";const s=document.createElement("div");s.className="AIGallery",kn.appendChild(s);const o=document.createElement("div");o.className="GalleryControllsDiv",s.appendChild(o);const l=document.createElement("div");t=="all"?l.innerHTML="Main Gallery":l.innerHTML=Xr.properties.title,l.className="GalleryTitleDiv PromptTitles PromptTitleDiv";const c=document.createElement("button"),h=document.createElement("button");c.innerHTML="<span>sort creations by date:</span>",h.innerHTML="<span>sort creations by likes:</span>",c.className="clickableButton GalleryFilterButton DateGalleryFilter",h.className="clickableButton GalleryFilterButton LikesGalleryFilter";const u=document.createElement("div");u.className="MarginDiv";const d=document.createElement("div");d.className="GalleryDescriptionDiv PromptDescriptionDiv",d.innerHTML="here you are able to <span>view and like other imaginative creations!</span> click on the buttons above to sort the creations, and the like buttons to show your appreciation!";const A=document.createElement("div");A.className="GalleryFilterButtonsDiv",A.appendChild(c),A.appendChild(u),A.appendChild(h),o.appendChild(l),o.appendChild(A),o.appendChild(d),c.addEventListener("click",function(){vu.sort((f,m)=>new Date(m.created)-new Date(f.created)),jf(t,i,!1,!0),document.getElementsByClassName("DateGalleryFilter")[0].style.backgroundColor="#f9d235",document.getElementsByClassName("LikesGalleryFilter")[0].style.backgroundColor="#fef9e4"}),h.addEventListener("click",function(){vu.sort((f,m)=>m.likes-f.likes),jf(t,i,!1,!0),document.getElementsByClassName("DateGalleryFilter")[0].style.backgroundColor="#fef9e4",document.getElementsByClassName("LikesGalleryFilter")[0].style.backgroundColor="#f9d235"}),Af=document.createElement("div"),Af.className="GalleryImagesDiv",s.appendChild(Af)}if(n?z2=vu.slice(0,i+12):z2=vu.slice(i,i+12),z2.forEach(s=>{const o=document.createElement("div");o.className=`GalleryElement ${"GalleryElement"+s.id}`,o.ImageID=s.id,o.NOLikes=s.likes,o.TimeCreate=s.created;const l=document.createElement("img");l.className="GalleryElementImage",l.src=s.httpadress,s.httpadress==zf&&o.classList.add("blinking4"),l.addEventListener("click",function(){const A=document.createElement("div");A.className="EnlargeGalleryImageWrapper";const f=document.createElement("div");f.className="EnlargeGalleryImageDiv",A.appendChild(f);const m=document.createElement("button");m.className="closeEnlargeGallery closeButton filterButton filterResetButton",A.appendChild(m),f.className="EnlargeGalleryImageDiv";const g=document.createElement("img");g.src="https://publictwin.info/digital_maquette/content/00_Icons/Close_Button.svg",g.className="mainMenuIcon arrowIcon",m.appendChild(g);const p=document.createElement("img");p.className="EnlargeGalleryImage",p.src=l.src;const v=document.createElement("div");v.className="ImageSizedDiv",f.appendChild(v),v.appendChild(p),m.addEventListener("click",function(){A.remove()}),document.getElementById("madiaGallery").appendChild(A)});const c=document.createElement("div");c.className="GalleryLikeDiv";const h=document.createElement("div");h.className=`GiveLike GalleryLikes clickableButton ${"GiveLike"+s.id}`,h.ImageID=s.id,h.addEventListener("click",function(){fetch("https://publictwin.info/digital_maquette/php_scripts/updateLikesImages.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageID:h.ImageID})}).then(A=>{if(!A.ok)throw new Error(`HTTP error! status: ${A.status}`);return A.json()}).then(A=>{A.success?(s.likes+=1,d.innerHTML=s.likes,s.likes>=100&&s.likes<1e3?d.classList.add("Number3Digit"):s.likes>=1e3&&d.classList.add("Number4Digit")):console.error("Failed to update likes in the database:",A.error)}).catch(A=>{console.error("Error updating likes:",A)})});const u=document.createElement("img");u.src="https://publictwin.info/digital_maquette/content/00_Icons/LikeButton.svg",u.className="LikeSvg",h.appendChild(u);const d=document.createElement("div");d.className=`LikeNumber GalleryLikes ${"LikeNumber"+s.id}`,d.ImageID=s.id,d.innerHTML=s.likes,d.addEventListener("click",function(){fetch("https://publictwin.info/digital_maquette/php_scripts/updateLikesImages.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageID:h.ImageID})}).then(A=>{if(!A.ok)throw new Error(`HTTP error! status: ${A.status}`);return A.json()}).then(A=>{A.success?(s.likes+=1,d.innerHTML=s.likes,s.likes>=100&&s.likes<1e3?d.classList.add("Number3Digit"):s.likes>=1e3&&d.classList.add("Number4Digit")):console.error("Failed to update likes in the database:",A.error)}).catch(A=>{console.error("Error updating likes:",A)})}),c.appendChild(d),c.appendChild(h),o.appendChild(l),o.appendChild(c),Af.appendChild(o)}),vu.length>i+12)if(r_=document.getElementsByClassName("LoadMoreButton"),r_){for(var a=0;a<r_.length;a++)document.getElementsByClassName("LoadMoreButton")[a].remove();const s=document.createElement("div"),o=document.createElement("button");
12258o.className="clickableButton LoadMoreButton",o.innerHTML="<span>load more images!</span>",o.addEventListener("click",function(){i+=12,jf(t,i,!0)}),s.appendChild(o),Af.appendChild(s)}else{const s=document.createElement("div"),o=document.createElement("button");o.className="clickableButton LoadMoreButton",o.innerHTML="<span>load more images!</span>",o.addEventListener("click",function(){i+=12,jf(t,i,!0)}),s.appendChild(o),Af.appendChild(s)}else{r_=document.getElementsByClassName("LoadMoreButton");for(var a=0;a<r_.length;a++)document.getElementsByClassName("LoadMoreButton")[a].remove()}}function Eze(t){fetch("https://publictwin.info/digital_maquette/php_scripts/saveFileToServer.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageUrl:t})}).then(r=>{if(!r.ok)throw new Error(`HTTP error! Status: ${r.status}`);return r.json()}).then(r=>{if(r.success){console.log("Image uploaded successfully:",r.fileName),yW=r.fileName,zf="https://publictwin.info/digital_maquette/content/Malmo_Nyhamnen/UrbanistAI/TextBasedGenerations/"+yW;let n=document.getElementsByClassName("PromptInput")[0].value,a=Xr.properties.AIPointNumber;i$(zf,a,n,n,n,"textbased")}else console.error("Error uploading image:",r.error),alert(`Error uploading image: ${r.error}`)}).catch(r=>{console.error("Fetch error:",r),alert(`Fetch error: ${r.message}`)})}let wze=Math.floor(1e7+Math.random()*9e7).toString(),bze="UF"+String(wze);sessionStorage.getItem("userID")||sessionStorage.setItem("userID",bze);let Sze=sessionStorage.getItem("userID"),h3=null,u3=null,TW=null,r$=null,J2=!1,YS=!1,ku=!1,x0=null,Za=0,Kg=!1,n$=0,oh="-",hc={},qM=!1;document.getElementById("CameraSubmitButton").style.backgroundColor="#d0af2d";const cE=document.getElementById("introduceCheckbox"),R0=document.getElementById("locationCheckbox"),hE=document.getElementById("roleCheckbox");sessionStorage.getItem("userPTCoins")||sessionStorage.setItem("userPTCoins",0),Za=parseInt(sessionStorage.getItem("userPTCoins"));document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins");h3=sessionStorage.getItem("IntroduceComplete");console.log(h3);u3=sessionStorage.getItem("LocationComplete");console.log(u3);Lze();let Cze=document.getElementById("UrbanFutureIntroduceButton"),Tze=document.getElementById("UrbanFutureRoleButton"),Mze=document.getElementById("UrbanFutureLocationButton"),xze=document.getElementById("UrbanFutureStartExperienceButton");document.getElementById("introduceCheckbox").checked=!1;document.getElementById("locationCheckbox").checked=!1;document.getElementById("roleCheckbox").checked=!1;Cze.addEventListener("click",function(){for(document.getElementById("UrbanFutureMainMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureChooseRoleMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureIntroduceMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureIntroduceMenu").classList.remove("UrbanFutureDisplayNone")},!0);Tze.addEventListener("click",function(){for(document.getElementById("UrbanFutureMainMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureIntroduceMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureChooseRoleMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureChooseRoleMenu").classList.remove("UrbanFutureDisplayNone")},!0);Mze.addEventListener("click",function(){navigator.geolocation.getCurrentPosition(t=>{t.coords.longitude,t.coords.latitude,Yc(R0,!0),sessionStorage.getItem("LocationComplete")||(Za+=25,sessionStorage.setItem("userPTCoins",Za),document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins")),sessionStorage.setItem("LocationComplete","true"),u3=sessionStorage.getItem("LocationComplete"),document.getElementById("LocationCoinDiv").style.display="none"},t=>{}),navigator.permissions&&navigator.permissions.query({name:"geolocation"}).then(function(t){t.state==="granted"?Yc(R0,!0):document.getElementById("StartIncompleteMessage").innerHTML="please, enable location services!"})},!0);xze.addEventListener("click",function(){YS?(document.getElementById("UserMenuUrbanFuture").style.display="none",document.getElementById("UserMenuUrbanFuture").style.visibility="hidden",document.getElementById("StartIncompleteMessage").innerHTML="",document.getElementById("closeMediaGalleryImage").style.display="none",document.getElementById("loginMenu").style.display="none",Uze(),Vze()):document.getElementById("StartIncompleteMessage").innerHTML="please, complete above sections!"},!0);let Rze=document.getElementById("UrbanFutureRoleBack"),MW=document.getElementById("UrbanFutureRoleSave");Rze.addEventListener("click",function(){for(document.getElementById("UrbanFutureChooseRoleMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureIntroduceMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureMainMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureMainMenu").classList.remove("UrbanFutureDisplayNone")},!0);MW.addEventListener("click",function(){if(MW.active=="true"){for(document.getElementById("UrbanFutureChooseRoleMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureIntroduceMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureMainMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureMainMenu").classList.remove("UrbanFutureDisplayNone");Yc(hE,!0),sessionStorage.getItem("RoleComplete")||(Za+=25,sessionStorage.setItem("userPTCoins",Za),document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins")),sessionStorage.setItem("RoleComplete","true"),sessionStorage.getItem("RoleComplete"),document.getElementById("RoleCoinDiv").style.display="none"}else alert("provide all the information!")},!0);let Bze=document.getElementById("UrbanFutureIntroduceBack"),xW=document.getElementById("UrbanFutureIntroduceSave");Bze.addEventListener("click",function(){for(document.getElementById("UrbanFutureChooseRoleMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureIntroduceMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureMainMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureMainMenu").classList.remove("UrbanFutureDisplayNone")},!0);xW.addEventListener("click",function(){if(xW.active=="true")for(document.getElementById("UrbanFutureChooseRoleMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureIntroduceMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureMainMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureMainMenu").classList.remove("UrbanFutureDisplayNone"),Yc(cE,!0),document.getElementById("IntrouceIncompleteMessage").innerHTML="",sessionStorage.getItem("IntroduceComplete")||(Za+=25,sessionStorage.setItem("userPTCoins",Za),document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins")),sessionStorage.setItem("IntroduceComplete","true"),h3=sessionStorage.getItem("IntroduceComplete"),document.getElementById("IntroductionCoinDiv").style.display="none";else document.getElementById("IntrouceIncompleteMessage").innerHTML="plese, select an option in all required fields!"},!0);let Ize=document.getElementById("UFGreenGuardian"),Dze=document.getElementById("UFAccessInspector"),Pze=document.getElementById("UFActivityScout");Ize.addEventListener("click",function(){document.getElementById("UFGreenGuardian").classList.add("WhiteBorder");let t="GreenGuardian";for(sessionStorage.setItem("userRole",t),x0=sessionStorage.getItem("userRole");document.getElementById("UFAccessInspector").classList.contains("WhiteBorder");)document.getElementById("UFAccessInspector").classList.remove("WhiteBorder");for(;document.getElementById("UFActivityScout").classList.contains("WhiteBorder");)document.getElementById("UFActivityScout").classList.remove("WhiteBorder");x0?(ku=!0,ku&&(document.getElementById("UrbanFutureRoleSave").style.backgroundColor="#f9d235",document.getElementById("UrbanFutureRoleSave").active="true")):(ku=!1,document.getElementById("UrbanFutureIntroduceSave").style.backgroundColor="#616161")},!0);Dze.addEventListener("click",function(){document.getElementById("UFAccessInspector").classList.add("WhiteBorder");let t="AccessInspector";for(sessionStorage.setItem("userRole",t),x0=sessionStorage.getItem("userRole");document.getElementById("UFGreenGuardian").classList.contains("WhiteBorder");)document.getElementById("UFGreenGuardian").classList.remove("WhiteBorder");for(;document.getElementById("UFActivityScout").classList.contains("WhiteBorder");)document.getElementById("UFActivityScout").classList.remove("WhiteBorder");x0?(ku=!0,ku&&(document.getElementById("UrbanFutureRoleSave").style.backgroundColor="#f9d235",document.getElementById("UrbanFutureRoleSave").active="true")):(ku=!1,document.getElementById("UrbanFutureIntroduceSave").style.backgroundColor="#616161")},!0);Pze.addEventListener("click",function(){document.getElementById("UFActivityScout").classList.add("WhiteBorder");let t="ActivityScout";for(sessionStorage.setItem("userRole",t),x0=sessionStorage.getItem("userRole");document.getElementById("UFAccessInspector").classList.contains("WhiteBorder");)document.getElementById("UFAccessInspector").classList.remove("WhiteBorder");for(;document.getElementById("UFGreenGuardian").classList.contains("WhiteBorder");)document.getElementById("UFGreenGuardian").classList.remove("WhiteBorder");x0?(ku=!0,ku&&(document.getElementById("UrbanFutureRoleSave").style.backgroundColor="#f9d235",document.getElementById("UrbanFutureRoleSave").active="true")):(ku=!1,document.getElementById("UrbanFutureIntroduceSave").style.backgroundColor="#616161")},!0);document.getElementById("UFFormGender").addEventListener("change",function(){let t=this.value;sessionStorage.setItem("userGender",t),TW=sessionStorage.getItem("userGender"),TW!=null&&r$!=null&&Sze!=null?(J2=!0,J2&&(document.getElementById("UrbanFutureIntroduceSave").style.backgroundColor="#f9d235",document.getElementById("UrbanFutureIntroduceSave").active="true",document.getElementById("IntrouceIncompleteMessage").innerHTML="")):(J2=!1,document.getElementById("UrbanFutureIntroduceSave").style.backgroundColor="#616161")});document.getElementById("UFFromRelation").addEventListener("change",function(){let t=this.value;sessionStorage.setItem("userRelation",t),r$=sessionStorage.getItem("userRelation")});document.getElementById("UFFormAge").addEventListener("change",function(){let t=this.value;sessionStorage.setItem("userAge",t),sessionStorage.getItem("userAge")});document.getElementById("UFFormEmail").addEventListener("change",function(){let t=this.value;sessionStorage.setItem("userEmail",t),sessionStorage.getItem("userEmail")});function Lze(){sessionStorage.getItem("IntroduceComplete")?(Yc(cE,!0),document.getElementById("IntroductionCoinDiv").style.display="none"):Yc(cE,!1),sessionStorage.getItem("RoleComplete")?(Yc(hE,!0),document.getElementById("RoleCoinDiv").style.display="none"):Yc(hE,!1),sessionStorage.getItem("LocationComplete")?(Yc(R0,!0),document.getElementById("LocationCoinDiv").style.display="none"):Yc(R0,!1)}function Yc(t,i){t.checked=i,Oze(t)}function Oze(t){if(sessionStorage.getItem("IntroduceComplete")&&(cE.checked=!0),sessionStorage.getItem("RoleComplete")&&(hE.checked=!0),sessionStorage.getItem("LocationComplete")&&(R0.checked=!0),t.checked)t.classList.add("checkedStyle");else for(;t.classList.contains("checkedStyle");)t.classList.remove("checkedStyle");hE.checked==!0&&R0.checked==!0&&cE.checked==!0?(YS=!0,YS&&(document.getElementById("UrbanFutureStartExperienceButtonSegment").style.backgroundColor="#f9d235",document.getElementById("UrbanFutureIntroduceSave").active="true",document.getElementById("StartIncompleteMessage").innerHTML="")):(YS=!1,document.getElementById("UrbanFutureStartExperienceButtonSegment").style.backgroundColor="#616161",console.log("not all elements are set"))}function Nze(){B.addSource("UrbanFuture-region-boundary",{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[19.45228193401138,51.774386222538254],[19.45187773035542,51.77647846703189],[19.44749268298696,51.776105817055225],[19.44725781298132,51.77726394376879],[19.44117588531921,51.775455188646845],[19.441132047147562,51.775310584771546],[19.43854732617163,51.775526338937794],[19.438763714112383,51.77658555449585],[19.438735424106937,51.777148539122635],[19.43814626394405,51.78066453281875],[19.439437423220227,51.78065726397182],[19.442400396720046,51.78113653483706],[19.442562851189166,51.78120474208802],[19.447815994167854,51.78212775503047],[19.448643351
12258598747,51.78223383990911],[19.449780827999973,51.78216272860976],[19.451003231236285,51.78197032879788],[19.451282771873366,51.78118440408494],[19.453854068063492,51.7812030051565],[19.45594802139715,51.781398915354686],[19.45660744432024,51.78132758997256],[19.45711982582742,51.781111459560606],[19.457508311358538,51.780847730082144],[19.457991371660455,51.78068790146364],[19.459261374556206,51.780582443753644],[19.45977779672006,51.78071086962254],[19.460142064887435,51.7807460567243],[19.460282233775786,51.78088264373858],[19.461187999055596,51.78097123317485],[19.461554784286676,51.77942263000455],[19.45705809622652,51.77901158619974],[19.45796550046927,51.7748752655572],[19.45228193401138,51.774386222538254]]]}}}),B.addLayer({id:"UrbanFuture-region-fill",type:"fill",source:"UrbanFuture-region-boundary",layout:{},paint:{"fill-color":"#f9d235","fill-opacity":.1}}),B.addLayer({id:"UrbanFuture-region-outline",type:"line",source:"UrbanFuture-region-boundary",layout:{},paint:{"line-color":"#f9d235","line-width":2}}),B.addLayer({id:"3d-model-UrbanFuture",type:"fill-extrusion",source:{type:"geojson",data:{type:"FeatureCollection",features:[]}},paint:{"fill-extrusion-color":"#888","fill-extrusion-height":0,"fill-extrusion-base":0,"fill-extrusion-opacity":0}}),B.addSource("UrbanFuture-walk-path",{type:"geojson",data:{type:"Feature",geometry:{type:"Polygon",coordinates:[[[19.44903954193009,51.77838571895643],[19.449002840089946,51.778447458095],[19.44718779847193,51.778299076847105],[19.44712310413354,51.77861884490102],[19.446970400004375,51.77863376358266],[19.44698080272525,51.77873104882909],[19.447064625940698,51.77877622379728],[19.44694179456684,51.77929888686356],[19.44682307845838,51.77936002211621],[19.446748874772624,51.77966857929789],[19.448629121207006,51.77983578990879],[19.44978177831311,51.77994178728804],[19.450165655100108,51.780005197778735],[19.45110299144966,51.78009876589391],[19.451686439121403,51.780153237483376],[19.451871525296326,51.780297175869606],[19.4521076369154,51.780362147961426],[19.45371170320996,51.78050737142928],[19.4540558669228,51.78051975161253],[19.454985025516464,51.780612016074826],[19.455566364561577,51.78066439215803],[19.455618827826612,51.780558684110815],[19.455773373570054,51.78044269506398],[19.455907074680482,51.780388840870216],[19.456091994944984,51.7803696924164],[19.456147935490662,51.78012770462851],[19.456150605931782,51.78004389694212],[19.45612335073608,51.78000816897875],[19.45491855584413,51.779538375963256],[19.45445000168533,51.77913339870864],[19.454520928705108,51.77909963446314],[19.454583118515103,51.77882532195653],[19.454345373249538,51.778798388555316],[19.45436714436343,51.77870471617919],[19.454392603779183,51.77867358210938],[19.454688429586128,51.777380305605504],[19.454722838958162,51.77731045444526],[19.45528889880424,51.777022183931706],[19.45534705970772,51.777005631991955],[19.45562004501184,51.7770282435437],[19.455636022970594,51.77692841662548],[19.45565783908296,51.7768150118803],[19.45546411892809,51.77680095585572],[19.45530189610446,51.77682975554285],[19.4551556123092,51.77682029175335],[19.455187447890978,51.7766603886505],[19.45501204322798,51.776519911402886],[19.454504280636627,51.77647871752379],[19.454280406970042,51.776585831876304],[19.454243086937566,51.77674261788232],[19.45408952371119,51.77673065767877],[19.453896078293184,51.7766546668102],[19.452428229345827,51.77651825919742],[19.45240667024126,51.776629587025354],[19.45237962428226,51.77665380756102],[19.45232902909558,51.776825453354405],[19.45186875846423,51.77679098968929],[19.451665751322793,51.77773181000151],[19.45076752338474,51.77764737716885],[19.450740905039964,51.77778825846906],[19.45068940328329,51.777816851739686],[19.449600096650556,51.7777088039056],[19.44923316160839,51.777769358004235],[19.44903954193009,51.77838571895643]]]}}}),B.addLayer({id:"UrbanFuture-walk-path",type:"line",source:"UrbanFuture-walk-path",layout:{},paint:{"line-color":"#d0af2d","line-width":3}});const t=[19.4547,51.7765],i=[19.4557,51.7805],r=[19.4496,51.7777],n=[19.4486,51.7782],a=[19.4475,51.7783],s=[19.4469,51.7791],o=document.createElement("div");o.className="markerUrbanFuture",o.id="elAmarkerUrbanFuture",new mapboxgl.Marker(o).setLngLat(t).addTo(B);const l=document.createElement("div");l.className="markerUrbanFuture",l.id="elBmarkerUrbanFuture",new mapboxgl.Marker(l).setLngLat(i).addTo(B);const c=document.createElement("div");c.className="markerUrbanFuture",c.id="elCmarkerUrbanFuture",new mapboxgl.Marker(c).setLngLat(r).addTo(B);const h=document.createElement("div");h.className="markerUrbanFuture",h.id="elDmarkerUrbanFuture",new mapboxgl.Marker(h).setLngLat(n).addTo(B);const u=document.createElement("div");u.className="markerUrbanFuture",u.id="elEmarkerUrbanFuture",new mapboxgl.Marker(u).setLngLat(a).addTo(B);const d=document.createElement("div");d.className="markerUrbanFuture",d.id="elFmarkerUrbanFuture",new mapboxgl.Marker(d).setLngLat(s).addTo(B),B.moveLayer("UrbanFuture-region-fill"),B.moveLayer("UrbanFuture-region-outline"),B.moveLayer("UrbanFuture-walk-path")}function Uze(){try{sessionStorage.getItem("userRole")&&(sessionStorage.getItem("userRole")=="GreenGuardian"?document.getElementById("yourRoleInApp").innerHTML="Green Guardian":sessionStorage.getItem("userRole")=="AccessInspector"?document.getElementById("yourRoleInApp").innerHTML="Access Inspector":sessionStorage.getItem("userRole")=="ActivityScout"&&(document.getElementById("yourRoleInApp").innerHTML="Activity Scout"))}catch{}try{document.getElementById("yourCoinsInApp").innerHTML=sessionStorage.getItem("userPTCoins")}catch{}document.getElementById("navbarTop").style.display="none",document.getElementById("TopNavbarUrbanFuture").style.display="block",document.getElementById("BottomMenuUrbanFuture").style.display="block"}document.getElementById("UrbanFutureTopNavbarSelectOptions").addEventListener("click",function(){Kg?(document.getElementById("TopNavbarUrbanFutureSelectOptions").style.display="none",document.getElementById("UrbanFutureTopNavbarOpenClose").src="https://publictwin.info/digital_maquette/content/Urban_Future/Icons/OpenMenu.png"):(document.getElementById("TopNavbarUrbanFutureSelectOptions").style.display="flex",document.getElementById("UrbanFutureTopNavbarOpenClose").src="https://publictwin.info/digital_maquette/content/Urban_Future/Icons/CloseMenu.png",wr(document.getElementById("BotomActionsUrbanReaction")),wr(document.getElementById("BotomActionsUrbanComment")),wr(document.getElementById("BotomActionsUrbanPhoto")),wr(document.getElementById("UrbanFutureWalkshopConclusion")),wr(document.getElementById("UrbanFutureWalkshopThank"))),Kg=!Kg});document.getElementById("UrbanFutureMainMenuButton").addEventListener("click",function(){for(document.getElementById("UrbanFutureTopNavbarSelectOptions").click(),document.getElementById("UrbanFutureChooseRoleMenu").classList.add("UrbanFutureDisplayNone"),document.getElementById("UrbanFutureIntroduceMenu").classList.add("UrbanFutureDisplayNone");document.getElementById("UrbanFutureMainMenu").classList.contains("UrbanFutureDisplayNone");)document.getElementById("UrbanFutureMainMenu").classList.remove("UrbanFutureDisplayNone");document.getElementById("UserMenuUrbanFuture").style.display="block",document.getElementById("UserMenuUrbanFuture").style.visibility="visible"});document.getElementById("UrbanFutureReCenterButton").addEventListener("click",function(){document.getElementById("UrbanFutureTopNavbarSelectOptions").click(),Ri({zoom:14.5,pitch:0,bearing:0,center:[19.4513,51.7788]})});document.getElementById("UrbanFutureEndTourButton").addEventListener("click",function(){document.getElementById("UrbanFutureTopNavbarSelectOptions").click(),document.getElementById("userIDUrbanFuture").innerHTML=sessionStorage.getItem("userID"),document.getElementById("userScoreUrbanFuture").innerHTML=sessionStorage.getItem("userPTCoins"),f1(document.getElementById("UrbanFutureWalkshopConclusion"))});document.getElementById("UrbanFutureLearnMoreButton").addEventListener("click",function(){document.getElementById("UrbanFutureTopNavbarSelectOptions").click(),window.open("https://publictwin.info/","_blank")});document.getElementById("UrbanFutureParticipationReact").addEventListener("click",function(){document.getElementById("BotomActionsUrbanReaction").getAttribute("menuOpened")=="false"?(f1(document.getElementById("BotomActionsUrbanReaction")),wr(document.getElementById("BotomActionsUrbanComment")),wr(document.getElementById("BotomActionsUrbanPhoto")),d3()):wr(document.getElementById("BotomActionsUrbanReaction"))});document.getElementById("ReactionCloseButton").addEventListener("click",function(){wr(document.getElementById("BotomActionsUrbanReaction")),document.getElementById("UrbanFutureReactionComment").value=""});document.getElementById("ReactionSubmitButton").addEventListener("click",function(){wr(document.getElementById("BotomActionsUrbanReaction")),oh="-",document.getElementById("UrbanFutureReactionComment").value?oh=document.getElementById("UrbanFutureReactionComment").value:oh="-",hc.reaction_comment=oh,hc.rating=parseInt(n$);let t=fh.getLngLat(),i=`${t.lng.toFixed(4)},${t.lat.toFixed(4)}`;hc.coordinates=i,Wze(hc)});document.getElementById("UrbanFutureParticipationComment").addEventListener("click",function(){document.getElementById("BotomActionsUrbanComment").getAttribute("menuOpened")=="false"?(f1(document.getElementById("BotomActionsUrbanComment")),wr(document.getElementById("BotomActionsUrbanReaction")),wr(document.getElementById("BotomActionsUrbanPhoto")),d3()):wr(document.getElementById("BotomActionsUrbanComment"))});document.getElementById("CommentCloseButton").addEventListener("click",function(){wr(document.getElementById("BotomActionsUrbanComment")),document.getElementById("UrbanFutureCommentComment").value=""});document.getElementById("CommentSubmitButton").addEventListener("click",function(){wr(document.getElementById("BotomActionsUrbanComment")),oh="-",oh=document.getElementById("UrbanFutureCommentComment").value,hc.reaction_comment=oh;let t=fh.getLngLat(),i=`${t.lng.toFixed(4)},${t.lat.toFixed(4)}`;hc.coordinates=i,jze(hc)});document.getElementById("CameraCloseButton").addEventListener("click",function(){wr(document.getElementById("BotomActionsUrbanPhoto")),document.getElementById("UrbanFuturePhotoComment").value=""});document.getElementById("CameraSubmitButton").addEventListener("click",function(){const t=document.getElementById("canvas").toDataURL("image/jpeg");qM&&fetch("https://publictwin.info/digital_maquette/php_scripts/UrbanFutureSaveCaptured
12258FileToServer.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({imageData:t})}).then(i=>i.json()).then(i=>{if(i.success){console.log("Image uploaded:",i.fileName),oh="-",oh=document.getElementById("UrbanFuturePhotoComment").value,hc.reaction_comment=oh,hc.httpadress="https://publictwin.info/digital_maquette/content/Urban_Future/Saved_User_Images/"+i.fileName;let r=fh.getLngLat(),n=`${r.lng.toFixed(4)},${r.lat.toFixed(4)}`;hc.coordinates=n,Yze(hc)}else console.error("Upload failed:",i.error)}).catch(i=>console.error("Fetch error:",i))});document.getElementById("UrbanFutureParticipationPhoto").addEventListener("click",function(){document.getElementById("BotomActionsUrbanPhoto").getAttribute("menuOpened")=="false"?(f1(document.getElementById("BotomActionsUrbanPhoto")),wr(document.getElementById("BotomActionsUrbanReaction")),wr(document.getElementById("BotomActionsUrbanComment")),d3(),Fze()):(wr(document.getElementById("BotomActionsUrbanPhoto")),a$())});document.getElementById("TourCloseButton").addEventListener("click",function(){wr(document.getElementById("UrbanFutureWalkshopConclusion"))});document.getElementById("TourSubmitButton").addEventListener("click",function(){wr(document.getElementById("UrbanFutureWalkshopConclusion")),Kze(),f1(document.getElementById("UrbanFutureWalkshopThank"))});document.getElementById("TypeformButton").addEventListener("click",function(){window.open("https://eoxsnlhinp7.typeform.com/to/bT4Az155","_blank")});const RW=document.querySelectorAll(".UrbanFutureReactionIcon");RW.forEach(t=>{t.addEventListener("click",()=>{if(RW.forEach(i=>i.classList.remove("whiteBorder")),t.classList.add("whiteBorder"),console.log(document.getElementById("BotomActionsUrbanReaction").getAttribute("apeneded")),document.getElementById("BotomActionsUrbanReaction").getAttribute("apeneded")=="false"){for(;document.getElementById("CommentWrapper").classList.contains("UrbanFutureDisplayNone");)document.getElementById("CommentWrapper").classList.remove("UrbanFutureDisplayNone");document.getElementById("BotomActionsUrbanReaction").setAttribute("apeneded","true")}n$=t.getAttribute("score")})});function f1(t){for(;t.classList.contains("UrbanFutureDisplayNone");)t.classList.remove("UrbanFutureDisplayNone");if(t.setAttribute("menuOpened","true"),t.id=="BotomActionsUrbanReaction"){for(document.getElementById("CommentWrapper").classList.add("UrbanFutureDisplayNone"),document.getElementById("BotomActionsUrbanReaction").setAttribute("apeneded","false"),document.getElementById("UrbanFutureParticipationReact").classList.add("whiteBorder");document.getElementById("UrbanFutureParticipationComment").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationComment").classList.remove("whiteBorder");for(;document.getElementById("UrbanFutureParticipationPhoto").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationPhoto").classList.remove("whiteBorder");wr(document.getElementById("UrbanFutureWalkshopConclusion")),wr(document.getElementById("UrbanFutureWalkshopThank"))}if(t.id=="BotomActionsUrbanComment"){for(document.getElementById("UrbanFutureParticipationComment").classList.add("whiteBorder");document.getElementById("UrbanFutureParticipationReact").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationReact").classList.remove("whiteBorder");for(;document.getElementById("UrbanFutureParticipationPhoto").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationPhoto").classList.remove("whiteBorder");wr(document.getElementById("UrbanFutureWalkshopConclusion")),wr(document.getElementById("UrbanFutureWalkshopThank"))}if(t.id=="BotomActionsUrbanPhoto"){for(document.getElementById("UrbanFutureParticipationPhoto").classList.add("whiteBorder");document.getElementById("UrbanFutureParticipationReact").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationReact").classList.remove("whiteBorder");for(;document.getElementById("UrbanFutureParticipationComment").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationComment").classList.remove("whiteBorder");wr(document.getElementById("UrbanFutureWalkshopConclusion")),wr(document.getElementById("UrbanFutureWalkshopThank"))}Kg&&(document.getElementById("TopNavbarUrbanFutureSelectOptions").style.display="none",document.getElementById("UrbanFutureTopNavbarOpenClose").src="https://publictwin.info/digital_maquette/content/Urban_Future/Icons/OpenMenu.png",Kg=!Kg)}function wr(t){if(t.classList.add("UrbanFutureDisplayNone"),t.setAttribute("menuOpened","fal
12258se"),t.id=="BotomActionsUrbanReaction")for(;document.getElementById("UrbanFutureParticipationReact").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationReact").classList.remove("whiteBorder");if(t.id=="BotomActionsUrbanComment")for(;document.getElementById("UrbanFutureParticipationComment").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationComment").classList.remove("whiteBorder");if(t.id=="BotomActionsUrbanPhoto"){for(;document.getElementById("UrbanFutureParticipationPhoto").classList.contains("whiteBorder");)document.getElementById("UrbanFutureParticipationPhoto").classList.remove("whiteBorder");document.getElementById("CameraSubmitButton").style.backgroundColor="#d0af2d",a$()}}const no=document.getElementById("video"),Au=document.getElementById("canvas"),p1=document.getElementById("captureBtn"),m1=document.getElementById("retakeBtn");let fy=null;async function Fze(){try{fy=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"},audio:!1}),no.srcObject=fy,no.play(),no.style.display="block",Au.style.display="none",m1.style.display="none",p1.style.display="flex"}catch(t){console.log("Error accessing camera:",t)}}function a$(){fy&&(fy.getTracks().forEach(t=>{t.stop()}),fy=null),no&&(no.pause(),no.srcObject=null,no.style.display="none"),Au.style.display="none",p1.style.display="flex",m1.style.display="none",qM=!1,document.getElementById("CameraSubmitButton").style.backgroundColor="#d0af2d"}function kze(){const t=Au.getContext("2d");Au.width=no.videoWidth,Au.height=no.videoHeight,t.drawImage(no,0,0,Au.width,Au.height),no.pause(),no.style.display="none",Au.style.display="block",p1.style.display="none",m1.style.display="flex",qM=!0,document.getElementById("CameraSubmitButton").style.backgroundColor="#f9d235"}function Hze(){no.play(),no.style.display="block",Au.style.display="none",p1.style.display="flex",m1.style.display="none",qM=!1,document.getElementById("CameraSubmitButton").style.backgroundColor="#d0af2d"}p1.addEventListener("click",kze);m1.addEventListener("click",Hze);const fh=new mapboxgl.Marker({color:"blue"});fh.getElement().style.opacity="0";fh.getElement().style.display="none";function Gze(t){try{const i=t.coords.longitude,r=t.coords.latitude;fh.setLngLat([i,r]).addTo(B),fh.getElement().style.opacity="0",fh.getElement().style.display="none"}catch{}}function d3(){try{const t=fh.getLngLat();B.easeTo({center:[t.lng,t.lat],bearing:0,pitch:0,duration:1e3})}catch{}}function zze(){try{const t=fh.getLngLat();B.easeTo({center:[t.lng,t.lat],bearing:0,pitch:45,zoom:16.5,duration:1e3})}catch{}}function Qze(t){console.error("Geolocation error:",t.message)}function Vze(){if(navigator.geolocation){navigator.geolocation.watchPosition(Gze,Qze,{enableHighAccuracy:!0,maximumAge:0,timeout:1e4});const t=new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0,showUserHeading:!0});B.addControl(t),setTimeout(()=>{t.trigger()},500);const i=document.querySelector(".mapboxgl-ctrl-top-right");i&&(i.style.display="none")}}document.getElementById("BottomLocateUser").addEventListener("click",function(){zze()});function Wze(t){let i=sessionStorage.getItem("userID"),r=sessionStorage.getItem("userAge"),n=sessionStorage.getItem("userRelation"),a=sessionStorage.getItem("userGender"),s;sessionStorage.getItem("userEmail")?s=sessionStorage.getItem("userEmail"):s="-";let o=sessionStorage.getItem("userRole"),l={reaction_comment:t.reaction_comment,rating:t.rating,coordinates:t.coordinates,user_identifier:i,age_group:r,relation_to_place:n,gender:a,email:s,users_role:o};fetch("https://publictwin.info/digital_maquette/php_scripts/UrbanFutureSubmitReaction.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(c=>c.json()).then(c=>{c.success&&(Za=parseInt(sessionStorage.getItem("userPTCoins")),Za+=10,sessionStorage.setItem("userPTCoins",Za),document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins"),document.getElementById("yourCoinsInApp").innerHTML=sessionStorage.getItem("userPTCoins"),A3(),f3(),p3(),document.getElementById("UrbanFutureReactionComment").value="")}
12258).catch(c=>{console.error("Fetch error:",c)})}function jze(t){let i=sessionStorage.getItem("userID"),r=sessionStorage.getItem("userAge"),n=sessionStorage.getItem("userRelation"),a=sessionStorage.getItem("userGender"),s;sessionStorage.getItem("userEmail")?s=sessionStorage.getItem("userEmail"):s="-";let o=sessionStorage.getItem("userRole"),l={reaction_comment:t.reaction_comment,coordinates:t.coordinates,user_identifier:i,age_group:r,relation_to_place:n,gender:a,email:s,users_role:o};fetch("https://publictwin.info/digital_maquette/php_scripts/UrbanFutureSubmitComment.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(c=>c.json()).then(c=>{c.success&&(Za=parseInt(sessionStorage.getItem("userPTCoins")),Za+=20,sessionStorage.setItem("userPTCoins",Za),document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins"),document.getElementById("yourCoinsInApp").innerHTML=sessionStorage.getItem("userPTCoins"),A3(),f3(),p3(),document.getElementById("UrbanFutureCommentComment").value="")}).catch(c=>{console.error("Fetch error:",c)})}function Yze(t){let i=sessionStorage.getItem("userID"),r=sessionStorage.getItem("userAge"),n=sessionStorage.getItem("userRelation"),a=sessionStorage.getItem("userGender"),s;sessionStorage.getItem("userEmail")?s=sessionStorage.getItem("userEmail"):s="-";let o=sessionStorage.getItem("userRole"),l={reaction_comment:t.reaction_comment,httpadress:t.httpadress,coordinates:t.coordinates,user_identifier:i,age_group:r,relation_to_place:n,gender:a,email:s,users_role:o};fetch("https://publictwin.info/digital_maquette/php_scripts/UrbanFutureSubmitPhoto.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(c=>c.json()).then(c=>{c.success&&(Za=parseInt(sessionStorage.getItem("userPTCoins")),Za+=30,sessionStorage.setItem("userPTCoins",Za),document.getElementById("yourCoins").innerHTML=sessionStorage.getItem("userPTCoins"),document.getElementById("yourCoinsInApp").innerHTML=sessionStorage.getItem("userPTCoins"),A3(),f3(),p3(),document.getElementById("UrbanFuturePhotoComment").value="",wr(document.getElementById("BotomActionsUrbanPhoto")))}).catch(c=>{console.error("Fetch error:",c)})}function Kze(){let t=sessionStorage.getItem("userID"),i=parseInt(sessionStorage.getItem("userPTCoins")),r;sessionStorage.getItem("userEmail")?r=sessionStorage.getItem("userEmail"):r="-",fetch("https://publictwin.info/digital_maquette/php_scripts/UrbanFutureSubmitScore.php",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({user_identifier:t,user_PTCoins:i,email:r})}).then(a=>a.json()).then(a=>{a.success}).catch(a=>{console.error("Fetch error:",a)})}function Xze(){const t=B.getZoom(),r=(Math.max(9,Math.min(16,t))-9)*(30/7)+10;document.querySelectorAll(".markerUrbanFuture").forEach(n=>{n.style.width=`${r}px`,n.style.height=`${r}px`})}function A3(){const t=sessionStorage.getItem("userID");if(!t){console.error("Missing userID in sessionStorage.");return}fetch("https://publictwin.info/digital_maquette/php_scripts/read_UrbanFutureReactions.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`user_identifier=${encodeURIComponent(t)}`}).then(i=>i.json()).then(i=>{B.getLayer("UrbanFutureReactionsLayer")&&B.removeLayer("UrbanFutureReactionsLayer"),B.getSource("UrbanFutureReactionsSource")&&B.removeSource("UrbanFutureReactionsSource"),B.addSource("UrbanFutureReactionsSource",{type:"geojson",data:i});const r=["match",["get","users_role"],"GreenGuardian",["match",["get","rating"],1,"#b9fbc0",2,"#86efac",3,"#4ade80",4,"#22c55e",5,"#15803d","#cccccc"],"ActivityScout",["match",["get","rating"],1,"#ffe7ba",2,"#fdba74",3,"#fb923c",4,"#f97316",5,"#c2410c","#cccccc"],"AccessInspector",["match",["get","rating"],1,"#bfdbfe",2,"#93c5fd",3,"#60a5fa",4,"#3b82f6",5,"#1d4ed8","#cccccc"],"#999999"];B.addLayer({id:"UrbanFutureReactionsLayer",type:"circle",source:"UrbanFutureReactionsSource",paint:{"circle-radius":{base:1.25,stops:[[11,2],[18,18]]}
12258,"circle-opacity":.55,"circle-stroke-width":0,"circle-stroke-color":"#000","circle-color":r}})}).catch(i=>{console.error("Error fetching UrbanFuture reactions:",i)})}function f3(){const t=sessionStorage.getItem("userID");if(!t){console.error("Missing userID in sessionStorage.");return}fetch("https://publictwin.info/digital_maquette/php_scripts/read_UrbanFutureComments.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`user_identifier=${encodeURIComponent(t)}`}).then(i=>i.json()).then(i=>{B.getLayer("UrbanFutureCommentsLayer")&&B.removeLayer("UrbanFutureCommentsLayer"),B.getSource("UrbanFutureCommentsSource")&&B.removeSource("UrbanFutureCommentsSource"),B.addSource("UrbanFutureCommentsSource",{type:"geojson",data:i});const r=["match",["get","users_role"],"GreenGuardian","#15803d","ActivityScout","#c2410c","AccessInspector","#1d4ed8","#999999"];B.addLayer({id:"UrbanFutureCommentsLayer",type:"circle",source:"UrbanFutureCommentsSource",paint:{"circle-radius":{base:1.25,stops:[[11,2],[18,18]]}
12258,"circle-opacity":.55,"circle-stroke-width":0,"circle-stroke-color":"#000","circle-color":r}})}).catch(i=>{console.error("Error fetching UrbanFuture reactions:",i)})}function p3(){const t=sessionStorage.getItem("userID");if(!t){console.error("Missing userID in sessionStorage.");return}fetch("https://publictwin.info/digital_maquette/php_scripts/read_UrbanFuturePhotos.php",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`user_identifier=${encodeURIComponent(t)}`}).then(i=>i.json()).then(i=>{B.getLayer("UrbanFuturePhotosLayer")&&B.removeLayer("UrbanFuturePhotosLayer"),B.getSource("UrbanFuturePhotosSource")&&B.removeSource("UrbanFuturePhotosSource"),B.addSource("UrbanFuturePhotosSource",{type:"geojson",data:i});const r=["match",["get","users_role"],"GreenGuardian","#15803d","ActivityScout","#c2410c","AccessInspector","#1d4ed8","#999999"];B.addLayer({id:"UrbanFuturePhotosLayer",type:"circle",source:"UrbanFuturePhotosSource",paint:{"circle-radius":{base:1.25,stops:[[11,2],[18,18]]},"circle-opacity":.55,"circle-stroke-width":0,"cir
12258cle-stroke-color":"#000","circle-color":r}})}).catch(i=>{console.error("Error fetching UrbanFuture reactions:",i)})}export{Cy as c,Gde as g}; 12259//# sourceMappingURL=index-5b7c4724.js.map
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.