ss-component-new 1.1.664 → 1.1.665
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{OrbitControls-3WQARX-Q.js → OrbitControls-Dg-YU8XV.js} +1 -1
- package/dist/{OrbitControls-xYWbvRmk.cjs → OrbitControls-dwV_193A.cjs} +1 -1
- package/dist/{index-DXCoBgbg.cjs → index-0hOaUjY4.cjs} +1 -1
- package/dist/{index-MuGZ_vW5.cjs → index-B77xf0bX.cjs} +175 -175
- package/dist/{index-BYOuYmBM.cjs → index-BIPYWuic.cjs} +12 -12
- package/dist/{index-DjL2Im8_.js → index-BYfsHxF4.js} +6 -6
- package/dist/{index-BnDSAAMI.js → index-BZjY19WM.js} +4872 -4818
- package/dist/{index-BYONMu87.js → index-BagJCuU1.js} +1 -1
- package/dist/{index-DJUbKs3M.js → index-BbncRgGC.js} +2 -2
- package/dist/{index-Bm1ogtsQ.js → index-BepWqjuD.js} +4 -4
- package/dist/{index-Z-hEJ2c8.js → index-BluBn2s2.js} +1 -1
- package/dist/{index-Di-OZ-fg.cjs → index-BqXSS12e.cjs} +1 -1
- package/dist/{index-BMWd9u9v.js → index-BqfogBjv.js} +12 -12
- package/dist/{index-BOol51NX.cjs → index-BqrmgrKD.cjs} +1 -1
- package/dist/{index-CBd7w7r0.cjs → index-BtSClRO6.cjs} +1 -1
- package/dist/{index-Co2b8hVH.js → index-BvuqksJo.js} +1 -1
- package/dist/{index-DHjpF29j.cjs → index-C2neJgVy.cjs} +1 -1
- package/dist/{index-DUovXypa.cjs → index-CQE3enC4.cjs} +1 -1
- package/dist/{index-wIJ-vRHM.js → index-CQxT8_Lq.js} +1 -1
- package/dist/{index-jh7MwUTj.js → index-CQzp3bhe.js} +2 -2
- package/dist/{index-5QZ4-xwn.js → index-CUF0apYP.js} +376 -391
- package/dist/{index-kuXtgeqr.js → index-CXStby4c.js} +1 -1
- package/dist/{index-C3QklCI4.cjs → index-Cc6Hab7M.cjs} +1 -1
- package/dist/{index-7w39ITU8.cjs → index-CgvKZgQA.cjs} +1 -1
- package/dist/{index-DhuXWA1T.js → index-CncQ_iPx.js} +536 -535
- package/dist/{index-DyoIv7cW.cjs → index-CyXybJMU.cjs} +1 -1
- package/dist/{index-C9bIOkxs.js → index-DEU2IhoK.js} +3 -3
- package/dist/{index-B9iM9zYk.js → index-DFKWyXmk.js} +6 -6
- package/dist/{index-BtP7qqgp.cjs → index-DUQZm_yT.cjs} +1 -1
- package/dist/index-DZzHO5wE.cjs +1 -0
- package/dist/{index-CvghfUgc.cjs → index-Dw4xZjy2.cjs} +1 -1
- package/dist/{index-DpUDz8SS.js → index-eqeibkVS.js} +4 -4
- package/dist/{index-Bz9EuKMh.cjs → index-t2AmjfPd.cjs} +1 -1
- package/dist/{index-CBmh8Gk_.cjs → index-xUvlhw8W.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_2be0f146_lang-B53G2F1L.cjs → index.vue_vue_type_style_index_0_scoped_2be0f146_lang-CWuVB8VJ.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_2be0f146_lang-BUwFjiDm.js → index.vue_vue_type_style_index_0_scoped_2be0f146_lang-nMLju4kE.js} +5 -5
- package/dist/{index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-B2Njafte.js → index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-B-9T2j67.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-CiNeVqJb.cjs → index.vue_vue_type_style_index_0_scoped_d215f0b6_lang-B6wX8zrT.cjs} +1 -1
- package/dist/{main-qCD36qGt.cjs → main-B-fBc3SC.cjs} +1 -1
- package/dist/{main-BMLyQW0_.js → main-DrKyvXLz.js} +2 -2
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +5 -5
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +8 -8
- package/dist/{threeModel-ClvLEKHP.js → threeModel-C9BgkcvH.js} +92 -92
- package/dist/{threeModel-BogmAsfY.cjs → threeModel-nrPGFxQD.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-LTK_nBIy.cjs +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";const V=require("vue"),
|
|
1
|
+
"use strict";const V=require("vue"),Pe=require("./menu-ScIJ5kqr.cjs"),si=require("./index-BIPYWuic.cjs"),Gh=require("./modelComp-CkSDfH0-.cjs"),pn=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-lPMPisUK.cjs"),xa=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ku=require("./login-9FT8kgSz.cjs"),bo=s=>s.match(/\((.*)\)/)[1],Zu={__name:"index",props:{isVisible:{type:Boolean,default:!1},title:{type:String,default:""},placement:{type:String,default:"bottom"},width:{type:Number,default:200}},setup(s){const e=s,t=V.ref(null),n=V.ref(!1),i=V.ref(null);return V.watch(()=>e==null?void 0:e.isVisible,()=>{n.value=e==null?void 0:e.isVisible},{deep:!0,immediate:!0}),V.watch(()=>i.value,()=>{V.nextTick(()=>{var r,a;(a=(r=t.value)==null?void 0:r.updatePopper)==null||a.call(r)})},{deep:!0,immediate:!0}),(r,a)=>{const o=V.resolveComponent("el-popover");return V.openBlock(),V.createBlock(o,{visible:n.value,title:e==null?void 0:e.title,placement:e==null?void 0:e.placement,width:e==null?void 0:e.width,ref_key:"popOverRef",ref:t},{reference:V.withCtx(()=>[V.createElementVNode("div",null,[V.renderSlot(r.$slots,"reference",{ref_key:"referenceRef",ref:i})])]),default:V.withCtx(()=>[V.createElementVNode("div",null,[V.renderSlot(r.$slots,"content")])]),_:3},8,["visible","title","placement","width"])}}},Qu={class:"extra-button-content"},ed={class:"table-operator-wrap"},td={class:"extra-button-filter"},nd={title:"条件查询"},id={class:"form-content-value"},sd={key:0,class:"extra-header"},rd={__name:"header",props:{compName:{type:String,default:"表格名称",required:!1},buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick","filter"],setup(s,{emit:e}){const t=e,n=s,i=V.ref(""),r=V.ref(!1),a=V.ref([]),o=V.ref([{label:"取消",background:"#999999"},{label:"清空",background:"#999999"},{label:"确认"}]),l=u=>{var m;const d=(m=a.value)==null?void 0:m.reduce((_,g,p)=>(p===0?_[g.label]=u:_[g.label]=g.value,_),{});t("filter",d)},c=u=>{t("buttonClick",u)},h=u=>{var d,m;a.value=(m=(d=pn.getColumnChild(Pe.cloneDeep(u)))==null?void 0:d.filter(_=>(_==null?void 0:_.label)!==""&&(_==null?void 0:_.label)!=="操作"))==null?void 0:m.map(_=>({label:(_==null?void 0:_.label)??"",value:"",name:(_==null?void 0:_.label)??"",isFormColHidden:_==null?void 0:_.isTableColHidden,width:2}))},f=u=>{var d;if((u==null?void 0:u.buttonName)==="确认"&&t("filter",u==null?void 0:u.content),(u==null?void 0:u.buttonName)==="清空"){const m=Pe.cloneDeep(u==null?void 0:u.content);for(const _ in m)m[_]="";a.value=(d=a.value)==null?void 0:d.map(_=>({..._,value:""})),t("filter",m)}r.value=!1};return V.onMounted(()=>{h(n.columns)}),V.watch(()=>n.columns,()=>{h(n.columns)},{deep:!0,immediate:!0}),(u,d)=>{var p;const m=V.resolveComponent("svg-icon"),_=V.resolveComponent("el-input"),g=V.resolveComponent("el-button");return V.openBlock(),V.createElementBlock("div",Qu,[V.createElementVNode("div",{class:V.normalizeClass(s.compName?"table-name-wrap":"")},V.toDisplayString(s.compName),3),V.createElementVNode("div",ed,[V.createElementVNode("div",td,[V.createVNode(Zu,{title:"",width:800,placement:"bottom-start",isVisible:r.value},{reference:V.withCtx(()=>[V.createVNode(_,{modelValue:i.value,"onUpdate:modelValue":d[1]||(d[1]=S=>i.value=S),style:{width:"240px"},placeholder:"搜索","prefix-icon":V.unref(Pe.search_default),clearable:"",onInput:l},{append:V.withCtx(()=>[V.createElementVNode("span",nd,[V.createVNode(m,{onClick:d[0]||(d[0]=S=>r.value=!r.value),name:"query",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),_:1},8,["modelValue","prefix-icon"])]),content:V.withCtx(()=>[V.createElementVNode("div",id,[(V.openBlock(),V.createBlock(si.ssForm,{rowContents:a.value,buttonValue:o.value,isRowFlex:!0,isEnableWrap:!1,isButtonRow:!1,key:o.value,isStartJustify:!1,onOnButtonClick:f},null,8,["rowContents","buttonValue"]))])]),_:1},8,["isVisible"])]),n!=null&&n.buttons&&((p=n==null?void 0:n.buttons)==null?void 0:p.length)>0?(V.openBlock(),V.createElementBlock("div",sd,[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(n==null?void 0:n.buttons,(S,A)=>(V.openBlock(),V.createElementBlock("div",{class:"extra-contents",key:A},[V.createVNode(g,{id:"themeButton",style:V.normalizeStyle({background:(S==null?void 0:S.background)??"var(--ssbutton-theme-bg)",color:"var(--ssbutton-theme-color)"}),onClick:b=>c(S==null?void 0:S.label)},{default:V.withCtx(()=>[V.createTextVNode(V.toDisplayString(S==null?void 0:S.label),1)]),_:2},1032,["style","onClick"])]))),128))])):V.createCommentVNode("",!0)])])}}},ad=xa._export_sfc(rd,[["__scopeId","data-v-e343d690"]]),od=V.defineComponent({__name:"batch",props:{buttons:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]}},emits:["buttonClick"],setup(s,{emit:e}){const t=e,n=i=>{t("buttonClick",i)};return(i,r)=>{const a=V.resolveComponent("el-button");return V.openBlock(),V.createElementBlock("div",null,[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(s.buttons,o=>{var l;return V.openBlock(),V.createBlock(a,{key:o==null?void 0:o.label,class:V.normalizeClass((l=o==null?void 0:o.label)!=null&&l.includes("删除")?"warning-type":"default-type"),onClick:c=>n(o==null?void 0:o.label)},{default:V.withCtx(()=>[V.createTextVNode(V.toDisplayString(o==null?void 0:o.label),1)]),_:2},1032,["class","onClick"])}),128))])}}}),ld=xa._export_sfc(od,[["__scopeId","data-v-73ec704e"]]);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2010-2025 Three.js Authors
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
|
-
*/const yl="177",ld={ROTATE:0,DOLLY:1,PAN:2},cd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},hd=0,jl=1,ud=2,Wh=1,Xh=2,vi=3,Xn=0,Rn=1,wn=2,Fi=0,As=1,Yl=2,$l=3,Jl=4,dd=5,Ji=100,fd=101,pd=102,md=103,gd=104,_d=200,vd=201,xd=202,yd=203,bo=204,Eo=205,Md=206,Sd=207,bd=208,Ed=209,Ad=210,wd=211,Td=212,Cd=213,Rd=214,Ao=0,wo=1,To=2,Rs=3,Co=4,Ro=5,Lo=6,Po=7,ya=0,Ld=1,Pd=2,Oi=0,Dd=1,Ud=2,Nd=3,qh=4,Id=5,Fd=6,Od=7,Kl="attached",zd="detached",jh=300,Ls=301,Ps=302,Do=303,Uo=304,Ma=306,ai=1e3,Jn=1001,No=1002,On=1003,Bd=1004,fr=1005,Fn=1006,La=1007,xi=1008,ci=1009,Yh=1010,$h=1011,ir=1012,Ml=1013,es=1014,oi=1015,cr=1016,Sl=1017,bl=1018,sr=1020,Jh=35902,Kh=1021,Zh=1022,Wn=1023,rr=1026,ar=1027,Qh=1028,El=1029,eu=1030,Al=1031,wl=1033,ta=33776,na=33777,ia=33778,sa=33779,Io=35840,Fo=35841,Oo=35842,zo=35843,Bo=36196,ko=37492,Vo=37496,Ho=37808,Go=37809,Wo=37810,Xo=37811,qo=37812,jo=37813,Yo=37814,$o=37815,Jo=37816,Ko=37817,Zo=37818,Qo=37819,el=37820,tl=37821,ra=36492,nl=36494,il=36495,tu=36283,sl=36284,rl=36285,al=36286,ua=2300,ol=2301,Pa=2302,Zl=2400,Ql=2401,ec=2402,kd=2500,Vd=3200,Hd=3201,Sa=0,Gd=1,Ni="",$t="srgb",Ds="srgb-linear",da="linear",rn="srgb",ss=7680,tc=519,Wd=512,Xd=513,qd=514,nu=515,jd=516,Yd=517,$d=518,Jd=519,ll=35044,nc="300 es",yi=2e3,fa=2001;class ns{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,e);e.target=null}}}const En=["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 ic=1234567;const Zs=Math.PI/180,Us=180/Math.PI;function Zn(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(En[s&255]+En[s>>8&255]+En[s>>16&255]+En[s>>24&255]+"-"+En[e&255]+En[e>>8&255]+"-"+En[e>>16&15|64]+En[e>>24&255]+"-"+En[t&63|128]+En[t>>8&255]+"-"+En[t>>16&255]+En[t>>24&255]+En[n&255]+En[n>>8&255]+En[n>>16&255]+En[n>>24&255]).toLowerCase()}function It(s,e,t){return Math.max(e,Math.min(t,s))}function Tl(s,e){return(s%e+e)%e}function Kd(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function Zd(s,e,t){return s!==e?(t-s)/(e-s):0}function Qs(s,e,t){return(1-t)*s+t*e}function Qd(s,e,t,n){return Qs(s,e,1-Math.exp(-t*n))}function ef(s,e=1){return e-Math.abs(Tl(s,e*2)-e)}function tf(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function nf(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function sf(s,e){return s+Math.floor(Math.random()*(e-s+1))}function rf(s,e){return s+Math.random()*(e-s)}function af(s){return s*(.5-Math.random())}function of(s){s!==void 0&&(ic=s);let e=ic+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function lf(s){return s*Zs}function cf(s){return s*Us}function hf(s){return(s&s-1)===0&&s!==0}function uf(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function df(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function ff(s,e,t,n,i){const r=Math.cos,a=Math.sin,o=r(t/2),l=a(t/2),c=r((e+n)/2),h=a((e+n)/2),d=r((e-n)/2),u=a((e-n)/2),f=r((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":s.set(o*h,l*d,l*u,o*c);break;case"YZY":s.set(l*u,o*h,l*d,o*c);break;case"ZXZ":s.set(l*d,l*u,o*h,o*c);break;case"XZX":s.set(o*h,l*m,l*f,o*c);break;case"YXY":s.set(l*f,o*h,l*m,o*c);break;case"ZYZ":s.set(l*m,l*f,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function $n(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function tn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Ki={DEG2RAD:Zs,RAD2DEG:Us,generateUUID:Zn,clamp:It,euclideanModulo:Tl,mapLinear:Kd,inverseLerp:Zd,lerp:Qs,damp:Qd,pingpong:ef,smoothstep:tf,smootherstep:nf,randInt:sf,randFloat:rf,randFloatSpread:af,seededRandom:of,degToRad:lf,radToDeg:cf,isPowerOfTwo:hf,ceilPowerOfTwo:uf,floorPowerOfTwo:df,setQuaternionFromProperEuler:ff,normalize:tn,denormalize:$n};class Qe{constructor(e=0,t=0){Qe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(It(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(It(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class zn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],d=n[i+3];const u=r[a+0],f=r[a+1],m=r[a+2],_=r[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d;return}if(o===1){e[t+0]=u,e[t+1]=f,e[t+2]=m,e[t+3]=_;return}if(d!==_||l!==u||c!==f||h!==m){let g=1-o;const p=l*u+c*f+h*m+d*_,E=p>=0?1:-1,b=1-p*p;if(b>Number.EPSILON){const U=Math.sqrt(b),R=Math.atan2(U,p*E);g=Math.sin(g*R)/U,o=Math.sin(o*R)/U}const M=o*E;if(l=l*g+u*M,c=c*g+f*M,h=h*g+m*M,d=d*g+_*M,g===1-o){const U=1/Math.sqrt(l*l+c*c+h*h+d*d);l*=U,c*=U,h*=U,d*=U}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=d}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],d=r[a],u=r[a+1],f=r[a+2],m=r[a+3];return e[t]=o*m+h*d+l*f-c*u,e[t+1]=l*m+h*u+c*d-o*f,e[t+2]=c*m+h*f+o*u-l*d,e[t+3]=h*m-o*d-l*u-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),d=o(r/2),u=l(n/2),f=l(i/2),m=l(r/2);switch(a){case"XYZ":this._x=u*h*d+c*f*m,this._y=c*f*d-u*h*m,this._z=c*h*m+u*f*d,this._w=c*h*d-u*f*m;break;case"YXZ":this._x=u*h*d+c*f*m,this._y=c*f*d-u*h*m,this._z=c*h*m-u*f*d,this._w=c*h*d+u*f*m;break;case"ZXY":this._x=u*h*d-c*f*m,this._y=c*f*d+u*h*m,this._z=c*h*m+u*f*d,this._w=c*h*d-u*f*m;break;case"ZYX":this._x=u*h*d-c*f*m,this._y=c*f*d+u*h*m,this._z=c*h*m-u*f*d,this._w=c*h*d+u*f*m;break;case"YZX":this._x=u*h*d+c*f*m,this._y=c*f*d+u*h*m,this._z=c*h*m-u*f*d,this._w=c*h*d-u*f*m;break;case"XZY":this._x=u*h*d-c*f*m,this._y=c*f*d-u*h*m,this._z=c*h*m+u*f*d,this._w=c*h*d+u*f*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],d=t[10],u=n+o+d;if(u>0){const f=.5/Math.sqrt(u+1);this._w=.25/f,this._x=(h-l)*f,this._y=(r-c)*f,this._z=(a-i)*f}else if(n>o&&n>d){const f=2*Math.sqrt(1+n-o-d);this._w=(h-l)/f,this._x=.25*f,this._y=(i+a)/f,this._z=(r+c)/f}else if(o>d){const f=2*Math.sqrt(1+o-n-d);this._w=(r-c)/f,this._x=(i+a)/f,this._y=.25*f,this._z=(l+h)/f}else{const f=2*Math.sqrt(1+d-n-o);this._w=(a-i)/f,this._x=(r+c)/f,this._y=(l+h)/f,this._z=.25*f}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(It(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-r*l,this._y=i*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const f=1-t;return this._w=f*a+t*this._w,this._x=f*n+t*this._x,this._y=f*i+t*this._y,this._z=f*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),d=Math.sin((1-t)*h)/c,u=Math.sin(t*h)/c;return this._w=a*d+this._w*u,this._x=n*d+this._x*u,this._y=i*d+this._y*u,this._z=r*d+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(sc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(sc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-r*i),d=2*(r*n-a*t);return this.x=t+l*c+a*d-o*h,this.y=n+l*h+o*c-r*d,this.z=i+l*d+r*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this.z=It(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this.z=It(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(It(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-r*o,this.y=r*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Da.copy(this).projectOnVector(e),this.sub(Da)}reflect(e){return this.sub(Da.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(It(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Da=new F,sc=new zn;class Nt{constructor(e,t,n,i,r,a,o,l,c){Nt.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c)}set(e,t,n,i,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],d=n[7],u=n[2],f=n[5],m=n[8],_=i[0],g=i[3],p=i[6],E=i[1],b=i[4],M=i[7],U=i[2],R=i[5],P=i[8];return r[0]=a*_+o*E+l*U,r[3]=a*g+o*b+l*R,r[6]=a*p+o*M+l*P,r[1]=c*_+h*E+d*U,r[4]=c*g+h*b+d*R,r[7]=c*p+h*M+d*P,r[2]=u*_+f*E+m*U,r[5]=u*g+f*b+m*R,r[8]=u*p+f*M+m*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*r*h+n*o*l+i*r*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=h*a-o*c,u=o*l-h*r,f=c*r-a*l,m=t*d+n*u+i*f;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=d*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=u*_,e[4]=(h*t-i*l)*_,e[5]=(i*r-o*t)*_,e[6]=f*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ua.makeScale(e,t)),this}rotate(e){return this.premultiply(Ua.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ua.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Ua=new Nt;function iu(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}function or(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function pf(){const s=or("canvas");return s.style.display="block",s}const rc={};function ws(s){s in rc||(rc[s]=!0,console.warn(s))}function mf(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function gf(s){const e=s.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function _f(s){const e=s.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const ac=new Nt().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),oc=new Nt().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function vf(){const s={enabled:!0,workingColorSpace:Ds,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===rn&&(i.r=Mi(i.r),i.g=Mi(i.g),i.b=Mi(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===rn&&(i.r=Ts(i.r),i.g=Ts(i.g),i.b=Ts(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ni?da:this.spaces[i].transfer},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ds]:{primaries:e,whitePoint:n,transfer:da,toXYZ:ac,fromXYZ:oc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:$t},outputColorSpaceConfig:{drawingBufferColorSpace:$t}},[$t]:{primaries:e,whitePoint:n,transfer:rn,toXYZ:ac,fromXYZ:oc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:$t}}}),s}const kt=vf();function Mi(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function Ts(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let rs;class xf{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{rs===void 0&&(rs=or("canvas")),rs.width=e.width,rs.height=e.height;const i=rs.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=rs}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=or("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=Mi(r[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Mi(t[n]/255)*255):t[n]=Mi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let yf=0;class Cl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:yf++}),this.uuid=Zn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(Na(i[a].image)):r.push(Na(i[a]))}else r=Na(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function Na(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?xf.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Mf=0;const Ia=new F;class bn extends ns{constructor(e=bn.DEFAULT_IMAGE,t=bn.DEFAULT_MAPPING,n=Jn,i=Jn,r=Fn,a=xi,o=Wn,l=ci,c=bn.DEFAULT_ANISOTROPY,h=Ni){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Mf++}),this.uuid=Zn(),this.name="",this.source=new Cl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Qe(0,0),this.repeat=new Qe(1,1),this.center=new Qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Nt,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Ia).x}get height(){return this.source.getSize(Ia).y}get depth(){return this.source.getSize(Ia).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==jh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ai:e.x=e.x-Math.floor(e.x);break;case Jn:e.x=e.x<0?0:1;break;case No:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ai:e.y=e.y-Math.floor(e.y);break;case Jn:e.y=e.y<0?0:1;break;case No:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}bn.DEFAULT_IMAGE=null;bn.DEFAULT_MAPPING=jh;bn.DEFAULT_ANISOTROPY=1;class Gt{constructor(e=0,t=0,n=0,i=1){Gt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const l=e.elements,c=l[0],h=l[4],d=l[8],u=l[1],f=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-u)<.01&&Math.abs(d-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+u)<.1&&Math.abs(d+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+f+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const b=(c+1)/2,M=(f+1)/2,U=(p+1)/2,R=(h+u)/4,P=(d+_)/4,D=(m+g)/4;return b>M&&b>U?b<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(b),i=R/n,r=P/n):M>U?M<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(M),n=R/i,r=D/i):U<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(U),n=P/r,i=D/r),this.set(n,i,r,t),this}let E=Math.sqrt((g-m)*(g-m)+(d-_)*(d-_)+(u-h)*(u-h));return Math.abs(E)<.001&&(E=1),this.x=(g-m)/E,this.y=(d-_)/E,this.z=(u-h)/E,this.w=Math.acos((c+f+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=It(this.x,e.x,t.x),this.y=It(this.y,e.y,t.y),this.z=It(this.z,e.z,t.z),this.w=It(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=It(this.x,e,t),this.y=It(this.y,e,t),this.z=It(this.z,e,t),this.w=It(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(It(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Sf extends ns{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Fn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Gt(0,0,e,t),this.scissorTest=!1,this.viewport=new Gt(0,0,e,t);const i={width:e,height:t,depth:n.depth},r=new bn(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Fn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Cl(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ts extends Sf{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class su extends bn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=On,this.minFilter=On,this.wrapR=Jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class bf extends bn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=On,this.minFilter=On,this.wrapR=Jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ei{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=qn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,qn):qn.fromBufferAttribute(r,a),qn.applyMatrix4(e.matrixWorld),this.expandByPoint(qn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),pr.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),pr.copy(n.boundingBox)),pr.applyMatrix4(e.matrixWorld),this.union(pr)}const i=e.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qn),qn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Vs),mr.subVectors(this.max,Vs),as.subVectors(e.a,Vs),os.subVectors(e.b,Vs),ls.subVectors(e.c,Vs),wi.subVectors(os,as),Ti.subVectors(ls,os),Vi.subVectors(as,ls);let t=[0,-wi.z,wi.y,0,-Ti.z,Ti.y,0,-Vi.z,Vi.y,wi.z,0,-wi.x,Ti.z,0,-Ti.x,Vi.z,0,-Vi.x,-wi.y,wi.x,0,-Ti.y,Ti.x,0,-Vi.y,Vi.x,0];return!Fa(t,as,os,ls,mr)||(t=[1,0,0,0,1,0,0,0,1],!Fa(t,as,os,ls,mr))?!1:(gr.crossVectors(wi,Ti),t=[gr.x,gr.y,gr.z],Fa(t,as,os,ls,mr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(di[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),di[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),di[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),di[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),di[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),di[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),di[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),di[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(di),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const di=[new F,new F,new F,new F,new F,new F,new F,new F],qn=new F,pr=new ei,as=new F,os=new F,ls=new F,wi=new F,Ti=new F,Vi=new F,Vs=new F,mr=new F,gr=new F,Hi=new F;function Fa(s,e,t,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){Hi.fromArray(s,r);const o=i.x*Math.abs(Hi.x)+i.y*Math.abs(Hi.y)+i.z*Math.abs(Hi.z),l=e.dot(Hi),c=t.dot(Hi),h=n.dot(Hi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Ef=new ei,Hs=new F,Oa=new F;class Ei{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):Ef.setFromPoints(e).getCenter(n);let i=0;for(let r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Hs.subVectors(e,this.center);const t=Hs.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Hs,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Oa.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Hs.copy(e.center).add(Oa)),this.expandByPoint(Hs.copy(e.center).sub(Oa))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const fi=new F,za=new F,_r=new F,Ci=new F,Ba=new F,vr=new F,ka=new F;class Fs{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=fi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fi.copy(this.origin).addScaledVector(this.direction,t),fi.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){za.copy(e).add(t).multiplyScalar(.5),_r.copy(t).sub(e).normalize(),Ci.copy(this.origin).sub(za);const r=e.distanceTo(t)*.5,a=-this.direction.dot(_r),o=Ci.dot(this.direction),l=-Ci.dot(_r),c=Ci.lengthSq(),h=Math.abs(1-a*a);let d,u,f,m;if(h>0)if(d=a*l-o,u=a*o-l,m=r*h,d>=0)if(u>=-m)if(u<=m){const _=1/h;d*=_,u*=_,f=d*(d+a*u+2*o)+u*(a*d+u+2*l)+c}else u=r,d=Math.max(0,-(a*u+o)),f=-d*d+u*(u+2*l)+c;else u=-r,d=Math.max(0,-(a*u+o)),f=-d*d+u*(u+2*l)+c;else u<=-m?(d=Math.max(0,-(-a*r+o)),u=d>0?-r:Math.min(Math.max(-r,-l),r),f=-d*d+u*(u+2*l)+c):u<=m?(d=0,u=Math.min(Math.max(-r,-l),r),f=u*(u+2*l)+c):(d=Math.max(0,-(a*r+o)),u=d>0?r:Math.min(Math.max(-r,-l),r),f=-d*d+u*(u+2*l)+c);else u=a>0?-r:r,d=Math.max(0,-(a*u+o)),f=-d*d+u*(u+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,d),i&&i.copy(za).addScaledVector(_r,u),f}intersectSphere(e,t){fi.subVectors(e.center,this.origin);const n=fi.dot(this.direction),i=fi.dot(fi)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,u=this.origin;return c>=0?(n=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(n=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),h>=0?(r=(e.min.y-u.y)*h,a=(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,a=(e.min.y-u.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),d>=0?(o=(e.min.z-u.z)*d,l=(e.max.z-u.z)*d):(o=(e.max.z-u.z)*d,l=(e.min.z-u.z)*d),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,fi)!==null}intersectTriangle(e,t,n,i,r){Ba.subVectors(t,e),vr.subVectors(n,e),ka.crossVectors(Ba,vr);let a=this.direction.dot(ka),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ci.subVectors(this.origin,e);const l=o*this.direction.dot(vr.crossVectors(Ci,vr));if(l<0)return null;const c=o*this.direction.dot(Ba.cross(Ci));if(c<0||l+c>a)return null;const h=-o*Ci.dot(ka);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class bt{constructor(e,t,n,i,r,a,o,l,c,h,d,u,f,m,_,g){bt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c,h,d,u,f,m,_,g)}set(e,t,n,i,r,a,o,l,c,h,d,u,f,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=r,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=d,p[14]=u,p[3]=f,p[7]=m,p[11]=_,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 bt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/cs.setFromMatrixColumn(e,0).length(),r=1/cs.setFromMatrixColumn(e,1).length(),a=1/cs.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),d=Math.sin(r);if(e.order==="XYZ"){const u=a*h,f=a*d,m=o*h,_=o*d;t[0]=l*h,t[4]=-l*d,t[8]=c,t[1]=f+m*c,t[5]=u-_*c,t[9]=-o*l,t[2]=_-u*c,t[6]=m+f*c,t[10]=a*l}else if(e.order==="YXZ"){const u=l*h,f=l*d,m=c*h,_=c*d;t[0]=u+_*o,t[4]=m*o-f,t[8]=a*c,t[1]=a*d,t[5]=a*h,t[9]=-o,t[2]=f*o-m,t[6]=_+u*o,t[10]=a*l}else if(e.order==="ZXY"){const u=l*h,f=l*d,m=c*h,_=c*d;t[0]=u-_*o,t[4]=-a*d,t[8]=m+f*o,t[1]=f+m*o,t[5]=a*h,t[9]=_-u*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const u=a*h,f=a*d,m=o*h,_=o*d;t[0]=l*h,t[4]=m*c-f,t[8]=u*c+_,t[1]=l*d,t[5]=_*c+u,t[9]=f*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const u=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-u*d,t[8]=m*d+f,t[1]=d,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=f*d+m,t[10]=u-_*d}else if(e.order==="XZY"){const u=a*l,f=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-d,t[8]=c*h,t[1]=u*d+_,t[5]=a*h,t[9]=f*d-m,t[2]=m*d-f,t[6]=o*h,t[10]=_*d+u}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(Af,e,wf)}lookAt(e,t,n){const i=this.elements;return Nn.subVectors(e,t),Nn.lengthSq()===0&&(Nn.z=1),Nn.normalize(),Ri.crossVectors(n,Nn),Ri.lengthSq()===0&&(Math.abs(n.z)===1?Nn.x+=1e-4:Nn.z+=1e-4,Nn.normalize(),Ri.crossVectors(n,Nn)),Ri.normalize(),xr.crossVectors(Nn,Ri),i[0]=Ri.x,i[4]=xr.x,i[8]=Nn.x,i[1]=Ri.y,i[5]=xr.y,i[9]=Nn.y,i[2]=Ri.z,i[6]=xr.z,i[10]=Nn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],d=n[5],u=n[9],f=n[13],m=n[2],_=n[6],g=n[10],p=n[14],E=n[3],b=n[7],M=n[11],U=n[15],R=i[0],P=i[4],D=i[8],S=i[12],y=i[1],N=i[5],W=i[9],X=i[13],Q=i[2],ne=i[6],H=i[10],se=i[14],Z=i[3],pe=i[7],be=i[11],Ce=i[15];return r[0]=a*R+o*y+l*Q+c*Z,r[4]=a*P+o*N+l*ne+c*pe,r[8]=a*D+o*W+l*H+c*be,r[12]=a*S+o*X+l*se+c*Ce,r[1]=h*R+d*y+u*Q+f*Z,r[5]=h*P+d*N+u*ne+f*pe,r[9]=h*D+d*W+u*H+f*be,r[13]=h*S+d*X+u*se+f*Ce,r[2]=m*R+_*y+g*Q+p*Z,r[6]=m*P+_*N+g*ne+p*pe,r[10]=m*D+_*W+g*H+p*be,r[14]=m*S+_*X+g*se+p*Ce,r[3]=E*R+b*y+M*Q+U*Z,r[7]=E*P+b*N+M*ne+U*pe,r[11]=E*D+b*W+M*H+U*be,r[15]=E*S+b*X+M*se+U*Ce,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],d=e[6],u=e[10],f=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+r*l*d-i*c*d-r*o*u+n*c*u+i*o*f-n*l*f)+_*(+t*l*f-t*c*u+r*a*u-i*a*f+i*c*h-r*l*h)+g*(+t*c*d-t*o*f-r*a*d+n*a*f+r*o*h-n*c*h)+p*(-i*o*h-t*l*d+t*o*u+i*a*d-n*a*u+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],d=e[9],u=e[10],f=e[11],m=e[12],_=e[13],g=e[14],p=e[15],E=d*g*c-_*u*c+_*l*f-o*g*f-d*l*p+o*u*p,b=m*u*c-h*g*c-m*l*f+a*g*f+h*l*p-a*u*p,M=h*_*c-m*d*c+m*o*f-a*_*f-h*o*p+a*d*p,U=m*d*l-h*_*l-m*o*u+a*_*u+h*o*g-a*d*g,R=t*E+n*b+i*M+r*U;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/R;return e[0]=E*P,e[1]=(_*u*r-d*g*r-_*i*f+n*g*f+d*i*p-n*u*p)*P,e[2]=(o*g*r-_*l*r+_*i*c-n*g*c-o*i*p+n*l*p)*P,e[3]=(d*l*r-o*u*r-d*i*c+n*u*c+o*i*f-n*l*f)*P,e[4]=b*P,e[5]=(h*g*r-m*u*r+m*i*f-t*g*f-h*i*p+t*u*p)*P,e[6]=(m*l*r-a*g*r-m*i*c+t*g*c+a*i*p-t*l*p)*P,e[7]=(a*u*r-h*l*r+h*i*c-t*u*c-a*i*f+t*l*f)*P,e[8]=M*P,e[9]=(m*d*r-h*_*r-m*n*f+t*_*f+h*n*p-t*d*p)*P,e[10]=(a*_*r-m*o*r+m*n*c-t*_*c-a*n*p+t*o*p)*P,e[11]=(h*o*r-a*d*r-h*n*c+t*d*c+a*n*f-t*o*f)*P,e[12]=U*P,e[13]=(h*_*i-m*d*i+m*n*u-t*_*u-h*n*g+t*d*g)*P,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*P,e[15]=(a*d*i-h*o*i+h*n*l-t*d*l-a*n*u+t*o*u)*P,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,d=o+o,u=r*c,f=r*h,m=r*d,_=a*h,g=a*d,p=o*d,E=l*c,b=l*h,M=l*d,U=n.x,R=n.y,P=n.z;return i[0]=(1-(_+p))*U,i[1]=(f+M)*U,i[2]=(m-b)*U,i[3]=0,i[4]=(f-M)*R,i[5]=(1-(u+p))*R,i[6]=(g+E)*R,i[7]=0,i[8]=(m+b)*P,i[9]=(g-E)*P,i[10]=(1-(u+_))*P,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=cs.set(i[0],i[1],i[2]).length();const a=cs.set(i[4],i[5],i[6]).length(),o=cs.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],jn.copy(this);const c=1/r,h=1/a,d=1/o;return jn.elements[0]*=c,jn.elements[1]*=c,jn.elements[2]*=c,jn.elements[4]*=h,jn.elements[5]*=h,jn.elements[6]*=h,jn.elements[8]*=d,jn.elements[9]*=d,jn.elements[10]*=d,t.setFromRotationMatrix(jn),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,i,r,a,o=yi){const l=this.elements,c=2*r/(t-e),h=2*r/(n-i),d=(t+e)/(t-e),u=(n+i)/(n-i);let f,m;if(o===yi)f=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===fa)f=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=d,l[12]=0,l[1]=0,l[5]=h,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=f,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=yi){const l=this.elements,c=1/(t-e),h=1/(n-i),d=1/(a-r),u=(t+e)*c,f=(n+i)*h;let m,_;if(o===yi)m=(a+r)*d,_=-2*d;else if(o===fa)m=r*d,_=-1*d;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-f,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const cs=new F,jn=new bt,Af=new F(0,0,0),wf=new F(1,1,1),Ri=new F,xr=new F,Nn=new F,lc=new bt,cc=new zn;class Ln{constructor(e=0,t=0,n=0,i=Ln.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],d=i[2],u=i[6],f=i[10];switch(t){case"XYZ":this._y=Math.asin(It(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,f),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-It(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,f),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-d,r),this._z=0);break;case"ZXY":this._x=Math.asin(It(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-d,f),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-It(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(u,f),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(It(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-d,r)):(this._x=0,this._y=Math.atan2(o,f));break;case"XZY":this._z=Math.asin(-It(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,f),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return lc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(lc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return cc.setFromEuler(this),this.setFromQuaternion(cc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ln.DEFAULT_ORDER="XYZ";class Rl{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Tf=0;const hc=new F,hs=new zn,pi=new bt,yr=new F,Gs=new F,Cf=new F,Rf=new zn,uc=new F(1,0,0),dc=new F(0,1,0),fc=new F(0,0,1),pc={type:"added"},Lf={type:"removed"},us={type:"childadded",child:null},Va={type:"childremoved",child:null};class an extends ns{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Tf++}),this.uuid=Zn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=an.DEFAULT_UP.clone();const e=new F,t=new Ln,n=new zn,i=new F(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new bt},normalMatrix:{value:new Nt}}),this.matrix=new bt,this.matrixWorld=new bt,this.matrixAutoUpdate=an.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Rl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hs.setFromAxisAngle(e,t),this.quaternion.multiply(hs),this}rotateOnWorldAxis(e,t){return hs.setFromAxisAngle(e,t),this.quaternion.premultiply(hs),this}rotateX(e){return this.rotateOnAxis(uc,e)}rotateY(e){return this.rotateOnAxis(dc,e)}rotateZ(e){return this.rotateOnAxis(fc,e)}translateOnAxis(e,t){return hc.copy(e).applyQuaternion(this.quaternion),this.position.add(hc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(uc,e)}translateY(e){return this.translateOnAxis(dc,e)}translateZ(e){return this.translateOnAxis(fc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(pi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?yr.copy(e):yr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Gs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?pi.lookAt(Gs,yr,this.up):pi.lookAt(yr,Gs,this.up),this.quaternion.setFromRotationMatrix(pi),i&&(pi.extractRotation(i.matrixWorld),hs.setFromRotationMatrix(pi),this.quaternion.premultiply(hs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(pc),us.child=e,this.dispatchEvent(us),us.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Lf),Va.child=e,this.dispatchEvent(Va),Va.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),pi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),pi.multiply(e.parent.matrixWorld)),e.applyMatrix4(pi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(pc),us.child=e,this.dispatchEvent(us),us.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gs,e,Cf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gs,Rf,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const d=l[c];r(e.shapes,d)}else r(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(e.materials,this.material[l]));i.material=o}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(r(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),d=a(e.shapes),u=a(e.skeletons),f=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),d.length>0&&(n.shapes=d),u.length>0&&(n.skeletons=u),f.length>0&&(n.animations=f),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}an.DEFAULT_UP=new F(0,1,0);an.DEFAULT_MATRIX_AUTO_UPDATE=!0;an.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Yn=new F,mi=new F,Ha=new F,gi=new F,ds=new F,fs=new F,mc=new F,Ga=new F,Wa=new F,Xa=new F,qa=new Gt,ja=new Gt,Ya=new Gt;class Gn{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Yn.subVectors(e,t),i.cross(Yn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Yn.subVectors(i,t),mi.subVectors(n,t),Ha.subVectors(e,t);const a=Yn.dot(Yn),o=Yn.dot(mi),l=Yn.dot(Ha),c=mi.dot(mi),h=mi.dot(Ha),d=a*c-o*o;if(d===0)return r.set(0,0,0),null;const u=1/d,f=(c*l-o*h)*u,m=(a*h-o*l)*u;return r.set(1-f-m,m,f)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,gi)===null?!1:gi.x>=0&&gi.y>=0&&gi.x+gi.y<=1}static getInterpolation(e,t,n,i,r,a,o,l){return this.getBarycoord(e,t,n,i,gi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,gi.x),l.addScaledVector(a,gi.y),l.addScaledVector(o,gi.z),l)}static getInterpolatedAttribute(e,t,n,i,r,a){return qa.setScalar(0),ja.setScalar(0),Ya.setScalar(0),qa.fromBufferAttribute(e,t),ja.fromBufferAttribute(e,n),Ya.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(qa,r.x),a.addScaledVector(ja,r.y),a.addScaledVector(Ya,r.z),a}static isFrontFacing(e,t,n,i){return Yn.subVectors(n,t),mi.subVectors(e,t),Yn.cross(mi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Yn.subVectors(this.c,this.b),mi.subVectors(this.a,this.b),Yn.cross(mi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Gn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Gn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return Gn.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return Gn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Gn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;ds.subVectors(i,n),fs.subVectors(r,n),Ga.subVectors(e,n);const l=ds.dot(Ga),c=fs.dot(Ga);if(l<=0&&c<=0)return t.copy(n);Wa.subVectors(e,i);const h=ds.dot(Wa),d=fs.dot(Wa);if(h>=0&&d<=h)return t.copy(i);const u=l*d-h*c;if(u<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(ds,a);Xa.subVectors(e,r);const f=ds.dot(Xa),m=fs.dot(Xa);if(m>=0&&f<=m)return t.copy(r);const _=f*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(fs,o);const g=h*m-f*d;if(g<=0&&d-h>=0&&f-m>=0)return mc.subVectors(r,i),o=(d-h)/(d-h+(f-m)),t.copy(i).addScaledVector(mc,o);const p=1/(g+_+u);return a=_*p,o=u*p,t.copy(n).addScaledVector(ds,a).addScaledVector(fs,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ru={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},Li={h:0,s:0,l:0},Mr={h:0,s:0,l:0};function $a(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class vt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=$t){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,kt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=kt.workingColorSpace){return this.r=e,this.g=t,this.b=n,kt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=kt.workingColorSpace){if(e=Tl(e,1),t=It(t,0,1),n=It(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=$a(a,r,e+1/3),this.g=$a(a,r,e),this.b=$a(a,r,e-1/3)}return kt.colorSpaceToWorking(this,i),this}setStyle(e,t=$t){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=$t){const n=ru[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Mi(e.r),this.g=Mi(e.g),this.b=Mi(e.b),this}copyLinearToSRGB(e){return this.r=Ts(e.r),this.g=Ts(e.g),this.b=Ts(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=$t){return kt.workingToColorSpace(An.copy(this),e),Math.round(It(An.r*255,0,255))*65536+Math.round(It(An.g*255,0,255))*256+Math.round(It(An.b*255,0,255))}getHexString(e=$t){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=kt.workingColorSpace){kt.workingToColorSpace(An.copy(this),t);const n=An.r,i=An.g,r=An.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const d=a-o;switch(c=h<=.5?d/(a+o):d/(2-a-o),a){case n:l=(i-r)/d+(i<r?6:0);break;case i:l=(r-n)/d+2;break;case r:l=(n-i)/d+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=kt.workingColorSpace){return kt.workingToColorSpace(An.copy(this),t),e.r=An.r,e.g=An.g,e.b=An.b,e}getStyle(e=$t){kt.workingToColorSpace(An.copy(this),e);const t=An.r,n=An.g,i=An.b;return e!==$t?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Li),this.setHSL(Li.h+e,Li.s+t,Li.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Li),e.getHSL(Mr);const n=Qs(Li.h,Mr.h,t),i=Qs(Li.s,Mr.s,t),r=Qs(Li.l,Mr.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const An=new vt;vt.NAMES=ru;let Pf=0;class Bn extends ns{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Pf++}),this.uuid=Zn(),this.name="",this.type="Material",this.blending=As,this.side=Xn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=bo,this.blendDst=Eo,this.blendEquation=Ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new vt(0,0,0),this.blendAlpha=0,this.depthFunc=Rs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=tc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ss,this.stencilZFail=ss,this.stencilZPass=ss,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.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!==void 0&&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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),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(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).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!==As&&(n.blending=this.blending),this.side!==Xn&&(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!==bo&&(n.blendSrc=this.blendSrc),this.blendDst!==Eo&&(n.blendDst=this.blendDst),this.blendEquation!==Ji&&(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!==Rs&&(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!==tc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ss&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ss&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ss&&(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 i(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(t){const r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class zi extends Bn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.combine=ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const pn=new F,Sr=new Qe;let Df=0;class fn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Df++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=ll,this.updateRanges=[],this.gpuType=oi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Sr.fromBufferAttribute(this,t),Sr.applyMatrix3(e),this.setXY(t,Sr.x,Sr.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyMatrix3(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyMatrix4(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.applyNormalMatrix(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)pn.fromBufferAttribute(this,t),pn.transformDirection(e),this.setXYZ(t,pn.x,pn.y,pn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=$n(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=tn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=$n(t,this.array)),t}setX(e,t){return this.normalized&&(t=tn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=$n(t,this.array)),t}setY(e,t){return this.normalized&&(t=tn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=$n(t,this.array)),t}setZ(e,t){return this.normalized&&(t=tn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=$n(t,this.array)),t}setW(e,t){return this.normalized&&(t=tn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=tn(t,this.array),n=tn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=tn(t,this.array),n=tn(n,this.array),i=tn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=tn(t,this.array),n=tn(n,this.array),i=tn(i,this.array),r=tn(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==ll&&(e.usage=this.usage),e}}class au extends fn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Uf extends fn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class ou extends fn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Dt extends fn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let Nf=0;const Vn=new bt,Ja=new an,ps=new F,In=new ei,Ws=new ei,vn=new F;class ln extends ns{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:Nf++}),this.uuid=Zn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(iu(e)?ou:au)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new Nt().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Vn.makeRotationFromQuaternion(e),this.applyMatrix4(Vn),this}rotateX(e){return Vn.makeRotationX(e),this.applyMatrix4(Vn),this}rotateY(e){return Vn.makeRotationY(e),this.applyMatrix4(Vn),this}rotateZ(e){return Vn.makeRotationZ(e),this.applyMatrix4(Vn),this}translate(e,t,n){return Vn.makeTranslation(e,t,n),this.applyMatrix4(Vn),this}scale(e,t,n){return Vn.makeScale(e,t,n),this.applyMatrix4(Vn),this}lookAt(e){return Ja.lookAt(e),Ja.updateMatrix(),this.applyMatrix4(Ja.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ps).negate(),this.translate(ps.x,ps.y,ps.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,r=e.length;i<r;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Dt(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const r=e[i];t.setXYZ(i,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];In.setFromBufferAttribute(r),this.morphTargetsRelative?(vn.addVectors(this.boundingBox.min,In.min),this.boundingBox.expandByPoint(vn),vn.addVectors(this.boundingBox.max,In.max),this.boundingBox.expandByPoint(vn)):(this.boundingBox.expandByPoint(In.min),this.boundingBox.expandByPoint(In.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 Ei);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){const n=this.boundingSphere.center;if(In.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];Ws.setFromBufferAttribute(o),this.morphTargetsRelative?(vn.addVectors(In.min,Ws.min),In.expandByPoint(vn),vn.addVectors(In.max,Ws.max),In.expandByPoint(vn)):(In.expandByPoint(Ws.min),In.expandByPoint(Ws.max))}In.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)vn.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(vn));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)vn.fromBufferAttribute(o,c),l&&(ps.fromBufferAttribute(e,c),vn.add(ps)),i=Math.max(i,n.distanceToSquared(vn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new fn(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let D=0;D<n.count;D++)o[D]=new F,l[D]=new F;const c=new F,h=new F,d=new F,u=new Qe,f=new Qe,m=new Qe,_=new F,g=new F;function p(D,S,y){c.fromBufferAttribute(n,D),h.fromBufferAttribute(n,S),d.fromBufferAttribute(n,y),u.fromBufferAttribute(r,D),f.fromBufferAttribute(r,S),m.fromBufferAttribute(r,y),h.sub(c),d.sub(c),f.sub(u),m.sub(u);const N=1/(f.x*m.y-m.x*f.y);isFinite(N)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(N),g.copy(d).multiplyScalar(f.x).addScaledVector(h,-m.x).multiplyScalar(N),o[D].add(_),o[S].add(_),o[y].add(_),l[D].add(g),l[S].add(g),l[y].add(g))}let E=this.groups;E.length===0&&(E=[{start:0,count:e.count}]);for(let D=0,S=E.length;D<S;++D){const y=E[D],N=y.start,W=y.count;for(let X=N,Q=N+W;X<Q;X+=3)p(e.getX(X+0),e.getX(X+1),e.getX(X+2))}const b=new F,M=new F,U=new F,R=new F;function P(D){U.fromBufferAttribute(i,D),R.copy(U);const S=o[D];b.copy(S),b.sub(U.multiplyScalar(U.dot(S))).normalize(),M.crossVectors(R,S);const N=M.dot(l[D])<0?-1:1;a.setXYZW(D,b.x,b.y,b.z,N)}for(let D=0,S=E.length;D<S;++D){const y=E[D],N=y.start,W=y.count;for(let X=N,Q=N+W;X<Q;X+=3)P(e.getX(X+0)),P(e.getX(X+1)),P(e.getX(X+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new fn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let u=0,f=n.count;u<f;u++)n.setXYZ(u,0,0,0);const i=new F,r=new F,a=new F,o=new F,l=new F,c=new F,h=new F,d=new F;if(e)for(let u=0,f=e.count;u<f;u+=3){const m=e.getX(u+0),_=e.getX(u+1),g=e.getX(u+2);i.fromBufferAttribute(t,m),r.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,r),d.subVectors(i,r),h.cross(d),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let u=0,f=t.count;u<f;u+=3)i.fromBufferAttribute(t,u+0),r.fromBufferAttribute(t,u+1),a.fromBufferAttribute(t,u+2),h.subVectors(a,r),d.subVectors(i,r),h.cross(d),n.setXYZ(u+0,h.x,h.y,h.z),n.setXYZ(u+1,h.x,h.y,h.z),n.setXYZ(u+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)vn.fromBufferAttribute(e,t),vn.normalize(),e.setXYZ(t,vn.x,vn.y,vn.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,d=o.normalized,u=new c.constructor(l.length*h);let f=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?f=l[_]*o.data.stride+o.offset:f=l[_]*h;for(let p=0;p<h;p++)u[m++]=c[f++]}return new fn(u,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new ln,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,d=c.length;h<d;h++){const u=c[h],f=e(u,n);l.push(f)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let d=0,u=c.length;d<u;d++){const f=c[d];h.push(f.toJSON(e.data))}h.length>0&&(i[l]=h,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const r=e.morphAttributes;for(const c in r){const h=[],d=r[c];for(let u=0,f=d.length;u<f;u++)h.push(d[u].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const d=a[c];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const gc=new bt,Gi=new Fs,br=new Ei,_c=new F,Er=new F,Ar=new F,wr=new F,Ka=new F,Tr=new F,vc=new F,Cr=new F;class Jt extends an{constructor(e=new ln,t=new zi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){Tr.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],d=r[l];h!==0&&(Ka.fromBufferAttribute(d,e),a?Tr.addScaledVector(Ka,h):Tr.addScaledVector(Ka.sub(t),h))}t.add(Tr)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),br.copy(n.boundingSphere),br.applyMatrix4(r),Gi.copy(e.ray).recast(e.near),!(br.containsPoint(Gi.origin)===!1&&(Gi.intersectSphere(br,_c)===null||Gi.origin.distanceToSquared(_c)>(e.far-e.near)**2))&&(gc.copy(r).invert(),Gi.copy(e.ray).applyMatrix4(gc),!(n.boundingBox!==null&&Gi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Gi)))}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,d=r.attributes.normal,u=r.groups,f=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],E=Math.max(g.start,f.start),b=Math.min(o.count,Math.min(g.start+g.count,f.start+f.count));for(let M=E,U=b;M<U;M+=3){const R=o.getX(M),P=o.getX(M+1),D=o.getX(M+2);i=Rr(this,p,e,n,c,h,d,R,P,D),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(o.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const E=o.getX(g),b=o.getX(g+1),M=o.getX(g+2);i=Rr(this,a,e,n,c,h,d,E,b,M),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],E=Math.max(g.start,f.start),b=Math.min(l.count,Math.min(g.start+g.count,f.start+f.count));for(let M=E,U=b;M<U;M+=3){const R=M,P=M+1,D=M+2;i=Rr(this,p,e,n,c,h,d,R,P,D),i&&(i.faceIndex=Math.floor(M/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,f.start),_=Math.min(l.count,f.start+f.count);for(let g=m,p=_;g<p;g+=3){const E=g,b=g+1,M=g+2;i=Rr(this,a,e,n,c,h,d,E,b,M),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function If(s,e,t,n,i,r,a,o){let l;if(e.side===Rn?l=n.intersectTriangle(a,r,i,!0,o):l=n.intersectTriangle(i,r,a,e.side===Xn,o),l===null)return null;Cr.copy(o),Cr.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(Cr);return c<t.near||c>t.far?null:{distance:c,point:Cr.clone(),object:s}}function Rr(s,e,t,n,i,r,a,o,l,c){s.getVertexPosition(o,Er),s.getVertexPosition(l,Ar),s.getVertexPosition(c,wr);const h=If(s,e,t,n,Er,Ar,wr,vc);if(h){const d=new F;Gn.getBarycoord(vc,Er,Ar,wr,d),i&&(h.uv=Gn.getInterpolatedAttribute(i,o,l,c,d,new Qe)),r&&(h.uv1=Gn.getInterpolatedAttribute(r,o,l,c,d,new Qe)),a&&(h.normal=Gn.getInterpolatedAttribute(a,o,l,c,d,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new F,materialIndex:0};Gn.getNormal(Er,Ar,wr,u.normal),h.face=u,h.barycoord=d}return h}class Bi extends ln{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],d=[];let u=0,f=0;m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,i,a,2),m("x","z","y",1,-1,e,n,-t,i,a,3),m("x","y","z",1,-1,e,t,n,i,r,4),m("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new Dt(c,3)),this.setAttribute("normal",new Dt(h,3)),this.setAttribute("uv",new Dt(d,2));function m(_,g,p,E,b,M,U,R,P,D,S){const y=M/P,N=U/D,W=M/2,X=U/2,Q=R/2,ne=P+1,H=D+1;let se=0,Z=0;const pe=new F;for(let be=0;be<H;be++){const Ce=be*N-X;for(let Ie=0;Ie<ne;Ie++){const He=Ie*y-W;pe[_]=He*E,pe[g]=Ce*b,pe[p]=Q,c.push(pe.x,pe.y,pe.z),pe[_]=0,pe[g]=0,pe[p]=R>0?1:-1,h.push(pe.x,pe.y,pe.z),d.push(Ie/P),d.push(1-be/D),se+=1}}for(let be=0;be<D;be++)for(let Ce=0;Ce<P;Ce++){const Ie=u+Ce+ne*be,He=u+Ce+ne*(be+1),K=u+(Ce+1)+ne*(be+1),re=u+(Ce+1)+ne*be;l.push(Ie,He,re),l.push(He,K,re),Z+=6}o.addGroup(f,Z,S),f+=Z,u+=se}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ns(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Cn(s){const e={};for(let t=0;t<s.length;t++){const n=Ns(s[t]);for(const i in n)e[i]=n[i]}return e}function Ff(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function lu(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:kt.workingColorSpace}const Ll={clone:Ns,merge:Cn};var Of=`void main() {
|
|
5
|
+
*/const yl="177",cd={ROTATE:0,DOLLY:1,PAN:2},hd={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},ud=0,jl=1,dd=2,Wh=1,Xh=2,vi=3,Xn=0,Rn=1,wn=2,Fi=0,As=1,Yl=2,$l=3,Jl=4,fd=5,Ji=100,pd=101,md=102,gd=103,_d=104,vd=200,xd=201,yd=202,Md=203,So=204,Eo=205,bd=206,Sd=207,Ed=208,Ad=209,wd=210,Td=211,Cd=212,Rd=213,Ld=214,Ao=0,wo=1,To=2,Rs=3,Co=4,Ro=5,Lo=6,Po=7,ya=0,Pd=1,Dd=2,Oi=0,Ud=1,Nd=2,Id=3,qh=4,Fd=5,Od=6,zd=7,Kl="attached",Bd="detached",jh=300,Ls=301,Ps=302,Do=303,Uo=304,Ma=306,ai=1e3,Jn=1001,No=1002,On=1003,kd=1004,fr=1005,Fn=1006,La=1007,xi=1008,ci=1009,Yh=1010,$h=1011,ir=1012,Ml=1013,es=1014,oi=1015,cr=1016,bl=1017,Sl=1018,sr=1020,Jh=35902,Kh=1021,Zh=1022,Wn=1023,rr=1026,ar=1027,Qh=1028,El=1029,eu=1030,Al=1031,wl=1033,ta=33776,na=33777,ia=33778,sa=33779,Io=35840,Fo=35841,Oo=35842,zo=35843,Bo=36196,ko=37492,Vo=37496,Ho=37808,Go=37809,Wo=37810,Xo=37811,qo=37812,jo=37813,Yo=37814,$o=37815,Jo=37816,Ko=37817,Zo=37818,Qo=37819,el=37820,tl=37821,ra=36492,nl=36494,il=36495,tu=36283,sl=36284,rl=36285,al=36286,ua=2300,ol=2301,Pa=2302,Zl=2400,Ql=2401,ec=2402,Vd=2500,Hd=3200,Gd=3201,ba=0,Wd=1,Ni="",Qt="srgb",Ds="srgb-linear",da="linear",an="srgb",ss=7680,tc=519,Xd=512,qd=513,jd=514,nu=515,Yd=516,$d=517,Jd=518,Kd=519,ll=35044,nc="300 es",yi=2e3,fa=2001;class ns{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const i=n[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let r=0,a=i.length;r<a;r++)i[r].call(this,e);e.target=null}}}const En=["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 ic=1234567;const Zs=Math.PI/180,Us=180/Math.PI;function Zn(){const s=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(En[s&255]+En[s>>8&255]+En[s>>16&255]+En[s>>24&255]+"-"+En[e&255]+En[e>>8&255]+"-"+En[e>>16&15|64]+En[e>>24&255]+"-"+En[t&63|128]+En[t>>8&255]+"-"+En[t>>16&255]+En[t>>24&255]+En[n&255]+En[n>>8&255]+En[n>>16&255]+En[n>>24&255]).toLowerCase()}function Ft(s,e,t){return Math.max(e,Math.min(t,s))}function Tl(s,e){return(s%e+e)%e}function Zd(s,e,t,n,i){return n+(s-e)*(i-n)/(t-e)}function Qd(s,e,t){return s!==e?(t-s)/(e-s):0}function Qs(s,e,t){return(1-t)*s+t*e}function ef(s,e,t,n){return Qs(s,e,1-Math.exp(-t*n))}function tf(s,e=1){return e-Math.abs(Tl(s,e*2)-e)}function nf(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*(3-2*s))}function sf(s,e,t){return s<=e?0:s>=t?1:(s=(s-e)/(t-e),s*s*s*(s*(s*6-15)+10))}function rf(s,e){return s+Math.floor(Math.random()*(e-s+1))}function af(s,e){return s+Math.random()*(e-s)}function of(s){return s*(.5-Math.random())}function lf(s){s!==void 0&&(ic=s);let e=ic+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function cf(s){return s*Zs}function hf(s){return s*Us}function uf(s){return(s&s-1)===0&&s!==0}function df(s){return Math.pow(2,Math.ceil(Math.log(s)/Math.LN2))}function ff(s){return Math.pow(2,Math.floor(Math.log(s)/Math.LN2))}function pf(s,e,t,n,i){const r=Math.cos,a=Math.sin,o=r(t/2),l=a(t/2),c=r((e+n)/2),h=a((e+n)/2),f=r((e-n)/2),u=a((e-n)/2),d=r((n-e)/2),m=a((n-e)/2);switch(i){case"XYX":s.set(o*h,l*f,l*u,o*c);break;case"YZY":s.set(l*u,o*h,l*f,o*c);break;case"ZXZ":s.set(l*f,l*u,o*h,o*c);break;case"XZX":s.set(o*h,l*m,l*d,o*c);break;case"YXY":s.set(l*d,o*h,l*m,o*c);break;case"ZYZ":s.set(l*m,l*d,o*h,o*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function $n(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return s/4294967295;case Uint16Array:return s/65535;case Uint8Array:return s/255;case Int32Array:return Math.max(s/2147483647,-1);case Int16Array:return Math.max(s/32767,-1);case Int8Array:return Math.max(s/127,-1);default:throw new Error("Invalid component type.")}}function rn(s,e){switch(e.constructor){case Float32Array:return s;case Uint32Array:return Math.round(s*4294967295);case Uint16Array:return Math.round(s*65535);case Uint8Array:return Math.round(s*255);case Int32Array:return Math.round(s*2147483647);case Int16Array:return Math.round(s*32767);case Int8Array:return Math.round(s*127);default:throw new Error("Invalid component type.")}}const Ki={DEG2RAD:Zs,RAD2DEG:Us,generateUUID:Zn,clamp:Ft,euclideanModulo:Tl,mapLinear:Zd,inverseLerp:Qd,lerp:Qs,damp:ef,pingpong:tf,smoothstep:nf,smootherstep:sf,randInt:rf,randFloat:af,randFloatSpread:of,seededRandom:lf,degToRad:cf,radToDeg:hf,isPowerOfTwo:uf,ceilPowerOfTwo:df,floorPowerOfTwo:ff,setQuaternionFromProperEuler:pf,normalize:rn,denormalize:$n};class Qe{constructor(e=0,t=0){Qe.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Ft(this.x,e.x,t.x),this.y=Ft(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=Ft(this.x,e,t),this.y=Ft(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Ft(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ft(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),r=this.x-e.x,a=this.y-e.y;return this.x=r*n-a*i+e.x,this.y=r*i+a*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class zn{constructor(e=0,t=0,n=0,i=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=i}static slerpFlat(e,t,n,i,r,a,o){let l=n[i+0],c=n[i+1],h=n[i+2],f=n[i+3];const u=r[a+0],d=r[a+1],m=r[a+2],_=r[a+3];if(o===0){e[t+0]=l,e[t+1]=c,e[t+2]=h,e[t+3]=f;return}if(o===1){e[t+0]=u,e[t+1]=d,e[t+2]=m,e[t+3]=_;return}if(f!==_||l!==u||c!==d||h!==m){let g=1-o;const p=l*u+c*d+h*m+f*_,S=p>=0?1:-1,A=1-p*p;if(A>Number.EPSILON){const N=Math.sqrt(A),C=Math.atan2(N,p*S);g=Math.sin(g*C)/N,o=Math.sin(o*C)/N}const b=o*S;if(l=l*g+u*b,c=c*g+d*b,h=h*g+m*b,f=f*g+_*b,g===1-o){const N=1/Math.sqrt(l*l+c*c+h*h+f*f);l*=N,c*=N,h*=N,f*=N}}e[t]=l,e[t+1]=c,e[t+2]=h,e[t+3]=f}static multiplyQuaternionsFlat(e,t,n,i,r,a){const o=n[i],l=n[i+1],c=n[i+2],h=n[i+3],f=r[a],u=r[a+1],d=r[a+2],m=r[a+3];return e[t]=o*m+h*f+l*d-c*u,e[t+1]=l*m+h*u+c*f-o*d,e[t+2]=c*m+h*d+o*u-l*f,e[t+3]=h*m-o*f-l*u-c*d,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,i=e._y,r=e._z,a=e._order,o=Math.cos,l=Math.sin,c=o(n/2),h=o(i/2),f=o(r/2),u=l(n/2),d=l(i/2),m=l(r/2);switch(a){case"XYZ":this._x=u*h*f+c*d*m,this._y=c*d*f-u*h*m,this._z=c*h*m+u*d*f,this._w=c*h*f-u*d*m;break;case"YXZ":this._x=u*h*f+c*d*m,this._y=c*d*f-u*h*m,this._z=c*h*m-u*d*f,this._w=c*h*f+u*d*m;break;case"ZXY":this._x=u*h*f-c*d*m,this._y=c*d*f+u*h*m,this._z=c*h*m+u*d*f,this._w=c*h*f-u*d*m;break;case"ZYX":this._x=u*h*f-c*d*m,this._y=c*d*f+u*h*m,this._z=c*h*m-u*d*f,this._w=c*h*f+u*d*m;break;case"YZX":this._x=u*h*f+c*d*m,this._y=c*d*f+u*h*m,this._z=c*h*m-u*d*f,this._w=c*h*f-u*d*m;break;case"XZY":this._x=u*h*f-c*d*m,this._y=c*d*f-u*h*m,this._z=c*h*m+u*d*f,this._w=c*h*f+u*d*m;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],r=t[8],a=t[1],o=t[5],l=t[9],c=t[2],h=t[6],f=t[10],u=n+o+f;if(u>0){const d=.5/Math.sqrt(u+1);this._w=.25/d,this._x=(h-l)*d,this._y=(r-c)*d,this._z=(a-i)*d}else if(n>o&&n>f){const d=2*Math.sqrt(1+n-o-f);this._w=(h-l)/d,this._x=.25*d,this._y=(i+a)/d,this._z=(r+c)/d}else if(o>f){const d=2*Math.sqrt(1+o-n-f);this._w=(r-c)/d,this._x=(i+a)/d,this._y=.25*d,this._z=(l+h)/d}else{const d=2*Math.sqrt(1+f-n-o);this._w=(a-i)/d,this._x=(r+c)/d,this._y=(l+h)/d,this._z=.25*d}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Ft(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,r=e._z,a=e._w,o=t._x,l=t._y,c=t._z,h=t._w;return this._x=n*h+a*o+i*c-r*l,this._y=i*h+a*l+r*o-n*c,this._z=r*h+a*c+n*l-i*o,this._w=a*h-n*o-i*l-r*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,r=this._z,a=this._w;let o=a*e._w+n*e._x+i*e._y+r*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=a,this._x=n,this._y=i,this._z=r,this;const l=1-o*o;if(l<=Number.EPSILON){const d=1-t;return this._w=d*a+t*this._w,this._x=d*n+t*this._x,this._y=d*i+t*this._y,this._z=d*r+t*this._z,this.normalize(),this}const c=Math.sqrt(l),h=Math.atan2(c,o),f=Math.sin((1-t)*h)/c,u=Math.sin(t*h)/c;return this._w=a*f+this._w*u,this._x=n*f+this._x*u,this._y=i*f+this._y*u,this._z=r*f+this._z*u,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),i=Math.sqrt(1-n),r=Math.sqrt(n);return this.set(i*Math.sin(e),i*Math.cos(e),r*Math.sin(t),r*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class F{constructor(e=0,t=0,n=0){F.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(sc.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(sc.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[3]*n+r[6]*i,this.y=r[1]*t+r[4]*n+r[7]*i,this.z=r[2]*t+r[5]*n+r[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=e.elements,a=1/(r[3]*t+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*t+r[4]*n+r[8]*i+r[12])*a,this.y=(r[1]*t+r[5]*n+r[9]*i+r[13])*a,this.z=(r[2]*t+r[6]*n+r[10]*i+r[14])*a,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,o=e.z,l=e.w,c=2*(a*i-o*n),h=2*(o*t-r*i),f=2*(r*n-a*t);return this.x=t+l*c+a*f-o*h,this.y=n+l*h+o*c-r*f,this.z=i+l*f+r*h-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,r=e.elements;return this.x=r[0]*t+r[4]*n+r[8]*i,this.y=r[1]*t+r[5]*n+r[9]*i,this.z=r[2]*t+r[6]*n+r[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Ft(this.x,e.x,t.x),this.y=Ft(this.y,e.y,t.y),this.z=Ft(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=Ft(this.x,e,t),this.y=Ft(this.y,e,t),this.z=Ft(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Ft(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}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(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,r=e.z,a=t.x,o=t.y,l=t.z;return this.x=i*l-r*o,this.y=r*a-n*l,this.z=n*o-i*a,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return Da.copy(this).projectOnVector(e),this.sub(Da)}reflect(e){return this.sub(Da.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Ft(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const Da=new F,sc=new zn;class It{constructor(e,t,n,i,r,a,o,l,c){It.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c)}set(e,t,n,i,r,a,o,l,c){const h=this.elements;return h[0]=e,h[1]=i,h[2]=o,h[3]=t,h[4]=r,h[5]=l,h[6]=n,h[7]=a,h[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[3],l=n[6],c=n[1],h=n[4],f=n[7],u=n[2],d=n[5],m=n[8],_=i[0],g=i[3],p=i[6],S=i[1],A=i[4],b=i[7],N=i[2],C=i[5],P=i[8];return r[0]=a*_+o*S+l*N,r[3]=a*g+o*A+l*C,r[6]=a*p+o*b+l*P,r[1]=c*_+h*S+f*N,r[4]=c*g+h*A+f*C,r[7]=c*p+h*b+f*P,r[2]=u*_+d*S+m*N,r[5]=u*g+d*A+m*C,r[8]=u*p+d*b+m*P,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8];return t*a*h-t*o*c-n*r*h+n*o*l+i*r*c-i*a*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],f=h*a-o*c,u=o*l-h*r,d=c*r-a*l,m=t*f+n*u+i*d;if(m===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/m;return e[0]=f*_,e[1]=(i*c-h*n)*_,e[2]=(o*n-i*a)*_,e[3]=u*_,e[4]=(h*t-i*l)*_,e[5]=(i*r-o*t)*_,e[6]=d*_,e[7]=(n*l-c*t)*_,e[8]=(a*t-n*r)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,r,a,o){const l=Math.cos(r),c=Math.sin(r);return this.set(n*l,n*c,-n*(l*a+c*o)+a+e,-i*c,i*l,-i*(-c*a+l*o)+o+t,0,0,1),this}scale(e,t){return this.premultiply(Ua.makeScale(e,t)),this}rotate(e){return this.premultiply(Ua.makeRotation(-e)),this}translate(e,t){return this.premultiply(Ua.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Ua=new It;function iu(s){for(let e=s.length-1;e>=0;--e)if(s[e]>=65535)return!0;return!1}function or(s){return document.createElementNS("http://www.w3.org/1999/xhtml",s)}function mf(){const s=or("canvas");return s.style.display="block",s}const rc={};function ws(s){s in rc||(rc[s]=!0,console.warn(s))}function gf(s,e,t){return new Promise(function(n,i){function r(){switch(s.clientWaitSync(e,s.SYNC_FLUSH_COMMANDS_BIT,0)){case s.WAIT_FAILED:i();break;case s.TIMEOUT_EXPIRED:setTimeout(r,t);break;default:n()}}setTimeout(r,t)})}function _f(s){const e=s.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function vf(s){const e=s.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}const ac=new It().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),oc=new It().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function xf(){const s={enabled:!0,workingColorSpace:Ds,spaces:{},convert:function(i,r,a){return this.enabled===!1||r===a||!r||!a||(this.spaces[r].transfer===an&&(i.r=Mi(i.r),i.g=Mi(i.g),i.b=Mi(i.b)),this.spaces[r].primaries!==this.spaces[a].primaries&&(i.applyMatrix3(this.spaces[r].toXYZ),i.applyMatrix3(this.spaces[a].fromXYZ)),this.spaces[a].transfer===an&&(i.r=Ts(i.r),i.g=Ts(i.g),i.b=Ts(i.b))),i},workingToColorSpace:function(i,r){return this.convert(i,this.workingColorSpace,r)},colorSpaceToWorking:function(i,r){return this.convert(i,r,this.workingColorSpace)},getPrimaries:function(i){return this.spaces[i].primaries},getTransfer:function(i){return i===Ni?da:this.spaces[i].transfer},getLuminanceCoefficients:function(i,r=this.workingColorSpace){return i.fromArray(this.spaces[r].luminanceCoefficients)},define:function(i){Object.assign(this.spaces,i)},_getMatrix:function(i,r,a){return i.copy(this.spaces[r].toXYZ).multiply(this.spaces[a].fromXYZ)},_getDrawingBufferColorSpace:function(i){return this.spaces[i].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(i=this.workingColorSpace){return this.spaces[i].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),s.workingToColorSpace(i,r)},toWorkingColorSpace:function(i,r){return ws("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),s.colorSpaceToWorking(i,r)}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return s.define({[Ds]:{primaries:e,whitePoint:n,transfer:da,toXYZ:ac,fromXYZ:oc,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:Qt},outputColorSpaceConfig:{drawingBufferColorSpace:Qt}},[Qt]:{primaries:e,whitePoint:n,transfer:an,toXYZ:ac,fromXYZ:oc,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:Qt}}}),s}const Wt=xf();function Mi(s){return s<.04045?s*.0773993808:Math.pow(s*.9478672986+.0521327014,2.4)}function Ts(s){return s<.0031308?s*12.92:1.055*Math.pow(s,.41666)-.055}let rs;class yf{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{rs===void 0&&(rs=or("canvas")),rs.width=e.width,rs.height=e.height;const i=rs.getContext("2d");e instanceof ImageData?i.putImageData(e,0,0):i.drawImage(e,0,0,e.width,e.height),n=rs}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=or("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),r=i.data;for(let a=0;a<r.length;a++)r[a]=Mi(r[a]/255)*255;return n.putImageData(i,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Mi(t[n]/255)*255):t[n]=Mi(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let Mf=0;class Cl{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:Mf++}),this.uuid=Zn(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const t=this.data;return t instanceof HTMLVideoElement?e.set(t.videoWidth,t.videoHeight):t!==null?e.set(t.width,t.height,t.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},i=this.data;if(i!==null){let r;if(Array.isArray(i)){r=[];for(let a=0,o=i.length;a<o;a++)i[a].isDataTexture?r.push(Na(i[a].image)):r.push(Na(i[a]))}else r=Na(i);n.url=r}return t||(e.images[this.uuid]=n),n}}function Na(s){return typeof HTMLImageElement<"u"&&s instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&s instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&s instanceof ImageBitmap?yf.getDataURL(s):s.data?{data:Array.from(s.data),width:s.width,height:s.height,type:s.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let bf=0;const Ia=new F;class Sn extends ns{constructor(e=Sn.DEFAULT_IMAGE,t=Sn.DEFAULT_MAPPING,n=Jn,i=Jn,r=Fn,a=xi,o=Wn,l=ci,c=Sn.DEFAULT_ANISOTROPY,h=Ni){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:bf++}),this.uuid=Zn(),this.name="",this.source=new Cl(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=i,this.magFilter=r,this.minFilter=a,this.anisotropy=c,this.format=o,this.internalFormat=null,this.type=l,this.offset=new Qe(0,0),this.repeat=new Qe(1,1),this.center=new Qe(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new It,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(Ia).x}get height(){return this.source.getSize(Ia).y}get depth(){return this.source.getSize(Ia).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Texture.setValues(): parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Texture.setValues(): property '${t}' does not exist.`);continue}i&&n&&i.isVector2&&n.isVector2||i&&n&&i.isVector3&&n.isVector3||i&&n&&i.isMatrix3&&n.isMatrix3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==jh)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case ai:e.x=e.x-Math.floor(e.x);break;case Jn:e.x=e.x<0?0:1;break;case No:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case ai:e.y=e.y-Math.floor(e.y);break;case Jn:e.y=e.y<0?0:1;break;case No:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Sn.DEFAULT_IMAGE=null;Sn.DEFAULT_MAPPING=jh;Sn.DEFAULT_ANISOTROPY=1;class Xt{constructor(e=0,t=0,n=0,i=1){Xt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,r=this.w,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*i+a[12]*r,this.y=a[1]*t+a[5]*n+a[9]*i+a[13]*r,this.z=a[2]*t+a[6]*n+a[10]*i+a[14]*r,this.w=a[3]*t+a[7]*n+a[11]*i+a[15]*r,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,r;const l=e.elements,c=l[0],h=l[4],f=l[8],u=l[1],d=l[5],m=l[9],_=l[2],g=l[6],p=l[10];if(Math.abs(h-u)<.01&&Math.abs(f-_)<.01&&Math.abs(m-g)<.01){if(Math.abs(h+u)<.1&&Math.abs(f+_)<.1&&Math.abs(m+g)<.1&&Math.abs(c+d+p-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const A=(c+1)/2,b=(d+1)/2,N=(p+1)/2,C=(h+u)/4,P=(f+_)/4,D=(m+g)/4;return A>b&&A>N?A<.01?(n=0,i=.707106781,r=.707106781):(n=Math.sqrt(A),i=C/n,r=P/n):b>N?b<.01?(n=.707106781,i=0,r=.707106781):(i=Math.sqrt(b),n=C/i,r=D/i):N<.01?(n=.707106781,i=.707106781,r=0):(r=Math.sqrt(N),n=P/r,i=D/r),this.set(n,i,r,t),this}let S=Math.sqrt((g-m)*(g-m)+(f-_)*(f-_)+(u-h)*(u-h));return Math.abs(S)<.001&&(S=1),this.x=(g-m)/S,this.y=(f-_)/S,this.z=(u-h)/S,this.w=Math.acos((c+d+p-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Ft(this.x,e.x,t.x),this.y=Ft(this.y,e.y,t.y),this.z=Ft(this.z,e.z,t.z),this.w=Ft(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=Ft(this.x,e,t),this.y=Ft(this.y,e,t),this.z=Ft(this.z,e,t),this.w=Ft(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Ft(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Sf extends ns{constructor(e=1,t=1,n={}){super(),n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:Fn,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},n),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=n.depth,this.scissor=new Xt(0,0,e,t),this.scissorTest=!1,this.viewport=new Xt(0,0,e,t);const i={width:e,height:t,depth:n.depth},r=new Sn(i);this.textures=[];const a=n.count;for(let o=0;o<a;o++)this.textures[o]=r.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(n),this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=n.depthTexture,this.samples=n.samples,this.multiview=n.multiview}_setTextureOptions(e={}){const t={minFilter:Fn,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(t.mapping=e.mapping),e.wrapS!==void 0&&(t.wrapS=e.wrapS),e.wrapT!==void 0&&(t.wrapT=e.wrapT),e.wrapR!==void 0&&(t.wrapR=e.wrapR),e.magFilter!==void 0&&(t.magFilter=e.magFilter),e.minFilter!==void 0&&(t.minFilter=e.minFilter),e.format!==void 0&&(t.format=e.format),e.type!==void 0&&(t.type=e.type),e.anisotropy!==void 0&&(t.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(t.colorSpace=e.colorSpace),e.flipY!==void 0&&(t.flipY=e.flipY),e.generateMipmaps!==void 0&&(t.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(t.internalFormat=e.internalFormat);for(let n=0;n<this.textures.length;n++)this.textures[n].setValues(t)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let i=0,r=this.textures.length;i<r;i++)this.textures[i].image.width=e,this.textures[i].image.height=t,this.textures[i].image.depth=n,this.textures[i].isArrayTexture=this.textures[i].image.depth>1;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const i=Object.assign({},e.textures[t].image);this.textures[t].source=new Cl(i)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class ts extends Sf{constructor(e=1,t=1,n={}){super(e,t,n),this.isWebGLRenderTarget=!0}}class su extends Sn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=On,this.minFilter=On,this.wrapR=Jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Ef extends Sn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=On,this.minFilter=On,this.wrapR=Jn,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class ei{constructor(e=new F(1/0,1/0,1/0),t=new F(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(qn.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(qn.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=qn.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const r=n.getAttribute("position");if(t===!0&&r!==void 0&&e.isInstancedMesh!==!0)for(let a=0,o=r.count;a<o;a++)e.isMesh===!0?e.getVertexPosition(a,qn):qn.fromBufferAttribute(r,a),qn.applyMatrix4(e.matrixWorld),this.expandByPoint(qn);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),pr.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),pr.copy(n.boundingBox)),pr.applyMatrix4(e.matrixWorld),this.union(pr)}const i=e.children;for(let r=0,a=i.length;r<a;r++)this.expandByObject(i[r],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,qn),qn.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Vs),mr.subVectors(this.max,Vs),as.subVectors(e.a,Vs),os.subVectors(e.b,Vs),ls.subVectors(e.c,Vs),wi.subVectors(os,as),Ti.subVectors(ls,os),Vi.subVectors(as,ls);let t=[0,-wi.z,wi.y,0,-Ti.z,Ti.y,0,-Vi.z,Vi.y,wi.z,0,-wi.x,Ti.z,0,-Ti.x,Vi.z,0,-Vi.x,-wi.y,wi.x,0,-Ti.y,Ti.x,0,-Vi.y,Vi.x,0];return!Fa(t,as,os,ls,mr)||(t=[1,0,0,0,1,0,0,0,1],!Fa(t,as,os,ls,mr))?!1:(gr.crossVectors(wi,Ti),t=[gr.x,gr.y,gr.z],Fa(t,as,os,ls,mr))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,qn).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(qn).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(di[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),di[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),di[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),di[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),di[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),di[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),di[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),di[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(di),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const di=[new F,new F,new F,new F,new F,new F,new F,new F],qn=new F,pr=new ei,as=new F,os=new F,ls=new F,wi=new F,Ti=new F,Vi=new F,Vs=new F,mr=new F,gr=new F,Hi=new F;function Fa(s,e,t,n,i){for(let r=0,a=s.length-3;r<=a;r+=3){Hi.fromArray(s,r);const o=i.x*Math.abs(Hi.x)+i.y*Math.abs(Hi.y)+i.z*Math.abs(Hi.z),l=e.dot(Hi),c=t.dot(Hi),h=n.dot(Hi);if(Math.max(-Math.max(l,c,h),Math.min(l,c,h))>o)return!1}return!0}const Af=new ei,Hs=new F,Oa=new F;class Ei{constructor(e=new F,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):Af.setFromPoints(e).getCenter(n);let i=0;for(let r=0,a=e.length;r<a;r++)i=Math.max(i,n.distanceToSquared(e[r]));return this.radius=Math.sqrt(i),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Hs.subVectors(e,this.center);const t=Hs.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Hs,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Oa.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Hs.copy(e.center).add(Oa)),this.expandByPoint(Hs.copy(e.center).sub(Oa))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const fi=new F,za=new F,_r=new F,Ci=new F,Ba=new F,vr=new F,ka=new F;class Fs{constructor(e=new F,t=new F(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,fi)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=fi.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(fi.copy(this.origin).addScaledVector(this.direction,t),fi.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){za.copy(e).add(t).multiplyScalar(.5),_r.copy(t).sub(e).normalize(),Ci.copy(this.origin).sub(za);const r=e.distanceTo(t)*.5,a=-this.direction.dot(_r),o=Ci.dot(this.direction),l=-Ci.dot(_r),c=Ci.lengthSq(),h=Math.abs(1-a*a);let f,u,d,m;if(h>0)if(f=a*l-o,u=a*o-l,m=r*h,f>=0)if(u>=-m)if(u<=m){const _=1/h;f*=_,u*=_,d=f*(f+a*u+2*o)+u*(a*f+u+2*l)+c}else u=r,f=Math.max(0,-(a*u+o)),d=-f*f+u*(u+2*l)+c;else u=-r,f=Math.max(0,-(a*u+o)),d=-f*f+u*(u+2*l)+c;else u<=-m?(f=Math.max(0,-(-a*r+o)),u=f>0?-r:Math.min(Math.max(-r,-l),r),d=-f*f+u*(u+2*l)+c):u<=m?(f=0,u=Math.min(Math.max(-r,-l),r),d=u*(u+2*l)+c):(f=Math.max(0,-(a*r+o)),u=f>0?r:Math.min(Math.max(-r,-l),r),d=-f*f+u*(u+2*l)+c);else u=a>0?-r:r,f=Math.max(0,-(a*u+o)),d=-f*f+u*(u+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,f),i&&i.copy(za).addScaledVector(_r,u),d}intersectSphere(e,t){fi.subVectors(e.center,this.origin);const n=fi.dot(this.direction),i=fi.dot(fi)-n*n,r=e.radius*e.radius;if(i>r)return null;const a=Math.sqrt(r-i),o=n-a,l=n+a;return l<0?null:o<0?this.at(l,t):this.at(o,t)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,r,a,o,l;const c=1/this.direction.x,h=1/this.direction.y,f=1/this.direction.z,u=this.origin;return c>=0?(n=(e.min.x-u.x)*c,i=(e.max.x-u.x)*c):(n=(e.max.x-u.x)*c,i=(e.min.x-u.x)*c),h>=0?(r=(e.min.y-u.y)*h,a=(e.max.y-u.y)*h):(r=(e.max.y-u.y)*h,a=(e.min.y-u.y)*h),n>a||r>i||((r>n||isNaN(n))&&(n=r),(a<i||isNaN(i))&&(i=a),f>=0?(o=(e.min.z-u.z)*f,l=(e.max.z-u.z)*f):(o=(e.max.z-u.z)*f,l=(e.min.z-u.z)*f),n>l||o>i)||((o>n||n!==n)&&(n=o),(l<i||i!==i)&&(i=l),i<0)?null:this.at(n>=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,fi)!==null}intersectTriangle(e,t,n,i,r){Ba.subVectors(t,e),vr.subVectors(n,e),ka.crossVectors(Ba,vr);let a=this.direction.dot(ka),o;if(a>0){if(i)return null;o=1}else if(a<0)o=-1,a=-a;else return null;Ci.subVectors(this.origin,e);const l=o*this.direction.dot(vr.crossVectors(Ci,vr));if(l<0)return null;const c=o*this.direction.dot(Ba.cross(Ci));if(c<0||l+c>a)return null;const h=-o*Ci.dot(ka);return h<0?null:this.at(h/a,r)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class Tt{constructor(e,t,n,i,r,a,o,l,c,h,f,u,d,m,_,g){Tt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,r,a,o,l,c,h,f,u,d,m,_,g)}set(e,t,n,i,r,a,o,l,c,h,f,u,d,m,_,g){const p=this.elements;return p[0]=e,p[4]=t,p[8]=n,p[12]=i,p[1]=r,p[5]=a,p[9]=o,p[13]=l,p[2]=c,p[6]=h,p[10]=f,p[14]=u,p[3]=d,p[7]=m,p[11]=_,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 Tt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/cs.setFromMatrixColumn(e,0).length(),r=1/cs.setFromMatrixColumn(e,1).length(),a=1/cs.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*r,t[5]=n[5]*r,t[6]=n[6]*r,t[7]=0,t[8]=n[8]*a,t[9]=n[9]*a,t[10]=n[10]*a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,r=e.z,a=Math.cos(n),o=Math.sin(n),l=Math.cos(i),c=Math.sin(i),h=Math.cos(r),f=Math.sin(r);if(e.order==="XYZ"){const u=a*h,d=a*f,m=o*h,_=o*f;t[0]=l*h,t[4]=-l*f,t[8]=c,t[1]=d+m*c,t[5]=u-_*c,t[9]=-o*l,t[2]=_-u*c,t[6]=m+d*c,t[10]=a*l}else if(e.order==="YXZ"){const u=l*h,d=l*f,m=c*h,_=c*f;t[0]=u+_*o,t[4]=m*o-d,t[8]=a*c,t[1]=a*f,t[5]=a*h,t[9]=-o,t[2]=d*o-m,t[6]=_+u*o,t[10]=a*l}else if(e.order==="ZXY"){const u=l*h,d=l*f,m=c*h,_=c*f;t[0]=u-_*o,t[4]=-a*f,t[8]=m+d*o,t[1]=d+m*o,t[5]=a*h,t[9]=_-u*o,t[2]=-a*c,t[6]=o,t[10]=a*l}else if(e.order==="ZYX"){const u=a*h,d=a*f,m=o*h,_=o*f;t[0]=l*h,t[4]=m*c-d,t[8]=u*c+_,t[1]=l*f,t[5]=_*c+u,t[9]=d*c-m,t[2]=-c,t[6]=o*l,t[10]=a*l}else if(e.order==="YZX"){const u=a*l,d=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=_-u*f,t[8]=m*f+d,t[1]=f,t[5]=a*h,t[9]=-o*h,t[2]=-c*h,t[6]=d*f+m,t[10]=u-_*f}else if(e.order==="XZY"){const u=a*l,d=a*c,m=o*l,_=o*c;t[0]=l*h,t[4]=-f,t[8]=c*h,t[1]=u*f+_,t[5]=a*h,t[9]=d*f-m,t[2]=m*f-d,t[6]=o*h,t[10]=_*f+u}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(wf,e,Tf)}lookAt(e,t,n){const i=this.elements;return Nn.subVectors(e,t),Nn.lengthSq()===0&&(Nn.z=1),Nn.normalize(),Ri.crossVectors(n,Nn),Ri.lengthSq()===0&&(Math.abs(n.z)===1?Nn.x+=1e-4:Nn.z+=1e-4,Nn.normalize(),Ri.crossVectors(n,Nn)),Ri.normalize(),xr.crossVectors(Nn,Ri),i[0]=Ri.x,i[4]=xr.x,i[8]=Nn.x,i[1]=Ri.y,i[5]=xr.y,i[9]=Nn.y,i[2]=Ri.z,i[6]=xr.z,i[10]=Nn.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,r=this.elements,a=n[0],o=n[4],l=n[8],c=n[12],h=n[1],f=n[5],u=n[9],d=n[13],m=n[2],_=n[6],g=n[10],p=n[14],S=n[3],A=n[7],b=n[11],N=n[15],C=i[0],P=i[4],D=i[8],E=i[12],y=i[1],U=i[5],G=i[9],X=i[13],Z=i[2],ie=i[6],H=i[10],oe=i[14],Y=i[3],me=i[7],Me=i[11],Ce=i[15];return r[0]=a*C+o*y+l*Z+c*Y,r[4]=a*P+o*U+l*ie+c*me,r[8]=a*D+o*G+l*H+c*Me,r[12]=a*E+o*X+l*oe+c*Ce,r[1]=h*C+f*y+u*Z+d*Y,r[5]=h*P+f*U+u*ie+d*me,r[9]=h*D+f*G+u*H+d*Me,r[13]=h*E+f*X+u*oe+d*Ce,r[2]=m*C+_*y+g*Z+p*Y,r[6]=m*P+_*U+g*ie+p*me,r[10]=m*D+_*G+g*H+p*Me,r[14]=m*E+_*X+g*oe+p*Ce,r[3]=S*C+A*y+b*Z+N*Y,r[7]=S*P+A*U+b*ie+N*me,r[11]=S*D+A*G+b*H+N*Me,r[15]=S*E+A*X+b*oe+N*Ce,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],r=e[12],a=e[1],o=e[5],l=e[9],c=e[13],h=e[2],f=e[6],u=e[10],d=e[14],m=e[3],_=e[7],g=e[11],p=e[15];return m*(+r*l*f-i*c*f-r*o*u+n*c*u+i*o*d-n*l*d)+_*(+t*l*d-t*c*u+r*a*u-i*a*d+i*c*h-r*l*h)+g*(+t*c*f-t*o*d-r*a*f+n*a*d+r*o*h-n*c*h)+p*(-i*o*h-t*l*f+t*o*u+i*a*f-n*a*u+n*l*h)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],r=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],f=e[9],u=e[10],d=e[11],m=e[12],_=e[13],g=e[14],p=e[15],S=f*g*c-_*u*c+_*l*d-o*g*d-f*l*p+o*u*p,A=m*u*c-h*g*c-m*l*d+a*g*d+h*l*p-a*u*p,b=h*_*c-m*f*c+m*o*d-a*_*d-h*o*p+a*f*p,N=m*f*l-h*_*l-m*o*u+a*_*u+h*o*g-a*f*g,C=t*S+n*A+i*b+r*N;if(C===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const P=1/C;return e[0]=S*P,e[1]=(_*u*r-f*g*r-_*i*d+n*g*d+f*i*p-n*u*p)*P,e[2]=(o*g*r-_*l*r+_*i*c-n*g*c-o*i*p+n*l*p)*P,e[3]=(f*l*r-o*u*r-f*i*c+n*u*c+o*i*d-n*l*d)*P,e[4]=A*P,e[5]=(h*g*r-m*u*r+m*i*d-t*g*d-h*i*p+t*u*p)*P,e[6]=(m*l*r-a*g*r-m*i*c+t*g*c+a*i*p-t*l*p)*P,e[7]=(a*u*r-h*l*r+h*i*c-t*u*c-a*i*d+t*l*d)*P,e[8]=b*P,e[9]=(m*f*r-h*_*r-m*n*d+t*_*d+h*n*p-t*f*p)*P,e[10]=(a*_*r-m*o*r+m*n*c-t*_*c-a*n*p+t*o*p)*P,e[11]=(h*o*r-a*f*r-h*n*c+t*f*c+a*n*d-t*o*d)*P,e[12]=N*P,e[13]=(h*_*i-m*f*i+m*n*u-t*_*u-h*n*g+t*f*g)*P,e[14]=(m*o*i-a*_*i-m*n*l+t*_*l+a*n*g-t*o*g)*P,e[15]=(a*f*i-h*o*i+h*n*l-t*f*l-a*n*u+t*o*u)*P,this}scale(e){const t=this.elements,n=e.x,i=e.y,r=e.z;return t[0]*=n,t[4]*=i,t[8]*=r,t[1]*=n,t[5]*=i,t[9]*=r,t[2]*=n,t[6]*=i,t[10]*=r,t[3]*=n,t[7]*=i,t[11]*=r,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),r=1-n,a=e.x,o=e.y,l=e.z,c=r*a,h=r*o;return this.set(c*a+n,c*o-i*l,c*l+i*o,0,c*o+i*l,h*o+n,h*l-i*a,0,c*l-i*o,h*l+i*a,r*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,r,a){return this.set(1,n,r,0,e,1,a,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,r=t._x,a=t._y,o=t._z,l=t._w,c=r+r,h=a+a,f=o+o,u=r*c,d=r*h,m=r*f,_=a*h,g=a*f,p=o*f,S=l*c,A=l*h,b=l*f,N=n.x,C=n.y,P=n.z;return i[0]=(1-(_+p))*N,i[1]=(d+b)*N,i[2]=(m-A)*N,i[3]=0,i[4]=(d-b)*C,i[5]=(1-(u+p))*C,i[6]=(g+S)*C,i[7]=0,i[8]=(m+A)*P,i[9]=(g-S)*P,i[10]=(1-(u+_))*P,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let r=cs.set(i[0],i[1],i[2]).length();const a=cs.set(i[4],i[5],i[6]).length(),o=cs.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),e.x=i[12],e.y=i[13],e.z=i[14],jn.copy(this);const c=1/r,h=1/a,f=1/o;return jn.elements[0]*=c,jn.elements[1]*=c,jn.elements[2]*=c,jn.elements[4]*=h,jn.elements[5]*=h,jn.elements[6]*=h,jn.elements[8]*=f,jn.elements[9]*=f,jn.elements[10]*=f,t.setFromRotationMatrix(jn),n.x=r,n.y=a,n.z=o,this}makePerspective(e,t,n,i,r,a,o=yi){const l=this.elements,c=2*r/(t-e),h=2*r/(n-i),f=(t+e)/(t-e),u=(n+i)/(n-i);let d,m;if(o===yi)d=-(a+r)/(a-r),m=-2*a*r/(a-r);else if(o===fa)d=-a/(a-r),m=-a*r/(a-r);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return l[0]=c,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=h,l[9]=u,l[13]=0,l[2]=0,l[6]=0,l[10]=d,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,r,a,o=yi){const l=this.elements,c=1/(t-e),h=1/(n-i),f=1/(a-r),u=(t+e)*c,d=(n+i)*h;let m,_;if(o===yi)m=(a+r)*f,_=-2*f;else if(o===fa)m=r*f,_=-1*f;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-u,l[1]=0,l[5]=2*h,l[9]=0,l[13]=-d,l[2]=0,l[6]=0,l[10]=_,l[14]=-m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const cs=new F,jn=new Tt,wf=new F(0,0,0),Tf=new F(1,1,1),Ri=new F,xr=new F,Nn=new F,lc=new Tt,cc=new zn;class Ln{constructor(e=0,t=0,n=0,i=Ln.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,r=i[0],a=i[4],o=i[8],l=i[1],c=i[5],h=i[9],f=i[2],u=i[6],d=i[10];switch(t){case"XYZ":this._y=Math.asin(Ft(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-a,r)):(this._x=Math.atan2(u,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Ft(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-f,r),this._z=0);break;case"ZXY":this._x=Math.asin(Ft(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(-f,d),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(l,r));break;case"ZYX":this._y=Math.asin(-Ft(f,-1,1)),Math.abs(f)<.9999999?(this._x=Math.atan2(u,d),this._z=Math.atan2(l,r)):(this._x=0,this._z=Math.atan2(-a,c));break;case"YZX":this._z=Math.asin(Ft(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-h,c),this._y=Math.atan2(-f,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-Ft(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(u,c),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return lc.makeRotationFromQuaternion(e),this.setFromRotationMatrix(lc,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return cc.setFromEuler(this),this.setFromQuaternion(cc,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Ln.DEFAULT_ORDER="XYZ";class Rl{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let Cf=0;const hc=new F,hs=new zn,pi=new Tt,yr=new F,Gs=new F,Rf=new F,Lf=new zn,uc=new F(1,0,0),dc=new F(0,1,0),fc=new F(0,0,1),pc={type:"added"},Pf={type:"removed"},us={type:"childadded",child:null},Va={type:"childremoved",child:null};class on extends ns{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:Cf++}),this.uuid=Zn(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=on.DEFAULT_UP.clone();const e=new F,t=new Ln,n=new zn,i=new F(1,1,1);function r(){n.setFromEuler(t,!1)}function a(){t.setFromQuaternion(n,void 0,!1)}t._onChange(r),n._onChange(a),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new Tt},normalMatrix:{value:new It}}),this.matrix=new Tt,this.matrixWorld=new Tt,this.matrixAutoUpdate=on.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Rl,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return hs.setFromAxisAngle(e,t),this.quaternion.multiply(hs),this}rotateOnWorldAxis(e,t){return hs.setFromAxisAngle(e,t),this.quaternion.premultiply(hs),this}rotateX(e){return this.rotateOnAxis(uc,e)}rotateY(e){return this.rotateOnAxis(dc,e)}rotateZ(e){return this.rotateOnAxis(fc,e)}translateOnAxis(e,t){return hc.copy(e).applyQuaternion(this.quaternion),this.position.add(hc.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(uc,e)}translateY(e){return this.translateOnAxis(dc,e)}translateZ(e){return this.translateOnAxis(fc,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(pi.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?yr.copy(e):yr.set(e,t,n);const i=this.parent;this.updateWorldMatrix(!0,!1),Gs.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?pi.lookAt(Gs,yr,this.up):pi.lookAt(yr,Gs,this.up),this.quaternion.setFromRotationMatrix(pi),i&&(pi.extractRotation(i.matrixWorld),hs.setFromRotationMatrix(pi),this.quaternion.premultiply(hs.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(pc),us.child=e,this.dispatchEvent(us),us.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(Pf),Va.child=e,this.dispatchEvent(Va),Va.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),pi.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),pi.multiply(e.parent.matrixWorld)),e.applyMatrix4(pi),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(pc),us.child=e,this.dispatchEvent(us),us.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,i=this.children.length;n<i;n++){const a=this.children[n].getObjectByProperty(e,t);if(a!==void 0)return a}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gs,e,Rf),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Gs,Lf,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,i=t.length;n<i;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const i=this.children;for(let r=0,a=i.length;r<a;r++)i[r].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const i={};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.castShadow===!0&&(i.castShadow=!0),this.receiveShadow===!0&&(i.receiveShadow=!0),this.visible===!1&&(i.visible=!1),this.frustumCulled===!1&&(i.frustumCulled=!1),this.renderOrder!==0&&(i.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(i.type="BatchedMesh",i.perObjectFrustumCulled=this.perObjectFrustumCulled,i.sortObjects=this.sortObjects,i.drawRanges=this._drawRanges,i.reservedRanges=this._reservedRanges,i.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),i.instanceInfo=this._instanceInfo.map(o=>({...o})),i.availableInstanceIds=this._availableInstanceIds.slice(),i.availableGeometryIds=this._availableGeometryIds.slice(),i.nextIndexStart=this._nextIndexStart,i.nextVertexStart=this._nextVertexStart,i.geometryCount=this._geometryCount,i.maxInstanceCount=this._maxInstanceCount,i.maxVertexCount=this._maxVertexCount,i.maxIndexCount=this._maxIndexCount,i.geometryInitialized=this._geometryInitialized,i.matricesTexture=this._matricesTexture.toJSON(e),i.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(i.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(i.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(i.boundingBox=this.boundingBox.toJSON()));function r(o,l){return o[l.uuid]===void 0&&(o[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=r(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const l=o.shapes;if(Array.isArray(l))for(let c=0,h=l.length;c<h;c++){const f=l[c];r(e.shapes,f)}else r(e.shapes,l)}}if(this.isSkinnedMesh&&(i.bindMode=this.bindMode,i.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(r(e.skeletons,this.skeleton),i.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let l=0,c=this.material.length;l<c;l++)o.push(r(e.materials,this.material[l]));i.material=o}else i.material=r(e.materials,this.material);if(this.children.length>0){i.children=[];for(let o=0;o<this.children.length;o++)i.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){i.animations=[];for(let o=0;o<this.animations.length;o++){const l=this.animations[o];i.animations.push(r(e.animations,l))}}if(t){const o=a(e.geometries),l=a(e.materials),c=a(e.textures),h=a(e.images),f=a(e.shapes),u=a(e.skeletons),d=a(e.animations),m=a(e.nodes);o.length>0&&(n.geometries=o),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),h.length>0&&(n.images=h),f.length>0&&(n.shapes=f),u.length>0&&(n.skeletons=u),d.length>0&&(n.animations=d),m.length>0&&(n.nodes=m)}return n.object=i,n;function a(o){const l=[];for(const c in o){const h=o[c];delete h.metadata,l.push(h)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const i=e.children[n];this.add(i.clone())}return this}}on.DEFAULT_UP=new F(0,1,0);on.DEFAULT_MATRIX_AUTO_UPDATE=!0;on.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const Yn=new F,mi=new F,Ha=new F,gi=new F,ds=new F,fs=new F,mc=new F,Ga=new F,Wa=new F,Xa=new F,qa=new Xt,ja=new Xt,Ya=new Xt;class Gn{constructor(e=new F,t=new F,n=new F){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,i){i.subVectors(n,t),Yn.subVectors(e,t),i.cross(Yn);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)}static getBarycoord(e,t,n,i,r){Yn.subVectors(i,t),mi.subVectors(n,t),Ha.subVectors(e,t);const a=Yn.dot(Yn),o=Yn.dot(mi),l=Yn.dot(Ha),c=mi.dot(mi),h=mi.dot(Ha),f=a*c-o*o;if(f===0)return r.set(0,0,0),null;const u=1/f,d=(c*l-o*h)*u,m=(a*h-o*l)*u;return r.set(1-d-m,m,d)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,gi)===null?!1:gi.x>=0&&gi.y>=0&&gi.x+gi.y<=1}static getInterpolation(e,t,n,i,r,a,o,l){return this.getBarycoord(e,t,n,i,gi)===null?(l.x=0,l.y=0,"z"in l&&(l.z=0),"w"in l&&(l.w=0),null):(l.setScalar(0),l.addScaledVector(r,gi.x),l.addScaledVector(a,gi.y),l.addScaledVector(o,gi.z),l)}static getInterpolatedAttribute(e,t,n,i,r,a){return qa.setScalar(0),ja.setScalar(0),Ya.setScalar(0),qa.fromBufferAttribute(e,t),ja.fromBufferAttribute(e,n),Ya.fromBufferAttribute(e,i),a.setScalar(0),a.addScaledVector(qa,r.x),a.addScaledVector(ja,r.y),a.addScaledVector(Ya,r.z),a}static isFrontFacing(e,t,n,i){return Yn.subVectors(n,t),mi.subVectors(e,t),Yn.cross(mi).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Yn.subVectors(this.c,this.b),mi.subVectors(this.a,this.b),Yn.cross(mi).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Gn.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Gn.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,i,r){return Gn.getInterpolation(e,this.a,this.b,this.c,t,n,i,r)}containsPoint(e){return Gn.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Gn.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,r=this.c;let a,o;ds.subVectors(i,n),fs.subVectors(r,n),Ga.subVectors(e,n);const l=ds.dot(Ga),c=fs.dot(Ga);if(l<=0&&c<=0)return t.copy(n);Wa.subVectors(e,i);const h=ds.dot(Wa),f=fs.dot(Wa);if(h>=0&&f<=h)return t.copy(i);const u=l*f-h*c;if(u<=0&&l>=0&&h<=0)return a=l/(l-h),t.copy(n).addScaledVector(ds,a);Xa.subVectors(e,r);const d=ds.dot(Xa),m=fs.dot(Xa);if(m>=0&&d<=m)return t.copy(r);const _=d*c-l*m;if(_<=0&&c>=0&&m<=0)return o=c/(c-m),t.copy(n).addScaledVector(fs,o);const g=h*m-d*f;if(g<=0&&f-h>=0&&d-m>=0)return mc.subVectors(r,i),o=(f-h)/(f-h+(d-m)),t.copy(i).addScaledVector(mc,o);const p=1/(g+_+u);return a=_*p,o=u*p,t.copy(n).addScaledVector(ds,a).addScaledVector(fs,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const ru={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},Li={h:0,s:0,l:0},Mr={h:0,s:0,l:0};function $a(s,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?s+(e-s)*6*t:t<1/2?e:t<2/3?s+(e-s)*6*(2/3-t):s}class xt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Qt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,Wt.colorSpaceToWorking(this,t),this}setRGB(e,t,n,i=Wt.workingColorSpace){return this.r=e,this.g=t,this.b=n,Wt.colorSpaceToWorking(this,i),this}setHSL(e,t,n,i=Wt.workingColorSpace){if(e=Tl(e,1),t=Ft(t,0,1),n=Ft(n,0,1),t===0)this.r=this.g=this.b=n;else{const r=n<=.5?n*(1+t):n+t-n*t,a=2*n-r;this.r=$a(a,r,e+1/3),this.g=$a(a,r,e),this.b=$a(a,r,e-1/3)}return Wt.colorSpaceToWorking(this,i),this}setStyle(e,t=Qt){function n(r){r!==void 0&&parseFloat(r)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let r;const a=i[1],o=i[2];switch(a){case"rgb":case"rgba":if(r=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(255,parseInt(r[1],10))/255,Math.min(255,parseInt(r[2],10))/255,Math.min(255,parseInt(r[3],10))/255,t);if(r=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setRGB(Math.min(100,parseInt(r[1],10))/100,Math.min(100,parseInt(r[2],10))/100,Math.min(100,parseInt(r[3],10))/100,t);break;case"hsl":case"hsla":if(r=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return n(r[4]),this.setHSL(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const r=i[1],a=r.length;if(a===3)return this.setRGB(parseInt(r.charAt(0),16)/15,parseInt(r.charAt(1),16)/15,parseInt(r.charAt(2),16)/15,t);if(a===6)return this.setHex(parseInt(r,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Qt){const n=ru[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Mi(e.r),this.g=Mi(e.g),this.b=Mi(e.b),this}copyLinearToSRGB(e){return this.r=Ts(e.r),this.g=Ts(e.g),this.b=Ts(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Qt){return Wt.workingToColorSpace(An.copy(this),e),Math.round(Ft(An.r*255,0,255))*65536+Math.round(Ft(An.g*255,0,255))*256+Math.round(Ft(An.b*255,0,255))}getHexString(e=Qt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=Wt.workingColorSpace){Wt.workingToColorSpace(An.copy(this),t);const n=An.r,i=An.g,r=An.b,a=Math.max(n,i,r),o=Math.min(n,i,r);let l,c;const h=(o+a)/2;if(o===a)l=0,c=0;else{const f=a-o;switch(c=h<=.5?f/(a+o):f/(2-a-o),a){case n:l=(i-r)/f+(i<r?6:0);break;case i:l=(r-n)/f+2;break;case r:l=(n-i)/f+4;break}l/=6}return e.h=l,e.s=c,e.l=h,e}getRGB(e,t=Wt.workingColorSpace){return Wt.workingToColorSpace(An.copy(this),t),e.r=An.r,e.g=An.g,e.b=An.b,e}getStyle(e=Qt){Wt.workingToColorSpace(An.copy(this),e);const t=An.r,n=An.g,i=An.b;return e!==Qt?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${i.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(i*255)})`}offsetHSL(e,t,n){return this.getHSL(Li),this.setHSL(Li.h+e,Li.s+t,Li.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Li),e.getHSL(Mr);const n=Qs(Li.h,Mr.h,t),i=Qs(Li.s,Mr.s,t),r=Qs(Li.l,Mr.l,t);return this.setHSL(n,i,r),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,i=this.b,r=e.elements;return this.r=r[0]*t+r[3]*n+r[6]*i,this.g=r[1]*t+r[4]*n+r[7]*i,this.b=r[2]*t+r[5]*n+r[8]*i,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const An=new xt;xt.NAMES=ru;let Df=0;class Bn extends ns{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:Df++}),this.uuid=Zn(),this.name="",this.type="Material",this.blending=As,this.side=Xn,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=So,this.blendDst=Eo,this.blendEquation=Ji,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new xt(0,0,0),this.blendAlpha=0,this.depthFunc=Rs,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=tc,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=ss,this.stencilZFail=ss,this.stencilZPass=ss,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};n.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!==void 0&&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(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),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(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).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(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),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(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).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!==As&&(n.blending=this.blending),this.side!==Xn&&(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!==So&&(n.blendSrc=this.blendSrc),this.blendDst!==Eo&&(n.blendDst=this.blendDst),this.blendEquation!==Ji&&(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!==Rs&&(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!==tc&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==ss&&(n.stencilFail=this.stencilFail),this.stencilZFail!==ss&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==ss&&(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 i(r){const a=[];for(const o in r){const l=r[o];delete l.metadata,a.push(l)}return a}if(t){const r=i(e.textures),a=i(e.images);r.length>0&&(n.textures=r),a.length>0&&(n.images=a)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let r=0;r!==i;++r)n[r]=t[r].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class zi extends Bn{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new xt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.combine=ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const fn=new F,br=new Qe;let Uf=0;class dn{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:Uf++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=ll,this.updateRanges=[],this.gpuType=oi,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[e+i]=t.array[n+i];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)br.fromBufferAttribute(this,t),br.applyMatrix3(e),this.setXY(t,br.x,br.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyMatrix3(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyMatrix4(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.applyNormalMatrix(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)fn.fromBufferAttribute(this,t),fn.transformDirection(e),this.setXYZ(t,fn.x,fn.y,fn.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=$n(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=rn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=$n(t,this.array)),t}setX(e,t){return this.normalized&&(t=rn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=$n(t,this.array)),t}setY(e,t){return this.normalized&&(t=rn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=$n(t,this.array)),t}setZ(e,t){return this.normalized&&(t=rn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=$n(t,this.array)),t}setW(e,t){return this.normalized&&(t=rn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=rn(t,this.array),n=rn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,i){return e*=this.itemSize,this.normalized&&(t=rn(t,this.array),n=rn(n,this.array),i=rn(i,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e*=this.itemSize,this.normalized&&(t=rn(t,this.array),n=rn(n,this.array),i=rn(i,this.array),r=rn(r,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=i,this.array[e+3]=r,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==ll&&(e.usage=this.usage),e}}class au extends dn{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class Nf extends dn{constructor(e,t,n){super(new Int32Array(e),t,n)}}class ou extends dn{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class Ut extends dn{constructor(e,t,n){super(new Float32Array(e),t,n)}}let If=0;const Vn=new Tt,Ja=new on,ps=new F,In=new ei,Ws=new ei,vn=new F;class hn extends ns{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:If++}),this.uuid=Zn(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(iu(e)?ou:au)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const r=new It().getNormalMatrix(e);n.applyNormalMatrix(r),n.needsUpdate=!0}const i=this.attributes.tangent;return i!==void 0&&(i.transformDirection(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return Vn.makeRotationFromQuaternion(e),this.applyMatrix4(Vn),this}rotateX(e){return Vn.makeRotationX(e),this.applyMatrix4(Vn),this}rotateY(e){return Vn.makeRotationY(e),this.applyMatrix4(Vn),this}rotateZ(e){return Vn.makeRotationZ(e),this.applyMatrix4(Vn),this}translate(e,t,n){return Vn.makeTranslation(e,t,n),this.applyMatrix4(Vn),this}scale(e,t,n){return Vn.makeScale(e,t,n),this.applyMatrix4(Vn),this}lookAt(e){return Ja.lookAt(e),Ja.updateMatrix(),this.applyMatrix4(Ja.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(ps).negate(),this.translate(ps.x,ps.y,ps.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let i=0,r=e.length;i<r;i++){const a=e[i];n.push(a.x,a.y,a.z||0)}this.setAttribute("position",new Ut(n,3))}else{const n=Math.min(e.length,t.count);for(let i=0;i<n;i++){const r=e[i];t.setXYZ(i,r.x,r.y,r.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new F(-1/0,-1/0,-1/0),new F(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,i=t.length;n<i;n++){const r=t[n];In.setFromBufferAttribute(r),this.morphTargetsRelative?(vn.addVectors(this.boundingBox.min,In.min),this.boundingBox.expandByPoint(vn),vn.addVectors(this.boundingBox.max,In.max),this.boundingBox.expandByPoint(vn)):(this.boundingBox.expandByPoint(In.min),this.boundingBox.expandByPoint(In.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 Ei);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new F,1/0);return}if(e){const n=this.boundingSphere.center;if(In.setFromBufferAttribute(e),t)for(let r=0,a=t.length;r<a;r++){const o=t[r];Ws.setFromBufferAttribute(o),this.morphTargetsRelative?(vn.addVectors(In.min,Ws.min),In.expandByPoint(vn),vn.addVectors(In.max,Ws.max),In.expandByPoint(vn)):(In.expandByPoint(Ws.min),In.expandByPoint(Ws.max))}In.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)vn.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(vn));if(t)for(let r=0,a=t.length;r<a;r++){const o=t[r],l=this.morphTargetsRelative;for(let c=0,h=o.count;c<h;c++)vn.fromBufferAttribute(o,c),l&&(ps.fromBufferAttribute(e,c),vn.add(ps)),i=Math.max(i,n.distanceToSquared(vn))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,i=t.normal,r=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new dn(new Float32Array(4*n.count),4));const a=this.getAttribute("tangent"),o=[],l=[];for(let D=0;D<n.count;D++)o[D]=new F,l[D]=new F;const c=new F,h=new F,f=new F,u=new Qe,d=new Qe,m=new Qe,_=new F,g=new F;function p(D,E,y){c.fromBufferAttribute(n,D),h.fromBufferAttribute(n,E),f.fromBufferAttribute(n,y),u.fromBufferAttribute(r,D),d.fromBufferAttribute(r,E),m.fromBufferAttribute(r,y),h.sub(c),f.sub(c),d.sub(u),m.sub(u);const U=1/(d.x*m.y-m.x*d.y);isFinite(U)&&(_.copy(h).multiplyScalar(m.y).addScaledVector(f,-d.y).multiplyScalar(U),g.copy(f).multiplyScalar(d.x).addScaledVector(h,-m.x).multiplyScalar(U),o[D].add(_),o[E].add(_),o[y].add(_),l[D].add(g),l[E].add(g),l[y].add(g))}let S=this.groups;S.length===0&&(S=[{start:0,count:e.count}]);for(let D=0,E=S.length;D<E;++D){const y=S[D],U=y.start,G=y.count;for(let X=U,Z=U+G;X<Z;X+=3)p(e.getX(X+0),e.getX(X+1),e.getX(X+2))}const A=new F,b=new F,N=new F,C=new F;function P(D){N.fromBufferAttribute(i,D),C.copy(N);const E=o[D];A.copy(E),A.sub(N.multiplyScalar(N.dot(E))).normalize(),b.crossVectors(C,E);const U=b.dot(l[D])<0?-1:1;a.setXYZW(D,A.x,A.y,A.z,U)}for(let D=0,E=S.length;D<E;++D){const y=S[D],U=y.start,G=y.count;for(let X=U,Z=U+G;X<Z;X+=3)P(e.getX(X+0)),P(e.getX(X+1)),P(e.getX(X+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new dn(new Float32Array(t.count*3),3),this.setAttribute("normal",n);else for(let u=0,d=n.count;u<d;u++)n.setXYZ(u,0,0,0);const i=new F,r=new F,a=new F,o=new F,l=new F,c=new F,h=new F,f=new F;if(e)for(let u=0,d=e.count;u<d;u+=3){const m=e.getX(u+0),_=e.getX(u+1),g=e.getX(u+2);i.fromBufferAttribute(t,m),r.fromBufferAttribute(t,_),a.fromBufferAttribute(t,g),h.subVectors(a,r),f.subVectors(i,r),h.cross(f),o.fromBufferAttribute(n,m),l.fromBufferAttribute(n,_),c.fromBufferAttribute(n,g),o.add(h),l.add(h),c.add(h),n.setXYZ(m,o.x,o.y,o.z),n.setXYZ(_,l.x,l.y,l.z),n.setXYZ(g,c.x,c.y,c.z)}else for(let u=0,d=t.count;u<d;u+=3)i.fromBufferAttribute(t,u+0),r.fromBufferAttribute(t,u+1),a.fromBufferAttribute(t,u+2),h.subVectors(a,r),f.subVectors(i,r),h.cross(f),n.setXYZ(u+0,h.x,h.y,h.z),n.setXYZ(u+1,h.x,h.y,h.z),n.setXYZ(u+2,h.x,h.y,h.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)vn.fromBufferAttribute(e,t),vn.normalize(),e.setXYZ(t,vn.x,vn.y,vn.z)}toNonIndexed(){function e(o,l){const c=o.array,h=o.itemSize,f=o.normalized,u=new c.constructor(l.length*h);let d=0,m=0;for(let _=0,g=l.length;_<g;_++){o.isInterleavedBufferAttribute?d=l[_]*o.data.stride+o.offset:d=l[_]*h;for(let p=0;p<h;p++)u[m++]=c[d++]}return new dn(u,h,f)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new hn,n=this.index.array,i=this.attributes;for(const o in i){const l=i[o],c=e(l,n);t.setAttribute(o,c)}const r=this.morphAttributes;for(const o in r){const l=[],c=r[o];for(let h=0,f=c.length;h<f;h++){const u=c[h],d=e(u,n);l.push(d)}t.morphAttributes[o]=l}t.morphTargetsRelative=this.morphTargetsRelative;const a=this.groups;for(let o=0,l=a.length;o<l;o++){const c=a[o];t.addGroup(c.start,c.count,c.materialIndex)}return t}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let r=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],h=[];for(let f=0,u=c.length;f<u;f++){const d=c[f];h.push(d.toJSON(e.data))}h.length>0&&(i[l]=h,r=!0)}r&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const a=this.groups;a.length>0&&(e.data.groups=JSON.parse(JSON.stringify(a)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const i=e.attributes;for(const c in i){const h=i[c];this.setAttribute(c,h.clone(t))}const r=e.morphAttributes;for(const c in r){const h=[],f=r[c];for(let u=0,d=f.length;u<d;u++)h.push(f[u].clone(t));this.morphAttributes[c]=h}this.morphTargetsRelative=e.morphTargetsRelative;const a=e.groups;for(let c=0,h=a.length;c<h;c++){const f=a[c];this.addGroup(f.start,f.count,f.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const l=e.boundingSphere;return l!==null&&(this.boundingSphere=l.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const gc=new Tt,Gi=new Fs,Sr=new Ei,_c=new F,Er=new F,Ar=new F,wr=new F,Ka=new F,Tr=new F,vc=new F,Cr=new F;class en extends on{constructor(e=new hn,t=new zi){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}getVertexPosition(e,t){const n=this.geometry,i=n.attributes.position,r=n.morphAttributes.position,a=n.morphTargetsRelative;t.fromBufferAttribute(i,e);const o=this.morphTargetInfluences;if(r&&o){Tr.set(0,0,0);for(let l=0,c=r.length;l<c;l++){const h=o[l],f=r[l];h!==0&&(Ka.fromBufferAttribute(f,e),a?Tr.addScaledVector(Ka,h):Tr.addScaledVector(Ka.sub(t),h))}t.add(Tr)}return t}raycast(e,t){const n=this.geometry,i=this.material,r=this.matrixWorld;i!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Sr.copy(n.boundingSphere),Sr.applyMatrix4(r),Gi.copy(e.ray).recast(e.near),!(Sr.containsPoint(Gi.origin)===!1&&(Gi.intersectSphere(Sr,_c)===null||Gi.origin.distanceToSquared(_c)>(e.far-e.near)**2))&&(gc.copy(r).invert(),Gi.copy(e.ray).applyMatrix4(gc),!(n.boundingBox!==null&&Gi.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Gi)))}_computeIntersections(e,t,n){let i;const r=this.geometry,a=this.material,o=r.index,l=r.attributes.position,c=r.attributes.uv,h=r.attributes.uv1,f=r.attributes.normal,u=r.groups,d=r.drawRange;if(o!==null)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],S=Math.max(g.start,d.start),A=Math.min(o.count,Math.min(g.start+g.count,d.start+d.count));for(let b=S,N=A;b<N;b+=3){const C=o.getX(b),P=o.getX(b+1),D=o.getX(b+2);i=Rr(this,p,e,n,c,h,f,C,P,D),i&&(i.faceIndex=Math.floor(b/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,d.start),_=Math.min(o.count,d.start+d.count);for(let g=m,p=_;g<p;g+=3){const S=o.getX(g),A=o.getX(g+1),b=o.getX(g+2);i=Rr(this,a,e,n,c,h,f,S,A,b),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}else if(l!==void 0)if(Array.isArray(a))for(let m=0,_=u.length;m<_;m++){const g=u[m],p=a[g.materialIndex],S=Math.max(g.start,d.start),A=Math.min(l.count,Math.min(g.start+g.count,d.start+d.count));for(let b=S,N=A;b<N;b+=3){const C=b,P=b+1,D=b+2;i=Rr(this,p,e,n,c,h,f,C,P,D),i&&(i.faceIndex=Math.floor(b/3),i.face.materialIndex=g.materialIndex,t.push(i))}}else{const m=Math.max(0,d.start),_=Math.min(l.count,d.start+d.count);for(let g=m,p=_;g<p;g+=3){const S=g,A=g+1,b=g+2;i=Rr(this,a,e,n,c,h,f,S,A,b),i&&(i.faceIndex=Math.floor(g/3),t.push(i))}}}}function Ff(s,e,t,n,i,r,a,o){let l;if(e.side===Rn?l=n.intersectTriangle(a,r,i,!0,o):l=n.intersectTriangle(i,r,a,e.side===Xn,o),l===null)return null;Cr.copy(o),Cr.applyMatrix4(s.matrixWorld);const c=t.ray.origin.distanceTo(Cr);return c<t.near||c>t.far?null:{distance:c,point:Cr.clone(),object:s}}function Rr(s,e,t,n,i,r,a,o,l,c){s.getVertexPosition(o,Er),s.getVertexPosition(l,Ar),s.getVertexPosition(c,wr);const h=Ff(s,e,t,n,Er,Ar,wr,vc);if(h){const f=new F;Gn.getBarycoord(vc,Er,Ar,wr,f),i&&(h.uv=Gn.getInterpolatedAttribute(i,o,l,c,f,new Qe)),r&&(h.uv1=Gn.getInterpolatedAttribute(r,o,l,c,f,new Qe)),a&&(h.normal=Gn.getInterpolatedAttribute(a,o,l,c,f,new F),h.normal.dot(n.direction)>0&&h.normal.multiplyScalar(-1));const u={a:o,b:l,c,normal:new F,materialIndex:0};Gn.getNormal(Er,Ar,wr,u.normal),h.face=u,h.barycoord=f}return h}class Bi extends hn{constructor(e=1,t=1,n=1,i=1,r=1,a=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:r,depthSegments:a};const o=this;i=Math.floor(i),r=Math.floor(r),a=Math.floor(a);const l=[],c=[],h=[],f=[];let u=0,d=0;m("z","y","x",-1,-1,n,t,e,a,r,0),m("z","y","x",1,-1,n,t,-e,a,r,1),m("x","z","y",1,1,e,n,t,i,a,2),m("x","z","y",1,-1,e,n,-t,i,a,3),m("x","y","z",1,-1,e,t,n,i,r,4),m("x","y","z",-1,-1,e,t,-n,i,r,5),this.setIndex(l),this.setAttribute("position",new Ut(c,3)),this.setAttribute("normal",new Ut(h,3)),this.setAttribute("uv",new Ut(f,2));function m(_,g,p,S,A,b,N,C,P,D,E){const y=b/P,U=N/D,G=b/2,X=N/2,Z=C/2,ie=P+1,H=D+1;let oe=0,Y=0;const me=new F;for(let Me=0;Me<H;Me++){const Ce=Me*U-X;for(let Ye=0;Ye<ie;Ye++){const Oe=Ye*y-G;me[_]=Oe*S,me[g]=Ce*A,me[p]=Z,c.push(me.x,me.y,me.z),me[_]=0,me[g]=0,me[p]=C>0?1:-1,h.push(me.x,me.y,me.z),f.push(Ye/P),f.push(1-Me/D),oe+=1}}for(let Me=0;Me<D;Me++)for(let Ce=0;Ce<P;Ce++){const Ye=u+Ce+ie*Me,Oe=u+Ce+ie*(Me+1),K=u+(Ce+1)+ie*(Me+1),te=u+(Ce+1)+ie*Me;l.push(Ye,Oe,te),l.push(Oe,K,te),Y+=6}o.addGroup(d,Y,E),d+=Y,u+=oe}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bi(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Ns(s){const e={};for(const t in s){e[t]={};for(const n in s[t]){const i=s[t][n];i&&(i.isColor||i.isMatrix3||i.isMatrix4||i.isVector2||i.isVector3||i.isVector4||i.isTexture||i.isQuaternion)?i.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=i.clone():Array.isArray(i)?e[t][n]=i.slice():e[t][n]=i}}return e}function Cn(s){const e={};for(let t=0;t<s.length;t++){const n=Ns(s[t]);for(const i in n)e[i]=n[i]}return e}function Of(s){const e=[];for(let t=0;t<s.length;t++)e.push(s[t].clone());return e}function lu(s){const e=s.getRenderTarget();return e===null?s.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:Wt.workingColorSpace}const Ll={clone:Ns,merge:Cn};var zf=`void main() {
|
|
6
6
|
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
|
|
7
|
-
}`,
|
|
7
|
+
}`,Bf=`void main() {
|
|
8
8
|
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
|
|
9
|
-
}`;class
|
|
9
|
+
}`;class Si extends Bn{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=zf,this.fragmentShader=Bf,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Ns(e.uniforms),this.uniformsGroups=Of(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const i in this.uniforms){const a=this.uniforms[i].value;a&&a.isTexture?t.uniforms[i]={type:"t",value:a.toJSON(e).uuid}:a&&a.isColor?t.uniforms[i]={type:"c",value:a.getHex()}:a&&a.isVector2?t.uniforms[i]={type:"v2",value:a.toArray()}:a&&a.isVector3?t.uniforms[i]={type:"v3",value:a.toArray()}:a&&a.isVector4?t.uniforms[i]={type:"v4",value:a.toArray()}:a&&a.isMatrix3?t.uniforms[i]={type:"m3",value:a.toArray()}:a&&a.isMatrix4?t.uniforms[i]={type:"m4",value:a.toArray()}:t.uniforms[i]={value:a}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class cu extends on{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Tt,this.projectionMatrix=new Tt,this.projectionMatrixInverse=new Tt,this.coordinateSystem=yi}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Pi=new F,xc=new Qe,yc=new Qe;class bn extends cu{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Us*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Zs*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Us*2*Math.atan(Math.tan(Zs*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Pi.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Pi.x,Pi.y).multiplyScalar(-e/Pi.z),Pi.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Pi.x,Pi.y).multiplyScalar(-e/Pi.z)}getViewSize(e,t){return this.getViewBounds(e,xc,yc),t.subVectors(yc,xc)}setViewOffset(e,t,n,i,r,a){this.aspect=e/t,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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(Zs*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,r=-.5*i;const a=this.view;if(this.view!==null&&this.view.enabled){const l=a.fullWidth,c=a.fullHeight;r+=a.offsetX*i/l,t-=a.offsetY*n/c,i*=a.width/l,n*=a.height/c}const o=this.filmOffset;o!==0&&(r+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const ms=-90,gs=1;class kf extends on{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const i=new bn(ms,gs,e,t);i.layers=this.layers,this.add(i);const r=new bn(ms,gs,e,t);r.layers=this.layers,this.add(r);const a=new bn(ms,gs,e,t);a.layers=this.layers,this.add(a);const o=new bn(ms,gs,e,t);o.layers=this.layers,this.add(o);const l=new bn(ms,gs,e,t);l.layers=this.layers,this.add(l);const c=new bn(ms,gs,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,r,a,o,l]=t;for(const c of t)this.remove(c);if(e===yi)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),r.up.set(0,0,-1),r.lookAt(0,1,0),a.up.set(0,0,1),a.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===fa)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),r.up.set(0,0,1),r.lookAt(0,1,0),a.up.set(0,0,-1),a.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:i}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[r,a,o,l,c,h]=this.children,f=e.getRenderTarget(),u=e.getActiveCubeFace(),d=e.getActiveMipmapLevel(),m=e.xr.enabled;e.xr.enabled=!1;const _=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,i),e.render(t,r),e.setRenderTarget(n,1,i),e.render(t,a),e.setRenderTarget(n,2,i),e.render(t,o),e.setRenderTarget(n,3,i),e.render(t,l),e.setRenderTarget(n,4,i),e.render(t,c),n.texture.generateMipmaps=_,e.setRenderTarget(n,5,i),e.render(t,h),e.setRenderTarget(f,u,d),e.xr.enabled=m,n.texture.needsPMREMUpdate=!0}}class hu extends Sn{constructor(e=[],t=Ls,n,i,r,a,o,l,c,h){super(e,t,n,i,r,a,o,l,c,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class Vf extends ts{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];this.texture=new hu(i),this._setTextureOptions(t),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
|
|
10
10
|
|
|
11
11
|
varying vec3 vWorldDirection;
|
|
12
12
|
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
42
42
|
|
|
43
43
|
}
|
|
44
|
-
`},i=new Bi(5,5,5),r=new bi({name:"CubemapFromEquirect",uniforms:Ns(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Rn,blending:Fi});r.uniforms.tEquirect.value=t;const a=new Jt(i,r),o=t.minFilter;return t.minFilter===xi&&(t.minFilter=Fn),new Bf(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(r)}}class Kn extends an{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Vf={type:"move"};class Za{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Kn,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 Kn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Kn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,n),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const h=c.joints["index-finger-tip"],d=c.joints["thumb-tip"],u=h.position.distanceTo(d.position),f=.02,m=.005;c.inputState.pinching&&u>f+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&u<=f-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Vf)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Kn;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Pl extends an{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ln,this.environmentIntensity=1,this.environmentRotation=new Ln,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class uu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ll,this.updateRanges=[],this.version=0,this.uuid=Zn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Tn=new F;class li{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.applyMatrix4(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.applyNormalMatrix(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.transformDirection(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=$n(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=tn(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=tn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=tn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=tn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=tn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=$n(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=$n(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=$n(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=$n(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=tn(t,this.array),n=tn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=tn(t,this.array),n=tn(n,this.array),i=tn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=tn(t,this.array),n=tn(n,this.array),i=tn(i,this.array),r=tn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new fn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new li(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class ba extends Bn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new vt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let _s;const Xs=new F,vs=new F,xs=new F,ys=new Qe,qs=new Qe,du=new bt,Lr=new F,js=new F,Pr=new F,Mc=new Qe,Qa=new Qe,Sc=new Qe;class Dl extends an{constructor(e=new ba){if(super(),this.isSprite=!0,this.type="Sprite",_s===void 0){_s=new ln;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new uu(t,5);_s.setIndex([0,1,2,0,2,3]),_s.setAttribute("position",new li(n,3,0,!1)),_s.setAttribute("uv",new li(n,2,3,!1))}this.geometry=_s,this.material=e,this.center=new Qe(.5,.5),this.count=1}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),vs.setFromMatrixScale(this.matrixWorld),du.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),xs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&vs.multiplyScalar(-xs.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;Dr(Lr.set(-.5,-.5,0),xs,a,vs,i,r),Dr(js.set(.5,-.5,0),xs,a,vs,i,r),Dr(Pr.set(.5,.5,0),xs,a,vs,i,r),Mc.set(0,0),Qa.set(1,0),Sc.set(1,1);let o=e.ray.intersectTriangle(Lr,js,Pr,!1,Xs);if(o===null&&(Dr(js.set(-.5,.5,0),xs,a,vs,i,r),Qa.set(0,1),o=e.ray.intersectTriangle(Lr,Pr,js,!1,Xs),o===null))return;const l=e.ray.origin.distanceTo(Xs);l<e.near||l>e.far||t.push({distance:l,point:Xs.clone(),uv:Gn.getInterpolation(Xs,Lr,js,Pr,Mc,Qa,Sc,new Qe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Dr(s,e,t,n,i,r){ys.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(qs.x=r*ys.x-i*ys.y,qs.y=i*ys.x+r*ys.y):qs.copy(ys),s.copy(e),s.x+=qs.x,s.y+=qs.y,s.applyMatrix4(du)}const Ur=new F,bc=new F;class fu extends an{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const r=t[n];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const i=t.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ur.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Ur);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ur.setFromMatrixPosition(e.matrixWorld),bc.setFromMatrixPosition(this.matrixWorld);const n=Ur.distanceTo(bc)/e.zoom;t[0].object.visible=!0;let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),n>=a)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const Ec=new F,Ac=new Gt,wc=new Gt,Hf=new F,Tc=new bt,Nr=new F,eo=new Ei,Cc=new bt,to=new Fs;class Gf extends Jt{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Kl,this.bindMatrix=new bt,this.bindMatrixInverse=new bt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ei),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingBox.expandByPoint(Nr)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ei),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingSphere.expandByPoint(Nr)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),eo.copy(this.boundingSphere),eo.applyMatrix4(i),e.ray.intersectsSphere(eo)!==!1&&(Cc.copy(i).invert(),to.copy(e.ray).applyMatrix4(Cc),!(this.boundingBox!==null&&to.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,to)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Gt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Kl?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===zd?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Ac.fromBufferAttribute(i.attributes.skinIndex,e),wc.fromBufferAttribute(i.attributes.skinWeight,e),Ec.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=wc.getComponent(r);if(a!==0){const o=Ac.getComponent(r);Tc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Hf.copy(Ec).applyMatrix4(Tc),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class pu extends an{constructor(){super(),this.isBone=!0,this.type="Bone"}}class mu extends bn{constructor(e=null,t=1,n=1,i,r,a,o,l,c=On,h=On,d,u){super(null,a,o,l,c,h,i,r,d,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Rc=new bt,Wf=new bt;class Ul{constructor(e=[],t=[]){this.uuid=Zn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new bt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new bt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:Wf;Rc.multiplyMatrices(o,t[r]),Rc.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ul(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new mu(t,e,e,Wn,oi);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let a=t[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new pu),this.bones.push(a),this.boneInverses.push(new bt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}const no=new F,Xf=new F,qf=new Nt;class Ui{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=no.subVectors(n,t).cross(Xf.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(no),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||qf.getNormalMatrix(e),i=this.coplanarPoint(no).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Wi=new Ei,Ir=new F;class Nl{constructor(e=new Ui,t=new Ui,n=new Ui,i=new Ui,r=new Ui,a=new Ui){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=yi){const n=this.planes,i=e.elements,r=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],d=i[6],u=i[7],f=i[8],m=i[9],_=i[10],g=i[11],p=i[12],E=i[13],b=i[14],M=i[15];if(n[0].setComponents(l-r,u-c,g-f,M-p).normalize(),n[1].setComponents(l+r,u+c,g+f,M+p).normalize(),n[2].setComponents(l+a,u+h,g+m,M+E).normalize(),n[3].setComponents(l-a,u-h,g-m,M-E).normalize(),n[4].setComponents(l-o,u-d,g-_,M-b).normalize(),t===yi)n[5].setComponents(l+o,u+d,g+_,M+b).normalize();else if(t===fa)n[5].setComponents(o,d,_,b).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Wi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Wi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Wi)}intersectsSprite(e){return Wi.center.set(0,0,0),Wi.radius=.7071067811865476,Wi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wi)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Ir.x=i.normal.x>0?e.max.x:e.min.x,Ir.y=i.normal.y>0?e.max.y:e.min.y,Ir.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ir)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class Si extends Bn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new vt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const pa=new F,ma=new F,Lc=new bt,Ys=new Fs,Fr=new Ei,io=new F,Pc=new F;class Ea extends an{constructor(e=new ln,t=new Si){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)pa.fromBufferAttribute(t,i-1),ma.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=pa.distanceTo(ma);e.setAttribute("lineDistance",new Dt(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Fr.copy(n.boundingSphere),Fr.applyMatrix4(i),Fr.radius+=r,e.ray.intersectsSphere(Fr)===!1)return;Lc.copy(i).invert(),Ys.copy(e.ray).applyMatrix4(Lc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,u=n.attributes.position;if(h!==null){const f=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=h.getX(_),E=h.getX(_+1),b=Or(this,e,Ys,l,p,E,_);b&&t.push(b)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(f),p=Or(this,e,Ys,l,_,g,m-1);p&&t.push(p)}}else{const f=Math.max(0,a.start),m=Math.min(u.count,a.start+a.count);for(let _=f,g=m-1;_<g;_+=c){const p=Or(this,e,Ys,l,_,_+1,_);p&&t.push(p)}if(this.isLineLoop){const _=Or(this,e,Ys,l,m-1,f,m-1);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Or(s,e,t,n,i,r,a){const o=s.geometry.attributes.position;if(pa.fromBufferAttribute(o,i),ma.fromBufferAttribute(o,r),t.distanceSqToSegment(pa,ma,io,Pc)>n)return;io.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(io);if(!(c<e.near||c>e.far))return{distance:c,point:Pc.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Dc=new F,Uc=new F;class ga extends Ea{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)Dc.fromBufferAttribute(t,i),Uc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Dc.distanceTo(Uc);e.setAttribute("lineDistance",new Dt(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ii extends Bn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new vt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Nc=new bt,cl=new Fs,zr=new Ei,Br=new F;class Cs extends an{constructor(e=new ln,t=new Ii){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),zr.copy(n.boundingSphere),zr.applyMatrix4(i),zr.radius+=r,e.ray.intersectsSphere(zr)===!1)return;Nc.copy(i).invert(),cl.copy(e.ray).applyMatrix4(Nc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,d=n.attributes.position;if(c!==null){const u=Math.max(0,a.start),f=Math.min(c.count,a.start+a.count);for(let m=u,_=f;m<_;m++){const g=c.getX(m);Br.fromBufferAttribute(d,g),Ic(Br,g,l,i,e,t,this)}}else{const u=Math.max(0,a.start),f=Math.min(d.count,a.start+a.count);for(let m=u,_=f;m<_;m++)Br.fromBufferAttribute(d,m),Ic(Br,m,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Ic(s,e,t,n,i,r,a){const o=cl.distanceSqToPoint(s);if(o<t){const l=new F;cl.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class jf extends bn{constructor(e,t,n,i,r,a,o,l,c){super(e,t,n,i,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class gu extends bn{constructor(e,t,n=es,i,r,a,o=On,l=On,c,h=rr,d=1){if(h!==rr&&h!==ar)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const u={width:e,height:t,depth:d};super(u,i,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Cl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Il extends ln{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],d=[],u=[],f=[];let m=0;const _=[],g=n/2;let p=0;E(),a===!1&&(e>0&&b(!0),t>0&&b(!1)),this.setIndex(h),this.setAttribute("position",new Dt(d,3)),this.setAttribute("normal",new Dt(u,3)),this.setAttribute("uv",new Dt(f,2));function E(){const M=new F,U=new F;let R=0;const P=(t-e)/n;for(let D=0;D<=r;D++){const S=[],y=D/r,N=y*(t-e)+e;for(let W=0;W<=i;W++){const X=W/i,Q=X*l+o,ne=Math.sin(Q),H=Math.cos(Q);U.x=N*ne,U.y=-y*n+g,U.z=N*H,d.push(U.x,U.y,U.z),M.set(ne,P,H).normalize(),u.push(M.x,M.y,M.z),f.push(X,1-y),S.push(m++)}_.push(S)}for(let D=0;D<i;D++)for(let S=0;S<r;S++){const y=_[S][D],N=_[S+1][D],W=_[S+1][D+1],X=_[S][D+1];(e>0||S!==0)&&(h.push(y,N,X),R+=3),(t>0||S!==r-1)&&(h.push(N,W,X),R+=3)}c.addGroup(p,R,0),p+=R}function b(M){const U=m,R=new Qe,P=new F;let D=0;const S=M===!0?e:t,y=M===!0?1:-1;for(let W=1;W<=i;W++)d.push(0,g*y,0),u.push(0,y,0),f.push(.5,.5),m++;const N=m;for(let W=0;W<=i;W++){const Q=W/i*l+o,ne=Math.cos(Q),H=Math.sin(Q);P.x=S*H,P.y=g*y,P.z=S*ne,d.push(P.x,P.y,P.z),u.push(0,y,0),R.x=ne*.5+.5,R.y=H*.5*y+.5,f.push(R.x,R.y),m++}for(let W=0;W<i;W++){const X=U+W,Q=N+W;M===!0?h.push(Q,Q+1,X):h.push(Q+1,Q,X),D+=3}c.addGroup(p,D,M===!0?1:2),p+=D}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Il(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ai{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const r=n.length;let a;t?a=t:a=e*n[r-1];let o=0,l=r-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(r-1);const h=n[i],u=n[i+1]-h,f=(a-h)/u;return(i+f)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),o=this.getPoint(r),l=t||(a.isVector2?new Qe:new F);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new F,i=[],r=[],a=[],o=new F,l=new bt;for(let f=0;f<=e;f++){const m=f/e;i[f]=this.getTangentAt(m,new F)}r[0]=new F,a[0]=new F;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),d=Math.abs(i[0].y),u=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),d<=c&&(c=d,n.set(0,1,0)),u<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(let f=1;f<=e;f++){if(r[f]=r[f-1].clone(),a[f]=a[f-1].clone(),o.crossVectors(i[f-1],i[f]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(It(i[f-1].dot(i[f]),-1,1));r[f].applyMatrix4(l.makeRotationAxis(o,m))}a[f].crossVectors(i[f],r[f])}if(t===!0){let f=Math.acos(It(r[0].dot(r[e]),-1,1));f/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(f=-f);for(let m=1;m<=e;m++)r[m].applyMatrix4(l.makeRotationAxis(i[m],f*m)),a[m].crossVectors(i[m],r[m])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class _u extends Ai{constructor(e=0,t=0,n=1,i=1,r=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Qe){const n=t,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(a?r=0:r=i),this.aClockwise===!0&&!a&&(r===i?r=-i:r=r-i);const o=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),u=l-this.aX,f=c-this.aY;l=u*h-f*d+this.aX,c=u*d+f*h+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class Yf extends _u{constructor(e,t,n,i,r,a){super(e,t,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Fl(){let s=0,e=0,t=0,n=0;function i(r,a,o,l){s=r,e=o,t=-3*r+3*a-2*o-l,n=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){i(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,h,d){let u=(a-r)/c-(o-r)/(c+h)+(o-a)/h,f=(o-a)/h-(l-a)/(h+d)+(l-o)/d;u*=h,f*=h,i(a,o,u,f)},calc:function(r){const a=r*r,o=a*r;return s+e*r+t*a+n*o}}}const kr=new F,so=new Fl,ro=new Fl,ao=new Fl;class vu extends Ai{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new F){const n=t,i=this.points,r=i.length,a=(r-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%r]:(kr.subVectors(i[0],i[1]).add(i[0]),c=kr);const d=i[o%r],u=i[(o+1)%r];if(this.closed||o+2<r?h=i[(o+2)%r]:(kr.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=kr),this.curveType==="centripetal"||this.curveType==="chordal"){const f=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(d),f),_=Math.pow(d.distanceToSquared(u),f),g=Math.pow(u.distanceToSquared(h),f);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),so.initNonuniformCatmullRom(c.x,d.x,u.x,h.x,m,_,g),ro.initNonuniformCatmullRom(c.y,d.y,u.y,h.y,m,_,g),ao.initNonuniformCatmullRom(c.z,d.z,u.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(so.initCatmullRom(c.x,d.x,u.x,h.x,this.tension),ro.initCatmullRom(c.y,d.y,u.y,h.y,this.tension),ao.initCatmullRom(c.z,d.z,u.z,h.z,this.tension));return n.set(so.calc(l),ro.calc(l),ao.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new F().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Fc(s,e,t,n,i){const r=(n-e)*.5,a=(i-t)*.5,o=s*s,l=s*o;return(2*t-2*n+r+a)*l+(-3*t+3*n-2*r-a)*o+r*s+t}function $f(s,e){const t=1-s;return t*t*e}function Jf(s,e){return 2*(1-s)*s*e}function Kf(s,e){return s*s*e}function er(s,e,t,n){return $f(s,e)+Jf(s,t)+Kf(s,n)}function Zf(s,e){const t=1-s;return t*t*t*e}function Qf(s,e){const t=1-s;return 3*t*t*s*e}function ep(s,e){return 3*(1-s)*s*s*e}function tp(s,e){return s*s*s*e}function tr(s,e,t,n,i){return Zf(s,e)+Qf(s,t)+ep(s,n)+tp(s,i)}class np extends Ai{constructor(e=new Qe,t=new Qe,n=new Qe,i=new Qe){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Qe){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(tr(e,i.x,r.x,a.x,o.x),tr(e,i.y,r.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class ip extends Ai{constructor(e=new F,t=new F,n=new F,i=new F){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(tr(e,i.x,r.x,a.x,o.x),tr(e,i.y,r.y,a.y,o.y),tr(e,i.z,r.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class sp extends Ai{constructor(e=new Qe,t=new Qe){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Qe){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Qe){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class rp extends Ai{constructor(e=new F,t=new F){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new F){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new F){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ap extends Ai{constructor(e=new Qe,t=new Qe,n=new Qe){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Qe){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(er(e,i.x,r.x,a.x),er(e,i.y,r.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class xu extends Ai{constructor(e=new F,t=new F,n=new F){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(er(e,i.x,r.x,a.x),er(e,i.y,r.y,a.y),er(e,i.z,r.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class op extends Ai{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Qe){const n=t,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],d=i[a>i.length-3?i.length-1:a+2];return n.set(Fc(o,l.x,c.x,h.x,d.x),Fc(o,l.y,c.y,h.y,d.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Qe().fromArray(i))}return this}}var lp=Object.freeze({__proto__:null,ArcCurve:Yf,CatmullRomCurve3:vu,CubicBezierCurve:np,CubicBezierCurve3:ip,EllipseCurve:_u,LineCurve:sp,LineCurve3:rp,QuadraticBezierCurve:ap,QuadraticBezierCurve3:xu,SplineCurve:op});class hr extends ln{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,d=e/o,u=t/l,f=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const E=p*u-a;for(let b=0;b<c;b++){const M=b*d-r;m.push(M,-E,0),_.push(0,0,1),g.push(b/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let E=0;E<o;E++){const b=E+c*p,M=E+c*(p+1),U=E+1+c*(p+1),R=E+1+c*p;f.push(b,M,R),f.push(M,U,R)}this.setIndex(f),this.setAttribute("position",new Dt(m,3)),this.setAttribute("normal",new Dt(_,3)),this.setAttribute("uv",new Dt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hr(e.width,e.height,e.widthSegments,e.heightSegments)}}class Aa extends ln{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const h=[],d=new F,u=new F,f=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const E=[],b=p/n;let M=0;p===0&&a===0?M=.5/t:p===n&&l===Math.PI&&(M=-.5/t);for(let U=0;U<=t;U++){const R=U/t;d.x=-e*Math.cos(i+R*r)*Math.sin(a+b*o),d.y=e*Math.cos(a+b*o),d.z=e*Math.sin(i+R*r)*Math.sin(a+b*o),m.push(d.x,d.y,d.z),u.copy(d).normalize(),_.push(u.x,u.y,u.z),g.push(R+M,1-b),E.push(c++)}h.push(E)}for(let p=0;p<n;p++)for(let E=0;E<t;E++){const b=h[p][E+1],M=h[p][E],U=h[p+1][E],R=h[p+1][E+1];(p!==0||a>0)&&f.push(b,M,R),(p!==n-1||l<Math.PI)&&f.push(M,U,R)}this.setIndex(f),this.setAttribute("position",new Dt(m,3)),this.setAttribute("normal",new Dt(_,3)),this.setAttribute("uv",new Dt(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Aa(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Ol extends ln{constructor(e=new xu(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new F,l=new F,c=new Qe;let h=new F;const d=[],u=[],f=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new Dt(d,3)),this.setAttribute("normal",new Dt(u,3)),this.setAttribute("uv",new Dt(f,2));function _(){for(let b=0;b<t;b++)g(b);g(r===!1?t:0),E(),p()}function g(b){h=e.getPointAt(b/t,h);const M=a.normals[b],U=a.binormals[b];for(let R=0;R<=i;R++){const P=R/i*Math.PI*2,D=Math.sin(P),S=-Math.cos(P);l.x=S*M.x+D*U.x,l.y=S*M.y+D*U.y,l.z=S*M.z+D*U.z,l.normalize(),u.push(l.x,l.y,l.z),o.x=h.x+n*l.x,o.y=h.y+n*l.y,o.z=h.z+n*l.z,d.push(o.x,o.y,o.z)}}function p(){for(let b=1;b<=t;b++)for(let M=1;M<=i;M++){const U=(i+1)*(b-1)+(M-1),R=(i+1)*b+(M-1),P=(i+1)*b+M,D=(i+1)*(b-1)+M;m.push(U,R,D),m.push(R,P,D)}}function E(){for(let b=0;b<=t;b++)for(let M=0;M<=i;M++)c.x=b/t,c.y=M/i,f.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Ol(new lp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class cp extends ln{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,r=new F;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const d=l[c],u=d.start,f=d.count;for(let m=u,_=u+f;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),E=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),r.fromBufferAttribute(a,E),Oc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,d=3*o+(c+1)%3;i.fromBufferAttribute(a,h),r.fromBufferAttribute(a,d),Oc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new Dt(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Oc(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}class hp extends Bn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new vt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class yu extends Bn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new vt(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 vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Dn extends Bn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new vt(16777215),this.specular=new vt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.combine=ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class up extends Bn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new vt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new vt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Sa,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.combine=ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class dp extends Bn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Vd,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class fp extends Bn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Vr(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function pp(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function mp(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function zc(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let l=0;l!==e;++l)i[a++]=s[o+l]}return i}function Mu(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=s[i++];while(r!==void 0)}class wa{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=t[--n-1],e>=r)break e}a=n,n=0;break t}break n}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let a=0;a!==i;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class gp extends wa{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Zl,endingEnd:Zl}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,o=i[r],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case Ql:r=e,o=2*t-n;break;case ec:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Ql:a=e,l=2*n-t;break;case ec:a=1,l=n+i[1]-i[0];break;default:a=e-1,l=t}const c=(n-t)*.5,h=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=this._offsetPrev,d=this._offsetNext,u=this._weightPrev,f=this._weightNext,m=(n-t)/(i-t),_=m*m,g=_*m,p=-u*g+2*u*_-u*m,E=(1+u)*g+(-1.5-2*u)*_+(-.5+u)*m+1,b=(-1-f)*g+(1.5+f)*_+.5*m,M=f*g-f*_;for(let U=0;U!==o;++U)r[U]=p*a[h+U]+E*a[c+U]+b*a[l+U]+M*a[d+U];return r}}class _p extends wa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=(n-t)/(i-t),d=1-h;for(let u=0;u!==o;++u)r[u]=a[c+u]*d+a[l+u]*h;return r}}class vp extends wa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class ti{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Vr(t,this.TimeBufferType),this.values=Vr(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Vr(e.times,Array),values:Vr(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new vp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new _p(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new gp(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ua:t=this.InterpolantFactoryMethodDiscrete;break;case ol:t=this.InterpolantFactoryMethodLinear;break;case Pa:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ua;case this.InterpolantFactoryMethodLinear:return ol;case this.InterpolantFactoryMethodSmooth:return Pa}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(i!==void 0&&pp(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Pa,r=e.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=e[o],h=e[o+1];if(c!==h&&(o!==1||c!==e[0]))if(i)l=!0;else{const d=o*n,u=d-n,f=d+n;for(let m=0;m!==n;++m){const _=t[d+m];if(_!==t[u+m]||_!==t[f+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const d=o*n,u=a*n;for(let f=0;f!==n;++f)t[u+f]=t[d+f]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}ti.prototype.ValueTypeName="";ti.prototype.TimeBufferType=Float32Array;ti.prototype.ValueBufferType=Float32Array;ti.prototype.DefaultInterpolation=ol;class Os extends ti{constructor(e,t,n){super(e,t,n)}}Os.prototype.ValueTypeName="bool";Os.prototype.ValueBufferType=Array;Os.prototype.DefaultInterpolation=ua;Os.prototype.InterpolantFactoryMethodLinear=void 0;Os.prototype.InterpolantFactoryMethodSmooth=void 0;class Su extends ti{constructor(e,t,n,i){super(e,t,n,i)}}Su.prototype.ValueTypeName="color";class _a extends ti{constructor(e,t,n,i){super(e,t,n,i)}}_a.prototype.ValueTypeName="number";class xp extends wa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(i-t);let c=e*o;for(let h=c+o;c!==h;c+=4)zn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class ur extends ti{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new xp(this.times,this.values,this.getValueSize(),e)}}ur.prototype.ValueTypeName="quaternion";ur.prototype.InterpolantFactoryMethodSmooth=void 0;class zs extends ti{constructor(e,t,n){super(e,t,n)}}zs.prototype.ValueTypeName="string";zs.prototype.ValueBufferType=Array;zs.prototype.DefaultInterpolation=ua;zs.prototype.InterpolantFactoryMethodLinear=void 0;zs.prototype.InterpolantFactoryMethodSmooth=void 0;class Is extends ti{constructor(e,t,n,i){super(e,t,n,i)}}Is.prototype.ValueTypeName="vector";class Bc{constructor(e="",t=-1,n=[],i=kd){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Zn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(Mp(n[a]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=n.length;r!==a;++r)t.push(ti.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,a=[];for(let o=0;o<r;o++){let l=[],c=[];l.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);const h=mp(l);l=zc(l,1,h),c=zc(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new _a(".morphTargetInfluences["+t[o].name+"]",l,c).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],h=c.name.match(r);if(h&&h.length>1){const d=h[1];let u=i[d];u||(i[d]=u=[]),u.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(d,u,f,m,_){if(f.length!==0){const g=[],p=[];Mu(f,g,p,m),g.length!==0&&_.push(new d(u,g,p))}},i=[],r=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let d=0;d<c.length;d++){const u=c[d].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const f={};let m;for(m=0;m<u.length;m++)if(u[m].morphTargets)for(let _=0;_<u[m].morphTargets.length;_++)f[u[m].morphTargets[_]]=-1;for(const _ in f){const g=[],p=[];for(let E=0;E!==u[m].morphTargets.length;++E){const b=u[m];g.push(b.time),p.push(b.morphTarget===_?1:0)}i.push(new _a(".morphTargetInfluence["+_+"]",g,p))}l=f.length*a}else{const f=".bones["+t[d].name+"]";n(Is,f+".position",u,"pos",i),n(ur,f+".quaternion",u,"rot",i),n(Is,f+".scale",u,"scl",i)}}return i.length===0?null:new this(r,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function yp(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return _a;case"vector":case"vector2":case"vector3":case"vector4":return Is;case"color":return Su;case"quaternion":return ur;case"bool":case"boolean":return Os;case"string":return zs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function Mp(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=yp(s.type);if(s.times===void 0){const t=[],n=[];Mu(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const va={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class bu{constructor(e,t,n){const i=this;let r=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,d){return c.push(h,d),this},this.removeHandler=function(h){const d=c.indexOf(h);return d!==-1&&c.splice(d,2),this},this.getHandler=function(h){for(let d=0,u=c.length;d<u;d+=2){const f=c[d],m=c[d+1];if(f.global&&(f.lastIndex=0),f.test(h))return m}return null}}}const zl=new bu;class Qn{constructor(e){this.manager=e!==void 0?e:zl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Qn.DEFAULT_MATERIAL_NAME="__DEFAULT";const _i={};class Sp extends Error{constructor(e,t){super(e),this.response=t}}class Bs extends Qn{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=va.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(_i[e]!==void 0){_i[e].push({onLoad:t,onProgress:n,onError:i});return}_i[e]=[],_i[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).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;const h=_i[e],d=c.body.getReader(),u=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),f=u?parseInt(u):0,m=f!==0;let _=0;const g=new ReadableStream({start(p){E();function E(){d.read().then(({done:b,value:M})=>{if(b)p.close();else{_+=M.byteLength;const U=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:f});for(let R=0,P=h.length;R<P;R++){const D=h[R];D.onProgress&&D.onProgress(U)}p.enqueue(M),E()}},b=>{p.error(b)})}}});return new Response(g)}else throw new Sp(`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==="")return c.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),u=d&&d[1]?d[1].toLowerCase():void 0,f=new TextDecoder(u);return c.arrayBuffer().then(m=>f.decode(m))}}}).then(c=>{va.add(e,c);const h=_i[e];delete _i[e];for(let d=0,u=h.length;d<u;d++){const f=h[d];f.onLoad&&f.onLoad(c)}}).catch(c=>{const h=_i[e];if(h===void 0)throw this.manager.itemError(e),c;delete _i[e];for(let d=0,u=h.length;d<u;d++){const f=h[d];f.onError&&f.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class bp extends Qn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=va.get(e);if(a!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;const o=or("img");function l(){h(),va.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(d){h(),i&&i(d),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class Ep extends Qn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new mu,o=new Bs(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(l){let c;try{c=r.parse(l)}catch(h){if(i!==void 0)i(h);else{console.error(h);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Jn,a.wrapT=c.wrapT!==void 0?c.wrapT:Jn,a.magFilter=c.magFilter!==void 0?c.magFilter:Fn,a.minFilter=c.minFilter!==void 0?c.minFilter:Fn,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=xi),c.mipmapCount===1&&(a.minFilter=Fn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,i),a}}class Bl extends Qn{constructor(e){super(e)}load(e,t,n,i){const r=new bn,a=new bp(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class dr extends an{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new vt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class Ap extends dr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(an.DEFAULT_UP),this.updateMatrix(),this.groundColor=new vt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const oo=new bt,kc=new F,Vc=new F;class kl{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qe(512,512),this.mapType=ci,this.map=null,this.mapPass=null,this.matrix=new bt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Nl,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new Gt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;kc.setFromMatrixPosition(e.matrixWorld),t.position.copy(kc),Vc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Vc),t.updateMatrixWorld(),oo.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(oo),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(oo)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class wp extends kl{constructor(){super(new Sn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Us*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=e.distance||t.far;(n!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Tp extends dr{constructor(e,t,n=0,i=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(an.DEFAULT_UP),this.updateMatrix(),this.target=new an,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new wp}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Hc=new bt,$s=new F,lo=new F;class Cp extends kl{constructor(){super(new Sn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Qe(4,2),this._viewportCount=6,this._viewports=[new Gt(2,1,1,1),new Gt(0,1,1,1),new Gt(3,1,1,1),new Gt(1,1,1,1),new Gt(3,0,1,1),new Gt(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),$s.setFromMatrixPosition(e.matrixWorld),n.position.copy($s),lo.copy(n.position),lo.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(lo),n.updateMatrixWorld(),i.makeTranslation(-$s.x,-$s.y,-$s.z),Hc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Hc)}}class Eu extends dr{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Cp}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Ta extends cu{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class Rp extends kl{constructor(){super(new Ta(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Au extends dr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(an.DEFAULT_UP),this.updateMatrix(),this.target=new an,this.shadow=new Rp}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class wu extends dr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Vl{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Lp extends ln{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class Pp extends Sn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Dp{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Gc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Gc();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Gc(){return performance.now()}class hl extends uu{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const Wc=new bt;class Up{constructor(e,t,n=0,i=1/0){this.ray=new Fs(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Rl,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Wc.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Wc),this}intersectObject(e,t=!0,n=[]){return ul(e,this,n,t),n.sort(Xc),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)ul(e[i],this,n,t);return n.sort(Xc),n}}function Xc(s,e){return s.distance-e.distance}function ul(s,e,t,n){let i=!0;if(s.layers.test(e.layers)&&s.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const r=s.children;for(let a=0,o=r.length;a<o;a++)ul(r[a],e,t,!0)}}class Tu{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=It(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(It(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const qc=new F,Hr=new F;class Np{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){qc.subVectors(e,this.start),Hr.subVectors(this.end,this.start);const n=Hr.dot(Hr);let r=Hr.dot(qc)/n;return t&&(r=It(r,0,1)),r}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Ip extends ga{constructor(e=10,t=10,n=4473924,i=8947848){n=new vt(n),i=new vt(i);const r=t/2,a=e/t,o=e/2,l=[],c=[];for(let u=0,f=0,m=-o;u<=t;u++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=u===r?n:i;_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3,_.toArray(c,f),f+=3}const h=new ln;h.setAttribute("position",new Dt(l,3)),h.setAttribute("color",new Dt(c,3));const d=new Si({vertexColors:!0,toneMapped:!1});super(h,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Fp extends ns{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function jc(s,e,t,n){const i=Op(n);switch(t){case Kh:return s*e;case Qh:return s*e/i.components*i.byteLength;case El:return s*e/i.components*i.byteLength;case eu:return s*e*2/i.components*i.byteLength;case Al:return s*e*2/i.components*i.byteLength;case Zh:return s*e*3/i.components*i.byteLength;case Wn:return s*e*4/i.components*i.byteLength;case wl:return s*e*4/i.components*i.byteLength;case ta:case na:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case ia:case sa:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Fo:case zo:return Math.max(s,16)*Math.max(e,8)/4;case Io:case Oo:return Math.max(s,8)*Math.max(e,8)/2;case Bo:case ko:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case Vo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Ho:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Go:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case Wo:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case Xo:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case qo:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case jo:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case Yo:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case $o:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case Jo:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case Ko:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case Zo:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case Qo:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case el:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case tl:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case ra:case nl:case il:return Math.ceil(s/4)*Math.ceil(e/4)*16;case tu:case sl:return Math.ceil(s/4)*Math.ceil(e/4)*8;case rl:case al:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function Op(s){switch(s){case ci:case Yh:return{byteLength:1,components:1};case ir:case $h:case cr:return{byteLength:2,components:1};case Sl:case bl:return{byteLength:2,components:4};case es:case Ml:case oi:return{byteLength:4,components:1};case Jh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:yl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=yl);/**
|
|
44
|
+
`},i=new Bi(5,5,5),r=new Si({name:"CubemapFromEquirect",uniforms:Ns(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:Rn,blending:Fi});r.uniforms.tEquirect.value=t;const a=new en(i,r),o=t.minFilter;return t.minFilter===xi&&(t.minFilter=Fn),new kf(1,10,this).update(e,a),t.minFilter=o,a.geometry.dispose(),a.material.dispose(),this}clear(e,t=!0,n=!0,i=!0){const r=e.getRenderTarget();for(let a=0;a<6;a++)e.setRenderTarget(this,a),e.clear(t,n,i);e.setRenderTarget(r)}}class Kn extends on{constructor(){super(),this.isGroup=!0,this.type="Group"}}const Hf={type:"move"};class Za{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Kn,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 Kn,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new F,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new F),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Kn,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new F,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new F),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,r=null,a=null;const o=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){a=!0;for(const _ of e.hand.values()){const g=t.getJointPose(_,n),p=this._getHandJoint(c,_);g!==null&&(p.matrix.fromArray(g.transform.matrix),p.matrix.decompose(p.position,p.rotation,p.scale),p.matrixWorldNeedsUpdate=!0,p.jointRadius=g.radius),p.visible=g!==null}const h=c.joints["index-finger-tip"],f=c.joints["thumb-tip"],u=h.position.distanceTo(f.position),d=.02,m=.005;c.inputState.pinching&&u>d+m?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&u<=d-m&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(r=t.getPose(e.gripSpace,n),r!==null&&(l.matrix.fromArray(r.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,r.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(r.linearVelocity)):l.hasLinearVelocity=!1,r.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(r.angularVelocity)):l.hasAngularVelocity=!1));o!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&r!==null&&(i=r),i!==null&&(o.matrix.fromArray(i.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,i.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(i.linearVelocity)):o.hasLinearVelocity=!1,i.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(i.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(Hf)))}return o!==null&&(o.visible=i!==null),l!==null&&(l.visible=r!==null),c!==null&&(c.visible=a!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Kn;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class Pl extends on{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Ln,this.environmentIntensity=1,this.environmentRotation=new Ln,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class uu{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=ll,this.updateRanges=[],this.version=0,this.uuid=Zn()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,r=this.stride;i<r;i++)this.array[e+i]=t.array[n+i];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Zn()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const Tn=new F;class li{constructor(e,t,n,i=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=i}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.applyMatrix4(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.applyNormalMatrix(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Tn.fromBufferAttribute(this,t),Tn.transformDirection(e),this.setXYZ(t,Tn.x,Tn.y,Tn.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=$n(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=rn(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=rn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=rn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=rn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=rn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=$n(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=$n(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=$n(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=$n(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=rn(t,this.array),n=rn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(t=rn(t,this.array),n=rn(n,this.array),i=rn(i,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this}setXYZW(e,t,n,i,r){return e=e*this.data.stride+this.offset,this.normalized&&(t=rn(t,this.array),n=rn(n,this.array),i=rn(i,this.array),r=rn(r,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=i,this.data.array[e+3]=r,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return new dn(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new li(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const i=n*this.data.stride+this.offset;for(let r=0;r<this.itemSize;r++)t.push(this.data.array[i+r])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class Sa extends Bn{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new xt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let _s;const Xs=new F,vs=new F,xs=new F,ys=new Qe,qs=new Qe,du=new Tt,Lr=new F,js=new F,Pr=new F,Mc=new Qe,Qa=new Qe,bc=new Qe;class Dl extends on{constructor(e=new Sa){if(super(),this.isSprite=!0,this.type="Sprite",_s===void 0){_s=new hn;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new uu(t,5);_s.setIndex([0,1,2,0,2,3]),_s.setAttribute("position",new li(n,3,0,!1)),_s.setAttribute("uv",new li(n,2,3,!1))}this.geometry=_s,this.material=e,this.center=new Qe(.5,.5),this.count=1}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),vs.setFromMatrixScale(this.matrixWorld),du.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),xs.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&vs.multiplyScalar(-xs.z);const n=this.material.rotation;let i,r;n!==0&&(r=Math.cos(n),i=Math.sin(n));const a=this.center;Dr(Lr.set(-.5,-.5,0),xs,a,vs,i,r),Dr(js.set(.5,-.5,0),xs,a,vs,i,r),Dr(Pr.set(.5,.5,0),xs,a,vs,i,r),Mc.set(0,0),Qa.set(1,0),bc.set(1,1);let o=e.ray.intersectTriangle(Lr,js,Pr,!1,Xs);if(o===null&&(Dr(js.set(-.5,.5,0),xs,a,vs,i,r),Qa.set(0,1),o=e.ray.intersectTriangle(Lr,Pr,js,!1,Xs),o===null))return;const l=e.ray.origin.distanceTo(Xs);l<e.near||l>e.far||t.push({distance:l,point:Xs.clone(),uv:Gn.getInterpolation(Xs,Lr,js,Pr,Mc,Qa,bc,new Qe),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Dr(s,e,t,n,i,r){ys.subVectors(s,t).addScalar(.5).multiply(n),i!==void 0?(qs.x=r*ys.x-i*ys.y,qs.y=i*ys.x+r*ys.y):qs.copy(ys),s.copy(e),s.x+=qs.x,s.y+=qs.y,s.applyMatrix4(du)}const Ur=new F,Sc=new F;class fu extends on{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n<i;n++){const r=t[n];this.addLevel(r.object.clone(),r.distance,r.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const i=this.levels;let r;for(r=0;r<i.length&&!(t<i[r].distance);r++);return i.splice(r,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const i=t.splice(n,1);return this.remove(i[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,i;for(n=1,i=t.length;n<i;n++){let r=t[n].distance;if(t[n].object.visible&&(r-=r*t[n].hysteresis),e<r)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ur.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Ur);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ur.setFromMatrixPosition(e.matrixWorld),Sc.setFromMatrixPosition(this.matrixWorld);const n=Ur.distanceTo(Sc)/e.zoom;t[0].object.visible=!0;let i,r;for(i=1,r=t.length;i<r;i++){let a=t[i].distance;if(t[i].object.visible&&(a-=a*t[i].hysteresis),n>=a)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;i<r;i++)t[i].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const a=n[i];t.object.levels.push({object:a.object.uuid,distance:a.distance,hysteresis:a.hysteresis})}return t}}const Ec=new F,Ac=new Xt,wc=new Xt,Gf=new F,Tc=new Tt,Nr=new F,eo=new Ei,Cc=new Tt,to=new Fs;class Wf extends en{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=Kl,this.bindMatrix=new Tt,this.bindMatrixInverse=new Tt,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new ei),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingBox.expandByPoint(Nr)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Ei),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Nr),this.boundingSphere.expandByPoint(Nr)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,i=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),eo.copy(this.boundingSphere),eo.applyMatrix4(i),e.ray.intersectsSphere(eo)!==!1&&(Cc.copy(i).invert(),to.copy(e.ray).applyMatrix4(Cc),!(this.boundingBox!==null&&to.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,to)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new Xt,t=this.geometry.attributes.skinWeight;for(let n=0,i=t.count;n<i;n++){e.fromBufferAttribute(t,n);const r=1/e.manhattanLength();r!==1/0?e.multiplyScalar(r):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===Kl?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===Bd?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,i=this.geometry;Ac.fromBufferAttribute(i.attributes.skinIndex,e),wc.fromBufferAttribute(i.attributes.skinWeight,e),Ec.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let r=0;r<4;r++){const a=wc.getComponent(r);if(a!==0){const o=Ac.getComponent(r);Tc.multiplyMatrices(n.bones[o].matrixWorld,n.boneInverses[o]),t.addScaledVector(Gf.copy(Ec).applyMatrix4(Tc),a)}}return t.applyMatrix4(this.bindMatrixInverse)}}class pu extends on{constructor(){super(),this.isBone=!0,this.type="Bone"}}class mu extends Sn{constructor(e=null,t=1,n=1,i,r,a,o,l,c=On,h=On,f,u){super(null,a,o,l,c,h,i,r,f,u),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const Rc=new Tt,Xf=new Tt;class Ul{constructor(e=[],t=[]){this.uuid=Zn(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,i=this.bones.length;n<i;n++)this.boneInverses.push(new Tt)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new Tt;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,a=e.length;r<a;r++){const o=e[r]?e[r].matrixWorld:Xf;Rc.multiplyMatrices(o,t[r]),Rc.toArray(n,r*16)}i!==null&&(i.needsUpdate=!0)}clone(){return new Ul(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new mu(t,e,e,Wn,oi);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const i=this.bones[t];if(i.name===e)return i}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,i=e.bones.length;n<i;n++){const r=e.bones[n];let a=t[r];a===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",r),a=new pu),this.bones.push(a),this.boneInverses.push(new Tt().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let i=0,r=t.length;i<r;i++){const a=t[i];e.bones.push(a.uuid);const o=n[i];e.boneInverses.push(o.toArray())}return e}}const no=new F,qf=new F,jf=new It;class Ui{constructor(e=new F(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=no.subVectors(n,t).cross(qf.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(no),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const r=-(e.start.dot(this.normal)+this.constant)/i;return r<0||r>1?null:t.copy(e.start).addScaledVector(n,r)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||jf.getNormalMatrix(e),i=this.coplanarPoint(no).applyMatrix4(e),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Wi=new Ei,Ir=new F;class Nl{constructor(e=new Ui,t=new Ui,n=new Ui,i=new Ui,r=new Ui,a=new Ui){this.planes=[e,t,n,i,r,a]}set(e,t,n,i,r,a){const o=this.planes;return o[0].copy(e),o[1].copy(t),o[2].copy(n),o[3].copy(i),o[4].copy(r),o[5].copy(a),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=yi){const n=this.planes,i=e.elements,r=i[0],a=i[1],o=i[2],l=i[3],c=i[4],h=i[5],f=i[6],u=i[7],d=i[8],m=i[9],_=i[10],g=i[11],p=i[12],S=i[13],A=i[14],b=i[15];if(n[0].setComponents(l-r,u-c,g-d,b-p).normalize(),n[1].setComponents(l+r,u+c,g+d,b+p).normalize(),n[2].setComponents(l+a,u+h,g+m,b+S).normalize(),n[3].setComponents(l-a,u-h,g-m,b-S).normalize(),n[4].setComponents(l-o,u-f,g-_,b-A).normalize(),t===yi)n[5].setComponents(l+o,u+f,g+_,b+A).normalize();else if(t===fa)n[5].setComponents(o,f,_,A).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Wi.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Wi.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Wi)}intersectsSprite(e){return Wi.center.set(0,0,0),Wi.radius=.7071067811865476,Wi.applyMatrix4(e.matrixWorld),this.intersectsSphere(Wi)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let r=0;r<6;r++)if(t[r].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(Ir.x=i.normal.x>0?e.max.x:e.min.x,Ir.y=i.normal.y>0?e.max.y:e.min.y,Ir.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Ir)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}class bi extends Bn{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new xt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const pa=new F,ma=new F,Lc=new Tt,Ys=new Fs,Fr=new Ei,io=new F,Pc=new F;class Ea extends on{constructor(e=new hn,t=new bi){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let i=1,r=t.count;i<r;i++)pa.fromBufferAttribute(t,i-1),ma.fromBufferAttribute(t,i),n[i]=n[i-1],n[i]+=pa.distanceTo(ma);e.setAttribute("lineDistance",new Ut(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Line.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Fr.copy(n.boundingSphere),Fr.applyMatrix4(i),Fr.radius+=r,e.ray.intersectsSphere(Fr)===!1)return;Lc.copy(i).invert(),Ys.copy(e.ray).applyMatrix4(Lc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=this.isLineSegments?2:1,h=n.index,u=n.attributes.position;if(h!==null){const d=Math.max(0,a.start),m=Math.min(h.count,a.start+a.count);for(let _=d,g=m-1;_<g;_+=c){const p=h.getX(_),S=h.getX(_+1),A=Or(this,e,Ys,l,p,S,_);A&&t.push(A)}if(this.isLineLoop){const _=h.getX(m-1),g=h.getX(d),p=Or(this,e,Ys,l,_,g,m-1);p&&t.push(p)}}else{const d=Math.max(0,a.start),m=Math.min(u.count,a.start+a.count);for(let _=d,g=m-1;_<g;_+=c){const p=Or(this,e,Ys,l,_,_+1,_);p&&t.push(p)}if(this.isLineLoop){const _=Or(this,e,Ys,l,m-1,d,m-1);_&&t.push(_)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Or(s,e,t,n,i,r,a){const o=s.geometry.attributes.position;if(pa.fromBufferAttribute(o,i),ma.fromBufferAttribute(o,r),t.distanceSqToSegment(pa,ma,io,Pc)>n)return;io.applyMatrix4(s.matrixWorld);const c=e.ray.origin.distanceTo(io);if(!(c<e.near||c>e.far))return{distance:c,point:Pc.clone().applyMatrix4(s.matrixWorld),index:a,face:null,faceIndex:null,barycoord:null,object:s}}const Dc=new F,Uc=new F;class ga extends Ea{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let i=0,r=t.count;i<r;i+=2)Dc.fromBufferAttribute(t,i),Uc.fromBufferAttribute(t,i+1),n[i]=i===0?0:n[i-1],n[i+1]=n[i]+Dc.distanceTo(Uc);e.setAttribute("lineDistance",new Ut(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class Ii extends Bn{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new xt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const Nc=new Tt,cl=new Fs,zr=new Ei,Br=new F;class Cs extends on{constructor(e=new hn,t=new Ii){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,i=this.matrixWorld,r=e.params.Points.threshold,a=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),zr.copy(n.boundingSphere),zr.applyMatrix4(i),zr.radius+=r,e.ray.intersectsSphere(zr)===!1)return;Nc.copy(i).invert(),cl.copy(e.ray).applyMatrix4(Nc);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),l=o*o,c=n.index,f=n.attributes.position;if(c!==null){const u=Math.max(0,a.start),d=Math.min(c.count,a.start+a.count);for(let m=u,_=d;m<_;m++){const g=c.getX(m);Br.fromBufferAttribute(f,g),Ic(Br,g,l,i,e,t,this)}}else{const u=Math.max(0,a.start),d=Math.min(f.count,a.start+a.count);for(let m=u,_=d;m<_;m++)Br.fromBufferAttribute(f,m),Ic(Br,m,l,i,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let r=0,a=i.length;r<a;r++){const o=i[r].name||String(r);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=r}}}}}function Ic(s,e,t,n,i,r,a){const o=cl.distanceSqToPoint(s);if(o<t){const l=new F;cl.closestPointToPoint(s,l),l.applyMatrix4(n);const c=i.ray.origin.distanceTo(l);if(c<i.near||c>i.far)return;r.push({distance:c,distanceToRay:Math.sqrt(o),point:l,index:e,face:null,faceIndex:null,barycoord:null,object:a})}}class Yf extends Sn{constructor(e,t,n,i,r,a,o,l,c){super(e,t,n,i,r,a,o,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class gu extends Sn{constructor(e,t,n=es,i,r,a,o=On,l=On,c,h=rr,f=1){if(h!==rr&&h!==ar)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const u={width:e,height:t,depth:f};super(u,i,r,a,o,l,h,n,c),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Cl(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class Il extends hn{constructor(e=1,t=1,n=1,i=32,r=1,a=!1,o=0,l=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:i,heightSegments:r,openEnded:a,thetaStart:o,thetaLength:l};const c=this;i=Math.floor(i),r=Math.floor(r);const h=[],f=[],u=[],d=[];let m=0;const _=[],g=n/2;let p=0;S(),a===!1&&(e>0&&A(!0),t>0&&A(!1)),this.setIndex(h),this.setAttribute("position",new Ut(f,3)),this.setAttribute("normal",new Ut(u,3)),this.setAttribute("uv",new Ut(d,2));function S(){const b=new F,N=new F;let C=0;const P=(t-e)/n;for(let D=0;D<=r;D++){const E=[],y=D/r,U=y*(t-e)+e;for(let G=0;G<=i;G++){const X=G/i,Z=X*l+o,ie=Math.sin(Z),H=Math.cos(Z);N.x=U*ie,N.y=-y*n+g,N.z=U*H,f.push(N.x,N.y,N.z),b.set(ie,P,H).normalize(),u.push(b.x,b.y,b.z),d.push(X,1-y),E.push(m++)}_.push(E)}for(let D=0;D<i;D++)for(let E=0;E<r;E++){const y=_[E][D],U=_[E+1][D],G=_[E+1][D+1],X=_[E][D+1];(e>0||E!==0)&&(h.push(y,U,X),C+=3),(t>0||E!==r-1)&&(h.push(U,G,X),C+=3)}c.addGroup(p,C,0),p+=C}function A(b){const N=m,C=new Qe,P=new F;let D=0;const E=b===!0?e:t,y=b===!0?1:-1;for(let G=1;G<=i;G++)f.push(0,g*y,0),u.push(0,y,0),d.push(.5,.5),m++;const U=m;for(let G=0;G<=i;G++){const Z=G/i*l+o,ie=Math.cos(Z),H=Math.sin(Z);P.x=E*H,P.y=g*y,P.z=E*ie,f.push(P.x,P.y,P.z),u.push(0,y,0),C.x=ie*.5+.5,C.y=H*.5*y+.5,d.push(C.x,C.y),m++}for(let G=0;G<i;G++){const X=N+G,Z=U+G;b===!0?h.push(Z,Z+1,X):h.push(Z+1,Z,X),D+=3}c.addGroup(p,D,b===!0?1:2),p+=D}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Il(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Ai{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),r=0;t.push(0);for(let a=1;a<=e;a++)n=this.getPoint(a/e),r+=n.distanceTo(i),t.push(r),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let i=0;const r=n.length;let a;t?a=t:a=e*n[r-1];let o=0,l=r-1,c;for(;o<=l;)if(i=Math.floor(o+(l-o)/2),c=n[i]-a,c<0)o=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===a)return i/(r-1);const h=n[i],u=n[i+1]-h,d=(a-h)/u;return(i+d)/(r-1)}getTangent(e,t){let i=e-1e-4,r=e+1e-4;i<0&&(i=0),r>1&&(r=1);const a=this.getPoint(i),o=this.getPoint(r),l=t||(a.isVector2?new Qe:new F);return l.copy(o).sub(a).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new F,i=[],r=[],a=[],o=new F,l=new Tt;for(let d=0;d<=e;d++){const m=d/e;i[d]=this.getTangentAt(m,new F)}r[0]=new F,a[0]=new F;let c=Number.MAX_VALUE;const h=Math.abs(i[0].x),f=Math.abs(i[0].y),u=Math.abs(i[0].z);h<=c&&(c=h,n.set(1,0,0)),f<=c&&(c=f,n.set(0,1,0)),u<=c&&n.set(0,0,1),o.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],o),a[0].crossVectors(i[0],r[0]);for(let d=1;d<=e;d++){if(r[d]=r[d-1].clone(),a[d]=a[d-1].clone(),o.crossVectors(i[d-1],i[d]),o.length()>Number.EPSILON){o.normalize();const m=Math.acos(Ft(i[d-1].dot(i[d]),-1,1));r[d].applyMatrix4(l.makeRotationAxis(o,m))}a[d].crossVectors(i[d],r[d])}if(t===!0){let d=Math.acos(Ft(r[0].dot(r[e]),-1,1));d/=e,i[0].dot(o.crossVectors(r[0],r[e]))>0&&(d=-d);for(let m=1;m<=e;m++)r[m].applyMatrix4(l.makeRotationAxis(i[m],d*m)),a[m].crossVectors(i[m],r[m])}return{tangents:i,normals:r,binormals:a}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class _u extends Ai{constructor(e=0,t=0,n=1,i=1,r=0,a=Math.PI*2,o=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=r,this.aEndAngle=a,this.aClockwise=o,this.aRotation=l}getPoint(e,t=new Qe){const n=t,i=Math.PI*2;let r=this.aEndAngle-this.aStartAngle;const a=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(a?r=0:r=i),this.aClockwise===!0&&!a&&(r===i?r=-i:r=r-i);const o=this.aStartAngle+e*r;let l=this.aX+this.xRadius*Math.cos(o),c=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),f=Math.sin(this.aRotation),u=l-this.aX,d=c-this.aY;l=u*h-d*f+this.aX,c=u*f+d*h+this.aY}return n.set(l,c)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class $f extends _u{constructor(e,t,n,i,r,a){super(e,t,n,n,i,r,a),this.isArcCurve=!0,this.type="ArcCurve"}}function Fl(){let s=0,e=0,t=0,n=0;function i(r,a,o,l){s=r,e=o,t=-3*r+3*a-2*o-l,n=2*r-2*a+o+l}return{initCatmullRom:function(r,a,o,l,c){i(a,o,c*(o-r),c*(l-a))},initNonuniformCatmullRom:function(r,a,o,l,c,h,f){let u=(a-r)/c-(o-r)/(c+h)+(o-a)/h,d=(o-a)/h-(l-a)/(h+f)+(l-o)/f;u*=h,d*=h,i(a,o,u,d)},calc:function(r){const a=r*r,o=a*r;return s+e*r+t*a+n*o}}}const kr=new F,so=new Fl,ro=new Fl,ao=new Fl;class vu extends Ai{constructor(e=[],t=!1,n="centripetal",i=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=i}getPoint(e,t=new F){const n=t,i=this.points,r=i.length,a=(r-(this.closed?0:1))*e;let o=Math.floor(a),l=a-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/r)+1)*r:l===0&&o===r-1&&(o=r-2,l=1);let c,h;this.closed||o>0?c=i[(o-1)%r]:(kr.subVectors(i[0],i[1]).add(i[0]),c=kr);const f=i[o%r],u=i[(o+1)%r];if(this.closed||o+2<r?h=i[(o+2)%r]:(kr.subVectors(i[r-1],i[r-2]).add(i[r-1]),h=kr),this.curveType==="centripetal"||this.curveType==="chordal"){const d=this.curveType==="chordal"?.5:.25;let m=Math.pow(c.distanceToSquared(f),d),_=Math.pow(f.distanceToSquared(u),d),g=Math.pow(u.distanceToSquared(h),d);_<1e-4&&(_=1),m<1e-4&&(m=_),g<1e-4&&(g=_),so.initNonuniformCatmullRom(c.x,f.x,u.x,h.x,m,_,g),ro.initNonuniformCatmullRom(c.y,f.y,u.y,h.y,m,_,g),ao.initNonuniformCatmullRom(c.z,f.z,u.z,h.z,m,_,g)}else this.curveType==="catmullrom"&&(so.initCatmullRom(c.x,f.x,u.x,h.x,this.tension),ro.initCatmullRom(c.y,f.y,u.y,h.y,this.tension),ao.initCatmullRom(c.z,f.z,u.z,h.z,this.tension));return n.set(so.calc(l),ro.calc(l),ao.calc(l)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new F().fromArray(i))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function Fc(s,e,t,n,i){const r=(n-e)*.5,a=(i-t)*.5,o=s*s,l=s*o;return(2*t-2*n+r+a)*l+(-3*t+3*n-2*r-a)*o+r*s+t}function Jf(s,e){const t=1-s;return t*t*e}function Kf(s,e){return 2*(1-s)*s*e}function Zf(s,e){return s*s*e}function er(s,e,t,n){return Jf(s,e)+Kf(s,t)+Zf(s,n)}function Qf(s,e){const t=1-s;return t*t*t*e}function ep(s,e){const t=1-s;return 3*t*t*s*e}function tp(s,e){return 3*(1-s)*s*s*e}function np(s,e){return s*s*s*e}function tr(s,e,t,n,i){return Qf(s,e)+ep(s,t)+tp(s,n)+np(s,i)}class ip extends Ai{constructor(e=new Qe,t=new Qe,n=new Qe,i=new Qe){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new Qe){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(tr(e,i.x,r.x,a.x,o.x),tr(e,i.y,r.y,a.y,o.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class sp extends Ai{constructor(e=new F,t=new F,n=new F,i=new F){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=i}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2,o=this.v3;return n.set(tr(e,i.x,r.x,a.x,o.x),tr(e,i.y,r.y,a.y,o.y),tr(e,i.z,r.z,a.z,o.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class rp extends Ai{constructor(e=new Qe,t=new Qe){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new Qe){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new Qe){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class ap extends Ai{constructor(e=new F,t=new F){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new F){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new F){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class op extends Ai{constructor(e=new Qe,t=new Qe,n=new Qe){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new Qe){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(er(e,i.x,r.x,a.x),er(e,i.y,r.y,a.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class xu extends Ai{constructor(e=new F,t=new F,n=new F){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new F){const n=t,i=this.v0,r=this.v1,a=this.v2;return n.set(er(e,i.x,r.x,a.x),er(e,i.y,r.y,a.y),er(e,i.z,r.z,a.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class lp extends Ai{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new Qe){const n=t,i=this.points,r=(i.length-1)*e,a=Math.floor(r),o=r-a,l=i[a===0?a:a-1],c=i[a],h=i[a>i.length-2?i.length-1:a+1],f=i[a>i.length-3?i.length-1:a+2];return n.set(Fc(o,l.x,c.x,h.x,f.x),Fc(o,l.y,c.y,h.y,f.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(i.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const i=this.points[t];e.points.push(i.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const i=e.points[t];this.points.push(new Qe().fromArray(i))}return this}}var cp=Object.freeze({__proto__:null,ArcCurve:$f,CatmullRomCurve3:vu,CubicBezierCurve:ip,CubicBezierCurve3:sp,EllipseCurve:_u,LineCurve:rp,LineCurve3:ap,QuadraticBezierCurve:op,QuadraticBezierCurve3:xu,SplineCurve:lp});class hr extends hn{constructor(e=1,t=1,n=1,i=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:i};const r=e/2,a=t/2,o=Math.floor(n),l=Math.floor(i),c=o+1,h=l+1,f=e/o,u=t/l,d=[],m=[],_=[],g=[];for(let p=0;p<h;p++){const S=p*u-a;for(let A=0;A<c;A++){const b=A*f-r;m.push(b,-S,0),_.push(0,0,1),g.push(A/o),g.push(1-p/l)}}for(let p=0;p<l;p++)for(let S=0;S<o;S++){const A=S+c*p,b=S+c*(p+1),N=S+1+c*(p+1),C=S+1+c*p;d.push(A,b,C),d.push(b,N,C)}this.setIndex(d),this.setAttribute("position",new Ut(m,3)),this.setAttribute("normal",new Ut(_,3)),this.setAttribute("uv",new Ut(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new hr(e.width,e.height,e.widthSegments,e.heightSegments)}}class Aa extends hn{constructor(e=1,t=32,n=16,i=0,r=Math.PI*2,a=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:i,phiLength:r,thetaStart:a,thetaLength:o},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const l=Math.min(a+o,Math.PI);let c=0;const h=[],f=new F,u=new F,d=[],m=[],_=[],g=[];for(let p=0;p<=n;p++){const S=[],A=p/n;let b=0;p===0&&a===0?b=.5/t:p===n&&l===Math.PI&&(b=-.5/t);for(let N=0;N<=t;N++){const C=N/t;f.x=-e*Math.cos(i+C*r)*Math.sin(a+A*o),f.y=e*Math.cos(a+A*o),f.z=e*Math.sin(i+C*r)*Math.sin(a+A*o),m.push(f.x,f.y,f.z),u.copy(f).normalize(),_.push(u.x,u.y,u.z),g.push(C+b,1-A),S.push(c++)}h.push(S)}for(let p=0;p<n;p++)for(let S=0;S<t;S++){const A=h[p][S+1],b=h[p][S],N=h[p+1][S],C=h[p+1][S+1];(p!==0||a>0)&&d.push(A,b,C),(p!==n-1||l<Math.PI)&&d.push(b,N,C)}this.setIndex(d),this.setAttribute("position",new Ut(m,3)),this.setAttribute("normal",new Ut(_,3)),this.setAttribute("uv",new Ut(g,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Aa(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Ol extends hn{constructor(e=new xu(new F(-1,-1,0),new F(-1,1,0),new F(1,1,0)),t=64,n=1,i=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:i,closed:r};const a=e.computeFrenetFrames(t,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals;const o=new F,l=new F,c=new Qe;let h=new F;const f=[],u=[],d=[],m=[];_(),this.setIndex(m),this.setAttribute("position",new Ut(f,3)),this.setAttribute("normal",new Ut(u,3)),this.setAttribute("uv",new Ut(d,2));function _(){for(let A=0;A<t;A++)g(A);g(r===!1?t:0),S(),p()}function g(A){h=e.getPointAt(A/t,h);const b=a.normals[A],N=a.binormals[A];for(let C=0;C<=i;C++){const P=C/i*Math.PI*2,D=Math.sin(P),E=-Math.cos(P);l.x=E*b.x+D*N.x,l.y=E*b.y+D*N.y,l.z=E*b.z+D*N.z,l.normalize(),u.push(l.x,l.y,l.z),o.x=h.x+n*l.x,o.y=h.y+n*l.y,o.z=h.z+n*l.z,f.push(o.x,o.y,o.z)}}function p(){for(let A=1;A<=t;A++)for(let b=1;b<=i;b++){const N=(i+1)*(A-1)+(b-1),C=(i+1)*A+(b-1),P=(i+1)*A+b,D=(i+1)*(A-1)+b;m.push(N,C,D),m.push(C,P,D)}}function S(){for(let A=0;A<=t;A++)for(let b=0;b<=i;b++)c.x=A/t,c.y=b/i,d.push(c.x,c.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new Ol(new cp[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class hp extends hn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,i=new F,r=new F;if(e.index!==null){const a=e.attributes.position,o=e.index;let l=e.groups;l.length===0&&(l=[{start:0,count:o.count,materialIndex:0}]);for(let c=0,h=l.length;c<h;++c){const f=l[c],u=f.start,d=f.count;for(let m=u,_=u+d;m<_;m+=3)for(let g=0;g<3;g++){const p=o.getX(m+g),S=o.getX(m+(g+1)%3);i.fromBufferAttribute(a,p),r.fromBufferAttribute(a,S),Oc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}}else{const a=e.attributes.position;for(let o=0,l=a.count/3;o<l;o++)for(let c=0;c<3;c++){const h=3*o+c,f=3*o+(c+1)%3;i.fromBufferAttribute(a,h),r.fromBufferAttribute(a,f),Oc(i,r,n)===!0&&(t.push(i.x,i.y,i.z),t.push(r.x,r.y,r.z))}}this.setAttribute("position",new Ut(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function Oc(s,e,t){const n=`${s.x},${s.y},${s.z}-${e.x},${e.y},${e.z}`,i=`${e.x},${e.y},${e.z}-${s.x},${s.y},${s.z}`;return t.has(n)===!0||t.has(i)===!0?!1:(t.add(n),t.add(i),!0)}class up extends Bn{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new xt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class yu extends Bn{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new xt(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 xt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ba,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class Dn extends Bn{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new xt(16777215),this.specular=new xt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new xt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ba,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.combine=ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class dp extends Bn{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new xt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new xt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=ba,this.normalScale=new Qe(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Ln,this.combine=ya,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class fp extends Bn{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=Hd,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class pp extends Bn{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}function Vr(s,e){return!s||s.constructor===e?s:typeof e.BYTES_PER_ELEMENT=="number"?new e(s):Array.prototype.slice.call(s)}function mp(s){return ArrayBuffer.isView(s)&&!(s instanceof DataView)}function gp(s){function e(i,r){return s[i]-s[r]}const t=s.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function zc(s,e,t){const n=s.length,i=new s.constructor(n);for(let r=0,a=0;a!==n;++r){const o=t[r]*e;for(let l=0;l!==e;++l)i[a++]=s[o+l]}return i}function Mu(s,e,t,n){let i=1,r=s[0];for(;r!==void 0&&r[n]===void 0;)r=s[i++];if(r===void 0)return;let a=r[n];if(a!==void 0)if(Array.isArray(a))do a=r[n],a!==void 0&&(e.push(r.time),t.push(...a)),r=s[i++];while(r!==void 0);else if(a.toArray!==void 0)do a=r[n],a!==void 0&&(e.push(r.time),a.toArray(t,t.length)),r=s[i++];while(r!==void 0);else do a=r[n],a!==void 0&&(e.push(r.time),t.push(a)),r=s[i++];while(r!==void 0)}class wa{constructor(e,t,n,i){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=i!==void 0?i:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,i=t[n],r=t[n-1];n:{e:{let a;t:{i:if(!(e<i)){for(let o=n+2;;){if(i===void 0){if(e<r)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===o)break;if(r=i,i=t[++n],e<i)break e}a=t.length;break t}if(!(e>=r)){const o=t[1];e<o&&(n=2,r=o);for(let l=n-2;;){if(r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===l)break;if(i=r,r=t[--n-1],e>=r)break e}a=n,n=0;break t}break n}for(;n<a;){const o=n+a>>>1;e<t[o]?a=o:n=o+1}if(i=t[n],r=t[n-1],r===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,e,i)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=e*i;for(let a=0;a!==i;++a)t[a]=n[r+a];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class _p extends wa{constructor(e,t,n,i){super(e,t,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Zl,endingEnd:Zl}}intervalChanged_(e,t,n){const i=this.parameterPositions;let r=e-2,a=e+1,o=i[r],l=i[a];if(o===void 0)switch(this.getSettings_().endingStart){case Ql:r=e,o=2*t-n;break;case ec:r=i.length-2,o=t+i[r]-i[r+1];break;default:r=e,o=n}if(l===void 0)switch(this.getSettings_().endingEnd){case Ql:a=e,l=2*n-t;break;case ec:a=1,l=n+i[1]-i[0];break;default:a=e-1,l=t}const c=(n-t)*.5,h=this.valueSize;this._weightPrev=c/(t-o),this._weightNext=c/(l-n),this._offsetPrev=r*h,this._offsetNext=a*h}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=this._offsetPrev,f=this._offsetNext,u=this._weightPrev,d=this._weightNext,m=(n-t)/(i-t),_=m*m,g=_*m,p=-u*g+2*u*_-u*m,S=(1+u)*g+(-1.5-2*u)*_+(-.5+u)*m+1,A=(-1-d)*g+(1.5+d)*_+.5*m,b=d*g-d*_;for(let N=0;N!==o;++N)r[N]=p*a[h+N]+S*a[c+N]+A*a[l+N]+b*a[f+N];return r}}class vp extends wa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=e*o,c=l-o,h=(n-t)/(i-t),f=1-h;for(let u=0;u!==o;++u)r[u]=a[c+u]*f+a[l+u]*h;return r}}class xp extends wa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e){return this.copySampleValue_(e-1)}}class ti{constructor(e,t,n,i){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Vr(t,this.TimeBufferType),this.values=Vr(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:Vr(e.times,Array),values:Vr(e.values,Array)};const i=e.getInterpolation();i!==e.DefaultInterpolation&&(n.interpolation=i)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new xp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new vp(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new _p(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case ua:t=this.InterpolantFactoryMethodDiscrete;break;case ol:t=this.InterpolantFactoryMethodLinear;break;case Pa:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return ua;case this.InterpolantFactoryMethodLinear:return ol;case this.InterpolantFactoryMethodSmooth:return Pa}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,i=t.length;n!==i;++n)t[n]*=e}return this}trim(e,t){const n=this.times,i=n.length;let r=0,a=i-1;for(;r!==i&&n[r]<e;)++r;for(;a!==-1&&n[a]>t;)--a;if(++a,r!==0||a!==i){r>=a&&(a=Math.max(a,1),r=a-1);const o=this.getValueSize();this.times=n.slice(r,a),this.values=this.values.slice(r*o,a*o)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,r=n.length;r===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let a=null;for(let o=0;o!==r;o++){const l=n[o];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,l),e=!1;break}if(a!==null&&a>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,l,a),e=!1;break}a=l}if(i!==void 0&&mp(i))for(let o=0,l=i.length;o!==l;++o){const c=i[o];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,c),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),i=this.getInterpolation()===Pa,r=e.length-1;let a=1;for(let o=1;o<r;++o){let l=!1;const c=e[o],h=e[o+1];if(c!==h&&(o!==1||c!==e[0]))if(i)l=!0;else{const f=o*n,u=f-n,d=f+n;for(let m=0;m!==n;++m){const _=t[f+m];if(_!==t[u+m]||_!==t[d+m]){l=!0;break}}}if(l){if(o!==a){e[a]=e[o];const f=o*n,u=a*n;for(let d=0;d!==n;++d)t[u+d]=t[f+d]}++a}}if(r>0){e[a]=e[r];for(let o=r*n,l=a*n,c=0;c!==n;++c)t[l+c]=t[o+c];++a}return a!==e.length?(this.times=e.slice(0,a),this.values=t.slice(0,a*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}ti.prototype.ValueTypeName="";ti.prototype.TimeBufferType=Float32Array;ti.prototype.ValueBufferType=Float32Array;ti.prototype.DefaultInterpolation=ol;class Os extends ti{constructor(e,t,n){super(e,t,n)}}Os.prototype.ValueTypeName="bool";Os.prototype.ValueBufferType=Array;Os.prototype.DefaultInterpolation=ua;Os.prototype.InterpolantFactoryMethodLinear=void 0;Os.prototype.InterpolantFactoryMethodSmooth=void 0;class bu extends ti{constructor(e,t,n,i){super(e,t,n,i)}}bu.prototype.ValueTypeName="color";class _a extends ti{constructor(e,t,n,i){super(e,t,n,i)}}_a.prototype.ValueTypeName="number";class yp extends wa{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const r=this.resultBuffer,a=this.sampleValues,o=this.valueSize,l=(n-t)/(i-t);let c=e*o;for(let h=c+o;c!==h;c+=4)zn.slerpFlat(r,0,a,c-o,a,c,l);return r}}class ur extends ti{constructor(e,t,n,i){super(e,t,n,i)}InterpolantFactoryMethodLinear(e){return new yp(this.times,this.values,this.getValueSize(),e)}}ur.prototype.ValueTypeName="quaternion";ur.prototype.InterpolantFactoryMethodSmooth=void 0;class zs extends ti{constructor(e,t,n){super(e,t,n)}}zs.prototype.ValueTypeName="string";zs.prototype.ValueBufferType=Array;zs.prototype.DefaultInterpolation=ua;zs.prototype.InterpolantFactoryMethodLinear=void 0;zs.prototype.InterpolantFactoryMethodSmooth=void 0;class Is extends ti{constructor(e,t,n,i){super(e,t,n,i)}}Is.prototype.ValueTypeName="vector";class Bc{constructor(e="",t=-1,n=[],i=Vd){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=Zn(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let a=0,o=n.length;a!==o;++a)t.push(bp(n[a]).scale(i));const r=new this(e.name,e.duration,t,e.blendMode);return r.uuid=e.uuid,r}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let r=0,a=n.length;r!==a;++r)t.push(ti.toJSON(n[r]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const r=t.length,a=[];for(let o=0;o<r;o++){let l=[],c=[];l.push((o+r-1)%r,o,(o+1)%r),c.push(0,1,0);const h=gp(l);l=zc(l,1,h),c=zc(c,1,h),!i&&l[0]===0&&(l.push(r),c.push(c[0])),a.push(new _a(".morphTargetInfluences["+t[o].name+"]",l,c).scale(1/n))}return new this(e,-1,a)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const i=e;n=i.geometry&&i.geometry.animations||i.animations}for(let i=0;i<n.length;i++)if(n[i].name===t)return n[i];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let o=0,l=e.length;o<l;o++){const c=e[o],h=c.name.match(r);if(h&&h.length>1){const f=h[1];let u=i[f];u||(i[f]=u=[]),u.push(c)}}const a=[];for(const o in i)a.push(this.CreateFromMorphTargetSequence(o,i[o],t,n));return a}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(f,u,d,m,_){if(d.length!==0){const g=[],p=[];Mu(d,g,p,m),g.length!==0&&_.push(new f(u,g,p))}},i=[],r=e.name||"default",a=e.fps||30,o=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let f=0;f<c.length;f++){const u=c[f].keys;if(!(!u||u.length===0))if(u[0].morphTargets){const d={};let m;for(m=0;m<u.length;m++)if(u[m].morphTargets)for(let _=0;_<u[m].morphTargets.length;_++)d[u[m].morphTargets[_]]=-1;for(const _ in d){const g=[],p=[];for(let S=0;S!==u[m].morphTargets.length;++S){const A=u[m];g.push(A.time),p.push(A.morphTarget===_?1:0)}i.push(new _a(".morphTargetInfluence["+_+"]",g,p))}l=d.length*a}else{const d=".bones["+t[f].name+"]";n(Is,d+".position",u,"pos",i),n(ur,d+".quaternion",u,"rot",i),n(Is,d+".scale",u,"scl",i)}}return i.length===0?null:new this(r,l,i,o)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,i=e.length;n!==i;++n){const r=this.tracks[n];t=Math.max(t,r.times[r.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function Mp(s){switch(s.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return _a;case"vector":case"vector2":case"vector3":case"vector4":return Is;case"color":return bu;case"quaternion":return ur;case"bool":case"boolean":return Os;case"string":return zs}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+s)}function bp(s){if(s.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=Mp(s.type);if(s.times===void 0){const t=[],n=[];Mu(s.keys,t,n,"value"),s.times=t,s.values=n}return e.parse!==void 0?e.parse(s):new e(s.name,s.times,s.values,s.interpolation)}const va={enabled:!1,files:{},add:function(s,e){this.enabled!==!1&&(this.files[s]=e)},get:function(s){if(this.enabled!==!1)return this.files[s]},remove:function(s){delete this.files[s]},clear:function(){this.files={}}};class Su{constructor(e,t,n){const i=this;let r=!1,a=0,o=0,l;const c=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(h){o++,r===!1&&i.onStart!==void 0&&i.onStart(h,a,o),r=!0},this.itemEnd=function(h){a++,i.onProgress!==void 0&&i.onProgress(h,a,o),a===o&&(r=!1,i.onLoad!==void 0&&i.onLoad())},this.itemError=function(h){i.onError!==void 0&&i.onError(h)},this.resolveURL=function(h){return l?l(h):h},this.setURLModifier=function(h){return l=h,this},this.addHandler=function(h,f){return c.push(h,f),this},this.removeHandler=function(h){const f=c.indexOf(h);return f!==-1&&c.splice(f,2),this},this.getHandler=function(h){for(let f=0,u=c.length;f<u;f+=2){const d=c[f],m=c[f+1];if(d.global&&(d.lastIndex=0),d.test(h))return m}return null}}}const zl=new Su;class Qn{constructor(e){this.manager=e!==void 0?e:zl,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(i,r){n.load(e,i,t,r)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}Qn.DEFAULT_MATERIAL_NAME="__DEFAULT";const _i={};class Sp extends Error{constructor(e,t){super(e),this.response=t}}class Bs extends Qn{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=va.get(e);if(r!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(r),this.manager.itemEnd(e)},0),r;if(_i[e]!==void 0){_i[e].push({onLoad:t,onProgress:n,onError:i});return}_i[e]=[],_i[e].push({onLoad:t,onProgress:n,onError:i});const a=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,l=this.responseType;fetch(a).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;const h=_i[e],f=c.body.getReader(),u=c.headers.get("X-File-Size")||c.headers.get("Content-Length"),d=u?parseInt(u):0,m=d!==0;let _=0;const g=new ReadableStream({start(p){S();function S(){f.read().then(({done:A,value:b})=>{if(A)p.close();else{_+=b.byteLength;const N=new ProgressEvent("progress",{lengthComputable:m,loaded:_,total:d});for(let C=0,P=h.length;C<P;C++){const D=h[C];D.onProgress&&D.onProgress(N)}p.enqueue(b),S()}},A=>{p.error(A)})}}});return new Response(g)}else throw new Sp(`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==="")return c.text();{const f=/charset="?([^;"\s]*)"?/i.exec(o),u=f&&f[1]?f[1].toLowerCase():void 0,d=new TextDecoder(u);return c.arrayBuffer().then(m=>d.decode(m))}}}).then(c=>{va.add(e,c);const h=_i[e];delete _i[e];for(let f=0,u=h.length;f<u;f++){const d=h[f];d.onLoad&&d.onLoad(c)}}).catch(c=>{const h=_i[e];if(h===void 0)throw this.manager.itemError(e),c;delete _i[e];for(let f=0,u=h.length;f<u;f++){const d=h[f];d.onError&&d.onError(c)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class Ep extends Qn{constructor(e){super(e)}load(e,t,n,i){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const r=this,a=va.get(e);if(a!==void 0)return r.manager.itemStart(e),setTimeout(function(){t&&t(a),r.manager.itemEnd(e)},0),a;const o=or("img");function l(){h(),va.add(e,this),t&&t(this),r.manager.itemEnd(e)}function c(f){h(),i&&i(f),r.manager.itemError(e),r.manager.itemEnd(e)}function h(){o.removeEventListener("load",l,!1),o.removeEventListener("error",c,!1)}return o.addEventListener("load",l,!1),o.addEventListener("error",c,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(e),o.src=e,o}}class Ap extends Qn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new mu,o=new Bs(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(e,function(l){let c;try{c=r.parse(l)}catch(h){if(i!==void 0)i(h);else{console.error(h);return}}c.image!==void 0?a.image=c.image:c.data!==void 0&&(a.image.width=c.width,a.image.height=c.height,a.image.data=c.data),a.wrapS=c.wrapS!==void 0?c.wrapS:Jn,a.wrapT=c.wrapT!==void 0?c.wrapT:Jn,a.magFilter=c.magFilter!==void 0?c.magFilter:Fn,a.minFilter=c.minFilter!==void 0?c.minFilter:Fn,a.anisotropy=c.anisotropy!==void 0?c.anisotropy:1,c.colorSpace!==void 0&&(a.colorSpace=c.colorSpace),c.flipY!==void 0&&(a.flipY=c.flipY),c.format!==void 0&&(a.format=c.format),c.type!==void 0&&(a.type=c.type),c.mipmaps!==void 0&&(a.mipmaps=c.mipmaps,a.minFilter=xi),c.mipmapCount===1&&(a.minFilter=Fn),c.generateMipmaps!==void 0&&(a.generateMipmaps=c.generateMipmaps),a.needsUpdate=!0,t&&t(a,c)},n,i),a}}class Bl extends Qn{constructor(e){super(e)}load(e,t,n,i){const r=new Sn,a=new Ep(this.manager);return a.setCrossOrigin(this.crossOrigin),a.setPath(this.path),a.load(e,function(o){r.image=o,r.needsUpdate=!0,t!==void 0&&t(r)},n,i),r}}class dr extends on{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new xt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class wp extends dr{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(on.DEFAULT_UP),this.updateMatrix(),this.groundColor=new xt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const oo=new Tt,kc=new F,Vc=new F;class kl{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qe(512,512),this.mapType=ci,this.map=null,this.mapPass=null,this.matrix=new Tt,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Nl,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new Xt(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;kc.setFromMatrixPosition(e.matrixWorld),t.position.copy(kc),Vc.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(Vc),t.updateMatrixWorld(),oo.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(oo),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(oo)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class Tp extends kl{constructor(){super(new bn(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const t=this.camera,n=Us*2*e.angle*this.focus,i=this.mapSize.width/this.mapSize.height*this.aspect,r=e.distance||t.far;(n!==t.fov||i!==t.aspect||r!==t.far)&&(t.fov=n,t.aspect=i,t.far=r,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class Cp extends dr{constructor(e,t,n=0,i=Math.PI/3,r=0,a=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(on.DEFAULT_UP),this.updateMatrix(),this.target=new on,this.distance=n,this.angle=i,this.penumbra=r,this.decay=a,this.map=null,this.shadow=new Tp}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const Hc=new Tt,$s=new F,lo=new F;class Rp extends kl{constructor(){super(new bn(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Qe(4,2),this._viewportCount=6,this._viewports=[new Xt(2,1,1,1),new Xt(0,1,1,1),new Xt(3,1,1,1),new Xt(1,1,1,1),new Xt(3,0,1,1),new Xt(1,0,1,1)],this._cubeDirections=[new F(1,0,0),new F(-1,0,0),new F(0,0,1),new F(0,0,-1),new F(0,1,0),new F(0,-1,0)],this._cubeUps=[new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,1,0),new F(0,0,1),new F(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,r=e.distance||n.far;r!==n.far&&(n.far=r,n.updateProjectionMatrix()),$s.setFromMatrixPosition(e.matrixWorld),n.position.copy($s),lo.copy(n.position),lo.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(lo),n.updateMatrixWorld(),i.makeTranslation(-$s.x,-$s.y,-$s.z),Hc.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Hc)}}class Eu extends dr{constructor(e,t,n=0,i=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=i,this.shadow=new Rp}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Ta extends cu{constructor(e=-1,t=1,n=1,i=-1,r=.1,a=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=r,this.far=a,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,r,a){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=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=a,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-e,a=n+e,o=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=c*this.view.offsetX,a=r+c*this.view.width,o-=h*this.view.offsetY,l=o-h*this.view.height}this.projectionMatrix.makeOrthographic(r,a,o,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class Lp extends kl{constructor(){super(new Ta(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class Au extends dr{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(on.DEFAULT_UP),this.updateMatrix(),this.target=new on,this.shadow=new Lp}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class wu extends dr{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class Vl{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class Pp extends hn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class Dp extends bn{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class Up{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=Gc(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=Gc();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function Gc(){return performance.now()}class hl extends uu{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}const Wc=new Tt;class Np{constructor(e,t,n=0,i=1/0){this.ray=new Fs(e,t),this.near=n,this.far=i,this.camera=null,this.layers=new Rl,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: Unsupported camera type: "+t.type)}setFromXRController(e){return Wc.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(Wc),this}intersectObject(e,t=!0,n=[]){return ul(e,this,n,t),n.sort(Xc),n}intersectObjects(e,t=!0,n=[]){for(let i=0,r=e.length;i<r;i++)ul(e[i],this,n,t);return n.sort(Xc),n}}function Xc(s,e){return s.distance-e.distance}function ul(s,e,t,n){let i=!0;if(s.layers.test(e.layers)&&s.raycast(e,t)===!1&&(i=!1),i===!0&&n===!0){const r=s.children;for(let a=0,o=r.length;a<o;a++)ul(r[a],e,t,!0)}}class Tu{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=Ft(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(Ft(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}const qc=new F,Hr=new F;class Ip{constructor(e=new F,t=new F){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){qc.subVectors(e,this.start),Hr.subVectors(this.end,this.start);const n=Hr.dot(Hr);let r=Hr.dot(qc)/n;return t&&(r=Ft(r,0,1)),r}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}class Fp extends ga{constructor(e=10,t=10,n=4473924,i=8947848){n=new xt(n),i=new xt(i);const r=t/2,a=e/t,o=e/2,l=[],c=[];for(let u=0,d=0,m=-o;u<=t;u++,m+=a){l.push(-o,0,m,o,0,m),l.push(m,0,-o,m,0,o);const _=u===r?n:i;_.toArray(c,d),d+=3,_.toArray(c,d),d+=3,_.toArray(c,d),d+=3,_.toArray(c,d),d+=3}const h=new hn;h.setAttribute("position",new Ut(l,3)),h.setAttribute("color",new Ut(c,3));const f=new bi({vertexColors:!0,toneMapped:!1});super(h,f),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class Op extends ns{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function jc(s,e,t,n){const i=zp(n);switch(t){case Kh:return s*e;case Qh:return s*e/i.components*i.byteLength;case El:return s*e/i.components*i.byteLength;case eu:return s*e*2/i.components*i.byteLength;case Al:return s*e*2/i.components*i.byteLength;case Zh:return s*e*3/i.components*i.byteLength;case Wn:return s*e*4/i.components*i.byteLength;case wl:return s*e*4/i.components*i.byteLength;case ta:case na:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case ia:case sa:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Fo:case zo:return Math.max(s,16)*Math.max(e,8)/4;case Io:case Oo:return Math.max(s,8)*Math.max(e,8)/2;case Bo:case ko:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*8;case Vo:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Ho:return Math.floor((s+3)/4)*Math.floor((e+3)/4)*16;case Go:return Math.floor((s+4)/5)*Math.floor((e+3)/4)*16;case Wo:return Math.floor((s+4)/5)*Math.floor((e+4)/5)*16;case Xo:return Math.floor((s+5)/6)*Math.floor((e+4)/5)*16;case qo:return Math.floor((s+5)/6)*Math.floor((e+5)/6)*16;case jo:return Math.floor((s+7)/8)*Math.floor((e+4)/5)*16;case Yo:return Math.floor((s+7)/8)*Math.floor((e+5)/6)*16;case $o:return Math.floor((s+7)/8)*Math.floor((e+7)/8)*16;case Jo:return Math.floor((s+9)/10)*Math.floor((e+4)/5)*16;case Ko:return Math.floor((s+9)/10)*Math.floor((e+5)/6)*16;case Zo:return Math.floor((s+9)/10)*Math.floor((e+7)/8)*16;case Qo:return Math.floor((s+9)/10)*Math.floor((e+9)/10)*16;case el:return Math.floor((s+11)/12)*Math.floor((e+9)/10)*16;case tl:return Math.floor((s+11)/12)*Math.floor((e+11)/12)*16;case ra:case nl:case il:return Math.ceil(s/4)*Math.ceil(e/4)*16;case tu:case sl:return Math.ceil(s/4)*Math.ceil(e/4)*8;case rl:case al:return Math.ceil(s/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function zp(s){switch(s){case ci:case Yh:return{byteLength:1,components:1};case ir:case $h:case cr:return{byteLength:2,components:1};case bl:case Sl:return{byteLength:2,components:4};case es:case Ml:case oi:return{byteLength:4,components:1};case Jh:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${s}.`)}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:yl}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=yl);/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2010-2025 Three.js Authors
|
|
47
47
|
* SPDX-License-Identifier: MIT
|
|
48
|
-
*/function Cu(){let s=null,e=!1,t=null,n=null;function i(r,a){t(r,a),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){s=r}}}function
|
|
48
|
+
*/function Cu(){let s=null,e=!1,t=null,n=null;function i(r,a){t(r,a),n=s.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=s.requestAnimationFrame(i),e=!0)},stop:function(){s.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(r){t=r},setContext:function(r){s=r}}}function Bp(s){const e=new WeakMap;function t(o,l){const c=o.array,h=o.usage,f=c.byteLength,u=s.createBuffer();s.bindBuffer(l,u),s.bufferData(l,c,h),o.onUploadCallback();let d;if(c instanceof Float32Array)d=s.FLOAT;else if(c instanceof Uint16Array)o.isFloat16BufferAttribute?d=s.HALF_FLOAT:d=s.UNSIGNED_SHORT;else if(c instanceof Int16Array)d=s.SHORT;else if(c instanceof Uint32Array)d=s.UNSIGNED_INT;else if(c instanceof Int32Array)d=s.INT;else if(c instanceof Int8Array)d=s.BYTE;else if(c instanceof Uint8Array)d=s.UNSIGNED_BYTE;else if(c instanceof Uint8ClampedArray)d=s.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+c);return{buffer:u,type:d,bytesPerElement:c.BYTES_PER_ELEMENT,version:o.version,size:f}}function n(o,l,c){const h=l.array,f=l.updateRanges;if(s.bindBuffer(c,o),f.length===0)s.bufferSubData(c,0,h);else{f.sort((d,m)=>d.start-m.start);let u=0;for(let d=1;d<f.length;d++){const m=f[u],_=f[d];_.start<=m.start+m.count+1?m.count=Math.max(m.count,_.start+_.count-m.start):(++u,f[u]=_)}f.length=u+1;for(let d=0,m=f.length;d<m;d++){const _=f[d];s.bufferSubData(c,_.start*h.BYTES_PER_ELEMENT,h,_.start,_.count)}l.clearUpdateRanges()}l.onUploadCallback()}function i(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function r(o){o.isInterleavedBufferAttribute&&(o=o.data);const l=e.get(o);l&&(s.deleteBuffer(l.buffer),e.delete(o))}function a(o,l){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const c=e.get(o);if(c===void 0)e.set(o,t(o,l));else if(c.version<o.version){if(c.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(c.buffer,o,l),c.version=o.version}}return{get:i,remove:r,update:a}}var kp=`#ifdef USE_ALPHAHASH
|
|
49
49
|
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
|
|
50
|
-
#endif`,
|
|
50
|
+
#endif`,Vp=`#ifdef USE_ALPHAHASH
|
|
51
51
|
const float ALPHA_HASH_SCALE = 0.05;
|
|
52
52
|
float hash2D( vec2 value ) {
|
|
53
53
|
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
|
|
@@ -82,20 +82,20 @@
|
|
|
82
82
|
: cases.z;
|
|
83
83
|
return clamp( threshold , 1.0e-6, 1.0 );
|
|
84
84
|
}
|
|
85
|
-
#endif`,Vp=`#ifdef USE_ALPHAMAP
|
|
86
|
-
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
87
85
|
#endif`,Hp=`#ifdef USE_ALPHAMAP
|
|
86
|
+
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
|
|
87
|
+
#endif`,Gp=`#ifdef USE_ALPHAMAP
|
|
88
88
|
uniform sampler2D alphaMap;
|
|
89
|
-
#endif`,
|
|
89
|
+
#endif`,Wp=`#ifdef USE_ALPHATEST
|
|
90
90
|
#ifdef ALPHA_TO_COVERAGE
|
|
91
91
|
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
|
|
92
92
|
if ( diffuseColor.a == 0.0 ) discard;
|
|
93
93
|
#else
|
|
94
94
|
if ( diffuseColor.a < alphaTest ) discard;
|
|
95
95
|
#endif
|
|
96
|
-
#endif`,
|
|
96
|
+
#endif`,Xp=`#ifdef USE_ALPHATEST
|
|
97
97
|
uniform float alphaTest;
|
|
98
|
-
#endif`,
|
|
98
|
+
#endif`,qp=`#ifdef USE_AOMAP
|
|
99
99
|
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
|
|
100
100
|
reflectedLight.indirectDiffuse *= ambientOcclusion;
|
|
101
101
|
#if defined( USE_CLEARCOAT )
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
|
|
109
109
|
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
|
|
110
110
|
#endif
|
|
111
|
-
#endif`,
|
|
111
|
+
#endif`,jp=`#ifdef USE_AOMAP
|
|
112
112
|
uniform sampler2D aoMap;
|
|
113
113
|
uniform float aoMapIntensity;
|
|
114
|
-
#endif`,
|
|
114
|
+
#endif`,Yp=`#ifdef USE_BATCHING
|
|
115
115
|
#if ! defined( GL_ANGLE_multi_draw )
|
|
116
116
|
#define gl_DrawID _gl_DrawID
|
|
117
117
|
uniform int _gl_DrawID;
|
|
@@ -145,15 +145,15 @@
|
|
|
145
145
|
int y = j / size;
|
|
146
146
|
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
|
|
147
147
|
}
|
|
148
|
-
#endif
|
|
148
|
+
#endif`,$p=`#ifdef USE_BATCHING
|
|
149
149
|
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
|
|
150
|
-
#endif
|
|
150
|
+
#endif`,Jp=`vec3 transformed = vec3( position );
|
|
151
151
|
#ifdef USE_ALPHAHASH
|
|
152
152
|
vPosition = vec3( position );
|
|
153
|
-
#endif`,
|
|
153
|
+
#endif`,Kp=`vec3 objectNormal = vec3( normal );
|
|
154
154
|
#ifdef USE_TANGENT
|
|
155
155
|
vec3 objectTangent = vec3( tangent.xyz );
|
|
156
|
-
#endif`,
|
|
156
|
+
#endif`,Zp=`float G_BlinnPhong_Implicit( ) {
|
|
157
157
|
return 0.25;
|
|
158
158
|
}
|
|
159
159
|
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
|
|
@@ -167,7 +167,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
167
167
|
float G = G_BlinnPhong_Implicit( );
|
|
168
168
|
float D = D_BlinnPhong( shininess, dotNH );
|
|
169
169
|
return F * ( G * D );
|
|
170
|
-
} // validated`,
|
|
170
|
+
} // validated`,Qp=`#ifdef USE_IRIDESCENCE
|
|
171
171
|
const mat3 XYZ_TO_REC709 = mat3(
|
|
172
172
|
3.2404542, -0.9692660, 0.0556434,
|
|
173
173
|
-1.5371385, 1.8760108, -0.2040259,
|
|
@@ -230,7 +230,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
230
230
|
}
|
|
231
231
|
return max( I, vec3( 0.0 ) );
|
|
232
232
|
}
|
|
233
|
-
#endif`,
|
|
233
|
+
#endif`,e0=`#ifdef USE_BUMPMAP
|
|
234
234
|
uniform sampler2D bumpMap;
|
|
235
235
|
uniform float bumpScale;
|
|
236
236
|
vec2 dHdxy_fwd() {
|
|
@@ -251,7 +251,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
251
251
|
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
|
|
252
252
|
return normalize( abs( fDet ) * surf_norm - vGrad );
|
|
253
253
|
}
|
|
254
|
-
#endif`,
|
|
254
|
+
#endif`,t0=`#if NUM_CLIPPING_PLANES > 0
|
|
255
255
|
vec4 plane;
|
|
256
256
|
#ifdef ALPHA_TO_COVERAGE
|
|
257
257
|
float distanceToPlane, distanceGradient;
|
|
@@ -297,26 +297,26 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
297
297
|
if ( clipped ) discard;
|
|
298
298
|
#endif
|
|
299
299
|
#endif
|
|
300
|
-
#endif`,t0=`#if NUM_CLIPPING_PLANES > 0
|
|
301
|
-
varying vec3 vClipPosition;
|
|
302
|
-
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
303
300
|
#endif`,n0=`#if NUM_CLIPPING_PLANES > 0
|
|
304
301
|
varying vec3 vClipPosition;
|
|
302
|
+
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
|
|
305
303
|
#endif`,i0=`#if NUM_CLIPPING_PLANES > 0
|
|
304
|
+
varying vec3 vClipPosition;
|
|
305
|
+
#endif`,s0=`#if NUM_CLIPPING_PLANES > 0
|
|
306
306
|
vClipPosition = - mvPosition.xyz;
|
|
307
|
-
#endif`,
|
|
307
|
+
#endif`,r0=`#if defined( USE_COLOR_ALPHA )
|
|
308
308
|
diffuseColor *= vColor;
|
|
309
309
|
#elif defined( USE_COLOR )
|
|
310
310
|
diffuseColor.rgb *= vColor;
|
|
311
|
-
#endif`,
|
|
311
|
+
#endif`,a0=`#if defined( USE_COLOR_ALPHA )
|
|
312
312
|
varying vec4 vColor;
|
|
313
313
|
#elif defined( USE_COLOR )
|
|
314
314
|
varying vec3 vColor;
|
|
315
|
-
#endif`,
|
|
315
|
+
#endif`,o0=`#if defined( USE_COLOR_ALPHA )
|
|
316
316
|
varying vec4 vColor;
|
|
317
317
|
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
318
318
|
varying vec3 vColor;
|
|
319
|
-
#endif`,
|
|
319
|
+
#endif`,l0=`#if defined( USE_COLOR_ALPHA )
|
|
320
320
|
vColor = vec4( 1.0 );
|
|
321
321
|
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
|
|
322
322
|
vColor = vec3( 1.0 );
|
|
@@ -330,7 +330,7 @@ vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in ve
|
|
|
330
330
|
#ifdef USE_BATCHING_COLOR
|
|
331
331
|
vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
|
|
332
332
|
vColor.xyz *= batchingColor.xyz;
|
|
333
|
-
#endif`,
|
|
333
|
+
#endif`,c0=`#define PI 3.141592653589793
|
|
334
334
|
#define PI2 6.283185307179586
|
|
335
335
|
#define PI_HALF 1.5707963267948966
|
|
336
336
|
#define RECIPROCAL_PI 0.3183098861837907
|
|
@@ -404,7 +404,7 @@ vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
|
|
|
404
404
|
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
405
405
|
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
|
|
406
406
|
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
|
|
407
|
-
} // validated`,
|
|
407
|
+
} // validated`,h0=`#ifdef ENVMAP_TYPE_CUBE_UV
|
|
408
408
|
#define cubeUV_minMipLevel 4.0
|
|
409
409
|
#define cubeUV_minTileSize 16.0
|
|
410
410
|
float getFace( vec3 direction ) {
|
|
@@ -497,7 +497,7 @@ float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
|
|
|
497
497
|
return vec4( mix( color0, color1, mipF ), 1.0 );
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
#endif`,
|
|
500
|
+
#endif`,u0=`vec3 transformedNormal = objectNormal;
|
|
501
501
|
#ifdef USE_TANGENT
|
|
502
502
|
vec3 transformedTangent = objectTangent;
|
|
503
503
|
#endif
|
|
@@ -526,21 +526,21 @@ transformedNormal = normalMatrix * transformedNormal;
|
|
|
526
526
|
#ifdef FLIP_SIDED
|
|
527
527
|
transformedTangent = - transformedTangent;
|
|
528
528
|
#endif
|
|
529
|
-
#endif`,
|
|
529
|
+
#endif`,d0=`#ifdef USE_DISPLACEMENTMAP
|
|
530
530
|
uniform sampler2D displacementMap;
|
|
531
531
|
uniform float displacementScale;
|
|
532
532
|
uniform float displacementBias;
|
|
533
|
-
#endif`,
|
|
533
|
+
#endif`,f0=`#ifdef USE_DISPLACEMENTMAP
|
|
534
534
|
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
|
|
535
|
-
#endif`,
|
|
535
|
+
#endif`,p0=`#ifdef USE_EMISSIVEMAP
|
|
536
536
|
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
|
|
537
537
|
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
|
|
538
538
|
emissiveColor = sRGBTransferEOTF( emissiveColor );
|
|
539
539
|
#endif
|
|
540
540
|
totalEmissiveRadiance *= emissiveColor.rgb;
|
|
541
|
-
#endif`,
|
|
541
|
+
#endif`,m0=`#ifdef USE_EMISSIVEMAP
|
|
542
542
|
uniform sampler2D emissiveMap;
|
|
543
|
-
#endif`,
|
|
543
|
+
#endif`,g0="gl_FragColor = linearToOutputTexel( gl_FragColor );",_0=`vec4 LinearTransferOETF( in vec4 value ) {
|
|
544
544
|
return value;
|
|
545
545
|
}
|
|
546
546
|
vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
@@ -548,7 +548,7 @@ vec4 sRGBTransferEOTF( in vec4 value ) {
|
|
|
548
548
|
}
|
|
549
549
|
vec4 sRGBTransferOETF( in vec4 value ) {
|
|
550
550
|
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 );
|
|
551
|
-
}`,
|
|
551
|
+
}`,v0=`#ifdef USE_ENVMAP
|
|
552
552
|
#ifdef ENV_WORLDPOS
|
|
553
553
|
vec3 cameraToFrag;
|
|
554
554
|
if ( isOrthographic ) {
|
|
@@ -577,7 +577,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
577
577
|
#elif defined( ENVMAP_BLENDING_ADD )
|
|
578
578
|
outgoingLight += envColor.xyz * specularStrength * reflectivity;
|
|
579
579
|
#endif
|
|
580
|
-
#endif`,
|
|
580
|
+
#endif`,x0=`#ifdef USE_ENVMAP
|
|
581
581
|
uniform float envMapIntensity;
|
|
582
582
|
uniform float flipEnvMap;
|
|
583
583
|
uniform mat3 envMapRotation;
|
|
@@ -587,7 +587,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
587
587
|
uniform sampler2D envMap;
|
|
588
588
|
#endif
|
|
589
589
|
|
|
590
|
-
#endif`,
|
|
590
|
+
#endif`,y0=`#ifdef USE_ENVMAP
|
|
591
591
|
uniform float reflectivity;
|
|
592
592
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
593
593
|
#define ENV_WORLDPOS
|
|
@@ -598,7 +598,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
598
598
|
#else
|
|
599
599
|
varying vec3 vReflect;
|
|
600
600
|
#endif
|
|
601
|
-
#endif`,
|
|
601
|
+
#endif`,M0=`#ifdef USE_ENVMAP
|
|
602
602
|
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
|
|
603
603
|
#define ENV_WORLDPOS
|
|
604
604
|
#endif
|
|
@@ -609,7 +609,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
609
609
|
varying vec3 vReflect;
|
|
610
610
|
uniform float refractionRatio;
|
|
611
611
|
#endif
|
|
612
|
-
#endif`,
|
|
612
|
+
#endif`,b0=`#ifdef USE_ENVMAP
|
|
613
613
|
#ifdef ENV_WORLDPOS
|
|
614
614
|
vWorldPosition = worldPosition.xyz;
|
|
615
615
|
#else
|
|
@@ -628,16 +628,16 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
628
628
|
#endif
|
|
629
629
|
#endif`,S0=`#ifdef USE_FOG
|
|
630
630
|
vFogDepth = - mvPosition.z;
|
|
631
|
-
#endif`,b0=`#ifdef USE_FOG
|
|
632
|
-
varying float vFogDepth;
|
|
633
631
|
#endif`,E0=`#ifdef USE_FOG
|
|
632
|
+
varying float vFogDepth;
|
|
633
|
+
#endif`,A0=`#ifdef USE_FOG
|
|
634
634
|
#ifdef FOG_EXP2
|
|
635
635
|
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
|
|
636
636
|
#else
|
|
637
637
|
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
|
|
638
638
|
#endif
|
|
639
639
|
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
|
|
640
|
-
#endif`,
|
|
640
|
+
#endif`,w0=`#ifdef USE_FOG
|
|
641
641
|
uniform vec3 fogColor;
|
|
642
642
|
varying float vFogDepth;
|
|
643
643
|
#ifdef FOG_EXP2
|
|
@@ -646,7 +646,7 @@ vec4 sRGBTransferOETF( in vec4 value ) {
|
|
|
646
646
|
uniform float fogNear;
|
|
647
647
|
uniform float fogFar;
|
|
648
648
|
#endif
|
|
649
|
-
#endif`,
|
|
649
|
+
#endif`,T0=`#ifdef USE_GRADIENTMAP
|
|
650
650
|
uniform sampler2D gradientMap;
|
|
651
651
|
#endif
|
|
652
652
|
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
@@ -658,12 +658,12 @@ vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
|
|
|
658
658
|
vec2 fw = fwidth( coord ) * 0.5;
|
|
659
659
|
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
|
|
660
660
|
#endif
|
|
661
|
-
}`,
|
|
661
|
+
}`,C0=`#ifdef USE_LIGHTMAP
|
|
662
662
|
uniform sampler2D lightMap;
|
|
663
663
|
uniform float lightMapIntensity;
|
|
664
|
-
#endif`,
|
|
664
|
+
#endif`,R0=`LambertMaterial material;
|
|
665
665
|
material.diffuseColor = diffuseColor.rgb;
|
|
666
|
-
material.specularStrength = specularStrength;`,
|
|
666
|
+
material.specularStrength = specularStrength;`,L0=`varying vec3 vViewPosition;
|
|
667
667
|
struct LambertMaterial {
|
|
668
668
|
vec3 diffuseColor;
|
|
669
669
|
float specularStrength;
|
|
@@ -677,7 +677,7 @@ void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometr
|
|
|
677
677
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
678
678
|
}
|
|
679
679
|
#define RE_Direct RE_Direct_Lambert
|
|
680
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,
|
|
680
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,P0=`uniform bool receiveShadow;
|
|
681
681
|
uniform vec3 ambientLightColor;
|
|
682
682
|
#if defined( USE_LIGHT_PROBES )
|
|
683
683
|
uniform vec3 lightProbe[ 9 ];
|
|
@@ -793,7 +793,7 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
|
|
|
793
793
|
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
|
|
794
794
|
return irradiance;
|
|
795
795
|
}
|
|
796
|
-
#endif`,
|
|
796
|
+
#endif`,D0=`#ifdef USE_ENVMAP
|
|
797
797
|
vec3 getIBLIrradiance( const in vec3 normal ) {
|
|
798
798
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
799
799
|
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
@@ -826,8 +826,8 @@ float getSpotAttenuation( const in float coneCosine, const in float penumbraCosi
|
|
|
826
826
|
#endif
|
|
827
827
|
}
|
|
828
828
|
#endif
|
|
829
|
-
#endif`,
|
|
830
|
-
material.diffuseColor = diffuseColor.rgb;`,
|
|
829
|
+
#endif`,U0=`ToonMaterial material;
|
|
830
|
+
material.diffuseColor = diffuseColor.rgb;`,N0=`varying vec3 vViewPosition;
|
|
831
831
|
struct ToonMaterial {
|
|
832
832
|
vec3 diffuseColor;
|
|
833
833
|
};
|
|
@@ -839,11 +839,11 @@ void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPo
|
|
|
839
839
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
840
840
|
}
|
|
841
841
|
#define RE_Direct RE_Direct_Toon
|
|
842
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,
|
|
842
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,I0=`BlinnPhongMaterial material;
|
|
843
843
|
material.diffuseColor = diffuseColor.rgb;
|
|
844
844
|
material.specularColor = specular;
|
|
845
845
|
material.specularShininess = shininess;
|
|
846
|
-
material.specularStrength = specularStrength;`,
|
|
846
|
+
material.specularStrength = specularStrength;`,F0=`varying vec3 vViewPosition;
|
|
847
847
|
struct BlinnPhongMaterial {
|
|
848
848
|
vec3 diffuseColor;
|
|
849
849
|
vec3 specularColor;
|
|
@@ -860,7 +860,7 @@ void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geom
|
|
|
860
860
|
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
|
|
861
861
|
}
|
|
862
862
|
#define RE_Direct RE_Direct_BlinnPhong
|
|
863
|
-
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,
|
|
863
|
+
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,O0=`PhysicalMaterial material;
|
|
864
864
|
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
|
|
865
865
|
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
|
|
866
866
|
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
|
|
@@ -946,7 +946,7 @@ material.roughness = min( material.roughness, 1.0 );
|
|
|
946
946
|
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
|
|
947
947
|
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
|
|
948
948
|
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
|
|
949
|
-
#endif`,
|
|
949
|
+
#endif`,z0=`struct PhysicalMaterial {
|
|
950
950
|
vec3 diffuseColor;
|
|
951
951
|
float roughness;
|
|
952
952
|
vec3 specularColor;
|
|
@@ -1247,7 +1247,7 @@ void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradia
|
|
|
1247
1247
|
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
|
|
1248
1248
|
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
|
|
1249
1249
|
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
|
|
1250
|
-
}`,
|
|
1250
|
+
}`,B0=`
|
|
1251
1251
|
vec3 geometryPosition = - vViewPosition;
|
|
1252
1252
|
vec3 geometryNormal = normal;
|
|
1253
1253
|
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
|
|
@@ -1362,7 +1362,7 @@ IncidentLight directLight;
|
|
|
1362
1362
|
#if defined( RE_IndirectSpecular )
|
|
1363
1363
|
vec3 radiance = vec3( 0.0 );
|
|
1364
1364
|
vec3 clearcoatRadiance = vec3( 0.0 );
|
|
1365
|
-
#endif`,
|
|
1365
|
+
#endif`,k0=`#if defined( RE_IndirectDiffuse )
|
|
1366
1366
|
#ifdef USE_LIGHTMAP
|
|
1367
1367
|
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
|
|
1368
1368
|
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
|
|
@@ -1381,32 +1381,32 @@ IncidentLight directLight;
|
|
|
1381
1381
|
#ifdef USE_CLEARCOAT
|
|
1382
1382
|
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
|
|
1383
1383
|
#endif
|
|
1384
|
-
#endif`,
|
|
1384
|
+
#endif`,V0=`#if defined( RE_IndirectDiffuse )
|
|
1385
1385
|
RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
1386
1386
|
#endif
|
|
1387
1387
|
#if defined( RE_IndirectSpecular )
|
|
1388
1388
|
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
|
|
1389
|
-
#endif`,V0=`#if defined( USE_LOGDEPTHBUF )
|
|
1390
|
-
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1391
1389
|
#endif`,H0=`#if defined( USE_LOGDEPTHBUF )
|
|
1390
|
+
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
|
|
1391
|
+
#endif`,G0=`#if defined( USE_LOGDEPTHBUF )
|
|
1392
1392
|
uniform float logDepthBufFC;
|
|
1393
1393
|
varying float vFragDepth;
|
|
1394
1394
|
varying float vIsPerspective;
|
|
1395
|
-
#endif`,
|
|
1395
|
+
#endif`,W0=`#ifdef USE_LOGDEPTHBUF
|
|
1396
1396
|
varying float vFragDepth;
|
|
1397
1397
|
varying float vIsPerspective;
|
|
1398
|
-
#endif`,
|
|
1398
|
+
#endif`,X0=`#ifdef USE_LOGDEPTHBUF
|
|
1399
1399
|
vFragDepth = 1.0 + gl_Position.w;
|
|
1400
1400
|
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
1401
|
-
#endif`,
|
|
1401
|
+
#endif`,q0=`#ifdef USE_MAP
|
|
1402
1402
|
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
|
|
1403
1403
|
#ifdef DECODE_VIDEO_TEXTURE
|
|
1404
1404
|
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
|
|
1405
1405
|
#endif
|
|
1406
1406
|
diffuseColor *= sampledDiffuseColor;
|
|
1407
|
-
#endif`,
|
|
1407
|
+
#endif`,j0=`#ifdef USE_MAP
|
|
1408
1408
|
uniform sampler2D map;
|
|
1409
|
-
#endif`,
|
|
1409
|
+
#endif`,Y0=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
1410
1410
|
#if defined( USE_POINTS_UV )
|
|
1411
1411
|
vec2 uv = vUv;
|
|
1412
1412
|
#else
|
|
@@ -1418,7 +1418,7 @@ IncidentLight directLight;
|
|
|
1418
1418
|
#endif
|
|
1419
1419
|
#ifdef USE_ALPHAMAP
|
|
1420
1420
|
diffuseColor.a *= texture2D( alphaMap, uv ).g;
|
|
1421
|
-
#endif
|
|
1421
|
+
#endif`,$0=`#if defined( USE_POINTS_UV )
|
|
1422
1422
|
varying vec2 vUv;
|
|
1423
1423
|
#else
|
|
1424
1424
|
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
|
|
@@ -1430,19 +1430,19 @@ IncidentLight directLight;
|
|
|
1430
1430
|
#endif
|
|
1431
1431
|
#ifdef USE_ALPHAMAP
|
|
1432
1432
|
uniform sampler2D alphaMap;
|
|
1433
|
-
#endif
|
|
1433
|
+
#endif`,J0=`float metalnessFactor = metalness;
|
|
1434
1434
|
#ifdef USE_METALNESSMAP
|
|
1435
1435
|
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
|
|
1436
1436
|
metalnessFactor *= texelMetalness.b;
|
|
1437
|
-
#endif`,
|
|
1437
|
+
#endif`,K0=`#ifdef USE_METALNESSMAP
|
|
1438
1438
|
uniform sampler2D metalnessMap;
|
|
1439
|
-
#endif`,
|
|
1439
|
+
#endif`,Z0=`#ifdef USE_INSTANCING_MORPH
|
|
1440
1440
|
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
1441
1441
|
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
|
|
1442
1442
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1443
1443
|
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
|
|
1444
1444
|
}
|
|
1445
|
-
#endif`,
|
|
1445
|
+
#endif`,Q0=`#if defined( USE_MORPHCOLORS )
|
|
1446
1446
|
vColor *= morphTargetBaseInfluence;
|
|
1447
1447
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1448
1448
|
#if defined( USE_COLOR_ALPHA )
|
|
@@ -1451,12 +1451,12 @@ IncidentLight directLight;
|
|
|
1451
1451
|
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
|
|
1452
1452
|
#endif
|
|
1453
1453
|
}
|
|
1454
|
-
#endif`,
|
|
1454
|
+
#endif`,em=`#ifdef USE_MORPHNORMALS
|
|
1455
1455
|
objectNormal *= morphTargetBaseInfluence;
|
|
1456
1456
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1457
1457
|
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
|
|
1458
1458
|
}
|
|
1459
|
-
#endif`,
|
|
1459
|
+
#endif`,tm=`#ifdef USE_MORPHTARGETS
|
|
1460
1460
|
#ifndef USE_INSTANCING_MORPH
|
|
1461
1461
|
uniform float morphTargetBaseInfluence;
|
|
1462
1462
|
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
|
|
@@ -1470,12 +1470,12 @@ IncidentLight directLight;
|
|
|
1470
1470
|
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
|
|
1471
1471
|
return texelFetch( morphTargetsTexture, morphUV, 0 );
|
|
1472
1472
|
}
|
|
1473
|
-
#endif`,
|
|
1473
|
+
#endif`,nm=`#ifdef USE_MORPHTARGETS
|
|
1474
1474
|
transformed *= morphTargetBaseInfluence;
|
|
1475
1475
|
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
|
|
1476
1476
|
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
|
|
1477
1477
|
}
|
|
1478
|
-
#endif`,
|
|
1478
|
+
#endif`,im=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
|
|
1479
1479
|
#ifdef FLAT_SHADED
|
|
1480
1480
|
vec3 fdx = dFdx( vViewPosition );
|
|
1481
1481
|
vec3 fdy = dFdy( vViewPosition );
|
|
@@ -1516,7 +1516,7 @@ IncidentLight directLight;
|
|
|
1516
1516
|
tbn2[1] *= faceDirection;
|
|
1517
1517
|
#endif
|
|
1518
1518
|
#endif
|
|
1519
|
-
vec3 nonPerturbedNormal = normal;`,
|
|
1519
|
+
vec3 nonPerturbedNormal = normal;`,sm=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
1520
1520
|
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
|
|
1521
1521
|
#ifdef FLIP_SIDED
|
|
1522
1522
|
normal = - normal;
|
|
@@ -1531,25 +1531,25 @@ vec3 nonPerturbedNormal = normal;`,im=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1531
1531
|
normal = normalize( tbn * mapN );
|
|
1532
1532
|
#elif defined( USE_BUMPMAP )
|
|
1533
1533
|
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
|
|
1534
|
-
#endif`,
|
|
1534
|
+
#endif`,rm=`#ifndef FLAT_SHADED
|
|
1535
1535
|
varying vec3 vNormal;
|
|
1536
1536
|
#ifdef USE_TANGENT
|
|
1537
1537
|
varying vec3 vTangent;
|
|
1538
1538
|
varying vec3 vBitangent;
|
|
1539
1539
|
#endif
|
|
1540
|
-
#endif`,
|
|
1540
|
+
#endif`,am=`#ifndef FLAT_SHADED
|
|
1541
1541
|
varying vec3 vNormal;
|
|
1542
1542
|
#ifdef USE_TANGENT
|
|
1543
1543
|
varying vec3 vTangent;
|
|
1544
1544
|
varying vec3 vBitangent;
|
|
1545
1545
|
#endif
|
|
1546
|
-
#endif`,
|
|
1546
|
+
#endif`,om=`#ifndef FLAT_SHADED
|
|
1547
1547
|
vNormal = normalize( transformedNormal );
|
|
1548
1548
|
#ifdef USE_TANGENT
|
|
1549
1549
|
vTangent = normalize( transformedTangent );
|
|
1550
1550
|
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
|
|
1551
1551
|
#endif
|
|
1552
|
-
#endif`,
|
|
1552
|
+
#endif`,lm=`#ifdef USE_NORMALMAP
|
|
1553
1553
|
uniform sampler2D normalMap;
|
|
1554
1554
|
uniform vec2 normalScale;
|
|
1555
1555
|
#endif
|
|
@@ -1571,13 +1571,13 @@ vec3 nonPerturbedNormal = normal;`,im=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1571
1571
|
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
|
|
1572
1572
|
return mat3( T * scale, B * scale, N );
|
|
1573
1573
|
}
|
|
1574
|
-
#endif`,
|
|
1574
|
+
#endif`,cm=`#ifdef USE_CLEARCOAT
|
|
1575
1575
|
vec3 clearcoatNormal = nonPerturbedNormal;
|
|
1576
|
-
#endif`,
|
|
1576
|
+
#endif`,hm=`#ifdef USE_CLEARCOAT_NORMALMAP
|
|
1577
1577
|
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
|
|
1578
1578
|
clearcoatMapN.xy *= clearcoatNormalScale;
|
|
1579
1579
|
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
|
|
1580
|
-
#endif`,
|
|
1580
|
+
#endif`,um=`#ifdef USE_CLEARCOATMAP
|
|
1581
1581
|
uniform sampler2D clearcoatMap;
|
|
1582
1582
|
#endif
|
|
1583
1583
|
#ifdef USE_CLEARCOAT_NORMALMAP
|
|
@@ -1586,18 +1586,18 @@ vec3 nonPerturbedNormal = normal;`,im=`#ifdef USE_NORMALMAP_OBJECTSPACE
|
|
|
1586
1586
|
#endif
|
|
1587
1587
|
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
|
|
1588
1588
|
uniform sampler2D clearcoatRoughnessMap;
|
|
1589
|
-
#endif`,
|
|
1589
|
+
#endif`,dm=`#ifdef USE_IRIDESCENCEMAP
|
|
1590
1590
|
uniform sampler2D iridescenceMap;
|
|
1591
1591
|
#endif
|
|
1592
1592
|
#ifdef USE_IRIDESCENCE_THICKNESSMAP
|
|
1593
1593
|
uniform sampler2D iridescenceThicknessMap;
|
|
1594
|
-
#endif`,
|
|
1594
|
+
#endif`,fm=`#ifdef OPAQUE
|
|
1595
1595
|
diffuseColor.a = 1.0;
|
|
1596
1596
|
#endif
|
|
1597
1597
|
#ifdef USE_TRANSMISSION
|
|
1598
1598
|
diffuseColor.a *= material.transmissionAlpha;
|
|
1599
1599
|
#endif
|
|
1600
|
-
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,
|
|
1600
|
+
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,pm=`vec3 packNormalToRGB( const in vec3 normal ) {
|
|
1601
1601
|
return normalize( normal ) * 0.5 + 0.5;
|
|
1602
1602
|
}
|
|
1603
1603
|
vec3 unpackRGBToNormal( const in vec3 rgb ) {
|
|
@@ -1666,9 +1666,9 @@ float viewZToPerspectiveDepth( const in float viewZ, const in float near, const
|
|
|
1666
1666
|
}
|
|
1667
1667
|
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
|
|
1668
1668
|
return ( near * far ) / ( ( far - near ) * depth - far );
|
|
1669
|
-
}`,
|
|
1669
|
+
}`,mm=`#ifdef PREMULTIPLIED_ALPHA
|
|
1670
1670
|
gl_FragColor.rgb *= gl_FragColor.a;
|
|
1671
|
-
#endif`,
|
|
1671
|
+
#endif`,gm=`vec4 mvPosition = vec4( transformed, 1.0 );
|
|
1672
1672
|
#ifdef USE_BATCHING
|
|
1673
1673
|
mvPosition = batchingMatrix * mvPosition;
|
|
1674
1674
|
#endif
|
|
@@ -1676,22 +1676,22 @@ float perspectiveDepthToViewZ( const in float depth, const in float near, const
|
|
|
1676
1676
|
mvPosition = instanceMatrix * mvPosition;
|
|
1677
1677
|
#endif
|
|
1678
1678
|
mvPosition = modelViewMatrix * mvPosition;
|
|
1679
|
-
gl_Position = projectionMatrix * mvPosition;`,
|
|
1679
|
+
gl_Position = projectionMatrix * mvPosition;`,_m=`#ifdef DITHERING
|
|
1680
1680
|
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
|
|
1681
|
-
#endif`,
|
|
1681
|
+
#endif`,vm=`#ifdef DITHERING
|
|
1682
1682
|
vec3 dithering( vec3 color ) {
|
|
1683
1683
|
float grid_position = rand( gl_FragCoord.xy );
|
|
1684
1684
|
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
|
|
1685
1685
|
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
|
|
1686
1686
|
return color + dither_shift_RGB;
|
|
1687
1687
|
}
|
|
1688
|
-
#endif`,
|
|
1688
|
+
#endif`,xm=`float roughnessFactor = roughness;
|
|
1689
1689
|
#ifdef USE_ROUGHNESSMAP
|
|
1690
1690
|
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
|
|
1691
1691
|
roughnessFactor *= texelRoughness.g;
|
|
1692
|
-
#endif`,
|
|
1692
|
+
#endif`,ym=`#ifdef USE_ROUGHNESSMAP
|
|
1693
1693
|
uniform sampler2D roughnessMap;
|
|
1694
|
-
#endif`,
|
|
1694
|
+
#endif`,Mm=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
1695
1695
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
1696
1696
|
#endif
|
|
1697
1697
|
#if NUM_SPOT_LIGHT_MAPS > 0
|
|
@@ -1877,7 +1877,7 @@ gl_Position = projectionMatrix * mvPosition;`,gm=`#ifdef DITHERING
|
|
|
1877
1877
|
}
|
|
1878
1878
|
return mix( 1.0, shadow, shadowIntensity );
|
|
1879
1879
|
}
|
|
1880
|
-
#endif`,
|
|
1880
|
+
#endif`,bm=`#if NUM_SPOT_LIGHT_COORDS > 0
|
|
1881
1881
|
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
|
|
1882
1882
|
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
|
|
1883
1883
|
#endif
|
|
@@ -1950,7 +1950,7 @@ gl_Position = projectionMatrix * mvPosition;`,gm=`#ifdef DITHERING
|
|
|
1950
1950
|
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
|
|
1951
1951
|
}
|
|
1952
1952
|
#pragma unroll_loop_end
|
|
1953
|
-
#endif`,
|
|
1953
|
+
#endif`,Em=`float getShadowMask() {
|
|
1954
1954
|
float shadow = 1.0;
|
|
1955
1955
|
#ifdef USE_SHADOWMAP
|
|
1956
1956
|
#if NUM_DIR_LIGHT_SHADOWS > 0
|
|
@@ -1982,12 +1982,12 @@ gl_Position = projectionMatrix * mvPosition;`,gm=`#ifdef DITHERING
|
|
|
1982
1982
|
#endif
|
|
1983
1983
|
#endif
|
|
1984
1984
|
return shadow;
|
|
1985
|
-
}`,
|
|
1985
|
+
}`,Am=`#ifdef USE_SKINNING
|
|
1986
1986
|
mat4 boneMatX = getBoneMatrix( skinIndex.x );
|
|
1987
1987
|
mat4 boneMatY = getBoneMatrix( skinIndex.y );
|
|
1988
1988
|
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
|
|
1989
1989
|
mat4 boneMatW = getBoneMatrix( skinIndex.w );
|
|
1990
|
-
#endif`,
|
|
1990
|
+
#endif`,wm=`#ifdef USE_SKINNING
|
|
1991
1991
|
uniform mat4 bindMatrix;
|
|
1992
1992
|
uniform mat4 bindMatrixInverse;
|
|
1993
1993
|
uniform highp sampler2D boneTexture;
|
|
@@ -2002,7 +2002,7 @@ gl_Position = projectionMatrix * mvPosition;`,gm=`#ifdef DITHERING
|
|
|
2002
2002
|
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
|
|
2003
2003
|
return mat4( v1, v2, v3, v4 );
|
|
2004
2004
|
}
|
|
2005
|
-
#endif`,
|
|
2005
|
+
#endif`,Tm=`#ifdef USE_SKINNING
|
|
2006
2006
|
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
|
|
2007
2007
|
vec4 skinned = vec4( 0.0 );
|
|
2008
2008
|
skinned += boneMatX * skinVertex * skinWeight.x;
|
|
@@ -2010,7 +2010,7 @@ gl_Position = projectionMatrix * mvPosition;`,gm=`#ifdef DITHERING
|
|
|
2010
2010
|
skinned += boneMatZ * skinVertex * skinWeight.z;
|
|
2011
2011
|
skinned += boneMatW * skinVertex * skinWeight.w;
|
|
2012
2012
|
transformed = ( bindMatrixInverse * skinned ).xyz;
|
|
2013
|
-
#endif`,
|
|
2013
|
+
#endif`,Cm=`#ifdef USE_SKINNING
|
|
2014
2014
|
mat4 skinMatrix = mat4( 0.0 );
|
|
2015
2015
|
skinMatrix += skinWeight.x * boneMatX;
|
|
2016
2016
|
skinMatrix += skinWeight.y * boneMatY;
|
|
@@ -2021,17 +2021,17 @@ gl_Position = projectionMatrix * mvPosition;`,gm=`#ifdef DITHERING
|
|
|
2021
2021
|
#ifdef USE_TANGENT
|
|
2022
2022
|
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
|
|
2023
2023
|
#endif
|
|
2024
|
-
#endif`,
|
|
2024
|
+
#endif`,Rm=`float specularStrength;
|
|
2025
2025
|
#ifdef USE_SPECULARMAP
|
|
2026
2026
|
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
|
|
2027
2027
|
specularStrength = texelSpecular.r;
|
|
2028
2028
|
#else
|
|
2029
2029
|
specularStrength = 1.0;
|
|
2030
|
-
#endif`,
|
|
2030
|
+
#endif`,Lm=`#ifdef USE_SPECULARMAP
|
|
2031
2031
|
uniform sampler2D specularMap;
|
|
2032
|
-
#endif`,
|
|
2032
|
+
#endif`,Pm=`#if defined( TONE_MAPPING )
|
|
2033
2033
|
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
|
|
2034
|
-
#endif`,
|
|
2034
|
+
#endif`,Dm=`#ifndef saturate
|
|
2035
2035
|
#define saturate( a ) clamp( a, 0.0, 1.0 )
|
|
2036
2036
|
#endif
|
|
2037
2037
|
uniform float toneMappingExposure;
|
|
@@ -2128,7 +2128,7 @@ vec3 NeutralToneMapping( vec3 color ) {
|
|
|
2128
2128
|
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
|
|
2129
2129
|
return mix( color, vec3( newPeak ), g );
|
|
2130
2130
|
}
|
|
2131
|
-
vec3 CustomToneMapping( vec3 color ) { return color; }`,
|
|
2131
|
+
vec3 CustomToneMapping( vec3 color ) { return color; }`,Um=`#ifdef USE_TRANSMISSION
|
|
2132
2132
|
material.transmission = transmission;
|
|
2133
2133
|
material.transmissionAlpha = 1.0;
|
|
2134
2134
|
material.thickness = thickness;
|
|
@@ -2149,7 +2149,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Dm=`#ifdef USE_TRANSMISS
|
|
|
2149
2149
|
material.attenuationColor, material.attenuationDistance );
|
|
2150
2150
|
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
|
|
2151
2151
|
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
|
|
2152
|
-
#endif`,
|
|
2152
|
+
#endif`,Nm=`#ifdef USE_TRANSMISSION
|
|
2153
2153
|
uniform float transmission;
|
|
2154
2154
|
uniform float thickness;
|
|
2155
2155
|
uniform float attenuationDistance;
|
|
@@ -2275,7 +2275,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Dm=`#ifdef USE_TRANSMISS
|
|
|
2275
2275
|
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
|
|
2276
2276
|
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
|
|
2277
2277
|
}
|
|
2278
|
-
#endif`,
|
|
2278
|
+
#endif`,Im=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2279
2279
|
varying vec2 vUv;
|
|
2280
2280
|
#endif
|
|
2281
2281
|
#ifdef USE_MAP
|
|
@@ -2345,7 +2345,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Dm=`#ifdef USE_TRANSMISS
|
|
|
2345
2345
|
#ifdef USE_THICKNESSMAP
|
|
2346
2346
|
uniform mat3 thicknessMapTransform;
|
|
2347
2347
|
varying vec2 vThicknessMapUv;
|
|
2348
|
-
#endif`,
|
|
2348
|
+
#endif`,Fm=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2349
2349
|
varying vec2 vUv;
|
|
2350
2350
|
#endif
|
|
2351
2351
|
#ifdef USE_MAP
|
|
@@ -2439,7 +2439,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Dm=`#ifdef USE_TRANSMISS
|
|
|
2439
2439
|
#ifdef USE_THICKNESSMAP
|
|
2440
2440
|
uniform mat3 thicknessMapTransform;
|
|
2441
2441
|
varying vec2 vThicknessMapUv;
|
|
2442
|
-
#endif`,
|
|
2442
|
+
#endif`,Om=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
|
|
2443
2443
|
vUv = vec3( uv, 1 ).xy;
|
|
2444
2444
|
#endif
|
|
2445
2445
|
#ifdef USE_MAP
|
|
@@ -2510,7 +2510,7 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Dm=`#ifdef USE_TRANSMISS
|
|
|
2510
2510
|
#endif
|
|
2511
2511
|
#ifdef USE_THICKNESSMAP
|
|
2512
2512
|
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
|
|
2513
|
-
#endif`,
|
|
2513
|
+
#endif`,zm=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
|
|
2514
2514
|
vec4 worldPosition = vec4( transformed, 1.0 );
|
|
2515
2515
|
#ifdef USE_BATCHING
|
|
2516
2516
|
worldPosition = batchingMatrix * worldPosition;
|
|
@@ -2519,12 +2519,12 @@ vec3 CustomToneMapping( vec3 color ) { return color; }`,Dm=`#ifdef USE_TRANSMISS
|
|
|
2519
2519
|
worldPosition = instanceMatrix * worldPosition;
|
|
2520
2520
|
#endif
|
|
2521
2521
|
worldPosition = modelMatrix * worldPosition;
|
|
2522
|
-
#endif`;const
|
|
2522
|
+
#endif`;const Bm=`varying vec2 vUv;
|
|
2523
2523
|
uniform mat3 uvTransform;
|
|
2524
2524
|
void main() {
|
|
2525
2525
|
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
|
|
2526
2526
|
gl_Position = vec4( position.xy, 1.0, 1.0 );
|
|
2527
|
-
}`,
|
|
2527
|
+
}`,km=`uniform sampler2D t2D;
|
|
2528
2528
|
uniform float backgroundIntensity;
|
|
2529
2529
|
varying vec2 vUv;
|
|
2530
2530
|
void main() {
|
|
@@ -2536,14 +2536,14 @@ void main() {
|
|
|
2536
2536
|
gl_FragColor = texColor;
|
|
2537
2537
|
#include <tonemapping_fragment>
|
|
2538
2538
|
#include <colorspace_fragment>
|
|
2539
|
-
}`,
|
|
2539
|
+
}`,Vm=`varying vec3 vWorldDirection;
|
|
2540
2540
|
#include <common>
|
|
2541
2541
|
void main() {
|
|
2542
2542
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
2543
2543
|
#include <begin_vertex>
|
|
2544
2544
|
#include <project_vertex>
|
|
2545
2545
|
gl_Position.z = gl_Position.w;
|
|
2546
|
-
}`,
|
|
2546
|
+
}`,Hm=`#ifdef ENVMAP_TYPE_CUBE
|
|
2547
2547
|
uniform samplerCube envMap;
|
|
2548
2548
|
#elif defined( ENVMAP_TYPE_CUBE_UV )
|
|
2549
2549
|
uniform sampler2D envMap;
|
|
@@ -2566,14 +2566,14 @@ void main() {
|
|
|
2566
2566
|
gl_FragColor = texColor;
|
|
2567
2567
|
#include <tonemapping_fragment>
|
|
2568
2568
|
#include <colorspace_fragment>
|
|
2569
|
-
}`,
|
|
2569
|
+
}`,Gm=`varying vec3 vWorldDirection;
|
|
2570
2570
|
#include <common>
|
|
2571
2571
|
void main() {
|
|
2572
2572
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
2573
2573
|
#include <begin_vertex>
|
|
2574
2574
|
#include <project_vertex>
|
|
2575
2575
|
gl_Position.z = gl_Position.w;
|
|
2576
|
-
}`,
|
|
2576
|
+
}`,Wm=`uniform samplerCube tCube;
|
|
2577
2577
|
uniform float tFlip;
|
|
2578
2578
|
uniform float opacity;
|
|
2579
2579
|
varying vec3 vWorldDirection;
|
|
@@ -2583,7 +2583,7 @@ void main() {
|
|
|
2583
2583
|
gl_FragColor.a *= opacity;
|
|
2584
2584
|
#include <tonemapping_fragment>
|
|
2585
2585
|
#include <colorspace_fragment>
|
|
2586
|
-
}`,
|
|
2586
|
+
}`,Xm=`#include <common>
|
|
2587
2587
|
#include <batching_pars_vertex>
|
|
2588
2588
|
#include <uv_pars_vertex>
|
|
2589
2589
|
#include <displacementmap_pars_vertex>
|
|
@@ -2610,7 +2610,7 @@ void main() {
|
|
|
2610
2610
|
#include <logdepthbuf_vertex>
|
|
2611
2611
|
#include <clipping_planes_vertex>
|
|
2612
2612
|
vHighPrecisionZW = gl_Position.zw;
|
|
2613
|
-
}`,
|
|
2613
|
+
}`,qm=`#if DEPTH_PACKING == 3200
|
|
2614
2614
|
uniform float opacity;
|
|
2615
2615
|
#endif
|
|
2616
2616
|
#include <common>
|
|
@@ -2644,7 +2644,7 @@ void main() {
|
|
|
2644
2644
|
#elif DEPTH_PACKING == 3203
|
|
2645
2645
|
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
|
|
2646
2646
|
#endif
|
|
2647
|
-
}`,
|
|
2647
|
+
}`,jm=`#define DISTANCE
|
|
2648
2648
|
varying vec3 vWorldPosition;
|
|
2649
2649
|
#include <common>
|
|
2650
2650
|
#include <batching_pars_vertex>
|
|
@@ -2671,7 +2671,7 @@ void main() {
|
|
|
2671
2671
|
#include <worldpos_vertex>
|
|
2672
2672
|
#include <clipping_planes_vertex>
|
|
2673
2673
|
vWorldPosition = worldPosition.xyz;
|
|
2674
|
-
}`,
|
|
2674
|
+
}`,Ym=`#define DISTANCE
|
|
2675
2675
|
uniform vec3 referencePosition;
|
|
2676
2676
|
uniform float nearDistance;
|
|
2677
2677
|
uniform float farDistance;
|
|
@@ -2695,13 +2695,13 @@ void main () {
|
|
|
2695
2695
|
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
|
|
2696
2696
|
dist = saturate( dist );
|
|
2697
2697
|
gl_FragColor = packDepthToRGBA( dist );
|
|
2698
|
-
}
|
|
2698
|
+
}`,$m=`varying vec3 vWorldDirection;
|
|
2699
2699
|
#include <common>
|
|
2700
2700
|
void main() {
|
|
2701
2701
|
vWorldDirection = transformDirection( position, modelMatrix );
|
|
2702
2702
|
#include <begin_vertex>
|
|
2703
2703
|
#include <project_vertex>
|
|
2704
|
-
}
|
|
2704
|
+
}`,Jm=`uniform sampler2D tEquirect;
|
|
2705
2705
|
varying vec3 vWorldDirection;
|
|
2706
2706
|
#include <common>
|
|
2707
2707
|
void main() {
|
|
@@ -2710,7 +2710,7 @@ void main() {
|
|
|
2710
2710
|
gl_FragColor = texture2D( tEquirect, sampleUV );
|
|
2711
2711
|
#include <tonemapping_fragment>
|
|
2712
2712
|
#include <colorspace_fragment>
|
|
2713
|
-
}`,
|
|
2713
|
+
}`,Km=`uniform float scale;
|
|
2714
2714
|
attribute float lineDistance;
|
|
2715
2715
|
varying float vLineDistance;
|
|
2716
2716
|
#include <common>
|
|
@@ -2732,7 +2732,7 @@ void main() {
|
|
|
2732
2732
|
#include <logdepthbuf_vertex>
|
|
2733
2733
|
#include <clipping_planes_vertex>
|
|
2734
2734
|
#include <fog_vertex>
|
|
2735
|
-
}`,
|
|
2735
|
+
}`,Zm=`uniform vec3 diffuse;
|
|
2736
2736
|
uniform float opacity;
|
|
2737
2737
|
uniform float dashSize;
|
|
2738
2738
|
uniform float totalSize;
|
|
@@ -2760,7 +2760,7 @@ void main() {
|
|
|
2760
2760
|
#include <colorspace_fragment>
|
|
2761
2761
|
#include <fog_fragment>
|
|
2762
2762
|
#include <premultiplied_alpha_fragment>
|
|
2763
|
-
}`,
|
|
2763
|
+
}`,Qm=`#include <common>
|
|
2764
2764
|
#include <batching_pars_vertex>
|
|
2765
2765
|
#include <uv_pars_vertex>
|
|
2766
2766
|
#include <envmap_pars_vertex>
|
|
@@ -2792,7 +2792,7 @@ void main() {
|
|
|
2792
2792
|
#include <worldpos_vertex>
|
|
2793
2793
|
#include <envmap_vertex>
|
|
2794
2794
|
#include <fog_vertex>
|
|
2795
|
-
}`,
|
|
2795
|
+
}`,e1=`uniform vec3 diffuse;
|
|
2796
2796
|
uniform float opacity;
|
|
2797
2797
|
#ifndef FLAT_SHADED
|
|
2798
2798
|
varying vec3 vNormal;
|
|
@@ -2840,7 +2840,7 @@ void main() {
|
|
|
2840
2840
|
#include <fog_fragment>
|
|
2841
2841
|
#include <premultiplied_alpha_fragment>
|
|
2842
2842
|
#include <dithering_fragment>
|
|
2843
|
-
}`,
|
|
2843
|
+
}`,t1=`#define LAMBERT
|
|
2844
2844
|
varying vec3 vViewPosition;
|
|
2845
2845
|
#include <common>
|
|
2846
2846
|
#include <batching_pars_vertex>
|
|
@@ -2879,7 +2879,7 @@ void main() {
|
|
|
2879
2879
|
#include <envmap_vertex>
|
|
2880
2880
|
#include <shadowmap_vertex>
|
|
2881
2881
|
#include <fog_vertex>
|
|
2882
|
-
}`,
|
|
2882
|
+
}`,n1=`#define LAMBERT
|
|
2883
2883
|
uniform vec3 diffuse;
|
|
2884
2884
|
uniform vec3 emissive;
|
|
2885
2885
|
uniform float opacity;
|
|
@@ -2936,7 +2936,7 @@ void main() {
|
|
|
2936
2936
|
#include <fog_fragment>
|
|
2937
2937
|
#include <premultiplied_alpha_fragment>
|
|
2938
2938
|
#include <dithering_fragment>
|
|
2939
|
-
}`,
|
|
2939
|
+
}`,i1=`#define MATCAP
|
|
2940
2940
|
varying vec3 vViewPosition;
|
|
2941
2941
|
#include <common>
|
|
2942
2942
|
#include <batching_pars_vertex>
|
|
@@ -2970,7 +2970,7 @@ void main() {
|
|
|
2970
2970
|
#include <clipping_planes_vertex>
|
|
2971
2971
|
#include <fog_vertex>
|
|
2972
2972
|
vViewPosition = - mvPosition.xyz;
|
|
2973
|
-
}`,
|
|
2973
|
+
}`,s1=`#define MATCAP
|
|
2974
2974
|
uniform vec3 diffuse;
|
|
2975
2975
|
uniform float opacity;
|
|
2976
2976
|
uniform sampler2D matcap;
|
|
@@ -3016,7 +3016,7 @@ void main() {
|
|
|
3016
3016
|
#include <fog_fragment>
|
|
3017
3017
|
#include <premultiplied_alpha_fragment>
|
|
3018
3018
|
#include <dithering_fragment>
|
|
3019
|
-
}`,
|
|
3019
|
+
}`,r1=`#define NORMAL
|
|
3020
3020
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
3021
3021
|
varying vec3 vViewPosition;
|
|
3022
3022
|
#endif
|
|
@@ -3049,7 +3049,7 @@ void main() {
|
|
|
3049
3049
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
3050
3050
|
vViewPosition = - mvPosition.xyz;
|
|
3051
3051
|
#endif
|
|
3052
|
-
}`,
|
|
3052
|
+
}`,a1=`#define NORMAL
|
|
3053
3053
|
uniform float opacity;
|
|
3054
3054
|
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
|
|
3055
3055
|
varying vec3 vViewPosition;
|
|
@@ -3071,7 +3071,7 @@ void main() {
|
|
|
3071
3071
|
#ifdef OPAQUE
|
|
3072
3072
|
gl_FragColor.a = 1.0;
|
|
3073
3073
|
#endif
|
|
3074
|
-
}`,
|
|
3074
|
+
}`,o1=`#define PHONG
|
|
3075
3075
|
varying vec3 vViewPosition;
|
|
3076
3076
|
#include <common>
|
|
3077
3077
|
#include <batching_pars_vertex>
|
|
@@ -3110,7 +3110,7 @@ void main() {
|
|
|
3110
3110
|
#include <envmap_vertex>
|
|
3111
3111
|
#include <shadowmap_vertex>
|
|
3112
3112
|
#include <fog_vertex>
|
|
3113
|
-
}`,
|
|
3113
|
+
}`,l1=`#define PHONG
|
|
3114
3114
|
uniform vec3 diffuse;
|
|
3115
3115
|
uniform vec3 emissive;
|
|
3116
3116
|
uniform vec3 specular;
|
|
@@ -3169,7 +3169,7 @@ void main() {
|
|
|
3169
3169
|
#include <fog_fragment>
|
|
3170
3170
|
#include <premultiplied_alpha_fragment>
|
|
3171
3171
|
#include <dithering_fragment>
|
|
3172
|
-
}`,
|
|
3172
|
+
}`,c1=`#define STANDARD
|
|
3173
3173
|
varying vec3 vViewPosition;
|
|
3174
3174
|
#ifdef USE_TRANSMISSION
|
|
3175
3175
|
varying vec3 vWorldPosition;
|
|
@@ -3212,7 +3212,7 @@ void main() {
|
|
|
3212
3212
|
#ifdef USE_TRANSMISSION
|
|
3213
3213
|
vWorldPosition = worldPosition.xyz;
|
|
3214
3214
|
#endif
|
|
3215
|
-
}`,
|
|
3215
|
+
}`,h1=`#define STANDARD
|
|
3216
3216
|
#ifdef PHYSICAL
|
|
3217
3217
|
#define IOR
|
|
3218
3218
|
#define USE_SPECULAR
|
|
@@ -3337,7 +3337,7 @@ void main() {
|
|
|
3337
3337
|
#include <fog_fragment>
|
|
3338
3338
|
#include <premultiplied_alpha_fragment>
|
|
3339
3339
|
#include <dithering_fragment>
|
|
3340
|
-
}`,
|
|
3340
|
+
}`,u1=`#define TOON
|
|
3341
3341
|
varying vec3 vViewPosition;
|
|
3342
3342
|
#include <common>
|
|
3343
3343
|
#include <batching_pars_vertex>
|
|
@@ -3374,7 +3374,7 @@ void main() {
|
|
|
3374
3374
|
#include <worldpos_vertex>
|
|
3375
3375
|
#include <shadowmap_vertex>
|
|
3376
3376
|
#include <fog_vertex>
|
|
3377
|
-
}`,
|
|
3377
|
+
}`,d1=`#define TOON
|
|
3378
3378
|
uniform vec3 diffuse;
|
|
3379
3379
|
uniform vec3 emissive;
|
|
3380
3380
|
uniform float opacity;
|
|
@@ -3427,7 +3427,7 @@ void main() {
|
|
|
3427
3427
|
#include <fog_fragment>
|
|
3428
3428
|
#include <premultiplied_alpha_fragment>
|
|
3429
3429
|
#include <dithering_fragment>
|
|
3430
|
-
}`,
|
|
3430
|
+
}`,f1=`uniform float size;
|
|
3431
3431
|
uniform float scale;
|
|
3432
3432
|
#include <common>
|
|
3433
3433
|
#include <color_pars_vertex>
|
|
@@ -3458,7 +3458,7 @@ void main() {
|
|
|
3458
3458
|
#include <clipping_planes_vertex>
|
|
3459
3459
|
#include <worldpos_vertex>
|
|
3460
3460
|
#include <fog_vertex>
|
|
3461
|
-
}`,
|
|
3461
|
+
}`,p1=`uniform vec3 diffuse;
|
|
3462
3462
|
uniform float opacity;
|
|
3463
3463
|
#include <common>
|
|
3464
3464
|
#include <color_pars_fragment>
|
|
@@ -3483,7 +3483,7 @@ void main() {
|
|
|
3483
3483
|
#include <colorspace_fragment>
|
|
3484
3484
|
#include <fog_fragment>
|
|
3485
3485
|
#include <premultiplied_alpha_fragment>
|
|
3486
|
-
}`,
|
|
3486
|
+
}`,m1=`#include <common>
|
|
3487
3487
|
#include <batching_pars_vertex>
|
|
3488
3488
|
#include <fog_pars_vertex>
|
|
3489
3489
|
#include <morphtarget_pars_vertex>
|
|
@@ -3506,7 +3506,7 @@ void main() {
|
|
|
3506
3506
|
#include <worldpos_vertex>
|
|
3507
3507
|
#include <shadowmap_vertex>
|
|
3508
3508
|
#include <fog_vertex>
|
|
3509
|
-
}`,
|
|
3509
|
+
}`,g1=`uniform vec3 color;
|
|
3510
3510
|
uniform float opacity;
|
|
3511
3511
|
#include <common>
|
|
3512
3512
|
#include <packing>
|
|
@@ -3522,7 +3522,7 @@ void main() {
|
|
|
3522
3522
|
#include <tonemapping_fragment>
|
|
3523
3523
|
#include <colorspace_fragment>
|
|
3524
3524
|
#include <fog_fragment>
|
|
3525
|
-
}`,
|
|
3525
|
+
}`,_1=`uniform float rotation;
|
|
3526
3526
|
uniform vec2 center;
|
|
3527
3527
|
#include <common>
|
|
3528
3528
|
#include <uv_pars_vertex>
|
|
@@ -3546,7 +3546,7 @@ void main() {
|
|
|
3546
3546
|
#include <logdepthbuf_vertex>
|
|
3547
3547
|
#include <clipping_planes_vertex>
|
|
3548
3548
|
#include <fog_vertex>
|
|
3549
|
-
}`,
|
|
3549
|
+
}`,v1=`uniform vec3 diffuse;
|
|
3550
3550
|
uniform float opacity;
|
|
3551
3551
|
#include <common>
|
|
3552
3552
|
#include <uv_pars_fragment>
|
|
@@ -3571,7 +3571,7 @@ void main() {
|
|
|
3571
3571
|
#include <tonemapping_fragment>
|
|
3572
3572
|
#include <colorspace_fragment>
|
|
3573
3573
|
#include <fog_fragment>
|
|
3574
|
-
}`,Ot={alphahash_fragment:Bp,alphahash_pars_fragment:kp,alphamap_fragment:Vp,alphamap_pars_fragment:Hp,alphatest_fragment:Gp,alphatest_pars_fragment:Wp,aomap_fragment:Xp,aomap_pars_fragment:qp,batching_pars_vertex:jp,batching_vertex:Yp,begin_vertex:$p,beginnormal_vertex:Jp,bsdfs:Kp,iridescence_fragment:Zp,bumpmap_pars_fragment:Qp,clipping_planes_fragment:e0,clipping_planes_pars_fragment:t0,clipping_planes_pars_vertex:n0,clipping_planes_vertex:i0,color_fragment:s0,color_pars_fragment:r0,color_pars_vertex:a0,color_vertex:o0,common:l0,cube_uv_reflection_fragment:c0,defaultnormal_vertex:h0,displacementmap_pars_vertex:u0,displacementmap_vertex:d0,emissivemap_fragment:f0,emissivemap_pars_fragment:p0,colorspace_fragment:m0,colorspace_pars_fragment:g0,envmap_fragment:_0,envmap_common_pars_fragment:v0,envmap_pars_fragment:x0,envmap_pars_vertex:y0,envmap_physical_pars_fragment:P0,envmap_vertex:M0,fog_vertex:S0,fog_pars_vertex:b0,fog_fragment:E0,fog_pars_fragment:A0,gradientmap_pars_fragment:w0,lightmap_pars_fragment:T0,lights_lambert_fragment:C0,lights_lambert_pars_fragment:R0,lights_pars_begin:L0,lights_toon_fragment:D0,lights_toon_pars_fragment:U0,lights_phong_fragment:N0,lights_phong_pars_fragment:I0,lights_physical_fragment:F0,lights_physical_pars_fragment:O0,lights_fragment_begin:z0,lights_fragment_maps:B0,lights_fragment_end:k0,logdepthbuf_fragment:V0,logdepthbuf_pars_fragment:H0,logdepthbuf_pars_vertex:G0,logdepthbuf_vertex:W0,map_fragment:X0,map_pars_fragment:q0,map_particle_fragment:j0,map_particle_pars_fragment:Y0,metalnessmap_fragment:$0,metalnessmap_pars_fragment:J0,morphinstance_vertex:K0,morphcolor_vertex:Z0,morphnormal_vertex:Q0,morphtarget_pars_vertex:em,morphtarget_vertex:tm,normal_fragment_begin:nm,normal_fragment_maps:im,normal_pars_fragment:sm,normal_pars_vertex:rm,normal_vertex:am,normalmap_pars_fragment:om,clearcoat_normal_fragment_begin:lm,clearcoat_normal_fragment_maps:cm,clearcoat_pars_fragment:hm,iridescence_pars_fragment:um,opaque_fragment:dm,packing:fm,premultiplied_alpha_fragment:pm,project_vertex:mm,dithering_fragment:gm,dithering_pars_fragment:_m,roughnessmap_fragment:vm,roughnessmap_pars_fragment:xm,shadowmap_pars_fragment:ym,shadowmap_pars_vertex:Mm,shadowmap_vertex:Sm,shadowmask_pars_fragment:bm,skinbase_vertex:Em,skinning_pars_vertex:Am,skinning_vertex:wm,skinnormal_vertex:Tm,specularmap_fragment:Cm,specularmap_pars_fragment:Rm,tonemapping_fragment:Lm,tonemapping_pars_fragment:Pm,transmission_fragment:Dm,transmission_pars_fragment:Um,uv_pars_fragment:Nm,uv_pars_vertex:Im,uv_vertex:Fm,worldpos_vertex:Om,background_vert:zm,background_frag:Bm,backgroundCube_vert:km,backgroundCube_frag:Vm,cube_vert:Hm,cube_frag:Gm,depth_vert:Wm,depth_frag:Xm,distanceRGBA_vert:qm,distanceRGBA_frag:jm,equirect_vert:Ym,equirect_frag:$m,linedashed_vert:Jm,linedashed_frag:Km,meshbasic_vert:Zm,meshbasic_frag:Qm,meshlambert_vert:e1,meshlambert_frag:t1,meshmatcap_vert:n1,meshmatcap_frag:i1,meshnormal_vert:s1,meshnormal_frag:r1,meshphong_vert:a1,meshphong_frag:o1,meshphysical_vert:l1,meshphysical_frag:c1,meshtoon_vert:h1,meshtoon_frag:u1,points_vert:d1,points_frag:f1,shadow_vert:p1,shadow_frag:m1,sprite_vert:g1,sprite_frag:_1},Ve={common:{diffuse:{value:new vt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Nt},alphaMap:{value:null},alphaMapTransform:{value:new Nt},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Nt}},envmap:{envMap:{value:null},envMapRotation:{value:new Nt},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Nt}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Nt}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Nt},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Nt},normalScale:{value:new Qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Nt},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Nt}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Nt}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Nt}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new vt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new vt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Nt},alphaTest:{value:0},uvTransform:{value:new Nt}},sprite:{diffuse:{value:new vt(16777215)},opacity:{value:1},center:{value:new Qe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Nt},alphaMap:{value:null},alphaMapTransform:{value:new Nt},alphaTest:{value:0}}},Un={basic:{uniforms:Cn([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.fog]),vertexShader:Ot.meshbasic_vert,fragmentShader:Ot.meshbasic_frag},lambert:{uniforms:Cn([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new vt(0)}}]),vertexShader:Ot.meshlambert_vert,fragmentShader:Ot.meshlambert_frag},phong:{uniforms:Cn([Ve.common,Ve.specularmap,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,Ve.lights,{emissive:{value:new vt(0)},specular:{value:new vt(1118481)},shininess:{value:30}}]),vertexShader:Ot.meshphong_vert,fragmentShader:Ot.meshphong_frag},standard:{uniforms:Cn([Ve.common,Ve.envmap,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.roughnessmap,Ve.metalnessmap,Ve.fog,Ve.lights,{emissive:{value:new vt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ot.meshphysical_vert,fragmentShader:Ot.meshphysical_frag},toon:{uniforms:Cn([Ve.common,Ve.aomap,Ve.lightmap,Ve.emissivemap,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.gradientmap,Ve.fog,Ve.lights,{emissive:{value:new vt(0)}}]),vertexShader:Ot.meshtoon_vert,fragmentShader:Ot.meshtoon_frag},matcap:{uniforms:Cn([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,Ve.fog,{matcap:{value:null}}]),vertexShader:Ot.meshmatcap_vert,fragmentShader:Ot.meshmatcap_frag},points:{uniforms:Cn([Ve.points,Ve.fog]),vertexShader:Ot.points_vert,fragmentShader:Ot.points_frag},dashed:{uniforms:Cn([Ve.common,Ve.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ot.linedashed_vert,fragmentShader:Ot.linedashed_frag},depth:{uniforms:Cn([Ve.common,Ve.displacementmap]),vertexShader:Ot.depth_vert,fragmentShader:Ot.depth_frag},normal:{uniforms:Cn([Ve.common,Ve.bumpmap,Ve.normalmap,Ve.displacementmap,{opacity:{value:1}}]),vertexShader:Ot.meshnormal_vert,fragmentShader:Ot.meshnormal_frag},sprite:{uniforms:Cn([Ve.sprite,Ve.fog]),vertexShader:Ot.sprite_vert,fragmentShader:Ot.sprite_frag},background:{uniforms:{uvTransform:{value:new Nt},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Ot.background_vert,fragmentShader:Ot.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Nt}},vertexShader:Ot.backgroundCube_vert,fragmentShader:Ot.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Ot.cube_vert,fragmentShader:Ot.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ot.equirect_vert,fragmentShader:Ot.equirect_frag},distanceRGBA:{uniforms:Cn([Ve.common,Ve.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ot.distanceRGBA_vert,fragmentShader:Ot.distanceRGBA_frag},shadow:{uniforms:Cn([Ve.lights,Ve.fog,{color:{value:new vt(0)},opacity:{value:1}}]),vertexShader:Ot.shadow_vert,fragmentShader:Ot.shadow_frag}};Un.physical={uniforms:Cn([Un.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Nt},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Nt},clearcoatNormalScale:{value:new Qe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Nt},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Nt},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Nt},sheen:{value:0},sheenColor:{value:new vt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Nt},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Nt},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Nt},transmissionSamplerSize:{value:new Qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Nt},attenuationDistance:{value:0},attenuationColor:{value:new vt(0)},specularColor:{value:new vt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Nt},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Nt},anisotropyVector:{value:new Qe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Nt}}]),vertexShader:Ot.meshphysical_vert,fragmentShader:Ot.meshphysical_frag};const Gr={r:0,b:0,g:0},Xi=new Ln,v1=new bt;function x1(s,e,t,n,i,r,a){const o=new vt(0);let l=r===!0?0:1,c,h,d=null,u=0,f=null;function m(b){let M=b.isScene===!0?b.background:null;return M&&M.isTexture&&(M=(b.backgroundBlurriness>0?t:e).get(M)),M}function _(b){let M=!1;const U=m(b);U===null?p(o,l):U&&U.isColor&&(p(U,1),M=!0);const R=s.xr.getEnvironmentBlendMode();R==="additive"?n.buffers.color.setClear(0,0,0,1,a):R==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(s.autoClear||M)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function g(b,M){const U=m(M);U&&(U.isCubeTexture||U.mapping===Ma)?(h===void 0&&(h=new Jt(new Bi(1,1,1),new bi({name:"BackgroundCubeMaterial",uniforms:Ns(Un.backgroundCube.uniforms),vertexShader:Un.backgroundCube.vertexShader,fragmentShader:Un.backgroundCube.fragmentShader,side:Rn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(R,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Xi.copy(M.backgroundRotation),Xi.x*=-1,Xi.y*=-1,Xi.z*=-1,U.isCubeTexture&&U.isRenderTargetTexture===!1&&(Xi.y*=-1,Xi.z*=-1),h.material.uniforms.envMap.value=U,h.material.uniforms.flipEnvMap.value=U.isCubeTexture&&U.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=M.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(v1.makeRotationFromEuler(Xi)),h.material.toneMapped=kt.getTransfer(U.colorSpace)!==rn,(d!==U||u!==U.version||f!==s.toneMapping)&&(h.material.needsUpdate=!0,d=U,u=U.version,f=s.toneMapping),h.layers.enableAll(),b.unshift(h,h.geometry,h.material,0,0,null)):U&&U.isTexture&&(c===void 0&&(c=new Jt(new hr(2,2),new bi({name:"BackgroundMaterial",uniforms:Ns(Un.background.uniforms),vertexShader:Un.background.vertexShader,fragmentShader:Un.background.fragmentShader,side:Xn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=U,c.material.uniforms.backgroundIntensity.value=M.backgroundIntensity,c.material.toneMapped=kt.getTransfer(U.colorSpace)!==rn,U.matrixAutoUpdate===!0&&U.updateMatrix(),c.material.uniforms.uvTransform.value.copy(U.matrix),(d!==U||u!==U.version||f!==s.toneMapping)&&(c.material.needsUpdate=!0,d=U,u=U.version,f=s.toneMapping),c.layers.enableAll(),b.unshift(c,c.geometry,c.material,0,0,null))}function p(b,M){b.getRGB(Gr,lu(s)),n.buffers.color.setClear(Gr.r,Gr.g,Gr.b,M,a)}function E(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(b,M=1){o.set(b),l=M,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(b){l=b,p(o,l)},render:_,addToRenderList:g,dispose:E}}function y1(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=u(null);let r=i,a=!1;function o(y,N,W,X,Q){let ne=!1;const H=d(X,W,N);r!==H&&(r=H,c(r.object)),ne=f(y,X,W,Q),ne&&m(y,X,W,Q),Q!==null&&e.update(Q,s.ELEMENT_ARRAY_BUFFER),(ne||a)&&(a=!1,M(y,N,W,X),Q!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(Q).buffer))}function l(){return s.createVertexArray()}function c(y){return s.bindVertexArray(y)}function h(y){return s.deleteVertexArray(y)}function d(y,N,W){const X=W.wireframe===!0;let Q=n[y.id];Q===void 0&&(Q={},n[y.id]=Q);let ne=Q[N.id];ne===void 0&&(ne={},Q[N.id]=ne);let H=ne[X];return H===void 0&&(H=u(l()),ne[X]=H),H}function u(y){const N=[],W=[],X=[];for(let Q=0;Q<t;Q++)N[Q]=0,W[Q]=0,X[Q]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:N,enabledAttributes:W,attributeDivisors:X,object:y,attributes:{},index:null}}function f(y,N,W,X){const Q=r.attributes,ne=N.attributes;let H=0;const se=W.getAttributes();for(const Z in se)if(se[Z].location>=0){const be=Q[Z];let Ce=ne[Z];if(Ce===void 0&&(Z==="instanceMatrix"&&y.instanceMatrix&&(Ce=y.instanceMatrix),Z==="instanceColor"&&y.instanceColor&&(Ce=y.instanceColor)),be===void 0||be.attribute!==Ce||Ce&&be.data!==Ce.data)return!0;H++}return r.attributesNum!==H||r.index!==X}function m(y,N,W,X){const Q={},ne=N.attributes;let H=0;const se=W.getAttributes();for(const Z in se)if(se[Z].location>=0){let be=ne[Z];be===void 0&&(Z==="instanceMatrix"&&y.instanceMatrix&&(be=y.instanceMatrix),Z==="instanceColor"&&y.instanceColor&&(be=y.instanceColor));const Ce={};Ce.attribute=be,be&&be.data&&(Ce.data=be.data),Q[Z]=Ce,H++}r.attributes=Q,r.attributesNum=H,r.index=X}function _(){const y=r.newAttributes;for(let N=0,W=y.length;N<W;N++)y[N]=0}function g(y){p(y,0)}function p(y,N){const W=r.newAttributes,X=r.enabledAttributes,Q=r.attributeDivisors;W[y]=1,X[y]===0&&(s.enableVertexAttribArray(y),X[y]=1),Q[y]!==N&&(s.vertexAttribDivisor(y,N),Q[y]=N)}function E(){const y=r.newAttributes,N=r.enabledAttributes;for(let W=0,X=N.length;W<X;W++)N[W]!==y[W]&&(s.disableVertexAttribArray(W),N[W]=0)}function b(y,N,W,X,Q,ne,H){H===!0?s.vertexAttribIPointer(y,N,W,Q,ne):s.vertexAttribPointer(y,N,W,X,Q,ne)}function M(y,N,W,X){_();const Q=X.attributes,ne=W.getAttributes(),H=N.defaultAttributeValues;for(const se in ne){const Z=ne[se];if(Z.location>=0){let pe=Q[se];if(pe===void 0&&(se==="instanceMatrix"&&y.instanceMatrix&&(pe=y.instanceMatrix),se==="instanceColor"&&y.instanceColor&&(pe=y.instanceColor)),pe!==void 0){const be=pe.normalized,Ce=pe.itemSize,Ie=e.get(pe);if(Ie===void 0)continue;const He=Ie.buffer,K=Ie.type,re=Ie.bytesPerElement,ae=K===s.INT||K===s.UNSIGNED_INT||pe.gpuType===Ml;if(pe.isInterleavedBufferAttribute){const le=pe.data,Le=le.stride,ge=pe.offset;if(le.isInstancedInterleavedBuffer){for(let Ae=0;Ae<Z.locationSize;Ae++)p(Z.location+Ae,le.meshPerAttribute);y.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=le.meshPerAttribute*le.count)}else for(let Ae=0;Ae<Z.locationSize;Ae++)g(Z.location+Ae);s.bindBuffer(s.ARRAY_BUFFER,He);for(let Ae=0;Ae<Z.locationSize;Ae++)b(Z.location+Ae,Ce/Z.locationSize,K,be,Le*re,(ge+Ce/Z.locationSize*Ae)*re,ae)}else{if(pe.isInstancedBufferAttribute){for(let le=0;le<Z.locationSize;le++)p(Z.location+le,pe.meshPerAttribute);y.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=pe.meshPerAttribute*pe.count)}else for(let le=0;le<Z.locationSize;le++)g(Z.location+le);s.bindBuffer(s.ARRAY_BUFFER,He);for(let le=0;le<Z.locationSize;le++)b(Z.location+le,Ce/Z.locationSize,K,be,Ce*re,Ce/Z.locationSize*le*re,ae)}}else if(H!==void 0){const be=H[se];if(be!==void 0)switch(be.length){case 2:s.vertexAttrib2fv(Z.location,be);break;case 3:s.vertexAttrib3fv(Z.location,be);break;case 4:s.vertexAttrib4fv(Z.location,be);break;default:s.vertexAttrib1fv(Z.location,be)}}}}E()}function U(){D();for(const y in n){const N=n[y];for(const W in N){const X=N[W];for(const Q in X)h(X[Q].object),delete X[Q];delete N[W]}delete n[y]}}function R(y){if(n[y.id]===void 0)return;const N=n[y.id];for(const W in N){const X=N[W];for(const Q in X)h(X[Q].object),delete X[Q];delete N[W]}delete n[y.id]}function P(y){for(const N in n){const W=n[N];if(W[y.id]===void 0)continue;const X=W[y.id];for(const Q in X)h(X[Q].object),delete X[Q];delete W[y.id]}}function D(){S(),a=!0,r!==i&&(r=i,c(r.object))}function S(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:D,resetDefaultState:S,dispose:U,releaseStatesOfGeometry:R,releaseStatesOfProgram:P,initAttributes:_,enableAttribute:g,disableUnusedAttributes:E}}function M1(s,e,t){let n;function i(c){n=c}function r(c,h){s.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,d){d!==0&&(s.drawArraysInstanced(n,c,h,d),t.update(h,n,d))}function o(c,h,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,d);let f=0;for(let m=0;m<d;m++)f+=h[m];t.update(f,n,1)}function l(c,h,d,u){if(d===0)return;const f=e.get("WEBGL_multi_draw");if(f===null)for(let m=0;m<c.length;m++)a(c[m],h[m],u[m]);else{f.multiDrawArraysInstancedWEBGL(n,c,0,h,0,u,0,d);let m=0;for(let _=0;_<d;_++)m+=h[_]*u[_];t.update(m,n,1)}}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function S1(s,e,t,n){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const P=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(P){return!(P!==Wn&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(P){const D=P===cr&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(P!==ci&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&P!==oi&&!D)}function l(P){if(P==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const d=t.logarithmicDepthBuffer===!0,u=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),f=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),m=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=s.getParameter(s.MAX_TEXTURE_SIZE),g=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),p=s.getParameter(s.MAX_VERTEX_ATTRIBS),E=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),b=s.getParameter(s.MAX_VARYING_VECTORS),M=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),U=m>0,R=s.getParameter(s.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:d,reverseDepthBuffer:u,maxTextures:f,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:E,maxVaryings:b,maxFragmentUniforms:M,vertexTextures:U,maxSamples:R}}function b1(s){const e=this;let t=null,n=0,i=!1,r=!1;const a=new Ui,o=new Nt,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(d,u){const f=d.length!==0||u||n!==0||i;return i=u,n=d.length,f},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(d,u){t=h(d,u,0)},this.setState=function(d,u,f){const m=d.clippingPlanes,_=d.clipIntersection,g=d.clipShadows,p=s.get(d);if(!i||m===null||m.length===0||r&&!g)r?h(null):c();else{const E=r?0:n,b=E*4;let M=p.clippingState||null;l.value=M,M=h(m,u,b,f);for(let U=0;U!==b;++U)M[U]=t[U];p.clippingState=M,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=E}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(d,u,f,m){const _=d!==null?d.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=f+_*4,E=u.matrixWorldInverse;o.getNormalMatrix(E),(g===null||g.length<p)&&(g=new Float32Array(p));for(let b=0,M=f;b!==_;++b,M+=4)a.copy(d[b]).applyMatrix4(E,o),a.normal.toArray(g,M),g[M+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function E1(s){let e=new WeakMap;function t(a,o){return o===Do?a.mapping=Ls:o===Uo&&(a.mapping=Ps),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Do||o===Uo)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new kf(l.height);return c.fromEquirectangularTexture(s,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const Es=4,Yc=[.125,.215,.35,.446,.526,.582],Zi=20,co=new Ta,$c=new vt;let ho=null,uo=0,fo=0,po=!1;const $i=(1+Math.sqrt(5))/2,Ms=1/$i,Jc=[new F(-$i,Ms,0),new F($i,Ms,0),new F(-Ms,0,$i),new F(Ms,0,$i),new F(0,$i,-Ms),new F(0,$i,Ms),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],A1=new F;class Kc{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,r={}){const{size:a=256,position:o=A1}=r;ho=this._renderer.getRenderTarget(),uo=this._renderer.getActiveCubeFace(),fo=this._renderer.getActiveMipmapLevel(),po=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=eh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Qc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(ho,uo,fo),this._renderer.xr.enabled=po,e.scissorTest=!1,Wr(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ls||e.mapping===Ps?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ho=this._renderer.getRenderTarget(),uo=this._renderer.getActiveCubeFace(),fo=this._renderer.getActiveMipmapLevel(),po=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Fn,minFilter:Fn,generateMipmaps:!1,type:cr,format:Wn,colorSpace:Ds,depthBuffer:!1},i=Zc(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Zc(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=w1(r)),this._blurMaterial=T1(r,e,t)}return i}_compileMaterial(e){const t=new Jt(this._lodPlanes[0],e);this._renderer.compile(t,co)}_sceneToCubeUV(e,t,n,i,r){const l=new Sn(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],d=this._renderer,u=d.autoClear,f=d.toneMapping;d.getClearColor($c),d.toneMapping=Oi,d.autoClear=!1;const m=new zi({name:"PMREM.Background",side:Rn,depthWrite:!1,depthTest:!1}),_=new Jt(new Bi,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy($c),g=!0);for(let E=0;E<6;E++){const b=E%3;b===0?(l.up.set(0,c[E],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[E],r.y,r.z)):b===1?(l.up.set(0,0,c[E]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[E],r.z)):(l.up.set(0,c[E],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[E]));const M=this._cubeSize;Wr(i,b*M,E>2?M:0,M,M),d.setRenderTarget(i),g&&d.render(_,l),d.render(e,l)}_.geometry.dispose(),_.material.dispose(),d.toneMapping=f,d.autoClear=u,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Ls||e.mapping===Ps;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=eh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Qc());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new Jt(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=e;const l=this._cubeSize;Wr(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,co)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;r<i;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Jc[(i-r-1)%Jc.length];this._blur(e,r-1,r,a,o)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,d=new Jt(this._lodPlanes[i],c),u=c.uniforms,f=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*f):2*Math.PI/(2*Zi-1),_=r/m,g=isFinite(r)?1+Math.floor(h*_):Zi;g>Zi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Zi}`);const p=[];let E=0;for(let P=0;P<Zi;++P){const D=P/_,S=Math.exp(-D*D/2);p.push(S),P===0?E+=S:P<g&&(E+=2*S)}for(let P=0;P<p.length;P++)p[P]=p[P]/E;u.envMap.value=e.texture,u.samples.value=g,u.weights.value=p,u.latitudinal.value=a==="latitudinal",o&&(u.poleAxis.value=o);const{_lodMax:b}=this;u.dTheta.value=m,u.mipInt.value=b-n;const M=this._sizeLods[i],U=3*M*(i>b-Es?i-b+Es:0),R=4*(this._cubeSize-M);Wr(t,U,R,3*M,2*M),l.setRenderTarget(t),l.render(d,co)}}function w1(s){const e=[],t=[],n=[];let i=s;const r=s-Es+1+Yc.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>s-Es?l=Yc[a-s+Es-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,d=1+c,u=[h,h,d,h,d,d,h,h,d,d,h,d],f=6,m=6,_=3,g=2,p=1,E=new Float32Array(_*m*f),b=new Float32Array(g*m*f),M=new Float32Array(p*m*f);for(let R=0;R<f;R++){const P=R%3*2/3-1,D=R>2?0:-1,S=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];E.set(S,_*m*R),b.set(u,g*m*R);const y=[R,R,R,R,R,R];M.set(y,p*m*R)}const U=new ln;U.setAttribute("position",new fn(E,_)),U.setAttribute("uv",new fn(b,g)),U.setAttribute("faceIndex",new fn(M,p)),e.push(U),i>Es&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function Zc(s,e,t){const n=new ts(s,e,t);return n.texture.mapping=Ma,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Wr(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function T1(s,e,t){const n=new Float32Array(Zi),i=new F(0,1,0);return new bi({name:"SphericalGaussianBlur",defines:{n:Zi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Hl(),fragmentShader:`
|
|
3574
|
+
}`,kt={alphahash_fragment:kp,alphahash_pars_fragment:Vp,alphamap_fragment:Hp,alphamap_pars_fragment:Gp,alphatest_fragment:Wp,alphatest_pars_fragment:Xp,aomap_fragment:qp,aomap_pars_fragment:jp,batching_pars_vertex:Yp,batching_vertex:$p,begin_vertex:Jp,beginnormal_vertex:Kp,bsdfs:Zp,iridescence_fragment:Qp,bumpmap_pars_fragment:e0,clipping_planes_fragment:t0,clipping_planes_pars_fragment:n0,clipping_planes_pars_vertex:i0,clipping_planes_vertex:s0,color_fragment:r0,color_pars_fragment:a0,color_pars_vertex:o0,color_vertex:l0,common:c0,cube_uv_reflection_fragment:h0,defaultnormal_vertex:u0,displacementmap_pars_vertex:d0,displacementmap_vertex:f0,emissivemap_fragment:p0,emissivemap_pars_fragment:m0,colorspace_fragment:g0,colorspace_pars_fragment:_0,envmap_fragment:v0,envmap_common_pars_fragment:x0,envmap_pars_fragment:y0,envmap_pars_vertex:M0,envmap_physical_pars_fragment:D0,envmap_vertex:b0,fog_vertex:S0,fog_pars_vertex:E0,fog_fragment:A0,fog_pars_fragment:w0,gradientmap_pars_fragment:T0,lightmap_pars_fragment:C0,lights_lambert_fragment:R0,lights_lambert_pars_fragment:L0,lights_pars_begin:P0,lights_toon_fragment:U0,lights_toon_pars_fragment:N0,lights_phong_fragment:I0,lights_phong_pars_fragment:F0,lights_physical_fragment:O0,lights_physical_pars_fragment:z0,lights_fragment_begin:B0,lights_fragment_maps:k0,lights_fragment_end:V0,logdepthbuf_fragment:H0,logdepthbuf_pars_fragment:G0,logdepthbuf_pars_vertex:W0,logdepthbuf_vertex:X0,map_fragment:q0,map_pars_fragment:j0,map_particle_fragment:Y0,map_particle_pars_fragment:$0,metalnessmap_fragment:J0,metalnessmap_pars_fragment:K0,morphinstance_vertex:Z0,morphcolor_vertex:Q0,morphnormal_vertex:em,morphtarget_pars_vertex:tm,morphtarget_vertex:nm,normal_fragment_begin:im,normal_fragment_maps:sm,normal_pars_fragment:rm,normal_pars_vertex:am,normal_vertex:om,normalmap_pars_fragment:lm,clearcoat_normal_fragment_begin:cm,clearcoat_normal_fragment_maps:hm,clearcoat_pars_fragment:um,iridescence_pars_fragment:dm,opaque_fragment:fm,packing:pm,premultiplied_alpha_fragment:mm,project_vertex:gm,dithering_fragment:_m,dithering_pars_fragment:vm,roughnessmap_fragment:xm,roughnessmap_pars_fragment:ym,shadowmap_pars_fragment:Mm,shadowmap_pars_vertex:bm,shadowmap_vertex:Sm,shadowmask_pars_fragment:Em,skinbase_vertex:Am,skinning_pars_vertex:wm,skinning_vertex:Tm,skinnormal_vertex:Cm,specularmap_fragment:Rm,specularmap_pars_fragment:Lm,tonemapping_fragment:Pm,tonemapping_pars_fragment:Dm,transmission_fragment:Um,transmission_pars_fragment:Nm,uv_pars_fragment:Im,uv_pars_vertex:Fm,uv_vertex:Om,worldpos_vertex:zm,background_vert:Bm,background_frag:km,backgroundCube_vert:Vm,backgroundCube_frag:Hm,cube_vert:Gm,cube_frag:Wm,depth_vert:Xm,depth_frag:qm,distanceRGBA_vert:jm,distanceRGBA_frag:Ym,equirect_vert:$m,equirect_frag:Jm,linedashed_vert:Km,linedashed_frag:Zm,meshbasic_vert:Qm,meshbasic_frag:e1,meshlambert_vert:t1,meshlambert_frag:n1,meshmatcap_vert:i1,meshmatcap_frag:s1,meshnormal_vert:r1,meshnormal_frag:a1,meshphong_vert:o1,meshphong_frag:l1,meshphysical_vert:c1,meshphysical_frag:h1,meshtoon_vert:u1,meshtoon_frag:d1,points_vert:f1,points_frag:p1,shadow_vert:m1,shadow_frag:g1,sprite_vert:_1,sprite_frag:v1},We={common:{diffuse:{value:new xt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new It},alphaMap:{value:null},alphaMapTransform:{value:new It},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new It}},envmap:{envMap:{value:null},envMapRotation:{value:new It},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new It}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new It}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new It},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new It},normalScale:{value:new Qe(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new It},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new It}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new It}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new It}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new xt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new xt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new It},alphaTest:{value:0},uvTransform:{value:new It}},sprite:{diffuse:{value:new xt(16777215)},opacity:{value:1},center:{value:new Qe(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new It},alphaMap:{value:null},alphaMapTransform:{value:new It},alphaTest:{value:0}}},Un={basic:{uniforms:Cn([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.fog]),vertexShader:kt.meshbasic_vert,fragmentShader:kt.meshbasic_frag},lambert:{uniforms:Cn([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.fog,We.lights,{emissive:{value:new xt(0)}}]),vertexShader:kt.meshlambert_vert,fragmentShader:kt.meshlambert_frag},phong:{uniforms:Cn([We.common,We.specularmap,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.fog,We.lights,{emissive:{value:new xt(0)},specular:{value:new xt(1118481)},shininess:{value:30}}]),vertexShader:kt.meshphong_vert,fragmentShader:kt.meshphong_frag},standard:{uniforms:Cn([We.common,We.envmap,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.roughnessmap,We.metalnessmap,We.fog,We.lights,{emissive:{value:new xt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:kt.meshphysical_vert,fragmentShader:kt.meshphysical_frag},toon:{uniforms:Cn([We.common,We.aomap,We.lightmap,We.emissivemap,We.bumpmap,We.normalmap,We.displacementmap,We.gradientmap,We.fog,We.lights,{emissive:{value:new xt(0)}}]),vertexShader:kt.meshtoon_vert,fragmentShader:kt.meshtoon_frag},matcap:{uniforms:Cn([We.common,We.bumpmap,We.normalmap,We.displacementmap,We.fog,{matcap:{value:null}}]),vertexShader:kt.meshmatcap_vert,fragmentShader:kt.meshmatcap_frag},points:{uniforms:Cn([We.points,We.fog]),vertexShader:kt.points_vert,fragmentShader:kt.points_frag},dashed:{uniforms:Cn([We.common,We.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:kt.linedashed_vert,fragmentShader:kt.linedashed_frag},depth:{uniforms:Cn([We.common,We.displacementmap]),vertexShader:kt.depth_vert,fragmentShader:kt.depth_frag},normal:{uniforms:Cn([We.common,We.bumpmap,We.normalmap,We.displacementmap,{opacity:{value:1}}]),vertexShader:kt.meshnormal_vert,fragmentShader:kt.meshnormal_frag},sprite:{uniforms:Cn([We.sprite,We.fog]),vertexShader:kt.sprite_vert,fragmentShader:kt.sprite_frag},background:{uniforms:{uvTransform:{value:new It},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:kt.background_vert,fragmentShader:kt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new It}},vertexShader:kt.backgroundCube_vert,fragmentShader:kt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:kt.cube_vert,fragmentShader:kt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:kt.equirect_vert,fragmentShader:kt.equirect_frag},distanceRGBA:{uniforms:Cn([We.common,We.displacementmap,{referencePosition:{value:new F},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:kt.distanceRGBA_vert,fragmentShader:kt.distanceRGBA_frag},shadow:{uniforms:Cn([We.lights,We.fog,{color:{value:new xt(0)},opacity:{value:1}}]),vertexShader:kt.shadow_vert,fragmentShader:kt.shadow_frag}};Un.physical={uniforms:Cn([Un.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new It},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new It},clearcoatNormalScale:{value:new Qe(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new It},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new It},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new It},sheen:{value:0},sheenColor:{value:new xt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new It},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new It},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new It},transmissionSamplerSize:{value:new Qe},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new It},attenuationDistance:{value:0},attenuationColor:{value:new xt(0)},specularColor:{value:new xt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new It},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new It},anisotropyVector:{value:new Qe},anisotropyMap:{value:null},anisotropyMapTransform:{value:new It}}]),vertexShader:kt.meshphysical_vert,fragmentShader:kt.meshphysical_frag};const Gr={r:0,b:0,g:0},Xi=new Ln,x1=new Tt;function y1(s,e,t,n,i,r,a){const o=new xt(0);let l=r===!0?0:1,c,h,f=null,u=0,d=null;function m(A){let b=A.isScene===!0?A.background:null;return b&&b.isTexture&&(b=(A.backgroundBlurriness>0?t:e).get(b)),b}function _(A){let b=!1;const N=m(A);N===null?p(o,l):N&&N.isColor&&(p(N,1),b=!0);const C=s.xr.getEnvironmentBlendMode();C==="additive"?n.buffers.color.setClear(0,0,0,1,a):C==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,a),(s.autoClear||b)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),s.clear(s.autoClearColor,s.autoClearDepth,s.autoClearStencil))}function g(A,b){const N=m(b);N&&(N.isCubeTexture||N.mapping===Ma)?(h===void 0&&(h=new en(new Bi(1,1,1),new Si({name:"BackgroundCubeMaterial",uniforms:Ns(Un.backgroundCube.uniforms),vertexShader:Un.backgroundCube.vertexShader,fragmentShader:Un.backgroundCube.fragmentShader,side:Rn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(C,P,D){this.matrixWorld.copyPosition(D.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(h)),Xi.copy(b.backgroundRotation),Xi.x*=-1,Xi.y*=-1,Xi.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(Xi.y*=-1,Xi.z*=-1),h.material.uniforms.envMap.value=N,h.material.uniforms.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=b.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(x1.makeRotationFromEuler(Xi)),h.material.toneMapped=Wt.getTransfer(N.colorSpace)!==an,(f!==N||u!==N.version||d!==s.toneMapping)&&(h.material.needsUpdate=!0,f=N,u=N.version,d=s.toneMapping),h.layers.enableAll(),A.unshift(h,h.geometry,h.material,0,0,null)):N&&N.isTexture&&(c===void 0&&(c=new en(new hr(2,2),new Si({name:"BackgroundMaterial",uniforms:Ns(Un.background.uniforms),vertexShader:Un.background.vertexShader,fragmentShader:Un.background.fragmentShader,side:Xn,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=N,c.material.uniforms.backgroundIntensity.value=b.backgroundIntensity,c.material.toneMapped=Wt.getTransfer(N.colorSpace)!==an,N.matrixAutoUpdate===!0&&N.updateMatrix(),c.material.uniforms.uvTransform.value.copy(N.matrix),(f!==N||u!==N.version||d!==s.toneMapping)&&(c.material.needsUpdate=!0,f=N,u=N.version,d=s.toneMapping),c.layers.enableAll(),A.unshift(c,c.geometry,c.material,0,0,null))}function p(A,b){A.getRGB(Gr,lu(s)),n.buffers.color.setClear(Gr.r,Gr.g,Gr.b,b,a)}function S(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),c!==void 0&&(c.geometry.dispose(),c.material.dispose(),c=void 0)}return{getClearColor:function(){return o},setClearColor:function(A,b=1){o.set(A),l=b,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(A){l=A,p(o,l)},render:_,addToRenderList:g,dispose:S}}function M1(s,e){const t=s.getParameter(s.MAX_VERTEX_ATTRIBS),n={},i=u(null);let r=i,a=!1;function o(y,U,G,X,Z){let ie=!1;const H=f(X,G,U);r!==H&&(r=H,c(r.object)),ie=d(y,X,G,Z),ie&&m(y,X,G,Z),Z!==null&&e.update(Z,s.ELEMENT_ARRAY_BUFFER),(ie||a)&&(a=!1,b(y,U,G,X),Z!==null&&s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,e.get(Z).buffer))}function l(){return s.createVertexArray()}function c(y){return s.bindVertexArray(y)}function h(y){return s.deleteVertexArray(y)}function f(y,U,G){const X=G.wireframe===!0;let Z=n[y.id];Z===void 0&&(Z={},n[y.id]=Z);let ie=Z[U.id];ie===void 0&&(ie={},Z[U.id]=ie);let H=ie[X];return H===void 0&&(H=u(l()),ie[X]=H),H}function u(y){const U=[],G=[],X=[];for(let Z=0;Z<t;Z++)U[Z]=0,G[Z]=0,X[Z]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:G,attributeDivisors:X,object:y,attributes:{},index:null}}function d(y,U,G,X){const Z=r.attributes,ie=U.attributes;let H=0;const oe=G.getAttributes();for(const Y in oe)if(oe[Y].location>=0){const Me=Z[Y];let Ce=ie[Y];if(Ce===void 0&&(Y==="instanceMatrix"&&y.instanceMatrix&&(Ce=y.instanceMatrix),Y==="instanceColor"&&y.instanceColor&&(Ce=y.instanceColor)),Me===void 0||Me.attribute!==Ce||Ce&&Me.data!==Ce.data)return!0;H++}return r.attributesNum!==H||r.index!==X}function m(y,U,G,X){const Z={},ie=U.attributes;let H=0;const oe=G.getAttributes();for(const Y in oe)if(oe[Y].location>=0){let Me=ie[Y];Me===void 0&&(Y==="instanceMatrix"&&y.instanceMatrix&&(Me=y.instanceMatrix),Y==="instanceColor"&&y.instanceColor&&(Me=y.instanceColor));const Ce={};Ce.attribute=Me,Me&&Me.data&&(Ce.data=Me.data),Z[Y]=Ce,H++}r.attributes=Z,r.attributesNum=H,r.index=X}function _(){const y=r.newAttributes;for(let U=0,G=y.length;U<G;U++)y[U]=0}function g(y){p(y,0)}function p(y,U){const G=r.newAttributes,X=r.enabledAttributes,Z=r.attributeDivisors;G[y]=1,X[y]===0&&(s.enableVertexAttribArray(y),X[y]=1),Z[y]!==U&&(s.vertexAttribDivisor(y,U),Z[y]=U)}function S(){const y=r.newAttributes,U=r.enabledAttributes;for(let G=0,X=U.length;G<X;G++)U[G]!==y[G]&&(s.disableVertexAttribArray(G),U[G]=0)}function A(y,U,G,X,Z,ie,H){H===!0?s.vertexAttribIPointer(y,U,G,Z,ie):s.vertexAttribPointer(y,U,G,X,Z,ie)}function b(y,U,G,X){_();const Z=X.attributes,ie=G.getAttributes(),H=U.defaultAttributeValues;for(const oe in ie){const Y=ie[oe];if(Y.location>=0){let me=Z[oe];if(me===void 0&&(oe==="instanceMatrix"&&y.instanceMatrix&&(me=y.instanceMatrix),oe==="instanceColor"&&y.instanceColor&&(me=y.instanceColor)),me!==void 0){const Me=me.normalized,Ce=me.itemSize,Ye=e.get(me);if(Ye===void 0)continue;const Oe=Ye.buffer,K=Ye.type,te=Ye.bytesPerElement,re=K===s.INT||K===s.UNSIGNED_INT||me.gpuType===Ml;if(me.isInterleavedBufferAttribute){const ae=me.data,Ie=ae.stride,ge=me.offset;if(ae.isInstancedInterleavedBuffer){for(let Re=0;Re<Y.locationSize;Re++)p(Y.location+Re,ae.meshPerAttribute);y.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let Re=0;Re<Y.locationSize;Re++)g(Y.location+Re);s.bindBuffer(s.ARRAY_BUFFER,Oe);for(let Re=0;Re<Y.locationSize;Re++)A(Y.location+Re,Ce/Y.locationSize,K,Me,Ie*te,(ge+Ce/Y.locationSize*Re)*te,re)}else{if(me.isInstancedBufferAttribute){for(let ae=0;ae<Y.locationSize;ae++)p(Y.location+ae,me.meshPerAttribute);y.isInstancedMesh!==!0&&X._maxInstanceCount===void 0&&(X._maxInstanceCount=me.meshPerAttribute*me.count)}else for(let ae=0;ae<Y.locationSize;ae++)g(Y.location+ae);s.bindBuffer(s.ARRAY_BUFFER,Oe);for(let ae=0;ae<Y.locationSize;ae++)A(Y.location+ae,Ce/Y.locationSize,K,Me,Ce*te,Ce/Y.locationSize*ae*te,re)}}else if(H!==void 0){const Me=H[oe];if(Me!==void 0)switch(Me.length){case 2:s.vertexAttrib2fv(Y.location,Me);break;case 3:s.vertexAttrib3fv(Y.location,Me);break;case 4:s.vertexAttrib4fv(Y.location,Me);break;default:s.vertexAttrib1fv(Y.location,Me)}}}}S()}function N(){D();for(const y in n){const U=n[y];for(const G in U){const X=U[G];for(const Z in X)h(X[Z].object),delete X[Z];delete U[G]}delete n[y]}}function C(y){if(n[y.id]===void 0)return;const U=n[y.id];for(const G in U){const X=U[G];for(const Z in X)h(X[Z].object),delete X[Z];delete U[G]}delete n[y.id]}function P(y){for(const U in n){const G=n[U];if(G[y.id]===void 0)continue;const X=G[y.id];for(const Z in X)h(X[Z].object),delete X[Z];delete G[y.id]}}function D(){E(),a=!0,r!==i&&(r=i,c(r.object))}function E(){i.geometry=null,i.program=null,i.wireframe=!1}return{setup:o,reset:D,resetDefaultState:E,dispose:N,releaseStatesOfGeometry:C,releaseStatesOfProgram:P,initAttributes:_,enableAttribute:g,disableUnusedAttributes:S}}function b1(s,e,t){let n;function i(c){n=c}function r(c,h){s.drawArrays(n,c,h),t.update(h,n,1)}function a(c,h,f){f!==0&&(s.drawArraysInstanced(n,c,h,f),t.update(h,n,f))}function o(c,h,f){if(f===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,c,0,h,0,f);let d=0;for(let m=0;m<f;m++)d+=h[m];t.update(d,n,1)}function l(c,h,f,u){if(f===0)return;const d=e.get("WEBGL_multi_draw");if(d===null)for(let m=0;m<c.length;m++)a(c[m],h[m],u[m]);else{d.multiDrawArraysInstancedWEBGL(n,c,0,h,0,u,0,f);let m=0;for(let _=0;_<f;_++)m+=h[_]*u[_];t.update(m,n,1)}}this.setMode=i,this.render=r,this.renderInstances=a,this.renderMultiDraw=o,this.renderMultiDrawInstances=l}function S1(s,e,t,n){let i;function r(){if(i!==void 0)return i;if(e.has("EXT_texture_filter_anisotropic")===!0){const P=e.get("EXT_texture_filter_anisotropic");i=s.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else i=0;return i}function a(P){return!(P!==Wn&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(P){const D=P===cr&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(P!==ci&&n.convert(P)!==s.getParameter(s.IMPLEMENTATION_COLOR_READ_TYPE)&&P!==oi&&!D)}function l(P){if(P==="highp"){if(s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.HIGH_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT).precision>0)return"highp";P="mediump"}return P==="mediump"&&s.getShaderPrecisionFormat(s.VERTEX_SHADER,s.MEDIUM_FLOAT).precision>0&&s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let c=t.precision!==void 0?t.precision:"highp";const h=l(c);h!==c&&(console.warn("THREE.WebGLRenderer:",c,"not supported, using",h,"instead."),c=h);const f=t.logarithmicDepthBuffer===!0,u=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),d=s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS),m=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_=s.getParameter(s.MAX_TEXTURE_SIZE),g=s.getParameter(s.MAX_CUBE_MAP_TEXTURE_SIZE),p=s.getParameter(s.MAX_VERTEX_ATTRIBS),S=s.getParameter(s.MAX_VERTEX_UNIFORM_VECTORS),A=s.getParameter(s.MAX_VARYING_VECTORS),b=s.getParameter(s.MAX_FRAGMENT_UNIFORM_VECTORS),N=m>0,C=s.getParameter(s.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:r,getMaxPrecision:l,textureFormatReadable:a,textureTypeReadable:o,precision:c,logarithmicDepthBuffer:f,reverseDepthBuffer:u,maxTextures:d,maxVertexTextures:m,maxTextureSize:_,maxCubemapSize:g,maxAttributes:p,maxVertexUniforms:S,maxVaryings:A,maxFragmentUniforms:b,vertexTextures:N,maxSamples:C}}function E1(s){const e=this;let t=null,n=0,i=!1,r=!1;const a=new Ui,o=new It,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(f,u){const d=f.length!==0||u||n!==0||i;return i=u,n=f.length,d},this.beginShadows=function(){r=!0,h(null)},this.endShadows=function(){r=!1},this.setGlobalState=function(f,u){t=h(f,u,0)},this.setState=function(f,u,d){const m=f.clippingPlanes,_=f.clipIntersection,g=f.clipShadows,p=s.get(f);if(!i||m===null||m.length===0||r&&!g)r?h(null):c();else{const S=r?0:n,A=S*4;let b=p.clippingState||null;l.value=b,b=h(m,u,A,d);for(let N=0;N!==A;++N)b[N]=t[N];p.clippingState=b,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=S}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function h(f,u,d,m){const _=f!==null?f.length:0;let g=null;if(_!==0){if(g=l.value,m!==!0||g===null){const p=d+_*4,S=u.matrixWorldInverse;o.getNormalMatrix(S),(g===null||g.length<p)&&(g=new Float32Array(p));for(let A=0,b=d;A!==_;++A,b+=4)a.copy(f[A]).applyMatrix4(S,o),a.normal.toArray(g,b),g[b+3]=a.constant}l.value=g,l.needsUpdate=!0}return e.numPlanes=_,e.numIntersection=0,g}}function A1(s){let e=new WeakMap;function t(a,o){return o===Do?a.mapping=Ls:o===Uo&&(a.mapping=Ps),a}function n(a){if(a&&a.isTexture){const o=a.mapping;if(o===Do||o===Uo)if(e.has(a)){const l=e.get(a).texture;return t(l,a.mapping)}else{const l=a.image;if(l&&l.height>0){const c=new Vf(l.height);return c.fromEquirectangularTexture(s,a),e.set(a,c),a.addEventListener("dispose",i),t(c.texture,a.mapping)}else return null}}return a}function i(a){const o=a.target;o.removeEventListener("dispose",i);const l=e.get(o);l!==void 0&&(e.delete(o),l.dispose())}function r(){e=new WeakMap}return{get:n,dispose:r}}const Es=4,Yc=[.125,.215,.35,.446,.526,.582],Zi=20,co=new Ta,$c=new xt;let ho=null,uo=0,fo=0,po=!1;const $i=(1+Math.sqrt(5))/2,Ms=1/$i,Jc=[new F(-$i,Ms,0),new F($i,Ms,0),new F(-Ms,0,$i),new F(Ms,0,$i),new F(0,$i,-Ms),new F(0,$i,Ms),new F(-1,1,-1),new F(1,1,-1),new F(-1,1,1),new F(1,1,1)],w1=new F;class Kc{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100,r={}){const{size:a=256,position:o=w1}=r;ho=this._renderer.getRenderTarget(),uo=this._renderer.getActiveCubeFace(),fo=this._renderer.getActiveMipmapLevel(),po=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(a);const l=this._allocateTargets();return l.depthBuffer=!0,this._sceneToCubeUV(e,n,i,l,o),t>0&&this._blur(l,0,0,t),this._applyPMREM(l),this._cleanup(l),l}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=eh(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=Qc(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(ho,uo,fo),this._renderer.xr.enabled=po,e.scissorTest=!1,Wr(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Ls||e.mapping===Ps?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),ho=this._renderer.getRenderTarget(),uo=this._renderer.getActiveCubeFace(),fo=this._renderer.getActiveMipmapLevel(),po=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:Fn,minFilter:Fn,generateMipmaps:!1,type:cr,format:Wn,colorSpace:Ds,depthBuffer:!1},i=Zc(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=Zc(e,t,n);const{_lodMax:r}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=T1(r)),this._blurMaterial=C1(r,e,t)}return i}_compileMaterial(e){const t=new en(this._lodPlanes[0],e);this._renderer.compile(t,co)}_sceneToCubeUV(e,t,n,i,r){const l=new bn(90,1,t,n),c=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],f=this._renderer,u=f.autoClear,d=f.toneMapping;f.getClearColor($c),f.toneMapping=Oi,f.autoClear=!1;const m=new zi({name:"PMREM.Background",side:Rn,depthWrite:!1,depthTest:!1}),_=new en(new Bi,m);let g=!1;const p=e.background;p?p.isColor&&(m.color.copy(p),e.background=null,g=!0):(m.color.copy($c),g=!0);for(let S=0;S<6;S++){const A=S%3;A===0?(l.up.set(0,c[S],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x+h[S],r.y,r.z)):A===1?(l.up.set(0,0,c[S]),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y+h[S],r.z)):(l.up.set(0,c[S],0),l.position.set(r.x,r.y,r.z),l.lookAt(r.x,r.y,r.z+h[S]));const b=this._cubeSize;Wr(i,A*b,S>2?b:0,b,b),f.setRenderTarget(i),g&&f.render(_,l),f.render(e,l)}_.geometry.dispose(),_.material.dispose(),f.toneMapping=d,f.autoClear=u,e.background=p}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===Ls||e.mapping===Ps;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=eh()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=Qc());const r=i?this._cubemapMaterial:this._equirectMaterial,a=new en(this._lodPlanes[0],r),o=r.uniforms;o.envMap.value=e;const l=this._cubeSize;Wr(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(a,co)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const i=this._lodPlanes.length;for(let r=1;r<i;r++){const a=Math.sqrt(this._sigmas[r]*this._sigmas[r]-this._sigmas[r-1]*this._sigmas[r-1]),o=Jc[(i-r-1)%Jc.length];this._blur(e,r-1,r,a,o)}t.autoClear=n}_blur(e,t,n,i,r){const a=this._pingPongRenderTarget;this._halfBlur(e,a,t,n,i,"latitudinal",r),this._halfBlur(a,e,n,n,i,"longitudinal",r)}_halfBlur(e,t,n,i,r,a,o){const l=this._renderer,c=this._blurMaterial;a!=="latitudinal"&&a!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,f=new en(this._lodPlanes[i],c),u=c.uniforms,d=this._sizeLods[n]-1,m=isFinite(r)?Math.PI/(2*d):2*Math.PI/(2*Zi-1),_=r/m,g=isFinite(r)?1+Math.floor(h*_):Zi;g>Zi&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${g} samples when the maximum is set to ${Zi}`);const p=[];let S=0;for(let P=0;P<Zi;++P){const D=P/_,E=Math.exp(-D*D/2);p.push(E),P===0?S+=E:P<g&&(S+=2*E)}for(let P=0;P<p.length;P++)p[P]=p[P]/S;u.envMap.value=e.texture,u.samples.value=g,u.weights.value=p,u.latitudinal.value=a==="latitudinal",o&&(u.poleAxis.value=o);const{_lodMax:A}=this;u.dTheta.value=m,u.mipInt.value=A-n;const b=this._sizeLods[i],N=3*b*(i>A-Es?i-A+Es:0),C=4*(this._cubeSize-b);Wr(t,N,C,3*b,2*b),l.setRenderTarget(t),l.render(f,co)}}function T1(s){const e=[],t=[],n=[];let i=s;const r=s-Es+1+Yc.length;for(let a=0;a<r;a++){const o=Math.pow(2,i);t.push(o);let l=1/o;a>s-Es?l=Yc[a-s+Es-1]:a===0&&(l=0),n.push(l);const c=1/(o-2),h=-c,f=1+c,u=[h,h,f,h,f,f,h,h,f,f,h,f],d=6,m=6,_=3,g=2,p=1,S=new Float32Array(_*m*d),A=new Float32Array(g*m*d),b=new Float32Array(p*m*d);for(let C=0;C<d;C++){const P=C%3*2/3-1,D=C>2?0:-1,E=[P,D,0,P+2/3,D,0,P+2/3,D+1,0,P,D,0,P+2/3,D+1,0,P,D+1,0];S.set(E,_*m*C),A.set(u,g*m*C);const y=[C,C,C,C,C,C];b.set(y,p*m*C)}const N=new hn;N.setAttribute("position",new dn(S,_)),N.setAttribute("uv",new dn(A,g)),N.setAttribute("faceIndex",new dn(b,p)),e.push(N),i>Es&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function Zc(s,e,t){const n=new ts(s,e,t);return n.texture.mapping=Ma,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Wr(s,e,t,n,i){s.viewport.set(e,t,n,i),s.scissor.set(e,t,n,i)}function C1(s,e,t){const n=new Float32Array(Zi),i=new F(0,1,0);return new Si({name:"SphericalGaussianBlur",defines:{n:Zi,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${s}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:Hl(),fragmentShader:`
|
|
3575
3575
|
|
|
3576
3576
|
precision mediump float;
|
|
3577
3577
|
precision mediump int;
|
|
@@ -3631,7 +3631,7 @@ void main() {
|
|
|
3631
3631
|
}
|
|
3632
3632
|
|
|
3633
3633
|
}
|
|
3634
|
-
`,blending:Fi,depthTest:!1,depthWrite:!1})}function Qc(){return new
|
|
3634
|
+
`,blending:Fi,depthTest:!1,depthWrite:!1})}function Qc(){return new Si({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Hl(),fragmentShader:`
|
|
3635
3635
|
|
|
3636
3636
|
precision mediump float;
|
|
3637
3637
|
precision mediump int;
|
|
@@ -3650,7 +3650,7 @@ void main() {
|
|
|
3650
3650
|
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
|
|
3651
3651
|
|
|
3652
3652
|
}
|
|
3653
|
-
`,blending:Fi,depthTest:!1,depthWrite:!1})}function eh(){return new
|
|
3653
|
+
`,blending:Fi,depthTest:!1,depthWrite:!1})}function eh(){return new Si({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Hl(),fragmentShader:`
|
|
3654
3654
|
|
|
3655
3655
|
precision mediump float;
|
|
3656
3656
|
precision mediump int;
|
|
@@ -3721,17 +3721,17 @@ void main() {
|
|
|
3721
3721
|
gl_Position = vec4( position, 1.0 );
|
|
3722
3722
|
|
|
3723
3723
|
}
|
|
3724
|
-
`}function C1(s){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Do||l===Uo,h=l===Ls||l===Ps;if(c||h){let d=e.get(o);const u=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==u)return t===null&&(t=new Kc(s)),d=c?t.fromEquirectangular(o,d):t.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const f=o.image;return c&&f&&f.height>0||h&&f&&i(f)?(t===null&&(t=new Kc(s)),d=c?t.fromEquirectangular(o):t.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",r),d.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;h<c;h++)o[h]!==void 0&&l++;return l===c}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function R1(s){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=s.getExtension("WEBGL_depth_texture")||s.getExtension("MOZ_WEBGL_depth_texture")||s.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=s.getExtension("WEBGL_compressed_texture_s3tc")||s.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=s.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&ws("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function L1(s,e,t,n){const i={},r=new WeakMap;function a(d){const u=d.target;u.index!==null&&e.remove(u.index);for(const m in u.attributes)e.remove(u.attributes[m]);u.removeEventListener("dispose",a),delete i[u.id];const f=r.get(u);f&&(e.remove(f),r.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function o(d,u){return i[u.id]===!0||(u.addEventListener("dispose",a),i[u.id]=!0,t.memory.geometries++),u}function l(d){const u=d.attributes;for(const f in u)e.update(u[f],s.ARRAY_BUFFER)}function c(d){const u=[],f=d.index,m=d.attributes.position;let _=0;if(f!==null){const E=f.array;_=f.version;for(let b=0,M=E.length;b<M;b+=3){const U=E[b+0],R=E[b+1],P=E[b+2];u.push(U,R,R,P,P,U)}}else if(m!==void 0){const E=m.array;_=m.version;for(let b=0,M=E.length/3-1;b<M;b+=3){const U=b+0,R=b+1,P=b+2;u.push(U,R,R,P,P,U)}}else return;const g=new(iu(u)?ou:au)(u,1);g.version=_;const p=r.get(d);p&&e.remove(p),r.set(d,g)}function h(d){const u=r.get(d);if(u){const f=d.index;f!==null&&u.version<f.version&&c(d)}else c(d);return r.get(d)}return{get:o,update:l,getWireframeAttribute:h}}function P1(s,e,t){let n;function i(u){n=u}let r,a;function o(u){r=u.type,a=u.bytesPerElement}function l(u,f){s.drawElements(n,f,r,u*a),t.update(f,n,1)}function c(u,f,m){m!==0&&(s.drawElementsInstanced(n,f,r,u*a,m),t.update(f,n,m))}function h(u,f,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,f,0,r,u,0,m);let g=0;for(let p=0;p<m;p++)g+=f[p];t.update(g,n,1)}function d(u,f,m,_){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<u.length;p++)c(u[p]/a,f[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,f,0,r,u,0,_,0,m);let p=0;for(let E=0;E<m;E++)p+=f[E]*_[E];t.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function D1(s){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case s.TRIANGLES:t.triangles+=o*(r/3);break;case s.LINES:t.lines+=o*(r/2);break;case s.LINE_STRIP:t.lines+=o*(r-1);break;case s.LINE_LOOP:t.lines+=o*r;break;case s.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function U1(s,e,t){const n=new WeakMap,i=new Gt;function r(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,d=h!==void 0?h.length:0;let u=n.get(o);if(u===void 0||u.count!==d){let S=function(){P.dispose(),n.delete(o),o.removeEventListener("dispose",S)};u!==void 0&&u.texture.dispose();const f=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],E=o.morphAttributes.color||[];let b=0;f===!0&&(b=1),m===!0&&(b=2),_===!0&&(b=3);let M=o.attributes.position.count*b,U=1;M>e.maxTextureSize&&(U=Math.ceil(M/e.maxTextureSize),M=e.maxTextureSize);const R=new Float32Array(M*U*4*d),P=new su(R,M,U,d);P.type=oi,P.needsUpdate=!0;const D=b*4;for(let y=0;y<d;y++){const N=g[y],W=p[y],X=E[y],Q=M*U*4*y;for(let ne=0;ne<N.count;ne++){const H=ne*D;f===!0&&(i.fromBufferAttribute(N,ne),R[Q+H+0]=i.x,R[Q+H+1]=i.y,R[Q+H+2]=i.z,R[Q+H+3]=0),m===!0&&(i.fromBufferAttribute(W,ne),R[Q+H+4]=i.x,R[Q+H+5]=i.y,R[Q+H+6]=i.z,R[Q+H+7]=0),_===!0&&(i.fromBufferAttribute(X,ne),R[Q+H+8]=i.x,R[Q+H+9]=i.y,R[Q+H+10]=i.z,R[Q+H+11]=X.itemSize===4?i.w:1)}}u={count:d,texture:P,size:new Qe(M,U)},n.set(o,u),o.addEventListener("dispose",S)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(s,"morphTexture",a.morphTexture,t);else{let f=0;for(let _=0;_<c.length;_++)f+=c[_];const m=o.morphTargetsRelative?1:1-f;l.getUniforms().setValue(s,"morphTargetBaseInfluence",m),l.getUniforms().setValue(s,"morphTargetInfluences",c)}l.getUniforms().setValue(s,"morphTargetsTexture",u.texture,t),l.getUniforms().setValue(s,"morphTargetsTextureSize",u.size)}return{update:r}}function N1(s,e,t,n){let i=new WeakMap;function r(l){const c=n.render.frame,h=l.geometry,d=e.get(l,h);if(i.get(d)!==c&&(e.update(d),i.set(d,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(t.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,s.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const u=l.skeleton;i.get(u)!==c&&(u.update(),i.set(u,c))}return d}function a(){i=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:r,dispose:a}}const Ru=new bn,th=new gu(1,1),Lu=new su,Pu=new bf,Du=new hu,nh=[],ih=[],sh=new Float32Array(16),rh=new Float32Array(9),ah=new Float32Array(4);function ks(s,e,t){const n=s[0];if(n<=0||n>0)return s;const i=e*t;let r=nh[i];if(r===void 0&&(r=new Float32Array(i),nh[i]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,s[a].toArray(r,o)}return r}function gn(s,e){if(s.length!==e.length)return!1;for(let t=0,n=s.length;t<n;t++)if(s[t]!==e[t])return!1;return!0}function _n(s,e){for(let t=0,n=e.length;t<n;t++)s[t]=e[t]}function Ca(s,e){let t=ih[e];t===void 0&&(t=new Int32Array(e),ih[e]=t);for(let n=0;n!==e;++n)t[n]=s.allocateTextureUnit();return t}function I1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1f(this.addr,e),t[0]=e)}function F1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(gn(t,e))return;s.uniform2fv(this.addr,e),_n(t,e)}}function O1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(s.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(gn(t,e))return;s.uniform3fv(this.addr,e),_n(t,e)}}function z1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(gn(t,e))return;s.uniform4fv(this.addr,e),_n(t,e)}}function B1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(gn(t,e))return;s.uniformMatrix2fv(this.addr,!1,e),_n(t,e)}else{if(gn(t,n))return;ah.set(n),s.uniformMatrix2fv(this.addr,!1,ah),_n(t,n)}}function k1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(gn(t,e))return;s.uniformMatrix3fv(this.addr,!1,e),_n(t,e)}else{if(gn(t,n))return;rh.set(n),s.uniformMatrix3fv(this.addr,!1,rh),_n(t,n)}}function V1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(gn(t,e))return;s.uniformMatrix4fv(this.addr,!1,e),_n(t,e)}else{if(gn(t,n))return;sh.set(n),s.uniformMatrix4fv(this.addr,!1,sh),_n(t,n)}}function H1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1i(this.addr,e),t[0]=e)}function G1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(gn(t,e))return;s.uniform2iv(this.addr,e),_n(t,e)}}function W1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(gn(t,e))return;s.uniform3iv(this.addr,e),_n(t,e)}}function X1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(gn(t,e))return;s.uniform4iv(this.addr,e),_n(t,e)}}function q1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1ui(this.addr,e),t[0]=e)}function j1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(gn(t,e))return;s.uniform2uiv(this.addr,e),_n(t,e)}}function Y1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(gn(t,e))return;s.uniform3uiv(this.addr,e),_n(t,e)}}function $1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(gn(t,e))return;s.uniform4uiv(this.addr,e),_n(t,e)}}function J1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?(th.compareFunction=nu,r=th):r=Ru,t.setTexture2D(e||r,i)}function K1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Pu,i)}function Z1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Du,i)}function Q1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Lu,i)}function e2(s){switch(s){case 5126:return I1;case 35664:return F1;case 35665:return O1;case 35666:return z1;case 35674:return B1;case 35675:return k1;case 35676:return V1;case 5124:case 35670:return H1;case 35667:case 35671:return G1;case 35668:case 35672:return W1;case 35669:case 35673:return X1;case 5125:return q1;case 36294:return j1;case 36295:return Y1;case 36296:return $1;case 35678:case 36198:case 36298:case 36306:case 35682:return J1;case 35679:case 36299:case 36307:return K1;case 35680:case 36300:case 36308:case 36293:return Z1;case 36289:case 36303:case 36311:case 36292:return Q1}}function t2(s,e){s.uniform1fv(this.addr,e)}function n2(s,e){const t=ks(e,this.size,2);s.uniform2fv(this.addr,t)}function i2(s,e){const t=ks(e,this.size,3);s.uniform3fv(this.addr,t)}function s2(s,e){const t=ks(e,this.size,4);s.uniform4fv(this.addr,t)}function r2(s,e){const t=ks(e,this.size,4);s.uniformMatrix2fv(this.addr,!1,t)}function a2(s,e){const t=ks(e,this.size,9);s.uniformMatrix3fv(this.addr,!1,t)}function o2(s,e){const t=ks(e,this.size,16);s.uniformMatrix4fv(this.addr,!1,t)}function l2(s,e){s.uniform1iv(this.addr,e)}function c2(s,e){s.uniform2iv(this.addr,e)}function h2(s,e){s.uniform3iv(this.addr,e)}function u2(s,e){s.uniform4iv(this.addr,e)}function d2(s,e){s.uniform1uiv(this.addr,e)}function f2(s,e){s.uniform2uiv(this.addr,e)}function p2(s,e){s.uniform3uiv(this.addr,e)}function m2(s,e){s.uniform4uiv(this.addr,e)}function g2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Ru,r[a])}function _2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Pu,r[a])}function v2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Du,r[a])}function x2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Lu,r[a])}function y2(s){switch(s){case 5126:return t2;case 35664:return n2;case 35665:return i2;case 35666:return s2;case 35674:return r2;case 35675:return a2;case 35676:return o2;case 5124:case 35670:return l2;case 35667:case 35671:return c2;case 35668:case 35672:return h2;case 35669:case 35673:return u2;case 5125:return d2;case 36294:return f2;case 36295:return p2;case 36296:return m2;case 35678:case 36198:case 36298:case 36306:case 35682:return g2;case 35679:case 36299:case 36307:return _2;case 35680:case 36300:case 36308:case 36293:return v2;case 36289:case 36303:case 36311:case 36292:return x2}}class M2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=e2(t.type)}}class S2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=y2(t.type)}}class b2{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(e,t[o.id],n)}}}const mo=/(\w+)(\])?(\[|\.)?/g;function oh(s,e){s.seq.push(e),s.map[e.id]=e}function E2(s,e,t){const n=s.name,i=n.length;for(mo.lastIndex=0;;){const r=mo.exec(n),a=mo.lastIndex;let o=r[1];const l=r[2]==="]",c=r[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){oh(t,c===void 0?new M2(o,s,e):new S2(o,s,e));break}else{let d=t.map[o];d===void 0&&(d=new b2(o),oh(t,d)),t=d}}}class aa{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const r=e.getActiveUniform(t,i),a=e.getUniformLocation(t,r.name);E2(r,a,this)}}setValue(e,t,n,i){const r=this.map[t];r!==void 0&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const o=t[r],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function lh(s,e,t){const n=s.createShader(e);return s.shaderSource(n,t),s.compileShader(n),n}const A2=37297;let w2=0;function T2(s,e){const t=s.split(`
|
|
3724
|
+
`}function R1(s){let e=new WeakMap,t=null;function n(o){if(o&&o.isTexture){const l=o.mapping,c=l===Do||l===Uo,h=l===Ls||l===Ps;if(c||h){let f=e.get(o);const u=f!==void 0?f.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==u)return t===null&&(t=new Kc(s)),f=c?t.fromEquirectangular(o,f):t.fromCubemap(o,f),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),f.texture;if(f!==void 0)return f.texture;{const d=o.image;return c&&d&&d.height>0||h&&d&&i(d)?(t===null&&(t=new Kc(s)),f=c?t.fromEquirectangular(o):t.fromCubemap(o),f.texture.pmremVersion=o.pmremVersion,e.set(o,f),o.addEventListener("dispose",r),f.texture):null}}}return o}function i(o){let l=0;const c=6;for(let h=0;h<c;h++)o[h]!==void 0&&l++;return l===c}function r(o){const l=o.target;l.removeEventListener("dispose",r);const c=e.get(l);c!==void 0&&(e.delete(l),c.dispose())}function a(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:a}}function L1(s){const e={};function t(n){if(e[n]!==void 0)return e[n];let i;switch(n){case"WEBGL_depth_texture":i=s.getExtension("WEBGL_depth_texture")||s.getExtension("MOZ_WEBGL_depth_texture")||s.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=s.getExtension("EXT_texture_filter_anisotropic")||s.getExtension("MOZ_EXT_texture_filter_anisotropic")||s.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=s.getExtension("WEBGL_compressed_texture_s3tc")||s.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=s.getExtension("WEBGL_compressed_texture_pvrtc")||s.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=s.getExtension(n)}return e[n]=i,i}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const i=t(n);return i===null&&ws("THREE.WebGLRenderer: "+n+" extension not supported."),i}}}function P1(s,e,t,n){const i={},r=new WeakMap;function a(f){const u=f.target;u.index!==null&&e.remove(u.index);for(const m in u.attributes)e.remove(u.attributes[m]);u.removeEventListener("dispose",a),delete i[u.id];const d=r.get(u);d&&(e.remove(d),r.delete(u)),n.releaseStatesOfGeometry(u),u.isInstancedBufferGeometry===!0&&delete u._maxInstanceCount,t.memory.geometries--}function o(f,u){return i[u.id]===!0||(u.addEventListener("dispose",a),i[u.id]=!0,t.memory.geometries++),u}function l(f){const u=f.attributes;for(const d in u)e.update(u[d],s.ARRAY_BUFFER)}function c(f){const u=[],d=f.index,m=f.attributes.position;let _=0;if(d!==null){const S=d.array;_=d.version;for(let A=0,b=S.length;A<b;A+=3){const N=S[A+0],C=S[A+1],P=S[A+2];u.push(N,C,C,P,P,N)}}else if(m!==void 0){const S=m.array;_=m.version;for(let A=0,b=S.length/3-1;A<b;A+=3){const N=A+0,C=A+1,P=A+2;u.push(N,C,C,P,P,N)}}else return;const g=new(iu(u)?ou:au)(u,1);g.version=_;const p=r.get(f);p&&e.remove(p),r.set(f,g)}function h(f){const u=r.get(f);if(u){const d=f.index;d!==null&&u.version<d.version&&c(f)}else c(f);return r.get(f)}return{get:o,update:l,getWireframeAttribute:h}}function D1(s,e,t){let n;function i(u){n=u}let r,a;function o(u){r=u.type,a=u.bytesPerElement}function l(u,d){s.drawElements(n,d,r,u*a),t.update(d,n,1)}function c(u,d,m){m!==0&&(s.drawElementsInstanced(n,d,r,u*a,m),t.update(d,n,m))}function h(u,d,m){if(m===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,d,0,r,u,0,m);let g=0;for(let p=0;p<m;p++)g+=d[p];t.update(g,n,1)}function f(u,d,m,_){if(m===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let p=0;p<u.length;p++)c(u[p]/a,d[p],_[p]);else{g.multiDrawElementsInstancedWEBGL(n,d,0,r,u,0,_,0,m);let p=0;for(let S=0;S<m;S++)p+=d[S]*_[S];t.update(p,n,1)}}this.setMode=i,this.setIndex=o,this.render=l,this.renderInstances=c,this.renderMultiDraw=h,this.renderMultiDrawInstances=f}function U1(s){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(r,a,o){switch(t.calls++,a){case s.TRIANGLES:t.triangles+=o*(r/3);break;case s.LINES:t.lines+=o*(r/2);break;case s.LINE_STRIP:t.lines+=o*(r-1);break;case s.LINE_LOOP:t.lines+=o*r;break;case s.POINTS:t.points+=o*r;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",a);break}}function i(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:i,update:n}}function N1(s,e,t){const n=new WeakMap,i=new Xt;function r(a,o,l){const c=a.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,f=h!==void 0?h.length:0;let u=n.get(o);if(u===void 0||u.count!==f){let E=function(){P.dispose(),n.delete(o),o.removeEventListener("dispose",E)};u!==void 0&&u.texture.dispose();const d=o.morphAttributes.position!==void 0,m=o.morphAttributes.normal!==void 0,_=o.morphAttributes.color!==void 0,g=o.morphAttributes.position||[],p=o.morphAttributes.normal||[],S=o.morphAttributes.color||[];let A=0;d===!0&&(A=1),m===!0&&(A=2),_===!0&&(A=3);let b=o.attributes.position.count*A,N=1;b>e.maxTextureSize&&(N=Math.ceil(b/e.maxTextureSize),b=e.maxTextureSize);const C=new Float32Array(b*N*4*f),P=new su(C,b,N,f);P.type=oi,P.needsUpdate=!0;const D=A*4;for(let y=0;y<f;y++){const U=g[y],G=p[y],X=S[y],Z=b*N*4*y;for(let ie=0;ie<U.count;ie++){const H=ie*D;d===!0&&(i.fromBufferAttribute(U,ie),C[Z+H+0]=i.x,C[Z+H+1]=i.y,C[Z+H+2]=i.z,C[Z+H+3]=0),m===!0&&(i.fromBufferAttribute(G,ie),C[Z+H+4]=i.x,C[Z+H+5]=i.y,C[Z+H+6]=i.z,C[Z+H+7]=0),_===!0&&(i.fromBufferAttribute(X,ie),C[Z+H+8]=i.x,C[Z+H+9]=i.y,C[Z+H+10]=i.z,C[Z+H+11]=X.itemSize===4?i.w:1)}}u={count:f,texture:P,size:new Qe(b,N)},n.set(o,u),o.addEventListener("dispose",E)}if(a.isInstancedMesh===!0&&a.morphTexture!==null)l.getUniforms().setValue(s,"morphTexture",a.morphTexture,t);else{let d=0;for(let _=0;_<c.length;_++)d+=c[_];const m=o.morphTargetsRelative?1:1-d;l.getUniforms().setValue(s,"morphTargetBaseInfluence",m),l.getUniforms().setValue(s,"morphTargetInfluences",c)}l.getUniforms().setValue(s,"morphTargetsTexture",u.texture,t),l.getUniforms().setValue(s,"morphTargetsTextureSize",u.size)}return{update:r}}function I1(s,e,t,n){let i=new WeakMap;function r(l){const c=n.render.frame,h=l.geometry,f=e.get(l,h);if(i.get(f)!==c&&(e.update(f),i.set(f,c)),l.isInstancedMesh&&(l.hasEventListener("dispose",o)===!1&&l.addEventListener("dispose",o),i.get(l)!==c&&(t.update(l.instanceMatrix,s.ARRAY_BUFFER),l.instanceColor!==null&&t.update(l.instanceColor,s.ARRAY_BUFFER),i.set(l,c))),l.isSkinnedMesh){const u=l.skeleton;i.get(u)!==c&&(u.update(),i.set(u,c))}return f}function a(){i=new WeakMap}function o(l){const c=l.target;c.removeEventListener("dispose",o),t.remove(c.instanceMatrix),c.instanceColor!==null&&t.remove(c.instanceColor)}return{update:r,dispose:a}}const Ru=new Sn,th=new gu(1,1),Lu=new su,Pu=new Ef,Du=new hu,nh=[],ih=[],sh=new Float32Array(16),rh=new Float32Array(9),ah=new Float32Array(4);function ks(s,e,t){const n=s[0];if(n<=0||n>0)return s;const i=e*t;let r=nh[i];if(r===void 0&&(r=new Float32Array(i),nh[i]=r),e!==0){n.toArray(r,0);for(let a=1,o=0;a!==e;++a)o+=t,s[a].toArray(r,o)}return r}function gn(s,e){if(s.length!==e.length)return!1;for(let t=0,n=s.length;t<n;t++)if(s[t]!==e[t])return!1;return!0}function _n(s,e){for(let t=0,n=e.length;t<n;t++)s[t]=e[t]}function Ca(s,e){let t=ih[e];t===void 0&&(t=new Int32Array(e),ih[e]=t);for(let n=0;n!==e;++n)t[n]=s.allocateTextureUnit();return t}function F1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1f(this.addr,e),t[0]=e)}function O1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(gn(t,e))return;s.uniform2fv(this.addr,e),_n(t,e)}}function z1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(s.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(gn(t,e))return;s.uniform3fv(this.addr,e),_n(t,e)}}function B1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(gn(t,e))return;s.uniform4fv(this.addr,e),_n(t,e)}}function k1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(gn(t,e))return;s.uniformMatrix2fv(this.addr,!1,e),_n(t,e)}else{if(gn(t,n))return;ah.set(n),s.uniformMatrix2fv(this.addr,!1,ah),_n(t,n)}}function V1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(gn(t,e))return;s.uniformMatrix3fv(this.addr,!1,e),_n(t,e)}else{if(gn(t,n))return;rh.set(n),s.uniformMatrix3fv(this.addr,!1,rh),_n(t,n)}}function H1(s,e){const t=this.cache,n=e.elements;if(n===void 0){if(gn(t,e))return;s.uniformMatrix4fv(this.addr,!1,e),_n(t,e)}else{if(gn(t,n))return;sh.set(n),s.uniformMatrix4fv(this.addr,!1,sh),_n(t,n)}}function G1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1i(this.addr,e),t[0]=e)}function W1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(gn(t,e))return;s.uniform2iv(this.addr,e),_n(t,e)}}function X1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(gn(t,e))return;s.uniform3iv(this.addr,e),_n(t,e)}}function q1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(gn(t,e))return;s.uniform4iv(this.addr,e),_n(t,e)}}function j1(s,e){const t=this.cache;t[0]!==e&&(s.uniform1ui(this.addr,e),t[0]=e)}function Y1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(s.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(gn(t,e))return;s.uniform2uiv(this.addr,e),_n(t,e)}}function $1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(s.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(gn(t,e))return;s.uniform3uiv(this.addr,e),_n(t,e)}}function J1(s,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(s.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(gn(t,e))return;s.uniform4uiv(this.addr,e),_n(t,e)}}function K1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i);let r;this.type===s.SAMPLER_2D_SHADOW?(th.compareFunction=nu,r=th):r=Ru,t.setTexture2D(e||r,i)}function Z1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture3D(e||Pu,i)}function Q1(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTextureCube(e||Du,i)}function e2(s,e,t){const n=this.cache,i=t.allocateTextureUnit();n[0]!==i&&(s.uniform1i(this.addr,i),n[0]=i),t.setTexture2DArray(e||Lu,i)}function t2(s){switch(s){case 5126:return F1;case 35664:return O1;case 35665:return z1;case 35666:return B1;case 35674:return k1;case 35675:return V1;case 35676:return H1;case 5124:case 35670:return G1;case 35667:case 35671:return W1;case 35668:case 35672:return X1;case 35669:case 35673:return q1;case 5125:return j1;case 36294:return Y1;case 36295:return $1;case 36296:return J1;case 35678:case 36198:case 36298:case 36306:case 35682:return K1;case 35679:case 36299:case 36307:return Z1;case 35680:case 36300:case 36308:case 36293:return Q1;case 36289:case 36303:case 36311:case 36292:return e2}}function n2(s,e){s.uniform1fv(this.addr,e)}function i2(s,e){const t=ks(e,this.size,2);s.uniform2fv(this.addr,t)}function s2(s,e){const t=ks(e,this.size,3);s.uniform3fv(this.addr,t)}function r2(s,e){const t=ks(e,this.size,4);s.uniform4fv(this.addr,t)}function a2(s,e){const t=ks(e,this.size,4);s.uniformMatrix2fv(this.addr,!1,t)}function o2(s,e){const t=ks(e,this.size,9);s.uniformMatrix3fv(this.addr,!1,t)}function l2(s,e){const t=ks(e,this.size,16);s.uniformMatrix4fv(this.addr,!1,t)}function c2(s,e){s.uniform1iv(this.addr,e)}function h2(s,e){s.uniform2iv(this.addr,e)}function u2(s,e){s.uniform3iv(this.addr,e)}function d2(s,e){s.uniform4iv(this.addr,e)}function f2(s,e){s.uniform1uiv(this.addr,e)}function p2(s,e){s.uniform2uiv(this.addr,e)}function m2(s,e){s.uniform3uiv(this.addr,e)}function g2(s,e){s.uniform4uiv(this.addr,e)}function _2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTexture2D(e[a]||Ru,r[a])}function v2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTexture3D(e[a]||Pu,r[a])}function x2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTextureCube(e[a]||Du,r[a])}function y2(s,e,t){const n=this.cache,i=e.length,r=Ca(t,i);gn(n,r)||(s.uniform1iv(this.addr,r),_n(n,r));for(let a=0;a!==i;++a)t.setTexture2DArray(e[a]||Lu,r[a])}function M2(s){switch(s){case 5126:return n2;case 35664:return i2;case 35665:return s2;case 35666:return r2;case 35674:return a2;case 35675:return o2;case 35676:return l2;case 5124:case 35670:return c2;case 35667:case 35671:return h2;case 35668:case 35672:return u2;case 35669:case 35673:return d2;case 5125:return f2;case 36294:return p2;case 36295:return m2;case 36296:return g2;case 35678:case 36198:case 36298:case 36306:case 35682:return _2;case 35679:case 36299:case 36307:return v2;case 35680:case 36300:case 36308:case 36293:return x2;case 36289:case 36303:case 36311:case 36292:return y2}}class b2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=t2(t.type)}}class S2{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=M2(t.type)}}class E2{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const i=this.seq;for(let r=0,a=i.length;r!==a;++r){const o=i[r];o.setValue(e,t[o.id],n)}}}const mo=/(\w+)(\])?(\[|\.)?/g;function oh(s,e){s.seq.push(e),s.map[e.id]=e}function A2(s,e,t){const n=s.name,i=n.length;for(mo.lastIndex=0;;){const r=mo.exec(n),a=mo.lastIndex;let o=r[1];const l=r[2]==="]",c=r[3];if(l&&(o=o|0),c===void 0||c==="["&&a+2===i){oh(t,c===void 0?new b2(o,s,e):new S2(o,s,e));break}else{let f=t.map[o];f===void 0&&(f=new E2(o),oh(t,f)),t=f}}}class aa{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let i=0;i<n;++i){const r=e.getActiveUniform(t,i),a=e.getUniformLocation(t,r.name);A2(r,a,this)}}setValue(e,t,n,i){const r=this.map[t];r!==void 0&&r.setValue(e,n,i)}setOptional(e,t,n){const i=t[n];i!==void 0&&this.setValue(e,n,i)}static upload(e,t,n,i){for(let r=0,a=t.length;r!==a;++r){const o=t[r],l=n[o.id];l.needsUpdate!==!1&&o.setValue(e,l.value,i)}}static seqWithValue(e,t){const n=[];for(let i=0,r=e.length;i!==r;++i){const a=e[i];a.id in t&&n.push(a)}return n}}function lh(s,e,t){const n=s.createShader(e);return s.shaderSource(n,t),s.compileShader(n),n}const w2=37297;let T2=0;function C2(s,e){const t=s.split(`
|
|
3725
3725
|
`),n=[],i=Math.max(e-6,0),r=Math.min(e+6,t.length);for(let a=i;a<r;a++){const o=a+1;n.push(`${o===e?">":" "} ${o}: ${t[a]}`)}return n.join(`
|
|
3726
|
-
`)}const ch=new
|
|
3726
|
+
`)}const ch=new It;function R2(s){Wt._getMatrix(ch,Wt.workingColorSpace,s);const e=`mat3( ${ch.elements.map(t=>t.toFixed(4))} )`;switch(Wt.getTransfer(s)){case da:return[e,"LinearTransferOETF"];case an:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",s),[e,"LinearTransferOETF"]}}function hh(s,e,t){const n=s.getShaderParameter(e,s.COMPILE_STATUS),i=s.getShaderInfoLog(e).trim();if(n&&i==="")return"";const r=/ERROR: 0:(\d+)/.exec(i);if(r){const a=parseInt(r[1]);return t.toUpperCase()+`
|
|
3727
3727
|
|
|
3728
3728
|
`+i+`
|
|
3729
3729
|
|
|
3730
|
-
`+
|
|
3731
|
-
`)}function
|
|
3732
|
-
`)}function
|
|
3733
|
-
`)}function
|
|
3734
|
-
`)}function
|
|
3730
|
+
`+C2(s.getShaderSource(e),a)}else return i}function L2(s,e){const t=R2(e);return[`vec4 ${s}( vec4 value ) {`,` return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
|
|
3731
|
+
`)}function P2(s,e){let t;switch(e){case Ud:t="Linear";break;case Nd:t="Reinhard";break;case Id:t="Cineon";break;case qh:t="ACESFilmic";break;case Od:t="AgX";break;case zd:t="Neutral";break;case Fd:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+s+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const Xr=new F;function D2(){Wt.getLuminanceCoefficients(Xr);const s=Xr.x.toFixed(4),e=Xr.y.toFixed(4),t=Xr.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${s}, ${e}, ${t} );`," return dot( weights, rgb );","}"].join(`
|
|
3732
|
+
`)}function U2(s){return[s.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",s.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(Ks).join(`
|
|
3733
|
+
`)}function N2(s){const e=[];for(const t in s){const n=s[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
|
|
3734
|
+
`)}function I2(s,e){const t={},n=s.getProgramParameter(e,s.ACTIVE_ATTRIBUTES);for(let i=0;i<n;i++){const r=s.getActiveAttrib(e,i),a=r.name;let o=1;r.type===s.FLOAT_MAT2&&(o=2),r.type===s.FLOAT_MAT3&&(o=3),r.type===s.FLOAT_MAT4&&(o=4),t[a]={type:r.type,location:s.getAttribLocation(e,a),locationSize:o}}return t}function Ks(s){return s!==""}function uh(s,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return s.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function dh(s,e){return s.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const F2=/^[ \t]*#include +<([\w\d./]+)>/gm;function dl(s){return s.replace(F2,z2)}const O2=new Map;function z2(s,e){let t=kt[e];if(t===void 0){const n=O2.get(e);if(n!==void 0)t=kt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return dl(t)}const B2=/#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 fh(s){return s.replace(B2,k2)}function k2(s,e,t,n){let i="";for(let r=parseInt(e);r<parseInt(t);r++)i+=n.replace(/\[\s*i\s*\]/g,"[ "+r+" ]").replace(/UNROLLED_LOOP_INDEX/g,r);return i}function ph(s){let e=`precision ${s.precision} float;
|
|
3735
3735
|
precision ${s.precision} int;
|
|
3736
3736
|
precision ${s.precision} sampler2D;
|
|
3737
3737
|
precision ${s.precision} samplerCube;
|
|
@@ -3751,30 +3751,30 @@ void main() {
|
|
|
3751
3751
|
`;return s.precision==="highp"?e+=`
|
|
3752
3752
|
#define HIGH_PRECISION`:s.precision==="mediump"?e+=`
|
|
3753
3753
|
#define MEDIUM_PRECISION`:s.precision==="lowp"&&(e+=`
|
|
3754
|
-
#define LOW_PRECISION`),e}function
|
|
3754
|
+
#define LOW_PRECISION`),e}function V2(s){let e="SHADOWMAP_TYPE_BASIC";return s.shadowMapType===Wh?e="SHADOWMAP_TYPE_PCF":s.shadowMapType===Xh?e="SHADOWMAP_TYPE_PCF_SOFT":s.shadowMapType===vi&&(e="SHADOWMAP_TYPE_VSM"),e}function H2(s){let e="ENVMAP_TYPE_CUBE";if(s.envMap)switch(s.envMapMode){case Ls:case Ps:e="ENVMAP_TYPE_CUBE";break;case Ma:e="ENVMAP_TYPE_CUBE_UV";break}return e}function G2(s){let e="ENVMAP_MODE_REFLECTION";if(s.envMap)switch(s.envMapMode){case Ps:e="ENVMAP_MODE_REFRACTION";break}return e}function W2(s){let e="ENVMAP_BLENDING_NONE";if(s.envMap)switch(s.combine){case ya:e="ENVMAP_BLENDING_MULTIPLY";break;case Pd:e="ENVMAP_BLENDING_MIX";break;case Dd:e="ENVMAP_BLENDING_ADD";break}return e}function X2(s){const e=s.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),7*16)),texelHeight:n,maxMip:t}}function q2(s,e,t,n){const i=s.getContext(),r=t.defines;let a=t.vertexShader,o=t.fragmentShader;const l=V2(t),c=H2(t),h=G2(t),f=W2(t),u=X2(t),d=U2(t),m=N2(r),_=i.createProgram();let g,p,S=t.glslVersion?"#version "+t.glslVersion+`
|
|
3755
3755
|
`:"";t.isRawShaderMaterial?(g=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Ks).join(`
|
|
3756
3756
|
`),g.length>0&&(g+=`
|
|
3757
3757
|
`),p=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m].filter(Ks).join(`
|
|
3758
3758
|
`),p.length>0&&(p+=`
|
|
3759
3759
|
`)):(g=[ph(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+h:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#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","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
|
|
3760
3760
|
`].filter(Ks).join(`
|
|
3761
|
-
`),p=[ph(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",t.envMap?"#define "+
|
|
3761
|
+
`),p=[ph(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,m,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+h:"",t.envMap?"#define "+f:"",u?"#define CUBEUV_TEXEL_WIDTH "+u.texelWidth:"",u?"#define CUBEUV_TEXEL_HEIGHT "+u.texelHeight:"",u?"#define CUBEUV_MAX_MIP "+u.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==Oi?"#define TONE_MAPPING":"",t.toneMapping!==Oi?kt.tonemapping_pars_fragment:"",t.toneMapping!==Oi?P2("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",kt.colorspace_pars_fragment,L2("linearToOutputTexel",t.outputColorSpace),D2(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
|
|
3762
3762
|
`].filter(Ks).join(`
|
|
3763
|
-
`)),a=dl(a),a=uh(a,t),a=dh(a,t),o=dl(o),o=uh(o,t),o=dh(o,t),a=fh(a),o=fh(o),t.isRawShaderMaterial!==!0&&(
|
|
3764
|
-
`,g=[
|
|
3763
|
+
`)),a=dl(a),a=uh(a,t),a=dh(a,t),o=dl(o),o=uh(o,t),o=dh(o,t),a=fh(a),o=fh(o),t.isRawShaderMaterial!==!0&&(S=`#version 300 es
|
|
3764
|
+
`,g=[d,"#define attribute in","#define varying out","#define texture2D texture"].join(`
|
|
3765
3765
|
`)+`
|
|
3766
3766
|
`+g,p=["#define varying in",t.glslVersion===nc?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===nc?"":"#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(`
|
|
3767
3767
|
`)+`
|
|
3768
|
-
`+p);const
|
|
3768
|
+
`+p);const A=S+g+a,b=S+p+o,N=lh(i,i.VERTEX_SHADER,A),C=lh(i,i.FRAGMENT_SHADER,b);i.attachShader(_,N),i.attachShader(_,C),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_);function P(U){if(s.debug.checkShaderErrors){const G=i.getProgramInfoLog(_).trim(),X=i.getShaderInfoLog(N).trim(),Z=i.getShaderInfoLog(C).trim();let ie=!0,H=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(ie=!1,typeof s.debug.onShaderError=="function")s.debug.onShaderError(i,_,N,C);else{const oe=hh(i,N,"vertex"),Y=hh(i,C,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+`
|
|
3769
3769
|
|
|
3770
|
-
Material Name: `+
|
|
3771
|
-
Material Type: `+
|
|
3770
|
+
Material Name: `+U.name+`
|
|
3771
|
+
Material Type: `+U.type+`
|
|
3772
3772
|
|
|
3773
|
-
Program Info Log: `+
|
|
3774
|
-
`+
|
|
3775
|
-
`+Z)}else W!==""?console.warn("THREE.WebGLProgram: Program Info Log:",W):(X===""||Q==="")&&(H=!1);H&&(N.diagnostics={runnable:ne,programLog:W,vertexShader:{log:X,prefix:g},fragmentShader:{log:Q,prefix:p}})}i.deleteShader(U),i.deleteShader(R),D=new aa(i,_),S=N2(i,_)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let S;this.getAttributes=function(){return S===void 0&&P(this),S};let y=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(_,A2)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=w2++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=U,this.fragmentShader=R,this}let q2=0;class j2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new Y2(e),t.set(e,n)),n}}class Y2{constructor(e){this.id=q2++,this.code=e,this.usedTimes=0}}function $2(s,e,t,n,i,r,a){const o=new Rl,l=new j2,c=new Set,h=[],d=i.logarithmicDepthBuffer,u=i.vertexTextures;let f=i.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 _(S){return c.add(S),S===0?"uv":`uv${S}`}function g(S,y,N,W,X){const Q=W.fog,ne=X.geometry,H=S.isMeshStandardMaterial?W.environment:null,se=(S.isMeshStandardMaterial?t:e).get(S.envMap||H),Z=se&&se.mapping===Ma?se.image.height:null,pe=m[S.type];S.precision!==null&&(f=i.getMaxPrecision(S.precision),f!==S.precision&&console.warn("THREE.WebGLProgram.getParameters:",S.precision,"not supported, using",f,"instead."));const be=ne.morphAttributes.position||ne.morphAttributes.normal||ne.morphAttributes.color,Ce=be!==void 0?be.length:0;let Ie=0;ne.morphAttributes.position!==void 0&&(Ie=1),ne.morphAttributes.normal!==void 0&&(Ie=2),ne.morphAttributes.color!==void 0&&(Ie=3);let He,K,re,ae;if(pe){const te=Un[pe];He=te.vertexShader,K=te.fragmentShader}else He=S.vertexShader,K=S.fragmentShader,l.update(S),re=l.getVertexShaderID(S),ae=l.getFragmentShaderID(S);const le=s.getRenderTarget(),Le=s.state.buffers.depth.getReversed(),ge=X.isInstancedMesh===!0,Ae=X.isBatchedMesh===!0,lt=!!S.map,Et=!!S.matcap,Mt=!!se,z=!!S.aoMap,Wt=!!S.lightMap,Rt=!!S.bumpMap,At=!!S.normalMap,Ge=!!S.displacementMap,mt=!!S.emissiveMap,Xe=!!S.metalnessMap,gt=!!S.roughnessMap,on=S.anisotropy>0,O=S.clearcoat>0,w=S.dispersion>0,ee=S.iridescence>0,de=S.sheen>0,me=S.transmission>0,ce=on&&!!S.anisotropyMap,ct=O&&!!S.clearcoatMap,We=O&&!!S.clearcoatNormalMap,st=O&&!!S.clearcoatRoughnessMap,rt=ee&&!!S.iridescenceMap,xe=ee&&!!S.iridescenceThicknessMap,Ze=de&&!!S.sheenColorMap,ft=de&&!!S.sheenRoughnessMap,_t=!!S.specularMap,ke=!!S.specularColorMap,wt=!!S.specularIntensityMap,q=me&&!!S.transmissionMap,qe=me&&!!S.thicknessMap,ye=!!S.gradientMap,et=!!S.alphaMap,I=S.alphaTest>0,B=!!S.alphaHash,$=!!S.extensions;let oe=Oi;S.toneMapped&&(le===null||le.isXRRenderTarget===!0)&&(oe=s.toneMapping);const ue={shaderID:pe,shaderType:S.type,shaderName:S.name,vertexShader:He,fragmentShader:K,defines:S.defines,customVertexShaderID:re,customFragmentShaderID:ae,isRawShaderMaterial:S.isRawShaderMaterial===!0,glslVersion:S.glslVersion,precision:f,batching:Ae,batchingColor:Ae&&X._colorsTexture!==null,instancing:ge,instancingColor:ge&&X.instanceColor!==null,instancingMorph:ge&&X.morphTexture!==null,supportsVertexTextures:u,outputColorSpace:le===null?s.outputColorSpace:le.isXRRenderTarget===!0?le.texture.colorSpace:Ds,alphaToCoverage:!!S.alphaToCoverage,map:lt,matcap:Et,envMap:Mt,envMapMode:Mt&&se.mapping,envMapCubeUVHeight:Z,aoMap:z,lightMap:Wt,bumpMap:Rt,normalMap:At,displacementMap:u&&Ge,emissiveMap:mt,normalMapObjectSpace:At&&S.normalMapType===Gd,normalMapTangentSpace:At&&S.normalMapType===Sa,metalnessMap:Xe,roughnessMap:gt,anisotropy:on,anisotropyMap:ce,clearcoat:O,clearcoatMap:ct,clearcoatNormalMap:We,clearcoatRoughnessMap:st,dispersion:w,iridescence:ee,iridescenceMap:rt,iridescenceThicknessMap:xe,sheen:de,sheenColorMap:Ze,sheenRoughnessMap:ft,specularMap:_t,specularColorMap:ke,specularIntensityMap:wt,transmission:me,transmissionMap:q,thicknessMap:qe,gradientMap:ye,opaque:S.transparent===!1&&S.blending===As&&S.alphaToCoverage===!1,alphaMap:et,alphaTest:I,alphaHash:B,combine:S.combine,mapUv:lt&&_(S.map.channel),aoMapUv:z&&_(S.aoMap.channel),lightMapUv:Wt&&_(S.lightMap.channel),bumpMapUv:Rt&&_(S.bumpMap.channel),normalMapUv:At&&_(S.normalMap.channel),displacementMapUv:Ge&&_(S.displacementMap.channel),emissiveMapUv:mt&&_(S.emissiveMap.channel),metalnessMapUv:Xe&&_(S.metalnessMap.channel),roughnessMapUv:gt&&_(S.roughnessMap.channel),anisotropyMapUv:ce&&_(S.anisotropyMap.channel),clearcoatMapUv:ct&&_(S.clearcoatMap.channel),clearcoatNormalMapUv:We&&_(S.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:st&&_(S.clearcoatRoughnessMap.channel),iridescenceMapUv:rt&&_(S.iridescenceMap.channel),iridescenceThicknessMapUv:xe&&_(S.iridescenceThicknessMap.channel),sheenColorMapUv:Ze&&_(S.sheenColorMap.channel),sheenRoughnessMapUv:ft&&_(S.sheenRoughnessMap.channel),specularMapUv:_t&&_(S.specularMap.channel),specularColorMapUv:ke&&_(S.specularColorMap.channel),specularIntensityMapUv:wt&&_(S.specularIntensityMap.channel),transmissionMapUv:q&&_(S.transmissionMap.channel),thicknessMapUv:qe&&_(S.thicknessMap.channel),alphaMapUv:et&&_(S.alphaMap.channel),vertexTangents:!!ne.attributes.tangent&&(At||on),vertexColors:S.vertexColors,vertexAlphas:S.vertexColors===!0&&!!ne.attributes.color&&ne.attributes.color.itemSize===4,pointsUvs:X.isPoints===!0&&!!ne.attributes.uv&&(lt||et),fog:!!Q,useFog:S.fog===!0,fogExp2:!!Q&&Q.isFogExp2,flatShading:S.flatShading===!0,sizeAttenuation:S.sizeAttenuation===!0,logarithmicDepthBuffer:d,reverseDepthBuffer:Le,skinning:X.isSkinnedMesh===!0,morphTargets:ne.morphAttributes.position!==void 0,morphNormals:ne.morphAttributes.normal!==void 0,morphColors:ne.morphAttributes.color!==void 0,morphTargetsCount:Ce,morphTextureStride:Ie,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:S.dithering,shadowMapEnabled:s.shadowMap.enabled&&N.length>0,shadowMapType:s.shadowMap.type,toneMapping:oe,decodeVideoTexture:lt&&S.map.isVideoTexture===!0&&kt.getTransfer(S.map.colorSpace)===rn,decodeVideoTextureEmissive:mt&&S.emissiveMap.isVideoTexture===!0&&kt.getTransfer(S.emissiveMap.colorSpace)===rn,premultipliedAlpha:S.premultipliedAlpha,doubleSided:S.side===wn,flipSided:S.side===Rn,useDepthPacking:S.depthPacking>=0,depthPacking:S.depthPacking||0,index0AttributeName:S.index0AttributeName,extensionClipCullDistance:$&&S.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:($&&S.extensions.multiDraw===!0||Ae)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:S.customProgramCacheKey()};return ue.vertexUv1s=c.has(1),ue.vertexUv2s=c.has(2),ue.vertexUv3s=c.has(3),c.clear(),ue}function p(S){const y=[];if(S.shaderID?y.push(S.shaderID):(y.push(S.customVertexShaderID),y.push(S.customFragmentShaderID)),S.defines!==void 0)for(const N in S.defines)y.push(N),y.push(S.defines[N]);return S.isRawShaderMaterial===!1&&(E(y,S),b(y,S),y.push(s.outputColorSpace)),y.push(S.customProgramCacheKey),y.join()}function E(S,y){S.push(y.precision),S.push(y.outputColorSpace),S.push(y.envMapMode),S.push(y.envMapCubeUVHeight),S.push(y.mapUv),S.push(y.alphaMapUv),S.push(y.lightMapUv),S.push(y.aoMapUv),S.push(y.bumpMapUv),S.push(y.normalMapUv),S.push(y.displacementMapUv),S.push(y.emissiveMapUv),S.push(y.metalnessMapUv),S.push(y.roughnessMapUv),S.push(y.anisotropyMapUv),S.push(y.clearcoatMapUv),S.push(y.clearcoatNormalMapUv),S.push(y.clearcoatRoughnessMapUv),S.push(y.iridescenceMapUv),S.push(y.iridescenceThicknessMapUv),S.push(y.sheenColorMapUv),S.push(y.sheenRoughnessMapUv),S.push(y.specularMapUv),S.push(y.specularColorMapUv),S.push(y.specularIntensityMapUv),S.push(y.transmissionMapUv),S.push(y.thicknessMapUv),S.push(y.combine),S.push(y.fogExp2),S.push(y.sizeAttenuation),S.push(y.morphTargetsCount),S.push(y.morphAttributeCount),S.push(y.numDirLights),S.push(y.numPointLights),S.push(y.numSpotLights),S.push(y.numSpotLightMaps),S.push(y.numHemiLights),S.push(y.numRectAreaLights),S.push(y.numDirLightShadows),S.push(y.numPointLightShadows),S.push(y.numSpotLightShadows),S.push(y.numSpotLightShadowsWithMaps),S.push(y.numLightProbes),S.push(y.shadowMapType),S.push(y.toneMapping),S.push(y.numClippingPlanes),S.push(y.numClipIntersection),S.push(y.depthPacking)}function b(S,y){o.disableAll(),y.supportsVertexTextures&&o.enable(0),y.instancing&&o.enable(1),y.instancingColor&&o.enable(2),y.instancingMorph&&o.enable(3),y.matcap&&o.enable(4),y.envMap&&o.enable(5),y.normalMapObjectSpace&&o.enable(6),y.normalMapTangentSpace&&o.enable(7),y.clearcoat&&o.enable(8),y.iridescence&&o.enable(9),y.alphaTest&&o.enable(10),y.vertexColors&&o.enable(11),y.vertexAlphas&&o.enable(12),y.vertexUv1s&&o.enable(13),y.vertexUv2s&&o.enable(14),y.vertexUv3s&&o.enable(15),y.vertexTangents&&o.enable(16),y.anisotropy&&o.enable(17),y.alphaHash&&o.enable(18),y.batching&&o.enable(19),y.dispersion&&o.enable(20),y.batchingColor&&o.enable(21),S.push(o.mask),o.disableAll(),y.fog&&o.enable(0),y.useFog&&o.enable(1),y.flatShading&&o.enable(2),y.logarithmicDepthBuffer&&o.enable(3),y.reverseDepthBuffer&&o.enable(4),y.skinning&&o.enable(5),y.morphTargets&&o.enable(6),y.morphNormals&&o.enable(7),y.morphColors&&o.enable(8),y.premultipliedAlpha&&o.enable(9),y.shadowMapEnabled&&o.enable(10),y.doubleSided&&o.enable(11),y.flipSided&&o.enable(12),y.useDepthPacking&&o.enable(13),y.dithering&&o.enable(14),y.transmission&&o.enable(15),y.sheen&&o.enable(16),y.opaque&&o.enable(17),y.pointsUvs&&o.enable(18),y.decodeVideoTexture&&o.enable(19),y.decodeVideoTextureEmissive&&o.enable(20),y.alphaToCoverage&&o.enable(21),S.push(o.mask)}function M(S){const y=m[S.type];let N;if(y){const W=Un[y];N=Ll.clone(W.uniforms)}else N=S.uniforms;return N}function U(S,y){let N;for(let W=0,X=h.length;W<X;W++){const Q=h[W];if(Q.cacheKey===y){N=Q,++N.usedTimes;break}}return N===void 0&&(N=new X2(s,y,S,r),h.push(N)),N}function R(S){if(--S.usedTimes===0){const y=h.indexOf(S);h[y]=h[h.length-1],h.pop(),S.destroy()}}function P(S){l.remove(S)}function D(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:M,acquireProgram:U,releaseProgram:R,releaseShaderCache:P,programs:h,dispose:D}}function J2(){let s=new WeakMap;function e(a){return s.has(a)}function t(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,l){s.get(a)[o]=l}function r(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:r}}function K2(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function mh(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function gh(){const s=[];let e=0;const t=[],n=[],i=[];function r(){e=0,t.length=0,n.length=0,i.length=0}function a(d,u,f,m,_,g){let p=s[e];return p===void 0?(p={id:d.id,object:d,geometry:u,material:f,groupOrder:m,renderOrder:d.renderOrder,z:_,group:g},s[e]=p):(p.id=d.id,p.object=d,p.geometry=u,p.material=f,p.groupOrder=m,p.renderOrder=d.renderOrder,p.z=_,p.group=g),e++,p}function o(d,u,f,m,_,g){const p=a(d,u,f,m,_,g);f.transmission>0?n.push(p):f.transparent===!0?i.push(p):t.push(p)}function l(d,u,f,m,_,g){const p=a(d,u,f,m,_,g);f.transmission>0?n.unshift(p):f.transparent===!0?i.unshift(p):t.unshift(p)}function c(d,u){t.length>1&&t.sort(d||K2),n.length>1&&n.sort(u||mh),i.length>1&&i.sort(u||mh)}function h(){for(let d=e,u=s.length;d<u;d++){const f=s[d];if(f.id===null)break;f.id=null,f.object=null,f.geometry=null,f.material=null,f.group=null}}return{opaque:t,transmissive:n,transparent:i,init:r,push:o,unshift:l,finish:h,sort:c}}function Z2(){let s=new WeakMap;function e(n,i){const r=s.get(n);let a;return r===void 0?(a=new gh,s.set(n,[a])):i>=r.length?(a=new gh,r.push(a)):a=r[i],a}function t(){s=new WeakMap}return{get:e,dispose:t}}function Q2(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new vt};break;case"SpotLight":t={position:new F,direction:new F,color:new vt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new vt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new vt,groundColor:new vt};break;case"RectAreaLight":t={color:new vt,position:new F,halfWidth:new F,halfHeight:new F};break}return s[e.id]=t,t}}}function eg(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let tg=0;function ng(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function ig(s){const e=new Q2,t=eg(),n={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 c=0;c<9;c++)n.probe.push(new F);const i=new F,r=new bt,a=new bt;function o(c){let h=0,d=0,u=0;for(let S=0;S<9;S++)n.probe[S].set(0,0,0);let f=0,m=0,_=0,g=0,p=0,E=0,b=0,M=0,U=0,R=0,P=0;c.sort(ng);for(let S=0,y=c.length;S<y;S++){const N=c[S],W=N.color,X=N.intensity,Q=N.distance,ne=N.shadow&&N.shadow.map?N.shadow.map.texture:null;if(N.isAmbientLight)h+=W.r*X,d+=W.g*X,u+=W.b*X;else if(N.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(N.sh.coefficients[H],X);P++}else if(N.isDirectionalLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity),N.castShadow){const se=N.shadow,Z=t.get(N);Z.shadowIntensity=se.intensity,Z.shadowBias=se.bias,Z.shadowNormalBias=se.normalBias,Z.shadowRadius=se.radius,Z.shadowMapSize=se.mapSize,n.directionalShadow[f]=Z,n.directionalShadowMap[f]=ne,n.directionalShadowMatrix[f]=N.shadow.matrix,E++}n.directional[f]=H,f++}else if(N.isSpotLight){const H=e.get(N);H.position.setFromMatrixPosition(N.matrixWorld),H.color.copy(W).multiplyScalar(X),H.distance=Q,H.coneCos=Math.cos(N.angle),H.penumbraCos=Math.cos(N.angle*(1-N.penumbra)),H.decay=N.decay,n.spot[_]=H;const se=N.shadow;if(N.map&&(n.spotLightMap[U]=N.map,U++,se.updateMatrices(N),N.castShadow&&R++),n.spotLightMatrix[_]=se.matrix,N.castShadow){const Z=t.get(N);Z.shadowIntensity=se.intensity,Z.shadowBias=se.bias,Z.shadowNormalBias=se.normalBias,Z.shadowRadius=se.radius,Z.shadowMapSize=se.mapSize,n.spotShadow[_]=Z,n.spotShadowMap[_]=ne,M++}_++}else if(N.isRectAreaLight){const H=e.get(N);H.color.copy(W).multiplyScalar(X),H.halfWidth.set(N.width*.5,0,0),H.halfHeight.set(0,N.height*.5,0),n.rectArea[g]=H,g++}else if(N.isPointLight){const H=e.get(N);if(H.color.copy(N.color).multiplyScalar(N.intensity),H.distance=N.distance,H.decay=N.decay,N.castShadow){const se=N.shadow,Z=t.get(N);Z.shadowIntensity=se.intensity,Z.shadowBias=se.bias,Z.shadowNormalBias=se.normalBias,Z.shadowRadius=se.radius,Z.shadowMapSize=se.mapSize,Z.shadowCameraNear=se.camera.near,Z.shadowCameraFar=se.camera.far,n.pointShadow[m]=Z,n.pointShadowMap[m]=ne,n.pointShadowMatrix[m]=N.shadow.matrix,b++}n.point[m]=H,m++}else if(N.isHemisphereLight){const H=e.get(N);H.skyColor.copy(N.color).multiplyScalar(X),H.groundColor.copy(N.groundColor).multiplyScalar(X),n.hemi[p]=H,p++}}g>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=Ve.LTC_FLOAT_1,n.rectAreaLTC2=Ve.LTC_FLOAT_2):(n.rectAreaLTC1=Ve.LTC_HALF_1,n.rectAreaLTC2=Ve.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=d,n.ambient[2]=u;const D=n.hash;(D.directionalLength!==f||D.pointLength!==m||D.spotLength!==_||D.rectAreaLength!==g||D.hemiLength!==p||D.numDirectionalShadows!==E||D.numPointShadows!==b||D.numSpotShadows!==M||D.numSpotMaps!==U||D.numLightProbes!==P)&&(n.directional.length=f,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=E,n.directionalShadowMap.length=E,n.pointShadow.length=b,n.pointShadowMap.length=b,n.spotShadow.length=M,n.spotShadowMap.length=M,n.directionalShadowMatrix.length=E,n.pointShadowMatrix.length=b,n.spotLightMatrix.length=M+U-R,n.spotLightMap.length=U,n.numSpotLightShadowsWithMaps=R,n.numLightProbes=P,D.directionalLength=f,D.pointLength=m,D.spotLength=_,D.rectAreaLength=g,D.hemiLength=p,D.numDirectionalShadows=E,D.numPointShadows=b,D.numSpotShadows=M,D.numSpotMaps=U,D.numLightProbes=P,n.version=tg++)}function l(c,h){let d=0,u=0,f=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,E=c.length;p<E;p++){const b=c[p];if(b.isDirectionalLight){const M=n.directional[d];M.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(g),d++}else if(b.isSpotLight){const M=n.spot[f];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),M.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),M.direction.sub(i),M.direction.transformDirection(g),f++}else if(b.isRectAreaLight){const M=n.rectArea[m];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),a.identity(),r.copy(b.matrixWorld),r.premultiply(g),a.extractRotation(r),M.halfWidth.set(b.width*.5,0,0),M.halfHeight.set(0,b.height*.5,0),M.halfWidth.applyMatrix4(a),M.halfHeight.applyMatrix4(a),m++}else if(b.isPointLight){const M=n.point[u];M.position.setFromMatrixPosition(b.matrixWorld),M.position.applyMatrix4(g),u++}else if(b.isHemisphereLight){const M=n.hemi[_];M.direction.setFromMatrixPosition(b.matrixWorld),M.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function _h(s){const e=new ig(s),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function l(h){e.setupView(t,h)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:r,pushShadow:a}}function sg(s){let e=new WeakMap;function t(i,r=0){const a=e.get(i);let o;return a===void 0?(o=new _h(s),e.set(i,[o])):r>=a.length?(o=new _h(s),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const rg=`void main() {
|
|
3773
|
+
Program Info Log: `+G+`
|
|
3774
|
+
`+oe+`
|
|
3775
|
+
`+Y)}else G!==""?console.warn("THREE.WebGLProgram: Program Info Log:",G):(X===""||Z==="")&&(H=!1);H&&(U.diagnostics={runnable:ie,programLog:G,vertexShader:{log:X,prefix:g},fragmentShader:{log:Z,prefix:p}})}i.deleteShader(N),i.deleteShader(C),D=new aa(i,_),E=I2(i,_)}let D;this.getUniforms=function(){return D===void 0&&P(this),D};let E;this.getAttributes=function(){return E===void 0&&P(this),E};let y=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return y===!1&&(y=i.getProgramParameter(_,w2)),y},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=T2++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=N,this.fragmentShader=C,this}let j2=0;class Y2{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),r=this._getShaderStage(n),a=this._getShaderCacheForMaterial(e);return a.has(i)===!1&&(a.add(i),i.usedTimes++),a.has(r)===!1&&(a.add(r),r.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new $2(e),t.set(e,n)),n}}class $2{constructor(e){this.id=j2++,this.code=e,this.usedTimes=0}}function J2(s,e,t,n,i,r,a){const o=new Rl,l=new Y2,c=new Set,h=[],f=i.logarithmicDepthBuffer,u=i.vertexTextures;let d=i.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 _(E){return c.add(E),E===0?"uv":`uv${E}`}function g(E,y,U,G,X){const Z=G.fog,ie=X.geometry,H=E.isMeshStandardMaterial?G.environment:null,oe=(E.isMeshStandardMaterial?t:e).get(E.envMap||H),Y=oe&&oe.mapping===Ma?oe.image.height:null,me=m[E.type];E.precision!==null&&(d=i.getMaxPrecision(E.precision),d!==E.precision&&console.warn("THREE.WebGLProgram.getParameters:",E.precision,"not supported, using",d,"instead."));const Me=ie.morphAttributes.position||ie.morphAttributes.normal||ie.morphAttributes.color,Ce=Me!==void 0?Me.length:0;let Ye=0;ie.morphAttributes.position!==void 0&&(Ye=1),ie.morphAttributes.normal!==void 0&&(Ye=2),ie.morphAttributes.color!==void 0&&(Ye=3);let Oe,K,te,re;if(me){const se=Un[me];Oe=se.vertexShader,K=se.fragmentShader}else Oe=E.vertexShader,K=E.fragmentShader,l.update(E),te=l.getVertexShaderID(E),re=l.getFragmentShaderID(E);const ae=s.getRenderTarget(),Ie=s.state.buffers.depth.getReversed(),ge=X.isInstancedMesh===!0,Re=X.isBatchedMesh===!0,nt=!!E.map,yt=!!E.matcap,At=!!oe,z=!!E.aoMap,Ot=!!E.lightMap,Pt=!!E.bumpMap,Ct=!!E.normalMap,Xe=!!E.displacementMap,gt=!!E.emissiveMap,je=!!E.metalnessMap,_t=!!E.roughnessMap,ln=E.anisotropy>0,O=E.clearcoat>0,w=E.dispersion>0,ee=E.iridescence>0,de=E.sheen>0,_e=E.transmission>0,le=ln&&!!E.anisotropyMap,lt=O&&!!E.clearcoatMap,He=O&&!!E.clearcoatNormalMap,st=O&&!!E.clearcoatRoughnessMap,ot=ee&&!!E.iridescenceMap,ve=ee&&!!E.iridescenceThicknessMap,Ze=de&&!!E.sheenColorMap,Mt=de&&!!E.sheenRoughnessMap,ft=!!E.specularMap,Ge=!!E.specularColorMap,Rt=!!E.specularIntensityMap,q=_e&&!!E.transmissionMap,qe=_e&&!!E.thicknessMap,ye=!!E.gradientMap,et=!!E.alphaMap,Ae=E.alphaTest>0,I=!!E.alphaHash,k=!!E.extensions;let Q=Oi;E.toneMapped&&(ae===null||ae.isXRRenderTarget===!0)&&(Q=s.toneMapping);const pe={shaderID:me,shaderType:E.type,shaderName:E.name,vertexShader:Oe,fragmentShader:K,defines:E.defines,customVertexShaderID:te,customFragmentShaderID:re,isRawShaderMaterial:E.isRawShaderMaterial===!0,glslVersion:E.glslVersion,precision:d,batching:Re,batchingColor:Re&&X._colorsTexture!==null,instancing:ge,instancingColor:ge&&X.instanceColor!==null,instancingMorph:ge&&X.morphTexture!==null,supportsVertexTextures:u,outputColorSpace:ae===null?s.outputColorSpace:ae.isXRRenderTarget===!0?ae.texture.colorSpace:Ds,alphaToCoverage:!!E.alphaToCoverage,map:nt,matcap:yt,envMap:At,envMapMode:At&&oe.mapping,envMapCubeUVHeight:Y,aoMap:z,lightMap:Ot,bumpMap:Pt,normalMap:Ct,displacementMap:u&&Xe,emissiveMap:gt,normalMapObjectSpace:Ct&&E.normalMapType===Wd,normalMapTangentSpace:Ct&&E.normalMapType===ba,metalnessMap:je,roughnessMap:_t,anisotropy:ln,anisotropyMap:le,clearcoat:O,clearcoatMap:lt,clearcoatNormalMap:He,clearcoatRoughnessMap:st,dispersion:w,iridescence:ee,iridescenceMap:ot,iridescenceThicknessMap:ve,sheen:de,sheenColorMap:Ze,sheenRoughnessMap:Mt,specularMap:ft,specularColorMap:Ge,specularIntensityMap:Rt,transmission:_e,transmissionMap:q,thicknessMap:qe,gradientMap:ye,opaque:E.transparent===!1&&E.blending===As&&E.alphaToCoverage===!1,alphaMap:et,alphaTest:Ae,alphaHash:I,combine:E.combine,mapUv:nt&&_(E.map.channel),aoMapUv:z&&_(E.aoMap.channel),lightMapUv:Ot&&_(E.lightMap.channel),bumpMapUv:Pt&&_(E.bumpMap.channel),normalMapUv:Ct&&_(E.normalMap.channel),displacementMapUv:Xe&&_(E.displacementMap.channel),emissiveMapUv:gt&&_(E.emissiveMap.channel),metalnessMapUv:je&&_(E.metalnessMap.channel),roughnessMapUv:_t&&_(E.roughnessMap.channel),anisotropyMapUv:le&&_(E.anisotropyMap.channel),clearcoatMapUv:lt&&_(E.clearcoatMap.channel),clearcoatNormalMapUv:He&&_(E.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:st&&_(E.clearcoatRoughnessMap.channel),iridescenceMapUv:ot&&_(E.iridescenceMap.channel),iridescenceThicknessMapUv:ve&&_(E.iridescenceThicknessMap.channel),sheenColorMapUv:Ze&&_(E.sheenColorMap.channel),sheenRoughnessMapUv:Mt&&_(E.sheenRoughnessMap.channel),specularMapUv:ft&&_(E.specularMap.channel),specularColorMapUv:Ge&&_(E.specularColorMap.channel),specularIntensityMapUv:Rt&&_(E.specularIntensityMap.channel),transmissionMapUv:q&&_(E.transmissionMap.channel),thicknessMapUv:qe&&_(E.thicknessMap.channel),alphaMapUv:et&&_(E.alphaMap.channel),vertexTangents:!!ie.attributes.tangent&&(Ct||ln),vertexColors:E.vertexColors,vertexAlphas:E.vertexColors===!0&&!!ie.attributes.color&&ie.attributes.color.itemSize===4,pointsUvs:X.isPoints===!0&&!!ie.attributes.uv&&(nt||et),fog:!!Z,useFog:E.fog===!0,fogExp2:!!Z&&Z.isFogExp2,flatShading:E.flatShading===!0,sizeAttenuation:E.sizeAttenuation===!0,logarithmicDepthBuffer:f,reverseDepthBuffer:Ie,skinning:X.isSkinnedMesh===!0,morphTargets:ie.morphAttributes.position!==void 0,morphNormals:ie.morphAttributes.normal!==void 0,morphColors:ie.morphAttributes.color!==void 0,morphTargetsCount:Ce,morphTextureStride:Ye,numDirLights:y.directional.length,numPointLights:y.point.length,numSpotLights:y.spot.length,numSpotLightMaps:y.spotLightMap.length,numRectAreaLights:y.rectArea.length,numHemiLights:y.hemi.length,numDirLightShadows:y.directionalShadowMap.length,numPointLightShadows:y.pointShadowMap.length,numSpotLightShadows:y.spotShadowMap.length,numSpotLightShadowsWithMaps:y.numSpotLightShadowsWithMaps,numLightProbes:y.numLightProbes,numClippingPlanes:a.numPlanes,numClipIntersection:a.numIntersection,dithering:E.dithering,shadowMapEnabled:s.shadowMap.enabled&&U.length>0,shadowMapType:s.shadowMap.type,toneMapping:Q,decodeVideoTexture:nt&&E.map.isVideoTexture===!0&&Wt.getTransfer(E.map.colorSpace)===an,decodeVideoTextureEmissive:gt&&E.emissiveMap.isVideoTexture===!0&&Wt.getTransfer(E.emissiveMap.colorSpace)===an,premultipliedAlpha:E.premultipliedAlpha,doubleSided:E.side===wn,flipSided:E.side===Rn,useDepthPacking:E.depthPacking>=0,depthPacking:E.depthPacking||0,index0AttributeName:E.index0AttributeName,extensionClipCullDistance:k&&E.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(k&&E.extensions.multiDraw===!0||Re)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:E.customProgramCacheKey()};return pe.vertexUv1s=c.has(1),pe.vertexUv2s=c.has(2),pe.vertexUv3s=c.has(3),c.clear(),pe}function p(E){const y=[];if(E.shaderID?y.push(E.shaderID):(y.push(E.customVertexShaderID),y.push(E.customFragmentShaderID)),E.defines!==void 0)for(const U in E.defines)y.push(U),y.push(E.defines[U]);return E.isRawShaderMaterial===!1&&(S(y,E),A(y,E),y.push(s.outputColorSpace)),y.push(E.customProgramCacheKey),y.join()}function S(E,y){E.push(y.precision),E.push(y.outputColorSpace),E.push(y.envMapMode),E.push(y.envMapCubeUVHeight),E.push(y.mapUv),E.push(y.alphaMapUv),E.push(y.lightMapUv),E.push(y.aoMapUv),E.push(y.bumpMapUv),E.push(y.normalMapUv),E.push(y.displacementMapUv),E.push(y.emissiveMapUv),E.push(y.metalnessMapUv),E.push(y.roughnessMapUv),E.push(y.anisotropyMapUv),E.push(y.clearcoatMapUv),E.push(y.clearcoatNormalMapUv),E.push(y.clearcoatRoughnessMapUv),E.push(y.iridescenceMapUv),E.push(y.iridescenceThicknessMapUv),E.push(y.sheenColorMapUv),E.push(y.sheenRoughnessMapUv),E.push(y.specularMapUv),E.push(y.specularColorMapUv),E.push(y.specularIntensityMapUv),E.push(y.transmissionMapUv),E.push(y.thicknessMapUv),E.push(y.combine),E.push(y.fogExp2),E.push(y.sizeAttenuation),E.push(y.morphTargetsCount),E.push(y.morphAttributeCount),E.push(y.numDirLights),E.push(y.numPointLights),E.push(y.numSpotLights),E.push(y.numSpotLightMaps),E.push(y.numHemiLights),E.push(y.numRectAreaLights),E.push(y.numDirLightShadows),E.push(y.numPointLightShadows),E.push(y.numSpotLightShadows),E.push(y.numSpotLightShadowsWithMaps),E.push(y.numLightProbes),E.push(y.shadowMapType),E.push(y.toneMapping),E.push(y.numClippingPlanes),E.push(y.numClipIntersection),E.push(y.depthPacking)}function A(E,y){o.disableAll(),y.supportsVertexTextures&&o.enable(0),y.instancing&&o.enable(1),y.instancingColor&&o.enable(2),y.instancingMorph&&o.enable(3),y.matcap&&o.enable(4),y.envMap&&o.enable(5),y.normalMapObjectSpace&&o.enable(6),y.normalMapTangentSpace&&o.enable(7),y.clearcoat&&o.enable(8),y.iridescence&&o.enable(9),y.alphaTest&&o.enable(10),y.vertexColors&&o.enable(11),y.vertexAlphas&&o.enable(12),y.vertexUv1s&&o.enable(13),y.vertexUv2s&&o.enable(14),y.vertexUv3s&&o.enable(15),y.vertexTangents&&o.enable(16),y.anisotropy&&o.enable(17),y.alphaHash&&o.enable(18),y.batching&&o.enable(19),y.dispersion&&o.enable(20),y.batchingColor&&o.enable(21),E.push(o.mask),o.disableAll(),y.fog&&o.enable(0),y.useFog&&o.enable(1),y.flatShading&&o.enable(2),y.logarithmicDepthBuffer&&o.enable(3),y.reverseDepthBuffer&&o.enable(4),y.skinning&&o.enable(5),y.morphTargets&&o.enable(6),y.morphNormals&&o.enable(7),y.morphColors&&o.enable(8),y.premultipliedAlpha&&o.enable(9),y.shadowMapEnabled&&o.enable(10),y.doubleSided&&o.enable(11),y.flipSided&&o.enable(12),y.useDepthPacking&&o.enable(13),y.dithering&&o.enable(14),y.transmission&&o.enable(15),y.sheen&&o.enable(16),y.opaque&&o.enable(17),y.pointsUvs&&o.enable(18),y.decodeVideoTexture&&o.enable(19),y.decodeVideoTextureEmissive&&o.enable(20),y.alphaToCoverage&&o.enable(21),E.push(o.mask)}function b(E){const y=m[E.type];let U;if(y){const G=Un[y];U=Ll.clone(G.uniforms)}else U=E.uniforms;return U}function N(E,y){let U;for(let G=0,X=h.length;G<X;G++){const Z=h[G];if(Z.cacheKey===y){U=Z,++U.usedTimes;break}}return U===void 0&&(U=new q2(s,y,E,r),h.push(U)),U}function C(E){if(--E.usedTimes===0){const y=h.indexOf(E);h[y]=h[h.length-1],h.pop(),E.destroy()}}function P(E){l.remove(E)}function D(){l.dispose()}return{getParameters:g,getProgramCacheKey:p,getUniforms:b,acquireProgram:N,releaseProgram:C,releaseShaderCache:P,programs:h,dispose:D}}function K2(){let s=new WeakMap;function e(a){return s.has(a)}function t(a){let o=s.get(a);return o===void 0&&(o={},s.set(a,o)),o}function n(a){s.delete(a)}function i(a,o,l){s.get(a)[o]=l}function r(){s=new WeakMap}return{has:e,get:t,remove:n,update:i,dispose:r}}function Z2(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.material.id!==e.material.id?s.material.id-e.material.id:s.z!==e.z?s.z-e.z:s.id-e.id}function mh(s,e){return s.groupOrder!==e.groupOrder?s.groupOrder-e.groupOrder:s.renderOrder!==e.renderOrder?s.renderOrder-e.renderOrder:s.z!==e.z?e.z-s.z:s.id-e.id}function gh(){const s=[];let e=0;const t=[],n=[],i=[];function r(){e=0,t.length=0,n.length=0,i.length=0}function a(f,u,d,m,_,g){let p=s[e];return p===void 0?(p={id:f.id,object:f,geometry:u,material:d,groupOrder:m,renderOrder:f.renderOrder,z:_,group:g},s[e]=p):(p.id=f.id,p.object=f,p.geometry=u,p.material=d,p.groupOrder=m,p.renderOrder=f.renderOrder,p.z=_,p.group=g),e++,p}function o(f,u,d,m,_,g){const p=a(f,u,d,m,_,g);d.transmission>0?n.push(p):d.transparent===!0?i.push(p):t.push(p)}function l(f,u,d,m,_,g){const p=a(f,u,d,m,_,g);d.transmission>0?n.unshift(p):d.transparent===!0?i.unshift(p):t.unshift(p)}function c(f,u){t.length>1&&t.sort(f||Z2),n.length>1&&n.sort(u||mh),i.length>1&&i.sort(u||mh)}function h(){for(let f=e,u=s.length;f<u;f++){const d=s[f];if(d.id===null)break;d.id=null,d.object=null,d.geometry=null,d.material=null,d.group=null}}return{opaque:t,transmissive:n,transparent:i,init:r,push:o,unshift:l,finish:h,sort:c}}function Q2(){let s=new WeakMap;function e(n,i){const r=s.get(n);let a;return r===void 0?(a=new gh,s.set(n,[a])):i>=r.length?(a=new gh,r.push(a)):a=r[i],a}function t(){s=new WeakMap}return{get:e,dispose:t}}function eg(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new F,color:new xt};break;case"SpotLight":t={position:new F,direction:new F,color:new xt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new F,color:new xt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new F,skyColor:new xt,groundColor:new xt};break;case"RectAreaLight":t={color:new xt,position:new F,halfWidth:new F,halfHeight:new F};break}return s[e.id]=t,t}}}function tg(){const s={};return{get:function(e){if(s[e.id]!==void 0)return s[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Qe,shadowCameraNear:1,shadowCameraFar:1e3};break}return s[e.id]=t,t}}}let ng=0;function ig(s,e){return(e.castShadow?2:0)-(s.castShadow?2:0)+(e.map?1:0)-(s.map?1:0)}function sg(s){const e=new eg,t=tg(),n={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 c=0;c<9;c++)n.probe.push(new F);const i=new F,r=new Tt,a=new Tt;function o(c){let h=0,f=0,u=0;for(let E=0;E<9;E++)n.probe[E].set(0,0,0);let d=0,m=0,_=0,g=0,p=0,S=0,A=0,b=0,N=0,C=0,P=0;c.sort(ig);for(let E=0,y=c.length;E<y;E++){const U=c[E],G=U.color,X=U.intensity,Z=U.distance,ie=U.shadow&&U.shadow.map?U.shadow.map.texture:null;if(U.isAmbientLight)h+=G.r*X,f+=G.g*X,u+=G.b*X;else if(U.isLightProbe){for(let H=0;H<9;H++)n.probe[H].addScaledVector(U.sh.coefficients[H],X);P++}else if(U.isDirectionalLight){const H=e.get(U);if(H.color.copy(U.color).multiplyScalar(U.intensity),U.castShadow){const oe=U.shadow,Y=t.get(U);Y.shadowIntensity=oe.intensity,Y.shadowBias=oe.bias,Y.shadowNormalBias=oe.normalBias,Y.shadowRadius=oe.radius,Y.shadowMapSize=oe.mapSize,n.directionalShadow[d]=Y,n.directionalShadowMap[d]=ie,n.directionalShadowMatrix[d]=U.shadow.matrix,S++}n.directional[d]=H,d++}else if(U.isSpotLight){const H=e.get(U);H.position.setFromMatrixPosition(U.matrixWorld),H.color.copy(G).multiplyScalar(X),H.distance=Z,H.coneCos=Math.cos(U.angle),H.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),H.decay=U.decay,n.spot[_]=H;const oe=U.shadow;if(U.map&&(n.spotLightMap[N]=U.map,N++,oe.updateMatrices(U),U.castShadow&&C++),n.spotLightMatrix[_]=oe.matrix,U.castShadow){const Y=t.get(U);Y.shadowIntensity=oe.intensity,Y.shadowBias=oe.bias,Y.shadowNormalBias=oe.normalBias,Y.shadowRadius=oe.radius,Y.shadowMapSize=oe.mapSize,n.spotShadow[_]=Y,n.spotShadowMap[_]=ie,b++}_++}else if(U.isRectAreaLight){const H=e.get(U);H.color.copy(G).multiplyScalar(X),H.halfWidth.set(U.width*.5,0,0),H.halfHeight.set(0,U.height*.5,0),n.rectArea[g]=H,g++}else if(U.isPointLight){const H=e.get(U);if(H.color.copy(U.color).multiplyScalar(U.intensity),H.distance=U.distance,H.decay=U.decay,U.castShadow){const oe=U.shadow,Y=t.get(U);Y.shadowIntensity=oe.intensity,Y.shadowBias=oe.bias,Y.shadowNormalBias=oe.normalBias,Y.shadowRadius=oe.radius,Y.shadowMapSize=oe.mapSize,Y.shadowCameraNear=oe.camera.near,Y.shadowCameraFar=oe.camera.far,n.pointShadow[m]=Y,n.pointShadowMap[m]=ie,n.pointShadowMatrix[m]=U.shadow.matrix,A++}n.point[m]=H,m++}else if(U.isHemisphereLight){const H=e.get(U);H.skyColor.copy(U.color).multiplyScalar(X),H.groundColor.copy(U.groundColor).multiplyScalar(X),n.hemi[p]=H,p++}}g>0&&(s.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=We.LTC_FLOAT_1,n.rectAreaLTC2=We.LTC_FLOAT_2):(n.rectAreaLTC1=We.LTC_HALF_1,n.rectAreaLTC2=We.LTC_HALF_2)),n.ambient[0]=h,n.ambient[1]=f,n.ambient[2]=u;const D=n.hash;(D.directionalLength!==d||D.pointLength!==m||D.spotLength!==_||D.rectAreaLength!==g||D.hemiLength!==p||D.numDirectionalShadows!==S||D.numPointShadows!==A||D.numSpotShadows!==b||D.numSpotMaps!==N||D.numLightProbes!==P)&&(n.directional.length=d,n.spot.length=_,n.rectArea.length=g,n.point.length=m,n.hemi.length=p,n.directionalShadow.length=S,n.directionalShadowMap.length=S,n.pointShadow.length=A,n.pointShadowMap.length=A,n.spotShadow.length=b,n.spotShadowMap.length=b,n.directionalShadowMatrix.length=S,n.pointShadowMatrix.length=A,n.spotLightMatrix.length=b+N-C,n.spotLightMap.length=N,n.numSpotLightShadowsWithMaps=C,n.numLightProbes=P,D.directionalLength=d,D.pointLength=m,D.spotLength=_,D.rectAreaLength=g,D.hemiLength=p,D.numDirectionalShadows=S,D.numPointShadows=A,D.numSpotShadows=b,D.numSpotMaps=N,D.numLightProbes=P,n.version=ng++)}function l(c,h){let f=0,u=0,d=0,m=0,_=0;const g=h.matrixWorldInverse;for(let p=0,S=c.length;p<S;p++){const A=c[p];if(A.isDirectionalLight){const b=n.directional[f];b.direction.setFromMatrixPosition(A.matrixWorld),i.setFromMatrixPosition(A.target.matrixWorld),b.direction.sub(i),b.direction.transformDirection(g),f++}else if(A.isSpotLight){const b=n.spot[d];b.position.setFromMatrixPosition(A.matrixWorld),b.position.applyMatrix4(g),b.direction.setFromMatrixPosition(A.matrixWorld),i.setFromMatrixPosition(A.target.matrixWorld),b.direction.sub(i),b.direction.transformDirection(g),d++}else if(A.isRectAreaLight){const b=n.rectArea[m];b.position.setFromMatrixPosition(A.matrixWorld),b.position.applyMatrix4(g),a.identity(),r.copy(A.matrixWorld),r.premultiply(g),a.extractRotation(r),b.halfWidth.set(A.width*.5,0,0),b.halfHeight.set(0,A.height*.5,0),b.halfWidth.applyMatrix4(a),b.halfHeight.applyMatrix4(a),m++}else if(A.isPointLight){const b=n.point[u];b.position.setFromMatrixPosition(A.matrixWorld),b.position.applyMatrix4(g),u++}else if(A.isHemisphereLight){const b=n.hemi[_];b.direction.setFromMatrixPosition(A.matrixWorld),b.direction.transformDirection(g),_++}}}return{setup:o,setupView:l,state:n}}function _h(s){const e=new sg(s),t=[],n=[];function i(h){c.camera=h,t.length=0,n.length=0}function r(h){t.push(h)}function a(h){n.push(h)}function o(){e.setup(t)}function l(h){e.setupView(t,h)}const c={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:i,state:c,setupLights:o,setupLightsView:l,pushLight:r,pushShadow:a}}function rg(s){let e=new WeakMap;function t(i,r=0){const a=e.get(i);let o;return a===void 0?(o=new _h(s),e.set(i,[o])):r>=a.length?(o=new _h(s),a.push(o)):o=a[r],o}function n(){e=new WeakMap}return{get:t,dispose:n}}const ag=`void main() {
|
|
3776
3776
|
gl_Position = vec4( position, 1.0 );
|
|
3777
|
-
}`,
|
|
3777
|
+
}`,og=`uniform sampler2D shadow_pass;
|
|
3778
3778
|
uniform vec2 resolution;
|
|
3779
3779
|
uniform float radius;
|
|
3780
3780
|
#include <packing>
|
|
@@ -3800,12 +3800,12 @@ void main() {
|
|
|
3800
3800
|
squared_mean = squared_mean / samples;
|
|
3801
3801
|
float std_dev = sqrt( squared_mean - mean * mean );
|
|
3802
3802
|
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
|
|
3803
|
-
}`;function og(s,e,t){let n=new Nl;const i=new Qe,r=new Qe,a=new Gt,o=new dp({depthPacking:Hd}),l=new fp,c={},h=t.maxTextureSize,d={[Xn]:Rn,[Rn]:Xn,[wn]:wn},u=new bi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qe},radius:{value:4}},vertexShader:rg,fragmentShader:ag}),f=u.clone();f.defines.HORIZONTAL_PASS=1;const m=new ln;m.setAttribute("position",new fn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new Jt(m,u),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Wh;let p=this.type;this.render=function(R,P,D){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||R.length===0)return;const S=s.getRenderTarget(),y=s.getActiveCubeFace(),N=s.getActiveMipmapLevel(),W=s.state;W.setBlending(Fi),W.buffers.color.setClear(1,1,1,1),W.buffers.depth.setTest(!0),W.setScissorTest(!1);const X=p!==vi&&this.type===vi,Q=p===vi&&this.type!==vi;for(let ne=0,H=R.length;ne<H;ne++){const se=R[ne],Z=se.shadow;if(Z===void 0){console.warn("THREE.WebGLShadowMap:",se,"has no shadow.");continue}if(Z.autoUpdate===!1&&Z.needsUpdate===!1)continue;i.copy(Z.mapSize);const pe=Z.getFrameExtents();if(i.multiply(pe),r.copy(Z.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/pe.x),i.x=r.x*pe.x,Z.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/pe.y),i.y=r.y*pe.y,Z.mapSize.y=r.y)),Z.map===null||X===!0||Q===!0){const Ce=this.type!==vi?{minFilter:On,magFilter:On}:{};Z.map!==null&&Z.map.dispose(),Z.map=new ts(i.x,i.y,Ce),Z.map.texture.name=se.name+".shadowMap",Z.camera.updateProjectionMatrix()}s.setRenderTarget(Z.map),s.clear();const be=Z.getViewportCount();for(let Ce=0;Ce<be;Ce++){const Ie=Z.getViewport(Ce);a.set(r.x*Ie.x,r.y*Ie.y,r.x*Ie.z,r.y*Ie.w),W.viewport(a),Z.updateMatrices(se,Ce),n=Z.getFrustum(),M(P,D,Z.camera,se,this.type)}Z.isPointLightShadow!==!0&&this.type===vi&&E(Z,D),Z.needsUpdate=!1}p=this.type,g.needsUpdate=!1,s.setRenderTarget(S,y,N)};function E(R,P){const D=e.update(_);u.defines.VSM_SAMPLES!==R.blurSamples&&(u.defines.VSM_SAMPLES=R.blurSamples,f.defines.VSM_SAMPLES=R.blurSamples,u.needsUpdate=!0,f.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new ts(i.x,i.y)),u.uniforms.shadow_pass.value=R.map.texture,u.uniforms.resolution.value=R.mapSize,u.uniforms.radius.value=R.radius,s.setRenderTarget(R.mapPass),s.clear(),s.renderBufferDirect(P,null,D,u,_,null),f.uniforms.shadow_pass.value=R.mapPass.texture,f.uniforms.resolution.value=R.mapSize,f.uniforms.radius.value=R.radius,s.setRenderTarget(R.map),s.clear(),s.renderBufferDirect(P,null,D,f,_,null)}function b(R,P,D,S){let y=null;const N=D.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(N!==void 0)y=N;else if(y=D.isPointLight===!0?l:o,s.localClippingEnabled&&P.clipShadows===!0&&Array.isArray(P.clippingPlanes)&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const W=y.uuid,X=P.uuid;let Q=c[W];Q===void 0&&(Q={},c[W]=Q);let ne=Q[X];ne===void 0&&(ne=y.clone(),Q[X]=ne,P.addEventListener("dispose",U)),y=ne}if(y.visible=P.visible,y.wireframe=P.wireframe,S===vi?y.side=P.shadowSide!==null?P.shadowSide:P.side:y.side=P.shadowSide!==null?P.shadowSide:d[P.side],y.alphaMap=P.alphaMap,y.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,y.map=P.map,y.clipShadows=P.clipShadows,y.clippingPlanes=P.clippingPlanes,y.clipIntersection=P.clipIntersection,y.displacementMap=P.displacementMap,y.displacementScale=P.displacementScale,y.displacementBias=P.displacementBias,y.wireframeLinewidth=P.wireframeLinewidth,y.linewidth=P.linewidth,D.isPointLight===!0&&y.isMeshDistanceMaterial===!0){const W=s.properties.get(y);W.light=D}return y}function M(R,P,D,S,y){if(R.visible===!1)return;if(R.layers.test(P.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&y===vi)&&(!R.frustumCulled||n.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,R.matrixWorld);const X=e.update(R),Q=R.material;if(Array.isArray(Q)){const ne=X.groups;for(let H=0,se=ne.length;H<se;H++){const Z=ne[H],pe=Q[Z.materialIndex];if(pe&&pe.visible){const be=b(R,pe,S,y);R.onBeforeShadow(s,R,P,D,X,be,Z),s.renderBufferDirect(D,null,X,be,R,Z),R.onAfterShadow(s,R,P,D,X,be,Z)}}}else if(Q.visible){const ne=b(R,Q,S,y);R.onBeforeShadow(s,R,P,D,X,ne,null),s.renderBufferDirect(D,null,X,ne,R,null),R.onAfterShadow(s,R,P,D,X,ne,null)}}const W=R.children;for(let X=0,Q=W.length;X<Q;X++)M(W[X],P,D,S,y)}function U(R){R.target.removeEventListener("dispose",U);for(const D in c){const S=c[D],y=R.target.uuid;y in S&&(S[y].dispose(),delete S[y])}}}const lg={[Ao]:wo,[To]:Lo,[Co]:Po,[Rs]:Ro,[wo]:Ao,[Lo]:To,[Po]:Co,[Ro]:Rs};function cg(s,e){function t(){let q=!1;const qe=new Gt;let ye=null;const et=new Gt(0,0,0,0);return{setMask:function(I){ye!==I&&!q&&(s.colorMask(I,I,I,I),ye=I)},setLocked:function(I){q=I},setClear:function(I,B,$,oe,ue){ue===!0&&(I*=oe,B*=oe,$*=oe),qe.set(I,B,$,oe),et.equals(qe)===!1&&(s.clearColor(I,B,$,oe),et.copy(qe))},reset:function(){q=!1,ye=null,et.set(-1,0,0,0)}}}function n(){let q=!1,qe=!1,ye=null,et=null,I=null;return{setReversed:function(B){if(qe!==B){const $=e.get("EXT_clip_control");B?$.clipControlEXT($.LOWER_LEFT_EXT,$.ZERO_TO_ONE_EXT):$.clipControlEXT($.LOWER_LEFT_EXT,$.NEGATIVE_ONE_TO_ONE_EXT),qe=B;const oe=I;I=null,this.setClear(oe)}},getReversed:function(){return qe},setTest:function(B){B?le(s.DEPTH_TEST):Le(s.DEPTH_TEST)},setMask:function(B){ye!==B&&!q&&(s.depthMask(B),ye=B)},setFunc:function(B){if(qe&&(B=lg[B]),et!==B){switch(B){case Ao:s.depthFunc(s.NEVER);break;case wo:s.depthFunc(s.ALWAYS);break;case To:s.depthFunc(s.LESS);break;case Rs:s.depthFunc(s.LEQUAL);break;case Co:s.depthFunc(s.EQUAL);break;case Ro:s.depthFunc(s.GEQUAL);break;case Lo:s.depthFunc(s.GREATER);break;case Po:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}et=B}},setLocked:function(B){q=B},setClear:function(B){I!==B&&(qe&&(B=1-B),s.clearDepth(B),I=B)},reset:function(){q=!1,ye=null,et=null,I=null,qe=!1}}}function i(){let q=!1,qe=null,ye=null,et=null,I=null,B=null,$=null,oe=null,ue=null;return{setTest:function(te){q||(te?le(s.STENCIL_TEST):Le(s.STENCIL_TEST))},setMask:function(te){qe!==te&&!q&&(s.stencilMask(te),qe=te)},setFunc:function(te,we,_e){(ye!==te||et!==we||I!==_e)&&(s.stencilFunc(te,we,_e),ye=te,et=we,I=_e)},setOp:function(te,we,_e){(B!==te||$!==we||oe!==_e)&&(s.stencilOp(te,we,_e),B=te,$=we,oe=_e)},setLocked:function(te){q=te},setClear:function(te){ue!==te&&(s.clearStencil(te),ue=te)},reset:function(){q=!1,qe=null,ye=null,et=null,I=null,B=null,$=null,oe=null,ue=null}}}const r=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},d={},u=new WeakMap,f=[],m=null,_=!1,g=null,p=null,E=null,b=null,M=null,U=null,R=null,P=new vt(0,0,0),D=0,S=!1,y=null,N=null,W=null,X=null,Q=null;const ne=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let H=!1,se=0;const Z=s.getParameter(s.VERSION);Z.indexOf("WebGL")!==-1?(se=parseFloat(/^WebGL (\d)/.exec(Z)[1]),H=se>=1):Z.indexOf("OpenGL ES")!==-1&&(se=parseFloat(/^OpenGL ES (\d)/.exec(Z)[1]),H=se>=2);let pe=null,be={};const Ce=s.getParameter(s.SCISSOR_BOX),Ie=s.getParameter(s.VIEWPORT),He=new Gt().fromArray(Ce),K=new Gt().fromArray(Ie);function re(q,qe,ye,et){const I=new Uint8Array(4),B=s.createTexture();s.bindTexture(q,B),s.texParameteri(q,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(q,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let $=0;$<ye;$++)q===s.TEXTURE_3D||q===s.TEXTURE_2D_ARRAY?s.texImage3D(qe,0,s.RGBA,1,1,et,0,s.RGBA,s.UNSIGNED_BYTE,I):s.texImage2D(qe+$,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,I);return B}const ae={};ae[s.TEXTURE_2D]=re(s.TEXTURE_2D,s.TEXTURE_2D,1),ae[s.TEXTURE_CUBE_MAP]=re(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),ae[s.TEXTURE_2D_ARRAY]=re(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),ae[s.TEXTURE_3D]=re(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),le(s.DEPTH_TEST),a.setFunc(Rs),Rt(!1),At(jl),le(s.CULL_FACE),z(Fi);function le(q){h[q]!==!0&&(s.enable(q),h[q]=!0)}function Le(q){h[q]!==!1&&(s.disable(q),h[q]=!1)}function ge(q,qe){return d[q]!==qe?(s.bindFramebuffer(q,qe),d[q]=qe,q===s.DRAW_FRAMEBUFFER&&(d[s.FRAMEBUFFER]=qe),q===s.FRAMEBUFFER&&(d[s.DRAW_FRAMEBUFFER]=qe),!0):!1}function Ae(q,qe){let ye=f,et=!1;if(q){ye=u.get(qe),ye===void 0&&(ye=[],u.set(qe,ye));const I=q.textures;if(ye.length!==I.length||ye[0]!==s.COLOR_ATTACHMENT0){for(let B=0,$=I.length;B<$;B++)ye[B]=s.COLOR_ATTACHMENT0+B;ye.length=I.length,et=!0}}else ye[0]!==s.BACK&&(ye[0]=s.BACK,et=!0);et&&s.drawBuffers(ye)}function lt(q){return m!==q?(s.useProgram(q),m=q,!0):!1}const Et={[Ji]:s.FUNC_ADD,[fd]:s.FUNC_SUBTRACT,[pd]:s.FUNC_REVERSE_SUBTRACT};Et[md]=s.MIN,Et[gd]=s.MAX;const Mt={[_d]:s.ZERO,[vd]:s.ONE,[xd]:s.SRC_COLOR,[bo]:s.SRC_ALPHA,[Ad]:s.SRC_ALPHA_SATURATE,[bd]:s.DST_COLOR,[Md]:s.DST_ALPHA,[yd]:s.ONE_MINUS_SRC_COLOR,[Eo]:s.ONE_MINUS_SRC_ALPHA,[Ed]:s.ONE_MINUS_DST_COLOR,[Sd]:s.ONE_MINUS_DST_ALPHA,[wd]:s.CONSTANT_COLOR,[Td]:s.ONE_MINUS_CONSTANT_COLOR,[Cd]:s.CONSTANT_ALPHA,[Rd]:s.ONE_MINUS_CONSTANT_ALPHA};function z(q,qe,ye,et,I,B,$,oe,ue,te){if(q===Fi){_===!0&&(Le(s.BLEND),_=!1);return}if(_===!1&&(le(s.BLEND),_=!0),q!==dd){if(q!==g||te!==S){if((p!==Ji||M!==Ji)&&(s.blendEquation(s.FUNC_ADD),p=Ji,M=Ji),te)switch(q){case As:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yl:s.blendFunc(s.ONE,s.ONE);break;case $l:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Jl:s.blendFuncSeparate(s.ZERO,s.SRC_COLOR,s.ZERO,s.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}else switch(q){case As:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yl:s.blendFunc(s.SRC_ALPHA,s.ONE);break;case $l:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Jl:s.blendFunc(s.ZERO,s.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}E=null,b=null,U=null,R=null,P.set(0,0,0),D=0,g=q,S=te}return}I=I||qe,B=B||ye,$=$||et,(qe!==p||I!==M)&&(s.blendEquationSeparate(Et[qe],Et[I]),p=qe,M=I),(ye!==E||et!==b||B!==U||$!==R)&&(s.blendFuncSeparate(Mt[ye],Mt[et],Mt[B],Mt[$]),E=ye,b=et,U=B,R=$),(oe.equals(P)===!1||ue!==D)&&(s.blendColor(oe.r,oe.g,oe.b,ue),P.copy(oe),D=ue),g=q,S=!1}function Wt(q,qe){q.side===wn?Le(s.CULL_FACE):le(s.CULL_FACE);let ye=q.side===Rn;qe&&(ye=!ye),Rt(ye),q.blending===As&&q.transparent===!1?z(Fi):z(q.blending,q.blendEquation,q.blendSrc,q.blendDst,q.blendEquationAlpha,q.blendSrcAlpha,q.blendDstAlpha,q.blendColor,q.blendAlpha,q.premultipliedAlpha),a.setFunc(q.depthFunc),a.setTest(q.depthTest),a.setMask(q.depthWrite),r.setMask(q.colorWrite);const et=q.stencilWrite;o.setTest(et),et&&(o.setMask(q.stencilWriteMask),o.setFunc(q.stencilFunc,q.stencilRef,q.stencilFuncMask),o.setOp(q.stencilFail,q.stencilZFail,q.stencilZPass)),mt(q.polygonOffset,q.polygonOffsetFactor,q.polygonOffsetUnits),q.alphaToCoverage===!0?le(s.SAMPLE_ALPHA_TO_COVERAGE):Le(s.SAMPLE_ALPHA_TO_COVERAGE)}function Rt(q){y!==q&&(q?s.frontFace(s.CW):s.frontFace(s.CCW),y=q)}function At(q){q!==hd?(le(s.CULL_FACE),q!==N&&(q===jl?s.cullFace(s.BACK):q===ud?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):Le(s.CULL_FACE),N=q}function Ge(q){q!==W&&(H&&s.lineWidth(q),W=q)}function mt(q,qe,ye){q?(le(s.POLYGON_OFFSET_FILL),(X!==qe||Q!==ye)&&(s.polygonOffset(qe,ye),X=qe,Q=ye)):Le(s.POLYGON_OFFSET_FILL)}function Xe(q){q?le(s.SCISSOR_TEST):Le(s.SCISSOR_TEST)}function gt(q){q===void 0&&(q=s.TEXTURE0+ne-1),pe!==q&&(s.activeTexture(q),pe=q)}function on(q,qe,ye){ye===void 0&&(pe===null?ye=s.TEXTURE0+ne-1:ye=pe);let et=be[ye];et===void 0&&(et={type:void 0,texture:void 0},be[ye]=et),(et.type!==q||et.texture!==qe)&&(pe!==ye&&(s.activeTexture(ye),pe=ye),s.bindTexture(q,qe||ae[q]),et.type=q,et.texture=qe)}function O(){const q=be[pe];q!==void 0&&q.type!==void 0&&(s.bindTexture(q.type,null),q.type=void 0,q.texture=void 0)}function w(){try{s.compressedTexImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ee(){try{s.compressedTexImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function de(){try{s.texSubImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function me(){try{s.texSubImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ce(){try{s.compressedTexSubImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ct(){try{s.compressedTexSubImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function We(){try{s.texStorage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function st(){try{s.texStorage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function rt(){try{s.texImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function xe(){try{s.texImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Ze(q){He.equals(q)===!1&&(s.scissor(q.x,q.y,q.z,q.w),He.copy(q))}function ft(q){K.equals(q)===!1&&(s.viewport(q.x,q.y,q.z,q.w),K.copy(q))}function _t(q,qe){let ye=c.get(qe);ye===void 0&&(ye=new WeakMap,c.set(qe,ye));let et=ye.get(q);et===void 0&&(et=s.getUniformBlockIndex(qe,q.name),ye.set(q,et))}function ke(q,qe){const et=c.get(qe).get(q);l.get(qe)!==et&&(s.uniformBlockBinding(qe,et,q.__bindingPointIndex),l.set(qe,et))}function wt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},pe=null,be={},d={},u=new WeakMap,f=[],m=null,_=!1,g=null,p=null,E=null,b=null,M=null,U=null,R=null,P=new vt(0,0,0),D=0,S=!1,y=null,N=null,W=null,X=null,Q=null,He.set(0,0,s.canvas.width,s.canvas.height),K.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:le,disable:Le,bindFramebuffer:ge,drawBuffers:Ae,useProgram:lt,setBlending:z,setMaterial:Wt,setFlipSided:Rt,setCullFace:At,setLineWidth:Ge,setPolygonOffset:mt,setScissorTest:Xe,activeTexture:gt,bindTexture:on,unbindTexture:O,compressedTexImage2D:w,compressedTexImage3D:ee,texImage2D:rt,texImage3D:xe,updateUBOMapping:_t,uniformBlockBinding:ke,texStorage2D:We,texStorage3D:st,texSubImage2D:de,texSubImage3D:me,compressedTexSubImage2D:ce,compressedTexSubImage3D:ct,scissor:Ze,viewport:ft,reset:wt}}function hg(s,e,t,n,i,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Qe,h=new WeakMap;let d;const u=new WeakMap;let f=!1;try{f=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(O,w){return f?new OffscreenCanvas(O,w):or("canvas")}function _(O,w,ee){let de=1;const me=on(O);if((me.width>ee||me.height>ee)&&(de=ee/Math.max(me.width,me.height)),de<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const ce=Math.floor(de*me.width),ct=Math.floor(de*me.height);d===void 0&&(d=m(ce,ct));const We=w?m(ce,ct):d;return We.width=ce,We.height=ct,We.getContext("2d").drawImage(O,0,0,ce,ct),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+me.width+"x"+me.height+") to ("+ce+"x"+ct+")."),We}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+me.width+"x"+me.height+")."),O;return O}function g(O){return O.generateMipmaps}function p(O){s.generateMipmap(O)}function E(O){return O.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?s.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function b(O,w,ee,de,me=!1){if(O!==null){if(s[O]!==void 0)return s[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let ce=w;if(w===s.RED&&(ee===s.FLOAT&&(ce=s.R32F),ee===s.HALF_FLOAT&&(ce=s.R16F),ee===s.UNSIGNED_BYTE&&(ce=s.R8)),w===s.RED_INTEGER&&(ee===s.UNSIGNED_BYTE&&(ce=s.R8UI),ee===s.UNSIGNED_SHORT&&(ce=s.R16UI),ee===s.UNSIGNED_INT&&(ce=s.R32UI),ee===s.BYTE&&(ce=s.R8I),ee===s.SHORT&&(ce=s.R16I),ee===s.INT&&(ce=s.R32I)),w===s.RG&&(ee===s.FLOAT&&(ce=s.RG32F),ee===s.HALF_FLOAT&&(ce=s.RG16F),ee===s.UNSIGNED_BYTE&&(ce=s.RG8)),w===s.RG_INTEGER&&(ee===s.UNSIGNED_BYTE&&(ce=s.RG8UI),ee===s.UNSIGNED_SHORT&&(ce=s.RG16UI),ee===s.UNSIGNED_INT&&(ce=s.RG32UI),ee===s.BYTE&&(ce=s.RG8I),ee===s.SHORT&&(ce=s.RG16I),ee===s.INT&&(ce=s.RG32I)),w===s.RGB_INTEGER&&(ee===s.UNSIGNED_BYTE&&(ce=s.RGB8UI),ee===s.UNSIGNED_SHORT&&(ce=s.RGB16UI),ee===s.UNSIGNED_INT&&(ce=s.RGB32UI),ee===s.BYTE&&(ce=s.RGB8I),ee===s.SHORT&&(ce=s.RGB16I),ee===s.INT&&(ce=s.RGB32I)),w===s.RGBA_INTEGER&&(ee===s.UNSIGNED_BYTE&&(ce=s.RGBA8UI),ee===s.UNSIGNED_SHORT&&(ce=s.RGBA16UI),ee===s.UNSIGNED_INT&&(ce=s.RGBA32UI),ee===s.BYTE&&(ce=s.RGBA8I),ee===s.SHORT&&(ce=s.RGBA16I),ee===s.INT&&(ce=s.RGBA32I)),w===s.RGB&&ee===s.UNSIGNED_INT_5_9_9_9_REV&&(ce=s.RGB9_E5),w===s.RGBA){const ct=me?da:kt.getTransfer(de);ee===s.FLOAT&&(ce=s.RGBA32F),ee===s.HALF_FLOAT&&(ce=s.RGBA16F),ee===s.UNSIGNED_BYTE&&(ce=ct===rn?s.SRGB8_ALPHA8:s.RGBA8),ee===s.UNSIGNED_SHORT_4_4_4_4&&(ce=s.RGBA4),ee===s.UNSIGNED_SHORT_5_5_5_1&&(ce=s.RGB5_A1)}return(ce===s.R16F||ce===s.R32F||ce===s.RG16F||ce===s.RG32F||ce===s.RGBA16F||ce===s.RGBA32F)&&e.get("EXT_color_buffer_float"),ce}function M(O,w){let ee;return O?w===null||w===es||w===sr?ee=s.DEPTH24_STENCIL8:w===oi?ee=s.DEPTH32F_STENCIL8:w===ir&&(ee=s.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):w===null||w===es||w===sr?ee=s.DEPTH_COMPONENT24:w===oi?ee=s.DEPTH_COMPONENT32F:w===ir&&(ee=s.DEPTH_COMPONENT16),ee}function U(O,w){return g(O)===!0||O.isFramebufferTexture&&O.minFilter!==On&&O.minFilter!==Fn?Math.log2(Math.max(w.width,w.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?w.mipmaps.length:1}function R(O){const w=O.target;w.removeEventListener("dispose",R),D(w),w.isVideoTexture&&h.delete(w)}function P(O){const w=O.target;w.removeEventListener("dispose",P),y(w)}function D(O){const w=n.get(O);if(w.__webglInit===void 0)return;const ee=O.source,de=u.get(ee);if(de){const me=de[w.__cacheKey];me.usedTimes--,me.usedTimes===0&&S(O),Object.keys(de).length===0&&u.delete(ee)}n.remove(O)}function S(O){const w=n.get(O);s.deleteTexture(w.__webglTexture);const ee=O.source,de=u.get(ee);delete de[w.__cacheKey],a.memory.textures--}function y(O){const w=n.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),n.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let de=0;de<6;de++){if(Array.isArray(w.__webglFramebuffer[de]))for(let me=0;me<w.__webglFramebuffer[de].length;me++)s.deleteFramebuffer(w.__webglFramebuffer[de][me]);else s.deleteFramebuffer(w.__webglFramebuffer[de]);w.__webglDepthbuffer&&s.deleteRenderbuffer(w.__webglDepthbuffer[de])}else{if(Array.isArray(w.__webglFramebuffer))for(let de=0;de<w.__webglFramebuffer.length;de++)s.deleteFramebuffer(w.__webglFramebuffer[de]);else s.deleteFramebuffer(w.__webglFramebuffer);if(w.__webglDepthbuffer&&s.deleteRenderbuffer(w.__webglDepthbuffer),w.__webglMultisampledFramebuffer&&s.deleteFramebuffer(w.__webglMultisampledFramebuffer),w.__webglColorRenderbuffer)for(let de=0;de<w.__webglColorRenderbuffer.length;de++)w.__webglColorRenderbuffer[de]&&s.deleteRenderbuffer(w.__webglColorRenderbuffer[de]);w.__webglDepthRenderbuffer&&s.deleteRenderbuffer(w.__webglDepthRenderbuffer)}const ee=O.textures;for(let de=0,me=ee.length;de<me;de++){const ce=n.get(ee[de]);ce.__webglTexture&&(s.deleteTexture(ce.__webglTexture),a.memory.textures--),n.remove(ee[de])}n.remove(O)}let N=0;function W(){N=0}function X(){const O=N;return O>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+i.maxTextures),N+=1,O}function Q(O){const w=[];return w.push(O.wrapS),w.push(O.wrapT),w.push(O.wrapR||0),w.push(O.magFilter),w.push(O.minFilter),w.push(O.anisotropy),w.push(O.internalFormat),w.push(O.format),w.push(O.type),w.push(O.generateMipmaps),w.push(O.premultiplyAlpha),w.push(O.flipY),w.push(O.unpackAlignment),w.push(O.colorSpace),w.join()}function ne(O,w){const ee=n.get(O);if(O.isVideoTexture&&Xe(O),O.isRenderTargetTexture===!1&&O.version>0&&ee.__version!==O.version){const de=O.image;if(de===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(de.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{ae(ee,O,w);return}}t.bindTexture(s.TEXTURE_2D,ee.__webglTexture,s.TEXTURE0+w)}function H(O,w){const ee=n.get(O);if(O.version>0&&ee.__version!==O.version){ae(ee,O,w);return}t.bindTexture(s.TEXTURE_2D_ARRAY,ee.__webglTexture,s.TEXTURE0+w)}function se(O,w){const ee=n.get(O);if(O.version>0&&ee.__version!==O.version){ae(ee,O,w);return}t.bindTexture(s.TEXTURE_3D,ee.__webglTexture,s.TEXTURE0+w)}function Z(O,w){const ee=n.get(O);if(O.version>0&&ee.__version!==O.version){le(ee,O,w);return}t.bindTexture(s.TEXTURE_CUBE_MAP,ee.__webglTexture,s.TEXTURE0+w)}const pe={[ai]:s.REPEAT,[Jn]:s.CLAMP_TO_EDGE,[No]:s.MIRRORED_REPEAT},be={[On]:s.NEAREST,[Bd]:s.NEAREST_MIPMAP_NEAREST,[fr]:s.NEAREST_MIPMAP_LINEAR,[Fn]:s.LINEAR,[La]:s.LINEAR_MIPMAP_NEAREST,[xi]:s.LINEAR_MIPMAP_LINEAR},Ce={[Wd]:s.NEVER,[Jd]:s.ALWAYS,[Xd]:s.LESS,[nu]:s.LEQUAL,[qd]:s.EQUAL,[$d]:s.GEQUAL,[jd]:s.GREATER,[Yd]:s.NOTEQUAL};function Ie(O,w){if(w.type===oi&&e.has("OES_texture_float_linear")===!1&&(w.magFilter===Fn||w.magFilter===La||w.magFilter===fr||w.magFilter===xi||w.minFilter===Fn||w.minFilter===La||w.minFilter===fr||w.minFilter===xi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(O,s.TEXTURE_WRAP_S,pe[w.wrapS]),s.texParameteri(O,s.TEXTURE_WRAP_T,pe[w.wrapT]),(O===s.TEXTURE_3D||O===s.TEXTURE_2D_ARRAY)&&s.texParameteri(O,s.TEXTURE_WRAP_R,pe[w.wrapR]),s.texParameteri(O,s.TEXTURE_MAG_FILTER,be[w.magFilter]),s.texParameteri(O,s.TEXTURE_MIN_FILTER,be[w.minFilter]),w.compareFunction&&(s.texParameteri(O,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(O,s.TEXTURE_COMPARE_FUNC,Ce[w.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===On||w.minFilter!==fr&&w.minFilter!==xi||w.type===oi&&e.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||n.get(w).__currentAnisotropy){const ee=e.get("EXT_texture_filter_anisotropic");s.texParameterf(O,ee.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy}}}function He(O,w){let ee=!1;O.__webglInit===void 0&&(O.__webglInit=!0,w.addEventListener("dispose",R));const de=w.source;let me=u.get(de);me===void 0&&(me={},u.set(de,me));const ce=Q(w);if(ce!==O.__cacheKey){me[ce]===void 0&&(me[ce]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,ee=!0),me[ce].usedTimes++;const ct=me[O.__cacheKey];ct!==void 0&&(me[O.__cacheKey].usedTimes--,ct.usedTimes===0&&S(w)),O.__cacheKey=ce,O.__webglTexture=me[ce].texture}return ee}function K(O,w,ee){return Math.floor(Math.floor(O/ee)/w)}function re(O,w,ee,de){const ce=O.updateRanges;if(ce.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,w.width,w.height,ee,de,w.data);else{ce.sort((xe,Ze)=>xe.start-Ze.start);let ct=0;for(let xe=1;xe<ce.length;xe++){const Ze=ce[ct],ft=ce[xe],_t=Ze.start+Ze.count,ke=K(ft.start,w.width,4),wt=K(Ze.start,w.width,4);ft.start<=_t+1&&ke===wt&&K(ft.start+ft.count-1,w.width,4)===ke?Ze.count=Math.max(Ze.count,ft.start+ft.count-Ze.start):(++ct,ce[ct]=ft)}ce.length=ct+1;const We=s.getParameter(s.UNPACK_ROW_LENGTH),st=s.getParameter(s.UNPACK_SKIP_PIXELS),rt=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,w.width);for(let xe=0,Ze=ce.length;xe<Ze;xe++){const ft=ce[xe],_t=Math.floor(ft.start/4),ke=Math.ceil(ft.count/4),wt=_t%w.width,q=Math.floor(_t/w.width),qe=ke,ye=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,wt),s.pixelStorei(s.UNPACK_SKIP_ROWS,q),t.texSubImage2D(s.TEXTURE_2D,0,wt,q,qe,ye,ee,de,w.data)}O.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,We),s.pixelStorei(s.UNPACK_SKIP_PIXELS,st),s.pixelStorei(s.UNPACK_SKIP_ROWS,rt)}}function ae(O,w,ee){let de=s.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(de=s.TEXTURE_2D_ARRAY),w.isData3DTexture&&(de=s.TEXTURE_3D);const me=He(O,w),ce=w.source;t.bindTexture(de,O.__webglTexture,s.TEXTURE0+ee);const ct=n.get(ce);if(ce.version!==ct.__version||me===!0){t.activeTexture(s.TEXTURE0+ee);const We=kt.getPrimaries(kt.workingColorSpace),st=w.colorSpace===Ni?null:kt.getPrimaries(w.colorSpace),rt=w.colorSpace===Ni||We===st?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,w.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,w.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,rt);let xe=_(w.image,!1,i.maxTextureSize);xe=gt(w,xe);const Ze=r.convert(w.format,w.colorSpace),ft=r.convert(w.type);let _t=b(w.internalFormat,Ze,ft,w.colorSpace,w.isVideoTexture);Ie(de,w);let ke;const wt=w.mipmaps,q=w.isVideoTexture!==!0,qe=ct.__version===void 0||me===!0,ye=ce.dataReady,et=U(w,xe);if(w.isDepthTexture)_t=M(w.format===ar,w.type),qe&&(q?t.texStorage2D(s.TEXTURE_2D,1,_t,xe.width,xe.height):t.texImage2D(s.TEXTURE_2D,0,_t,xe.width,xe.height,0,Ze,ft,null));else if(w.isDataTexture)if(wt.length>0){q&&qe&&t.texStorage2D(s.TEXTURE_2D,et,_t,wt[0].width,wt[0].height);for(let I=0,B=wt.length;I<B;I++)ke=wt[I],q?ye&&t.texSubImage2D(s.TEXTURE_2D,I,0,0,ke.width,ke.height,Ze,ft,ke.data):t.texImage2D(s.TEXTURE_2D,I,_t,ke.width,ke.height,0,Ze,ft,ke.data);w.generateMipmaps=!1}else q?(qe&&t.texStorage2D(s.TEXTURE_2D,et,_t,xe.width,xe.height),ye&&re(w,xe,Ze,ft)):t.texImage2D(s.TEXTURE_2D,0,_t,xe.width,xe.height,0,Ze,ft,xe.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){q&&qe&&t.texStorage3D(s.TEXTURE_2D_ARRAY,et,_t,wt[0].width,wt[0].height,xe.depth);for(let I=0,B=wt.length;I<B;I++)if(ke=wt[I],w.format!==Wn)if(Ze!==null)if(q){if(ye)if(w.layerUpdates.size>0){const $=jc(ke.width,ke.height,w.format,w.type);for(const oe of w.layerUpdates){const ue=ke.data.subarray(oe*$/ke.data.BYTES_PER_ELEMENT,(oe+1)*$/ke.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,I,0,0,oe,ke.width,ke.height,1,Ze,ue)}w.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,I,0,0,0,ke.width,ke.height,xe.depth,Ze,ke.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,I,_t,ke.width,ke.height,xe.depth,0,ke.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else q?ye&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,I,0,0,0,ke.width,ke.height,xe.depth,Ze,ft,ke.data):t.texImage3D(s.TEXTURE_2D_ARRAY,I,_t,ke.width,ke.height,xe.depth,0,Ze,ft,ke.data)}else{q&&qe&&t.texStorage2D(s.TEXTURE_2D,et,_t,wt[0].width,wt[0].height);for(let I=0,B=wt.length;I<B;I++)ke=wt[I],w.format!==Wn?Ze!==null?q?ye&&t.compressedTexSubImage2D(s.TEXTURE_2D,I,0,0,ke.width,ke.height,Ze,ke.data):t.compressedTexImage2D(s.TEXTURE_2D,I,_t,ke.width,ke.height,0,ke.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q?ye&&t.texSubImage2D(s.TEXTURE_2D,I,0,0,ke.width,ke.height,Ze,ft,ke.data):t.texImage2D(s.TEXTURE_2D,I,_t,ke.width,ke.height,0,Ze,ft,ke.data)}else if(w.isDataArrayTexture)if(q){if(qe&&t.texStorage3D(s.TEXTURE_2D_ARRAY,et,_t,xe.width,xe.height,xe.depth),ye)if(w.layerUpdates.size>0){const I=jc(xe.width,xe.height,w.format,w.type);for(const B of w.layerUpdates){const $=xe.data.subarray(B*I/xe.data.BYTES_PER_ELEMENT,(B+1)*I/xe.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,B,xe.width,xe.height,1,Ze,ft,$)}w.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,xe.width,xe.height,xe.depth,Ze,ft,xe.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,_t,xe.width,xe.height,xe.depth,0,Ze,ft,xe.data);else if(w.isData3DTexture)q?(qe&&t.texStorage3D(s.TEXTURE_3D,et,_t,xe.width,xe.height,xe.depth),ye&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,xe.width,xe.height,xe.depth,Ze,ft,xe.data)):t.texImage3D(s.TEXTURE_3D,0,_t,xe.width,xe.height,xe.depth,0,Ze,ft,xe.data);else if(w.isFramebufferTexture){if(qe)if(q)t.texStorage2D(s.TEXTURE_2D,et,_t,xe.width,xe.height);else{let I=xe.width,B=xe.height;for(let $=0;$<et;$++)t.texImage2D(s.TEXTURE_2D,$,_t,I,B,0,Ze,ft,null),I>>=1,B>>=1}}else if(wt.length>0){if(q&&qe){const I=on(wt[0]);t.texStorage2D(s.TEXTURE_2D,et,_t,I.width,I.height)}for(let I=0,B=wt.length;I<B;I++)ke=wt[I],q?ye&&t.texSubImage2D(s.TEXTURE_2D,I,0,0,Ze,ft,ke):t.texImage2D(s.TEXTURE_2D,I,_t,Ze,ft,ke);w.generateMipmaps=!1}else if(q){if(qe){const I=on(xe);t.texStorage2D(s.TEXTURE_2D,et,_t,I.width,I.height)}ye&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,Ze,ft,xe)}else t.texImage2D(s.TEXTURE_2D,0,_t,Ze,ft,xe);g(w)&&p(de),ct.__version=ce.version,w.onUpdate&&w.onUpdate(w)}O.__version=w.version}function le(O,w,ee){if(w.image.length!==6)return;const de=He(O,w),me=w.source;t.bindTexture(s.TEXTURE_CUBE_MAP,O.__webglTexture,s.TEXTURE0+ee);const ce=n.get(me);if(me.version!==ce.__version||de===!0){t.activeTexture(s.TEXTURE0+ee);const ct=kt.getPrimaries(kt.workingColorSpace),We=w.colorSpace===Ni?null:kt.getPrimaries(w.colorSpace),st=w.colorSpace===Ni||ct===We?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,w.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,w.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);const rt=w.isCompressedTexture||w.image[0].isCompressedTexture,xe=w.image[0]&&w.image[0].isDataTexture,Ze=[];for(let B=0;B<6;B++)!rt&&!xe?Ze[B]=_(w.image[B],!0,i.maxCubemapSize):Ze[B]=xe?w.image[B].image:w.image[B],Ze[B]=gt(w,Ze[B]);const ft=Ze[0],_t=r.convert(w.format,w.colorSpace),ke=r.convert(w.type),wt=b(w.internalFormat,_t,ke,w.colorSpace),q=w.isVideoTexture!==!0,qe=ce.__version===void 0||de===!0,ye=me.dataReady;let et=U(w,ft);Ie(s.TEXTURE_CUBE_MAP,w);let I;if(rt){q&&qe&&t.texStorage2D(s.TEXTURE_CUBE_MAP,et,wt,ft.width,ft.height);for(let B=0;B<6;B++){I=Ze[B].mipmaps;for(let $=0;$<I.length;$++){const oe=I[$];w.format!==Wn?_t!==null?q?ye&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$,0,0,oe.width,oe.height,_t,oe.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$,wt,oe.width,oe.height,0,oe.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$,0,0,oe.width,oe.height,_t,ke,oe.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$,wt,oe.width,oe.height,0,_t,ke,oe.data)}}}else{if(I=w.mipmaps,q&&qe){I.length>0&&et++;const B=on(Ze[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,et,wt,B.width,B.height)}for(let B=0;B<6;B++)if(xe){q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,0,0,Ze[B].width,Ze[B].height,_t,ke,Ze[B].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,wt,Ze[B].width,Ze[B].height,0,_t,ke,Ze[B].data);for(let $=0;$<I.length;$++){const ue=I[$].image[B].image;q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$+1,0,0,ue.width,ue.height,_t,ke,ue.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$+1,wt,ue.width,ue.height,0,_t,ke,ue.data)}}else{q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,0,0,_t,ke,Ze[B]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,0,wt,_t,ke,Ze[B]);for(let $=0;$<I.length;$++){const oe=I[$];q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$+1,0,0,_t,ke,oe.image[B]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+B,$+1,wt,_t,ke,oe.image[B])}}}g(w)&&p(s.TEXTURE_CUBE_MAP),ce.__version=me.version,w.onUpdate&&w.onUpdate(w)}O.__version=w.version}function Le(O,w,ee,de,me,ce){const ct=r.convert(ee.format,ee.colorSpace),We=r.convert(ee.type),st=b(ee.internalFormat,ct,We,ee.colorSpace),rt=n.get(w),xe=n.get(ee);if(xe.__renderTarget=w,!rt.__hasExternalTextures){const Ze=Math.max(1,w.width>>ce),ft=Math.max(1,w.height>>ce);me===s.TEXTURE_3D||me===s.TEXTURE_2D_ARRAY?t.texImage3D(me,ce,st,Ze,ft,w.depth,0,ct,We,null):t.texImage2D(me,ce,st,Ze,ft,0,ct,We,null)}t.bindFramebuffer(s.FRAMEBUFFER,O),mt(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,de,me,xe.__webglTexture,0,Ge(w)):(me===s.TEXTURE_2D||me>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&me<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,de,me,xe.__webglTexture,ce),t.bindFramebuffer(s.FRAMEBUFFER,null)}function ge(O,w,ee){if(s.bindRenderbuffer(s.RENDERBUFFER,O),w.depthBuffer){const de=w.depthTexture,me=de&&de.isDepthTexture?de.type:null,ce=M(w.stencilBuffer,me),ct=w.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,We=Ge(w);mt(w)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,We,ce,w.width,w.height):ee?s.renderbufferStorageMultisample(s.RENDERBUFFER,We,ce,w.width,w.height):s.renderbufferStorage(s.RENDERBUFFER,ce,w.width,w.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,ct,s.RENDERBUFFER,O)}else{const de=w.textures;for(let me=0;me<de.length;me++){const ce=de[me],ct=r.convert(ce.format,ce.colorSpace),We=r.convert(ce.type),st=b(ce.internalFormat,ct,We,ce.colorSpace),rt=Ge(w);ee&&mt(w)===!1?s.renderbufferStorageMultisample(s.RENDERBUFFER,rt,st,w.width,w.height):mt(w)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,rt,st,w.width,w.height):s.renderbufferStorage(s.RENDERBUFFER,st,w.width,w.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function Ae(O,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(s.FRAMEBUFFER,O),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const de=n.get(w.depthTexture);de.__renderTarget=w,(!de.__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),ne(w.depthTexture,0);const me=de.__webglTexture,ce=Ge(w);if(w.depthTexture.format===rr)mt(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,me,0,ce):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,me,0);else if(w.depthTexture.format===ar)mt(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,me,0,ce):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,me,0);else throw new Error("Unknown depthTexture format")}function lt(O){const w=n.get(O),ee=O.isWebGLCubeRenderTarget===!0;if(w.__boundDepthTexture!==O.depthTexture){const de=O.depthTexture;if(w.__depthDisposeCallback&&w.__depthDisposeCallback(),de){const me=()=>{delete w.__boundDepthTexture,delete w.__depthDisposeCallback,de.removeEventListener("dispose",me)};de.addEventListener("dispose",me),w.__depthDisposeCallback=me}w.__boundDepthTexture=de}if(O.depthTexture&&!w.__autoAllocateDepthBuffer){if(ee)throw new Error("target.depthTexture not supported in Cube render targets");const de=O.texture.mipmaps;de&&de.length>0?Ae(w.__webglFramebuffer[0],O):Ae(w.__webglFramebuffer,O)}else if(ee){w.__webglDepthbuffer=[];for(let de=0;de<6;de++)if(t.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer[de]),w.__webglDepthbuffer[de]===void 0)w.__webglDepthbuffer[de]=s.createRenderbuffer(),ge(w.__webglDepthbuffer[de],O,!1);else{const me=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,ce=w.__webglDepthbuffer[de];s.bindRenderbuffer(s.RENDERBUFFER,ce),s.framebufferRenderbuffer(s.FRAMEBUFFER,me,s.RENDERBUFFER,ce)}}else{const de=O.texture.mipmaps;if(de&&de.length>0?t.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer===void 0)w.__webglDepthbuffer=s.createRenderbuffer(),ge(w.__webglDepthbuffer,O,!1);else{const me=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,ce=w.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,ce),s.framebufferRenderbuffer(s.FRAMEBUFFER,me,s.RENDERBUFFER,ce)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function Et(O,w,ee){const de=n.get(O);w!==void 0&&Le(de.__webglFramebuffer,O,O.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),ee!==void 0&<(O)}function Mt(O){const w=O.texture,ee=n.get(O),de=n.get(w);O.addEventListener("dispose",P);const me=O.textures,ce=O.isWebGLCubeRenderTarget===!0,ct=me.length>1;if(ct||(de.__webglTexture===void 0&&(de.__webglTexture=s.createTexture()),de.__version=w.version,a.memory.textures++),ce){ee.__webglFramebuffer=[];for(let We=0;We<6;We++)if(w.mipmaps&&w.mipmaps.length>0){ee.__webglFramebuffer[We]=[];for(let st=0;st<w.mipmaps.length;st++)ee.__webglFramebuffer[We][st]=s.createFramebuffer()}else ee.__webglFramebuffer[We]=s.createFramebuffer()}else{if(w.mipmaps&&w.mipmaps.length>0){ee.__webglFramebuffer=[];for(let We=0;We<w.mipmaps.length;We++)ee.__webglFramebuffer[We]=s.createFramebuffer()}else ee.__webglFramebuffer=s.createFramebuffer();if(ct)for(let We=0,st=me.length;We<st;We++){const rt=n.get(me[We]);rt.__webglTexture===void 0&&(rt.__webglTexture=s.createTexture(),a.memory.textures++)}if(O.samples>0&&mt(O)===!1){ee.__webglMultisampledFramebuffer=s.createFramebuffer(),ee.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let We=0;We<me.length;We++){const st=me[We];ee.__webglColorRenderbuffer[We]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,ee.__webglColorRenderbuffer[We]);const rt=r.convert(st.format,st.colorSpace),xe=r.convert(st.type),Ze=b(st.internalFormat,rt,xe,st.colorSpace,O.isXRRenderTarget===!0),ft=Ge(O);s.renderbufferStorageMultisample(s.RENDERBUFFER,ft,Ze,O.width,O.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+We,s.RENDERBUFFER,ee.__webglColorRenderbuffer[We])}s.bindRenderbuffer(s.RENDERBUFFER,null),O.depthBuffer&&(ee.__webglDepthRenderbuffer=s.createRenderbuffer(),ge(ee.__webglDepthRenderbuffer,O,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(ce){t.bindTexture(s.TEXTURE_CUBE_MAP,de.__webglTexture),Ie(s.TEXTURE_CUBE_MAP,w);for(let We=0;We<6;We++)if(w.mipmaps&&w.mipmaps.length>0)for(let st=0;st<w.mipmaps.length;st++)Le(ee.__webglFramebuffer[We][st],O,w,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+We,st);else Le(ee.__webglFramebuffer[We],O,w,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+We,0);g(w)&&p(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(ct){for(let We=0,st=me.length;We<st;We++){const rt=me[We],xe=n.get(rt);t.bindTexture(s.TEXTURE_2D,xe.__webglTexture),Ie(s.TEXTURE_2D,rt),Le(ee.__webglFramebuffer,O,rt,s.COLOR_ATTACHMENT0+We,s.TEXTURE_2D,0),g(rt)&&p(s.TEXTURE_2D)}t.unbindTexture()}else{let We=s.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(We=O.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(We,de.__webglTexture),Ie(We,w),w.mipmaps&&w.mipmaps.length>0)for(let st=0;st<w.mipmaps.length;st++)Le(ee.__webglFramebuffer[st],O,w,s.COLOR_ATTACHMENT0,We,st);else Le(ee.__webglFramebuffer,O,w,s.COLOR_ATTACHMENT0,We,0);g(w)&&p(We),t.unbindTexture()}O.depthBuffer&<(O)}function z(O){const w=O.textures;for(let ee=0,de=w.length;ee<de;ee++){const me=w[ee];if(g(me)){const ce=E(O),ct=n.get(me).__webglTexture;t.bindTexture(ce,ct),p(ce),t.unbindTexture()}}}const Wt=[],Rt=[];function At(O){if(O.samples>0){if(mt(O)===!1){const w=O.textures,ee=O.width,de=O.height;let me=s.COLOR_BUFFER_BIT;const ce=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,ct=n.get(O),We=w.length>1;if(We)for(let rt=0;rt<w.length;rt++)t.bindFramebuffer(s.FRAMEBUFFER,ct.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+rt,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,ct.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+rt,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,ct.__webglMultisampledFramebuffer);const st=O.texture.mipmaps;st&&st.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,ct.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,ct.__webglFramebuffer);for(let rt=0;rt<w.length;rt++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(me|=s.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(me|=s.STENCIL_BUFFER_BIT)),We){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,ct.__webglColorRenderbuffer[rt]);const xe=n.get(w[rt]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,xe,0)}s.blitFramebuffer(0,0,ee,de,0,0,ee,de,me,s.NEAREST),l===!0&&(Wt.length=0,Rt.length=0,Wt.push(s.COLOR_ATTACHMENT0+rt),O.depthBuffer&&O.resolveDepthBuffer===!1&&(Wt.push(ce),Rt.push(ce),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Rt)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,Wt))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),We)for(let rt=0;rt<w.length;rt++){t.bindFramebuffer(s.FRAMEBUFFER,ct.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+rt,s.RENDERBUFFER,ct.__webglColorRenderbuffer[rt]);const xe=n.get(w[rt]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,ct.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+rt,s.TEXTURE_2D,xe,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,ct.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&l){const w=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[w])}}}function Ge(O){return Math.min(i.maxSamples,O.samples)}function mt(O){const w=n.get(O);return O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function Xe(O){const w=a.render.frame;h.get(O)!==w&&(h.set(O,w),O.update())}function gt(O,w){const ee=O.colorSpace,de=O.format,me=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||ee!==Ds&&ee!==Ni&&(kt.getTransfer(ee)===rn?(de!==Wn||me!==ci)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ee)),w}function on(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(c.width=O.naturalWidth||O.width,c.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(c.width=O.displayWidth,c.height=O.displayHeight):(c.width=O.width,c.height=O.height),c}this.allocateTextureUnit=X,this.resetTextureUnits=W,this.setTexture2D=ne,this.setTexture2DArray=H,this.setTexture3D=se,this.setTextureCube=Z,this.rebindTextures=Et,this.setupRenderTarget=Mt,this.updateRenderTargetMipmap=z,this.updateMultisampleRenderTarget=At,this.setupDepthRenderbuffer=lt,this.setupFrameBufferTexture=Le,this.useMultisampledRTT=mt}function ug(s,e){function t(n,i=Ni){let r;const a=kt.getTransfer(i);if(n===ci)return s.UNSIGNED_BYTE;if(n===Sl)return s.UNSIGNED_SHORT_4_4_4_4;if(n===bl)return s.UNSIGNED_SHORT_5_5_5_1;if(n===Jh)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===Yh)return s.BYTE;if(n===$h)return s.SHORT;if(n===ir)return s.UNSIGNED_SHORT;if(n===Ml)return s.INT;if(n===es)return s.UNSIGNED_INT;if(n===oi)return s.FLOAT;if(n===cr)return s.HALF_FLOAT;if(n===Kh)return s.ALPHA;if(n===Zh)return s.RGB;if(n===Wn)return s.RGBA;if(n===rr)return s.DEPTH_COMPONENT;if(n===ar)return s.DEPTH_STENCIL;if(n===Qh)return s.RED;if(n===El)return s.RED_INTEGER;if(n===eu)return s.RG;if(n===Al)return s.RG_INTEGER;if(n===wl)return s.RGBA_INTEGER;if(n===ta||n===na||n===ia||n===sa)if(a===rn)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===ta)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===ia)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===sa)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===ta)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===ia)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===sa)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Io||n===Fo||n===Oo||n===zo)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Io)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Fo)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Oo)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===zo)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Bo||n===ko||n===Vo)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Bo||n===ko)return a===rn?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Vo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Ho||n===Go||n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo||n===Qo||n===el||n===tl)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Ho)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Go)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Wo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Xo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===qo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===jo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Yo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===$o)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Jo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ko)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Zo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Qo)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===el)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===tl)return a===rn?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===ra||n===nl||n===il)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===ra)return a===rn?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===nl)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===il)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===tu||n===sl||n===rl||n===al)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===ra)return r.COMPRESSED_RED_RGTC1_EXT;if(n===sl)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===rl)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===al)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===sr?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const dg=`
|
|
3803
|
+
}`;function lg(s,e,t){let n=new Nl;const i=new Qe,r=new Qe,a=new Xt,o=new fp({depthPacking:Gd}),l=new pp,c={},h=t.maxTextureSize,f={[Xn]:Rn,[Rn]:Xn,[wn]:wn},u=new Si({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Qe},radius:{value:4}},vertexShader:ag,fragmentShader:og}),d=u.clone();d.defines.HORIZONTAL_PASS=1;const m=new hn;m.setAttribute("position",new dn(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new en(m,u),g=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Wh;let p=this.type;this.render=function(C,P,D){if(g.enabled===!1||g.autoUpdate===!1&&g.needsUpdate===!1||C.length===0)return;const E=s.getRenderTarget(),y=s.getActiveCubeFace(),U=s.getActiveMipmapLevel(),G=s.state;G.setBlending(Fi),G.buffers.color.setClear(1,1,1,1),G.buffers.depth.setTest(!0),G.setScissorTest(!1);const X=p!==vi&&this.type===vi,Z=p===vi&&this.type!==vi;for(let ie=0,H=C.length;ie<H;ie++){const oe=C[ie],Y=oe.shadow;if(Y===void 0){console.warn("THREE.WebGLShadowMap:",oe,"has no shadow.");continue}if(Y.autoUpdate===!1&&Y.needsUpdate===!1)continue;i.copy(Y.mapSize);const me=Y.getFrameExtents();if(i.multiply(me),r.copy(Y.mapSize),(i.x>h||i.y>h)&&(i.x>h&&(r.x=Math.floor(h/me.x),i.x=r.x*me.x,Y.mapSize.x=r.x),i.y>h&&(r.y=Math.floor(h/me.y),i.y=r.y*me.y,Y.mapSize.y=r.y)),Y.map===null||X===!0||Z===!0){const Ce=this.type!==vi?{minFilter:On,magFilter:On}:{};Y.map!==null&&Y.map.dispose(),Y.map=new ts(i.x,i.y,Ce),Y.map.texture.name=oe.name+".shadowMap",Y.camera.updateProjectionMatrix()}s.setRenderTarget(Y.map),s.clear();const Me=Y.getViewportCount();for(let Ce=0;Ce<Me;Ce++){const Ye=Y.getViewport(Ce);a.set(r.x*Ye.x,r.y*Ye.y,r.x*Ye.z,r.y*Ye.w),G.viewport(a),Y.updateMatrices(oe,Ce),n=Y.getFrustum(),b(P,D,Y.camera,oe,this.type)}Y.isPointLightShadow!==!0&&this.type===vi&&S(Y,D),Y.needsUpdate=!1}p=this.type,g.needsUpdate=!1,s.setRenderTarget(E,y,U)};function S(C,P){const D=e.update(_);u.defines.VSM_SAMPLES!==C.blurSamples&&(u.defines.VSM_SAMPLES=C.blurSamples,d.defines.VSM_SAMPLES=C.blurSamples,u.needsUpdate=!0,d.needsUpdate=!0),C.mapPass===null&&(C.mapPass=new ts(i.x,i.y)),u.uniforms.shadow_pass.value=C.map.texture,u.uniforms.resolution.value=C.mapSize,u.uniforms.radius.value=C.radius,s.setRenderTarget(C.mapPass),s.clear(),s.renderBufferDirect(P,null,D,u,_,null),d.uniforms.shadow_pass.value=C.mapPass.texture,d.uniforms.resolution.value=C.mapSize,d.uniforms.radius.value=C.radius,s.setRenderTarget(C.map),s.clear(),s.renderBufferDirect(P,null,D,d,_,null)}function A(C,P,D,E){let y=null;const U=D.isPointLight===!0?C.customDistanceMaterial:C.customDepthMaterial;if(U!==void 0)y=U;else if(y=D.isPointLight===!0?l:o,s.localClippingEnabled&&P.clipShadows===!0&&Array.isArray(P.clippingPlanes)&&P.clippingPlanes.length!==0||P.displacementMap&&P.displacementScale!==0||P.alphaMap&&P.alphaTest>0||P.map&&P.alphaTest>0||P.alphaToCoverage===!0){const G=y.uuid,X=P.uuid;let Z=c[G];Z===void 0&&(Z={},c[G]=Z);let ie=Z[X];ie===void 0&&(ie=y.clone(),Z[X]=ie,P.addEventListener("dispose",N)),y=ie}if(y.visible=P.visible,y.wireframe=P.wireframe,E===vi?y.side=P.shadowSide!==null?P.shadowSide:P.side:y.side=P.shadowSide!==null?P.shadowSide:f[P.side],y.alphaMap=P.alphaMap,y.alphaTest=P.alphaToCoverage===!0?.5:P.alphaTest,y.map=P.map,y.clipShadows=P.clipShadows,y.clippingPlanes=P.clippingPlanes,y.clipIntersection=P.clipIntersection,y.displacementMap=P.displacementMap,y.displacementScale=P.displacementScale,y.displacementBias=P.displacementBias,y.wireframeLinewidth=P.wireframeLinewidth,y.linewidth=P.linewidth,D.isPointLight===!0&&y.isMeshDistanceMaterial===!0){const G=s.properties.get(y);G.light=D}return y}function b(C,P,D,E,y){if(C.visible===!1)return;if(C.layers.test(P.layers)&&(C.isMesh||C.isLine||C.isPoints)&&(C.castShadow||C.receiveShadow&&y===vi)&&(!C.frustumCulled||n.intersectsObject(C))){C.modelViewMatrix.multiplyMatrices(D.matrixWorldInverse,C.matrixWorld);const X=e.update(C),Z=C.material;if(Array.isArray(Z)){const ie=X.groups;for(let H=0,oe=ie.length;H<oe;H++){const Y=ie[H],me=Z[Y.materialIndex];if(me&&me.visible){const Me=A(C,me,E,y);C.onBeforeShadow(s,C,P,D,X,Me,Y),s.renderBufferDirect(D,null,X,Me,C,Y),C.onAfterShadow(s,C,P,D,X,Me,Y)}}}else if(Z.visible){const ie=A(C,Z,E,y);C.onBeforeShadow(s,C,P,D,X,ie,null),s.renderBufferDirect(D,null,X,ie,C,null),C.onAfterShadow(s,C,P,D,X,ie,null)}}const G=C.children;for(let X=0,Z=G.length;X<Z;X++)b(G[X],P,D,E,y)}function N(C){C.target.removeEventListener("dispose",N);for(const D in c){const E=c[D],y=C.target.uuid;y in E&&(E[y].dispose(),delete E[y])}}}const cg={[Ao]:wo,[To]:Lo,[Co]:Po,[Rs]:Ro,[wo]:Ao,[Lo]:To,[Po]:Co,[Ro]:Rs};function hg(s,e){function t(){let q=!1;const qe=new Xt;let ye=null;const et=new Xt(0,0,0,0);return{setMask:function(Ae){ye!==Ae&&!q&&(s.colorMask(Ae,Ae,Ae,Ae),ye=Ae)},setLocked:function(Ae){q=Ae},setClear:function(Ae,I,k,Q,pe){pe===!0&&(Ae*=Q,I*=Q,k*=Q),qe.set(Ae,I,k,Q),et.equals(qe)===!1&&(s.clearColor(Ae,I,k,Q),et.copy(qe))},reset:function(){q=!1,ye=null,et.set(-1,0,0,0)}}}function n(){let q=!1,qe=!1,ye=null,et=null,Ae=null;return{setReversed:function(I){if(qe!==I){const k=e.get("EXT_clip_control");I?k.clipControlEXT(k.LOWER_LEFT_EXT,k.ZERO_TO_ONE_EXT):k.clipControlEXT(k.LOWER_LEFT_EXT,k.NEGATIVE_ONE_TO_ONE_EXT),qe=I;const Q=Ae;Ae=null,this.setClear(Q)}},getReversed:function(){return qe},setTest:function(I){I?ae(s.DEPTH_TEST):Ie(s.DEPTH_TEST)},setMask:function(I){ye!==I&&!q&&(s.depthMask(I),ye=I)},setFunc:function(I){if(qe&&(I=cg[I]),et!==I){switch(I){case Ao:s.depthFunc(s.NEVER);break;case wo:s.depthFunc(s.ALWAYS);break;case To:s.depthFunc(s.LESS);break;case Rs:s.depthFunc(s.LEQUAL);break;case Co:s.depthFunc(s.EQUAL);break;case Ro:s.depthFunc(s.GEQUAL);break;case Lo:s.depthFunc(s.GREATER);break;case Po:s.depthFunc(s.NOTEQUAL);break;default:s.depthFunc(s.LEQUAL)}et=I}},setLocked:function(I){q=I},setClear:function(I){Ae!==I&&(qe&&(I=1-I),s.clearDepth(I),Ae=I)},reset:function(){q=!1,ye=null,et=null,Ae=null,qe=!1}}}function i(){let q=!1,qe=null,ye=null,et=null,Ae=null,I=null,k=null,Q=null,pe=null;return{setTest:function(se){q||(se?ae(s.STENCIL_TEST):Ie(s.STENCIL_TEST))},setMask:function(se){qe!==se&&!q&&(s.stencilMask(se),qe=se)},setFunc:function(se,he,we){(ye!==se||et!==he||Ae!==we)&&(s.stencilFunc(se,he,we),ye=se,et=he,Ae=we)},setOp:function(se,he,we){(I!==se||k!==he||Q!==we)&&(s.stencilOp(se,he,we),I=se,k=he,Q=we)},setLocked:function(se){q=se},setClear:function(se){pe!==se&&(s.clearStencil(se),pe=se)},reset:function(){q=!1,qe=null,ye=null,et=null,Ae=null,I=null,k=null,Q=null,pe=null}}}const r=new t,a=new n,o=new i,l=new WeakMap,c=new WeakMap;let h={},f={},u=new WeakMap,d=[],m=null,_=!1,g=null,p=null,S=null,A=null,b=null,N=null,C=null,P=new xt(0,0,0),D=0,E=!1,y=null,U=null,G=null,X=null,Z=null;const ie=s.getParameter(s.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let H=!1,oe=0;const Y=s.getParameter(s.VERSION);Y.indexOf("WebGL")!==-1?(oe=parseFloat(/^WebGL (\d)/.exec(Y)[1]),H=oe>=1):Y.indexOf("OpenGL ES")!==-1&&(oe=parseFloat(/^OpenGL ES (\d)/.exec(Y)[1]),H=oe>=2);let me=null,Me={};const Ce=s.getParameter(s.SCISSOR_BOX),Ye=s.getParameter(s.VIEWPORT),Oe=new Xt().fromArray(Ce),K=new Xt().fromArray(Ye);function te(q,qe,ye,et){const Ae=new Uint8Array(4),I=s.createTexture();s.bindTexture(q,I),s.texParameteri(q,s.TEXTURE_MIN_FILTER,s.NEAREST),s.texParameteri(q,s.TEXTURE_MAG_FILTER,s.NEAREST);for(let k=0;k<ye;k++)q===s.TEXTURE_3D||q===s.TEXTURE_2D_ARRAY?s.texImage3D(qe,0,s.RGBA,1,1,et,0,s.RGBA,s.UNSIGNED_BYTE,Ae):s.texImage2D(qe+k,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,Ae);return I}const re={};re[s.TEXTURE_2D]=te(s.TEXTURE_2D,s.TEXTURE_2D,1),re[s.TEXTURE_CUBE_MAP]=te(s.TEXTURE_CUBE_MAP,s.TEXTURE_CUBE_MAP_POSITIVE_X,6),re[s.TEXTURE_2D_ARRAY]=te(s.TEXTURE_2D_ARRAY,s.TEXTURE_2D_ARRAY,1,1),re[s.TEXTURE_3D]=te(s.TEXTURE_3D,s.TEXTURE_3D,1,1),r.setClear(0,0,0,1),a.setClear(1),o.setClear(0),ae(s.DEPTH_TEST),a.setFunc(Rs),Pt(!1),Ct(jl),ae(s.CULL_FACE),z(Fi);function ae(q){h[q]!==!0&&(s.enable(q),h[q]=!0)}function Ie(q){h[q]!==!1&&(s.disable(q),h[q]=!1)}function ge(q,qe){return f[q]!==qe?(s.bindFramebuffer(q,qe),f[q]=qe,q===s.DRAW_FRAMEBUFFER&&(f[s.FRAMEBUFFER]=qe),q===s.FRAMEBUFFER&&(f[s.DRAW_FRAMEBUFFER]=qe),!0):!1}function Re(q,qe){let ye=d,et=!1;if(q){ye=u.get(qe),ye===void 0&&(ye=[],u.set(qe,ye));const Ae=q.textures;if(ye.length!==Ae.length||ye[0]!==s.COLOR_ATTACHMENT0){for(let I=0,k=Ae.length;I<k;I++)ye[I]=s.COLOR_ATTACHMENT0+I;ye.length=Ae.length,et=!0}}else ye[0]!==s.BACK&&(ye[0]=s.BACK,et=!0);et&&s.drawBuffers(ye)}function nt(q){return m!==q?(s.useProgram(q),m=q,!0):!1}const yt={[Ji]:s.FUNC_ADD,[pd]:s.FUNC_SUBTRACT,[md]:s.FUNC_REVERSE_SUBTRACT};yt[gd]=s.MIN,yt[_d]=s.MAX;const At={[vd]:s.ZERO,[xd]:s.ONE,[yd]:s.SRC_COLOR,[So]:s.SRC_ALPHA,[wd]:s.SRC_ALPHA_SATURATE,[Ed]:s.DST_COLOR,[bd]:s.DST_ALPHA,[Md]:s.ONE_MINUS_SRC_COLOR,[Eo]:s.ONE_MINUS_SRC_ALPHA,[Ad]:s.ONE_MINUS_DST_COLOR,[Sd]:s.ONE_MINUS_DST_ALPHA,[Td]:s.CONSTANT_COLOR,[Cd]:s.ONE_MINUS_CONSTANT_COLOR,[Rd]:s.CONSTANT_ALPHA,[Ld]:s.ONE_MINUS_CONSTANT_ALPHA};function z(q,qe,ye,et,Ae,I,k,Q,pe,se){if(q===Fi){_===!0&&(Ie(s.BLEND),_=!1);return}if(_===!1&&(ae(s.BLEND),_=!0),q!==fd){if(q!==g||se!==E){if((p!==Ji||b!==Ji)&&(s.blendEquation(s.FUNC_ADD),p=Ji,b=Ji),se)switch(q){case As:s.blendFuncSeparate(s.ONE,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yl:s.blendFunc(s.ONE,s.ONE);break;case $l:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Jl:s.blendFuncSeparate(s.ZERO,s.SRC_COLOR,s.ZERO,s.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}else switch(q){case As:s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA);break;case Yl:s.blendFunc(s.SRC_ALPHA,s.ONE);break;case $l:s.blendFuncSeparate(s.ZERO,s.ONE_MINUS_SRC_COLOR,s.ZERO,s.ONE);break;case Jl:s.blendFunc(s.ZERO,s.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",q);break}S=null,A=null,N=null,C=null,P.set(0,0,0),D=0,g=q,E=se}return}Ae=Ae||qe,I=I||ye,k=k||et,(qe!==p||Ae!==b)&&(s.blendEquationSeparate(yt[qe],yt[Ae]),p=qe,b=Ae),(ye!==S||et!==A||I!==N||k!==C)&&(s.blendFuncSeparate(At[ye],At[et],At[I],At[k]),S=ye,A=et,N=I,C=k),(Q.equals(P)===!1||pe!==D)&&(s.blendColor(Q.r,Q.g,Q.b,pe),P.copy(Q),D=pe),g=q,E=!1}function Ot(q,qe){q.side===wn?Ie(s.CULL_FACE):ae(s.CULL_FACE);let ye=q.side===Rn;qe&&(ye=!ye),Pt(ye),q.blending===As&&q.transparent===!1?z(Fi):z(q.blending,q.blendEquation,q.blendSrc,q.blendDst,q.blendEquationAlpha,q.blendSrcAlpha,q.blendDstAlpha,q.blendColor,q.blendAlpha,q.premultipliedAlpha),a.setFunc(q.depthFunc),a.setTest(q.depthTest),a.setMask(q.depthWrite),r.setMask(q.colorWrite);const et=q.stencilWrite;o.setTest(et),et&&(o.setMask(q.stencilWriteMask),o.setFunc(q.stencilFunc,q.stencilRef,q.stencilFuncMask),o.setOp(q.stencilFail,q.stencilZFail,q.stencilZPass)),gt(q.polygonOffset,q.polygonOffsetFactor,q.polygonOffsetUnits),q.alphaToCoverage===!0?ae(s.SAMPLE_ALPHA_TO_COVERAGE):Ie(s.SAMPLE_ALPHA_TO_COVERAGE)}function Pt(q){y!==q&&(q?s.frontFace(s.CW):s.frontFace(s.CCW),y=q)}function Ct(q){q!==ud?(ae(s.CULL_FACE),q!==U&&(q===jl?s.cullFace(s.BACK):q===dd?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK))):Ie(s.CULL_FACE),U=q}function Xe(q){q!==G&&(H&&s.lineWidth(q),G=q)}function gt(q,qe,ye){q?(ae(s.POLYGON_OFFSET_FILL),(X!==qe||Z!==ye)&&(s.polygonOffset(qe,ye),X=qe,Z=ye)):Ie(s.POLYGON_OFFSET_FILL)}function je(q){q?ae(s.SCISSOR_TEST):Ie(s.SCISSOR_TEST)}function _t(q){q===void 0&&(q=s.TEXTURE0+ie-1),me!==q&&(s.activeTexture(q),me=q)}function ln(q,qe,ye){ye===void 0&&(me===null?ye=s.TEXTURE0+ie-1:ye=me);let et=Me[ye];et===void 0&&(et={type:void 0,texture:void 0},Me[ye]=et),(et.type!==q||et.texture!==qe)&&(me!==ye&&(s.activeTexture(ye),me=ye),s.bindTexture(q,qe||re[q]),et.type=q,et.texture=qe)}function O(){const q=Me[me];q!==void 0&&q.type!==void 0&&(s.bindTexture(q.type,null),q.type=void 0,q.texture=void 0)}function w(){try{s.compressedTexImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ee(){try{s.compressedTexImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function de(){try{s.texSubImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function _e(){try{s.texSubImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function le(){try{s.compressedTexSubImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function lt(){try{s.compressedTexSubImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function He(){try{s.texStorage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function st(){try{s.texStorage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ot(){try{s.texImage2D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function ve(){try{s.texImage3D(...arguments)}catch(q){console.error("THREE.WebGLState:",q)}}function Ze(q){Oe.equals(q)===!1&&(s.scissor(q.x,q.y,q.z,q.w),Oe.copy(q))}function Mt(q){K.equals(q)===!1&&(s.viewport(q.x,q.y,q.z,q.w),K.copy(q))}function ft(q,qe){let ye=c.get(qe);ye===void 0&&(ye=new WeakMap,c.set(qe,ye));let et=ye.get(q);et===void 0&&(et=s.getUniformBlockIndex(qe,q.name),ye.set(q,et))}function Ge(q,qe){const et=c.get(qe).get(q);l.get(qe)!==et&&(s.uniformBlockBinding(qe,et,q.__bindingPointIndex),l.set(qe,et))}function Rt(){s.disable(s.BLEND),s.disable(s.CULL_FACE),s.disable(s.DEPTH_TEST),s.disable(s.POLYGON_OFFSET_FILL),s.disable(s.SCISSOR_TEST),s.disable(s.STENCIL_TEST),s.disable(s.SAMPLE_ALPHA_TO_COVERAGE),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ONE,s.ZERO),s.blendFuncSeparate(s.ONE,s.ZERO,s.ONE,s.ZERO),s.blendColor(0,0,0,0),s.colorMask(!0,!0,!0,!0),s.clearColor(0,0,0,0),s.depthMask(!0),s.depthFunc(s.LESS),a.setReversed(!1),s.clearDepth(1),s.stencilMask(4294967295),s.stencilFunc(s.ALWAYS,0,4294967295),s.stencilOp(s.KEEP,s.KEEP,s.KEEP),s.clearStencil(0),s.cullFace(s.BACK),s.frontFace(s.CCW),s.polygonOffset(0,0),s.activeTexture(s.TEXTURE0),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.useProgram(null),s.lineWidth(1),s.scissor(0,0,s.canvas.width,s.canvas.height),s.viewport(0,0,s.canvas.width,s.canvas.height),h={},me=null,Me={},f={},u=new WeakMap,d=[],m=null,_=!1,g=null,p=null,S=null,A=null,b=null,N=null,C=null,P=new xt(0,0,0),D=0,E=!1,y=null,U=null,G=null,X=null,Z=null,Oe.set(0,0,s.canvas.width,s.canvas.height),K.set(0,0,s.canvas.width,s.canvas.height),r.reset(),a.reset(),o.reset()}return{buffers:{color:r,depth:a,stencil:o},enable:ae,disable:Ie,bindFramebuffer:ge,drawBuffers:Re,useProgram:nt,setBlending:z,setMaterial:Ot,setFlipSided:Pt,setCullFace:Ct,setLineWidth:Xe,setPolygonOffset:gt,setScissorTest:je,activeTexture:_t,bindTexture:ln,unbindTexture:O,compressedTexImage2D:w,compressedTexImage3D:ee,texImage2D:ot,texImage3D:ve,updateUBOMapping:ft,uniformBlockBinding:Ge,texStorage2D:He,texStorage3D:st,texSubImage2D:de,texSubImage3D:_e,compressedTexSubImage2D:le,compressedTexSubImage3D:lt,scissor:Ze,viewport:Mt,reset:Rt}}function ug(s,e,t,n,i,r,a){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,l=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),c=new Qe,h=new WeakMap;let f;const u=new WeakMap;let d=!1;try{d=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function m(O,w){return d?new OffscreenCanvas(O,w):or("canvas")}function _(O,w,ee){let de=1;const _e=ln(O);if((_e.width>ee||_e.height>ee)&&(de=ee/Math.max(_e.width,_e.height)),de<1)if(typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&O instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&O instanceof ImageBitmap||typeof VideoFrame<"u"&&O instanceof VideoFrame){const le=Math.floor(de*_e.width),lt=Math.floor(de*_e.height);f===void 0&&(f=m(le,lt));const He=w?m(le,lt):f;return He.width=le,He.height=lt,He.getContext("2d").drawImage(O,0,0,le,lt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+_e.width+"x"+_e.height+") to ("+le+"x"+lt+")."),He}else return"data"in O&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+_e.width+"x"+_e.height+")."),O;return O}function g(O){return O.generateMipmaps}function p(O){s.generateMipmap(O)}function S(O){return O.isWebGLCubeRenderTarget?s.TEXTURE_CUBE_MAP:O.isWebGL3DRenderTarget?s.TEXTURE_3D:O.isWebGLArrayRenderTarget||O.isCompressedArrayTexture?s.TEXTURE_2D_ARRAY:s.TEXTURE_2D}function A(O,w,ee,de,_e=!1){if(O!==null){if(s[O]!==void 0)return s[O];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+O+"'")}let le=w;if(w===s.RED&&(ee===s.FLOAT&&(le=s.R32F),ee===s.HALF_FLOAT&&(le=s.R16F),ee===s.UNSIGNED_BYTE&&(le=s.R8)),w===s.RED_INTEGER&&(ee===s.UNSIGNED_BYTE&&(le=s.R8UI),ee===s.UNSIGNED_SHORT&&(le=s.R16UI),ee===s.UNSIGNED_INT&&(le=s.R32UI),ee===s.BYTE&&(le=s.R8I),ee===s.SHORT&&(le=s.R16I),ee===s.INT&&(le=s.R32I)),w===s.RG&&(ee===s.FLOAT&&(le=s.RG32F),ee===s.HALF_FLOAT&&(le=s.RG16F),ee===s.UNSIGNED_BYTE&&(le=s.RG8)),w===s.RG_INTEGER&&(ee===s.UNSIGNED_BYTE&&(le=s.RG8UI),ee===s.UNSIGNED_SHORT&&(le=s.RG16UI),ee===s.UNSIGNED_INT&&(le=s.RG32UI),ee===s.BYTE&&(le=s.RG8I),ee===s.SHORT&&(le=s.RG16I),ee===s.INT&&(le=s.RG32I)),w===s.RGB_INTEGER&&(ee===s.UNSIGNED_BYTE&&(le=s.RGB8UI),ee===s.UNSIGNED_SHORT&&(le=s.RGB16UI),ee===s.UNSIGNED_INT&&(le=s.RGB32UI),ee===s.BYTE&&(le=s.RGB8I),ee===s.SHORT&&(le=s.RGB16I),ee===s.INT&&(le=s.RGB32I)),w===s.RGBA_INTEGER&&(ee===s.UNSIGNED_BYTE&&(le=s.RGBA8UI),ee===s.UNSIGNED_SHORT&&(le=s.RGBA16UI),ee===s.UNSIGNED_INT&&(le=s.RGBA32UI),ee===s.BYTE&&(le=s.RGBA8I),ee===s.SHORT&&(le=s.RGBA16I),ee===s.INT&&(le=s.RGBA32I)),w===s.RGB&&ee===s.UNSIGNED_INT_5_9_9_9_REV&&(le=s.RGB9_E5),w===s.RGBA){const lt=_e?da:Wt.getTransfer(de);ee===s.FLOAT&&(le=s.RGBA32F),ee===s.HALF_FLOAT&&(le=s.RGBA16F),ee===s.UNSIGNED_BYTE&&(le=lt===an?s.SRGB8_ALPHA8:s.RGBA8),ee===s.UNSIGNED_SHORT_4_4_4_4&&(le=s.RGBA4),ee===s.UNSIGNED_SHORT_5_5_5_1&&(le=s.RGB5_A1)}return(le===s.R16F||le===s.R32F||le===s.RG16F||le===s.RG32F||le===s.RGBA16F||le===s.RGBA32F)&&e.get("EXT_color_buffer_float"),le}function b(O,w){let ee;return O?w===null||w===es||w===sr?ee=s.DEPTH24_STENCIL8:w===oi?ee=s.DEPTH32F_STENCIL8:w===ir&&(ee=s.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):w===null||w===es||w===sr?ee=s.DEPTH_COMPONENT24:w===oi?ee=s.DEPTH_COMPONENT32F:w===ir&&(ee=s.DEPTH_COMPONENT16),ee}function N(O,w){return g(O)===!0||O.isFramebufferTexture&&O.minFilter!==On&&O.minFilter!==Fn?Math.log2(Math.max(w.width,w.height))+1:O.mipmaps!==void 0&&O.mipmaps.length>0?O.mipmaps.length:O.isCompressedTexture&&Array.isArray(O.image)?w.mipmaps.length:1}function C(O){const w=O.target;w.removeEventListener("dispose",C),D(w),w.isVideoTexture&&h.delete(w)}function P(O){const w=O.target;w.removeEventListener("dispose",P),y(w)}function D(O){const w=n.get(O);if(w.__webglInit===void 0)return;const ee=O.source,de=u.get(ee);if(de){const _e=de[w.__cacheKey];_e.usedTimes--,_e.usedTimes===0&&E(O),Object.keys(de).length===0&&u.delete(ee)}n.remove(O)}function E(O){const w=n.get(O);s.deleteTexture(w.__webglTexture);const ee=O.source,de=u.get(ee);delete de[w.__cacheKey],a.memory.textures--}function y(O){const w=n.get(O);if(O.depthTexture&&(O.depthTexture.dispose(),n.remove(O.depthTexture)),O.isWebGLCubeRenderTarget)for(let de=0;de<6;de++){if(Array.isArray(w.__webglFramebuffer[de]))for(let _e=0;_e<w.__webglFramebuffer[de].length;_e++)s.deleteFramebuffer(w.__webglFramebuffer[de][_e]);else s.deleteFramebuffer(w.__webglFramebuffer[de]);w.__webglDepthbuffer&&s.deleteRenderbuffer(w.__webglDepthbuffer[de])}else{if(Array.isArray(w.__webglFramebuffer))for(let de=0;de<w.__webglFramebuffer.length;de++)s.deleteFramebuffer(w.__webglFramebuffer[de]);else s.deleteFramebuffer(w.__webglFramebuffer);if(w.__webglDepthbuffer&&s.deleteRenderbuffer(w.__webglDepthbuffer),w.__webglMultisampledFramebuffer&&s.deleteFramebuffer(w.__webglMultisampledFramebuffer),w.__webglColorRenderbuffer)for(let de=0;de<w.__webglColorRenderbuffer.length;de++)w.__webglColorRenderbuffer[de]&&s.deleteRenderbuffer(w.__webglColorRenderbuffer[de]);w.__webglDepthRenderbuffer&&s.deleteRenderbuffer(w.__webglDepthRenderbuffer)}const ee=O.textures;for(let de=0,_e=ee.length;de<_e;de++){const le=n.get(ee[de]);le.__webglTexture&&(s.deleteTexture(le.__webglTexture),a.memory.textures--),n.remove(ee[de])}n.remove(O)}let U=0;function G(){U=0}function X(){const O=U;return O>=i.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+O+" texture units while this GPU supports only "+i.maxTextures),U+=1,O}function Z(O){const w=[];return w.push(O.wrapS),w.push(O.wrapT),w.push(O.wrapR||0),w.push(O.magFilter),w.push(O.minFilter),w.push(O.anisotropy),w.push(O.internalFormat),w.push(O.format),w.push(O.type),w.push(O.generateMipmaps),w.push(O.premultiplyAlpha),w.push(O.flipY),w.push(O.unpackAlignment),w.push(O.colorSpace),w.join()}function ie(O,w){const ee=n.get(O);if(O.isVideoTexture&&je(O),O.isRenderTargetTexture===!1&&O.version>0&&ee.__version!==O.version){const de=O.image;if(de===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(de.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{re(ee,O,w);return}}t.bindTexture(s.TEXTURE_2D,ee.__webglTexture,s.TEXTURE0+w)}function H(O,w){const ee=n.get(O);if(O.version>0&&ee.__version!==O.version){re(ee,O,w);return}t.bindTexture(s.TEXTURE_2D_ARRAY,ee.__webglTexture,s.TEXTURE0+w)}function oe(O,w){const ee=n.get(O);if(O.version>0&&ee.__version!==O.version){re(ee,O,w);return}t.bindTexture(s.TEXTURE_3D,ee.__webglTexture,s.TEXTURE0+w)}function Y(O,w){const ee=n.get(O);if(O.version>0&&ee.__version!==O.version){ae(ee,O,w);return}t.bindTexture(s.TEXTURE_CUBE_MAP,ee.__webglTexture,s.TEXTURE0+w)}const me={[ai]:s.REPEAT,[Jn]:s.CLAMP_TO_EDGE,[No]:s.MIRRORED_REPEAT},Me={[On]:s.NEAREST,[kd]:s.NEAREST_MIPMAP_NEAREST,[fr]:s.NEAREST_MIPMAP_LINEAR,[Fn]:s.LINEAR,[La]:s.LINEAR_MIPMAP_NEAREST,[xi]:s.LINEAR_MIPMAP_LINEAR},Ce={[Xd]:s.NEVER,[Kd]:s.ALWAYS,[qd]:s.LESS,[nu]:s.LEQUAL,[jd]:s.EQUAL,[Jd]:s.GEQUAL,[Yd]:s.GREATER,[$d]:s.NOTEQUAL};function Ye(O,w){if(w.type===oi&&e.has("OES_texture_float_linear")===!1&&(w.magFilter===Fn||w.magFilter===La||w.magFilter===fr||w.magFilter===xi||w.minFilter===Fn||w.minFilter===La||w.minFilter===fr||w.minFilter===xi)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),s.texParameteri(O,s.TEXTURE_WRAP_S,me[w.wrapS]),s.texParameteri(O,s.TEXTURE_WRAP_T,me[w.wrapT]),(O===s.TEXTURE_3D||O===s.TEXTURE_2D_ARRAY)&&s.texParameteri(O,s.TEXTURE_WRAP_R,me[w.wrapR]),s.texParameteri(O,s.TEXTURE_MAG_FILTER,Me[w.magFilter]),s.texParameteri(O,s.TEXTURE_MIN_FILTER,Me[w.minFilter]),w.compareFunction&&(s.texParameteri(O,s.TEXTURE_COMPARE_MODE,s.COMPARE_REF_TO_TEXTURE),s.texParameteri(O,s.TEXTURE_COMPARE_FUNC,Ce[w.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(w.magFilter===On||w.minFilter!==fr&&w.minFilter!==xi||w.type===oi&&e.has("OES_texture_float_linear")===!1)return;if(w.anisotropy>1||n.get(w).__currentAnisotropy){const ee=e.get("EXT_texture_filter_anisotropic");s.texParameterf(O,ee.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(w.anisotropy,i.getMaxAnisotropy())),n.get(w).__currentAnisotropy=w.anisotropy}}}function Oe(O,w){let ee=!1;O.__webglInit===void 0&&(O.__webglInit=!0,w.addEventListener("dispose",C));const de=w.source;let _e=u.get(de);_e===void 0&&(_e={},u.set(de,_e));const le=Z(w);if(le!==O.__cacheKey){_e[le]===void 0&&(_e[le]={texture:s.createTexture(),usedTimes:0},a.memory.textures++,ee=!0),_e[le].usedTimes++;const lt=_e[O.__cacheKey];lt!==void 0&&(_e[O.__cacheKey].usedTimes--,lt.usedTimes===0&&E(w)),O.__cacheKey=le,O.__webglTexture=_e[le].texture}return ee}function K(O,w,ee){return Math.floor(Math.floor(O/ee)/w)}function te(O,w,ee,de){const le=O.updateRanges;if(le.length===0)t.texSubImage2D(s.TEXTURE_2D,0,0,0,w.width,w.height,ee,de,w.data);else{le.sort((ve,Ze)=>ve.start-Ze.start);let lt=0;for(let ve=1;ve<le.length;ve++){const Ze=le[lt],Mt=le[ve],ft=Ze.start+Ze.count,Ge=K(Mt.start,w.width,4),Rt=K(Ze.start,w.width,4);Mt.start<=ft+1&&Ge===Rt&&K(Mt.start+Mt.count-1,w.width,4)===Ge?Ze.count=Math.max(Ze.count,Mt.start+Mt.count-Ze.start):(++lt,le[lt]=Mt)}le.length=lt+1;const He=s.getParameter(s.UNPACK_ROW_LENGTH),st=s.getParameter(s.UNPACK_SKIP_PIXELS),ot=s.getParameter(s.UNPACK_SKIP_ROWS);s.pixelStorei(s.UNPACK_ROW_LENGTH,w.width);for(let ve=0,Ze=le.length;ve<Ze;ve++){const Mt=le[ve],ft=Math.floor(Mt.start/4),Ge=Math.ceil(Mt.count/4),Rt=ft%w.width,q=Math.floor(ft/w.width),qe=Ge,ye=1;s.pixelStorei(s.UNPACK_SKIP_PIXELS,Rt),s.pixelStorei(s.UNPACK_SKIP_ROWS,q),t.texSubImage2D(s.TEXTURE_2D,0,Rt,q,qe,ye,ee,de,w.data)}O.clearUpdateRanges(),s.pixelStorei(s.UNPACK_ROW_LENGTH,He),s.pixelStorei(s.UNPACK_SKIP_PIXELS,st),s.pixelStorei(s.UNPACK_SKIP_ROWS,ot)}}function re(O,w,ee){let de=s.TEXTURE_2D;(w.isDataArrayTexture||w.isCompressedArrayTexture)&&(de=s.TEXTURE_2D_ARRAY),w.isData3DTexture&&(de=s.TEXTURE_3D);const _e=Oe(O,w),le=w.source;t.bindTexture(de,O.__webglTexture,s.TEXTURE0+ee);const lt=n.get(le);if(le.version!==lt.__version||_e===!0){t.activeTexture(s.TEXTURE0+ee);const He=Wt.getPrimaries(Wt.workingColorSpace),st=w.colorSpace===Ni?null:Wt.getPrimaries(w.colorSpace),ot=w.colorSpace===Ni||He===st?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,w.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,w.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,ot);let ve=_(w.image,!1,i.maxTextureSize);ve=_t(w,ve);const Ze=r.convert(w.format,w.colorSpace),Mt=r.convert(w.type);let ft=A(w.internalFormat,Ze,Mt,w.colorSpace,w.isVideoTexture);Ye(de,w);let Ge;const Rt=w.mipmaps,q=w.isVideoTexture!==!0,qe=lt.__version===void 0||_e===!0,ye=le.dataReady,et=N(w,ve);if(w.isDepthTexture)ft=b(w.format===ar,w.type),qe&&(q?t.texStorage2D(s.TEXTURE_2D,1,ft,ve.width,ve.height):t.texImage2D(s.TEXTURE_2D,0,ft,ve.width,ve.height,0,Ze,Mt,null));else if(w.isDataTexture)if(Rt.length>0){q&&qe&&t.texStorage2D(s.TEXTURE_2D,et,ft,Rt[0].width,Rt[0].height);for(let Ae=0,I=Rt.length;Ae<I;Ae++)Ge=Rt[Ae],q?ye&&t.texSubImage2D(s.TEXTURE_2D,Ae,0,0,Ge.width,Ge.height,Ze,Mt,Ge.data):t.texImage2D(s.TEXTURE_2D,Ae,ft,Ge.width,Ge.height,0,Ze,Mt,Ge.data);w.generateMipmaps=!1}else q?(qe&&t.texStorage2D(s.TEXTURE_2D,et,ft,ve.width,ve.height),ye&&te(w,ve,Ze,Mt)):t.texImage2D(s.TEXTURE_2D,0,ft,ve.width,ve.height,0,Ze,Mt,ve.data);else if(w.isCompressedTexture)if(w.isCompressedArrayTexture){q&&qe&&t.texStorage3D(s.TEXTURE_2D_ARRAY,et,ft,Rt[0].width,Rt[0].height,ve.depth);for(let Ae=0,I=Rt.length;Ae<I;Ae++)if(Ge=Rt[Ae],w.format!==Wn)if(Ze!==null)if(q){if(ye)if(w.layerUpdates.size>0){const k=jc(Ge.width,Ge.height,w.format,w.type);for(const Q of w.layerUpdates){const pe=Ge.data.subarray(Q*k/Ge.data.BYTES_PER_ELEMENT,(Q+1)*k/Ge.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Ae,0,0,Q,Ge.width,Ge.height,1,Ze,pe)}w.clearLayerUpdates()}else t.compressedTexSubImage3D(s.TEXTURE_2D_ARRAY,Ae,0,0,0,Ge.width,Ge.height,ve.depth,Ze,Ge.data)}else t.compressedTexImage3D(s.TEXTURE_2D_ARRAY,Ae,ft,Ge.width,Ge.height,ve.depth,0,Ge.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else q?ye&&t.texSubImage3D(s.TEXTURE_2D_ARRAY,Ae,0,0,0,Ge.width,Ge.height,ve.depth,Ze,Mt,Ge.data):t.texImage3D(s.TEXTURE_2D_ARRAY,Ae,ft,Ge.width,Ge.height,ve.depth,0,Ze,Mt,Ge.data)}else{q&&qe&&t.texStorage2D(s.TEXTURE_2D,et,ft,Rt[0].width,Rt[0].height);for(let Ae=0,I=Rt.length;Ae<I;Ae++)Ge=Rt[Ae],w.format!==Wn?Ze!==null?q?ye&&t.compressedTexSubImage2D(s.TEXTURE_2D,Ae,0,0,Ge.width,Ge.height,Ze,Ge.data):t.compressedTexImage2D(s.TEXTURE_2D,Ae,ft,Ge.width,Ge.height,0,Ge.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):q?ye&&t.texSubImage2D(s.TEXTURE_2D,Ae,0,0,Ge.width,Ge.height,Ze,Mt,Ge.data):t.texImage2D(s.TEXTURE_2D,Ae,ft,Ge.width,Ge.height,0,Ze,Mt,Ge.data)}else if(w.isDataArrayTexture)if(q){if(qe&&t.texStorage3D(s.TEXTURE_2D_ARRAY,et,ft,ve.width,ve.height,ve.depth),ye)if(w.layerUpdates.size>0){const Ae=jc(ve.width,ve.height,w.format,w.type);for(const I of w.layerUpdates){const k=ve.data.subarray(I*Ae/ve.data.BYTES_PER_ELEMENT,(I+1)*Ae/ve.data.BYTES_PER_ELEMENT);t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,I,ve.width,ve.height,1,Ze,Mt,k)}w.clearLayerUpdates()}else t.texSubImage3D(s.TEXTURE_2D_ARRAY,0,0,0,0,ve.width,ve.height,ve.depth,Ze,Mt,ve.data)}else t.texImage3D(s.TEXTURE_2D_ARRAY,0,ft,ve.width,ve.height,ve.depth,0,Ze,Mt,ve.data);else if(w.isData3DTexture)q?(qe&&t.texStorage3D(s.TEXTURE_3D,et,ft,ve.width,ve.height,ve.depth),ye&&t.texSubImage3D(s.TEXTURE_3D,0,0,0,0,ve.width,ve.height,ve.depth,Ze,Mt,ve.data)):t.texImage3D(s.TEXTURE_3D,0,ft,ve.width,ve.height,ve.depth,0,Ze,Mt,ve.data);else if(w.isFramebufferTexture){if(qe)if(q)t.texStorage2D(s.TEXTURE_2D,et,ft,ve.width,ve.height);else{let Ae=ve.width,I=ve.height;for(let k=0;k<et;k++)t.texImage2D(s.TEXTURE_2D,k,ft,Ae,I,0,Ze,Mt,null),Ae>>=1,I>>=1}}else if(Rt.length>0){if(q&&qe){const Ae=ln(Rt[0]);t.texStorage2D(s.TEXTURE_2D,et,ft,Ae.width,Ae.height)}for(let Ae=0,I=Rt.length;Ae<I;Ae++)Ge=Rt[Ae],q?ye&&t.texSubImage2D(s.TEXTURE_2D,Ae,0,0,Ze,Mt,Ge):t.texImage2D(s.TEXTURE_2D,Ae,ft,Ze,Mt,Ge);w.generateMipmaps=!1}else if(q){if(qe){const Ae=ln(ve);t.texStorage2D(s.TEXTURE_2D,et,ft,Ae.width,Ae.height)}ye&&t.texSubImage2D(s.TEXTURE_2D,0,0,0,Ze,Mt,ve)}else t.texImage2D(s.TEXTURE_2D,0,ft,Ze,Mt,ve);g(w)&&p(de),lt.__version=le.version,w.onUpdate&&w.onUpdate(w)}O.__version=w.version}function ae(O,w,ee){if(w.image.length!==6)return;const de=Oe(O,w),_e=w.source;t.bindTexture(s.TEXTURE_CUBE_MAP,O.__webglTexture,s.TEXTURE0+ee);const le=n.get(_e);if(_e.version!==le.__version||de===!0){t.activeTexture(s.TEXTURE0+ee);const lt=Wt.getPrimaries(Wt.workingColorSpace),He=w.colorSpace===Ni?null:Wt.getPrimaries(w.colorSpace),st=w.colorSpace===Ni||lt===He?s.NONE:s.BROWSER_DEFAULT_WEBGL;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,w.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,w.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,w.unpackAlignment),s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,st);const ot=w.isCompressedTexture||w.image[0].isCompressedTexture,ve=w.image[0]&&w.image[0].isDataTexture,Ze=[];for(let I=0;I<6;I++)!ot&&!ve?Ze[I]=_(w.image[I],!0,i.maxCubemapSize):Ze[I]=ve?w.image[I].image:w.image[I],Ze[I]=_t(w,Ze[I]);const Mt=Ze[0],ft=r.convert(w.format,w.colorSpace),Ge=r.convert(w.type),Rt=A(w.internalFormat,ft,Ge,w.colorSpace),q=w.isVideoTexture!==!0,qe=le.__version===void 0||de===!0,ye=_e.dataReady;let et=N(w,Mt);Ye(s.TEXTURE_CUBE_MAP,w);let Ae;if(ot){q&&qe&&t.texStorage2D(s.TEXTURE_CUBE_MAP,et,Rt,Mt.width,Mt.height);for(let I=0;I<6;I++){Ae=Ze[I].mipmaps;for(let k=0;k<Ae.length;k++){const Q=Ae[k];w.format!==Wn?ft!==null?q?ye&&t.compressedTexSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k,0,0,Q.width,Q.height,ft,Q.data):t.compressedTexImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k,Rt,Q.width,Q.height,0,Q.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k,0,0,Q.width,Q.height,ft,Ge,Q.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k,Rt,Q.width,Q.height,0,ft,Ge,Q.data)}}}else{if(Ae=w.mipmaps,q&&qe){Ae.length>0&&et++;const I=ln(Ze[0]);t.texStorage2D(s.TEXTURE_CUBE_MAP,et,Rt,I.width,I.height)}for(let I=0;I<6;I++)if(ve){q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,0,0,0,Ze[I].width,Ze[I].height,ft,Ge,Ze[I].data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,0,Rt,Ze[I].width,Ze[I].height,0,ft,Ge,Ze[I].data);for(let k=0;k<Ae.length;k++){const pe=Ae[k].image[I].image;q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k+1,0,0,pe.width,pe.height,ft,Ge,pe.data):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k+1,Rt,pe.width,pe.height,0,ft,Ge,pe.data)}}else{q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,0,0,0,ft,Ge,Ze[I]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,0,Rt,ft,Ge,Ze[I]);for(let k=0;k<Ae.length;k++){const Q=Ae[k];q?ye&&t.texSubImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k+1,0,0,ft,Ge,Q.image[I]):t.texImage2D(s.TEXTURE_CUBE_MAP_POSITIVE_X+I,k+1,Rt,ft,Ge,Q.image[I])}}}g(w)&&p(s.TEXTURE_CUBE_MAP),le.__version=_e.version,w.onUpdate&&w.onUpdate(w)}O.__version=w.version}function Ie(O,w,ee,de,_e,le){const lt=r.convert(ee.format,ee.colorSpace),He=r.convert(ee.type),st=A(ee.internalFormat,lt,He,ee.colorSpace),ot=n.get(w),ve=n.get(ee);if(ve.__renderTarget=w,!ot.__hasExternalTextures){const Ze=Math.max(1,w.width>>le),Mt=Math.max(1,w.height>>le);_e===s.TEXTURE_3D||_e===s.TEXTURE_2D_ARRAY?t.texImage3D(_e,le,st,Ze,Mt,w.depth,0,lt,He,null):t.texImage2D(_e,le,st,Ze,Mt,0,lt,He,null)}t.bindFramebuffer(s.FRAMEBUFFER,O),gt(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,de,_e,ve.__webglTexture,0,Xe(w)):(_e===s.TEXTURE_2D||_e>=s.TEXTURE_CUBE_MAP_POSITIVE_X&&_e<=s.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&s.framebufferTexture2D(s.FRAMEBUFFER,de,_e,ve.__webglTexture,le),t.bindFramebuffer(s.FRAMEBUFFER,null)}function ge(O,w,ee){if(s.bindRenderbuffer(s.RENDERBUFFER,O),w.depthBuffer){const de=w.depthTexture,_e=de&&de.isDepthTexture?de.type:null,le=b(w.stencilBuffer,_e),lt=w.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,He=Xe(w);gt(w)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,He,le,w.width,w.height):ee?s.renderbufferStorageMultisample(s.RENDERBUFFER,He,le,w.width,w.height):s.renderbufferStorage(s.RENDERBUFFER,le,w.width,w.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,lt,s.RENDERBUFFER,O)}else{const de=w.textures;for(let _e=0;_e<de.length;_e++){const le=de[_e],lt=r.convert(le.format,le.colorSpace),He=r.convert(le.type),st=A(le.internalFormat,lt,He,le.colorSpace),ot=Xe(w);ee&>(w)===!1?s.renderbufferStorageMultisample(s.RENDERBUFFER,ot,st,w.width,w.height):gt(w)?o.renderbufferStorageMultisampleEXT(s.RENDERBUFFER,ot,st,w.width,w.height):s.renderbufferStorage(s.RENDERBUFFER,st,w.width,w.height)}}s.bindRenderbuffer(s.RENDERBUFFER,null)}function Re(O,w){if(w&&w.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(s.FRAMEBUFFER,O),!(w.depthTexture&&w.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const de=n.get(w.depthTexture);de.__renderTarget=w,(!de.__webglTexture||w.depthTexture.image.width!==w.width||w.depthTexture.image.height!==w.height)&&(w.depthTexture.image.width=w.width,w.depthTexture.image.height=w.height,w.depthTexture.needsUpdate=!0),ie(w.depthTexture,0);const _e=de.__webglTexture,le=Xe(w);if(w.depthTexture.format===rr)gt(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,_e,0,le):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.TEXTURE_2D,_e,0);else if(w.depthTexture.format===ar)gt(w)?o.framebufferTexture2DMultisampleEXT(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,_e,0,le):s.framebufferTexture2D(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.TEXTURE_2D,_e,0);else throw new Error("Unknown depthTexture format")}function nt(O){const w=n.get(O),ee=O.isWebGLCubeRenderTarget===!0;if(w.__boundDepthTexture!==O.depthTexture){const de=O.depthTexture;if(w.__depthDisposeCallback&&w.__depthDisposeCallback(),de){const _e=()=>{delete w.__boundDepthTexture,delete w.__depthDisposeCallback,de.removeEventListener("dispose",_e)};de.addEventListener("dispose",_e),w.__depthDisposeCallback=_e}w.__boundDepthTexture=de}if(O.depthTexture&&!w.__autoAllocateDepthBuffer){if(ee)throw new Error("target.depthTexture not supported in Cube render targets");const de=O.texture.mipmaps;de&&de.length>0?Re(w.__webglFramebuffer[0],O):Re(w.__webglFramebuffer,O)}else if(ee){w.__webglDepthbuffer=[];for(let de=0;de<6;de++)if(t.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer[de]),w.__webglDepthbuffer[de]===void 0)w.__webglDepthbuffer[de]=s.createRenderbuffer(),ge(w.__webglDepthbuffer[de],O,!1);else{const _e=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,le=w.__webglDepthbuffer[de];s.bindRenderbuffer(s.RENDERBUFFER,le),s.framebufferRenderbuffer(s.FRAMEBUFFER,_e,s.RENDERBUFFER,le)}}else{const de=O.texture.mipmaps;if(de&&de.length>0?t.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer[0]):t.bindFramebuffer(s.FRAMEBUFFER,w.__webglFramebuffer),w.__webglDepthbuffer===void 0)w.__webglDepthbuffer=s.createRenderbuffer(),ge(w.__webglDepthbuffer,O,!1);else{const _e=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,le=w.__webglDepthbuffer;s.bindRenderbuffer(s.RENDERBUFFER,le),s.framebufferRenderbuffer(s.FRAMEBUFFER,_e,s.RENDERBUFFER,le)}}t.bindFramebuffer(s.FRAMEBUFFER,null)}function yt(O,w,ee){const de=n.get(O);w!==void 0&&Ie(de.__webglFramebuffer,O,O.texture,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,0),ee!==void 0&&nt(O)}function At(O){const w=O.texture,ee=n.get(O),de=n.get(w);O.addEventListener("dispose",P);const _e=O.textures,le=O.isWebGLCubeRenderTarget===!0,lt=_e.length>1;if(lt||(de.__webglTexture===void 0&&(de.__webglTexture=s.createTexture()),de.__version=w.version,a.memory.textures++),le){ee.__webglFramebuffer=[];for(let He=0;He<6;He++)if(w.mipmaps&&w.mipmaps.length>0){ee.__webglFramebuffer[He]=[];for(let st=0;st<w.mipmaps.length;st++)ee.__webglFramebuffer[He][st]=s.createFramebuffer()}else ee.__webglFramebuffer[He]=s.createFramebuffer()}else{if(w.mipmaps&&w.mipmaps.length>0){ee.__webglFramebuffer=[];for(let He=0;He<w.mipmaps.length;He++)ee.__webglFramebuffer[He]=s.createFramebuffer()}else ee.__webglFramebuffer=s.createFramebuffer();if(lt)for(let He=0,st=_e.length;He<st;He++){const ot=n.get(_e[He]);ot.__webglTexture===void 0&&(ot.__webglTexture=s.createTexture(),a.memory.textures++)}if(O.samples>0&>(O)===!1){ee.__webglMultisampledFramebuffer=s.createFramebuffer(),ee.__webglColorRenderbuffer=[],t.bindFramebuffer(s.FRAMEBUFFER,ee.__webglMultisampledFramebuffer);for(let He=0;He<_e.length;He++){const st=_e[He];ee.__webglColorRenderbuffer[He]=s.createRenderbuffer(),s.bindRenderbuffer(s.RENDERBUFFER,ee.__webglColorRenderbuffer[He]);const ot=r.convert(st.format,st.colorSpace),ve=r.convert(st.type),Ze=A(st.internalFormat,ot,ve,st.colorSpace,O.isXRRenderTarget===!0),Mt=Xe(O);s.renderbufferStorageMultisample(s.RENDERBUFFER,Mt,Ze,O.width,O.height),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+He,s.RENDERBUFFER,ee.__webglColorRenderbuffer[He])}s.bindRenderbuffer(s.RENDERBUFFER,null),O.depthBuffer&&(ee.__webglDepthRenderbuffer=s.createRenderbuffer(),ge(ee.__webglDepthRenderbuffer,O,!0)),t.bindFramebuffer(s.FRAMEBUFFER,null)}}if(le){t.bindTexture(s.TEXTURE_CUBE_MAP,de.__webglTexture),Ye(s.TEXTURE_CUBE_MAP,w);for(let He=0;He<6;He++)if(w.mipmaps&&w.mipmaps.length>0)for(let st=0;st<w.mipmaps.length;st++)Ie(ee.__webglFramebuffer[He][st],O,w,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+He,st);else Ie(ee.__webglFramebuffer[He],O,w,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+He,0);g(w)&&p(s.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(lt){for(let He=0,st=_e.length;He<st;He++){const ot=_e[He],ve=n.get(ot);t.bindTexture(s.TEXTURE_2D,ve.__webglTexture),Ye(s.TEXTURE_2D,ot),Ie(ee.__webglFramebuffer,O,ot,s.COLOR_ATTACHMENT0+He,s.TEXTURE_2D,0),g(ot)&&p(s.TEXTURE_2D)}t.unbindTexture()}else{let He=s.TEXTURE_2D;if((O.isWebGL3DRenderTarget||O.isWebGLArrayRenderTarget)&&(He=O.isWebGL3DRenderTarget?s.TEXTURE_3D:s.TEXTURE_2D_ARRAY),t.bindTexture(He,de.__webglTexture),Ye(He,w),w.mipmaps&&w.mipmaps.length>0)for(let st=0;st<w.mipmaps.length;st++)Ie(ee.__webglFramebuffer[st],O,w,s.COLOR_ATTACHMENT0,He,st);else Ie(ee.__webglFramebuffer,O,w,s.COLOR_ATTACHMENT0,He,0);g(w)&&p(He),t.unbindTexture()}O.depthBuffer&&nt(O)}function z(O){const w=O.textures;for(let ee=0,de=w.length;ee<de;ee++){const _e=w[ee];if(g(_e)){const le=S(O),lt=n.get(_e).__webglTexture;t.bindTexture(le,lt),p(le),t.unbindTexture()}}}const Ot=[],Pt=[];function Ct(O){if(O.samples>0){if(gt(O)===!1){const w=O.textures,ee=O.width,de=O.height;let _e=s.COLOR_BUFFER_BIT;const le=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT,lt=n.get(O),He=w.length>1;if(He)for(let ot=0;ot<w.length;ot++)t.bindFramebuffer(s.FRAMEBUFFER,lt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+ot,s.RENDERBUFFER,null),t.bindFramebuffer(s.FRAMEBUFFER,lt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+ot,s.TEXTURE_2D,null,0);t.bindFramebuffer(s.READ_FRAMEBUFFER,lt.__webglMultisampledFramebuffer);const st=O.texture.mipmaps;st&&st.length>0?t.bindFramebuffer(s.DRAW_FRAMEBUFFER,lt.__webglFramebuffer[0]):t.bindFramebuffer(s.DRAW_FRAMEBUFFER,lt.__webglFramebuffer);for(let ot=0;ot<w.length;ot++){if(O.resolveDepthBuffer&&(O.depthBuffer&&(_e|=s.DEPTH_BUFFER_BIT),O.stencilBuffer&&O.resolveStencilBuffer&&(_e|=s.STENCIL_BUFFER_BIT)),He){s.framebufferRenderbuffer(s.READ_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.RENDERBUFFER,lt.__webglColorRenderbuffer[ot]);const ve=n.get(w[ot]).__webglTexture;s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,ve,0)}s.blitFramebuffer(0,0,ee,de,0,0,ee,de,_e,s.NEAREST),l===!0&&(Ot.length=0,Pt.length=0,Ot.push(s.COLOR_ATTACHMENT0+ot),O.depthBuffer&&O.resolveDepthBuffer===!1&&(Ot.push(le),Pt.push(le),s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,Pt)),s.invalidateFramebuffer(s.READ_FRAMEBUFFER,Ot))}if(t.bindFramebuffer(s.READ_FRAMEBUFFER,null),t.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),He)for(let ot=0;ot<w.length;ot++){t.bindFramebuffer(s.FRAMEBUFFER,lt.__webglMultisampledFramebuffer),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0+ot,s.RENDERBUFFER,lt.__webglColorRenderbuffer[ot]);const ve=n.get(w[ot]).__webglTexture;t.bindFramebuffer(s.FRAMEBUFFER,lt.__webglFramebuffer),s.framebufferTexture2D(s.DRAW_FRAMEBUFFER,s.COLOR_ATTACHMENT0+ot,s.TEXTURE_2D,ve,0)}t.bindFramebuffer(s.DRAW_FRAMEBUFFER,lt.__webglMultisampledFramebuffer)}else if(O.depthBuffer&&O.resolveDepthBuffer===!1&&l){const w=O.stencilBuffer?s.DEPTH_STENCIL_ATTACHMENT:s.DEPTH_ATTACHMENT;s.invalidateFramebuffer(s.DRAW_FRAMEBUFFER,[w])}}}function Xe(O){return Math.min(i.maxSamples,O.samples)}function gt(O){const w=n.get(O);return O.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&w.__useRenderToTexture!==!1}function je(O){const w=a.render.frame;h.get(O)!==w&&(h.set(O,w),O.update())}function _t(O,w){const ee=O.colorSpace,de=O.format,_e=O.type;return O.isCompressedTexture===!0||O.isVideoTexture===!0||ee!==Ds&&ee!==Ni&&(Wt.getTransfer(ee)===an?(de!==Wn||_e!==ci)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ee)),w}function ln(O){return typeof HTMLImageElement<"u"&&O instanceof HTMLImageElement?(c.width=O.naturalWidth||O.width,c.height=O.naturalHeight||O.height):typeof VideoFrame<"u"&&O instanceof VideoFrame?(c.width=O.displayWidth,c.height=O.displayHeight):(c.width=O.width,c.height=O.height),c}this.allocateTextureUnit=X,this.resetTextureUnits=G,this.setTexture2D=ie,this.setTexture2DArray=H,this.setTexture3D=oe,this.setTextureCube=Y,this.rebindTextures=yt,this.setupRenderTarget=At,this.updateRenderTargetMipmap=z,this.updateMultisampleRenderTarget=Ct,this.setupDepthRenderbuffer=nt,this.setupFrameBufferTexture=Ie,this.useMultisampledRTT=gt}function dg(s,e){function t(n,i=Ni){let r;const a=Wt.getTransfer(i);if(n===ci)return s.UNSIGNED_BYTE;if(n===bl)return s.UNSIGNED_SHORT_4_4_4_4;if(n===Sl)return s.UNSIGNED_SHORT_5_5_5_1;if(n===Jh)return s.UNSIGNED_INT_5_9_9_9_REV;if(n===Yh)return s.BYTE;if(n===$h)return s.SHORT;if(n===ir)return s.UNSIGNED_SHORT;if(n===Ml)return s.INT;if(n===es)return s.UNSIGNED_INT;if(n===oi)return s.FLOAT;if(n===cr)return s.HALF_FLOAT;if(n===Kh)return s.ALPHA;if(n===Zh)return s.RGB;if(n===Wn)return s.RGBA;if(n===rr)return s.DEPTH_COMPONENT;if(n===ar)return s.DEPTH_STENCIL;if(n===Qh)return s.RED;if(n===El)return s.RED_INTEGER;if(n===eu)return s.RG;if(n===Al)return s.RG_INTEGER;if(n===wl)return s.RGBA_INTEGER;if(n===ta||n===na||n===ia||n===sa)if(a===an)if(r=e.get("WEBGL_compressed_texture_s3tc_srgb"),r!==null){if(n===ta)return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===ia)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===sa)return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(r=e.get("WEBGL_compressed_texture_s3tc"),r!==null){if(n===ta)return r.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===na)return r.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===ia)return r.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===sa)return r.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Io||n===Fo||n===Oo||n===zo)if(r=e.get("WEBGL_compressed_texture_pvrtc"),r!==null){if(n===Io)return r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Fo)return r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Oo)return r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===zo)return r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===Bo||n===ko||n===Vo)if(r=e.get("WEBGL_compressed_texture_etc"),r!==null){if(n===Bo||n===ko)return a===an?r.COMPRESSED_SRGB8_ETC2:r.COMPRESSED_RGB8_ETC2;if(n===Vo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:r.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===Ho||n===Go||n===Wo||n===Xo||n===qo||n===jo||n===Yo||n===$o||n===Jo||n===Ko||n===Zo||n===Qo||n===el||n===tl)if(r=e.get("WEBGL_compressed_texture_astc"),r!==null){if(n===Ho)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:r.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Go)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:r.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Wo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:r.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Xo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:r.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===qo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:r.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===jo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:r.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Yo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:r.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===$o)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:r.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Jo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:r.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Ko)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:r.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===Zo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:r.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===Qo)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:r.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===el)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:r.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===tl)return a===an?r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:r.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===ra||n===nl||n===il)if(r=e.get("EXT_texture_compression_bptc"),r!==null){if(n===ra)return a===an?r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:r.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===nl)return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===il)return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===tu||n===sl||n===rl||n===al)if(r=e.get("EXT_texture_compression_rgtc"),r!==null){if(n===ra)return r.COMPRESSED_RED_RGTC1_EXT;if(n===sl)return r.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===rl)return r.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===al)return r.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===sr?s.UNSIGNED_INT_24_8:s[n]!==void 0?s[n]:null}return{convert:t}}const fg=`
|
|
3804
3804
|
void main() {
|
|
3805
3805
|
|
|
3806
3806
|
gl_Position = vec4( position, 1.0 );
|
|
3807
3807
|
|
|
3808
|
-
}`,
|
|
3808
|
+
}`,pg=`
|
|
3809
3809
|
uniform sampler2DArray depthColor;
|
|
3810
3810
|
uniform float depthWidth;
|
|
3811
3811
|
uniform float depthHeight;
|
|
@@ -3824,7 +3824,7 @@ void main() {
|
|
|
3824
3824
|
|
|
3825
3825
|
}
|
|
3826
3826
|
|
|
3827
|
-
}`;class pg{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new bn,r=e.properties.get(i);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new bi({vertexShader:dg,fragmentShader:fg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new Jt(new hr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class mg extends ns{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,d=null,u=null,f=null,m=null;const _=new pg,g=t.getContextAttributes();let p=null,E=null;const b=[],M=[],U=new Qe;let R=null;const P=new Sn;P.viewport=new Gt;const D=new Sn;D.viewport=new Gt;const S=[P,D],y=new Pp;let N=null,W=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let re=b[K];return re===void 0&&(re=new Za,b[K]=re),re.getTargetRaySpace()},this.getControllerGrip=function(K){let re=b[K];return re===void 0&&(re=new Za,b[K]=re),re.getGripSpace()},this.getHand=function(K){let re=b[K];return re===void 0&&(re=new Za,b[K]=re),re.getHandSpace()};function X(K){const re=M.indexOf(K.inputSource);if(re===-1)return;const ae=b[re];ae!==void 0&&(ae.update(K.inputSource,K.frame,c||a),ae.dispatchEvent({type:K.type,data:K.inputSource}))}function Q(){i.removeEventListener("select",X),i.removeEventListener("selectstart",X),i.removeEventListener("selectend",X),i.removeEventListener("squeeze",X),i.removeEventListener("squeezestart",X),i.removeEventListener("squeezeend",X),i.removeEventListener("end",Q),i.removeEventListener("inputsourceschange",ne);for(let K=0;K<b.length;K++){const re=M[K];re!==null&&(M[K]=null,b[K].disconnect(re))}N=null,W=null,_.reset(),e.setRenderTarget(p),f=null,u=null,d=null,i=null,E=null,He.stop(),n.isPresenting=!1,e.setPixelRatio(R),e.setSize(U.width,U.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){r=K,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){o=K,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(K){c=K},this.getBaseLayer=function(){return u!==null?u:f},this.getBinding=function(){return d},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(K){if(i=K,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",X),i.addEventListener("selectstart",X),i.addEventListener("selectend",X),i.addEventListener("squeeze",X),i.addEventListener("squeezestart",X),i.addEventListener("squeezeend",X),i.addEventListener("end",Q),i.addEventListener("inputsourceschange",ne),g.xrCompatible!==!0&&await t.makeXRCompatible(),R=e.getPixelRatio(),e.getSize(U),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let ae=null,le=null,Le=null;g.depth&&(Le=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,ae=g.stencil?ar:rr,le=g.stencil?sr:es);const ge={colorFormat:t.RGBA8,depthFormat:Le,scaleFactor:r};d=new XRWebGLBinding(i,t),u=d.createProjectionLayer(ge),i.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),E=new ts(u.textureWidth,u.textureHeight,{format:Wn,type:ci,depthTexture:new gu(u.textureWidth,u.textureHeight,le,void 0,void 0,void 0,void 0,void 0,void 0,ae),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const ae={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};f=new XRWebGLLayer(i,t,ae),i.updateRenderState({baseLayer:f}),e.setPixelRatio(1),e.setSize(f.framebufferWidth,f.framebufferHeight,!1),E=new ts(f.framebufferWidth,f.framebufferHeight,{format:Wn,type:ci,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:f.ignoreDepthValues===!1,resolveStencilBuffer:f.ignoreDepthValues===!1})}E.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),He.setContext(i),He.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ne(K){for(let re=0;re<K.removed.length;re++){const ae=K.removed[re],le=M.indexOf(ae);le>=0&&(M[le]=null,b[le].disconnect(ae))}for(let re=0;re<K.added.length;re++){const ae=K.added[re];let le=M.indexOf(ae);if(le===-1){for(let ge=0;ge<b.length;ge++)if(ge>=M.length){M.push(ae),le=ge;break}else if(M[ge]===null){M[ge]=ae,le=ge;break}if(le===-1)break}const Le=b[le];Le&&Le.connect(ae)}}const H=new F,se=new F;function Z(K,re,ae){H.setFromMatrixPosition(re.matrixWorld),se.setFromMatrixPosition(ae.matrixWorld);const le=H.distanceTo(se),Le=re.projectionMatrix.elements,ge=ae.projectionMatrix.elements,Ae=Le[14]/(Le[10]-1),lt=Le[14]/(Le[10]+1),Et=(Le[9]+1)/Le[5],Mt=(Le[9]-1)/Le[5],z=(Le[8]-1)/Le[0],Wt=(ge[8]+1)/ge[0],Rt=Ae*z,At=Ae*Wt,Ge=le/(-z+Wt),mt=Ge*-z;if(re.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(mt),K.translateZ(Ge),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert(),Le[10]===-1)K.projectionMatrix.copy(re.projectionMatrix),K.projectionMatrixInverse.copy(re.projectionMatrixInverse);else{const Xe=Ae+Ge,gt=lt+Ge,on=Rt-mt,O=At+(le-mt),w=Et*lt/gt*Xe,ee=Mt*lt/gt*Xe;K.projectionMatrix.makePerspective(on,O,w,ee,Xe,gt),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}}function pe(K,re){re===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(re.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(i===null)return;let re=K.near,ae=K.far;_.texture!==null&&(_.depthNear>0&&(re=_.depthNear),_.depthFar>0&&(ae=_.depthFar)),y.near=D.near=P.near=re,y.far=D.far=P.far=ae,(N!==y.near||W!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),N=y.near,W=y.far),P.layers.mask=K.layers.mask|2,D.layers.mask=K.layers.mask|4,y.layers.mask=P.layers.mask|D.layers.mask;const le=K.parent,Le=y.cameras;pe(y,le);for(let ge=0;ge<Le.length;ge++)pe(Le[ge],le);Le.length===2?Z(y,P,D):y.projectionMatrix.copy(P.projectionMatrix),be(K,y,le)};function be(K,re,ae){ae===null?K.matrix.copy(re.matrixWorld):(K.matrix.copy(ae.matrixWorld),K.matrix.invert(),K.matrix.multiply(re.matrixWorld)),K.matrix.decompose(K.position,K.quaternion,K.scale),K.updateMatrixWorld(!0),K.projectionMatrix.copy(re.projectionMatrix),K.projectionMatrixInverse.copy(re.projectionMatrixInverse),K.isPerspectiveCamera&&(K.fov=Us*2*Math.atan(1/K.projectionMatrix.elements[5]),K.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(u===null&&f===null))return l},this.setFoveation=function(K){l=K,u!==null&&(u.fixedFoveation=K),f!==null&&f.fixedFoveation!==void 0&&(f.fixedFoveation=K)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(y)};let Ce=null;function Ie(K,re){if(h=re.getViewerPose(c||a),m=re,h!==null){const ae=h.views;f!==null&&(e.setRenderTargetFramebuffer(E,f.framebuffer),e.setRenderTarget(E));let le=!1;ae.length!==y.cameras.length&&(y.cameras.length=0,le=!0);for(let Ae=0;Ae<ae.length;Ae++){const lt=ae[Ae];let Et=null;if(f!==null)Et=f.getViewport(lt);else{const z=d.getViewSubImage(u,lt);Et=z.viewport,Ae===0&&(e.setRenderTargetTextures(E,z.colorTexture,z.depthStencilTexture),e.setRenderTarget(E))}let Mt=S[Ae];Mt===void 0&&(Mt=new Sn,Mt.layers.enable(Ae),Mt.viewport=new Gt,S[Ae]=Mt),Mt.matrix.fromArray(lt.transform.matrix),Mt.matrix.decompose(Mt.position,Mt.quaternion,Mt.scale),Mt.projectionMatrix.fromArray(lt.projectionMatrix),Mt.projectionMatrixInverse.copy(Mt.projectionMatrix).invert(),Mt.viewport.set(Et.x,Et.y,Et.width,Et.height),Ae===0&&(y.matrix.copy(Mt.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),le===!0&&y.cameras.push(Mt)}const Le=i.enabledFeatures;if(Le&&Le.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&d){const Ae=d.getDepthInformation(ae[0]);Ae&&Ae.isValid&&Ae.texture&&_.init(e,Ae,i.renderState)}}for(let ae=0;ae<b.length;ae++){const le=M[ae],Le=b[ae];le!==null&&Le!==void 0&&Le.update(le,re,c||a)}Ce&&Ce(K,re),re.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:re}),m=null}const He=new Cu;He.setAnimationLoop(Ie),this.setAnimationLoop=function(K){Ce=K},this.dispose=function(){}}}const qi=new Ln,gg=new bt;function _g(s,e){function t(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,lu(s)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,E,b,M){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(g,p):p.isMeshToonMaterial?(r(g,p),d(g,p)):p.isMeshPhongMaterial?(r(g,p),h(g,p)):p.isMeshStandardMaterial?(r(g,p),u(g,p),p.isMeshPhysicalMaterial&&f(g,p,M)):p.isMeshMatcapMaterial?(r(g,p),m(g,p)):p.isMeshDepthMaterial?r(g,p):p.isMeshDistanceMaterial?(r(g,p),_(g,p)):p.isMeshNormalMaterial?r(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,E,b):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(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,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,t(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===Rn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===Rn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,t(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,t(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const E=e.get(p),b=E.envMap,M=E.envMapRotation;b&&(g.envMap.value=b,qi.copy(M),qi.x*=-1,qi.y*=-1,qi.z*=-1,b.isCubeTexture&&b.isRenderTargetTexture===!1&&(qi.y*=-1,qi.z*=-1),g.envMapRotation.value.setFromMatrix4(gg.makeRotationFromEuler(qi)),g.flipEnvMap.value=b.isCubeTexture&&b.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,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}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,E,b){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*E,g.scale.value=b*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}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,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function d(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function u(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function f(g,p,E){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,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Rn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),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,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=E.texture,g.transmissionSamplerSize.value.set(E.width,E.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const E=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(E.matrixWorld),g.nearDistance.value=E.shadow.camera.near,g.farDistance.value=E.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function vg(s,e,t,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function l(E,b){const M=b.program;n.uniformBlockBinding(E,M)}function c(E,b){let M=i[E.id];M===void 0&&(m(E),M=h(E),i[E.id]=M,E.addEventListener("dispose",g));const U=b.program;n.updateUBOMapping(E,U);const R=e.render.frame;r[E.id]!==R&&(u(E),r[E.id]=R)}function h(E){const b=d();E.__bindingPointIndex=b;const M=s.createBuffer(),U=E.__size,R=E.usage;return s.bindBuffer(s.UNIFORM_BUFFER,M),s.bufferData(s.UNIFORM_BUFFER,U,R),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,b,M),M}function d(){for(let E=0;E<o;E++)if(a.indexOf(E)===-1)return a.push(E),E;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(E){const b=i[E.id],M=E.uniforms,U=E.__cache;s.bindBuffer(s.UNIFORM_BUFFER,b);for(let R=0,P=M.length;R<P;R++){const D=Array.isArray(M[R])?M[R]:[M[R]];for(let S=0,y=D.length;S<y;S++){const N=D[S];if(f(N,R,S,U)===!0){const W=N.__offset,X=Array.isArray(N.value)?N.value:[N.value];let Q=0;for(let ne=0;ne<X.length;ne++){const H=X[ne],se=_(H);typeof H=="number"||typeof H=="boolean"?(N.__data[0]=H,s.bufferSubData(s.UNIFORM_BUFFER,W+Q,N.__data)):H.isMatrix3?(N.__data[0]=H.elements[0],N.__data[1]=H.elements[1],N.__data[2]=H.elements[2],N.__data[3]=0,N.__data[4]=H.elements[3],N.__data[5]=H.elements[4],N.__data[6]=H.elements[5],N.__data[7]=0,N.__data[8]=H.elements[6],N.__data[9]=H.elements[7],N.__data[10]=H.elements[8],N.__data[11]=0):(H.toArray(N.__data,Q),Q+=se.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,W,N.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function f(E,b,M,U){const R=E.value,P=b+"_"+M;if(U[P]===void 0)return typeof R=="number"||typeof R=="boolean"?U[P]=R:U[P]=R.clone(),!0;{const D=U[P];if(typeof R=="number"||typeof R=="boolean"){if(D!==R)return U[P]=R,!0}else if(D.equals(R)===!1)return D.copy(R),!0}return!1}function m(E){const b=E.uniforms;let M=0;const U=16;for(let P=0,D=b.length;P<D;P++){const S=Array.isArray(b[P])?b[P]:[b[P]];for(let y=0,N=S.length;y<N;y++){const W=S[y],X=Array.isArray(W.value)?W.value:[W.value];for(let Q=0,ne=X.length;Q<ne;Q++){const H=X[Q],se=_(H),Z=M%U,pe=Z%se.boundary,be=Z+pe;M+=pe,be!==0&&U-be<se.storage&&(M+=U-be),W.__data=new Float32Array(se.storage/Float32Array.BYTES_PER_ELEMENT),W.__offset=M,M+=se.storage}}}const R=M%U;return R>0&&(M+=U-R),E.__size=M,E.__cache={},this}function _(E){const b={boundary:0,storage:0};return typeof E=="number"||typeof E=="boolean"?(b.boundary=4,b.storage=4):E.isVector2?(b.boundary=8,b.storage=8):E.isVector3||E.isColor?(b.boundary=16,b.storage=12):E.isVector4?(b.boundary=16,b.storage=16):E.isMatrix3?(b.boundary=48,b.storage=48):E.isMatrix4?(b.boundary=64,b.storage=64):E.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",E),b}function g(E){const b=E.target;b.removeEventListener("dispose",g);const M=a.indexOf(b.__bindingPointIndex);a.splice(M,1),s.deleteBuffer(i[b.id]),delete i[b.id],delete r[b.id]}function p(){for(const E in i)s.deleteBuffer(i[E]);a=[],i={},r={}}return{bind:l,update:c,dispose:p}}class xg{constructor(e={}){const{canvas:t=pf(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reverseDepthBuffer:u=!1}=e;this.isWebGLRenderer=!0;let f;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");f=n.getContextAttributes().alpha}else f=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const E=[],b=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Oi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const M=this;let U=!1;this._outputColorSpace=$t;let R=0,P=0,D=null,S=-1,y=null;const N=new Gt,W=new Gt;let X=null;const Q=new vt(0);let ne=0,H=t.width,se=t.height,Z=1,pe=null,be=null;const Ce=new Gt(0,0,H,se),Ie=new Gt(0,0,H,se);let He=!1;const K=new Nl;let re=!1,ae=!1;const le=new bt,Le=new bt,ge=new F,Ae=new Gt,lt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let Et=!1;function Mt(){return D===null?Z:1}let z=n;function Wt(A,k){return t.getContext(A,k)}try{const A={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${yl}`),t.addEventListener("webglcontextlost",et,!1),t.addEventListener("webglcontextrestored",I,!1),t.addEventListener("webglcontextcreationerror",B,!1),z===null){const k="webgl2";if(z=Wt(k,A),z===null)throw Wt(k)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(A){throw console.error("THREE.WebGLRenderer: "+A.message),A}let Rt,At,Ge,mt,Xe,gt,on,O,w,ee,de,me,ce,ct,We,st,rt,xe,Ze,ft,_t,ke,wt,q;function qe(){Rt=new R1(z),Rt.init(),ke=new ug(z,Rt),At=new S1(z,Rt,e,ke),Ge=new cg(z,Rt),At.reverseDepthBuffer&&u&&Ge.buffers.depth.setReversed(!0),mt=new D1(z),Xe=new J2,gt=new hg(z,Rt,Ge,Xe,At,ke,mt),on=new E1(M),O=new C1(M),w=new zp(z),wt=new y1(z,w),ee=new L1(z,w,mt,wt),de=new N1(z,ee,w,mt),Ze=new U1(z,At,gt),st=new b1(Xe),me=new $2(M,on,O,Rt,At,wt,st),ce=new _g(M,Xe),ct=new Z2,We=new sg(Rt),xe=new x1(M,on,O,Ge,de,f,l),rt=new og(M,de,At),q=new vg(z,mt,At,Ge),ft=new M1(z,Rt,mt),_t=new P1(z,Rt,mt),mt.programs=me.programs,M.capabilities=At,M.extensions=Rt,M.properties=Xe,M.renderLists=ct,M.shadowMap=rt,M.state=Ge,M.info=mt}qe();const ye=new mg(M,z);this.xr=ye,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){const A=Rt.get("WEBGL_lose_context");A&&A.loseContext()},this.forceContextRestore=function(){const A=Rt.get("WEBGL_lose_context");A&&A.restoreContext()},this.getPixelRatio=function(){return Z},this.setPixelRatio=function(A){A!==void 0&&(Z=A,this.setSize(H,se,!1))},this.getSize=function(A){return A.set(H,se)},this.setSize=function(A,k,Y=!0){if(ye.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=A,se=k,t.width=Math.floor(A*Z),t.height=Math.floor(k*Z),Y===!0&&(t.style.width=A+"px",t.style.height=k+"px"),this.setViewport(0,0,A,k)},this.getDrawingBufferSize=function(A){return A.set(H*Z,se*Z).floor()},this.setDrawingBufferSize=function(A,k,Y){H=A,se=k,Z=Y,t.width=Math.floor(A*Y),t.height=Math.floor(k*Y),this.setViewport(0,0,A,k)},this.getCurrentViewport=function(A){return A.copy(N)},this.getViewport=function(A){return A.copy(Ce)},this.setViewport=function(A,k,Y,J){A.isVector4?Ce.set(A.x,A.y,A.z,A.w):Ce.set(A,k,Y,J),Ge.viewport(N.copy(Ce).multiplyScalar(Z).round())},this.getScissor=function(A){return A.copy(Ie)},this.setScissor=function(A,k,Y,J){A.isVector4?Ie.set(A.x,A.y,A.z,A.w):Ie.set(A,k,Y,J),Ge.scissor(W.copy(Ie).multiplyScalar(Z).round())},this.getScissorTest=function(){return He},this.setScissorTest=function(A){Ge.setScissorTest(He=A)},this.setOpaqueSort=function(A){pe=A},this.setTransparentSort=function(A){be=A},this.getClearColor=function(A){return A.copy(xe.getClearColor())},this.setClearColor=function(){xe.setClearColor(...arguments)},this.getClearAlpha=function(){return xe.getClearAlpha()},this.setClearAlpha=function(){xe.setClearAlpha(...arguments)},this.clear=function(A=!0,k=!0,Y=!0){let J=0;if(A){let G=!1;if(D!==null){const fe=D.texture.format;G=fe===wl||fe===Al||fe===El}if(G){const fe=D.texture.type,Me=fe===ci||fe===es||fe===ir||fe===sr||fe===Sl||fe===bl,ze=xe.getClearColor(),Ue=xe.getClearAlpha(),at=ze.r,it=ze.g,nt=ze.b;Me?(m[0]=at,m[1]=it,m[2]=nt,m[3]=Ue,z.clearBufferuiv(z.COLOR,0,m)):(_[0]=at,_[1]=it,_[2]=nt,_[3]=Ue,z.clearBufferiv(z.COLOR,0,_))}else J|=z.COLOR_BUFFER_BIT}k&&(J|=z.DEPTH_BUFFER_BIT),Y&&(J|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),z.clear(J)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",et,!1),t.removeEventListener("webglcontextrestored",I,!1),t.removeEventListener("webglcontextcreationerror",B,!1),xe.dispose(),ct.dispose(),We.dispose(),Xe.dispose(),on.dispose(),O.dispose(),de.dispose(),wt.dispose(),q.dispose(),me.dispose(),ye.dispose(),ye.removeEventListener("sessionstart",Te),ye.removeEventListener("sessionend",je),j.stop()};function et(A){A.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),U=!0}function I(){console.log("THREE.WebGLRenderer: Context Restored."),U=!1;const A=mt.autoReset,k=rt.enabled,Y=rt.autoUpdate,J=rt.needsUpdate,G=rt.type;qe(),mt.autoReset=A,rt.enabled=k,rt.autoUpdate=Y,rt.needsUpdate=J,rt.type=G}function B(A){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",A.statusMessage)}function $(A){const k=A.target;k.removeEventListener("dispose",$),oe(k)}function oe(A){ue(A),Xe.remove(A)}function ue(A){const k=Xe.get(A).programs;k!==void 0&&(k.forEach(function(Y){me.releaseProgram(Y)}),A.isShaderMaterial&&me.releaseShaderCache(A))}this.renderBufferDirect=function(A,k,Y,J,G,fe){k===null&&(k=lt);const Me=G.isMesh&&G.matrixWorld.determinant()<0,ze=qt(A,k,Y,J,G);Ge.setMaterial(J,Me);let Ue=Y.index,at=1;if(J.wireframe===!0){if(Ue=ee.getWireframeAttribute(Y),Ue===void 0)return;at=2}const it=Y.drawRange,nt=Y.attributes.position;let St=it.start*at,Ft=(it.start+it.count)*at;fe!==null&&(St=Math.max(St,fe.start*at),Ft=Math.min(Ft,(fe.start+fe.count)*at)),Ue!==null?(St=Math.max(St,0),Ft=Math.min(Ft,Ue.count)):nt!=null&&(St=Math.max(St,0),Ft=Math.min(Ft,nt.count));const Ut=Ft-St;if(Ut<0||Ut===1/0)return;wt.setup(G,J,ze,Y,Ue);let ve,Ke=ft;if(Ue!==null&&(ve=w.get(Ue),Ke=_t,Ke.setIndex(ve)),G.isMesh)J.wireframe===!0?(Ge.setLineWidth(J.wireframeLinewidth*Mt()),Ke.setMode(z.LINES)):Ke.setMode(z.TRIANGLES);else if(G.isLine){let Ye=J.linewidth;Ye===void 0&&(Ye=1),Ge.setLineWidth(Ye*Mt()),G.isLineSegments?Ke.setMode(z.LINES):G.isLineLoop?Ke.setMode(z.LINE_LOOP):Ke.setMode(z.LINE_STRIP)}else G.isPoints?Ke.setMode(z.POINTS):G.isSprite&&Ke.setMode(z.TRIANGLES);if(G.isBatchedMesh)if(G._multiDrawInstances!==null)ws("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Ke.renderMultiDrawInstances(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount,G._multiDrawInstances);else if(Rt.get("WEBGL_multi_draw"))Ke.renderMultiDraw(G._multiDrawStarts,G._multiDrawCounts,G._multiDrawCount);else{const Ye=G._multiDrawStarts,Bt=G._multiDrawCounts,Ht=G._multiDrawCount,un=Ue?w.get(Ue).bytesPerElement:1,Ne=Xe.get(J).currentProgram.getUniforms();for(let Se=0;Se<Ht;Se++)Ne.setValue(z,"_gl_DrawID",Se),Ke.render(Ye[Se]/un,Bt[Se])}else if(G.isInstancedMesh)Ke.renderInstances(St,Ut,G.count);else if(Y.isInstancedBufferGeometry){const Ye=Y._maxInstanceCount!==void 0?Y._maxInstanceCount:1/0,Bt=Math.min(Y.instanceCount,Ye);Ke.renderInstances(St,Ut,Bt)}else Ke.render(St,Ut)};function te(A,k,Y){A.transparent===!0&&A.side===wn&&A.forceSinglePass===!1?(A.side=Rn,A.needsUpdate=!0,dt(A,k,Y),A.side=Xn,A.needsUpdate=!0,dt(A,k,Y),A.side=wn):dt(A,k,Y)}this.compile=function(A,k,Y=null){Y===null&&(Y=A),p=We.get(Y),p.init(k),b.push(p),Y.traverseVisible(function(G){G.isLight&&G.layers.test(k.layers)&&(p.pushLight(G),G.castShadow&&p.pushShadow(G))}),A!==Y&&A.traverseVisible(function(G){G.isLight&&G.layers.test(k.layers)&&(p.pushLight(G),G.castShadow&&p.pushShadow(G))}),p.setupLights();const J=new Set;return A.traverse(function(G){if(!(G.isMesh||G.isPoints||G.isLine||G.isSprite))return;const fe=G.material;if(fe)if(Array.isArray(fe))for(let Me=0;Me<fe.length;Me++){const ze=fe[Me];te(ze,Y,G),J.add(ze)}else te(fe,Y,G),J.add(fe)}),p=b.pop(),J},this.compileAsync=function(A,k,Y=null){const J=this.compile(A,k,Y);return new Promise(G=>{function fe(){if(J.forEach(function(Me){Xe.get(Me).currentProgram.isReady()&&J.delete(Me)}),J.size===0){G(A);return}setTimeout(fe,10)}Rt.get("KHR_parallel_shader_compile")!==null?fe():setTimeout(fe,10)})};let we=null;function _e(A){we&&we(A)}function Te(){j.stop()}function je(){j.start()}const j=new Cu;j.setAnimationLoop(_e),typeof self<"u"&&j.setContext(self),this.setAnimationLoop=function(A){we=A,ye.setAnimationLoop(A),A===null?j.stop():j.start()},ye.addEventListener("sessionstart",Te),ye.addEventListener("sessionend",je),this.render=function(A,k){if(k!==void 0&&k.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(U===!0)return;if(A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),k.parent===null&&k.matrixWorldAutoUpdate===!0&&k.updateMatrixWorld(),ye.enabled===!0&&ye.isPresenting===!0&&(ye.cameraAutoUpdate===!0&&ye.updateCamera(k),k=ye.getCamera()),A.isScene===!0&&A.onBeforeRender(M,A,k,D),p=We.get(A,b.length),p.init(k),b.push(p),Le.multiplyMatrices(k.projectionMatrix,k.matrixWorldInverse),K.setFromProjectionMatrix(Le),ae=this.localClippingEnabled,re=st.init(this.clippingPlanes,ae),g=ct.get(A,E.length),g.init(),E.push(g),ye.enabled===!0&&ye.isPresenting===!0){const fe=M.xr.getDepthSensingMesh();fe!==null&&Fe(fe,k,-1/0,M.sortObjects)}Fe(A,k,0,M.sortObjects),g.finish(),M.sortObjects===!0&&g.sort(pe,be),Et=ye.enabled===!1||ye.isPresenting===!1||ye.hasDepthSensing()===!1,Et&&xe.addToRenderList(g,A),this.info.render.frame++,re===!0&&st.beginShadows();const Y=p.state.shadowsArray;rt.render(Y,A,k),re===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const J=g.opaque,G=g.transmissive;if(p.setupLights(),k.isArrayCamera){const fe=k.cameras;if(G.length>0)for(let Me=0,ze=fe.length;Me<ze;Me++){const Ue=fe[Me];Pt(J,G,A,Ue)}Et&&xe.render(A);for(let Me=0,ze=fe.length;Me<ze;Me++){const Ue=fe[Me];Tt(g,A,Ue,Ue.viewport)}}else G.length>0&&Pt(J,G,A,k),Et&&xe.render(A),Tt(g,A,k);D!==null&&P===0&&(gt.updateMultisampleRenderTarget(D),gt.updateRenderTargetMipmap(D)),A.isScene===!0&&A.onAfterRender(M,A,k),wt.resetDefaultState(),S=-1,y=null,b.pop(),b.length>0?(p=b[b.length-1],re===!0&&st.setGlobalState(M.clippingPlanes,p.state.camera)):p=null,E.pop(),E.length>0?g=E[E.length-1]:g=null};function Fe(A,k,Y,J){if(A.visible===!1)return;if(A.layers.test(k.layers)){if(A.isGroup)Y=A.renderOrder;else if(A.isLOD)A.autoUpdate===!0&&A.update(k);else if(A.isLight)p.pushLight(A),A.castShadow&&p.pushShadow(A);else if(A.isSprite){if(!A.frustumCulled||K.intersectsSprite(A)){J&&Ae.setFromMatrixPosition(A.matrixWorld).applyMatrix4(Le);const Me=de.update(A),ze=A.material;ze.visible&&g.push(A,Me,ze,Y,Ae.z,null)}}else if((A.isMesh||A.isLine||A.isPoints)&&(!A.frustumCulled||K.intersectsObject(A))){const Me=de.update(A),ze=A.material;if(J&&(A.boundingSphere!==void 0?(A.boundingSphere===null&&A.computeBoundingSphere(),Ae.copy(A.boundingSphere.center)):(Me.boundingSphere===null&&Me.computeBoundingSphere(),Ae.copy(Me.boundingSphere.center)),Ae.applyMatrix4(A.matrixWorld).applyMatrix4(Le)),Array.isArray(ze)){const Ue=Me.groups;for(let at=0,it=Ue.length;at<it;at++){const nt=Ue[at],St=ze[nt.materialIndex];St&&St.visible&&g.push(A,Me,St,Y,Ae.z,nt)}}else ze.visible&&g.push(A,Me,ze,Y,Ae.z,null)}}const fe=A.children;for(let Me=0,ze=fe.length;Me<ze;Me++)Fe(fe[Me],k,Y,J)}function Tt(A,k,Y,J){const G=A.opaque,fe=A.transmissive,Me=A.transparent;p.setupLightsView(Y),re===!0&&st.setGlobalState(M.clippingPlanes,Y),J&&Ge.viewport(N.copy(J)),G.length>0&&Xt(G,k,Y),fe.length>0&&Xt(fe,k,Y),Me.length>0&&Xt(Me,k,Y),Ge.buffers.depth.setTest(!0),Ge.buffers.depth.setMask(!0),Ge.buffers.color.setMask(!0),Ge.setPolygonOffset(!1)}function Pt(A,k,Y,J){if((Y.isScene===!0?Y.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[J.id]===void 0&&(p.state.transmissionRenderTarget[J.id]=new ts(1,1,{generateMipmaps:!0,type:Rt.has("EXT_color_buffer_half_float")||Rt.has("EXT_color_buffer_float")?cr:ci,minFilter:xi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:kt.workingColorSpace}));const fe=p.state.transmissionRenderTarget[J.id],Me=J.viewport||N;fe.setSize(Me.z*M.transmissionResolutionScale,Me.w*M.transmissionResolutionScale);const ze=M.getRenderTarget();M.setRenderTarget(fe),M.getClearColor(Q),ne=M.getClearAlpha(),ne<1&&M.setClearColor(16777215,.5),M.clear(),Et&&xe.render(Y);const Ue=M.toneMapping;M.toneMapping=Oi;const at=J.viewport;if(J.viewport!==void 0&&(J.viewport=void 0),p.setupLightsView(J),re===!0&&st.setGlobalState(M.clippingPlanes,J),Xt(A,Y,J),gt.updateMultisampleRenderTarget(fe),gt.updateRenderTargetMipmap(fe),Rt.has("WEBGL_multisampled_render_to_texture")===!1){let it=!1;for(let nt=0,St=k.length;nt<St;nt++){const Ft=k[nt],Ut=Ft.object,ve=Ft.geometry,Ke=Ft.material,Ye=Ft.group;if(Ke.side===wn&&Ut.layers.test(J.layers)){const Bt=Ke.side;Ke.side=Rn,Ke.needsUpdate=!0,nn(Ut,Y,J,ve,Ke,Ye),Ke.side=Bt,Ke.needsUpdate=!0,it=!0}}it===!0&&(gt.updateMultisampleRenderTarget(fe),gt.updateRenderTargetMipmap(fe))}M.setRenderTarget(ze),M.setClearColor(Q,ne),at!==void 0&&(J.viewport=at),M.toneMapping=Ue}function Xt(A,k,Y){const J=k.isScene===!0?k.overrideMaterial:null;for(let G=0,fe=A.length;G<fe;G++){const Me=A[G],ze=Me.object,Ue=Me.geometry,at=Me.group;let it=Me.material;it.allowOverride===!0&&J!==null&&(it=J),ze.layers.test(Y.layers)&&nn(ze,k,Y,Ue,it,at)}}function nn(A,k,Y,J,G,fe){A.onBeforeRender(M,k,Y,J,G,fe),A.modelViewMatrix.multiplyMatrices(Y.matrixWorldInverse,A.matrixWorld),A.normalMatrix.getNormalMatrix(A.modelViewMatrix),G.onBeforeRender(M,k,Y,J,A,fe),G.transparent===!0&&G.side===wn&&G.forceSinglePass===!1?(G.side=Rn,G.needsUpdate=!0,M.renderBufferDirect(Y,k,J,G,A,fe),G.side=Xn,G.needsUpdate=!0,M.renderBufferDirect(Y,k,J,G,A,fe),G.side=wn):M.renderBufferDirect(Y,k,J,G,A,fe),A.onAfterRender(M,k,Y,J,G,fe)}function dt(A,k,Y){k.isScene!==!0&&(k=lt);const J=Xe.get(A),G=p.state.lights,fe=p.state.shadowsArray,Me=G.state.version,ze=me.getParameters(A,G.state,fe,k,Y),Ue=me.getProgramCacheKey(ze);let at=J.programs;J.environment=A.isMeshStandardMaterial?k.environment:null,J.fog=k.fog,J.envMap=(A.isMeshStandardMaterial?O:on).get(A.envMap||J.environment),J.envMapRotation=J.environment!==null&&A.envMap===null?k.environmentRotation:A.envMapRotation,at===void 0&&(A.addEventListener("dispose",$),at=new Map,J.programs=at);let it=at.get(Ue);if(it!==void 0){if(J.currentProgram===it&&J.lightsStateVersion===Me)return Re(A,ze),it}else ze.uniforms=me.getUniforms(A),A.onBeforeCompile(ze,M),it=me.acquireProgram(ze,Ue),at.set(Ue,it),J.uniforms=ze.uniforms;const nt=J.uniforms;return(!A.isShaderMaterial&&!A.isRawShaderMaterial||A.clipping===!0)&&(nt.clippingPlanes=st.uniform),Re(A,ze),J.needsLights=Ct(A),J.lightsStateVersion=Me,J.needsLights&&(nt.ambientLightColor.value=G.state.ambient,nt.lightProbe.value=G.state.probe,nt.directionalLights.value=G.state.directional,nt.directionalLightShadows.value=G.state.directionalShadow,nt.spotLights.value=G.state.spot,nt.spotLightShadows.value=G.state.spotShadow,nt.rectAreaLights.value=G.state.rectArea,nt.ltc_1.value=G.state.rectAreaLTC1,nt.ltc_2.value=G.state.rectAreaLTC2,nt.pointLights.value=G.state.point,nt.pointLightShadows.value=G.state.pointShadow,nt.hemisphereLights.value=G.state.hemi,nt.directionalShadowMap.value=G.state.directionalShadowMap,nt.directionalShadowMatrix.value=G.state.directionalShadowMatrix,nt.spotShadowMap.value=G.state.spotShadowMap,nt.spotLightMatrix.value=G.state.spotLightMatrix,nt.spotLightMap.value=G.state.spotLightMap,nt.pointShadowMap.value=G.state.pointShadowMap,nt.pointShadowMatrix.value=G.state.pointShadowMatrix),J.currentProgram=it,J.uniformsList=null,it}function Lt(A){if(A.uniformsList===null){const k=A.currentProgram.getUniforms();A.uniformsList=aa.seqWithValue(k.seq,A.uniforms)}return A.uniformsList}function Re(A,k){const Y=Xe.get(A);Y.outputColorSpace=k.outputColorSpace,Y.batching=k.batching,Y.batchingColor=k.batchingColor,Y.instancing=k.instancing,Y.instancingColor=k.instancingColor,Y.instancingMorph=k.instancingMorph,Y.skinning=k.skinning,Y.morphTargets=k.morphTargets,Y.morphNormals=k.morphNormals,Y.morphColors=k.morphColors,Y.morphTargetsCount=k.morphTargetsCount,Y.numClippingPlanes=k.numClippingPlanes,Y.numIntersection=k.numClipIntersection,Y.vertexAlphas=k.vertexAlphas,Y.vertexTangents=k.vertexTangents,Y.toneMapping=k.toneMapping}function qt(A,k,Y,J,G){k.isScene!==!0&&(k=lt),gt.resetTextureUnits();const fe=k.fog,Me=J.isMeshStandardMaterial?k.environment:null,ze=D===null?M.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:Ds,Ue=(J.isMeshStandardMaterial?O:on).get(J.envMap||Me),at=J.vertexColors===!0&&!!Y.attributes.color&&Y.attributes.color.itemSize===4,it=!!Y.attributes.tangent&&(!!J.normalMap||J.anisotropy>0),nt=!!Y.morphAttributes.position,St=!!Y.morphAttributes.normal,Ft=!!Y.morphAttributes.color;let Ut=Oi;J.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(Ut=M.toneMapping);const ve=Y.morphAttributes.position||Y.morphAttributes.normal||Y.morphAttributes.color,Ke=ve!==void 0?ve.length:0,Ye=Xe.get(J),Bt=p.state.lights;if(re===!0&&(ae===!0||A!==y)){const Zt=A===y&&J.id===S;st.setState(J,A,Zt)}let Ht=!1;J.version===Ye.__version?(Ye.needsLights&&Ye.lightsStateVersion!==Bt.state.version||Ye.outputColorSpace!==ze||G.isBatchedMesh&&Ye.batching===!1||!G.isBatchedMesh&&Ye.batching===!0||G.isBatchedMesh&&Ye.batchingColor===!0&&G.colorTexture===null||G.isBatchedMesh&&Ye.batchingColor===!1&&G.colorTexture!==null||G.isInstancedMesh&&Ye.instancing===!1||!G.isInstancedMesh&&Ye.instancing===!0||G.isSkinnedMesh&&Ye.skinning===!1||!G.isSkinnedMesh&&Ye.skinning===!0||G.isInstancedMesh&&Ye.instancingColor===!0&&G.instanceColor===null||G.isInstancedMesh&&Ye.instancingColor===!1&&G.instanceColor!==null||G.isInstancedMesh&&Ye.instancingMorph===!0&&G.morphTexture===null||G.isInstancedMesh&&Ye.instancingMorph===!1&&G.morphTexture!==null||Ye.envMap!==Ue||J.fog===!0&&Ye.fog!==fe||Ye.numClippingPlanes!==void 0&&(Ye.numClippingPlanes!==st.numPlanes||Ye.numIntersection!==st.numIntersection)||Ye.vertexAlphas!==at||Ye.vertexTangents!==it||Ye.morphTargets!==nt||Ye.morphNormals!==St||Ye.morphColors!==Ft||Ye.toneMapping!==Ut||Ye.morphTargetsCount!==Ke)&&(Ht=!0):(Ht=!0,Ye.__version=J.version);let un=Ye.currentProgram;Ht===!0&&(un=dt(J,k,G));let Ne=!1,Se=!1,cn=!1;const Vt=un.getUniforms(),Kt=Ye.uniforms;if(Ge.useProgram(un.program)&&(Ne=!0,Se=!0,cn=!0),J.id!==S&&(S=J.id,Se=!0),Ne||y!==A){Ge.buffers.depth.getReversed()?(le.copy(A.projectionMatrix),gf(le),_f(le),Vt.setValue(z,"projectionMatrix",le)):Vt.setValue(z,"projectionMatrix",A.projectionMatrix),Vt.setValue(z,"viewMatrix",A.matrixWorldInverse);const dn=Vt.map.cameraPosition;dn!==void 0&&dn.setValue(z,ge.setFromMatrixPosition(A.matrixWorld)),At.logarithmicDepthBuffer&&Vt.setValue(z,"logDepthBufFC",2/(Math.log(A.far+1)/Math.LN2)),(J.isMeshPhongMaterial||J.isMeshToonMaterial||J.isMeshLambertMaterial||J.isMeshBasicMaterial||J.isMeshStandardMaterial||J.isShaderMaterial)&&Vt.setValue(z,"isOrthographic",A.isOrthographicCamera===!0),y!==A&&(y=A,Se=!0,cn=!0)}if(G.isSkinnedMesh){Vt.setOptional(z,G,"bindMatrix"),Vt.setOptional(z,G,"bindMatrixInverse");const Zt=G.skeleton;Zt&&(Zt.boneTexture===null&&Zt.computeBoneTexture(),Vt.setValue(z,"boneTexture",Zt.boneTexture,gt))}G.isBatchedMesh&&(Vt.setOptional(z,G,"batchingTexture"),Vt.setValue(z,"batchingTexture",G._matricesTexture,gt),Vt.setOptional(z,G,"batchingIdTexture"),Vt.setValue(z,"batchingIdTexture",G._indirectTexture,gt),Vt.setOptional(z,G,"batchingColorTexture"),G._colorsTexture!==null&&Vt.setValue(z,"batchingColorTexture",G._colorsTexture,gt));const sn=Y.morphAttributes;if((sn.position!==void 0||sn.normal!==void 0||sn.color!==void 0)&&Ze.update(G,Y,un),(Se||Ye.receiveShadow!==G.receiveShadow)&&(Ye.receiveShadow=G.receiveShadow,Vt.setValue(z,"receiveShadow",G.receiveShadow)),J.isMeshGouraudMaterial&&J.envMap!==null&&(Kt.envMap.value=Ue,Kt.flipEnvMap.value=Ue.isCubeTexture&&Ue.isRenderTargetTexture===!1?-1:1),J.isMeshStandardMaterial&&J.envMap===null&&k.environment!==null&&(Kt.envMapIntensity.value=k.environmentIntensity),Se&&(Vt.setValue(z,"toneMappingExposure",M.toneMappingExposure),Ye.needsLights&&Oe(Kt,cn),fe&&J.fog===!0&&ce.refreshFogUniforms(Kt,fe),ce.refreshMaterialUniforms(Kt,J,Z,se,p.state.transmissionRenderTarget[A.id]),aa.upload(z,Lt(Ye),Kt,gt)),J.isShaderMaterial&&J.uniformsNeedUpdate===!0&&(aa.upload(z,Lt(Ye),Kt,gt),J.uniformsNeedUpdate=!1),J.isSpriteMaterial&&Vt.setValue(z,"center",G.center),Vt.setValue(z,"modelViewMatrix",G.modelViewMatrix),Vt.setValue(z,"normalMatrix",G.normalMatrix),Vt.setValue(z,"modelMatrix",G.matrixWorld),J.isShaderMaterial||J.isRawShaderMaterial){const Zt=J.uniformsGroups;for(let dn=0,hi=Zt.length;dn<hi;dn++){const kn=Zt[dn];q.update(kn,un),q.bind(kn,un)}}return un}function Oe(A,k){A.ambientLightColor.needsUpdate=k,A.lightProbe.needsUpdate=k,A.directionalLights.needsUpdate=k,A.directionalLightShadows.needsUpdate=k,A.pointLights.needsUpdate=k,A.pointLightShadows.needsUpdate=k,A.spotLights.needsUpdate=k,A.spotLightShadows.needsUpdate=k,A.rectAreaLights.needsUpdate=k,A.hemisphereLights.needsUpdate=k}function Ct(A){return A.isMeshLambertMaterial||A.isMeshToonMaterial||A.isMeshPhongMaterial||A.isMeshStandardMaterial||A.isShadowMaterial||A.isShaderMaterial&&A.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return P},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(A,k,Y){const J=Xe.get(A);J.__autoAllocateDepthBuffer=A.resolveDepthBuffer===!1,J.__autoAllocateDepthBuffer===!1&&(J.__useRenderToTexture=!1),Xe.get(A.texture).__webglTexture=k,Xe.get(A.depthTexture).__webglTexture=J.__autoAllocateDepthBuffer?void 0:Y,J.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(A,k){const Y=Xe.get(A);Y.__webglFramebuffer=k,Y.__useDefaultFramebuffer=k===void 0};const Pe=z.createFramebuffer();this.setRenderTarget=function(A,k=0,Y=0){D=A,R=k,P=Y;let J=!0,G=null,fe=!1,Me=!1;if(A){const Ue=Xe.get(A);if(Ue.__useDefaultFramebuffer!==void 0)Ge.bindFramebuffer(z.FRAMEBUFFER,null),J=!1;else if(Ue.__webglFramebuffer===void 0)gt.setupRenderTarget(A);else if(Ue.__hasExternalTextures)gt.rebindTextures(A,Xe.get(A.texture).__webglTexture,Xe.get(A.depthTexture).__webglTexture);else if(A.depthBuffer){const nt=A.depthTexture;if(Ue.__boundDepthTexture!==nt){if(nt!==null&&Xe.has(nt)&&(A.width!==nt.image.width||A.height!==nt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");gt.setupDepthRenderbuffer(A)}}const at=A.texture;(at.isData3DTexture||at.isDataArrayTexture||at.isCompressedArrayTexture)&&(Me=!0);const it=Xe.get(A).__webglFramebuffer;A.isWebGLCubeRenderTarget?(Array.isArray(it[k])?G=it[k][Y]:G=it[k],fe=!0):A.samples>0&>.useMultisampledRTT(A)===!1?G=Xe.get(A).__webglMultisampledFramebuffer:Array.isArray(it)?G=it[Y]:G=it,N.copy(A.viewport),W.copy(A.scissor),X=A.scissorTest}else N.copy(Ce).multiplyScalar(Z).floor(),W.copy(Ie).multiplyScalar(Z).floor(),X=He;if(Y!==0&&(G=Pe),Ge.bindFramebuffer(z.FRAMEBUFFER,G)&&J&&Ge.drawBuffers(A,G),Ge.viewport(N),Ge.scissor(W),Ge.setScissorTest(X),fe){const Ue=Xe.get(A.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+k,Ue.__webglTexture,Y)}else if(Me){const Ue=Xe.get(A.texture),at=k;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Ue.__webglTexture,Y,at)}else if(A!==null&&Y!==0){const Ue=Xe.get(A.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Ue.__webglTexture,Y)}S=-1},this.readRenderTargetPixels=function(A,k,Y,J,G,fe,Me,ze=0){if(!(A&&A.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ue=Xe.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Me!==void 0&&(Ue=Ue[Me]),Ue){Ge.bindFramebuffer(z.FRAMEBUFFER,Ue);try{const at=A.textures[ze],it=at.format,nt=at.type;if(!At.textureFormatReadable(it)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!At.textureTypeReadable(nt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}k>=0&&k<=A.width-J&&Y>=0&&Y<=A.height-G&&(A.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+ze),z.readPixels(k,Y,J,G,ke.convert(it),ke.convert(nt),fe))}finally{const at=D!==null?Xe.get(D).__webglFramebuffer:null;Ge.bindFramebuffer(z.FRAMEBUFFER,at)}}},this.readRenderTargetPixelsAsync=async function(A,k,Y,J,G,fe,Me,ze=0){if(!(A&&A.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ue=Xe.get(A).__webglFramebuffer;if(A.isWebGLCubeRenderTarget&&Me!==void 0&&(Ue=Ue[Me]),Ue)if(k>=0&&k<=A.width-J&&Y>=0&&Y<=A.height-G){Ge.bindFramebuffer(z.FRAMEBUFFER,Ue);const at=A.textures[ze],it=at.format,nt=at.type;if(!At.textureFormatReadable(it))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!At.textureTypeReadable(nt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const St=z.createBuffer();z.bindBuffer(z.PIXEL_PACK_BUFFER,St),z.bufferData(z.PIXEL_PACK_BUFFER,fe.byteLength,z.STREAM_READ),A.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+ze),z.readPixels(k,Y,J,G,ke.convert(it),ke.convert(nt),0);const Ft=D!==null?Xe.get(D).__webglFramebuffer:null;Ge.bindFramebuffer(z.FRAMEBUFFER,Ft);const Ut=z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE,0);return z.flush(),await mf(z,Ut,4),z.bindBuffer(z.PIXEL_PACK_BUFFER,St),z.getBufferSubData(z.PIXEL_PACK_BUFFER,0,fe),z.deleteBuffer(St),z.deleteSync(Ut),fe}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(A,k=null,Y=0){const J=Math.pow(2,-Y),G=Math.floor(A.image.width*J),fe=Math.floor(A.image.height*J),Me=k!==null?k.x:0,ze=k!==null?k.y:0;gt.setTexture2D(A,0),z.copyTexSubImage2D(z.TEXTURE_2D,Y,0,0,Me,ze,G,fe),Ge.unbindTexture()};const zt=z.createFramebuffer(),Je=z.createFramebuffer();this.copyTextureToTexture=function(A,k,Y=null,J=null,G=0,fe=null){fe===null&&(G!==0?(ws("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),fe=G,G=0):fe=0);let Me,ze,Ue,at,it,nt,St,Ft,Ut;const ve=A.isCompressedTexture?A.mipmaps[fe]:A.image;if(Y!==null)Me=Y.max.x-Y.min.x,ze=Y.max.y-Y.min.y,Ue=Y.isBox3?Y.max.z-Y.min.z:1,at=Y.min.x,it=Y.min.y,nt=Y.isBox3?Y.min.z:0;else{const sn=Math.pow(2,-G);Me=Math.floor(ve.width*sn),ze=Math.floor(ve.height*sn),A.isDataArrayTexture?Ue=ve.depth:A.isData3DTexture?Ue=Math.floor(ve.depth*sn):Ue=1,at=0,it=0,nt=0}J!==null?(St=J.x,Ft=J.y,Ut=J.z):(St=0,Ft=0,Ut=0);const Ke=ke.convert(k.format),Ye=ke.convert(k.type);let Bt;k.isData3DTexture?(gt.setTexture3D(k,0),Bt=z.TEXTURE_3D):k.isDataArrayTexture||k.isCompressedArrayTexture?(gt.setTexture2DArray(k,0),Bt=z.TEXTURE_2D_ARRAY):(gt.setTexture2D(k,0),Bt=z.TEXTURE_2D),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,k.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,k.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,k.unpackAlignment);const Ht=z.getParameter(z.UNPACK_ROW_LENGTH),un=z.getParameter(z.UNPACK_IMAGE_HEIGHT),Ne=z.getParameter(z.UNPACK_SKIP_PIXELS),Se=z.getParameter(z.UNPACK_SKIP_ROWS),cn=z.getParameter(z.UNPACK_SKIP_IMAGES);z.pixelStorei(z.UNPACK_ROW_LENGTH,ve.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,ve.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,at),z.pixelStorei(z.UNPACK_SKIP_ROWS,it),z.pixelStorei(z.UNPACK_SKIP_IMAGES,nt);const Vt=A.isDataArrayTexture||A.isData3DTexture,Kt=k.isDataArrayTexture||k.isData3DTexture;if(A.isDepthTexture){const sn=Xe.get(A),Zt=Xe.get(k),dn=Xe.get(sn.__renderTarget),hi=Xe.get(Zt.__renderTarget);Ge.bindFramebuffer(z.READ_FRAMEBUFFER,dn.__webglFramebuffer),Ge.bindFramebuffer(z.DRAW_FRAMEBUFFER,hi.__webglFramebuffer);for(let kn=0;kn<Ue;kn++)Vt&&(z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Xe.get(A).__webglTexture,G,nt+kn),z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Xe.get(k).__webglTexture,fe,Ut+kn)),z.blitFramebuffer(at,it,Me,ze,St,Ft,Me,ze,z.DEPTH_BUFFER_BIT,z.NEAREST);Ge.bindFramebuffer(z.READ_FRAMEBUFFER,null),Ge.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else if(G!==0||A.isRenderTargetTexture||Xe.has(A)){const sn=Xe.get(A),Zt=Xe.get(k);Ge.bindFramebuffer(z.READ_FRAMEBUFFER,zt),Ge.bindFramebuffer(z.DRAW_FRAMEBUFFER,Je);for(let dn=0;dn<Ue;dn++)Vt?z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,sn.__webglTexture,G,nt+dn):z.framebufferTexture2D(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,sn.__webglTexture,G),Kt?z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Zt.__webglTexture,fe,Ut+dn):z.framebufferTexture2D(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Zt.__webglTexture,fe),G!==0?z.blitFramebuffer(at,it,Me,ze,St,Ft,Me,ze,z.COLOR_BUFFER_BIT,z.NEAREST):Kt?z.copyTexSubImage3D(Bt,fe,St,Ft,Ut+dn,at,it,Me,ze):z.copyTexSubImage2D(Bt,fe,St,Ft,at,it,Me,ze);Ge.bindFramebuffer(z.READ_FRAMEBUFFER,null),Ge.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else Kt?A.isDataTexture||A.isData3DTexture?z.texSubImage3D(Bt,fe,St,Ft,Ut,Me,ze,Ue,Ke,Ye,ve.data):k.isCompressedArrayTexture?z.compressedTexSubImage3D(Bt,fe,St,Ft,Ut,Me,ze,Ue,Ke,ve.data):z.texSubImage3D(Bt,fe,St,Ft,Ut,Me,ze,Ue,Ke,Ye,ve):A.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,fe,St,Ft,Me,ze,Ke,Ye,ve.data):A.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,fe,St,Ft,ve.width,ve.height,Ke,ve.data):z.texSubImage2D(z.TEXTURE_2D,fe,St,Ft,Me,ze,Ke,Ye,ve);z.pixelStorei(z.UNPACK_ROW_LENGTH,Ht),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,un),z.pixelStorei(z.UNPACK_SKIP_PIXELS,Ne),z.pixelStorei(z.UNPACK_SKIP_ROWS,Se),z.pixelStorei(z.UNPACK_SKIP_IMAGES,cn),fe===0&&k.generateMipmaps&&z.generateMipmap(Bt),Ge.unbindTexture()},this.copyTextureToTexture3D=function(A,k,Y=null,J=null,G=0){return ws('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(A,k,Y,J,G)},this.initRenderTarget=function(A){Xe.get(A).__webglFramebuffer===void 0&>.setupRenderTarget(A)},this.initTexture=function(A){A.isCubeTexture?gt.setTextureCube(A,0):A.isData3DTexture?gt.setTexture3D(A,0):A.isDataArrayTexture||A.isCompressedArrayTexture?gt.setTexture2DArray(A,0):gt.setTexture2D(A,0),Ge.unbindTexture()},this.resetState=function(){R=0,P=0,D=null,Ge.reset(),wt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return yi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=kt._getDrawingBufferColorSpace(e),t.unpackColorSpace=kt._getUnpackColorSpace()}}var yg=Object.defineProperty,Mg=(s,e,t)=>e in s?yg(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Qt=(s,e,t)=>Mg(s,typeof e!="symbol"?e+"":e,t);const Uu=(s,e)=>{const[t,n]=e.split("-");return Object.assign(s.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:t==="top"?"0":t==="bottom"?"":"50%",bottom:t==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${t==="center"?"translateY(-50%)":""}`}),e},Sg=({placement:s,size:e,offset:t,id:n,className:i})=>{const r=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(r.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),Uu(r,s),n&&(r.id=n),i&&(r.className=i),r},bg=s=>{const e=typeof s=="string"?document.querySelector(s):s;if(!e)throw Error("Invalid DOM element");return e};function fl(s,e,t){return Math.max(e,Math.min(t,s))}const Eg=[["x",0,3],["y",1,4],["z",2,5]],vh=new F;function xh({isSphere:s},e,t){s&&(vh.set(0,0,1).applyQuaternion(t.quaternion),Eg.forEach(([n,i,r])=>{const a=vh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=fl(a>=0?l:l/2,0,1),o=e[r],l=o.userData.opacity,o.material.opacity=fl(a>=0?l/2:l,0,1)}))}const Ag=(s,e,t=10)=>Math.abs(s.clientX-e.x)<t&&Math.abs(s.clientY-e.y)<t,yh=new Up,Mh=new Qe,Sh=(s,e,t,n)=>{Mh.set((s.clientX-e.left)/e.width*2-1,-((s.clientY-e.top)/e.height)*2+1),yh.setFromCamera(Mh,t);const i=yh.intersectObjects(n,!1),r=i.length?i[0]:null;return!r||!r.object.visible?null:r},go=1e-6,wg=2*Math.PI,Nu=["x","y","z"],lr=[...Nu,"nx","ny","nz"],Tg=["x","z","y","nx","nz","ny"],Cg=["z","x","y","nz","nx","ny"],pl="Right",oa="Top",ml="Front",gl="Left",la="Bottom",_l="Back",Rg=[pl,oa,ml,gl,la,_l].map(s=>s.toLocaleLowerCase()),Iu=1.3,bh=(s,e=!0)=>{const{material:t,userData:n}=s,{color:i,opacity:r}=e?n.hover:n;t.color.set(i),t.opacity=r},ji=s=>JSON.parse(JSON.stringify(s)),Lg=s=>{const e=s.type||"sphere",t=e==="sphere",n=s.resolution||t?64:128,i=an.DEFAULT_UP,r=i.z===1,a=i.x===1,{container:o}=s;s.container=void 0,s=JSON.parse(JSON.stringify(s)),s.container=o;const l=r?Tg:a?Cg:lr;Rg.forEach((u,f)=>{s[u]&&(s[l[f]]=s[u])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:t?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:t?.45:.7,hover:{scale:t?.5:.7}},d={type:e,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:t?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:t?16777215:14739180,opacity:t?0:1,hover:{color:t?16777215:14739180,opacity:t?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!t,color:t?15915362:16777215,opacity:1,scale:t?.15:.2,radius:1,smoothness:18,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:.225}},edges:{enabled:!t,color:t?15915362:16777215,opacity:t?1:0,radius:t?1:.125,smoothness:18,scale:t?.15:1,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:1}},x:{...ji(c),...t?{label:"X",color:16725587,line:!0}:{label:a?oa:pl}},y:{...ji(c),...t?{label:"Y",color:9100032,line:!0}:{label:r||a?ml:oa}},z:{...ji(c),...t?{label:"Z",color:2920447,line:!0}:{label:r?oa:a?pl:ml}},nx:{...ji(h),label:t?"":a?la:gl},ny:{...ji(h),label:t?"":r||a?_l:la},nz:{...ji(h),label:t?"":r?la:a?gl:_l}};return vl(s,d),Nu.forEach(u=>vl(s[`n${u}`],ji(s[u]))),{...s,isSphere:t}};function vl(s,...e){if(s instanceof HTMLElement||typeof s!="object"||s===null)return s;for(const t of e)for(const n in t)n!=="container"&&n in t&&(s[n]===void 0?s[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(s[n]=vl(s[n]||{},t[n])));return s}const Pg=(s,e=2)=>{const t=new vt,n=e*2,{isSphere:i,resolution:r,radius:a,font:o,corners:l,edges:c}=s,h=lr.map(P=>({...s[P],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const d=document.createElement("canvas"),u=d.getContext("2d");d.width=r*2+n*2,d.height=r*h.length+n*h.length;const[f,m]=U(h,r,o);h.forEach(({radius:P,label:D,color:S,labelColor:y,border:N,hover:{color:W,labelColor:X,border:Q}},ne)=>{const H=r*ne+ne*n+e;M(e,H,e,r,P,D,N,S,y),M(r+e*3,H,e,r,P,D,Q??N,W??S,X??y)});const _=h.length,g=e/(r*2),p=e/(r*6),E=1/_,b=new jf(d);return b.repeat.set(.5-2*g,E-2*p),b.offset.set(g,1-p),Object.assign(b,{colorSpace:$t,wrapS:ai,wrapT:ai,userData:{offsetX:g,offsetY:p,cellHeight:E}}),b;function M(P,D,S,y,N,W,X,Q,ne){if(N=N*(y/2),Q!=null&&Q!==""&&(H(),u.fillStyle=t.set(Q).getStyle(),u.fill()),X&&X.size){const se=X.size*y/2;P+=se,D+=se,y-=X.size*y,N=Math.max(0,N-se),H(),u.strokeStyle=t.set(X.color).getStyle(),u.lineWidth=X.size*y,u.stroke()}W&&R(u,P+y/2,D+(y+S)/2,W,t.set(ne).getStyle());function H(){u.beginPath(),u.moveTo(P+N,D),u.lineTo(P+y-N,D),u.arcTo(P+y,D,P+y,D+N,N),u.lineTo(P+y,D+y-N),u.arcTo(P+y,D+y,P+y-N,D+y,N),u.lineTo(P+N,D+y),u.arcTo(P,D+y,P,D+y-N,N),u.lineTo(P,D+N),u.arcTo(P,D,P+N,D,N),u.closePath()}}function U(P,D,S){const y=[...P].sort((be,Ce)=>{var Ie,He;return(((Ie=be.label)==null?void 0:Ie.length)||0)-(((He=Ce.label)==null?void 0:He.length)||0)}).pop().label,{family:N,weight:W}=S,X=i?Math.sqrt(Math.pow(D*.7,2)/2):D;let Q=X,ne=0,H=0;do{u.font=`${W} ${Q}px ${N}`;const be=u.measureText(y);ne=be.width,H=be.fontBoundingBoxDescent,Q--}while(ne>X&&Q>0);const se=X/H,Z=Math.min(X/ne,se),pe=Math.floor(Q*Z);return[`${W} ${pe}px ${N}`,se]}function R(P,D,S,y,N){P.font=f,P.textAlign="center",P.textBaseline="middle",P.fillStyle=N,P.fillText(y,D,S+(i?m:0))}},Dg=(s,e)=>s.offset.x=(e?.5:0)+s.userData.offsetX,Gl=(s,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=s;t.y=1-(e+1)*i+n};function Wl(s,e,t=2,n=2){const i=t/2-s,r=n/2-s,a=s/t,o=(t-s)/t,l=s/n,c=(n-s)/n,h=[i,r,0,-i,r,0,-i,-r,0,i,-r,0],d=[o,c,a,c,a,l,o,l],u=[3*(e+1)+3,3*(e+1)+4,e+4,e+5,2*(e+1)+4,2,1,2*(e+1)+3,3,4*(e+1)+3,4,0],f=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(R=>u[R]);let m,_,g,p,E,b,M,U;for(let R=0;R<4;R++){p=R<1||R>2?i:-i,E=R<2?r:-r,b=R<1||R>2?o:a,M=R<2?c:l;for(let P=0;P<=e;P++)m=Math.PI/2*(R+P/e),_=Math.cos(m),g=Math.sin(m),h.push(p+s*_,E+s*g,0),d.push(b+a*_,M+l*g),P<e&&(U=(e+1)*R+P+4,f.push(R,U,U+1))}return new ln().setIndex(new fn(new Uint32Array(f),1)).setAttribute("position",new fn(new Float32Array(h),3)).setAttribute("uv",new fn(new Float32Array(d),2))}const Ug=(s,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:r}=s,a=Wl(i,r);return lr.map((o,l)=>{const c=l<3,h=lr[l],d=l?e.clone():e;Gl(d,l);const{enabled:u,scale:f,opacity:m,hover:_}=s[h],g={map:d,opacity:m,transparent:!0},p=n?new Dl(new ba(g)):new Jt(a,new zi(g)),E=c?h:h[1];return p.position[E]=(c?1:-1)*(n?Iu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(f),p.renderOrder=1,p.visible=u,p.userData={scale:f,opacity:m,hover:_},p})},Ng=(s,e)=>{const{isSphere:t,corners:n}=s;if(!n.enabled)return[];const{color:i,opacity:r,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Wl(o,l),d={transparent:!0,opacity:r},u=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),f=new F;return Array(u.length/3).fill(0).map((m,_)=>{if(t){const E=e.clone();Gl(E,6),d.map=E}else d.color=i;const g=t?new Dl(new ba(d)):new Jt(h,new zi(d)),p=_*3;return g.position.set(u[p],u[p+1],u[p+2]),t&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(f.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:r,scale:a,hover:c},g})},Ig=(s,e,t)=>{const{isSphere:n,edges:i}=s;if(!i.enabled)return[];const{color:r,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,d=n?null:Wl(c,h,1.2,.25),u={transparent:!0,opacity:a},f=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new F,_=new F(0,1,0);return Array(f.length/3).fill(0).map((g,p)=>{if(n){const M=e.clone();Gl(M,t),u.map=M}else u.color=r;const E=n?new Dl(new ba(u)):new Jt(d,new zi(u)),b=p*3;return E.position.set(f[b],f[b+1],f[b+2]),n&&E.position.normalize().multiplyScalar(1.7),E.scale.setScalar(o),E.up.copy(_),E.lookAt(m.copy(E.position).multiplyScalar(2)),!n&&!E.position.y&&(E.rotation.z=Math.PI/2),E.renderOrder=1,E.userData={color:r,opacity:a,scale:o,hover:l},E})};function Fg(s,e=!1){const t=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,l=new ln;let c=0;for(let h=0;h<s.length;++h){const d=s[h];let u=0;if(t!==(d.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const f in d.attributes){if(!n.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+f+'" attribute exists among all geometries, or in none of them.'),null;r[f]===void 0&&(r[f]=[]),r[f].push(d.attributes[f]),u++}if(u!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==d.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const f in d.morphAttributes){if(!i.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[f]===void 0&&(a[f]=[]),a[f].push(d.morphAttributes[f])}if(e){let f;if(t)f=d.index.count;else if(d.attributes.position!==void 0)f=d.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,f,h),c+=f}}if(t){let h=0;const d=[];for(let u=0;u<s.length;++u){const f=s[u].index;for(let m=0;m<f.count;++m)d.push(f.getX(m)+h);h+=s[u].attributes.position.count}l.setIndex(d)}for(const h in r){const d=Eh(r[h]);if(!d)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,d)}for(const h in a){const d=a[h][0].length;if(d===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let u=0;u<d;++u){const f=[];for(let _=0;_<a[h].length;++_)f.push(a[h][_][u]);const m=Eh(f);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function Eh(s){let e,t,n,i=-1,r=0;for(let c=0;c<s.length;++c){const h=s[c];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*t}const a=new e(r),o=new fn(a,t,n);let l=0;for(let c=0;c<s.length;++c){const h=s[c];if(h.isInterleavedBufferAttribute){const d=l/t;for(let u=0,f=h.count;u<f;u++)for(let m=0;m<t;m++){const _=h.getComponent(u,m);o.setComponent(u+d,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const Og=(s,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:r,hover:a}}=e;let o;const l=new zi({color:i,side:Rn,opacity:r,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new Jt(new Aa(1.8,64,64),l);else{let c;s.forEach(h=>{const d=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const u=h.geometry.clone();u.applyMatrix4(h.matrix),c=c?Fg([c,u]):u,h.scale.setScalar(d)}),o=new Jt(c,l)}return o.userData={color:i,opacity:r,hover:a},o},Ah=new ei,qr=new F;class Fu extends Lp{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new Dt(e,3)),this.setAttribute("uv",new Dt(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new hl(t,6,1);return this.setAttribute("instanceStart",new li(n,3,0)),this.setAttribute("instanceEnd",new li(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new hl(t,6,1);return this.setAttribute("instanceColorStart",new li(n,3,0)),this.setAttribute("instanceColorEnd",new li(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new cp(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Ah.setFromBufferAttribute(t),this.boundingBox.union(Ah))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ei),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)qr.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(qr)),qr.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(qr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}Ve.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Qe(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};Un.line={uniforms:Ll.merge([Ve.common,Ve.fog,Ve.line]),vertexShader:`
|
|
3827
|
+
}`;class mg{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const i=new Sn,r=e.properties.get(i);r.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Si({vertexShader:fg,fragmentShader:pg,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new en(new hr(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class gg extends ns{constructor(e,t){super();const n=this;let i=null,r=1,a=null,o="local-floor",l=1,c=null,h=null,f=null,u=null,d=null,m=null;const _=new mg,g=t.getContextAttributes();let p=null,S=null;const A=[],b=[],N=new Qe;let C=null;const P=new bn;P.viewport=new Xt;const D=new bn;D.viewport=new Xt;const E=[P,D],y=new Dp;let U=null,G=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(K){let te=A[K];return te===void 0&&(te=new Za,A[K]=te),te.getTargetRaySpace()},this.getControllerGrip=function(K){let te=A[K];return te===void 0&&(te=new Za,A[K]=te),te.getGripSpace()},this.getHand=function(K){let te=A[K];return te===void 0&&(te=new Za,A[K]=te),te.getHandSpace()};function X(K){const te=b.indexOf(K.inputSource);if(te===-1)return;const re=A[te];re!==void 0&&(re.update(K.inputSource,K.frame,c||a),re.dispatchEvent({type:K.type,data:K.inputSource}))}function Z(){i.removeEventListener("select",X),i.removeEventListener("selectstart",X),i.removeEventListener("selectend",X),i.removeEventListener("squeeze",X),i.removeEventListener("squeezestart",X),i.removeEventListener("squeezeend",X),i.removeEventListener("end",Z),i.removeEventListener("inputsourceschange",ie);for(let K=0;K<A.length;K++){const te=b[K];te!==null&&(b[K]=null,A[K].disconnect(te))}U=null,G=null,_.reset(),e.setRenderTarget(p),d=null,u=null,f=null,i=null,S=null,Oe.stop(),n.isPresenting=!1,e.setPixelRatio(C),e.setSize(N.width,N.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(K){r=K,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(K){o=K,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return c||a},this.setReferenceSpace=function(K){c=K},this.getBaseLayer=function(){return u!==null?u:d},this.getBinding=function(){return f},this.getFrame=function(){return m},this.getSession=function(){return i},this.setSession=async function(K){if(i=K,i!==null){if(p=e.getRenderTarget(),i.addEventListener("select",X),i.addEventListener("selectstart",X),i.addEventListener("selectend",X),i.addEventListener("squeeze",X),i.addEventListener("squeezestart",X),i.addEventListener("squeezeend",X),i.addEventListener("end",Z),i.addEventListener("inputsourceschange",ie),g.xrCompatible!==!0&&await t.makeXRCompatible(),C=e.getPixelRatio(),e.getSize(N),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let re=null,ae=null,Ie=null;g.depth&&(Ie=g.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,re=g.stencil?ar:rr,ae=g.stencil?sr:es);const ge={colorFormat:t.RGBA8,depthFormat:Ie,scaleFactor:r};f=new XRWebGLBinding(i,t),u=f.createProjectionLayer(ge),i.updateRenderState({layers:[u]}),e.setPixelRatio(1),e.setSize(u.textureWidth,u.textureHeight,!1),S=new ts(u.textureWidth,u.textureHeight,{format:Wn,type:ci,depthTexture:new gu(u.textureWidth,u.textureHeight,ae,void 0,void 0,void 0,void 0,void 0,void 0,re),stencilBuffer:g.stencil,colorSpace:e.outputColorSpace,samples:g.antialias?4:0,resolveDepthBuffer:u.ignoreDepthValues===!1,resolveStencilBuffer:u.ignoreDepthValues===!1})}else{const re={antialias:g.antialias,alpha:!0,depth:g.depth,stencil:g.stencil,framebufferScaleFactor:r};d=new XRWebGLLayer(i,t,re),i.updateRenderState({baseLayer:d}),e.setPixelRatio(1),e.setSize(d.framebufferWidth,d.framebufferHeight,!1),S=new ts(d.framebufferWidth,d.framebufferHeight,{format:Wn,type:ci,colorSpace:e.outputColorSpace,stencilBuffer:g.stencil,resolveDepthBuffer:d.ignoreDepthValues===!1,resolveStencilBuffer:d.ignoreDepthValues===!1})}S.isXRRenderTarget=!0,this.setFoveation(l),c=null,a=await i.requestReferenceSpace(o),Oe.setContext(i),Oe.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(i!==null)return i.environmentBlendMode},this.getDepthTexture=function(){return _.getDepthTexture()};function ie(K){for(let te=0;te<K.removed.length;te++){const re=K.removed[te],ae=b.indexOf(re);ae>=0&&(b[ae]=null,A[ae].disconnect(re))}for(let te=0;te<K.added.length;te++){const re=K.added[te];let ae=b.indexOf(re);if(ae===-1){for(let ge=0;ge<A.length;ge++)if(ge>=b.length){b.push(re),ae=ge;break}else if(b[ge]===null){b[ge]=re,ae=ge;break}if(ae===-1)break}const Ie=A[ae];Ie&&Ie.connect(re)}}const H=new F,oe=new F;function Y(K,te,re){H.setFromMatrixPosition(te.matrixWorld),oe.setFromMatrixPosition(re.matrixWorld);const ae=H.distanceTo(oe),Ie=te.projectionMatrix.elements,ge=re.projectionMatrix.elements,Re=Ie[14]/(Ie[10]-1),nt=Ie[14]/(Ie[10]+1),yt=(Ie[9]+1)/Ie[5],At=(Ie[9]-1)/Ie[5],z=(Ie[8]-1)/Ie[0],Ot=(ge[8]+1)/ge[0],Pt=Re*z,Ct=Re*Ot,Xe=ae/(-z+Ot),gt=Xe*-z;if(te.matrixWorld.decompose(K.position,K.quaternion,K.scale),K.translateX(gt),K.translateZ(Xe),K.matrixWorld.compose(K.position,K.quaternion,K.scale),K.matrixWorldInverse.copy(K.matrixWorld).invert(),Ie[10]===-1)K.projectionMatrix.copy(te.projectionMatrix),K.projectionMatrixInverse.copy(te.projectionMatrixInverse);else{const je=Re+Xe,_t=nt+Xe,ln=Pt-gt,O=Ct+(ae-gt),w=yt*nt/_t*je,ee=At*nt/_t*je;K.projectionMatrix.makePerspective(ln,O,w,ee,je,_t),K.projectionMatrixInverse.copy(K.projectionMatrix).invert()}}function me(K,te){te===null?K.matrixWorld.copy(K.matrix):K.matrixWorld.multiplyMatrices(te.matrixWorld,K.matrix),K.matrixWorldInverse.copy(K.matrixWorld).invert()}this.updateCamera=function(K){if(i===null)return;let te=K.near,re=K.far;_.texture!==null&&(_.depthNear>0&&(te=_.depthNear),_.depthFar>0&&(re=_.depthFar)),y.near=D.near=P.near=te,y.far=D.far=P.far=re,(U!==y.near||G!==y.far)&&(i.updateRenderState({depthNear:y.near,depthFar:y.far}),U=y.near,G=y.far),P.layers.mask=K.layers.mask|2,D.layers.mask=K.layers.mask|4,y.layers.mask=P.layers.mask|D.layers.mask;const ae=K.parent,Ie=y.cameras;me(y,ae);for(let ge=0;ge<Ie.length;ge++)me(Ie[ge],ae);Ie.length===2?Y(y,P,D):y.projectionMatrix.copy(P.projectionMatrix),Me(K,y,ae)};function Me(K,te,re){re===null?K.matrix.copy(te.matrixWorld):(K.matrix.copy(re.matrixWorld),K.matrix.invert(),K.matrix.multiply(te.matrixWorld)),K.matrix.decompose(K.position,K.quaternion,K.scale),K.updateMatrixWorld(!0),K.projectionMatrix.copy(te.projectionMatrix),K.projectionMatrixInverse.copy(te.projectionMatrixInverse),K.isPerspectiveCamera&&(K.fov=Us*2*Math.atan(1/K.projectionMatrix.elements[5]),K.zoom=1)}this.getCamera=function(){return y},this.getFoveation=function(){if(!(u===null&&d===null))return l},this.setFoveation=function(K){l=K,u!==null&&(u.fixedFoveation=K),d!==null&&d.fixedFoveation!==void 0&&(d.fixedFoveation=K)},this.hasDepthSensing=function(){return _.texture!==null},this.getDepthSensingMesh=function(){return _.getMesh(y)};let Ce=null;function Ye(K,te){if(h=te.getViewerPose(c||a),m=te,h!==null){const re=h.views;d!==null&&(e.setRenderTargetFramebuffer(S,d.framebuffer),e.setRenderTarget(S));let ae=!1;re.length!==y.cameras.length&&(y.cameras.length=0,ae=!0);for(let Re=0;Re<re.length;Re++){const nt=re[Re];let yt=null;if(d!==null)yt=d.getViewport(nt);else{const z=f.getViewSubImage(u,nt);yt=z.viewport,Re===0&&(e.setRenderTargetTextures(S,z.colorTexture,z.depthStencilTexture),e.setRenderTarget(S))}let At=E[Re];At===void 0&&(At=new bn,At.layers.enable(Re),At.viewport=new Xt,E[Re]=At),At.matrix.fromArray(nt.transform.matrix),At.matrix.decompose(At.position,At.quaternion,At.scale),At.projectionMatrix.fromArray(nt.projectionMatrix),At.projectionMatrixInverse.copy(At.projectionMatrix).invert(),At.viewport.set(yt.x,yt.y,yt.width,yt.height),Re===0&&(y.matrix.copy(At.matrix),y.matrix.decompose(y.position,y.quaternion,y.scale)),ae===!0&&y.cameras.push(At)}const Ie=i.enabledFeatures;if(Ie&&Ie.includes("depth-sensing")&&i.depthUsage=="gpu-optimized"&&f){const Re=f.getDepthInformation(re[0]);Re&&Re.isValid&&Re.texture&&_.init(e,Re,i.renderState)}}for(let re=0;re<A.length;re++){const ae=b[re],Ie=A[re];ae!==null&&Ie!==void 0&&Ie.update(ae,te,c||a)}Ce&&Ce(K,te),te.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:te}),m=null}const Oe=new Cu;Oe.setAnimationLoop(Ye),this.setAnimationLoop=function(K){Ce=K},this.dispose=function(){}}}const qi=new Ln,_g=new Tt;function vg(s,e){function t(g,p){g.matrixAutoUpdate===!0&&g.updateMatrix(),p.value.copy(g.matrix)}function n(g,p){p.color.getRGB(g.fogColor.value,lu(s)),p.isFog?(g.fogNear.value=p.near,g.fogFar.value=p.far):p.isFogExp2&&(g.fogDensity.value=p.density)}function i(g,p,S,A,b){p.isMeshBasicMaterial||p.isMeshLambertMaterial?r(g,p):p.isMeshToonMaterial?(r(g,p),f(g,p)):p.isMeshPhongMaterial?(r(g,p),h(g,p)):p.isMeshStandardMaterial?(r(g,p),u(g,p),p.isMeshPhysicalMaterial&&d(g,p,b)):p.isMeshMatcapMaterial?(r(g,p),m(g,p)):p.isMeshDepthMaterial?r(g,p):p.isMeshDistanceMaterial?(r(g,p),_(g,p)):p.isMeshNormalMaterial?r(g,p):p.isLineBasicMaterial?(a(g,p),p.isLineDashedMaterial&&o(g,p)):p.isPointsMaterial?l(g,p,S,A):p.isSpriteMaterial?c(g,p):p.isShadowMaterial?(g.color.value.copy(p.color),g.opacity.value=p.opacity):p.isShaderMaterial&&(p.uniformsNeedUpdate=!1)}function r(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,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.bumpMap&&(g.bumpMap.value=p.bumpMap,t(p.bumpMap,g.bumpMapTransform),g.bumpScale.value=p.bumpScale,p.side===Rn&&(g.bumpScale.value*=-1)),p.normalMap&&(g.normalMap.value=p.normalMap,t(p.normalMap,g.normalMapTransform),g.normalScale.value.copy(p.normalScale),p.side===Rn&&g.normalScale.value.negate()),p.displacementMap&&(g.displacementMap.value=p.displacementMap,t(p.displacementMap,g.displacementMapTransform),g.displacementScale.value=p.displacementScale,g.displacementBias.value=p.displacementBias),p.emissiveMap&&(g.emissiveMap.value=p.emissiveMap,t(p.emissiveMap,g.emissiveMapTransform)),p.specularMap&&(g.specularMap.value=p.specularMap,t(p.specularMap,g.specularMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest);const S=e.get(p),A=S.envMap,b=S.envMapRotation;A&&(g.envMap.value=A,qi.copy(b),qi.x*=-1,qi.y*=-1,qi.z*=-1,A.isCubeTexture&&A.isRenderTargetTexture===!1&&(qi.y*=-1,qi.z*=-1),g.envMapRotation.value.setFromMatrix4(_g.makeRotationFromEuler(qi)),g.flipEnvMap.value=A.isCubeTexture&&A.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,g.lightMapIntensity.value=p.lightMapIntensity,t(p.lightMap,g.lightMapTransform)),p.aoMap&&(g.aoMap.value=p.aoMap,g.aoMapIntensity.value=p.aoMapIntensity,t(p.aoMap,g.aoMapTransform))}function a(g,p){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,p.map&&(g.map.value=p.map,t(p.map,g.mapTransform))}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,S,A){g.diffuse.value.copy(p.color),g.opacity.value=p.opacity,g.size.value=p.size*S,g.scale.value=A*.5,p.map&&(g.map.value=p.map,t(p.map,g.uvTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}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,t(p.map,g.mapTransform)),p.alphaMap&&(g.alphaMap.value=p.alphaMap,t(p.alphaMap,g.alphaMapTransform)),p.alphaTest>0&&(g.alphaTest.value=p.alphaTest)}function h(g,p){g.specular.value.copy(p.specular),g.shininess.value=Math.max(p.shininess,1e-4)}function f(g,p){p.gradientMap&&(g.gradientMap.value=p.gradientMap)}function u(g,p){g.metalness.value=p.metalness,p.metalnessMap&&(g.metalnessMap.value=p.metalnessMap,t(p.metalnessMap,g.metalnessMapTransform)),g.roughness.value=p.roughness,p.roughnessMap&&(g.roughnessMap.value=p.roughnessMap,t(p.roughnessMap,g.roughnessMapTransform)),p.envMap&&(g.envMapIntensity.value=p.envMapIntensity)}function d(g,p,S){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,t(p.sheenColorMap,g.sheenColorMapTransform)),p.sheenRoughnessMap&&(g.sheenRoughnessMap.value=p.sheenRoughnessMap,t(p.sheenRoughnessMap,g.sheenRoughnessMapTransform))),p.clearcoat>0&&(g.clearcoat.value=p.clearcoat,g.clearcoatRoughness.value=p.clearcoatRoughness,p.clearcoatMap&&(g.clearcoatMap.value=p.clearcoatMap,t(p.clearcoatMap,g.clearcoatMapTransform)),p.clearcoatRoughnessMap&&(g.clearcoatRoughnessMap.value=p.clearcoatRoughnessMap,t(p.clearcoatRoughnessMap,g.clearcoatRoughnessMapTransform)),p.clearcoatNormalMap&&(g.clearcoatNormalMap.value=p.clearcoatNormalMap,t(p.clearcoatNormalMap,g.clearcoatNormalMapTransform),g.clearcoatNormalScale.value.copy(p.clearcoatNormalScale),p.side===Rn&&g.clearcoatNormalScale.value.negate())),p.dispersion>0&&(g.dispersion.value=p.dispersion),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,t(p.iridescenceMap,g.iridescenceMapTransform)),p.iridescenceThicknessMap&&(g.iridescenceThicknessMap.value=p.iridescenceThicknessMap,t(p.iridescenceThicknessMap,g.iridescenceThicknessMapTransform))),p.transmission>0&&(g.transmission.value=p.transmission,g.transmissionSamplerMap.value=S.texture,g.transmissionSamplerSize.value.set(S.width,S.height),p.transmissionMap&&(g.transmissionMap.value=p.transmissionMap,t(p.transmissionMap,g.transmissionMapTransform)),g.thickness.value=p.thickness,p.thicknessMap&&(g.thicknessMap.value=p.thicknessMap,t(p.thicknessMap,g.thicknessMapTransform)),g.attenuationDistance.value=p.attenuationDistance,g.attenuationColor.value.copy(p.attenuationColor)),p.anisotropy>0&&(g.anisotropyVector.value.set(p.anisotropy*Math.cos(p.anisotropyRotation),p.anisotropy*Math.sin(p.anisotropyRotation)),p.anisotropyMap&&(g.anisotropyMap.value=p.anisotropyMap,t(p.anisotropyMap,g.anisotropyMapTransform))),g.specularIntensity.value=p.specularIntensity,g.specularColor.value.copy(p.specularColor),p.specularColorMap&&(g.specularColorMap.value=p.specularColorMap,t(p.specularColorMap,g.specularColorMapTransform)),p.specularIntensityMap&&(g.specularIntensityMap.value=p.specularIntensityMap,t(p.specularIntensityMap,g.specularIntensityMapTransform))}function m(g,p){p.matcap&&(g.matcap.value=p.matcap)}function _(g,p){const S=e.get(p).light;g.referencePosition.value.setFromMatrixPosition(S.matrixWorld),g.nearDistance.value=S.shadow.camera.near,g.farDistance.value=S.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function xg(s,e,t,n){let i={},r={},a=[];const o=s.getParameter(s.MAX_UNIFORM_BUFFER_BINDINGS);function l(S,A){const b=A.program;n.uniformBlockBinding(S,b)}function c(S,A){let b=i[S.id];b===void 0&&(m(S),b=h(S),i[S.id]=b,S.addEventListener("dispose",g));const N=A.program;n.updateUBOMapping(S,N);const C=e.render.frame;r[S.id]!==C&&(u(S),r[S.id]=C)}function h(S){const A=f();S.__bindingPointIndex=A;const b=s.createBuffer(),N=S.__size,C=S.usage;return s.bindBuffer(s.UNIFORM_BUFFER,b),s.bufferData(s.UNIFORM_BUFFER,N,C),s.bindBuffer(s.UNIFORM_BUFFER,null),s.bindBufferBase(s.UNIFORM_BUFFER,A,b),b}function f(){for(let S=0;S<o;S++)if(a.indexOf(S)===-1)return a.push(S),S;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function u(S){const A=i[S.id],b=S.uniforms,N=S.__cache;s.bindBuffer(s.UNIFORM_BUFFER,A);for(let C=0,P=b.length;C<P;C++){const D=Array.isArray(b[C])?b[C]:[b[C]];for(let E=0,y=D.length;E<y;E++){const U=D[E];if(d(U,C,E,N)===!0){const G=U.__offset,X=Array.isArray(U.value)?U.value:[U.value];let Z=0;for(let ie=0;ie<X.length;ie++){const H=X[ie],oe=_(H);typeof H=="number"||typeof H=="boolean"?(U.__data[0]=H,s.bufferSubData(s.UNIFORM_BUFFER,G+Z,U.__data)):H.isMatrix3?(U.__data[0]=H.elements[0],U.__data[1]=H.elements[1],U.__data[2]=H.elements[2],U.__data[3]=0,U.__data[4]=H.elements[3],U.__data[5]=H.elements[4],U.__data[6]=H.elements[5],U.__data[7]=0,U.__data[8]=H.elements[6],U.__data[9]=H.elements[7],U.__data[10]=H.elements[8],U.__data[11]=0):(H.toArray(U.__data,Z),Z+=oe.storage/Float32Array.BYTES_PER_ELEMENT)}s.bufferSubData(s.UNIFORM_BUFFER,G,U.__data)}}}s.bindBuffer(s.UNIFORM_BUFFER,null)}function d(S,A,b,N){const C=S.value,P=A+"_"+b;if(N[P]===void 0)return typeof C=="number"||typeof C=="boolean"?N[P]=C:N[P]=C.clone(),!0;{const D=N[P];if(typeof C=="number"||typeof C=="boolean"){if(D!==C)return N[P]=C,!0}else if(D.equals(C)===!1)return D.copy(C),!0}return!1}function m(S){const A=S.uniforms;let b=0;const N=16;for(let P=0,D=A.length;P<D;P++){const E=Array.isArray(A[P])?A[P]:[A[P]];for(let y=0,U=E.length;y<U;y++){const G=E[y],X=Array.isArray(G.value)?G.value:[G.value];for(let Z=0,ie=X.length;Z<ie;Z++){const H=X[Z],oe=_(H),Y=b%N,me=Y%oe.boundary,Me=Y+me;b+=me,Me!==0&&N-Me<oe.storage&&(b+=N-Me),G.__data=new Float32Array(oe.storage/Float32Array.BYTES_PER_ELEMENT),G.__offset=b,b+=oe.storage}}}const C=b%N;return C>0&&(b+=N-C),S.__size=b,S.__cache={},this}function _(S){const A={boundary:0,storage:0};return typeof S=="number"||typeof S=="boolean"?(A.boundary=4,A.storage=4):S.isVector2?(A.boundary=8,A.storage=8):S.isVector3||S.isColor?(A.boundary=16,A.storage=12):S.isVector4?(A.boundary=16,A.storage=16):S.isMatrix3?(A.boundary=48,A.storage=48):S.isMatrix4?(A.boundary=64,A.storage=64):S.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",S),A}function g(S){const A=S.target;A.removeEventListener("dispose",g);const b=a.indexOf(A.__bindingPointIndex);a.splice(b,1),s.deleteBuffer(i[A.id]),delete i[A.id],delete r[A.id]}function p(){for(const S in i)s.deleteBuffer(i[S]);a=[],i={},r={}}return{bind:l,update:c,dispose:p}}class yg{constructor(e={}){const{canvas:t=mf(),context:n=null,depth:i=!0,stencil:r=!1,alpha:a=!1,antialias:o=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:f=!1,reverseDepthBuffer:u=!1}=e;this.isWebGLRenderer=!0;let d;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");d=n.getContextAttributes().alpha}else d=a;const m=new Uint32Array(4),_=new Int32Array(4);let g=null,p=null;const S=[],A=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=Oi,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const b=this;let N=!1;this._outputColorSpace=Qt;let C=0,P=0,D=null,E=-1,y=null;const U=new Xt,G=new Xt;let X=null;const Z=new xt(0);let ie=0,H=t.width,oe=t.height,Y=1,me=null,Me=null;const Ce=new Xt(0,0,H,oe),Ye=new Xt(0,0,H,oe);let Oe=!1;const K=new Nl;let te=!1,re=!1;const ae=new Tt,Ie=new Tt,ge=new F,Re=new Xt,nt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let yt=!1;function At(){return D===null?Y:1}let z=n;function Ot(M,B){return t.getContext(M,B)}try{const M={alpha:!0,depth:i,stencil:r,antialias:o,premultipliedAlpha:l,preserveDrawingBuffer:c,powerPreference:h,failIfMajorPerformanceCaveat:f};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${yl}`),t.addEventListener("webglcontextlost",et,!1),t.addEventListener("webglcontextrestored",Ae,!1),t.addEventListener("webglcontextcreationerror",I,!1),z===null){const B="webgl2";if(z=Ot(B,M),z===null)throw Ot(B)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(M){throw console.error("THREE.WebGLRenderer: "+M.message),M}let Pt,Ct,Xe,gt,je,_t,ln,O,w,ee,de,_e,le,lt,He,st,ot,ve,Ze,Mt,ft,Ge,Rt,q;function qe(){Pt=new L1(z),Pt.init(),Ge=new dg(z,Pt),Ct=new S1(z,Pt,e,Ge),Xe=new hg(z,Pt),Ct.reverseDepthBuffer&&u&&Xe.buffers.depth.setReversed(!0),gt=new U1(z),je=new K2,_t=new ug(z,Pt,Xe,je,Ct,Ge,gt),ln=new A1(b),O=new R1(b),w=new Bp(z),Rt=new M1(z,w),ee=new P1(z,w,gt,Rt),de=new I1(z,ee,w,gt),Ze=new N1(z,Ct,_t),st=new E1(je),_e=new J2(b,ln,O,Pt,Ct,Rt,st),le=new vg(b,je),lt=new Q2,He=new rg(Pt),ve=new y1(b,ln,O,Xe,de,d,l),ot=new lg(b,de,Ct),q=new xg(z,gt,Ct,Xe),Mt=new b1(z,Pt,gt),ft=new D1(z,Pt,gt),gt.programs=_e.programs,b.capabilities=Ct,b.extensions=Pt,b.properties=je,b.renderLists=lt,b.shadowMap=ot,b.state=Xe,b.info=gt}qe();const ye=new gg(b,z);this.xr=ye,this.getContext=function(){return z},this.getContextAttributes=function(){return z.getContextAttributes()},this.forceContextLoss=function(){const M=Pt.get("WEBGL_lose_context");M&&M.loseContext()},this.forceContextRestore=function(){const M=Pt.get("WEBGL_lose_context");M&&M.restoreContext()},this.getPixelRatio=function(){return Y},this.setPixelRatio=function(M){M!==void 0&&(Y=M,this.setSize(H,oe,!1))},this.getSize=function(M){return M.set(H,oe)},this.setSize=function(M,B,j=!0){if(ye.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}H=M,oe=B,t.width=Math.floor(M*Y),t.height=Math.floor(B*Y),j===!0&&(t.style.width=M+"px",t.style.height=B+"px"),this.setViewport(0,0,M,B)},this.getDrawingBufferSize=function(M){return M.set(H*Y,oe*Y).floor()},this.setDrawingBufferSize=function(M,B,j){H=M,oe=B,Y=j,t.width=Math.floor(M*j),t.height=Math.floor(B*j),this.setViewport(0,0,M,B)},this.getCurrentViewport=function(M){return M.copy(U)},this.getViewport=function(M){return M.copy(Ce)},this.setViewport=function(M,B,j,J){M.isVector4?Ce.set(M.x,M.y,M.z,M.w):Ce.set(M,B,j,J),Xe.viewport(U.copy(Ce).multiplyScalar(Y).round())},this.getScissor=function(M){return M.copy(Ye)},this.setScissor=function(M,B,j,J){M.isVector4?Ye.set(M.x,M.y,M.z,M.w):Ye.set(M,B,j,J),Xe.scissor(G.copy(Ye).multiplyScalar(Y).round())},this.getScissorTest=function(){return Oe},this.setScissorTest=function(M){Xe.setScissorTest(Oe=M)},this.setOpaqueSort=function(M){me=M},this.setTransparentSort=function(M){Me=M},this.getClearColor=function(M){return M.copy(ve.getClearColor())},this.setClearColor=function(){ve.setClearColor(...arguments)},this.getClearAlpha=function(){return ve.getClearAlpha()},this.setClearAlpha=function(){ve.setClearAlpha(...arguments)},this.clear=function(M=!0,B=!0,j=!0){let J=0;if(M){let W=!1;if(D!==null){const ce=D.texture.format;W=ce===wl||ce===Al||ce===El}if(W){const ce=D.texture.type,be=ce===ci||ce===es||ce===ir||ce===sr||ce===bl||ce===Sl,Ue=ve.getClearColor(),Fe=ve.getClearAlpha(),it=Ue.r,rt=Ue.g,$e=Ue.b;be?(m[0]=it,m[1]=rt,m[2]=$e,m[3]=Fe,z.clearBufferuiv(z.COLOR,0,m)):(_[0]=it,_[1]=rt,_[2]=$e,_[3]=Fe,z.clearBufferiv(z.COLOR,0,_))}else J|=z.COLOR_BUFFER_BIT}B&&(J|=z.DEPTH_BUFFER_BIT),j&&(J|=z.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),z.clear(J)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",et,!1),t.removeEventListener("webglcontextrestored",Ae,!1),t.removeEventListener("webglcontextcreationerror",I,!1),ve.dispose(),lt.dispose(),He.dispose(),je.dispose(),ln.dispose(),O.dispose(),de.dispose(),Rt.dispose(),q.dispose(),_e.dispose(),ye.dispose(),ye.removeEventListener("sessionstart",xe),ye.removeEventListener("sessionend",Ee),ke.stop()};function et(M){M.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function Ae(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1;const M=gt.autoReset,B=ot.enabled,j=ot.autoUpdate,J=ot.needsUpdate,W=ot.type;qe(),gt.autoReset=M,ot.enabled=B,ot.autoUpdate=j,ot.needsUpdate=J,ot.type=W}function I(M){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",M.statusMessage)}function k(M){const B=M.target;B.removeEventListener("dispose",k),Q(B)}function Q(M){pe(M),je.remove(M)}function pe(M){const B=je.get(M).programs;B!==void 0&&(B.forEach(function(j){_e.releaseProgram(j)}),M.isShaderMaterial&&_e.releaseShaderCache(M))}this.renderBufferDirect=function(M,B,j,J,W,ce){B===null&&(B=nt);const be=W.isMesh&&W.matrixWorld.determinant()<0,Ue=Te(M,B,j,J,W);Xe.setMaterial(J,be);let Fe=j.index,it=1;if(J.wireframe===!0){if(Fe=ee.getWireframeAttribute(j),Fe===void 0)return;it=2}const rt=j.drawRange,$e=j.attributes.position;let wt=rt.start*it,zt=(rt.start+rt.count)*it;ce!==null&&(wt=Math.max(wt,ce.start*it),zt=Math.min(zt,(ce.start+ce.count)*it)),Fe!==null?(wt=Math.max(wt,0),zt=Math.min(zt,Fe.count)):$e!=null&&(wt=Math.max(wt,0),zt=Math.min(zt,$e.count));const jt=zt-wt;if(jt<0||jt===1/0)return;Rt.setup(W,J,Ue,j,Fe);let Gt,fe=Mt;if(Fe!==null&&(Gt=w.get(Fe),fe=ft,fe.setIndex(Gt)),W.isMesh)J.wireframe===!0?(Xe.setLineWidth(J.wireframeLinewidth*At()),fe.setMode(z.LINES)):fe.setMode(z.TRIANGLES);else if(W.isLine){let Ne=J.linewidth;Ne===void 0&&(Ne=1),Xe.setLineWidth(Ne*At()),W.isLineSegments?fe.setMode(z.LINES):W.isLineLoop?fe.setMode(z.LINE_LOOP):fe.setMode(z.LINE_STRIP)}else W.isPoints?fe.setMode(z.POINTS):W.isSprite&&fe.setMode(z.TRIANGLES);if(W.isBatchedMesh)if(W._multiDrawInstances!==null)ws("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),fe.renderMultiDrawInstances(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount,W._multiDrawInstances);else if(Pt.get("WEBGL_multi_draw"))fe.renderMultiDraw(W._multiDrawStarts,W._multiDrawCounts,W._multiDrawCount);else{const Ne=W._multiDrawStarts,Bt=W._multiDrawCounts,bt=W._multiDrawCount,mn=Fe?w.get(Fe).bytesPerElement:1,Yt=je.get(J).currentProgram.getUniforms();for(let Je=0;Je<bt;Je++)Yt.setValue(z,"_gl_DrawID",Je),fe.render(Ne[Je]/mn,Bt[Je])}else if(W.isInstancedMesh)fe.renderInstances(wt,jt,W.count);else if(j.isInstancedBufferGeometry){const Ne=j._maxInstanceCount!==void 0?j._maxInstanceCount:1/0,Bt=Math.min(j.instanceCount,Ne);fe.renderInstances(wt,jt,Bt)}else fe.render(wt,jt)};function se(M,B,j){M.transparent===!0&&M.side===wn&&M.forceSinglePass===!1?(M.side=Rn,M.needsUpdate=!0,Vt(M,B,j),M.side=Xn,M.needsUpdate=!0,Vt(M,B,j),M.side=wn):Vt(M,B,j)}this.compile=function(M,B,j=null){j===null&&(j=M),p=He.get(j),p.init(B),A.push(p),j.traverseVisible(function(W){W.isLight&&W.layers.test(B.layers)&&(p.pushLight(W),W.castShadow&&p.pushShadow(W))}),M!==j&&M.traverseVisible(function(W){W.isLight&&W.layers.test(B.layers)&&(p.pushLight(W),W.castShadow&&p.pushShadow(W))}),p.setupLights();const J=new Set;return M.traverse(function(W){if(!(W.isMesh||W.isPoints||W.isLine||W.isSprite))return;const ce=W.material;if(ce)if(Array.isArray(ce))for(let be=0;be<ce.length;be++){const Ue=ce[be];se(Ue,j,W),J.add(Ue)}else se(ce,j,W),J.add(ce)}),p=A.pop(),J},this.compileAsync=function(M,B,j=null){const J=this.compile(M,B,j);return new Promise(W=>{function ce(){if(J.forEach(function(be){je.get(be).currentProgram.isReady()&&J.delete(be)}),J.size===0){W(M);return}setTimeout(ce,10)}Pt.get("KHR_parallel_shader_compile")!==null?ce():setTimeout(ce,10)})};let he=null;function we(M){he&&he(M)}function xe(){ke.stop()}function Ee(){ke.start()}const ke=new Cu;ke.setAnimationLoop(we),typeof self<"u"&&ke.setContext(self),this.setAnimationLoop=function(M){he=M,ye.setAnimationLoop(M),M===null?ke.stop():ke.start()},ye.addEventListener("sessionstart",xe),ye.addEventListener("sessionend",Ee),this.render=function(M,B){if(B!==void 0&&B.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(N===!0)return;if(M.matrixWorldAutoUpdate===!0&&M.updateMatrixWorld(),B.parent===null&&B.matrixWorldAutoUpdate===!0&&B.updateMatrixWorld(),ye.enabled===!0&&ye.isPresenting===!0&&(ye.cameraAutoUpdate===!0&&ye.updateCamera(B),B=ye.getCamera()),M.isScene===!0&&M.onBeforeRender(b,M,B,D),p=He.get(M,A.length),p.init(B),A.push(p),Ie.multiplyMatrices(B.projectionMatrix,B.matrixWorldInverse),K.setFromProjectionMatrix(Ie),re=this.localClippingEnabled,te=st.init(this.clippingPlanes,re),g=lt.get(M,S.length),g.init(),S.push(g),ye.enabled===!0&&ye.isPresenting===!0){const ce=b.xr.getDepthSensingMesh();ce!==null&&$(ce,B,-1/0,b.sortObjects)}$(M,B,0,b.sortObjects),g.finish(),b.sortObjects===!0&&g.sort(me,Me),yt=ye.enabled===!1||ye.isPresenting===!1||ye.hasDepthSensing()===!1,yt&&ve.addToRenderList(g,M),this.info.render.frame++,te===!0&&st.beginShadows();const j=p.state.shadowsArray;ot.render(j,M,B),te===!0&&st.endShadows(),this.info.autoReset===!0&&this.info.reset();const J=g.opaque,W=g.transmissive;if(p.setupLights(),B.isArrayCamera){const ce=B.cameras;if(W.length>0)for(let be=0,Ue=ce.length;be<Ue;be++){const Fe=ce[be];ht(J,W,M,Fe)}yt&&ve.render(M);for(let be=0,Ue=ce.length;be<Ue;be++){const Fe=ce[be];Be(g,M,Fe,Fe.viewport)}}else W.length>0&&ht(J,W,M,B),yt&&ve.render(M),Be(g,M,B);D!==null&&P===0&&(_t.updateMultisampleRenderTarget(D),_t.updateRenderTargetMipmap(D)),M.isScene===!0&&M.onAfterRender(b,M,B),Rt.resetDefaultState(),E=-1,y=null,A.pop(),A.length>0?(p=A[A.length-1],te===!0&&st.setGlobalState(b.clippingPlanes,p.state.camera)):p=null,S.pop(),S.length>0?g=S[S.length-1]:g=null};function $(M,B,j,J){if(M.visible===!1)return;if(M.layers.test(B.layers)){if(M.isGroup)j=M.renderOrder;else if(M.isLOD)M.autoUpdate===!0&&M.update(B);else if(M.isLight)p.pushLight(M),M.castShadow&&p.pushShadow(M);else if(M.isSprite){if(!M.frustumCulled||K.intersectsSprite(M)){J&&Re.setFromMatrixPosition(M.matrixWorld).applyMatrix4(Ie);const be=de.update(M),Ue=M.material;Ue.visible&&g.push(M,be,Ue,j,Re.z,null)}}else if((M.isMesh||M.isLine||M.isPoints)&&(!M.frustumCulled||K.intersectsObject(M))){const be=de.update(M),Ue=M.material;if(J&&(M.boundingSphere!==void 0?(M.boundingSphere===null&&M.computeBoundingSphere(),Re.copy(M.boundingSphere.center)):(be.boundingSphere===null&&be.computeBoundingSphere(),Re.copy(be.boundingSphere.center)),Re.applyMatrix4(M.matrixWorld).applyMatrix4(Ie)),Array.isArray(Ue)){const Fe=be.groups;for(let it=0,rt=Fe.length;it<rt;it++){const $e=Fe[it],wt=Ue[$e.materialIndex];wt&&wt.visible&&g.push(M,be,wt,j,Re.z,$e)}}else Ue.visible&&g.push(M,be,Ue,j,Re.z,null)}}const ce=M.children;for(let be=0,Ue=ce.length;be<Ue;be++)$(ce[be],B,j,J)}function Be(M,B,j,J){const W=M.opaque,ce=M.transmissive,be=M.transparent;p.setupLightsView(j),te===!0&&st.setGlobalState(b.clippingPlanes,j),J&&Xe.viewport(U.copy(J)),W.length>0&&vt(W,B,j),ce.length>0&&vt(ce,B,j),be.length>0&&vt(be,B,j),Xe.buffers.depth.setTest(!0),Xe.buffers.depth.setMask(!0),Xe.buffers.color.setMask(!0),Xe.setPolygonOffset(!1)}function ht(M,B,j,J){if((j.isScene===!0?j.overrideMaterial:null)!==null)return;p.state.transmissionRenderTarget[J.id]===void 0&&(p.state.transmissionRenderTarget[J.id]=new ts(1,1,{generateMipmaps:!0,type:Pt.has("EXT_color_buffer_half_float")||Pt.has("EXT_color_buffer_float")?cr:ci,minFilter:xi,samples:4,stencilBuffer:r,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:Wt.workingColorSpace}));const ce=p.state.transmissionRenderTarget[J.id],be=J.viewport||U;ce.setSize(be.z*b.transmissionResolutionScale,be.w*b.transmissionResolutionScale);const Ue=b.getRenderTarget();b.setRenderTarget(ce),b.getClearColor(Z),ie=b.getClearAlpha(),ie<1&&b.setClearColor(16777215,.5),b.clear(),yt&&ve.render(j);const Fe=b.toneMapping;b.toneMapping=Oi;const it=J.viewport;if(J.viewport!==void 0&&(J.viewport=void 0),p.setupLightsView(J),te===!0&&st.setGlobalState(b.clippingPlanes,J),vt(M,j,J),_t.updateMultisampleRenderTarget(ce),_t.updateRenderTargetMipmap(ce),Pt.has("WEBGL_multisampled_render_to_texture")===!1){let rt=!1;for(let $e=0,wt=B.length;$e<wt;$e++){const zt=B[$e],jt=zt.object,Gt=zt.geometry,fe=zt.material,Ne=zt.group;if(fe.side===wn&&jt.layers.test(J.layers)){const Bt=fe.side;fe.side=Rn,fe.needsUpdate=!0,Dt(jt,j,J,Gt,fe,Ne),fe.side=Bt,fe.needsUpdate=!0,rt=!0}}rt===!0&&(_t.updateMultisampleRenderTarget(ce),_t.updateRenderTargetMipmap(ce))}b.setRenderTarget(Ue),b.setClearColor(Z,ie),it!==void 0&&(J.viewport=it),b.toneMapping=Fe}function vt(M,B,j){const J=B.isScene===!0?B.overrideMaterial:null;for(let W=0,ce=M.length;W<ce;W++){const be=M[W],Ue=be.object,Fe=be.geometry,it=be.group;let rt=be.material;rt.allowOverride===!0&&J!==null&&(rt=J),Ue.layers.test(j.layers)&&Dt(Ue,B,j,Fe,rt,it)}}function Dt(M,B,j,J,W,ce){M.onBeforeRender(b,B,j,J,W,ce),M.modelViewMatrix.multiplyMatrices(j.matrixWorldInverse,M.matrixWorld),M.normalMatrix.getNormalMatrix(M.modelViewMatrix),W.onBeforeRender(b,B,j,J,M,ce),W.transparent===!0&&W.side===wn&&W.forceSinglePass===!1?(W.side=Rn,W.needsUpdate=!0,b.renderBufferDirect(j,B,J,W,M,ce),W.side=Xn,W.needsUpdate=!0,b.renderBufferDirect(j,B,J,W,M,ce),W.side=wn):b.renderBufferDirect(j,B,J,W,M,ce),M.onAfterRender(b,B,j,J,W,ce)}function Vt(M,B,j){B.isScene!==!0&&(B=nt);const J=je.get(M),W=p.state.lights,ce=p.state.shadowsArray,be=W.state.version,Ue=_e.getParameters(M,W.state,ce,B,j),Fe=_e.getProgramCacheKey(Ue);let it=J.programs;J.environment=M.isMeshStandardMaterial?B.environment:null,J.fog=B.fog,J.envMap=(M.isMeshStandardMaterial?O:ln).get(M.envMap||J.environment),J.envMapRotation=J.environment!==null&&M.envMap===null?B.environmentRotation:M.envMapRotation,it===void 0&&(M.addEventListener("dispose",k),it=new Map,J.programs=it);let rt=it.get(Fe);if(rt!==void 0){if(J.currentProgram===rt&&J.lightsStateVersion===be)return pt(M,Ue),rt}else Ue.uniforms=_e.getUniforms(M),M.onBeforeCompile(Ue,b),rt=_e.acquireProgram(Ue,Fe),it.set(Fe,rt),J.uniforms=Ue.uniforms;const $e=J.uniforms;return(!M.isShaderMaterial&&!M.isRawShaderMaterial||M.clipping===!0)&&($e.clippingPlanes=st.uniform),pt(M,Ue),J.needsLights=ze(M),J.lightsStateVersion=be,J.needsLights&&($e.ambientLightColor.value=W.state.ambient,$e.lightProbe.value=W.state.probe,$e.directionalLights.value=W.state.directional,$e.directionalLightShadows.value=W.state.directionalShadow,$e.spotLights.value=W.state.spot,$e.spotLightShadows.value=W.state.spotShadow,$e.rectAreaLights.value=W.state.rectArea,$e.ltc_1.value=W.state.rectAreaLTC1,$e.ltc_2.value=W.state.rectAreaLTC2,$e.pointLights.value=W.state.point,$e.pointLightShadows.value=W.state.pointShadow,$e.hemisphereLights.value=W.state.hemi,$e.directionalShadowMap.value=W.state.directionalShadowMap,$e.directionalShadowMatrix.value=W.state.directionalShadowMatrix,$e.spotShadowMap.value=W.state.spotShadowMap,$e.spotLightMatrix.value=W.state.spotLightMatrix,$e.spotLightMap.value=W.state.spotLightMap,$e.pointShadowMap.value=W.state.pointShadowMap,$e.pointShadowMatrix.value=W.state.pointShadowMatrix),J.currentProgram=rt,J.uniformsList=null,rt}function ut(M){if(M.uniformsList===null){const B=M.currentProgram.getUniforms();M.uniformsList=aa.seqWithValue(B.seq,M.uniforms)}return M.uniformsList}function pt(M,B){const j=je.get(M);j.outputColorSpace=B.outputColorSpace,j.batching=B.batching,j.batchingColor=B.batchingColor,j.instancing=B.instancing,j.instancingColor=B.instancingColor,j.instancingMorph=B.instancingMorph,j.skinning=B.skinning,j.morphTargets=B.morphTargets,j.morphNormals=B.morphNormals,j.morphColors=B.morphColors,j.morphTargetsCount=B.morphTargetsCount,j.numClippingPlanes=B.numClippingPlanes,j.numIntersection=B.numClipIntersection,j.vertexAlphas=B.vertexAlphas,j.vertexTangents=B.vertexTangents,j.toneMapping=B.toneMapping}function Te(M,B,j,J,W){B.isScene!==!0&&(B=nt),_t.resetTextureUnits();const ce=B.fog,be=J.isMeshStandardMaterial?B.environment:null,Ue=D===null?b.outputColorSpace:D.isXRRenderTarget===!0?D.texture.colorSpace:Ds,Fe=(J.isMeshStandardMaterial?O:ln).get(J.envMap||be),it=J.vertexColors===!0&&!!j.attributes.color&&j.attributes.color.itemSize===4,rt=!!j.attributes.tangent&&(!!J.normalMap||J.anisotropy>0),$e=!!j.morphAttributes.position,wt=!!j.morphAttributes.normal,zt=!!j.morphAttributes.color;let jt=Oi;J.toneMapped&&(D===null||D.isXRRenderTarget===!0)&&(jt=b.toneMapping);const Gt=j.morphAttributes.position||j.morphAttributes.normal||j.morphAttributes.color,fe=Gt!==void 0?Gt.length:0,Ne=je.get(J),Bt=p.state.lights;if(te===!0&&(re===!0||M!==y)){const Jt=M===y&&J.id===E;st.setState(J,M,Jt)}let bt=!1;J.version===Ne.__version?(Ne.needsLights&&Ne.lightsStateVersion!==Bt.state.version||Ne.outputColorSpace!==Ue||W.isBatchedMesh&&Ne.batching===!1||!W.isBatchedMesh&&Ne.batching===!0||W.isBatchedMesh&&Ne.batchingColor===!0&&W.colorTexture===null||W.isBatchedMesh&&Ne.batchingColor===!1&&W.colorTexture!==null||W.isInstancedMesh&&Ne.instancing===!1||!W.isInstancedMesh&&Ne.instancing===!0||W.isSkinnedMesh&&Ne.skinning===!1||!W.isSkinnedMesh&&Ne.skinning===!0||W.isInstancedMesh&&Ne.instancingColor===!0&&W.instanceColor===null||W.isInstancedMesh&&Ne.instancingColor===!1&&W.instanceColor!==null||W.isInstancedMesh&&Ne.instancingMorph===!0&&W.morphTexture===null||W.isInstancedMesh&&Ne.instancingMorph===!1&&W.morphTexture!==null||Ne.envMap!==Fe||J.fog===!0&&Ne.fog!==ce||Ne.numClippingPlanes!==void 0&&(Ne.numClippingPlanes!==st.numPlanes||Ne.numIntersection!==st.numIntersection)||Ne.vertexAlphas!==it||Ne.vertexTangents!==rt||Ne.morphTargets!==$e||Ne.morphNormals!==wt||Ne.morphColors!==zt||Ne.toneMapping!==jt||Ne.morphTargetsCount!==fe)&&(bt=!0):(bt=!0,Ne.__version=J.version);let mn=Ne.currentProgram;bt===!0&&(mn=Vt(J,B,W));let Yt=!1,Je=!1,Le=!1;const Nt=mn.getUniforms(),cn=Ne.uniforms;if(Xe.useProgram(mn.program)&&(Yt=!0,Je=!0,Le=!0),J.id!==E&&(E=J.id,Je=!0),Yt||y!==M){Xe.buffers.depth.getReversed()?(ae.copy(M.projectionMatrix),_f(ae),vf(ae),Nt.setValue(z,"projectionMatrix",ae)):Nt.setValue(z,"projectionMatrix",M.projectionMatrix),Nt.setValue(z,"viewMatrix",M.matrixWorldInverse);const nn=Nt.map.cameraPosition;nn!==void 0&&nn.setValue(z,ge.setFromMatrixPosition(M.matrixWorld)),Ct.logarithmicDepthBuffer&&Nt.setValue(z,"logDepthBufFC",2/(Math.log(M.far+1)/Math.LN2)),(J.isMeshPhongMaterial||J.isMeshToonMaterial||J.isMeshLambertMaterial||J.isMeshBasicMaterial||J.isMeshStandardMaterial||J.isShaderMaterial)&&Nt.setValue(z,"isOrthographic",M.isOrthographicCamera===!0),y!==M&&(y=M,Je=!0,Le=!0)}if(W.isSkinnedMesh){Nt.setOptional(z,W,"bindMatrix"),Nt.setOptional(z,W,"bindMatrixInverse");const Jt=W.skeleton;Jt&&(Jt.boneTexture===null&&Jt.computeBoneTexture(),Nt.setValue(z,"boneTexture",Jt.boneTexture,_t))}W.isBatchedMesh&&(Nt.setOptional(z,W,"batchingTexture"),Nt.setValue(z,"batchingTexture",W._matricesTexture,_t),Nt.setOptional(z,W,"batchingIdTexture"),Nt.setValue(z,"batchingIdTexture",W._indirectTexture,_t),Nt.setOptional(z,W,"batchingColorTexture"),W._colorsTexture!==null&&Nt.setValue(z,"batchingColorTexture",W._colorsTexture,_t));const $t=j.morphAttributes;if(($t.position!==void 0||$t.normal!==void 0||$t.color!==void 0)&&Ze.update(W,j,mn),(Je||Ne.receiveShadow!==W.receiveShadow)&&(Ne.receiveShadow=W.receiveShadow,Nt.setValue(z,"receiveShadow",W.receiveShadow)),J.isMeshGouraudMaterial&&J.envMap!==null&&(cn.envMap.value=Fe,cn.flipEnvMap.value=Fe.isCubeTexture&&Fe.isRenderTargetTexture===!1?-1:1),J.isMeshStandardMaterial&&J.envMap===null&&B.environment!==null&&(cn.envMapIntensity.value=B.environmentIntensity),Je&&(Nt.setValue(z,"toneMappingExposure",b.toneMappingExposure),Ne.needsLights&&qt(cn,Le),ce&&J.fog===!0&&le.refreshFogUniforms(cn,ce),le.refreshMaterialUniforms(cn,J,Y,oe,p.state.transmissionRenderTarget[M.id]),aa.upload(z,ut(Ne),cn,_t)),J.isShaderMaterial&&J.uniformsNeedUpdate===!0&&(aa.upload(z,ut(Ne),cn,_t),J.uniformsNeedUpdate=!1),J.isSpriteMaterial&&Nt.setValue(z,"center",W.center),Nt.setValue(z,"modelViewMatrix",W.modelViewMatrix),Nt.setValue(z,"normalMatrix",W.normalMatrix),Nt.setValue(z,"modelMatrix",W.matrixWorld),J.isShaderMaterial||J.isRawShaderMaterial){const Jt=J.uniformsGroups;for(let nn=0,hi=Jt.length;nn<hi;nn++){const kn=Jt[nn];q.update(kn,mn),q.bind(kn,mn)}}return mn}function qt(M,B){M.ambientLightColor.needsUpdate=B,M.lightProbe.needsUpdate=B,M.directionalLights.needsUpdate=B,M.directionalLightShadows.needsUpdate=B,M.pointLights.needsUpdate=B,M.pointLightShadows.needsUpdate=B,M.spotLights.needsUpdate=B,M.spotLightShadows.needsUpdate=B,M.rectAreaLights.needsUpdate=B,M.hemisphereLights.needsUpdate=B}function ze(M){return M.isMeshLambertMaterial||M.isMeshToonMaterial||M.isMeshPhongMaterial||M.isMeshStandardMaterial||M.isShadowMaterial||M.isShaderMaterial&&M.lights===!0}this.getActiveCubeFace=function(){return C},this.getActiveMipmapLevel=function(){return P},this.getRenderTarget=function(){return D},this.setRenderTargetTextures=function(M,B,j){const J=je.get(M);J.__autoAllocateDepthBuffer=M.resolveDepthBuffer===!1,J.__autoAllocateDepthBuffer===!1&&(J.__useRenderToTexture=!1),je.get(M.texture).__webglTexture=B,je.get(M.depthTexture).__webglTexture=J.__autoAllocateDepthBuffer?void 0:j,J.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(M,B){const j=je.get(M);j.__webglFramebuffer=B,j.__useDefaultFramebuffer=B===void 0};const Lt=z.createFramebuffer();this.setRenderTarget=function(M,B=0,j=0){D=M,C=B,P=j;let J=!0,W=null,ce=!1,be=!1;if(M){const Fe=je.get(M);if(Fe.__useDefaultFramebuffer!==void 0)Xe.bindFramebuffer(z.FRAMEBUFFER,null),J=!1;else if(Fe.__webglFramebuffer===void 0)_t.setupRenderTarget(M);else if(Fe.__hasExternalTextures)_t.rebindTextures(M,je.get(M.texture).__webglTexture,je.get(M.depthTexture).__webglTexture);else if(M.depthBuffer){const $e=M.depthTexture;if(Fe.__boundDepthTexture!==$e){if($e!==null&&je.has($e)&&(M.width!==$e.image.width||M.height!==$e.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");_t.setupDepthRenderbuffer(M)}}const it=M.texture;(it.isData3DTexture||it.isDataArrayTexture||it.isCompressedArrayTexture)&&(be=!0);const rt=je.get(M).__webglFramebuffer;M.isWebGLCubeRenderTarget?(Array.isArray(rt[B])?W=rt[B][j]:W=rt[B],ce=!0):M.samples>0&&_t.useMultisampledRTT(M)===!1?W=je.get(M).__webglMultisampledFramebuffer:Array.isArray(rt)?W=rt[j]:W=rt,U.copy(M.viewport),G.copy(M.scissor),X=M.scissorTest}else U.copy(Ce).multiplyScalar(Y).floor(),G.copy(Ye).multiplyScalar(Y).floor(),X=Oe;if(j!==0&&(W=Lt),Xe.bindFramebuffer(z.FRAMEBUFFER,W)&&J&&Xe.drawBuffers(M,W),Xe.viewport(U),Xe.scissor(G),Xe.setScissorTest(X),ce){const Fe=je.get(M.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+B,Fe.__webglTexture,j)}else if(be){const Fe=je.get(M.texture),it=B;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,Fe.__webglTexture,j,it)}else if(M!==null&&j!==0){const Fe=je.get(M.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Fe.__webglTexture,j)}E=-1},this.readRenderTargetPixels=function(M,B,j,J,W,ce,be,Ue=0){if(!(M&&M.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Fe=je.get(M).__webglFramebuffer;if(M.isWebGLCubeRenderTarget&&be!==void 0&&(Fe=Fe[be]),Fe){Xe.bindFramebuffer(z.FRAMEBUFFER,Fe);try{const it=M.textures[Ue],rt=it.format,$e=it.type;if(!Ct.textureFormatReadable(rt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Ct.textureTypeReadable($e)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}B>=0&&B<=M.width-J&&j>=0&&j<=M.height-W&&(M.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+Ue),z.readPixels(B,j,J,W,Ge.convert(rt),Ge.convert($e),ce))}finally{const it=D!==null?je.get(D).__webglFramebuffer:null;Xe.bindFramebuffer(z.FRAMEBUFFER,it)}}},this.readRenderTargetPixelsAsync=async function(M,B,j,J,W,ce,be,Ue=0){if(!(M&&M.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Fe=je.get(M).__webglFramebuffer;if(M.isWebGLCubeRenderTarget&&be!==void 0&&(Fe=Fe[be]),Fe)if(B>=0&&B<=M.width-J&&j>=0&&j<=M.height-W){Xe.bindFramebuffer(z.FRAMEBUFFER,Fe);const it=M.textures[Ue],rt=it.format,$e=it.type;if(!Ct.textureFormatReadable(rt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Ct.textureTypeReadable($e))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const wt=z.createBuffer();z.bindBuffer(z.PIXEL_PACK_BUFFER,wt),z.bufferData(z.PIXEL_PACK_BUFFER,ce.byteLength,z.STREAM_READ),M.textures.length>1&&z.readBuffer(z.COLOR_ATTACHMENT0+Ue),z.readPixels(B,j,J,W,Ge.convert(rt),Ge.convert($e),0);const zt=D!==null?je.get(D).__webglFramebuffer:null;Xe.bindFramebuffer(z.FRAMEBUFFER,zt);const jt=z.fenceSync(z.SYNC_GPU_COMMANDS_COMPLETE,0);return z.flush(),await gf(z,jt,4),z.bindBuffer(z.PIXEL_PACK_BUFFER,wt),z.getBufferSubData(z.PIXEL_PACK_BUFFER,0,ce),z.deleteBuffer(wt),z.deleteSync(jt),ce}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(M,B=null,j=0){const J=Math.pow(2,-j),W=Math.floor(M.image.width*J),ce=Math.floor(M.image.height*J),be=B!==null?B.x:0,Ue=B!==null?B.y:0;_t.setTexture2D(M,0),z.copyTexSubImage2D(z.TEXTURE_2D,j,0,0,be,Ue,W,ce),Xe.unbindTexture()};const De=z.createFramebuffer(),Ht=z.createFramebuffer();this.copyTextureToTexture=function(M,B,j=null,J=null,W=0,ce=null){ce===null&&(W!==0?(ws("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),ce=W,W=0):ce=0);let be,Ue,Fe,it,rt,$e,wt,zt,jt;const Gt=M.isCompressedTexture?M.mipmaps[ce]:M.image;if(j!==null)be=j.max.x-j.min.x,Ue=j.max.y-j.min.y,Fe=j.isBox3?j.max.z-j.min.z:1,it=j.min.x,rt=j.min.y,$e=j.isBox3?j.min.z:0;else{const $t=Math.pow(2,-W);be=Math.floor(Gt.width*$t),Ue=Math.floor(Gt.height*$t),M.isDataArrayTexture?Fe=Gt.depth:M.isData3DTexture?Fe=Math.floor(Gt.depth*$t):Fe=1,it=0,rt=0,$e=0}J!==null?(wt=J.x,zt=J.y,jt=J.z):(wt=0,zt=0,jt=0);const fe=Ge.convert(B.format),Ne=Ge.convert(B.type);let Bt;B.isData3DTexture?(_t.setTexture3D(B,0),Bt=z.TEXTURE_3D):B.isDataArrayTexture||B.isCompressedArrayTexture?(_t.setTexture2DArray(B,0),Bt=z.TEXTURE_2D_ARRAY):(_t.setTexture2D(B,0),Bt=z.TEXTURE_2D),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,B.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,B.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,B.unpackAlignment);const bt=z.getParameter(z.UNPACK_ROW_LENGTH),mn=z.getParameter(z.UNPACK_IMAGE_HEIGHT),Yt=z.getParameter(z.UNPACK_SKIP_PIXELS),Je=z.getParameter(z.UNPACK_SKIP_ROWS),Le=z.getParameter(z.UNPACK_SKIP_IMAGES);z.pixelStorei(z.UNPACK_ROW_LENGTH,Gt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,Gt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,it),z.pixelStorei(z.UNPACK_SKIP_ROWS,rt),z.pixelStorei(z.UNPACK_SKIP_IMAGES,$e);const Nt=M.isDataArrayTexture||M.isData3DTexture,cn=B.isDataArrayTexture||B.isData3DTexture;if(M.isDepthTexture){const $t=je.get(M),Jt=je.get(B),nn=je.get($t.__renderTarget),hi=je.get(Jt.__renderTarget);Xe.bindFramebuffer(z.READ_FRAMEBUFFER,nn.__webglFramebuffer),Xe.bindFramebuffer(z.DRAW_FRAMEBUFFER,hi.__webglFramebuffer);for(let kn=0;kn<Fe;kn++)Nt&&(z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,je.get(M).__webglTexture,W,$e+kn),z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,je.get(B).__webglTexture,ce,jt+kn)),z.blitFramebuffer(it,rt,be,Ue,wt,zt,be,Ue,z.DEPTH_BUFFER_BIT,z.NEAREST);Xe.bindFramebuffer(z.READ_FRAMEBUFFER,null),Xe.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else if(W!==0||M.isRenderTargetTexture||je.has(M)){const $t=je.get(M),Jt=je.get(B);Xe.bindFramebuffer(z.READ_FRAMEBUFFER,De),Xe.bindFramebuffer(z.DRAW_FRAMEBUFFER,Ht);for(let nn=0;nn<Fe;nn++)Nt?z.framebufferTextureLayer(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,$t.__webglTexture,W,$e+nn):z.framebufferTexture2D(z.READ_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,$t.__webglTexture,W),cn?z.framebufferTextureLayer(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,Jt.__webglTexture,ce,jt+nn):z.framebufferTexture2D(z.DRAW_FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_2D,Jt.__webglTexture,ce),W!==0?z.blitFramebuffer(it,rt,be,Ue,wt,zt,be,Ue,z.COLOR_BUFFER_BIT,z.NEAREST):cn?z.copyTexSubImage3D(Bt,ce,wt,zt,jt+nn,it,rt,be,Ue):z.copyTexSubImage2D(Bt,ce,wt,zt,it,rt,be,Ue);Xe.bindFramebuffer(z.READ_FRAMEBUFFER,null),Xe.bindFramebuffer(z.DRAW_FRAMEBUFFER,null)}else cn?M.isDataTexture||M.isData3DTexture?z.texSubImage3D(Bt,ce,wt,zt,jt,be,Ue,Fe,fe,Ne,Gt.data):B.isCompressedArrayTexture?z.compressedTexSubImage3D(Bt,ce,wt,zt,jt,be,Ue,Fe,fe,Gt.data):z.texSubImage3D(Bt,ce,wt,zt,jt,be,Ue,Fe,fe,Ne,Gt):M.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,ce,wt,zt,be,Ue,fe,Ne,Gt.data):M.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,ce,wt,zt,Gt.width,Gt.height,fe,Gt.data):z.texSubImage2D(z.TEXTURE_2D,ce,wt,zt,be,Ue,fe,Ne,Gt);z.pixelStorei(z.UNPACK_ROW_LENGTH,bt),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,mn),z.pixelStorei(z.UNPACK_SKIP_PIXELS,Yt),z.pixelStorei(z.UNPACK_SKIP_ROWS,Je),z.pixelStorei(z.UNPACK_SKIP_IMAGES,Le),ce===0&&B.generateMipmaps&&z.generateMipmap(Bt),Xe.unbindTexture()},this.copyTextureToTexture3D=function(M,B,j=null,J=null,W=0){return ws('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(M,B,j,J,W)},this.initRenderTarget=function(M){je.get(M).__webglFramebuffer===void 0&&_t.setupRenderTarget(M)},this.initTexture=function(M){M.isCubeTexture?_t.setTextureCube(M,0):M.isData3DTexture?_t.setTexture3D(M,0):M.isDataArrayTexture||M.isCompressedArrayTexture?_t.setTexture2DArray(M,0):_t.setTexture2D(M,0),Xe.unbindTexture()},this.resetState=function(){C=0,P=0,D=null,Xe.reset(),Rt.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return yi}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=Wt._getDrawingBufferColorSpace(e),t.unpackColorSpace=Wt._getUnpackColorSpace()}}var Mg=Object.defineProperty,bg=(s,e,t)=>e in s?Mg(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,tn=(s,e,t)=>bg(s,typeof e!="symbol"?e+"":e,t);const Uu=(s,e)=>{const[t,n]=e.split("-");return Object.assign(s.style,{left:n==="left"?"0":n==="center"?"50%":"",right:n==="right"?"0":"",top:t==="top"?"0":t==="bottom"?"":"50%",bottom:t==="bottom"?"0":"",transform:`${n==="center"?"translateX(-50%)":""} ${t==="center"?"translateY(-50%)":""}`}),e},Sg=({placement:s,size:e,offset:t,id:n,className:i})=>{const r=document.createElement("div"),{top:a,left:o,right:l,bottom:c}=t;return Object.assign(r.style,{id:n,position:"absolute",zIndex:"1000",height:`${e}px`,width:`${e}px`,margin:`${a}px ${l}px ${c}px ${o}px`,borderRadius:"100%"}),Uu(r,s),n&&(r.id=n),i&&(r.className=i),r},Eg=s=>{const e=typeof s=="string"?document.querySelector(s):s;if(!e)throw Error("Invalid DOM element");return e};function fl(s,e,t){return Math.max(e,Math.min(t,s))}const Ag=[["x",0,3],["y",1,4],["z",2,5]],vh=new F;function xh({isSphere:s},e,t){s&&(vh.set(0,0,1).applyQuaternion(t.quaternion),Ag.forEach(([n,i,r])=>{const a=vh[n];let o=e[i],l=o.userData.opacity;o.material.opacity=fl(a>=0?l:l/2,0,1),o=e[r],l=o.userData.opacity,o.material.opacity=fl(a>=0?l/2:l,0,1)}))}const wg=(s,e,t=10)=>Math.abs(s.clientX-e.x)<t&&Math.abs(s.clientY-e.y)<t,yh=new Np,Mh=new Qe,bh=(s,e,t,n)=>{Mh.set((s.clientX-e.left)/e.width*2-1,-((s.clientY-e.top)/e.height)*2+1),yh.setFromCamera(Mh,t);const i=yh.intersectObjects(n,!1),r=i.length?i[0]:null;return!r||!r.object.visible?null:r},go=1e-6,Tg=2*Math.PI,Nu=["x","y","z"],lr=[...Nu,"nx","ny","nz"],Cg=["x","z","y","nx","nz","ny"],Rg=["z","x","y","nz","nx","ny"],pl="Right",oa="Top",ml="Front",gl="Left",la="Bottom",_l="Back",Lg=[pl,oa,ml,gl,la,_l].map(s=>s.toLocaleLowerCase()),Iu=1.3,Sh=(s,e=!0)=>{const{material:t,userData:n}=s,{color:i,opacity:r}=e?n.hover:n;t.color.set(i),t.opacity=r},ji=s=>JSON.parse(JSON.stringify(s)),Pg=s=>{const e=s.type||"sphere",t=e==="sphere",n=s.resolution||t?64:128,i=on.DEFAULT_UP,r=i.z===1,a=i.x===1,{container:o}=s;s.container=void 0,s=JSON.parse(JSON.stringify(s)),s.container=o;const l=r?Cg:a?Rg:lr;Lg.forEach((u,d)=>{s[u]&&(s[l[d]]=s[u])});const c={enabled:!0,color:16777215,opacity:1,scale:.7,labelColor:2236962,line:!1,border:{size:0,color:14540253},hover:{color:t?16777215:9688043,labelColor:2236962,opacity:1,scale:.7,border:{size:0,color:14540253}}},h={line:!1,scale:t?.45:.7,hover:{scale:t?.5:.7}},f={type:e,container:document.body,size:128,placement:"top-right",resolution:n,lineWidth:4,radius:t?1:.2,smoothness:18,animated:!0,speed:1,background:{enabled:!0,color:t?16777215:14739180,opacity:t?0:1,hover:{color:t?16777215:14739180,opacity:t?.2:1}},font:{family:"sans-serif",weight:900},offset:{top:10,left:10,bottom:10,right:10},corners:{enabled:!t,color:t?15915362:16777215,opacity:1,scale:t?.15:.2,radius:1,smoothness:18,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:.225}},edges:{enabled:!t,color:t?15915362:16777215,opacity:t?1:0,radius:t?1:.125,smoothness:18,scale:t?.15:1,hover:{color:t?16777215:9688043,opacity:1,scale:t?.2:1}},x:{...ji(c),...t?{label:"X",color:16725587,line:!0}:{label:a?oa:pl}},y:{...ji(c),...t?{label:"Y",color:9100032,line:!0}:{label:r||a?ml:oa}},z:{...ji(c),...t?{label:"Z",color:2920447,line:!0}:{label:r?oa:a?pl:ml}},nx:{...ji(h),label:t?"":a?la:gl},ny:{...ji(h),label:t?"":r||a?_l:la},nz:{...ji(h),label:t?"":r?la:a?gl:_l}};return vl(s,f),Nu.forEach(u=>vl(s[`n${u}`],ji(s[u]))),{...s,isSphere:t}};function vl(s,...e){if(s instanceof HTMLElement||typeof s!="object"||s===null)return s;for(const t of e)for(const n in t)n!=="container"&&n in t&&(s[n]===void 0?s[n]=t[n]:typeof t[n]=="object"&&!Array.isArray(t[n])&&(s[n]=vl(s[n]||{},t[n])));return s}const Dg=(s,e=2)=>{const t=new xt,n=e*2,{isSphere:i,resolution:r,radius:a,font:o,corners:l,edges:c}=s,h=lr.map(P=>({...s[P],radius:a}));i&&l.enabled&&h.push(l),i&&c.enabled&&h.push(c);const f=document.createElement("canvas"),u=f.getContext("2d");f.width=r*2+n*2,f.height=r*h.length+n*h.length;const[d,m]=N(h,r,o);h.forEach(({radius:P,label:D,color:E,labelColor:y,border:U,hover:{color:G,labelColor:X,border:Z}},ie)=>{const H=r*ie+ie*n+e;b(e,H,e,r,P,D,U,E,y),b(r+e*3,H,e,r,P,D,Z??U,G??E,X??y)});const _=h.length,g=e/(r*2),p=e/(r*6),S=1/_,A=new Yf(f);return A.repeat.set(.5-2*g,S-2*p),A.offset.set(g,1-p),Object.assign(A,{colorSpace:Qt,wrapS:ai,wrapT:ai,userData:{offsetX:g,offsetY:p,cellHeight:S}}),A;function b(P,D,E,y,U,G,X,Z,ie){if(U=U*(y/2),Z!=null&&Z!==""&&(H(),u.fillStyle=t.set(Z).getStyle(),u.fill()),X&&X.size){const oe=X.size*y/2;P+=oe,D+=oe,y-=X.size*y,U=Math.max(0,U-oe),H(),u.strokeStyle=t.set(X.color).getStyle(),u.lineWidth=X.size*y,u.stroke()}G&&C(u,P+y/2,D+(y+E)/2,G,t.set(ie).getStyle());function H(){u.beginPath(),u.moveTo(P+U,D),u.lineTo(P+y-U,D),u.arcTo(P+y,D,P+y,D+U,U),u.lineTo(P+y,D+y-U),u.arcTo(P+y,D+y,P+y-U,D+y,U),u.lineTo(P+U,D+y),u.arcTo(P,D+y,P,D+y-U,U),u.lineTo(P,D+U),u.arcTo(P,D,P+U,D,U),u.closePath()}}function N(P,D,E){const y=[...P].sort((Me,Ce)=>{var Ye,Oe;return(((Ye=Me.label)==null?void 0:Ye.length)||0)-(((Oe=Ce.label)==null?void 0:Oe.length)||0)}).pop().label,{family:U,weight:G}=E,X=i?Math.sqrt(Math.pow(D*.7,2)/2):D;let Z=X,ie=0,H=0;do{u.font=`${G} ${Z}px ${U}`;const Me=u.measureText(y);ie=Me.width,H=Me.fontBoundingBoxDescent,Z--}while(ie>X&&Z>0);const oe=X/H,Y=Math.min(X/ie,oe),me=Math.floor(Z*Y);return[`${G} ${me}px ${U}`,oe]}function C(P,D,E,y,U){P.font=d,P.textAlign="center",P.textBaseline="middle",P.fillStyle=U,P.fillText(y,D,E+(i?m:0))}},Ug=(s,e)=>s.offset.x=(e?.5:0)+s.userData.offsetX,Gl=(s,e)=>{const{offset:t,userData:{offsetY:n,cellHeight:i}}=s;t.y=1-(e+1)*i+n};function Wl(s,e,t=2,n=2){const i=t/2-s,r=n/2-s,a=s/t,o=(t-s)/t,l=s/n,c=(n-s)/n,h=[i,r,0,-i,r,0,-i,-r,0,i,-r,0],f=[o,c,a,c,a,l,o,l],u=[3*(e+1)+3,3*(e+1)+4,e+4,e+5,2*(e+1)+4,2,1,2*(e+1)+3,3,4*(e+1)+3,4,0],d=[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11].map(C=>u[C]);let m,_,g,p,S,A,b,N;for(let C=0;C<4;C++){p=C<1||C>2?i:-i,S=C<2?r:-r,A=C<1||C>2?o:a,b=C<2?c:l;for(let P=0;P<=e;P++)m=Math.PI/2*(C+P/e),_=Math.cos(m),g=Math.sin(m),h.push(p+s*_,S+s*g,0),f.push(A+a*_,b+l*g),P<e&&(N=(e+1)*C+P+4,d.push(C,N,N+1))}return new hn().setIndex(new dn(new Uint32Array(d),1)).setAttribute("position",new dn(new Float32Array(h),3)).setAttribute("uv",new dn(new Float32Array(f),2))}const Ng=(s,e)=>{const t=new F,{isSphere:n,radius:i,smoothness:r}=s,a=Wl(i,r);return lr.map((o,l)=>{const c=l<3,h=lr[l],f=l?e.clone():e;Gl(f,l);const{enabled:u,scale:d,opacity:m,hover:_}=s[h],g={map:f,opacity:m,transparent:!0},p=n?new Dl(new Sa(g)):new en(a,new zi(g)),S=c?h:h[1];return p.position[S]=(c?1:-1)*(n?Iu:1),n||p.lookAt(t.copy(p.position).multiplyScalar(1.7)),p.scale.setScalar(d),p.renderOrder=1,p.visible=u,p.userData={scale:d,opacity:m,hover:_},p})},Ig=(s,e)=>{const{isSphere:t,corners:n}=s;if(!n.enabled)return[];const{color:i,opacity:r,scale:a,radius:o,smoothness:l,hover:c}=n,h=t?null:Wl(o,l),f={transparent:!0,opacity:r},u=[1,1,1,-1,1,1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,-1,-1,-1,-1,-1].map(m=>m*.85),d=new F;return Array(u.length/3).fill(0).map((m,_)=>{if(t){const S=e.clone();Gl(S,6),f.map=S}else f.color=i;const g=t?new Dl(new Sa(f)):new en(h,new zi(f)),p=_*3;return g.position.set(u[p],u[p+1],u[p+2]),t&&g.position.normalize().multiplyScalar(1.7),g.scale.setScalar(a),g.lookAt(d.copy(g.position).multiplyScalar(2)),g.renderOrder=1,g.userData={color:i,opacity:r,scale:a,hover:c},g})},Fg=(s,e,t)=>{const{isSphere:n,edges:i}=s;if(!i.enabled)return[];const{color:r,opacity:a,scale:o,hover:l,radius:c,smoothness:h}=i,f=n?null:Wl(c,h,1.2,.25),u={transparent:!0,opacity:a},d=[0,1,1,0,-1,1,1,0,1,-1,0,1,0,1,-1,0,-1,-1,1,0,-1,-1,0,-1,1,1,0,1,-1,0,-1,1,0,-1,-1,0].map(g=>g*.925),m=new F,_=new F(0,1,0);return Array(d.length/3).fill(0).map((g,p)=>{if(n){const b=e.clone();Gl(b,t),u.map=b}else u.color=r;const S=n?new Dl(new Sa(u)):new en(f,new zi(u)),A=p*3;return S.position.set(d[A],d[A+1],d[A+2]),n&&S.position.normalize().multiplyScalar(1.7),S.scale.setScalar(o),S.up.copy(_),S.lookAt(m.copy(S.position).multiplyScalar(2)),!n&&!S.position.y&&(S.rotation.z=Math.PI/2),S.renderOrder=1,S.userData={color:r,opacity:a,scale:o,hover:l},S})};function Og(s,e=!1){const t=s[0].index!==null,n=new Set(Object.keys(s[0].attributes)),i=new Set(Object.keys(s[0].morphAttributes)),r={},a={},o=s[0].morphTargetsRelative,l=new hn;let c=0;for(let h=0;h<s.length;++h){const f=s[h];let u=0;if(t!==(f.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(const d in f.attributes){if(!n.has(d))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;r[d]===void 0&&(r[d]=[]),r[d].push(f.attributes[d]),u++}if(u!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(o!==f.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(const d in f.morphAttributes){if(!i.has(d))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;a[d]===void 0&&(a[d]=[]),a[d].push(f.morphAttributes[d])}if(e){let d;if(t)d=f.index.count;else if(f.attributes.position!==void 0)d=f.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,d,h),c+=d}}if(t){let h=0;const f=[];for(let u=0;u<s.length;++u){const d=s[u].index;for(let m=0;m<d.count;++m)f.push(d.getX(m)+h);h+=s[u].attributes.position.count}l.setIndex(f)}for(const h in r){const f=Eh(r[h]);if(!f)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" attribute."),null;l.setAttribute(h,f)}for(const h in a){const f=a[h][0].length;if(f===0)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[h]=[];for(let u=0;u<f;++u){const d=[];for(let _=0;_<a[h].length;++_)d.push(a[h][_][u]);const m=Eh(d);if(!m)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+h+" morphAttribute."),null;l.morphAttributes[h].push(m)}}return l}function Eh(s){let e,t,n,i=-1,r=0;for(let c=0;c<s.length;++c){const h=s[c];if(e===void 0&&(e=h.array.constructor),e!==h.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=h.itemSize),t!==h.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=h.normalized),n!==h.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(i===-1&&(i=h.gpuType),i!==h.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;r+=h.count*t}const a=new e(r),o=new dn(a,t,n);let l=0;for(let c=0;c<s.length;++c){const h=s[c];if(h.isInterleavedBufferAttribute){const f=l/t;for(let u=0,d=h.count;u<d;u++)for(let m=0;m<t;m++){const _=h.getComponent(u,m);o.setComponent(u+f,m,_)}}else a.set(h.array,l);l+=h.count*t}return i!==void 0&&(o.gpuType=i),o}const zg=(s,e)=>{const{isSphere:t,background:{enabled:n,color:i,opacity:r,hover:a}}=e;let o;const l=new zi({color:i,side:Rn,opacity:r,transparent:!0,depthWrite:!1});if(!n)return null;if(t)o=new en(new Aa(1.8,64,64),l);else{let c;s.forEach(h=>{const f=h.scale.x;h.scale.setScalar(.9),h.updateMatrix();const u=h.geometry.clone();u.applyMatrix4(h.matrix),c=c?Og([c,u]):u,h.scale.setScalar(f)}),o=new en(c,l)}return o.userData={color:i,opacity:r,hover:a},o},Ah=new ei,qr=new F;class Fu extends Pp{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],t=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],n=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(n),this.setAttribute("position",new Ut(e,3)),this.setAttribute("uv",new Ut(t,2))}applyMatrix4(e){const t=this.attributes.instanceStart,n=this.attributes.instanceEnd;return t!==void 0&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new hl(t,6,1);return this.setAttribute("instanceStart",new li(n,3,0)),this.setAttribute("instanceEnd",new li(n,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));const n=new hl(t,6,1);return this.setAttribute("instanceColorStart",new li(n,3,0)),this.setAttribute("instanceColorEnd",new li(n,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new hp(e.geometry)),this}fromLineSegments(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new ei);const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;e!==void 0&&t!==void 0&&(this.boundingBox.setFromBufferAttribute(e),Ah.setFromBufferAttribute(t),this.boundingBox.union(Ah))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Ei),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(e!==void 0&&t!==void 0){const n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let r=0,a=e.count;r<a;r++)qr.fromBufferAttribute(e,r),i=Math.max(i,n.distanceToSquared(qr)),qr.fromBufferAttribute(t,r),i=Math.max(i,n.distanceToSquared(qr));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}We.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new Qe(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};Un.line={uniforms:Ll.merge([We.common,We.fog,We.line]),vertexShader:`
|
|
3828
3828
|
#include <common>
|
|
3829
3829
|
#include <color_pars_vertex>
|
|
3830
3830
|
#include <fog_pars_vertex>
|
|
@@ -4194,14 +4194,14 @@ void main() {
|
|
|
4194
4194
|
#include <premultiplied_alpha_fragment>
|
|
4195
4195
|
|
|
4196
4196
|
}
|
|
4197
|
-
`};class Xl extends bi{constructor(e){super({type:"LineMaterial",uniforms:Ll.clone(Un.line.uniforms),vertexShader:Un.line.vertexShader,fragmentShader:Un.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const _o=new Gt,wh=new F,Th=new F,xn=new Gt,yn=new Gt,ni=new Gt,vo=new F,xo=new bt,Mn=new Np,Ch=new F,jr=new ei,Yr=new Ei,ii=new Gt;let ri,Qi;function Rh(s,e,t){return ii.set(0,0,-e,1).applyMatrix4(s.projectionMatrix),ii.multiplyScalar(1/ii.w),ii.x=Qi/t.width,ii.y=Qi/t.height,ii.applyMatrix4(s.projectionMatrixInverse),ii.multiplyScalar(1/ii.w),Math.abs(Math.max(ii.x,ii.y))}function zg(s,e){const t=s.matrixWorld,n=s.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){Mn.start.fromBufferAttribute(i,o),Mn.end.fromBufferAttribute(r,o),Mn.applyMatrix4(t);const c=new F,h=new F;ri.distanceSqToSegment(Mn.start,Mn.end,h,c),h.distanceTo(c)<Qi*.5&&e.push({point:h,pointOnLine:c,distance:ri.origin.distanceTo(h),object:s,face:null,faceIndex:o,uv:null,uv1:null})}}function Bg(s,e,t){const n=e.projectionMatrix,i=s.material.resolution,r=s.matrixWorld,a=s.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-e.near;ri.at(1,ni),ni.w=1,ni.applyMatrix4(e.matrixWorldInverse),ni.applyMatrix4(n),ni.multiplyScalar(1/ni.w),ni.x*=i.x/2,ni.y*=i.y/2,ni.z=0,vo.copy(ni),xo.multiplyMatrices(e.matrixWorldInverse,r);for(let d=0,u=c;d<u;d++){if(xn.fromBufferAttribute(o,d),yn.fromBufferAttribute(l,d),xn.w=1,yn.w=1,xn.applyMatrix4(xo),yn.applyMatrix4(xo),xn.z>h&&yn.z>h)continue;if(xn.z>h){const p=xn.z-yn.z,E=(xn.z-h)/p;xn.lerp(yn,E)}else if(yn.z>h){const p=yn.z-xn.z,E=(yn.z-h)/p;yn.lerp(xn,E)}xn.applyMatrix4(n),yn.applyMatrix4(n),xn.multiplyScalar(1/xn.w),yn.multiplyScalar(1/yn.w),xn.x*=i.x/2,xn.y*=i.y/2,yn.x*=i.x/2,yn.y*=i.y/2,Mn.start.copy(xn),Mn.start.z=0,Mn.end.copy(yn),Mn.end.z=0;const f=Mn.closestPointToPointParameter(vo,!0);Mn.at(f,Ch);const m=Ki.lerp(xn.z,yn.z,f),_=m>=-1&&m<=1,g=vo.distanceTo(Ch)<Qi*.5;if(_&&g){Mn.start.fromBufferAttribute(o,d),Mn.end.fromBufferAttribute(l,d),Mn.start.applyMatrix4(r),Mn.end.applyMatrix4(r);const p=new F,E=new F;ri.distanceSqToSegment(Mn.start,Mn.end,E,p),t.push({point:E,pointOnLine:p,distance:ri.origin.distanceTo(E),object:s,face:null,faceIndex:d,uv:null,uv1:null})}}}class kg extends Jt{constructor(e=new Fu,t=new Xl({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let a=0,o=0,l=t.count;a<l;a++,o+=2)wh.fromBufferAttribute(t,a),Th.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+wh.distanceTo(Th);const r=new hl(i,2,1);return e.setAttribute("instanceDistanceStart",new li(r,1,0)),e.setAttribute("instanceDistanceEnd",new li(r,1,1)),this}raycast(e,t){const n=this.material.worldUnits,i=e.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=e.params.Line2!==void 0&&e.params.Line2.threshold||0;ri=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Qi=l.linewidth+r,o.boundingSphere===null&&o.computeBoundingSphere(),Yr.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Qi*.5;else{const d=Math.max(i.near,Yr.distanceToPoint(ri.origin));c=Rh(i,d,l.resolution)}if(Yr.radius+=c,ri.intersectsSphere(Yr)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),jr.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Qi*.5;else{const d=Math.max(i.near,jr.distanceToPoint(ri.origin));h=Rh(i,d,l.resolution)}jr.expandByScalar(h),ri.intersectsBox(jr)!==!1&&(n?zg(this,t):Bg(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(_o),this.material.uniforms.resolution.value.set(_o.z,_o.w))}}class Ou extends Fu{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let i=0;i<t;i++)n[6*i]=e[i].x,n[6*i+1]=e[i].y,n[6*i+2]=e[i].z||0,n[6*i+3]=e[i+1].x,n[6*i+4]=e[i+1].y,n[6*i+5]=e[i+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Vg extends kg{constructor(e=new Ou,t=new Xl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const Hg=s=>{const e=new vt,t=[],n=[],{isSphere:i}=s;if(lr.forEach((o,l)=>{const{enabled:c,line:h,scale:d,color:u}=s[o];if(!c||!h)return;const f=l<3?1:-1,m=(i?Iu-d/2:.975)*f;t.push(o.includes("x")?m:0,o.includes("y")?m:0,o.includes("z")?m:0,0,0,0);const _=e.set(u).toArray();n.push(..._,..._)}),!t.length)return null;const r=new Ou().setPositions(t).setColors(n),a=new Xl({linewidth:s.lineWidth,vertexColors:!0,resolution:new Qe(window.innerWidth,window.innerHeight)});return new Vg(r,a).computeLineDistances()},Gg=s=>{const{corners:e,edges:t}=s,n=[],i=Pg(s),r=Ug(s,i);n.push(...r),e.enabled&&n.push(...Ng(s,i)),t.enabled&&n.push(...Ig(s,i,e.enabled?7:6));const a=Og(r,s),o=Hg(s);return[n,a,o]},Js=(s,e=!0)=>{const{material:t,userData:n}=s,{opacity:i,color:r,scale:a}=e?n.hover:n;s.scale.setScalar(a),t.opacity=i,t.map?Dg(t.map,e):t.color.set(r)},Ss=new bt,Lh=new Tu,Wg=new Qe,Yi=new F,Ph=new Gt;class Xg extends an{constructor(e,t,n={}){super(),Qt(this,"enabled",!0),Qt(this,"camera"),Qt(this,"renderer"),Qt(this,"options"),Qt(this,"target",new F),Qt(this,"animated",!0),Qt(this,"speed",1),Qt(this,"animating",!1),Qt(this,"_options"),Qt(this,"_intersections"),Qt(this,"_background",null),Qt(this,"_viewport",[0,0,0,0]),Qt(this,"_originalViewport",[0,0,0,0]),Qt(this,"_originalScissor",[0,0,0,0]),Qt(this,"_scene"),Qt(this,"_camera"),Qt(this,"_container"),Qt(this,"_domElement"),Qt(this,"_domRect"),Qt(this,"_dragging",!1),Qt(this,"_distance",0),Qt(this,"_clock",new Dp),Qt(this,"_targetQuaternion",new zn),Qt(this,"_quaternionStart",new zn),Qt(this,"_quaternionEnd",new zn),Qt(this,"_pointerStart",new Qe),Qt(this,"_focus",null),Qt(this,"_placement"),Qt(this,"_controls"),Qt(this,"_controlsListeners"),this.camera=e,this.renderer=t,this._scene=new Pl().add(this),this.set(n)}get placement(){return this._placement}set placement(e){this._placement=Uu(this._domElement,e),this.domUpdate()}set(e={}){this.dispose(),this.options=e,this._options=Lg(e),this._camera=this._options.isSphere?new Ta(-1.8,1.8,1.8,-1.8,5,10):new Sn(26,1,5,10),this._camera.position.set(0,0,7);const[t,n,i]=Gg(this._options);n&&this.add(n),i&&this.add(i),this.add(...t),this._background=n,this._intersections=t;const{container:r,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=r?bg(r):document.body,this._domElement=Sg(this._options),this._domElement.onpointerdown=l=>this._onPointerDown(l),this._domElement.onpointermove=l=>this._onPointerMove(l),this._domElement.onpointerleave=()=>this._onPointerLeave(),this._container.appendChild(this._domElement),this._controls&&this.attachControls(this._controls),this.update(),this._updateOrientation(!0),this}render(){this.animating&&this._animate();const{renderer:e,_viewport:t}=this,n=e.getScissorTest(),i=e.autoClear;return e.autoClear=!1,e.setViewport(...t),n&&e.setScissor(...t),e.clear(!1,!0,!1),e.render(this._scene,this._camera),e.setViewport(...this._originalViewport),n&&e.setScissor(...this._originalScissor),e.autoClear=i,this}domUpdate(){this._domRect=this._domElement.getBoundingClientRect();const e=this.renderer,t=this._domRect,n=e.domElement.getBoundingClientRect();return this._viewport.splice(0,4,t.left-n.left,e.domElement.clientHeight-(t.top-n.top+t.height),t.width,t.height),e.getViewport(Ph).toArray(this._originalViewport),e.getScissorTest()&&e.getScissor(Ph).toArray(this._originalScissor),this}cameraUpdate(){return this._updateOrientation(),this}update(e=!0){return e&&this._controls&&this._controls.update(),this.domUpdate().cameraUpdate()}attachControls(e){return this.detachControls(),this.target=e.target,this._controlsListeners={start:()=>e.enabled=!1,end:()=>e.enabled=!0,change:()=>this.update(!1)},this.addEventListener("start",this._controlsListeners.start),this.addEventListener("end",this._controlsListeners.end),e.addEventListener("change",this._controlsListeners.change),this._controls=e,this}detachControls(){if(!(!this._controlsListeners||!this._controls))return this.target=new F().copy(this._controls.target),this.removeEventListener("start",this._controlsListeners.start),this.removeEventListener("end",this._controlsListeners.end),this._controls.removeEventListener("change",this._controlsListeners.change),this._controlsListeners=void 0,this._controls=void 0,this}dispose(){var e;this.detachControls(),this.children.forEach(t=>{var n,i,r,a;this.remove(t);const o=t;(n=o.material)==null||n.dispose(),(r=(i=o.material)==null?void 0:i.map)==null||r.dispose(),(a=o.geometry)==null||a.dispose()}),(e=this._domElement)==null||e.remove()}_updateOrientation(e=!0){e&&(this.quaternion.copy(this.camera.quaternion).invert(),this.updateMatrixWorld()),xh(this._options,this._intersections,this.camera)}_animate(){const{position:e,quaternion:t}=this.camera;if(e.set(0,0,1),!this.animated){e.applyQuaternion(this._quaternionEnd).multiplyScalar(this._distance).add(this.target),t.copy(this._targetQuaternion),this._updateOrientation(),this.animating=!1,this.dispatchEvent({type:"change"}),this.dispatchEvent({type:"end"});return}this._controls&&(this._controls.enabled=!1);const n=this._clock.getDelta()*wg*this.speed;this._quaternionStart.rotateTowards(this._quaternionEnd,n),e.applyQuaternion(this._quaternionStart).multiplyScalar(this._distance).add(this.target),t.rotateTowards(this._targetQuaternion,n),this._updateOrientation(),requestAnimationFrame(()=>this.dispatchEvent({type:"change"})),this._quaternionStart.angleTo(this._quaternionEnd)<go&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(e){const t=this.camera,n=this.target;Yi.copy(e).multiplyScalar(this._distance),Ss.setPosition(Yi).lookAt(Yi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(Ss),Yi.add(n),Ss.lookAt(Yi,n,this.up),this._quaternionEnd.setFromRotationMatrix(Ss),Ss.setPosition(t.position).lookAt(t.position,n,this.up),this._quaternionStart.setFromRotationMatrix(Ss),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(e){if(!this.enabled)return;const t=l=>{if(!this._dragging){if(Ag(l,this._pointerStart))return;this._dragging=!0}const c=Wg.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Yi.subVectors(this.camera.position,this.target)),d=Lh.setFromVector3(h);d.theta=a-c.x,d.phi=fl(o-c.y,go,Math.PI-go),this.coordinateConversion(this.camera.position.setFromSpherical(d),!0).add(this.target),this.camera.lookAt(this.target),this.quaternion.copy(this.camera.quaternion).invert(),this._updateOrientation(!1),this.dispatchEvent({type:"change"})},n=()=>{if(document.removeEventListener("pointermove",t,!1),document.removeEventListener("pointerup",n,!1),!this._dragging)return this._handleClick(e);this._focus&&(Js(this._focus,!1),this._focus=null),this._dragging=!1,this.dispatchEvent({type:"end"})};if(this.animating)return;e.preventDefault(),this._pointerStart.set(e.clientX,e.clientY);const i=this.coordinateConversion(Yi.subVectors(this.camera.position,this.target)),r=Lh.setFromVector3(i),a=r.theta,o=r.phi;this._distance=r.radius,document.addEventListener("pointermove",t,!1),document.addEventListener("pointerup",n,!1),this.dispatchEvent({type:"start"})}coordinateConversion(e,t=!1){const{x:n,y:i,z:r}=e,a=an.DEFAULT_UP;return a.x===1?t?e.set(i,r,n):e.set(r,n,i):a.z===1?t?e.set(r,n,i):e.set(i,r,n):e}_onPointerMove(e){!this.enabled||this._dragging||(this._background&&bh(this._background,!0),this._handleHover(e))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&bh(this._background,!1),this._focus&&Js(this._focus,!1),this._domElement.style.cursor="")}_handleClick(e){const t=Sh(e,this._domRect,this._camera,this._intersections);this._focus&&(Js(this._focus,!1),this._focus=null),t&&(this._setOrientation(t.object.position),this.dispatchEvent({type:"change"}))}_handleHover(e){const t=Sh(e,this._domRect,this._camera,this._intersections),n=(t==null?void 0:t.object)||null;this._focus!==n&&(this._domElement.style.cursor=n?"pointer":"",this._focus&&Js(this._focus,!1),(this._focus=n)?Js(n,!0):xh(this._options,this._intersections,this.camera))}}const qg=/^[og]\s*(.+)?/,jg=/^mtllib /,Yg=/^usemtl /,$g=/^usemap /,Dh=/\s+/,Uh=new F,yo=new F,Nh=new F,Ih=new F,Hn=new F,$r=new vt;function Jg(){const s={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,r){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const o={index:this.materials.length,name:i||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},n&&n.name&&typeof n.clone=="function"){const i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){const i=this.vertices,r=this.object.geometry.vertices;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const i=this.normals,r=this.object.geometry.normals;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,r=this.object.geometry.normals;Uh.fromArray(i,e),yo.fromArray(i,t),Nh.fromArray(i,n),Hn.subVectors(Nh,yo),Ih.subVectors(Uh,yo),Hn.cross(Ih),Hn.normalize(),r.push(Hn.x,Hn.y,Hn.z),r.push(Hn.x,Hn.y,Hn.z),r.push(Hn.x,Hn.y,Hn.z)},addColor:function(e,t,n){const i=this.colors,r=this.object.geometry.colors;i[e]!==void 0&&r.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&r.push(i[t+0],i[t+1],i[t+2]),i[n]!==void 0&&r.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,r=this.object.geometry.uvs;r.push(i[e+0],i[e+1]),r.push(i[t+0],i[t+1]),r.push(i[n+0],i[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,i,r,a,o,l,c){const h=this.vertices.length;let d=this.parseVertexIndex(e,h),u=this.parseVertexIndex(t,h),f=this.parseVertexIndex(n,h);if(this.addVertex(d,u,f),this.addColor(d,u,f),o!==void 0&&o!==""){const m=this.normals.length;d=this.parseNormalIndex(o,m),u=this.parseNormalIndex(l,m),f=this.parseNormalIndex(c,m),this.addNormal(d,u,f)}else this.addFaceNormal(d,u,f);if(i!==void 0&&i!==""){const m=this.uvs.length;d=this.parseUVIndex(i,m),u=this.parseUVIndex(r,m),f=this.parseUVIndex(a,m),this.addUV(d,u,f),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,i=e.length;n<i;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let r=0,a=e.length;r<a;r++)this.addVertexLine(this.parseVertexIndex(e[r],n));for(let r=0,a=t.length;r<a;r++)this.addUVLine(this.parseUVIndex(t[r],i))}};return s.startObject("",!1),s}class ca extends Qn{constructor(e){super(e),this.materials=null}load(e,t,n,i){const r=this,a=new Bs(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new Jg;e.indexOf(`\r
|
|
4197
|
+
`};class Xl extends Si{constructor(e){super({type:"LineMaterial",uniforms:Ll.clone(Un.line.uniforms),vertexShader:Un.line.vertexShader,fragmentShader:Un.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const _o=new Xt,wh=new F,Th=new F,xn=new Xt,yn=new Xt,ni=new Xt,vo=new F,xo=new Tt,Mn=new Ip,Ch=new F,jr=new ei,Yr=new Ei,ii=new Xt;let ri,Qi;function Rh(s,e,t){return ii.set(0,0,-e,1).applyMatrix4(s.projectionMatrix),ii.multiplyScalar(1/ii.w),ii.x=Qi/t.width,ii.y=Qi/t.height,ii.applyMatrix4(s.projectionMatrixInverse),ii.multiplyScalar(1/ii.w),Math.abs(Math.max(ii.x,ii.y))}function Bg(s,e){const t=s.matrixWorld,n=s.geometry,i=n.attributes.instanceStart,r=n.attributes.instanceEnd,a=Math.min(n.instanceCount,i.count);for(let o=0,l=a;o<l;o++){Mn.start.fromBufferAttribute(i,o),Mn.end.fromBufferAttribute(r,o),Mn.applyMatrix4(t);const c=new F,h=new F;ri.distanceSqToSegment(Mn.start,Mn.end,h,c),h.distanceTo(c)<Qi*.5&&e.push({point:h,pointOnLine:c,distance:ri.origin.distanceTo(h),object:s,face:null,faceIndex:o,uv:null,uv1:null})}}function kg(s,e,t){const n=e.projectionMatrix,i=s.material.resolution,r=s.matrixWorld,a=s.geometry,o=a.attributes.instanceStart,l=a.attributes.instanceEnd,c=Math.min(a.instanceCount,o.count),h=-e.near;ri.at(1,ni),ni.w=1,ni.applyMatrix4(e.matrixWorldInverse),ni.applyMatrix4(n),ni.multiplyScalar(1/ni.w),ni.x*=i.x/2,ni.y*=i.y/2,ni.z=0,vo.copy(ni),xo.multiplyMatrices(e.matrixWorldInverse,r);for(let f=0,u=c;f<u;f++){if(xn.fromBufferAttribute(o,f),yn.fromBufferAttribute(l,f),xn.w=1,yn.w=1,xn.applyMatrix4(xo),yn.applyMatrix4(xo),xn.z>h&&yn.z>h)continue;if(xn.z>h){const p=xn.z-yn.z,S=(xn.z-h)/p;xn.lerp(yn,S)}else if(yn.z>h){const p=yn.z-xn.z,S=(yn.z-h)/p;yn.lerp(xn,S)}xn.applyMatrix4(n),yn.applyMatrix4(n),xn.multiplyScalar(1/xn.w),yn.multiplyScalar(1/yn.w),xn.x*=i.x/2,xn.y*=i.y/2,yn.x*=i.x/2,yn.y*=i.y/2,Mn.start.copy(xn),Mn.start.z=0,Mn.end.copy(yn),Mn.end.z=0;const d=Mn.closestPointToPointParameter(vo,!0);Mn.at(d,Ch);const m=Ki.lerp(xn.z,yn.z,d),_=m>=-1&&m<=1,g=vo.distanceTo(Ch)<Qi*.5;if(_&&g){Mn.start.fromBufferAttribute(o,f),Mn.end.fromBufferAttribute(l,f),Mn.start.applyMatrix4(r),Mn.end.applyMatrix4(r);const p=new F,S=new F;ri.distanceSqToSegment(Mn.start,Mn.end,S,p),t.push({point:S,pointOnLine:p,distance:ri.origin.distanceTo(S),object:s,face:null,faceIndex:f,uv:null,uv1:null})}}}class Vg extends en{constructor(e=new Fu,t=new Xl({color:Math.random()*16777215})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let a=0,o=0,l=t.count;a<l;a++,o+=2)wh.fromBufferAttribute(t,a),Th.fromBufferAttribute(n,a),i[o]=o===0?0:i[o-1],i[o+1]=i[o]+wh.distanceTo(Th);const r=new hl(i,2,1);return e.setAttribute("instanceDistanceStart",new li(r,1,0)),e.setAttribute("instanceDistanceEnd",new li(r,1,1)),this}raycast(e,t){const n=this.material.worldUnits,i=e.camera;i===null&&!n&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const r=e.params.Line2!==void 0&&e.params.Line2.threshold||0;ri=e.ray;const a=this.matrixWorld,o=this.geometry,l=this.material;Qi=l.linewidth+r,o.boundingSphere===null&&o.computeBoundingSphere(),Yr.copy(o.boundingSphere).applyMatrix4(a);let c;if(n)c=Qi*.5;else{const f=Math.max(i.near,Yr.distanceToPoint(ri.origin));c=Rh(i,f,l.resolution)}if(Yr.radius+=c,ri.intersectsSphere(Yr)===!1)return;o.boundingBox===null&&o.computeBoundingBox(),jr.copy(o.boundingBox).applyMatrix4(a);let h;if(n)h=Qi*.5;else{const f=Math.max(i.near,jr.distanceToPoint(ri.origin));h=Rh(i,f,l.resolution)}jr.expandByScalar(h),ri.intersectsBox(jr)!==!1&&(n?Bg(this,t):kg(this,i,t))}onBeforeRender(e){const t=this.material.uniforms;t&&t.resolution&&(e.getViewport(_o),this.material.uniforms.resolution.value.set(_o.z,_o.w))}}class Ou extends Fu{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e){const t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setColors(n),this}setFromPoints(e){const t=e.length-1,n=new Float32Array(6*t);for(let i=0;i<t;i++)n[6*i]=e[i].x,n[6*i+1]=e[i].y,n[6*i+2]=e[i].z||0,n[6*i+3]=e[i+1].x,n[6*i+4]=e[i+1].y,n[6*i+5]=e[i+1].z||0;return super.setPositions(n),this}fromLine(e){const t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class Hg extends Vg{constructor(e=new Ou,t=new Xl({color:Math.random()*16777215})){super(e,t),this.isLine2=!0,this.type="Line2"}}const Gg=s=>{const e=new xt,t=[],n=[],{isSphere:i}=s;if(lr.forEach((o,l)=>{const{enabled:c,line:h,scale:f,color:u}=s[o];if(!c||!h)return;const d=l<3?1:-1,m=(i?Iu-f/2:.975)*d;t.push(o.includes("x")?m:0,o.includes("y")?m:0,o.includes("z")?m:0,0,0,0);const _=e.set(u).toArray();n.push(..._,..._)}),!t.length)return null;const r=new Ou().setPositions(t).setColors(n),a=new Xl({linewidth:s.lineWidth,vertexColors:!0,resolution:new Qe(window.innerWidth,window.innerHeight)});return new Hg(r,a).computeLineDistances()},Wg=s=>{const{corners:e,edges:t}=s,n=[],i=Dg(s),r=Ng(s,i);n.push(...r),e.enabled&&n.push(...Ig(s,i)),t.enabled&&n.push(...Fg(s,i,e.enabled?7:6));const a=zg(r,s),o=Gg(s);return[n,a,o]},Js=(s,e=!0)=>{const{material:t,userData:n}=s,{opacity:i,color:r,scale:a}=e?n.hover:n;s.scale.setScalar(a),t.opacity=i,t.map?Ug(t.map,e):t.color.set(r)},bs=new Tt,Lh=new Tu,Xg=new Qe,Yi=new F,Ph=new Xt;class qg extends on{constructor(e,t,n={}){super(),tn(this,"enabled",!0),tn(this,"camera"),tn(this,"renderer"),tn(this,"options"),tn(this,"target",new F),tn(this,"animated",!0),tn(this,"speed",1),tn(this,"animating",!1),tn(this,"_options"),tn(this,"_intersections"),tn(this,"_background",null),tn(this,"_viewport",[0,0,0,0]),tn(this,"_originalViewport",[0,0,0,0]),tn(this,"_originalScissor",[0,0,0,0]),tn(this,"_scene"),tn(this,"_camera"),tn(this,"_container"),tn(this,"_domElement"),tn(this,"_domRect"),tn(this,"_dragging",!1),tn(this,"_distance",0),tn(this,"_clock",new Up),tn(this,"_targetQuaternion",new zn),tn(this,"_quaternionStart",new zn),tn(this,"_quaternionEnd",new zn),tn(this,"_pointerStart",new Qe),tn(this,"_focus",null),tn(this,"_placement"),tn(this,"_controls"),tn(this,"_controlsListeners"),this.camera=e,this.renderer=t,this._scene=new Pl().add(this),this.set(n)}get placement(){return this._placement}set placement(e){this._placement=Uu(this._domElement,e),this.domUpdate()}set(e={}){this.dispose(),this.options=e,this._options=Pg(e),this._camera=this._options.isSphere?new Ta(-1.8,1.8,1.8,-1.8,5,10):new bn(26,1,5,10),this._camera.position.set(0,0,7);const[t,n,i]=Wg(this._options);n&&this.add(n),i&&this.add(i),this.add(...t),this._background=n,this._intersections=t;const{container:r,animated:a,speed:o}=this._options;return this.animated=a,this.speed=o,this._container=r?Eg(r):document.body,this._domElement=Sg(this._options),this._domElement.onpointerdown=l=>this._onPointerDown(l),this._domElement.onpointermove=l=>this._onPointerMove(l),this._domElement.onpointerleave=()=>this._onPointerLeave(),this._container.appendChild(this._domElement),this._controls&&this.attachControls(this._controls),this.update(),this._updateOrientation(!0),this}render(){this.animating&&this._animate();const{renderer:e,_viewport:t}=this,n=e.getScissorTest(),i=e.autoClear;return e.autoClear=!1,e.setViewport(...t),n&&e.setScissor(...t),e.clear(!1,!0,!1),e.render(this._scene,this._camera),e.setViewport(...this._originalViewport),n&&e.setScissor(...this._originalScissor),e.autoClear=i,this}domUpdate(){this._domRect=this._domElement.getBoundingClientRect();const e=this.renderer,t=this._domRect,n=e.domElement.getBoundingClientRect();return this._viewport.splice(0,4,t.left-n.left,e.domElement.clientHeight-(t.top-n.top+t.height),t.width,t.height),e.getViewport(Ph).toArray(this._originalViewport),e.getScissorTest()&&e.getScissor(Ph).toArray(this._originalScissor),this}cameraUpdate(){return this._updateOrientation(),this}update(e=!0){return e&&this._controls&&this._controls.update(),this.domUpdate().cameraUpdate()}attachControls(e){return this.detachControls(),this.target=e.target,this._controlsListeners={start:()=>e.enabled=!1,end:()=>e.enabled=!0,change:()=>this.update(!1)},this.addEventListener("start",this._controlsListeners.start),this.addEventListener("end",this._controlsListeners.end),e.addEventListener("change",this._controlsListeners.change),this._controls=e,this}detachControls(){if(!(!this._controlsListeners||!this._controls))return this.target=new F().copy(this._controls.target),this.removeEventListener("start",this._controlsListeners.start),this.removeEventListener("end",this._controlsListeners.end),this._controls.removeEventListener("change",this._controlsListeners.change),this._controlsListeners=void 0,this._controls=void 0,this}dispose(){var e;this.detachControls(),this.children.forEach(t=>{var n,i,r,a;this.remove(t);const o=t;(n=o.material)==null||n.dispose(),(r=(i=o.material)==null?void 0:i.map)==null||r.dispose(),(a=o.geometry)==null||a.dispose()}),(e=this._domElement)==null||e.remove()}_updateOrientation(e=!0){e&&(this.quaternion.copy(this.camera.quaternion).invert(),this.updateMatrixWorld()),xh(this._options,this._intersections,this.camera)}_animate(){const{position:e,quaternion:t}=this.camera;if(e.set(0,0,1),!this.animated){e.applyQuaternion(this._quaternionEnd).multiplyScalar(this._distance).add(this.target),t.copy(this._targetQuaternion),this._updateOrientation(),this.animating=!1,this.dispatchEvent({type:"change"}),this.dispatchEvent({type:"end"});return}this._controls&&(this._controls.enabled=!1);const n=this._clock.getDelta()*Tg*this.speed;this._quaternionStart.rotateTowards(this._quaternionEnd,n),e.applyQuaternion(this._quaternionStart).multiplyScalar(this._distance).add(this.target),t.rotateTowards(this._targetQuaternion,n),this._updateOrientation(),requestAnimationFrame(()=>this.dispatchEvent({type:"change"})),this._quaternionStart.angleTo(this._quaternionEnd)<go&&(this._controls&&(this._controls.enabled=!0),this.animating=!1,this.dispatchEvent({type:"end"}))}_setOrientation(e){const t=this.camera,n=this.target;Yi.copy(e).multiplyScalar(this._distance),bs.setPosition(Yi).lookAt(Yi,this.position,this.up),this._targetQuaternion.setFromRotationMatrix(bs),Yi.add(n),bs.lookAt(Yi,n,this.up),this._quaternionEnd.setFromRotationMatrix(bs),bs.setPosition(t.position).lookAt(t.position,n,this.up),this._quaternionStart.setFromRotationMatrix(bs),this.animating=!0,this._clock.start(),this.dispatchEvent({type:"start"})}_onPointerDown(e){if(!this.enabled)return;const t=l=>{if(!this._dragging){if(wg(l,this._pointerStart))return;this._dragging=!0}const c=Xg.set(l.clientX,l.clientY).sub(this._pointerStart).multiplyScalar(1/this._domRect.width*Math.PI),h=this.coordinateConversion(Yi.subVectors(this.camera.position,this.target)),f=Lh.setFromVector3(h);f.theta=a-c.x,f.phi=fl(o-c.y,go,Math.PI-go),this.coordinateConversion(this.camera.position.setFromSpherical(f),!0).add(this.target),this.camera.lookAt(this.target),this.quaternion.copy(this.camera.quaternion).invert(),this._updateOrientation(!1),this.dispatchEvent({type:"change"})},n=()=>{if(document.removeEventListener("pointermove",t,!1),document.removeEventListener("pointerup",n,!1),!this._dragging)return this._handleClick(e);this._focus&&(Js(this._focus,!1),this._focus=null),this._dragging=!1,this.dispatchEvent({type:"end"})};if(this.animating)return;e.preventDefault(),this._pointerStart.set(e.clientX,e.clientY);const i=this.coordinateConversion(Yi.subVectors(this.camera.position,this.target)),r=Lh.setFromVector3(i),a=r.theta,o=r.phi;this._distance=r.radius,document.addEventListener("pointermove",t,!1),document.addEventListener("pointerup",n,!1),this.dispatchEvent({type:"start"})}coordinateConversion(e,t=!1){const{x:n,y:i,z:r}=e,a=on.DEFAULT_UP;return a.x===1?t?e.set(i,r,n):e.set(r,n,i):a.z===1?t?e.set(r,n,i):e.set(i,r,n):e}_onPointerMove(e){!this.enabled||this._dragging||(this._background&&Sh(this._background,!0),this._handleHover(e))}_onPointerLeave(){!this.enabled||this._dragging||(this._background&&Sh(this._background,!1),this._focus&&Js(this._focus,!1),this._domElement.style.cursor="")}_handleClick(e){const t=bh(e,this._domRect,this._camera,this._intersections);this._focus&&(Js(this._focus,!1),this._focus=null),t&&(this._setOrientation(t.object.position),this.dispatchEvent({type:"change"}))}_handleHover(e){const t=bh(e,this._domRect,this._camera,this._intersections),n=(t==null?void 0:t.object)||null;this._focus!==n&&(this._domElement.style.cursor=n?"pointer":"",this._focus&&Js(this._focus,!1),(this._focus=n)?Js(n,!0):xh(this._options,this._intersections,this.camera))}}const jg=/^[og]\s*(.+)?/,Yg=/^mtllib /,$g=/^usemtl /,Jg=/^usemap /,Dh=/\s+/,Uh=new F,yo=new F,Nh=new F,Ih=new F,Hn=new F,$r=new xt;function Kg(){const s={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(e,t){if(this.object&&this.object.fromDeclaration===!1){this.object.name=e,this.object.fromDeclaration=t!==!1;return}const n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:e||"",fromDeclaration:t!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(i,r){const a=this._finalize(!1);a&&(a.inherited||a.groupCount<=0)&&this.materials.splice(a.index,1);const o={index:this.materials.length,name:i||"",mtllib:Array.isArray(r)&&r.length>0?r[r.length-1]:"",smooth:a!==void 0?a.smooth:this.smooth,groupStart:a!==void 0?a.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(l){const c={index:typeof l=="number"?l:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(o),o},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(i){const r=this.currentMaterial();if(r&&r.groupEnd===-1&&(r.groupEnd=this.geometry.vertices.length/3,r.groupCount=r.groupEnd-r.groupStart,r.inherited=!1),i&&this.materials.length>1)for(let a=this.materials.length-1;a>=0;a--)this.materials[a].groupCount<=0&&this.materials.splice(a,1);return i&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),r}},n&&n.name&&typeof n.clone=="function"){const i=n.clone(0);i.inherited=!0,this.object.materials.push(i)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseNormalIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/3)*3},parseUVIndex:function(e,t){const n=parseInt(e,10);return(n>=0?n-1:n+t/2)*2},addVertex:function(e,t,n){const i=this.vertices,r=this.object.geometry.vertices;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addVertexPoint:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addVertexLine:function(e){const t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])},addNormal:function(e,t,n){const i=this.normals,r=this.object.geometry.normals;r.push(i[e+0],i[e+1],i[e+2]),r.push(i[t+0],i[t+1],i[t+2]),r.push(i[n+0],i[n+1],i[n+2])},addFaceNormal:function(e,t,n){const i=this.vertices,r=this.object.geometry.normals;Uh.fromArray(i,e),yo.fromArray(i,t),Nh.fromArray(i,n),Hn.subVectors(Nh,yo),Ih.subVectors(Uh,yo),Hn.cross(Ih),Hn.normalize(),r.push(Hn.x,Hn.y,Hn.z),r.push(Hn.x,Hn.y,Hn.z),r.push(Hn.x,Hn.y,Hn.z)},addColor:function(e,t,n){const i=this.colors,r=this.object.geometry.colors;i[e]!==void 0&&r.push(i[e+0],i[e+1],i[e+2]),i[t]!==void 0&&r.push(i[t+0],i[t+1],i[t+2]),i[n]!==void 0&&r.push(i[n+0],i[n+1],i[n+2])},addUV:function(e,t,n){const i=this.uvs,r=this.object.geometry.uvs;r.push(i[e+0],i[e+1]),r.push(i[t+0],i[t+1]),r.push(i[n+0],i[n+1])},addDefaultUV:function(){const e=this.object.geometry.uvs;e.push(0,0),e.push(0,0),e.push(0,0)},addUVLine:function(e){const t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])},addFace:function(e,t,n,i,r,a,o,l,c){const h=this.vertices.length;let f=this.parseVertexIndex(e,h),u=this.parseVertexIndex(t,h),d=this.parseVertexIndex(n,h);if(this.addVertex(f,u,d),this.addColor(f,u,d),o!==void 0&&o!==""){const m=this.normals.length;f=this.parseNormalIndex(o,m),u=this.parseNormalIndex(l,m),d=this.parseNormalIndex(c,m),this.addNormal(f,u,d)}else this.addFaceNormal(f,u,d);if(i!==void 0&&i!==""){const m=this.uvs.length;f=this.parseUVIndex(i,m),u=this.parseUVIndex(r,m),d=this.parseUVIndex(a,m),this.addUV(f,u,d),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(e){this.object.geometry.type="Points";const t=this.vertices.length;for(let n=0,i=e.length;n<i;n++){const r=this.parseVertexIndex(e[n],t);this.addVertexPoint(r),this.addColor(r)}},addLineGeometry:function(e,t){this.object.geometry.type="Line";const n=this.vertices.length,i=this.uvs.length;for(let r=0,a=e.length;r<a;r++)this.addVertexLine(this.parseVertexIndex(e[r],n));for(let r=0,a=t.length;r<a;r++)this.addUVLine(this.parseUVIndex(t[r],i))}};return s.startObject("",!1),s}class ca extends Qn{constructor(e){super(e),this.materials=null}load(e,t,n,i){const r=this,a=new Bs(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}setMaterials(e){return this.materials=e,this}parse(e){const t=new Kg;e.indexOf(`\r
|
|
4198
4198
|
`)!==-1&&(e=e.replace(/\r\n/g,`
|
|
4199
4199
|
`)),e.indexOf(`\\
|
|
4200
4200
|
`)!==-1&&(e=e.replace(/\\\n/g,""));const n=e.split(`
|
|
4201
|
-
`);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const
|
|
4202
|
-
`);let i={};const r=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let
|
|
4203
|
-
`||D==="\r"?(p.trim().toLowerCase().startsWith("data")&&(
|
|
4204
|
-
`);for(let p=0,E=g.length;p<E;p++){if(g[p]==="")continue;const b=g[p].split(" ");if(f.x!==void 0&&(r.push(parseFloat(b[f.x])),r.push(parseFloat(b[f.y])),r.push(parseFloat(b[f.z]))),f.rgb!==void 0){const M=i.fields.findIndex(N=>N==="rgb"),U=i.type[M],R=parseFloat(b[f.rgb]);let P=R;if(U==="F"){const N=new Float32Array(1);N[0]=R,P=new Int32Array(N.buffer)[0]}const D=(P>>16&255)/255,S=(P>>8&255)/255,y=(P>>0&255)/255;h.setRGB(D,S,y,$t),o.push(h.r,h.g,h.b)}f.normal_x!==void 0&&(a.push(parseFloat(b[f.normal_x])),a.push(parseFloat(b[f.normal_y])),a.push(parseFloat(b[f.normal_z]))),f.intensity!==void 0&&l.push(parseFloat(b[f.intensity])),f.label!==void 0&&c.push(parseInt(b[f.label]))}}if(i.data==="binary_compressed"){const f=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),m=f[0],_=f[1],g=t(new Uint8Array(e,i.headerLen+8,m),_),p=new DataView(g.buffer),E=i.offset;for(let b=0;b<i.points;b++){if(E.x!==void 0){const M=i.fields.indexOf("x"),U=i.fields.indexOf("y"),R=i.fields.indexOf("z");r.push(this._getDataView(p,i.points*E.x+i.size[M]*b,i.type[M],i.size[M])),r.push(this._getDataView(p,i.points*E.y+i.size[U]*b,i.type[U],i.size[U])),r.push(this._getDataView(p,i.points*E.z+i.size[R]*b,i.type[R],i.size[R]))}if(E.rgb!==void 0){const M=i.fields.indexOf("rgb"),U=p.getUint8(i.points*E.rgb+i.size[M]*b+2)/255,R=p.getUint8(i.points*E.rgb+i.size[M]*b+1)/255,P=p.getUint8(i.points*E.rgb+i.size[M]*b+0)/255;h.setRGB(U,R,P,$t),o.push(h.r,h.g,h.b)}if(E.normal_x!==void 0){const M=i.fields.indexOf("normal_x"),U=i.fields.indexOf("normal_y"),R=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*E.normal_x+i.size[M]*b,i.type[M],i.size[M])),a.push(this._getDataView(p,i.points*E.normal_y+i.size[U]*b,i.type[U],i.size[U])),a.push(this._getDataView(p,i.points*E.normal_z+i.size[R]*b,i.type[R],i.size[R]))}if(E.intensity!==void 0){const M=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*E.intensity+i.size[M]*b,i.type[M],i.size[M]))}if(E.label!==void 0){const M=i.fields.indexOf("label");c.push(p.getInt32(i.points*E.label+i.size[M]*b,this.littleEndian))}}}if(i.data==="binary"){const f=new DataView(e,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),E=i.fields.indexOf("y"),b=i.fields.indexOf("z");r.push(this._getDataView(f,g+m.x,i.type[p],i.size[p])),r.push(this._getDataView(f,g+m.y,i.type[E],i.size[E])),r.push(this._getDataView(f,g+m.z,i.type[b],i.size[b]))}if(m.rgb!==void 0){const p=f.getUint8(g+m.rgb+2)/255,E=f.getUint8(g+m.rgb+1)/255,b=f.getUint8(g+m.rgb+0)/255;h.setRGB(p,E,b,$t),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),E=i.fields.indexOf("normal_y"),b=i.fields.indexOf("normal_z");a.push(this._getDataView(f,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(f,g+m.normal_y,i.type[E],i.size[E])),a.push(this._getDataView(f,g+m.normal_z,i.type[b],i.size[b]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(f,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(f.getInt32(g+m.label,this.littleEndian))}}const d=new ln;r.length>0&&d.setAttribute("position",new Dt(r,3)),a.length>0&&d.setAttribute("normal",new Dt(a,3)),o.length>0&&d.setAttribute("color",new Dt(o,3)),l.length>0&&d.setAttribute("intensity",new Dt(l,1)),c.length>0&&d.setAttribute("label",new Uf(c,1)),d.computeBoundingSphere();const u=new Ii({size:.005});return o.length>0&&(u.vertexColors=!0),new Cs(d,u)}}class Fh extends Ep{constructor(e){super(e)}parse(e){function t(H){switch(H.image_type){case u:case _:if(H.colormap_length>256||H.colormap_size!==24||H.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case f:case m:case g:case p:if(H.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case d:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+H.image_type)}if(H.width<=0||H.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(H.pixel_size!==8&&H.pixel_size!==16&&H.pixel_size!==24&&H.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+H.pixel_size)}function n(H,se,Z,pe,be){let Ce,Ie;const He=Z.pixel_size>>3,K=Z.width*Z.height*He;if(se&&(Ie=be.subarray(pe,pe+=Z.colormap_length*(Z.colormap_size>>3))),H){Ce=new Uint8Array(K);let re,ae,le,Le=0;const ge=new Uint8Array(He);for(;Le<K;)if(re=be[pe++],ae=(re&127)+1,re&128){for(le=0;le<He;++le)ge[le]=be[pe++];for(le=0;le<ae;++le)Ce.set(ge,Le+le*He);Le+=He*ae}else{for(ae*=He,le=0;le<ae;++le)Ce[Le+le]=be[pe++];Le+=ae}}else Ce=be.subarray(pe,pe+=se?Z.width*Z.height:K);return{pixel_data:Ce,palettes:Ie}}function i(H,se,Z,pe,be,Ce,Ie,He,K){const re=K;let ae,le=0,Le,ge;const Ae=y.width;for(ge=se;ge!==pe;ge+=Z)for(Le=be;Le!==Ie;Le+=Ce,le++)ae=He[le],H[(Le+Ae*ge)*4+3]=255,H[(Le+Ae*ge)*4+2]=re[ae*3+0],H[(Le+Ae*ge)*4+1]=re[ae*3+1],H[(Le+Ae*ge)*4+0]=re[ae*3+2];return H}function r(H,se,Z,pe,be,Ce,Ie,He){let K,re=0,ae,le;const Le=y.width;for(le=se;le!==pe;le+=Z)for(ae=be;ae!==Ie;ae+=Ce,re+=2)K=He[re+0]+(He[re+1]<<8),H[(ae+Le*le)*4+0]=(K&31744)>>7,H[(ae+Le*le)*4+1]=(K&992)>>2,H[(ae+Le*le)*4+2]=(K&31)<<3,H[(ae+Le*le)*4+3]=K&32768?0:255;return H}function a(H,se,Z,pe,be,Ce,Ie,He){let K=0,re,ae;const le=y.width;for(ae=se;ae!==pe;ae+=Z)for(re=be;re!==Ie;re+=Ce,K+=3)H[(re+le*ae)*4+3]=255,H[(re+le*ae)*4+2]=He[K+0],H[(re+le*ae)*4+1]=He[K+1],H[(re+le*ae)*4+0]=He[K+2];return H}function o(H,se,Z,pe,be,Ce,Ie,He){let K=0,re,ae;const le=y.width;for(ae=se;ae!==pe;ae+=Z)for(re=be;re!==Ie;re+=Ce,K+=4)H[(re+le*ae)*4+2]=He[K+0],H[(re+le*ae)*4+1]=He[K+1],H[(re+le*ae)*4+0]=He[K+2],H[(re+le*ae)*4+3]=He[K+3];return H}function l(H,se,Z,pe,be,Ce,Ie,He){let K,re=0,ae,le;const Le=y.width;for(le=se;le!==pe;le+=Z)for(ae=be;ae!==Ie;ae+=Ce,re++)K=He[re],H[(ae+Le*le)*4+0]=K,H[(ae+Le*le)*4+1]=K,H[(ae+Le*le)*4+2]=K,H[(ae+Le*le)*4+3]=255;return H}function c(H,se,Z,pe,be,Ce,Ie,He){let K=0,re,ae;const le=y.width;for(ae=se;ae!==pe;ae+=Z)for(re=be;re!==Ie;re+=Ce,K+=2)H[(re+le*ae)*4+0]=He[K+0],H[(re+le*ae)*4+1]=He[K+0],H[(re+le*ae)*4+2]=He[K+0],H[(re+le*ae)*4+3]=He[K+1];return H}function h(H,se,Z,pe,be){let Ce,Ie,He,K,re,ae;switch((y.flags&E)>>b){default:case R:Ce=0,He=1,re=se,Ie=0,K=1,ae=Z;break;case M:Ce=0,He=1,re=se,Ie=Z-1,K=-1,ae=-1;break;case P:Ce=se-1,He=-1,re=-1,Ie=0,K=1,ae=Z;break;case U:Ce=se-1,He=-1,re=-1,Ie=Z-1,K=-1,ae=-1;break}if(X)switch(y.pixel_size){case 8:l(H,Ie,K,ae,Ce,He,re,pe);break;case 16:c(H,Ie,K,ae,Ce,He,re,pe);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(y.pixel_size){case 8:i(H,Ie,K,ae,Ce,He,re,pe,be);break;case 16:r(H,Ie,K,ae,Ce,He,re,pe);break;case 24:a(H,Ie,K,ae,Ce,He,re,pe);break;case 32:o(H,Ie,K,ae,Ce,He,re,pe);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return H}const d=0,u=1,f=2,m=3,_=9,g=10,p=11,E=48,b=4,M=0,U=1,R=2,P=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let D=0;const S=new Uint8Array(e),y={id_length:S[D++],colormap_type:S[D++],image_type:S[D++],colormap_index:S[D++]|S[D++]<<8,colormap_length:S[D++]|S[D++]<<8,colormap_size:S[D++],origin:[S[D++]|S[D++]<<8,S[D++]|S[D++]<<8],width:S[D++]|S[D++]<<8,height:S[D++]|S[D++]<<8,pixel_size:S[D++],flags:S[D++]};if(t(y),y.id_length+D>e.length)throw new Error("THREE.TGALoader: No data.");D+=y.id_length;let N=!1,W=!1,X=!1;switch(y.image_type){case _:N=!0,W=!0;break;case u:W=!0;break;case g:N=!0;break;case f:break;case p:N=!0,X=!0;break;case m:X=!0;break}const Q=new Uint8Array(y.width*y.height*4),ne=n(N,W,y,D,S);return h(Q,y.width,y.height,ne.pixel_data,ne.palettes),{data:Q,width:y.width,height:y.height,flipY:!0,generateMipmaps:!0,minFilter:xi}}}class Zg extends Qn{load(e,t,n,i){const r=this,a=r.path===""?Vl.extractUrlBase(e):r.path,o=new Bs(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(l){try{t(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(e)}},n,i)}parse(e,t){function n(x,v){const C=[],T=x.childNodes;for(let L=0,ie=T.length;L<ie;L++){const he=T[L];he.nodeName===v&&C.push(he)}return C}function i(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),C=new Array(v.length);for(let T=0,L=v.length;T<L;T++)C[T]=v[T];return C}function r(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),C=new Array(v.length);for(let T=0,L=v.length;T<L;T++)C[T]=parseFloat(v[T]);return C}function a(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),C=new Array(v.length);for(let T=0,L=v.length;T<L;T++)C[T]=parseInt(v[T]);return C}function o(x){return x.substring(1)}function l(){return"three_default_"+kn++}function c(x){return Object.keys(x).length===0}function h(x){return{unit:d(n(x,"unit")[0]),upAxis:u(n(x,"up_axis")[0])}}function d(x){return x!==void 0&&x.hasAttribute("meter")===!0?parseFloat(x.getAttribute("meter")):1}function u(x){return x!==void 0?x.textContent:"Y_UP"}function f(x,v,C,T){const L=n(x,v)[0];if(L!==void 0){const ie=n(L,C);for(let he=0;he<ie.length;he++)T(ie[he])}}function m(x,v){for(const C in x){const T=x[C];T.build=v(x[C])}}function _(x,v){return x.build!==void 0||(x.build=v(x)),x.build}function g(x){const v={sources:{},samplers:{},channels:{}};let C=!1;for(let T=0,L=x.childNodes.length;T<L;T++){const ie=x.childNodes[T];if(ie.nodeType!==1)continue;let he;switch(ie.nodeName){case"source":he=ie.getAttribute("id"),v.sources[he]=ye(ie);break;case"sampler":he=ie.getAttribute("id"),v.samplers[he]=p(ie);break;case"channel":he=ie.getAttribute("target"),v.channels[he]=E(ie);break;case"animation":g(ie),C=!0;break;default:console.log(ie)}}C===!1&&(xt.animations[x.getAttribute("id")||Ki.generateUUID()]=v)}function p(x){const v={inputs:{}};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"input":const ie=o(L.getAttribute("source")),he=L.getAttribute("semantic");v.inputs[he]=ie;break}}return v}function E(x){const v={};let T=x.getAttribute("target").split("/");const L=T.shift();let ie=T.shift();const he=ie.indexOf("(")!==-1,tt=ie.indexOf(".")!==-1;if(tt)T=ie.split("."),ie=T.shift(),v.member=T.shift();else if(he){const Be=ie.split("(");ie=Be.shift();for(let $e=0;$e<Be.length;$e++)Be[$e]=parseInt(Be[$e].replace(/\)/,""));v.indices=Be}return v.id=L,v.sid=ie,v.arraySyntax=he,v.memberSyntax=tt,v.sampler=o(x.getAttribute("source")),v}function b(x){const v=[],C=x.channels,T=x.samplers,L=x.sources;for(const ie in C)if(C.hasOwnProperty(ie)){const he=C[ie],tt=T[he.sampler],Be=tt.inputs.INPUT,$e=tt.inputs.OUTPUT,ut=L[Be],Ee=L[$e],ht=U(he,ut,Ee);y(ht,v)}return v}function M(x){return _(xt.animations[x],b)}function U(x,v,C){const T=xt.nodes[x.id],L=St(T.id),ie=T.transforms[x.sid],he=T.matrix.clone().transpose();let tt,Be,$e,ut,Ee,ht;const ot={};switch(ie){case"matrix":for($e=0,ut=v.array.length;$e<ut;$e++)if(tt=v.array[$e],Be=$e*C.stride,ot[tt]===void 0&&(ot[tt]={}),x.arraySyntax===!0){const hn=C.array[Be],en=x.indices[0]+4*x.indices[1];ot[tt][en]=hn}else for(Ee=0,ht=C.stride;Ee<ht;Ee++)ot[tt][Ee]=C.array[Be+Ee];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ie);break}const yt=R(ot,he);return{name:L.uuid,keyframes:yt}}function R(x,v){const C=[];for(const L in x)C.push({time:parseFloat(L),value:x[L]});C.sort(T);for(let L=0;L<16;L++)N(C,L,v.elements[L]);return C;function T(L,ie){return L.time-ie.time}}const P=new F,D=new F,S=new zn;function y(x,v){const C=x.keyframes,T=x.name,L=[],ie=[],he=[],tt=[];for(let Be=0,$e=C.length;Be<$e;Be++){const ut=C[Be],Ee=ut.time,ht=ut.value;k.fromArray(ht).transpose(),k.decompose(P,S,D),L.push(Ee),ie.push(P.x,P.y,P.z),he.push(S.x,S.y,S.z,S.w),tt.push(D.x,D.y,D.z)}return ie.length>0&&v.push(new Is(T+".position",L,ie)),he.length>0&&v.push(new ur(T+".quaternion",L,he)),tt.length>0&&v.push(new Is(T+".scale",L,tt)),v}function N(x,v,C){let T,L=!0,ie,he;for(ie=0,he=x.length;ie<he;ie++)T=x[ie],T.value[v]===void 0?T.value[v]=null:L=!1;if(L===!0)for(ie=0,he=x.length;ie<he;ie++)T=x[ie],T.value[v]=C;else W(x,v)}function W(x,v){let C,T;for(let L=0,ie=x.length;L<ie;L++){const he=x[L];if(he.value[v]===null){if(C=X(x,L,v),T=Q(x,L,v),C===null){he.value[v]=T.value[v];continue}if(T===null){he.value[v]=C.value[v];continue}ne(he,C,T,v)}}}function X(x,v,C){for(;v>=0;){const T=x[v];if(T.value[C]!==null)return T;v--}return null}function Q(x,v,C){for(;v<x.length;){const T=x[v];if(T.value[C]!==null)return T;v++}return null}function ne(x,v,C,T){if(C.time-v.time===0){x.value[T]=v.value[T];return}x.value[T]=(x.time-v.time)*(C.value[T]-v.value[T])/(C.time-v.time)+v.value[T]}function H(x){const v={name:x.getAttribute("id")||"default",start:parseFloat(x.getAttribute("start")||0),end:parseFloat(x.getAttribute("end")||0),animations:[]};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"instance_animation":v.animations.push(o(L.getAttribute("url")));break}}xt.clips[x.getAttribute("id")]=v}function se(x){const v=[],C=x.name,T=x.end-x.start||-1,L=x.animations;for(let ie=0,he=L.length;ie<he;ie++){const tt=M(L[ie]);for(let Be=0,$e=tt.length;Be<$e;Be++)v.push(tt[Be])}return new Bc(C,T,v)}function Z(x){return _(xt.clips[x],se)}function pe(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"skin":v.id=o(L.getAttribute("source")),v.skin=be(L);break;case"morph":v.id=o(L.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}xt.controllers[x.getAttribute("id")]=v}function be(x){const v={sources:{}};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"bind_shape_matrix":v.bindShapeMatrix=r(L.textContent);break;case"source":const ie=L.getAttribute("id");v.sources[ie]=ye(L);break;case"joints":v.joints=Ce(L);break;case"vertex_weights":v.vertexWeights=Ie(L);break}}return v}function Ce(x){const v={inputs:{}};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"input":const ie=L.getAttribute("semantic"),he=o(L.getAttribute("source"));v.inputs[ie]=he;break}}return v}function Ie(x){const v={inputs:{}};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"input":const ie=L.getAttribute("semantic"),he=o(L.getAttribute("source")),tt=parseInt(L.getAttribute("offset"));v.inputs[ie]={id:he,offset:tt};break;case"vcount":v.vcount=a(L.textContent);break;case"v":v.v=a(L.textContent);break}}return v}function He(x){const v={id:x.id},C=xt.geometries[v.id];return x.skin!==void 0&&(v.skin=K(x.skin),C.sources.skinIndices=v.skin.indices,C.sources.skinWeights=v.skin.weights),v}function K(x){const C={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},T=x.sources,L=x.vertexWeights,ie=L.vcount,he=L.v,tt=L.inputs.JOINT.offset,Be=L.inputs.WEIGHT.offset,$e=x.sources[x.joints.inputs.JOINT],ut=x.sources[x.joints.inputs.INV_BIND_MATRIX],Ee=T[L.inputs.WEIGHT.id].array;let ht=0,ot,yt,pt;for(ot=0,pt=ie.length;ot<pt;ot++){const en=ie[ot],jt=[];for(yt=0;yt<en;yt++){const Yt=he[ht+tt],ui=he[ht+Be],Pn=Ee[ui];jt.push({index:Yt,weight:Pn}),ht+=2}for(jt.sort(hn),yt=0;yt<4;yt++){const Yt=jt[yt];Yt!==void 0?(C.indices.array.push(Yt.index),C.weights.array.push(Yt.weight)):(C.indices.array.push(0),C.weights.array.push(0))}}for(x.bindShapeMatrix?C.bindMatrix=new bt().fromArray(x.bindShapeMatrix).transpose():C.bindMatrix=new bt().identity(),ot=0,pt=$e.array.length;ot<pt;ot++){const en=$e.array[ot],jt=new bt().fromArray(ut.array,ot*ut.stride).transpose();C.joints.push({name:en,boneInverse:jt})}return C;function hn(en,jt){return jt.weight-en.weight}}function re(x){return _(xt.controllers[x],He)}function ae(x){const v={init_from:n(x,"init_from")[0].textContent};xt.images[x.getAttribute("id")]=v}function le(x){return x.build!==void 0?x.build:x.init_from}function Le(x){const v=xt.images[x];return v!==void 0?_(v,le):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",x),null)}function ge(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"profile_COMMON":v.profile=Ae(L);break}}xt.effects[x.getAttribute("id")]=v}function Ae(x){const v={surfaces:{},samplers:{}};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"newparam":lt(L,v);break;case"technique":v.technique=z(L);break;case"extra":v.extra=Xe(L);break}}return v}function lt(x,v){const C=x.getAttribute("sid");for(let T=0,L=x.childNodes.length;T<L;T++){const ie=x.childNodes[T];if(ie.nodeType===1)switch(ie.nodeName){case"surface":v.surfaces[C]=Et(ie);break;case"sampler2D":v.samplers[C]=Mt(ie);break}}}function Et(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"init_from":v.init_from=L.textContent;break}}return v}function Mt(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"source":v.source=L.textContent;break}}return v}function z(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"constant":case"lambert":case"blinn":case"phong":v.type=L.nodeName,v.parameters=Wt(L);break;case"extra":v.extra=Xe(L);break}}return v}function Wt(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":v[L.nodeName]=Rt(L);break;case"transparent":v[L.nodeName]={opaque:L.hasAttribute("opaque")?L.getAttribute("opaque"):"A_ONE",data:Rt(L)};break}}return v}function Rt(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"color":v[L.nodeName]=r(L.textContent);break;case"float":v[L.nodeName]=parseFloat(L.textContent);break;case"texture":v[L.nodeName]={id:L.getAttribute("texture"),extra:At(L)};break}}return v}function At(x){const v={technique:{}};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"extra":Ge(L,v);break}}return v}function Ge(x,v){for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"technique":mt(L,v);break}}}function mt(x,v){for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":v.technique[L.nodeName]=parseFloat(L.textContent);break;case"wrapU":case"wrapV":L.textContent.toUpperCase()==="TRUE"?v.technique[L.nodeName]=1:L.textContent.toUpperCase()==="FALSE"?v.technique[L.nodeName]=0:v.technique[L.nodeName]=parseInt(L.textContent);break;case"bump":v[L.nodeName]=on(L);break}}}function Xe(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"technique":v.technique=gt(L);break}}return v}function gt(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"double_sided":v[L.nodeName]=parseInt(L.textContent);break;case"bump":v[L.nodeName]=on(L);break}}return v}function on(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"texture":v[L.nodeName]={id:L.getAttribute("texture"),texcoord:L.getAttribute("texcoord"),extra:At(L)};break}}return v}function O(x){return x}function w(x){return _(xt.effects[x],O)}function ee(x){const v={name:x.getAttribute("name")};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"instance_effect":v.url=o(L.getAttribute("url"));break}}xt.materials[x.getAttribute("id")]=v}function de(x){let v,C=x.slice((x.lastIndexOf(".")-1>>>0)+2);switch(C=C.toLowerCase(),C){case"tga":v=sn;break;default:v=Kt}return v}function me(x){const v=w(x.url),C=v.profile.technique;let T;switch(C.type){case"phong":case"blinn":T=new Dn;break;case"lambert":T=new up;break;default:T=new zi;break}T.name=x.name||"";function L(Be,$e=null){const ut=v.profile.samplers[Be.id];let Ee=null;if(ut!==void 0){const ht=v.profile.surfaces[ut.source];Ee=Le(ht.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Ee=Le(Be.id);if(Ee!==null){const ht=de(Ee);if(ht!==void 0){const ot=ht.load(Ee),yt=Be.extra;if(yt!==void 0&&yt.technique!==void 0&&c(yt.technique)===!1){const pt=yt.technique;ot.wrapS=pt.wrapU?ai:Jn,ot.wrapT=pt.wrapV?ai:Jn,ot.offset.set(pt.offsetU||0,pt.offsetV||0),ot.repeat.set(pt.repeatU||1,pt.repeatV||1)}else ot.wrapS=ai,ot.wrapT=ai;return $e!==null&&(ot.colorSpace=$e),ot}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Ee),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Be.id),null}const ie=C.parameters;for(const Be in ie){const $e=ie[Be];switch(Be){case"diffuse":$e.color&&T.color.fromArray($e.color),$e.texture&&(T.map=L($e.texture,$t));break;case"specular":$e.color&&T.specular&&T.specular.fromArray($e.color),$e.texture&&(T.specularMap=L($e.texture));break;case"bump":$e.texture&&(T.normalMap=L($e.texture));break;case"ambient":$e.texture&&(T.lightMap=L($e.texture,$t));break;case"shininess":$e.float&&T.shininess&&(T.shininess=$e.float);break;case"emission":$e.color&&T.emissive&&T.emissive.fromArray($e.color),$e.texture&&(T.emissiveMap=L($e.texture,$t));break}}kt.colorSpaceToWorking(T.color,$t),T.specular&&kt.colorSpaceToWorking(T.specular,$t),T.emissive&&kt.colorSpaceToWorking(T.emissive,$t);let he=ie.transparent,tt=ie.transparency;if(tt===void 0&&he&&(tt={float:1}),he===void 0&&tt&&(he={opaque:"A_ONE",data:{color:[1,1,1,1]}}),he&&tt)if(he.data.texture)T.transparent=!0;else{const Be=he.data.color;switch(he.opaque){case"A_ONE":T.opacity=Be[3]*tt.float;break;case"RGB_ZERO":T.opacity=1-Be[0]*tt.float;break;case"A_ZERO":T.opacity=1-Be[3]*tt.float;break;case"RGB_ONE":T.opacity=Be[0]*tt.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',he.opaque)}T.opacity<1&&(T.transparent=!0)}if(C.extra!==void 0&&C.extra.technique!==void 0){const Be=C.extra.technique;for(const $e in Be){const ut=Be[$e];switch($e){case"double_sided":T.side=ut===1?wn:Xn;break;case"bump":T.normalMap=L(ut.texture),T.normalScale=new Qe(1,1);break}}}return T}function ce(x){return _(xt.materials[x],me)}function ct(x){const v={name:x.getAttribute("name")};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"optics":v.optics=We(L);break}}xt.cameras[x.getAttribute("id")]=v}function We(x){for(let v=0;v<x.childNodes.length;v++){const C=x.childNodes[v];switch(C.nodeName){case"technique_common":return st(C)}}return{}}function st(x){const v={};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];switch(T.nodeName){case"perspective":case"orthographic":v.technique=T.nodeName,v.parameters=rt(T);break}}return v}function rt(x){const v={};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];switch(T.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":v[T.nodeName]=parseFloat(T.textContent);break}}return v}function xe(x){let v;switch(x.optics.technique){case"perspective":v=new Sn(x.optics.parameters.yfov,x.optics.parameters.aspect_ratio,x.optics.parameters.znear,x.optics.parameters.zfar);break;case"orthographic":let C=x.optics.parameters.ymag,T=x.optics.parameters.xmag;const L=x.optics.parameters.aspect_ratio;T=T===void 0?C*L:T,C=C===void 0?T/L:C,T*=.5,C*=.5,v=new Ta(-T,T,C,-C,x.optics.parameters.znear,x.optics.parameters.zfar);break;default:v=new Sn;break}return v.name=x.name||"",v}function Ze(x){const v=xt.cameras[x];return v!==void 0?_(v,xe):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",x),null)}function ft(x){let v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"technique_common":v=_t(L);break}}xt.lights[x.getAttribute("id")]=v}function _t(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"directional":case"point":case"spot":case"ambient":v.technique=L.nodeName,v.parameters=ke(L)}}return v}function ke(x){const v={};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"color":const ie=r(L.textContent);v.color=new vt().fromArray(ie),kt.colorSpaceToWorking(v.color,$t);break;case"falloff_angle":v.falloffAngle=parseFloat(L.textContent);break;case"quadratic_attenuation":const he=parseFloat(L.textContent);v.distance=he?Math.sqrt(1/he):0;break}}return v}function wt(x){let v;switch(x.technique){case"directional":v=new Au;break;case"point":v=new Eu;break;case"spot":v=new Tp;break;case"ambient":v=new wu;break}return x.parameters.color&&v.color.copy(x.parameters.color),x.parameters.distance&&(v.distance=x.parameters.distance),v}function q(x){const v=xt.lights[x];return v!==void 0?_(v,wt):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",x),null)}function qe(x){const v={name:x.getAttribute("name"),sources:{},vertices:{},primitives:[]},C=n(x,"mesh")[0];if(C!==void 0){for(let T=0;T<C.childNodes.length;T++){const L=C.childNodes[T];if(L.nodeType!==1)continue;const ie=L.getAttribute("id");switch(L.nodeName){case"source":v.sources[ie]=ye(L);break;case"vertices":v.vertices=et(L);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",L.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":v.primitives.push(I(L));break;default:console.log(L)}}xt.geometries[x.getAttribute("id")]=v}}function ye(x){const v={array:[],stride:3};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"float_array":v.array=r(T.textContent);break;case"Name_array":v.array=i(T.textContent);break;case"technique_common":const L=n(T,"accessor")[0];L!==void 0&&(v.stride=parseInt(L.getAttribute("stride")));break}}return v}function et(x){const v={};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];T.nodeType===1&&(v[T.getAttribute("semantic")]=o(T.getAttribute("source")))}return v}function I(x){const v={type:x.nodeName,material:x.getAttribute("material"),count:parseInt(x.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let C=0,T=x.childNodes.length;C<T;C++){const L=x.childNodes[C];if(L.nodeType===1)switch(L.nodeName){case"input":const ie=o(L.getAttribute("source")),he=L.getAttribute("semantic"),tt=parseInt(L.getAttribute("offset")),Be=parseInt(L.getAttribute("set")),$e=Be>0?he+Be:he;v.inputs[$e]={id:ie,offset:tt},v.stride=Math.max(v.stride,tt+1),he==="TEXCOORD"&&(v.hasUV=!0);break;case"vcount":v.vcount=a(L.textContent);break;case"p":v.p=a(L.textContent);break}}return v}function B(x){const v={};for(let C=0;C<x.length;C++){const T=x[C];v[T.type]===void 0&&(v[T.type]=[]),v[T.type].push(T)}return v}function $(x){let v=0;for(let C=0,T=x.length;C<T;C++)x[C].hasUV===!0&&v++;v>0&&v<x.length&&(x.uvsNeedsFix=!0)}function oe(x){const v={},C=x.sources,T=x.vertices,L=x.primitives;if(L.length===0)return{};const ie=B(L);for(const he in ie){const tt=ie[he];$(tt),v[he]=ue(tt,C,T)}return v}function ue(x,v,C){const T={},L={array:[],stride:0},ie={array:[],stride:0},he={array:[],stride:0},tt={array:[],stride:0},Be={array:[],stride:0},$e={array:[],stride:4},ut={array:[],stride:4},Ee=new ln,ht=[];let ot=0;for(let yt=0;yt<x.length;yt++){const pt=x[yt],hn=pt.inputs;let en=0;switch(pt.type){case"lines":case"linestrips":en=pt.count*2;break;case"triangles":en=pt.count*3;break;case"polylist":for(let jt=0;jt<pt.count;jt++){const Yt=pt.vcount[jt];switch(Yt){case 3:en+=3;break;case 4:en+=6;break;default:en+=(Yt-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",pt.type)}Ee.addGroup(ot,en,yt),ot+=en,pt.material&&ht.push(pt.material);for(const jt in hn){const Yt=hn[jt];switch(jt){case"VERTEX":for(const ui in C){const Pn=C[ui];switch(ui){case"POSITION":const is=L.array.length;if(te(pt,v[Pn],Yt.offset,L.array),L.stride=v[Pn].stride,v.skinWeights&&v.skinIndices&&(te(pt,v.skinIndices,Yt.offset,$e.array),te(pt,v.skinWeights,Yt.offset,ut.array)),pt.hasUV===!1&&x.uvsNeedsFix===!0){const $u=(L.array.length-is)/L.stride;for(let ql=0;ql<$u;ql++)he.array.push(0,0)}break;case"NORMAL":te(pt,v[Pn],Yt.offset,ie.array),ie.stride=v[Pn].stride;break;case"COLOR":te(pt,v[Pn],Yt.offset,Be.array),Be.stride=v[Pn].stride;break;case"TEXCOORD":te(pt,v[Pn],Yt.offset,he.array),he.stride=v[Pn].stride;break;case"TEXCOORD1":te(pt,v[Pn],Yt.offset,tt.array),he.stride=v[Pn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',ui)}}break;case"NORMAL":te(pt,v[Yt.id],Yt.offset,ie.array),ie.stride=v[Yt.id].stride;break;case"COLOR":te(pt,v[Yt.id],Yt.offset,Be.array,!0),Be.stride=v[Yt.id].stride;break;case"TEXCOORD":te(pt,v[Yt.id],Yt.offset,he.array),he.stride=v[Yt.id].stride;break;case"TEXCOORD1":te(pt,v[Yt.id],Yt.offset,tt.array),tt.stride=v[Yt.id].stride;break}}}return L.array.length>0&&Ee.setAttribute("position",new Dt(L.array,L.stride)),ie.array.length>0&&Ee.setAttribute("normal",new Dt(ie.array,ie.stride)),Be.array.length>0&&Ee.setAttribute("color",new Dt(Be.array,Be.stride)),he.array.length>0&&Ee.setAttribute("uv",new Dt(he.array,he.stride)),tt.array.length>0&&Ee.setAttribute("uv1",new Dt(tt.array,tt.stride)),$e.array.length>0&&Ee.setAttribute("skinIndex",new Dt($e.array,$e.stride)),ut.array.length>0&&Ee.setAttribute("skinWeight",new Dt(ut.array,ut.stride)),T.data=Ee,T.type=x[0].type,T.materialKeys=ht,T}function te(x,v,C,T,L=!1){const ie=x.p,he=x.stride,tt=x.vcount;function Be(Ee){let ht=ie[Ee+C]*ut;const ot=ht+ut;for(;ht<ot;ht++)T.push($e[ht]);if(L){const yt=T.length-ut-1;Zt.setRGB(T[yt+0],T[yt+1],T[yt+2],$t),T[yt+0]=Zt.r,T[yt+1]=Zt.g,T[yt+2]=Zt.b}}const $e=v.array,ut=v.stride;if(x.vcount!==void 0){let Ee=0;for(let ht=0,ot=tt.length;ht<ot;ht++){const yt=tt[ht];if(yt===4){const pt=Ee+he*0,hn=Ee+he*1,en=Ee+he*2,jt=Ee+he*3;Be(pt),Be(hn),Be(jt),Be(hn),Be(en),Be(jt)}else if(yt===3){const pt=Ee+he*0,hn=Ee+he*1,en=Ee+he*2;Be(pt),Be(hn),Be(en)}else if(yt>4)for(let pt=1,hn=yt-2;pt<=hn;pt++){const en=Ee+he*0,jt=Ee+he*pt,Yt=Ee+he*(pt+1);Be(en),Be(jt),Be(Yt)}Ee+=he*yt}}else for(let Ee=0,ht=ie.length;Ee<ht;Ee+=he)Be(Ee)}function we(x){return _(xt.geometries[x],oe)}function _e(x){const v={name:x.getAttribute("name")||"",joints:{},links:[]};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"technique_common":j(T,v);break}}xt.kinematicsModels[x.getAttribute("id")]=v}function Te(x){return x.build!==void 0?x.build:x}function je(x){return _(xt.kinematicsModels[x],Te)}function j(x,v){for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"joint":v.joints[T.getAttribute("sid")]=Fe(T);break;case"link":v.links.push(Pt(T));break}}}function Fe(x){let v;for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"prismatic":case"revolute":v=Tt(T);break}}return v}function Tt(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:x.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"axis":const L=r(T.textContent);v.axis.fromArray(L);break;case"limits":const ie=T.getElementsByTagName("max")[0],he=T.getElementsByTagName("min")[0];v.limits.max=parseFloat(ie.textContent),v.limits.min=parseFloat(he.textContent);break}}return v.limits.min>=v.limits.max&&(v.static=!0),v.middlePosition=(v.limits.min+v.limits.max)/2,v}function Pt(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",attachments:[],transforms:[]};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"attachment_full":v.attachments.push(Xt(T));break;case"matrix":case"translate":case"rotate":v.transforms.push(nn(T));break}}return v}function Xt(x){const v={joint:x.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"link":v.links.push(Pt(T));break;case"matrix":case"translate":case"rotate":v.transforms.push(nn(T));break}}return v}function nn(x){const v={type:x.nodeName},C=r(x.textContent);switch(v.type){case"matrix":v.obj=new bt,v.obj.fromArray(C).transpose();break;case"translate":v.obj=new F,v.obj.fromArray(C);break;case"rotate":v.obj=new F,v.obj.fromArray(C),v.angle=Ki.degToRad(C[3]);break}return v}function dt(x){const v={name:x.getAttribute("name")||"",rigidBodies:{}};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"rigid_body":v.rigidBodies[T.getAttribute("name")]={},Lt(T,v.rigidBodies[T.getAttribute("name")]);break}}xt.physicsModels[x.getAttribute("id")]=v}function Lt(x,v){for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"technique_common":Re(T,v);break}}}function Re(x,v){for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"inertia":v.inertia=r(T.textContent);break;case"mass":v.mass=r(T.textContent)[0];break}}}function qt(x){const v={bindJointAxis:[]};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"bind_joint_axis":v.bindJointAxis.push(Oe(T));break}}xt.kinematicsScenes[o(x.getAttribute("url"))]=v}function Oe(x){const v={target:x.getAttribute("target").split("/").pop()};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType===1)switch(T.nodeName){case"axis":const L=T.getElementsByTagName("param")[0];v.axis=L.textContent;const ie=v.axis.split("inst_").pop().split("axis")[0];v.jointIndex=ie.substring(0,ie.length-1);break}}return v}function Ct(x){return x.build!==void 0?x.build:x}function Pe(x){return _(xt.kinematicsScenes[x],Ct)}function zt(){const x=Object.keys(xt.kinematicsModels)[0],v=Object.keys(xt.kinematicsScenes)[0],C=Object.keys(xt.visualScenes)[0];if(x===void 0||v===void 0)return;const T=je(x),L=Pe(v),ie=Ke(C),he=L.bindJointAxis,tt={};for(let ut=0,Ee=he.length;ut<Ee;ut++){const ht=he[ut],ot=Ne.querySelector('[sid="'+ht.target+'"]');if(ot){const yt=ot.parentElement;Be(ht.jointIndex,yt)}}function Be(ut,Ee){const ht=Ee.getAttribute("name"),ot=T.joints[ut];ie.traverse(function(yt){yt.name===ht&&(tt[ut]={object:yt,transforms:Je(Ee),joint:ot,position:ot.zeroPosition})})}const $e=new bt;hi={joints:T&&T.joints,getJointValue:function(ut){const Ee=tt[ut];if(Ee)return Ee.position;console.warn("THREE.ColladaLoader: Joint "+ut+" doesn't exist.")},setJointValue:function(ut,Ee){const ht=tt[ut];if(ht){const ot=ht.joint;if(Ee>ot.limits.max||Ee<ot.limits.min)console.warn("THREE.ColladaLoader: Joint "+ut+" value "+Ee+" outside of limits (min: "+ot.limits.min+", max: "+ot.limits.max+").");else if(ot.static)console.warn("THREE.ColladaLoader: Joint "+ut+" is static.");else{const yt=ht.object,pt=ot.axis,hn=ht.transforms;k.identity();for(let en=0;en<hn.length;en++){const jt=hn[en];if(jt.sid&&jt.sid.indexOf(ut)!==-1)switch(ot.type){case"revolute":k.multiply($e.makeRotationAxis(pt,Ki.degToRad(Ee)));break;case"prismatic":k.multiply($e.makeTranslation(pt.x*Ee,pt.y*Ee,pt.z*Ee));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+ot.type);break}else switch(jt.type){case"matrix":k.multiply(jt.obj);break;case"translate":k.multiply($e.makeTranslation(jt.obj.x,jt.obj.y,jt.obj.z));break;case"scale":k.scale(jt.obj);break;case"rotate":k.multiply($e.makeRotationAxis(jt.obj,jt.angle));break}}yt.matrix.copy(k),yt.matrix.decompose(yt.position,yt.quaternion,yt.scale),tt[ut].position=Ee}}else console.log("THREE.ColladaLoader: "+ut+" does not exist.")}}}function Je(x){const v=[],C=Ne.querySelector('[id="'+x.id+'"]');for(let T=0;T<C.childNodes.length;T++){const L=C.childNodes[T];if(L.nodeType!==1)continue;let ie,he;switch(L.nodeName){case"matrix":ie=r(L.textContent);const tt=new bt().fromArray(ie).transpose();v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:tt});break;case"translate":case"scale":ie=r(L.textContent),he=new F().fromArray(ie),v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:he});break;case"rotate":ie=r(L.textContent),he=new F().fromArray(ie);const Be=Ki.degToRad(ie[3]);v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:he,angle:Be});break}}return v}function A(x){const v=x.getElementsByTagName("node");for(let C=0;C<v.length;C++){const T=v[C];T.hasAttribute("id")===!1&&T.setAttribute("id",l())}}const k=new bt,Y=new F;function J(x){const v={name:x.getAttribute("name")||"",type:x.getAttribute("type"),id:x.getAttribute("id"),sid:x.getAttribute("sid"),matrix:new bt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];if(T.nodeType!==1)continue;let L;switch(T.nodeName){case"node":v.nodes.push(T.getAttribute("id")),J(T);break;case"instance_camera":v.instanceCameras.push(o(T.getAttribute("url")));break;case"instance_controller":v.instanceControllers.push(G(T));break;case"instance_light":v.instanceLights.push(o(T.getAttribute("url")));break;case"instance_geometry":v.instanceGeometries.push(G(T));break;case"instance_node":v.instanceNodes.push(o(T.getAttribute("url")));break;case"matrix":L=r(T.textContent),v.matrix.multiply(k.fromArray(L).transpose()),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"translate":L=r(T.textContent),Y.fromArray(L),v.matrix.multiply(k.makeTranslation(Y.x,Y.y,Y.z)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"rotate":L=r(T.textContent);const ie=Ki.degToRad(L[3]);v.matrix.multiply(k.makeRotationAxis(Y.fromArray(L),ie)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"scale":L=r(T.textContent),v.matrix.scale(Y.fromArray(L)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"extra":break;default:console.log(T)}}return nt(v.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",v.id):xt.nodes[v.id]=v,v}function G(x){const v={id:o(x.getAttribute("url")),materials:{},skeletons:[]};for(let C=0;C<x.childNodes.length;C++){const T=x.childNodes[C];switch(T.nodeName){case"bind_material":const L=T.getElementsByTagName("instance_material");for(let ie=0;ie<L.length;ie++){const he=L[ie],tt=he.getAttribute("symbol"),Be=he.getAttribute("target");v.materials[tt]=o(Be)}break;case"skeleton":v.skeletons.push(o(T.textContent));break}}return v}function fe(x,v){const C=[],T=[];let L,ie,he;for(L=0;L<x.length;L++){const $e=x[L];let ut;if(nt($e))ut=St($e),Me(ut,v,C);else if(ve($e)){const ht=xt.visualScenes[$e].children;for(let ot=0;ot<ht.length;ot++){const yt=ht[ot];if(yt.type==="JOINT"){const pt=St(yt.id);Me(pt,v,C)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",$e)}for(L=0;L<v.length;L++)for(ie=0;ie<C.length;ie++)if(he=C[ie],he.bone.name===v[L].name){T[L]=he,he.processed=!0;break}for(L=0;L<C.length;L++)he=C[L],he.processed===!1&&(T.push(he),he.processed=!0);const tt=[],Be=[];for(L=0;L<T.length;L++)he=T[L],tt.push(he.bone),Be.push(he.boneInverse);return new Ul(tt,Be)}function Me(x,v,C){x.traverse(function(T){if(T.isBone===!0){let L;for(let ie=0;ie<v.length;ie++){const he=v[ie];if(he.name===T.name){L=he.boneInverse;break}}L===void 0&&(L=new bt),C.push({bone:T,boneInverse:L,processed:!1})}})}function ze(x){const v=[],C=x.matrix,T=x.nodes,L=x.type,ie=x.instanceCameras,he=x.instanceControllers,tt=x.instanceLights,Be=x.instanceGeometries,$e=x.instanceNodes;for(let Ee=0,ht=T.length;Ee<ht;Ee++)v.push(St(T[Ee]));for(let Ee=0,ht=ie.length;Ee<ht;Ee++){const ot=Ze(ie[Ee]);ot!==null&&v.push(ot.clone())}for(let Ee=0,ht=he.length;Ee<ht;Ee++){const ot=he[Ee],yt=re(ot.id),pt=we(yt.id),hn=it(pt,ot.materials),en=ot.skeletons,jt=yt.skin.joints,Yt=fe(en,jt);for(let ui=0,Pn=hn.length;ui<Pn;ui++){const is=hn[ui];is.isSkinnedMesh&&(is.bind(Yt,yt.skin.bindMatrix),is.normalizeSkinWeights()),v.push(is)}}for(let Ee=0,ht=tt.length;Ee<ht;Ee++){const ot=q(tt[Ee]);ot!==null&&v.push(ot.clone())}for(let Ee=0,ht=Be.length;Ee<ht;Ee++){const ot=Be[Ee],yt=we(ot.id),pt=it(yt,ot.materials);for(let hn=0,en=pt.length;hn<en;hn++)v.push(pt[hn])}for(let Ee=0,ht=$e.length;Ee<ht;Ee++)v.push(St($e[Ee]).clone());let ut;if(T.length===0&&v.length===1)ut=v[0];else{ut=L==="JOINT"?new pu:new Kn;for(let Ee=0;Ee<v.length;Ee++)ut.add(v[Ee])}return ut.name=L==="JOINT"?x.sid:x.name,ut.matrix.copy(C),ut.matrix.decompose(ut.position,ut.quaternion,ut.scale),ut}const Ue=new zi({name:Qn.DEFAULT_MATERIAL_NAME,color:16711935});function at(x,v){const C=[];for(let T=0,L=x.length;T<L;T++){const ie=v[x[T]];ie===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",x[T]),C.push(Ue)):C.push(ce(ie))}return C}function it(x,v){const C=[];for(const T in x){const L=x[T],ie=at(L.materialKeys,v);if(ie.length===0&&(T==="lines"||T==="linestrips"?ie.push(new Si):ie.push(new Dn)),T==="lines"||T==="linestrips")for(let $e=0,ut=ie.length;$e<ut;$e++){const Ee=ie[$e];if(Ee.isMeshPhongMaterial===!0||Ee.isMeshLambertMaterial===!0){const ht=new Si;ht.color.copy(Ee.color),ht.opacity=Ee.opacity,ht.transparent=Ee.transparent,ie[$e]=ht}}const he=L.data.attributes.skinIndex!==void 0,tt=ie.length===1?ie[0]:ie;let Be;switch(T){case"lines":Be=new ga(L.data,tt);break;case"linestrips":Be=new Ea(L.data,tt);break;case"triangles":case"polylist":he?Be=new Gf(L.data,tt):Be=new Jt(L.data,tt);break}C.push(Be)}return C}function nt(x){return xt.nodes[x]!==void 0}function St(x){return _(xt.nodes[x],ze)}function Ft(x){const v={name:x.getAttribute("name"),children:[]};A(x);const C=n(x,"node");for(let T=0;T<C.length;T++)v.children.push(J(C[T]));xt.visualScenes[x.getAttribute("id")]=v}function Ut(x){const v=new Kn;v.name=x.name;const C=x.children;for(let T=0;T<C.length;T++){const L=C[T];v.add(St(L.id))}return v}function ve(x){return xt.visualScenes[x]!==void 0}function Ke(x){return _(xt.visualScenes[x],Ut)}function Ye(x){const v=n(x,"instance_visual_scene")[0];return Ke(o(v.getAttribute("url")))}function Bt(){const x=xt.clips;if(c(x)===!0){if(c(xt.animations)===!1){const v=[];for(const C in xt.animations){const T=M(C);for(let L=0,ie=T.length;L<ie;L++)v.push(T[L])}dn.push(new Bc("default",-1,v))}}else for(const v in x)dn.push(Z(v))}function Ht(x){let v="";const C=[x];for(;C.length;){const T=C.shift();T.nodeType===Node.TEXT_NODE?v+=T.textContent:(v+=`
|
|
4205
|
-
`,
|
|
4206
|
-
`,v),null}const cn=Ne.getAttribute("version");console.debug("THREE.ColladaLoader: File version",cn);const Vt=h(n(Ne,"asset")[0]),Kt=new Bl(this.manager);Kt.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let sn;Fh&&(sn=new Fh(this.manager),sn.setPath(this.resourcePath||t));const Zt=new vt,dn=[];let hi={},kn=0;const xt={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};f(Ne,"library_animations","animation",g),f(Ne,"library_animation_clips","animation_clip",H),f(Ne,"library_controllers","controller",pe),f(Ne,"library_images","image",ae),f(Ne,"library_effects","effect",ge),f(Ne,"library_materials","material",ee),f(Ne,"library_cameras","camera",ct),f(Ne,"library_lights","light",ft),f(Ne,"library_geometries","geometry",qe),f(Ne,"library_nodes","node",J),f(Ne,"library_visual_scenes","visual_scene",Ft),f(Ne,"library_kinematics_models","kinematics_model",_e),f(Ne,"library_physics_models","physics_model",dt),f(Ne,"scene","instance_kinematics_scene",qt),m(xt.animations,b),m(xt.clips,se),m(xt.controllers,He),m(xt.images,le),m(xt.effects,O),m(xt.materials,me),m(xt.cameras,xe),m(xt.lights,wt),m(xt.geometries,oe),m(xt.visualScenes,Ut),Bt(),zt();const ki=Ye(n(Ne,"scene")[0]);return ki.animations=dn,Vt.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ki.rotation.set(-Math.PI/2,0,0)),ki.scale.multiplyScalar(Vt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),dn},kinematics:hi,library:xt,scene:ki}}}const Oh=new F,Qg=new Ln,Jr=new bt,Di=new bt,Kr=new zn,Zr=new F(1,1,1),Qr=new F;class Ra extends an{constructor(...e){super(...e),this.urdfNode=null,this.urdfName=""}copy(e,t){return super.copy(e,t),this.urdfNode=e.urdfNode,this.urdfName=e.urdfName,this}}class e3 extends Ra{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class t3 extends Ra{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Bu extends Ra{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class ku extends Ra{get jointType(){return this._jointType}set jointType(e){if(this.jointType!==e)switch(this._jointType=e,this.matrixWorldNeedsUpdate=!0,e){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new F(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...e){super(...e),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new F(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(e,t){return super.copy(e,t),this.jointType=e.jointType,this.axis=e.axis.clone(),this.limit.lower=e.limit.lower,this.limit.upper=e.limit.upper,this.ignoreLimits=!1,this.jointValue=[...e.jointValue],this.origPosition=e.origPosition?e.origPosition.clone():null,this.origQuaternion=e.origQuaternion?e.origQuaternion.clone():null,this.mimicJoints=[...e.mimicJoints],this}setJointValue(...e){e=e.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let t=!1;switch(this.mimicJoints.forEach(n=>{t=n.updateFromMimickedJoint(...e)||t}),this.jointType){case"fixed":return t;case"continuous":case"revolute":{let n=e[0];return n==null||n===this.jointValue[0]?t:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"prismatic":{let n=e[0];return n==null||n===this.jointValue[0]?t:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Oh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Oh,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"floating":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Di.compose(this.origPosition,this.origQuaternion,Zr),Kr.setFromEuler(Qg.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),Qr.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Jr.compose(Qr,Kr,Zr),Di.premultiply(Jr),this.position.setFromMatrixPosition(Di),this.rotation.setFromRotationMatrix(Di),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Di.compose(this.origPosition,this.origQuaternion,Zr),Kr.setFromAxisAngle(this.axis,this.jointValue[2]),Qr.set(this.jointValue[0],this.jointValue[1],0),Jr.compose(Qr,Kr,Zr),Di.premultiply(Jr),this.position.setFromMatrixPosition(Di),this.rotation.setFromRotationMatrix(Di),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class zh extends ku{constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const t=e.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...t)}copy(e,t){return super.copy(e,t),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class n3 extends Bu{constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,t){super.copy(e,t),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in e.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in e.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in e.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in e.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...t){const n=this.joints[e];return n?n.setJointValue(...t):!1}setJointValues(e){let t=!1;for(const n in e){const i=e[n];Array.isArray(i)?t=this.setJointValue(n,...i)||t:t=this.setJointValue(n,i)||t}return t}}const Mo=new zn,Bh=new Ln;function bs(s){return s?s.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function kh(s,e,t=!1){t||s.rotation.set(0,0,0),Bh.set(e[0],e[1],e[2],"ZYX"),Mo.setFromEuler(Bh),Mo.multiply(s.quaternion),s.quaternion.copy(Mo)}class Vu{constructor(e){this.manager=e||zl,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((t,n)=>{this.load(e,t,null,n)})}load(e,t,n,i){const r=this.manager,a=Vl.extractUrlBase(e),o=this.manager.resolveURL(e);r.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);t(c),r.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),r.itemError(o),r.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,r=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function d(E){if(!/^package:\/\//.test(E))return t?t+E:E;const[b,M]=E.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(b)?n+"/"+M:n+"/"+b+"/"+M;if(n instanceof Function)return n(b)+"/"+M;if(typeof n=="object")return b in n?n[b]+"/"+M:(console.error(`URDFLoader : ${b} not found in provided package list.`),null)}function u(E){let b;E instanceof Document?b=[...E.children]:E instanceof Element?b=[E]:b=[...new DOMParser().parseFromString(E,"text/xml").children];const M=b.filter(U=>U.nodeName==="robot").pop();return f(M)}function f(E){const b=[...E.children],M=b.filter(N=>N.nodeName.toLowerCase()==="link"),U=b.filter(N=>N.nodeName.toLowerCase()==="joint"),R=b.filter(N=>N.nodeName.toLowerCase()==="material"),P=new n3;P.robotName=E.getAttribute("name"),P.urdfRobotNode=E,R.forEach(N=>{const W=N.getAttribute("name");h[W]=g(N)});const D={},S={};M.forEach(N=>{const W=N.getAttribute("name"),X=E.querySelector(`child[link="${W}"]`)===null;l[W]=_(N,D,S,X?P:null)}),U.forEach(N=>{const W=N.getAttribute("name");c[W]=m(N)}),P.joints=c,P.links=l,P.colliders=S,P.visual=D;const y=Object.values(c);return y.forEach(N=>{N instanceof zh&&c[N.mimicJoint].mimicJoints.push(N)}),y.forEach(N=>{const W=new Set,X=Q=>{if(W.has(Q))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");W.add(Q),Q.mimicJoints.forEach(ne=>{X(ne)})};X(N)}),P.frames={...S,...D,...l,...c},P}function m(E){const b=[...E.children],M=E.getAttribute("type");let U;const R=b.find(W=>W.nodeName.toLowerCase()==="mimic");R?(U=new zh,U.mimicJoint=R.getAttribute("joint"),U.multiplier=parseFloat(R.getAttribute("multiplier")||1),U.offset=parseFloat(R.getAttribute("offset")||0)):U=new ku,U.urdfNode=E,U.name=E.getAttribute("name"),U.urdfName=U.name,U.jointType=M;let P=null,D=null,S=[0,0,0],y=[0,0,0];b.forEach(W=>{const X=W.nodeName.toLowerCase();X==="origin"?(S=bs(W.getAttribute("xyz")),y=bs(W.getAttribute("rpy"))):X==="child"?D=l[W.getAttribute("link")]:X==="parent"?P=l[W.getAttribute("link")]:X==="limit"&&(U.limit.lower=parseFloat(W.getAttribute("lower")||U.limit.lower),U.limit.upper=parseFloat(W.getAttribute("upper")||U.limit.upper))}),P.add(U),U.add(D),kh(U,y),U.position.set(S[0],S[1],S[2]);const N=b.filter(W=>W.nodeName.toLowerCase()==="axis")[0];if(N){const W=N.getAttribute("xyz").split(/\s+/g).map(X=>parseFloat(X));U.axis=new F(W[0],W[1],W[2]),U.axis.normalize()}return U}function _(E,b,M,U=null){U===null&&(U=new Bu);const R=[...E.children];return U.name=E.getAttribute("name"),U.urdfName=U.name,U.urdfNode=E,r&&R.filter(D=>D.nodeName.toLowerCase()==="visual").forEach(D=>{const S=p(D,h);if(U.add(S),D.hasAttribute("name")){const y=D.getAttribute("name");S.name=y,S.urdfName=y,b[y]=S}}),a&&R.filter(D=>D.nodeName.toLowerCase()==="collision").forEach(D=>{const S=p(D);if(U.add(S),D.hasAttribute("name")){const y=D.getAttribute("name");S.name=y,S.urdfName=y,M[y]=S}}),U}function g(E){const b=[...E.children],M=new Dn;return M.name=E.getAttribute("name")||"",b.forEach(U=>{const R=U.nodeName.toLowerCase();if(R==="color"){const P=U.getAttribute("rgba").split(/\s/g).map(D=>parseFloat(D));M.color.setRGB(P[0],P[1],P[2]),M.opacity=P[3],M.transparent=P[3]<1,M.depthWrite=!M.transparent}else if(R==="texture"){const P=U.getAttribute("filename");if(P){const D=new Bl(o),S=d(P);M.map=D.load(S),M.map.colorSpace=$t}}}),M}function p(E,b={}){const M=E.nodeName.toLowerCase()==="collision",U=[...E.children];let R=null;const P=U.filter(S=>S.nodeName.toLowerCase()==="material")[0];if(P){const S=P.getAttribute("name");S&&S in b?R=b[S]:R=g(P)}else R=new Dn;const D=M?new e3:new t3;return D.urdfNode=E,U.forEach(S=>{const y=S.nodeName.toLowerCase();if(y==="geometry"){const N=S.children[0].nodeName.toLowerCase();if(N==="mesh"){const W=S.children[0].getAttribute("filename"),X=d(W);if(X!==null){const Q=S.children[0].getAttribute("scale");if(Q){const ne=bs(Q);D.scale.set(ne[0],ne[1],ne[2])}i(X,o,(ne,H)=>{H?console.error("URDFLoader: Error loading mesh.",H):ne&&(ne instanceof Jt&&(ne.material=R),ne.position.set(0,0,0),ne.quaternion.identity(),D.add(ne))})}}else if(N==="box"){const W=new Jt;W.geometry=new Bi(1,1,1),W.material=R;const X=bs(S.children[0].getAttribute("size"));W.scale.set(X[0],X[1],X[2]),D.add(W)}else if(N==="sphere"){const W=new Jt;W.geometry=new Aa(1,30,30),W.material=R;const X=parseFloat(S.children[0].getAttribute("radius"))||0;W.scale.set(X,X,X),D.add(W)}else if(N==="cylinder"){const W=new Jt;W.geometry=new Il(1,1,1,30),W.material=R;const X=parseFloat(S.children[0].getAttribute("radius"))||0,Q=parseFloat(S.children[0].getAttribute("length"))||0;W.scale.set(X,Q,X),W.rotation.set(Math.PI/2,0,0),D.add(W)}}else if(y==="origin"){const N=bs(S.getAttribute("xyz")),W=bs(S.getAttribute("rpy"));D.position.set(N[0],N[1],N[2]),D.rotation.set(0,0,0),kh(D,W)}}),D}return u(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new nr(t).load(e,r=>{const a=new Jt(r,new Dn);n(a)}):/\.dae$/i.test(e)?new Zg(t).load(e,r=>n(r.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
|
|
4207
|
-
No loader available`)}}const i3=Gh.useModelComp(De.pinia),{systemPath:Vh}=De.storeToRefs(i3),ea=V.ref(),Hh=new Map;function s3(s,e,t,n,i){const r=async u=>{try{const f=await si.downloadAvatarApi({url:u});if(f.status!==200)throw new Error(`下载失败: ${f.status}`);return f.data}catch(f){throw console.error("addModelFromUrl失败:",f),f}},a=u=>new Promise((f,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,b=new ha().parse(p);b.preload(),f(b)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(u)}),o=async u=>{const f={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new Dn({color:8947848,side:wn}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of u){const _=await a(m);Object.assign(f.materials,_.materials)}return f.preload(),f},l=async(u,f=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const E=p.target.result;let b=null;f&&f.length>0&&(f.length===1?b=await a(f[0]):b=await o(f));const M=new ca;b&&M.setMaterials(b);const U=M.parse(E);b||U.traverse(R=>{R.isMesh&&(R.material=new Dn({color:8947848,side:wn}))}),m(U)}catch(E){_(E)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(u)}),c=async u=>{var f;try{t.value=!0;const{scene:m}=s();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<u.length;g++){const p=u[g];n.value=`正在加载模型 ${g+1}/${u.length}...`;const E=await r(p.objUrl),b=((f=p.objUrl)==null?void 0:f.split("/").pop())||`model_${g}.obj`,M=new File([E],b,{type:E.type});let U=[];if(p.mtlUrls){const P=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let D=0;D<P.length;D++){const S=P[D],y=await r(S),N=(S==null?void 0:S.split("/").pop())||`material_${g}_${D}.mtl`,W=new File([y],N,{type:y.type});U.push(W)}}const R=await l(M,U);m.add(R),e.value.push(R),_.push(R)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(u,f,m=[],_=[])=>{let g;const p=u.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const E=await f.text();if(p===".txt"||p===".cpt"){const ge=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,lt=[...E.matchAll(ge)].map(z=>({x:parseFloat(z[1]),y:parseFloat(z[2]),z:parseFloat(z[3])})),Et=new ln,Mt=lt.flatMap(z=>[z.x,z.y,z.z]);if(Et.setAttribute("position",new Dt(Mt,3)),p===".txt"){const z=new Ii({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Cs(Et,z)}else if(p===".cpt"){const z=new Si({color:"#5B5C99",linewidth:100});g=new Ea(Et,z)}}else if(p===".obj"){const ge=new ca;if(m&&m.length>0){const Ae=new ha;for(const lt of m){const Et=await lt.text(),Mt=Ae.parse(Et);Mt.preload(),ge.setMaterials(Mt);break}}g=ge.parse(E),(!m||m.length===0)&&g.traverse(Ae=>{Ae.isMesh&&(Ae.material=new Dn({color:"#B3B3D4"})),Ae instanceof Jt&&(Ae.material.side=wn)})}break;case".stl":const b=await f.arrayBuffer(),U=new nr().parse(b),R=new Dn({color:"#B3B3D4",side:wn});g=new Jt(U,R);break;case".nc":const P=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],D={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},S=new Kn,y=P.map(ge=>new Promise((Ae,lt)=>{new nr().load(Vh.value===""?`/model/${ge}`:`${Vh.value}\\${ge}`,Mt=>{const z=new Dn({color:D[ge]||"#B3B3D4",side:wn}),Wt=new Jt(Mt,z);Ae(Wt)},void 0,lt)}));try{(await Promise.all(y)).forEach(Ae=>S.add(Ae)),g=S}catch(ge){throw console.error("加载NC文件对应的STL文件失败:",ge),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const N=new zu,W=new Kn;try{const ge=await De.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),Ae=new Blob([ge.data],{type:"application/octet-stream;charset=UTF-8"}),lt=await De.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),Et=new Blob([lt.data],{type:"application/octet-stream;charset=UTF-8"}),Mt=await new Promise((Wt,Rt)=>{const At=URL.createObjectURL(Ae);N.load(At,Ge=>{const mt=new Float32Array(Ge.geometry.attributes.position.count*3);for(let Xe=0;Xe<Ge.geometry.attributes.position.count;Xe++)mt[Xe*3]=1,mt[Xe*3+1]=0,mt[Xe*3+2]=0;Ge.geometry.setAttribute("color",new fn(mt,3)),Ge.material.vertexColors=!0,Ge.scale.set(.3,.3,.3),URL.revokeObjectURL(At),Wt(Ge)},void 0,Rt)}),z=await new Promise((Wt,Rt)=>{const At=URL.createObjectURL(Et);N.load(At,Ge=>{const mt=new Float32Array(Ge.geometry.attributes.position.count*3);for(let Xe=0;Xe<Ge.geometry.attributes.position.count;Xe++)mt[Xe*3]=0,mt[Xe*3+1]=1,mt[Xe*3+2]=0;Ge.geometry.setAttribute("color",new fn(mt,3)),Ge.material.vertexColors=!0,Ge.scale.set(.3,.3,.3),URL.revokeObjectURL(At),Wt(Ge)},void 0,Rt)});W.add(Mt),W.add(z),g=W}catch(ge){throw console.error("PCD文件加载失败:",ge),new Error("无法加载PCD文件")}break;case".urdf":const X=URL.createObjectURL(f),Q=new Vu,ne="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",H={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},se=new Map,Z=new Map,pe=new Map,be=async ge=>{if(se.has(ge))return console.log(`从缓存加载: ${ge}`),se.get(ge);try{const Ae=await De.axios.get(`${ne}/${ge}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),lt=new Blob([Ae.data],{type:"application/octet-stream;charset=UTF-8"});return H.enableCache&&se.set(ge,lt),lt}catch(Ae){throw console.error(`加载文件失败: ${ge}`,Ae),new Error(`无法加载文件: ${ge}`)}},Ce=(ge="default")=>{if(Z.has(ge))return Z.get(ge);const Ae=new Dn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Xn});return Z.set(ge,Ae),Ae},Ie=ge=>{try{ge.isBufferGeometry&&ge.mergeVertices&&ge.mergeVertices(),ge.computeVertexNormals&&ge.computeVertexNormals(),ge.computeBoundingSphere&&ge.computeBoundingSphere(),ge.deleteAttribute&&ge.deleteAttribute("uv2")}catch(Ae){console.warn("几何体优化失败,使用原始几何体:",Ae)}return ge},He=async(ge,Ae,lt)=>{const Et=`stl_${Ae}`;if(pe.has(Et)){const Rt=pe.get(Et);return new Jt(Rt,Ce())}const Mt=await ge.arrayBuffer();let Wt=new nr(lt).parse(Mt);return Wt=Ie(Wt),pe.set(Et,Wt),new Jt(Wt,Ce())},K=async(ge,Ae,lt)=>{const Et=`obj_${Ae}`;if(se.has(Et))return se.get(Et).clone();const Mt=await ge.text(),z=new ca(lt),Wt=Ae.replace(".obj",".mtl");try{const Ge=await(await be(Wt)).text(),Xe=new ha(lt).parse(Ge);Xe.preload(),z.setMaterials(Xe)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${Wt}`)}const Rt=z.parse(Mt);return Rt.traverse(At=>{At.isMesh&&(At.geometry=Ie(At.geometry),At.castShadow=!0,At.receiveShadow=!0,At.renderOrder=1)}),se.set(Et,Rt),Rt},re=(ge,Ae)=>{const lt=new fu;if(lt.addLevel(ge,0),ge.geometry){const Et=ge.geometry.clone(),Mt=new Jt(Et,ge.material);lt.addLevel(Mt,50)}return lt};let ae=0,le=0;const Le=[];Q.loadMeshCb=async(ge,Ae,lt,Et,Mt)=>{const z=ge.split("/").pop(),Wt=lt||(()=>{});ae++;const Rt=new Promise(async(At,Ge)=>{try{const mt=await be(z);if(!mt||mt.size===0)throw new Error(`文件为空: ${z}`);const Xe=z.split(".").pop().toLowerCase();let gt;switch(Xe){case"stl":gt=await He(mt,z,Ae);break;case"obj":gt=await K(mt,z,Ae);break;default:throw new Error(`不支持的文件格式: ${Xe}`)}H.enableLOD&>.isMesh&&(gt=re(gt,z)),Wt(gt),le++,Et&&Et({loaded:le,total:ae,progress:le/ae}),At(gt)}catch(mt){console.error(`mesh文件加载失败: ${z}`,mt);const Xe=new Kn;Wt(Xe),At(Xe);const gt=new Bi(.1,.1,.1),on=new yu({color:16711680,wireframe:!0});return new Jt(gt,on)}});Le.push(Rt)};try{if(!X){ea.value=void 0;break}if(g=await Q.loadAsync(X),console.log(`URDF文件加载完成,等待${ae}个mesh文件加载...`),Le.length>0)try{await Promise.allSettled(Le),console.log(`所有mesh文件处理完成,成功加载: ${le}/${ae}`)}catch(lt){console.warn("部分mesh文件加载失败,但继续显示模型",lt)}g.traverse(lt=>{lt.isMesh&&(lt.castShadow=!0,lt.receiveShadow=!0,lt.renderOrder=1,lt.material&&(lt.material.needsUpdate=!0))}),console.time("计算包围盒");const ge=new ei;ge.expandByObject(g);const Ae=`urdf_${Date.now()}`;g.userData.boundingBox=ge.clone(),g.userData.modelId=Ae,Hh.set(Ae,{box:ge.clone(),center:ge.getCenter(new F),size:ge.getSize(new F),maxSize:Math.max(...ge.getSize(new F).toArray())}),ea.value=g,console.log("URDF模型加载完成并优化")}catch(ge){console.error("URDF加载失败:",ge),ea.value=void 0}finally{X&&URL.revokeObjectURL(X)}break;default:throw new Error(`不支持的文件格式: ${u}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async u=>{console.log(u);try{t.value=!0,n.value="正在加载模型...";const{scene:f}=s();if(!f)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<u.length;_++){const g=u[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(f.add(p),e.value.push(p),m.push(p))}return t.value=!1,n.value="",m}catch(f){throw console.error("加载模型失败:",f),t.value=!1,n.value="",f}},urdfModel:ea,modelBoundingBoxes:Hh}}window._iconfont_svg_string_4634042='<svg><symbol id="icon-lookAround" viewBox="0 0 1041 1024"><path d="M520.685026 798.355937c-10.788594 0-21.577187-2.790872-31.241101-8.372615l-291.583615-168.36871A62.482203 62.482203 0 0 1 166.619208 567.505024V230.850913c0-22.368629 11.913273-42.987756 31.241102-54.109588l291.583615-168.36871a62.482203 62.482203 0 0 1 62.482203 0l291.583615 168.36871c19.327828 11.121832 31.241102 31.740959 31.241101 54.109588v336.654111a62.482203 62.482203 0 0 1-31.241101 54.109588l-291.583615 168.36871a62.857096 62.857096 0 0 1-31.241102 8.372615zM291.583615 531.39031l229.101411 132.295652 229.101412-132.295652v-264.507993l-229.101412-132.295651L291.583615 266.923972v264.466338z m520.685026 36.114714h0.416548-0.416548z" fill="#aaaaaa" ></path><path d="M520.685026 461.660172c-10.788594 0-21.577187-2.790872-31.241101-8.372616l-291.583615-168.327055a62.482203 62.482203 0 0 1 62.482203-108.219176L520.685026 326.990196l260.342513-150.248871a62.482203 62.482203 0 1 1 62.482204 108.219176l-291.583615 168.327055a62.857096 62.857096 0 0 1-31.241102 8.372616z" fill="#aaaaaa" ></path><path d="M520.685026 798.355937a62.482203 62.482203 0 0 1-62.482203-62.482203V399.177969a62.482203 62.482203 0 1 1 124.964406 0v336.695765a62.482203 62.482203 0 0 1-62.482203 62.482203z" fill="#aaaaaa" ></path><path d="M520.685026 1003.172599c-53.276492 0-520.685026-5.248505-520.685026-187.446609 0-62.982061 54.776065-111.259976 162.870276-143.584103 33.073913-9.622259 67.855673 8.914128 77.769516 41.98804s-8.872473 67.897327-41.946386 77.769516c-30.324696 9.080747-49.194321 17.619981-60.649392 24.11813 46.32014 26.242525 178.657446 62.19062 382.641012 62.19062s336.320872-35.948094 382.641012-62.19062c-11.455071-6.498149-30.324696-15.037384-60.649392-24.11813a62.482203 62.482203 0 1 1 35.82313-119.757556c108.094211 32.324126 162.870276 80.643697 162.870276 143.584103 0 182.198104-467.408534 187.446609-520.685026 187.446609z m398.886385-175.366717h0.416548-0.416548z" fill="#72B02D" ></path></symbol><symbol id="icon-xuanzhuan" viewBox="0 0 1024 1024"><path d="M378.963454 724.443778l91.182641 163.473426c6.246088 11.212239 2.252687 25.39393-9.010749 31.691216l-163.473427 91.18264c-18.123894 10.085896-39.422029-6.758062-33.739113-26.673866l72.290786-254.707264c5.682916-19.967002 32.663967-23.090045 42.749862-4.966152z" fill="#FC794B" ></path><path d="M414.64807 903.9932c-1.228739 0-2.40628-0.051197-3.635018-0.204789C169.002752 879.367232 0.000003 771.443028 0.000003 641.452727c0-52.221389 27.032248-102.19009 78.127293-144.581571a35.827969 35.827969 0 0 1 50.480676 4.710165 35.827969 35.827969 0 0 1-4.710164 50.480676C100.090998 571.824209 71.727616 603.310634 71.727616 641.452727c0 88.929954 148.984551 171.050647 346.504275 191.068847 19.711014 1.9967 34.046298 19.557422 32.049597 39.268436a35.879166 35.879166 0 0 1-35.633418 32.20319zM608.430381 904.095595c-18.175091 0-33.79031-13.772111-35.633418-32.254387-1.945503-19.711014 12.389781-37.271736 32.100795-39.217239 198.134093-19.813409 347.528224-101.985301 347.528223-191.171242 0-23.550822-10.649068-47.050447-31.58882-69.935703-13.362532-14.59127-12.389781-37.271736 2.20149-50.634268 14.59127-13.362532 37.271736-12.389781 50.634268 2.20149 32.971151 35.9918 50.429479 76.898555 50.429478 118.368481 0 130.297485-169.463527 238.221689-412.088195 262.489276-1.177541 0.102395-2.40628 0.153592-3.583821 0.153592z" fill="#FC794B" ></path><path d="M846.703267 184.413179l-325.308534 184.464377L196.137396 184.413179 521.394733 0z" fill="#BEC5CB" ></path><path d="M521.394733 737.703915l325.308534-184.41318V184.413179l-325.308534 184.464377z" fill="#808487" ></path><path d="M521.394733 737.703915L196.137396 553.290735V184.413179l325.257337 184.464377z" fill="#9CA3A9" ></path></symbol><symbol id="icon-clipping" viewBox="0 0 1024 1024"><path d="M341.930667 201.770667l353.706666 204.245333v408.448l-353.706666-204.245333z" fill="#4A80FF" fill-opacity="0.15" ></path><path d="M320.853333 165.248l396.117334 228.608v457.173333l-395.946667-228.608z m353.749334 252.970667L362.837333 238.336v359.722667l311.466667 179.882666z" fill="#72B02D" ></path><path d="M544.384 746.453333l-211.669333-211.669333 18.688-18.688 211.669333 211.669333z" fill="#72B02D" ></path><path d="M693.717333 530.261333l-266.453333-266.325333 20.906667-20.906667 266.325333 266.453334z" fill="#72B02D" ></path><path d="M688.853333 621.098667l-366.933333-366.933334 24.448-24.704 366.933333 366.933334z" fill="#72B02D" ></path><path d="M689.664 713.856L321.578667 345.770667l24.618666-24.618667 368.085334 368.128z" fill="#72B02D" ></path><path d="M683.605333 799.317333l-355.712-355.712 24.234667-24.234666 355.712 355.712z" fill="#72B02D" ></path><path d="M537.770667 944.938667h-51.2v-418.602667l-362.666667-209.28 25.6-44.330667 362.666667 209.066667 362.666666-209.066667 25.6 44.330667-362.666666 209.066667z" fill="#AAAAAA" ></path><path d="M512.170667 53.461333a31.146667 31.146667 0 0 1 15.488 4.266667l370.090666 213.632a31.232 31.232 0 0 1 15.317334 26.794667v426.922666a31.274667 31.274667 0 0 1-15.317334 26.837334l-369.834666 213.333333a31.488 31.488 0 0 1-31.061334 0l-369.834666-213.333333a31.146667 31.146667 0 0 1-15.914667-26.837334V298.069333a31.146667 31.146667 0 0 1 15.573333-27.008l369.792-213.333333a30.976 30.976 0 0 1 15.701334-4.266667z m349.866666 256l-349.866666-201.642666-349.866667 201.856v403.84l349.866667 201.813333 349.866666-201.898667z" fill="#AAAAAA" ></path></symbol><symbol id="icon-viewReset" viewBox="0 0 1024 1024"><path d="M643.2 515.2c-89.6-67.2-179.2-60.8-268.8 0-32 22.4-67.2 57.6-105.6 89.6 38.4 32 70.4 70.4 108.8 96 28.8 19.2 60.8 32 96 38.4 118.4 19.2 188.8-57.6 268.8-137.6-35.2-28.8-60.8-64-99.2-86.4zM508.8 704c-51.2 0-96-41.6-96-99.2s41.6-105.6 96-105.6 96 41.6 96 99.2c0 64-38.4 105.6-96 105.6z" fill="#AAAAAA" ></path><path d="M515.2 544c-3.2 41.6 12.8 60.8 51.2 51.2 0 32-19.2 57.6-51.2 57.6s-57.6-22.4-51.2-57.6c-6.4-32 16-51.2 51.2-51.2" fill="#AAAAAA" ></path><path d="M652.8 3.2c9.6-3.2 19.2-3.2 28.8 0 9.6 3.2 12.8 12.8 12.8 22.4v108.8c70.4 28.8 131.2 70.4 179.2 128 80 89.6 118.4 214.4 108.8 336-9.6 124.8-70.4 236.8-166.4 313.6-96 80-224 118.4-345.6 108.8-124.8-9.6-243.2-67.2-323.2-160S32 649.6 41.6 524.8c9.6-118.4 70.4-233.6 160-307.2 22.4-19.2 60.8-19.2 80 3.2 19.2 22.4 19.2 57.6-3.2 80-70.4 57.6-115.2 140.8-124.8 233.6s22.4 185.6 80 249.6c60.8 70.4 147.2 115.2 243.2 124.8 96 9.6 188.8-19.2 259.2-80s118.4-140.8 124.8-236.8c9.6-89.6-22.4-185.6-80-249.6-28.8-28.8-57.6-57.6-89.6-76.8v89.6c0 9.6-3.2 19.2-12.8 22.4-9.6 3.2-19.2 3.2-28.8 0l-227.2-160c-3.2-3.2-9.6-12.8-9.6-19.2 0-9.6 3.2-12.8 9.6-19.2L652.8 3.2z" fill="#72B02D" ></path></symbol><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(s=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,r,a,o,l=function(d,u){u.parentNode.insertBefore(d,u)};if(e&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(d){console&&console.log(d)}}n=function(){var d,u=document.createElement("div");u.innerHTML=s._iconfont_svg_string_4634042,(u=u.getElementsByTagName("svg")[0])&&(u.setAttribute("aria-hidden","true"),u.style.position="absolute",u.style.width=0,u.style.height=0,u.style.overflow="hidden",u=u,(d=document.body).firstChild?l(u,d.firstChild):d.appendChild(u))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(r=n,a=s.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,r())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Hu=De.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(s){this.selectArray=s},setSelectString(s){this.selectString=s}}}),r3={class:"calculator-content"},a3={class:"calculator-child"},o3={class:"calculator-child"},l3=V.defineComponent({__name:"calculator",setup(s){const e=V.ref(),t=V.ref();return V.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(V.openBlock(),V.createElementBlock("div",r3,[V.createElementVNode("div",a3,[V.createVNode(si.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),V.createElementVNode("div",o3,[V.createVNode(si.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),c3=xa._export_sfc(l3,[["__scopeId","data-v-73db0fe7"]]),Gu=De.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(s){this.selectIndex=s},setSelectMenu(s){this.selectMenu=s},setSelectTitle(s){this.selectTitle=s}}}),Wu=(s,e)=>{let t=s,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,r)=>{if(Array.isArray(i)){let a={};return i=i==null?void 0:i.forEach((o,l)=>{var c;(c=n==null?void 0:n[l])!=null&&c.prop?a[n[l].prop]=o:Array.isArray(o)&&(a.children=Wu(o,n))}),Object.assign(a,{id:r})}else return i})),t},Xu=(s,e,t)=>{let n=s,i=e;return n=n==null?void 0:n.map((r,a)=>{var o,l;return!Array.isArray(r)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(r.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),r.some(c=>Array.isArray(c))&&(r=r==null?void 0:r.map(c=>{var h;return Array.isArray(c)&&(c=Xu(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),r}),n},h3=(s,e,t)=>{if(e==="")return s==null?void 0:s.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return u3(s,n,t)}},u3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(r=>r.id!==t):n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=qu(r,i,t)),r)),n},qu=(s,e,t)=>{var r,a;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=(r=n.children)==null?void 0:r.filter(o=>o.id!==t):n.children=(a=n.children)==null?void 0:a.map(o=>(o.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),o=qu(o,i,t)),o)),n},d3=(s,e,t)=>{if(e==="")return t;{const n=e.split("-");return f3(s,n,t)}},f3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=ju(r,i,t)),r)),n},ju=(s,e,t)=>{var r;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(r=n.children)==null?void 0:r.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=ju(a,i,t)),a)),n},Yu=De.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(s){this.tableIndex=s},setTableShowThree(s){this.tableShowThree=s}}}),xl=async s=>{var r,a,o,l,c,h,d;let e=(a=(r=De.cloneDeep(s))==null?void 0:r.optionUrl)==null?void 0:a.menuSelect,t=[];e==null||e.forEach(u=>{});let n="";const i=await mn.menuToParent(e);if(i==null||i.forEach(u=>{var f,m,_,g;(u==null?void 0:u.name)===(((g=(_=(m=(f=De.cloneDeep(s))==null?void 0:f.optionUrl)==null?void 0:m.groupSelect)==null?void 0:_[0])==null?void 0:g.replaceAll("'",""))??"")&&(n=u==null?void 0:u.id)}),n!==""){const u=(o=i==null?void 0:i[0])==null?void 0:o.compData;let f=(c=(l=u==null?void 0:u.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:l.contents)==null?void 0:c.map(_=>_==null?void 0:_.label),m=(d=(h=u==null?void 0:u.find(_=>(_==null?void 0:_.key)==="tableContents"))==null?void 0:h.contents)==null?void 0:d.map(_=>(_=_==null?void 0:_.filter(g=>!(g!=null&&g.id)),_));m==null||m.forEach(_=>{t.push(mn.getValueToObjectValue(_,f))})}return t},p3={class:"table-content"},m3={class:"menu-config-wrap"},g3=["onClick"],_3={key:0,class:"viewport-wrap"},v3=["onClick"],x3={title:"选择显示列信息"},y3={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","max-height":"300px",width:"300px",overflow:"auto"}},M3={class:"form-content"},S3={key:0,class:"dialog-footer"},b3={class:"dialog-footer"},E3={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick"],setup(s,{emit:e}){const t=V.ref(null),n=V.ref([]),i=s,r=e,a=V.ref([]),o=V.ref([]),l=V.ref([]),c=V.ref(!1),h=V.ref(),d=De.useMenuState(),{activeMenuPath:u}=De.storeToRefs(d),f=Yu(De.pinia),m=Gh.useModelComp(De.pinia),{extraContents:_}=De.storeToRefs(m),g=V.ref([]);V.ref(!1);const p=V.ref("");V.ref();const E=V.ref(!0),b=V.ref(0),M=V.ref(!1),U=V.ref(""),R=V.ref(!1),P=V.ref({label:"查看三维模型"}),D=V.ref(!1),S=V.ref(),y=V.ref([]),N=V.ref([]),W=V.ref(!1),X=V.ref([]),Q=V.ref([]),ne=V.ref([]),H=V.ref(),se=V.ref(),Z=Hu(De.pinia),pe=V.ref(),be=Gu(De.pinia),{selectIndex:Ce,selectMenu:Ie,selectTitle:He}=De.storeToRefs(be),{selectString:K}=De.storeToRefs(Z),re=Ju.useLoginState(De.pinia),{loginUserInfo:ae}=De.storeToRefs(re),le=V.ref(720),Le=V.ref("read"),ge=V.ref([]),Ae=V.ref(),lt=V.ref(!0),Et=I=>{ge.value=I},Mt=(I,B)=>{Ae.value===B?lt.value=!1:lt.value=!0,Ae.value=B==null?void 0:B.changeProp},z=V.computed(()=>{var I;return(I=a.value)==null?void 0:I.filter(B=>(B==null?void 0:B.label)!=="操作")}),Wt=()=>{R.value=!1},Rt=I=>{r("clickTrigger",I)},At=I=>{console.log(232,I)},Ge=(I,B)=>{if(Object.values(B).length!==0)return Object.values(B).find($=>{var oe,ue,te;return((oe=$==null?void 0:$.toString())==null?void 0:oe.includes(".txt"))||((ue=$==null?void 0:$.toString())==null?void 0:ue.includes(".cpt"))||((te=$==null?void 0:$.toString())==null?void 0:te.includes(".obj"))})?[...I,P.value]:I},mt=I=>{var ue;K.value===""?I==null||I[0]:(I==null?void 0:I.find(te=>(te==null?void 0:te.selectLabel)==="("+K.value+")"))??(I==null||I.find(te=>!(te!=null&&te.selectLabel)));let B=I;(ue=a.value)!=null&&ue.find(te=>te.prop==="index");let $=H.value;const oe=[];return B==null||B.forEach((te,we)=>{var Te;let _e={};if(Array.isArray(te)){let je=[];te==null||te.filter(j=>!(j!=null&&j.id)).forEach((j,Fe)=>{var Tt,Pt,Xt,nn,dt;if((Tt=$==null?void 0:$[Fe])!=null&&Tt.prop&&!Array.isArray(j)){let Lt={};Lt[$[Fe].column]=j,_!=null&&_.value&&((Pt=_==null?void 0:_.value)==null?void 0:Pt.length)>0&&((Xt=_==null?void 0:_.value)!=null&&Xt.find(Re=>JSON.stringify(Re==null?void 0:Re[0])===JSON.stringify(Lt)))&&(je=(nn=_==null?void 0:_.value)==null?void 0:nn.find(Re=>JSON.stringify(Re==null?void 0:Re[0])===JSON.stringify(Lt))),je&&je.length>0?_e[$[Fe].prop]=je!=null&&je.find(Re=>{var qt;return((qt=Object.keys(Re))==null?void 0:qt[0])===$[Fe].column})?(dt=je==null?void 0:je.find(Re=>{var qt;return((qt=Object.keys(Re))==null?void 0:qt[0])===$[Fe].column}))==null?void 0:dt[$[Fe].column]:j:_e[$[Fe].prop]=j}})}else _e=te;Array.isArray(te)&&te.some(je=>je==null?void 0:je.id)?oe.push(Object.assign(_e,{id:(Te=te==null?void 0:te.find(je=>je.id))==null?void 0:Te.id})):_e.id?oe.push(_e):oe.push(Object.assign(_e,{id:we}))}),oe},Xe=async I=>{var ue,te,we,_e,Te;let B={};for(let je in I)I[je]!==""&&(B["tableData."+je]=I[je]);const $=await mn.filterContents({type:"data",tableId:i==null?void 0:i.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:u.value},B),oe=(we=(te=(ue=De.cloneDeep($))==null?void 0:ue.data)==null?void 0:te.result)==null?void 0:we.map(je=>{var Fe;let j=[];return j.push({id:je.id}),j.push((Fe=je==null?void 0:je.value)==null?void 0:Fe.tableData),j});g.value=mt(mn.getTableContents(oe,(Te=(_e=De.cloneDeep(a.value))==null?void 0:_e.map(je=>je.label))==null?void 0:Te.filter(je=>je!=="操作")))},gt=async I=>{var oe,ue,te,we,_e,Te,je,j,Fe,Tt,Pt;const B=(oe=De.cloneDeep(a.value))==null?void 0:oe.filter(Xt=>Xt==null?void 0:Xt.isRoute);if((B==null?void 0:B.length)>0){let Xt=(ue=B==null?void 0:B[0])==null?void 0:ue.prop,nn=De.cloneDeep(u).value+"/"+(I==null?void 0:I[Xt]),dt=De.cloneDeep(u).value,Lt=await mn.getItemData(nn,sessionStorage.getItem("systemKey"),"");(Lt==null?void 0:Lt.length)>0&&(await mn.loadingConstruct(nn,nn+`/updateLoading${(te=ae.value)==null?void 0:te.account}`),m.setRouteToChildPath(dt),d.setActiveMenuPath(nn+`/updateLoading${(we=ae.value)==null?void 0:we.account}`))}let $=await mn.getItemData(u.value,sessionStorage.getItem("systemKey"),I.id);if($=$==null?void 0:$.filter(Xt=>Xt.comp!=="methodButton"),$&&$.length>0){const Xt=!Array.isArray(He.value)&&((_e=He.value)==null?void 0:_e.key)!=="main"?[]:He.value;Xt.push({key:Ie.value===""?(Te=I==null?void 0:I.id)==null?void 0:Te.toString():Ie.value+"-"+((je=I==null?void 0:I.id)==null?void 0:je.toString()),value:I[(j=Object.keys(I))==null?void 0:j.filter(nn=>nn!=="index"&&nn!=="id")[0]]}),be.setSelectMenu(Ie.value===""?(Fe=I==null?void 0:I.id)==null?void 0:Fe.toString():Ie.value+"-"+((Tt=I==null?void 0:I.id)==null?void 0:Tt.toString())),be.setSelectTitle(Xt),be.setSelectIndex((Pt=I==null?void 0:I.id)==null?void 0:Pt.toString()),r("pageChange",$)}},on=I=>{var B;(B=De.cloneDeep(i.itemData))==null||B.map($=>(($==null?void 0:$.key)==="tableContents"&&($.contents=I),$))},O=async(I,B,$,oe)=>{var ue;if((oe==null?void 0:oe.data)==="查看"&&(I!=null&&I.every(te=>(te==null?void 0:te.url)&&(te==null?void 0:te.name)))){let te=De.cloneDeep(I);te=await((ue=De.cloneDeep(te))==null?void 0:ue.map(async _e=>{var j,Fe,Tt,Pt;const Te=await si.downloadAvatarApi({url:_e==null?void 0:_e.url});let je=URL.createObjectURL(Te.data);return{name:(_e==null?void 0:_e.name)+"."+((Pt=(j=_e==null?void 0:_e.url)==null?void 0:j.split("."))==null?void 0:Pt[((Tt=(Fe=_e==null?void 0:_e.url)==null?void 0:Fe.split("."))==null?void 0:Tt.length)-1]),blobUrl:je}}));let we=await Promise.all(te);h.value=we,c.value=!0}r("contentClick",I,B,$,{id:i==null?void 0:i.index,type:"table"})},w=()=>{c.value=!1},ee=I=>{r("rowClick",I)};V.watch(()=>i.changedContent,()=>{var $,oe;if(!i.changedContent)return;let I=($=g.value)==null?void 0:$.map(ue=>{var te;return ue.id===((te=i.changedContent)==null?void 0:te.id)&&(ue={...i.changedContent,id:i.changedContent.newId?i.changedContent.newId:i.changedContent.id},delete ue.newId),ue});const B=(oe=i.itemData)==null?void 0:oe.map(ue=>((ue==null?void 0:ue.key)==="tableContents"&&(ue.contents=I),ue));g.value=I,r("contentChange",{contents:B,index:i.index}),r("change",{content:I,index:i==null?void 0:i.index,buttonName:"",id:i==null?void 0:i.index})},{deep:!0,immediate:!0});const de=()=>{},me=(I,B,$)=>{var oe,ue,te,we,_e,Te,je;if(p.value="",W.value=!0,E.value=!0,r("onButtonClick",I,B),I==="删除"){g.value=(oe=De.cloneDeep(g.value))==null?void 0:oe.filter(Fe=>(Fe==null?void 0:Fe.id)!==(B==null?void 0:B.id));const j=h3(pe.value,Ie.value,B==null?void 0:B.id);on(j),r("change",{content:g.value,singleContent:B,index:i==null?void 0:i.index,type:"delete",buttonName:I,column:a.value})}else if(I==="批量删除"){if(((ue=ge.value)==null?void 0:ue.length)===0)return De.ElMessage.warning("请先勾选操作的数据");r("change",{content:g.value,singleContent:null,selectItems:ge.value,index:i==null?void 0:i.index,type:"batchDelete",buttonName:I,column:a.value})}else if(I==="复制新增"){U.value="新增";const j=De.cloneDeep(B),Fe=(te=a.value)==null?void 0:te[0],Tt=(we=Q.value)==null?void 0:we.find(Pt=>(Pt==null?void 0:Pt.label)==="新增子页面");st(!0,Tt,{data:j,firstCol:Fe})}else if(I==="新增")U.value="新增",rt(""),R.value=!0;else if(I==="编辑")U.value="编辑",rt(B),R.value=!0;else if(I==="查看")U.value="查看",rt(B),W.value=!1,E.value=!1,R.value=!0;else if(I==="查看三维模型"){const j={};for(let Tt in B)Tt!=="id"&&(j[Tt]=B[Tt]);let Fe=(_e=Object.values(j))==null?void 0:_e[1];f.setTableShowThree(Fe)}else if(((Te=$==null?void 0:$.extra)==null?void 0:Te.type)==="modelExample")U.value=I,D.value=!0;else if(I==="新增子页面"){const j=(je=Q.value)==null?void 0:je.find(Fe=>(Fe==null?void 0:Fe.label)==="新增子页面");st(!1,j)}else if(I==="修改模板"){let j=De.cloneDeep(u).value;m.setRouteToChildPath(j),d.setActiveMenuPath(j+"/")}},ce=async I=>{var $,oe,ue,te,we,_e;const B=await De.getInsofDataApi({key:{pageKey:I,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if((($=B==null?void 0:B.data)==null?void 0:$.code)===200)return Array.isArray((oe=B==null?void 0:B.data)==null?void 0:oe.result)&&((te=(ue=B==null?void 0:B.data)==null?void 0:ue.result)==null?void 0:te.length)>0?(_e=(we=B==null?void 0:B.data)==null?void 0:we.result)==null?void 0:_e.map(Te=>{var je;return{id:Te==null?void 0:Te.id,...(je=Te==null?void 0:Te.value)==null?void 0:je.pageData}}):[]},ct=(I,B,$,oe)=>{var ue;r("contentChange",{contents:(ue=I==null?void 0:I.compData)==null?void 0:ue.map(te=>{var we;return(te==null?void 0:te.key)==="formContent"?{...te,contents:(we=te==null?void 0:te.contents)==null?void 0:we.map(_e=>(_e==null?void 0:_e.key)===B?{..._e,value:$}:_e)}:te}),index:I==null?void 0:I.id}),d.setActiveMenuPath(""),d.setActiveMenuPath(oe)},We=(I,B)=>{let $=I==null?void 0:I[B==null?void 0:B.prop],oe=1;if(g.value.some(ue=>(ue==null?void 0:ue[B==null?void 0:B.prop])===$)){const ue=$;for(;g.value.some(te=>(te==null?void 0:te[B==null?void 0:B.prop])===`${ue}(${oe})`);)oe++;$=`${ue}(${oe})`}return $},st=async(I,B,$)=>{var we,_e,Te,je,j;let oe,ue;const te=We($==null?void 0:$.data,$==null?void 0:$.firstCol);if(I?(oe=De.cloneDeep(u).value+"/"+((Te=$==null?void 0:$.data)==null?void 0:Te[(_e=$==null?void 0:$.firstCol)==null?void 0:_e.prop]),ue=De.cloneDeep(u).value+"/"+te):(oe=De.cloneDeep(u).value+"/",ue=De.cloneDeep(oe)+`loading${(we=ae.value)==null?void 0:we.account}`),B){const Fe=await mn.getItemData(ue,sessionStorage.getItem("systemKey"),"");if((Fe==null?void 0:Fe.length)>0)if(I){const Tt=Fe==null?void 0:Fe.find(Pt=>{var Xt;return((Xt=Pt==null?void 0:Pt.comp)==null?void 0:Xt.toUpperCase())==="FORM"});Tt&&ct(Tt,(je=$==null?void 0:$.firstCol)==null?void 0:je.label,te,u.value)}else m.setRouteToChildPath(De.cloneDeep(u).value),d.setActiveMenuPath(ue);else if(await mn.loadingConstruct(oe,ue),I){const Tt=await ce(ue);if((Tt==null?void 0:Tt.length)>0){const Pt=Tt==null?void 0:Tt.find(Xt=>{var nn;return((nn=Xt==null?void 0:Xt.comp)==null?void 0:nn.toUpperCase())==="FORM"});Pt&&ct(Pt,(j=$==null?void 0:$.firstCol)==null?void 0:j.label,te,u.value)}}else m.setRouteToChildPath(De.cloneDeep(u).value),d.setActiveMenuPath(ue)}else I?(p.value="",se.value=$==null?void 0:$.data,ft(!0,$==null?void 0:$.firstCol,te)):(m.setRouteToChildPath(De.cloneDeep(u).value),d.setActiveMenuPath(ue))},rt=I=>{var ue,te,we,_e,Te,je;const B=[];let $=[];for(let j in I)Array.isArray(I==null?void 0:I[j])&&$.push(j);o.value=De.cloneDeep(a.value),(te=mn.getColumnChild((ue=De.cloneDeep(a.value))==null?void 0:ue.filter(j=>(j==null?void 0:j.label)!=="操作")))==null||te.forEach((j,Fe)=>{var Tt;$.find(Pt=>Pt===(j==null?void 0:j.prop))||(j!=null&&j.formType&&((Tt=j==null?void 0:j.formType)==null?void 0:Tt.toUpperCase())==="SELECT"?B.push({label:(j==null?void 0:j.label)??"",name:(j==null?void 0:j.prop)??"t"+Fe,type:!(j!=null&&j.formType)||(j==null?void 0:j.formType)===""?"Input":j==null?void 0:j.formType,value:(I==null?void 0:I[j==null?void 0:j.prop])??(j==null?void 0:j.value)??"",id:(j==null?void 0:j.id)??Fe,contents:(j==null?void 0:j.options)??[],width:1,isFormColHidden:j==null?void 0:j.isFormColHidden,optionUrl:{groupSelect:j==null?void 0:j.groupSelect,menuSelect:j==null?void 0:j.formMenuSelect,type:"Select",selectRelateType:j==null?void 0:j.selectRelateType}}):B.push({label:(j==null?void 0:j.label)??"",name:(j==null?void 0:j.prop)??"t"+Fe,type:!(j!=null&&j.formType)||(j==null?void 0:j.formType)===""?"Input":j==null?void 0:j.formType,value:(I==null?void 0:I[j==null?void 0:j.prop])??(j==null?void 0:j.value)??"",id:(j==null?void 0:j.id)??Fe,contents:(j==null?void 0:j.options)??[],width:1,isFormColHidden:j==null?void 0:j.isFormColHidden}))}),I===""||!I||(p.value=(I==null?void 0:I.id)??"");let oe=mn.getColumnChild((we=De.cloneDeep(a.value))==null?void 0:we.filter(j=>(j==null?void 0:j.label)!=="操作"));y.value&&((_e=y.value)==null?void 0:_e.length)>0&&(y.value=(Te=De.cloneDeep(y).value)==null?void 0:Te.map(j=>{var Tt;let Fe=(Tt=oe==null?void 0:oe.find(Pt=>(Pt==null?void 0:Pt.label)===(j==null?void 0:j.label)))==null?void 0:Tt.prop;return Fe&&(j.value=I[Fe]),j})),ne.value=y.value&&((je=y.value)==null?void 0:je.length)>0?mn.getTableFormToForm(y.value):B},xe=async()=>{var B;await V.nextTick();const I=(B=t.value)==null?void 0:B.$el;I&&mn.Sortable.create(I,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:$=>{var we;const{oldIndex:oe,newIndex:ue}=$;if(oe===ue)return;const te=z.value.splice(oe,1)[0];z.value.splice(ue,0,te),a.value=(we=a.value)==null?void 0:we.slice().sort((_e,Te)=>{var je,j;return _e.label==="操作"?1:Te.label==="操作"?-1:((je=z.value)==null?void 0:je.indexOf(_e))-((j=z.value)==null?void 0:j.indexOf(Te))})}})};V.onMounted(()=>{S.value=window.innerWidth-240*2});const Ze=()=>{V.nextTick(()=>{xe()})},ft=(I=!0,B,$)=>{var we;let oe=mn.getColumnChild((we=De.cloneDeep(a.value))==null?void 0:we.filter(_e=>(_e==null?void 0:_e.label)!=="操作")),ue,te=De.cloneDeep(g.value);if(!se.value){R.value=!1;return}if(p.value===""){b.value++;let _e;B&&$?_e={id:b.value,[B==null?void 0:B.prop]:$}:_e={id:b.value},te.push(Object.assign(se.value,_e)),ue=Object.assign(se.value,_e)}else te=te==null?void 0:te.map(_e=>{var Te,je;if((_e==null?void 0:_e.id)===p.value){let j={};for(let Fe in _e){let Tt=(Te=oe==null?void 0:oe.find(Pt=>(Pt==null?void 0:Pt.prop)===Fe))==null?void 0:Te.label;Tt?j[Fe]=(je=se.value)==null?void 0:je[Tt]:j[Fe]=_e[Fe]}_e=Object.assign(j,se.value),ue=_e}return _e});if(g.value=te,I){const _e=d3(pe.value,Ie.value,te);on(_e),R.value=!1,se.value=void 0,r("change",{content:_e,singleContent:ue,index:i==null?void 0:i.index,buttonName:U.value,column:a.value})}},_t=async(I,B,$)=>{var je,j,Fe,Tt,Pt,Xt,nn,dt,Lt,Re,qt;Ae.value=$==null?void 0:$.prop;const oe=De.cloneDeep(i.itemData),ue=oe==null?void 0:oe.map(Oe=>{var Ct;return(Oe==null?void 0:Oe.key)==="header"&&((Ct=Oe.contents)==null||Ct.map((Pe,zt)=>{var Je,A,k,Y,J,G,fe,Me,ze,Ue,at,it,nt,St,Ft,Ut,ve,Ke,Ye;return Pe.type=Pe!=null&&Pe.type?Pe.type:(Y=(k=(A=(Je=Pe==null?void 0:Pe.key)==null?void 0:Je.split("$"))==null?void 0:A[1])==null?void 0:k.split("("))!=null&&Y[0]?(G=(J=mn.FormType)==null?void 0:J.find(Bt=>{var Ht,un,Ne,Se;return(Bt==null?void 0:Bt.key)===((Se=(Ne=(un=(Ht=Pe==null?void 0:Pe.key)==null?void 0:Ht.split("$"))==null?void 0:un[1])==null?void 0:Ne.split("("))==null?void 0:Se[0])}))==null?void 0:G.value:"Input",Pe.options=Pe!=null&&Pe.options?Pe.options:((ze=(Me=(fe=Pe==null?void 0:Pe.key)==null?void 0:fe.split("$"))==null?void 0:Me[1])==null?void 0:ze.length)>0?(nt=(it=So((at=(Ue=Pe==null?void 0:Pe.key)==null?void 0:Ue.split("$"))==null?void 0:at[1]))==null?void 0:it.split(","))==null?void 0:nt.map(Bt=>({label:Bt,value:Bt})):[],(St=Pe==null?void 0:Pe.key)!=null&&St.includes("$")&&(Pe.key=(Ut=(Ft=Pe==null?void 0:Pe.key)==null?void 0:Ft.split("$"))==null?void 0:Ut[0]),Pe.value=(ve=Object.values(B))==null?void 0:ve[zt],Pe.optionUrl=Pe!=null&&Pe.formMenuSelect&&((Ke=Pe==null?void 0:Pe.formMenuSelect)==null?void 0:Ke.length)>0?{groupSelect:(Ye=Pe==null?void 0:Pe.groupSelect)==null?void 0:Ye.split(/[::]/).map(Bt=>Bt.trim()),menuSelect:Pe==null?void 0:Pe.formMenuSelect,selectRelateType:"",type:(Pe==null?void 0:Pe.formType)??(Pe!=null&&Pe.groupSelect?"Select":"")}:null,Pe})),Oe});let te=De.cloneDeep(ne.value),we=(j=(je=De.cloneDeep(ue))==null?void 0:je.find(Oe=>(Oe==null?void 0:Oe.key)==="header"))==null?void 0:j.contents;te=te==null?void 0:te.map(Oe=>{var Ct;return Oe.value=(Ct=we==null?void 0:we.find((Pe,zt)=>zt===(Oe==null?void 0:Oe.id)))==null?void 0:Ct.value,Oe});let _e="",Te=(Pt=(Tt=(Fe=De.cloneDeep(ue))==null?void 0:Fe.find(Oe=>(Oe==null?void 0:Oe.key)==="header"))==null?void 0:Tt.contents)==null?void 0:Pt.find((Oe,Ct)=>{var Pe,zt;return(Oe==null?void 0:Oe.label)===Ae.value||(Ct==null?void 0:Ct.toString())===((zt=(Pe=Ae.value)==null?void 0:Pe.split("a"))==null?void 0:zt[1].toString())});if((dt=(nn=(Xt=De.cloneDeep(ue))==null?void 0:Xt.find(Oe=>(Oe==null?void 0:Oe.key)==="header"))==null?void 0:nn.contents)==null||dt.forEach(Oe=>{var Ct,Pe,zt,Je,A;_e===""&&((zt=(Pe=(Ct=Oe==null?void 0:Oe.optionUrl)==null?void 0:Ct.groupSelect)==null?void 0:Pe[1])!=null&&zt.includes("["))&&(_e=(A=(Je=Oe==null?void 0:Oe.optionUrl)==null?void 0:Je.groupSelect)==null?void 0:A[1])}),(Lt=Te==null?void 0:Te.optionUrl)!=null&&Lt.menuSelect){let Oe=await xl(Te),Ct;if(Oe==null||Oe.forEach(Pe=>{var zt,Je,A,k,Y,J,G,fe,Me,ze;_e===((Je=(zt=Te==null?void 0:Te.optionUrl)==null?void 0:zt.groupSelect)==null?void 0:Je[1])&&((Y=(k=(A=Te==null?void 0:Te.optionUrl)==null?void 0:A.groupSelect)==null?void 0:k[1])!=null&&Y.includes("["))&&((ze=De.cloneDeep(Pe))==null?void 0:ze[(Me=(fe=(G=(J=Te==null?void 0:Te.optionUrl)==null?void 0:J.groupSelect)==null?void 0:G[1])==null?void 0:fe.replaceAll("[",""))==null?void 0:Me.replaceAll("]","")])===(Te==null?void 0:Te.value)&&(Ct=Pe)}),Ct){let Pe=De.cloneDeep(te);Pe=Pe==null?void 0:Pe.map(Je=>{var A,k,Y,J,G,fe,Me,ze,Ue,at,it;return(Ct!=null&&Ct[Je==null?void 0:Je.label]||Ct!=null&&Ct[(J=(Y=(k=(A=Je==null?void 0:Je.optionUrl)==null?void 0:A.groupSelect)==null?void 0:k[1])==null?void 0:Y.replaceAll("[",""))==null?void 0:J.replaceAll("]","")])&&((Me=(fe=(G=Je==null?void 0:Je.optionUrl)==null?void 0:G.groupSelect)==null?void 0:fe[1])!=null&&Me.includes("["))&&(Je.value=(Ct==null?void 0:Ct[Je==null?void 0:Je.label])||(Ct==null?void 0:Ct[(it=(at=(Ue=(ze=Je==null?void 0:Je.optionUrl)==null?void 0:ze.groupSelect)==null?void 0:Ue[1])==null?void 0:at.replaceAll("[",""))==null?void 0:it.replaceAll("]","")])),Je}),g.value=(Re=De.cloneDeep(g.value))==null?void 0:Re.map(Je=>{if((Je==null?void 0:Je.id)===(B==null?void 0:B.id)){const A={};return Pe==null||Pe.forEach(k=>{A[k.name]=k.value}),A.id=Je==null?void 0:Je.id,A}return Je});let zt=De.cloneDeep(Pe);zt=zt==null?void 0:zt.map(Je=>{var A,k,Y,J;return(k=(A=Je==null?void 0:Je.optionUrl)==null?void 0:A.menuSelect)!=null&&k.some(G=>G==null?void 0:G.includes)&&(Je.optionUrl.menuSelect=(J=(Y=Je==null?void 0:Je.optionUrl)==null?void 0:Y.menuSelect)==null?void 0:J.map(G=>{var fe,Me,ze,Ue;if(G!=null&&G.includes("[")){let at=(Me=(fe=G==null?void 0:G.replaceAll("[","").replaceAll("]",""))==null?void 0:fe.split(":"))==null?void 0:Me[1];G=(Ue=(ze=De.cloneDeep(Pe))==null?void 0:ze.find(it=>(it==null?void 0:it.label)===at))==null?void 0:Ue.value}return G})),Je}),g.value=(qt=De.cloneDeep(g.value))==null?void 0:qt.map(Je=>{if((Je==null?void 0:Je.id)===(B==null?void 0:B.id)){const A={};return zt==null||zt.forEach(k=>{A[k.name]=k.value}),A.id=Je==null?void 0:Je.id,A}return Je})}}},ke=async I=>{var _e,Te,je,j,Fe,Tt,Pt,Xt,nn;if(!I)return;se.value=I,r("onFormChange",I);const B=De.cloneDeep(i.itemData),$=B==null?void 0:B.map(dt=>{var Lt;return(dt==null?void 0:dt.key)==="header"&&((Lt=dt.contents)==null||Lt.map((Re,qt)=>{var Oe,Ct,Pe,zt,Je,A,k,Y,J,G,fe,Me,ze,Ue,at,it,nt,St,Ft;return Re.type=Re!=null&&Re.type?Re.type:(zt=(Pe=(Ct=(Oe=Re==null?void 0:Re.key)==null?void 0:Oe.split("$"))==null?void 0:Ct[1])==null?void 0:Pe.split("("))!=null&&zt[0]?(A=(Je=mn.FormType)==null?void 0:Je.find(Ut=>{var ve,Ke,Ye,Bt;return(Ut==null?void 0:Ut.key)===((Bt=(Ye=(Ke=(ve=Re==null?void 0:Re.key)==null?void 0:ve.split("$"))==null?void 0:Ke[1])==null?void 0:Ye.split("("))==null?void 0:Bt[0])}))==null?void 0:A.value:"Input",Re.options=Re!=null&&Re.options?Re.options:((J=(Y=(k=Re==null?void 0:Re.key)==null?void 0:k.split("$"))==null?void 0:Y[1])==null?void 0:J.length)>0?(ze=(Me=So((fe=(G=Re==null?void 0:Re.key)==null?void 0:G.split("$"))==null?void 0:fe[1]))==null?void 0:Me.split(","))==null?void 0:ze.map(Ut=>({label:Ut,value:Ut})):[],(Ue=Re==null?void 0:Re.key)!=null&&Ue.includes("$")&&(Re.key=(it=(at=Re==null?void 0:Re.key)==null?void 0:at.split("$"))==null?void 0:it[0]),Re.value=(nt=Object.values(I))==null?void 0:nt[qt],Re.optionUrl=Re!=null&&Re.formMenuSelect&&((St=Re==null?void 0:Re.formMenuSelect)==null?void 0:St.length)>0?{groupSelect:(Ft=Re==null?void 0:Re.groupSelect)==null?void 0:Ft.split(/[::]/).map(Ut=>Ut.trim()),menuSelect:Re==null?void 0:Re.formMenuSelect,selectRelateType:"",type:(Re==null?void 0:Re.formType)??(Re!=null&&Re.groupSelect?"Select":"")}:null,Re})),dt});let oe=De.cloneDeep(ne.value),ue=(Te=(_e=De.cloneDeep($))==null?void 0:_e.find(dt=>(dt==null?void 0:dt.key)==="header"))==null?void 0:Te.contents;if(oe=oe==null?void 0:oe.map(dt=>{var Lt;return dt.value=(Lt=ue==null?void 0:ue.find((Re,qt)=>qt===(dt==null?void 0:dt.id)))==null?void 0:Lt.value,dt}),!lt.value)return;let te="",we=(Fe=(j=(je=De.cloneDeep($))==null?void 0:je.find(dt=>(dt==null?void 0:dt.key)==="header"))==null?void 0:j.contents)==null?void 0:Fe.find((dt,Lt)=>{var Re,qt;return(dt==null?void 0:dt.label)===Ae.value||(Lt==null?void 0:Lt.toString())===((qt=(Re=Ae.value)==null?void 0:Re.split("a"))==null?void 0:qt[1].toString())});if((Xt=(Pt=(Tt=De.cloneDeep($))==null?void 0:Tt.find(dt=>(dt==null?void 0:dt.key)==="header"))==null?void 0:Pt.contents)==null||Xt.forEach(dt=>{var Lt,Re,qt,Oe,Ct;te===""&&((qt=(Re=(Lt=dt==null?void 0:dt.optionUrl)==null?void 0:Lt.groupSelect)==null?void 0:Re[1])!=null&&qt.includes("["))&&(te=(Ct=(Oe=dt==null?void 0:dt.optionUrl)==null?void 0:Oe.groupSelect)==null?void 0:Ct[1])}),(nn=we==null?void 0:we.optionUrl)!=null&&nn.menuSelect&<.value){let dt=await xl(we),Lt;if(dt==null||dt.forEach(Re=>{var qt,Oe,Ct,Pe,zt,Je,A,k,Y,J;te===((Oe=(qt=we==null?void 0:we.optionUrl)==null?void 0:qt.groupSelect)==null?void 0:Oe[1])&&((zt=(Pe=(Ct=we==null?void 0:we.optionUrl)==null?void 0:Ct.groupSelect)==null?void 0:Pe[1])!=null&&zt.includes("["))&&((J=De.cloneDeep(Re))==null?void 0:J[(Y=(k=(A=(Je=we==null?void 0:we.optionUrl)==null?void 0:Je.groupSelect)==null?void 0:A[1])==null?void 0:k.replaceAll("[",""))==null?void 0:Y.replaceAll("]","")])===(we==null?void 0:we.value)&&(Lt=Re)}),Lt){let Re=De.cloneDeep(oe);Re=Re==null?void 0:Re.map(Oe=>{var Ct,Pe,zt,Je,A,k,Y,J,G,fe,Me;return(Lt!=null&&Lt[Oe==null?void 0:Oe.label]||Lt!=null&&Lt[(Je=(zt=(Pe=(Ct=Oe==null?void 0:Oe.optionUrl)==null?void 0:Ct.groupSelect)==null?void 0:Pe[1])==null?void 0:zt.replaceAll("[",""))==null?void 0:Je.replaceAll("]","")])&&((Y=(k=(A=Oe==null?void 0:Oe.optionUrl)==null?void 0:A.groupSelect)==null?void 0:k[1])!=null&&Y.includes("["))&&(Oe.value=(Lt==null?void 0:Lt[Oe==null?void 0:Oe.label])||(Lt==null?void 0:Lt[(Me=(fe=(G=(J=Oe==null?void 0:Oe.optionUrl)==null?void 0:J.groupSelect)==null?void 0:G[1])==null?void 0:fe.replaceAll("[",""))==null?void 0:Me.replaceAll("]","")])),Oe}),ne.value=Re;let qt=De.cloneDeep(Re);qt=qt==null?void 0:qt.map(Oe=>{var Ct,Pe,zt,Je;return(Pe=(Ct=Oe==null?void 0:Oe.optionUrl)==null?void 0:Ct.menuSelect)!=null&&Pe.some(A=>A==null?void 0:A.includes)&&(Oe.optionUrl.menuSelect=(Je=(zt=Oe==null?void 0:Oe.optionUrl)==null?void 0:zt.menuSelect)==null?void 0:Je.map(A=>{var k,Y,J,G;if(A!=null&&A.includes("[")){let fe=(Y=(k=A==null?void 0:A.replaceAll("[","").replaceAll("]",""))==null?void 0:k.split(":"))==null?void 0:Y[1];A=(G=(J=De.cloneDeep(Re))==null?void 0:J.find(Me=>(Me==null?void 0:Me.label)===fe))==null?void 0:G.value}return A})),Oe}),ne.value=qt}}lt.value=!1},wt=I=>I?(I==null?void 0:I.toUpperCase())==="INPUT"?"TEXTAREA":I:"TEXTAREA",q=I=>{var $,oe,ue,te,we,_e;rt("");const B=($=ne.value)==null?void 0:$.reduce((Te,je)=>(Te[je.name]=je.value,Te),{});((oe=Object.keys(B))==null?void 0:oe.length)>0&&(se.value=B,p.value="",b.value=(ue=g.value)==null?void 0:ue.length,X.value=(te=Q.value)==null?void 0:te.filter(Te=>(Te==null?void 0:Te.label)!=="新增"),a.value=(_e=(we=o.value)==null?void 0:we.filter(Te=>(Te==null?void 0:Te.label)!=="操作"))==null?void 0:_e.map(Te=>{var je;return{...Te,type:"edit",optionUrl:Te!=null&&Te.formMenuSelect&&((je=Te==null?void 0:Te.formMenuSelect)==null?void 0:je.length)>0?{groupSelect:Te==null?void 0:Te.groupSelect,menuSelect:Te==null?void 0:Te.formMenuSelect,selectRelateType:"",type:Te==null?void 0:Te.formType}:null,columnType:wt(Te==null?void 0:Te.formType)}}),I==="createClick"&&ft(!1))};V.watch(()=>[i.itemData,K.value,Ce.value,Ie.value,_==null?void 0:_.value],()=>{var Te,je,j,Fe,Tt,Pt,Xt,nn,dt,Lt,Re,qt,Oe,Ct,Pe,zt,Je,A,k,Y,J,G,fe,Me,ze,Ue,at,it,nt,St,Ft,Ut;const I=(Te=De.cloneDeep(i.itemData))==null?void 0:Te.filter(ve=>(ve==null?void 0:ve.key)==="header");(je=De.cloneDeep(i.itemData))==null||je.filter(ve=>(ve==null?void 0:ve.key)==="tableIndexColumn")[0];const B=(j=De.cloneDeep(i.itemData))==null?void 0:j.find(ve=>(ve==null?void 0:ve.key)==="page"),$=(Fe=De.cloneDeep(i.itemData))==null?void 0:Fe.find(ve=>(ve==null?void 0:ve.key)==="rowButton"),oe=(Tt=De.cloneDeep(i.itemData))==null?void 0:Tt.find(ve=>(ve==null?void 0:ve.key)==="extraButton"),ue=(Pt=De.cloneDeep(i.itemData))==null?void 0:Pt.filter(ve=>(ve==null?void 0:ve.key)==="tableContents"),te=(Xt=De.cloneDeep(i.itemData))==null?void 0:Xt.filter(ve=>(ve==null?void 0:ve.key)==="tableIndex");y.value=(Lt=(dt=(nn=De.cloneDeep(i.itemData))==null?void 0:nn.filter(ve=>(ve==null?void 0:ve.key)==="tableToForm"))==null?void 0:dt[0])==null?void 0:Lt.contents,M.value=(B==null?void 0:B.contents)??!1;let we=[];K.value===""?we=I==null?void 0:I[0]:we=(I==null?void 0:I.find(ve=>(ve==null?void 0:ve.selectLabel)==="("+K.value+")"))??(I==null?void 0:I.find(ve=>!(ve!=null&&ve.selectLabel)));let _e=[];if(K.value===""?_e=te==null?void 0:te[0]:_e=(te==null?void 0:te.find(ve=>(ve==null?void 0:ve.selectLabel)==="("+K.value+")"))??(te==null?void 0:te.find(ve=>!(ve!=null&&ve.selectLabel))),((Re=we==null?void 0:we.contents)==null?void 0:Re.length)>0){let ve=[];if(we!=null&&we.contents.some(Ne=>Array.isArray(Ne)&&(Ne==null?void 0:Ne.find(Se=>Se.children))))Ie.value===""?ve=(Oe=(qt=mn.getGradeColumns(De.cloneDeep(we==null?void 0:we.contents)))==null?void 0:qt[0])==null?void 0:Oe.filter(Ne=>!Array.isArray(Ne)):(Ie.value.split("-"),ve=(Ct=mn.getGradeColumns(De.cloneDeep(we==null?void 0:we.contents)))==null?void 0:Ct[0]);else{const Ne=we!=null&&we.contents.some(Se=>Array.isArray(Se))?(Pe=we==null?void 0:we.contents)==null?void 0:Pe[0]:we==null?void 0:we.contents;Ne==null||Ne.forEach((Se,cn)=>{var Vt;ve.push({label:(Se==null?void 0:Se.label)??"",prop:(Se==null?void 0:Se.label)==="操作"?"operate":(Se==null?void 0:Se.prop)??"a"+cn,width:Se!=null&&Se.width?parseInt(Se.width):"",fixed:(Se==null?void 0:Se.fixed)??void 0,sortable:(Se==null?void 0:Se.sortable)??!1,align:(Se==null?void 0:Se.align)??"left",showOverflowTooltip:(Se==null?void 0:Se.showOverflowTooltip)??!0,isNotDrag:(Se==null?void 0:Se.isNotDrag)??!1,isEditCol:(Se==null?void 0:Se.isEditCol)??!1,isOperate:(Se==null?void 0:Se.isOperate)??!1,id:(Se==null?void 0:Se.id)??cn,type:(Se==null?void 0:Se.label)==="操作"?"operate":void 0,formType:(Se==null?void 0:Se.formType)??(Se!=null&&Se.groupSelect?"Select":""),isTableColHidden:Se==null?void 0:Se.isTableColHidden,isFormColHidden:Se==null?void 0:Se.isFormColHidden,options:(Se==null?void 0:Se.options)??[],value:(Se==null?void 0:Se.value)??"",formMenuSelect:(Se==null?void 0:Se.formMenuSelect)??[],isRoute:(Se==null?void 0:Se.isRoute)??!1,groupSelect:Se!=null&&Se.groupSelect?(Vt=Se==null?void 0:Se.groupSelect)==null?void 0:Vt.replaceAll('"',"").split(":"):[]})})}a.value=ve,l.value=ve,n.value=(zt=a.value)==null?void 0:zt.map(Ne=>Ne==null?void 0:Ne.label);let Ke=(A=(Je=mn.getAllLeafNodes(De.cloneDeep(a.value)))==null?void 0:Je.filter(Ne=>(Ne==null?void 0:Ne.type)!=="operate"))==null?void 0:A.map((Ne,Se)=>({prop:(Ne==null?void 0:Ne.prop)??"a"+Se,column:Ne.label}));H.value=Ke;let Ye=[];K.value===""?Ye=ue==null?void 0:ue[0]:Ye=(ue==null?void 0:ue.find(Ne=>(Ne==null?void 0:Ne.selectLabel)==="("+K.value+")"))??(ue==null?void 0:ue.find(Ne=>!(Ne!=null&&Ne.selectLabel)));let Bt=Array.isArray((k=Ye==null?void 0:Ye.contents)==null?void 0:k[0])&&((Y=Ye==null?void 0:Ye.contents)!=null&&Y[0].every(Ne=>Array.isArray(Ne)))?(J=De.cloneDeep(Ye==null?void 0:Ye.contents))==null?void 0:J[0]:De.cloneDeep(Ye==null?void 0:Ye.contents);_e!=null&&_e.contents&&((G=_e==null?void 0:_e.contents)==null?void 0:G.length)!==0&&(Bt=(fe=De.cloneDeep(Bt))==null?void 0:fe.map((Ne,Se)=>{if(!Array.isArray(Ne)){let cn={};for(let Vt in Ne)Vt!=="id"&&Vt!=="index"&&(cn[Vt]=Ne[Vt]);Ne=Object.values(cn)}return Ne}));const Ht=!!((Me=a.value)!=null&&Me.find(Ne=>Ne.prop==="index"));Bt=Xu(De.cloneDeep(Bt),_e==null?void 0:_e.contents,Ht);const un=[];Bt==null||Bt.forEach((Ne,Se)=>{var Vt;let cn={};if(Array.isArray(Ne)){let Kt=[];Ne==null||Ne.filter(sn=>!(sn!=null&&sn.id)).forEach((sn,Zt)=>{var dn,hi,kn,xt,ki,x;if((dn=Ke==null?void 0:Ke[Zt])!=null&&dn.prop&&!Array.isArray(sn)){let v={};v[Ke[Zt].column]=sn,_!=null&&_.value&&((hi=_==null?void 0:_.value)==null?void 0:hi.length)>0&&((kn=_==null?void 0:_.value)!=null&&kn.find(C=>JSON.stringify(C==null?void 0:C[0])===JSON.stringify(v)))&&(Kt=(xt=_==null?void 0:_.value)==null?void 0:xt.find(C=>JSON.stringify(C==null?void 0:C[0])===JSON.stringify(v))),Kt&&Kt.length>0?cn[Ke[Zt].prop]=Kt!=null&&Kt.find(C=>{var T;return((T=Object.keys(C))==null?void 0:T[0])===Ke[Zt].column})?(ki=Kt==null?void 0:Kt.find(C=>{var T;return((T=Object.keys(C))==null?void 0:T[0])===Ke[Zt].column}))==null?void 0:ki[Ke[Zt].column]:sn:cn[Ke[Zt].prop]=sn}else Array.isArray(sn)&&((x=Ke[Zt])!=null&&x.prop?cn[Ke[Zt].prop]=sn:cn.children=Wu(sn,Ke))})}else cn=Ne;Array.isArray(Ne)&&Ne.some(Kt=>Kt==null?void 0:Kt.id)?un.push(Object.assign(cn,{id:(Vt=Ne==null?void 0:Ne.find(Kt=>Kt.id))==null?void 0:Vt.id})):cn.id?un.push(cn):un.push(Object.assign(cn,{id:Se.toString()}))}),g.value=un}else a.value=[],o.value=[],g.value=[];((ze=$==null?void 0:$.contents)==null?void 0:ze.length)>0?N.value=$==null?void 0:$.contents:N.value=[],((Ue=oe==null?void 0:oe.contents)==null?void 0:Ue.length)>0?(((it=(at=De.cloneDeep(a.value))==null?void 0:at.filter(Ke=>(Ke==null?void 0:Ke.type)!=="operate"))==null?void 0:it.every(Ke=>(Ke==null?void 0:Ke.formType)==="Select"))?oe==null||oe.contents.push({label:"新增子页面"}):oe.contents=(nt=oe==null?void 0:oe.contents)==null?void 0:nt.filter(Ke=>(Ke==null?void 0:Ke.label)!=="修改模板"),X.value=oe==null?void 0:oe.contents,Q.value=oe==null?void 0:oe.contents):(X.value=[],Q.value=[]),b.value=((St=g==null?void 0:g.value)==null?void 0:St.length)??0,pe.value=g.value,Le.value==="edit"&&(a.value=(Ut=(Ft=o.value)==null?void 0:Ft.filter(ve=>(ve==null?void 0:ve.label)!=="操作"))==null?void 0:Ut.map(ve=>{var Ke;return{...ve,type:"edit",optionUrl:ve!=null&&ve.formMenuSelect&&((Ke=ve==null?void 0:ve.formMenuSelect)==null?void 0:Ke.length)>0?{groupSelect:ve==null?void 0:ve.groupSelect,menuSelect:ve==null?void 0:ve.formMenuSelect,selectRelateType:"",type:ve==null?void 0:ve.formType}:null}}),q())},{deep:!0,immediate:!0}),V.watch(()=>i==null?void 0:i.operatingForm,I=>{I!=null&&I.form&&(rt(I==null?void 0:I.form),U.value=I==null?void 0:I.dialogTitle,W.value=!0,R.value=!0)},{immediate:!0,deep:!0});const qe=I=>{Le.value=I,I==="edit"?q("viewChange"):(X.value=Q.value,a.value=l.value)};V.ref(!1);const ye=I=>{q("createClick")},et=(I,B,$)=>{var oe,ue;se.value=De.cloneDeep(I),p.value=I==null?void 0:I.id,b.value=(oe=g.value)==null?void 0:oe.length,U.value=(I==null?void 0:I.id)===((ue=g.value)==null?void 0:ue.length)?"新增":"编辑",ft(!0)};return(I,B)=>{var Te,je;const $=V.resolveComponent("el-icon"),oe=V.resolveComponent("el-popover"),ue=V.resolveComponent("svg-icon"),te=V.resolveComponent("el-checkbox"),we=V.resolveComponent("el-checkbox-group"),_e=V.resolveComponent("el-button");return V.openBlock(),V.createElementBlock("div",p3,[(V.openBlock(),V.createBlock(si.ssTable,{columns:a.value,checkedColumns:n.value,key:a.value,tableData:g.value,viewport:Le.value,isShowPagination:M.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:gt,extraButton:X.value,onContentClick:O,onRowClick:ee,onSelectChange:Et,onCellChange:et,onChange:_t,onPreview:At},V.createSlots({headerButton:V.withCtx(j=>[s.showHeader?(V.openBlock(),V.createBlock(rd,{key:0,compName:s.compName,buttons:j.buttons,onButtonClick:B[0]||(B[0]=Fe=>me(Fe,"",{})),columns:a.value,onFilter:Xe},null,8,["compName","buttons","columns"])):V.createCommentVNode("",!0)]),viewport:V.withCtx(()=>{var j;return[((j=g.value)==null?void 0:j.length)>0?(V.openBlock(),V.createElementBlock("div",_3,[V.createElementVNode("span",{title:"只读视图",onClick:B[2]||(B[2]=Fe=>qe("read"))},[V.createVNode(ue,{name:"readTable",class:"view-icon"})]),V.createElementVNode("span",{title:"编辑视图",onClick:B[3]||(B[3]=Fe=>qe("edit"))},[V.createVNode(ue,{name:"editTable",class:"view-icon"})])])):V.createCommentVNode("",!0)]}),rowCreate:V.withCtx(({row:j})=>[V.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:Fe=>ye()},[V.createVNode(ue,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,v3)]),operateCol:V.withCtx(()=>[V.createVNode(oe,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"click",onShow:Ze},{reference:V.withCtx(()=>[V.createElementVNode("span",x3,[V.createVNode(ue,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:V.withCtx(()=>[V.createElementVNode("div",y3,[V.createVNode(we,{modelValue:n.value,"onUpdate:modelValue":B[4]||(B[4]=j=>n.value=j),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:t},{default:V.withCtx(()=>[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(z.value,j=>(V.openBlock(),V.createBlock(te,{key:j.label,label:j.label,value:j.label,style:{width:"100%",marginRight:0}},{default:V.withCtx(()=>[V.createElementVNode("span",null,V.toDisplayString(j.label),1),V.createVNode(ue,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px",cursor:"move",color:"grey",position:"absolute",right:"5px"}})]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])]),_:1})]),_:2},[((Te=N.value)==null?void 0:Te.length)>0?{name:"actions",fn:V.withCtx(({item:j})=>[V.createVNode(oe,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:V.withCtx(()=>[V.createVNode($,null,{default:V.withCtx(()=>[V.createVNode(V.unref(De.more_filled_default))]),_:1})]),default:V.withCtx(()=>[V.createElementVNode("div",m3,[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(Ge(N.value,j),(Fe,Tt)=>(V.openBlock(),V.createElementBlock("div",{class:"menu-config-item",key:Tt,onClick:Pt=>me(Fe==null?void 0:Fe.label,j,{extra:Fe})},[V.createElementVNode("div",{style:V.normalizeStyle({color:Fe==null?void 0:Fe.textColor}),class:"extra-button-label"},V.toDisplayString(Fe==null?void 0:Fe.label),5)],8,g3))),128))])]),_:2},1024)]),key:"0"}:void 0,((je=g.value)==null?void 0:je.length)>0?{name:"batchButton",fn:V.withCtx(j=>[V.createVNode(od,{buttons:j.buttons,onButtonClick:B[1]||(B[1]=Fe=>me(Fe,"",{}))},null,8,["buttons"])]),key:"1"}:void 0]),1032,["columns","checkedColumns","tableData","viewport","isShowPagination","extraButton"])),V.createVNode(si.ssDialog,{title:U.value,visible:R.value,width:le.value,onBeforeDestroy:Wt},{default:V.withCtx(()=>[V.createElementVNode("div",M3,[V.createVNode(si.ssForm,{rowContents:ne.value,isEnableWrap:!1,onChange:ke,onClickTrigger:Rt,isEdit:E.value,onBlurChange:Mt},null,8,["rowContents","isEdit"])])]),footer:V.withCtx(()=>[W.value?(V.openBlock(),V.createElementBlock("div",S3,[V.createVNode(_e,{onClick:B[5]||(B[5]=j=>R.value=!1),id:"themeBorderButton"},{default:V.withCtx(()=>B[8]||(B[8]=[V.createTextVNode(V.toDisplayString("取消"))])),_:1,__:[8]}),V.createVNode(_e,{class:"ok-button",onClick:ft,id:"themeButton"},{default:V.withCtx(()=>B[9]||(B[9]=[V.createTextVNode(V.toDisplayString("确认"))])),_:1,__:[9]})])):V.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),V.createVNode(si.ssDialog,{title:U.value,visible:D.value,width:S.value,onBeforeDestroy:B[7]||(B[7]=j=>D.value=!1)},{default:V.withCtx(()=>[V.createVNode(c3)]),footer:V.withCtx(()=>[V.createElementVNode("div",b3,[V.createVNode(_e,{onClick:B[6]||(B[6]=j=>D.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:V.withCtx(()=>B[10]||(B[10]=[V.createTextVNode(V.toDisplayString("取消"))])),_:1,__:[10]}),V.createVNode(_e,{class:"ok-button",onClick:de,id:"themeButton"},{default:V.withCtx(()=>B[11]||(B[11]=[V.createTextVNode(V.toDisplayString("确认"))])),_:1,__:[11]})])]),_:1},8,["title","visible","width"]),c.value?(V.openBlock(),V.createBlock(si.ssFilePreview,{key:0,fileDataList:h.value,onDestroy:w},null,8,["fileDataList"])):V.createCommentVNode("",!0)])}}},A3=xa._export_sfc(E3,[["__scopeId","data-v-864d094f"]]);exports.ACESFilmicToneMapping=qh;exports.AmbientLight=wu;exports.Box3=ei;exports.BoxGeometry=Bi;exports.BufferAttribute=fn;exports.BufferGeometry=ln;exports.CatmullRomCurve3=vu;exports.Color=vt;exports.Controls=Fp;exports.DirectionalLight=Au;exports.DoubleSide=wn;exports.Euler=Ln;exports.Float32BufferAttribute=Dt;exports.FrontSide=Xn;exports.GridHelper=Ip;exports.Group=Kn;exports.HemisphereLight=Ap;exports.LOD=fu;exports.Line=Ea;exports.LineBasicMaterial=Si;exports.LoadingManager=bu;exports.MOUSE=ld;exports.MTLLoader=ha;exports.MathUtils=Ki;exports.Matrix4=bt;exports.Mesh=Jt;exports.MeshPhongMaterial=Dn;exports.MeshStandardMaterial=yu;exports.OBJLoader=ca;exports.PCDLoader=zu;exports.PCFSoftShadowMap=Xh;exports.PerspectiveCamera=Sn;exports.Plane=Ui;exports.PlaneGeometry=hr;exports.PointLight=Eu;exports.Points=Cs;exports.PointsMaterial=Ii;exports.Quaternion=zn;exports.Ray=Fs;exports.SRGBColorSpace=$t;exports.STLLoader=nr;exports.Scene=Pl;exports.ShadowMaterial=hp;exports.Spherical=Tu;exports.TOUCH=cd;exports.TubeGeometry=Ol;exports.URDFLoader=Vu;exports.Vector2=Qe;exports.Vector3=F;exports.WebGLRenderer=xg;exports.Xe=Xg;exports.formGetOptions=So;exports.getSelectRow=xl;exports.ssTable=A3;exports.useFormToTableComp=Hu;exports.useModelLoader=s3;exports.useTableComp=Yu;exports.useUnit=Gu;
|
|
4201
|
+
`);let i=[];for(let o=0,l=n.length;o<l;o++){const c=n[o].trimStart();if(c.length===0)continue;const h=c.charAt(0);if(h!=="#")if(h==="v"){const f=c.split(Dh);switch(f[0]){case"v":t.vertices.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3])),f.length>=7?($r.setRGB(parseFloat(f[4]),parseFloat(f[5]),parseFloat(f[6]),Qt),t.colors.push($r.r,$r.g,$r.b)):t.colors.push(void 0,void 0,void 0);break;case"vn":t.normals.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3]));break;case"vt":t.uvs.push(parseFloat(f[1]),parseFloat(f[2]));break}}else if(h==="f"){const u=c.slice(1).trim().split(Dh),d=[];for(let _=0,g=u.length;_<g;_++){const p=u[_];if(p.length>0){const S=p.split("/");d.push(S)}}const m=d[0];for(let _=1,g=d.length-1;_<g;_++){const p=d[_],S=d[_+1];t.addFace(m[0],p[0],S[0],m[1],p[1],S[1],m[2],p[2],S[2])}}else if(h==="l"){const f=c.substring(1).trim().split(" ");let u=[];const d=[];if(c.indexOf("/")===-1)u=f;else for(let m=0,_=f.length;m<_;m++){const g=f[m].split("/");g[0]!==""&&u.push(g[0]),g[1]!==""&&d.push(g[1])}t.addLineGeometry(u,d)}else if(h==="p"){const u=c.slice(1).trim().split(" ");t.addPointGeometry(u)}else if((i=jg.exec(c))!==null){const f=(" "+i[0].slice(1).trim()).slice(1);t.startObject(f)}else if($g.test(c))t.object.startMaterial(c.substring(7).trim(),t.materialLibraries);else if(Yg.test(c))t.materialLibraries.push(c.substring(7).trim());else if(Jg.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(h==="s"){if(i=c.split(" "),i.length>1){const u=i[1].trim().toLowerCase();t.object.smooth=u!=="0"&&u!=="off"}else t.object.smooth=!0;const f=t.object.currentMaterial();f&&(f.smooth=t.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}t.finalize();const r=new Kn;if(r.materialLibraries=[].concat(t.materialLibraries),!(t.objects.length===1&&t.objects[0].geometry.vertices.length===0)===!0)for(let o=0,l=t.objects.length;o<l;o++){const c=t.objects[o],h=c.geometry,f=c.materials,u=h.type==="Line",d=h.type==="Points";let m=!1;if(h.vertices.length===0)continue;const _=new hn;_.setAttribute("position",new Ut(h.vertices,3)),h.normals.length>0&&_.setAttribute("normal",new Ut(h.normals,3)),h.colors.length>0&&(m=!0,_.setAttribute("color",new Ut(h.colors,3))),h.hasUVIndices===!0&&_.setAttribute("uv",new Ut(h.uvs,2));const g=[];for(let S=0,A=f.length;S<A;S++){const b=f[S],N=b.name+"_"+b.smooth+"_"+m;let C=t.materials[N];if(this.materials!==null){if(C=this.materials.create(b.name),u&&C&&!(C instanceof bi)){const P=new bi;Bn.prototype.copy.call(P,C),P.color.copy(C.color),C=P}else if(d&&C&&!(C instanceof Ii)){const P=new Ii({size:10,sizeAttenuation:!1});Bn.prototype.copy.call(P,C),P.color.copy(C.color),P.map=C.map,C=P}}C===void 0&&(u?C=new bi:d?C=new Ii({size:1,sizeAttenuation:!1}):C=new Dn,C.name=b.name,C.flatShading=!b.smooth,C.vertexColors=m,t.materials[N]=C),g.push(C)}let p;if(g.length>1){for(let S=0,A=f.length;S<A;S++){const b=f[S];_.addGroup(b.groupStart,b.groupCount,S)}u?p=new ga(_,g):d?p=new Cs(_,g):p=new en(_,g)}else u?p=new ga(_,g[0]):d?p=new Cs(_,g[0]):p=new en(_,g[0]);p.name=c.name,r.add(p)}else if(t.vertices.length>0){const o=new Ii({size:1,sizeAttenuation:!1}),l=new hn;l.setAttribute("position",new Ut(t.vertices,3)),t.colors.length>0&&t.colors[0]!==void 0&&(l.setAttribute("color",new Ut(t.colors,3)),o.vertexColors=!0);const c=new Cs(l,o);r.add(c)}return r}}class ha extends Qn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=this.path===""?Vl.extractUrlBase(e):this.path,o=new Bs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{t(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(e)}},n,i)}setMaterialOptions(e){return this.materialOptions=e,this}parse(e,t){const n=e.split(`
|
|
4202
|
+
`);let i={};const r=/\s+/,a={};for(let l=0;l<n.length;l++){let c=n[l];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const h=c.indexOf(" ");let f=h>=0?c.substring(0,h):c;f=f.toLowerCase();let u=h>=0?c.substring(h+1):"";if(u=u.trim(),f==="newmtl")i={name:u},a[u]=i;else if(f==="ka"||f==="kd"||f==="ks"||f==="ke"){const d=u.split(r,3);i[f]=[parseFloat(d[0]),parseFloat(d[1]),parseFloat(d[2])]}else i[f]=u}const o=new Zg(this.resourcePath||t,this.materialOptions);return o.setCrossOrigin(this.crossOrigin),o.setManager(this.manager),o.setMaterials(a),o}}class Zg{constructor(e="",t={}){this.baseUrl=e,this.options=t,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:Xn,this.wrap=this.options.wrap!==void 0?this.options.wrap:ai}setCrossOrigin(e){return this.crossOrigin=e,this}setManager(e){this.manager=e}setMaterials(e){this.materialsInfo=this.convert(e),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(e){if(!this.options)return e;const t={};for(const n in e){const i=e[n],r={};t[n]=r;for(const a in i){let o=!0,l=i[a];const c=a.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(l=[l[0]/255,l[1]/255,l[2]/255]),this.options&&this.options.ignoreZeroRGBs&&l[0]===0&&l[1]===0&&l[2]===0&&(o=!1);break}o&&(r[c]=l)}}return t}preload(){for(const e in this.materialsInfo)this.create(e)}getIndex(e){return this.nameLookup[e]}getAsArray(){let e=0;for(const t in this.materialsInfo)this.materialsArray[e]=this.create(t),this.nameLookup[t]=e,e++;return this.materialsArray}create(e){return this.materials[e]===void 0&&this.createMaterial_(e),this.materials[e]}createMaterial_(e){const t=this,n=this.materialsInfo[e],i={name:e,side:this.side};function r(o,l){return typeof l!="string"||l===""?"":/^https?:\/\//i.test(l)?l:o+l}function a(o,l){if(i[o])return;const c=t.getTextureParams(l,i),h=t.loadTexture(r(t.baseUrl,c.url));h.repeat.copy(c.scale),h.offset.copy(c.offset),h.wrapS=t.wrap,h.wrapT=t.wrap,(o==="map"||o==="emissiveMap")&&(h.colorSpace=Qt),i[o]=h}for(const o in n){const l=n[o];let c;if(l!=="")switch(o.toLowerCase()){case"kd":i.color=Wt.colorSpaceToWorking(new xt().fromArray(l),Qt);break;case"ks":i.specular=Wt.colorSpaceToWorking(new xt().fromArray(l),Qt);break;case"ke":i.emissive=Wt.colorSpaceToWorking(new xt().fromArray(l),Qt);break;case"map_kd":a("map",l);break;case"map_ks":a("specularMap",l);break;case"map_ke":a("emissiveMap",l);break;case"norm":a("normalMap",l);break;case"map_bump":case"bump":a("bumpMap",l);break;case"disp":a("displacementMap",l);break;case"map_d":a("alphaMap",l),i.transparent=!0;break;case"ns":i.shininess=parseFloat(l);break;case"d":c=parseFloat(l),c<1&&(i.opacity=c,i.transparent=!0);break;case"tr":c=parseFloat(l),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(i.opacity=1-c,i.transparent=!0);break}}return this.materials[e]=new Dn(i),this.materials[e]}getTextureParams(e,t){const n={scale:new Qe(1,1),offset:new Qe(0,0)},i=e.split(/\s+/);let r;return r=i.indexOf("-bm"),r>=0&&(t.bumpScale=parseFloat(i[r+1]),i.splice(r,2)),r=i.indexOf("-mm"),r>=0&&(t.displacementBias=parseFloat(i[r+1]),t.displacementScale=parseFloat(i[r+2]),i.splice(r,3)),r=i.indexOf("-s"),r>=0&&(n.scale.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),r=i.indexOf("-o"),r>=0&&(n.offset.set(parseFloat(i[r+1]),parseFloat(i[r+2])),i.splice(r,4)),n.url=i.join(" ").trim(),n}loadTexture(e,t,n,i,r){const a=this.manager!==void 0?this.manager:zl;let o=a.getHandler(e);o===null&&(o=new Bl(a)),o.setCrossOrigin&&o.setCrossOrigin(this.crossOrigin);const l=o.load(e,n,i,r);return t!==void 0&&(l.mapping=t),l}}class nr extends Qn{constructor(e){super(e)}load(e,t,n,i){const r=this,a=new Bs(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}parse(e){function t(c){const h=new DataView(c),f=32/8*3+32/8*3*3+16/8,u=h.getUint32(80,!0);if(80+32/8+u*f===h.byteLength)return!0;const m=[115,111,108,105,100];for(let _=0;_<5;_++)if(n(m,h,_))return!1;return!0}function n(c,h,f){for(let u=0,d=c.length;u<d;u++)if(c[u]!==h.getUint8(f+u))return!1;return!0}function i(c){const h=new DataView(c),f=h.getUint32(80,!0);let u,d,m,_=!1,g,p,S,A,b;for(let U=0;U<70;U++)h.getUint32(U,!1)==1129270351&&h.getUint8(U+4)==82&&h.getUint8(U+5)==61&&(_=!0,g=new Float32Array(f*3*3),p=h.getUint8(U+6)/255,S=h.getUint8(U+7)/255,A=h.getUint8(U+8)/255,b=h.getUint8(U+9)/255);const N=84,C=12*4+2,P=new hn,D=new Float32Array(f*3*3),E=new Float32Array(f*3*3),y=new xt;for(let U=0;U<f;U++){const G=N+U*C,X=h.getFloat32(G,!0),Z=h.getFloat32(G+4,!0),ie=h.getFloat32(G+8,!0);if(_){const H=h.getUint16(G+48,!0);(H&32768)===0?(u=(H&31)/31,d=(H>>5&31)/31,m=(H>>10&31)/31):(u=p,d=S,m=A)}for(let H=1;H<=3;H++){const oe=G+H*12,Y=U*3*3+(H-1)*3;D[Y]=h.getFloat32(oe,!0),D[Y+1]=h.getFloat32(oe+4,!0),D[Y+2]=h.getFloat32(oe+8,!0),E[Y]=X,E[Y+1]=Z,E[Y+2]=ie,_&&(y.setRGB(u,d,m,Qt),g[Y]=y.r,g[Y+1]=y.g,g[Y+2]=y.b)}}return P.setAttribute("position",new dn(D,3)),P.setAttribute("normal",new dn(E,3)),_&&(P.setAttribute("color",new dn(g,3)),P.hasColors=!0,P.alpha=b),P}function r(c){const h=new hn,f=/solid([\s\S]*?)endsolid/g,u=/facet([\s\S]*?)endfacet/g,d=/solid\s(.+)/;let m=0;const _=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,g=new RegExp("vertex"+_+_+_,"g"),p=new RegExp("normal"+_+_+_,"g"),S=[],A=[],b=[],N=new F;let C,P=0,D=0,E=0;for(;(C=f.exec(c))!==null;){D=E;const y=C[0],U=(C=d.exec(y))!==null?C[1]:"";for(b.push(U);(C=u.exec(y))!==null;){let Z=0,ie=0;const H=C[0];for(;(C=p.exec(H))!==null;)N.x=parseFloat(C[1]),N.y=parseFloat(C[2]),N.z=parseFloat(C[3]),ie++;for(;(C=g.exec(H))!==null;)S.push(parseFloat(C[1]),parseFloat(C[2]),parseFloat(C[3])),A.push(N.x,N.y,N.z),Z++,E++;ie!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+m),Z!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+m),m++}const G=D,X=E-D;h.userData.groupNames=b,h.addGroup(G,X,P),P++}return h.setAttribute("position",new Ut(S,3)),h.setAttribute("normal",new Ut(A,3)),h}function a(c){return typeof c!="string"?new TextDecoder().decode(c):c}function o(c){if(typeof c=="string"){const h=new Uint8Array(c.length);for(let f=0;f<c.length;f++)h[f]=c.charCodeAt(f)&255;return h.buffer||h}else return c}const l=o(e);return t(l)?i(l):r(a(e))}}class zu extends Qn{constructor(e){super(e),this.littleEndian=!0}load(e,t,n,i){const r=this,a=new Bs(r.manager);a.setPath(r.path),a.setResponseType("arraybuffer"),a.setRequestHeader(r.requestHeader),a.setWithCredentials(r.withCredentials),a.load(e,function(o){try{t(r.parse(o))}catch(l){i?i(l):console.error(l),r.manager.itemError(e)}},n,i)}_getDataView(e,t,n,i){switch(n){case"F":return i===8?e.getFloat64(t,this.littleEndian):e.getFloat32(t,this.littleEndian);case"I":return i===1?e.getInt8(t):i===2?e.getInt16(t,this.littleEndian):e.getInt32(t,this.littleEndian);case"U":return i===1?e.getUint8(t):i===2?e.getUint16(t,this.littleEndian):e.getUint32(t,this.littleEndian)}}parse(e){function t(d,m){const _=d.length,g=new Uint8Array(m);let p=0,S=0,A,b,N;do if(A=d[p++],A<32){if(A++,S+A>m)throw new Error("Output buffer is not large enough");if(p+A>_)throw new Error("Invalid compressed data");do g[S++]=d[p++];while(--A)}else{if(b=A>>5,N=S-((A&31)<<8)-1,p>=_)throw new Error("Invalid compressed data");if(b===7&&(b+=d[p++],p>=_))throw new Error("Invalid compressed data");if(N-=d[p++],S+b+2>m)throw new Error("Output buffer is not large enough");if(N<0)throw new Error("Invalid compressed data");if(N>=S)throw new Error("Invalid compressed data");do g[S++]=g[N++];while(--b+2)}while(p<_);return g}function n(d){const m={},_=new Uint8Array(d);let g="",p="",S=0,A=!1;const b=_.length;for(;S<b&&A===!1;){const D=String.fromCharCode(_[S++]);D===`
|
|
4203
|
+
`||D==="\r"?(p.trim().toLowerCase().startsWith("data")&&(A=!0),p=""):p+=D,g+=D}const N=g.search(/[\r\n]DATA\s(\S*)\s/i),C=/[\r\n]DATA\s(\S*)\s/i.exec(g.slice(N-1));if(m.data=C[1],m.headerLen=C[0].length+N,m.str=g.slice(0,m.headerLen),m.str=m.str.replace(/#.*/gi,""),m.version=/^VERSION (.*)/im.exec(m.str),m.fields=/^FIELDS (.*)/im.exec(m.str),m.size=/^SIZE (.*)/im.exec(m.str),m.type=/^TYPE (.*)/im.exec(m.str),m.count=/^COUNT (.*)/im.exec(m.str),m.width=/^WIDTH (.*)/im.exec(m.str),m.height=/^HEIGHT (.*)/im.exec(m.str),m.viewpoint=/^VIEWPOINT (.*)/im.exec(m.str),m.points=/^POINTS (.*)/im.exec(m.str),m.version!==null&&(m.version=parseFloat(m.version[1])),m.fields=m.fields!==null?m.fields[1].split(" "):[],m.type!==null&&(m.type=m.type[1].split(" ")),m.width!==null&&(m.width=parseInt(m.width[1])),m.height!==null&&(m.height=parseInt(m.height[1])),m.viewpoint!==null&&(m.viewpoint=m.viewpoint[1]),m.points!==null&&(m.points=parseInt(m.points[1],10)),m.points===null&&(m.points=m.width*m.height),m.size!==null&&(m.size=m.size[1].split(" ").map(function(D){return parseInt(D,10)})),m.count!==null)m.count=m.count[1].split(" ").map(function(D){return parseInt(D,10)});else{m.count=[];for(let D=0,E=m.fields.length;D<E;D++)m.count.push(1)}m.offset={};let P=0;for(let D=0,E=m.fields.length;D<E;D++)m.data==="ascii"?m.offset[m.fields[D]]=D:(m.offset[m.fields[D]]=P,P+=m.size[D]*m.count[D]);return m.rowSize=P,m}const i=n(e),r=[],a=[],o=[],l=[],c=[],h=new xt;if(i.data==="ascii"){const d=i.offset,g=new TextDecoder().decode(e).slice(i.headerLen).split(`
|
|
4204
|
+
`);for(let p=0,S=g.length;p<S;p++){if(g[p]==="")continue;const A=g[p].split(" ");if(d.x!==void 0&&(r.push(parseFloat(A[d.x])),r.push(parseFloat(A[d.y])),r.push(parseFloat(A[d.z]))),d.rgb!==void 0){const b=i.fields.findIndex(U=>U==="rgb"),N=i.type[b],C=parseFloat(A[d.rgb]);let P=C;if(N==="F"){const U=new Float32Array(1);U[0]=C,P=new Int32Array(U.buffer)[0]}const D=(P>>16&255)/255,E=(P>>8&255)/255,y=(P>>0&255)/255;h.setRGB(D,E,y,Qt),o.push(h.r,h.g,h.b)}d.normal_x!==void 0&&(a.push(parseFloat(A[d.normal_x])),a.push(parseFloat(A[d.normal_y])),a.push(parseFloat(A[d.normal_z]))),d.intensity!==void 0&&l.push(parseFloat(A[d.intensity])),d.label!==void 0&&c.push(parseInt(A[d.label]))}}if(i.data==="binary_compressed"){const d=new Uint32Array(e.slice(i.headerLen,i.headerLen+8)),m=d[0],_=d[1],g=t(new Uint8Array(e,i.headerLen+8,m),_),p=new DataView(g.buffer),S=i.offset;for(let A=0;A<i.points;A++){if(S.x!==void 0){const b=i.fields.indexOf("x"),N=i.fields.indexOf("y"),C=i.fields.indexOf("z");r.push(this._getDataView(p,i.points*S.x+i.size[b]*A,i.type[b],i.size[b])),r.push(this._getDataView(p,i.points*S.y+i.size[N]*A,i.type[N],i.size[N])),r.push(this._getDataView(p,i.points*S.z+i.size[C]*A,i.type[C],i.size[C]))}if(S.rgb!==void 0){const b=i.fields.indexOf("rgb"),N=p.getUint8(i.points*S.rgb+i.size[b]*A+2)/255,C=p.getUint8(i.points*S.rgb+i.size[b]*A+1)/255,P=p.getUint8(i.points*S.rgb+i.size[b]*A+0)/255;h.setRGB(N,C,P,Qt),o.push(h.r,h.g,h.b)}if(S.normal_x!==void 0){const b=i.fields.indexOf("normal_x"),N=i.fields.indexOf("normal_y"),C=i.fields.indexOf("normal_z");a.push(this._getDataView(p,i.points*S.normal_x+i.size[b]*A,i.type[b],i.size[b])),a.push(this._getDataView(p,i.points*S.normal_y+i.size[N]*A,i.type[N],i.size[N])),a.push(this._getDataView(p,i.points*S.normal_z+i.size[C]*A,i.type[C],i.size[C]))}if(S.intensity!==void 0){const b=i.fields.indexOf("intensity");l.push(this._getDataView(p,i.points*S.intensity+i.size[b]*A,i.type[b],i.size[b]))}if(S.label!==void 0){const b=i.fields.indexOf("label");c.push(p.getInt32(i.points*S.label+i.size[b]*A,this.littleEndian))}}}if(i.data==="binary"){const d=new DataView(e,i.headerLen),m=i.offset;for(let _=0,g=0;_<i.points;_++,g+=i.rowSize){if(m.x!==void 0){const p=i.fields.indexOf("x"),S=i.fields.indexOf("y"),A=i.fields.indexOf("z");r.push(this._getDataView(d,g+m.x,i.type[p],i.size[p])),r.push(this._getDataView(d,g+m.y,i.type[S],i.size[S])),r.push(this._getDataView(d,g+m.z,i.type[A],i.size[A]))}if(m.rgb!==void 0){const p=d.getUint8(g+m.rgb+2)/255,S=d.getUint8(g+m.rgb+1)/255,A=d.getUint8(g+m.rgb+0)/255;h.setRGB(p,S,A,Qt),o.push(h.r,h.g,h.b)}if(m.normal_x!==void 0){const p=i.fields.indexOf("normal_x"),S=i.fields.indexOf("normal_y"),A=i.fields.indexOf("normal_z");a.push(this._getDataView(d,g+m.normal_x,i.type[p],i.size[p])),a.push(this._getDataView(d,g+m.normal_y,i.type[S],i.size[S])),a.push(this._getDataView(d,g+m.normal_z,i.type[A],i.size[A]))}if(m.intensity!==void 0){const p=i.fields.indexOf("intensity");l.push(this._getDataView(d,g+m.intensity,i.type[p],i.size[p]))}m.label!==void 0&&c.push(d.getInt32(g+m.label,this.littleEndian))}}const f=new hn;r.length>0&&f.setAttribute("position",new Ut(r,3)),a.length>0&&f.setAttribute("normal",new Ut(a,3)),o.length>0&&f.setAttribute("color",new Ut(o,3)),l.length>0&&f.setAttribute("intensity",new Ut(l,1)),c.length>0&&f.setAttribute("label",new Nf(c,1)),f.computeBoundingSphere();const u=new Ii({size:.005});return o.length>0&&(u.vertexColors=!0),new Cs(f,u)}}class Fh extends Ap{constructor(e){super(e)}parse(e){function t(H){switch(H.image_type){case u:case _:if(H.colormap_length>256||H.colormap_size!==24||H.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case d:case m:case g:case p:if(H.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case f:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+H.image_type)}if(H.width<=0||H.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(H.pixel_size!==8&&H.pixel_size!==16&&H.pixel_size!==24&&H.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+H.pixel_size)}function n(H,oe,Y,me,Me){let Ce,Ye;const Oe=Y.pixel_size>>3,K=Y.width*Y.height*Oe;if(oe&&(Ye=Me.subarray(me,me+=Y.colormap_length*(Y.colormap_size>>3))),H){Ce=new Uint8Array(K);let te,re,ae,Ie=0;const ge=new Uint8Array(Oe);for(;Ie<K;)if(te=Me[me++],re=(te&127)+1,te&128){for(ae=0;ae<Oe;++ae)ge[ae]=Me[me++];for(ae=0;ae<re;++ae)Ce.set(ge,Ie+ae*Oe);Ie+=Oe*re}else{for(re*=Oe,ae=0;ae<re;++ae)Ce[Ie+ae]=Me[me++];Ie+=re}}else Ce=Me.subarray(me,me+=oe?Y.width*Y.height:K);return{pixel_data:Ce,palettes:Ye}}function i(H,oe,Y,me,Me,Ce,Ye,Oe,K){const te=K;let re,ae=0,Ie,ge;const Re=y.width;for(ge=oe;ge!==me;ge+=Y)for(Ie=Me;Ie!==Ye;Ie+=Ce,ae++)re=Oe[ae],H[(Ie+Re*ge)*4+3]=255,H[(Ie+Re*ge)*4+2]=te[re*3+0],H[(Ie+Re*ge)*4+1]=te[re*3+1],H[(Ie+Re*ge)*4+0]=te[re*3+2];return H}function r(H,oe,Y,me,Me,Ce,Ye,Oe){let K,te=0,re,ae;const Ie=y.width;for(ae=oe;ae!==me;ae+=Y)for(re=Me;re!==Ye;re+=Ce,te+=2)K=Oe[te+0]+(Oe[te+1]<<8),H[(re+Ie*ae)*4+0]=(K&31744)>>7,H[(re+Ie*ae)*4+1]=(K&992)>>2,H[(re+Ie*ae)*4+2]=(K&31)<<3,H[(re+Ie*ae)*4+3]=K&32768?0:255;return H}function a(H,oe,Y,me,Me,Ce,Ye,Oe){let K=0,te,re;const ae=y.width;for(re=oe;re!==me;re+=Y)for(te=Me;te!==Ye;te+=Ce,K+=3)H[(te+ae*re)*4+3]=255,H[(te+ae*re)*4+2]=Oe[K+0],H[(te+ae*re)*4+1]=Oe[K+1],H[(te+ae*re)*4+0]=Oe[K+2];return H}function o(H,oe,Y,me,Me,Ce,Ye,Oe){let K=0,te,re;const ae=y.width;for(re=oe;re!==me;re+=Y)for(te=Me;te!==Ye;te+=Ce,K+=4)H[(te+ae*re)*4+2]=Oe[K+0],H[(te+ae*re)*4+1]=Oe[K+1],H[(te+ae*re)*4+0]=Oe[K+2],H[(te+ae*re)*4+3]=Oe[K+3];return H}function l(H,oe,Y,me,Me,Ce,Ye,Oe){let K,te=0,re,ae;const Ie=y.width;for(ae=oe;ae!==me;ae+=Y)for(re=Me;re!==Ye;re+=Ce,te++)K=Oe[te],H[(re+Ie*ae)*4+0]=K,H[(re+Ie*ae)*4+1]=K,H[(re+Ie*ae)*4+2]=K,H[(re+Ie*ae)*4+3]=255;return H}function c(H,oe,Y,me,Me,Ce,Ye,Oe){let K=0,te,re;const ae=y.width;for(re=oe;re!==me;re+=Y)for(te=Me;te!==Ye;te+=Ce,K+=2)H[(te+ae*re)*4+0]=Oe[K+0],H[(te+ae*re)*4+1]=Oe[K+0],H[(te+ae*re)*4+2]=Oe[K+0],H[(te+ae*re)*4+3]=Oe[K+1];return H}function h(H,oe,Y,me,Me){let Ce,Ye,Oe,K,te,re;switch((y.flags&S)>>A){default:case C:Ce=0,Oe=1,te=oe,Ye=0,K=1,re=Y;break;case b:Ce=0,Oe=1,te=oe,Ye=Y-1,K=-1,re=-1;break;case P:Ce=oe-1,Oe=-1,te=-1,Ye=0,K=1,re=Y;break;case N:Ce=oe-1,Oe=-1,te=-1,Ye=Y-1,K=-1,re=-1;break}if(X)switch(y.pixel_size){case 8:l(H,Ye,K,re,Ce,Oe,te,me);break;case 16:c(H,Ye,K,re,Ce,Oe,te,me);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(y.pixel_size){case 8:i(H,Ye,K,re,Ce,Oe,te,me,Me);break;case 16:r(H,Ye,K,re,Ce,Oe,te,me);break;case 24:a(H,Ye,K,re,Ce,Oe,te,me);break;case 32:o(H,Ye,K,re,Ce,Oe,te,me);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return H}const f=0,u=1,d=2,m=3,_=9,g=10,p=11,S=48,A=4,b=0,N=1,C=2,P=3;if(e.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let D=0;const E=new Uint8Array(e),y={id_length:E[D++],colormap_type:E[D++],image_type:E[D++],colormap_index:E[D++]|E[D++]<<8,colormap_length:E[D++]|E[D++]<<8,colormap_size:E[D++],origin:[E[D++]|E[D++]<<8,E[D++]|E[D++]<<8],width:E[D++]|E[D++]<<8,height:E[D++]|E[D++]<<8,pixel_size:E[D++],flags:E[D++]};if(t(y),y.id_length+D>e.length)throw new Error("THREE.TGALoader: No data.");D+=y.id_length;let U=!1,G=!1,X=!1;switch(y.image_type){case _:U=!0,G=!0;break;case u:G=!0;break;case g:U=!0;break;case d:break;case p:U=!0,X=!0;break;case m:X=!0;break}const Z=new Uint8Array(y.width*y.height*4),ie=n(U,G,y,D,E);return h(Z,y.width,y.height,ie.pixel_data,ie.palettes),{data:Z,width:y.width,height:y.height,flipY:!0,generateMipmaps:!0,minFilter:xi}}}class Qg extends Qn{load(e,t,n,i){const r=this,a=r.path===""?Vl.extractUrlBase(e):r.path,o=new Bs(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.setWithCredentials(r.withCredentials),o.load(e,function(l){try{t(r.parse(l,a))}catch(c){i?i(c):console.error(c),r.manager.itemError(e)}},n,i)}parse(e,t){function n(x,v){const R=[],T=x.childNodes;for(let L=0,ne=T.length;L<ne;L++){const ue=T[L];ue.nodeName===v&&R.push(ue)}return R}function i(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let T=0,L=v.length;T<L;T++)R[T]=v[T];return R}function r(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let T=0,L=v.length;T<L;T++)R[T]=parseFloat(v[T]);return R}function a(x){if(x.length===0)return[];const v=x.trim().split(/\s+/),R=new Array(v.length);for(let T=0,L=v.length;T<L;T++)R[T]=parseInt(v[T]);return R}function o(x){return x.substring(1)}function l(){return"three_default_"+kn++}function c(x){return Object.keys(x).length===0}function h(x){return{unit:f(n(x,"unit")[0]),upAxis:u(n(x,"up_axis")[0])}}function f(x){return x!==void 0&&x.hasAttribute("meter")===!0?parseFloat(x.getAttribute("meter")):1}function u(x){return x!==void 0?x.textContent:"Y_UP"}function d(x,v,R,T){const L=n(x,v)[0];if(L!==void 0){const ne=n(L,R);for(let ue=0;ue<ne.length;ue++)T(ne[ue])}}function m(x,v){for(const R in x){const T=x[R];T.build=v(x[R])}}function _(x,v){return x.build!==void 0||(x.build=v(x)),x.build}function g(x){const v={sources:{},samplers:{},channels:{}};let R=!1;for(let T=0,L=x.childNodes.length;T<L;T++){const ne=x.childNodes[T];if(ne.nodeType!==1)continue;let ue;switch(ne.nodeName){case"source":ue=ne.getAttribute("id"),v.sources[ue]=ye(ne);break;case"sampler":ue=ne.getAttribute("id"),v.samplers[ue]=p(ne);break;case"channel":ue=ne.getAttribute("target"),v.channels[ue]=S(ne);break;case"animation":g(ne),R=!0;break;default:console.log(ne)}}R===!1&&(St.animations[x.getAttribute("id")||Ki.generateUUID()]=v)}function p(x){const v={inputs:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const ne=o(L.getAttribute("source")),ue=L.getAttribute("semantic");v.inputs[ue]=ne;break}}return v}function S(x){const v={};let T=x.getAttribute("target").split("/");const L=T.shift();let ne=T.shift();const ue=ne.indexOf("(")!==-1,tt=ne.indexOf(".")!==-1;if(tt)T=ne.split("."),ne=T.shift(),v.member=T.shift();else if(ue){const Ve=ne.split("(");ne=Ve.shift();for(let Ke=0;Ke<Ve.length;Ke++)Ve[Ke]=parseInt(Ve[Ke].replace(/\)/,""));v.indices=Ve}return v.id=L,v.sid=ne,v.arraySyntax=ue,v.memberSyntax=tt,v.sampler=o(x.getAttribute("source")),v}function A(x){const v=[],R=x.channels,T=x.samplers,L=x.sources;for(const ne in R)if(R.hasOwnProperty(ne)){const ue=R[ne],tt=T[ue.sampler],Ve=tt.inputs.INPUT,Ke=tt.inputs.OUTPUT,dt=L[Ve],Se=L[Ke],ct=N(ue,dt,Se);y(ct,v)}return v}function b(x){return _(St.animations[x],A)}function N(x,v,R){const T=St.nodes[x.id],L=wt(T.id),ne=T.transforms[x.sid],ue=T.matrix.clone().transpose();let tt,Ve,Ke,dt,Se,ct;const at={};switch(ne){case"matrix":for(Ke=0,dt=v.array.length;Ke<dt;Ke++)if(tt=v.array[Ke],Ve=Ke*R.stride,at[tt]===void 0&&(at[tt]={}),x.arraySyntax===!0){const un=R.array[Ve],sn=x.indices[0]+4*x.indices[1];at[tt][sn]=un}else for(Se=0,ct=R.stride;Se<ct;Se++)at[tt][Se]=R.array[Ve+Se];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ne);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ne);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',ne);break}const Et=C(at,ue);return{name:L.uuid,keyframes:Et}}function C(x,v){const R=[];for(const L in x)R.push({time:parseFloat(L),value:x[L]});R.sort(T);for(let L=0;L<16;L++)U(R,L,v.elements[L]);return R;function T(L,ne){return L.time-ne.time}}const P=new F,D=new F,E=new zn;function y(x,v){const R=x.keyframes,T=x.name,L=[],ne=[],ue=[],tt=[];for(let Ve=0,Ke=R.length;Ve<Ke;Ve++){const dt=R[Ve],Se=dt.time,ct=dt.value;B.fromArray(ct).transpose(),B.decompose(P,E,D),L.push(Se),ne.push(P.x,P.y,P.z),ue.push(E.x,E.y,E.z,E.w),tt.push(D.x,D.y,D.z)}return ne.length>0&&v.push(new Is(T+".position",L,ne)),ue.length>0&&v.push(new ur(T+".quaternion",L,ue)),tt.length>0&&v.push(new Is(T+".scale",L,tt)),v}function U(x,v,R){let T,L=!0,ne,ue;for(ne=0,ue=x.length;ne<ue;ne++)T=x[ne],T.value[v]===void 0?T.value[v]=null:L=!1;if(L===!0)for(ne=0,ue=x.length;ne<ue;ne++)T=x[ne],T.value[v]=R;else G(x,v)}function G(x,v){let R,T;for(let L=0,ne=x.length;L<ne;L++){const ue=x[L];if(ue.value[v]===null){if(R=X(x,L,v),T=Z(x,L,v),R===null){ue.value[v]=T.value[v];continue}if(T===null){ue.value[v]=R.value[v];continue}ie(ue,R,T,v)}}}function X(x,v,R){for(;v>=0;){const T=x[v];if(T.value[R]!==null)return T;v--}return null}function Z(x,v,R){for(;v<x.length;){const T=x[v];if(T.value[R]!==null)return T;v++}return null}function ie(x,v,R,T){if(R.time-v.time===0){x.value[T]=v.value[T];return}x.value[T]=(x.time-v.time)*(R.value[T]-v.value[T])/(R.time-v.time)+v.value[T]}function H(x){const v={name:x.getAttribute("id")||"default",start:parseFloat(x.getAttribute("start")||0),end:parseFloat(x.getAttribute("end")||0),animations:[]};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"instance_animation":v.animations.push(o(L.getAttribute("url")));break}}St.clips[x.getAttribute("id")]=v}function oe(x){const v=[],R=x.name,T=x.end-x.start||-1,L=x.animations;for(let ne=0,ue=L.length;ne<ue;ne++){const tt=b(L[ne]);for(let Ve=0,Ke=tt.length;Ve<Ke;Ve++)v.push(tt[Ve])}return new Bc(R,T,v)}function Y(x){return _(St.clips[x],oe)}function me(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"skin":v.id=o(L.getAttribute("source")),v.skin=Me(L);break;case"morph":v.id=o(L.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}St.controllers[x.getAttribute("id")]=v}function Me(x){const v={sources:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"bind_shape_matrix":v.bindShapeMatrix=r(L.textContent);break;case"source":const ne=L.getAttribute("id");v.sources[ne]=ye(L);break;case"joints":v.joints=Ce(L);break;case"vertex_weights":v.vertexWeights=Ye(L);break}}return v}function Ce(x){const v={inputs:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const ne=L.getAttribute("semantic"),ue=o(L.getAttribute("source"));v.inputs[ne]=ue;break}}return v}function Ye(x){const v={inputs:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const ne=L.getAttribute("semantic"),ue=o(L.getAttribute("source")),tt=parseInt(L.getAttribute("offset"));v.inputs[ne]={id:ue,offset:tt};break;case"vcount":v.vcount=a(L.textContent);break;case"v":v.v=a(L.textContent);break}}return v}function Oe(x){const v={id:x.id},R=St.geometries[v.id];return x.skin!==void 0&&(v.skin=K(x.skin),R.sources.skinIndices=v.skin.indices,R.sources.skinWeights=v.skin.weights),v}function K(x){const R={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},T=x.sources,L=x.vertexWeights,ne=L.vcount,ue=L.v,tt=L.inputs.JOINT.offset,Ve=L.inputs.WEIGHT.offset,Ke=x.sources[x.joints.inputs.JOINT],dt=x.sources[x.joints.inputs.INV_BIND_MATRIX],Se=T[L.inputs.WEIGHT.id].array;let ct=0,at,Et,mt;for(at=0,mt=ne.length;at<mt;at++){const sn=ne[at],Kt=[];for(Et=0;Et<sn;Et++){const Zt=ue[ct+tt],ui=ue[ct+Ve],Pn=Se[ui];Kt.push({index:Zt,weight:Pn}),ct+=2}for(Kt.sort(un),Et=0;Et<4;Et++){const Zt=Kt[Et];Zt!==void 0?(R.indices.array.push(Zt.index),R.weights.array.push(Zt.weight)):(R.indices.array.push(0),R.weights.array.push(0))}}for(x.bindShapeMatrix?R.bindMatrix=new Tt().fromArray(x.bindShapeMatrix).transpose():R.bindMatrix=new Tt().identity(),at=0,mt=Ke.array.length;at<mt;at++){const sn=Ke.array[at],Kt=new Tt().fromArray(dt.array,at*dt.stride).transpose();R.joints.push({name:sn,boneInverse:Kt})}return R;function un(sn,Kt){return Kt.weight-sn.weight}}function te(x){return _(St.controllers[x],Oe)}function re(x){const v={init_from:n(x,"init_from")[0].textContent};St.images[x.getAttribute("id")]=v}function ae(x){return x.build!==void 0?x.build:x.init_from}function Ie(x){const v=St.images[x];return v!==void 0?_(v,ae):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",x),null)}function ge(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"profile_COMMON":v.profile=Re(L);break}}St.effects[x.getAttribute("id")]=v}function Re(x){const v={surfaces:{},samplers:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"newparam":nt(L,v);break;case"technique":v.technique=z(L);break;case"extra":v.extra=je(L);break}}return v}function nt(x,v){const R=x.getAttribute("sid");for(let T=0,L=x.childNodes.length;T<L;T++){const ne=x.childNodes[T];if(ne.nodeType===1)switch(ne.nodeName){case"surface":v.surfaces[R]=yt(ne);break;case"sampler2D":v.samplers[R]=At(ne);break}}}function yt(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"init_from":v.init_from=L.textContent;break}}return v}function At(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"source":v.source=L.textContent;break}}return v}function z(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"constant":case"lambert":case"blinn":case"phong":v.type=L.nodeName,v.parameters=Ot(L);break;case"extra":v.extra=je(L);break}}return v}function Ot(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":v[L.nodeName]=Pt(L);break;case"transparent":v[L.nodeName]={opaque:L.hasAttribute("opaque")?L.getAttribute("opaque"):"A_ONE",data:Pt(L)};break}}return v}function Pt(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"color":v[L.nodeName]=r(L.textContent);break;case"float":v[L.nodeName]=parseFloat(L.textContent);break;case"texture":v[L.nodeName]={id:L.getAttribute("texture"),extra:Ct(L)};break}}return v}function Ct(x){const v={technique:{}};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"extra":Xe(L,v);break}}return v}function Xe(x,v){for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"technique":gt(L,v);break}}}function gt(x,v){for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":v.technique[L.nodeName]=parseFloat(L.textContent);break;case"wrapU":case"wrapV":L.textContent.toUpperCase()==="TRUE"?v.technique[L.nodeName]=1:L.textContent.toUpperCase()==="FALSE"?v.technique[L.nodeName]=0:v.technique[L.nodeName]=parseInt(L.textContent);break;case"bump":v[L.nodeName]=ln(L);break}}}function je(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"technique":v.technique=_t(L);break}}return v}function _t(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"double_sided":v[L.nodeName]=parseInt(L.textContent);break;case"bump":v[L.nodeName]=ln(L);break}}return v}function ln(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"texture":v[L.nodeName]={id:L.getAttribute("texture"),texcoord:L.getAttribute("texcoord"),extra:Ct(L)};break}}return v}function O(x){return x}function w(x){return _(St.effects[x],O)}function ee(x){const v={name:x.getAttribute("name")};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"instance_effect":v.url=o(L.getAttribute("url"));break}}St.materials[x.getAttribute("id")]=v}function de(x){let v,R=x.slice((x.lastIndexOf(".")-1>>>0)+2);switch(R=R.toLowerCase(),R){case"tga":v=$t;break;default:v=cn}return v}function _e(x){const v=w(x.url),R=v.profile.technique;let T;switch(R.type){case"phong":case"blinn":T=new Dn;break;case"lambert":T=new dp;break;default:T=new zi;break}T.name=x.name||"";function L(Ve,Ke=null){const dt=v.profile.samplers[Ve.id];let Se=null;if(dt!==void 0){const ct=v.profile.surfaces[dt.source];Se=Ie(ct.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),Se=Ie(Ve.id);if(Se!==null){const ct=de(Se);if(ct!==void 0){const at=ct.load(Se),Et=Ve.extra;if(Et!==void 0&&Et.technique!==void 0&&c(Et.technique)===!1){const mt=Et.technique;at.wrapS=mt.wrapU?ai:Jn,at.wrapT=mt.wrapV?ai:Jn,at.offset.set(mt.offsetU||0,mt.offsetV||0),at.repeat.set(mt.repeatU||1,mt.repeatV||1)}else at.wrapS=ai,at.wrapT=ai;return Ke!==null&&(at.colorSpace=Ke),at}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",Se),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Ve.id),null}const ne=R.parameters;for(const Ve in ne){const Ke=ne[Ve];switch(Ve){case"diffuse":Ke.color&&T.color.fromArray(Ke.color),Ke.texture&&(T.map=L(Ke.texture,Qt));break;case"specular":Ke.color&&T.specular&&T.specular.fromArray(Ke.color),Ke.texture&&(T.specularMap=L(Ke.texture));break;case"bump":Ke.texture&&(T.normalMap=L(Ke.texture));break;case"ambient":Ke.texture&&(T.lightMap=L(Ke.texture,Qt));break;case"shininess":Ke.float&&T.shininess&&(T.shininess=Ke.float);break;case"emission":Ke.color&&T.emissive&&T.emissive.fromArray(Ke.color),Ke.texture&&(T.emissiveMap=L(Ke.texture,Qt));break}}Wt.colorSpaceToWorking(T.color,Qt),T.specular&&Wt.colorSpaceToWorking(T.specular,Qt),T.emissive&&Wt.colorSpaceToWorking(T.emissive,Qt);let ue=ne.transparent,tt=ne.transparency;if(tt===void 0&&ue&&(tt={float:1}),ue===void 0&&tt&&(ue={opaque:"A_ONE",data:{color:[1,1,1,1]}}),ue&&tt)if(ue.data.texture)T.transparent=!0;else{const Ve=ue.data.color;switch(ue.opaque){case"A_ONE":T.opacity=Ve[3]*tt.float;break;case"RGB_ZERO":T.opacity=1-Ve[0]*tt.float;break;case"A_ZERO":T.opacity=1-Ve[3]*tt.float;break;case"RGB_ONE":T.opacity=Ve[0]*tt.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',ue.opaque)}T.opacity<1&&(T.transparent=!0)}if(R.extra!==void 0&&R.extra.technique!==void 0){const Ve=R.extra.technique;for(const Ke in Ve){const dt=Ve[Ke];switch(Ke){case"double_sided":T.side=dt===1?wn:Xn;break;case"bump":T.normalMap=L(dt.texture),T.normalScale=new Qe(1,1);break}}}return T}function le(x){return _(St.materials[x],_e)}function lt(x){const v={name:x.getAttribute("name")};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"optics":v.optics=He(L);break}}St.cameras[x.getAttribute("id")]=v}function He(x){for(let v=0;v<x.childNodes.length;v++){const R=x.childNodes[v];switch(R.nodeName){case"technique_common":return st(R)}}return{}}function st(x){const v={};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];switch(T.nodeName){case"perspective":case"orthographic":v.technique=T.nodeName,v.parameters=ot(T);break}}return v}function ot(x){const v={};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];switch(T.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":v[T.nodeName]=parseFloat(T.textContent);break}}return v}function ve(x){let v;switch(x.optics.technique){case"perspective":v=new bn(x.optics.parameters.yfov,x.optics.parameters.aspect_ratio,x.optics.parameters.znear,x.optics.parameters.zfar);break;case"orthographic":let R=x.optics.parameters.ymag,T=x.optics.parameters.xmag;const L=x.optics.parameters.aspect_ratio;T=T===void 0?R*L:T,R=R===void 0?T/L:R,T*=.5,R*=.5,v=new Ta(-T,T,R,-R,x.optics.parameters.znear,x.optics.parameters.zfar);break;default:v=new bn;break}return v.name=x.name||"",v}function Ze(x){const v=St.cameras[x];return v!==void 0?_(v,ve):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",x),null)}function Mt(x){let v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"technique_common":v=ft(L);break}}St.lights[x.getAttribute("id")]=v}function ft(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"directional":case"point":case"spot":case"ambient":v.technique=L.nodeName,v.parameters=Ge(L)}}return v}function Ge(x){const v={};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"color":const ne=r(L.textContent);v.color=new xt().fromArray(ne),Wt.colorSpaceToWorking(v.color,Qt);break;case"falloff_angle":v.falloffAngle=parseFloat(L.textContent);break;case"quadratic_attenuation":const ue=parseFloat(L.textContent);v.distance=ue?Math.sqrt(1/ue):0;break}}return v}function Rt(x){let v;switch(x.technique){case"directional":v=new Au;break;case"point":v=new Eu;break;case"spot":v=new Cp;break;case"ambient":v=new wu;break}return x.parameters.color&&v.color.copy(x.parameters.color),x.parameters.distance&&(v.distance=x.parameters.distance),v}function q(x){const v=St.lights[x];return v!==void 0?_(v,Rt):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",x),null)}function qe(x){const v={name:x.getAttribute("name"),sources:{},vertices:{},primitives:[]},R=n(x,"mesh")[0];if(R!==void 0){for(let T=0;T<R.childNodes.length;T++){const L=R.childNodes[T];if(L.nodeType!==1)continue;const ne=L.getAttribute("id");switch(L.nodeName){case"source":v.sources[ne]=ye(L);break;case"vertices":v.vertices=et(L);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",L.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":v.primitives.push(Ae(L));break;default:console.log(L)}}St.geometries[x.getAttribute("id")]=v}}function ye(x){const v={array:[],stride:3};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"float_array":v.array=r(T.textContent);break;case"Name_array":v.array=i(T.textContent);break;case"technique_common":const L=n(T,"accessor")[0];L!==void 0&&(v.stride=parseInt(L.getAttribute("stride")));break}}return v}function et(x){const v={};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];T.nodeType===1&&(v[T.getAttribute("semantic")]=o(T.getAttribute("source")))}return v}function Ae(x){const v={type:x.nodeName,material:x.getAttribute("material"),count:parseInt(x.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let R=0,T=x.childNodes.length;R<T;R++){const L=x.childNodes[R];if(L.nodeType===1)switch(L.nodeName){case"input":const ne=o(L.getAttribute("source")),ue=L.getAttribute("semantic"),tt=parseInt(L.getAttribute("offset")),Ve=parseInt(L.getAttribute("set")),Ke=Ve>0?ue+Ve:ue;v.inputs[Ke]={id:ne,offset:tt},v.stride=Math.max(v.stride,tt+1),ue==="TEXCOORD"&&(v.hasUV=!0);break;case"vcount":v.vcount=a(L.textContent);break;case"p":v.p=a(L.textContent);break}}return v}function I(x){const v={};for(let R=0;R<x.length;R++){const T=x[R];v[T.type]===void 0&&(v[T.type]=[]),v[T.type].push(T)}return v}function k(x){let v=0;for(let R=0,T=x.length;R<T;R++)x[R].hasUV===!0&&v++;v>0&&v<x.length&&(x.uvsNeedsFix=!0)}function Q(x){const v={},R=x.sources,T=x.vertices,L=x.primitives;if(L.length===0)return{};const ne=I(L);for(const ue in ne){const tt=ne[ue];k(tt),v[ue]=pe(tt,R,T)}return v}function pe(x,v,R){const T={},L={array:[],stride:0},ne={array:[],stride:0},ue={array:[],stride:0},tt={array:[],stride:0},Ve={array:[],stride:0},Ke={array:[],stride:4},dt={array:[],stride:4},Se=new hn,ct=[];let at=0;for(let Et=0;Et<x.length;Et++){const mt=x[Et],un=mt.inputs;let sn=0;switch(mt.type){case"lines":case"linestrips":sn=mt.count*2;break;case"triangles":sn=mt.count*3;break;case"polylist":for(let Kt=0;Kt<mt.count;Kt++){const Zt=mt.vcount[Kt];switch(Zt){case 3:sn+=3;break;case 4:sn+=6;break;default:sn+=(Zt-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",mt.type)}Se.addGroup(at,sn,Et),at+=sn,mt.material&&ct.push(mt.material);for(const Kt in un){const Zt=un[Kt];switch(Kt){case"VERTEX":for(const ui in R){const Pn=R[ui];switch(ui){case"POSITION":const is=L.array.length;if(se(mt,v[Pn],Zt.offset,L.array),L.stride=v[Pn].stride,v.skinWeights&&v.skinIndices&&(se(mt,v.skinIndices,Zt.offset,Ke.array),se(mt,v.skinWeights,Zt.offset,dt.array)),mt.hasUV===!1&&x.uvsNeedsFix===!0){const Ju=(L.array.length-is)/L.stride;for(let ql=0;ql<Ju;ql++)ue.array.push(0,0)}break;case"NORMAL":se(mt,v[Pn],Zt.offset,ne.array),ne.stride=v[Pn].stride;break;case"COLOR":se(mt,v[Pn],Zt.offset,Ve.array),Ve.stride=v[Pn].stride;break;case"TEXCOORD":se(mt,v[Pn],Zt.offset,ue.array),ue.stride=v[Pn].stride;break;case"TEXCOORD1":se(mt,v[Pn],Zt.offset,tt.array),ue.stride=v[Pn].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',ui)}}break;case"NORMAL":se(mt,v[Zt.id],Zt.offset,ne.array),ne.stride=v[Zt.id].stride;break;case"COLOR":se(mt,v[Zt.id],Zt.offset,Ve.array,!0),Ve.stride=v[Zt.id].stride;break;case"TEXCOORD":se(mt,v[Zt.id],Zt.offset,ue.array),ue.stride=v[Zt.id].stride;break;case"TEXCOORD1":se(mt,v[Zt.id],Zt.offset,tt.array),tt.stride=v[Zt.id].stride;break}}}return L.array.length>0&&Se.setAttribute("position",new Ut(L.array,L.stride)),ne.array.length>0&&Se.setAttribute("normal",new Ut(ne.array,ne.stride)),Ve.array.length>0&&Se.setAttribute("color",new Ut(Ve.array,Ve.stride)),ue.array.length>0&&Se.setAttribute("uv",new Ut(ue.array,ue.stride)),tt.array.length>0&&Se.setAttribute("uv1",new Ut(tt.array,tt.stride)),Ke.array.length>0&&Se.setAttribute("skinIndex",new Ut(Ke.array,Ke.stride)),dt.array.length>0&&Se.setAttribute("skinWeight",new Ut(dt.array,dt.stride)),T.data=Se,T.type=x[0].type,T.materialKeys=ct,T}function se(x,v,R,T,L=!1){const ne=x.p,ue=x.stride,tt=x.vcount;function Ve(Se){let ct=ne[Se+R]*dt;const at=ct+dt;for(;ct<at;ct++)T.push(Ke[ct]);if(L){const Et=T.length-dt-1;Jt.setRGB(T[Et+0],T[Et+1],T[Et+2],Qt),T[Et+0]=Jt.r,T[Et+1]=Jt.g,T[Et+2]=Jt.b}}const Ke=v.array,dt=v.stride;if(x.vcount!==void 0){let Se=0;for(let ct=0,at=tt.length;ct<at;ct++){const Et=tt[ct];if(Et===4){const mt=Se+ue*0,un=Se+ue*1,sn=Se+ue*2,Kt=Se+ue*3;Ve(mt),Ve(un),Ve(Kt),Ve(un),Ve(sn),Ve(Kt)}else if(Et===3){const mt=Se+ue*0,un=Se+ue*1,sn=Se+ue*2;Ve(mt),Ve(un),Ve(sn)}else if(Et>4)for(let mt=1,un=Et-2;mt<=un;mt++){const sn=Se+ue*0,Kt=Se+ue*mt,Zt=Se+ue*(mt+1);Ve(sn),Ve(Kt),Ve(Zt)}Se+=ue*Et}}else for(let Se=0,ct=ne.length;Se<ct;Se+=ue)Ve(Se)}function he(x){return _(St.geometries[x],Q)}function we(x){const v={name:x.getAttribute("name")||"",joints:{},links:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"technique_common":ke(T,v);break}}St.kinematicsModels[x.getAttribute("id")]=v}function xe(x){return x.build!==void 0?x.build:x}function Ee(x){return _(St.kinematicsModels[x],xe)}function ke(x,v){for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"joint":v.joints[T.getAttribute("sid")]=$(T);break;case"link":v.links.push(ht(T));break}}}function $(x){let v;for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"prismatic":case"revolute":v=Be(T);break}}return v}function Be(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",axis:new F,limits:{min:0,max:0},type:x.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"axis":const L=r(T.textContent);v.axis.fromArray(L);break;case"limits":const ne=T.getElementsByTagName("max")[0],ue=T.getElementsByTagName("min")[0];v.limits.max=parseFloat(ne.textContent),v.limits.min=parseFloat(ue.textContent);break}}return v.limits.min>=v.limits.max&&(v.static=!0),v.middlePosition=(v.limits.min+v.limits.max)/2,v}function ht(x){const v={sid:x.getAttribute("sid"),name:x.getAttribute("name")||"",attachments:[],transforms:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"attachment_full":v.attachments.push(vt(T));break;case"matrix":case"translate":case"rotate":v.transforms.push(Dt(T));break}}return v}function vt(x){const v={joint:x.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"link":v.links.push(ht(T));break;case"matrix":case"translate":case"rotate":v.transforms.push(Dt(T));break}}return v}function Dt(x){const v={type:x.nodeName},R=r(x.textContent);switch(v.type){case"matrix":v.obj=new Tt,v.obj.fromArray(R).transpose();break;case"translate":v.obj=new F,v.obj.fromArray(R);break;case"rotate":v.obj=new F,v.obj.fromArray(R),v.angle=Ki.degToRad(R[3]);break}return v}function Vt(x){const v={name:x.getAttribute("name")||"",rigidBodies:{}};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"rigid_body":v.rigidBodies[T.getAttribute("name")]={},ut(T,v.rigidBodies[T.getAttribute("name")]);break}}St.physicsModels[x.getAttribute("id")]=v}function ut(x,v){for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"technique_common":pt(T,v);break}}}function pt(x,v){for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"inertia":v.inertia=r(T.textContent);break;case"mass":v.mass=r(T.textContent)[0];break}}}function Te(x){const v={bindJointAxis:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"bind_joint_axis":v.bindJointAxis.push(qt(T));break}}St.kinematicsScenes[o(x.getAttribute("url"))]=v}function qt(x){const v={target:x.getAttribute("target").split("/").pop()};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType===1)switch(T.nodeName){case"axis":const L=T.getElementsByTagName("param")[0];v.axis=L.textContent;const ne=v.axis.split("inst_").pop().split("axis")[0];v.jointIndex=ne.substring(0,ne.length-1);break}}return v}function ze(x){return x.build!==void 0?x.build:x}function Lt(x){return _(St.kinematicsScenes[x],ze)}function De(){const x=Object.keys(St.kinematicsModels)[0],v=Object.keys(St.kinematicsScenes)[0],R=Object.keys(St.visualScenes)[0];if(x===void 0||v===void 0)return;const T=Ee(x),L=Lt(v),ne=fe(R),ue=L.bindJointAxis,tt={};for(let dt=0,Se=ue.length;dt<Se;dt++){const ct=ue[dt],at=Yt.querySelector('[sid="'+ct.target+'"]');if(at){const Et=at.parentElement;Ve(ct.jointIndex,Et)}}function Ve(dt,Se){const ct=Se.getAttribute("name"),at=T.joints[dt];ne.traverse(function(Et){Et.name===ct&&(tt[dt]={object:Et,transforms:Ht(Se),joint:at,position:at.zeroPosition})})}const Ke=new Tt;hi={joints:T&&T.joints,getJointValue:function(dt){const Se=tt[dt];if(Se)return Se.position;console.warn("THREE.ColladaLoader: Joint "+dt+" doesn't exist.")},setJointValue:function(dt,Se){const ct=tt[dt];if(ct){const at=ct.joint;if(Se>at.limits.max||Se<at.limits.min)console.warn("THREE.ColladaLoader: Joint "+dt+" value "+Se+" outside of limits (min: "+at.limits.min+", max: "+at.limits.max+").");else if(at.static)console.warn("THREE.ColladaLoader: Joint "+dt+" is static.");else{const Et=ct.object,mt=at.axis,un=ct.transforms;B.identity();for(let sn=0;sn<un.length;sn++){const Kt=un[sn];if(Kt.sid&&Kt.sid.indexOf(dt)!==-1)switch(at.type){case"revolute":B.multiply(Ke.makeRotationAxis(mt,Ki.degToRad(Se)));break;case"prismatic":B.multiply(Ke.makeTranslation(mt.x*Se,mt.y*Se,mt.z*Se));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+at.type);break}else switch(Kt.type){case"matrix":B.multiply(Kt.obj);break;case"translate":B.multiply(Ke.makeTranslation(Kt.obj.x,Kt.obj.y,Kt.obj.z));break;case"scale":B.scale(Kt.obj);break;case"rotate":B.multiply(Ke.makeRotationAxis(Kt.obj,Kt.angle));break}}Et.matrix.copy(B),Et.matrix.decompose(Et.position,Et.quaternion,Et.scale),tt[dt].position=Se}}else console.log("THREE.ColladaLoader: "+dt+" does not exist.")}}}function Ht(x){const v=[],R=Yt.querySelector('[id="'+x.id+'"]');for(let T=0;T<R.childNodes.length;T++){const L=R.childNodes[T];if(L.nodeType!==1)continue;let ne,ue;switch(L.nodeName){case"matrix":ne=r(L.textContent);const tt=new Tt().fromArray(ne).transpose();v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:tt});break;case"translate":case"scale":ne=r(L.textContent),ue=new F().fromArray(ne),v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:ue});break;case"rotate":ne=r(L.textContent),ue=new F().fromArray(ne);const Ve=Ki.degToRad(ne[3]);v.push({sid:L.getAttribute("sid"),type:L.nodeName,obj:ue,angle:Ve});break}}return v}function M(x){const v=x.getElementsByTagName("node");for(let R=0;R<v.length;R++){const T=v[R];T.hasAttribute("id")===!1&&T.setAttribute("id",l())}}const B=new Tt,j=new F;function J(x){const v={name:x.getAttribute("name")||"",type:x.getAttribute("type"),id:x.getAttribute("id"),sid:x.getAttribute("sid"),matrix:new Tt,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];if(T.nodeType!==1)continue;let L;switch(T.nodeName){case"node":v.nodes.push(T.getAttribute("id")),J(T);break;case"instance_camera":v.instanceCameras.push(o(T.getAttribute("url")));break;case"instance_controller":v.instanceControllers.push(W(T));break;case"instance_light":v.instanceLights.push(o(T.getAttribute("url")));break;case"instance_geometry":v.instanceGeometries.push(W(T));break;case"instance_node":v.instanceNodes.push(o(T.getAttribute("url")));break;case"matrix":L=r(T.textContent),v.matrix.multiply(B.fromArray(L).transpose()),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"translate":L=r(T.textContent),j.fromArray(L),v.matrix.multiply(B.makeTranslation(j.x,j.y,j.z)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"rotate":L=r(T.textContent);const ne=Ki.degToRad(L[3]);v.matrix.multiply(B.makeRotationAxis(j.fromArray(L),ne)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"scale":L=r(T.textContent),v.matrix.scale(j.fromArray(L)),v.transforms[T.getAttribute("sid")]=T.nodeName;break;case"extra":break;default:console.log(T)}}return $e(v.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",v.id):St.nodes[v.id]=v,v}function W(x){const v={id:o(x.getAttribute("url")),materials:{},skeletons:[]};for(let R=0;R<x.childNodes.length;R++){const T=x.childNodes[R];switch(T.nodeName){case"bind_material":const L=T.getElementsByTagName("instance_material");for(let ne=0;ne<L.length;ne++){const ue=L[ne],tt=ue.getAttribute("symbol"),Ve=ue.getAttribute("target");v.materials[tt]=o(Ve)}break;case"skeleton":v.skeletons.push(o(T.textContent));break}}return v}function ce(x,v){const R=[],T=[];let L,ne,ue;for(L=0;L<x.length;L++){const Ke=x[L];let dt;if($e(Ke))dt=wt(Ke),be(dt,v,R);else if(Gt(Ke)){const ct=St.visualScenes[Ke].children;for(let at=0;at<ct.length;at++){const Et=ct[at];if(Et.type==="JOINT"){const mt=wt(Et.id);be(mt,v,R)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",Ke)}for(L=0;L<v.length;L++)for(ne=0;ne<R.length;ne++)if(ue=R[ne],ue.bone.name===v[L].name){T[L]=ue,ue.processed=!0;break}for(L=0;L<R.length;L++)ue=R[L],ue.processed===!1&&(T.push(ue),ue.processed=!0);const tt=[],Ve=[];for(L=0;L<T.length;L++)ue=T[L],tt.push(ue.bone),Ve.push(ue.boneInverse);return new Ul(tt,Ve)}function be(x,v,R){x.traverse(function(T){if(T.isBone===!0){let L;for(let ne=0;ne<v.length;ne++){const ue=v[ne];if(ue.name===T.name){L=ue.boneInverse;break}}L===void 0&&(L=new Tt),R.push({bone:T,boneInverse:L,processed:!1})}})}function Ue(x){const v=[],R=x.matrix,T=x.nodes,L=x.type,ne=x.instanceCameras,ue=x.instanceControllers,tt=x.instanceLights,Ve=x.instanceGeometries,Ke=x.instanceNodes;for(let Se=0,ct=T.length;Se<ct;Se++)v.push(wt(T[Se]));for(let Se=0,ct=ne.length;Se<ct;Se++){const at=Ze(ne[Se]);at!==null&&v.push(at.clone())}for(let Se=0,ct=ue.length;Se<ct;Se++){const at=ue[Se],Et=te(at.id),mt=he(Et.id),un=rt(mt,at.materials),sn=at.skeletons,Kt=Et.skin.joints,Zt=ce(sn,Kt);for(let ui=0,Pn=un.length;ui<Pn;ui++){const is=un[ui];is.isSkinnedMesh&&(is.bind(Zt,Et.skin.bindMatrix),is.normalizeSkinWeights()),v.push(is)}}for(let Se=0,ct=tt.length;Se<ct;Se++){const at=q(tt[Se]);at!==null&&v.push(at.clone())}for(let Se=0,ct=Ve.length;Se<ct;Se++){const at=Ve[Se],Et=he(at.id),mt=rt(Et,at.materials);for(let un=0,sn=mt.length;un<sn;un++)v.push(mt[un])}for(let Se=0,ct=Ke.length;Se<ct;Se++)v.push(wt(Ke[Se]).clone());let dt;if(T.length===0&&v.length===1)dt=v[0];else{dt=L==="JOINT"?new pu:new Kn;for(let Se=0;Se<v.length;Se++)dt.add(v[Se])}return dt.name=L==="JOINT"?x.sid:x.name,dt.matrix.copy(R),dt.matrix.decompose(dt.position,dt.quaternion,dt.scale),dt}const Fe=new zi({name:Qn.DEFAULT_MATERIAL_NAME,color:16711935});function it(x,v){const R=[];for(let T=0,L=x.length;T<L;T++){const ne=v[x[T]];ne===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",x[T]),R.push(Fe)):R.push(le(ne))}return R}function rt(x,v){const R=[];for(const T in x){const L=x[T],ne=it(L.materialKeys,v);if(ne.length===0&&(T==="lines"||T==="linestrips"?ne.push(new bi):ne.push(new Dn)),T==="lines"||T==="linestrips")for(let Ke=0,dt=ne.length;Ke<dt;Ke++){const Se=ne[Ke];if(Se.isMeshPhongMaterial===!0||Se.isMeshLambertMaterial===!0){const ct=new bi;ct.color.copy(Se.color),ct.opacity=Se.opacity,ct.transparent=Se.transparent,ne[Ke]=ct}}const ue=L.data.attributes.skinIndex!==void 0,tt=ne.length===1?ne[0]:ne;let Ve;switch(T){case"lines":Ve=new ga(L.data,tt);break;case"linestrips":Ve=new Ea(L.data,tt);break;case"triangles":case"polylist":ue?Ve=new Wf(L.data,tt):Ve=new en(L.data,tt);break}R.push(Ve)}return R}function $e(x){return St.nodes[x]!==void 0}function wt(x){return _(St.nodes[x],Ue)}function zt(x){const v={name:x.getAttribute("name"),children:[]};M(x);const R=n(x,"node");for(let T=0;T<R.length;T++)v.children.push(J(R[T]));St.visualScenes[x.getAttribute("id")]=v}function jt(x){const v=new Kn;v.name=x.name;const R=x.children;for(let T=0;T<R.length;T++){const L=R[T];v.add(wt(L.id))}return v}function Gt(x){return St.visualScenes[x]!==void 0}function fe(x){return _(St.visualScenes[x],jt)}function Ne(x){const v=n(x,"instance_visual_scene")[0];return fe(o(v.getAttribute("url")))}function Bt(){const x=St.clips;if(c(x)===!0){if(c(St.animations)===!1){const v=[];for(const R in St.animations){const T=b(R);for(let L=0,ne=T.length;L<ne;L++)v.push(T[L])}nn.push(new Bc("default",-1,v))}}else for(const v in x)nn.push(Y(v))}function bt(x){let v="";const R=[x];for(;R.length;){const T=R.shift();T.nodeType===Node.TEXT_NODE?v+=T.textContent:(v+=`
|
|
4205
|
+
`,R.push(...T.childNodes))}return v.trim()}if(e.length===0)return{scene:new Pl};const mn=new DOMParser().parseFromString(e,"application/xml"),Yt=n(mn,"COLLADA")[0],Je=mn.getElementsByTagName("parsererror")[0];if(Je!==void 0){const x=n(Je,"div")[0];let v;return x?v=x.textContent:v=bt(Je),console.error(`THREE.ColladaLoader: Failed to parse collada file.
|
|
4206
|
+
`,v),null}const Le=Yt.getAttribute("version");console.debug("THREE.ColladaLoader: File version",Le);const Nt=h(n(Yt,"asset")[0]),cn=new Bl(this.manager);cn.setPath(this.resourcePath||t).setCrossOrigin(this.crossOrigin);let $t;Fh&&($t=new Fh(this.manager),$t.setPath(this.resourcePath||t));const Jt=new xt,nn=[];let hi={},kn=0;const St={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};d(Yt,"library_animations","animation",g),d(Yt,"library_animation_clips","animation_clip",H),d(Yt,"library_controllers","controller",me),d(Yt,"library_images","image",re),d(Yt,"library_effects","effect",ge),d(Yt,"library_materials","material",ee),d(Yt,"library_cameras","camera",lt),d(Yt,"library_lights","light",Mt),d(Yt,"library_geometries","geometry",qe),d(Yt,"library_nodes","node",J),d(Yt,"library_visual_scenes","visual_scene",zt),d(Yt,"library_kinematics_models","kinematics_model",we),d(Yt,"library_physics_models","physics_model",Vt),d(Yt,"scene","instance_kinematics_scene",Te),m(St.animations,A),m(St.clips,oe),m(St.controllers,Oe),m(St.images,ae),m(St.effects,O),m(St.materials,_e),m(St.cameras,ve),m(St.lights,Rt),m(St.geometries,Q),m(St.visualScenes,jt),Bt(),De();const ki=Ne(n(Yt,"scene")[0]);return ki.animations=nn,Nt.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),ki.rotation.set(-Math.PI/2,0,0)),ki.scale.multiplyScalar(Nt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),nn},kinematics:hi,library:St,scene:ki}}}const Oh=new F,e3=new Ln,Jr=new Tt,Di=new Tt,Kr=new zn,Zr=new F(1,1,1),Qr=new F;class Ra extends on{constructor(...e){super(...e),this.urdfNode=null,this.urdfName=""}copy(e,t){return super.copy(e,t),this.urdfNode=e.urdfNode,this.urdfName=e.urdfName,this}}class t3 extends Ra{constructor(...e){super(...e),this.isURDFCollider=!0,this.type="URDFCollider"}}class n3 extends Ra{constructor(...e){super(...e),this.isURDFVisual=!0,this.type="URDFVisual"}}class Bu extends Ra{constructor(...e){super(...e),this.isURDFLink=!0,this.type="URDFLink"}}class ku extends Ra{get jointType(){return this._jointType}set jointType(e){if(this.jointType!==e)switch(this._jointType=e,this.matrixWorldNeedsUpdate=!0,e){case"fixed":this.jointValue=[];break;case"continuous":case"revolute":case"prismatic":this.jointValue=new Array(1).fill(0);break;case"planar":this.jointValue=new Array(3).fill(0),this.axis=new F(0,0,1);break;case"floating":this.jointValue=new Array(6).fill(0);break}}get angle(){return this.jointValue[0]}constructor(...e){super(...e),this.isURDFJoint=!0,this.type="URDFJoint",this.jointValue=null,this.jointType="fixed",this.axis=new F(1,0,0),this.limit={lower:0,upper:0},this.ignoreLimits=!1,this.origPosition=null,this.origQuaternion=null,this.mimicJoints=[]}copy(e,t){return super.copy(e,t),this.jointType=e.jointType,this.axis=e.axis.clone(),this.limit.lower=e.limit.lower,this.limit.upper=e.limit.upper,this.ignoreLimits=!1,this.jointValue=[...e.jointValue],this.origPosition=e.origPosition?e.origPosition.clone():null,this.origQuaternion=e.origQuaternion?e.origQuaternion.clone():null,this.mimicJoints=[...e.mimicJoints],this}setJointValue(...e){e=e.map(n=>n===null?null:parseFloat(n)),(!this.origPosition||!this.origQuaternion)&&(this.origPosition=this.position.clone(),this.origQuaternion=this.quaternion.clone());let t=!1;switch(this.mimicJoints.forEach(n=>{t=n.updateFromMimickedJoint(...e)||t}),this.jointType){case"fixed":return t;case"continuous":case"revolute":{let n=e[0];return n==null||n===this.jointValue[0]?t:(!this.ignoreLimits&&this.jointType==="revolute"&&(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.quaternion.setFromAxisAngle(this.axis,n).premultiply(this.origQuaternion),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"prismatic":{let n=e[0];return n==null||n===this.jointValue[0]?t:(this.ignoreLimits||(n=Math.min(this.limit.upper,n),n=Math.max(this.limit.lower,n)),this.position.copy(this.origPosition),Oh.copy(this.axis).applyEuler(this.rotation),this.position.addScaledVector(Oh,n),this.jointValue[0]!==n?(this.jointValue[0]=n,this.matrixWorldNeedsUpdate=!0,!0):t)}case"floating":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],this.jointValue[3]=e[3]!==null?e[3]:this.jointValue[3],this.jointValue[4]=e[4]!==null?e[4]:this.jointValue[4],this.jointValue[5]=e[5]!==null?e[5]:this.jointValue[5],Di.compose(this.origPosition,this.origQuaternion,Zr),Kr.setFromEuler(e3.set(this.jointValue[3],this.jointValue[4],this.jointValue[5],"XYZ")),Qr.set(this.jointValue[0],this.jointValue[1],this.jointValue[2]),Jr.compose(Qr,Kr,Zr),Di.premultiply(Jr),this.position.setFromMatrixPosition(Di),this.rotation.setFromRotationMatrix(Di),this.matrixWorldNeedsUpdate=!0,!0);case"planar":return this.jointValue.every((n,i)=>e[i]===n||e[i]===null)?t:(this.jointValue[0]=e[0]!==null?e[0]:this.jointValue[0],this.jointValue[1]=e[1]!==null?e[1]:this.jointValue[1],this.jointValue[2]=e[2]!==null?e[2]:this.jointValue[2],Di.compose(this.origPosition,this.origQuaternion,Zr),Kr.setFromAxisAngle(this.axis,this.jointValue[2]),Qr.set(this.jointValue[0],this.jointValue[1],0),Jr.compose(Qr,Kr,Zr),Di.premultiply(Jr),this.position.setFromMatrixPosition(Di),this.rotation.setFromRotationMatrix(Di),this.matrixWorldNeedsUpdate=!0,!0)}return t}}class zh extends ku{constructor(...e){super(...e),this.type="URDFMimicJoint",this.mimicJoint=null,this.offset=0,this.multiplier=1}updateFromMimickedJoint(...e){const t=e.map(n=>n*this.multiplier+this.offset);return super.setJointValue(...t)}copy(e,t){return super.copy(e,t),this.mimicJoint=e.mimicJoint,this.offset=e.offset,this.multiplier=e.multiplier,this}}class i3 extends Bu{constructor(...e){super(...e),this.isURDFRobot=!0,this.urdfNode=null,this.urdfRobotNode=null,this.robotName=null,this.links=null,this.joints=null,this.colliders=null,this.visual=null,this.frames=null}copy(e,t){super.copy(e,t),this.urdfRobotNode=e.urdfRobotNode,this.robotName=e.robotName,this.links={},this.joints={},this.colliders={},this.visual={},this.traverse(n=>{n.isURDFJoint&&n.urdfName in e.joints&&(this.joints[n.urdfName]=n),n.isURDFLink&&n.urdfName in e.links&&(this.links[n.urdfName]=n),n.isURDFCollider&&n.urdfName in e.colliders&&(this.colliders[n.urdfName]=n),n.isURDFVisual&&n.urdfName in e.visual&&(this.visual[n.urdfName]=n)});for(const n in this.joints)this.joints[n].mimicJoints=this.joints[n].mimicJoints.map(i=>this.joints[i.name]);return this.frames={...this.colliders,...this.visual,...this.links,...this.joints},this}getFrame(e){return this.frames[e]}setJointValue(e,...t){const n=this.joints[e];return n?n.setJointValue(...t):!1}setJointValues(e){let t=!1;for(const n in e){const i=e[n];Array.isArray(i)?t=this.setJointValue(n,...i)||t:t=this.setJointValue(n,i)||t}return t}}const Mo=new zn,Bh=new Ln;function Ss(s){return s?s.trim().split(/\s+/g).map(e=>parseFloat(e)):[0,0,0]}function kh(s,e,t=!1){t||s.rotation.set(0,0,0),Bh.set(e[0],e[1],e[2],"ZYX"),Mo.setFromEuler(Bh),Mo.multiply(s.quaternion),s.quaternion.copy(Mo)}class Vu{constructor(e){this.manager=e||zl,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(e){return new Promise((t,n)=>{this.load(e,t,null,n)})}load(e,t,n,i){const r=this.manager,a=Vl.extractUrlBase(e),o=this.manager.resolveURL(e);r.itemStart(o),fetch(o,this.fetchOptions).then(l=>{if(l.ok)return n&&n(null),l.text();throw new Error(`URDFLoader: Failed to load url '${o}' with error code ${l.status} : ${l.statusText}.`)}).then(l=>{const c=this.parse(l,this.workingPath||a);t(c),r.itemEnd(o)}).catch(l=>{i?i(l):console.error("URDFLoader: Error loading file.",l),r.itemError(o),r.itemEnd(o)})}parse(e,t=this.workingPath){const n=this.packages,i=this.loadMeshCb,r=this.parseVisual,a=this.parseCollision,o=this.manager,l={},c={},h={};function f(S){if(!/^package:\/\//.test(S))return t?t+S:S;const[A,b]=S.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof n=="string")return n.endsWith(A)?n+"/"+b:n+"/"+A+"/"+b;if(n instanceof Function)return n(A)+"/"+b;if(typeof n=="object")return A in n?n[A]+"/"+b:(console.error(`URDFLoader : ${A} not found in provided package list.`),null)}function u(S){let A;S instanceof Document?A=[...S.children]:S instanceof Element?A=[S]:A=[...new DOMParser().parseFromString(S,"text/xml").children];const b=A.filter(N=>N.nodeName==="robot").pop();return d(b)}function d(S){const A=[...S.children],b=A.filter(U=>U.nodeName.toLowerCase()==="link"),N=A.filter(U=>U.nodeName.toLowerCase()==="joint"),C=A.filter(U=>U.nodeName.toLowerCase()==="material"),P=new i3;P.robotName=S.getAttribute("name"),P.urdfRobotNode=S,C.forEach(U=>{const G=U.getAttribute("name");h[G]=g(U)});const D={},E={};b.forEach(U=>{const G=U.getAttribute("name"),X=S.querySelector(`child[link="${G}"]`)===null;l[G]=_(U,D,E,X?P:null)}),N.forEach(U=>{const G=U.getAttribute("name");c[G]=m(U)}),P.joints=c,P.links=l,P.colliders=E,P.visual=D;const y=Object.values(c);return y.forEach(U=>{U instanceof zh&&c[U.mimicJoint].mimicJoints.push(U)}),y.forEach(U=>{const G=new Set,X=Z=>{if(G.has(Z))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");G.add(Z),Z.mimicJoints.forEach(ie=>{X(ie)})};X(U)}),P.frames={...E,...D,...l,...c},P}function m(S){const A=[...S.children],b=S.getAttribute("type");let N;const C=A.find(G=>G.nodeName.toLowerCase()==="mimic");C?(N=new zh,N.mimicJoint=C.getAttribute("joint"),N.multiplier=parseFloat(C.getAttribute("multiplier")||1),N.offset=parseFloat(C.getAttribute("offset")||0)):N=new ku,N.urdfNode=S,N.name=S.getAttribute("name"),N.urdfName=N.name,N.jointType=b;let P=null,D=null,E=[0,0,0],y=[0,0,0];A.forEach(G=>{const X=G.nodeName.toLowerCase();X==="origin"?(E=Ss(G.getAttribute("xyz")),y=Ss(G.getAttribute("rpy"))):X==="child"?D=l[G.getAttribute("link")]:X==="parent"?P=l[G.getAttribute("link")]:X==="limit"&&(N.limit.lower=parseFloat(G.getAttribute("lower")||N.limit.lower),N.limit.upper=parseFloat(G.getAttribute("upper")||N.limit.upper))}),P.add(N),N.add(D),kh(N,y),N.position.set(E[0],E[1],E[2]);const U=A.filter(G=>G.nodeName.toLowerCase()==="axis")[0];if(U){const G=U.getAttribute("xyz").split(/\s+/g).map(X=>parseFloat(X));N.axis=new F(G[0],G[1],G[2]),N.axis.normalize()}return N}function _(S,A,b,N=null){N===null&&(N=new Bu);const C=[...S.children];return N.name=S.getAttribute("name"),N.urdfName=N.name,N.urdfNode=S,r&&C.filter(D=>D.nodeName.toLowerCase()==="visual").forEach(D=>{const E=p(D,h);if(N.add(E),D.hasAttribute("name")){const y=D.getAttribute("name");E.name=y,E.urdfName=y,A[y]=E}}),a&&C.filter(D=>D.nodeName.toLowerCase()==="collision").forEach(D=>{const E=p(D);if(N.add(E),D.hasAttribute("name")){const y=D.getAttribute("name");E.name=y,E.urdfName=y,b[y]=E}}),N}function g(S){const A=[...S.children],b=new Dn;return b.name=S.getAttribute("name")||"",A.forEach(N=>{const C=N.nodeName.toLowerCase();if(C==="color"){const P=N.getAttribute("rgba").split(/\s/g).map(D=>parseFloat(D));b.color.setRGB(P[0],P[1],P[2]),b.opacity=P[3],b.transparent=P[3]<1,b.depthWrite=!b.transparent}else if(C==="texture"){const P=N.getAttribute("filename");if(P){const D=new Bl(o),E=f(P);b.map=D.load(E),b.map.colorSpace=Qt}}}),b}function p(S,A={}){const b=S.nodeName.toLowerCase()==="collision",N=[...S.children];let C=null;const P=N.filter(E=>E.nodeName.toLowerCase()==="material")[0];if(P){const E=P.getAttribute("name");E&&E in A?C=A[E]:C=g(P)}else C=new Dn;const D=b?new t3:new n3;return D.urdfNode=S,N.forEach(E=>{const y=E.nodeName.toLowerCase();if(y==="geometry"){const U=E.children[0].nodeName.toLowerCase();if(U==="mesh"){const G=E.children[0].getAttribute("filename"),X=f(G);if(X!==null){const Z=E.children[0].getAttribute("scale");if(Z){const ie=Ss(Z);D.scale.set(ie[0],ie[1],ie[2])}i(X,o,(ie,H)=>{H?console.error("URDFLoader: Error loading mesh.",H):ie&&(ie instanceof en&&(ie.material=C),ie.position.set(0,0,0),ie.quaternion.identity(),D.add(ie))})}}else if(U==="box"){const G=new en;G.geometry=new Bi(1,1,1),G.material=C;const X=Ss(E.children[0].getAttribute("size"));G.scale.set(X[0],X[1],X[2]),D.add(G)}else if(U==="sphere"){const G=new en;G.geometry=new Aa(1,30,30),G.material=C;const X=parseFloat(E.children[0].getAttribute("radius"))||0;G.scale.set(X,X,X),D.add(G)}else if(U==="cylinder"){const G=new en;G.geometry=new Il(1,1,1,30),G.material=C;const X=parseFloat(E.children[0].getAttribute("radius"))||0,Z=parseFloat(E.children[0].getAttribute("length"))||0;G.scale.set(X,Z,X),G.rotation.set(Math.PI/2,0,0),D.add(G)}}else if(y==="origin"){const U=Ss(E.getAttribute("xyz")),G=Ss(E.getAttribute("rpy"));D.position.set(U[0],U[1],U[2]),D.rotation.set(0,0,0),kh(D,G)}}),D}return u(e)}defaultMeshLoader(e,t,n){/\.stl$/i.test(e)?new nr(t).load(e,r=>{const a=new en(r,new Dn);n(a)}):/\.dae$/i.test(e)?new Qg(t).load(e,r=>n(r.scene)):console.warn(`URDFLoader: Could not load model at ${e}.
|
|
4207
|
+
No loader available`)}}const s3=Gh.useModelComp(Pe.pinia),{systemPath:Vh}=Pe.storeToRefs(s3),ea=V.ref(),Hh=new Map;function r3(s,e,t,n,i){const r=async u=>{try{const d=await si.downloadAvatarApi({url:u});if(d.status!==200)throw new Error(`下载失败: ${d.status}`);return d.data}catch(d){throw console.error("addModelFromUrl失败:",d),d}},a=u=>new Promise((d,m)=>{const _=new FileReader;_.onload=g=>{try{const p=g.target.result,A=new ha().parse(p);A.preload(),d(A)}catch(p){m(p)}},_.onerror=()=>{m(new Error("MTL文件读取失败"))},_.readAsText(u)}),o=async u=>{const d={materials:{},create:function(m){return this.materials[m]?this.materials[m]:(console.warn(`Material '${m}' not found, using default material`),new Dn({color:8947848,side:wn}))},getAsArray:function(){const m=[];for(const _ in this.materials)m.push(this.materials[_]);return m},preload:function(){for(const m in this.materials)this.materials[m].map&&(this.materials[m].map.needsUpdate=!0)}};for(const m of u){const _=await a(m);Object.assign(d.materials,_.materials)}return d.preload(),d},l=async(u,d=[])=>new Promise((m,_)=>{const g=new FileReader;g.onload=async p=>{try{const S=p.target.result;let A=null;d&&d.length>0&&(d.length===1?A=await a(d[0]):A=await o(d));const b=new ca;A&&b.setMaterials(A);const N=b.parse(S);A||N.traverse(C=>{C.isMesh&&(C.material=new Dn({color:8947848,side:wn}))}),m(N)}catch(S){_(S)}},g.onerror=()=>{_(new Error("OBJ文件读取失败"))},g.readAsText(u)}),c=async u=>{var d;try{t.value=!0;const{scene:m}=s();if(!m)throw new Error("Scene not initialized");i();const _=[];for(let g=0;g<u.length;g++){const p=u[g];n.value=`正在加载模型 ${g+1}/${u.length}...`;const S=await r(p.objUrl),A=((d=p.objUrl)==null?void 0:d.split("/").pop())||`model_${g}.obj`,b=new File([S],A,{type:S.type});let N=[];if(p.mtlUrls){const P=Array.isArray(p.mtlUrls)?p.mtlUrls:[p.mtlUrls];for(let D=0;D<P.length;D++){const E=P[D],y=await r(E),U=(E==null?void 0:E.split("/").pop())||`material_${g}_${D}.mtl`,G=new File([y],U,{type:y.type});N.push(G)}}const C=await l(b,N);m.add(C),e.value.push(C),_.push(C)}return t.value=!1,_}catch(m){throw console.error("加载模型失败:",m),t.value=!1,m}},h=async(u,d,m=[],_=[])=>{let g;const p=u.toLowerCase();switch(p){case".txt":case".cpt":case".obj":const S=await d.text();if(p===".txt"||p===".cpt"){const ge=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,nt=[...S.matchAll(ge)].map(z=>({x:parseFloat(z[1]),y:parseFloat(z[2]),z:parseFloat(z[3])})),yt=new hn,At=nt.flatMap(z=>[z.x,z.y,z.z]);if(yt.setAttribute("position",new Ut(At,3)),p===".txt"){const z=new Ii({color:"#5B5C99",size:1,sizeAttenuation:!1});g=new Cs(yt,z)}else if(p===".cpt"){const z=new bi({color:"#5B5C99",linewidth:100});g=new Ea(yt,z)}}else if(p===".obj"){const ge=new ca;if(m&&m.length>0){const Re=new ha;for(const nt of m){const yt=await nt.text(),At=Re.parse(yt);At.preload(),ge.setMaterials(At);break}}g=ge.parse(S),(!m||m.length===0)&&g.traverse(Re=>{Re.isMesh&&(Re.material=new Dn({color:"#B3B3D4"})),Re instanceof en&&(Re.material.side=wn)})}break;case".stl":const A=await d.arrayBuffer(),N=new nr().parse(A),C=new Dn({color:"#B3B3D4",side:wn});g=new en(N,C);break;case".nc":const P=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],D={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},E=new Kn,y=P.map(ge=>new Promise((Re,nt)=>{new nr().load(Vh.value===""?`/model/${ge}`:`${Vh.value}\\${ge}`,At=>{const z=new Dn({color:D[ge]||"#B3B3D4",side:wn}),Ot=new en(At,z);Re(Ot)},void 0,nt)}));try{(await Promise.all(y)).forEach(Re=>E.add(Re)),g=E}catch(ge){throw console.error("加载NC文件对应的STL文件失败:",ge),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const U=new zu,G=new Kn;try{const ge=await Pe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/target.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),Re=new Blob([ge.data],{type:"application/octet-stream;charset=UTF-8"}),nt=await Pe.axios.get("http://139.196.154.85:20026/chfs/shared/重大专项/重大专项文件/final.pcd",{responseType:"blob",headers:{"Content-Type":"application/json"}}),yt=new Blob([nt.data],{type:"application/octet-stream;charset=UTF-8"}),At=await new Promise((Ot,Pt)=>{const Ct=URL.createObjectURL(Re);U.load(Ct,Xe=>{const gt=new Float32Array(Xe.geometry.attributes.position.count*3);for(let je=0;je<Xe.geometry.attributes.position.count;je++)gt[je*3]=1,gt[je*3+1]=0,gt[je*3+2]=0;Xe.geometry.setAttribute("color",new dn(gt,3)),Xe.material.vertexColors=!0,Xe.scale.set(.3,.3,.3),URL.revokeObjectURL(Ct),Ot(Xe)},void 0,Pt)}),z=await new Promise((Ot,Pt)=>{const Ct=URL.createObjectURL(yt);U.load(Ct,Xe=>{const gt=new Float32Array(Xe.geometry.attributes.position.count*3);for(let je=0;je<Xe.geometry.attributes.position.count;je++)gt[je*3]=0,gt[je*3+1]=1,gt[je*3+2]=0;Xe.geometry.setAttribute("color",new dn(gt,3)),Xe.material.vertexColors=!0,Xe.scale.set(.3,.3,.3),URL.revokeObjectURL(Ct),Ot(Xe)},void 0,Pt)});G.add(At),G.add(z),g=G}catch(ge){throw console.error("PCD文件加载失败:",ge),new Error("无法加载PCD文件")}break;case".urdf":const X=URL.createObjectURL(d),Z=new Vu,ie="http://139.196.154.85:20026/chfs/shared/机器人/urdf/SmallBender_R-2000iC-165F/meshes",H={maxConcurrentLoads:4,enableCache:!0,enableLOD:!0,simplifyGeometry:!0,shareMaterials:!0,enableInstancing:!0},oe=new Map,Y=new Map,me=new Map,Me=async ge=>{if(oe.has(ge))return console.log(`从缓存加载: ${ge}`),oe.get(ge);try{const Re=await Pe.axios.get(`${ie}/${ge}`,{responseType:"blob",headers:{"Content-Type":"application/json"},timeout:6e5}),nt=new Blob([Re.data],{type:"application/octet-stream;charset=UTF-8"});return H.enableCache&&oe.set(ge,nt),nt}catch(Re){throw console.error(`加载文件失败: ${ge}`,Re),new Error(`无法加载文件: ${ge}`)}},Ce=(ge="default")=>{if(Y.has(ge))return Y.get(ge);const Re=new Dn({color:12303291,shininess:30,transparent:!1,alphaTest:.1,side:Xn});return Y.set(ge,Re),Re},Ye=ge=>{try{ge.isBufferGeometry&&ge.mergeVertices&&ge.mergeVertices(),ge.computeVertexNormals&&ge.computeVertexNormals(),ge.computeBoundingSphere&&ge.computeBoundingSphere(),ge.deleteAttribute&&ge.deleteAttribute("uv2")}catch(Re){console.warn("几何体优化失败,使用原始几何体:",Re)}return ge},Oe=async(ge,Re,nt)=>{const yt=`stl_${Re}`;if(me.has(yt)){const Pt=me.get(yt);return new en(Pt,Ce())}const At=await ge.arrayBuffer();let Ot=new nr(nt).parse(At);return Ot=Ye(Ot),me.set(yt,Ot),new en(Ot,Ce())},K=async(ge,Re,nt)=>{const yt=`obj_${Re}`;if(oe.has(yt))return oe.get(yt).clone();const At=await ge.text(),z=new ca(nt),Ot=Re.replace(".obj",".mtl");try{const Xe=await(await Me(Ot)).text(),je=new ha(nt).parse(Xe);je.preload(),z.setMaterials(je)}catch{console.warn(`MTL文件加载失败,使用默认材质: ${Ot}`)}const Pt=z.parse(At);return Pt.traverse(Ct=>{Ct.isMesh&&(Ct.geometry=Ye(Ct.geometry),Ct.castShadow=!0,Ct.receiveShadow=!0,Ct.renderOrder=1)}),oe.set(yt,Pt),Pt},te=(ge,Re)=>{const nt=new fu;if(nt.addLevel(ge,0),ge.geometry){const yt=ge.geometry.clone(),At=new en(yt,ge.material);nt.addLevel(At,50)}return nt};let re=0,ae=0;const Ie=[];Z.loadMeshCb=async(ge,Re,nt,yt,At)=>{const z=ge.split("/").pop(),Ot=nt||(()=>{});re++;const Pt=new Promise(async(Ct,Xe)=>{try{const gt=await Me(z);if(!gt||gt.size===0)throw new Error(`文件为空: ${z}`);const je=z.split(".").pop().toLowerCase();let _t;switch(je){case"stl":_t=await Oe(gt,z,Re);break;case"obj":_t=await K(gt,z,Re);break;default:throw new Error(`不支持的文件格式: ${je}`)}H.enableLOD&&_t.isMesh&&(_t=te(_t,z)),Ot(_t),ae++,yt&&yt({loaded:ae,total:re,progress:ae/re}),Ct(_t)}catch(gt){console.error(`mesh文件加载失败: ${z}`,gt);const je=new Kn;Ot(je),Ct(je);const _t=new Bi(.1,.1,.1),ln=new yu({color:16711680,wireframe:!0});return new en(_t,ln)}});Ie.push(Pt)};try{if(!X){ea.value=void 0;break}if(g=await Z.loadAsync(X),console.log(`URDF文件加载完成,等待${re}个mesh文件加载...`),Ie.length>0)try{await Promise.allSettled(Ie),console.log(`所有mesh文件处理完成,成功加载: ${ae}/${re}`)}catch(nt){console.warn("部分mesh文件加载失败,但继续显示模型",nt)}g.traverse(nt=>{nt.isMesh&&(nt.castShadow=!0,nt.receiveShadow=!0,nt.renderOrder=1,nt.material&&(nt.material.needsUpdate=!0))}),console.time("计算包围盒");const ge=new ei;ge.expandByObject(g);const Re=`urdf_${Date.now()}`;g.userData.boundingBox=ge.clone(),g.userData.modelId=Re,Hh.set(Re,{box:ge.clone(),center:ge.getCenter(new F),size:ge.getSize(new F),maxSize:Math.max(...ge.getSize(new F).toArray())}),ea.value=g,console.log("URDF模型加载完成并优化")}catch(ge){console.error("URDF加载失败:",ge),ea.value=void 0}finally{X&&URL.revokeObjectURL(X)}break;default:throw new Error(`不支持的文件格式: ${u}`)}return g};return{addModelsFromUrls:c,loadModelByDefaultPath:async u=>{console.log(u);try{t.value=!0,n.value="正在加载模型...";const{scene:d}=s();if(!d)throw new Error("Scene not initialized");i(),await new Promise(_=>setTimeout(_,100));const m=[];for(let _=0;_<u.length;_++){const g=u[_],p=await h(g.suffix,g.blob,g.mtlBlobs||[],g.meshFiles||[]);p&&(d.add(p),e.value.push(p),m.push(p))}return t.value=!1,n.value="",m}catch(d){throw console.error("加载模型失败:",d),t.value=!1,n.value="",d}},urdfModel:ea,modelBoundingBoxes:Hh}}window._iconfont_svg_string_4634042='<svg><symbol id="icon-lookAround" viewBox="0 0 1041 1024"><path d="M520.685026 798.355937c-10.788594 0-21.577187-2.790872-31.241101-8.372615l-291.583615-168.36871A62.482203 62.482203 0 0 1 166.619208 567.505024V230.850913c0-22.368629 11.913273-42.987756 31.241102-54.109588l291.583615-168.36871a62.482203 62.482203 0 0 1 62.482203 0l291.583615 168.36871c19.327828 11.121832 31.241102 31.740959 31.241101 54.109588v336.654111a62.482203 62.482203 0 0 1-31.241101 54.109588l-291.583615 168.36871a62.857096 62.857096 0 0 1-31.241102 8.372615zM291.583615 531.39031l229.101411 132.295652 229.101412-132.295652v-264.507993l-229.101412-132.295651L291.583615 266.923972v264.466338z m520.685026 36.114714h0.416548-0.416548z" fill="#aaaaaa" ></path><path d="M520.685026 461.660172c-10.788594 0-21.577187-2.790872-31.241101-8.372616l-291.583615-168.327055a62.482203 62.482203 0 0 1 62.482203-108.219176L520.685026 326.990196l260.342513-150.248871a62.482203 62.482203 0 1 1 62.482204 108.219176l-291.583615 168.327055a62.857096 62.857096 0 0 1-31.241102 8.372616z" fill="#aaaaaa" ></path><path d="M520.685026 798.355937a62.482203 62.482203 0 0 1-62.482203-62.482203V399.177969a62.482203 62.482203 0 1 1 124.964406 0v336.695765a62.482203 62.482203 0 0 1-62.482203 62.482203z" fill="#aaaaaa" ></path><path d="M520.685026 1003.172599c-53.276492 0-520.685026-5.248505-520.685026-187.446609 0-62.982061 54.776065-111.259976 162.870276-143.584103 33.073913-9.622259 67.855673 8.914128 77.769516 41.98804s-8.872473 67.897327-41.946386 77.769516c-30.324696 9.080747-49.194321 17.619981-60.649392 24.11813 46.32014 26.242525 178.657446 62.19062 382.641012 62.19062s336.320872-35.948094 382.641012-62.19062c-11.455071-6.498149-30.324696-15.037384-60.649392-24.11813a62.482203 62.482203 0 1 1 35.82313-119.757556c108.094211 32.324126 162.870276 80.643697 162.870276 143.584103 0 182.198104-467.408534 187.446609-520.685026 187.446609z m398.886385-175.366717h0.416548-0.416548z" fill="#72B02D" ></path></symbol><symbol id="icon-xuanzhuan" viewBox="0 0 1024 1024"><path d="M378.963454 724.443778l91.182641 163.473426c6.246088 11.212239 2.252687 25.39393-9.010749 31.691216l-163.473427 91.18264c-18.123894 10.085896-39.422029-6.758062-33.739113-26.673866l72.290786-254.707264c5.682916-19.967002 32.663967-23.090045 42.749862-4.966152z" fill="#FC794B" ></path><path d="M414.64807 903.9932c-1.228739 0-2.40628-0.051197-3.635018-0.204789C169.002752 879.367232 0.000003 771.443028 0.000003 641.452727c0-52.221389 27.032248-102.19009 78.127293-144.581571a35.827969 35.827969 0 0 1 50.480676 4.710165 35.827969 35.827969 0 0 1-4.710164 50.480676C100.090998 571.824209 71.727616 603.310634 71.727616 641.452727c0 88.929954 148.984551 171.050647 346.504275 191.068847 19.711014 1.9967 34.046298 19.557422 32.049597 39.268436a35.879166 35.879166 0 0 1-35.633418 32.20319zM608.430381 904.095595c-18.175091 0-33.79031-13.772111-35.633418-32.254387-1.945503-19.711014 12.389781-37.271736 32.100795-39.217239 198.134093-19.813409 347.528224-101.985301 347.528223-191.171242 0-23.550822-10.649068-47.050447-31.58882-69.935703-13.362532-14.59127-12.389781-37.271736 2.20149-50.634268 14.59127-13.362532 37.271736-12.389781 50.634268 2.20149 32.971151 35.9918 50.429479 76.898555 50.429478 118.368481 0 130.297485-169.463527 238.221689-412.088195 262.489276-1.177541 0.102395-2.40628 0.153592-3.583821 0.153592z" fill="#FC794B" ></path><path d="M846.703267 184.413179l-325.308534 184.464377L196.137396 184.413179 521.394733 0z" fill="#BEC5CB" ></path><path d="M521.394733 737.703915l325.308534-184.41318V184.413179l-325.308534 184.464377z" fill="#808487" ></path><path d="M521.394733 737.703915L196.137396 553.290735V184.413179l325.257337 184.464377z" fill="#9CA3A9" ></path></symbol><symbol id="icon-clipping" viewBox="0 0 1024 1024"><path d="M341.930667 201.770667l353.706666 204.245333v408.448l-353.706666-204.245333z" fill="#4A80FF" fill-opacity="0.15" ></path><path d="M320.853333 165.248l396.117334 228.608v457.173333l-395.946667-228.608z m353.749334 252.970667L362.837333 238.336v359.722667l311.466667 179.882666z" fill="#72B02D" ></path><path d="M544.384 746.453333l-211.669333-211.669333 18.688-18.688 211.669333 211.669333z" fill="#72B02D" ></path><path d="M693.717333 530.261333l-266.453333-266.325333 20.906667-20.906667 266.325333 266.453334z" fill="#72B02D" ></path><path d="M688.853333 621.098667l-366.933333-366.933334 24.448-24.704 366.933333 366.933334z" fill="#72B02D" ></path><path d="M689.664 713.856L321.578667 345.770667l24.618666-24.618667 368.085334 368.128z" fill="#72B02D" ></path><path d="M683.605333 799.317333l-355.712-355.712 24.234667-24.234666 355.712 355.712z" fill="#72B02D" ></path><path d="M537.770667 944.938667h-51.2v-418.602667l-362.666667-209.28 25.6-44.330667 362.666667 209.066667 362.666666-209.066667 25.6 44.330667-362.666666 209.066667z" fill="#AAAAAA" ></path><path d="M512.170667 53.461333a31.146667 31.146667 0 0 1 15.488 4.266667l370.090666 213.632a31.232 31.232 0 0 1 15.317334 26.794667v426.922666a31.274667 31.274667 0 0 1-15.317334 26.837334l-369.834666 213.333333a31.488 31.488 0 0 1-31.061334 0l-369.834666-213.333333a31.146667 31.146667 0 0 1-15.914667-26.837334V298.069333a31.146667 31.146667 0 0 1 15.573333-27.008l369.792-213.333333a30.976 30.976 0 0 1 15.701334-4.266667z m349.866666 256l-349.866666-201.642666-349.866667 201.856v403.84l349.866667 201.813333 349.866666-201.898667z" fill="#AAAAAA" ></path></symbol><symbol id="icon-viewReset" viewBox="0 0 1024 1024"><path d="M643.2 515.2c-89.6-67.2-179.2-60.8-268.8 0-32 22.4-67.2 57.6-105.6 89.6 38.4 32 70.4 70.4 108.8 96 28.8 19.2 60.8 32 96 38.4 118.4 19.2 188.8-57.6 268.8-137.6-35.2-28.8-60.8-64-99.2-86.4zM508.8 704c-51.2 0-96-41.6-96-99.2s41.6-105.6 96-105.6 96 41.6 96 99.2c0 64-38.4 105.6-96 105.6z" fill="#AAAAAA" ></path><path d="M515.2 544c-3.2 41.6 12.8 60.8 51.2 51.2 0 32-19.2 57.6-51.2 57.6s-57.6-22.4-51.2-57.6c-6.4-32 16-51.2 51.2-51.2" fill="#AAAAAA" ></path><path d="M652.8 3.2c9.6-3.2 19.2-3.2 28.8 0 9.6 3.2 12.8 12.8 12.8 22.4v108.8c70.4 28.8 131.2 70.4 179.2 128 80 89.6 118.4 214.4 108.8 336-9.6 124.8-70.4 236.8-166.4 313.6-96 80-224 118.4-345.6 108.8-124.8-9.6-243.2-67.2-323.2-160S32 649.6 41.6 524.8c9.6-118.4 70.4-233.6 160-307.2 22.4-19.2 60.8-19.2 80 3.2 19.2 22.4 19.2 57.6-3.2 80-70.4 57.6-115.2 140.8-124.8 233.6s22.4 185.6 80 249.6c60.8 70.4 147.2 115.2 243.2 124.8 96 9.6 188.8-19.2 259.2-80s118.4-140.8 124.8-236.8c9.6-89.6-22.4-185.6-80-249.6-28.8-28.8-57.6-57.6-89.6-76.8v89.6c0 9.6-3.2 19.2-12.8 22.4-9.6 3.2-19.2 3.2-28.8 0l-227.2-160c-3.2-3.2-9.6-12.8-9.6-19.2 0-9.6 3.2-12.8 9.6-19.2L652.8 3.2z" fill="#72B02D" ></path></symbol><symbol id="icon-donghuafangzhen" viewBox="0 0 1024 1024"><path d="M868.864 228.864c-19.968 0-38.912 7.68-53.248 20.992l-291.328-170.496c-7.168-5.12-16.896-5.12-24.064 0L208.896 248.832c-14.336-12.8-33.28-20.48-53.76-20.48-43.52 0-79.872 36.864-79.872 80.896 0 33.792 21.504 63.488 53.248 74.24v318.976c0 9.216 4.608 17.408 12.288 22.016L437.248 896c11.776 30.72 41.472 51.712 74.752 52.224 33.28-0.512 62.464-20.992 74.752-52.224l296.448-171.52c7.68-4.608 12.288-13.312 12.288-22.016V386.048c31.744-11.776 53.248-42.496 53.248-76.288 0-44.032-36.352-80.896-79.872-80.896zM155.136 339.456c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 15.872-12.8 28.672-29.184 29.184zM512 897.024c-16.896 0-29.184-12.288-29.184-29.696 0-14.848 12.288-29.696 29.184-29.696h2.048c15.36 0.512 27.648 13.824 27.136 29.696 0 14.848-14.848 29.696-29.184 29.696z m74.752-58.368c-11.776-30.208-40.96-51.712-74.752-51.712-27.136 0-52.224 14.336-67.072 37.376l-3.072 1.024c-4.608 2.048-8.704 5.632-9.728 10.752l-252.416-146.944V384.512C212.48 373.76 234.496 343.04 235.52 308.736l3.072 0.512h2.048c3.584 0 7.168-1.536 10.24-3.584 7.168-5.632 8.192-16.384 2.048-23.552L512 130.56l278.528 162.816c-7.68 36.864 11.264 74.24 45.568 90.624 0.512 5.632 3.584 10.24 8.704 13.312v291.328l-258.048 150.016z m282.112-499.2c-16.896 0-29.184-12.288-29.184-29.696v-2.048c0.512-15.36 13.312-27.648 29.184-27.136h2.048c15.36 0.512 27.648 13.824 27.136 29.696v2.56c-1.024 14.848-13.824 27.136-29.184 26.624z" fill="#AAAAAA" ></path><path d="M422.912 724.992c-3.072-8.704-12.288-12.8-20.992-9.728-8.704 3.072-12.8 12.8-9.728 21.504l19.968 54.784c2.56 6.656 8.192 10.752 15.36 10.752 2.048 0 3.584-0.512 5.12-1.024 8.704-3.072 12.8-12.8 9.728-21.504l-19.456-54.784zM706.048 507.392c0-107.52-86.016-195.072-192-196.096-2.048-1.536-4.608-2.56-7.68-3.072l-24.064-3.072c-8.192-1.024-15.872 4.096-17.92 11.776-5.632 1.536-11.776 3.584-16.896 5.632 0.512-1.536 1.024-3.072 1.536-5.12 1.024-9.216-5.12-17.408-14.336-18.432l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.608 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l44.032 5.12C384 353.28 351.232 388.608 333.312 432.64c-25.088 60.928-17.92 130.048 18.432 184.832-1.024 3.584-1.024 7.168 0.512 10.24l19.968 54.784c1.024 3.072 3.072 5.632 6.144 7.68 7.168 5.12 17.408 3.072 22.528-4.096 3.072-4.608 3.584-10.24 2.048-15.36l-0.512-1.536c53.76 37.888 123.392 45.568 184.32 19.968 46.08-19.456 82.944-55.808 102.912-101.376l12.8-14.336c6.144-6.656 5.632-17.408-0.512-23.04 2.56-14.336 4.096-28.672 4.096-43.008z m-193.536 156.16C427.52 663.552 358.4 593.92 358.4 507.392c0-86.016 69.12-156.16 154.112-156.16s154.112 69.632 154.112 156.16c0 86.016-69.12 156.16-154.112 156.16z" fill="#72B02D" ></path><path d="M765.44 478.72c-6.144-5.632-15.872-5.632-22.016 0l-32.256 35.84c-4.096 4.608-5.632 11.776-3.072 17.92 2.56 6.144 8.192 9.728 14.848 9.728 4.608 0 8.704-2.048 11.776-5.12l32.256-35.84c5.12-7.168 4.608-16.896-1.536-22.528zM823.296 401.92c-5.632-1.024-11.776 0.512-15.872 5.12l-32.256 35.84c-4.608 4.608-5.632 11.776-3.072 17.92 1.024 2.048 2.56 4.096 4.096 5.632 6.656 6.144 16.896 5.632 23.04-1.536l32.256-35.84c4.096-4.096 5.632-10.752 3.584-16.384-1.024-5.632-5.632-9.728-11.776-10.752zM336.384 321.024c8.704 0 15.872-6.656 16.384-15.36 0.512-8.704-5.632-16.384-14.336-17.408l-48.128-5.632c-5.632-1.024-11.776 1.536-15.36 6.144-3.584 4.608-4.096 11.264-2.048 16.896 2.56 5.632 7.68 9.216 13.312 9.728l48.128 5.632h2.048z" fill="#72B02D" ></path></symbol><symbol id="icon-guanjianjiexi" viewBox="0 0 1024 1024"><path d="M298.496 200.704v83.456h-39.936v177.664h137.728V389.12h47.104v245.76h-47.104v-79.872H211.456c-10.752-3.584-54.272-14.336-54.272-57.856V280.064h-32.768V200.704h174.08m47.104-47.104H77.824v177.152h36.352v169.984c0 68.608 61.44 97.792 97.792 104.96H353.28v79.872h141.312V342.016H349.184v72.192h-43.52v-87.04h39.936V153.6zM627.712 389.12v79.872H812.544c10.752 3.584 54.272 14.336 54.272 54.272V740.352h32.768v83.456h-173.568v-83.456h39.936v-177.664h-137.728V634.88h-47.104V389.12h46.592m47.104-47.104h-141.312v340.48h141.312v-72.192h43.52v83.456h-39.936V870.4h267.776v-177.152h-36.352v-169.984c0-68.608-61.44-97.792-97.792-104.96H670.72V342.528h4.096z" fill="#AAAAAA" ></path></symbol><symbol id="icon-gongyishengcheng" viewBox="0 0 1024 1024"><path d="M889.344 391.68h29.696v-43.008h-208.896l1.024 45.056 28.16 3.072v20.992c55.808 5.632 108.032 28.672 150.016 66.56-0.512 0 0-92.672 0-92.672z m-366.592 102.912c13.312-13.312 27.648-24.576 43.008-34.816-2.048-70.144-5.632-153.088-8.704-179.712-5.632-48.64-34.816-204.288-226.816-202.752-191.488 1.536-223.744 164.864-230.912 207.36s-11.776 197.632-11.776 197.632h-24.576v43.008l208.896 1.024v-40.96h-24.064V316.928S245.76 230.912 335.36 231.424C424.448 232.448 415.232 327.68 414.72 327.68v313.856c4.608 0 6.144 77.824 50.176 144.896-13.312-32.256-20.48-67.072-20.48-102.912 0-71.168 27.648-138.24 78.336-188.928z" fill="#AAAAAA" ></path><path d="M75.264 601.6h31.232v281.088s41.984 29.184 141.824 0v-274.944l29.184-2.56v-44.032H75.264v40.448zM906.24 263.168h-29.184l1.024-188.416s-53.76-27.648-144.384 0l1.024 192-31.744 1.024V307.2h203.776l-0.512-44.032z" fill="#AAAAAA" ></path><path d="M934.912 627.712c-9.216-4.608-20.48-2.048-29.184 6.656l-21.504 21.504c-9.216 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l21.504-21.504c8.704-8.704 11.264-19.968 6.656-29.184-5.632-10.752-18.432-15.36-34.304-13.312-25.6 4.096-48.64 15.36-66.56 33.792-27.136 27.136-39.424 65.536-33.792 103.936l-178.176 178.176c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l178.176-178.176c37.888 6.144 76.288-6.656 103.936-33.792 17.92-17.92 29.696-41.472 33.792-66.56 2.048-15.872-2.56-28.672-13.312-34.304z m-9.728 30.72c-3.072 20.48-12.8 38.912-27.136 53.76-23.04 23.04-56.32 33.28-89.088 26.624l-6.144-1.536-186.88 186.88c-8.704 9.216-20.992 13.824-33.792 13.824s-24.576-5.12-33.792-13.824c-9.216-9.216-13.824-20.992-13.824-33.792s5.12-24.576 13.824-33.792l186.88-186.88-1.536-6.144c-6.656-32.256 3.072-65.536 26.624-89.088 14.848-14.848 33.28-24.064 53.76-27.136 1.536-0.512 3.072-0.512 4.608-0.512 2.56 0 4.608 0.512 5.12 1.024-0.512 0.512-1.024 1.536-2.048 2.56l-21.504 21.504c-13.312 13.312-20.992 31.232-20.992 50.176s7.168 36.864 20.992 50.176c13.312 13.312 31.232 20.992 50.176 20.992 18.944 0 36.864-7.168 50.176-20.992l21.504-21.504c1.024-1.024 2.048-1.536 2.56-2.048 0.512 1.536 1.024 4.608 0.512 9.728z" fill="#72B02D" ></path><path d="M560.64 870.912c-12.8 12.8-12.8 33.28 0 45.568 6.144 6.144 14.336 9.216 23.04 9.216s16.896-3.072 23.04-9.216c6.144-6.144 9.728-14.336 9.728-23.04 0-8.704-3.584-16.896-9.728-23.04-12.8-12.288-33.792-12.288-46.08 0.512z m28.672 28.672c-3.072 3.072-8.704 3.072-11.776 0-3.072-3.072-3.072-8.704 0-11.776 1.536-1.536 3.584-2.56 6.144-2.56 2.048 0 4.096 1.024 6.144 2.56 1.536 1.536 2.56 3.584 2.56 6.144-0.512 2.048-1.536 4.096-3.072 5.632z m225.28-107.008c-4.096-4.096-10.24-4.096-14.336 0l-43.52 43.52c-4.096 4.096-4.096 10.24 0 14.336l102.4 102.4c15.872 15.872 41.984 15.872 57.856 0 15.872-15.872 15.872-41.984 0-57.856l-102.4-102.4z m-237.056-150.528l70.656 70.656 28.672-28.672-70.656-70.656-15.872-30.208-50.688-36.352-28.672 28.672 36.352 50.688 30.208 15.872z" fill="#72B02D" ></path></symbol><symbol id="icon-mojupipei" viewBox="0 0 1024 1024"><path d="M880.64 117.248c32.768 0 58.88 23.04 64.512 54.784l1.024 7.68v663.04c0.512 31.744-22.528 58.368-53.76 62.464l-7.68 1.024H151.552c-34.816 0-66.048-22.528-72.192-53.248l-1.024-6.656V183.296c0-31.744 27.648-59.904 61.952-65.024l7.168-1.024h142.848c24.064 0 44.032 16.896 48.64 39.936l1.024 6.656V406.528c0 7.68 5.12 14.848 12.288 16.896l3.584 0.512H424.96c13.312 0 25.088 9.216 29.184 22.528 6.144 23.552 33.792 46.08 58.368 46.08 22.528 0 48.128-19.456 55.808-39.424l2.048-5.632c2.048-10.24 9.216-18.432 19.456-21.504l5.12-1.024 3.072-0.512h71.168c6.144 0 11.776-3.584 14.336-9.728l1.024-3.584V164.864c0-23.04 15.872-41.984 37.888-46.592l6.144-1.024H880.64zM273.92 184.32H151.552l-2.048 0.512-2.048 0.512-2.56 1.536-1.536 649.728 3.072 1.536 3.072 1.024h1.024l328.192 3.072 2.048-286.72-2.048-0.512-10.24-3.584c-24.576-10.24-45.568-27.136-60.928-49.152l-6.144-9.216 1.024-1.536H349.184c-37.888-4.096-68.608-33.792-74.24-71.68l-1.024-8.192v-4.096V184.32z m476.16-3.072V409.6l-0.512 8.704c-3.584 36.864-32.256 66.56-68.608 72.192l-8.192 1.024h-4.096l-45.568-1.536-6.144 9.728c-14.848 22.528-36.352 40.448-61.44 51.2l-10.752 4.096-3.072 284.16h337.408v-655.36l-129.024-2.56z" fill="#AAAAAA" ></path></symbol><symbol id="icon-buchangshezhi" viewBox="0 0 1024 1024"><path d="M792.576 75.264h-686.08c-17.408 0-31.232 13.824-31.232 31.232v686.08c0 17.408 13.824 31.232 31.232 31.232h436.736c17.408 0 31.232-13.824 31.232-31.232s-13.824-31.232-31.232-31.232H137.728V262.656h624.128v280.576c0 17.408 13.824 31.232 31.232 31.232s31.232-13.824 31.232-31.232V106.496c-0.512-17.408-14.336-31.232-31.744-31.232z" fill="#AAAAAA" ></path><path d="M792.576 948.736c-17.408 0-31.232-13.824-31.232-31.232v-93.696h-93.696c-17.408 0-31.232-13.824-31.232-31.232 0-17.408 13.824-31.232 31.232-31.232h93.696v-93.696c0-17.408 13.824-31.232 31.232-31.232 17.408 0 31.232 13.824 31.232 31.232v93.696h93.696c17.408 0 31.232 13.824 31.232 31.232 0 17.408-13.824 31.232-31.232 31.232h-93.696v93.696c0 17.408-13.824 31.232-31.232 31.232z" fill="#72B02D" ></path><path d="M372.224 518.144l-110.08 110.08c-20.992 20.992-20.992 55.296 0 76.288s55.296 20.992 76.288 0l110.08-110.08c-16.896-6.144-32.768-15.872-46.592-29.696-13.824-13.312-23.552-29.696-29.696-46.592z m-57.856 162.304c-7.68 7.68-20.48 7.68-28.672 0-7.68-7.68-7.68-20.48 0-28.672 7.68-7.68 20.48-7.68 28.672 0 7.68 8.192 7.68 20.992 0 28.672z m340.48-292.864L592.384 450.56c-20.992 20.992-55.296 20.992-76.288 0s-20.992-55.296 0-76.288l62.976-62.976c-51.712-8.704-116.224 14.848-151.552 50.176-49.152 49.152-49.152 128.512 0 177.664s129.024 49.152 177.664 0c35.328-35.328 58.368-99.84 49.664-151.552z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shuchujiagongchengxu" viewBox="0 0 1024 1024"><path d="M876.544 473.6v374.272c0 16.384-13.312 29.696-29.696 29.696h-522.24c-16.384 0-29.696-13.312-29.696-29.696V503.296c0-16.384 13.312-29.696 29.696-29.696h551.936m40.96-70.656H253.952c-16.384 0-29.696 13.312-29.696 29.696v486.4c0 16.384 13.312 29.696 29.696 29.696h663.552c16.384 0 29.696-13.312 29.696-29.696v-486.4c0-16.384-13.312-29.696-29.696-29.696z" fill="#AAAAAA" ></path><path d="M489.984 211.968H814.08l-41.984-41.984c-13.824-13.824-13.824-36.352 0-50.176 13.824-13.824 36.352-13.824 50.176 0L947.712 245.76l-0.512 0.512 0.512 0.512-125.952 125.952c-13.824 13.824-36.352 13.824-50.176 0-13.824-13.824-13.824-36.352 0-50.176l38.912-38.912H489.472c-19.456 0-35.328-15.872-35.328-35.328 0.512-20.48 16.384-36.352 35.84-36.352z" fill="#72B02D" ></path><path d="M531.456 717.824c0-11.776-7.68-22.016-18.944-25.6l-55.808-16.896-14.848-4.608 14.848-4.608 55.808-16.896c11.264-3.584 18.944-13.824 18.944-25.6v-2.048c0-18.432-17.92-31.232-35.328-25.088L363.52 641.024c-10.752 3.584-17.92 13.824-17.92 25.088v8.192c0 11.264 7.168 21.504 17.92 25.088l132.608 45.568c17.408 6.144 35.328-7.168 35.328-25.088v-2.048z m123.392-96.768v2.048c0 11.776 7.68 22.016 18.944 25.6l56.32 16.896 14.848 4.608-14.848 4.608-56.32 16.896c-11.264 3.584-18.944 13.824-18.944 25.6v2.56c0 18.432 17.92 31.232 35.328 25.088l132.608-45.568c10.752-3.584 17.92-13.824 17.92-25.088v-8.192c0-11.264-7.168-21.504-17.92-25.088l-132.608-45.568c-17.408-6.144-35.328 7.168-35.328 25.6z m-54.784-64l-70.144 248.32c-4.608 16.896 8.192 33.792 25.6 33.792 11.776 0 22.528-8.192 25.6-19.456l70.144-248.32c4.608-16.896-8.192-33.792-25.6-33.792-11.776 0-22.016 8.192-25.6 19.456zM147.456 814.08V173.056c0-14.848 11.776-26.624 26.624-26.624h463.872c19.456 0 35.328-15.872 35.328-35.328 0-19.456-15.872-35.328-35.328-35.328H107.008c-16.896 0-30.72 13.824-30.72 30.72v748.032c0 16.896 13.824 30.72 30.72 30.72h40.448c19.456 0 35.328-15.872 35.328-35.328 0.512-19.968-15.36-35.84-35.328-35.84z" fill="#AAAAAA" ></path></symbol><symbol id="icon-guanjiekongzhi" viewBox="0 0 1024 1024"><path d="M648.192 377.344h-71.68c-18.432 0-33.792-14.848-33.792-33.792H366.592c12.288-30.72 25.088-80.896 0-134.656H542.72c0-18.432 15.36-33.792 33.792-33.792h67.584c1.536 0 2.56 0 4.096 0.512L719.36 87.04c10.752-13.312 29.184-16.384 44.032-7.68l168.96 100.864c15.872 9.728 20.992 30.208 11.776 46.08-9.728 15.872-30.208 20.992-46.592 11.264l-143.872-85.504L677.888 245.76v61.44l75.776 93.696 143.872-85.504c15.872-9.728 36.864-4.608 46.592 11.776 9.728 15.872 4.608 36.352-11.264 46.08h-0.512l-168.96 100.864c-14.336 8.704-33.28 5.12-44.032-7.68l-71.168-89.088zM319.488 780.8L102.912 415.744c76.8 69.632 185.344 48.64 231.424-13.312l222.72 378.368H711.68c18.432 0 33.792 14.848 33.792 33.792v100.864c0 18.432-15.36 33.792-33.792 33.792H170.496c-18.432 0-33.792-14.848-33.792-33.792v-100.864c0-18.432 15.36-33.792 33.792-33.792h148.992z" fill="#AAAAAA" ></path><path d="M204.288 148.48C133.12 148.48 75.264 205.824 75.264 276.48S133.12 404.48 204.288 404.48c71.168 0 129.024-57.344 129.024-128S275.456 148.48 204.288 148.48z m0 202.752c-41.472 0-74.752-33.28-74.752-74.752 0-40.96 33.792-74.24 74.752-74.24C245.76 202.24 279.04 235.52 279.04 276.48c0 41.472-33.792 75.264-74.752 74.752z" fill="#72B02D" ></path></symbol><symbol id="icon-jiegoushu" viewBox="0 0 1024 1024"><path d="M233.984 472.064h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44v238.08h317.44c0-44.032 35.328-79.36 79.36-79.36h238.08c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-238.08c-44.032 0-79.36-35.328-79.36-79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V233.984h-39.936c-22.016 0-39.936-17.92-39.936-39.936V115.2c0-22.016 17.92-39.936 39.936-39.936h158.72c22.016 0 39.936 17.92 39.936 39.936V194.56c0 22.016-17.92 39.936-39.936 39.936h-39.936v237.568z" fill="#AAAAAA" ></path><path d="M551.936 75.264h317.44c44.032 0 79.36 35.328 79.36 79.36v79.36c0 44.032-35.328 79.36-79.36 79.36h-317.44c-44.032 0-79.36-35.328-79.36-79.36V154.624c-0.512-44.032 35.328-79.36 79.36-79.36z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaitui" viewBox="0 0 1024 1024"><path d="M512 148.992c199.68 0 361.984 162.304 361.984 361.984S711.68 872.448 512 872.448s-361.984-162.304-361.984-361.984S312.32 148.992 512 148.992m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M670.72 456.192v109.056l-75.264-54.784L670.72 456.192m25.6-102.912c-10.24 0-20.992 3.072-30.208 10.24l-144.896 105.472c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-52.224-52.224z" fill="#72B02D" ></path><path d="M499.712 456.192v109.056L424.96 510.976l74.752-54.784m26.112-102.912c-10.24 0-20.992 3.072-30.208 10.24L350.208 468.992c-28.672 20.48-28.672 62.976 0 83.968l144.896 105.472c9.216 6.656 19.968 10.24 30.208 10.24 27.136 0 52.224-21.504 52.224-51.712V405.504c0-30.72-25.088-52.224-51.712-52.224z" fill="#72B02D" ></path><path d="M314.368 381.44c-21.504 0-38.912 17.408-38.912 38.912v181.248c0 21.504 17.408 38.912 38.912 38.912s38.912-17.408 38.912-38.912V420.352c0-21.504-17.408-38.912-38.912-38.912z" fill="#72B02D" ></path></symbol><symbol id="icon-bofang" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M491.008 445.952l115.712 66.048-115.712 66.048V445.952m-23.552-87.04c-24.576 0-46.592 19.456-46.592 46.592v212.48c0 27.136 22.528 46.592 46.592 46.592 7.68 0 15.36-2.048 23.04-6.144l185.856-106.496c31.232-17.92 31.232-62.976 0-80.896L490.496 365.056c-7.168-4.096-15.36-6.144-23.04-6.144z" fill="#72B02D" ></path></symbol><symbol id="icon-kuaijin" viewBox="0 0 1024 1024"><path d="M515.584 151.04c199.168 0 360.96 161.792 360.96 360.96s-161.792 360.96-360.96 360.96-360.96-161.792-360.96-360.96 161.792-360.96 360.96-360.96m0-74.752c-240.64 0-435.712 195.072-435.712 435.712s195.072 435.712 435.712 435.712 435.712-195.072 435.712-435.712-195.072-435.712-435.712-435.712z" fill="#AAAAAA" ></path><path d="M358.912 458.24L433.152 512l-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432L363.52 366.592c-9.216-6.656-19.456-9.728-29.696-9.728z" fill="#72B02D" ></path><path d="M527.36 458.24l74.24 53.76-74.24 53.76v-107.52m-25.088-101.376c-26.624 0-51.2 20.992-51.2 51.2v207.872c0 30.208 24.576 51.2 51.2 51.2 10.24 0 20.48-3.072 29.696-9.728l142.848-103.936c28.16-20.48 28.16-61.952 0-82.432l-142.848-103.936c-9.216-7.168-19.968-10.24-29.696-10.24z" fill="#72B02D" ></path><path d="M710.144 384.512c-20.992 0-38.4 17.408-38.4 38.4v178.688c0 20.992 17.408 38.4 38.4 38.4s38.4-17.408 38.4-38.4V422.912c0-21.504-17.408-38.4-38.4-38.4z" fill="#72B02D" ></path></symbol><symbol id="icon-zanting" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M416.768 353.28c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c-0.512-21.504-17.92-39.424-39.936-39.424z m190.464 0c-22.016 0-39.936 17.92-39.936 39.936v238.08c0 22.016 17.92 39.936 39.936 39.936s39.936-17.92 39.936-39.936V392.704c0-21.504-17.92-39.424-39.936-39.424z" fill="#72B02D" ></path></symbol><symbol id="icon-zhongzhi" viewBox="0 0 1024 1024"><path d="M512 150.016c199.68 0 361.984 162.304 361.984 361.984S711.68 873.984 512 873.984 150.016 711.68 150.016 512 312.32 150.016 512 150.016m0-74.752c-241.152 0-436.736 195.584-436.736 436.736s195.584 436.736 436.736 436.736 436.736-195.584 436.736-436.736-195.584-436.736-436.736-436.736z" fill="#AAAAAA" ></path><path d="M580.096 421.376c12.288 0 22.528 10.24 22.528 22.528v136.192c0 12.288-10.24 22.528-22.528 22.528H443.904c-12.288 0-22.528-10.24-22.528-22.528V443.904c0-12.288 10.24-22.528 22.528-22.528h136.192m0-68.096H443.904C393.728 353.28 353.28 393.728 353.28 443.904v136.192c0 50.176 40.448 90.624 90.624 90.624h136.192c50.176 0 90.624-40.448 90.624-90.624V443.904c0-50.176-40.448-90.624-90.624-90.624z" fill="#72B02D" ></path></symbol><symbol id="icon-suoxiao" viewBox="0 0 1024 1024"><path d="M491.008 463.36c32.256 0 58.88-26.112 58.88-58.88s-26.112-58.88-58.88-58.88H285.696c-32.256 0-58.88 26.112-58.88 58.88s26.112 58.88 58.88 58.88h205.312z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848 13.312 0 26.112-5.12 36.352-14.848 19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangda" viewBox="0 0 1024 1024"><path d="M488.96 333.824h-47.104V286.72c0-34.816-28.16-62.976-62.976-62.976-34.816 0-62.976 28.16-62.976 62.976v47.104h-47.104c-34.816 0-62.976 28.16-62.976 62.976s28.16 62.976 62.976 62.976h47.104V506.88c0 34.816 28.16 62.976 62.976 62.976 34.816 0 62.976-28.16 62.976-62.976v-47.104h47.104c34.816 0 62.976-28.16 62.976-62.976 0-34.304-28.16-62.976-62.976-62.976z" fill="#72B02D" ></path><path d="M810.496 720.384l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 143.36-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.104-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-97.28 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M811.008 106.496h-109.056V209.92h109.056c29.696 0 53.76 24.064 53.76 53.76v81.408H967.68v-81.92c0-86.016-70.144-156.672-156.672-156.672zM864.768 791.552c0 29.696-24.064 53.76-53.76 53.76h-109.056v102.912h109.056c86.528 0 156.672-70.144 156.672-156.672v-81.92h-102.912v81.92z m-690.176 0v-81.92H71.68v81.92c0 86.528 70.144 156.672 156.672 156.672h109.056v-102.912H228.352c-29.696 0-53.76-24.064-53.76-53.76z" fill="#AAAAAA" ></path></symbol><symbol id="icon-fangdazhichuangkou" viewBox="0 0 1024 1024"><path d="M949.248 858.624l-158.208-158.208c29.184-48.128 46.08-104.96 46.08-165.376 0-175.616-142.848-318.976-318.976-318.976s-318.976 142.848-318.976 318.976 142.848 318.976 318.976 318.976c78.336 0 150.016-28.16 205.824-75.264l152.576 152.576c10.24 10.24 23.04 14.848 36.352 14.848s26.112-5.12 36.352-14.848c19.968-19.968 19.968-52.736 0-72.704z m-431.616-107.52c-119.296 0-216.064-96.768-216.064-216.064 0-119.296 96.768-216.064 216.064-216.064s216.064 96.768 216.064 216.064c0 119.296-96.768 216.064-216.064 216.064z" fill="#72B02D" ></path><path d="M216.576 919.04h109.056v-102.912H216.576c-29.696 0-53.76-24.064-53.76-53.76V233.984c0-29.696 24.064-53.76 53.76-53.76H798.72c29.696 0 53.76 24.064 53.76 53.76v81.92h102.912v-81.92c0-86.528-70.144-156.672-156.672-156.672H216.576c-86.528 0-156.672 70.144-156.672 156.672v528.384c0 86.528 70.144 156.672 156.672 156.672z" fill="#AAAAAA" ></path></symbol><symbol id="icon-shiyingpingmu" viewBox="0 0 1024 1024"><path d="M876.032 75.264H147.968c-39.936 0-72.704 32.768-72.704 72.704v728.064c0 39.936 32.768 72.704 72.704 72.704h728.064c39.936 0 72.704-32.768 72.704-72.704V147.968c0-39.936-32.768-72.704-72.704-72.704z m0 764.416c0 22.016-14.336 36.352-36.352 36.352H184.32c-22.016 0-36.352-14.336-36.352-36.352V184.32c0-22.016 14.336-36.352 36.352-36.352h655.36c22.016 0 36.352 14.336 36.352 36.352v655.36z" fill="#AAAAAA" ></path><path d="M329.728 184.32H220.672c-3.584 0-10.752 0-14.336 3.584-7.168 3.584-14.336 10.752-18.432 18.432-3.584 3.584-3.584 10.752-3.584 14.336v109.056c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352v-22.016l47.104 47.104c7.168 7.168 14.336 10.752 25.6 10.752 10.752 0 18.432-3.584 25.6-10.752 14.336-14.336 14.336-36.352 0-51.2l-47.104-47.104h22.016c22.016 0 36.352-14.336 36.352-36.352 0-21.504-14.848-35.84-36.864-35.84zM329.728 766.976h-22.016l47.104-47.104c14.336-14.336 14.336-36.352 0-51.2-14.336-14.336-36.352-14.336-51.2 0l-47.104 47.104v-22.016c0-22.016-14.336-36.352-36.352-36.352s-36.352 14.336-36.352 36.352v109.056c0 3.584 0 10.752 3.584 14.336 3.584 7.168 10.752 14.336 18.432 18.432 3.584 3.584 10.752 3.584 14.336 3.584h109.056c22.016 0 36.352-14.336 36.352-36.352s-13.824-35.84-35.84-35.84zM817.664 187.904c-3.584-3.584-10.752-3.584-14.336-3.584h-109.056c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h22.016l-47.104 47.104c-14.336 14.336-14.336 36.352 0 51.2 7.168 7.168 14.336 10.752 25.6 10.752s18.432-3.584 25.6-10.752l47.104-47.104v22.016c0 22.016 14.336 36.352 36.352 36.352s36.352-14.336 36.352-36.352V220.672c0-3.584 0-10.752-3.584-14.336-4.096-7.68-11.264-14.848-18.944-18.432zM803.328 657.408c-22.016 0-36.352 14.336-36.352 36.352v22.016l-47.104-47.104c-14.336-14.336-36.352-14.336-51.2 0-14.336 14.336-14.336 36.352 0 51.2l47.104 47.104h-22.016c-22.016 0-36.352 14.336-36.352 36.352s14.336 36.352 36.352 36.352h109.056c3.584 0 10.752 0 14.336-3.584 7.168-3.584 14.336-10.752 18.432-18.432 3.584-3.584 3.584-10.752 3.584-14.336v-109.056c0.512-22.016-13.824-36.864-35.84-36.864z" fill="#72B02D" ></path></symbol><symbol id="icon-yangshitu-01" viewBox="0 0 1024 1024"><path d="M645.632 882.688H150.528l252.928-204.8 477.696 0.512z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512z m-542.72 23.552H880.64l-234.496 203.264-228.864 0.512V140.8z m0 247.296l217.088-0.512-1.024 247.296H417.28V388.096z m-43.008-223.744v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m532.48 493.568H150.528l252.928-204.288 477.696 0.512-235.52 203.776z m271.36-247.808h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-zuoshitu-01" viewBox="0 0 1024 1024"><path d="M374.272 644.096l-262.656 211.968L112.64 373.76l261.632-209.408z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM112.64 373.76l261.632-209.408v479.744l-263.168 211.968L112.64 373.76z m520.192 507.904l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-qianshitu-01" viewBox="0 0 1024 1024"><path d="M112.64 389.12h520.704v493.056H112.64z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m259.584 717.824H112.64V389.12h520.704v493.056z m12.288-537.6l-228.864 0.512V140.8H880.64l-234.496 203.776z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-youshitu-01" viewBox="0 0 1024 1024"><path d="M916.992 659.456l-239.616 196.096V375.808l239.616-208.896z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-228.864 0.512V140.8H880.64l-234.496 203.776z m270.848 314.88l-239.104 196.096V375.808l239.104-208.896v492.544z" fill="#AAAAAA" ></path></symbol><symbol id="icon-houshitu-01" viewBox="0 0 1024 1024"><path d="M960 118.784V117.76v-1.024-1.024-1.024-0.512-0.512c1.536 7.68-1.024 15.872-6.656 20.992L677.376 373.76v299.52h-43.008V389.12H374.272v254.976l-262.656 211.968L112.64 389.12l261.632-0.512v-42.496h269.824l280.064-243.2c3.072-2.56 6.656-4.096 10.752-5.12H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c-0.512 0.512-0.512 1.024-1.024 2.048 0 0.512 0 0.512-0.512 1.024 0 0.512 0 0.512-0.512 1.024 0 0.512 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V907.264c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024c0 0.512 0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024s0 0.512 0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-242.176 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V658.944v-2.048V118.272c1.536 1.024 1.536 1.024 1.536 0.512zM374.272 164.352v180.736l-225.792 1.024 225.792-181.76z m258.56 717.312l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m44.544-26.112v-177.664H880.64l-203.264 177.664z m281.6-741.376v-0.512-0.512 1.024z" fill="#AAAAAA" ></path><path d="M916.992 634.88h-239.616V375.808l239.616-211.456zM644.096 346.112H417.28V141.824h462.336zM417.28 389.12H634.88v245.76H417.28z" fill="#72B02D" ></path><path d="M958.976 114.176c0 0.512 0.512 0.512 0 0z m-20.48-16.384H945.152l0.512 0.512 0.512 0.512h1.024l0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512 0.512c0 0.512 0.512 0.512 0.512 1.024s0 0.512 0.512 0.512c0 0.512 0.512 1.024 0.512 1.536 0 0.512 0.512 1.024 0.512 1.024-3.072-10.24-13.312-16.896-24.064-14.848h4.608v1.024z" fill="#C1272D" ></path></symbol><symbol id="icon-dingshitu-01" viewBox="0 0 1024 1024"><path d="M880.64 140.8l-234.496 203.776-497.664 1.536 256-206.336z" fill="#72B02D" ></path><path d="M960 117.248v-1.024-1.024-0.512-1.024-0.512c0-0.512-0.512-1.024-0.512-1.536l-0.512-1.536s0-0.512-0.512-0.512-0.512-0.512-0.512-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024l-0.512-0.512-1.024-0.512H393.216c-5.12 0-9.728 1.536-13.312 4.608L72.192 350.72l-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536l0.512 0.512c0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024-0.512 0.512-0.512 1.024 0 0.512-0.512 1.024c0 0.512 0 1.024-0.512 1.536v0.512l-0.512 2.048V907.776c0 0.512 0 1.536 0.512 2.048v1.024c0 0.512 0 0.512 0.512 1.024s0 0.512 0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.536l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512l1.024 1.024 0.512 0.512 1.024 1.024 0.512 0.512 1.536 1.536c0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512 1.024 0.512 0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512l1.024 0.512H655.872c7.68 0 14.848-4.096 18.432-10.752l276.992-241.664 1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.536 0-0.512 0.512-1.024 0.512-1.536v-0.512V660.992v-2.048V117.76c1.024 0 1.024 0 1.024-0.512zM113.152 389.12l261.632-0.512v256l-263.168 211.968 1.536-467.456z m519.68 492.544l-482.304 1.536 252.928-204.8h230.4l-1.024 203.264z m1.024-246.784H417.28V388.096l217.088-0.512-0.512 247.296z m12.288-290.304l-497.664 1.536 256-205.824 476.16 1.024-234.496 203.264z m31.232 510.976v-177.664H880.64l-203.264 177.664z m239.616-220.672h-239.104V375.808l239.104-208.896V634.88z" fill="#AAAAAA" ></path></symbol><symbol id="icon-toushitu-01" viewBox="0 0 1024 1024"><path d="M965.632 114.176V112.64v-1.024-0.512-1.024-0.512s0-0.512-0.512-1.024v-0.512c-0.512-1.024-0.512-2.048-1.024-3.072v-0.512c0-0.512-0.512-0.512-0.512-1.024s0-0.512-0.512-0.512l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512s-0.512-1.024-1.024-1.024l-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512-0.512h-1.024s-0.512 0-0.512-0.512c0 0-0.512 0-0.512-0.512H950.784h-0.512H392.704c-5.12 0-9.728 1.536-13.312 4.608l-312.32 251.392-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024-0.512 0.512-1.024 1.024s0 0.512-0.512 0.512c-0.512 0.512-0.512 1.024-1.024 1.536 0 0 0 0.512-0.512 0.512 0 0.512-0.512 0.512-0.512 1.024s0 0.512-0.512 1.024c0 0.512 0 0.512-0.512 1.024s0 0.512 0 1.024 0 1.024-0.512 1.536v0.512c0 0.512 0 1.024-0.512 1.536V912.896c0 0.512 0 1.024 0.512 2.048v0.512s0 0.512 0.512 1.024l0.512 1.024v1.024s0 0.512 0.512 1.024c0 0.512 0.512 1.024 0.512 1.024l0.512 0.512c0.512 0.512 0.512 1.024 1.024 1.536 0 0 0 0.512 0.512 0.512 0 0.512 0.512 0.512 1.024 1.024l0.512 0.512 1.024 1.024 0.512 0.512c0.512 0.512 1.024 1.024 1.536 1.024 0.512 0.512 1.024 0.512 1.536 1.024l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 0.512 0.512 1.024 0.512l0.512 0.512c0.512 0 1.024 0.512 1.536 0.512h0.512c0.512 0 1.024 0 1.024 0.512h583.168c7.68 0 14.848-4.096 18.432-10.752L957.44 675.84l1.024-1.024 1.024-1.024 0.512-0.512 1.024-1.024 1.024-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024v-0.512c0-0.512 0.512-0.512 0.512-1.024v-0.512c0-0.512 0.512-1.024 0.512-1.024 0-0.512 0.512-1.024 0.512-1.536v-0.512V661.504v-1.536V658.432l1.024-544.256zM372.736 343.04l-229.888 0.512L372.736 158.72v184.32z m43.008 43.008l220.672-0.512-0.512 251.392h-220.16v-250.88z m-43.008 0v260.096l-267.264 215.552 1.536-474.624 265.728-1.024z m-227.84 502.272l257.024-208.384h233.984l-0.512 206.848-490.496 1.536z m503.296-545.792l-172.544 0.512H415.232V135.68h471.04l-238.08 206.848z m31.232 337.408h207.36l-207.36 181.248v-181.248z m0-43.008V373.76l243.2-212.48v475.648h-243.2z" fill="#AAAAAA" ></path></symbol><symbol id="icon-a-jixiebi3" viewBox="0 0 1024 1024"><path d="M483.386004 821.695719H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M483.386004 776.399147H164.779715l29.075502 22.648286h260.455285l29.075502-22.648286z" fill="#7A807D" ></path><path d="M483.386004 776.399147H164.779715l29.075502-22.648285h260.455285l29.075502 22.648285z" fill="#3F3F3F" ></path><path d="M483.386004 730.796518H164.779715l29.075502 22.954344h260.455285l29.075502-22.954344zM483.386004 685.499947H164.779715l29.075502 22.648285h260.455285l29.075502-22.648285z" fill="#7A807D" ></path><path d="M483.386004 730.796518H164.779715l29.075502-22.648286h260.455285l29.075502 22.648286z" fill="#3F3F3F" ></path><path d="M150.701051 623.064132h339.418227v62.435815H150.701051z" fill="#F7A53F" ></path><path d="M150.701051 821.695719h339.418227v31.217907H150.701051z" fill="#FFFFFF" ></path><path d="M607.951575 339.654504a74.984189 74.984189 0 0 1-23.872517 103.447575 75.290247 75.290247 0 0 1-103.753633-23.872518L293.324039 120.823095A75.290247 75.290247 0 0 1 317.196557 17.069462a75.290247 75.290247 0 0 1 103.753633 23.872517zM441.762128 517.474152v105.58998H198.752144v-105.58998a122.423166 122.423166 0 1 1 244.846331 0z" fill="#FFC200" ></path><path d="M627.233224 377.605685a103.141517 103.141517 0 0 1-52.948019 82.635637l-165.88339 118.750471-2.448463 1.836347a112.93537 112.93537 0 1 1-112.017197-194.346775l195.571007-84.471985a132.523077 132.523077 0 0 1 48.357151-12.854432A89.062853 89.062853 0 0 1 627.233224 377.605685z" fill="#FFE610" ></path><path d="M401.056425 493.601635a71.005436 71.005436 0 1 1-71.005436-71.311494 71.005436 71.005436 0 0 1 71.005436 71.311494z" fill="#FFFFFF" ></path><path d="M375.34756 493.601635a45.296571 45.296571 0 1 1-45.296571-45.60263 45.296571 45.296571 0 0 1 45.296571 45.60263z" fill="#48B8BF" ></path><path d="M592.342622 376.381453a49.88744 49.88744 0 1 1-49.581382-49.88744 49.88744 49.88744 0 0 1 49.581382 49.88744z" fill="#FFFFFF" ></path><path d="M574.285205 376.381453a30.605791 30.605791 0 1 1-30.605792-30.605791 30.605791 30.605791 0 0 1 30.605792 30.605791z" fill="#48B8BF" ></path><path d="M731.048068 230.789704l165.975207-62.099151 18.883774 50.46895-165.975207 62.068545z" fill="#FFE610" ></path><path d="M734.047436 202.785404l145.836596-54.294674 9.426584 25.31099-145.867202 54.294674z" fill="#F7A53F" ></path><path d="M808.419509 259.161272l23.872517 63.353988 31.523966 35.808776-19.893765 18.057417-48.051092-38.257239-27.851271-63.660046 40.399645-15.302896zM854.940312 242.022029l23.56646 63.04793-0.306058 47.745035 26.627038 0.612116 11.324143-60.293409-20.811938-66.414568-40.399645 15.302896zM716.173654 94.379691l102.345766-38.257239 37.216643 99.468822-102.345767 38.257239z" fill="#7A807D" ></path><path d="M841.473764 83.790087a66.108509 66.108509 0 0 1-65.802452 66.10851l-407.669142 15.608953a67.944857 67.944857 0 0 1-11.324142 0 82.635637 82.635637 0 0 1 0-165.271273 67.944857 67.944857 0 0 1 11.324142 0l407.669142 17.445301A66.108509 66.108509 0 0 1 841.473764 83.790087z" fill="#FFE610" ></path><path d="M402.892773 83.790087a46.520803 46.520803 0 1 1-46.520803-46.214745A46.520803 46.520803 0 0 1 402.892773 83.790087z" fill="#FFFFFF" ></path><path d="M386.059587 83.790087a30.605791 30.605791 0 1 1-30.605791-30.605791 30.605791 30.605791 0 0 1 30.605791 30.605791z" fill="#48B8BF" ></path><path d="M810.867972 83.790087a38.257239 38.257239 0 1 1-39.787528-38.257239A38.257239 38.257239 0 0 1 810.867972 83.790087z" fill="#FFFFFF" ></path><path d="M795.565077 83.790087a24.484633 24.484633 0 1 1-24.484633-24.484633 24.484633 24.484633 0 0 1 24.484633 24.484633z" fill="#48B8BF" ></path><path d="M106.93477 852.913626h639.66104v171.086374H106.93477z" fill="#FFE610" ></path><path d="M383.305066 709.678522h337.275822v207.201208H383.305066z" fill="#4D4D4D" ></path><path d="M407.177584 732.02075h291.061076v161.904636H407.177584z" fill="#FFFFFF" ></path><path d="M429.825869 755.893267h159.150116v16.22107h-159.150116zM429.825869 784.356653h131.604903v16.22107h-131.604903zM429.825869 812.820039h199.855818v16.22107h-199.855818zM429.825869 841.283425h146.601741v16.22107h-146.601741z" fill="#92D5D2" ></path><path d="M507.564579 732.326808l-31.830023 161.904636H407.177584v-161.904636h100.386995z" fill="#F5F5F5" opacity=".5" ></path><path d="M474.816383 916.87973h155.783478v31.830023h-155.783478z" fill="#7A807D" ></path><path d="M106.93477 977.173139h639.66104v46.826861H106.93477z" fill="#F7A53F" ></path><path d="M252.006221 899.740487h66.414567v48.969266H252.006221z" fill="#7A807D" ></path><path d="M319.64502 817.716966l-3.672695 11.324143-21.730112 70.699378h-21.730112l23.872518-76.820537 3.366637-11.324143 19.893764 6.121159z" fill="#999999" ></path><path d="M341.069074 809.147344A28.463386 28.463386 0 1 1 321.17531 773.950684a28.463386 28.463386 0 0 1 19.893764 35.19666z" fill="#48B8BF" ></path><path d="M322.705599 793.538391a13.16049 13.16049 0 1 1-26.014923 0 13.16049 13.16049 0 0 1 26.014923 0z" fill="#FFFFFF" ></path><path d="M165.085773 899.740487h66.414568v49.275324H165.085773z" fill="#7A807D" ></path><path d="M163.861542 817.716966l3.366637 11.324143 22.03617 70.699378h21.730111l-23.872517-76.820537-3.672695-11.324143-19.587706 6.121159z" fill="#999999" ></path><path d="M142.437488 809.147344a28.157328 28.157328 0 1 0 18.669532-35.19666 28.157328 28.157328 0 0 0-18.669532 35.19666z" fill="#F7A53F" ></path><path d="M160.800963 793.538391a13.16049 13.16049 0 1 0 12.854432-12.854433 12.854432 12.854432 0 0 0-12.854432 12.854433z" fill="#FFFFFF" ></path></symbol><symbol id="icon-jixiebi2" viewBox="0 0 1164 1024"><path d="M848.55632 485.108049h233.370249v430.146938h-233.370249z" fill="#FFE610" ></path><path d="M974.217224 605.245396h154.314351v64.211341h-154.314351zM974.217224 689.82485h154.314351v64.211341h-154.314351zM974.217224 774.749527h154.314351v64.211341h-154.314351z" fill="#54D9D9" ></path><path d="M306.557369 245.869021l99.078789 31.760448 69.389675 22.094225 145.683794 46.259783 69.734897 22.094225 119.101681 37.974449 66.627896 21.058558 1.035667-2.761778 21.749003-69.044453 23.129891-72.151453-22.784669-7.249667-79.746343-25.201225-20.368113-6.559223-337.972595-107.364124-21.40378-6.904445-87.686455-27.617781-45.224116 142.576794-0.345222 1.035667z" fill="#FFE610" ></path><path d="M412.33347 357.755556l10.70189-33.555604 441.470229 140.401894-10.667368 33.555604z" fill="#A3A3A3" ></path><path d="M380.331366 357.686512l25.408359-79.953476 69.424197 22.094225-25.408359 79.918953zM595.508402 425.626253l25.408359-79.953476 69.389674 22.059703-25.373836 79.953476z" fill="#3F3F3F" ></path><path d="M809.200982 411.575707a144.302906 144.302906 0 0 0 4.833112 37.284004 138.088905 138.088905 0 0 0 18.987224 43.152783 144.302906 144.302906 0 0 0 15.535002 19.677669 146.719461 146.719461 0 0 0 256.154919-100.114456 144.648128 144.648128 0 0 0-34.522226-94.5909 180.206021 180.206021 0 0 0-15.880224-16.570668 146.719461 146.719461 0 0 0-96.317012-34.522227 148.445573 148.445573 0 0 0-58.687784 10.356668 146.719461 146.719461 0 0 0-89.757788 129.803571 34.522226 34.522226 0 0 0-0.345223 5.523556z" fill="#FFC200" ></path><path d="M876.174101 411.575707A80.091565 80.091565 0 1 0 956.265666 331.484142a80.091565 80.091565 0 0 0-80.091565 80.091565z" fill="#FFFFFF" ></path><path d="M904.827549 411.575707a51.438117 51.438117 0 1 0 51.438117-51.092895 51.438117 51.438117 0 0 0-51.438117 51.092895z" fill="#54D9D9" ></path><path d="M218.076903 216.594173l37.007826-117.202958 88.894733 28.06657L306.902591 244.660743zM86.512699 119.345062l92.450522-16.467102 19.401491 108.745013-92.450522 16.467102z" fill="#8A8A8A" ></path><path d="M0 65.317778l45.224116 254.083585 21.058558-3.797445 31.415226-5.523556 22.094225-4.142667-13.808891-77.675009-19.332446-109.090235-12.082779-67.318341-14.499335 2.761778-21.403781 3.797445-38.664893 6.904445z" fill="#292929" ></path><path d="M95.626567 436.43171l16.570668-3.107-14.499335-123.244348-31.415226 5.523556 29.343893 120.827792z" fill="#7A807D" ></path><path d="M138.088905 153.349455a80.782009 80.782009 0 0 0 31.070003 63.520896 79.40112 79.40112 0 0 0 49.021562 16.915891 75.258453 75.258453 0 0 0 32.10567-6.904445 80.091565 80.091565 0 0 0 48.331117-73.532342 78.710676 78.710676 0 0 0-13.808891-44.18845 76.984564 76.984564 0 0 0-31.760448-27.617781l-7.59489-3.452222a83.543787 83.543787 0 0 0-12.428001-3.452223H217.835247A80.091565 80.091565 0 0 0 138.088905 153.349455z" fill="#FFC200" ></path><path d="M167.087575 153.694677A51.092895 51.092895 0 1 0 217.835247 103.637449a50.747673 50.747673 0 0 0-50.747672 50.057228z" fill="#FFFFFF" ></path><path d="M185.384355 153.694677a32.450893 32.450893 0 1 0 32.450892-34.522226 32.450893 32.450893 0 0 0-32.450892 34.522226z" fill="#54D9D9" ></path><path d="M38.664893 58.413333l21.403781-3.797445C66.627897 19.74844 108.745013 11.117883 141.88635 14.915328a89.757788 89.757788 0 0 1 81.472454 58.687784h9.321001a83.543787 83.543787 0 0 1 12.428001 3.452223l7.59489 3.452223c53.854673-42.807561 165.016241-17.951558 187.110466 48.331116l21.40378 6.904446C439.813162 59.449 307.593036 24.581551 241.655583 69.115223a113.923346 113.923346 0 0 0-108.745012-69.044452C90.793455 0.070771 41.081449 10.772661 38.664893 58.413333zM799.189537 244.14291l20.368113 6.559223a345.222262 345.222262 0 0 0 89.412566-34.522226c48.331117-22.784669 133.601015-34.522226 144.99335 34.522226a114.613791 114.613791 0 0 1 0 48.676339 180.206021 180.206021 0 0 1 15.880224 16.570668c15.880224-50.057228 3.797445-107.364124-54.545117-124.280014-83.198565-22.439447-141.541127 45.569339-216.109136 52.473784z" fill="#3F3F3F" ></path><path d="M44.18845 731.251522a105.638012 105.638012 0 0 0 105.638012 105.638012h698.729858v-31.415226H149.826462a74.222786 74.222786 0 0 1 0-148.445573h698.729858v-31.415225H149.826462a105.638012 105.638012 0 0 0-105.638012 105.638012z" fill="#8A8A8A" ></path><path d="M75.603675 731.251522a74.222786 74.222786 0 0 0 74.222787 74.222786h698.729858V655.993069H149.826462a74.222786 74.222786 0 0 0-74.222787 75.258453z" fill="#FFE610" ></path><path d="M103.566679 731.251522a51.092895 51.092895 0 1 0 50.747672-50.747673A50.747673 50.747673 0 0 0 103.566679 731.251522z" fill="#FFFFFF" ></path><path d="M121.863459 731.251522a32.450893 32.450893 0 1 0 32.450892-32.450893 32.450893 32.450893 0 0 0-32.450892 32.450893zM290.331922 731.251522a34.522226 34.522226 0 0 0 34.522227 34.522226h414.266714a34.522226 34.522226 0 0 0 34.522226-34.522226 34.522226 34.522226 0 0 0-34.522226-34.522226h-414.266714a34.522226 34.522226 0 0 0-34.522227 34.522226z" fill="#54D9D9" ></path><path d="M827.15254 877.625761h276.523032v61.794785h-276.523032z" fill="#F7A53F" ></path><path d="M839.925764 939.765768h250.976584v31.070004h-250.976584z" fill="#707070" ></path><path d="M747.75142 657.028735v148.445573h43.152783v31.415226h57.652117v-211.276024h-57.652117v31.415225h-43.152783z" fill="#B3B3B3" opacity=".76" ></path><path d="M14.499335 970.490549h1149.590133v53.509451H14.499335z" fill="#B86805" ></path><path d="M154.314351 836.889534H272.725587v133.601015H154.314351zM614.150404 836.889534h118.411236v133.601015h-118.411236z" fill="#F7A53F" ></path><path d="M614.150404 836.889534h118.411236v78.365453h-118.411236zM154.314351 836.889534H272.725587v78.365453H154.314351z" fill="#B3B3B3" opacity=".76" ></path></symbol><symbol id="icon-jixiebi4" viewBox="0 0 1123 1024"><path d="M502.569098 505.335276h543.234824v85.15391H502.569098z" fill="#FFE610" ></path><path d="M483.047648 203.089382a81.451566 81.451566 0 0 1-41.06236 73.373725l-302.919047 173.33701a82.124719 82.124719 0 0 1-81.788143-143.045105l302.919047-173.33701a82.124719 82.124719 0 0 1 83.807603 0 79.768682 79.768682 0 0 1 27.935868 28.945597A77.412645 77.412645 0 0 1 483.047648 203.089382z" fill="#FFC200" ></path><path d="M39.776109 803.542249h1082.094151v220.121174H39.776109z" fill="#FFE610" ></path><path d="M39.776109 971.830609h1082.094151v52.169391H39.776109zM466.218812 723.43699v146.747449H219.844654v-146.747449a123.187079 123.187079 0 0 1 246.374158 0z" fill="#FFC200" ></path><path d="M396.210854 790.415757a100.973016 100.973016 0 0 1-141.698798-23.896947l-235.603704-331.864645a100.973016 100.973016 0 0 1 23.896947-141.362222 100.973016 100.973016 0 0 1 141.698799 23.896947l235.603703 331.528068a100.973016 100.973016 0 0 1-24.233523 141.698799z" fill="#FFE610" ></path><path d="M146.470929 451.146424a86.16364 86.16364 0 1 1 29.282174-118.138428 86.16364 86.16364 0 0 1-29.282174 118.138428z" fill="#B8B8B8" ></path><path d="M131.661553 424.556864a56.881466 56.881466 0 1 1 19.52145-78.085799 56.544889 56.544889 0 0 1-19.52145 78.085799z" fill="#B8B8B8" ></path><path d="M120.554522 405.035414a35.677132 35.677132 0 0 1-36.686863-60.920386A35.677132 35.677132 0 1 1 120.554522 405.035414z" fill="#FFFFFF" ></path><path d="M370.9676 757.767815a56.881466 56.881466 0 1 1 19.184873-78.085798 56.881466 56.881466 0 0 1-19.184873 78.085798z" fill="#B8B8B8" ></path><path d="M358.850839 739.592672a35.677132 35.677132 0 1 1 12.116761-48.803624 35.677132 35.677132 0 0 1-12.116761 48.803624z" fill="#FFFFFF" ></path><path d="M423.136992 384.167657l-112.416624 66.305614-32.984519-55.871735 112.753201-65.969037 9.760725 16.492259 13.463069 22.887217 9.424148 16.155682z" fill="#8A8A8A" ></path><path d="M400.18246 345.023785l70.512822-41.398937 13.463069 22.887217-70.512823 41.432594z" fill="#C4C4C4" ></path><path d="M489.442606 313.823123a21.877487 21.877487 0 0 1-11.780186 27.935868 21.54091 21.54091 0 0 1-27.935867-12.116762l-29.955328-73.373725a21.54091 21.54091 0 0 1 12.116762-27.935868 21.204333 21.204333 0 0 1 27.599291 11.780186z" fill="#F7A53F" ></path><path d="M482.037918 318.19862a12.453339 12.453339 0 0 1-9.424148 14.809376 12.789915 12.789915 0 0 1-14.809376-9.424148 12.789915 12.789915 0 0 1 9.424148-14.809376 12.453339 12.453339 0 0 1 14.809376 9.424148z" fill="#707070" ></path><path d="M303.652257 388.543155a24.5701 24.5701 0 0 0-7.404688 8.077841l-24.906677 45.10128 32.311365 44.764704 36.350285-65.63246a24.906677 24.906677 0 0 0-36.013709-33.657672z m12.453338 6.394957a14.472799 14.472799 0 0 1 16.155683 12.116762 14.136222 14.136222 0 0 1-12.116762 16.155683 13.799645 13.799645 0 0 1-16.155683-11.780185 14.136222 14.136222 0 0 1 13.463069-16.49226z" fill="#B86805" ></path><path d="M305.33514 411.430372a13.799645 13.799645 0 0 0 16.155683 11.780185 14.136222 14.136222 0 0 0 12.116762-16.155683 14.472799 14.472799 0 0 0-16.155683-12.116762 14.136222 14.136222 0 0 0-12.116762 16.49226z" fill="#5E5E5E" ></path><path d="M625.4196 163.709906l-19.858026 12.116762-37.360016 22.55064-19.858027 12.116762-20.867756-34.667402-40.389207-66.64219-19.184872-31.301635 9.424148-5.721804 58.227772-35.340556 9.424148-5.385227 80.441836 132.27465z" fill="#8A8A8A" ></path><path d="M568.066927 198.276335l37.124412-22.516982 36.484917 60.14626-37.15807 22.55064z" fill="#4D4D4D" ></path><path d="M931.031261 336.373763l-85.15391 217.765137h-128.572307l-46.447587-118.811581-30.965058-79.768683-7.404688-19.184873 46.111011-46.447587h205.648375l46.784164 46.447587z" fill="#AEBABD" ></path><path d="M744.668732 483.861681l105.954351-43.182793 2.423352 5.890093-105.988009 43.182793zM840.8287 361.953594l-120.157889-26.252984 1.682884-6.058381 119.821312 26.252984-1.346307 6.058381zM683.916634 363.838423l6.125696-1.851172 32.984518 109.252803-6.159353 1.851172z" fill="#6A5060" ></path><path d="M880.544753 403.015954a49.813354 49.813354 0 1 1-49.813354-49.813355 50.149931 50.149931 0 0 1 49.813354 49.813355zM746.923796 359.597557a33.657672 33.657672 0 1 1-33.657672-33.657672 33.657672 33.657672 0 0 1 33.657672 33.657672zM767.454975 465.282647a26.589561 26.589561 0 0 1-26.58956 26.252984A26.252984 26.252984 0 0 1 741.201991 438.693086a26.589561 26.589561 0 0 1 26.252984 26.589561z" fill="#FFFFFF" ></path><path d="M846.887081 403.015954a16.155683 16.155683 0 1 1-16.155682-16.155683 16.155683 16.155683 0 0 1 16.155682 16.155683zM724.709732 359.597557a10.097302 10.097302 0 0 1-10.097302 9.760725 9.760725 9.760725 0 1 1 0-19.52145 10.097302 10.097302 0 0 1 10.097302 9.760725zM748.943256 465.282647A7.741265 7.741265 0 0 1 741.201991 472.350758a8.077841 8.077841 0 0 1-8.077841-8.077842 8.077841 8.077841 0 0 1 8.077841-8.077841 8.077841 8.077841 0 0 1 7.741265 9.087572z" fill="#788B90" opacity=".37" ></path><path d="M698.456748 219.581642h166.268899v46.11101h-166.268899z" fill="#F7A53F" ></path><path d="M702.159092 223.620562h5.048651v38.03317h-5.048651zM711.246663 223.620562h5.048651v38.03317h-5.048651zM720.334235 223.620562h5.048651v38.03317h-5.048651zM729.421806 223.620562h5.048651v38.03317h-5.048651zM738.509378 223.620562h5.04865v38.03317h-5.04865zM747.596949 223.620562h5.048651v38.03317h-5.048651zM756.68452 223.620562h5.048651v38.03317h-5.048651zM765.772092 223.620562h5.048651v38.03317h-5.048651zM774.859663 223.620562h5.048651v38.03317H774.859663zM783.610658 223.620562h5.048651v38.03317h-5.048651zM792.698229 223.620562h5.048651v38.03317h-5.048651zM801.785801 223.620562h5.04865v38.03317h-5.04865zM810.873372 223.620562h5.048651v38.03317h-5.048651zM819.960944 223.620562h5.04865v38.03317h-5.04865zM829.048515 223.620562h5.048651v38.03317h-5.048651zM838.136086 223.620562h5.048651v38.03317h-5.048651zM847.223658 223.620562h5.048651v38.03317h-5.048651zM856.311229 223.620562h5.048651v38.03317h-5.048651z" fill="#788B90" opacity=".38" ></path><path d="M738.845954 265.692652h85.490487v23.896947h-85.490487z" fill="#707070" ></path><path d="M735.816764 288.916446h-1.682884L640.228976 355.558636l-39.0429 26.926138-4.712074 3.365767-16.492259-23.896947a25.916407 25.916407 0 0 1 6.731534-36.013709l97.270672-67.315344a25.916407 25.916407 0 0 1 36.013709 6.731534z" fill="#58BFD2" ></path><path d="M670.857457 435.327319h-33.657672a12.116762 12.116762 0 0 1-10.433878-8.414418l-24.906677-44.428127 39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M827.365631 288.916446h1.682884l94.241481 65.63246 39.0429 26.926138 4.712074 3.365767 16.492259-23.896947a25.916407 25.916407 0 0 0-6.731534-35.003979l-97.270672-67.315344a25.916407 25.916407 0 0 0-36.013709 6.731534z" fill="#58BFD2" ></path><path d="M892.324938 435.327319h33.657672a12.116762 12.116762 0 0 0 10.433878-8.414418l24.906677-44.428127-39.042899-26.926138z" fill="#8A8A8A" ></path><path d="M738.845954 265.692652h85.490487v12.116762h-85.490487zM922.95342 355.558636l-31.301635 79.768683-46.447588 118.811581 49.140201-194.541343-70.007957-69.671381h4.038921l94.578058 65.63246z" fill="#848484" opacity=".25" ></path><path d="M661.433309 321.900964l-48.467048-67.988497 21.204334-12.789915 38.033169 74.383455-10.770455 6.394957z" fill="#7A807D" ></path><path d="M535.553616 36.820483l-58.227772 33.657672-11.780186-19.184873A33.657672 33.657672 0 0 1 502.905674 1.143351a33.657672 33.657672 0 0 1 21.204334 15.482529z" fill="#F7A53F" ></path><path d="M527.475775 175.826668L483.047648 203.089382A77.412645 77.412645 0 0 0 471.940616 164.046483a79.768682 79.768682 0 0 0-27.599291-28.272444l42.745243-25.916408zM527.475775 175.826668l-40.389207-66.64219 40.389207 66.64219z" fill="#C4C4C4" ></path><path d="M956.274515 854.028757H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M650.999431 304.062398l-70.007958 14.809376 69.671381 8.414418-4.712074 38.033169 25.243254-25.243254 22.887217 25.243254-3.702344-36.350286 35.003979-1.682883-31.974789-19.52145 14.809376-35.677132-33.657672 24.906677-26.252984-43.754973 2.692614 50.823084z" fill="#FFFFFF" ></path><path d="M956.274515 803.542249H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 803.542249H600.512923l32.311365-25.579831h290.802285l32.647942 25.579831z" fill="#999999" ></path><path d="M956.274515 752.719165H600.512923l32.311365 25.243253h290.802285l32.647942-25.243253zM956.274515 702.232657H600.512923l32.311365 25.243254h290.802285l32.647942-25.243254z" fill="#7A807D" ></path><path d="M956.274515 752.719165H600.512923l32.311365-25.243254h290.802285l32.647942 25.243254z" fill="#999999" ></path><path d="M584.693817 632.561276h378.985386v69.671381H584.693817zM584.693817 854.028757h378.985386v34.667402H584.693817z" fill="#FFC200" ></path><path d="M502.569098 590.489186h543.234824v42.07209H502.569098z" fill="#F7A53F" ></path><path d="M273.696929 882.637778h80.441836v59.574079H273.696929z" fill="#7A807D" ></path><path d="M355.821648 783.011069l-4.375497 13.799646-26.589561 85.827063h-26.252984l28.945598-93.231751 4.375497-13.799646 23.896947 7.404688z" fill="#999999" ></path><path d="M381.738055 772.913768a33.657672 33.657672 0 1 1-22.55064-43.08182 33.657672 33.657672 0 0 1 22.55064 43.08182z" fill="#F7A53F" ></path><path d="M359.523992 753.728895a15.819106 15.819106 0 1 1-15.819106-15.819106 15.819106 15.819106 0 0 1 15.819106 15.819106z" fill="#FFFFFF" ></path><path d="M168.348416 882.637778h80.441835v59.574079H168.348416z" fill="#7A807D" ></path><path d="M166.665532 783.011069l4.375497 13.799646 26.589561 85.827063h26.252984l-28.945598-93.231751-4.03892-13.799646-24.233524 7.404688z" fill="#999999" ></path><path d="M140.749125 772.913768a33.657672 33.657672 0 1 0 67.315343-20.53118 33.657672 33.657672 0 0 0-43.08182-22.55064 33.657672 33.657672 0 0 0-24.233523 43.08182z" fill="#68FF4B" ></path><path d="M162.963188 753.728895a15.819106 15.819106 0 1 0 15.819106-15.819106 15.819106 15.819106 0 0 0-15.819106 15.819106z" fill="#FFFFFF" ></path></symbol></svg>',(s=>{var e=(t=(t=document.getElementsByTagName("script"))[t.length-1]).getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var n,i,r,a,o,l=function(f,u){u.parentNode.insertBefore(f,u)};if(e&&!s.__iconfont__svg__cssinject__){s.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(f){console&&console.log(f)}}n=function(){var f,u=document.createElement("div");u.innerHTML=s._iconfont_svg_string_4634042,(u=u.getElementsByTagName("svg")[0])&&(u.setAttribute("aria-hidden","true"),u.style.position="absolute",u.style.width=0,u.style.height=0,u.style.overflow="hidden",u=u,(f=document.body).firstChild?l(u,f.firstChild):f.appendChild(u))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(r=n,a=s.document,o=!1,h(),a.onreadystatechange=function(){a.readyState=="complete"&&(a.onreadystatechange=null,c())})}function c(){o||(o=!0,r())}function h(){try{a.documentElement.doScroll("left")}catch{return void setTimeout(h,50)}c()}})(window);const Hu=Pe.defineStore("formToTableComp",{state:()=>({selectArray:[],selectString:""}),actions:{setSelectArray(s){this.selectArray=s},setSelectString(s){this.selectString=s}}}),a3={class:"calculator-content"},o3={class:"calculator-child"},l3={class:"calculator-child"},c3=V.defineComponent({__name:"calculator",setup(s){const e=V.ref(),t=V.ref();return V.onMounted(()=>{e.value=[{type:"Upload",label:"输入",name:"input"}],t.value=[{type:"Upload",label:"输出",name:"output"}]}),(n,i)=>(V.openBlock(),V.createElementBlock("div",a3,[V.createElementVNode("div",o3,[V.createVNode(si.ssForm,{rowContents:e.value,isRowFlex:!0},null,8,["rowContents"])]),V.createElementVNode("div",l3,[V.createVNode(si.ssForm,{rowContents:t.value,isEdit:!1,isRowFlex:!0},null,8,["rowContents"])])]))}}),h3=xa._export_sfc(c3,[["__scopeId","data-v-73db0fe7"]]),Gu=Pe.defineStore("unit",{state:()=>({selectIndex:"",selectMenu:"",selectTitle:[]}),actions:{setSelectIndex(s){this.selectIndex=s},setSelectMenu(s){this.selectMenu=s},setSelectTitle(s){this.selectTitle=s}}}),Wu=(s,e)=>{let t=s,n=e;return Array.isArray(t)&&(t=t==null?void 0:t.map((i,r)=>{if(Array.isArray(i)){let a={};return i=i==null?void 0:i.forEach((o,l)=>{var c;(c=n==null?void 0:n[l])!=null&&c.prop?a[n[l].prop]=o:Array.isArray(o)&&(a.children=Wu(o,n))}),Object.assign(a,{id:r})}else return i})),t},Xu=(s,e,t)=>{let n=s,i=e;return n=n==null?void 0:n.map((r,a)=>{var o,l;return!Array.isArray(r)||!((o=i==null?void 0:i[a])!=null&&o.label)&&!t||(r.unshift(((l=i==null?void 0:i[a])==null?void 0:l.label)??""),r.some(c=>Array.isArray(c))&&(r=r==null?void 0:r.map(c=>{var h;return Array.isArray(c)&&(c=Xu(c,(h=i==null?void 0:i[a])==null?void 0:h.children,t)),c}))),r}),n},u3=(s,e,t)=>{if(e==="")return s==null?void 0:s.filter(n=>(n==null?void 0:n.id)!==t);{const n=e.split("-");return d3(s,n,t)}},d3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=n==null?void 0:n.filter(r=>r.id!==t):n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=qu(r,i,t)),r)),n},qu=(s,e,t)=>{var r,a;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=(r=n.children)==null?void 0:r.filter(o=>o.id!==t):n.children=(a=n.children)==null?void 0:a.map(o=>(o.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),o=qu(o,i,t)),o)),n},f3=(s,e,t)=>{if(e==="")return t;{const n=e.split("-");return p3(s,n,t)}},p3=(s,e,t)=>{let n=s,i=e;return(i==null?void 0:i.length)===0?n=t:n=n==null?void 0:n.map(r=>(r.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),r=ju(r,i,t)),r)),n},ju=(s,e,t)=>{var r;let n=s,i=e;return(i==null?void 0:i.length)===0?n.children=t:n.children=(r=n.children)==null?void 0:r.map(a=>(a.id.toString()===(i==null?void 0:i[0])&&(i==null||i.shift(),a=ju(a,i,t)),a)),n},Yu=Pe.defineStore("modelTableComp",{state:()=>({tableIndex:0,tableShowThree:""}),actions:{setTableIndex(s){this.tableIndex=s},setTableShowThree(s){this.tableShowThree=s}}}),$u=Pe.defineStore("formComp",{state:()=>({objUrl:[],blobUrls:[]}),actions:{setObjUrl(s){this.objUrl=s},setBlobUrls(s){this.blobUrls=s}}}),xl=async s=>{var r,a,o,l,c,h,f;let e=(a=(r=Pe.cloneDeep(s))==null?void 0:r.optionUrl)==null?void 0:a.menuSelect,t=[];e==null||e.forEach(u=>{});let n="";const i=await pn.menuToParent(e);if(i==null||i.forEach(u=>{var d,m,_,g;(u==null?void 0:u.name)===(((g=(_=(m=(d=Pe.cloneDeep(s))==null?void 0:d.optionUrl)==null?void 0:m.groupSelect)==null?void 0:_[0])==null?void 0:g.replaceAll("'",""))??"")&&(n=u==null?void 0:u.id)}),n!==""){const u=(o=i==null?void 0:i[0])==null?void 0:o.compData;let d=(c=(l=u==null?void 0:u.find(_=>(_==null?void 0:_.key)==="header"))==null?void 0:l.contents)==null?void 0:c.map(_=>_==null?void 0:_.label),m=(f=(h=u==null?void 0:u.find(_=>(_==null?void 0:_.key)==="tableContents"))==null?void 0:h.contents)==null?void 0:f.map(_=>(_=_==null?void 0:_.filter(g=>!(g!=null&&g.id)),_));m==null||m.forEach(_=>{t.push(pn.getValueToObjectValue(_,d))})}return t},m3={class:"table-content"},g3={class:"menu-config-wrap"},_3=["onClick"],v3={key:0,class:"viewport-wrap"},x3=["onClick"],y3={title:"选择显示列信息"},M3={class:"menu-config-wrap",style:{padding:"0 0 0 16px","box-sizing":"border-box","max-height":"300px",width:"300px",overflow:"auto"}},b3={class:"form-content"},S3={key:0,class:"dialog-footer"},E3={class:"dialog-footer"},A3={__name:"index",props:{compName:{type:String,default:"",required:!1},operatingForm:{type:Object,default:()=>{}},itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number,changedContent:{type:Object,default:()=>{}},showHeader:{type:Boolean,default:!0}},emits:["change","contentChange","onButtonClick","contentClick","pageChange","rowClick"],setup(s,{emit:e}){const t=V.ref([]),n=$u(Pe.pinia),i=V.ref(null),r=s,a=e,o=V.ref([]),l=V.ref([]),c=V.ref([]),h=V.ref(!1),f=V.ref(),u=Pe.useMenuState(),{activeMenuPath:d}=Pe.storeToRefs(u),m=Yu(Pe.pinia),_=Gh.useModelComp(Pe.pinia),{extraContents:g}=Pe.storeToRefs(_),p=V.ref([]);V.ref(!1);const S=V.ref("");V.ref();const A=V.ref(!0),b=V.ref(0),N=V.ref(!1),C=V.ref(""),P=V.ref(!1),D=V.ref({label:"查看三维模型"}),E=V.ref(!1),y=V.ref(),U=V.ref([]),G=V.ref([]),X=V.ref(!1),Z=V.ref([]),ie=V.ref([]),H=V.ref([]),oe=V.ref(),Y=V.ref(),me=Hu(Pe.pinia),Me=V.ref(),Ce=Gu(Pe.pinia),{selectIndex:Ye,selectMenu:Oe,selectTitle:K}=Pe.storeToRefs(Ce),{selectString:te}=Pe.storeToRefs(me),re=Ku.useLoginState(Pe.pinia),{loginUserInfo:ae}=Pe.storeToRefs(re),Ie=V.ref(720),ge=V.ref("read"),Re=V.ref([]),nt=V.ref(),yt=V.ref(!0),At=I=>{Re.value=I},z=(I,k)=>{nt.value===k?yt.value=!1:yt.value=!0,nt.value=k==null?void 0:k.changeProp},Ot=V.computed(()=>{var I;return(I=o.value)==null?void 0:I.filter(k=>(k==null?void 0:k.label)!=="操作")}),Pt=()=>{P.value=!1},Ct=I=>{a("clickTrigger",I)},Xe=async I=>{var pe,se,he,we,xe,Ee,ke,$,Be;const k=I==null?void 0:I.row;let Q=[];if((pe=k==null?void 0:k.toString())!=null&&pe.includes(".stl")||(se=k==null?void 0:k.toString())!=null&&se.includes(".STL")||(he=k==null?void 0:k.toString())!=null&&he.includes(".obj")||(we=k==null?void 0:k.toString())!=null&&we.includes(".mtl")){let ht,vt=[],Dt={};if(Array.isArray(k)?ht=k:ht=k==null?void 0:k.split(","),ht==null||ht.forEach(Vt=>{Vt.includes(".mtl")?vt.push(Vt):Dt.blob=Dt.blob?Dt.blob+","+Vt:Vt}),(vt==null?void 0:vt.length)>0&&(Dt.mtlBlobs=vt),(Ee=(xe=Object.values(Dt))==null?void 0:xe[0])!=null&&Ee.includes("http:"))Q.push(Dt);else{const Vt=new Blob([Dt.blob],{type:"application/octet-stream;charset=UTF-8"});let ut=URL.createObjectURL(Vt),pt="";(ke=k==null?void 0:k.split("/"))==null||ke.forEach((Te,qt)=>{var ze;qt===((ze=k==null?void 0:k.split("/"))==null?void 0:ze.length)-1&&(pt=Te)}),($=Dt.blob)!=null&&$.includes(".stl")&&(pt=(pt==null?void 0:pt.replaceAll(">",""))+".urdf"),f.value=[{name:pt,blobUrl:ut}],h.value=!0}}else{const ht=await axios.get(k,{responseType:"blob",headers:{"Content-Type":"application/json"}}),vt=new Blob([ht.data],{type:"application/octet-stream;charset=UTF-8"});let Dt=URL.createObjectURL(vt),Vt="";(Be=k==null?void 0:k.split("/"))==null||Be.forEach((ut,pt)=>{var Te;pt===((Te=k==null?void 0:k.split("/"))==null?void 0:Te.length)-1&&(Vt=ut)}),f.value=[{name:Vt,blobUrl:Dt}],h.value=!0}(Q==null?void 0:Q.length)>0&&n.setBlobUrls(Q)},gt=(I,k)=>{if(Object.values(k).length!==0)return Object.values(k).find(Q=>{var pe,se,he;return((pe=Q==null?void 0:Q.toString())==null?void 0:pe.includes(".txt"))||((se=Q==null?void 0:Q.toString())==null?void 0:se.includes(".cpt"))||((he=Q==null?void 0:Q.toString())==null?void 0:he.includes(".obj"))})?[...I,D.value]:I},je=I=>{var se;te.value===""?I==null||I[0]:(I==null?void 0:I.find(he=>(he==null?void 0:he.selectLabel)==="("+te.value+")"))??(I==null||I.find(he=>!(he!=null&&he.selectLabel)));let k=I;(se=o.value)!=null&&se.find(he=>he.prop==="index");let Q=oe.value;const pe=[];return k==null||k.forEach((he,we)=>{var Ee;let xe={};if(Array.isArray(he)){let ke=[];he==null||he.filter($=>!($!=null&&$.id)).forEach(($,Be)=>{var ht,vt,Dt,Vt,ut;if((ht=Q==null?void 0:Q[Be])!=null&&ht.prop&&!Array.isArray($)){let pt={};pt[Q[Be].column]=$,g!=null&&g.value&&((vt=g==null?void 0:g.value)==null?void 0:vt.length)>0&&((Dt=g==null?void 0:g.value)!=null&&Dt.find(Te=>JSON.stringify(Te==null?void 0:Te[0])===JSON.stringify(pt)))&&(ke=(Vt=g==null?void 0:g.value)==null?void 0:Vt.find(Te=>JSON.stringify(Te==null?void 0:Te[0])===JSON.stringify(pt))),ke&&ke.length>0?xe[Q[Be].prop]=ke!=null&&ke.find(Te=>{var qt;return((qt=Object.keys(Te))==null?void 0:qt[0])===Q[Be].column})?(ut=ke==null?void 0:ke.find(Te=>{var qt;return((qt=Object.keys(Te))==null?void 0:qt[0])===Q[Be].column}))==null?void 0:ut[Q[Be].column]:$:xe[Q[Be].prop]=$}})}else xe=he;Array.isArray(he)&&he.some(ke=>ke==null?void 0:ke.id)?pe.push(Object.assign(xe,{id:(Ee=he==null?void 0:he.find(ke=>ke.id))==null?void 0:Ee.id})):xe.id?pe.push(xe):pe.push(Object.assign(xe,{id:we}))}),pe},_t=async I=>{var se,he,we,xe,Ee;let k={};for(let ke in I)I[ke]!==""&&(k["tableData."+ke]=I[ke]);const Q=await pn.filterContents({type:"data",tableId:r==null?void 0:r.index,systemKey:sessionStorage.getItem("systemKey"),pageKey:d.value},k),pe=(we=(he=(se=Pe.cloneDeep(Q))==null?void 0:se.data)==null?void 0:he.result)==null?void 0:we.map(ke=>{var Be;let $=[];return $.push({id:ke.id}),$.push((Be=ke==null?void 0:ke.value)==null?void 0:Be.tableData),$});p.value=je(pn.getTableContents(pe,(Ee=(xe=Pe.cloneDeep(o.value))==null?void 0:xe.map(ke=>ke.label))==null?void 0:Ee.filter(ke=>ke!=="操作")))},ln=async I=>{var pe,se,he,we,xe,Ee,ke,$,Be,ht,vt;const k=(pe=Pe.cloneDeep(o.value))==null?void 0:pe.filter(Dt=>Dt==null?void 0:Dt.isRoute);if((k==null?void 0:k.length)>0){let Dt=(se=k==null?void 0:k[0])==null?void 0:se.prop,Vt=Pe.cloneDeep(d).value+"/"+(I==null?void 0:I[Dt]),ut=Pe.cloneDeep(d).value,pt=await pn.getItemData(Vt,sessionStorage.getItem("systemKey"),"");(pt==null?void 0:pt.length)>0&&(await pn.loadingConstruct(Vt,Vt+`/updateLoading${(he=ae.value)==null?void 0:he.account}`),_.setRouteToChildPath(ut),u.setActiveMenuPath(Vt+`/updateLoading${(we=ae.value)==null?void 0:we.account}`))}let Q=await pn.getItemData(d.value,sessionStorage.getItem("systemKey"),I.id);if(Q=Q==null?void 0:Q.filter(Dt=>Dt.comp!=="methodButton"),Q&&Q.length>0){const Dt=!Array.isArray(K.value)&&((xe=K.value)==null?void 0:xe.key)!=="main"?[]:K.value;Dt.push({key:Oe.value===""?(Ee=I==null?void 0:I.id)==null?void 0:Ee.toString():Oe.value+"-"+((ke=I==null?void 0:I.id)==null?void 0:ke.toString()),value:I[($=Object.keys(I))==null?void 0:$.filter(Vt=>Vt!=="index"&&Vt!=="id")[0]]}),Ce.setSelectMenu(Oe.value===""?(Be=I==null?void 0:I.id)==null?void 0:Be.toString():Oe.value+"-"+((ht=I==null?void 0:I.id)==null?void 0:ht.toString())),Ce.setSelectTitle(Dt),Ce.setSelectIndex((vt=I==null?void 0:I.id)==null?void 0:vt.toString()),a("pageChange",Q)}},O=I=>{var k;(k=Pe.cloneDeep(r.itemData))==null||k.map(Q=>((Q==null?void 0:Q.key)==="tableContents"&&(Q.contents=I),Q))},w=async(I,k,Q,pe)=>{var se;if((pe==null?void 0:pe.data)==="查看"&&(I!=null&&I.every(he=>(he==null?void 0:he.url)&&(he==null?void 0:he.name)))){let he=Pe.cloneDeep(I);he=await((se=Pe.cloneDeep(he))==null?void 0:se.map(async xe=>{var $,Be,ht,vt;const Ee=await si.downloadAvatarApi({url:xe==null?void 0:xe.url});let ke=URL.createObjectURL(Ee.data);return{name:(xe==null?void 0:xe.name)+"."+((vt=($=xe==null?void 0:xe.url)==null?void 0:$.split("."))==null?void 0:vt[((ht=(Be=xe==null?void 0:xe.url)==null?void 0:Be.split("."))==null?void 0:ht.length)-1]),blobUrl:ke}}));let we=await Promise.all(he);f.value=we,h.value=!0}a("contentClick",I,k,Q,{id:r==null?void 0:r.index,type:"table"})},ee=()=>{h.value=!1},de=I=>{a("rowClick",I)};V.watch(()=>r.changedContent,()=>{var Q,pe;if(!r.changedContent)return;let I=(Q=p.value)==null?void 0:Q.map(se=>{var he;return se.id===((he=r.changedContent)==null?void 0:he.id)&&(se={...r.changedContent,id:r.changedContent.newId?r.changedContent.newId:r.changedContent.id},delete se.newId),se});const k=(pe=r.itemData)==null?void 0:pe.map(se=>((se==null?void 0:se.key)==="tableContents"&&(se.contents=I),se));p.value=I,a("contentChange",{contents:k,index:r.index}),a("change",{content:I,index:r==null?void 0:r.index,buttonName:"",id:r==null?void 0:r.index})},{deep:!0,immediate:!0});const _e=()=>{},le=(I,k,Q)=>{var pe,se,he,we,xe,Ee,ke;if(S.value="",X.value=!0,A.value=!0,a("onButtonClick",I,k),I==="删除"){p.value=(pe=Pe.cloneDeep(p.value))==null?void 0:pe.filter(Be=>(Be==null?void 0:Be.id)!==(k==null?void 0:k.id));const $=u3(Me.value,Oe.value,k==null?void 0:k.id);O($),a("change",{content:p.value,singleContent:k,index:r==null?void 0:r.index,type:"delete",buttonName:I,column:o.value})}else if(I==="批量删除"){if(((se=Re.value)==null?void 0:se.length)===0)return Pe.ElMessage.warning("请先勾选操作的数据");a("change",{content:p.value,singleContent:null,selectItems:Re.value,index:r==null?void 0:r.index,type:"batchDelete",buttonName:I,column:o.value})}else if(I==="复制新增"){C.value="新增";const $=Pe.cloneDeep(k),Be=(he=o.value)==null?void 0:he[0],ht=(we=ie.value)==null?void 0:we.find(vt=>(vt==null?void 0:vt.label)==="新增子页面");ot(!0,ht,{data:$,firstCol:Be})}else if(I==="新增")C.value="新增",ve(""),P.value=!0;else if(I==="编辑")C.value="编辑",ve(k),P.value=!0;else if(I==="查看")C.value="查看",ve(k),X.value=!1,A.value=!1,P.value=!0;else if(I==="查看三维模型"){const $={};for(let ht in k)ht!=="id"&&($[ht]=k[ht]);let Be=(xe=Object.values($))==null?void 0:xe[1];m.setTableShowThree(Be)}else if(((Ee=Q==null?void 0:Q.extra)==null?void 0:Ee.type)==="modelExample")C.value=I,E.value=!0;else if(I==="新增子页面"){const $=(ke=ie.value)==null?void 0:ke.find(Be=>(Be==null?void 0:Be.label)==="新增子页面");ot(!1,$)}else if(I==="修改模板"){let $=Pe.cloneDeep(d).value;_.setRouteToChildPath($),u.setActiveMenuPath($+"/")}},lt=async I=>{var Q,pe,se,he,we,xe;const k=await Pe.getInsofDataApi({key:{pageKey:I,type:"structure",systemKey:sessionStorage.getItem("systemKey")}});if(((Q=k==null?void 0:k.data)==null?void 0:Q.code)===200)return Array.isArray((pe=k==null?void 0:k.data)==null?void 0:pe.result)&&((he=(se=k==null?void 0:k.data)==null?void 0:se.result)==null?void 0:he.length)>0?(xe=(we=k==null?void 0:k.data)==null?void 0:we.result)==null?void 0:xe.map(Ee=>{var ke;return{id:Ee==null?void 0:Ee.id,...(ke=Ee==null?void 0:Ee.value)==null?void 0:ke.pageData}}):[]},He=(I,k,Q,pe)=>{var se;a("contentChange",{contents:(se=I==null?void 0:I.compData)==null?void 0:se.map(he=>{var we;return(he==null?void 0:he.key)==="formContent"?{...he,contents:(we=he==null?void 0:he.contents)==null?void 0:we.map(xe=>(xe==null?void 0:xe.key)===k?{...xe,value:Q}:xe)}:he}),index:I==null?void 0:I.id}),u.setActiveMenuPath(""),u.setActiveMenuPath(pe)},st=(I,k)=>{let Q=I==null?void 0:I[k==null?void 0:k.prop],pe=1;if(p.value.some(se=>(se==null?void 0:se[k==null?void 0:k.prop])===Q)){const se=Q;for(;p.value.some(he=>(he==null?void 0:he[k==null?void 0:k.prop])===`${se}(${pe})`);)pe++;Q=`${se}(${pe})`}return Q},ot=async(I,k,Q)=>{var we,xe,Ee,ke,$;let pe,se;const he=st(Q==null?void 0:Q.data,Q==null?void 0:Q.firstCol);if(I?(pe=Pe.cloneDeep(d).value+"/"+((Ee=Q==null?void 0:Q.data)==null?void 0:Ee[(xe=Q==null?void 0:Q.firstCol)==null?void 0:xe.prop]),se=Pe.cloneDeep(d).value+"/"+he):(pe=Pe.cloneDeep(d).value+"/",se=Pe.cloneDeep(pe)+`loading${(we=ae.value)==null?void 0:we.account}`),k){const Be=await pn.getItemData(se,sessionStorage.getItem("systemKey"),"");if((Be==null?void 0:Be.length)>0)if(I){const ht=Be==null?void 0:Be.find(vt=>{var Dt;return((Dt=vt==null?void 0:vt.comp)==null?void 0:Dt.toUpperCase())==="FORM"});ht&&He(ht,(ke=Q==null?void 0:Q.firstCol)==null?void 0:ke.label,he,d.value)}else _.setRouteToChildPath(Pe.cloneDeep(d).value),u.setActiveMenuPath(se);else if(await pn.loadingConstruct(pe,se),I){const ht=await lt(se);if((ht==null?void 0:ht.length)>0){const vt=ht==null?void 0:ht.find(Dt=>{var Vt;return((Vt=Dt==null?void 0:Dt.comp)==null?void 0:Vt.toUpperCase())==="FORM"});vt&&He(vt,($=Q==null?void 0:Q.firstCol)==null?void 0:$.label,he,d.value)}}else _.setRouteToChildPath(Pe.cloneDeep(d).value),u.setActiveMenuPath(se)}else I?(S.value="",Y.value=Q==null?void 0:Q.data,ft(!0,Q==null?void 0:Q.firstCol,he)):(_.setRouteToChildPath(Pe.cloneDeep(d).value),u.setActiveMenuPath(se))},ve=I=>{var se,he,we,xe,Ee,ke;const k=[];let Q=[];for(let $ in I)Array.isArray(I==null?void 0:I[$])&&Q.push($);l.value=Pe.cloneDeep(o.value),(he=pn.getColumnChild((se=Pe.cloneDeep(o.value))==null?void 0:se.filter($=>($==null?void 0:$.label)!=="操作")))==null||he.forEach(($,Be)=>{var ht;Q.find(vt=>vt===($==null?void 0:$.prop))||($!=null&&$.formType&&((ht=$==null?void 0:$.formType)==null?void 0:ht.toUpperCase())==="SELECT"?k.push({label:($==null?void 0:$.label)??"",name:($==null?void 0:$.prop)??"t"+Be,type:!($!=null&&$.formType)||($==null?void 0:$.formType)===""?"Input":$==null?void 0:$.formType,value:(I==null?void 0:I[$==null?void 0:$.prop])??($==null?void 0:$.value)??"",id:($==null?void 0:$.id)??Be,contents:($==null?void 0:$.options)??[],width:1,isFormColHidden:$==null?void 0:$.isFormColHidden,optionUrl:{groupSelect:$==null?void 0:$.groupSelect,menuSelect:$==null?void 0:$.formMenuSelect,type:"Select",selectRelateType:$==null?void 0:$.selectRelateType}}):k.push({label:($==null?void 0:$.label)??"",name:($==null?void 0:$.prop)??"t"+Be,type:!($!=null&&$.formType)||($==null?void 0:$.formType)===""?"Input":$==null?void 0:$.formType,value:(I==null?void 0:I[$==null?void 0:$.prop])??($==null?void 0:$.value)??"",id:($==null?void 0:$.id)??Be,contents:($==null?void 0:$.options)??[],width:1,isFormColHidden:$==null?void 0:$.isFormColHidden}))}),I===""||!I||(S.value=(I==null?void 0:I.id)??"");let pe=pn.getColumnChild((we=Pe.cloneDeep(o.value))==null?void 0:we.filter($=>($==null?void 0:$.label)!=="操作"));U.value&&((xe=U.value)==null?void 0:xe.length)>0&&(U.value=(Ee=Pe.cloneDeep(U).value)==null?void 0:Ee.map($=>{var ht;let Be=(ht=pe==null?void 0:pe.find(vt=>(vt==null?void 0:vt.label)===($==null?void 0:$.label)))==null?void 0:ht.prop;return Be&&($.value=I[Be]),$})),H.value=U.value&&((ke=U.value)==null?void 0:ke.length)>0?pn.getTableFormToForm(U.value):k},Ze=async()=>{var k;await V.nextTick();const I=(k=i.value)==null?void 0:k.$el;I&&pn.Sortable.create(I,{animation:150,handle:".col-drag-icon",ghostClass:"sortable-ghost",onEnd:Q=>{var we;const{oldIndex:pe,newIndex:se}=Q;if(pe===se)return;const he=Ot.value.splice(pe,1)[0];Ot.value.splice(se,0,he),o.value=(we=o.value)==null?void 0:we.slice().sort((xe,Ee)=>{var ke,$;return xe.label==="操作"?1:Ee.label==="操作"?-1:((ke=Ot.value)==null?void 0:ke.indexOf(xe))-(($=Ot.value)==null?void 0:$.indexOf(Ee))})}})};V.onMounted(()=>{y.value=window.innerWidth-240*2});const Mt=()=>{V.nextTick(()=>{Ze()})},ft=(I=!0,k,Q)=>{var we;let pe=pn.getColumnChild((we=Pe.cloneDeep(o.value))==null?void 0:we.filter(xe=>(xe==null?void 0:xe.label)!=="操作")),se,he=Pe.cloneDeep(p.value);if(!Y.value){P.value=!1;return}if(S.value===""){b.value++;let xe;k&&Q?xe={id:b.value,[k==null?void 0:k.prop]:Q}:xe={id:b.value},he.push(Object.assign(Y.value,xe)),se=Object.assign(Y.value,xe)}else he=he==null?void 0:he.map(xe=>{var Ee,ke;if((xe==null?void 0:xe.id)===S.value){let $={};for(let Be in xe){let ht=(Ee=pe==null?void 0:pe.find(vt=>(vt==null?void 0:vt.prop)===Be))==null?void 0:Ee.label;ht?$[Be]=(ke=Y.value)==null?void 0:ke[ht]:$[Be]=xe[Be]}xe=Object.assign($,Y.value),se=xe}return xe});if(p.value=he,I){const xe=f3(Me.value,Oe.value,he);O(xe),P.value=!1,Y.value=void 0,a("change",{content:xe,singleContent:se,index:r==null?void 0:r.index,buttonName:C.value,column:o.value})}},Ge=async(I,k,Q)=>{var ke,$,Be,ht,vt,Dt,Vt,ut,pt,Te,qt;nt.value=Q==null?void 0:Q.prop;const pe=Pe.cloneDeep(r.itemData),se=pe==null?void 0:pe.map(ze=>{var Lt;return(ze==null?void 0:ze.key)==="header"&&((Lt=ze.contents)==null||Lt.map((De,Ht)=>{var M,B,j,J,W,ce,be,Ue,Fe,it,rt,$e,wt,zt,jt,Gt,fe,Ne,Bt;return De.type=De!=null&&De.type?De.type:(J=(j=(B=(M=De==null?void 0:De.key)==null?void 0:M.split("$"))==null?void 0:B[1])==null?void 0:j.split("("))!=null&&J[0]?(ce=(W=pn.FormType)==null?void 0:W.find(bt=>{var mn,Yt,Je,Le;return(bt==null?void 0:bt.key)===((Le=(Je=(Yt=(mn=De==null?void 0:De.key)==null?void 0:mn.split("$"))==null?void 0:Yt[1])==null?void 0:Je.split("("))==null?void 0:Le[0])}))==null?void 0:ce.value:"Input",De.options=De!=null&&De.options?De.options:((Fe=(Ue=(be=De==null?void 0:De.key)==null?void 0:be.split("$"))==null?void 0:Ue[1])==null?void 0:Fe.length)>0?(wt=($e=bo((rt=(it=De==null?void 0:De.key)==null?void 0:it.split("$"))==null?void 0:rt[1]))==null?void 0:$e.split(","))==null?void 0:wt.map(bt=>({label:bt,value:bt})):[],(zt=De==null?void 0:De.key)!=null&&zt.includes("$")&&(De.key=(Gt=(jt=De==null?void 0:De.key)==null?void 0:jt.split("$"))==null?void 0:Gt[0]),De.value=(fe=Object.values(k))==null?void 0:fe[Ht],De.optionUrl=De!=null&&De.formMenuSelect&&((Ne=De==null?void 0:De.formMenuSelect)==null?void 0:Ne.length)>0?{groupSelect:(Bt=De==null?void 0:De.groupSelect)==null?void 0:Bt.split(/[::]/).map(bt=>bt.trim()),menuSelect:De==null?void 0:De.formMenuSelect,selectRelateType:"",type:(De==null?void 0:De.formType)??(De!=null&&De.groupSelect?"Select":"")}:null,De})),ze});let he=Pe.cloneDeep(H.value),we=($=(ke=Pe.cloneDeep(se))==null?void 0:ke.find(ze=>(ze==null?void 0:ze.key)==="header"))==null?void 0:$.contents;he=he==null?void 0:he.map(ze=>{var Lt;return ze.value=(Lt=we==null?void 0:we.find((De,Ht)=>Ht===(ze==null?void 0:ze.id)))==null?void 0:Lt.value,ze});let xe="",Ee=(vt=(ht=(Be=Pe.cloneDeep(se))==null?void 0:Be.find(ze=>(ze==null?void 0:ze.key)==="header"))==null?void 0:ht.contents)==null?void 0:vt.find((ze,Lt)=>{var De,Ht;return(ze==null?void 0:ze.label)===nt.value||(Lt==null?void 0:Lt.toString())===((Ht=(De=nt.value)==null?void 0:De.split("a"))==null?void 0:Ht[1].toString())});if((ut=(Vt=(Dt=Pe.cloneDeep(se))==null?void 0:Dt.find(ze=>(ze==null?void 0:ze.key)==="header"))==null?void 0:Vt.contents)==null||ut.forEach(ze=>{var Lt,De,Ht,M,B;xe===""&&((Ht=(De=(Lt=ze==null?void 0:ze.optionUrl)==null?void 0:Lt.groupSelect)==null?void 0:De[1])!=null&&Ht.includes("["))&&(xe=(B=(M=ze==null?void 0:ze.optionUrl)==null?void 0:M.groupSelect)==null?void 0:B[1])}),(pt=Ee==null?void 0:Ee.optionUrl)!=null&&pt.menuSelect){let ze=await xl(Ee),Lt;if(ze==null||ze.forEach(De=>{var Ht,M,B,j,J,W,ce,be,Ue,Fe;xe===((M=(Ht=Ee==null?void 0:Ee.optionUrl)==null?void 0:Ht.groupSelect)==null?void 0:M[1])&&((J=(j=(B=Ee==null?void 0:Ee.optionUrl)==null?void 0:B.groupSelect)==null?void 0:j[1])!=null&&J.includes("["))&&((Fe=Pe.cloneDeep(De))==null?void 0:Fe[(Ue=(be=(ce=(W=Ee==null?void 0:Ee.optionUrl)==null?void 0:W.groupSelect)==null?void 0:ce[1])==null?void 0:be.replaceAll("[",""))==null?void 0:Ue.replaceAll("]","")])===(Ee==null?void 0:Ee.value)&&(Lt=De)}),Lt){let De=Pe.cloneDeep(he);De=De==null?void 0:De.map(M=>{var B,j,J,W,ce,be,Ue,Fe,it,rt,$e;return(Lt!=null&&Lt[M==null?void 0:M.label]||Lt!=null&&Lt[(W=(J=(j=(B=M==null?void 0:M.optionUrl)==null?void 0:B.groupSelect)==null?void 0:j[1])==null?void 0:J.replaceAll("[",""))==null?void 0:W.replaceAll("]","")])&&((Ue=(be=(ce=M==null?void 0:M.optionUrl)==null?void 0:ce.groupSelect)==null?void 0:be[1])!=null&&Ue.includes("["))&&(M.value=(Lt==null?void 0:Lt[M==null?void 0:M.label])||(Lt==null?void 0:Lt[($e=(rt=(it=(Fe=M==null?void 0:M.optionUrl)==null?void 0:Fe.groupSelect)==null?void 0:it[1])==null?void 0:rt.replaceAll("[",""))==null?void 0:$e.replaceAll("]","")])),M}),p.value=(Te=Pe.cloneDeep(p.value))==null?void 0:Te.map(M=>{if((M==null?void 0:M.id)===(k==null?void 0:k.id)){const B={};return De==null||De.forEach(j=>{B[j.name]=j.value}),B.id=M==null?void 0:M.id,B}return M});let Ht=Pe.cloneDeep(De);Ht=Ht==null?void 0:Ht.map(M=>{var B,j,J,W;return(j=(B=M==null?void 0:M.optionUrl)==null?void 0:B.menuSelect)!=null&&j.some(ce=>ce==null?void 0:ce.includes)&&(M.optionUrl.menuSelect=(W=(J=M==null?void 0:M.optionUrl)==null?void 0:J.menuSelect)==null?void 0:W.map(ce=>{var be,Ue,Fe,it;if(ce!=null&&ce.includes("[")){let rt=(Ue=(be=ce==null?void 0:ce.replaceAll("[","").replaceAll("]",""))==null?void 0:be.split(":"))==null?void 0:Ue[1];ce=(it=(Fe=Pe.cloneDeep(De))==null?void 0:Fe.find($e=>($e==null?void 0:$e.label)===rt))==null?void 0:it.value}return ce})),M}),p.value=(qt=Pe.cloneDeep(p.value))==null?void 0:qt.map(M=>{if((M==null?void 0:M.id)===(k==null?void 0:k.id)){const B={};return Ht==null||Ht.forEach(j=>{B[j.name]=j.value}),B.id=M==null?void 0:M.id,B}return M})}}},Rt=async I=>{var xe,Ee,ke,$,Be,ht,vt,Dt,Vt;if(!I)return;Y.value=I,a("onFormChange",I);const k=Pe.cloneDeep(r.itemData),Q=k==null?void 0:k.map(ut=>{var pt;return(ut==null?void 0:ut.key)==="header"&&((pt=ut.contents)==null||pt.map((Te,qt)=>{var ze,Lt,De,Ht,M,B,j,J,W,ce,be,Ue,Fe,it,rt,$e,wt,zt,jt;return Te.type=Te!=null&&Te.type?Te.type:(Ht=(De=(Lt=(ze=Te==null?void 0:Te.key)==null?void 0:ze.split("$"))==null?void 0:Lt[1])==null?void 0:De.split("("))!=null&&Ht[0]?(B=(M=pn.FormType)==null?void 0:M.find(Gt=>{var fe,Ne,Bt,bt;return(Gt==null?void 0:Gt.key)===((bt=(Bt=(Ne=(fe=Te==null?void 0:Te.key)==null?void 0:fe.split("$"))==null?void 0:Ne[1])==null?void 0:Bt.split("("))==null?void 0:bt[0])}))==null?void 0:B.value:"Input",Te.options=Te!=null&&Te.options?Te.options:((W=(J=(j=Te==null?void 0:Te.key)==null?void 0:j.split("$"))==null?void 0:J[1])==null?void 0:W.length)>0?(Fe=(Ue=bo((be=(ce=Te==null?void 0:Te.key)==null?void 0:ce.split("$"))==null?void 0:be[1]))==null?void 0:Ue.split(","))==null?void 0:Fe.map(Gt=>({label:Gt,value:Gt})):[],(it=Te==null?void 0:Te.key)!=null&&it.includes("$")&&(Te.key=($e=(rt=Te==null?void 0:Te.key)==null?void 0:rt.split("$"))==null?void 0:$e[0]),Te.value=(wt=Object.values(I))==null?void 0:wt[qt],Te.optionUrl=Te!=null&&Te.formMenuSelect&&((zt=Te==null?void 0:Te.formMenuSelect)==null?void 0:zt.length)>0?{groupSelect:(jt=Te==null?void 0:Te.groupSelect)==null?void 0:jt.split(/[::]/).map(Gt=>Gt.trim()),menuSelect:Te==null?void 0:Te.formMenuSelect,selectRelateType:"",type:(Te==null?void 0:Te.formType)??(Te!=null&&Te.groupSelect?"Select":"")}:null,Te})),ut});let pe=Pe.cloneDeep(H.value),se=(Ee=(xe=Pe.cloneDeep(Q))==null?void 0:xe.find(ut=>(ut==null?void 0:ut.key)==="header"))==null?void 0:Ee.contents;if(pe=pe==null?void 0:pe.map(ut=>{var pt;return ut.value=(pt=se==null?void 0:se.find((Te,qt)=>qt===(ut==null?void 0:ut.id)))==null?void 0:pt.value,ut}),!yt.value)return;let he="",we=(Be=($=(ke=Pe.cloneDeep(Q))==null?void 0:ke.find(ut=>(ut==null?void 0:ut.key)==="header"))==null?void 0:$.contents)==null?void 0:Be.find((ut,pt)=>{var Te,qt;return(ut==null?void 0:ut.label)===nt.value||(pt==null?void 0:pt.toString())===((qt=(Te=nt.value)==null?void 0:Te.split("a"))==null?void 0:qt[1].toString())});if((Dt=(vt=(ht=Pe.cloneDeep(Q))==null?void 0:ht.find(ut=>(ut==null?void 0:ut.key)==="header"))==null?void 0:vt.contents)==null||Dt.forEach(ut=>{var pt,Te,qt,ze,Lt;he===""&&((qt=(Te=(pt=ut==null?void 0:ut.optionUrl)==null?void 0:pt.groupSelect)==null?void 0:Te[1])!=null&&qt.includes("["))&&(he=(Lt=(ze=ut==null?void 0:ut.optionUrl)==null?void 0:ze.groupSelect)==null?void 0:Lt[1])}),(Vt=we==null?void 0:we.optionUrl)!=null&&Vt.menuSelect&&yt.value){let ut=await xl(we),pt;if(ut==null||ut.forEach(Te=>{var qt,ze,Lt,De,Ht,M,B,j,J,W;he===((ze=(qt=we==null?void 0:we.optionUrl)==null?void 0:qt.groupSelect)==null?void 0:ze[1])&&((Ht=(De=(Lt=we==null?void 0:we.optionUrl)==null?void 0:Lt.groupSelect)==null?void 0:De[1])!=null&&Ht.includes("["))&&((W=Pe.cloneDeep(Te))==null?void 0:W[(J=(j=(B=(M=we==null?void 0:we.optionUrl)==null?void 0:M.groupSelect)==null?void 0:B[1])==null?void 0:j.replaceAll("[",""))==null?void 0:J.replaceAll("]","")])===(we==null?void 0:we.value)&&(pt=Te)}),pt){let Te=Pe.cloneDeep(pe);Te=Te==null?void 0:Te.map(ze=>{var Lt,De,Ht,M,B,j,J,W,ce,be,Ue;return(pt!=null&&pt[ze==null?void 0:ze.label]||pt!=null&&pt[(M=(Ht=(De=(Lt=ze==null?void 0:ze.optionUrl)==null?void 0:Lt.groupSelect)==null?void 0:De[1])==null?void 0:Ht.replaceAll("[",""))==null?void 0:M.replaceAll("]","")])&&((J=(j=(B=ze==null?void 0:ze.optionUrl)==null?void 0:B.groupSelect)==null?void 0:j[1])!=null&&J.includes("["))&&(ze.value=(pt==null?void 0:pt[ze==null?void 0:ze.label])||(pt==null?void 0:pt[(Ue=(be=(ce=(W=ze==null?void 0:ze.optionUrl)==null?void 0:W.groupSelect)==null?void 0:ce[1])==null?void 0:be.replaceAll("[",""))==null?void 0:Ue.replaceAll("]","")])),ze}),H.value=Te;let qt=Pe.cloneDeep(Te);qt=qt==null?void 0:qt.map(ze=>{var Lt,De,Ht,M;return(De=(Lt=ze==null?void 0:ze.optionUrl)==null?void 0:Lt.menuSelect)!=null&&De.some(B=>B==null?void 0:B.includes)&&(ze.optionUrl.menuSelect=(M=(Ht=ze==null?void 0:ze.optionUrl)==null?void 0:Ht.menuSelect)==null?void 0:M.map(B=>{var j,J,W,ce;if(B!=null&&B.includes("[")){let be=(J=(j=B==null?void 0:B.replaceAll("[","").replaceAll("]",""))==null?void 0:j.split(":"))==null?void 0:J[1];B=(ce=(W=Pe.cloneDeep(Te))==null?void 0:W.find(Ue=>(Ue==null?void 0:Ue.label)===be))==null?void 0:ce.value}return B})),ze}),H.value=qt}}yt.value=!1},q=I=>I?(I==null?void 0:I.toUpperCase())==="INPUT"?"TEXTAREA":I:"TEXTAREA",qe=I=>{var Q,pe,se,he,we,xe;ve("");const k=(Q=H.value)==null?void 0:Q.reduce((Ee,ke)=>(Ee[ke.name]=ke.value,Ee),{});((pe=Object.keys(k))==null?void 0:pe.length)>0&&(Y.value=k,S.value="",b.value=(se=p.value)==null?void 0:se.length,Z.value=(he=ie.value)==null?void 0:he.filter(Ee=>(Ee==null?void 0:Ee.label)!=="新增"),o.value=(xe=(we=l.value)==null?void 0:we.filter(Ee=>(Ee==null?void 0:Ee.label)!=="操作"))==null?void 0:xe.map(Ee=>{var ke;return{...Ee,type:"edit",optionUrl:Ee!=null&&Ee.formMenuSelect&&((ke=Ee==null?void 0:Ee.formMenuSelect)==null?void 0:ke.length)>0?{groupSelect:Ee==null?void 0:Ee.groupSelect,menuSelect:Ee==null?void 0:Ee.formMenuSelect,selectRelateType:"",type:Ee==null?void 0:Ee.formType}:null,columnType:q(Ee==null?void 0:Ee.formType)}}),I==="createClick"&&ft(!1))};V.watch(()=>[r.itemData,te.value,Ye.value,Oe.value,g==null?void 0:g.value],()=>{var Ee,ke,$,Be,ht,vt,Dt,Vt,ut,pt,Te,qt,ze,Lt,De,Ht,M,B,j,J,W,ce,be,Ue,Fe,it,rt,$e,wt,zt,jt,Gt;const I=(Ee=Pe.cloneDeep(r.itemData))==null?void 0:Ee.filter(fe=>(fe==null?void 0:fe.key)==="header");(ke=Pe.cloneDeep(r.itemData))==null||ke.filter(fe=>(fe==null?void 0:fe.key)==="tableIndexColumn")[0];const k=($=Pe.cloneDeep(r.itemData))==null?void 0:$.find(fe=>(fe==null?void 0:fe.key)==="page"),Q=(Be=Pe.cloneDeep(r.itemData))==null?void 0:Be.find(fe=>(fe==null?void 0:fe.key)==="rowButton"),pe=(ht=Pe.cloneDeep(r.itemData))==null?void 0:ht.find(fe=>(fe==null?void 0:fe.key)==="extraButton"),se=(vt=Pe.cloneDeep(r.itemData))==null?void 0:vt.filter(fe=>(fe==null?void 0:fe.key)==="tableContents"),he=(Dt=Pe.cloneDeep(r.itemData))==null?void 0:Dt.filter(fe=>(fe==null?void 0:fe.key)==="tableIndex");U.value=(pt=(ut=(Vt=Pe.cloneDeep(r.itemData))==null?void 0:Vt.filter(fe=>(fe==null?void 0:fe.key)==="tableToForm"))==null?void 0:ut[0])==null?void 0:pt.contents,N.value=(k==null?void 0:k.contents)??!1;let we=[];te.value===""?we=I==null?void 0:I[0]:we=(I==null?void 0:I.find(fe=>(fe==null?void 0:fe.selectLabel)==="("+te.value+")"))??(I==null?void 0:I.find(fe=>!(fe!=null&&fe.selectLabel)));let xe=[];if(te.value===""?xe=he==null?void 0:he[0]:xe=(he==null?void 0:he.find(fe=>(fe==null?void 0:fe.selectLabel)==="("+te.value+")"))??(he==null?void 0:he.find(fe=>!(fe!=null&&fe.selectLabel))),((Te=we==null?void 0:we.contents)==null?void 0:Te.length)>0){let fe=[];if(we!=null&&we.contents.some(Je=>Array.isArray(Je)&&(Je==null?void 0:Je.find(Le=>Le.children))))Oe.value===""?fe=(ze=(qt=pn.getGradeColumns(Pe.cloneDeep(we==null?void 0:we.contents)))==null?void 0:qt[0])==null?void 0:ze.filter(Je=>!Array.isArray(Je)):(Oe.value.split("-"),fe=(Lt=pn.getGradeColumns(Pe.cloneDeep(we==null?void 0:we.contents)))==null?void 0:Lt[0]);else{const Je=we!=null&&we.contents.some(Le=>Array.isArray(Le))?(De=we==null?void 0:we.contents)==null?void 0:De[0]:we==null?void 0:we.contents;Je==null||Je.forEach((Le,Nt)=>{var cn;fe.push({label:(Le==null?void 0:Le.label)??"",prop:(Le==null?void 0:Le.label)==="操作"?"operate":(Le==null?void 0:Le.prop)??"a"+Nt,width:Le!=null&&Le.width?parseInt(Le.width):"",fixed:(Le==null?void 0:Le.fixed)??void 0,sortable:(Le==null?void 0:Le.sortable)??!1,align:(Le==null?void 0:Le.align)??"left",showOverflowTooltip:(Le==null?void 0:Le.showOverflowTooltip)??!0,isNotDrag:(Le==null?void 0:Le.isNotDrag)??!1,isEditCol:(Le==null?void 0:Le.isEditCol)??!1,isOperate:(Le==null?void 0:Le.isOperate)??!1,id:(Le==null?void 0:Le.id)??Nt,type:(Le==null?void 0:Le.label)==="操作"?"operate":void 0,formType:(Le==null?void 0:Le.formType)??(Le!=null&&Le.groupSelect?"Select":""),isTableColHidden:Le==null?void 0:Le.isTableColHidden,isFormColHidden:Le==null?void 0:Le.isFormColHidden,options:(Le==null?void 0:Le.options)??[],value:(Le==null?void 0:Le.value)??"",formMenuSelect:(Le==null?void 0:Le.formMenuSelect)??[],isRoute:(Le==null?void 0:Le.isRoute)??!1,groupSelect:Le!=null&&Le.groupSelect?(cn=Le==null?void 0:Le.groupSelect)==null?void 0:cn.replaceAll('"',"").split(":"):[]})})}o.value=fe,c.value=fe,t.value=(Ht=o.value)==null?void 0:Ht.map(Je=>Je==null?void 0:Je.label);let Ne=(B=(M=pn.getAllLeafNodes(Pe.cloneDeep(o.value)))==null?void 0:M.filter(Je=>(Je==null?void 0:Je.type)!=="operate"))==null?void 0:B.map((Je,Le)=>({prop:(Je==null?void 0:Je.prop)??"a"+Le,column:Je.label}));oe.value=Ne;let Bt=[];te.value===""?Bt=se==null?void 0:se[0]:Bt=(se==null?void 0:se.find(Je=>(Je==null?void 0:Je.selectLabel)==="("+te.value+")"))??(se==null?void 0:se.find(Je=>!(Je!=null&&Je.selectLabel)));let bt=Array.isArray((j=Bt==null?void 0:Bt.contents)==null?void 0:j[0])&&((J=Bt==null?void 0:Bt.contents)!=null&&J[0].every(Je=>Array.isArray(Je)))?(W=Pe.cloneDeep(Bt==null?void 0:Bt.contents))==null?void 0:W[0]:Pe.cloneDeep(Bt==null?void 0:Bt.contents);xe!=null&&xe.contents&&((ce=xe==null?void 0:xe.contents)==null?void 0:ce.length)!==0&&(bt=(be=Pe.cloneDeep(bt))==null?void 0:be.map((Je,Le)=>{if(!Array.isArray(Je)){let Nt={};for(let cn in Je)cn!=="id"&&cn!=="index"&&(Nt[cn]=Je[cn]);Je=Object.values(Nt)}return Je}));const mn=!!((Ue=o.value)!=null&&Ue.find(Je=>Je.prop==="index"));bt=Xu(Pe.cloneDeep(bt),xe==null?void 0:xe.contents,mn);const Yt=[];bt==null||bt.forEach((Je,Le)=>{var cn;let Nt={};if(Array.isArray(Je)){let $t=[];Je==null||Je.filter(Jt=>!(Jt!=null&&Jt.id)).forEach((Jt,nn)=>{var hi,kn,St,ki,x,v;if((hi=Ne==null?void 0:Ne[nn])!=null&&hi.prop&&!Array.isArray(Jt)){let R={};R[Ne[nn].column]=Jt,g!=null&&g.value&&((kn=g==null?void 0:g.value)==null?void 0:kn.length)>0&&((St=g==null?void 0:g.value)!=null&&St.find(T=>JSON.stringify(T==null?void 0:T[0])===JSON.stringify(R)))&&($t=(ki=g==null?void 0:g.value)==null?void 0:ki.find(T=>JSON.stringify(T==null?void 0:T[0])===JSON.stringify(R))),$t&&$t.length>0?Nt[Ne[nn].prop]=$t!=null&&$t.find(T=>{var L;return((L=Object.keys(T))==null?void 0:L[0])===Ne[nn].column})?(x=$t==null?void 0:$t.find(T=>{var L;return((L=Object.keys(T))==null?void 0:L[0])===Ne[nn].column}))==null?void 0:x[Ne[nn].column]:Jt:Nt[Ne[nn].prop]=Jt}else Array.isArray(Jt)&&((v=Ne[nn])!=null&&v.prop?Nt[Ne[nn].prop]=Jt:Nt.children=Wu(Jt,Ne))})}else Nt=Je;Array.isArray(Je)&&Je.some($t=>$t==null?void 0:$t.id)?Yt.push(Object.assign(Nt,{id:(cn=Je==null?void 0:Je.find($t=>$t.id))==null?void 0:cn.id})):Nt.id?Yt.push(Nt):Yt.push(Object.assign(Nt,{id:Le.toString()}))}),p.value=Yt}else o.value=[],l.value=[],p.value=[];((Fe=Q==null?void 0:Q.contents)==null?void 0:Fe.length)>0?G.value=Q==null?void 0:Q.contents:G.value=[],((it=pe==null?void 0:pe.contents)==null?void 0:it.length)>0?((($e=(rt=Pe.cloneDeep(o.value))==null?void 0:rt.filter(Ne=>(Ne==null?void 0:Ne.type)!=="operate"))==null?void 0:$e.every(Ne=>(Ne==null?void 0:Ne.formType)==="Select"))?pe==null||pe.contents.push({label:"新增子页面"}):pe.contents=(wt=pe==null?void 0:pe.contents)==null?void 0:wt.filter(Ne=>(Ne==null?void 0:Ne.label)!=="修改模板"),Z.value=pe==null?void 0:pe.contents,ie.value=pe==null?void 0:pe.contents):(Z.value=[],ie.value=[]),b.value=((zt=p==null?void 0:p.value)==null?void 0:zt.length)??0,Me.value=p.value,ge.value==="edit"&&(o.value=(Gt=(jt=l.value)==null?void 0:jt.filter(fe=>(fe==null?void 0:fe.label)!=="操作"))==null?void 0:Gt.map(fe=>{var Ne;return{...fe,type:"edit",optionUrl:fe!=null&&fe.formMenuSelect&&((Ne=fe==null?void 0:fe.formMenuSelect)==null?void 0:Ne.length)>0?{groupSelect:fe==null?void 0:fe.groupSelect,menuSelect:fe==null?void 0:fe.formMenuSelect,selectRelateType:"",type:fe==null?void 0:fe.formType}:null}}),qe())},{deep:!0,immediate:!0}),V.watch(()=>r==null?void 0:r.operatingForm,I=>{I!=null&&I.form&&(ve(I==null?void 0:I.form),C.value=I==null?void 0:I.dialogTitle,X.value=!0,P.value=!0)},{immediate:!0,deep:!0});const ye=I=>{ge.value=I,I==="edit"?qe("viewChange"):(Z.value=ie.value,o.value=c.value)};V.ref(!1);const et=I=>{qe("createClick")},Ae=(I,k,Q)=>{var pe,se;Y.value=Pe.cloneDeep(I),S.value=I==null?void 0:I.id,b.value=(pe=p.value)==null?void 0:pe.length,C.value=(I==null?void 0:I.id)===((se=p.value)==null?void 0:se.length)?"新增":"编辑",ft(!0)};return(I,k)=>{var Ee,ke;const Q=V.resolveComponent("el-icon"),pe=V.resolveComponent("el-popover"),se=V.resolveComponent("svg-icon"),he=V.resolveComponent("el-checkbox"),we=V.resolveComponent("el-checkbox-group"),xe=V.resolveComponent("el-button");return V.openBlock(),V.createElementBlock("div",m3,[(V.openBlock(),V.createBlock(si.ssTable,{columns:o.value,checkedColumns:t.value,key:o.value,tableData:p.value,viewport:ge.value,isShowPagination:N.value,isShowEdit:!1,isShowDelete:!1,onDbClickRow:ln,extraButton:Z.value,onContentClick:w,onRowClick:de,onSelectChange:At,onCellChange:Ae,onChange:Ge,onPreview:Xe},V.createSlots({headerButton:V.withCtx($=>[s.showHeader?(V.openBlock(),V.createBlock(ad,{key:0,compName:s.compName,buttons:$.buttons,onButtonClick:k[0]||(k[0]=Be=>le(Be,"",{})),columns:o.value,onFilter:_t},null,8,["compName","buttons","columns"])):V.createCommentVNode("",!0)]),viewport:V.withCtx(()=>{var $;return[(($=p.value)==null?void 0:$.length)>0?(V.openBlock(),V.createElementBlock("div",v3,[V.createElementVNode("span",{title:"只读视图",onClick:k[2]||(k[2]=Be=>ye("read"))},[V.createVNode(se,{name:"readTable",class:"view-icon"})]),V.createElementVNode("span",{title:"编辑视图",onClick:k[3]||(k[3]=Be=>ye("edit"))},[V.createVNode(se,{name:"editTable",class:"view-icon"})])])):V.createCommentVNode("",!0)]}),rowCreate:V.withCtx(({row:$})=>[V.createElementVNode("span",{title:"新增",class:"row-create-wrap",onClick:Be=>et()},[V.createVNode(se,{name:"rowCreate",style:{width:"10px",height:"10px"}})],8,x3)]),operateCol:V.withCtx(()=>[V.createVNode(pe,{title:"选择显示列信息",placement:"left-start","popper-class":"menu-operate-popover",trigger:"click",onShow:Mt},{reference:V.withCtx(()=>[V.createElementVNode("span",y3,[V.createVNode(se,{name:"operate",style:{width:"15px",height:"15px",cursor:"pointer"}})])]),default:V.withCtx(()=>[V.createElementVNode("div",M3,[V.createVNode(we,{modelValue:t.value,"onUpdate:modelValue":k[4]||(k[4]=$=>t.value=$),style:{height:"100%"},min:2,ref_key:"checkboxGroupRef",ref:i},{default:V.withCtx(()=>[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(Ot.value,$=>(V.openBlock(),V.createBlock(he,{key:$.label,label:$.label,value:$.label,style:{width:"100%",marginRight:0}},{default:V.withCtx(()=>[V.createElementVNode("span",null,V.toDisplayString($.label),1),V.createVNode(se,{name:"drag",class:"col-drag-icon",style:{width:"15px",height:"15px",cursor:"move",color:"grey",position:"absolute",right:"5px"}})]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])])]),_:1})]),_:2},[((Ee=G.value)==null?void 0:Ee.length)>0?{name:"actions",fn:V.withCtx(({item:$})=>[V.createVNode(pe,{title:"",placement:"left-start","popper-class":"menu-operate-popover"},{reference:V.withCtx(()=>[V.createVNode(Q,null,{default:V.withCtx(()=>[V.createVNode(V.unref(Pe.more_filled_default))]),_:1})]),default:V.withCtx(()=>[V.createElementVNode("div",g3,[(V.openBlock(!0),V.createElementBlock(V.Fragment,null,V.renderList(gt(G.value,$),(Be,ht)=>(V.openBlock(),V.createElementBlock("div",{class:"menu-config-item",key:ht,onClick:vt=>le(Be==null?void 0:Be.label,$,{extra:Be})},[V.createElementVNode("div",{style:V.normalizeStyle({color:Be==null?void 0:Be.textColor}),class:"extra-button-label"},V.toDisplayString(Be==null?void 0:Be.label),5)],8,_3))),128))])]),_:2},1024)]),key:"0"}:void 0,((ke=p.value)==null?void 0:ke.length)>0?{name:"batchButton",fn:V.withCtx($=>[V.createVNode(ld,{buttons:$.buttons,onButtonClick:k[1]||(k[1]=Be=>le(Be,"",{}))},null,8,["buttons"])]),key:"1"}:void 0]),1032,["columns","checkedColumns","tableData","viewport","isShowPagination","extraButton"])),V.createVNode(si.ssDialog,{title:C.value,visible:P.value,width:Ie.value,onBeforeDestroy:Pt},{default:V.withCtx(()=>[V.createElementVNode("div",b3,[V.createVNode(si.ssForm,{rowContents:H.value,isEnableWrap:!1,onChange:Rt,onClickTrigger:Ct,isEdit:A.value,onBlurChange:z},null,8,["rowContents","isEdit"])])]),footer:V.withCtx(()=>[X.value?(V.openBlock(),V.createElementBlock("div",S3,[V.createVNode(xe,{onClick:k[5]||(k[5]=$=>P.value=!1),id:"themeBorderButton"},{default:V.withCtx(()=>k[8]||(k[8]=[V.createTextVNode(V.toDisplayString("取消"))])),_:1,__:[8]}),V.createVNode(xe,{class:"ok-button",onClick:ft,id:"themeButton"},{default:V.withCtx(()=>k[9]||(k[9]=[V.createTextVNode(V.toDisplayString("确认"))])),_:1,__:[9]})])):V.createCommentVNode("",!0)]),_:1},8,["title","visible","width"]),V.createVNode(si.ssDialog,{title:C.value,visible:E.value,width:y.value,onBeforeDestroy:k[7]||(k[7]=$=>E.value=!1)},{default:V.withCtx(()=>[V.createVNode(h3)]),footer:V.withCtx(()=>[V.createElementVNode("div",E3,[V.createVNode(xe,{onClick:k[6]||(k[6]=$=>E.value=!1),class:"cancel-button",id:"themeBorderButton"},{default:V.withCtx(()=>k[10]||(k[10]=[V.createTextVNode(V.toDisplayString("取消"))])),_:1,__:[10]}),V.createVNode(xe,{class:"ok-button",onClick:_e,id:"themeButton"},{default:V.withCtx(()=>k[11]||(k[11]=[V.createTextVNode(V.toDisplayString("确认"))])),_:1,__:[11]})])]),_:1},8,["title","visible","width"]),h.value?(V.openBlock(),V.createBlock(si.ssFilePreview,{key:0,fileDataList:f.value,onDestroy:ee},null,8,["fileDataList"])):V.createCommentVNode("",!0)])}}},w3=xa._export_sfc(A3,[["__scopeId","data-v-850ede5b"]]);exports.ACESFilmicToneMapping=qh;exports.AmbientLight=wu;exports.Box3=ei;exports.BoxGeometry=Bi;exports.BufferAttribute=dn;exports.BufferGeometry=hn;exports.CatmullRomCurve3=vu;exports.Color=xt;exports.Controls=Op;exports.DirectionalLight=Au;exports.DoubleSide=wn;exports.Euler=Ln;exports.Float32BufferAttribute=Ut;exports.FrontSide=Xn;exports.GridHelper=Fp;exports.Group=Kn;exports.HemisphereLight=wp;exports.LOD=fu;exports.Line=Ea;exports.LineBasicMaterial=bi;exports.LoadingManager=Su;exports.MOUSE=cd;exports.MTLLoader=ha;exports.MathUtils=Ki;exports.Matrix4=Tt;exports.Mesh=en;exports.MeshPhongMaterial=Dn;exports.MeshStandardMaterial=yu;exports.OBJLoader=ca;exports.PCDLoader=zu;exports.PCFSoftShadowMap=Xh;exports.PerspectiveCamera=bn;exports.Plane=Ui;exports.PlaneGeometry=hr;exports.PointLight=Eu;exports.Points=Cs;exports.PointsMaterial=Ii;exports.Quaternion=zn;exports.Ray=Fs;exports.SRGBColorSpace=Qt;exports.STLLoader=nr;exports.Scene=Pl;exports.ShadowMaterial=up;exports.Spherical=Tu;exports.TOUCH=hd;exports.TubeGeometry=Ol;exports.URDFLoader=Vu;exports.Vector2=Qe;exports.Vector3=F;exports.WebGLRenderer=yg;exports.Xe=qg;exports.formGetOptions=bo;exports.getSelectRow=xl;exports.ssTable=w3;exports.useFormComp=$u;exports.useFormToTableComp=Hu;exports.useModelLoader=r3;exports.useTableComp=Yu;exports.useUnit=Gu;
|