@tomorrowevening/hermes 0.0.75 → 0.0.76
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/hermes.cjs.js +15 -15
- package/dist/hermes.es.js +1528 -1446
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/editor/multiView/CameraWindow.d.ts +3 -1
package/dist/hermes.cjs.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three"),vn=require("tweakpane"),bn=require("@tweakpane/plugin-essentials"),E=require("react"),en=require("framer-motion");function yn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const En=yn(bn),Ct=()=>{},Sn=()=>{};function lt(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function He(e,n,a){return Math.min(n,Math.max(e,a))}function Pt(e,n,a){return(a-e)/(n-e)}function jt(e,n,a){return e*(1-a)+n*a}function xn(e,n){const a=e-n;return Math.sqrt(a*a)}function tn(){return Math.round(Math.random()*1e6).toString()}function nn(e){return e.r!==void 0&&e.g!==void 0&&e.b!==void 0}function an(e){const n=Math.round(e.r*255),a=Math.round(e.g*255),t=Math.round(e.b*255),i=h=>{const d=h.toString(16);return d.length===1?"0"+d:d},c=i(n),u=i(a),r=i(t);return"#"+c+u+r}function It(e,n=1){return Number(e.toFixed(n))}exports.totalThreeObjects=0;const Nt=()=>{exports.totalThreeObjects=0},xt=e=>{if(!e)return;let n=e.name.replaceAll(" ","").replaceAll("/",".");if(n.length===0&&(n=`obj_${exports.totalThreeObjects}`,exports.totalThreeObjects++),e.parent!==null&&e.parent.uuid.length>0&&(n=`${e.parent.uuid}.${n}`),e.uuid=n,e.isMesh!==void 0){const a=e;if(Array.isArray(a.material))a.material.forEach((t,i)=>{t.uuid=`${n}.material.${i}`});else{const t=a.material;t.uuid=`${n}.material`}}e.children.forEach(a=>xt(a))},Cn=e=>{e?.dispose()},rn=e=>{e&&(Array.isArray(e)?e.forEach(n=>n.dispose()):e.dispose())},ut=e=>{if(e){for(;e.children.length>0;){const n=e.children[0];n.type==="Audio"?(n.pause(),n.parent&&n.parent.remove(n)):ut(n)}if(e.parent&&e.parent.remove(e),e.isMesh){const n=e;n.geometry?.dispose(),rn(n.material)}e.dispose!==void 0&&e.dispose()}};class wn{components=new Map;listen;_appID="";_debugEnabled;_broadcastChannel=void 0;_webSocket=void 0;_mode="app";_connected=!1;_useBC=!1;constructor(n,a,t=!0){this._appID=n,this._debugEnabled=a,a&&(this._useBC=t,t?(this._broadcastChannel=new BroadcastChannel(n),this._broadcastChannel.addEventListener("message",this.messageHandler)):(this._webSocket=new WebSocket(n),this._webSocket.addEventListener("open",this.openHandler),this._webSocket.addEventListener("close",this.closeHandler),this._webSocket.addEventListener("message",this.messageHandler)))}addComponent(n,a){this.components.set(n,a)}dispose(){this._broadcastChannel!==void 0&&this._broadcastChannel.removeEventListener("message",this.messageHandler),this._webSocket!==void 0&&(this._webSocket.removeEventListener("open",this.openHandler),this._webSocket.removeEventListener("close",this.closeHandler),this._webSocket.removeEventListener("message",this.messageHandler)),this.components.forEach(n=>{n.dispose()}),this.components.clear()}send(n){this._mode!==n.target&&(this._useBC?this._broadcastChannel?.postMessage(n):this._connected&&this._webSocket?.send(JSON.stringify(n)))}messageHandler=n=>{this.listen!==void 0&&(this._useBC?this.listen(n.data):this.listen(JSON.parse(n.data)))};openHandler=()=>{this._connected=!0};closeHandler=()=>{this._connected=!1};get appID(){return this._appID}get connected(){return this._connected}get debugEnabled(){return this._debugEnabled}get mode(){return this._mode}get isApp(){return this._mode==="app"}get editor(){return this._mode==="editor"}set editor(n){n&&(this._mode="editor")}}const j=new f.EventDispatcher,I={CUSTOM:"ToolEvents::custom",SELECT_DROPDOWN:"ToolEvents::selectDropdown",DRAG_UPDATE:"ToolEvents::dragUpdate",ADD_SCENE:"ToolEvents::addScene",REMOVE_SCENE:"ToolEvents::removeScene",SET_SCENE:"ToolEvents::setScene",GET_OBJECT:"ToolEvents::getObject",SET_OBJECT:"ToolEvents::setObject",UPDATE_OBJECT:"ToolEvents::updateObject",CREATE_TEXTURE:"ToolEvents::createTexture",REQUEST_METHOD:"ToolEvents::requestMethod",ADD_CAMERA:"ToolEvents::addCamera",REMOVE_CAMERA:"ToolEvents::removeCamera"};class dt{app;constructor(n){this.app=n}dispose(){}handleApp(n,a,t){}handleEditor(n,a,t){}}class Mn extends dt{selectDropdown(n,a){this.app.send({event:"selectComponent",target:"app",data:{dropdown:n,value:a}})}updateDropdown(n,a){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:n,value:a}})}handleApp(n,a,t){switch(t.event){case"selectComponent":j.dispatchEvent({type:I.SELECT_DROPDOWN,value:t.data});break;case"draggableListUpdate":j.dispatchEvent({type:I.DRAG_UPDATE,value:t.data});break}}}class wt extends dt{project;sheets=new Map;sheetObjects=new Map;sheetObjectCBs=new Map;sheetObjectUnsubscribe=new Map;activeSheet;studio=void 0;static rafDriver=void 0;dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}getSheetInstance(n,a){return a!==void 0?`${n}-${a}`:n}sheet(n,a){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const t=this.getSheetInstance(n,a);let i=this.sheets.get(t);return i!==void 0||(i=this.project?.sheet(n,a),this.sheets.set(t,i)),i}playSheet(n,a,t){this.sheet(n,t)?.sequence.play(a),this.app.send({event:"playSheet",target:"editor",data:{sheet:n,instance:t,value:a}})}pauseSheet(n,a){this.sheet(n)?.sequence.pause(),this.app.send({event:"pauseSheet",target:"editor",data:{sheet:n,instance:a}})}clearSheetObjects(n){this.sheetObjects.forEach((a,t)=>{t.search(`${n}_`)>-1&&this.unsubscribe(a)})}sheetObject(n,a,t,i,c){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const u=this.sheet(n,c);if(u===void 0)return;const h=`${this.getSheetInstance(n,c)}_${a}`;let d=this.sheetObjects.get(h);d!==void 0?d=u.object(a,{...t,...d.value},{reconfigure:!0}):d=u.object(a,t),this.sheetObjects.set(h,d),this.sheetObjectCBs.set(h,i!==void 0?i:Ct);const m=d.onValuesChange(p=>{if(this.app.editor){for(const C in p){const D=p[C];typeof D=="object"&&nn(D)&&(p[C]={r:D.r,g:D.g,b:D.b,a:D.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheet:n,sheetObject:h,values:p}})}const b=this.sheetObjectCBs.get(h);b!==void 0&&b(p)});return this.sheetObjectUnsubscribe.set(h,m),d}unsubscribe(n){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const a=n.address.sheetId,t=n.address.objectKey;this.sheets.get(a)?.detachObject(t);const c=`${a}_${t}`,u=this.sheetObjectUnsubscribe.get(c);u!==void 0&&(this.sheetObjects.delete(c),this.sheetObjectCBs.delete(c),this.sheetObjectUnsubscribe.delete(c),u())}handleApp(n,a,t){const i=a;let c;switch(t.event){case"setSheet":c=i.sheets.get(t.data.sheet),c!==void 0&&(i.activeSheet=c,this.studio?.setSelection([c]));break;case"setSheetObject":c=i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`),c!==void 0&&this.studio?.setSelection([c]);break;case"updateSheetObject":c=i.sheets.get(t.data.sheet),c!==void 0&&c.sequence.pause(),c=i.sheetObjectCBs.get(t.data.sheetObject),c!==void 0&&c(t.data.values);break;case"updateTimeline":c=i.sheets.get(t.data.sheet),i.activeSheet!==void 0&&(i.activeSheet.sequence.position=t.data.position);break}}handleEditor(n,a,t){if(n.editor){const i=a;switch(t.event){case"playSheet":i.sheet(t.data.sheet,t.data.instance)?.sequence.play(t.data.value);break;case"pauseSheet":i.sheet(t.data.sheet,t.data.instance)?.sequence.pause();break}}}handleEditorApp(n,a){if(n.editor){this.studio?.ui.restore(),this.studio?.onSelectionChange(u=>{u.length<1||u.forEach(r=>{let h=r.address.sheetId,d="setSheet",m={};switch(r.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:r.address.sheetId},a.activeSheet=a.sheets.get(r.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${r.address.objectKey}`,m={id:h,sheet:r.address.sheetId,key:r.address.objectKey},a.activeSheet=a.sheets.get(r.address.sheetId);break}n.send({event:d,target:"app",data:m})})});let t=-1;const i=()=>{if(wt.rafDriver?.tick(performance.now()),a.activeSheet!==void 0&&t!==a.activeSheet.sequence.position){t=a.activeSheet.sequence.position;const u=a.activeSheet;n.send({event:"updateTimeline",target:"app",data:{position:t,sheet:u.address.sheetId}})}},c=()=>{i(),requestAnimationFrame(c)};i(),c()}else this.studio?.ui.hide()}}function On(e,n,a){if(e.editor){a.ui.restore(),a.onSelectionChange(u=>{u.length<1||u.forEach(r=>{let h=r.address.sheetId,d="setSheet",m={};switch(r.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:r.address.sheetId},n.activeSheet=n.sheets.get(r.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${r.address.objectKey}`,m={id:h,sheet:r.address.sheetId,key:r.address.objectKey},n.activeSheet=n.sheets.get(r.address.sheetId);break}e.send({event:d,target:"app",data:m})})});let t=-1;const i=()=>{if(wt.rafDriver?.tick(performance.now()),n.activeSheet!==void 0&&t!==n.activeSheet.sequence.position){t=n.activeSheet.sequence.position;const u=n.activeSheet;e.send({event:"updateTimeline",target:"app",data:{position:t,sheet:u.address.sheetId}})}},c=()=>{i(),requestAnimationFrame(c)};i(),c()}else a.ui.hide()}function Rn(e){if(e.name==="cameras")return"camera";if(e.name==="interactive")return"interactive";if(e.name==="lights")return"light";if(e.name==="ui")return"ui";if(e.name==="utils")return"utils";const n=e.type;return n.search("Helper")>-1?"icon_utils":n.search("Camera")>-1?"camera":n.search("Light")>-1?"light":"obj3D"}function yt(e){const n={name:e.name,type:e.type,uuid:e.uuid,children:[]};return e.children.forEach(a=>{n.children.push(yt(a))}),n}function Tn(e){const n={};for(const a in e){const t=e[a].value;n[a]={value:t},t===null?n[a].value={src:"",offset:[0,0],repeat:[1,1]}:t.isTexture&&(n[a].value={src:t.image.src,offset:[t.offset.x,t.offset.y],repeat:[t.repeat.x,t.repeat.y]})}return n}function _n(e){switch(e){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function et(e){const n={};for(const a in e){if(a.substring(0,1)==="_"||a.substring(0,2)==="is"||_n(a))continue;const t=typeof e[a],i=e[a];switch(t){case"boolean":case"number":case"string":n[a]=i;break;case"object":if(i!==null)if(n[a]=i,i.isTexture)if(i instanceof f.Texture){const u=i.source.toJSON().url;n[a]={src:u,offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]}}else i instanceof f.CubeTexture&&(console.log("env map"),console.log(i.source.data),console.log(i.source.toJSON()),n[a]={src:"",offset:[i.offset.x,i.offset.y],repeat:[i.repeat.x,i.repeat.y]});else a==="uniforms"&&(n[a]=Tn(n[a]));else n[a]={src:"",offset:[0,0],repeat:[1,1]};break}}return n}function kt(e){e.updateMatrix();const n={name:e.name,type:e.type,uuid:e.uuid,visible:e.visible,matrix:e.matrix.elements,animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};e.animations.forEach(t=>{n.animations.push({name:t.name,duration:t.duration,blendMode:t.blendMode})});const a=e.type.toLowerCase();if(a.search("mesh")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(c=>{i.push(et(c))}),n.material=i}else n.material=et(t.material)}else if(a.search("points")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(c=>{i.push(et(c))}),n.material=i}else n.material=et(t.material)}else if(a.search("line")>-1){const t=e;if(Array.isArray(t.material)){const i=[];t.material.forEach(c=>{i.push(et(c))}),n.material=i}else n.material=et(t.material)}else a.search("camera")>-1?e.type==="PerspectiveCamera"?n.perspectiveCameraInfo={fov:e.fov,zoom:e.zoom,near:e.near,far:e.far,focus:e.focus,aspect:e.aspect,filmGauge:e.filmGauge,filmOffset:e.filmOffset}:e.type==="OrthographicCamera"&&(n.orthographicCameraInfo={zoom:e.zoom,near:e.near,far:e.far,left:e.left,right:e.right,top:e.top,bottom:e.bottom}):a.search("light")>-1&&(n.lightInfo={color:e.color,intensity:e.intensity,decay:e.decay,distance:e.distance,angle:e.angle,penumbra:e.penumbra,groundColor:e.groundColor,width:e.width,height:e.height});return n}function kn(e,n){const a=n.split(".");switch(a.length){case 1:return e[a[0]];case 2:return e[a[0]][a[1]];case 3:return e[a[0]][a[1]][a[2]];case 4:return e[a[0]][a[1]][a[2]][a[3]];case 5:return e[a[0]][a[1]][a[2]][a[3]][a[4]];case 6:return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]]}}function Dn(e,n){for(const a in n)e[a]=n[a]}function te(e,n,a){if(e===void 0){console.log(`Hermes - Can't set props: ${n}`,a);return}const t=n.split("."),i=t.length;if(typeof a!="object")switch(i){case 1:e[t[0]]=a;break;case 2:e[t[0]][t[1]]=a;break;case 3:e[t[0]][t[1]][t[2]]=a;break;case 4:e[t[0]][t[1]][t[2]][t[3]]=a;break;case 5:e[t[0]][t[1]][t[2]][t[3]][t[4]]=a;break}else{let u;switch(i){case 1:u=e[t[0]];break;case 2:u=e[t[0]][t[1]];break;case 3:u=e[t[0]][t[1]][t[2]];break;case 4:u=e[t[0]][t[1]][t[2]][t[3]];break;case 5:u=e[t[0]][t[1]][t[2]][t[3]][t[4]];break}u!=null&&Dn(u,a)}}function sn(e){return new Promise((n,a)=>{const t=new Image;t.onload=()=>{const i=new f.Texture(t);i.wrapS=f.RepeatWrapping,i.wrapT=f.RepeatWrapping,i.needsUpdate=!0,n(i)},t.onerror=a,t.src=e})}class An extends dt{scene=void 0;scenes=new Map;renderer=void 0;renderTargets=new Map;dispose(){this.scenes.forEach(n=>{ut(n)}),this.scenes.clear(),this.scene&&ut(this.scene),this.renderTargets.forEach(n=>{n.dispose()}),this.renderTargets.clear(),this.renderer?.dispose()}getObject(n){this.app.debugEnabled&&this.app.send({event:"getObject",target:"app",data:n})}setObject(n){const a=kt(n);this.app.send({event:"setObject",target:"editor",data:a})}requestMethod(n,a,t,i){this.app.send({event:"requestMethod",target:"app",data:{uuid:n,key:a,value:t,subitem:i}})}updateObject(n,a,t){this.app.send({event:"updateObject",target:"app",data:{uuid:n,key:a,value:t}})}createTexture(n,a,t){this.app.send({event:"createTexture",target:"app",data:{uuid:n,key:a,value:t}})}addScene(n){if(n===void 0||(this.scenes.set(n.name,n),!this.app.debugEnabled))return;Nt(),xt(n);const a=yt(n);this.app.send({event:"addScene",target:"editor",data:a})}removeScene(n){if(n===void 0||(this.scenes.delete(n.name),!this.app.debugEnabled))return;const a=yt(n);this.app.send({event:"removeScene",target:"editor",data:a})}removeAllScenes(){this.scenes.forEach(n=>this.removeScene(n))}getScene(n){let a=null;return this.scenes.forEach((t,i)=>{n.search(i)>-1&&(a=t)}),a}setScene(n){if(n===void 0||(this.scene=n,!this.app.debugEnabled))return;Nt(),xt(n);const a=yt(n);this.app.send({event:"setScene",target:"editor",data:a})}addCamera(n){if(!this.app.debugEnabled)return;const a=kt(n);this.app.send({event:"addCamera",target:"editor",data:a})}removeCamera(n){if(!this.app.debugEnabled)return;const a=kt(n);this.app.send({event:"removeCamera",target:"editor",data:a})}handleApp(n,a,t){switch(t.event){case"getObject":j.dispatchEvent({type:I.GET_OBJECT,value:t.data});break;case"updateObject":j.dispatchEvent({type:I.UPDATE_OBJECT,value:t.data});break;case"createTexture":j.dispatchEvent({type:I.CREATE_TEXTURE,value:t.data});break;case"requestMethod":j.dispatchEvent({type:I.REQUEST_METHOD,value:t.data});break}}handleEditor(n,a,t){switch(t.event){case"setObject":j.dispatchEvent({type:I.SET_OBJECT,value:t.data});break;case"addScene":j.dispatchEvent({type:I.ADD_SCENE,value:t.data});break;case"removeScene":j.dispatchEvent({type:I.REMOVE_SCENE,value:t.data});break;case"setScene":j.dispatchEvent({type:I.SET_SCENE,value:t.data});break;case"addCamera":j.dispatchEvent({type:I.ADD_CAMERA,value:t.data});break;case"removeCamera":j.dispatchEvent({type:I.REMOVE_CAMERA,value:t.data});break}}rendererWidth=300;rendererHeight=150;addRT(n,a){const t=new f.WebGLRenderTarget(32,32,a);t.texture.name=n,this.renderTargets.set(n,t)}resize(n,a){const t=this.dpr;this.rendererWidth=n,this.rendererHeight=a,this.renderTargets.forEach(i=>{i.setSize(n*t,a*t)}),this.renderer?.setSize(n,a)}set dpr(n){this.renderer?.setPixelRatio(He(1,2,n))}get dpr(){return this.renderer!==void 0?this.renderer?.getPixelRatio():1}get width(){return this.rendererWidth}get height(){return this.rendererHeight}get canvas(){return this.renderer!==void 0?this.renderer?.domElement:null}}class Pn extends dt{bindCBs;buttonCBs;pane=void 0;appCallbacks=0;editorCallbacks=0;inspectorFolder=void 0;constructor(n){super(n),this.bindCBs=new Map,this.buttonCBs=new Map,n.editor&&this.createGUI()}createGUI(){this.pane=new vn.Pane({title:"GUI"}),this.pane.registerPlugin(En)}dispose(){this.bindCBs.clear(),this.buttonCBs.clear(),this.appCallbacks=0,this.editorCallbacks=0,this.app.editor&&(this.pane?.dispose(),this.pane=void 0)}addFolder(n,a=void 0,t=void 0){if(this.app.editor)return this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addFolder({title:n,...a});this.app.send({event:"addFolder",target:"app",data:{name:n,params:a,parent:t}})}get bindID(){return`debug_${Math.max(this.appCallbacks,this.editorCallbacks)}`}bind(n,a,t,i=void 0){const c=this.bindID,u=t.onChange!==void 0?t.onChange:Ct;this.bindCBs.set(c,u),this.app.editor?(this.pane===void 0&&this.createGUI(),(i!==void 0?i:this.pane).addBinding(n,a,t).on("change",h=>{this.app.send({event:"updateBind",target:"app",data:{id:c,value:h.value}})}),this.editorCallbacks++):(this.app.send({event:"bindObject",target:"app",data:{id:c,name:a,params:t,parent:i}}),this.appCallbacks++)}triggerBind(n,a){const t=this.bindCBs.get(n);t!==void 0?t(a):console.warn(`No callback for: ${n}`,a)}button(n,a,t=void 0){const i=this.bindID;this.buttonCBs.set(i,a),this.app.editor?(this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addButton({title:n}).on("click",()=>{this.app.send({event:"clickButton",target:"app",data:{id:i}})}),this.editorCallbacks++):(this.app.send({event:"addButton",target:"app",data:{id:i,name:n,callback:a,parent:t}}),this.appCallbacks++)}triggerButton(n){const a=this.buttonCBs.get(n);a!==void 0&&a()}createInspector(){this.inspectorFolder=this.addFolder("Inspector",this.pane)}clearInspector(){const n=this.inspectorFolder.children.length-1;for(let a=n;a>-1;--a)this.inspectorFolder.remove(this.inspectorFolder.children[a])}handleApp(n,a,t){const i=a;switch(t.event){case"addFolder":i.addFolder(t.data.name,t.data.params,t.data.parent);break;case"bindObject":i.bind(t.data.name,t.data.params,t.data.parent);break;case"updateBind":i.triggerBind(t.data.id,t.data.value);break;case"addButton":i.button(t.data.name,t.data.callback,t.data.parent);break;case"clickButton":i.triggerButton(t.data.id);break}}}var Lt={exports:{}},rt={};/**
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("three"),En=require("tweakpane"),xn=require("@tweakpane/plugin-essentials"),S=require("react"),rn=require("framer-motion");function Cn(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const t=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(n,a,t.get?t:{enumerable:!0,get:()=>e[a]})}}return n.default=e,Object.freeze(n)}const wn=Cn(xn),wt=()=>{},Mn=()=>{};function dt(e){return e.substring(0,1).toUpperCase()+e.substring(1)}function We(e,n,a){return Math.min(n,Math.max(e,a))}function It(e,n,a){return(a-e)/(n-e)}function jt(e,n,a){return e*(1-a)+n*a}function On(e,n){const a=e-n;return Math.sqrt(a*a)}function sn(){return Math.round(Math.random()*1e6).toString()}function on(e){return e.r!==void 0&&e.g!==void 0&&e.b!==void 0}function cn(e){const n=Math.round(e.r*255),a=Math.round(e.g*255),t=Math.round(e.b*255),r=h=>{const d=h.toString(16);return d.length===1?"0"+d:d},c=r(n),u=r(a),s=r(t);return"#"+c+u+s}function Nt(e,n=1){return Number(e.toFixed(n))}exports.totalThreeObjects=0;const Lt=()=>{exports.totalThreeObjects=0},xt=e=>{if(!e)return;let n=e.name.replaceAll(" ","").replaceAll("/",".");if(n.length===0&&(n=`obj_${exports.totalThreeObjects}`,exports.totalThreeObjects++),e.parent!==null&&e.parent.uuid.length>0&&(n=`${e.parent.uuid}.${n}`),e.uuid=n,e.isMesh!==void 0){const a=e;if(Array.isArray(a.material))a.material.forEach((t,r)=>{t.uuid=`${n}.material.${r}`});else{const t=a.material;t.uuid=`${n}.material`}}e.children.forEach(a=>xt(a))},Rn=e=>{e?.dispose()},ln=e=>{e&&(Array.isArray(e)?e.forEach(n=>n.dispose()):e.dispose())},ht=e=>{if(e){for(;e.children.length>0;){const n=e.children[0];n.type==="Audio"?(n.pause(),n.parent&&n.parent.remove(n)):ht(n)}if(e.parent&&e.parent.remove(e),e.isMesh){const n=e;n.geometry?.dispose(),ln(n.material)}e.dispose!==void 0&&e.dispose()}};class Tn{components=new Map;listen;_appID="";_debugEnabled;_broadcastChannel=void 0;_webSocket=void 0;_mode="app";_connected=!1;_useBC=!1;constructor(n,a,t=!0){this._appID=n,this._debugEnabled=a,a&&(this._useBC=t,t?(this._broadcastChannel=new BroadcastChannel(n),this._broadcastChannel.addEventListener("message",this.messageHandler)):(this._webSocket=new WebSocket(n),this._webSocket.addEventListener("open",this.openHandler),this._webSocket.addEventListener("close",this.closeHandler),this._webSocket.addEventListener("message",this.messageHandler)))}addComponent(n,a){this.components.set(n,a)}dispose(){this._broadcastChannel!==void 0&&this._broadcastChannel.removeEventListener("message",this.messageHandler),this._webSocket!==void 0&&(this._webSocket.removeEventListener("open",this.openHandler),this._webSocket.removeEventListener("close",this.closeHandler),this._webSocket.removeEventListener("message",this.messageHandler)),this.components.forEach(n=>{n.dispose()}),this.components.clear()}send(n){this._mode!==n.target&&(this._useBC?this._broadcastChannel?.postMessage(n):this._connected&&this._webSocket?.send(JSON.stringify(n)))}messageHandler=n=>{this.listen!==void 0&&(this._useBC?this.listen(n.data):this.listen(JSON.parse(n.data)))};openHandler=()=>{this._connected=!0};closeHandler=()=>{this._connected=!1};get appID(){return this._appID}get connected(){return this._connected}get debugEnabled(){return this._debugEnabled}get mode(){return this._mode}get isApp(){return this._mode==="app"}get editor(){return this._mode==="editor"}set editor(n){n&&(this._mode="editor")}}const I=new f.EventDispatcher,j={CUSTOM:"ToolEvents::custom",SELECT_DROPDOWN:"ToolEvents::selectDropdown",DRAG_UPDATE:"ToolEvents::dragUpdate",ADD_SCENE:"ToolEvents::addScene",REMOVE_SCENE:"ToolEvents::removeScene",SET_SCENE:"ToolEvents::setScene",GET_OBJECT:"ToolEvents::getObject",SET_OBJECT:"ToolEvents::setObject",UPDATE_OBJECT:"ToolEvents::updateObject",CREATE_TEXTURE:"ToolEvents::createTexture",REQUEST_METHOD:"ToolEvents::requestMethod",ADD_CAMERA:"ToolEvents::addCamera",REMOVE_CAMERA:"ToolEvents::removeCamera"};class ft{app;constructor(n){this.app=n}dispose(){}handleApp(n,a,t){}handleEditor(n,a,t){}}class _n extends ft{selectDropdown(n,a){this.app.send({event:"selectComponent",target:"app",data:{dropdown:n,value:a}})}updateDropdown(n,a){this.app.send({event:"draggableListUpdate",target:"app",data:{dropdown:n,value:a}})}handleApp(n,a,t){switch(t.event){case"selectComponent":I.dispatchEvent({type:j.SELECT_DROPDOWN,value:t.data});break;case"draggableListUpdate":I.dispatchEvent({type:j.DRAG_UPDATE,value:t.data});break}}}class Mt extends ft{project;sheets=new Map;sheetObjects=new Map;sheetObjectCBs=new Map;sheetObjectUnsubscribe=new Map;activeSheet;studio=void 0;static rafDriver=void 0;dispose(){this.project=void 0,this.sheets=new Map,this.sheetObjects=new Map,this.sheetObjectCBs=new Map,this.sheetObjectUnsubscribe=new Map}getSheetInstance(n,a){return a!==void 0?`${n}-${a}`:n}sheet(n,a){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const t=this.getSheetInstance(n,a);let r=this.sheets.get(t);return r!==void 0||(r=this.project?.sheet(n,a),this.sheets.set(t,r)),r}playSheet(n,a,t){this.sheet(n,t)?.sequence.play(a),this.app.send({event:"playSheet",target:"editor",data:{sheet:n,instance:t,value:a}})}pauseSheet(n,a){this.sheet(n)?.sequence.pause(),this.app.send({event:"pauseSheet",target:"editor",data:{sheet:n,instance:a}})}clearSheetObjects(n){this.sheetObjects.forEach((a,t)=>{t.search(`${n}_`)>-1&&this.unsubscribe(a)})}sheetObject(n,a,t,r,c){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const u=this.sheet(n,c);if(u===void 0)return;const h=`${this.getSheetInstance(n,c)}_${a}`;let d=this.sheetObjects.get(h);d!==void 0?d=u.object(a,{...t,...d.value},{reconfigure:!0}):d=u.object(a,t),this.sheetObjects.set(h,d),this.sheetObjectCBs.set(h,r!==void 0?r:wt);const m=d.onValuesChange(g=>{if(this.app.editor){for(const E in g){const R=g[E];typeof R=="object"&&on(R)&&(g[E]={r:R.r,g:R.g,b:R.b,a:R.a})}this.app.send({event:"updateSheetObject",target:"app",data:{sheet:n,sheetObject:h,values:g}})}const v=this.sheetObjectCBs.get(h);v!==void 0&&v(g)});return this.sheetObjectUnsubscribe.set(h,m),d}unsubscribe(n){if(this.project===void 0){console.error("Theatre Project hasn't been created yet.");return}const a=n.address.sheetId,t=n.address.objectKey;this.sheets.get(a)?.detachObject(t);const c=`${a}_${t}`,u=this.sheetObjectUnsubscribe.get(c);u!==void 0&&(this.sheetObjects.delete(c),this.sheetObjectCBs.delete(c),this.sheetObjectUnsubscribe.delete(c),u())}handleApp(n,a,t){const r=a;let c;switch(t.event){case"setSheet":c=r.sheets.get(t.data.sheet),c!==void 0&&(r.activeSheet=c,this.studio?.setSelection([c]));break;case"setSheetObject":c=r.sheetObjects.get(`${t.data.sheet}_${t.data.key}`),c!==void 0&&this.studio?.setSelection([c]);break;case"updateSheetObject":c=r.sheets.get(t.data.sheet),c!==void 0&&c.sequence.pause(),c=r.sheetObjectCBs.get(t.data.sheetObject),c!==void 0&&c(t.data.values);break;case"updateTimeline":c=r.sheets.get(t.data.sheet),r.activeSheet!==void 0&&(r.activeSheet.sequence.position=t.data.position);break}}handleEditor(n,a,t){if(n.editor){const r=a;switch(t.event){case"playSheet":r.sheet(t.data.sheet,t.data.instance)?.sequence.play(t.data.value);break;case"pauseSheet":r.sheet(t.data.sheet,t.data.instance)?.sequence.pause();break}}}handleEditorApp(n,a){if(n.editor){this.studio?.ui.restore(),this.studio?.onSelectionChange(u=>{u.length<1||u.forEach(s=>{let h=s.address.sheetId,d="setSheet",m={};switch(s.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:s.address.sheetId},a.activeSheet=a.sheets.get(s.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${s.address.objectKey}`,m={id:h,sheet:s.address.sheetId,key:s.address.objectKey},a.activeSheet=a.sheets.get(s.address.sheetId);break}n.send({event:d,target:"app",data:m})})});let t=-1;const r=()=>{if(Mt.rafDriver?.tick(performance.now()),a.activeSheet!==void 0&&t!==a.activeSheet.sequence.position){t=a.activeSheet.sequence.position;const u=a.activeSheet;n.send({event:"updateTimeline",target:"app",data:{position:t,sheet:u.address.sheetId}})}},c=()=>{r(),requestAnimationFrame(c)};r(),c()}else this.studio?.ui.hide()}}function kn(e,n,a){if(e.editor){a.ui.restore(),a.onSelectionChange(u=>{u.length<1||u.forEach(s=>{let h=s.address.sheetId,d="setSheet",m={};switch(s.type){case"Theatre_Sheet_PublicAPI":d="setSheet",m={sheet:s.address.sheetId},n.activeSheet=n.sheets.get(s.address.sheetId);break;case"Theatre_SheetObject_PublicAPI":d="setSheetObject",h+=`_${s.address.objectKey}`,m={id:h,sheet:s.address.sheetId,key:s.address.objectKey},n.activeSheet=n.sheets.get(s.address.sheetId);break}e.send({event:d,target:"app",data:m})})});let t=-1;const r=()=>{if(Mt.rafDriver?.tick(performance.now()),n.activeSheet!==void 0&&t!==n.activeSheet.sequence.position){t=n.activeSheet.sequence.position;const u=n.activeSheet;e.send({event:"updateTimeline",target:"app",data:{position:t,sheet:u.address.sheetId}})}},c=()=>{r(),requestAnimationFrame(c)};r(),c()}else a.ui.hide()}function Dn(e){if(e.name==="cameras")return"camera";if(e.name==="interactive")return"interactive";if(e.name==="lights")return"light";if(e.name==="ui")return"ui";if(e.name==="utils")return"utils";const n=e.type;return n.search("Helper")>-1?"icon_utils":n.search("Camera")>-1?"camera":n.search("Light")>-1?"light":"obj3D"}function St(e){const n={name:e.name,type:e.type,uuid:e.uuid,children:[]};return e.children.forEach(a=>{n.children.push(St(a))}),n}function An(e){const n={};for(const a in e){const t=e[a].value;n[a]={value:t},t===null?n[a].value={src:"",offset:[0,0],repeat:[1,1]}:t.isTexture&&(n[a].value={src:t.image.src,offset:[t.offset.x,t.offset.y],repeat:[t.repeat.x,t.repeat.y]})}return n}function Pn(e){switch(e){case"blendSrcAlpha":case"blendDstAlpha":case"blendEquationAlpha":case"clippingPlanes":case"shadowSide":case"precision":return!0}return!1}function at(e){const n={};for(const a in e){if(a.substring(0,1)==="_"||a.substring(0,2)==="is"||Pn(a))continue;const t=typeof e[a],r=e[a];switch(t){case"boolean":case"number":case"string":n[a]=r;break;case"object":if(r!==null)if(n[a]=r,r.isTexture)if(r instanceof f.Texture){const u=r.source.toJSON().url;n[a]={src:u,offset:[r.offset.x,r.offset.y],repeat:[r.repeat.x,r.repeat.y]}}else r instanceof f.CubeTexture&&(console.log("env map"),console.log(r.source.data),console.log(r.source.toJSON()),n[a]={src:"",offset:[r.offset.x,r.offset.y],repeat:[r.repeat.x,r.repeat.y]});else a==="uniforms"&&(n[a]=An(n[a]));else n[a]={src:"",offset:[0,0],repeat:[1,1]};break}}return n}function Dt(e){e.updateMatrix();const n={name:e.name,type:e.type,uuid:e.uuid,visible:e.visible,matrix:e.matrix.elements,animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};e.animations.forEach(t=>{n.animations.push({name:t.name,duration:t.duration,blendMode:t.blendMode})});const a=e.type.toLowerCase();if(a.search("mesh")>-1){const t=e;if(Array.isArray(t.material)){const r=[];t.material.forEach(c=>{r.push(at(c))}),n.material=r}else n.material=at(t.material)}else if(a.search("points")>-1){const t=e;if(Array.isArray(t.material)){const r=[];t.material.forEach(c=>{r.push(at(c))}),n.material=r}else n.material=at(t.material)}else if(a.search("line")>-1){const t=e;if(Array.isArray(t.material)){const r=[];t.material.forEach(c=>{r.push(at(c))}),n.material=r}else n.material=at(t.material)}else a.search("camera")>-1?e.type==="PerspectiveCamera"?n.perspectiveCameraInfo={fov:e.fov,zoom:e.zoom,near:e.near,far:e.far,focus:e.focus,aspect:e.aspect,filmGauge:e.filmGauge,filmOffset:e.filmOffset}:e.type==="OrthographicCamera"&&(n.orthographicCameraInfo={zoom:e.zoom,near:e.near,far:e.far,left:e.left,right:e.right,top:e.top,bottom:e.bottom}):a.search("light")>-1&&(n.lightInfo={color:e.color,intensity:e.intensity,decay:e.decay,distance:e.distance,angle:e.angle,penumbra:e.penumbra,groundColor:e.groundColor,width:e.width,height:e.height});return n}function In(e,n){const a=n.split(".");switch(a.length){case 1:return e[a[0]];case 2:return e[a[0]][a[1]];case 3:return e[a[0]][a[1]][a[2]];case 4:return e[a[0]][a[1]][a[2]][a[3]];case 5:return e[a[0]][a[1]][a[2]][a[3]][a[4]];case 6:return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]]}}function jn(e,n){for(const a in n)e[a]=n[a]}function ne(e,n,a){if(e===void 0){console.log(`Hermes - Can't set props: ${n}`,a);return}const t=n.split("."),r=t.length;if(typeof a!="object")switch(r){case 1:e[t[0]]=a;break;case 2:e[t[0]][t[1]]=a;break;case 3:e[t[0]][t[1]][t[2]]=a;break;case 4:e[t[0]][t[1]][t[2]][t[3]]=a;break;case 5:e[t[0]][t[1]][t[2]][t[3]][t[4]]=a;break}else{let u;switch(r){case 1:u=e[t[0]];break;case 2:u=e[t[0]][t[1]];break;case 3:u=e[t[0]][t[1]][t[2]];break;case 4:u=e[t[0]][t[1]][t[2]][t[3]];break;case 5:u=e[t[0]][t[1]][t[2]][t[3]][t[4]];break}u!=null&&jn(u,a)}}function un(e){return new Promise((n,a)=>{const t=new Image;t.onload=()=>{const r=new f.Texture(t);r.wrapS=f.RepeatWrapping,r.wrapT=f.RepeatWrapping,r.needsUpdate=!0,n(r)},t.onerror=a,t.src=e})}class Nn extends ft{scene=void 0;scenes=new Map;renderer=void 0;renderTargets=new Map;dispose(){this.scenes.forEach(n=>{ht(n)}),this.scenes.clear(),this.scene&&ht(this.scene),this.renderTargets.forEach(n=>{n.dispose()}),this.renderTargets.clear(),this.renderer?.dispose()}getObject(n){this.app.debugEnabled&&this.app.send({event:"getObject",target:"app",data:n})}setObject(n){const a=Dt(n);this.app.send({event:"setObject",target:"editor",data:a})}requestMethod(n,a,t,r){this.app.send({event:"requestMethod",target:"app",data:{uuid:n,key:a,value:t,subitem:r}})}updateObject(n,a,t){this.app.send({event:"updateObject",target:"app",data:{uuid:n,key:a,value:t}})}createTexture(n,a,t){this.app.send({event:"createTexture",target:"app",data:{uuid:n,key:a,value:t}})}addScene(n){if(n===void 0||(this.scenes.set(n.name,n),!this.app.debugEnabled))return;Lt(),xt(n);const a=St(n);this.app.send({event:"addScene",target:"editor",data:a})}removeScene(n){if(n===void 0||(this.scenes.delete(n.name),!this.app.debugEnabled))return;const a=St(n);this.app.send({event:"removeScene",target:"editor",data:a})}removeAllScenes(){this.scenes.forEach(n=>this.removeScene(n))}getScene(n){let a=null;return this.scenes.forEach((t,r)=>{n.search(r)>-1&&(a=t)}),a}setScene(n){if(n===void 0||(this.scene=n,!this.app.debugEnabled))return;Lt(),xt(n);const a=St(n);this.app.send({event:"setScene",target:"editor",data:a})}addCamera(n){if(!this.app.debugEnabled)return;const a=Dt(n);this.app.send({event:"addCamera",target:"editor",data:a})}removeCamera(n){if(!this.app.debugEnabled)return;const a=Dt(n);this.app.send({event:"removeCamera",target:"editor",data:a})}handleApp(n,a,t){switch(t.event){case"getObject":I.dispatchEvent({type:j.GET_OBJECT,value:t.data});break;case"updateObject":I.dispatchEvent({type:j.UPDATE_OBJECT,value:t.data});break;case"createTexture":I.dispatchEvent({type:j.CREATE_TEXTURE,value:t.data});break;case"requestMethod":I.dispatchEvent({type:j.REQUEST_METHOD,value:t.data});break}}handleEditor(n,a,t){switch(t.event){case"setObject":I.dispatchEvent({type:j.SET_OBJECT,value:t.data});break;case"addScene":I.dispatchEvent({type:j.ADD_SCENE,value:t.data});break;case"removeScene":I.dispatchEvent({type:j.REMOVE_SCENE,value:t.data});break;case"setScene":I.dispatchEvent({type:j.SET_SCENE,value:t.data});break;case"addCamera":I.dispatchEvent({type:j.ADD_CAMERA,value:t.data});break;case"removeCamera":I.dispatchEvent({type:j.REMOVE_CAMERA,value:t.data});break}}rendererWidth=300;rendererHeight=150;addRT(n,a){const t=new f.WebGLRenderTarget(32,32,a);t.texture.name=n,this.renderTargets.set(n,t)}resize(n,a){const t=this.dpr;this.rendererWidth=n,this.rendererHeight=a,this.renderTargets.forEach(r=>{r.setSize(n*t,a*t)}),this.renderer?.setSize(n,a)}set dpr(n){this.renderer?.setPixelRatio(We(1,2,n))}get dpr(){return this.renderer!==void 0?this.renderer?.getPixelRatio():1}get width(){return this.rendererWidth}get height(){return this.rendererHeight}get canvas(){return this.renderer!==void 0?this.renderer?.domElement:null}}class Ln extends ft{bindCBs;buttonCBs;pane=void 0;appCallbacks=0;editorCallbacks=0;inspectorFolder=void 0;constructor(n){super(n),this.bindCBs=new Map,this.buttonCBs=new Map,n.editor&&this.createGUI()}createGUI(){this.pane=new En.Pane({title:"GUI"}),this.pane.registerPlugin(wn)}dispose(){this.bindCBs.clear(),this.buttonCBs.clear(),this.appCallbacks=0,this.editorCallbacks=0,this.app.editor&&(this.pane?.dispose(),this.pane=void 0)}addFolder(n,a=void 0,t=void 0){if(this.app.editor)return this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addFolder({title:n,...a});this.app.send({event:"addFolder",target:"app",data:{name:n,params:a,parent:t}})}get bindID(){return`debug_${Math.max(this.appCallbacks,this.editorCallbacks)}`}bind(n,a,t,r=void 0){const c=this.bindID,u=t.onChange!==void 0?t.onChange:wt;this.bindCBs.set(c,u),this.app.editor?(this.pane===void 0&&this.createGUI(),(r!==void 0?r:this.pane).addBinding(n,a,t).on("change",h=>{this.app.send({event:"updateBind",target:"app",data:{id:c,value:h.value}})}),this.editorCallbacks++):(this.app.send({event:"bindObject",target:"app",data:{id:c,name:a,params:t,parent:r}}),this.appCallbacks++)}triggerBind(n,a){const t=this.bindCBs.get(n);t!==void 0?t(a):console.warn(`No callback for: ${n}`,a)}button(n,a,t=void 0){const r=this.bindID;this.buttonCBs.set(r,a),this.app.editor?(this.pane===void 0&&this.createGUI(),(t!==void 0?t:this.pane).addButton({title:n}).on("click",()=>{this.app.send({event:"clickButton",target:"app",data:{id:r}})}),this.editorCallbacks++):(this.app.send({event:"addButton",target:"app",data:{id:r,name:n,callback:a,parent:t}}),this.appCallbacks++)}triggerButton(n){const a=this.buttonCBs.get(n);a!==void 0&&a()}createInspector(){this.inspectorFolder=this.addFolder("Inspector",this.pane)}clearInspector(){const n=this.inspectorFolder.children.length-1;for(let a=n;a>-1;--a)this.inspectorFolder.remove(this.inspectorFolder.children[a])}handleApp(n,a,t){const r=a;switch(t.event){case"addFolder":r.addFolder(t.data.name,t.data.params,t.data.parent);break;case"bindObject":r.bind(t.data.name,t.data.params,t.data.parent);break;case"updateBind":r.triggerBind(t.data.id,t.data.value);break;case"addButton":r.button(t.data.name,t.data.callback,t.data.parent);break;case"clickButton":r.triggerButton(t.data.id);break}}}var Ft={exports:{}},ot={};/**
|
2
2
|
* @license React
|
3
3
|
* react-jsx-runtime.production.min.js
|
4
4
|
*
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/var Ht;function
|
9
|
+
*/var Ht;function Fn(){if(Ht)return ot;Ht=1;var e=S,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),t=Object.prototype.hasOwnProperty,r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(s,h,d){var m,g={},v=null,E=null;d!==void 0&&(v=""+d),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(E=h.ref);for(m in h)t.call(h,m)&&!c.hasOwnProperty(m)&&(g[m]=h[m]);if(s&&s.defaultProps)for(m in h=s.defaultProps,h)g[m]===void 0&&(g[m]=h[m]);return{$$typeof:n,type:s,key:v,ref:E,props:g,_owner:r.current}}return ot.Fragment=a,ot.jsx=u,ot.jsxs=u,ot}var ct={};/**
|
10
10
|
* @license React
|
11
11
|
* react-jsx-runtime.development.js
|
12
12
|
*
|
@@ -14,20 +14,20 @@
|
|
14
14
|
*
|
15
15
|
* This source code is licensed under the MIT license found in the
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
17
|
-
*/var
|
18
|
-
`+
|
19
|
-
`),
|
20
|
-
`),
|
21
|
-
`+L[
|
17
|
+
*/var Wt;function Un(){return Wt||(Wt=1,process.env.NODE_ENV!=="production"&&function(){var e=S,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),s=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),R=Symbol.iterator,k="@@iterator";function D(i){if(i===null||typeof i!="object")return null;var b=R&&i[R]||i[k];return typeof b=="function"?b:null}var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function M(i){{for(var b=arguments.length,x=new Array(b>1?b-1:0),T=1;T<b;T++)x[T-1]=arguments[T];z("error",i,x)}}function z(i,b,x){{var T=G.ReactDebugCurrentFrame,$=T.getStackAddendum();$!==""&&(b+="%s",x=x.concat([$]));var Y=x.map(function(U){return String(U)});Y.unshift("Warning: "+b),Function.prototype.apply.call(console[i],console,Y)}}var N=!1,J=!1,fe=!1,K=!1,re=!1,ye;ye=Symbol.for("react.module.reference");function Je(i){return!!(typeof i=="string"||typeof i=="function"||i===t||i===c||re||i===r||i===d||i===m||K||i===E||N||J||fe||typeof i=="object"&&i!==null&&(i.$$typeof===v||i.$$typeof===g||i.$$typeof===u||i.$$typeof===s||i.$$typeof===h||i.$$typeof===ye||i.getModuleId!==void 0))}function De(i,b,x){var T=i.displayName;if(T)return T;var $=b.displayName||b.name||"";return $!==""?x+"("+$+")":x}function oe(i){return i.displayName||"Context"}function ee(i){if(i==null)return null;if(typeof i.tag=="number"&&M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case t:return"Fragment";case a:return"Portal";case c:return"Profiler";case r:return"StrictMode";case d:return"Suspense";case m:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case s:var b=i;return oe(b)+".Consumer";case u:var x=i;return oe(x._context)+".Provider";case h:return De(i,i.render,"ForwardRef");case g:var T=i.displayName||null;return T!==null?T:ee(i.type)||"Memo";case v:{var $=i,Y=$._payload,U=$._init;try{return ee(U(Y))}catch{return null}}}return null}var ge=Object.assign,Se=0,W,Ie,A,je,Ae,Ne,Ye;function Le(){}Le.__reactDisabledLog=!0;function Fe(){{if(Se===0){W=console.log,Ie=console.info,A=console.warn,je=console.error,Ae=console.group,Ne=console.groupCollapsed,Ye=console.groupEnd;var i={configurable:!0,enumerable:!0,value:Le,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}Se++}}function Qe(){{if(Se--,Se===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ge({},i,{value:W}),info:ge({},i,{value:Ie}),warn:ge({},i,{value:A}),error:ge({},i,{value:je}),group:ge({},i,{value:Ae}),groupCollapsed:ge({},i,{value:Ne}),groupEnd:ge({},i,{value:Ye})})}Se<0&&M("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ue=G.ReactCurrentDispatcher,Be;function Ve(i,b,x){{if(Be===void 0)try{throw Error()}catch($){var T=$.stack.trim().match(/\n( *(at )?)/);Be=T&&T[1]||""}return`
|
18
|
+
`+Be+i}}var _e=!1,Q;{var Ee=typeof WeakMap=="function"?WeakMap:Map;Q=new Ee}function et(i,b){if(!i||_e)return"";{var x=Q.get(i);if(x!==void 0)return x}var T;_e=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Y;Y=Ue.current,Ue.current=null,Fe();try{if(b){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(Pe){T=Pe}Reflect.construct(i,[],U)}else{try{U.call()}catch(Pe){T=Pe}i.call(U.prototype)}}else{try{throw Error()}catch(Pe){T=Pe}i()}}catch(Pe){if(Pe&&T&&typeof Pe.stack=="string"){for(var L=Pe.stack.split(`
|
19
|
+
`),pe=T.stack.split(`
|
20
|
+
`),te=L.length-1,ae=pe.length-1;te>=1&&ae>=0&&L[te]!==pe[ae];)ae--;for(;te>=1&&ae>=0;te--,ae--)if(L[te]!==pe[ae]){if(te!==1||ae!==1)do if(te--,ae--,ae<0||L[te]!==pe[ae]){var Oe=`
|
21
|
+
`+L[te].replace(" at new "," at ");return i.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",i.displayName)),typeof i=="function"&&Q.set(i,Oe),Oe}while(te>=1&&ae>=0);break}}}finally{_e=!1,Ue.current=Y,Qe(),Error.prepareStackTrace=$}var nt=i?i.displayName||i.name:"",Gt=nt?Ve(nt):"";return typeof i=="function"&&Q.set(i,Gt),Gt}function st(i,b,x){return et(i,!1)}function be(i){var b=i.prototype;return!!(b&&b.isReactComponent)}function p(i,b,x){if(i==null)return"";if(typeof i=="function")return et(i,be(i));if(typeof i=="string")return Ve(i);switch(i){case d:return Ve("Suspense");case m:return Ve("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case h:return st(i.render);case g:return p(i.type,b,x);case v:{var T=i,$=T._payload,Y=T._init;try{return p(Y($),b,x)}catch{}}}return""}var y=Object.prototype.hasOwnProperty,_={},F=G.ReactDebugCurrentFrame;function ce(i){if(i){var b=i._owner,x=p(i.type,i._source,b?b.type:null);F.setExtraStackFrame(x)}else F.setExtraStackFrame(null)}function le(i,b,x,T,$){{var Y=Function.call.bind(y);for(var U in i)if(Y(i,U)){var L=void 0;try{if(typeof i[U]!="function"){var pe=Error((T||"React class")+": "+x+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw pe.name="Invariant Violation",pe}L=i[U](b,U,T,x,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(te){L=te}L&&!(L instanceof Error)&&(ce($),M("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",T||"React class",x,U,typeof L),ce(null)),L instanceof Error&&!(L.message in _)&&(_[L.message]=!0,ce($),M("Failed %s type: %s",x,L.message),ce(null))}}}var O=Array.isArray;function w(i){return O(i)}function q(i){{var b=typeof Symbol=="function"&&Symbol.toStringTag,x=b&&i[Symbol.toStringTag]||i.constructor.name||"Object";return x}}function ie(i){try{return xe(i),!1}catch{return!0}}function xe(i){return""+i}function V(i){if(ie(i))return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",q(i)),xe(i)}var Z=G.ReactCurrentOwner,H={key:!0,ref:!0,__self:!0,__source:!0},ke,ue,de;de={};function Tt(i){if(y.call(i,"ref")){var b=Object.getOwnPropertyDescriptor(i,"ref").get;if(b&&b.isReactWarning)return!1}return i.ref!==void 0}function _t(i){if(y.call(i,"key")){var b=Object.getOwnPropertyDescriptor(i,"key").get;if(b&&b.isReactWarning)return!1}return i.key!==void 0}function kt(i,b){if(typeof i.ref=="string"&&Z.current&&b&&Z.current.stateNode!==b){var x=ee(Z.current.type);de[x]||(M('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',ee(Z.current.type),i.ref),de[x]=!0)}}function mt(i,b){{var x=function(){ke||(ke=!0,M("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};x.isReactWarning=!0,Object.defineProperty(i,"key",{get:x,configurable:!0})}}function $e(i,b){{var x=function(){ue||(ue=!0,M("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};x.isReactWarning=!0,Object.defineProperty(i,"ref",{get:x,configurable:!0})}}var $t=function(i,b,x,T,$,Y,U){var L={$$typeof:n,type:i,key:b,ref:x,props:U,_owner:Y};return L._store={},Object.defineProperty(L._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(L,"_self",{configurable:!1,enumerable:!1,writable:!1,value:T}),Object.defineProperty(L,"_source",{configurable:!1,enumerable:!1,writable:!1,value:$}),Object.freeze&&(Object.freeze(L.props),Object.freeze(L)),L};function o(i,b,x,T,$){{var Y,U={},L=null,pe=null;x!==void 0&&(V(x),L=""+x),_t(b)&&(V(b.key),L=""+b.key),Tt(b)&&(pe=b.ref,kt(b,$));for(Y in b)y.call(b,Y)&&!H.hasOwnProperty(Y)&&(U[Y]=b[Y]);if(i&&i.defaultProps){var te=i.defaultProps;for(Y in te)U[Y]===void 0&&(U[Y]=te[Y])}if(L||pe){var ae=typeof i=="function"?i.displayName||i.name||"Unknown":i;L&&mt(U,ae),pe&&$e(U,ae)}return $t(i,L,pe,$,T,Z.current,U)}}var C=G.ReactCurrentOwner,P=G.ReactDebugCurrentFrame;function B(i){if(i){var b=i._owner,x=p(i.type,i._source,b?b.type:null);P.setExtraStackFrame(x)}else P.setExtraStackFrame(null)}var se;se=!1;function Ce(i){return typeof i=="object"&&i!==null&&i.$$typeof===n}function me(){{if(C.current){var i=ee(C.current.type);if(i)return`
|
22
22
|
|
23
|
-
Check the render method of \``+
|
23
|
+
Check the render method of \``+i+"`."}return""}}function zt(i){{if(i!==void 0){var b=i.fileName.replace(/^.*[\\\/]/,""),x=i.lineNumber;return`
|
24
24
|
|
25
|
-
Check your code at `+
|
25
|
+
Check your code at `+b+":"+x+"."}return""}}var pt={};function gt(i){{var b=me();if(!b){var x=typeof i=="string"?i:i.displayName||i.name;x&&(b=`
|
26
26
|
|
27
|
-
Check the top-level render call using <`+
|
27
|
+
Check the top-level render call using <`+x+">.")}return b}}function we(i,b){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var x=gt(b);if(pt[x])return;pt[x]=!0;var T="";i&&i._owner&&i._owner!==C.current&&(T=" It was passed a child from "+ee(i._owner.type)+"."),B(i),M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',x,T),B(null)}}function Me(i,b){{if(typeof i!="object")return;if(w(i))for(var x=0;x<i.length;x++){var T=i[x];Ce(T)&&we(T,b)}else if(Ce(i))i._store&&(i._store.validated=!0);else if(i){var $=D(i);if(typeof $=="function"&&$!==i.entries)for(var Y=$.call(i),U;!(U=Y.next()).done;)Ce(U.value)&&we(U.value,b)}}}function qe(i){{var b=i.type;if(b==null||typeof b=="string")return;var x;if(typeof b=="function")x=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===h||b.$$typeof===g))x=b.propTypes;else return;if(x){var T=ee(b);le(x,i.props,"prop",T,i)}else if(b.PropTypes!==void 0&&!se){se=!0;var $=ee(b);M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",$||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Re(i){{for(var b=Object.keys(i.props),x=0;x<b.length;x++){var T=b[x];if(T!=="children"&&T!=="key"){B(i),M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",T),B(null);break}}i.ref!==null&&(B(i),M("Invalid attribute `ref` supplied to `React.Fragment`."),B(null))}}function ze(i,b,x,T,$,Y){{var U=Je(i);if(!U){var L="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(L+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var pe=zt($);pe?L+=pe:L+=me();var te;i===null?te="null":w(i)?te="array":i!==void 0&&i.$$typeof===n?(te="<"+(ee(i.type)||"Unknown")+" />",L=" Did you accidentally export a JSX literal instead of a component?"):te=typeof i,M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",te,L)}var ae=o(i,b,x,$,Y);if(ae==null)return ae;if(U){var Oe=b.children;if(Oe!==void 0)if(T)if(w(Oe)){for(var nt=0;nt<Oe.length;nt++)Me(Oe[nt],i);Object.freeze&&Object.freeze(Oe)}else M("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Me(Oe,i)}return i===t?Re(ae):qe(ae),ae}}function tt(i,b,x){return ze(i,b,x,!0)}function vt(i,b,x){return ze(i,b,x,!1)}var yn=vt,Sn=tt;ct.Fragment=t,ct.jsx=yn,ct.jsxs=Sn}()),ct}process.env.NODE_ENV==="production"?Ft.exports=Fn():Ft.exports=Un();var l=Ft.exports;function Bt(e){return e.title.search("<")>-1?l.jsx("button",{className:"svg",dangerouslySetInnerHTML:{__html:e.title}}):l.jsx("button",{children:e.title})}const Bn=l.jsxs("svg",{className:"closeIcon",width:"14",height:"14",fill:"none",stroke:"#666666",strokeMiterlimit:"10",children:[l.jsx("circle",{cx:"7",cy:"7",r:"6"}),l.jsx("line",{x1:"4",y1:"4",x2:"10",y2:"10"}),l.jsx("line",{x1:"4",y1:"10",x2:"10",y2:"4"})]}),Vn=l.jsx("svg",{className:"dragIcon",width:"14",height:"14",fill:"#666666",stroke:"none",children:l.jsx("path",{d:`M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
|
28
28
|
C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.57,10h6.86C10.74,10,11,9.78,11,9.5v-1
|
29
|
-
C11,8.22,10.74,8,10.43,8z`})});function on(e){return l.jsx(en.Reorder.Item,{value:e.title,children:l.jsxs("div",{children:[Ln,l.jsx("span",{children:e.title}),l.jsx("button",{className:"closeIcon",onClick:()=>{e.onDelete(e.index)},children:Nn})]})},e.title)}function cn(e){const[n,a]=E.useState(!1),[t,i]=E.useState(e.options),c=d=>{e.onDragComplete(d),i(d)},u=d=>{const m=[...t];m.splice(d,1),c(m)},r=[];t.forEach((d,m)=>{r.push(l.jsx(on,{index:m,title:d,onDelete:u},d))});let h="dropdown draggable";return e.subdropdown&&(h+=" subdropdown"),l.jsxs("div",{className:h,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[l.jsx(Ut,{title:e.title}),l.jsx(en.Reorder.Group,{axis:"y",values:t,onReorder:c,style:{visibility:n?"visible":"hidden"},children:r})]})}function ln(e){const[n,a]=E.useState(!1),t=[];e.options.map((c,u)=>{e.onSelect!==void 0&&(c.onSelect=e.onSelect),t.push(l.jsx(un,{option:c},u))});let i="dropdown";return e.subdropdown&&(i+=" subdropdown"),l.jsxs("div",{className:i,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[l.jsx(Ut,{title:e.title}),l.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:t})]})}function un(e){const{option:n}=e,[a,t]=E.useState("");let i;switch(n.type){case"draggable":i=l.jsx(cn,{title:n.title,options:n.value,onDragComplete:c=>{n.onDragComplete!==void 0&&n.onDragComplete(c)},subdropdown:!0});break;case"dropdown":i=l.jsx(ln,{title:n.title,options:n.value,onSelect:n.onSelect,subdropdown:!0});break;case"option":i=l.jsx("button",{onClick:()=>{n.onSelect!==void 0&&n.onSelect(n.value),n.selectable&&(a!==n.title?t(n.title):t(""))},children:n.title});break}return l.jsx("li",{className:a===n.title?"selected":"",children:i},tn())}function Fn(e,n,a){function t(c){switch(n.forEach(u=>{u.callback(e,u.remote,c)}),c.event){case"custom":j.dispatchEvent({type:I.CUSTOM,value:c.data});break}}function i(c){switch(a.forEach(u=>{u.callback(e,u.remote,c)}),c.event){case"custom":j.dispatchEvent({type:I.CUSTOM,value:c.data});break}}e.listen=c=>{c.target==="editor"?i(c):t(c)}}function Mt(e){const[n,a]=E.useState(e.open!==void 0?e.open:!0),t=!n||e.children===void 0;return l.jsxs("div",{className:`accordion ${t?"hide":""}`,children:[l.jsxs("button",{className:"toggle",onClick:()=>{const i=!n;e.onToggle!==void 0&&e.onToggle(i),a(i)},children:[l.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),l.jsx("p",{className:"label",children:lt(e.label)})]}),e.button,l.jsx("div",{className:n?"open":"",children:l.jsx("div",{children:e.children})})]})}function Bt(e){const n=E.useRef(null),[a,t]=E.useState(!1),i=e.child!==void 0&&e.child.children.length>0,c=[];return e.child!==void 0&&e.child.children.length>0&&e.child.children.map((u,r)=>{c.push(l.jsx(Bt,{child:u,three:e.three},r))}),E.useEffect(()=>{const u=e.child.uuid,r=e.three.getScene(u);if(r!==null){const h=r.getObjectByProperty("uuid",u);h!==void 0&&(n.current.style.opacity=h.visible?"1":"0.25")}},[]),l.jsx(l.Fragment,{children:e.child!==void 0&&l.jsxs("div",{className:"childObject",children:[l.jsxs("div",{className:"child",children:[i?l.jsx("button",{className:"status",style:{backgroundPositionX:a?"-14px":"2px"},onClick:()=>{t(!a)}}):null,l.jsx("button",{className:"name",style:{left:i?"20px":"5px"},onClick:()=>{e.child!==void 0&&(e.three.getObject(e.child.uuid),a||t(!0))},children:e.child.name.length>0?`${e.child.name} (${e.child.type})`:`${e.child.type}::${e.child.uuid}`}),l.jsx("button",{className:"visibility",ref:n,onClick:()=>{if(e.child){const u=e.three.getScene(e.child.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",e.child.uuid);if(r!==void 0){const h="visible",d=!r.visible;n.current.style.opacity=d?"1":"0.25",e.three.updateObject(e.child.uuid,h,d),te(r,h,d)}else console.log(`Hermes - Couldn't find object: ${e.child.uuid}`,u)}else console.log(`Hermes - Couldn't find object in scene: ${e.child.uuid}, ${e.child.name}`)}}}),l.jsx("div",{className:`icon ${Rn(e.child)}`})]}),l.jsx("div",{className:a?"open":"",children:l.jsx("div",{className:"container",children:c})})]},Math.random())})}function dn(e){const n=[];return e.child?.children.map((a,t)=>{n.push(l.jsx(Bt,{child:a,scene:e.scene,three:e.three},t))}),l.jsx("div",{className:`scene ${e.class!==void 0?e.class:""}`,children:n})}function Un(e){const[n,a]=E.useState(e.defaultValue);return E.useEffect(()=>{let t=!1,i=-1,c=0,u=e.defaultValue;const r=b=>{t=!0,c=Number(e.input.current?.value),i=b.clientX,document.addEventListener("mouseup",d,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("contextmenu",d,!1)},h=b=>{if(!t)return;const C=e.step!==void 0?e.step:1,D=(b.clientX-i)*C;u=Number((c+D).toFixed(4)),e.min!==void 0&&(u=Math.max(u,e.min)),e.max!==void 0&&(u=Math.min(u,e.max)),e.onChange!==void 0&&e.onChange(u),a(u)},d=()=>{t=!1,document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)},m=b=>{const C=Number(b.target.value);a(C)},p=b=>{const C=Number(b.target.value);e.onChange!==void 0&&e.onChange(C),a(C)};return e.input.current?.addEventListener("input",m),e.label.current?.addEventListener("mousedown",r,!1),e.sliderRef!==void 0&&e.sliderRef.current?.addEventListener("input",p),()=>{e.input.current?.removeEventListener("input",m),e.label.current?.removeEventListener("mousedown",r),e.sliderRef!==void 0&&e.sliderRef.current?.removeEventListener("input",p),document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)}},[]),n}function Ke(e){const n=E.useRef(null),a=E.useRef(null),t=Un({label:e.labelRef,input:n,sliderRef:a,defaultValue:e.value,min:e.min,max:e.max,step:e.step,onChange:i=>{e.onChange!==void 0&&e.onChange(e.prop,i)}});return l.jsxs(l.Fragment,{children:[e.type==="number"&&l.jsx("input",{alt:e.alt,className:e.className,ref:n,type:"number",value:t,min:e.min,max:e.max,step:e.step,disabled:e.disabled,onChange:i=>{const c=Number(i.target.value);e.onChange!==void 0&&e.onChange(e.prop,c)}}),e.type==="range"&&l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"text",value:t.toString(),disabled:e.disabled,ref:n,className:"min",onChange:i=>{const c=Number(i.target.value);e.onChange!==void 0&&e.onChange(e.prop,c)}}),l.jsx("input",{disabled:e.disabled,type:"range",value:t,min:e.min,max:e.max,step:e.step,ref:a,onChange:Ct})]})]})}function Bn(e){const n=E.useRef(null),a=E.useRef(null),t=E.useRef(null),i=E.useRef(null),c=E.useRef(null),u=E.useRef(null),[r,h]=E.useState(e.value),[d,m]=E.useState({min:Math.min(e.min,Math.min(e.value.x,e.value.y)),max:Math.max(e.max,Math.max(e.value.x,e.value.y))}),[p,b]=E.useState(!1);function C(){p||(window.addEventListener("mousemove",q),window.addEventListener("mouseup",D),window.addEventListener("mouseup",D),b(!0))}function D(){window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",D),b(!1)}function q(R){const Z=c.current.getBoundingClientRect(),ce=He(0,99,R.clientX-Z.left)/99,W=He(0,99,R.clientY-Z.top)/99,me=It(jt(d.min,d.max,ce),3),ie=It(jt(d.min,d.max,W),3);e.onChange({target:{value:{x:me,y:ie}}}),h({x:me,y:ie})}function z(R){let Z=r.x,ce=r.y;R.target===n.current?Z=Number(R.target.value):ce=Number(R.target.value),h({x:Z,y:ce})}function G(){const R=Number(t.current.value);m({min:R,max:d.max}),(r.x<R||r.y<R)&&h({x:He(R,d.max,r.x),y:He(R,d.max,r.y)})}function M(){const R=Number(i.current.value);m({min:d.min,max:R}),(r.x>R||r.y>R)&&h({x:He(d.min,R,r.x),y:He(d.min,R,r.y)})}E.useEffect(()=>{const R=Pt(d.min,d.max,r.x),Z=Pt(d.min,d.max,r.y);u.current.style.left=`${R*100}%`,u.current.style.top=`${Z*100}%`},[d,r]);const K=e.step!==void 0?e.step:.01;return l.jsxs("div",{className:"vector2",children:[l.jsxs("div",{className:"fields",children:[l.jsxs("div",{children:[l.jsx("label",{children:"X:"}),l.jsx("input",{ref:n,type:"number",value:r.x,min:d.min,max:d.max,step:K,onChange:z})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Y:"}),l.jsx("input",{ref:a,type:"number",value:r.y,min:d.min,max:d.max,step:K,onChange:z})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Min:"}),l.jsx("input",{ref:t,type:"number",value:d.min,step:K,onChange:G})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Max:"}),l.jsx("input",{ref:i,type:"number",value:d.max,step:K,onChange:M})]})]}),l.jsxs("div",{className:"input",ref:c,onMouseDown:C,onMouseUp:D,children:[l.jsx("div",{className:"x"}),l.jsx("div",{className:"y"}),l.jsx("div",{className:"pt",ref:u})]})]})}function Wt(e){const n=e.value.isVector3!==void 0,a=e.value.isEuler!==void 0,t=e.value.elements!==void 0,i=e.step!==void 0?e.step:.01,c=[];if(n){const u=E.useMemo(()=>e.value,[]),r=(d,m)=>{u[d]=m,e.onChange({target:{value:u}})};["x","y","z"].forEach(d=>{const m=E.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:m,children:d.toUpperCase()}),l.jsx(Ke,{value:u[d],type:"number",prop:d,step:i,labelRef:m,onChange:r})]},d))})}else if(a){const u=E.useMemo(()=>e.value,[]),r=(d,m)=>{u[d]=m,e.onChange({target:{value:u}})};["_x","_y","_z"].forEach(d=>{const m=E.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:m,children:d.substring(1).toUpperCase()}),l.jsx(Ke,{value:u[d],type:"number",prop:d,step:i,labelRef:m,onChange:r})]},d))})}else if(t){const u=E.useMemo(()=>e.value,[]),r=(h,d)=>{const m=Number(h);u.elements[m]=d,e.onChange({target:{value:u}})};for(let h=0;h<9;h++){const d=E.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:d,children:h+1}),l.jsx(Ke,{value:u.elements[h],type:"number",prop:h.toString(),step:i,labelRef:d,onChange:r})]},h.toString()))}}return l.jsx("div",{className:"grid3",children:c},Math.random().toString())}function Vn(e){const n=e.value.x!==void 0,a=e.step!==void 0?e.step:.01,t=[];if(n){const i=E.useMemo(()=>e.value,[]),c=(r,h)=>{i[r]=h,e.onChange({target:{value:i}})};["x","y","z","w"].forEach(r=>{const h=E.useRef(null);t.push(l.jsxs("div",{children:[l.jsx("label",{ref:h,children:r.toUpperCase()}),l.jsx(Ke,{value:i.x,type:"number",prop:r,step:a,labelRef:h,onChange:c})]},r))})}else{const i=E.useMemo(()=>e.value,[]),c=(u,r)=>{const h=Number(u);i.elements[h]=r,e.onChange({target:{value:i}})};for(let u=0;u<16;u++){const r=E.useRef(null);t.push(l.jsxs("div",{children:[l.jsx("label",{ref:r,children:u+1}),l.jsx(Ke,{value:i.elements[u],type:"number",prop:u.toString(),step:a,labelRef:r,onChange:c})]},u.toString()))}}return l.jsx("div",{className:"grid4",children:t})}function zn(e){return"items"in e}function Xe(e){const n=[];return e.items.forEach(a=>{zn(a)?n.push(l.jsx(Xe,{title:lt(a.title),items:a.items},Math.random())):n.push(l.jsx(Et,{title:a.title,prop:a.prop,value:a.value,type:a.type,min:a.min,max:a.max,step:a.step,disabled:a.disabled,options:a.options,onChange:(t,i)=>{a.onChange!==void 0&&a.onChange(t,i)},onKeyDown:t=>{a.onKeyDown!==void 0&&a.onKeyDown(t)}},Math.random()))}),l.jsx(Mt,{label:e.title,open:e.expanded===!0,children:n})}function Gn(e){return!(e==="alphaHash"||e==="alphaToCoverage"||e==="attenuationDistance"||e==="blendAlpha"||e==="blendColor"||e==="blendDstAlpha"||e==="colorWrite"||e==="combine"||e==="defaultAttributeValues"||e==="depthFunc"||e==="forceSinglePass"||e==="glslVersion"||e==="linecap"||e==="linejoin"||e==="linewidth"||e==="normalMapType"||e==="precision"||e==="premultipliedAlpha"||e==="shadowSide"||e==="toneMapped"||e==="uniformsGroups"||e==="uniformsNeedUpdate"||e==="userData"||e==="vertexColors"||e==="version"||e==="wireframeLinecap"||e==="wireframeLinejoin"||e==="wireframeLinewidth"||e.slice(0,4)==="clip"||e.slice(0,7)==="polygon"||e.slice(0,7)==="stencil"||e.slice(0,2)==="is")}function Hn(e){switch(e){case"Alpha Map":return"alphaMap";case"Anisotropy Map":return"anisotropyMap";case"AO Map":return"aoMap";case"Bump Map":return"bumpMap";case"Clearcoat Map":return"clearcoatMap";case"Clearcoat Normal Map":return"clearcoatNormalMap";case"Clearcoat Roughness Map":return"clearcoatRoughnessMap";case"Displacement Map":return"displacementMap";case"Emissive Map":return"emissiveMap";case"Iridescence Map":return"iridescenceMap";case"Iridescence Thickness Map":return"iridescenceThicknessMap";case"Map":return"map";case"Matcap":return"matcap";case"Normal Map":return"normalMap";case"Roughness Map":return"roughnessMap";case"Sheen Color Map":return"sheenColorMap";case"Sheen Roughness Map":return"sheenRoughnessMap";case"Specular Color Map":return"specularColorMap";case"Specular Map Intensity":return"specularIntensityMap";case"Thickness Map":return"thicknessMap";case"Transmission Map":return"transmissionMap"}return e}function Ot(e){switch(e){case"alphaMap":return"Alpha Map";case"anisotropyMap":return"Anisotropy Map";case"anisotropyRotation":return"Anisotropy Rotation";case"aoMap":return"AO Map";case"aoMapIntensity":return"AO Map Intensity";case"attenuationColor":return"Attenuation Color";case"blendAlpha":return"Blend Alpha";case"blendColor":return"Blend Color";case"blendDst":return"Blend Dst";case"blendDstAlpha":return"Blend Dst Alha";case"blendEquation":return"Blend Equation";case"blendEquationAlpha":return"Blend Equation Alpha";case"blending":return"Blending";case"blendSrc":return"Blend Src";case"blendSrcAlpha":return"Blend Src Alpha";case"bumpMap":return"Bump Map";case"bumpScale":return"Bump Scale";case"clearcoatMap":return"Clearcoat Map";case"clearcoatNormalMap":return"Clearcoat Normal Map";case"clearcoatNormalScale":return"Clearcoat Normal Scale";case"clearcoatRoughness":return"Clearcoat Roughness";case"clearcoatRoughnessMap":return"Clearcoat Roughness Map";case"color":return"Color";case"defines":return"Defines";case"depthTest":return"Depth Test";case"depthWrite":return"Depth Write";case"displacementBias":return"Displacement Bias";case"displacementMap":return"Displacement Map";case"displacementScale":return"Displacement Scale";case"dithering":return"Dithering";case"emissive":return"Emissive";case"emissiveMap":return"Emissive Map";case"emissiveIntensity":return"Emissive Intensity";case"envMap":return"Environment Map";case"envMapIntensity":return"Environment Map Intensity";case"extensions":return"Extensions";case"flatShading":return"Flat Shading";case"fragmentShader":return"Fragment Shader";case"fog":return"Fog";case"gradientMap":return"Gradient Map";case"ior":return"IOR";case"iridescenceIOR":return"Iridescence IOR";case"iridescenceMap":return"Iridescence Map";case"iridescenceThicknessMap":return"Iridescence Thickness Map";case"iridescenceThicknessRange":return"Iridescence Thickness Range";case"lights":return"Lights";case"lightMap":return"Light Map";case"lightMapIntensity":return"Light Map Intensity";case"map":return"Map";case"matcap":return"Matcap";case"metalness":return"Metalness";case"metalnessMap":return"Metalness Map";case"name":return"Name";case"normalMap":return"Normal Map";case"normalScale":return"Normal Scale";case"opacity":return"Opacity";case"reflectivity":return"Reflectivity";case"refractionRatio":return"Refraction Ratio";case"roughness":return"Roughness";case"roughnessMap":return"Roughness Map";case"sheenColor":return"Sheen Color";case"sheenColorMap":return"Sheen Color Map";case"sheenRoughness":return"Sheen Roughness";case"sheenRoughnessMap":return"Sheen Roughness Map";case"shininess":return"Shininess";case"side":return"Side";case"size":return"Size";case"sizeAttenuation":return"Size Attenuation";case"specular":return"Specular";case"specularColor":return"Specular Color";case"specularColorMap":return"Specular Color Map";case"specularIntensity":return"Specular Intensity";case"specularIntensityMap":return"Specular Map Intensity";case"thickness":return"Thickness";case"thicknessMap":return"Thickness Map";case"transmission":return"Transmission";case"transmissionMap":return"Transmission Map";case"transparent":return"Transparent";case"type":return"Type";case"uuid":return"UUID";case"uniforms":return"Uniforms";case"vertexShader":return"Vertex Shader";case"visible":return"Visible";case"wireframe":return"Wireframe"}return e}function hn(e){const n=e.toLowerCase();return n.search("intensity")>-1||n==="anisotropyrotation"||n==="blendalpha"||n==="bumpscale"||n==="clearcoatroughness"||n==="displacementbias"||n==="displacementscale"||n==="metalness"||n==="opacity"||n==="reflectivity"||n==="refractionratio"||n==="roughness"||n==="sheenroughness"||n==="thickness"}function $n(){const e=document.createElement("input");return e.type="file",new Promise((n,a)=>{e.addEventListener("change",function(){if(e.files===null)a();else{const t=e.files[0],i=new FileReader;i.onload=function(c){n(c.target.result)},i.readAsDataURL(t)}}),e.click()})}const Wn=[{title:"Front",value:f.FrontSide},{title:"Back",value:f.BackSide},{title:"Double",value:f.DoubleSide}],Yn=[{title:"No Blending",value:f.NoBlending},{title:"Normal",value:f.NormalBlending},{title:"Additive",value:f.AdditiveBlending},{title:"Subtractive",value:f.SubtractiveBlending},{title:"Multiply",value:f.MultiplyBlending},{title:"Custom",value:f.CustomBlending}],qn=[{title:"Add",value:f.AddEquation},{title:"Subtract",value:f.SubtractEquation},{title:"Reverse Subtract",value:f.ReverseSubtractEquation},{title:"Min",value:f.MinEquation},{title:"Max",value:f.MaxEquation}],Kn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Src Alpha Saturate",valye:f.SrcAlphaSaturateFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}],Xn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}];function ot(e,n){e.needsUpdate=!0,e.type="option",e.options=n}function Zn(e,n,a,t){return{type:"boolean",title:Ot(e),prop:e,value:n,needsUpdate:!0,onChange:(i,c)=>{t.updateObject(a.uuid,`material.${e}`,c),t.updateObject(a.uuid,"material.needsUpdate",!0);const u=t.getScene(a.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",a.uuid);te(r,`material.${e}`,c)}}}}function Jn(e,n,a,t){const i={type:"number",title:Ot(e),prop:e,value:n,min:void 0,max:void 0,step:.01,needsUpdate:!0,onChange:(c,u)=>{t.updateObject(a.uuid,`material.${e}`,u),t.updateObject(a.uuid,"material.needsUpdate",!0);const r=t.getScene(a.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",a.uuid);te(h,`material.${e}`,u)}}};switch(e){case"blending":ot(i,Yn);break;case"blendDst":ot(i,Xn);break;case"blendEquation":ot(i,qn);break;case"blendSrc":ot(i,Kn);break;case"side":ot(i,Wn);break}return hn(e)&&(i.value=Number(n),i.type="range",i.min=Math.min(0,i.value),i.max=Math.max(1,i.value),i.step=.01),i}function Qn(e,n,a,t){const i={type:"string",title:Ot(e),prop:e,value:n,needsUpdate:!0,onChange:(u,r)=>{t.updateObject(a.uuid,`material.${e}`,r),t.updateObject(a.uuid,"material.needsUpdate",!0);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);te(d,`material.${e}`,r)}},onKeyDown:u=>{}};return(e==="vertexShader"||e==="fragmentShader")&&(i.disabled=!1,i.latest=i.value,i.onChange=(u,r)=>{i.latest=r,t.updateObject(a.uuid,`material.${e}`,r);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);te(d,`material.${e}`,r)}},i.onKeyDown=u=>{if(u.key==="Enter"&&(u.altKey||u.metaKey)){t.updateObject(a.uuid,"material.needsUpdate",!0);const r=t.getScene(a.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",a.uuid);te(h,"material.needsUpdate",!0)}}}),i}function ea(e){return e.x!==void 0&&e.y!==void 0&&e.z===void 0}function ta(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w===void 0}function na(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w!==void 0}function Ft(e){e.sort((n,a)=>n.title<a.title?-1:n.title>a.title?1:0)}function ct(e,n,a,t,i="",c=!1){const u=Ot(e).split(".")[0].replaceAll("[","").replaceAll("]",""),r=i.length>0?`${i}.${e}`:e,h=typeof n;if(h==="boolean"||h==="string")return{title:u,prop:r,type:h,value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(h==="number"){const d={title:u,prop:r,type:"number",value:n,step:.01,disabled:c,onChange:(m,p)=>{t.updateObject(a.uuid,`material.${r}`,p);const b=t.getScene(a.uuid);if(b!==null){const C=b.getObjectByProperty("uuid",a.uuid);te(C,`material.${r}`,p)}}};return hn(u)&&(d.type="range",d.min=0,d.max=1),d}else{if(n.isColor)return{title:u,prop:r,type:"color",value:n,disabled:c,onChange:(d,m)=>{const p=new f.Color(m);t.updateObject(a.uuid,`material.${r}`,p);const b=t.getScene(a.uuid);if(b!==null){const C=b.getObjectByProperty("uuid",a.uuid);te(C,`material.${r}`,p)}}};if(Array.isArray(n)){const d=[];for(const m in n){const p=n[m],b=`[${m.toString()}]`;if(p.value!==void 0){const C=ct(`${b}.value`,p.value,a,t,r,c);C!==void 0&&d.push(C)}else{const C=ct(b,p,a,t,r,c);C!==void 0&&d.push(C)}}if(d.length>0)return Ft(d),{title:u,items:d}}else{if(ea(n))return{title:u,prop:r,type:"vector2",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(ta(n))return{title:u,prop:r,type:"grid3",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(na(n))return{title:u,prop:r,type:"grid4",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(n.isEuler)return{title:u,prop:r,type:"euler",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};if(n.src!==void 0)return{title:u,type:"image",value:n,disabled:c,onChange:(d,m)=>{const p=Hn(e),b=i.length>0?`${i}.${p}`:p;t.createTexture(a.uuid,`material.${b}`,m);const C=t.getScene(a.uuid);if(C!==null){const D=C.getObjectByProperty("uuid",a.uuid);if(D!==void 0){const q=z=>{const G=D.material,M=b.split(".");switch(M.length){case 1:G[M[0]]=z;break;case 2:G[M[0]][M[1]]=z;break;case 3:G[M[0]][M[1]][M[2]]=z;break;case 4:G[M[0]][M[1]][M[2]][M[3]]=z;break;case 5:G[M[0]][M[1]][M[2]][M[3]][M[4]]=z;break}G.needsUpdate=!0};m.src.length>0?sn(m.src).then(z=>{z.offset.set(m.offset[0],m.offset[1]),z.repeat.set(m.repeat[0],m.repeat[1]),q(z)}):q(null)}}}};if(n.elements!==void 0)return{title:u,prop:r,type:n.elements.length>9?"grid4":"grid3",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${r}`,m);const p=t.getScene(a.uuid);if(p!==null){const b=p.getObjectByProperty("uuid",a.uuid);te(b,`material.${r}`,m)}}};{const d=[],m=e==="defines"||e==="extensions";try{for(const p in n){const b=n[p];if(b!==void 0)if(b.value!==void 0){const C=ct(`${p}.value`,b.value,a,t,r,m);C!==void 0&&d.push(C)}else{const C=ct(p,b,a,t,r,m);C!==void 0&&d.push(C)}}}catch{console.log("Issue cycling through material object:",e,n)}if(d.length>0)return Ft(d),{title:u,items:d}}}}}function Yt(e,n,a){const t=[];for(const i in e){if(!Gn(i))continue;const c=typeof e[i],u=e[i];if(c==="boolean")t.push(Zn(i,u,n,a));else if(c==="number")t.push(Jn(i,u,n,a));else if(c==="string")t.push(Qn(i,u,n,a));else if(c==="object"){const r=ct(i,u,n,a);r!==void 0&&t.push(r)}else u!==void 0&&console.log("other:",i,c,u)}return Ft(t),t.push({title:"Update Material",type:"button",onChange:()=>{a.updateObject(n.uuid,"material.needsUpdate",!0);const i=a.getScene(n.uuid);if(i!==null){const c=i.getObjectByProperty("uuid",n.uuid);te(c,"material.needsUpdate",!0)}}}),t}function aa(e,n){const a=e.material;if(Array.isArray(a)){const t=[],i=a.length;for(let c=0;c<i;c++)t.push(l.jsx(Xe,{title:`Material ${c}`,items:Yt(a[c],e,n)},`Material ${c}`));return l.jsx(l.Fragment,{children:t})}else return l.jsx(Xe,{title:"Material",items:Yt(a,e,n)})}const qt="data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";function ia(e){const n=e.step!==void 0?e.step:.01,a=E.useRef(null),t=E.useRef(null),i=E.useRef(null),c=E.useRef(null),u=E.useRef(null),[r]=E.useState(e.value),[h,d]=E.useState(e.value.offset[0]),[m,p]=E.useState(e.value.offset[1]),[b,C]=E.useState(e.value.repeat[0]),[D,q]=E.useState(e.value.repeat[1]);function z(M,K,R,Z,ce){if(e.onChange!==void 0){const W=e.prop!==void 0?e.prop:e.title;e.onChange(W,{src:M,offset:[K,R],repeat:[Z,ce]})}}function G(M){const K=a.current.src,R=M.target.value;switch(M.target){case t.current:d(R),z(K,R,m,b,D);break;case i.current:p(R),z(K,h,R,b,D);break;case c.current:C(R),z(K,h,m,R,D);break;case u.current:q(R),z(K,h,m,b,R);break}}return l.jsxs("div",{className:"imageField",children:[l.jsx("img",{alt:e.title,ref:a,onClick:()=>{$n().then(M=>{a.current.src=M,z(M,h,m,b,D)})},src:r.src.length>0?r.src:qt}),l.jsxs("div",{className:"fields",children:[l.jsxs("div",{children:[l.jsx("label",{children:"Offset:"}),l.jsx("input",{ref:t,type:"number",value:h,step:n,onChange:G}),l.jsx("input",{ref:i,type:"number",value:m,step:n,onChange:G})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Repeat:"}),l.jsx("input",{ref:c,type:"number",value:b,step:n,onChange:G}),l.jsx("input",{ref:u,type:"number",value:D,step:n,onChange:G})]}),l.jsx("button",{onClick:()=>{z("",h,m,b,D),a.current.src=qt},children:"Clear"})]})]})}function Et(e){let n=e.value;n!==void 0&&n.isColor!==void 0&&(n=an(e.value));const[a,t]=E.useState(n),i=E.useRef(null),c=d=>{let m=d.target.value;e.type==="boolean"?m=d.target.checked:e.type==="option"&&(m=e.options[m].value),t(m),e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,m)},u={};e.disabled&&(u.opacity=.8);const r=e.type==="string"&&(a.length>100||a.search(`
|
30
|
-
`)>-1),h=r||e.type==="image"||e.type==="vector2";return l.jsxs("div",{className:`field ${h?"block":""}`,style:u,children:[e.type!=="button"&&l.jsx("label",{ref:i,children:lt(e.title)},"fieldLabel"),e.type==="string"&&!r&&l.jsx("input",{type:"text",disabled:e.disabled,onChange:c,value:a}),e.type==="string"&&r&&l.jsx("textarea",{cols:50,rows:10,disabled:e.disabled!==void 0?e.disabled:!0,onChange:c,onKeyDown:d=>{e.onKeyDown!==void 0&&e.onKeyDown(d)},value:a}),e.type==="boolean"&&l.jsx("input",{type:"checkbox",disabled:e.disabled,onChange:c,checked:a}),e.type==="number"&&l.jsx(Ke,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:i,onChange:e.onChange}),e.type==="range"&&l.jsx(Ke,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:i,onChange:e.onChange}),e.type==="color"&&l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"text",value:a.toString(),onChange:c,disabled:e.disabled,className:"color"}),l.jsx("input",{type:"color",value:a,onChange:c,disabled:e.disabled})]}),e.type==="button"&&l.jsx("button",{disabled:e.disabled,onClick:()=>{e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,!0)},children:e.title}),e.type==="image"&&l.jsx(ia,{title:e.title,prop:e.prop,value:e.value,onChange:e.onChange}),e.type==="option"&&l.jsx(l.Fragment,{children:l.jsx("select",{onChange:c,disabled:e.disabled,defaultValue:e.value,children:e.options?.map((d,m)=>l.jsx("option",{value:d.value,children:lt(d.title)},m))})}),e.type==="vector2"&&l.jsx(Bn,{step:e.step,value:a,min:0,max:1,onChange:c}),e.type==="grid3"&&l.jsx(Wt,{step:e.step,value:a,onChange:c}),e.type==="grid4"&&l.jsx(Vn,{step:e.step,value:a,onChange:c}),e.type==="euler"&&l.jsx(Wt,{step:e.step,value:a,onChange:c})]})}function Kt(e){switch(e){case"fov":return"FOV";case"zoom":return"Zoom";case"near":return"Near";case"far":return"Far";case"focus":return"Focus";case"aspect":return"Aspect";case"filmGauge":return"Film Gauge";case"filmOffset":return"Film Offset";case"left":return"Left";case"right":return"Right";case"top":return"Top";case"bottom":return"Bottom"}return e}function ra(e,n){const a=[];if(e.perspectiveCameraInfo!==void 0)for(const t in e.perspectiveCameraInfo)a.push({title:Kt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(i,c)=>{n.updateObject(e.uuid,i,c),n.requestMethod(e.uuid,"updateProjectionMatrix");const u=n.getScene(e.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",e.uuid);r!==void 0&&(te(r,i,c),r.updateProjectionMatrix())}}});else if(e.orthographicCameraInfo!==void 0)for(const t in e.orthographicCameraInfo)a.push({title:Kt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(i,c)=>{n.updateObject(e.uuid,i,c),n.requestMethod(e.uuid,"updateProjectionMatrix");const u=n.getScene(e.uuid);if(u!==null){const r=u.getObjectByProperty("uuid",e.uuid);r!==void 0&&(te(r,i,c),r.updateProjectionMatrix())}}});return l.jsx(Xe,{title:"Camera",items:a})}function sa(e,n){const a=new f.Matrix4;a.elements=e.matrix;const t=new f.Vector3,i=new f.Euler,c=new f.Vector3;e.uuid.length>0&&(t.setFromMatrixPosition(a),i.setFromRotationMatrix(a),c.setFromMatrixScale(a));const u=(r,h)=>{const d=r==="rotation"?{x:h._x,y:h._y,z:h._z}:h;n.updateObject(e.uuid,r,d);const m=n.getScene(e.uuid);if(m!==null){const p=m.getObjectByProperty("uuid",e.uuid);te(p,r,d)}};return l.jsx(Xe,{title:"Transform",items:[{title:"Position",prop:"position",type:"grid3",step:.1,value:t,onChange:u},{title:"Rotation",prop:"rotation",type:"grid3",value:i,onChange:u},{title:"Scale",prop:"scale",type:"grid3",value:c,onChange:u}]})}function Xt(e){switch(e){case"color":return"Color";case"intensity":return"Intensity";case"decay":return"Decay";case"distance":return"Distance";case"angle":return"Angle";case"penumbra":return"Penumbra";case"groundColor":return"Ground Color";case"width":return"Width";case"height":return"Height"}return e}function oa(e,n){const a=[];if(e.lightInfo!==void 0)for(const t in e.lightInfo){const i=e.lightInfo[t];i!==void 0&&(i.isColor!==void 0?a.push({title:Xt(t),prop:t,type:"color",value:i,onChange:(c,u)=>{const r=new f.Color(u);n.updateObject(e.uuid,c,r);const h=n.getScene(e.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",e.uuid);te(d,c,r)}}}):a.push({title:Xt(t),prop:t,type:typeof i,value:i,step:typeof i=="number"?.01:void 0,onChange:(c,u)=>{n.updateObject(e.uuid,c,u);const r=n.getScene(e.uuid);if(r!==null){const h=r.getObjectByProperty("uuid",e.uuid);te(h,c,u)}}}))}return l.jsx(Xe,{title:"Light",items:a})}function ca(e,n){const a=[],t=[];let i=0;e.animations.forEach(u=>{i=Math.max(i,u.duration),u.duration>0&&t.push({title:u.name,items:[{title:"Duration",type:"number",value:u.duration,disabled:!0},{title:"Blend Mode",type:"option",disabled:!0,options:[{title:"Normal",value:2500},{title:"Additive",value:2501}]}]})}),a.push({title:"Animations",items:t});const c=n.getScene(e.uuid);if(c!==null){const u=c.getObjectByProperty("uuid",e.uuid);let r=!1;if(u!==void 0){const h=u.mixer;if(r=h!==void 0,r){const d=[{title:"Time Scale",type:"range",value:h.timeScale,step:.01,min:-1,max:2,onChange:(m,p)=>{h.timeScale=p,n.updateObject(e.uuid,"mixer.timeScale",p)}}];d.push({title:"Stop All",type:"button",onChange:()=>{h.stopAllAction(),n.requestMethod(e.uuid,"stopAllAction",void 0,"mixer")}}),a.push({title:"Mixer",items:d})}}}return l.jsx(Xe,{title:"Animation",items:a})}const fn={name:"",uuid:"",type:"",visible:!1,matrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};let fe={...fn};function mn(e){const[n,a]=E.useState(-1);E.useEffect(()=>{function u(h){fe={...h.value},a(Date.now())}function r(){fe={...fn},a(Date.now())}return j.addEventListener(I.SET_SCENE,r),j.addEventListener(I.SET_OBJECT,u),()=>{j.removeEventListener(I.SET_SCENE,r),j.removeEventListener(I.SET_OBJECT,u)}},[]);const t=fe.type.toLowerCase(),i=fe.animations.length>0||fe.mixer!==void 0,c=t.search("mesh")>-1||t.search("line")>-1||t.search("points")>-1;return l.jsx(Mt,{label:"Inspector",children:l.jsx("div",{id:"Inspector",className:e.class,children:fe.uuid.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs(l.Fragment,{children:[l.jsx(Et,{type:"string",title:"Name",prop:"name",value:fe.name,disabled:!0}),l.jsx(Et,{type:"string",title:"Type",prop:"type",value:fe.type,disabled:!0}),l.jsx(Et,{type:"string",title:"UUID",prop:"uuid",value:fe.uuid,disabled:!0})]}),l.jsxs(l.Fragment,{children:[sa(fe,e.three),i?ca(fe,e.three):null,t.search("camera")>-1?ra(fe,e.three):null,t.search("light")>-1?oa(fe,e.three):null,c?aa(fe,e.three):null]})]})},n)},"Inspector")}function la(e){const[n]=E.useState([]),[a,t]=E.useState(0),i=r=>{n.push(r.value),t(Date.now())},c=r=>{const h=r.value;for(let d=0;d<n.length;d++)if(h.uuid===n[d].uuid){n.splice(d,1),t(Date.now());return}};E.useEffect(()=>(j.addEventListener(I.ADD_SCENE,i),j.addEventListener(I.REMOVE_SCENE,c),()=>{j.removeEventListener(I.ADD_SCENE,i),j.removeEventListener(I.REMOVE_SCENE,c)}),[]);const u=[];return n.forEach((r,h)=>{u.push(l.jsx(Mt,{label:`Scene: ${r.name}`,open:!0,children:l.jsx(dn,{child:r,scene:r,three:e.three})},`scene_${h}`))}),l.jsxs("div",{id:"SidePanel",children:[u,l.jsx(mn,{three:e.three})]},`SidePanel ${a}`)}function ua(e){return E.useEffect(()=>{function n(r){let h=null;return e.three.scenes.forEach(d=>{r.search(d.uuid)>-1&&(h=d)}),h}const a=r=>{const h=r.value,d=n(h),m=d?.getObjectByProperty("uuid",h);m!==void 0?e.three.setObject(m):console.log(`Hermes - can't find object: ${h}`,d)},t=(r,h,d)=>{const m=n(r),p=m?.getObjectByProperty("uuid",r);p!==void 0?te(p,h,d):console.log(`Hermes - can't set object: ${r}`,m)},i=r=>{const h=r.value,{key:d,value:m,uuid:p}=h;t(p,d,m)},c=r=>{const h=r.value,m=n(h.uuid)?.getObjectByProperty("uuid",h.uuid);if(m!==void 0){const p=b=>{const C=h.key.split(".");switch(C.length){case 1:m[C[0]]=b;break;case 2:m[C[0]][C[1]]=b;break;case 3:m[C[0]][C[1]][C[2]]=b;break;case 4:m[C[0]][C[1]][C[2]][C[3]]=b;break;case 5:m[C[0]][C[1]][C[2]][C[3]][C[4]]=b;break}m.material.needsUpdate=!0};h.value.src.length>0?sn(h.value.src).then(b=>{b.offset.set(h.value.offset[0],h.value.offset[1]),b.repeat.set(h.value.repeat[0],h.value.repeat[1]),p(b)}):p(null)}},u=r=>{const{key:h,uuid:d,value:m,subitem:p}=r.value,C=n(d)?.getObjectByProperty("uuid",d);if(C!==void 0)try{p!==void 0?kn(C,p)[h](m):C[h](m)}catch(D){console.log("Error requesting method:"),console.log(D),console.log(h),console.log(m)}};return j.addEventListener(I.GET_OBJECT,a),j.addEventListener(I.UPDATE_OBJECT,i),j.addEventListener(I.CREATE_TEXTURE,c),j.addEventListener(I.REQUEST_METHOD,u),()=>{j.removeEventListener(I.GET_OBJECT,a),j.removeEventListener(I.UPDATE_OBJECT,i),j.removeEventListener(I.CREATE_TEXTURE,c),j.removeEventListener(I.REQUEST_METHOD,u)}},[]),null}class da extends f.Line{constructor(n,a){const t=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],i=new f.BufferGeometry;i.setAttribute("position",new f.Float32BufferAttribute(t,3)),i.computeBoundingSphere();const c=new f.LineBasicMaterial({fog:!1});super(i,c),this.light=n,this.color=a,this.type="RectAreaLightHelper";const u=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],r=new f.BufferGeometry;r.setAttribute("position",new f.Float32BufferAttribute(u,3)),r.computeBoundingSphere(),this.add(new f.Mesh(r,new f.MeshBasicMaterial({side:f.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const n=this.material.color,a=Math.max(n.r,n.g,n.b);a>1&&n.multiplyScalar(1/a),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Zt={type:"change"},Dt={type:"start"},Jt={type:"end"},vt=new f.Ray,Qt=new f.Plane,ha=Math.cos(70*f.MathUtils.DEG2RAD);class fa extends f.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new f.Vector3,this.cursor=new f.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN},this.touches={ONE:f.TOUCH.ROTATE,TWO:f.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return r.phi},this.getAzimuthalAngle=function(){return r.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",at),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",at),this._domElementKeyEvents=null},this.saveState=function(){t.target0.copy(t.target),t.position0.copy(t.object.position),t.zoom0=t.object.zoom},this.reset=function(){t.target.copy(t.target0),t.object.position.copy(t.position0),t.object.zoom=t.zoom0,t.object.updateProjectionMatrix(),t.dispatchEvent(Zt),t.update(),c=i.NONE},this.update=function(){const o=new f.Vector3,x=new f.Quaternion().setFromUnitVectors(n.up,new f.Vector3(0,1,0)),P=x.clone().invert(),U=new f.Vector3,re=new f.Quaternion,be=new f.Vector3,ue=2*Math.PI;return function(mt=null){const pt=t.object.position;o.copy(pt).sub(t.target),o.applyQuaternion(x),r.setFromVector3(o),t.autoRotate&&c===i.NONE&&ge(Me(mt)),t.enableDamping?(r.theta+=h.theta*t.dampingFactor,r.phi+=h.phi*t.dampingFactor):(r.theta+=h.theta,r.phi+=h.phi);let ye=t.minAzimuthAngle,Ee=t.maxAzimuthAngle;isFinite(ye)&&isFinite(Ee)&&(ye<-Math.PI?ye+=ue:ye>Math.PI&&(ye-=ue),Ee<-Math.PI?Ee+=ue:Ee>Math.PI&&(Ee-=ue),ye<=Ee?r.theta=Math.max(ye,Math.min(Ee,r.theta)):r.theta=r.theta>(ye+Ee)/2?Math.max(ye,r.theta):Math.min(Ee,r.theta)),r.phi=Math.max(t.minPolarAngle,Math.min(t.maxPolarAngle,r.phi)),r.makeSafe(),t.enableDamping===!0?t.target.addScaledVector(m,t.dampingFactor):t.target.add(m),t.target.sub(t.cursor),t.target.clampLength(t.minTargetRadius,t.maxTargetRadius),t.target.add(t.cursor);let Ye=!1;if(t.zoomToCursor&&ce||t.object.isOrthographicCamera)r.radius=_e(r.radius);else{const Ce=r.radius;r.radius=_e(r.radius*d),Ye=Ce!=r.radius}if(o.setFromSpherical(r),o.applyQuaternion(P),pt.copy(t.target).add(o),t.object.lookAt(t.target),t.enableDamping===!0?(h.theta*=1-t.dampingFactor,h.phi*=1-t.dampingFactor,m.multiplyScalar(1-t.dampingFactor)):(h.set(0,0,0),m.set(0,0,0)),t.zoomToCursor&&ce){let Ce=null;if(t.object.isPerspectiveCamera){const Ve=o.length();Ce=_e(Ve*d);const Je=Ve-Ce;t.object.position.addScaledVector(R,Je),t.object.updateMatrixWorld(),Ye=!!Je}else if(t.object.isOrthographicCamera){const Ve=new f.Vector3(Z.x,Z.y,0);Ve.unproject(t.object);const Je=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),t.object.updateProjectionMatrix(),Ye=Je!==t.object.zoom;const gt=new f.Vector3(Z.x,Z.y,0);gt.unproject(t.object),t.object.position.sub(gt).add(Ve),t.object.updateMatrixWorld(),Ce=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),t.zoomToCursor=!1;Ce!==null&&(this.screenSpacePanning?t.target.set(0,0,-1).transformDirection(t.object.matrix).multiplyScalar(Ce).add(t.object.position):(vt.origin.copy(t.object.position),vt.direction.set(0,0,-1).transformDirection(t.object.matrix),Math.abs(t.object.up.dot(vt.direction))<ha?n.lookAt(t.target):(Qt.setFromNormalAndCoplanarPoint(t.object.up,t.target),vt.intersectPlane(Qt,t.target))))}else if(t.object.isOrthographicCamera){const Ce=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),Ce!==t.object.zoom&&(t.object.updateProjectionMatrix(),Ye=!0)}return d=1,ce=!1,Ye||U.distanceToSquared(t.object.position)>u||8*(1-re.dot(t.object.quaternion))>u||be.distanceToSquared(t.target)>u?(t.dispatchEvent(Zt),U.copy(t.object.position),re.copy(t.object.quaternion),be.copy(t.target),!0):!1}}(),this.dispose=function(){t.domElement.removeEventListener("contextmenu",Ze),t.domElement.removeEventListener("pointerdown",w),t.domElement.removeEventListener("pointercancel",J),t.domElement.removeEventListener("wheel",Q),t.domElement.removeEventListener("pointermove",H),t.domElement.removeEventListener("pointerup",J),t.domElement.getRootNode().removeEventListener("keydown",Fe,{capture:!0}),t._domElementKeyEvents!==null&&(t._domElementKeyEvents.removeEventListener("keydown",at),t._domElementKeyEvents=null)};const t=this,i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=i.NONE;const u=1e-6,r=new f.Spherical,h=new f.Spherical;let d=1;const m=new f.Vector3,p=new f.Vector2,b=new f.Vector2,C=new f.Vector2,D=new f.Vector2,q=new f.Vector2,z=new f.Vector2,G=new f.Vector2,M=new f.Vector2,K=new f.Vector2,R=new f.Vector3,Z=new f.Vector2;let ce=!1;const W=[],me={};let ie=!1;function Me(o){return o!==null?2*Math.PI/60*t.autoRotateSpeed*o:2*Math.PI/60/60*t.autoRotateSpeed}function Oe(o){const x=Math.abs(o*.01);return Math.pow(.95,t.zoomSpeed*x)}function ge(o){h.theta-=o}function B(o){h.phi-=o}const ve=function(){const o=new f.Vector3;return function(P,U){o.setFromMatrixColumn(U,0),o.multiplyScalar(-P),m.add(o)}}(),k=function(){const o=new f.Vector3;return function(P,U){t.screenSpacePanning===!0?o.setFromMatrixColumn(U,1):(o.setFromMatrixColumn(U,0),o.crossVectors(t.object.up,o)),o.multiplyScalar(P),m.add(o)}}(),xe=function(){const o=new f.Vector3;return function(P,U){const re=t.domElement;if(t.object.isPerspectiveCamera){const be=t.object.position;o.copy(be).sub(t.target);let ue=o.length();ue*=Math.tan(t.object.fov/2*Math.PI/180),ve(2*P*ue/re.clientHeight,t.object.matrix),k(2*U*ue/re.clientHeight,t.object.matrix)}else t.object.isOrthographicCamera?(ve(P*(t.object.right-t.object.left)/t.object.zoom/re.clientWidth,t.object.matrix),k(U*(t.object.top-t.object.bottom)/t.object.zoom/re.clientHeight,t.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),t.enablePan=!1)}}();function Re(o){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function De(o){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function Te(o,x){if(!t.zoomToCursor)return;ce=!0;const P=t.domElement.getBoundingClientRect(),U=o-P.left,re=x-P.top,be=P.width,ue=P.height;Z.x=U/be*2-1,Z.y=-(re/ue)*2+1,R.set(Z.x,Z.y,1).unproject(t.object).sub(t.object.position).normalize()}function _e(o){return Math.max(t.minDistance,Math.min(t.maxDistance,o))}function ke(o){p.set(o.clientX,o.clientY)}function $e(o){Te(o.clientX,o.clientX),G.set(o.clientX,o.clientY)}function Ae(o){D.set(o.clientX,o.clientY)}function We(o){b.set(o.clientX,o.clientY),C.subVectors(b,p).multiplyScalar(t.rotateSpeed);const x=t.domElement;ge(2*Math.PI*C.x/x.clientHeight),B(2*Math.PI*C.y/x.clientHeight),p.copy(b),t.update()}function nt(o){M.set(o.clientX,o.clientY),K.subVectors(M,G),K.y>0?Re(Oe(K.y)):K.y<0&&De(Oe(K.y)),G.copy(M),t.update()}function Pe(o){q.set(o.clientX,o.clientY),z.subVectors(q,D).multiplyScalar(t.panSpeed),xe(z.x,z.y),D.copy(q),t.update()}function ne(o){Te(o.clientX,o.clientY),o.deltaY<0?De(Oe(o.deltaY)):o.deltaY>0&&Re(Oe(o.deltaY)),t.update()}function he(o){let x=!1;switch(o.code){case t.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?B(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(0,t.keyPanSpeed),x=!0;break;case t.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?B(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(0,-t.keyPanSpeed),x=!0;break;case t.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?ge(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(t.keyPanSpeed,0),x=!0;break;case t.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?ge(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):xe(-t.keyPanSpeed,0),x=!0;break}x&&(o.preventDefault(),t.update())}function Ne(o){if(W.length===1)p.set(o.pageX,o.pageY);else{const x=Be(o),P=.5*(o.pageX+x.x),U=.5*(o.pageY+x.y);p.set(P,U)}}function je(o){if(W.length===1)D.set(o.pageX,o.pageY);else{const x=Be(o),P=.5*(o.pageX+x.x),U=.5*(o.pageY+x.y);D.set(P,U)}}function pe(o){const x=Be(o),P=o.pageX-x.x,U=o.pageY-x.y,re=Math.sqrt(P*P+U*U);G.set(0,re)}function v(o){t.enableZoom&&pe(o),t.enablePan&&je(o)}function y(o){t.enableZoom&&pe(o),t.enableRotate&&Ne(o)}function T(o){if(W.length==1)b.set(o.pageX,o.pageY);else{const P=Be(o),U=.5*(o.pageX+P.x),re=.5*(o.pageY+P.y);b.set(U,re)}C.subVectors(b,p).multiplyScalar(t.rotateSpeed);const x=t.domElement;ge(2*Math.PI*C.x/x.clientHeight),B(2*Math.PI*C.y/x.clientHeight),p.copy(b)}function N(o){if(W.length===1)q.set(o.pageX,o.pageY);else{const x=Be(o),P=.5*(o.pageX+x.x),U=.5*(o.pageY+x.y);q.set(P,U)}z.subVectors(q,D).multiplyScalar(t.panSpeed),xe(z.x,z.y),D.copy(q)}function se(o){const x=Be(o),P=o.pageX-x.x,U=o.pageY-x.y,re=Math.sqrt(P*P+U*U);M.set(0,re),K.set(0,Math.pow(M.y/G.y,t.zoomSpeed)),Re(K.y),G.copy(M);const be=(o.pageX+x.x)*.5,ue=(o.pageY+x.y)*.5;Te(be,ue)}function le(o){t.enableZoom&&se(o),t.enablePan&&N(o)}function _(o){t.enableZoom&&se(o),t.enableRotate&&T(o)}function w(o){t.enabled!==!1&&(W.length===0&&(t.domElement.setPointerCapture(o.pointerId),t.domElement.addEventListener("pointermove",H),t.domElement.addEventListener("pointerup",J)),!_t(o)&&(Rt(o),o.pointerType==="touch"?it(o):A(o)))}function H(o){t.enabled!==!1&&(o.pointerType==="touch"?ht(o):Y(o))}function J(o){switch(Tt(o),W.length){case 0:t.domElement.releasePointerCapture(o.pointerId),t.domElement.removeEventListener("pointermove",H),t.domElement.removeEventListener("pointerup",J),t.dispatchEvent(Jt),c=i.NONE;break;case 1:const x=W[0],P=me[x];it({pointerId:x,pageX:P.x,pageY:P.y});break}}function A(o){let x;switch(o.button){case 0:x=t.mouseButtons.LEFT;break;case 1:x=t.mouseButtons.MIDDLE;break;case 2:x=t.mouseButtons.RIGHT;break;default:x=-1}switch(x){case f.MOUSE.DOLLY:if(t.enableZoom===!1)return;$e(o),c=i.DOLLY;break;case f.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(t.enablePan===!1)return;Ae(o),c=i.PAN}else{if(t.enableRotate===!1)return;ke(o),c=i.ROTATE}break;case f.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(t.enableRotate===!1)return;ke(o),c=i.ROTATE}else{if(t.enablePan===!1)return;Ae(o),c=i.PAN}break;default:c=i.NONE}c!==i.NONE&&t.dispatchEvent(Dt)}function Y(o){switch(c){case i.ROTATE:if(t.enableRotate===!1)return;We(o);break;case i.DOLLY:if(t.enableZoom===!1)return;nt(o);break;case i.PAN:if(t.enablePan===!1)return;Pe(o);break}}function Q(o){t.enabled===!1||t.enableZoom===!1||c!==i.NONE||(o.preventDefault(),t.dispatchEvent(Dt),ne(Le(o)),t.dispatchEvent(Jt))}function Le(o){const x=o.deltaMode,P={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(x){case 1:P.deltaY*=16;break;case 2:P.deltaY*=100;break}return o.ctrlKey&&!ie&&(P.deltaY*=10),P}function Fe(o){o.key==="Control"&&(ie=!0,t.domElement.getRootNode().addEventListener("keyup",Ue,{passive:!0,capture:!0}))}function Ue(o){o.key==="Control"&&(ie=!1,t.domElement.getRootNode().removeEventListener("keyup",Ue,{passive:!0,capture:!0}))}function at(o){t.enabled===!1||t.enablePan===!1||he(o)}function it(o){switch(ft(o),W.length){case 1:switch(t.touches.ONE){case f.TOUCH.ROTATE:if(t.enableRotate===!1)return;Ne(o),c=i.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(t.enablePan===!1)return;je(o),c=i.TOUCH_PAN;break;default:c=i.NONE}break;case 2:switch(t.touches.TWO){case f.TOUCH.DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;v(o),c=i.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;y(o),c=i.TOUCH_DOLLY_ROTATE;break;default:c=i.NONE}break;default:c=i.NONE}c!==i.NONE&&t.dispatchEvent(Dt)}function ht(o){switch(ft(o),c){case i.TOUCH_ROTATE:if(t.enableRotate===!1)return;T(o),t.update();break;case i.TOUCH_PAN:if(t.enablePan===!1)return;N(o),t.update();break;case i.TOUCH_DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;le(o),t.update();break;case i.TOUCH_DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;_(o),t.update();break;default:c=i.NONE}}function Ze(o){t.enabled!==!1&&o.preventDefault()}function Rt(o){W.push(o.pointerId)}function Tt(o){delete me[o.pointerId];for(let x=0;x<W.length;x++)if(W[x]==o.pointerId){W.splice(x,1);return}}function _t(o){for(let x=0;x<W.length;x++)if(W[x]==o.pointerId)return!0;return!1}function ft(o){let x=me[o.pointerId];x===void 0&&(x=new f.Vector2,me[o.pointerId]=x),x.set(o.pageX,o.pageY)}function Be(o){const x=o.pointerId===W[0]?W[1]:W[0];return me[x]}t.domElement.addEventListener("contextmenu",Ze),t.domElement.addEventListener("pointerdown",w),t.domElement.addEventListener("pointercancel",J),t.domElement.addEventListener("wheel",Q,{passive:!1}),t.domElement.getRootNode().addEventListener("keydown",Fe,{passive:!0,capture:!0}),this.update()}}function tt(e,n,a,t,i){return t+(e-n)*(i-t)/(a-n)}const St=e=>{const[n,a]=E.useState(e.options[e.index]),t=()=>{e.onToggle(!e.open)},i=c=>{c!==n&&(e.onSelect(c),a(c)),e.onToggle(!1)};return l.jsxs("div",{className:`dropdown ${e.up===!0?"up":""}`,children:[l.jsx("div",{className:"dropdown-toggle",onClick:t,children:n}),e.open&&l.jsx("ul",{className:"dropdown-menu",children:e.options.map(c=>l.jsx("li",{onClick:()=>i(c),children:c},c))})]})},qe=E.forwardRef(function(n,a){const[t,i]=E.useState(!1),c=n.options.indexOf(n.camera.name);return l.jsxs("div",{className:"CameraWindow",children:[l.jsx("div",{ref:a,className:"clickable",onClick:()=>{t&&i(!1)}}),l.jsx(St,{index:c,open:t,options:n.options,onSelect:n.onSelect,onToggle:u=>{i(u)},up:!0})]})});class ma extends f.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:f.GLSL3,side:f.DoubleSide,transparent:!0,uniforms:{uScale:{value:n?.scale!==void 0?n?.scale:.1},uDivisions:{value:n?.divisions!==void 0?n?.divisions:10},uColor:{value:n?.color!==void 0?n?.color:new f.Color(16777215)},uDistance:{value:n?.distance!==void 0?n?.distance:1e4},uSubgridOpacity:{value:n?.subgridOpacity!==void 0?n?.subgridOpacity:.15},uGridOpacity:{value:n?.gridOpacity!==void 0?n?.gridOpacity:.25}},vertexShader:`out vec3 worldPosition;
|
29
|
+
C11,8.22,10.74,8,10.43,8z`})});function dn(e){return l.jsx(rn.Reorder.Item,{value:e.title,children:l.jsxs("div",{children:[Vn,l.jsx("span",{children:e.title}),l.jsx("button",{className:"closeIcon",onClick:()=>{e.onDelete(e.index)},children:Bn})]})},e.title)}function hn(e){const[n,a]=S.useState(!1),[t,r]=S.useState(e.options),c=d=>{e.onDragComplete(d),r(d)},u=d=>{const m=[...t];m.splice(d,1),c(m)},s=[];t.forEach((d,m)=>{s.push(l.jsx(dn,{index:m,title:d,onDelete:u},d))});let h="dropdown draggable";return e.subdropdown&&(h+=" subdropdown"),l.jsxs("div",{className:h,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[l.jsx(Bt,{title:e.title}),l.jsx(rn.Reorder.Group,{axis:"y",values:t,onReorder:c,style:{visibility:n?"visible":"hidden"},children:s})]})}function fn(e){const[n,a]=S.useState(!1),t=[];e.options.map((c,u)=>{e.onSelect!==void 0&&(c.onSelect=e.onSelect),t.push(l.jsx(mn,{option:c},u))});let r="dropdown";return e.subdropdown&&(r+=" subdropdown"),l.jsxs("div",{className:r,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[l.jsx(Bt,{title:e.title}),l.jsx("ul",{style:{visibility:n?"visible":"hidden"},children:t})]})}function mn(e){const{option:n}=e,[a,t]=S.useState("");let r;switch(n.type){case"draggable":r=l.jsx(hn,{title:n.title,options:n.value,onDragComplete:c=>{n.onDragComplete!==void 0&&n.onDragComplete(c)},subdropdown:!0});break;case"dropdown":r=l.jsx(fn,{title:n.title,options:n.value,onSelect:n.onSelect,subdropdown:!0});break;case"option":r=l.jsx("button",{onClick:()=>{n.onSelect!==void 0&&n.onSelect(n.value),n.selectable&&(a!==n.title?t(n.title):t(""))},children:n.title});break}return l.jsx("li",{className:a===n.title?"selected":"",children:r},sn())}function $n(e,n,a){function t(c){switch(n.forEach(u=>{u.callback(e,u.remote,c)}),c.event){case"custom":I.dispatchEvent({type:j.CUSTOM,value:c.data});break}}function r(c){switch(a.forEach(u=>{u.callback(e,u.remote,c)}),c.event){case"custom":I.dispatchEvent({type:j.CUSTOM,value:c.data});break}}e.listen=c=>{c.target==="editor"?r(c):t(c)}}function Ot(e){const[n,a]=S.useState(e.open!==void 0?e.open:!0),t=!n||e.children===void 0;return l.jsxs("div",{className:`accordion ${t?"hide":""}`,children:[l.jsxs("button",{className:"toggle",onClick:()=>{const r=!n;e.onToggle!==void 0&&e.onToggle(r),a(r)},children:[l.jsx("p",{className:`status ${n?"open":""}`,children:"Toggle"}),l.jsx("p",{className:"label",children:dt(e.label)})]}),e.button,l.jsx("div",{className:n?"open":"",children:l.jsx("div",{children:e.children})})]})}function Vt(e){const n=S.useRef(null),[a,t]=S.useState(!1),r=e.child!==void 0&&e.child.children.length>0,c=[];return e.child!==void 0&&e.child.children.length>0&&e.child.children.map((u,s)=>{c.push(l.jsx(Vt,{child:u,three:e.three},s))}),S.useEffect(()=>{const u=e.child.uuid,s=e.three.getScene(u);if(s!==null){const h=s.getObjectByProperty("uuid",u);h!==void 0&&(n.current.style.opacity=h.visible?"1":"0.25")}},[]),l.jsx(l.Fragment,{children:e.child!==void 0&&l.jsxs("div",{className:"childObject",children:[l.jsxs("div",{className:"child",children:[r?l.jsx("button",{className:"status",style:{backgroundPositionX:a?"-14px":"2px"},onClick:()=>{t(!a)}}):null,l.jsx("button",{className:"name",style:{left:r?"20px":"5px"},onClick:()=>{e.child!==void 0&&(e.three.getObject(e.child.uuid),a||t(!0))},children:e.child.name.length>0?`${e.child.name} (${e.child.type})`:`${e.child.type}::${e.child.uuid}`}),l.jsx("button",{className:"visibility",ref:n,onClick:()=>{if(e.child){const u=e.three.getScene(e.child.uuid);if(u!==null){const s=u.getObjectByProperty("uuid",e.child.uuid);if(s!==void 0){const h="visible",d=!s.visible;n.current.style.opacity=d?"1":"0.25",e.three.updateObject(e.child.uuid,h,d),ne(s,h,d)}else console.log(`Hermes - Couldn't find object: ${e.child.uuid}`,u)}else console.log(`Hermes - Couldn't find object in scene: ${e.child.uuid}, ${e.child.name}`)}}}),l.jsx("div",{className:`icon ${Dn(e.child)}`})]}),l.jsx("div",{className:a?"open":"",children:l.jsx("div",{className:"container",children:c})})]},Math.random())})}function pn(e){const n=[];return e.child?.children.map((a,t)=>{n.push(l.jsx(Vt,{child:a,scene:e.scene,three:e.three},t))}),l.jsx("div",{className:`scene ${e.class!==void 0?e.class:""}`,children:n})}function zn(e){const[n,a]=S.useState(e.defaultValue);return S.useEffect(()=>{let t=!1,r=-1,c=0,u=e.defaultValue;const s=v=>{t=!0,c=Number(e.input.current?.value),r=v.clientX,document.addEventListener("mouseup",d,!1),document.addEventListener("mousemove",h,!1),document.addEventListener("contextmenu",d,!1)},h=v=>{if(!t)return;const E=e.step!==void 0?e.step:1,R=(v.clientX-r)*E;u=Number((c+R).toFixed(4)),e.min!==void 0&&(u=Math.max(u,e.min)),e.max!==void 0&&(u=Math.min(u,e.max)),e.onChange!==void 0&&e.onChange(u),a(u)},d=()=>{t=!1,document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)},m=v=>{const E=Number(v.target.value);a(E)},g=v=>{const E=Number(v.target.value);e.onChange!==void 0&&e.onChange(E),a(E)};return e.input.current?.addEventListener("input",m),e.label.current?.addEventListener("mousedown",s,!1),e.sliderRef!==void 0&&e.sliderRef.current?.addEventListener("input",g),()=>{e.input.current?.removeEventListener("input",m),e.label.current?.removeEventListener("mousedown",s),e.sliderRef!==void 0&&e.sliderRef.current?.removeEventListener("input",g),document.removeEventListener("mouseup",d),document.removeEventListener("mousemove",h),document.removeEventListener("contextmenu",d)}},[]),n}function Xe(e){const n=S.useRef(null),a=S.useRef(null),t=zn({label:e.labelRef,input:n,sliderRef:a,defaultValue:e.value,min:e.min,max:e.max,step:e.step,onChange:r=>{e.onChange!==void 0&&e.onChange(e.prop,r)}});return l.jsxs(l.Fragment,{children:[e.type==="number"&&l.jsx("input",{alt:e.alt,className:e.className,ref:n,type:"number",value:t,min:e.min,max:e.max,step:e.step,disabled:e.disabled,onChange:r=>{const c=Number(r.target.value);e.onChange!==void 0&&e.onChange(e.prop,c)}}),e.type==="range"&&l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"text",value:t.toString(),disabled:e.disabled,ref:n,className:"min",onChange:r=>{const c=Number(r.target.value);e.onChange!==void 0&&e.onChange(e.prop,c)}}),l.jsx("input",{disabled:e.disabled,type:"range",value:t,min:e.min,max:e.max,step:e.step,ref:a,onChange:wt})]})]})}function Gn(e){const n=S.useRef(null),a=S.useRef(null),t=S.useRef(null),r=S.useRef(null),c=S.useRef(null),u=S.useRef(null),[s,h]=S.useState(e.value),[d,m]=S.useState({min:Math.min(e.min,Math.min(e.value.x,e.value.y)),max:Math.max(e.max,Math.max(e.value.x,e.value.y))}),[g,v]=S.useState(!1);function E(){g||(window.addEventListener("mousemove",k),window.addEventListener("mouseup",R),window.addEventListener("mouseup",R),v(!0))}function R(){window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",R),v(!1)}function k(N){const J=c.current.getBoundingClientRect(),fe=We(0,99,N.clientX-J.left)/99,K=We(0,99,N.clientY-J.top)/99,re=Nt(jt(d.min,d.max,fe),3),ye=Nt(jt(d.min,d.max,K),3);e.onChange({target:{value:{x:re,y:ye}}}),h({x:re,y:ye})}function D(N){let J=s.x,fe=s.y;N.target===n.current?J=Number(N.target.value):fe=Number(N.target.value),h({x:J,y:fe})}function G(){const N=Number(t.current.value);m({min:N,max:d.max}),(s.x<N||s.y<N)&&h({x:We(N,d.max,s.x),y:We(N,d.max,s.y)})}function M(){const N=Number(r.current.value);m({min:d.min,max:N}),(s.x>N||s.y>N)&&h({x:We(d.min,N,s.x),y:We(d.min,N,s.y)})}S.useEffect(()=>{const N=It(d.min,d.max,s.x),J=It(d.min,d.max,s.y);u.current.style.left=`${N*100}%`,u.current.style.top=`${J*100}%`},[d,s]);const z=e.step!==void 0?e.step:.01;return l.jsxs("div",{className:"vector2",children:[l.jsxs("div",{className:"fields",children:[l.jsxs("div",{children:[l.jsx("label",{children:"X:"}),l.jsx("input",{ref:n,type:"number",value:s.x,min:d.min,max:d.max,step:z,onChange:D})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Y:"}),l.jsx("input",{ref:a,type:"number",value:s.y,min:d.min,max:d.max,step:z,onChange:D})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Min:"}),l.jsx("input",{ref:t,type:"number",value:d.min,step:z,onChange:G})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Max:"}),l.jsx("input",{ref:r,type:"number",value:d.max,step:z,onChange:M})]})]}),l.jsxs("div",{className:"input",ref:c,onMouseDown:E,onMouseUp:R,children:[l.jsx("div",{className:"x"}),l.jsx("div",{className:"y"}),l.jsx("div",{className:"pt",ref:u})]})]})}function Yt(e){const n=e.value.isVector3!==void 0,a=e.value.isEuler!==void 0,t=e.value.elements!==void 0,r=e.step!==void 0?e.step:.01,c=[];if(n){const u=S.useMemo(()=>e.value,[]),s=(d,m)=>{u[d]=m,e.onChange({target:{value:u}})};["x","y","z"].forEach(d=>{const m=S.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:m,children:d.toUpperCase()}),l.jsx(Xe,{value:u[d],type:"number",prop:d,step:r,labelRef:m,onChange:s})]},d))})}else if(a){const u=S.useMemo(()=>e.value,[]),s=(d,m)=>{u[d]=m,e.onChange({target:{value:u}})};["_x","_y","_z"].forEach(d=>{const m=S.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:m,children:d.substring(1).toUpperCase()}),l.jsx(Xe,{value:u[d],type:"number",prop:d,step:r,labelRef:m,onChange:s})]},d))})}else if(t){const u=S.useMemo(()=>e.value,[]),s=(h,d)=>{const m=Number(h);u.elements[m]=d,e.onChange({target:{value:u}})};for(let h=0;h<9;h++){const d=S.useRef(null);c.push(l.jsxs("div",{children:[l.jsx("label",{ref:d,children:h+1}),l.jsx(Xe,{value:u.elements[h],type:"number",prop:h.toString(),step:r,labelRef:d,onChange:s})]},h.toString()))}}return l.jsx("div",{className:"grid3",children:c},Math.random().toString())}function Hn(e){const n=e.value.x!==void 0,a=e.step!==void 0?e.step:.01,t=[];if(n){const r=S.useMemo(()=>e.value,[]),c=(s,h)=>{r[s]=h,e.onChange({target:{value:r}})};["x","y","z","w"].forEach(s=>{const h=S.useRef(null);t.push(l.jsxs("div",{children:[l.jsx("label",{ref:h,children:s.toUpperCase()}),l.jsx(Xe,{value:r.x,type:"number",prop:s,step:a,labelRef:h,onChange:c})]},s))})}else{const r=S.useMemo(()=>e.value,[]),c=(u,s)=>{const h=Number(u);r.elements[h]=s,e.onChange({target:{value:r}})};for(let u=0;u<16;u++){const s=S.useRef(null);t.push(l.jsxs("div",{children:[l.jsx("label",{ref:s,children:u+1}),l.jsx(Xe,{value:r.elements[u],type:"number",prop:u.toString(),step:a,labelRef:s,onChange:c})]},u.toString()))}}return l.jsx("div",{className:"grid4",children:t})}function Wn(e){return"items"in e}function Ze(e){const n=[];return e.items.forEach(a=>{Wn(a)?n.push(l.jsx(Ze,{title:dt(a.title),items:a.items},Math.random())):n.push(l.jsx(Et,{title:a.title,prop:a.prop,value:a.value,type:a.type,min:a.min,max:a.max,step:a.step,disabled:a.disabled,options:a.options,onChange:(t,r)=>{a.onChange!==void 0&&a.onChange(t,r)},onKeyDown:t=>{a.onKeyDown!==void 0&&a.onKeyDown(t)}},Math.random()))}),l.jsx(Ot,{label:e.title,open:e.expanded===!0,children:n})}function Yn(e){return!(e==="alphaHash"||e==="alphaToCoverage"||e==="attenuationDistance"||e==="blendAlpha"||e==="blendColor"||e==="blendDstAlpha"||e==="colorWrite"||e==="combine"||e==="defaultAttributeValues"||e==="depthFunc"||e==="forceSinglePass"||e==="glslVersion"||e==="linecap"||e==="linejoin"||e==="linewidth"||e==="normalMapType"||e==="precision"||e==="premultipliedAlpha"||e==="shadowSide"||e==="toneMapped"||e==="uniformsGroups"||e==="uniformsNeedUpdate"||e==="userData"||e==="vertexColors"||e==="version"||e==="wireframeLinecap"||e==="wireframeLinejoin"||e==="wireframeLinewidth"||e.slice(0,4)==="clip"||e.slice(0,7)==="polygon"||e.slice(0,7)==="stencil"||e.slice(0,2)==="is")}function qn(e){switch(e){case"Alpha Map":return"alphaMap";case"Anisotropy Map":return"anisotropyMap";case"AO Map":return"aoMap";case"Bump Map":return"bumpMap";case"Clearcoat Map":return"clearcoatMap";case"Clearcoat Normal Map":return"clearcoatNormalMap";case"Clearcoat Roughness Map":return"clearcoatRoughnessMap";case"Displacement Map":return"displacementMap";case"Emissive Map":return"emissiveMap";case"Iridescence Map":return"iridescenceMap";case"Iridescence Thickness Map":return"iridescenceThicknessMap";case"Map":return"map";case"Matcap":return"matcap";case"Normal Map":return"normalMap";case"Roughness Map":return"roughnessMap";case"Sheen Color Map":return"sheenColorMap";case"Sheen Roughness Map":return"sheenRoughnessMap";case"Specular Color Map":return"specularColorMap";case"Specular Map Intensity":return"specularIntensityMap";case"Thickness Map":return"thicknessMap";case"Transmission Map":return"transmissionMap"}return e}function Rt(e){switch(e){case"alphaMap":return"Alpha Map";case"anisotropyMap":return"Anisotropy Map";case"anisotropyRotation":return"Anisotropy Rotation";case"aoMap":return"AO Map";case"aoMapIntensity":return"AO Map Intensity";case"attenuationColor":return"Attenuation Color";case"blendAlpha":return"Blend Alpha";case"blendColor":return"Blend Color";case"blendDst":return"Blend Dst";case"blendDstAlpha":return"Blend Dst Alha";case"blendEquation":return"Blend Equation";case"blendEquationAlpha":return"Blend Equation Alpha";case"blending":return"Blending";case"blendSrc":return"Blend Src";case"blendSrcAlpha":return"Blend Src Alpha";case"bumpMap":return"Bump Map";case"bumpScale":return"Bump Scale";case"clearcoatMap":return"Clearcoat Map";case"clearcoatNormalMap":return"Clearcoat Normal Map";case"clearcoatNormalScale":return"Clearcoat Normal Scale";case"clearcoatRoughness":return"Clearcoat Roughness";case"clearcoatRoughnessMap":return"Clearcoat Roughness Map";case"color":return"Color";case"defines":return"Defines";case"depthTest":return"Depth Test";case"depthWrite":return"Depth Write";case"displacementBias":return"Displacement Bias";case"displacementMap":return"Displacement Map";case"displacementScale":return"Displacement Scale";case"dithering":return"Dithering";case"emissive":return"Emissive";case"emissiveMap":return"Emissive Map";case"emissiveIntensity":return"Emissive Intensity";case"envMap":return"Environment Map";case"envMapIntensity":return"Environment Map Intensity";case"extensions":return"Extensions";case"flatShading":return"Flat Shading";case"fragmentShader":return"Fragment Shader";case"fog":return"Fog";case"gradientMap":return"Gradient Map";case"ior":return"IOR";case"iridescenceIOR":return"Iridescence IOR";case"iridescenceMap":return"Iridescence Map";case"iridescenceThicknessMap":return"Iridescence Thickness Map";case"iridescenceThicknessRange":return"Iridescence Thickness Range";case"lights":return"Lights";case"lightMap":return"Light Map";case"lightMapIntensity":return"Light Map Intensity";case"map":return"Map";case"matcap":return"Matcap";case"metalness":return"Metalness";case"metalnessMap":return"Metalness Map";case"name":return"Name";case"normalMap":return"Normal Map";case"normalScale":return"Normal Scale";case"opacity":return"Opacity";case"reflectivity":return"Reflectivity";case"refractionRatio":return"Refraction Ratio";case"roughness":return"Roughness";case"roughnessMap":return"Roughness Map";case"sheenColor":return"Sheen Color";case"sheenColorMap":return"Sheen Color Map";case"sheenRoughness":return"Sheen Roughness";case"sheenRoughnessMap":return"Sheen Roughness Map";case"shininess":return"Shininess";case"side":return"Side";case"size":return"Size";case"sizeAttenuation":return"Size Attenuation";case"specular":return"Specular";case"specularColor":return"Specular Color";case"specularColorMap":return"Specular Color Map";case"specularIntensity":return"Specular Intensity";case"specularIntensityMap":return"Specular Map Intensity";case"thickness":return"Thickness";case"thicknessMap":return"Thickness Map";case"transmission":return"Transmission";case"transmissionMap":return"Transmission Map";case"transparent":return"Transparent";case"type":return"Type";case"uuid":return"UUID";case"uniforms":return"Uniforms";case"vertexShader":return"Vertex Shader";case"visible":return"Visible";case"wireframe":return"Wireframe"}return e}function gn(e){const n=e.toLowerCase();return n.search("intensity")>-1||n==="anisotropyrotation"||n==="blendalpha"||n==="bumpscale"||n==="clearcoatroughness"||n==="displacementbias"||n==="displacementscale"||n==="metalness"||n==="opacity"||n==="reflectivity"||n==="refractionratio"||n==="roughness"||n==="sheenroughness"||n==="thickness"}function Kn(){const e=document.createElement("input");return e.type="file",new Promise((n,a)=>{e.addEventListener("change",function(){if(e.files===null)a();else{const t=e.files[0],r=new FileReader;r.onload=function(c){n(c.target.result)},r.readAsDataURL(t)}}),e.click()})}const Xn=[{title:"Front",value:f.FrontSide},{title:"Back",value:f.BackSide},{title:"Double",value:f.DoubleSide}],Zn=[{title:"No Blending",value:f.NoBlending},{title:"Normal",value:f.NormalBlending},{title:"Additive",value:f.AdditiveBlending},{title:"Subtractive",value:f.SubtractiveBlending},{title:"Multiply",value:f.MultiplyBlending},{title:"Custom",value:f.CustomBlending}],Jn=[{title:"Add",value:f.AddEquation},{title:"Subtract",value:f.SubtractEquation},{title:"Reverse Subtract",value:f.ReverseSubtractEquation},{title:"Min",value:f.MinEquation},{title:"Max",value:f.MaxEquation}],Qn=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Src Alpha Saturate",valye:f.SrcAlphaSaturateFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}],ea=[{title:"Zero",valye:f.ZeroFactor},{title:"One",valye:f.OneFactor},{title:"Src Color",valye:f.SrcColorFactor},{title:"One Minus Src Color",valye:f.OneMinusSrcColorFactor},{title:"Src Alpha",valye:f.SrcAlphaFactor},{title:"One Minus Src Alpha",valye:f.OneMinusSrcAlphaFactor},{title:"Dst Alpha",valye:f.DstAlphaFactor},{title:"One Minus Dst Alpha",valye:f.OneMinusDstAlphaFactor},{title:"Dst Color",valye:f.DstColorFactor},{title:"One Minus Dst Color",valye:f.OneMinusDstColorFactor},{title:"Constant Color",valye:f.ConstantColorFactor},{title:"One Minus Constant Color",valye:f.OneMinusConstantColorFactor},{title:"Constant Alpha",valye:f.ConstantAlphaFactor},{title:"One Minus Constant Alpha",valye:f.OneMinusConstantAlphaFactor}];function lt(e,n){e.needsUpdate=!0,e.type="option",e.options=n}function ta(e,n,a,t){return{type:"boolean",title:Rt(e),prop:e,value:n,needsUpdate:!0,onChange:(r,c)=>{t.updateObject(a.uuid,`material.${e}`,c),t.updateObject(a.uuid,"material.needsUpdate",!0);const u=t.getScene(a.uuid);if(u!==null){const s=u.getObjectByProperty("uuid",a.uuid);ne(s,`material.${e}`,c)}}}}function na(e,n,a,t){const r={type:"number",title:Rt(e),prop:e,value:n,min:void 0,max:void 0,step:.01,needsUpdate:!0,onChange:(c,u)=>{t.updateObject(a.uuid,`material.${e}`,u),t.updateObject(a.uuid,"material.needsUpdate",!0);const s=t.getScene(a.uuid);if(s!==null){const h=s.getObjectByProperty("uuid",a.uuid);ne(h,`material.${e}`,u)}}};switch(e){case"blending":lt(r,Zn);break;case"blendDst":lt(r,ea);break;case"blendEquation":lt(r,Jn);break;case"blendSrc":lt(r,Qn);break;case"side":lt(r,Xn);break}return gn(e)&&(r.value=Number(n),r.type="range",r.min=Math.min(0,r.value),r.max=Math.max(1,r.value),r.step=.01),r}function aa(e,n,a,t){const r={type:"string",title:Rt(e),prop:e,value:n,needsUpdate:!0,onChange:(u,s)=>{t.updateObject(a.uuid,`material.${e}`,s),t.updateObject(a.uuid,"material.needsUpdate",!0);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);ne(d,`material.${e}`,s)}},onKeyDown:u=>{}};return(e==="vertexShader"||e==="fragmentShader")&&(r.disabled=!1,r.latest=r.value,r.onChange=(u,s)=>{r.latest=s,t.updateObject(a.uuid,`material.${e}`,s);const h=t.getScene(a.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",a.uuid);ne(d,`material.${e}`,s)}},r.onKeyDown=u=>{if(u.key==="Enter"&&(u.altKey||u.metaKey)){t.updateObject(a.uuid,"material.needsUpdate",!0);const s=t.getScene(a.uuid);if(s!==null){const h=s.getObjectByProperty("uuid",a.uuid);ne(h,"material.needsUpdate",!0)}}}),r}function ra(e){return e.x!==void 0&&e.y!==void 0&&e.z===void 0}function ia(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w===void 0}function sa(e){return e.x!==void 0&&e.y!==void 0&&e.z!==void 0&&e.w!==void 0}function Ut(e){e.sort((n,a)=>n.title<a.title?-1:n.title>a.title?1:0)}function ut(e,n,a,t,r="",c=!1){const u=Rt(e).split(".")[0].replaceAll("[","").replaceAll("]",""),s=r.length>0?`${r}.${e}`:e,h=typeof n;if(h==="boolean"||h==="string")return{title:u,prop:s,type:h,value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${s}`,m);const g=t.getScene(a.uuid);if(g!==null){const v=g.getObjectByProperty("uuid",a.uuid);ne(v,`material.${s}`,m)}}};if(h==="number"){const d={title:u,prop:s,type:"number",value:n,step:.01,disabled:c,onChange:(m,g)=>{t.updateObject(a.uuid,`material.${s}`,g);const v=t.getScene(a.uuid);if(v!==null){const E=v.getObjectByProperty("uuid",a.uuid);ne(E,`material.${s}`,g)}}};return gn(u)&&(d.type="range",d.min=0,d.max=1),d}else{if(n.isColor)return{title:u,prop:s,type:"color",value:n,disabled:c,onChange:(d,m)=>{const g=new f.Color(m);t.updateObject(a.uuid,`material.${s}`,g);const v=t.getScene(a.uuid);if(v!==null){const E=v.getObjectByProperty("uuid",a.uuid);ne(E,`material.${s}`,g)}}};if(Array.isArray(n)){const d=[];for(const m in n){const g=n[m],v=`[${m.toString()}]`;if(g.value!==void 0){const E=ut(`${v}.value`,g.value,a,t,s,c);E!==void 0&&d.push(E)}else{const E=ut(v,g,a,t,s,c);E!==void 0&&d.push(E)}}if(d.length>0)return Ut(d),{title:u,items:d}}else{if(ra(n))return{title:u,prop:s,type:"vector2",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${s}`,m);const g=t.getScene(a.uuid);if(g!==null){const v=g.getObjectByProperty("uuid",a.uuid);ne(v,`material.${s}`,m)}}};if(ia(n))return{title:u,prop:s,type:"grid3",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${s}`,m);const g=t.getScene(a.uuid);if(g!==null){const v=g.getObjectByProperty("uuid",a.uuid);ne(v,`material.${s}`,m)}}};if(sa(n))return{title:u,prop:s,type:"grid4",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${s}`,m);const g=t.getScene(a.uuid);if(g!==null){const v=g.getObjectByProperty("uuid",a.uuid);ne(v,`material.${s}`,m)}}};if(n.isEuler)return{title:u,prop:s,type:"euler",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${s}`,m);const g=t.getScene(a.uuid);if(g!==null){const v=g.getObjectByProperty("uuid",a.uuid);ne(v,`material.${s}`,m)}}};if(n.src!==void 0)return{title:u,type:"image",value:n,disabled:c,onChange:(d,m)=>{const g=qn(e),v=r.length>0?`${r}.${g}`:g;t.createTexture(a.uuid,`material.${v}`,m);const E=t.getScene(a.uuid);if(E!==null){const R=E.getObjectByProperty("uuid",a.uuid);if(R!==void 0){const k=D=>{const G=R.material,M=v.split(".");switch(M.length){case 1:G[M[0]]=D;break;case 2:G[M[0]][M[1]]=D;break;case 3:G[M[0]][M[1]][M[2]]=D;break;case 4:G[M[0]][M[1]][M[2]][M[3]]=D;break;case 5:G[M[0]][M[1]][M[2]][M[3]][M[4]]=D;break}G.needsUpdate=!0};m.src.length>0?un(m.src).then(D=>{D.offset.set(m.offset[0],m.offset[1]),D.repeat.set(m.repeat[0],m.repeat[1]),k(D)}):k(null)}}}};if(n.elements!==void 0)return{title:u,prop:s,type:n.elements.length>9?"grid4":"grid3",value:n,disabled:c,onChange:(d,m)=>{t.updateObject(a.uuid,`material.${s}`,m);const g=t.getScene(a.uuid);if(g!==null){const v=g.getObjectByProperty("uuid",a.uuid);ne(v,`material.${s}`,m)}}};{const d=[],m=e==="defines"||e==="extensions";try{for(const g in n){const v=n[g];if(v!==void 0)if(v.value!==void 0){const E=ut(`${g}.value`,v.value,a,t,s,m);E!==void 0&&d.push(E)}else{const E=ut(g,v,a,t,s,m);E!==void 0&&d.push(E)}}}catch{console.log("Issue cycling through material object:",e,n)}if(d.length>0)return Ut(d),{title:u,items:d}}}}}function qt(e,n,a){const t=[];for(const r in e){if(!Yn(r))continue;const c=typeof e[r],u=e[r];if(c==="boolean")t.push(ta(r,u,n,a));else if(c==="number")t.push(na(r,u,n,a));else if(c==="string")t.push(aa(r,u,n,a));else if(c==="object"){const s=ut(r,u,n,a);s!==void 0&&t.push(s)}else u!==void 0&&console.log("other:",r,c,u)}return Ut(t),t.push({title:"Update Material",type:"button",onChange:()=>{a.updateObject(n.uuid,"material.needsUpdate",!0);const r=a.getScene(n.uuid);if(r!==null){const c=r.getObjectByProperty("uuid",n.uuid);ne(c,"material.needsUpdate",!0)}}}),t}function oa(e,n){const a=e.material;if(Array.isArray(a)){const t=[],r=a.length;for(let c=0;c<r;c++)t.push(l.jsx(Ze,{title:`Material ${c}`,items:qt(a[c],e,n)},`Material ${c}`));return l.jsx(l.Fragment,{children:t})}else return l.jsx(Ze,{title:"Material",items:qt(a,e,n)})}const Kt="data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";function ca(e){const n=e.step!==void 0?e.step:.01,a=S.useRef(null),t=S.useRef(null),r=S.useRef(null),c=S.useRef(null),u=S.useRef(null),[s]=S.useState(e.value),[h,d]=S.useState(e.value.offset[0]),[m,g]=S.useState(e.value.offset[1]),[v,E]=S.useState(e.value.repeat[0]),[R,k]=S.useState(e.value.repeat[1]);function D(M,z,N,J,fe){if(e.onChange!==void 0){const K=e.prop!==void 0?e.prop:e.title;e.onChange(K,{src:M,offset:[z,N],repeat:[J,fe]})}}function G(M){const z=a.current.src,N=M.target.value;switch(M.target){case t.current:d(N),D(z,N,m,v,R);break;case r.current:g(N),D(z,h,N,v,R);break;case c.current:E(N),D(z,h,m,N,R);break;case u.current:k(N),D(z,h,m,v,N);break}}return l.jsxs("div",{className:"imageField",children:[l.jsx("img",{alt:e.title,ref:a,onClick:()=>{Kn().then(M=>{a.current.src=M,D(M,h,m,v,R)})},src:s.src.length>0?s.src:Kt}),l.jsxs("div",{className:"fields",children:[l.jsxs("div",{children:[l.jsx("label",{children:"Offset:"}),l.jsx("input",{ref:t,type:"number",value:h,step:n,onChange:G}),l.jsx("input",{ref:r,type:"number",value:m,step:n,onChange:G})]}),l.jsxs("div",{children:[l.jsx("label",{children:"Repeat:"}),l.jsx("input",{ref:c,type:"number",value:v,step:n,onChange:G}),l.jsx("input",{ref:u,type:"number",value:R,step:n,onChange:G})]}),l.jsx("button",{onClick:()=>{D("",h,m,v,R),a.current.src=Kt},children:"Clear"})]})]})}function Et(e){let n=e.value;n!==void 0&&n.isColor!==void 0&&(n=cn(e.value));const[a,t]=S.useState(n),r=S.useRef(null),c=d=>{let m=d.target.value;e.type==="boolean"?m=d.target.checked:e.type==="option"&&(m=e.options[m].value),t(m),e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,m)},u={};e.disabled&&(u.opacity=.8);const s=e.type==="string"&&(a.length>100||a.search(`
|
30
|
+
`)>-1),h=s||e.type==="image"||e.type==="vector2";return l.jsxs("div",{className:`field ${h?"block":""}`,style:u,children:[e.type!=="button"&&l.jsx("label",{ref:r,children:dt(e.title)},"fieldLabel"),e.type==="string"&&!s&&l.jsx("input",{type:"text",disabled:e.disabled,onChange:c,value:a}),e.type==="string"&&s&&l.jsx("textarea",{cols:50,rows:10,disabled:e.disabled!==void 0?e.disabled:!0,onChange:c,onKeyDown:d=>{e.onKeyDown!==void 0&&e.onKeyDown(d)},value:a}),e.type==="boolean"&&l.jsx("input",{type:"checkbox",disabled:e.disabled,onChange:c,checked:a}),e.type==="number"&&l.jsx(Xe,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:r,onChange:e.onChange}),e.type==="range"&&l.jsx(Xe,{value:a,type:e.type,prop:e.prop!==void 0?e.prop:e.title,min:e.min,max:e.max,step:e.step,disabled:e.disabled,labelRef:r,onChange:e.onChange}),e.type==="color"&&l.jsxs(l.Fragment,{children:[l.jsx("input",{type:"text",value:a.toString(),onChange:c,disabled:e.disabled,className:"color"}),l.jsx("input",{type:"color",value:a,onChange:c,disabled:e.disabled})]}),e.type==="button"&&l.jsx("button",{disabled:e.disabled,onClick:()=>{e.onChange!==void 0&&e.onChange(e.prop!==void 0?e.prop:e.title,!0)},children:e.title}),e.type==="image"&&l.jsx(ca,{title:e.title,prop:e.prop,value:e.value,onChange:e.onChange}),e.type==="option"&&l.jsx(l.Fragment,{children:l.jsx("select",{onChange:c,disabled:e.disabled,defaultValue:e.value,children:e.options?.map((d,m)=>l.jsx("option",{value:d.value,children:dt(d.title)},m))})}),e.type==="vector2"&&l.jsx(Gn,{step:e.step,value:a,min:0,max:1,onChange:c}),e.type==="grid3"&&l.jsx(Yt,{step:e.step,value:a,onChange:c}),e.type==="grid4"&&l.jsx(Hn,{step:e.step,value:a,onChange:c}),e.type==="euler"&&l.jsx(Yt,{step:e.step,value:a,onChange:c})]})}function Xt(e){switch(e){case"fov":return"FOV";case"zoom":return"Zoom";case"near":return"Near";case"far":return"Far";case"focus":return"Focus";case"aspect":return"Aspect";case"filmGauge":return"Film Gauge";case"filmOffset":return"Film Offset";case"left":return"Left";case"right":return"Right";case"top":return"Top";case"bottom":return"Bottom"}return e}function la(e,n){const a=[];if(e.perspectiveCameraInfo!==void 0)for(const t in e.perspectiveCameraInfo)a.push({title:Xt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(r,c)=>{n.updateObject(e.uuid,r,c),n.requestMethod(e.uuid,"updateProjectionMatrix");const u=n.getScene(e.uuid);if(u!==null){const s=u.getObjectByProperty("uuid",e.uuid);s!==void 0&&(ne(s,r,c),s.updateProjectionMatrix())}}});else if(e.orthographicCameraInfo!==void 0)for(const t in e.orthographicCameraInfo)a.push({title:Xt(t),prop:t,type:"number",step:.01,value:e.perspectiveCameraInfo[t],onChange:(r,c)=>{n.updateObject(e.uuid,r,c),n.requestMethod(e.uuid,"updateProjectionMatrix");const u=n.getScene(e.uuid);if(u!==null){const s=u.getObjectByProperty("uuid",e.uuid);s!==void 0&&(ne(s,r,c),s.updateProjectionMatrix())}}});return l.jsx(Ze,{title:"Camera",items:a})}function ua(e,n){const a=new f.Matrix4;a.elements=e.matrix;const t=new f.Vector3,r=new f.Euler,c=new f.Vector3;e.uuid.length>0&&(t.setFromMatrixPosition(a),r.setFromRotationMatrix(a),c.setFromMatrixScale(a));const u=(s,h)=>{const d=s==="rotation"?{x:h._x,y:h._y,z:h._z}:h;n.updateObject(e.uuid,s,d);const m=n.getScene(e.uuid);if(m!==null){const g=m.getObjectByProperty("uuid",e.uuid);ne(g,s,d)}};return l.jsx(Ze,{title:"Transform",items:[{title:"Position",prop:"position",type:"grid3",step:.1,value:t,onChange:u},{title:"Rotation",prop:"rotation",type:"grid3",value:r,onChange:u},{title:"Scale",prop:"scale",type:"grid3",value:c,onChange:u}]})}function Zt(e){switch(e){case"color":return"Color";case"intensity":return"Intensity";case"decay":return"Decay";case"distance":return"Distance";case"angle":return"Angle";case"penumbra":return"Penumbra";case"groundColor":return"Ground Color";case"width":return"Width";case"height":return"Height"}return e}function da(e,n){const a=[];if(e.lightInfo!==void 0)for(const t in e.lightInfo){const r=e.lightInfo[t];r!==void 0&&(r.isColor!==void 0?a.push({title:Zt(t),prop:t,type:"color",value:r,onChange:(c,u)=>{const s=new f.Color(u);n.updateObject(e.uuid,c,s);const h=n.getScene(e.uuid);if(h!==null){const d=h.getObjectByProperty("uuid",e.uuid);ne(d,c,s)}}}):a.push({title:Zt(t),prop:t,type:typeof r,value:r,step:typeof r=="number"?.01:void 0,onChange:(c,u)=>{n.updateObject(e.uuid,c,u);const s=n.getScene(e.uuid);if(s!==null){const h=s.getObjectByProperty("uuid",e.uuid);ne(h,c,u)}}}))}return l.jsx(Ze,{title:"Light",items:a})}function ha(e,n){const a=[],t=[];let r=0;e.animations.forEach(u=>{r=Math.max(r,u.duration),u.duration>0&&t.push({title:u.name,items:[{title:"Duration",type:"number",value:u.duration,disabled:!0},{title:"Blend Mode",type:"option",disabled:!0,options:[{title:"Normal",value:2500},{title:"Additive",value:2501}]}]})}),a.push({title:"Animations",items:t});const c=n.getScene(e.uuid);if(c!==null){const u=c.getObjectByProperty("uuid",e.uuid);let s=!1;if(u!==void 0){const h=u.mixer;if(s=h!==void 0,s){const d=[{title:"Time Scale",type:"range",value:h.timeScale,step:.01,min:-1,max:2,onChange:(m,g)=>{h.timeScale=g,n.updateObject(e.uuid,"mixer.timeScale",g)}}];d.push({title:"Stop All",type:"button",onChange:()=>{h.stopAllAction(),n.requestMethod(e.uuid,"stopAllAction",void 0,"mixer")}}),a.push({title:"Mixer",items:d})}}}return l.jsx(Ze,{title:"Animation",items:a})}const vn={name:"",uuid:"",type:"",visible:!1,matrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],animations:[],material:void 0,perspectiveCameraInfo:void 0,orthographicCameraInfo:void 0,lightInfo:void 0,children:[]};let ve={...vn};function bn(e){const[n,a]=S.useState(-1);S.useEffect(()=>{function u(h){ve={...h.value},a(Date.now())}function s(){ve={...vn},a(Date.now())}return I.addEventListener(j.SET_SCENE,s),I.addEventListener(j.SET_OBJECT,u),()=>{I.removeEventListener(j.SET_SCENE,s),I.removeEventListener(j.SET_OBJECT,u)}},[]);const t=ve.type.toLowerCase(),r=ve.animations.length>0||ve.mixer!==void 0,c=t.search("mesh")>-1||t.search("line")>-1||t.search("points")>-1;return l.jsx(Ot,{label:"Inspector",children:l.jsx("div",{id:"Inspector",className:e.class,children:ve.uuid.length>0&&l.jsxs(l.Fragment,{children:[l.jsxs(l.Fragment,{children:[l.jsx(Et,{type:"string",title:"Name",prop:"name",value:ve.name,disabled:!0}),l.jsx(Et,{type:"string",title:"Type",prop:"type",value:ve.type,disabled:!0}),l.jsx(Et,{type:"string",title:"UUID",prop:"uuid",value:ve.uuid,disabled:!0})]}),l.jsxs(l.Fragment,{children:[ua(ve,e.three),r?ha(ve,e.three):null,t.search("camera")>-1?la(ve,e.three):null,t.search("light")>-1?da(ve,e.three):null,c?oa(ve,e.three):null]})]})},n)},"Inspector")}function fa(e){const[n]=S.useState([]),[a,t]=S.useState(0),r=s=>{n.push(s.value),t(Date.now())},c=s=>{const h=s.value;for(let d=0;d<n.length;d++)if(h.uuid===n[d].uuid){n.splice(d,1),t(Date.now());return}};S.useEffect(()=>(I.addEventListener(j.ADD_SCENE,r),I.addEventListener(j.REMOVE_SCENE,c),()=>{I.removeEventListener(j.ADD_SCENE,r),I.removeEventListener(j.REMOVE_SCENE,c)}),[]);const u=[];return n.forEach((s,h)=>{u.push(l.jsx(Ot,{label:`Scene: ${s.name}`,open:!0,children:l.jsx(pn,{child:s,scene:s,three:e.three})},`scene_${h}`))}),l.jsxs("div",{id:"SidePanel",children:[u,l.jsx(bn,{three:e.three})]},`SidePanel ${a}`)}function ma(e){return S.useEffect(()=>{function n(s){let h=null;return e.three.scenes.forEach(d=>{s.search(d.uuid)>-1&&(h=d)}),h}const a=s=>{const h=s.value,d=n(h),m=d?.getObjectByProperty("uuid",h);m!==void 0?e.three.setObject(m):console.log(`Hermes - can't find object: ${h}`,d)},t=(s,h,d)=>{const m=n(s),g=m?.getObjectByProperty("uuid",s);g!==void 0?ne(g,h,d):console.log(`Hermes - can't set object: ${s}`,m)},r=s=>{const h=s.value,{key:d,value:m,uuid:g}=h;t(g,d,m)},c=s=>{const h=s.value,m=n(h.uuid)?.getObjectByProperty("uuid",h.uuid);if(m!==void 0){const g=v=>{const E=h.key.split(".");switch(E.length){case 1:m[E[0]]=v;break;case 2:m[E[0]][E[1]]=v;break;case 3:m[E[0]][E[1]][E[2]]=v;break;case 4:m[E[0]][E[1]][E[2]][E[3]]=v;break;case 5:m[E[0]][E[1]][E[2]][E[3]][E[4]]=v;break}m.material.needsUpdate=!0};h.value.src.length>0?un(h.value.src).then(v=>{v.offset.set(h.value.offset[0],h.value.offset[1]),v.repeat.set(h.value.repeat[0],h.value.repeat[1]),g(v)}):g(null)}},u=s=>{const{key:h,uuid:d,value:m,subitem:g}=s.value,E=n(d)?.getObjectByProperty("uuid",d);if(E!==void 0)try{g!==void 0?In(E,g)[h](m):E[h](m)}catch(R){console.log("Error requesting method:"),console.log(R),console.log(h),console.log(m)}};return I.addEventListener(j.GET_OBJECT,a),I.addEventListener(j.UPDATE_OBJECT,r),I.addEventListener(j.CREATE_TEXTURE,c),I.addEventListener(j.REQUEST_METHOD,u),()=>{I.removeEventListener(j.GET_OBJECT,a),I.removeEventListener(j.UPDATE_OBJECT,r),I.removeEventListener(j.CREATE_TEXTURE,c),I.removeEventListener(j.REQUEST_METHOD,u)}},[]),null}class pa extends f.Line{constructor(n,a){const t=[1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new f.BufferGeometry;r.setAttribute("position",new f.Float32BufferAttribute(t,3)),r.computeBoundingSphere();const c=new f.LineBasicMaterial({fog:!1});super(r,c),this.light=n,this.color=a,this.type="RectAreaLightHelper";const u=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],s=new f.BufferGeometry;s.setAttribute("position",new f.Float32BufferAttribute(u,3)),s.computeBoundingSphere(),this.add(new f.Mesh(s,new f.MeshBasicMaterial({side:f.BackSide,fog:!1})))}updateMatrixWorld(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),this.color!==void 0)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);const n=this.material.color,a=Math.max(n.r,n.g,n.b);a>1&&n.multiplyScalar(1/a),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const Jt={type:"change"},At={type:"start"},Qt={type:"end"},bt=new f.Ray,en=new f.Plane,ga=Math.cos(70*f.MathUtils.DEG2RAD);class va extends f.EventDispatcher{constructor(n,a){super(),this.object=n,this.domElement=a,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new f.Vector3,this.cursor=new f.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:f.MOUSE.ROTATE,MIDDLE:f.MOUSE.DOLLY,RIGHT:f.MOUSE.PAN},this.touches={ONE:f.TOUCH.ROTATE,TWO:f.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(o){o.addEventListener("keydown",H),this._domElementKeyEvents=o},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",H),this._domElementKeyEvents=null},this.saveState=function(){t.target0.copy(t.target),t.position0.copy(t.object.position),t.zoom0=t.object.zoom},this.reset=function(){t.target.copy(t.target0),t.object.position.copy(t.position0),t.object.zoom=t.zoom0,t.object.updateProjectionMatrix(),t.dispatchEvent(Jt),t.update(),c=r.NONE},this.update=function(){const o=new f.Vector3,C=new f.Quaternion().setFromUnitVectors(n.up,new f.Vector3(0,1,0)),P=C.clone().invert(),B=new f.Vector3,se=new f.Quaternion,Ce=new f.Vector3,me=2*Math.PI;return function(pt=null){const gt=t.object.position;o.copy(gt).sub(t.target),o.applyQuaternion(C),s.setFromVector3(o),t.autoRotate&&c===r.NONE&&oe(Je(pt)),t.enableDamping?(s.theta+=h.theta*t.dampingFactor,s.phi+=h.phi*t.dampingFactor):(s.theta+=h.theta,s.phi+=h.phi);let we=t.minAzimuthAngle,Me=t.maxAzimuthAngle;isFinite(we)&&isFinite(Me)&&(we<-Math.PI?we+=me:we>Math.PI&&(we-=me),Me<-Math.PI?Me+=me:Me>Math.PI&&(Me-=me),we<=Me?s.theta=Math.max(we,Math.min(Me,s.theta)):s.theta=s.theta>(we+Me)/2?Math.max(we,s.theta):Math.min(Me,s.theta)),s.phi=Math.max(t.minPolarAngle,Math.min(t.maxPolarAngle,s.phi)),s.makeSafe(),t.enableDamping===!0?t.target.addScaledVector(m,t.dampingFactor):t.target.add(m),t.target.sub(t.cursor),t.target.clampLength(t.minTargetRadius,t.maxTargetRadius),t.target.add(t.cursor);let qe=!1;if(t.zoomToCursor&&fe||t.object.isOrthographicCamera)s.radius=Ae(s.radius);else{const Re=s.radius;s.radius=Ae(s.radius*d),qe=Re!=s.radius}if(o.setFromSpherical(s),o.applyQuaternion(P),gt.copy(t.target).add(o),t.object.lookAt(t.target),t.enableDamping===!0?(h.theta*=1-t.dampingFactor,h.phi*=1-t.dampingFactor,m.multiplyScalar(1-t.dampingFactor)):(h.set(0,0,0),m.set(0,0,0)),t.zoomToCursor&&fe){let Re=null;if(t.object.isPerspectiveCamera){const ze=o.length();Re=Ae(ze*d);const tt=ze-Re;t.object.position.addScaledVector(N,tt),t.object.updateMatrixWorld(),qe=!!tt}else if(t.object.isOrthographicCamera){const ze=new f.Vector3(J.x,J.y,0);ze.unproject(t.object);const tt=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),t.object.updateProjectionMatrix(),qe=tt!==t.object.zoom;const vt=new f.Vector3(J.x,J.y,0);vt.unproject(t.object),t.object.position.sub(vt).add(ze),t.object.updateMatrixWorld(),Re=o.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),t.zoomToCursor=!1;Re!==null&&(this.screenSpacePanning?t.target.set(0,0,-1).transformDirection(t.object.matrix).multiplyScalar(Re).add(t.object.position):(bt.origin.copy(t.object.position),bt.direction.set(0,0,-1).transformDirection(t.object.matrix),Math.abs(t.object.up.dot(bt.direction))<ga?n.lookAt(t.target):(en.setFromNormalAndCoplanarPoint(t.object.up,t.target),bt.intersectPlane(en,t.target))))}else if(t.object.isOrthographicCamera){const Re=t.object.zoom;t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/d)),Re!==t.object.zoom&&(t.object.updateProjectionMatrix(),qe=!0)}return d=1,fe=!1,qe||B.distanceToSquared(t.object.position)>u||8*(1-se.dot(t.object.quaternion))>u||Ce.distanceToSquared(t.target)>u?(t.dispatchEvent(Jt),B.copy(t.object.position),se.copy(t.object.quaternion),Ce.copy(t.target),!0):!1}}(),this.dispose=function(){t.domElement.removeEventListener("contextmenu",de),t.domElement.removeEventListener("pointerdown",ce),t.domElement.removeEventListener("pointercancel",O),t.domElement.removeEventListener("wheel",ie),t.domElement.removeEventListener("pointermove",le),t.domElement.removeEventListener("pointerup",O),t.domElement.getRootNode().removeEventListener("keydown",V,{capture:!0}),t._domElementKeyEvents!==null&&(t._domElementKeyEvents.removeEventListener("keydown",H),t._domElementKeyEvents=null)};const t=this,r={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=r.NONE;const u=1e-6,s=new f.Spherical,h=new f.Spherical;let d=1;const m=new f.Vector3,g=new f.Vector2,v=new f.Vector2,E=new f.Vector2,R=new f.Vector2,k=new f.Vector2,D=new f.Vector2,G=new f.Vector2,M=new f.Vector2,z=new f.Vector2,N=new f.Vector3,J=new f.Vector2;let fe=!1;const K=[],re={};let ye=!1;function Je(o){return o!==null?2*Math.PI/60*t.autoRotateSpeed*o:2*Math.PI/60/60*t.autoRotateSpeed}function De(o){const C=Math.abs(o*.01);return Math.pow(.95,t.zoomSpeed*C)}function oe(o){h.theta-=o}function ee(o){h.phi-=o}const ge=function(){const o=new f.Vector3;return function(P,B){o.setFromMatrixColumn(B,0),o.multiplyScalar(-P),m.add(o)}}(),Se=function(){const o=new f.Vector3;return function(P,B){t.screenSpacePanning===!0?o.setFromMatrixColumn(B,1):(o.setFromMatrixColumn(B,0),o.crossVectors(t.object.up,o)),o.multiplyScalar(P),m.add(o)}}(),W=function(){const o=new f.Vector3;return function(P,B){const se=t.domElement;if(t.object.isPerspectiveCamera){const Ce=t.object.position;o.copy(Ce).sub(t.target);let me=o.length();me*=Math.tan(t.object.fov/2*Math.PI/180),ge(2*P*me/se.clientHeight,t.object.matrix),Se(2*B*me/se.clientHeight,t.object.matrix)}else t.object.isOrthographicCamera?(ge(P*(t.object.right-t.object.left)/t.object.zoom/se.clientWidth,t.object.matrix),Se(B*(t.object.top-t.object.bottom)/t.object.zoom/se.clientHeight,t.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),t.enablePan=!1)}}();function Ie(o){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function A(o){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?d*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function je(o,C){if(!t.zoomToCursor)return;fe=!0;const P=t.domElement.getBoundingClientRect(),B=o-P.left,se=C-P.top,Ce=P.width,me=P.height;J.x=B/Ce*2-1,J.y=-(se/me)*2+1,N.set(J.x,J.y,1).unproject(t.object).sub(t.object.position).normalize()}function Ae(o){return Math.max(t.minDistance,Math.min(t.maxDistance,o))}function Ne(o){g.set(o.clientX,o.clientY)}function Ye(o){je(o.clientX,o.clientX),G.set(o.clientX,o.clientY)}function Le(o){R.set(o.clientX,o.clientY)}function Fe(o){v.set(o.clientX,o.clientY),E.subVectors(v,g).multiplyScalar(t.rotateSpeed);const C=t.domElement;oe(2*Math.PI*E.x/C.clientHeight),ee(2*Math.PI*E.y/C.clientHeight),g.copy(v),t.update()}function Qe(o){M.set(o.clientX,o.clientY),z.subVectors(M,G),z.y>0?Ie(De(z.y)):z.y<0&&A(De(z.y)),G.copy(M),t.update()}function Ue(o){k.set(o.clientX,o.clientY),D.subVectors(k,R).multiplyScalar(t.panSpeed),W(D.x,D.y),R.copy(k),t.update()}function Be(o){je(o.clientX,o.clientY),o.deltaY<0?A(De(o.deltaY)):o.deltaY>0&&Ie(De(o.deltaY)),t.update()}function Ve(o){let C=!1;switch(o.code){case t.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?ee(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):W(0,t.keyPanSpeed),C=!0;break;case t.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?ee(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):W(0,-t.keyPanSpeed),C=!0;break;case t.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?oe(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):W(t.keyPanSpeed,0),C=!0;break;case t.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?oe(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):W(-t.keyPanSpeed,0),C=!0;break}C&&(o.preventDefault(),t.update())}function _e(o){if(K.length===1)g.set(o.pageX,o.pageY);else{const C=$e(o),P=.5*(o.pageX+C.x),B=.5*(o.pageY+C.y);g.set(P,B)}}function Q(o){if(K.length===1)R.set(o.pageX,o.pageY);else{const C=$e(o),P=.5*(o.pageX+C.x),B=.5*(o.pageY+C.y);R.set(P,B)}}function Ee(o){const C=$e(o),P=o.pageX-C.x,B=o.pageY-C.y,se=Math.sqrt(P*P+B*B);G.set(0,se)}function et(o){t.enableZoom&&Ee(o),t.enablePan&&Q(o)}function st(o){t.enableZoom&&Ee(o),t.enableRotate&&_e(o)}function be(o){if(K.length==1)v.set(o.pageX,o.pageY);else{const P=$e(o),B=.5*(o.pageX+P.x),se=.5*(o.pageY+P.y);v.set(B,se)}E.subVectors(v,g).multiplyScalar(t.rotateSpeed);const C=t.domElement;oe(2*Math.PI*E.x/C.clientHeight),ee(2*Math.PI*E.y/C.clientHeight),g.copy(v)}function p(o){if(K.length===1)k.set(o.pageX,o.pageY);else{const C=$e(o),P=.5*(o.pageX+C.x),B=.5*(o.pageY+C.y);k.set(P,B)}D.subVectors(k,R).multiplyScalar(t.panSpeed),W(D.x,D.y),R.copy(k)}function y(o){const C=$e(o),P=o.pageX-C.x,B=o.pageY-C.y,se=Math.sqrt(P*P+B*B);M.set(0,se),z.set(0,Math.pow(M.y/G.y,t.zoomSpeed)),Ie(z.y),G.copy(M);const Ce=(o.pageX+C.x)*.5,me=(o.pageY+C.y)*.5;je(Ce,me)}function _(o){t.enableZoom&&y(o),t.enablePan&&p(o)}function F(o){t.enableZoom&&y(o),t.enableRotate&&be(o)}function ce(o){t.enabled!==!1&&(K.length===0&&(t.domElement.setPointerCapture(o.pointerId),t.domElement.addEventListener("pointermove",le),t.domElement.addEventListener("pointerup",O)),!kt(o)&&(Tt(o),o.pointerType==="touch"?ke(o):w(o)))}function le(o){t.enabled!==!1&&(o.pointerType==="touch"?ue(o):q(o))}function O(o){switch(_t(o),K.length){case 0:t.domElement.releasePointerCapture(o.pointerId),t.domElement.removeEventListener("pointermove",le),t.domElement.removeEventListener("pointerup",O),t.dispatchEvent(Qt),c=r.NONE;break;case 1:const C=K[0],P=re[C];ke({pointerId:C,pageX:P.x,pageY:P.y});break}}function w(o){let C;switch(o.button){case 0:C=t.mouseButtons.LEFT;break;case 1:C=t.mouseButtons.MIDDLE;break;case 2:C=t.mouseButtons.RIGHT;break;default:C=-1}switch(C){case f.MOUSE.DOLLY:if(t.enableZoom===!1)return;Ye(o),c=r.DOLLY;break;case f.MOUSE.ROTATE:if(o.ctrlKey||o.metaKey||o.shiftKey){if(t.enablePan===!1)return;Le(o),c=r.PAN}else{if(t.enableRotate===!1)return;Ne(o),c=r.ROTATE}break;case f.MOUSE.PAN:if(o.ctrlKey||o.metaKey||o.shiftKey){if(t.enableRotate===!1)return;Ne(o),c=r.ROTATE}else{if(t.enablePan===!1)return;Le(o),c=r.PAN}break;default:c=r.NONE}c!==r.NONE&&t.dispatchEvent(At)}function q(o){switch(c){case r.ROTATE:if(t.enableRotate===!1)return;Fe(o);break;case r.DOLLY:if(t.enableZoom===!1)return;Qe(o);break;case r.PAN:if(t.enablePan===!1)return;Ue(o);break}}function ie(o){t.enabled===!1||t.enableZoom===!1||c!==r.NONE||(o.preventDefault(),t.dispatchEvent(At),Be(xe(o)),t.dispatchEvent(Qt))}function xe(o){const C=o.deltaMode,P={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(C){case 1:P.deltaY*=16;break;case 2:P.deltaY*=100;break}return o.ctrlKey&&!ye&&(P.deltaY*=10),P}function V(o){o.key==="Control"&&(ye=!0,t.domElement.getRootNode().addEventListener("keyup",Z,{passive:!0,capture:!0}))}function Z(o){o.key==="Control"&&(ye=!1,t.domElement.getRootNode().removeEventListener("keyup",Z,{passive:!0,capture:!0}))}function H(o){t.enabled===!1||t.enablePan===!1||Ve(o)}function ke(o){switch(mt(o),K.length){case 1:switch(t.touches.ONE){case f.TOUCH.ROTATE:if(t.enableRotate===!1)return;_e(o),c=r.TOUCH_ROTATE;break;case f.TOUCH.PAN:if(t.enablePan===!1)return;Q(o),c=r.TOUCH_PAN;break;default:c=r.NONE}break;case 2:switch(t.touches.TWO){case f.TOUCH.DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;et(o),c=r.TOUCH_DOLLY_PAN;break;case f.TOUCH.DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;st(o),c=r.TOUCH_DOLLY_ROTATE;break;default:c=r.NONE}break;default:c=r.NONE}c!==r.NONE&&t.dispatchEvent(At)}function ue(o){switch(mt(o),c){case r.TOUCH_ROTATE:if(t.enableRotate===!1)return;be(o),t.update();break;case r.TOUCH_PAN:if(t.enablePan===!1)return;p(o),t.update();break;case r.TOUCH_DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;_(o),t.update();break;case r.TOUCH_DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;F(o),t.update();break;default:c=r.NONE}}function de(o){t.enabled!==!1&&o.preventDefault()}function Tt(o){K.push(o.pointerId)}function _t(o){delete re[o.pointerId];for(let C=0;C<K.length;C++)if(K[C]==o.pointerId){K.splice(C,1);return}}function kt(o){for(let C=0;C<K.length;C++)if(K[C]==o.pointerId)return!0;return!1}function mt(o){let C=re[o.pointerId];C===void 0&&(C=new f.Vector2,re[o.pointerId]=C),C.set(o.pageX,o.pageY)}function $e(o){const C=o.pointerId===K[0]?K[1]:K[0];return re[C]}t.domElement.addEventListener("contextmenu",de),t.domElement.addEventListener("pointerdown",ce),t.domElement.addEventListener("pointercancel",O),t.domElement.addEventListener("wheel",ie,{passive:!1}),t.domElement.getRootNode().addEventListener("keydown",V,{passive:!0,capture:!0}),this.update()}}function rt(e,n,a,t,r){return t+(e-n)*(r-t)/(a-n)}const Ct=e=>{const[n,a]=S.useState(e.options[e.index]),t=()=>{e.onToggle(!e.open)},r=c=>{c!==n&&(e.onSelect(c),a(c)),e.onToggle(!1)};return l.jsxs("div",{className:`dropdown ${e.up===!0?"up":""}`,children:[l.jsx("div",{className:"dropdown-toggle",onClick:t,children:n}),e.open&&l.jsx("ul",{className:"dropdown-menu",children:e.options.map(c=>l.jsx("li",{onClick:()=>r(c),children:c},c))})]})},tn=["Renderer","Depth","Normals","UVs","Wireframe"],Ke=S.forwardRef(function(n,a){const[t,r]=S.useState("Renderer"),[c,u]=S.useState(!1),[s,h]=S.useState(!1),[d,m]=S.useState(!1),g=n.options.indexOf(n.camera.name);return l.jsxs("div",{className:"CameraWindow",children:[l.jsx("div",{ref:a,className:"clickable",onClick:()=>{d&&m(!1)}}),l.jsx(Ct,{index:tn.indexOf(t),open:s,options:tn,onSelect:v=>{if(v===t)return;const E=v;n.onSelectRenderMode(E),r(E)},onToggle:v=>{c&&u(!1),h(v)},up:!0}),l.jsx(Ct,{index:g,open:d,options:n.options,onSelect:n.onSelectCamera,onToggle:v=>{m(v)},up:!0})]})});class ba extends f.ShaderMaterial{constructor(n){super({extensions:{derivatives:!0},glslVersion:f.GLSL3,side:f.DoubleSide,transparent:!0,uniforms:{uScale:{value:n?.scale!==void 0?n?.scale:.1},uDivisions:{value:n?.divisions!==void 0?n?.divisions:10},uColor:{value:n?.color!==void 0?n?.color:new f.Color(16777215)},uDistance:{value:n?.distance!==void 0?n?.distance:1e4},uSubgridOpacity:{value:n?.subgridOpacity!==void 0?n?.subgridOpacity:.15},uGridOpacity:{value:n?.gridOpacity!==void 0?n?.gridOpacity:.25}},vertexShader:`out vec3 worldPosition;
|
31
31
|
uniform float uDistance;
|
32
32
|
|
33
33
|
void main() {
|
@@ -103,7 +103,7 @@ C11,8.22,10.74,8,10.43,8z`})});function on(e){return l.jsx(en.Reorder.Item,{valu
|
|
103
103
|
fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
|
104
104
|
|
105
105
|
if (fragColor.a <= 0.0) discard;
|
106
|
-
}`,name:"InfiniteGrid",depthWrite:!1})}}class
|
106
|
+
}`,name:"InfiniteGrid",depthWrite:!1})}}class ya extends f.Mesh{gridMaterial;constructor(){const n=new ba;super(new f.PlaneGeometry(2,2),n),this.gridMaterial=n,this.frustumCulled=!1,this.name="InfiniteGridHelper",this.position.y=.1}update(){this.gridMaterial.needsUpdate=!0}}const Sa=`#include <common>
|
107
107
|
#include <batching_pars_vertex>
|
108
108
|
#include <uv_pars_vertex>
|
109
109
|
#include <color_pars_vertex>
|
@@ -133,7 +133,7 @@ void main() {
|
|
133
133
|
#include <logdepthbuf_vertex>
|
134
134
|
#include <clipping_planes_vertex>
|
135
135
|
#include <worldpos_vertex>
|
136
|
-
}`,
|
136
|
+
}`,Ea=`
|
137
137
|
#include <common>
|
138
138
|
#include <uv_pars_fragment>
|
139
139
|
#include <clipping_planes_pars_fragment>
|
@@ -141,4 +141,4 @@ void main() {
|
|
141
141
|
void main() {
|
142
142
|
#include <clipping_planes_fragment>
|
143
143
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
144
|
-
}`;class ba extends f.ShaderMaterial{constructor(){super({defines:{USE_UV:""},vertexShader:ga,fragmentShader:va})}}let bt="Renderer",we,At=!1,X=null,oe=null,ze=null,Ge=null;function ya(e){const n=e.three.app.appID,a=localStorage.getItem(`${n}_mode`),t=localStorage.getItem(`${n}_tlCam`)!==null?localStorage.getItem(`${n}_tlCam`):"Debug",i=localStorage.getItem(`${n}_trCam`)!==null?localStorage.getItem(`${n}_trCam`):"Orthographic",c=localStorage.getItem(`${n}_blCam`)!==null?localStorage.getItem(`${n}_blCam`):"Front",u=localStorage.getItem(`${n}_brCam`)!==null?localStorage.getItem(`${n}_brCam`):"Top",r=E.useMemo(()=>new Map,[]),h=E.useMemo(()=>new Map,[]),d=E.useMemo(()=>new Map,[]),m=E.useMemo(()=>new Map,[]),p=E.useMemo(()=>new f.Scene,[]),b=E.useMemo(()=>new f.Group,[]),C=E.useMemo(()=>new pa,[]),D=E.useMemo(()=>new f.AxesHelper(500),[]),q=E.useMemo(()=>new f.AxesHelper(100),[]),z=E.useMemo(()=>new f.MeshDepthMaterial,[]),G=E.useMemo(()=>new f.MeshNormalMaterial,[]),M=E.useMemo(()=>new ba,[]),K=E.useMemo(()=>new f.MeshBasicMaterial({opacity:.33,transparent:!0,wireframe:!0}),[]);function R(v,y){const T=new f.OrthographicCamera(-100,100,100,-100,50,5e3);return T.name=v,T.position.copy(y),T.lookAt(0,0,0),r.set(v,T),T}const Z=["Renderer","Depth","Normals","UVs","Wireframe"],ce=["Single","Side by Side","Stacked","Quad"],W=E.useRef(null),me=E.useRef(null),ie=E.useRef(null),Me=E.useRef(null),Oe=E.useRef(null),ge=E.useRef(null),[B,ve]=E.useState(a!==null?a:"Single"),[k,xe]=E.useState(null),[Re,De]=E.useState(!1),[Te,_e]=E.useState(!1),[ke,$e]=E.useState("Orbit"),[Ae,We]=E.useState(!1),[nt,Pe]=E.useState(Date.now());localStorage.setItem(`${n}_mode`,B),localStorage.setItem(`${n}_tlCam`,t),localStorage.setItem(`${n}_trCam`,i),localStorage.setItem(`${n}_blCam`,c),localStorage.setItem(`${n}_brCam`,u);const ne=(v,y)=>{const T=h.get(v.name);if(T!==void 0&&T.dispose(),h.delete(v.name),v.name==="UI")return;const N=new fa(v,y);switch(N.enableDamping=!0,N.dampingFactor=.05,v.name){case"Top":case"Bottom":case"Left":case"Right":case"Front":case"Back":N.enableRotate=!1;break}h.set(v.name,N)},he=v=>{const y=d.get(v.name);y!==void 0&&(p.remove(y),y.dispose(),d.delete(v.name));const T=h.get(v.name);T!==void 0&&(T.dispose(),h.delete(v.name))},Ne=()=>{h.forEach((v,y)=>{v.dispose();const T=d.get(y);T!==void 0&&(p.remove(T),T.dispose()),d.delete(y),h.delete(y)}),h.clear(),d.clear()},je=()=>{switch(B){case"Single":ne(X,ie.current);break;case"Side by Side":case"Stacked":ne(X,ie.current),ne(oe,Me.current);break;case"Quad":ne(X,ie.current),ne(oe,Me.current),ne(ze,Oe.current),ne(Ge,ge.current);break}};E.useEffect(()=>{const v=new f.WebGLRenderer({canvas:W.current,stencil:!1});v.autoClear=!1,v.shadowMap.enabled=!0,v.setPixelRatio(devicePixelRatio),v.setClearColor(0),e.three.renderer=v,xe(v)},[]),E.useEffect(()=>{p.name="Debug Scene",p.uuid="",b.name="helpers",p.add(b),b.add(C),D.name="axisHelper",b.add(D),q.name="interactionHelper",b.add(q),q.visible=!1,R("Top",new f.Vector3(0,1e3,0)),R("Bottom",new f.Vector3(0,-1e3,0)),R("Left",new f.Vector3(-1e3,0,0)),R("Right",new f.Vector3(1e3,0,0)),R("Front",new f.Vector3(0,0,1e3)),R("Back",new f.Vector3(0,0,-1e3)),R("Orthographic",new f.Vector3(1e3,1e3,1e3)),R("UI",new f.Vector3);const v=new f.PerspectiveCamera(60,1,50,5e3);v.name="Debug",v.position.set(500,500,500),v.lookAt(0,0,0),r.set("Debug",v),X=r.get(localStorage.getItem(`${n}_tlCam`)),oe=r.get(localStorage.getItem(`${n}_trCam`)),ze=r.get(localStorage.getItem(`${n}_blCam`)),Ge=r.get(localStorage.getItem(`${n}_brCam`))},[]),E.useEffect(()=>{const v=()=>{m.forEach(_=>{b.remove(_),_.dispose()}),m.clear()},y=()=>{we.traverse(_=>{if(_.type.search("Light")>-1){let w;switch(_.type){case"DirectionalLight":w=new f.DirectionalLightHelper(_,100),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"HemisphereLight":w=new f.HemisphereLightHelper(_,250),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"RectAreaLight":w=new da(_),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"PointLight":w=new f.PointLightHelper(_,100),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break;case"SpotLight":w=new f.SpotLightHelper(_),w.name=`${_.name}Helper`,m.set(_.name,w),b.add(w);break}}})},T=_=>{b.add(D),v(),ut(we),p.remove(we);const w=e.scenes.get(_.value.name);if(w!==void 0){const H=new w;e.onSceneSet!==void 0&&e.onSceneSet(H),we=H,e.three.scene=we,p.add(we),At=!0,y()}},N=_=>{const w=_.value,H=e.three.scene?.getObjectByProperty("uuid",w.uuid);if(H!==void 0&&r.set(w.name,H),H instanceof f.PerspectiveCamera){const J=new f.CameraHelper(H);d.set(H.name,J),p.add(J)}Pe(Date.now())},se=_=>{const w=d.get(_.value.name);w!==void 0&&(p.remove(w),w.dispose()),r.delete(_.value.name),Pe(Date.now())},le=_=>{const w=we.getObjectByProperty("uuid",_.value.uuid);w&&w.add(D)};return j.addEventListener(I.SET_SCENE,T),j.addEventListener(I.ADD_CAMERA,N),j.addEventListener(I.REMOVE_CAMERA,se),j.addEventListener(I.SET_OBJECT,le),()=>{j.removeEventListener(I.SET_SCENE,T),j.removeEventListener(I.ADD_CAMERA,N),j.removeEventListener(I.REMOVE_CAMERA,se),j.removeEventListener(I.SET_OBJECT,le)}},[]),E.useEffect(()=>{if(k===null)return;let v=window.innerWidth,y=window.innerHeight,T=Math.floor(v/2),N=Math.floor(y/2),se=-1;const le=()=>{v=window.innerWidth-300,y=window.innerHeight,T=Math.floor(v/2),N=Math.floor(y/2),e.three.resize(v,y),e.onSceneResize!==void 0&&At&&e.onSceneResize(we,v,y);let A=v,Y=y;switch(B){case"Side by Side":A=T,Y=y;break;case"Stacked":A=v,Y=N;break;case"Quad":A=T,Y=N;break}r.forEach(Q=>{Q instanceof f.OrthographicCamera?(Q.left=A/-2,Q.right=A/2,Q.top=Y/2,Q.bottom=Y/-2,Q.name==="UI"&&(Q.position.x=v/2,Q.position.y=y/-2,Q.position.z=100),Q.updateProjectionMatrix()):Q instanceof f.PerspectiveCamera&&(Q.aspect=A/Y,Q.updateProjectionMatrix(),d.get(Q.name)?.update())})},_=()=>{k.setViewport(0,0,v,y),k.setScissor(0,0,v,y),k.render(p,X)},w=()=>{if(B==="Side by Side")k.setViewport(0,0,T,y),k.setScissor(0,0,T,y),k.render(p,X),k.setViewport(T,0,T,y),k.setScissor(T,0,T,y),k.render(p,oe);else{const A=y-N;k.setViewport(0,A,v,N),k.setScissor(0,A,v,N),k.render(p,X),k.setViewport(0,0,v,N),k.setScissor(0,0,v,N),k.render(p,oe)}},H=()=>{let A=0,Y=0;Y=y-N,A=0,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,X),A=T,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,oe),Y=0,A=0,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,ze),A=T,k.setViewport(A,Y,T,N),k.setScissor(A,Y,T,N),k.render(p,Ge)},J=()=>{switch(h.forEach(A=>{A.update()}),d.forEach(A=>{A.update()}),m.forEach(A=>{A.update!==void 0&&A.update()}),e.onSceneUpdate!==void 0&&At&&e.onSceneUpdate(we),k.clear(),B){case"Single":_();break;case"Side by Side":case"Stacked":w();break;case"Quad":H();break}se=requestAnimationFrame(J)};return je(),window.addEventListener("resize",le),le(),J(),()=>{window.removeEventListener("resize",le),cancelAnimationFrame(se),se=-1}},[B,k]),E.useEffect(()=>{if(k!==null){const v=new f.Raycaster,y=new f.Vector2,T=(_,w,H,J)=>{switch(B){case"Quad":_<H?w<J?v.setFromCamera(y,X):v.setFromCamera(y,ze):w<J?v.setFromCamera(y,oe):v.setFromCamera(y,Ge);break;case"Side by Side":_<H?v.setFromCamera(y,X):v.setFromCamera(y,oe);break;case"Single":v.setFromCamera(y,X);break;case"Stacked":w<J?v.setFromCamera(y,X):v.setFromCamera(y,oe);break}},N=_=>{if(ke==="Orbit")return;const w=new f.Vector2;k.getSize(w);const H=Math.min(_.clientX,w.x),J=Math.min(_.clientY,w.y);y.x=tt(H,0,w.x,-1,1),y.y=tt(J,0,w.y,1,-1);const A=w.x/2,Y=w.y/2,Q=()=>{H<A?y.x=tt(H,0,A,-1,1):y.x=tt(H,A,w.x,-1,1)},Le=()=>{J<Y?y.y=tt(J,0,Y,1,-1):y.y=tt(J,Y,w.y,1,-1)};switch(B){case"Quad":Q(),Le();break;case"Side by Side":Q();break;case"Stacked":Le(),Le();break}T(H,J,A,Y);const Fe=v.intersectObjects(we.children);Fe.length>0&&q.position.copy(Fe[0].point)},se=_=>{if(ke==="Orbit")return;const w=new f.Vector2;if(k.getSize(w),_.clientX>=w.x)return;N(_);const H=v.intersectObjects(we.children);H.length>0&&(e.three.getObject(H[0].object.uuid),q.visible=!1,$e("Orbit"),Pe(Date.now()))},le=me.current;return le.addEventListener("mousemove",N,!1),le.addEventListener("click",se,!1),()=>{le.removeEventListener("mousemove",N),le.removeEventListener("click",se)}}},[B,k,ke]);const pe=[];return r.forEach((v,y)=>{pe.push(y)}),l.jsxs("div",{className:"multiview",children:[l.jsx("canvas",{ref:W}),k!==null&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`cameras ${B==="Single"||B==="Stacked"?"single":""}`,ref:me,children:[B==="Single"&&l.jsx(l.Fragment,{children:l.jsx(qe,{camera:X,options:pe,ref:ie,onSelect:v=>{h.get(X.name)?.dispose();const y=r.get(v);y!==void 0&&(he(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),ne(y,ie.current))}})}),(B==="Side by Side"||B==="Stacked")&&l.jsxs(l.Fragment,{children:[l.jsx(qe,{camera:X,options:pe,ref:ie,onSelect:v=>{h.get(X.name)?.dispose();const y=r.get(v);y!==void 0&&(he(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),ne(y,ie.current))}}),l.jsx(qe,{camera:oe,options:pe,ref:Me,onSelect:v=>{h.get(oe.name)?.dispose();const y=r.get(v);y!==void 0&&(he(oe),oe=y,localStorage.setItem(`${n}_trCam`,y.name),ne(y,Me.current))}})]}),B==="Quad"&&l.jsxs(l.Fragment,{children:[l.jsx(qe,{camera:X,options:pe,ref:ie,onSelect:v=>{h.get(X.name)?.dispose();const y=r.get(v);y!==void 0&&(he(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),ne(y,ie.current))}}),l.jsx(qe,{camera:oe,options:pe,ref:Me,onSelect:v=>{h.get(oe.name)?.dispose();const y=r.get(v);y!==void 0&&(he(oe),oe=y,localStorage.setItem(`${n}_trCam`,y.name),ne(y,Me.current))}}),l.jsx(qe,{camera:ze,options:pe,ref:Oe,onSelect:v=>{h.get(ze.name)?.dispose();const y=r.get(v);y!==void 0&&(he(ze),ze=y,localStorage.setItem(`${n}_blCam`,y.name),ne(y,Oe.current))}}),l.jsx(qe,{camera:Ge,options:pe,ref:ge,onSelect:v=>{h.get(Ge.name)?.dispose();const y=r.get(v);y!==void 0&&(he(Ge),Ge=y,localStorage.setItem(`${n}_brCam`,y.name),ne(y,ge.current))}})]})]}),l.jsxs("div",{className:"settings",children:[l.jsx(St,{index:ce.indexOf(B),options:ce,onSelect:v=>{v!==B&&(Ne(),ve(v))},open:Re,onToggle:v=>{De(v),Te&&_e(!1),Ae&&We(!1)}}),l.jsx(St,{index:Z.indexOf(bt),options:Z,onSelect:v=>{if(v!==bt)switch(bt=v,bt){case"Depth":p.overrideMaterial=z;break;case"Normals":p.overrideMaterial=G;break;default:case"Renderer":p.overrideMaterial=null;break;case"Wireframe":p.overrideMaterial=K;break;case"UVs":p.overrideMaterial=M;break}},open:Te,onToggle:v=>{Re&&De(!1),_e(v),Ae&&We(!1)}}),l.jsx(St,{index:ke==="Orbit"?0:1,options:["Orbit Mode","Selection Mode"],onSelect:v=>{q.visible=v==="Selection Mode",$e(q.visible?"Selection":"Orbit")},open:Ae,onToggle:v=>{Re&&De(!1),Te&&_e(!1),We(v)}})]},nt)]})]})}function Ea(e){return l.jsxs("div",{className:"editor",ref:e.ref,style:e.style,children:[l.jsx("div",{className:"header",children:e.header}),e.children,l.jsx("div",{className:"footer",children:e.footer})]})}exports.Accordion=Mt;exports.Application=wn;exports.BaseRemote=dt;exports.ChildObject=Bt;exports.ContainerObject=dn;exports.Draggable=cn;exports.DraggableItem=on;exports.Dropdown=ln;exports.DropdownItem=un;exports.Editor=Ea;exports.Inspector=mn;exports.MultiView=ya;exports.NavButton=Ut;exports.RemoteComponents=Mn;exports.RemoteController=Fn;exports.RemoteTheatre=wt;exports.RemoteThree=An;exports.RemoteTweakpane=Pn;exports.SceneInspector=ua;exports.SidePanel=la;exports.ToolEvents=I;exports.capitalize=lt;exports.clamp=He;exports.colorToHex=an;exports.debugDispatcher=j;exports.defaultTheatreCallback=Sn;exports.dispose=ut;exports.disposeMaterial=rn;exports.disposeTexture=Cn;exports.distance=xn;exports.hierarchyUUID=xt;exports.isColor=nn;exports.mix=jt;exports.noop=Ct;exports.normalize=Pt;exports.randomID=tn;exports.resetThreeObjects=Nt;exports.round=It;exports.theatreEditorApp=On;
|
144
|
+
}`;class xa extends f.ShaderMaterial{constructor(){super({defines:{USE_UV:""},vertexShader:Sa,fragmentShader:Ea})}}let Te,Pt=!1,X=null,he=null,Ge=null,He=null,it="Renderer",yt="Renderer",nn="Renderer",an="Renderer";function Ca(e){const n=e.three.app.appID,a=localStorage.getItem(`${n}_mode`),t=localStorage.getItem(`${n}_tlCam`)!==null?localStorage.getItem(`${n}_tlCam`):"Debug",r=localStorage.getItem(`${n}_trCam`)!==null?localStorage.getItem(`${n}_trCam`):"Orthographic",c=localStorage.getItem(`${n}_blCam`)!==null?localStorage.getItem(`${n}_blCam`):"Front",u=localStorage.getItem(`${n}_brCam`)!==null?localStorage.getItem(`${n}_brCam`):"Top",s=localStorage.getItem(`${n}_tlRender`)!==null?localStorage.getItem(`${n}_tlRender`):"Renderer",h=localStorage.getItem(`${n}_trRender`)!==null?localStorage.getItem(`${n}_trRender`):"Renderer",d=localStorage.getItem(`${n}_blRender`)!==null?localStorage.getItem(`${n}_blRender`):"Renderer",m=localStorage.getItem(`${n}_brRender`)!==null?localStorage.getItem(`${n}_brRender`):"Renderer",g=S.useMemo(()=>new Map,[]),v=S.useMemo(()=>new Map,[]),E=S.useMemo(()=>new Map,[]),R=S.useMemo(()=>new Map,[]),k=S.useMemo(()=>new f.Scene,[]),D=S.useMemo(()=>new f.Group,[]),G=S.useMemo(()=>new ya,[]),M=S.useMemo(()=>new f.AxesHelper(500),[]),z=S.useMemo(()=>new f.AxesHelper(100),[]),N=S.useMemo(()=>new f.MeshDepthMaterial,[]),J=S.useMemo(()=>new f.MeshNormalMaterial,[]),fe=S.useMemo(()=>new xa,[]),K=S.useMemo(()=>new f.MeshBasicMaterial({opacity:.33,transparent:!0,wireframe:!0}),[]);function re(p,y){const _=new f.OrthographicCamera(-100,100,100,-100,50,5e3);return _.name=p,_.position.copy(y),_.lookAt(0,0,0),g.set(p,_),_}const ye=["Single","Side by Side","Stacked","Quad"],Je=S.useRef(null),De=S.useRef(null),oe=S.useRef(null),ee=S.useRef(null),ge=S.useRef(null),Se=S.useRef(null),[W,Ie]=S.useState(a!==null?a:"Single"),[A,je]=S.useState(null),[Ae,Ne]=S.useState(!1),[Ye,Le]=S.useState(!1),[Fe,Qe]=S.useState("Orbit"),[Ue,Be]=S.useState(!1),[Ve,_e]=S.useState(Date.now());localStorage.setItem(`${n}_mode`,W),localStorage.setItem(`${n}_tlCam`,t),localStorage.setItem(`${n}_trCam`,r),localStorage.setItem(`${n}_blCam`,c),localStorage.setItem(`${n}_brCam`,u),localStorage.setItem(`${n}_tlRender`,s),localStorage.setItem(`${n}_trRender`,h),localStorage.setItem(`${n}_blRender`,d),localStorage.setItem(`${n}_brRender`,m);const Q=(p,y)=>{const _=v.get(p.name);if(_!==void 0&&_.dispose(),v.delete(p.name),p.name==="UI")return;const F=new va(p,y);switch(F.enableDamping=!0,F.dampingFactor=.05,p.name){case"Top":case"Bottom":case"Left":case"Right":case"Front":case"Back":F.enableRotate=!1;break}v.set(p.name,F)},Ee=p=>{const y=E.get(p.name);y!==void 0&&(k.remove(y),y.dispose(),E.delete(p.name));const _=v.get(p.name);_!==void 0&&(_.dispose(),v.delete(p.name))},et=()=>{v.forEach((p,y)=>{p.dispose();const _=E.get(y);_!==void 0&&(k.remove(_),_.dispose()),E.delete(y),v.delete(y)}),v.clear(),E.clear()},st=()=>{switch(W){case"Single":Q(X,oe.current);break;case"Side by Side":case"Stacked":Q(X,oe.current),Q(he,ee.current);break;case"Quad":Q(X,oe.current),Q(he,ee.current),Q(Ge,ge.current),Q(He,Se.current);break}};S.useEffect(()=>{const p=new f.WebGLRenderer({canvas:Je.current,stencil:!1});p.autoClear=!1,p.shadowMap.enabled=!0,p.setPixelRatio(devicePixelRatio),p.setClearColor(0),e.three.renderer=p,je(p)},[]),S.useEffect(()=>{k.name="Debug Scene",k.uuid="",D.name="helpers",k.add(D),D.add(G),M.name="axisHelper",D.add(M),z.name="interactionHelper",D.add(z),z.visible=!1,re("Top",new f.Vector3(0,1e3,0)),re("Bottom",new f.Vector3(0,-1e3,0)),re("Left",new f.Vector3(-1e3,0,0)),re("Right",new f.Vector3(1e3,0,0)),re("Front",new f.Vector3(0,0,1e3)),re("Back",new f.Vector3(0,0,-1e3)),re("Orthographic",new f.Vector3(1e3,1e3,1e3)),re("UI",new f.Vector3);const p=new f.PerspectiveCamera(60,1,50,5e3);p.name="Debug",p.position.set(500,500,500),p.lookAt(0,0,0),g.set("Debug",p),X=g.get(localStorage.getItem(`${n}_tlCam`)),he=g.get(localStorage.getItem(`${n}_trCam`)),Ge=g.get(localStorage.getItem(`${n}_blCam`)),He=g.get(localStorage.getItem(`${n}_brCam`))},[]),S.useEffect(()=>{const p=()=>{R.forEach(O=>{D.remove(O),O.dispose()}),R.clear()},y=()=>{Te.traverse(O=>{if(O.type.search("Light")>-1){let w;switch(O.type){case"DirectionalLight":w=new f.DirectionalLightHelper(O,100),w.name=`${O.name}Helper`,R.set(O.name,w),D.add(w);break;case"HemisphereLight":w=new f.HemisphereLightHelper(O,250),w.name=`${O.name}Helper`,R.set(O.name,w),D.add(w);break;case"RectAreaLight":w=new pa(O),w.name=`${O.name}Helper`,R.set(O.name,w),D.add(w);break;case"PointLight":w=new f.PointLightHelper(O,100),w.name=`${O.name}Helper`,R.set(O.name,w),D.add(w);break;case"SpotLight":w=new f.SpotLightHelper(O),w.name=`${O.name}Helper`,R.set(O.name,w),D.add(w);break}}})},_=O=>{D.add(M),p(),ht(Te),k.remove(Te);const w=e.scenes.get(O.value.name);if(w!==void 0){const q=new w;e.onSceneSet!==void 0&&e.onSceneSet(q),Te=q,e.three.scene=Te,k.add(Te),Pt=!0,y()}},F=O=>{const w=O.value,q=e.three.scene?.getObjectByProperty("uuid",w.uuid);if(q!==void 0&&g.set(w.name,q),q instanceof f.PerspectiveCamera){const ie=new f.CameraHelper(q);E.set(q.name,ie),k.add(ie)}_e(Date.now())},ce=O=>{const w=E.get(O.value.name);w!==void 0&&(k.remove(w),w.dispose()),g.delete(O.value.name),_e(Date.now())},le=O=>{const w=Te.getObjectByProperty("uuid",O.value.uuid);w&&w.add(M)};return I.addEventListener(j.SET_SCENE,_),I.addEventListener(j.ADD_CAMERA,F),I.addEventListener(j.REMOVE_CAMERA,ce),I.addEventListener(j.SET_OBJECT,le),()=>{I.removeEventListener(j.SET_SCENE,_),I.removeEventListener(j.ADD_CAMERA,F),I.removeEventListener(j.REMOVE_CAMERA,ce),I.removeEventListener(j.SET_OBJECT,le)}},[]),S.useEffect(()=>{if(A===null)return;let p=window.innerWidth,y=window.innerHeight,_=Math.floor(p/2),F=Math.floor(y/2),ce=-1;const le=()=>{p=window.innerWidth-300,y=window.innerHeight,_=Math.floor(p/2),F=Math.floor(y/2),e.three.resize(p,y),e.onSceneResize!==void 0&&Pt&&e.onSceneResize(Te,p,y);let V=p,Z=y;switch(W){case"Side by Side":V=_,Z=y;break;case"Stacked":V=p,Z=F;break;case"Quad":V=_,Z=F;break}g.forEach(H=>{H instanceof f.OrthographicCamera?(H.left=V/-2,H.right=V/2,H.top=Z/2,H.bottom=Z/-2,H.name==="UI"&&(H.position.x=p/2,H.position.y=y/-2,H.position.z=100),H.updateProjectionMatrix()):H instanceof f.PerspectiveCamera&&(H.aspect=V/Z,H.updateProjectionMatrix(),E.get(H.name)?.update())})};function O(V){switch(V){case"Depth":return N;case"Normals":return J;case"Renderer":return null;case"UVs":return fe;case"Wireframe":return K}return null}const w=()=>{const V=O(it);k.overrideMaterial=V,A.setViewport(0,0,p,y),A.setScissor(0,0,p,y),A.render(k,X)},q=()=>{const V=O(it),Z=O(yt);if(k.overrideMaterial=V,W==="Side by Side")A.setViewport(0,0,_,y),A.setScissor(0,0,_,y),A.render(k,X),k.overrideMaterial=Z,A.setViewport(_,0,_,y),A.setScissor(_,0,_,y),A.render(k,he);else{const H=y-F;A.setViewport(0,H,p,F),A.setScissor(0,H,p,F),A.render(k,X),k.overrideMaterial=Z,A.setViewport(0,0,p,F),A.setScissor(0,0,p,F),A.render(k,he)}},ie=()=>{const V=O(it),Z=O(yt),H=O(nn),ke=O(an);let ue=0,de=0;de=y-F,ue=0,k.overrideMaterial=V,A.setViewport(ue,de,_,F),A.setScissor(ue,de,_,F),A.render(k,X),ue=_,k.overrideMaterial=Z,A.setViewport(ue,de,_,F),A.setScissor(ue,de,_,F),A.render(k,he),de=0,ue=0,k.overrideMaterial=H,A.setViewport(ue,de,_,F),A.setScissor(ue,de,_,F),A.render(k,Ge),ue=_,k.overrideMaterial=ke,A.setViewport(ue,de,_,F),A.setScissor(ue,de,_,F),A.render(k,He)},xe=()=>{switch(v.forEach(V=>{V.update()}),E.forEach(V=>{V.update()}),R.forEach(V=>{V.update!==void 0&&V.update()}),e.onSceneUpdate!==void 0&&Pt&&e.onSceneUpdate(Te),A.clear(),W){case"Single":w();break;case"Side by Side":case"Stacked":q();break;case"Quad":ie();break}ce=requestAnimationFrame(xe)};return st(),window.addEventListener("resize",le),le(),xe(),()=>{window.removeEventListener("resize",le),cancelAnimationFrame(ce),ce=-1}},[W,A]),S.useEffect(()=>{if(A!==null){const p=new f.Raycaster,y=new f.Vector2,_=(O,w,q,ie)=>{switch(W){case"Quad":O<q?w<ie?p.setFromCamera(y,X):p.setFromCamera(y,Ge):w<ie?p.setFromCamera(y,he):p.setFromCamera(y,He);break;case"Side by Side":O<q?p.setFromCamera(y,X):p.setFromCamera(y,he);break;case"Single":p.setFromCamera(y,X);break;case"Stacked":w<ie?p.setFromCamera(y,X):p.setFromCamera(y,he);break}},F=O=>{if(Fe==="Orbit")return;const w=new f.Vector2;A.getSize(w);const q=Math.min(O.clientX,w.x),ie=Math.min(O.clientY,w.y);y.x=rt(q,0,w.x,-1,1),y.y=rt(ie,0,w.y,1,-1);const xe=w.x/2,V=w.y/2,Z=()=>{q<xe?y.x=rt(q,0,xe,-1,1):y.x=rt(q,xe,w.x,-1,1)},H=()=>{ie<V?y.y=rt(ie,0,V,1,-1):y.y=rt(ie,V,w.y,1,-1)};switch(W){case"Quad":Z(),H();break;case"Side by Side":Z();break;case"Stacked":H(),H();break}_(q,ie,xe,V);const ke=p.intersectObjects(Te.children);ke.length>0&&z.position.copy(ke[0].point)},ce=O=>{if(Fe==="Orbit")return;const w=new f.Vector2;if(A.getSize(w),O.clientX>=w.x)return;F(O);const q=p.intersectObjects(Te.children);q.length>0&&(e.three.getObject(q[0].object.uuid),z.visible=!1,Qe("Orbit"),_e(Date.now()))},le=De.current;return le.addEventListener("mousemove",F,!1),le.addEventListener("click",ce,!1),()=>{le.removeEventListener("mousemove",F),le.removeEventListener("click",ce)}}},[W,A,Fe]);const be=[];return g.forEach((p,y)=>{be.push(y)}),l.jsxs("div",{className:"multiview",children:[l.jsx("canvas",{ref:Je}),A!==null&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`cameras ${W==="Single"||W==="Stacked"?"single":""}`,ref:De,children:[W==="Single"&&l.jsx(l.Fragment,{children:l.jsx(Ke,{camera:X,options:be,ref:oe,onSelectCamera:p=>{v.get(X.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),Q(y,oe.current))},onSelectRenderMode:p=>{it=p,localStorage.setItem(`${n}_tlRender`,p)}})}),(W==="Side by Side"||W==="Stacked")&&l.jsxs(l.Fragment,{children:[l.jsx(Ke,{camera:X,options:be,ref:oe,onSelectCamera:p=>{v.get(X.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),Q(y,oe.current))},onSelectRenderMode:p=>{it=p,localStorage.setItem(`${n}_tlRender`,p)}}),l.jsx(Ke,{camera:he,options:be,ref:ee,onSelectCamera:p=>{v.get(he.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(he),he=y,localStorage.setItem(`${n}_trCam`,y.name),Q(y,ee.current))},onSelectRenderMode:p=>{yt=p,localStorage.setItem(`${n}_trRender`,p)}})]}),W==="Quad"&&l.jsxs(l.Fragment,{children:[l.jsx(Ke,{camera:X,options:be,ref:oe,onSelectCamera:p=>{v.get(X.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(X),X=y,localStorage.setItem(`${n}_tlCam`,y.name),Q(y,oe.current))},onSelectRenderMode:p=>{it=p,localStorage.setItem(`${n}_tlRender`,p)}}),l.jsx(Ke,{camera:he,options:be,ref:ee,onSelectCamera:p=>{v.get(he.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(he),he=y,localStorage.setItem(`${n}_trCam`,y.name),Q(y,ee.current))},onSelectRenderMode:p=>{yt=p,localStorage.setItem(`${n}_trRender`,p)}}),l.jsx(Ke,{camera:Ge,options:be,ref:ge,onSelectCamera:p=>{v.get(Ge.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(Ge),Ge=y,localStorage.setItem(`${n}_blCam`,y.name),Q(y,ge.current))},onSelectRenderMode:p=>{nn=p,localStorage.setItem(`${n}_blRender`,p)}}),l.jsx(Ke,{camera:He,options:be,ref:Se,onSelectCamera:p=>{v.get(He.name)?.dispose();const y=g.get(p);y!==void 0&&(Ee(He),He=y,localStorage.setItem(`${n}_brCam`,y.name),Q(y,Se.current))},onSelectRenderMode:p=>{an=p,localStorage.setItem(`${n}_brRender`,p)}})]})]}),l.jsxs("div",{className:"settings",children:[l.jsx(Ct,{index:ye.indexOf(W),options:ye,onSelect:p=>{p!==W&&(et(),Ie(p))},open:Ae,onToggle:p=>{Ne(p),Ye&&Le(!1),Ue&&Be(!1)}}),l.jsx(Ct,{index:Fe==="Orbit"?0:1,options:["Orbit Mode","Selection Mode"],onSelect:p=>{z.visible=p==="Selection Mode",Qe(z.visible?"Selection":"Orbit")},open:Ue,onToggle:p=>{Ae&&Ne(!1),Ye&&Le(!1),Be(p)}})]},Ve)]})]})}function wa(e){return l.jsxs("div",{className:"editor",ref:e.ref,style:e.style,children:[l.jsx("div",{className:"header",children:e.header}),e.children,l.jsx("div",{className:"footer",children:e.footer})]})}exports.Accordion=Ot;exports.Application=Tn;exports.BaseRemote=ft;exports.ChildObject=Vt;exports.ContainerObject=pn;exports.Draggable=hn;exports.DraggableItem=dn;exports.Dropdown=fn;exports.DropdownItem=mn;exports.Editor=wa;exports.Inspector=bn;exports.MultiView=Ca;exports.NavButton=Bt;exports.RemoteComponents=_n;exports.RemoteController=$n;exports.RemoteTheatre=Mt;exports.RemoteThree=Nn;exports.RemoteTweakpane=Ln;exports.SceneInspector=ma;exports.SidePanel=fa;exports.ToolEvents=j;exports.capitalize=dt;exports.clamp=We;exports.colorToHex=cn;exports.debugDispatcher=I;exports.defaultTheatreCallback=Mn;exports.dispose=ht;exports.disposeMaterial=ln;exports.disposeTexture=Rn;exports.distance=On;exports.hierarchyUUID=xt;exports.isColor=on;exports.mix=jt;exports.noop=wt;exports.normalize=It;exports.randomID=sn;exports.resetThreeObjects=Lt;exports.round=Nt;exports.theatreEditorApp=kn;
|