@classcad/mcp 0.5.0 → 0.5.1
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/app/SOURCE.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Buerligons 2.0.0-beta.
|
|
1
|
+
Buerligons 2.0.0-beta.20261016112850 (npm: @buerli.io/buerligons, dist/mcp), taken on 2026-10-16
|
|
@@ -4919,7 +4919,7 @@ varying vec4 vColor;
|
|
|
4919
4919
|
void main() {
|
|
4920
4920
|
gl_FragColor = vColor;
|
|
4921
4921
|
gl_FragColor = gl_FragColor * texture2D(tex, gl_PointCoord);
|
|
4922
|
-
}`,mfe=e=>(0,K.jsxs)(`group`,{children:[(0,K.jsx)(hfe,{...e}),(0,K.jsx)(dfe,{...e})]}),hfe=e=>{let{productId:t,containerId:n,geometry:r,config:i}=e,a=W.useRef(null),o=i?.disabled===void 0||!i.disabled,s=W.useMemo(()=>{if(i?.meshes?.hidden)return[];let e={};for(let t of r.meshes){let n=t.color&&t.color.getHexString()||`__nocolor__`,a=e[n]||{geoms:[],mm:{},mg:null,lastIndex:0,color:t.color||r.color||i?.meshes?.color,opacity:o?t.opacity||r.opacity||i?.meshes?.opacity:.1,wireframe:i?.meshes?.wireframe!==void 0&&i.meshes.wireframe};e[n]=a,a.geoms.push(t)}return Object.keys(e).map(t=>{let n=0,r=e[t];for(let e of r.geoms){let t=e.geometry.getIndex()?.count;if(t)for(let i=0;i<t/3;i++)r.mm[n]=e,n++}return r.mg=Bg(r.geoms.map(e=>e.geometry)),r})},[i,r.meshes,r.color,r.opacity,o]),c=W.useMemo(()=>{if(i?.edges?.hidden)return[];let e={},t=[...r.lines,...r.edges,...r.arcs];for(let n of t){let t=n.color&&n.color.getHexString()||`__nocolor__`,r=e[t]||{geoms:[],lm:{},lg:null,color:n.color||i?.edges?.color,opacity:n.opacity||i?.edges?.opacity||1};e[t]=r,r.geoms.push(n)}return Object.keys(e).map(t=>{let n=0,r=e[t];for(let e of r.geoms){let t=e.geometry.attributes.position.count;if(t)for(let i=0;i<t;i++)r.lm[n]=e,n++}return r.lg=Bg(r.geoms.map(e=>e.geometry)),r})},[i,r.arcs,r.edges,r.lines]);return W.useEffect(()=>()=>s.forEach(e=>e.mg?.dispose()),[s]),W.useEffect(()=>()=>c.forEach(e=>e.lg?.dispose()),[c]),(0,K.jsxs)(`group`,{ref:a,name:`${r.graphicId}|${t}`,children:[s.length>0&&s.map((e,r)=>e.mg?(0,K.jsx)(`mesh`,{geometry:e.mg,renderOrder:o?50:0,userData:{meshMap:e.mm,isBuerliGeometry:o,productId:t,containerId:n},children:(0,K.jsx)(`meshLambertMaterial`,{name:`buerli-body`,opacity:e.opacity,color:e.color,polygonOffset:!e.wireframe,polygonOffsetFactor:1,polygonOffsetUnits:1,side:o?2:0,transparent:e.opacity<1,depthWrite:i?.meshes?.depthWrite===void 0||i?.meshes?.depthWrite,wireframe:e.wireframe})},r):null),c.length>0&&c.map((e,r)=>e.lg?(0,K.jsx)(`lineSegments`,{geometry:e.lg,renderOrder:o?150:100,userData:{lineMap:e.lm,isBuerliGeometry:o,productId:t,containerId:n},children:(0,K.jsx)(`lineBasicMaterial`,{transparent:e.opacity<1,opacity:e.opacity,color:e.color})},r):null)]})},gfe=({name:e,coordinateSystem:t,children:n})=>{let r=W.useMemo(()=>t?cg.convertToMatrix4(t):new Ei,[t]);return(0,K.jsx)(`group`,{name:e||``,matrix:r,matrixAutoUpdate:!1,children:n})};dT({Line_:yc});var _fe=mfe,vfe=gfe,yfe=({drawingId:e,solidId:t,productId:n})=>{let r=Yy(e=>e.options.config.geometry),i=G(e,e=>e.geometry.cache[t]),a=G(e,e=>e.geometry.config.product[n]),o=G(e,e=>e.geometry.config.product[t]),s=W.useMemo(()=>ofe.all([r,a||{},o||{}]),[r,a,o]),c=i?.container?.ownerId??0,l=G(e,e=>e.structure.tree[c]?.name);return i&&i.type===w.BREP?(0,K.jsx)(`group`,{name:l,userData:{id:c},children:(0,K.jsx)(`group`,{name:`${t}`,userData:{id:t},children:(0,K.jsx)(_fe,{drawingId:e,containerId:t,productId:n,geometry:i,config:s},i.dirtyStamp||-1)})}):null},bfe=({drawingId:e,partId:t,productId:n})=>{let r=G(e,e=>e.structure.tree[t]);return r?(0,K.jsx)(`group`,{name:r.name,userData:{id:r.id},children:Array.isArray(r.solids)?r.solids.map(t=>(0,K.jsx)(yfe,{productId:n,solidId:t,drawingId:e},t)):null}):null},oE=W.memo(({drawingId:e,isRoot:t=!1,productId:n,children:r})=>{let i=G(e,e=>e.structure.root),a=(t&&n===void 0?i:n)||0,o=G(e,e=>e.structure.tree[a]);return o?(0,K.jsx)(K.Fragment,{children:t?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(aE,{drawingId:e,objectId:a,children:(0,K.jsx)(xfe,{obj:o,drawingId:e,children:r})})}):(0,K.jsx)(vfe,{coordinateSystem:o.coordinateSystem,children:(0,K.jsx)(xfe,{obj:o,drawingId:e,children:r})})}):null});function xfe({obj:e,drawingId:t,children:n}){let r=null;return r=Array.isArray(e.geometryIdList)?e.geometryIdList.map(n=>(0,K.jsx)(yfe,{productId:e.id,solidId:n,drawingId:t},n)):Array.isArray(e.solids)?(0,K.jsx)(bfe,{partId:e.id,productId:e.id,drawingId:t}):e.link===void 0?e.children?e.children.map(e=>(0,K.jsx)(oE,{productId:e,drawingId:t,children:n},e)):null:(0,K.jsx)(bfe,{partId:e.link,productId:e.id,drawingId:t}),n||r?(0,K.jsx)(`group`,{name:e.name,userData:{id:e.id},children:n?n({node:r,object:e}):r}):null}var Sfe=!1,Cfe=W.memo(e=>{let{selection:t=!1,drawingId:n,suspend:r=!1}=e,i=Yy(e=>e.drawing.active),a=n??i;Array.isArray(r)&&Sfe===!1&&(console.warn(`Array notation for <BuerliGeometry suspend={[".Load", ".SetDatabaseSettings", ...]}> is deprecated. Use <BuerliGeometry suspend=".Load,.SetDatabaseSettings" /> instead.`),Sfe=!0);let o=G(a,e=>e.cad.pending),s=typeof r==`string`?r.split(`,`):Array.isArray(r)?r:[],c=typeof r==`function`?r:e=>typeof r==`boolean`?r:s.find(t=>e.name.includes(t)),l=(o?.filter(e=>e.promise&&c(e))??[]).map(e=>e.promise);return r&&dse(()=>Promise.all(l),[`buerli/react/BuerliGeometry`,...l]),a===null?null:t?(0,K.jsx)(afe,{drawingId:a,children:(0,K.jsx)(oE,{...e,drawingId:a,isRoot:!0})}):(0,K.jsx)(oE,{...e,drawingId:a,isRoot:!0})}),wfe=(e,t)=>W.useMemo(()=>{let n=H(e);if(!t||!n)return[];let r=n.structure.tree,i=t,a=[];for(;i&&r[i];)a.push(r[i].parent),i=r[i].parent;return a},[e,t]),Tfe=e=>{let{drawingId:t,pluginId:n,showOnlyActive:r=!0}=e,i=wfe(t,bw(t,n,e=>e.objectId)),a=G(t,e=>e.structure.currentProduct)||-1,o=i.indexOf(a)!==-1,s=G(t,e=>e.plugin.visible)||[],c=G(t,e=>e.plugin.active.global)||[],l=G(t,e=>e.plugin.active.feature);return(!r||o)&&s.indexOf(n)>=0||c.indexOf(n)>=0||n===l?(0,K.jsx)(mue,{drawingId:t,pluginId:n,view:!0}):null},Efe=[];function Dfe(e){let t=G(e,e=>e.plugin.feature)||Efe,n=G(e,e=>e.plugin.global)||Efe;return W.useMemo(()=>{let e=[...t,...n];return e.filter((t,n)=>e.findIndex(e=>e===t)===n)},[t,n])}var Ofe=W.memo(e=>{let{drawingId:t,showOnlyActive:n=!0}=e,r=Yy(e=>e.drawing.active),i=t??r,a=Dfe(i);return(0,K.jsx)(K.Fragment,{children:a?.map(e=>(0,K.jsx)(Tfe,{drawingId:i,pluginId:e,showOnlyActive:n},e))})}),sE={Entity:nE,Loop:Yde,Mesh:rE,Point:iE,Spline:tE},cE=e=>{let t=W.useRef(e);return t.current=e,W.useCallback((...e)=>t.current?.(...e),[])};function lE(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}var kfe=lE()?W.useLayoutEffect:W.useEffect,uE=(e,t)=>{let n=W.useRef(!0);kfe(()=>e(n.current),t),kfe(()=>(n.current=!1,()=>{n.current=!0}),[])},Afe=(e,t)=>{uE(t=>{if(!t)return e()},t)},jfe=e=>{let t=W.useRef(!1),[n,r]=W.useState(e);W.useEffect(()=>(t.current=!1,()=>{t.current=!0}),[]);function i(e,n){n&&t.current||r(e)}return[n,i]};function dE(e,t){let[n,r]=(0,W.useState)(e),i=t===void 0?n:t;return uE(e=>{e||r(t)},[t]),[i,r]}var Mfe=e=>+setTimeout(e,16),Nfe=e=>clearTimeout(e);typeof window<`u`&&`requestAnimationFrame`in window&&(Mfe=e=>window.requestAnimationFrame(e),Nfe=e=>window.cancelAnimationFrame(e));var Pfe=0,fE=new Map;function Ffe(e){fE.delete(e)}var pE=(e,t=1)=>{Pfe+=1;let n=Pfe;function r(t){if(t===0)Ffe(n),e();else{let e=Mfe(()=>{r(t-1)});fE.set(n,e)}}return r(t),n};pE.cancel=e=>{let t=fE.get(e);return Ffe(e),Nfe(t)};function mE(e){let[t,n]=W.useState(e),r=W.useRef(null),i=cE(()=>{if(r.current){let[e,t]=r.current;e?pE.cancel(t):clearTimeout(t),r.current=null}});return[t,cE((e,t)=>{let a=t||{frame:1};i(),a===!0?n(e):`ms`in a?r.current=[!1,setTimeout(()=>n(e),a.ms)]:r.current=[!0,pE(()=>n(e),a.frame)]})]}function Ife(){return{...W}.useId}var Lfe=0,Rfe=Ife(),hE=Rfe?function(e){let t=Rfe();return e||t}:function(e){let[t,n]=W.useState(`ssr-id`);return W.useEffect(()=>{let e=Lfe;Lfe+=1,n(`rc_unique_${e}`)},[]),e||t};function gE(e,t,n){let r=W.useRef({});return(!(`value`in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}function zfe(e){let[,t]=W.useReducer(e=>e+1,0),n=W.useRef(e);return[cE(()=>n.current),cE(e=>{n.current=typeof e==`function`?e(n.current):e,t()})]}var Bfe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.ForwardRef=c,e.isMemo=function(e){return m(e)===d}})),Vfe=o(((e,t)=>{t.exports=Bfe()})),Hfe=Symbol.for(`react.element`),Ufe=Symbol.for(`react.transitional.element`),Wfe=Symbol.for(`react.fragment`);function Gfe(e){return e&&typeof e==`object`&&(e.$$typeof===Hfe||e.$$typeof===Ufe)&&e.type===Wfe}var _E=Vfe(),Kfe=Number(W.version.split(`.`)[0]),qfe=(e,t)=>{typeof e==`function`?e(t):typeof e==`object`&&e&&`current`in e&&(e.current=t)},vE=(...e)=>{let t=e.filter(Boolean);return t.length<=1?t[0]:t=>{e.forEach(e=>{qfe(e,t)})}},yE=(...e)=>gE(()=>vE(...e),e,(e,t)=>e.length!==t.length||e.every((e,n)=>e!==t[n])),bE=e=>{if(!e)return!1;if(xE(e)&&Kfe>=19)return!0;let t=(0,_E.isMemo)(e)?e.type.type:e.type;return!(typeof t==`function`&&!t.prototype?.render&&t.$$typeof!==_E.ForwardRef||typeof e==`function`&&!e.prototype?.render&&e.$$typeof!==_E.ForwardRef)};function xE(e){return(0,W.isValidElement)(e)&&!Gfe(e)}var Jfe=e=>xE(e)&&bE(e),SE=e=>{if(e&&xE(e)){let t=e;return t.props.propertyIsEnumerable(`ref`)?t.props.ref:t.ref}return null};function CE(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}var Yfe=`data-rc-order`,Xfe=`data-rc-priority`,Zfe=`rc-util-key`,wE=new Map;function Qfe({mark:e}={}){return e?e.startsWith(`data-`)?e:`data-${e}`:Zfe}function TE(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function $fe(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function EE(e){return Array.from((wE.get(e)||e).children).filter(e=>e.tagName===`STYLE`)}function epe(e,t={}){if(!lE())return null;let{csp:n,prepend:r,priority:i=0}=t,a=$fe(r),o=a===`prependQueue`,s=document.createElement(`style`);s.setAttribute(Yfe,a),o&&i&&s.setAttribute(Xfe,`${i}`),n?.nonce&&(s.nonce=n?.nonce),s.innerHTML=e;let c=TE(t),{firstChild:l}=c;if(r){if(o){let e=(t.styles||EE(c)).filter(e=>{if(![`prepend`,`prependQueue`].includes(e.getAttribute(Yfe)))return!1;let t=Number(e.getAttribute(Xfe)||0);return i>=t});if(e.length)return c.insertBefore(s,e[e.length-1].nextSibling),s}c.insertBefore(s,l)}else c.appendChild(s);return s}function tpe(e,t={}){let{styles:n}=t;return n||=EE(TE(t)),n.find(n=>n.getAttribute(Qfe(t))===e)}function DE(e,t={}){let n=tpe(e,t);n&&TE(t).removeChild(n)}function npe(e,t){let n=wE.get(e);if(!n||!CE(document,n)){let n=epe(``,t),{parentNode:r}=n;wE.set(e,r),e.removeChild(n)}}function OE(e,t,n={}){let r=TE(n),i=EE(r),a={...n,styles:i};npe(r,a);let o=tpe(t,a);if(o)return a.csp?.nonce&&o.nonce!==a.csp?.nonce&&(o.nonce=a.csp?.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;let s=epe(e,a);return s.setAttribute(Qfe(a),t),s}function kE(e){return e instanceof HTMLElement||e instanceof SVGElement}function AE(e){return e&&typeof e==`object`&&kE(e.nativeElement)?e.nativeElement:kE(e)?e:null}var jE=(e=>{if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){let{width:t,height:n}=e.getBBox();if(t||n)return!0}if(e.getBoundingClientRect){let{width:t,height:n}=e.getBoundingClientRect();if(t||n)return!0}}return!1});function rpe(e,t=!1){if(jE(e)){let n=e.nodeName.toLowerCase(),r=[`input`,`select`,`textarea`,`button`].includes(n)||e.isContentEditable||n===`a`&&!!e.getAttribute(`href`),i=e.getAttribute(`tabindex`),a=Number(i),o=null;return i&&!Number.isNaN(a)?o=a:r&&o===null&&(o=0),r&&e.disabled&&(o=null),o!==null&&(o>=0||t&&o<0)}return!1}function ME(e,t=!1){let n=[...e.querySelectorAll(`*`)].filter(e=>rpe(e,t));return rpe(e,t)&&n.unshift(e),n}function ipe(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){let t=e.value.length;switch(n){case`start`:e.setSelectionRange(0,0);break;case`end`:e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var NE=null,PE=[],FE=new Map,IE=new Map;function LE(){return PE[PE.length-1]}function ape(e){let t=LE();if(e&&t){let n;for(let[e,r]of FE.entries())if(r===t){n=e;break}let r=IE.get(n);return!!r&&(r===e||r.contains(e))}return!1}function ope(e){let{activeElement:t}=document;return e===t||e.contains(t)}function RE(){let e=LE(),{activeElement:t}=document;if(!ape(t)){if(e&&!ope(e)){let t=ME(e);(t.includes(NE)?NE:t[0])?.focus({preventScroll:!0})}else NE=t}}function spe(e){if(e.key===`Tab`){let{activeElement:t}=document,n=ME(LE()),r=n[n.length-1];e.shiftKey&&t===n[0]?NE=r:!e.shiftKey&&t===r&&(NE=n[0])}}function cpe(e,t){return e&&(FE.set(t,e),PE=PE.filter(t=>t!==e),PE.push(e),window.addEventListener(`focusin`,RE),window.addEventListener(`keydown`,spe,!0),RE()),()=>{NE=null,PE=PE.filter(t=>t!==e),FE.delete(t),IE.delete(t),PE.length===0&&(window.removeEventListener(`focusin`,RE),window.removeEventListener(`keydown`,spe,!0))}}function lpe(e,t){let n=(0,W.useRef)(0),[r,i]=(0,W.useState)(0);(0,W.useEffect)(()=>{n.current=0},t),(0,W.useEffect)(()=>{let[t,r]=e(n.current);return r||(n.current+=1,i(e=>e+1)),t},[...t,r])}function upe(e,t){let n=hE(),r=(0,W.useRef)(t);return r.current=t,lpe(t=>{if(!e)return[void 0,!0];let i=r.current();return i?[cpe(i,n),!0]:[void 0,t>=1]},[n,e]),[e=>{e&&IE.set(n,e)}]}function dpe(e){return e?.getRootNode?.()}function fpe(e){return dpe(e)instanceof ShadowRoot}function zE(e){return fpe(e)?dpe(e):null}var BE={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){let{keyCode:t}=e;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=BE.F1&&t<=BE.F12)return!1;switch(t){case BE.ALT:case BE.CAPS_LOCK:case BE.CONTEXT_MENU:case BE.CTRL:case BE.DOWN:case BE.END:case BE.ESC:case BE.HOME:case BE.INSERT:case BE.LEFT:case BE.MAC_FF_META:case BE.META:case BE.NUMLOCK:case BE.NUM_CENTER:case BE.PAGE_DOWN:case BE.PAGE_UP:case BE.PAUSE:case BE.PRINT_SCREEN:case BE.RIGHT:case BE.SHIFT:case BE.UP:case BE.WIN_KEY:case BE.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=BE.ZERO&&e<=BE.NINE||e>=BE.NUM_ZERO&&e<=BE.NUM_MULTIPLY||e>=BE.A&&e<=BE.Z||window.navigator.userAgent.indexOf(`WebKit`)!==-1&&e===0)return!0;switch(e){case BE.SPACE:case BE.QUESTION_MARK:case BE.NUM_PLUS:case BE.NUM_MINUS:case BE.NUM_PERIOD:case BE.NUM_DIVISION:case BE.SEMICOLON:case BE.DASH:case BE.EQUALS:case BE.COMMA:case BE.PERIOD:case BE.SLASH:case BE.APOSTROPHE:case BE.SINGLE_QUOTE:case BE.OPEN_SQUARE_BRACKET:case BE.BACKSLASH:case BE.CLOSE_SQUARE_BRACKET:return!0;default:return!1}},isEditableTarget:function(e){let t=e.target;if(!(t instanceof HTMLElement))return!1;let n=t.tagName;return!!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)}};function ppe(e){let t=`rc-scrollbar-measure-${Math.random().toString(36).substring(7)}`,n=document.createElement(`div`);n.id=t;let r=n.style;r.position=`absolute`,r.left=`0`,r.top=`0`,r.width=`100px`,r.height=`100px`,r.overflow=`scroll`;let i,a;if(e){let n=getComputedStyle(e);r.scrollbarColor=n.scrollbarColor,r.scrollbarWidth=n.scrollbarWidth;let o=getComputedStyle(e,`::-webkit-scrollbar`),s=parseInt(o.width,10),c=parseInt(o.height,10);try{OE(`
|
|
4922
|
+
}`,mfe=e=>(0,K.jsxs)(`group`,{children:[(0,K.jsx)(hfe,{...e}),(0,K.jsx)(dfe,{...e})]}),hfe=e=>{let{productId:t,containerId:n,geometry:r,config:i}=e,a=W.useRef(null),o=i?.disabled===void 0||!i.disabled,s=W.useMemo(()=>{if(i?.meshes?.hidden)return[];let e={};for(let t of r.meshes){let n=t.color&&t.color.getHexString()||`__nocolor__`,a=e[n]||{geoms:[],mm:{},mg:null,lastIndex:0,color:t.color||r.color||i?.meshes?.color,opacity:o?t.opacity||r.opacity||i?.meshes?.opacity:.1,wireframe:i?.meshes?.wireframe!==void 0&&i.meshes.wireframe};e[n]=a,a.geoms.push(t)}return Object.keys(e).map(t=>{let n=0,r=e[t];for(let e of r.geoms){let t=e.geometry.getIndex()?.count;if(t)for(let i=0;i<t/3;i++)r.mm[n]=e,n++}return r.mg=Bg(r.geoms.map(e=>e.geometry)),r})},[i,r.meshes,r.color,r.opacity,o]),c=!!i?.edges?.hidden,l=W.useMemo(()=>{let e={},t=[...r.lines,...r.edges,...r.arcs];for(let n of t){let t=n.color&&n.color.getHexString()||`__nocolor__`,r=e[t]||{geoms:[],lm:{},lg:null,color:n.color||i?.edges?.color,opacity:n.opacity||i?.edges?.opacity||1};e[t]=r,r.geoms.push(n)}return Object.keys(e).map(t=>{let n=0,r=e[t];for(let e of r.geoms){let t=e.geometry.attributes.position.count;if(t)for(let i=0;i<t;i++)r.lm[n]=e,n++}return r.lg=Bg(r.geoms.map(e=>e.geometry)),r})},[i,r.arcs,r.edges,r.lines]);return W.useEffect(()=>()=>s.forEach(e=>e.mg?.dispose()),[s]),W.useEffect(()=>()=>l.forEach(e=>e.lg?.dispose()),[l]),(0,K.jsxs)(`group`,{ref:a,name:`${r.graphicId}|${t}`,children:[s.length>0&&s.map((e,r)=>e.mg?(0,K.jsx)(`mesh`,{geometry:e.mg,renderOrder:o?50:0,userData:{meshMap:e.mm,isBuerliGeometry:o,productId:t,containerId:n},children:(0,K.jsx)(`meshLambertMaterial`,{name:`buerli-body`,opacity:e.opacity,color:e.color,polygonOffset:!e.wireframe,polygonOffsetFactor:1,polygonOffsetUnits:1,side:o?2:0,transparent:e.opacity<1,depthWrite:i?.meshes?.depthWrite===void 0||i?.meshes?.depthWrite,wireframe:e.wireframe})},r):null),l.length>0&&l.map((e,r)=>e.lg?(0,K.jsx)(`lineSegments`,{geometry:e.lg,renderOrder:o?150:100,userData:{lineMap:e.lm,isBuerliGeometry:o,productId:t,containerId:n,hidden:c},children:(0,K.jsx)(`lineBasicMaterial`,{visible:!c,transparent:e.opacity<1,opacity:e.opacity,color:e.color})},r):null)]})},gfe=({name:e,coordinateSystem:t,children:n})=>{let r=W.useMemo(()=>t?cg.convertToMatrix4(t):new Ei,[t]);return(0,K.jsx)(`group`,{name:e||``,matrix:r,matrixAutoUpdate:!1,children:n})};dT({Line_:yc});var _fe=mfe,vfe=gfe,yfe=({drawingId:e,solidId:t,productId:n})=>{let r=Yy(e=>e.options.config.geometry),i=G(e,e=>e.geometry.cache[t]),a=G(e,e=>e.geometry.config.product[n]),o=G(e,e=>e.geometry.config.product[t]),s=W.useMemo(()=>ofe.all([r,a||{},o||{}]),[r,a,o]),c=i?.container?.ownerId??0,l=G(e,e=>e.structure.tree[c]?.name);return i&&i.type===w.BREP?(0,K.jsx)(`group`,{name:l,userData:{id:c},children:(0,K.jsx)(`group`,{name:`${t}`,userData:{id:t},children:(0,K.jsx)(_fe,{drawingId:e,containerId:t,productId:n,geometry:i,config:s},i.dirtyStamp||-1)})}):null},bfe=({drawingId:e,partId:t,productId:n})=>{let r=G(e,e=>e.structure.tree[t]);return r?(0,K.jsx)(`group`,{name:r.name,userData:{id:r.id},children:Array.isArray(r.solids)?r.solids.map(t=>(0,K.jsx)(yfe,{productId:n,solidId:t,drawingId:e},t)):null}):null},oE=W.memo(({drawingId:e,isRoot:t=!1,productId:n,children:r})=>{let i=G(e,e=>e.structure.root),a=(t&&n===void 0?i:n)||0,o=G(e,e=>e.structure.tree[a]);return o?(0,K.jsx)(K.Fragment,{children:t?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(aE,{drawingId:e,objectId:a,children:(0,K.jsx)(xfe,{obj:o,drawingId:e,children:r})})}):(0,K.jsx)(vfe,{coordinateSystem:o.coordinateSystem,children:(0,K.jsx)(xfe,{obj:o,drawingId:e,children:r})})}):null});function xfe({obj:e,drawingId:t,children:n}){let r=null;return r=Array.isArray(e.geometryIdList)?e.geometryIdList.map(n=>(0,K.jsx)(yfe,{productId:e.id,solidId:n,drawingId:t},n)):Array.isArray(e.solids)?(0,K.jsx)(bfe,{partId:e.id,productId:e.id,drawingId:t}):e.link===void 0?e.children?e.children.map(e=>(0,K.jsx)(oE,{productId:e,drawingId:t,children:n},e)):null:(0,K.jsx)(bfe,{partId:e.link,productId:e.id,drawingId:t}),n||r?(0,K.jsx)(`group`,{name:e.name,userData:{id:e.id},children:n?n({node:r,object:e}):r}):null}var Sfe=!1,Cfe=W.memo(e=>{let{selection:t=!1,drawingId:n,suspend:r=!1}=e,i=Yy(e=>e.drawing.active),a=n??i;Array.isArray(r)&&Sfe===!1&&(console.warn(`Array notation for <BuerliGeometry suspend={[".Load", ".SetDatabaseSettings", ...]}> is deprecated. Use <BuerliGeometry suspend=".Load,.SetDatabaseSettings" /> instead.`),Sfe=!0);let o=G(a,e=>e.cad.pending),s=typeof r==`string`?r.split(`,`):Array.isArray(r)?r:[],c=typeof r==`function`?r:e=>typeof r==`boolean`?r:s.find(t=>e.name.includes(t)),l=(o?.filter(e=>e.promise&&c(e))??[]).map(e=>e.promise);return r&&dse(()=>Promise.all(l),[`buerli/react/BuerliGeometry`,...l]),a===null?null:t?(0,K.jsx)(afe,{drawingId:a,children:(0,K.jsx)(oE,{...e,drawingId:a,isRoot:!0})}):(0,K.jsx)(oE,{...e,drawingId:a,isRoot:!0})}),wfe=(e,t)=>W.useMemo(()=>{let n=H(e);if(!t||!n)return[];let r=n.structure.tree,i=t,a=[];for(;i&&r[i];)a.push(r[i].parent),i=r[i].parent;return a},[e,t]),Tfe=e=>{let{drawingId:t,pluginId:n,showOnlyActive:r=!0}=e,i=wfe(t,bw(t,n,e=>e.objectId)),a=G(t,e=>e.structure.currentProduct)||-1,o=i.indexOf(a)!==-1,s=G(t,e=>e.plugin.visible)||[],c=G(t,e=>e.plugin.active.global)||[],l=G(t,e=>e.plugin.active.feature);return(!r||o)&&s.indexOf(n)>=0||c.indexOf(n)>=0||n===l?(0,K.jsx)(mue,{drawingId:t,pluginId:n,view:!0}):null},Efe=[];function Dfe(e){let t=G(e,e=>e.plugin.feature)||Efe,n=G(e,e=>e.plugin.global)||Efe;return W.useMemo(()=>{let e=[...t,...n];return e.filter((t,n)=>e.findIndex(e=>e===t)===n)},[t,n])}var Ofe=W.memo(e=>{let{drawingId:t,showOnlyActive:n=!0}=e,r=Yy(e=>e.drawing.active),i=t??r,a=Dfe(i);return(0,K.jsx)(K.Fragment,{children:a?.map(e=>(0,K.jsx)(Tfe,{drawingId:i,pluginId:e,showOnlyActive:n},e))})}),sE={Entity:nE,Loop:Yde,Mesh:rE,Point:iE,Spline:tE},cE=e=>{let t=W.useRef(e);return t.current=e,W.useCallback((...e)=>t.current?.(...e),[])};function lE(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}var kfe=lE()?W.useLayoutEffect:W.useEffect,uE=(e,t)=>{let n=W.useRef(!0);kfe(()=>e(n.current),t),kfe(()=>(n.current=!1,()=>{n.current=!0}),[])},Afe=(e,t)=>{uE(t=>{if(!t)return e()},t)},jfe=e=>{let t=W.useRef(!1),[n,r]=W.useState(e);W.useEffect(()=>(t.current=!1,()=>{t.current=!0}),[]);function i(e,n){n&&t.current||r(e)}return[n,i]};function dE(e,t){let[n,r]=(0,W.useState)(e),i=t===void 0?n:t;return uE(e=>{e||r(t)},[t]),[i,r]}var Mfe=e=>+setTimeout(e,16),Nfe=e=>clearTimeout(e);typeof window<`u`&&`requestAnimationFrame`in window&&(Mfe=e=>window.requestAnimationFrame(e),Nfe=e=>window.cancelAnimationFrame(e));var Pfe=0,fE=new Map;function Ffe(e){fE.delete(e)}var pE=(e,t=1)=>{Pfe+=1;let n=Pfe;function r(t){if(t===0)Ffe(n),e();else{let e=Mfe(()=>{r(t-1)});fE.set(n,e)}}return r(t),n};pE.cancel=e=>{let t=fE.get(e);return Ffe(e),Nfe(t)};function mE(e){let[t,n]=W.useState(e),r=W.useRef(null),i=cE(()=>{if(r.current){let[e,t]=r.current;e?pE.cancel(t):clearTimeout(t),r.current=null}});return[t,cE((e,t)=>{let a=t||{frame:1};i(),a===!0?n(e):`ms`in a?r.current=[!1,setTimeout(()=>n(e),a.ms)]:r.current=[!0,pE(()=>n(e),a.frame)]})]}function Ife(){return{...W}.useId}var Lfe=0,Rfe=Ife(),hE=Rfe?function(e){let t=Rfe();return e||t}:function(e){let[t,n]=W.useState(`ssr-id`);return W.useEffect(()=>{let e=Lfe;Lfe+=1,n(`rc_unique_${e}`)},[]),e||t};function gE(e,t,n){let r=W.useRef({});return(!(`value`in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}function zfe(e){let[,t]=W.useReducer(e=>e+1,0),n=W.useRef(e);return[cE(()=>n.current),cE(e=>{n.current=typeof e==`function`?e(n.current):e,t()})]}var Bfe=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.ForwardRef=c,e.isMemo=function(e){return m(e)===d}})),Vfe=o(((e,t)=>{t.exports=Bfe()})),Hfe=Symbol.for(`react.element`),Ufe=Symbol.for(`react.transitional.element`),Wfe=Symbol.for(`react.fragment`);function Gfe(e){return e&&typeof e==`object`&&(e.$$typeof===Hfe||e.$$typeof===Ufe)&&e.type===Wfe}var _E=Vfe(),Kfe=Number(W.version.split(`.`)[0]),qfe=(e,t)=>{typeof e==`function`?e(t):typeof e==`object`&&e&&`current`in e&&(e.current=t)},vE=(...e)=>{let t=e.filter(Boolean);return t.length<=1?t[0]:t=>{e.forEach(e=>{qfe(e,t)})}},yE=(...e)=>gE(()=>vE(...e),e,(e,t)=>e.length!==t.length||e.every((e,n)=>e!==t[n])),bE=e=>{if(!e)return!1;if(xE(e)&&Kfe>=19)return!0;let t=(0,_E.isMemo)(e)?e.type.type:e.type;return!(typeof t==`function`&&!t.prototype?.render&&t.$$typeof!==_E.ForwardRef||typeof e==`function`&&!e.prototype?.render&&e.$$typeof!==_E.ForwardRef)};function xE(e){return(0,W.isValidElement)(e)&&!Gfe(e)}var Jfe=e=>xE(e)&&bE(e),SE=e=>{if(e&&xE(e)){let t=e;return t.props.propertyIsEnumerable(`ref`)?t.props.ref:t.ref}return null};function CE(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}var Yfe=`data-rc-order`,Xfe=`data-rc-priority`,Zfe=`rc-util-key`,wE=new Map;function Qfe({mark:e}={}){return e?e.startsWith(`data-`)?e:`data-${e}`:Zfe}function TE(e){return e.attachTo?e.attachTo:document.querySelector(`head`)||document.body}function $fe(e){return e===`queue`?`prependQueue`:e?`prepend`:`append`}function EE(e){return Array.from((wE.get(e)||e).children).filter(e=>e.tagName===`STYLE`)}function epe(e,t={}){if(!lE())return null;let{csp:n,prepend:r,priority:i=0}=t,a=$fe(r),o=a===`prependQueue`,s=document.createElement(`style`);s.setAttribute(Yfe,a),o&&i&&s.setAttribute(Xfe,`${i}`),n?.nonce&&(s.nonce=n?.nonce),s.innerHTML=e;let c=TE(t),{firstChild:l}=c;if(r){if(o){let e=(t.styles||EE(c)).filter(e=>{if(![`prepend`,`prependQueue`].includes(e.getAttribute(Yfe)))return!1;let t=Number(e.getAttribute(Xfe)||0);return i>=t});if(e.length)return c.insertBefore(s,e[e.length-1].nextSibling),s}c.insertBefore(s,l)}else c.appendChild(s);return s}function tpe(e,t={}){let{styles:n}=t;return n||=EE(TE(t)),n.find(n=>n.getAttribute(Qfe(t))===e)}function DE(e,t={}){let n=tpe(e,t);n&&TE(t).removeChild(n)}function npe(e,t){let n=wE.get(e);if(!n||!CE(document,n)){let n=epe(``,t),{parentNode:r}=n;wE.set(e,r),e.removeChild(n)}}function OE(e,t,n={}){let r=TE(n),i=EE(r),a={...n,styles:i};npe(r,a);let o=tpe(t,a);if(o)return a.csp?.nonce&&o.nonce!==a.csp?.nonce&&(o.nonce=a.csp?.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;let s=epe(e,a);return s.setAttribute(Qfe(a),t),s}function kE(e){return e instanceof HTMLElement||e instanceof SVGElement}function AE(e){return e&&typeof e==`object`&&kE(e.nativeElement)?e.nativeElement:kE(e)?e:null}var jE=(e=>{if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){let{width:t,height:n}=e.getBBox();if(t||n)return!0}if(e.getBoundingClientRect){let{width:t,height:n}=e.getBoundingClientRect();if(t||n)return!0}}return!1});function rpe(e,t=!1){if(jE(e)){let n=e.nodeName.toLowerCase(),r=[`input`,`select`,`textarea`,`button`].includes(n)||e.isContentEditable||n===`a`&&!!e.getAttribute(`href`),i=e.getAttribute(`tabindex`),a=Number(i),o=null;return i&&!Number.isNaN(a)?o=a:r&&o===null&&(o=0),r&&e.disabled&&(o=null),o!==null&&(o>=0||t&&o<0)}return!1}function ME(e,t=!1){let n=[...e.querySelectorAll(`*`)].filter(e=>rpe(e,t));return rpe(e,t)&&n.unshift(e),n}function ipe(e,t){if(!e)return;e.focus(t);let{cursor:n}=t||{};if(n&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){let t=e.value.length;switch(n){case`start`:e.setSelectionRange(0,0);break;case`end`:e.setSelectionRange(t,t);break;default:e.setSelectionRange(0,t)}}}var NE=null,PE=[],FE=new Map,IE=new Map;function LE(){return PE[PE.length-1]}function ape(e){let t=LE();if(e&&t){let n;for(let[e,r]of FE.entries())if(r===t){n=e;break}let r=IE.get(n);return!!r&&(r===e||r.contains(e))}return!1}function ope(e){let{activeElement:t}=document;return e===t||e.contains(t)}function RE(){let e=LE(),{activeElement:t}=document;if(!ape(t)){if(e&&!ope(e)){let t=ME(e);(t.includes(NE)?NE:t[0])?.focus({preventScroll:!0})}else NE=t}}function spe(e){if(e.key===`Tab`){let{activeElement:t}=document,n=ME(LE()),r=n[n.length-1];e.shiftKey&&t===n[0]?NE=r:!e.shiftKey&&t===r&&(NE=n[0])}}function cpe(e,t){return e&&(FE.set(t,e),PE=PE.filter(t=>t!==e),PE.push(e),window.addEventListener(`focusin`,RE),window.addEventListener(`keydown`,spe,!0),RE()),()=>{NE=null,PE=PE.filter(t=>t!==e),FE.delete(t),IE.delete(t),PE.length===0&&(window.removeEventListener(`focusin`,RE),window.removeEventListener(`keydown`,spe,!0))}}function lpe(e,t){let n=(0,W.useRef)(0),[r,i]=(0,W.useState)(0);(0,W.useEffect)(()=>{n.current=0},t),(0,W.useEffect)(()=>{let[t,r]=e(n.current);return r||(n.current+=1,i(e=>e+1)),t},[...t,r])}function upe(e,t){let n=hE(),r=(0,W.useRef)(t);return r.current=t,lpe(t=>{if(!e)return[void 0,!0];let i=r.current();return i?[cpe(i,n),!0]:[void 0,t>=1]},[n,e]),[e=>{e&&IE.set(n,e)}]}function dpe(e){return e?.getRootNode?.()}function fpe(e){return dpe(e)instanceof ShadowRoot}function zE(e){return fpe(e)?dpe(e):null}var BE={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){let{keyCode:t}=e;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=BE.F1&&t<=BE.F12)return!1;switch(t){case BE.ALT:case BE.CAPS_LOCK:case BE.CONTEXT_MENU:case BE.CTRL:case BE.DOWN:case BE.END:case BE.ESC:case BE.HOME:case BE.INSERT:case BE.LEFT:case BE.MAC_FF_META:case BE.META:case BE.NUMLOCK:case BE.NUM_CENTER:case BE.PAGE_DOWN:case BE.PAGE_UP:case BE.PAUSE:case BE.PRINT_SCREEN:case BE.RIGHT:case BE.SHIFT:case BE.UP:case BE.WIN_KEY:case BE.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=BE.ZERO&&e<=BE.NINE||e>=BE.NUM_ZERO&&e<=BE.NUM_MULTIPLY||e>=BE.A&&e<=BE.Z||window.navigator.userAgent.indexOf(`WebKit`)!==-1&&e===0)return!0;switch(e){case BE.SPACE:case BE.QUESTION_MARK:case BE.NUM_PLUS:case BE.NUM_MINUS:case BE.NUM_PERIOD:case BE.NUM_DIVISION:case BE.SEMICOLON:case BE.DASH:case BE.EQUALS:case BE.COMMA:case BE.PERIOD:case BE.SLASH:case BE.APOSTROPHE:case BE.SINGLE_QUOTE:case BE.OPEN_SQUARE_BRACKET:case BE.BACKSLASH:case BE.CLOSE_SQUARE_BRACKET:return!0;default:return!1}},isEditableTarget:function(e){let t=e.target;if(!(t instanceof HTMLElement))return!1;let n=t.tagName;return!!(n===`INPUT`||n===`TEXTAREA`||n===`SELECT`||t.isContentEditable)}};function ppe(e){let t=`rc-scrollbar-measure-${Math.random().toString(36).substring(7)}`,n=document.createElement(`div`);n.id=t;let r=n.style;r.position=`absolute`,r.left=`0`,r.top=`0`,r.width=`100px`,r.height=`100px`,r.overflow=`scroll`;let i,a;if(e){let n=getComputedStyle(e);r.scrollbarColor=n.scrollbarColor,r.scrollbarWidth=n.scrollbarWidth;let o=getComputedStyle(e,`::-webkit-scrollbar`),s=parseInt(o.width,10),c=parseInt(o.height,10);try{OE(`
|
|
4923
4923
|
#${t}::-webkit-scrollbar {
|
|
4924
4924
|
${s?`width: ${o.width};`:``}
|
|
4925
4925
|
${c?`height: ${o.height};`:``}
|
|
@@ -6070,6 +6070,23 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
6070
6070
|
`,kGe=pW(`chevronRight`,{ink:`#000`},14),AGe=hw`
|
|
6071
6071
|
html:root {
|
|
6072
6072
|
/* ---- menus: dropdowns and what hangs off them */
|
|
6073
|
+
/* (antd colours a menu's rows from its own variables, by rules that outweigh the ones below, and
|
|
6074
|
+
its variables are its light theme's: inside a menu they are the app's, in either theme) */
|
|
6075
|
+
.ant-dropdown,
|
|
6076
|
+
.ant-dropdown-menu-submenu,
|
|
6077
|
+
.ant-dropdown-menu {
|
|
6078
|
+
--ant-color-text: var(--rcad-ink-2);
|
|
6079
|
+
--ant-color-text-description: var(--rcad-mute);
|
|
6080
|
+
--ant-color-text-disabled: var(--rcad-dim);
|
|
6081
|
+
--ant-color-icon: var(--rcad-dim);
|
|
6082
|
+
--ant-color-primary: var(--rcad-ink);
|
|
6083
|
+
--ant-color-error: var(--rcad-accent);
|
|
6084
|
+
--ant-color-bg-elevated: var(--rcad-chrome);
|
|
6085
|
+
--ant-color-split: var(--rcad-chrome-line);
|
|
6086
|
+
--ant-control-item-bg-hover: var(--rcad-hover);
|
|
6087
|
+
--ant-control-item-bg-active: var(--rcad-hover);
|
|
6088
|
+
--ant-control-item-bg-active-hover: var(--rcad-hover);
|
|
6089
|
+
}
|
|
6073
6090
|
.ant-dropdown-menu,
|
|
6074
6091
|
.ant-dropdown-menu-submenu .ant-dropdown-menu {
|
|
6075
6092
|
min-width: 148px;
|
|
@@ -10188,7 +10205,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
|
|
|
10188
10205
|
|
|
10189
10206
|
outputColor = vec4(blendColor, blendAlpha);
|
|
10190
10207
|
}
|
|
10191
|
-
`,m0e=class extends UQ{constructor(e,t,{width:n=4,edgeColor1:r=[16777215,8421504],edgeColor2:i=[16777215,8421504],edgeColor3:a=[16777215,8421504]}={}){super(`OutlineEffect`,p0e,{attributes:FQ.DEPTH,uniforms:new Map([[`outlineTexture`,new cp(null)],[`edgeColor1`,new cp(new sa(r[0]))],[`edgeColor2`,new cp(new sa(i[0]))],[`edgeColor3`,new cp(new sa(a[0]))],[`edgeColor1S`,new cp(new sa(r[1]))],[`edgeColor2S`,new cp(new sa(i[1]))],[`edgeColor3S`,new cp(new sa(a[1]))]]),blendFunction:HQ.SRC}),this.scene=e,this.camera=t,this.idRT=new xi(1,1,{minFilter:tt,magFilter:tt,depthBuffer:!1,stencilBuffer:!1}),this.idRT.texture.name=`Outline.IDs`,this.outlineRT=new xi(1,1,{minFilter:tt,magFilter:tt,depthBuffer:!1,stencilBuffer:!1}),this.outlineRT.texture.name=`Outline.Outline`,this.aaRT=new xi(1,1,{minFilter:tt,magFilter:tt,depthBuffer:!1,stencilBuffer:!1}),this.aaRT.texture.name=`Outline.AA`;let o=this.uniforms.get(`outlineTexture`);o.value=this.aaRT.texture,this.clearPass=new NQ,this.clearPass.overrideClearColor=new sa(0),this.clearPass.overrideClearAlpha=0,this.idPass=new r0e(e,t),this.outlinePass=new H1e(new o0e);let s=this.outlinePass.fullscreenMaterial;s.inputBuffer=this.idRT.texture,this.widenPass=new l0e({width:n}),this.aaPass=new f0e,this.time=0,this.selections1=[],this.selections2=[],this.selections3=[],this.isColorSwitchNeeded=(e,t,n)=>{let{r,g:i,b:a}=t,{r:o,g:s,b:c}=n,l=0,u=0;return e.forEach(e=>{let t=e,n=t.material,d=t.geometry;!d.boundingBox&&d.computeBoundingBox();let f=t.geometry.boundingBox.getSize(new V),{r:p,g:m,b:h}=n.color,g=2*Math.abs(r-p)+2*Math.abs(i-m)+3*Math.abs(a-h),_=2*Math.abs(o-p)+2*Math.abs(s-m)+3*Math.abs(c-h);g<.5&&(l+=f.x+f.y+f.z),_<.5&&(u+=f.x+f.y+f.z)}),l>u},this.processSelection=(e,t,n,r,i)=>{t.layer++,this.idPass.id=i,this.idPass.selection=t,this.idPass.render(e,this.idRT),t.layer--,s.idColor=this.idPass.idColor,s.isColorSwitchNeeded=this.isColorSwitchNeeded(t,n,r),this.outlinePass.render(e,null,this.outlineRT)}}set width(e){this.widenPass.width=e}set edgeColor1(e){let t=this.uniforms.get(`edgeColor1`),n=this.uniforms.get(`edgeColor1S`);t.value=new sa(e[0]),n.value=new sa(e[1])}set edgeColor2(e){let t=this.uniforms.get(`edgeColor2`),n=this.uniforms.get(`edgeColor2S`);t.value=new sa(e[0]),n.value=new sa(e[1])}set edgeColor3(e){let t=this.uniforms.get(`edgeColor3`),n=this.uniforms.get(`edgeColor3S`);t.value=new sa(e[0]),n.value=new sa(e[1])}set selectionLayer(e){this.selections1.forEach(t=>{t.layer=e}),this.selections2.forEach(t=>{t.layer=e}),this.selections3.forEach(t=>{t.layer=e})}update(e,t,n){let r=this.scene,i=this.camera,a=this.selections1,o=this.selections2,s=this.selections3,c=r.background,l=i.layers.mask;if(a.length>0||o.length>0||s.length>0){r.background=null,this.time+=n;let t=a[0]?.layer||o[0]?.layer||s[0]?.layer;i.layers.set(t+1),this.clearPass.render(e,this.idRT,null),this.clearPass.render(e,this.outlineRT,null),this.clearPass.render(e,this.aaRT,null);let u=Math.min(this.selections1.length,255),d=this.uniforms.get(`edgeColor1`)?.value,f=this.uniforms.get(`edgeColor1S`)?.value;this.idPass.channel=0;for(let t=0;t<u;t++)this.processSelection(e,a[t],d,f,t);u=Math.min(this.selections2.length,255),d=this.uniforms.get(`edgeColor2`)?.value,f=this.uniforms.get(`edgeColor2S`)?.value,this.idPass.channel=1;for(let t=0;t<u;t++)this.processSelection(e,o[t],d,f,t);u=Math.min(this.selections3.length,255),d=this.uniforms.get(`edgeColor3`)?.value,f=this.uniforms.get(`edgeColor3S`)?.value,this.idPass.channel=2;for(let t=0;t<u;t++)this.processSelection(e,s[t],d,f,t);this.widenPass.render(e,this.outlineRT,this.outlineRT),this.aaPass.render(e,this.outlineRT,this.aaRT),i.layers.mask=l,r.background=c}else this.time>0&&(this.clearPass.render(e,this.idRT,null),this.clearPass.render(e,this.outlineRT,null),this.clearPass.render(e,this.aaRT,null),this.time=0)}setSize(e,t){this.widenPass.setSize(e,t),this.aaPass.setSize(e,t),this.idRT.setSize(e,t),this.outlineRT.setSize(e,t),this.aaRT.setSize(e,t),this.outlinePass.fullscreenMaterial.setSize(e,t)}initialize(e,t,n){this.widenPass.initialize(e,t,dt),n!==void 0&&(this.idPass.initialize(e,t,n),this.outlinePass.initialize(e,t,n))}},h0e=W.forwardRef(function({selections1:e=[],selections2:t=[],selections3:n=[],selectionLayer:r=10,edgeColor1:i,edgeColor2:a,edgeColor3:o,width:s,...c},l){let u=Qw(e=>e.invalidate),{scene:d,camera:f}=Qw(),p=W.useMemo(()=>new m0e(d,f,{width:s,edgeColor1:i,edgeColor2:a,edgeColor3:o}),[d,f]);return W.useEffect(()=>{if(e)return p.selections1=e.map(e=>new VQ(e,r)),u(),()=>{p.selections1.forEach(e=>e.clear()),p.selections1=[],u()}},[p,e]),W.useEffect(()=>{if(t)return p.selections2=t.map(e=>new VQ(e,r)),u(),()=>{p.selections2.forEach(e=>e.clear()),p.selections2=[],u()}},[p,t]),W.useEffect(()=>{if(n)return p.selections3=n.map(e=>new VQ(e,r)),u(),()=>{p.selections3.forEach(e=>e.clear()),p.selections3=[],u()}},[p,n]),W.useEffect(()=>{s&&(p.width=s,u())},[p,s]),W.useEffect(()=>{i&&(p.edgeColor1=i,u())},[p,i]),W.useEffect(()=>{a&&(p.edgeColor2=a,u())},[p,a]),W.useEffect(()=>{o&&(p.edgeColor3=o,u())},[p,o]),W.useEffect(()=>{p.selectionLayer=r,u()},[p,r,u]),(0,K.jsx)(`primitive`,{ref:l,object:p})}),g0e=[`firstRefMate`,`secondRefMate`],_0e=(e,t)=>{let n=H(e),r=n.structure.tree,i=r[t]?.members,a=[];if(i&&i[g0e[0]]&&g0e.forEach(e=>{let t=i[e],n=t?.members[0]?.members,o=t?.members[1]?.value;n&&n.length>0&&n.every(e=>r[e.value])&&o&&r[o]&&a.push(n[n.length-1].value)}),a.length===0)return;let o=r[n.structure.currentInstance],s=o?.instances||o?.children||[],c=[];return s.forEach(e=>{let t=r[e].members?.productRef?.value||e;a.indexOf(t)!==-1&&c.push(e)}),c},v0e=new sa(`rgb(128, 128, 128)`).getHex(),y0e=[UG.geoBody,WG.geoBody].map(e=>new sa(e).getHex()),b0e=1.4,x0e=2.5,S0e=4e5,C0e=140,w0e=e=>{let t=new qde(new BT,new VT({linewidth:e}));return t.raycast=()=>void 0,t},qQ=e=>{e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()};function T0e(e){let t=e.attributes.normal?.array;if(!t)return new Uint32Array;let n=e.index?.array,r=(n?n.length:e.attributes.position.count)/3,i=(e,n)=>{let r=t[3*e]-t[3*n],i=t[3*e+1]-t[3*n+1],a=t[3*e+2]-t[3*n+2];return r*r+i*i+a*a>1e-7},a=[];for(let e=0;e<r;e++){let t=n?n[3*e]:3*e,r=n?n[3*e+1]:3*e+1,o=n?n[3*e+2]:3*e+2;(i(t,r)||i(t,o))&&a.push(e)}return Uint32Array.from(a)}function E0e(e,t,n,r){let i=e.attributes.position.array,a=e.attributes.normal.array,o=e.index?.array,{curved:s,segments:c}=t,{x:l,y:u,z:d}=n,f=e=>r?a[3*e]*l+a[3*e+1]*u+a[3*e+2]*d:a[3*e]*(l-i[3*e])+a[3*e+1]*(u-i[3*e+1])+a[3*e+2]*(d-i[3*e+2]),p=0,m=0,h=(e,t,n,r)=>{let a=n/(n-r);c[m++]=i[3*e]+(i[3*t]-i[3*e])*a,c[m++]=i[3*e+1]+(i[3*t+1]-i[3*e+1])*a,c[m++]=i[3*e+2]+(i[3*t+2]-i[3*e+2])*a};for(let e of s){let t=o?o[3*e]:3*e,n=o?o[3*e+1]:3*e+1,r=o?o[3*e+2]:3*e+2,i=f(t),a=f(n),s=f(r),c=i>0,l=a>0,u=s>0;(c!==l||l!==u)&&(c!==l&&c!==u?(h(t,n,i,a),h(t,r,i,s)):l!==c&&l!==u?(h(n,t,a,i),h(n,r,a,s)):(h(r,t,s,i),h(r,n,s,a)),p++)}return p}function D0e(e,t){let n=new Set;e.parent?.children.forEach(e=>{let t=e.userData?.meshMap;if(t)for(let e=0;t[e]!==void 0;e++)n.add(t[e])});let r=new Map,i=new Set;n.forEach(e=>{let t=new Set;for(let n of e.loops??[])for(let a of n){t.has(a)&&i.add(a),t.add(a);let n=r.get(a);n?n.push(e):r.set(a,[e])}});let a=e.geometry.attributes.position.array,o=a.length/3;for(let e=0;e<o;){let n=t[e]?.graphicId,s=e+1;for(;s<o&&t[s]?.graphicId===n;)s++;let c=n===void 0?void 0:r.get(n);if(n!==void 0&&!i.has(n)&&c?.length===1){let t=3*(e+2*Math.floor((s-e)/4)),r=c[0].geometry?.attributes?.position?.array,o=0;if(r)for(let e=0;e<r.length&&o<2;e+=3){let n=r[e]-a[t],i=r[e+1]-a[t+1],s=r[e+2]-a[t+2];n*n+i*i+s*s<1e-8&&o++}o>1&&i.add(n)}e=s}return i}function O0e(e){let t=e.geometry.attributes.position.array,n=e.userData?.lineMap,r=n?D0e(e,n):new Set;if(!n||r.size===0)return t;let i=new Float32Array(t.length),a=0;for(let e=0;e+1<t.length/3;e+=2){let o=n[e]?.graphicId;if(!(o!==void 0&&r.has(o)))for(let n=0;n<6;n++)i[a++]=t[3*e+n]}return i.subarray(0,a)}function k0e(e){let t=0;for(let n=0;n+5<e.length;n+=6){let r=e[n+3]-e[n],i=e[n+4]-e[n+1],a=e[n+5]-e[n+2];t+=Math.sqrt(r*r+i*i+a*a)}return t}var A0e=new WeakMap;function j0e(e){let t=A0e.get(e);if(t)return t;let n=e.attributes.position.array,r=e.index?.array,i=(r?r.length:e.attributes.position.count)/3,a=0,o=0,s=new V;for(let e=0;e<i;e++){let t=3*(r?r[3*e]:3*e),i=3*(r?r[3*e+1]:3*e+1),c=3*(r?r[3*e+2]:3*e+2);o+=(n[t]*(n[i+1]*n[c+2]-n[i+2]*n[c+1])+n[t+1]*(n[i+2]*n[c]-n[i]*n[c+2])+n[t+2]*(n[i]*n[c+1]-n[i+1]*n[c]))/6;let l=n[i]-n[t],u=n[i+1]-n[t+1],d=n[i+2]-n[t+2],f=n[c]-n[t],p=n[c+1]-n[t+1],m=n[c+2]-n[t+2],h=u*m-d*p,g=d*f-l*m,_=l*p-u*f;a+=Math.sqrt(h*h+g*g+_*_)/2,s.x+=h/2,s.y+=g/2,s.z+=_/2}return e.boundingBox||e.computeBoundingBox(),t={area:a,volume:o,facing:s,box:e.boundingBox.clone()},A0e.set(e,t),t}var M0e=new WeakMap,JQ=new Ea,YQ=new V,N0e=new V,XQ=new V;function P0e(e,t,n,r){let i=M0e.get(e);if(i?.frame===t)return i;i||M0e.set(e,i={frame:t,width:1/0,across:1/0,area:0,scale:0}),i.frame=t,i.tone=void 0;let a=0,o=0;JQ.makeEmpty(),YQ.set(0,0,0);for(let t of e.children){let e=t;if(!e.isMesh||e.userData?.containerId===void 0||!e.geometry?.attributes?.position)continue;let n=j0e(e.geometry);a+=n.area,o+=n.volume,YQ.add(n.facing),JQ.union(n.box),i.tone??=e.material.color}let{x:s,y:c,z:l}=JQ.getSize(N0e);i.width=JQ.isEmpty()?1/0:s+c+l-Math.max(s,c,l)-Math.min(s,c,l);let u=a>0&&YQ.length()<.01*a;i.across=Math.min(i.width,u?4*Math.abs(o)/a:1/0),i.area=a;let d=n,f=n,p=e.matrixWorld.getMaxScaleOnAxis();if(d.isOrthographicCamera)i.scale=p*d.zoom*r/(d.top-d.bottom);else if(f.isPerspectiveCamera){JQ.isEmpty()?XQ.set(0,0,0):JQ.getCenter(XQ);let t=-XQ.applyMatrix4(e.matrixWorld).applyMatrix4(n.matrixWorldInverse).z;i.scale=p*f.zoom*r/(2*Math.tan(Qr.DEG2RAD*f.fov*.5)*t),i.scale>0||(i.scale=1/0)}else i.scale=1/0;return i}var ZQ=new V,QQ=new Ei,F0e=({weight:e=b0e,silhouettes:t=!0})=>{let n=Qw(e=>e.scene),r=Qw(e=>e.invalidate),i=YG(e=>e.colors.geoBody),a=YG(e=>e.colors.geoEdge),o=W.useMemo(()=>new sa(i),[i]),s=W.useMemo(()=>new sa(a),[a]);W.useEffect(()=>r(),[o,s,e,t,r]);let c=W.useRef(new Map),l=W.useRef(new Map),u=W.useRef({quaternion:new ei,moved:0,heavy:!1,wake:0,frame:0});return W.useEffect(()=>{let e=c.current,t=[e,l.current],n=u.current;return()=>{window.clearTimeout(n.wake),e.forEach((e,t)=>t.material.visible=!0);for(let e of t)e.forEach(qQ),e.clear()}},[]),$w(({size:i,camera:a})=>{let d=o.getHex(),f=!a.isPerspectiveCamera,p=performance.now(),m=u.current,h=++m.frame;m.quaternion.equals(a.quaternion)||(m.quaternion.copy(a.quaternion),m.moved=p);let g=m.heavy&&p-m.moved<C0e;g&&(window.clearTimeout(m.wake),m.wake=window.setTimeout(r,150));let _=0,v=x0e*e,y=e=>e.parent?P0e(e.parent,h,a,i.height):void 0;n.traverse(n=>{if(n.userData?.containerId===void 0)return;let r=n;if(r.isMesh){let n=r.material?.color;if(!n)return;let c=n.getHex();c!==d&&(c===v0e||y0e.indexOf(c)!==-1)&&n.copy(o);let u=r.geometry,p=l.current.get(r),m=y(r),b=m?m.across*m.scale:1/0;if(!(t&&!r.material.wireframe&&r.material.visible&&u?.attributes?.normal&&r.parent?.children.some(e=>e.isLineSegments)&&!(b<v/2))){p&&(p.line.visible=!1,p.seen=h);return}if(!p||p.of!==u){p&&qQ(p);let t=T0e(u),n=new Float32Array(Math.max(t.length,1)*6),i=new up(n,6,1);i.setUsage(Kn);let a=w0e(e);a.geometry.setAttribute(`instanceStart`,new bo(i,3,0)),a.geometry.setAttribute(`instanceEnd`,new bo(i,3,3)),a.geometry.instanceCount=0,u.boundingBox||u.computeBoundingBox(),u.boundingSphere||u.computeBoundingSphere(),a.geometry.boundingBox=u.boundingBox.clone(),a.geometry.boundingSphere=u.boundingSphere.clone(),a.frustumCulled=!1,a.renderOrder=150,r.add(a),p={line:a,of:u,seen:h,curved:t,segments:n,buffer:i,eye:new V(NaN,0,0),found:!1},l.current.set(r,p)}if(p.seen=h,_+=p.curved.length,p.line.visible=p.curved.length>0&&!(g&&!p.found),p.curved.length>0){QQ.copy(r.matrixWorld).invert(),f?a.getWorldDirection(ZQ).transformDirection(QQ):ZQ.copy(a.position).applyMatrix4(QQ),(!p.found||ZQ.distanceToSquared(p.eye)>1e-12)&&(g?(p.found=!1,p.line.visible=!1):(p.line.geometry.instanceCount=E0e(u,p,ZQ,f),p.buffer.needsUpdate=!0,p.eye.copy(ZQ),p.found=!0,p.line.visible=!0));let t=p.line.material;t.color.copy(s),b<v&&t.color.lerp(n,2-2*b/v),t.transparent=r.material.transparent,t.opacity=r.material.transparent?r.material.opacity:1,t.linewidth=e,t.resolution.set(i.width,i.height)}return}let u=n;if(!u.isLineSegments||!u.geometry?.attributes?.position)return;let p=c.current.get(u);if(!p||p.of!==u.geometry){p&&qQ(p);let t=w0e(e),n=O0e(u);t.geometry.setPositions(n),t.renderOrder=u.renderOrder,u.add(t),p={line:t,of:u.geometry,seen:h,length:k0e(n)},c.current.set(u,p)}p.seen=h,u.material.visible=!1;let m=p.line.material;m.color.copy(u.material.color);let b=y(u);if(b?.tone&&b.area>0){let e=Math.min(b.width,b.area/(2*p.length))*b.scale;e<v&&m.color.lerp(b.tone,1-e/v)}m.opacity=u.material.opacity,m.transparent=u.material.transparent,m.linewidth=e,m.resolution.set(i.width,i.height)}),m.heavy=_>S0e;for(let e of[c.current,l.current])e.forEach((t,n)=>{t.seen!==h&&(qQ(t),e.delete(n))})},-3),null},I0e=`alphaMap.alphaTest.anisotropy.anisotropyMap.anisotropyRotation.aoMap.aoMapIntensity.attenuationColor.attenuationDistance.bumpMap.clearcoat.clearcoatMap.clearcoatNormalMap.clearcoatNormalScale.clearcoatRoughness.color.dispersion.displacementMap.emissive.emissiveIntensity.emissiveMap.envMap.envMapIntensity.gradientMap.ior.iridescence.iridescenceIOR.iridescenceMap.iridescenceThicknessMap.lightMap.lightMapIntensity.map.matcap.metalness.metalnessMap.normalMap.normalScale.opacity.roughness.roughnessMap.sheen.sheenColor.sheenColorMap.sheenRoughnessMap.shininess.specular.specularColor.specularColorMap.specularIntensity.specularIntensityMap.specularMap.thickness.transmission.transmissionMap`.split(`.`),$Q=new WeakMap,L0e=new WeakMap,R0e=new WeakMap,z0e=class{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=e.object.isSkinnedMesh===!0,this.refreshUniforms=I0e,this.renderId=0}firstInitialization(e){return this.renderObjects.has(e)===!1&&(this.getRenderObjectData(e),!0)}needsVelocity(e){let t=e.getMRT();return t!==null&&t.has(`velocity`)}getRenderObjectData(e){let t=this.renderObjects.get(e);if(t===void 0){let{geometry:n,object:r}=e;if(t={geometryId:n.id,worldMatrix:r.matrixWorld.clone()},r.center&&(t.center=r.center.clone()),r.morphTargetInfluences&&(t.morphTargetInfluences=r.morphTargetInfluences.slice()),e.bundle!==null&&(t.version=e.bundle.version),e.material.transmission>0){let{width:n,height:r}=e.context;t.bufferWidth=n,t.bufferHeight=r}t.lights=this.getLightsData(e.lightsNode.getLights()),this.renderObjects.set(e,t)}return t}getAttributesData(e){let t={};for(let n in e){let r=e[n];t[n]={id:r.id,version:r.version}}return t}containsNode(e){let t=e.material;for(let e in t)if(t[e]&&t[e].isNode)return!0;return!!(e.context.modelViewMatrix||e.context.modelNormalViewMatrix||e.context.getAO||e.context.getShadow)}getGeometryData(e){let t=R0e.get(e);return t===void 0&&(t={_renderId:-1,_equal:!1,attributes:this.getAttributesData(e.attributes),indexId:e.index?e.index.id:null,indexVersion:e.index?e.index.version:null,drawRange:{start:e.drawRange.start,count:e.drawRange.count}},R0e.set(e,t)),t}getMaterialData(e){let t=L0e.get(e);if(t===void 0){t={_renderId:-1,_equal:!1};for(let n of this.refreshUniforms){let r=e[n];r!=null&&(typeof r==`object`&&r.clone!==void 0?r.isTexture===!0?t[n]={id:r.id,version:r.version}:t[n]=r.clone():t[n]=r)}L0e.set(e,t)}return t}equals(e,t,n){let{object:r,material:i,geometry:a}=e,o=this.getRenderObjectData(e);if(o.worldMatrix.equals(r.matrixWorld)!==!0)return o.worldMatrix.copy(r.matrixWorld),!1;let s=this.getMaterialData(e.material);if(s._renderId!==n){s._renderId=n;for(let e in s){let t=s[e],n=i[e];if(e!==`_renderId`&&e!==`_equal`){if(t.equals!==void 0){if(t.equals(n)===!1)return t.copy(n),s._equal=!1,!1}else if(n.isTexture===!0){if(t.id!==n.id||t.version!==n.version)return t.id=n.id,t.version=n.version,s._equal=!1,!1}else if(t!==n)return s[e]=n,s._equal=!1,!1}}if(s.transmission>0){let{width:t,height:n}=e.context;if(o.bufferWidth!==t||o.bufferHeight!==n)return o.bufferWidth=t,o.bufferHeight=n,s._equal=!1,!1}s._equal=!0}else if(s._equal===!1)return!1;if(o.geometryId!==a.id)return o.geometryId=a.id,!1;let c=this.getGeometryData(e.geometry);if(c._renderId!==n){c._renderId=n;let e=a.attributes,t=c.attributes,r=0,i=0;for(let t in e)r++;for(let n in t){i++;let r=t[n],a=e[n];if(a===void 0)return delete t[n],c._equal=!1,!1;if(r.id!==a.id||r.version!==a.version)return r.id=a.id,r.version=a.version,c._equal=!1,!1}if(i!==r)return c.attributes=this.getAttributesData(e),c._equal=!1,!1;let o=a.index,s=c.indexId,l=c.indexVersion,u=o?o.id:null,d=o?o.version:null;if(s!==u||l!==d)return c.indexId=u,c.indexVersion=d,c._equal=!1,!1;if(c.drawRange.start!==a.drawRange.start||c.drawRange.count!==a.drawRange.count)return c.drawRange.start=a.drawRange.start,c.drawRange.count=a.drawRange.count,c._equal=!1,!1;c._equal=!0}else if(c._equal===!1)return!1;if(o.morphTargetInfluences){let e=!1;for(let t=0;t<o.morphTargetInfluences.length;t++)o.morphTargetInfluences[t]!==r.morphTargetInfluences[t]&&(o.morphTargetInfluences[t]=r.morphTargetInfluences[t],e=!0);if(e)return!1}if(o.lights){for(let e=0;e<t.length;e++)if(o.lights[e].map!==t[e].map)return!1}return o.center&&o.center.equals(r.center)===!1?(o.center.copy(r.center),!0):(e.bundle!==null&&(o.version=e.bundle.version),!0)}getLightsData(e){let t=[];for(let n of e)n.isSpotLight===!0&&n.map!==null&&t.push({map:n.map.version});return t}getLights(e,t){if($Q.has(e)){let n=$Q.get(e);if(n.renderId===t)return n.lightsData}let n=this.getLightsData(e.getLights());return $Q.set(e,{renderId:t,lightsData:n}),n}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e)||this.needsVelocity(t.renderer))return!0;let{renderId:n}=t;if(this.renderId!==n)return this.renderId=n,!0;let r=e.object.static===!0,i=e.bundle!==null&&e.bundle.static===!0&&this.getRenderObjectData(e).version===e.bundle.version;if(r||i)return!1;let a=this.getLights(e.lightsNode,n);return this.equals(e,a,n)!==!0}},B0e=[/^StackTrace\.js$/,/^TSLCore\.js$/,/^.*Node\.js$/,/^three\.webgpu.*\.js$/];function V0e(e){let t=/(?:at\s+(.+?)\s+\()?(?:(.+?)@)?([^@\s()]+):(\d+):(\d+)/;return e.split(`
|
|
10208
|
+
`,m0e=class extends UQ{constructor(e,t,{width:n=4,edgeColor1:r=[16777215,8421504],edgeColor2:i=[16777215,8421504],edgeColor3:a=[16777215,8421504]}={}){super(`OutlineEffect`,p0e,{attributes:FQ.DEPTH,uniforms:new Map([[`outlineTexture`,new cp(null)],[`edgeColor1`,new cp(new sa(r[0]))],[`edgeColor2`,new cp(new sa(i[0]))],[`edgeColor3`,new cp(new sa(a[0]))],[`edgeColor1S`,new cp(new sa(r[1]))],[`edgeColor2S`,new cp(new sa(i[1]))],[`edgeColor3S`,new cp(new sa(a[1]))]]),blendFunction:HQ.SRC}),this.scene=e,this.camera=t,this.idRT=new xi(1,1,{minFilter:tt,magFilter:tt,depthBuffer:!1,stencilBuffer:!1}),this.idRT.texture.name=`Outline.IDs`,this.outlineRT=new xi(1,1,{minFilter:tt,magFilter:tt,depthBuffer:!1,stencilBuffer:!1}),this.outlineRT.texture.name=`Outline.Outline`,this.aaRT=new xi(1,1,{minFilter:tt,magFilter:tt,depthBuffer:!1,stencilBuffer:!1}),this.aaRT.texture.name=`Outline.AA`;let o=this.uniforms.get(`outlineTexture`);o.value=this.aaRT.texture,this.clearPass=new NQ,this.clearPass.overrideClearColor=new sa(0),this.clearPass.overrideClearAlpha=0,this.idPass=new r0e(e,t),this.outlinePass=new H1e(new o0e);let s=this.outlinePass.fullscreenMaterial;s.inputBuffer=this.idRT.texture,this.widenPass=new l0e({width:n}),this.aaPass=new f0e,this.time=0,this.selections1=[],this.selections2=[],this.selections3=[],this.isColorSwitchNeeded=(e,t,n)=>{let{r,g:i,b:a}=t,{r:o,g:s,b:c}=n,l=0,u=0;return e.forEach(e=>{let t=e,n=t.material,d=t.geometry;!d.boundingBox&&d.computeBoundingBox();let f=t.geometry.boundingBox.getSize(new V),{r:p,g:m,b:h}=n.color,g=2*Math.abs(r-p)+2*Math.abs(i-m)+3*Math.abs(a-h),_=2*Math.abs(o-p)+2*Math.abs(s-m)+3*Math.abs(c-h);g<.5&&(l+=f.x+f.y+f.z),_<.5&&(u+=f.x+f.y+f.z)}),l>u},this.processSelection=(e,t,n,r,i)=>{t.layer++,this.idPass.id=i,this.idPass.selection=t,this.idPass.render(e,this.idRT),t.layer--,s.idColor=this.idPass.idColor,s.isColorSwitchNeeded=this.isColorSwitchNeeded(t,n,r),this.outlinePass.render(e,null,this.outlineRT)}}set width(e){this.widenPass.width=e}set edgeColor1(e){let t=this.uniforms.get(`edgeColor1`),n=this.uniforms.get(`edgeColor1S`);t.value=new sa(e[0]),n.value=new sa(e[1])}set edgeColor2(e){let t=this.uniforms.get(`edgeColor2`),n=this.uniforms.get(`edgeColor2S`);t.value=new sa(e[0]),n.value=new sa(e[1])}set edgeColor3(e){let t=this.uniforms.get(`edgeColor3`),n=this.uniforms.get(`edgeColor3S`);t.value=new sa(e[0]),n.value=new sa(e[1])}set selectionLayer(e){this.selections1.forEach(t=>{t.layer=e}),this.selections2.forEach(t=>{t.layer=e}),this.selections3.forEach(t=>{t.layer=e})}update(e,t,n){let r=this.scene,i=this.camera,a=this.selections1,o=this.selections2,s=this.selections3,c=r.background,l=i.layers.mask;if(a.length>0||o.length>0||s.length>0){r.background=null,this.time+=n;let t=a[0]?.layer||o[0]?.layer||s[0]?.layer;i.layers.set(t+1),this.clearPass.render(e,this.idRT,null),this.clearPass.render(e,this.outlineRT,null),this.clearPass.render(e,this.aaRT,null);let u=Math.min(this.selections1.length,255),d=this.uniforms.get(`edgeColor1`)?.value,f=this.uniforms.get(`edgeColor1S`)?.value;this.idPass.channel=0;for(let t=0;t<u;t++)this.processSelection(e,a[t],d,f,t);u=Math.min(this.selections2.length,255),d=this.uniforms.get(`edgeColor2`)?.value,f=this.uniforms.get(`edgeColor2S`)?.value,this.idPass.channel=1;for(let t=0;t<u;t++)this.processSelection(e,o[t],d,f,t);u=Math.min(this.selections3.length,255),d=this.uniforms.get(`edgeColor3`)?.value,f=this.uniforms.get(`edgeColor3S`)?.value,this.idPass.channel=2;for(let t=0;t<u;t++)this.processSelection(e,s[t],d,f,t);this.widenPass.render(e,this.outlineRT,this.outlineRT),this.aaPass.render(e,this.outlineRT,this.aaRT),i.layers.mask=l,r.background=c}else this.time>0&&(this.clearPass.render(e,this.idRT,null),this.clearPass.render(e,this.outlineRT,null),this.clearPass.render(e,this.aaRT,null),this.time=0)}setSize(e,t){this.widenPass.setSize(e,t),this.aaPass.setSize(e,t),this.idRT.setSize(e,t),this.outlineRT.setSize(e,t),this.aaRT.setSize(e,t),this.outlinePass.fullscreenMaterial.setSize(e,t)}initialize(e,t,n){this.widenPass.initialize(e,t,dt),n!==void 0&&(this.idPass.initialize(e,t,n),this.outlinePass.initialize(e,t,n))}},h0e=W.forwardRef(function({selections1:e=[],selections2:t=[],selections3:n=[],selectionLayer:r=10,edgeColor1:i,edgeColor2:a,edgeColor3:o,width:s,...c},l){let u=Qw(e=>e.invalidate),{scene:d,camera:f}=Qw(),p=W.useMemo(()=>new m0e(d,f,{width:s,edgeColor1:i,edgeColor2:a,edgeColor3:o}),[d,f]);return W.useEffect(()=>{if(e)return p.selections1=e.map(e=>new VQ(e,r)),u(),()=>{p.selections1.forEach(e=>e.clear()),p.selections1=[],u()}},[p,e]),W.useEffect(()=>{if(t)return p.selections2=t.map(e=>new VQ(e,r)),u(),()=>{p.selections2.forEach(e=>e.clear()),p.selections2=[],u()}},[p,t]),W.useEffect(()=>{if(n)return p.selections3=n.map(e=>new VQ(e,r)),u(),()=>{p.selections3.forEach(e=>e.clear()),p.selections3=[],u()}},[p,n]),W.useEffect(()=>{s&&(p.width=s,u())},[p,s]),W.useEffect(()=>{i&&(p.edgeColor1=i,u())},[p,i]),W.useEffect(()=>{a&&(p.edgeColor2=a,u())},[p,a]),W.useEffect(()=>{o&&(p.edgeColor3=o,u())},[p,o]),W.useEffect(()=>{p.selectionLayer=r,u()},[p,r,u]),(0,K.jsx)(`primitive`,{ref:l,object:p})}),g0e=[`firstRefMate`,`secondRefMate`],_0e=(e,t)=>{let n=H(e),r=n.structure.tree,i=r[t]?.members,a=[];if(i&&i[g0e[0]]&&g0e.forEach(e=>{let t=i[e],n=t?.members[0]?.members,o=t?.members[1]?.value;n&&n.length>0&&n.every(e=>r[e.value])&&o&&r[o]&&a.push(n[n.length-1].value)}),a.length===0)return;let o=r[n.structure.currentInstance],s=o?.instances||o?.children||[],c=[];return s.forEach(e=>{let t=r[e].members?.productRef?.value||e;a.indexOf(t)!==-1&&c.push(e)}),c},v0e=new sa(`rgb(128, 128, 128)`).getHex(),y0e=[UG.geoBody,WG.geoBody].map(e=>new sa(e).getHex()),b0e=1.4,x0e=2.5,S0e=4e5,C0e=140,w0e=e=>{let t=new qde(new BT,new VT({linewidth:e}));return t.raycast=()=>void 0,t},qQ=e=>{e.line.removeFromParent(),e.line.geometry.dispose(),e.line.material.dispose()};function T0e(e){let t=e.attributes.normal?.array;if(!t)return new Uint32Array;let n=e.index?.array,r=(n?n.length:e.attributes.position.count)/3,i=(e,n)=>{let r=t[3*e]-t[3*n],i=t[3*e+1]-t[3*n+1],a=t[3*e+2]-t[3*n+2];return r*r+i*i+a*a>1e-7},a=[];for(let e=0;e<r;e++){let t=n?n[3*e]:3*e,r=n?n[3*e+1]:3*e+1,o=n?n[3*e+2]:3*e+2;(i(t,r)||i(t,o))&&a.push(e)}return Uint32Array.from(a)}function E0e(e,t,n,r){let i=e.attributes.position.array,a=e.attributes.normal.array,o=e.index?.array,{curved:s,segments:c}=t,{x:l,y:u,z:d}=n,f=e=>r?a[3*e]*l+a[3*e+1]*u+a[3*e+2]*d:a[3*e]*(l-i[3*e])+a[3*e+1]*(u-i[3*e+1])+a[3*e+2]*(d-i[3*e+2]),p=0,m=0,h=(e,t,n,r)=>{let a=n/(n-r);c[m++]=i[3*e]+(i[3*t]-i[3*e])*a,c[m++]=i[3*e+1]+(i[3*t+1]-i[3*e+1])*a,c[m++]=i[3*e+2]+(i[3*t+2]-i[3*e+2])*a};for(let e of s){let t=o?o[3*e]:3*e,n=o?o[3*e+1]:3*e+1,r=o?o[3*e+2]:3*e+2,i=f(t),a=f(n),s=f(r),c=i>0,l=a>0,u=s>0;(c!==l||l!==u)&&(c!==l&&c!==u?(h(t,n,i,a),h(t,r,i,s)):l!==c&&l!==u?(h(n,t,a,i),h(n,r,a,s)):(h(r,t,s,i),h(r,n,s,a)),p++)}return p}function D0e(e,t){let n=new Set;e.parent?.children.forEach(e=>{let t=e.userData?.meshMap;if(t)for(let e=0;t[e]!==void 0;e++)n.add(t[e])});let r=new Map,i=new Set;n.forEach(e=>{let t=new Set;for(let n of e.loops??[])for(let a of n){t.has(a)&&i.add(a),t.add(a);let n=r.get(a);n?n.push(e):r.set(a,[e])}});let a=e.geometry.attributes.position.array,o=a.length/3;for(let e=0;e<o;){let n=t[e]?.graphicId,s=e+1;for(;s<o&&t[s]?.graphicId===n;)s++;let c=n===void 0?void 0:r.get(n);if(n!==void 0&&!i.has(n)&&c?.length===1){let t=3*(e+2*Math.floor((s-e)/4)),r=c[0].geometry?.attributes?.position?.array,o=0;if(r)for(let e=0;e<r.length&&o<2;e+=3){let n=r[e]-a[t],i=r[e+1]-a[t+1],s=r[e+2]-a[t+2];n*n+i*i+s*s<1e-8&&o++}o>1&&i.add(n)}e=s}return i}function O0e(e){let t=e.geometry.attributes.position.array,n=e.userData?.lineMap,r=n?D0e(e,n):new Set;if(!n||r.size===0)return t;let i=new Float32Array(t.length),a=0;for(let e=0;e+1<t.length/3;e+=2){let o=n[e]?.graphicId;if(!(o!==void 0&&r.has(o)))for(let n=0;n<6;n++)i[a++]=t[3*e+n]}return i.subarray(0,a)}function k0e(e){let t=0;for(let n=0;n+5<e.length;n+=6){let r=e[n+3]-e[n],i=e[n+4]-e[n+1],a=e[n+5]-e[n+2];t+=Math.sqrt(r*r+i*i+a*a)}return t}var A0e=new WeakMap;function j0e(e){let t=A0e.get(e);if(t)return t;let n=e.attributes.position.array,r=e.index?.array,i=(r?r.length:e.attributes.position.count)/3,a=0,o=0,s=new V;for(let e=0;e<i;e++){let t=3*(r?r[3*e]:3*e),i=3*(r?r[3*e+1]:3*e+1),c=3*(r?r[3*e+2]:3*e+2);o+=(n[t]*(n[i+1]*n[c+2]-n[i+2]*n[c+1])+n[t+1]*(n[i+2]*n[c]-n[i]*n[c+2])+n[t+2]*(n[i]*n[c+1]-n[i+1]*n[c]))/6;let l=n[i]-n[t],u=n[i+1]-n[t+1],d=n[i+2]-n[t+2],f=n[c]-n[t],p=n[c+1]-n[t+1],m=n[c+2]-n[t+2],h=u*m-d*p,g=d*f-l*m,_=l*p-u*f;a+=Math.sqrt(h*h+g*g+_*_)/2,s.x+=h/2,s.y+=g/2,s.z+=_/2}return e.boundingBox||e.computeBoundingBox(),t={area:a,volume:o,facing:s,box:e.boundingBox.clone()},A0e.set(e,t),t}var M0e=new WeakMap,JQ=new Ea,YQ=new V,N0e=new V,XQ=new V;function P0e(e,t,n,r){let i=M0e.get(e);if(i?.frame===t)return i;i||M0e.set(e,i={frame:t,width:1/0,across:1/0,area:0,scale:0}),i.frame=t,i.tone=void 0;let a=0,o=0;JQ.makeEmpty(),YQ.set(0,0,0);for(let t of e.children){let e=t;if(!e.isMesh||e.userData?.containerId===void 0||!e.geometry?.attributes?.position)continue;let n=j0e(e.geometry);a+=n.area,o+=n.volume,YQ.add(n.facing),JQ.union(n.box),i.tone??=e.material.color}let{x:s,y:c,z:l}=JQ.getSize(N0e);i.width=JQ.isEmpty()?1/0:s+c+l-Math.max(s,c,l)-Math.min(s,c,l);let u=a>0&&YQ.length()<.01*a;i.across=Math.min(i.width,u?4*Math.abs(o)/a:1/0),i.area=a;let d=n,f=n,p=e.matrixWorld.getMaxScaleOnAxis();if(d.isOrthographicCamera)i.scale=p*d.zoom*r/(d.top-d.bottom);else if(f.isPerspectiveCamera){JQ.isEmpty()?XQ.set(0,0,0):JQ.getCenter(XQ);let t=-XQ.applyMatrix4(e.matrixWorld).applyMatrix4(n.matrixWorldInverse).z;i.scale=p*f.zoom*r/(2*Math.tan(Qr.DEG2RAD*f.fov*.5)*t),i.scale>0||(i.scale=1/0)}else i.scale=1/0;return i}var ZQ=new V,QQ=new Ei,F0e=({weight:e=b0e,silhouettes:t=!0})=>{let n=Qw(e=>e.scene),r=Qw(e=>e.invalidate),i=YG(e=>e.colors.geoBody),a=YG(e=>e.colors.geoEdge),o=W.useMemo(()=>new sa(i),[i]),s=W.useMemo(()=>new sa(a),[a]);W.useEffect(()=>r(),[o,s,e,t,r]);let c=W.useRef(new Map),l=W.useRef(new Map),u=W.useRef({quaternion:new ei,moved:0,heavy:!1,wake:0,frame:0});return W.useEffect(()=>{let e=c.current,t=[e,l.current],n=u.current;return()=>{window.clearTimeout(n.wake),e.forEach((e,t)=>t.material.visible=!0);for(let e of t)e.forEach(qQ),e.clear()}},[]),$w(({size:i,camera:a})=>{let d=o.getHex(),f=!a.isPerspectiveCamera,p=performance.now(),m=u.current,h=++m.frame;m.quaternion.equals(a.quaternion)||(m.quaternion.copy(a.quaternion),m.moved=p);let g=m.heavy&&p-m.moved<C0e;g&&(window.clearTimeout(m.wake),m.wake=window.setTimeout(r,150));let _=0,v=x0e*e,y=e=>e.parent?P0e(e.parent,h,a,i.height):void 0;n.traverse(n=>{if(n.userData?.containerId===void 0)return;let r=n;if(r.isMesh){let n=r.material?.color;if(!n)return;let c=n.getHex();c!==d&&(c===v0e||y0e.indexOf(c)!==-1)&&n.copy(o);let u=r.geometry,p=l.current.get(r),m=y(r),b=m?m.across*m.scale:1/0;if(!(t&&!r.material.wireframe&&r.material.visible&&u?.attributes?.normal&&r.parent?.children.some(e=>e.isLineSegments&&!e.userData?.hidden)&&!(b<v/2))){p&&(p.line.visible=!1,p.seen=h);return}if(!p||p.of!==u){p&&qQ(p);let t=T0e(u),n=new Float32Array(Math.max(t.length,1)*6),i=new up(n,6,1);i.setUsage(Kn);let a=w0e(e);a.geometry.setAttribute(`instanceStart`,new bo(i,3,0)),a.geometry.setAttribute(`instanceEnd`,new bo(i,3,3)),a.geometry.instanceCount=0,u.boundingBox||u.computeBoundingBox(),u.boundingSphere||u.computeBoundingSphere(),a.geometry.boundingBox=u.boundingBox.clone(),a.geometry.boundingSphere=u.boundingSphere.clone(),a.frustumCulled=!1,a.renderOrder=150,r.add(a),p={line:a,of:u,seen:h,curved:t,segments:n,buffer:i,eye:new V(NaN,0,0),found:!1},l.current.set(r,p)}if(p.seen=h,_+=p.curved.length,p.line.visible=p.curved.length>0&&!(g&&!p.found),p.curved.length>0){QQ.copy(r.matrixWorld).invert(),f?a.getWorldDirection(ZQ).transformDirection(QQ):ZQ.copy(a.position).applyMatrix4(QQ),(!p.found||ZQ.distanceToSquared(p.eye)>1e-12)&&(g?(p.found=!1,p.line.visible=!1):(p.line.geometry.instanceCount=E0e(u,p,ZQ,f),p.buffer.needsUpdate=!0,p.eye.copy(ZQ),p.found=!0,p.line.visible=!0));let t=p.line.material;t.color.copy(s),b<v&&t.color.lerp(n,2-2*b/v),t.transparent=r.material.transparent,t.opacity=r.material.transparent?r.material.opacity:1,t.linewidth=e,t.resolution.set(i.width,i.height)}return}let u=n;if(!u.isLineSegments||!u.geometry?.attributes?.position||u.userData?.hidden)return;let p=c.current.get(u);if(!p||p.of!==u.geometry){p&&qQ(p);let t=w0e(e),n=O0e(u);t.geometry.setPositions(n),t.renderOrder=u.renderOrder,u.add(t),p={line:t,of:u.geometry,seen:h,length:k0e(n)},c.current.set(u,p)}p.seen=h,u.material.visible=!1;let m=p.line.material;m.color.copy(u.material.color);let b=y(u);if(b?.tone&&b.area>0){let e=Math.min(b.width,b.area/(2*p.length))*b.scale;e<v&&m.color.lerp(b.tone,1-e/v)}m.opacity=u.material.opacity,m.transparent=u.material.transparent,m.linewidth=e,m.resolution.set(i.width,i.height)}),m.heavy=_>S0e;for(let e of[c.current,l.current])e.forEach((t,n)=>{t.seen!==h&&(qQ(t),e.delete(n))})},-3),null},I0e=`alphaMap.alphaTest.anisotropy.anisotropyMap.anisotropyRotation.aoMap.aoMapIntensity.attenuationColor.attenuationDistance.bumpMap.clearcoat.clearcoatMap.clearcoatNormalMap.clearcoatNormalScale.clearcoatRoughness.color.dispersion.displacementMap.emissive.emissiveIntensity.emissiveMap.envMap.envMapIntensity.gradientMap.ior.iridescence.iridescenceIOR.iridescenceMap.iridescenceThicknessMap.lightMap.lightMapIntensity.map.matcap.metalness.metalnessMap.normalMap.normalScale.opacity.roughness.roughnessMap.sheen.sheenColor.sheenColorMap.sheenRoughnessMap.shininess.specular.specularColor.specularColorMap.specularIntensity.specularIntensityMap.specularMap.thickness.transmission.transmissionMap`.split(`.`),$Q=new WeakMap,L0e=new WeakMap,R0e=new WeakMap,z0e=class{constructor(e){this.renderObjects=new WeakMap,this.hasNode=this.containsNode(e),this.hasAnimation=e.object.isSkinnedMesh===!0,this.refreshUniforms=I0e,this.renderId=0}firstInitialization(e){return this.renderObjects.has(e)===!1&&(this.getRenderObjectData(e),!0)}needsVelocity(e){let t=e.getMRT();return t!==null&&t.has(`velocity`)}getRenderObjectData(e){let t=this.renderObjects.get(e);if(t===void 0){let{geometry:n,object:r}=e;if(t={geometryId:n.id,worldMatrix:r.matrixWorld.clone()},r.center&&(t.center=r.center.clone()),r.morphTargetInfluences&&(t.morphTargetInfluences=r.morphTargetInfluences.slice()),e.bundle!==null&&(t.version=e.bundle.version),e.material.transmission>0){let{width:n,height:r}=e.context;t.bufferWidth=n,t.bufferHeight=r}t.lights=this.getLightsData(e.lightsNode.getLights()),this.renderObjects.set(e,t)}return t}getAttributesData(e){let t={};for(let n in e){let r=e[n];t[n]={id:r.id,version:r.version}}return t}containsNode(e){let t=e.material;for(let e in t)if(t[e]&&t[e].isNode)return!0;return!!(e.context.modelViewMatrix||e.context.modelNormalViewMatrix||e.context.getAO||e.context.getShadow)}getGeometryData(e){let t=R0e.get(e);return t===void 0&&(t={_renderId:-1,_equal:!1,attributes:this.getAttributesData(e.attributes),indexId:e.index?e.index.id:null,indexVersion:e.index?e.index.version:null,drawRange:{start:e.drawRange.start,count:e.drawRange.count}},R0e.set(e,t)),t}getMaterialData(e){let t=L0e.get(e);if(t===void 0){t={_renderId:-1,_equal:!1};for(let n of this.refreshUniforms){let r=e[n];r!=null&&(typeof r==`object`&&r.clone!==void 0?r.isTexture===!0?t[n]={id:r.id,version:r.version}:t[n]=r.clone():t[n]=r)}L0e.set(e,t)}return t}equals(e,t,n){let{object:r,material:i,geometry:a}=e,o=this.getRenderObjectData(e);if(o.worldMatrix.equals(r.matrixWorld)!==!0)return o.worldMatrix.copy(r.matrixWorld),!1;let s=this.getMaterialData(e.material);if(s._renderId!==n){s._renderId=n;for(let e in s){let t=s[e],n=i[e];if(e!==`_renderId`&&e!==`_equal`){if(t.equals!==void 0){if(t.equals(n)===!1)return t.copy(n),s._equal=!1,!1}else if(n.isTexture===!0){if(t.id!==n.id||t.version!==n.version)return t.id=n.id,t.version=n.version,s._equal=!1,!1}else if(t!==n)return s[e]=n,s._equal=!1,!1}}if(s.transmission>0){let{width:t,height:n}=e.context;if(o.bufferWidth!==t||o.bufferHeight!==n)return o.bufferWidth=t,o.bufferHeight=n,s._equal=!1,!1}s._equal=!0}else if(s._equal===!1)return!1;if(o.geometryId!==a.id)return o.geometryId=a.id,!1;let c=this.getGeometryData(e.geometry);if(c._renderId!==n){c._renderId=n;let e=a.attributes,t=c.attributes,r=0,i=0;for(let t in e)r++;for(let n in t){i++;let r=t[n],a=e[n];if(a===void 0)return delete t[n],c._equal=!1,!1;if(r.id!==a.id||r.version!==a.version)return r.id=a.id,r.version=a.version,c._equal=!1,!1}if(i!==r)return c.attributes=this.getAttributesData(e),c._equal=!1,!1;let o=a.index,s=c.indexId,l=c.indexVersion,u=o?o.id:null,d=o?o.version:null;if(s!==u||l!==d)return c.indexId=u,c.indexVersion=d,c._equal=!1,!1;if(c.drawRange.start!==a.drawRange.start||c.drawRange.count!==a.drawRange.count)return c.drawRange.start=a.drawRange.start,c.drawRange.count=a.drawRange.count,c._equal=!1,!1;c._equal=!0}else if(c._equal===!1)return!1;if(o.morphTargetInfluences){let e=!1;for(let t=0;t<o.morphTargetInfluences.length;t++)o.morphTargetInfluences[t]!==r.morphTargetInfluences[t]&&(o.morphTargetInfluences[t]=r.morphTargetInfluences[t],e=!0);if(e)return!1}if(o.lights){for(let e=0;e<t.length;e++)if(o.lights[e].map!==t[e].map)return!1}return o.center&&o.center.equals(r.center)===!1?(o.center.copy(r.center),!0):(e.bundle!==null&&(o.version=e.bundle.version),!0)}getLightsData(e){let t=[];for(let n of e)n.isSpotLight===!0&&n.map!==null&&t.push({map:n.map.version});return t}getLights(e,t){if($Q.has(e)){let n=$Q.get(e);if(n.renderId===t)return n.lightsData}let n=this.getLightsData(e.getLights());return $Q.set(e,{renderId:t,lightsData:n}),n}needsRefresh(e,t){if(this.hasNode||this.hasAnimation||this.firstInitialization(e)||this.needsVelocity(t.renderer))return!0;let{renderId:n}=t;if(this.renderId!==n)return this.renderId=n,!0;let r=e.object.static===!0,i=e.bundle!==null&&e.bundle.static===!0&&this.getRenderObjectData(e).version===e.bundle.version;if(r||i)return!1;let a=this.getLights(e.lightsNode,n);return this.equals(e,a,n)!==!0}},B0e=[/^StackTrace\.js$/,/^TSLCore\.js$/,/^.*Node\.js$/,/^three\.webgpu.*\.js$/];function V0e(e){let t=/(?:at\s+(.+?)\s+\()?(?:(.+?)@)?([^@\s()]+):(\d+):(\d+)/;return e.split(`
|
|
10192
10209
|
`).map(e=>{let n=e.match(t);if(!n)return null;let r=n[1]||n[2]||``,i=n[3].split(`?`)[0],a=parseInt(n[4],10),o=parseInt(n[5],10);return{fn:r,file:i.split(`/`).pop(),line:a,column:o}}).filter(e=>e&&!B0e.some(t=>t.test(e.file)))}var e$=class{constructor(e=null){this.isStackTrace=!0,this.stack=V0e(e||Error().stack)}getLocation(){if(this.stack.length===0)return`[Unknown location]`;let e=this.stack[0],t=e.fn;return`${t?`"${t}()" at `:``}"${e.file}:${e.line}"`}getError(e){return this.stack.length===0?e:`${e}\n${this.stack.map(e=>{let t=`${e.file}:${e.line}:${e.column}`;return e.fn?` at ${e.fn} (${t})`:` at ${t}`}).join(`
|
|
10193
10210
|
`)}`}};function t$(e,t=0){let n=3735928559^t,r=1103547991^t;if(Array.isArray(e))for(let t=0,i;t<e.length;t++)i=e[t],n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);else for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),4294967296*(2097151&r)+(n>>>0)}var n$=e=>t$(e),r$=e=>t$(e),i$=(...e)=>t$(e),H0e=new Map([[1,`float`],[2,`vec2`],[3,`vec3`],[4,`vec4`],[9,`mat3`],[16,`mat4`]]),U0e=new WeakMap;function W0e(e){return H0e.get(e)}function a$(e){if(/[iu]?vec\d/.test(e))return e.startsWith(`ivec`)?Int32Array:e.startsWith(`uvec`)?Uint32Array:Float32Array;if(/mat\d/.test(e)||/float/.test(e))return Float32Array;if(/uint/.test(e))return Uint32Array;if(/int/.test(e))return Int32Array;throw Error(`THREE.NodeUtils: Unsupported type: ${e}`)}function G0e(e){if(/float|int|uint/.test(e))return 1;if(/vec2/.test(e))return 2;if(/vec3/.test(e))return 3;if(/vec4/.test(e)||/mat2/.test(e))return 4;if(/mat3/.test(e))return 9;if(/mat4/.test(e))return 16;br(`TSL: Unsupported type: ${e}`,new e$)}function K0e(e){if(/float|int|uint/.test(e))return 1;if(/vec2/.test(e))return 2;if(/vec3/.test(e))return 3;if(/vec4/.test(e)||/mat2/.test(e))return 4;if(/mat3/.test(e))return 12;if(/mat4/.test(e))return 16;br(`TSL: Unsupported type: ${e}`,new e$)}function q0e(e){if(/float|int|uint/.test(e))return 4;if(/vec2/.test(e))return 8;if(/vec3/.test(e)||/vec4/.test(e))return 16;if(/mat2/.test(e))return 8;if(/mat3/.test(e)||/mat4/.test(e))return 16;br(`TSL: Unsupported type: ${e}`,new e$)}function o$(e){if(e==null)return null;let t=typeof e;return e.isNode===!0?`node`:t===`number`?`float`:t===`boolean`?`bool`:t===`string`?`string`:t===`function`?`shader`:e.isVector2===!0?`vec2`:e.isVector3===!0?`vec3`:e.isVector4===!0?`vec4`:e.isMatrix2===!0?`mat2`:e.isMatrix3===!0?`mat3`:e.isMatrix4===!0?`mat4`:e.isColor===!0?`color`:e instanceof ArrayBuffer?`ArrayBuffer`:null}function s$(e,...t){let n=e?e.slice(-4):void 0;return t.length===1&&(n===`vec2`?t=[t[0],t[0]]:n===`vec3`?t=[t[0],t[0],t[0]]:n===`vec4`&&(t=[t[0],t[0],t[0],t[0]])),e===`color`?new sa(...t):n===`vec2`?new $r(...t):n===`vec3`?new V(...t):n===`vec4`?new yi(...t):n===`mat2`?new yp(...t):n===`mat3`?new ri(...t):n===`mat4`?new Ei(...t):e===`bool`?t[0]||!1:e===`float`||e===`int`||e===`uint`?t[0]||0:e===`string`?t[0]||``:e===`ArrayBuffer`?X0e(t[0]):null}function J0e(e){let t=U0e.get(e);return t===void 0&&(t={},U0e.set(e,t)),t}function Y0e(e){let t=``,n=new Uint8Array(e);for(let e=0;e<n.length;e++)t+=String.fromCharCode(n[e]);return btoa(t)}function X0e(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0)).buffer}var c$={VERTEX:`vertex`,FRAGMENT:`fragment`},l$={NONE:`none`,FRAME:`frame`,RENDER:`render`,OBJECT:`object`},Z0e={BOOLEAN:`bool`,INTEGER:`int`,FLOAT:`float`,VECTOR2:`vec2`,VECTOR3:`vec3`,VECTOR4:`vec4`,MATRIX2:`mat2`,MATRIX3:`mat3`,MATRIX4:`mat4`},u$={READ_ONLY:`readOnly`,WRITE_ONLY:`writeOnly`,READ_WRITE:`readWrite`},Q0e=[`fragment`,`vertex`],d$=[`setup`,`analyze`,`generate`],f$=[...Q0e,`compute`],p$=[`x`,`y`,`z`,`w`],$0e={analyze:`setup`,generate:`analyze`},e2e=0,m$=class e extends Tr{static get type(){return`Node`}constructor(t=null){super(),this.nodeType=t,this.updateType=l$.NONE,this.updateBeforeType=l$.NONE,this.updateAfterType=l$.NONE,this.version=0,this.name=``,this.global=!1,this.parents=!1,this.isNode=!0,this._beforeNodes=null,this._cacheKey=null,this._uuid=null,this._cacheKeyVersion=0,this.id=e2e++,this.stackTrace=null,e.captureStackTrace===!0&&(this.stackTrace=new e$)}set needsUpdate(e){e===!0&&this.version++}get uuid(){return this._uuid===null&&(this._uuid=Qr.generateUUID()),this._uuid}get type(){return this.constructor.type}onUpdate(e,t){return this.updateType=t,this.update=e.bind(this),this}onFrameUpdate(e){return this.onUpdate(e,l$.FRAME)}onRenderUpdate(e){return this.onUpdate(e,l$.RENDER)}onObjectUpdate(e){return this.onUpdate(e,l$.OBJECT)}onReference(e){return this.updateReference=e.bind(this),this}updateReference(){return this}isGlobal(){return this.global}*getChildren(){for(let{childNode:e}of this._getChildren())yield e}dispose(){this.dispatchEvent({type:`dispose`})}traverse(e){e(this);for(let t of this.getChildren())t.traverse(e)}_getChildren(e=new Set){let t=[];e.add(this);for(let n of Object.getOwnPropertyNames(this)){let r=this[n];if(!(n.startsWith(`_`)===!0||e.has(r))){if(Array.isArray(r)===!0)for(let e=0;e<r.length;e++){let i=r[e];i&&i.isNode===!0&&t.push({property:n,index:e,childNode:i})}else if(r&&r.isNode===!0)t.push({property:n,childNode:r});else if(r&&Object.getPrototypeOf(r)===Object.prototype)for(let e in r){if(e.startsWith(`_`)===!0)continue;let i=r[e];i&&i.isNode===!0&&t.push({property:n,index:e,childNode:i})}}}return t}getCacheKey(e=!1,t=null){if(e||=this.version!==this._cacheKeyVersion,e===!0||this._cacheKey===null){t===null&&(t=new Set);let n=[];for(let{property:r,childNode:i}of this._getChildren(t))n.push(n$(r.slice(0,-4)),i.getCacheKey(e,t));this._cacheKey=i$(r$(n),this.customCacheKey()),this._cacheKeyVersion=this.version}return this._cacheKey}customCacheKey(){return this.id}getScope(){return this}getHash(){return String(this.id)}getUpdateType(){return this.updateType}getUpdateBeforeType(){return this.updateBeforeType}getUpdateAfterType(){return this.updateAfterType}getElementType(e){let t=this.getNodeType(e);return e.getElementType(t)}getMemberType(){return`void`}getNodeType(e,t=null){let n=e.getDataFromNode(this),r;return t===null?(r=n.type,r===void 0&&(r=this.generateNodeType(e),n.type=r)):(n.typeFromOutput=n.typeFromOutput||{},r=n.typeFromOutput[t],r===void 0&&(r=this.generateNodeType(e,t),n.typeFromOutput[t]=r)),r}generateNodeType(e,t=null){let n=e.getNodeProperties(this);return n.outputNode?n.outputNode.getNodeType(e,t):this.nodeType}getShared(e){let t=this.getHash(e);return e.getNodeFromHash(t)||this}getArrayCount(){return null}setup(e){let t=e.getNodeProperties(this),n=0;for(let e of this.getChildren())t[`node`+n++]=e;return t.outputNode||null}analyze(e,t=null){let n=e.increaseUsage(this);if(this.parents===!0){let n=e.getDataFromNode(this,`any`);n.stages=n.stages||{},n.stages[e.shaderStage]=n.stages[e.shaderStage]||[],n.stages[e.shaderStage].push(t)}if(n===1){let t=e.getNodeProperties(this);for(let n of Object.values(t))n&&n.isNode===!0&&n.build(e,this)}}generate(e,t){let{outputNode:n}=e.getNodeProperties(this);if(n&&n.isNode===!0)return n.build(e,t)}updateBefore(){yr(`Abstract function.`)}updateAfter(){yr(`Abstract function.`)}update(){yr(`Abstract function.`)}before(e){return this._beforeNodes===null&&(this._beforeNodes=[]),this._beforeNodes.push(e),this}build(e,t=null){let n=this.getShared(e);if(this!==n)return n.build(e,t);if(this._beforeNodes!==null){let n=this._beforeNodes;this._beforeNodes=null;for(let r of n)r.build(e,t);this._beforeNodes=n}let r=e.getDataFromNode(this);r.buildStages=r.buildStages||{},r.buildStages[e.buildStage]=!0;let i=$0e[e.buildStage];if(i&&r.buildStages[i]!==!0){let t=e.getBuildStage();e.setBuildStage(i),this.build(e),e.setBuildStage(t)}e.addChain(this);let a=null,o=e.getBuildStage();if(o===`setup`){e.addNode(this),this.updateReference(e);let t=e.getNodeProperties(this);if(t.initialized!==!0){t.initialized=!0,t.outputNode=this.setup(e)||t.outputNode||null;for(let n of Object.values(t))if(n&&n.isNode===!0){if(n.parents===!0){let t=e.getNodeProperties(n);t.parents=t.parents||[],t.parents.push(this)}n.build(e)}e.addSequentialNode(this)}a=t.outputNode}else if(o===`analyze`)this.analyze(e,t);else if(o===`generate`){if(this.generate.length<2){let n=this.getNodeType(e),r=e.getDataFromNode(this);a=r.snippet,a===void 0?r.generated===void 0?(r.generated=!0,a=this.generate(e)||``,r.snippet=a):(yr(`Node: Recursion detected.`,this),a=`/* Recursion detected. */`):r.flowCodes!==void 0&&e.context.nodeBlock!==void 0&&e.addFlowCodeHierarchy(this,e.context.nodeBlock),a=e.format(a,n,t)}else a=this.generate(e,t)||``;a===``&&t!==null&&t!==`void`&&t!==`OutputType`&&(br(`TSL: Invalid generated code, expected a "${t}".`),a=e.generateConst(t))}return e.removeChain(this),a}getSerializeChildren(){return this._getChildren()}serialize(e){let t=this.getSerializeChildren(),n={};for(let{property:r,index:i,childNode:a}of t)i===void 0?n[r]=a.toJSON(e.meta).uuid:(n[r]===void 0&&(n[r]=Number.isInteger(i)?[]:{}),n[r][i]=a.toJSON(e.meta).uuid);Object.keys(n).length>0&&(e.inputNodes=n)}deserialize(e){if(e.inputNodes!==void 0){let t=e.meta.nodes;for(let n in e.inputNodes)if(Array.isArray(e.inputNodes[n])){let r=[];for(let i of e.inputNodes[n])r.push(t[i]);this[n]=r}else if(typeof e.inputNodes[n]==`object`){let r={};for(let i in e.inputNodes[n])r[i]=t[e.inputNodes[n][i]];this[n]=r}else{let r=e.inputNodes[n];this[n]=t[r]}}}toJSON(e){let{uuid:t,type:n}=this,r=e===void 0||typeof e==`string`;r&&(e={textures:{},images:{},nodes:{}});let i=e.nodes[t];i===void 0&&(i={uuid:t,type:n,meta:e,metadata:{version:4.7,type:`Node`,generator:`Node.toJSON`}},r!==!0&&(e.nodes[i.uuid]=i),this.serialize(i),delete i.meta);function a(e){let t=[];for(let n in e){let r=e[n];delete r.metadata,t.push(r)}return t}if(r){let t=a(e.textures),n=a(e.images),r=a(e.nodes);t.length>0&&(i.textures=t),n.length>0&&(i.images=n),r.length>0&&(i.nodes=r)}return i}};m$.captureStackTrace=!1;var h$=class extends m${static get type(){return`ArrayElementNode`}constructor(e,t){super(),this.node=e,this.indexNode=t,this.isArrayElementNode=!0}generateNodeType(e){return this.node.getElementType(e)}getMemberType(e,t){return this.node.getMemberType(e,t)}generate(e){let t=this.indexNode.getNodeType(e);return`${this.node.build(e)}[ ${this.indexNode.build(e,!e.isVector(t)&&e.isInteger(t)?t:`uint`)} ]`}},t2e=class extends m${static get type(){return`ConvertNode`}constructor(e,t){super(),this.node=e,this.convertTo=t}generateNodeType(e){let t=this.node.getNodeType(e),n=null;for(let r of this.convertTo.split(`|`))(n===null||e.getTypeLength(t)===e.getTypeLength(r))&&(n=r);return n}serialize(e){super.serialize(e),e.convertTo=this.convertTo}deserialize(e){super.deserialize(e),this.convertTo=e.convertTo}generate(e,t){let n=this.node,r=this.getNodeType(e),i=n.build(e,r);return e.format(i,r,t)}},g$=class extends m${static get type(){return`TempNode`}constructor(e=null){super(e),this.isTempNode=!0}hasDependencies(e){return e.getDataFromNode(this).usageCount>1}build(e,t){if(e.getBuildStage()===`generate`){let n=e.getVectorType(this.getNodeType(e,t)),r=e.getDataFromNode(this);if(r.propertyName!==void 0)return e.format(r.propertyName,n,t);if(n!==`void`&&t!==`void`&&this.hasDependencies(e)){let i=super.build(e,n),a=e.getVarFromNode(this,null,n),o=e.getPropertyName(a);return e.addLineFlowCode(`${o} = ${i}`,this),r.snippet=i,r.propertyName=o,e.format(r.propertyName,n,t)}}return super.build(e,t)}},n2e=class extends g${static get type(){return`JoinNode`}constructor(e=[],t=null){super(t),this.nodes=e}generateNodeType(e){return this.nodeType===null?e.getTypeFromLength(this.nodes.reduce((t,n)=>t+e.getTypeLength(n.getNodeType(e)),0)):e.getVectorType(this.nodeType)}generate(e,t){let n=this.getNodeType(e),r=e.getTypeLength(n),i=this.nodes,a=e.getComponentType(n),o=[],s=0;for(let t of i){if(s>=r){br(`TSL: Length of parameters exceeds maximum length of function '${n}()' type.`,this.stackTrace);break}let i=t.getNodeType(e),c=e.getTypeLength(i),l;if(s+c>r&&(br(`TSL: Length of '${n}()' data exceeds maximum length of output type.`,this.stackTrace),c=r-s,i=e.getTypeFromLength(c)),s+=c,l=t.build(e,i),e.getComponentType(i)!==a){let t=e.getTypeFromLength(c,a);l=e.format(l,i,t)}o.push(l)}let c=`${e.getType(n)}( ${o.join(`, `)} )`;return e.format(c,n,t)}},r2e=p$.join(``),i2e=class extends m${static get type(){return`SplitNode`}constructor(e,t=`x`){super(),this.node=e,this.components=t,this.isSplitNode=!0}getVectorLength(){let e=this.components.length;for(let t of this.components)e=Math.max(p$.indexOf(t)+1,e);return e}getComponentType(e){return e.getComponentType(this.node.getNodeType(e))}generateNodeType(e){return e.getTypeFromLength(this.components.length,this.getComponentType(e))}getScope(){return this.node.getScope()}generate(e,t){let n=this.node,r=e.getTypeLength(n.getNodeType(e)),i=null;if(r>1){let a=null;this.getVectorLength()>=r&&(a=e.getTypeFromLength(this.getVectorLength(),this.getComponentType(e)));let o=n.build(e,a);i=this.components.length===r&&this.components===r2e.slice(0,this.components.length)?e.format(o,a,t):e.format(`${o}.${this.components}`,this.getNodeType(e),t)}else i=n.build(e,t);return i}serialize(e){super.serialize(e),e.components=this.components}deserialize(e){super.deserialize(e),this.components=e.components}},a2e=class extends g${static get type(){return`SetNode`}constructor(e,t,n){super(),this.sourceNode=e,this.components=t,this.targetNode=n}generateNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){let{sourceNode:t,components:n,targetNode:r}=this,i=this.getNodeType(e),a=e.getComponentType(r.getNodeType(e)),o=e.getTypeFromLength(n.length,a),s=r.build(e,o),c=t.build(e,i),l=e.getTypeLength(i),u=[];for(let e=0;e<l;e++){let t=p$[e];t===n[0]?(u.push(s),e+=n.length-1):u.push(c+`.`+t)}return`${e.getType(i)}( ${u.join(`, `)} )`}},o2e=class extends g${static get type(){return`FlipNode`}constructor(e,t){super(),this.sourceNode=e,this.components=t}generateNodeType(e){return this.sourceNode.getNodeType(e)}generate(e){let{components:t,sourceNode:n}=this,r=this.getNodeType(e),i=n.build(e),a=e.getVarFromNode(this),o=e.getPropertyName(a);e.addLineFlowCode(o+` = `+i,this);let s=e.getTypeLength(r),c=[],l=0;for(let e=0;e<s;e++){let n=p$[e];n===t[l]?(c.push(`1.0 - `+(o+`.`+n)),l++):c.push(o+`.`+n)}return`${e.getType(r)}( ${c.join(`, `)} )`}},_$=class extends m${static get type(){return`InputNode`}constructor(e,t=null){super(t),this.isInputNode=!0,this.value=e,this.precision=null}generateNodeType(){return this.nodeType===null?o$(this.value):this.nodeType}getInputType(e){return this.getNodeType(e)}setPrecision(e){return this.precision=e,this}serialize(e){super.serialize(e),e.value=this.value,this.value&&this.value.toArray&&(e.value=this.value.toArray()),e.valueType=o$(this.value),e.nodeType=this.nodeType,e.valueType===`ArrayBuffer`&&(e.value=Y0e(e.value)),e.precision=this.precision}deserialize(e){super.deserialize(e),this.nodeType=e.nodeType,this.value=Array.isArray(e.value)?s$(e.valueType,...e.value):e.value,this.precision=e.precision||null,this.value&&this.value.fromArray&&(this.value=this.value.fromArray(e.value))}generate(){yr(`Abstract function.`)}},s2e=/float|u?int/,v$=class extends _${static get type(){return`ConstNode`}constructor(e,t=null){super(e,t),this.isConstNode=!0}generateConst(e){return e.generateConst(this.getNodeType(e),this.value)}generate(e,t){let n=this.getNodeType(e);return s2e.test(n)&&s2e.test(t)?e.generateConst(t,this.value):e.format(this.generateConst(e),n,t)}},c2e=class extends m${static get type(){return`MemberNode`}constructor(e,t){super(),this.structNode=e,this.property=t,this.isMemberNode=!0}hasMember(e){return this.structNode.isMemberNode&&this.structNode.hasMember(e)===!1?!1:this.structNode.getMemberType(e,this.property)!==`void`}generateNodeType(e){return this.hasMember(e)===!1?`float`:this.structNode.getMemberType(e,this.property)}getMemberType(e,t){if(this.hasMember(e)===!1)return`float`;let n=this.getNodeType(e);return e.getStructTypeNode(n).getMemberType(e,t)}generate(e){if(this.hasMember(e)===!1){yr(`TSL: Member "${this.property}" does not exist in struct.`,this.stackTrace);let t=this.getNodeType(e);return e.generateConst(t)}return this.structNode.build(e)+`.`+this.property}},y$=null,b$=new Map;function x$(e,t){if(b$.has(e))yr(`TSL: Redefinition of method chaining '${e}'.`);else{if(typeof t!=`function`)throw Error(`THREE.TSL: Node element ${e} is not a function`);b$.set(e,t),e!==`assign`&&(m$.prototype[e]=function(...e){return this.isStackNode?this.addToStack(t(...e)):t(this,...e)},m$.prototype[e+`Assign`]=function(...e){return this.isStackNode?this.assign(e[0],t(...e)):this.assign(t(this,...e))})}}var l2e=e=>e.replace(/r|s/g,`x`).replace(/g|t/g,`y`).replace(/b|p/g,`z`).replace(/a|q/g,`w`),u2e=e=>l2e(e).split(``).sort().join(``);m$.prototype.assign=function(...e){if(this.isStackNode!==!0)return y$===null?br(`TSL: No stack defined for assign operation. Make sure the assign is inside a Fn().`,new e$):y$.assign(this,...e),this;{let t=b$.get(`assign`);return this.addToStack(t(...e))}},m$.prototype.toVarIntent=function(){return this},m$.prototype.get=function(e){return new c2e(this,e)};var S$={};function C$(e,t,n){S$[e]=S$[t]=S$[n]={get(){this._cache=this._cache||{};let t=this._cache[e];return t===void 0&&(t=new i2e(this,e),this._cache[e]=t),t},set(t){this[e].assign(I$(t))}};let r=e.toUpperCase(),i=t.toUpperCase(),a=n.toUpperCase();m$.prototype[`set`+r]=m$.prototype[`set`+i]=m$.prototype[`set`+a]=function(t){let n=u2e(e);return new a2e(this,n,I$(t))},m$.prototype[`flip`+r]=m$.prototype[`flip`+i]=m$.prototype[`flip`+a]=function(){let t=u2e(e);return new o2e(this,t)}}var w$=[`x`,`y`,`z`,`w`],T$=[`r`,`g`,`b`,`a`],E$=[`s`,`t`,`p`,`q`];for(let e=0;e<4;e++){let t=w$[e],n=T$[e],r=E$[e];C$(t,n,r);for(let i=0;i<4;i++){t=w$[e]+w$[i],n=T$[e]+T$[i],r=E$[e]+E$[i],C$(t,n,r);for(let a=0;a<4;a++){t=w$[e]+w$[i]+w$[a],n=T$[e]+T$[i]+T$[a],r=E$[e]+E$[i]+E$[a],C$(t,n,r);for(let o=0;o<4;o++)t=w$[e]+w$[i]+w$[a]+w$[o],n=T$[e]+T$[i]+T$[a]+T$[o],r=E$[e]+E$[i]+E$[a]+E$[o],C$(t,n,r)}}}for(let e=0;e<32;e++)S$[e]={get(){this._cache=this._cache||{};let t=this._cache[e];return t===void 0&&(t=new h$(this,new v$(e,`uint`)),this._cache[e]=t),t},set(t){this[e].assign(I$(t))}};Object.defineProperties(m$.prototype,S$);var d2e=new WeakMap,f2e=function(e,t=null){let n=o$(e);return n===`node`?e:t===null&&(n===`float`||n===`boolean`)||n&&n!==`shader`&&n!==`string`?I$(M$(e,t)):n===`shader`?e.isFn?e:J(e):e},p2e=function(e,t=null){for(let n in e)e[n]=I$(e[n],t);return e},m2e=function(e,t=null){let n=e.length;for(let r=0;r<n;r++)e[r]=I$(e[r],t);return e},h2e=function(e,t=null,n=null,r=null){function i(e){return r===null?e=I$(e):(e=I$(Object.assign(e,r)),r.intent===!0&&(e=e.toVarIntent())),e}let a,o=t,s,c;function l(t){let n;return n=o?/[a-z]/i.test(o)?o+`()`:o:e.type,s!==void 0&&t.length<s?(br(`TSL: "${n}" parameter length is less than minimum required.`,new e$),t.concat(Array(s-t.length).fill(0))):c!==void 0&&t.length>c?(br(`TSL: "${n}" parameter length exceeds limit.`,new e$),t.slice(0,c)):t}return t===null?a=(...t)=>i(new e(...z$(l(t)))):n===null?a=(...n)=>i(new e(t,...z$(l(n)))):(n=I$(n),a=(...r)=>i(new e(t,...z$(l(r)),n))),a.setParameterLength=(...e)=>(e.length===1?s=c=e[0]:e.length===2&&([s,c]=e),a),a.setName=e=>(o=e,a),a},g2e=function(e,...t){return new e(...z$(t))},_2e=class extends m${constructor(e,t){super(),this.shaderNode=e,this.rawInputs=t,this.isShaderCallNodeInternal=!0}generateNodeType(e){return this.shaderNode.nodeType||this.getOutputNode(e).getNodeType(e)}getElementType(e){return this.getOutputNode(e).getElementType(e)}getMemberType(e,t){return this.getOutputNode(e).getMemberType(e,t)}call(e){let{shaderNode:t,rawInputs:n}=this,r=e.getNodeProperties(t),i=e.getClosestSubBuild(t.subBuilds)||``,a=i||`default`;if(r[a])return r[a];let o=e.subBuildFn,s=e.fnCall;e.subBuildFn=i,e.fnCall=this;let c=null;if(t.layout){let r=d2e.get(e.constructor);r===void 0&&(r=new WeakMap,d2e.set(e.constructor,r));let i=r.get(t);i===void 0&&(i=I$(e.buildFunctionNode(t)),r.set(t,i)),e.addInclude(i);let a=n?v2e(n):null;c=I$(i.call(a))}else{let r=new Proxy(e,{get:(e,t,n)=>{let r;return r=Symbol.iterator===t?function*(){yield}:Reflect.get(e,t,n),r}}),i=n?y2e(n):null,a=Array.isArray(n)?n.length>0:n!==null,o=t.jsFunc;c=I$(a||o.length>1?o(i,r):o(r))}return e.subBuildFn=o,e.fnCall=s,t.once&&(r[a]=c),c}setupOutput(e){return e.addStack(),e.stack.outputNode=this.call(e),e.removeStack()}getOutputNode(e){let t=e.getNodeProperties(this),n=e.getSubBuildOutput(this);return t[n]=t[n]||this.setupOutput(e),t[n].subBuild=e.getClosestSubBuild(this),t[n]}build(e,t=null){let n=null,r=e.getBuildStage(),i=e.getNodeProperties(this),a=e.getSubBuildOutput(this),o=this.getOutputNode(e),s=e.fnCall;if(e.fnCall=this,r===`setup`){let t=e.getSubBuildProperty(`initialized`,this);if(i[t]!==!0&&(i[t]=!0,i[a]=this.getOutputNode(e),i[a].build(e),this.shaderNode.subBuilds))for(let t of e.chaining){let n=e.getDataFromNode(t,`any`);n.subBuilds=n.subBuilds||new Set;for(let e of this.shaderNode.subBuilds)n.subBuilds.add(e)}n=i[a]}else r===`analyze`?o.build(e,t):r===`generate`&&(n=o.build(e,t)||``);return e.fnCall=s,n}};function v2e(e){let t;return R$(e),t=e[0]&&(e[0].isNode||Object.getPrototypeOf(e[0])!==Object.prototype)?[...e]:e[0],t}function y2e(e){let t=0;return R$(e),new Proxy(e,{get:(n,r,i)=>{let a;if(r===`length`)return a=e.length,a;if(Symbol.iterator===r)a=function*(){for(let t of e)yield I$(t)};else{if(e.length>0){if(Object.getPrototypeOf(e[0])===Object.prototype){let n=e[0];a=n[r]===void 0?n[t++]:Reflect.get(n,r,i)}else e[0]instanceof m$&&(a=e[r]===void 0?e[t++]:Reflect.get(e,r,i))}else a=Reflect.get(n,r,i);a=I$(a)}return a}})}var b2e=class extends m${constructor(e,t){super(t),this.jsFunc=e,this.layout=null,this.global=!0,this.once=!1}setLayout(e){return this.layout=e,this}getLayout(){return this.layout}call(e=null){return new _2e(this,e)}setup(){return this.call()}},x2e=[!1,!0],S2e=[0,1,2,3],C2e=[-1,-2],w2e=[.5,1.5,1/3,1e-6,1e6,Math.PI,Math.PI*2,1/Math.PI,2/Math.PI,1/(Math.PI*2),Math.PI/2],D$=new Map;for(let e of x2e)D$.set(e,new v$(e));var O$=new Map;for(let e of S2e)O$.set(e,new v$(e,`uint`));var k$=new Map([...O$].map(e=>new v$(e.value,`int`)));for(let e of C2e)k$.set(e,new v$(e,`int`));var A$=new Map([...k$].map(e=>new v$(e.value)));for(let e of w2e)A$.set(e,new v$(e));for(let e of w2e)A$.set(-e,new v$(-e));var j$={bool:D$,uint:O$,ints:k$,float:A$},T2e=new Map([...D$,...A$]),M$=(e,t)=>T2e.has(e)?T2e.get(e):e.isNode===!0?e:new v$(e,t),N$=function(e,t=null){return(...n)=>{for(let t of n)if(t===void 0)return br(`TSL: Invalid parameter for the type "${e}".`,new e$),new v$(0,e);if((n.length===0||![`bool`,`float`,`int`,`uint`].includes(e)&&n.every(e=>{let t=typeof e;return t!==`object`&&t!==`function`}))&&(n=[s$(e,...n)]),n.length===1&&t!==null&&t.has(n[0]))return L$(t.get(n[0]));if(n.length===1){let t=M$(n[0],e);return t.nodeType===e?L$(t):L$(new t2e(t,e))}return L$(new n2e(n.map(e=>M$(e)),e))}};function P$(e){return e&&e.isNode&&e.traverse(t=>{t.isConstNode&&(e=t.value)}),!!e}var E2e=e=>e==null?null:e.nodeType||e.convertTo||(typeof e==`string`?e:null);function F$(e,t){return new b2e(e,t)}var I$=(e,t=null)=>f2e(e,t),L$=(e,t=null)=>I$(e,t).toVarIntent(),R$=(e,t=null)=>new p2e(e,t),z$=(e,t=null)=>new m2e(e,t),B$=(e,t=null,n=null,r=null)=>new h2e(e,t,n,r),V$=(e,...t)=>new g2e(e,...t),H$=(e,t=null,n=null,r={})=>new h2e(e,t,n,{...r,intent:!0}),D2e=0,O2e=class extends m${constructor(e,t=null){super();let n=null;t!==null&&(typeof t==`object`?n=t.return:(typeof t==`string`?n=t:br(`TSL: Invalid layout type.`,new e$),t=null)),this.shaderNode=new F$(e,n),t!==null&&this.setLayout(t),this.isFn=!0}setLayout(e){let t=this.shaderNode.nodeType;if(typeof e.inputs!=`object`){let n={name:`fn`+D2e++,type:t,inputs:[]};for(let t in e)t!==`return`&&n.inputs.push({name:t,type:e[t]});e=n}return this.shaderNode.setLayout(e),this}generateNodeType(e){return this.shaderNode.getNodeType(e)||`float`}call(...e){let t=this.shaderNode.call(e);return this.shaderNode.nodeType===`void`&&t.toStack(),t.toVarIntent()}once(e=null){return this.shaderNode.once=!0,this.shaderNode.subBuilds=e,this}generate(e){let t=this.getNodeType(e);return br(`TSL: "Fn()" was declared but not invoked. Try calling it like "Fn()( ...params )".`,this.stackTrace),e.generateConst(t)}};function J(e,t=null){let n=new O2e(e,t);return new Proxy(()=>{},{apply(e,t,r){return n.call(...r)},get(e,t,r){return Reflect.get(n,t,r)},set(e,t,r,i){return Reflect.set(n,t,r,i)}})}var U$=e=>{y$=e},W$=()=>y$,G$=(...e)=>y$.If(...e),k2e=(...e)=>y$.Switch(...e);function K$(e){return y$&&y$.addToStack(e),e}x$(`toStack`,K$);var A2e=new N$(`color`),Y=new N$(`float`,j$.float),X=new N$(`int`,j$.ints),q$=new N$(`uint`,j$.uint),J$=new N$(`bool`,j$.bool),Y$=new N$(`vec2`),X$=new N$(`ivec2`),Z$=new N$(`uvec2`),j2e=new N$(`bvec2`),Z=new N$(`vec3`),Q$=new N$(`ivec3`),$$=new N$(`uvec3`),e1=new N$(`bvec3`),t1=new N$(`vec4`),n1=new N$(`ivec4`),r1=new N$(`uvec4`),M2e=new N$(`bvec4`),i1=new N$(`mat2`),a1=new N$(`mat3`),o1=new N$(`mat4`),N2e=(e=``)=>new v$(e,`string`),P2e=e=>new v$(e,`ArrayBuffer`);x$(`toColor`,A2e),x$(`toFloat`,Y),x$(`toInt`,X),x$(`toUint`,q$),x$(`toBool`,J$),x$(`toVec2`,Y$),x$(`toIVec2`,X$),x$(`toUVec2`,Z$),x$(`toBVec2`,j2e),x$(`toVec3`,Z),x$(`toIVec3`,Q$),x$(`toUVec3`,$$),x$(`toBVec3`,e1),x$(`toVec4`,t1),x$(`toIVec4`,n1),x$(`toUVec4`,r1),x$(`toBVec4`,M2e),x$(`toMat2`,i1),x$(`toMat3`,a1),x$(`toMat4`,o1);var F2e=B$(h$).setParameterLength(2),I2e=(e,t)=>new t2e(I$(e),t),L2e=(e,t)=>new i2e(I$(e),t);x$(`element`,F2e),x$(`convert`,I2e);var R2e=e=>(yr(`TSL: append() has been renamed to Stack().`,new e$),K$(e));x$(`append`,e=>(yr(`TSL: .append() has been renamed to .toStack().`,new e$),K$(e)));var s1=class extends m${static get type(){return`PropertyNode`}constructor(e,t=null,n=!1){super(e),this.name=t,this.varying=n,this.isPropertyNode=!0,this.global=!0}customCacheKey(){return n$(this.type+`:`+(this.name||``)+`:`+(this.varying?`1`:`0`))}getHash(e){return this.name||super.getHash(e)}generate(e){let t;return this.varying===!0?(t=e.getVaryingFromNode(this,this.name),t.needsInterpolation=!0):t=e.getVarFromNode(this,this.name),e.getPropertyName(t)}},c1=(e,t)=>new s1(e,t),l1=(e,t)=>new s1(e,t,!0),u1=V$(s1,`vec4`,`DiffuseColor`),d1=V$(s1,`vec3`,`DiffuseContribution`),f1=V$(s1,`vec3`,`EmissiveColor`),p1=V$(s1,`float`,`Roughness`),m1=V$(s1,`float`,`Metalness`),h1=V$(s1,`float`,`Clearcoat`),g1=V$(s1,`float`,`ClearcoatRoughness`),_1=V$(s1,`vec3`,`Sheen`),v1=V$(s1,`float`,`SheenRoughness`),y1=V$(s1,`float`,`Iridescence`),b1=V$(s1,`float`,`IridescenceIOR`),x1=V$(s1,`float`,`IridescenceThickness`),S1=V$(s1,`float`,`AlphaT`),C1=V$(s1,`float`,`Anisotropy`),w1=V$(s1,`vec3`,`AnisotropyT`),T1=V$(s1,`vec3`,`AnisotropyB`),E1=V$(s1,`color`,`SpecularColor`),D1=V$(s1,`color`,`SpecularColorBlended`),O1=V$(s1,`float`,`SpecularF90`),k1=V$(s1,`float`,`Shininess`),A1=V$(s1,`vec4`,`Output`),j1=V$(s1,`float`,`dashSize`),M1=V$(s1,`float`,`gapSize`),z2e=V$(s1,`float`,`pointWidth`),N1=V$(s1,`float`,`IOR`),P1=V$(s1,`float`,`Transmission`),F1=V$(s1,`float`,`Thickness`),I1=V$(s1,`float`,`AttenuationDistance`),L1=V$(s1,`color`,`AttenuationColor`),R1=V$(s1,`float`,`Dispersion`),B2e=class extends m${static get type(){return`UniformGroupNode`}constructor(e,t=!1,n=1,r=null){super(`string`),this.name=e,this.shared=t,this.order=n,this.updateType=r,this.isUniformGroup=!0}update(){this.needsUpdate=!0}serialize(e){super.serialize(e),e.name=this.name,e.version=this.version,e.shared=this.shared}deserialize(e){super.deserialize(e),this.name=e.name,this.version=e.version,this.shared=e.shared}},V2e=(e,t=1,n=null)=>new B2e(e,!1,t,n),z1=(e,t=0,n=null)=>new B2e(e,!0,t,n),H2e=z1(`frame`,0,l$.FRAME),B1=z1(`render`,0,l$.RENDER),U2e=V2e(`object`,1,l$.OBJECT),V1=class extends _${static get type(){return`UniformNode`}constructor(e,t=null){super(e,t),this.isUniformNode=!0,this.name=``,this.groupNode=U2e}setName(e){return this.name=e,this}label(e){return yr(`TSL: "label()" has been deprecated. Use "setName()" instead.`,new e$),this.setName(e)}setGroup(e){return this.groupNode=e,this}getGroup(){return this.groupNode}getUniformHash(e){return this.getHash(e)}onUpdate(e,t){return e=e.bind(this),super.onUpdate(t=>{let n=e(t,this);n!==void 0&&(this.value=n)},t)}getInputType(e){let t=super.getInputType(e);return t===`bool`&&(t=`uint`),t}generate(e,t){let n=this.getNodeType(e),r=this.getUniformHash(e),i=e.getNodeFromHash(r);i===void 0&&(e.setHashNode(this,r),i=this);let a=i.getInputType(e),o=e.getUniformFromNode(i,a,e.shaderStage,this.name||e.context.nodeName),s=e.getPropertyName(o);e.context.nodeName!==void 0&&delete e.context.nodeName;let c=s;if(n===`bool`){let t=e.getDataFromNode(this),r=t.propertyName;if(r===void 0){let i=e.getVarFromNode(this,null,`bool`);r=e.getPropertyName(i),t.propertyName=r,c=e.format(s,a,n),e.addLineFlowCode(`${r} = ${c}`,this)}c=r}return e.format(c,n,t)}},H1=(e,t)=>{let n=E2e(t||e);if(n===e&&(e=s$(n)),e&&e.isNode===!0){let t=e.value;e.traverse(e=>{e.isConstNode===!0&&(t=e.value)}),e=t}return new V1(e,n)},W2e=class extends g${static get type(){return`ArrayNode`}constructor(e,t,n=null){super(e),this.count=t,this.values=n,this.isArrayNode=!0}getArrayCount(){return this.count}generateNodeType(e){return this.nodeType===null?this.values[0].getNodeType(e):this.nodeType}getElementType(e){return this.getNodeType(e)}getMemberType(e,t){return this.nodeType===null?this.values[0].getMemberType(e,t):super.getMemberType(e,t)}generate(e){let t=this.getNodeType(e);return e.generateArray(t,this.count,this.values)}},G2e=(...e)=>{let t;if(e.length===1){let n=e[0];t=new W2e(null,n.length,n)}else{let n=e[0],r=e[1];t=new W2e(n,r)}return I$(t)};x$(`toArray`,(e,t)=>G2e(Array(t).fill(e)));var K2e=B$(class extends g${static get type(){return`AssignNode`}constructor(e,t){super(),this.targetNode=e,this.sourceNode=t,this.isAssignNode=!0}hasDependencies(){return!1}generateNodeType(e,t){return t===`void`?`void`:this.targetNode.getNodeType(e)}needsSplitAssign(e){let{targetNode:t}=this;if(e.isAvailable(`swizzleAssign`)===!1&&t.isSplitNode&&t.components.length>1){let n=e.getTypeLength(t.node.getNodeType(e));return p$.join(``).slice(0,n)!==t.components}return!1}setup(e){let{targetNode:t,sourceNode:n}=this,r=t.getScope(),i=e.getDataFromNode(r);i.assign=!0;let a=e.getNodeProperties(this);a.sourceNode=n,a.targetNode=t.context({assign:!0})}generate(e,t){let{targetNode:n,sourceNode:r}=e.getNodeProperties(this),i=this.needsSplitAssign(e),a=n.build(e),o=n.getNodeType(e),s=r.build(e,o),c=r.getNodeType(e),l=e.getDataFromNode(this),u;if(l.initialized===!0)t!==`void`&&(u=a);else if(i){let r=e.getVarFromNode(this,null,o),i=e.getPropertyName(r);e.addLineFlowCode(`${i} = ${s}`,this);let c=n.node,l=c.node.context({assign:!0}).build(e);for(let t=0;t<c.components.length;t++){let n=c.components[t];e.addLineFlowCode(`${l}.${n} = ${i}[ ${t} ]`,this)}t!==`void`&&(u=a)}else u=`${a} = ${s}`,(t===`void`||c===`void`)&&(e.addLineFlowCode(u,this),t!==`void`&&(u=a));return l.initialized=!0,e.format(u,o,t)}}).setParameterLength(2);x$(`assign`,K2e);var q2e=class extends g${static get type(){return`FunctionCallNode`}constructor(e=null,t={}){super(),this.functionNode=e,this.parameters=t}setParameters(e){return this.parameters=e,this}getParameters(){return this.parameters}generateNodeType(e){return this.functionNode.getNodeType(e)}getMemberType(e,t){return this.functionNode.getMemberType(e,t)}generate(e){let t=[],n=this.functionNode,r=n.getInputs(e),i=this.parameters,a=(t,n)=>{let r=n.type,i=r===`pointer`,a;return a=i?`&`+t.build(e):t.build(e,r),a};if(Array.isArray(i)){if(i.length>r.length)br(`TSL: The number of provided parameters exceeds the expected number of inputs in 'Fn()'.`),i.length=r.length;else if(i.length<r.length)for(br(`TSL: The number of provided parameters is less than the expected number of inputs in 'Fn()'.`);i.length<r.length;)i.push(Y(0));for(let e=0;e<i.length;e++)t.push(a(i[e],r[e]))}else for(let e of r){let n=i[e.name];n===void 0?(br(`TSL: Input '${e.name}' not found in \'Fn()\'.`),t.push(a(Y(0),e))):t.push(a(n,e))}return`${n.build(e,`property`)}( ${t.join(`, `)} )`}},J2e=(e,...t)=>(t=t.length>1||t[0]&&t[0].isNode===!0?z$(t):R$(t[0]),new q2e(I$(e),t));x$(`call`,J2e);var Y2e={"==":`equal`,"!=":`notEqual`,"<":`lessThan`,">":`greaterThan`,"<=":`lessThanEqual`,">=":`greaterThanEqual`,"%":`mod`},U1=class e extends g${static get type(){return`OperatorNode`}constructor(t,n,r,...i){if(super(),i.length>0){let a=new e(t,n,r);for(let n=0;n<i.length-1;n++)a=new e(t,a,i[n]);n=a,r=i[i.length-1]}this.op=t,this.aNode=n,this.bNode=r,this.isOperatorNode=!0}getOperatorMethod(e,t){return e.getMethod(Y2e[this.op],t)}generateNodeType(e,t=null){let n=this.op,r=this.aNode,i=this.bNode,a=r.getNodeType(e),o=i?i.getNodeType(e):null;if(a===`void`||o===`void`)return t||`void`;if(n===`%`)return a;if(n===`~`||n===`&`||n===`|`||n===`^`||n===`>>`||n===`<<`)return e.getIntegerType(a);if(n===`!`||n===`&&`||n===`||`||n===`^^`)return`bool`;if(n===`==`||n===`!=`||n===`<`||n===`>`||n===`<=`||n===`>=`){let t=Math.max(e.getTypeLength(a),e.getTypeLength(o));return t>1?`bvec${t}`:`bool`}if(e.isMatrix(a)){if(o===`float`)return a;if(e.isVector(o))return e.getVectorFromMatrix(a);if(e.isMatrix(o))return a}else if(e.isMatrix(o)){if(a===`float`)return o;if(e.isVector(a))return e.getVectorFromMatrix(o)}return e.getTypeLength(o)>e.getTypeLength(a)?o:a}generate(e,t){let n=this.op,{aNode:r,bNode:i}=this,a=this.getNodeType(e,t),o=null,s=null;a===`void`?o=s=a:(o=r.getNodeType(e),s=i?i.getNodeType(e):null,n===`<`||n===`>`||n===`<=`||n===`>=`||n===`==`||n===`!=`?e.isVector(o)?s=o:e.isVector(s)?o=s:o!==s&&(o=s=`float`):n===`>>`||n===`<<`?(o=a,s=e.changeComponentType(s,`uint`)):n===`%`?(o=a,s=e.isInteger(o)&&e.isInteger(s)?s:o):e.isMatrix(o)?s===`float`?s=`float`:e.isVector(s)?s=e.getVectorFromMatrix(o):e.isMatrix(s)||(o=s=a):o=e.isMatrix(s)?o===`float`?`float`:e.isVector(o)?e.getVectorFromMatrix(s):s=a:s=a);let c=r.build(e,o),l=i?i.build(e,s):null,u=e.getFunctionOperator(n);if(t!==`void`){let r=e.renderer.coordinateSystem===tr;if(n===`==`||n===`!=`||n===`<`||n===`>`||n===`<=`||n===`>=`)return r&&e.isVector(o)?e.format(`${this.getOperatorMethod(e,t)}( ${c}, ${l} )`,a,t):e.format(`( ${c} ${n} ${l} )`,a,t);if(n===`%`)return e.isInteger(s)?e.format(`( ${c} % ${l} )`,a,t):e.format(`${this.getOperatorMethod(e,a)}( ${c}, ${l} )`,a,t);if(n===`!`||n===`~`)return e.format(`(${n}${c})`,o,t);if(u)return e.format(`${u}( ${c}, ${l} )`,a,t);if(e.isMatrix(o)&&s===`float`)return e.format(`( ${l} ${n} ${c} )`,a,t);if(o===`float`&&e.isMatrix(s))return e.format(`${c} ${n} ${l}`,a,t);{let i=`( ${c} ${n} ${l} )`;return!r&&a===`bool`&&e.isVector(o)&&e.isVector(s)&&(i=`all${i}`),e.format(i,a,t)}}if(o!==`void`)return u?e.format(`${u}( ${c}, ${l} )`,a,t):e.isMatrix(o)&&s===`float`?e.format(`${l} ${n} ${c}`,a,t):e.format(`${c} ${n} ${l}`,a,t)}serialize(e){super.serialize(e),e.op=this.op}deserialize(e){super.deserialize(e),this.op=e.op}},W1=H$(U1,`+`).setParameterLength(2,1/0).setName(`add`),G1=H$(U1,`-`).setParameterLength(2,1/0).setName(`sub`),K1=H$(U1,`*`).setParameterLength(2,1/0).setName(`mul`),q1=H$(U1,`/`).setParameterLength(2,1/0).setName(`div`),J1=H$(U1,`%`).setParameterLength(2).setName(`mod`),X2e=H$(U1,`==`).setParameterLength(2).setName(`equal`),Z2e=H$(U1,`!=`).setParameterLength(2).setName(`notEqual`),Q2e=H$(U1,`<`).setParameterLength(2).setName(`lessThan`),Y1=H$(U1,`>`).setParameterLength(2).setName(`greaterThan`),$2e=H$(U1,`<=`).setParameterLength(2).setName(`lessThanEqual`),e4e=H$(U1,`>=`).setParameterLength(2).setName(`greaterThanEqual`),t4e=H$(U1,`&&`).setParameterLength(2,1/0).setName(`and`),n4e=H$(U1,`||`).setParameterLength(2,1/0).setName(`or`),r4e=H$(U1,`!`).setParameterLength(1).setName(`not`),i4e=H$(U1,`^^`).setParameterLength(2).setName(`xor`),a4e=H$(U1,`&`).setParameterLength(2).setName(`bitAnd`),o4e=H$(U1,`~`).setParameterLength(1).setName(`bitNot`),s4e=H$(U1,`|`).setParameterLength(2).setName(`bitOr`),c4e=H$(U1,`^`).setParameterLength(2).setName(`bitXor`),l4e=H$(U1,`<<`).setParameterLength(2).setName(`shiftLeft`),u4e=H$(U1,`>>`).setParameterLength(2).setName(`shiftRight`),d4e=J(([e])=>(e.addAssign(1),e)),f4e=J(([e])=>(e.subAssign(1),e)),p4e=J(([e])=>{let t=X(e).toConst();return e.addAssign(1),t}),m4e=J(([e])=>{let t=X(e).toConst();return e.subAssign(1),t});x$(`add`,W1),x$(`sub`,G1),x$(`mul`,K1),x$(`div`,q1),x$(`mod`,J1),x$(`equal`,X2e),x$(`notEqual`,Z2e),x$(`lessThan`,Q2e),x$(`greaterThan`,Y1),x$(`lessThanEqual`,$2e),x$(`greaterThanEqual`,e4e),x$(`and`,t4e),x$(`or`,n4e),x$(`not`,r4e),x$(`xor`,i4e),x$(`bitAnd`,a4e),x$(`bitNot`,o4e),x$(`bitOr`,s4e),x$(`bitXor`,c4e),x$(`shiftLeft`,l4e),x$(`shiftRight`,u4e),x$(`incrementBefore`,d4e),x$(`decrementBefore`,f4e),x$(`increment`,p4e),x$(`decrement`,m4e);var h4e=(e,t)=>(yr(`TSL: "modInt()" is deprecated. Use "mod( int( ... ) )" instead.`,new e$),J1(X(e),X(t)));x$(`modInt`,h4e);var X1=class e extends g${static get type(){return`MathNode`}constructor(t,n,r=null,i=null){if(super(),(t===e.MAX||t===e.MIN)&&arguments.length>3){let a=new e(t,n,r);for(let n=2;n<arguments.length-1;n++)a=new e(t,a,arguments[n]);n=a,r=arguments[arguments.length-1],i=null}this.method=t,this.aNode=n,this.bNode=r,this.cNode=i,this.isMathNode=!0}getInputType(e){let t=this.aNode.getNodeType(e),n=this.bNode?this.bNode.getNodeType(e):null,r=this.cNode?this.cNode.getNodeType(e):null,i=e.isMatrix(t)?0:e.getTypeLength(t),a=e.isMatrix(n)?0:e.getTypeLength(n),o=e.isMatrix(r)?0:e.getTypeLength(r);return i>a&&i>o?t:a>o?n:o>i?r:t}generateNodeType(t){let n=this.method;return n===e.LENGTH||n===e.DISTANCE||n===e.DOT?`float`:n===e.CROSS?`vec3`:n===e.ALL||n===e.ANY?`bool`:n===e.EQUALS?t.changeComponentType(this.aNode.getNodeType(t),`bool`):this.getInputType(t)}setup(t){let{aNode:n,bNode:r,method:i}=this,a=null;if(i===e.ONE_MINUS)a=G1(1,n);else if(i===e.RECIPROCAL)a=q1(1,n);else if(i===e.DIFFERENCE)a=p0(G1(n,r));else if(i===e.TRANSFORM_DIRECTION){let e=n,i=r;t.isMatrix(e.getNodeType(t))?i=t1(Z(i),0):e=t1(Z(e),0);let o=K1(e,i).xyz;a=s0(o)}return a===null?super.setup(t):a}generate(t,n){if(t.getNodeProperties(this).outputNode)return super.generate(t,n);let r=this.method,i=this.getNodeType(t),a=this.getInputType(t),o=this.aNode,s=this.bNode,c=this.cNode,l=t.renderer.coordinateSystem;if(r===e.NEGATE)return t.format(`( - `+o.build(t,a)+` )`,i,n);{let u=[];return r===e.CROSS?u.push(o.build(t,i),s.build(t,i)):l===2e3&&r===e.STEP?u.push(o.build(t,t.getTypeLength(o.getNodeType(t))===1?`float`:a),s.build(t,a)):l===2e3&&(r===e.MIN||r===e.MAX)?u.push(o.build(t,a),s.build(t,t.getTypeLength(s.getNodeType(t))===1?`float`:a)):r===e.REFRACT?u.push(o.build(t,a),s.build(t,a),c.build(t,`float`)):r===e.MIX?u.push(o.build(t,a),s.build(t,a),c.build(t,t.getTypeLength(c.getNodeType(t))===1?`float`:a)):(l===2001&&r===e.ATAN&&s!==null&&(r=`atan2`),t.shaderStage!==`fragment`&&(r===e.DFDX||r===e.DFDY)&&(yr(`TSL: '${r}' is not supported in the ${t.shaderStage} stage.`,this.stackTrace),r=`/*`+r+`*/`),u.push(o.build(t,a)),s!==null&&u.push(s.build(t,a)),c!==null&&u.push(c.build(t,a))),t.format(`${t.getMethod(r,i)}( ${u.join(`, `)} )`,i,n)}}serialize(e){super.serialize(e),e.method=this.method}deserialize(e){super.deserialize(e),this.method=e.method}};X1.ALL=`all`,X1.ANY=`any`,X1.RADIANS=`radians`,X1.DEGREES=`degrees`,X1.EXP=`exp`,X1.EXP2=`exp2`,X1.LOG=`log`,X1.LOG2=`log2`,X1.SQRT=`sqrt`,X1.INVERSE_SQRT=`inversesqrt`,X1.FLOOR=`floor`,X1.CEIL=`ceil`,X1.NORMALIZE=`normalize`,X1.FRACT=`fract`,X1.SIN=`sin`,X1.SINH=`sinh`,X1.COS=`cos`,X1.COSH=`cosh`,X1.TAN=`tan`,X1.TANH=`tanh`,X1.ASIN=`asin`,X1.ASINH=`asinh`,X1.ACOS=`acos`,X1.ACOSH=`acosh`,X1.ATAN=`atan`,X1.ATANH=`atanh`,X1.ABS=`abs`,X1.SIGN=`sign`,X1.LENGTH=`length`,X1.NEGATE=`negate`,X1.ONE_MINUS=`oneMinus`,X1.DFDX=`dFdx`,X1.DFDY=`dFdy`,X1.ROUND=`round`,X1.RECIPROCAL=`reciprocal`,X1.TRUNC=`trunc`,X1.FWIDTH=`fwidth`,X1.TRANSPOSE=`transpose`,X1.DETERMINANT=`determinant`,X1.INVERSE=`inverse`,X1.EQUALS=`equals`,X1.MIN=`min`,X1.MAX=`max`,X1.STEP=`step`,X1.REFLECT=`reflect`,X1.DISTANCE=`distance`,X1.DIFFERENCE=`difference`,X1.DOT=`dot`,X1.CROSS=`cross`,X1.POW=`pow`,X1.TRANSFORM_DIRECTION=`transformDirection`,X1.MIX=`mix`,X1.CLAMP=`clamp`,X1.REFRACT=`refract`,X1.SMOOTHSTEP=`smoothstep`,X1.FACEFORWARD=`faceforward`;var Z1=Y(1e-6),g4e=Y(1e6),Q1=Y(Math.PI),_4e=Y(Math.PI*2),v4e=Y(Math.PI*2),y4e=Y(Math.PI*.5),b4e=H$(X1,X1.ALL).setParameterLength(1),x4e=H$(X1,X1.ANY).setParameterLength(1),S4e=H$(X1,X1.RADIANS).setParameterLength(1),C4e=H$(X1,X1.DEGREES).setParameterLength(1),$1=H$(X1,X1.EXP).setParameterLength(1),e0=H$(X1,X1.EXP2).setParameterLength(1),t0=H$(X1,X1.LOG).setParameterLength(1),n0=H$(X1,X1.LOG2).setParameterLength(1),r0=H$(X1,X1.SQRT).setParameterLength(1),i0=H$(X1,X1.INVERSE_SQRT).setParameterLength(1),a0=H$(X1,X1.FLOOR).setParameterLength(1),o0=H$(X1,X1.CEIL).setParameterLength(1),s0=H$(X1,X1.NORMALIZE).setParameterLength(1),c0=H$(X1,X1.FRACT).setParameterLength(1),l0=H$(X1,X1.SIN).setParameterLength(1),w4e=H$(X1,X1.SINH).setParameterLength(1),u0=H$(X1,X1.COS).setParameterLength(1),T4e=H$(X1,X1.COSH).setParameterLength(1),E4e=H$(X1,X1.TAN).setParameterLength(1),D4e=H$(X1,X1.TANH).setParameterLength(1),O4e=H$(X1,X1.ASIN).setParameterLength(1),k4e=H$(X1,X1.ASINH).setParameterLength(1),d0=H$(X1,X1.ACOS).setParameterLength(1),A4e=H$(X1,X1.ACOSH).setParameterLength(1),f0=H$(X1,X1.ATAN).setParameterLength(1,2),j4e=H$(X1,X1.ATANH).setParameterLength(1),p0=H$(X1,X1.ABS).setParameterLength(1),m0=H$(X1,X1.SIGN).setParameterLength(1),h0=H$(X1,X1.LENGTH).setParameterLength(1),g0=H$(X1,X1.NEGATE).setParameterLength(1),M4e=H$(X1,X1.ONE_MINUS).setParameterLength(1),_0=H$(X1,X1.DFDX).setParameterLength(1),v0=H$(X1,X1.DFDY).setParameterLength(1),N4e=H$(X1,X1.ROUND).setParameterLength(1),P4e=H$(X1,X1.RECIPROCAL).setParameterLength(1),y0=H$(X1,X1.TRUNC).setParameterLength(1),b0=H$(X1,X1.FWIDTH).setParameterLength(1),F4e=H$(X1,X1.TRANSPOSE).setParameterLength(1),I4e=H$(X1,X1.DETERMINANT).setParameterLength(1),L4e=H$(X1,X1.INVERSE).setParameterLength(1),x0=H$(X1,X1.MIN).setParameterLength(2,1/0),S0=H$(X1,X1.MAX).setParameterLength(2,1/0),C0=H$(X1,X1.STEP).setParameterLength(2),R4e=H$(X1,X1.REFLECT).setParameterLength(2),z4e=H$(X1,X1.DISTANCE).setParameterLength(2),B4e=H$(X1,X1.DIFFERENCE).setParameterLength(2),w0=H$(X1,X1.DOT).setParameterLength(2),T0=H$(X1,X1.CROSS).setParameterLength(2),E0=H$(X1,X1.POW).setParameterLength(2),D0=e=>K1(e,e),V4e=e=>K1(e,e,e),O0=e=>K1(e,e,e,e),H4e=H$(X1,X1.TRANSFORM_DIRECTION).setParameterLength(2),U4e=e=>K1(m0(e),E0(p0(e),1/3)),k0=e=>w0(e,e),A0=H$(X1,X1.MIX).setParameterLength(3),j0=(e,t=0,n=1)=>new X1(X1.CLAMP,I$(e),I$(t),I$(n)),M0=e=>j0(e),N0=H$(X1,X1.REFRACT).setParameterLength(3),P0=H$(X1,X1.SMOOTHSTEP).setParameterLength(3),F0=H$(X1,X1.FACEFORWARD).setParameterLength(3),W4e=J(([e])=>c0(l0(J1(w0(e.xy,Y$(12.9898,78.233)),Q1)).mul(43758.5453))),G4e=(e,t,n)=>A0(t,n,e),K4e=(e,t,n)=>P0(t,n,e),q4e=(e,t)=>C0(t,e),J4e=F0,Y4e=i0;x$(`all`,b4e),x$(`any`,x4e),x$(`radians`,S4e),x$(`degrees`,C4e),x$(`exp`,$1),x$(`exp2`,e0),x$(`log`,t0),x$(`log2`,n0),x$(`sqrt`,r0),x$(`inverseSqrt`,i0),x$(`floor`,a0),x$(`ceil`,o0),x$(`normalize`,s0),x$(`fract`,c0),x$(`sin`,l0),x$(`sinh`,w4e),x$(`cos`,u0),x$(`cosh`,T4e),x$(`tan`,E4e),x$(`tanh`,D4e),x$(`asin`,O4e),x$(`asinh`,k4e),x$(`acos`,d0),x$(`acosh`,A4e),x$(`atan`,f0),x$(`atanh`,j4e),x$(`abs`,p0),x$(`sign`,m0),x$(`length`,h0),x$(`lengthSq`,k0),x$(`negate`,g0),x$(`oneMinus`,M4e),x$(`dFdx`,_0),x$(`dFdy`,v0),x$(`round`,N4e),x$(`reciprocal`,P4e),x$(`trunc`,y0),x$(`fwidth`,b0),x$(`min`,x0),x$(`max`,S0),x$(`step`,q4e),x$(`reflect`,R4e),x$(`distance`,z4e),x$(`dot`,w0),x$(`cross`,T0),x$(`pow`,E0),x$(`pow2`,D0),x$(`pow3`,V4e),x$(`pow4`,O0),x$(`transformDirection`,H4e),x$(`mix`,G4e),x$(`clamp`,j0),x$(`refract`,N0),x$(`smoothstep`,K4e),x$(`faceForward`,F0),x$(`difference`,B4e),x$(`saturate`,M0),x$(`cbrt`,U4e),x$(`transpose`,F4e),x$(`determinant`,I4e),x$(`inverse`,L4e),x$(`rand`,W4e);var I0=B$(class extends m${static get type(){return`ConditionalNode`}constructor(e,t,n=null){super(),this.condNode=e,this.ifNode=t,this.elseNode=n}generateNodeType(e){let{ifNode:t,elseNode:n}=e.getNodeProperties(this);if(t===void 0)return e.flowBuildStage(this,`setup`),this.getNodeType(e);let r=t.getNodeType(e);if(n!==null){let t=n.getNodeType(e);if(e.getTypeLength(t)>e.getTypeLength(r))return t}return r}setup(e){let t=this.condNode,n=this.ifNode.isolate(),r=this.elseNode?this.elseNode.isolate():null,i=e.context.nodeBlock;e.getDataFromNode(n).parentNodeBlock=i,r!==null&&(e.getDataFromNode(r).parentNodeBlock=i);let a=e.context.uniformFlow,o=e.getNodeProperties(this);o.condNode=t,o.ifNode=a?n:n.context({nodeBlock:n}),o.elseNode=r?a?r:r.context({nodeBlock:r}):null}generate(e,t){let n=this.getNodeType(e),r=e.getDataFromNode(this);if(r.nodeProperty!==void 0)return r.nodeProperty;let{condNode:i,ifNode:a,elseNode:o}=e.getNodeProperties(this),s=e.currentFunctionNode,c=t!==`void`,l=c?c1(n).build(e):``;r.nodeProperty=l;let u=i.build(e,`bool`);if(e.context.uniformFlow&&o!==null){let r=a.build(e,n),i=o.build(e,n),s=e.getTernary(u,r,i);return e.format(s,n,t)}e.addFlowCode(`\n${e.tab}if ( ${u} ) {\n\n`).addFlowTab();let d=a.build(e,n);if(d&&(c?d=l+` = `+d+`;`:(d=`return `+d+`;`,s===null&&(yr(`TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.`,this.stackTrace),d=`// `+d))),e.removeFlowTab().addFlowCode(e.tab+` `+d+`
|
|
10194
10211
|
|
package/dist/app/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="apple-touch-icon" href="./favicon.svg" />
|
|
9
9
|
<link rel="manifest" href="./manifest.json" />
|
|
10
10
|
<title>buerligons</title>
|
|
11
|
-
<script type="module" crossorigin src="./assets/index-
|
|
11
|
+
<script type="module" crossorigin src="./assets/index-BFlkXWfw.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="./assets/index-B5BXDqMa.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
package/dist/mcp-server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { type Client, type EnginePolicy } from './client.js';
|
|
3
3
|
import { type LocalWasmOptions } from './engine/wasm.js';
|
|
4
4
|
import { type Show } from './share/session.js';
|
|
5
|
-
export declare const VERSION = "0.5.
|
|
5
|
+
export declare const VERSION = "0.5.1";
|
|
6
6
|
export declare const DEFAULT_WS_URL = "ws://0.0.0.0:9094/";
|
|
7
7
|
export type McpServerOptions = {
|
|
8
8
|
/** ClassCAD worker this instance connects to (lazily, on the first tool call). */
|
package/dist/mcp-server.js
CHANGED
|
@@ -20,7 +20,7 @@ import { attachViewer, VIEWER_NOTE } from './tools/viewer.js';
|
|
|
20
20
|
import { appNote, attachShare, registerSelectionTools, registerShareTool, registerViewTool } from './tools/share.js';
|
|
21
21
|
import { appAvailable, joinedHere, listen as listenForApps, waitForPage, SESSION_PATH } from './share/server.js';
|
|
22
22
|
import { sharingFromEnv, showFromEnv } from './share/session.js';
|
|
23
|
-
export const VERSION = '0.5.
|
|
23
|
+
export const VERSION = '0.5.1';
|
|
24
24
|
/** True for the address sessions are joined on on this machine (share/server.ts): an app's own engine, or another agent's. */
|
|
25
25
|
const hostedOnThisMachine = (url) => {
|
|
26
26
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@classcad/mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"mcpName": "io.github.awv-informatik/classcad",
|
|
5
5
|
"description": "ClassCAD MCP server: build, verify and export 3D CAD parts and assemblies with the ClassCAD engine, running locally",
|
|
6
6
|
"homepage": "https://classcad.ai",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@classcad/script": "^0.2.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@buerli.io/buerligons": "2.0.0-beta.
|
|
62
|
+
"@buerli.io/buerligons": "2.0.0-beta.20261016112850",
|
|
63
63
|
"@types/node": "^22.0.0",
|
|
64
64
|
"@types/ws": "^8.5.13",
|
|
65
65
|
"typescript": "^5.6.0",
|