@wandelbots/wandelbots-js-react-components 4.1.0 → 4.1.1-pr.feat-RB-3107-motion-group-visualizer.510.0de52b6

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/3d.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./manufacturerHomePositions-B_nLYNzG.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.LinearAxis=e.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=e.MANUFACTURER_HOME_CONFIGS;exports.PresetEnvironment=e.PresetEnvironment;exports.Robot=e.Robot;exports.RobotCard=e.RobotCard;exports.SafetyZonesRenderer=e.SafetyZonesRenderer;exports.SupportedLinearAxis=e.SupportedLinearAxis;exports.SupportedRobot=e.SupportedRobot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.defaultAxisConfig=e.defaultAxisConfig;exports.defaultGetModel=e.defaultGetModel;exports.extractManufacturer=e.extractManufacturer;exports.getDefaultHomeConfig=e.getDefaultHomeConfig;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./manufacturerHomePositions-5E6JP4Zd.cjs");exports.CollisionSceneRenderer=e.CollisionSceneRenderer;exports.LinearAxis=e.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=e.MANUFACTURER_HOME_CONFIGS;exports.PresetEnvironment=e.PresetEnvironment;exports.Robot=e.Robot;exports.RobotCard=e.RobotCard;exports.SafetyZonesRenderer=e.SafetyZonesRenderer;exports.SupportedLinearAxis=e.SupportedLinearAxis;exports.SupportedRobot=e.SupportedRobot;exports.TrajectoryRenderer=e.TrajectoryRenderer;exports.defaultAxisConfig=e.defaultAxisConfig;exports.defaultGetModel=e.defaultGetModel;exports.extractManufacturer=e.extractManufacturer;exports.getDefaultHomeConfig=e.getDefaultHomeConfig;
2
2
  //# sourceMappingURL=3d.cjs.js.map
package/dist/3d.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as r, L as s, M as o, P as t, R as n, a as d, S as i, b as f, c as R, T as u, d as C, e as l, f as S, g as c } from "./manufacturerHomePositions-BCgn-SCy.js";
1
+ import { C as r, L as s, M as o, P as t, R as n, a as d, S as i, b as f, c as R, T as u, d as C, e as l, f as S, g as c } from "./manufacturerHomePositions-DAaWLJKB.js";
2
2
  export {
3
3
  r as CollisionSceneRenderer,
4
4
  s as LinearAxis,
@@ -1 +1 @@
1
- {"version":3,"file":"LinearAxisAnimator.d.ts","sourceRoot":"","sources":["../../../src/components/robots/LinearAxisAnimator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAA;AAK5C,KAAK,uBAAuB,GAAG;IAC7B,0BAA0B,EAAE,gBAAgB,CAAA;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC1E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,0BAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,QAAQ,GACT,EAAE,uBAAuB,2CA+FzB"}
1
+ {"version":3,"file":"LinearAxisAnimator.d.ts","sourceRoot":"","sources":["../../../src/components/robots/LinearAxisAnimator.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,OAAO,KAAyC,MAAM,OAAO,CAAA;AAC7D,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAA;AAK5C,KAAK,uBAAuB,GAAG;IAC7B,0BAA0B,EAAE,gBAAgB,CAAA;IAC5C,YAAY,EAAE,WAAW,EAAE,CAAA;IAC3B,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC1E,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,0BAA0B,EAC1B,YAAY,EACZ,oBAAoB,EACpB,QAAQ,GACT,EAAE,uBAAuB,2CA8FzB"}
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { type SupportedRobotProps } from "./SupportedRobot";
3
+ import { type SupportedLinearAxisProps } from "./SupportedLinearAxis";
4
+ export type MotionGroupVisualizerProps = {
5
+ inverseSolver?: string | null;
6
+ } & (SupportedRobotProps | SupportedLinearAxisProps);
7
+ export declare const MotionGroupVisualizer: React.FC<MotionGroupVisualizerProps>;
8
+ //# sourceMappingURL=MotionGroupVisualizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MotionGroupVisualizer.d.ts","sourceRoot":"","sources":["../../../src/components/robots/MotionGroupVisualizer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAKxE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAC3E,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAE1F,MAAM,MAAM,0BAA0B,GAAG;IACvC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B,GAAG,CAAC,mBAAmB,GAAG,wBAAwB,CAAC,CAAA;AAEpD,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA4DrE,CAAA"}
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./manufacturerHomePositions-B_nLYNzG.cjs"),e=require("./theming-DPoEjzxv.cjs"),r=require("./LoadingCover-CukpS_aj.cjs"),t=require("./interpolation-DZhBKo-u.cjs"),a=require("./externalizeComponent-CkVWk2F_.cjs"),n=require("./WandelscriptEditor-D6_vS5Uk.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.LinearAxis=o.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=o.MANUFACTURER_HOME_CONFIGS;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.RobotCard=o.RobotCard;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedRobot=o.SupportedRobot;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultAxisConfig=o.defaultAxisConfig;exports.defaultGetModel=o.defaultGetModel;exports.extractManufacturer=o.extractManufacturer;exports.getDefaultHomeConfig=o.getDefaultHomeConfig;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointRotationControl=e.JoggingJointRotationControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SafetyBar=e.SafetyBar;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.LoadingCover=r.LoadingCover;exports.LoadingErrorMessage=r.LoadingErrorMessage;exports.ProgramControl=t.ProgramControl;exports.ProgramState=t.ProgramState;exports.ProgramStateIndicator=t.ProgramStateIndicator;exports.ValueInterpolator=t.ValueInterpolator;exports.useAnimationFrame=t.useAnimationFrame;exports.useAutorun=t.useAutorun;exports.useInterpolation=t.useInterpolation;exports.useMounted=t.useMounted;exports.useReaction=t.useReaction;exports.i18n=a.i18n;exports.WandelscriptEditor=n.WandelscriptEditor;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./manufacturerHomePositions-5E6JP4Zd.cjs"),e=require("./theming-DPoEjzxv.cjs"),r=require("./LoadingCover-CukpS_aj.cjs"),t=require("./interpolation-DZhBKo-u.cjs"),a=require("./externalizeComponent-CkVWk2F_.cjs"),n=require("./WandelscriptEditor-D6_vS5Uk.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.LinearAxis=o.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=o.MANUFACTURER_HOME_CONFIGS;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.RobotCard=o.RobotCard;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedRobot=o.SupportedRobot;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultAxisConfig=o.defaultAxisConfig;exports.defaultGetModel=o.defaultGetModel;exports.extractManufacturer=o.extractManufacturer;exports.getDefaultHomeConfig=o.getDefaultHomeConfig;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointRotationControl=e.JoggingJointRotationControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SafetyBar=e.SafetyBar;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.LoadingCover=r.LoadingCover;exports.LoadingErrorMessage=r.LoadingErrorMessage;exports.ProgramControl=t.ProgramControl;exports.ProgramState=t.ProgramState;exports.ProgramStateIndicator=t.ProgramStateIndicator;exports.ValueInterpolator=t.ValueInterpolator;exports.useAnimationFrame=t.useAnimationFrame;exports.useAutorun=t.useAutorun;exports.useInterpolation=t.useInterpolation;exports.useMounted=t.useMounted;exports.useReaction=t.useReaction;exports.i18n=a.i18n;exports.WandelscriptEditor=n.WandelscriptEditor;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as o, L as s, M as t, P as r, R as n, a as i, S as g, b as l, c as u, T as d, d as c, e as p, f as m, g as M } from "./manufacturerHomePositions-BCgn-SCy.js";
1
+ import { C as o, L as s, M as t, P as r, R as n, a as i, S as g, b as l, c as u, T as d, d as c, e as p, f as m, g as M } from "./manufacturerHomePositions-DAaWLJKB.js";
2
2
  import { A as f, C, a as R, J as b, b as L, c as x, d as P, e as A, L as V, f as E, g as J, M as T, N as I, P as y, h as G, R as N, i as W, j as q, S as v, k as F, T as j, l as w, V as D, m as H, W as h, n as B, o as O, p as U, q as _, r as k, s as Z, t as z, u as K, v as Q, w as X } from "./theming-BTlS2afw.js";
3
3
  import { L as $, a as aa } from "./LoadingCover-6gWr11KP.js";
4
4
  import { P as oa, a as sa, b as ta, V as ra, u as na, c as ia, d as ga, e as la, f as ua } from "./interpolation-baUmFLkh.js";
@@ -1,2 +1,2 @@
1
- "use strict";const t=require("./externalizeComponent-CkVWk2F_.cjs"),g=require("three"),q=require("three-stdlib"),_=require("@react-three/fiber"),M=require("@react-three/drei"),y=require("@mui/material"),ae=require("mobx-react-lite"),p=require("react"),ue=require("react-i18next"),E=require("./interpolation-DZhBKo-u.cjs"),W=require("react-error-boundary");function ce(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const j=ce(g);function le(e){switch(e.shape_type){case"convex_hull":return new q.ConvexGeometry(e.vertices.map(r=>new j.Vector3(r[0]/1e3,r[1]/1e3,r[2]/1e3)));case"box":return new j.BoxGeometry(e.size_x/1e3,e.size_y/1e3,e.size_z/1e3);case"sphere":return new j.SphereGeometry(e.radius/1e3);case"capsule":return new j.CapsuleGeometry(e.radius/1e3,e.cylinder_height/1e3);case"cylinder":return new j.CylinderGeometry(e.radius/1e3,e.radius/1e3,e.height/1e3);case"rectangle":return new j.BoxGeometry(e.size_x/1e3,e.size_y/1e3,0);default:return console.warn(`${e.shape_type} is not supported`),new j.BufferGeometry}}function xe({name:e,collider:n,children:r}){var l,u;const a=((l=n.pose)==null?void 0:l.position)??[0,0,0],s=((u=n.pose)==null?void 0:u.orientation)??[0,0,0];return n.margin&&console.warn(`${e} margin is not supported`),t.jsxRuntimeExports.jsx("mesh",{name:e,position:new j.Vector3(a[0],a[1],a[2]).divideScalar(1e3),rotation:new j.Euler(s[0],s[1],s[2],"XYZ"),geometry:le(n.shape),children:r})}function me({name:e,colliders:n,meshChildrenProvider:r,...a}){return t.jsxRuntimeExports.jsx("group",{name:e,...a,children:Object.entries(n).map(([s,l])=>t.jsxRuntimeExports.jsx(xe,{name:s,collider:l,children:r(s,l)},s))})}function pe({scene:e,meshChildrenProvider:n}){const r=e.colliders;return t.jsxRuntimeExports.jsx("group",{children:r&&t.jsxRuntimeExports.jsx(me,{meshChildrenProvider:n,colliders:r})})}function F(){return t.jsxRuntimeExports.jsx(M.Environment,{children:t.jsxRuntimeExports.jsx(fe,{})})}function fe({positions:e=[2,0,2,0,2,0,2,0]}){return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(M.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),t.jsxRuntimeExports.jsx("group",{rotation:[0,.5,0],children:t.jsxRuntimeExports.jsx("group",{children:e.map((n,r)=>t.jsxRuntimeExports.jsx(M.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[n,4,r*4],scale:[3,1,1]},r))})}),t.jsxRuntimeExports.jsx(M.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),t.jsxRuntimeExports.jsx(M.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),t.jsxRuntimeExports.jsx(M.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),t.jsxRuntimeExports.jsx(M.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),t.jsxRuntimeExports.jsx(M.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}function de(e){if(e.length<3)return console.log("Not enough vertices to define a plane"),{isCoplanar:!1};const n=new j.Vector3(e[0].x,e[0].y,e[0].z),r=new j.Vector3(e[1].x,e[1].y,e[1].z),a=new j.Vector3(e[2].x,e[2].y,e[2].z),s=new j.Vector3().subVectors(r,n),l=new j.Vector3().subVectors(a,n),u=new j.Vector3().crossVectors(s,l).normalize();for(let x=3;x<e.length;x++){const c=new j.Vector3(e[x].x,e[x].y,e[x].z),f=new j.Vector3().subVectors(c,n),m=u.dot(f);if(Math.abs(m)>1e-6)return console.log("Vertices are not on the same plane"),{isCoplanar:!1}}return{isCoplanar:!0,normal:u}}function he({safetyZones:e,...n}){return t.jsxRuntimeExports.jsx("group",{...n,children:e.map((r,a)=>{let s=[];return r.geometry&&(r.geometry.compound?s=r.geometry.compound.child_geometries:r.geometry.convex_hull&&(s=[r.geometry])),s.map((l,u)=>{if(!l.convex_hull)return null;const x=l.convex_hull.vertices.map(m=>new j.Vector3(m.x/1e3,m.y/1e3,m.z/1e3)),c=de(x);if(c.isCoplanar&&c.normal){const o=new j.Vector3().addVectors(x[0],c.normal.multiplyScalar(1e-4));x.push(o)}let f;try{f=new q.ConvexGeometry(x)}catch(m){return console.log("Error creating ConvexGeometry:",m),null}return t.jsxRuntimeExports.jsx("mesh",{geometry:f,children:t.jsxRuntimeExports.jsx("meshStandardMaterial",{attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-u},a)},`${a}-${u}`)})})})}function je({trajectory:e,...n}){var a;const r=((a=e.trajectory)==null?void 0:a.map(s=>s.tcp_pose?new j.Vector3(s.tcp_pose.position.x/1e3,s.tcp_pose.position.z/1e3,-s.tcp_pose.position.y/1e3):null).filter(s=>s!==null))||[];return t.jsxRuntimeExports.jsx("group",{...n,children:r.length>0&&t.jsxRuntimeExports.jsx(M.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const A=new Map;async function L(e){if(A.has(e))return A.get(e);const n=(async()=>{var l;const a=new E.NovaClient({instanceUrl:""}),s=a.api.motionGroupModels;(l=s.axios)!=null&&l.interceptors&&s.axios.interceptors.request.use(u=>{var x;return(x=u.url)!=null&&x.includes("/glb")&&(u.responseType="blob"),u});try{const u=await a.api.motionGroupModels.getMotionGroupGlbModel(e);return URL.createObjectURL(u)}catch(u){throw console.error("Failed to fetch model:",u),u}})();return A.set(e,n),n}function H(e){function n(r){return r.children.length===0?[r]:[r,...r.children.flatMap(a=>n(a))]}return n(e).filter(r=>$(r))}function J(e){return e.name.endsWith("_FLG")}function $(e){return/_J[0-9]+$/.test(e.name)}function Re(e,n){let r;function a(s){if(J(s)){if(r)throw Error(`Found multiple flange groups in robot model ${n}; first ${r.name} then ${s.name}. Only one _FLG group is allowed.`);r=s}$(s),s.children.map(a)}if(a(e.scene),!r)throw Error(`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function N({rapidlyChangingMotionState:e,dhParameters:n,onRotationChanged:r,children:a}){const s=p.useRef([]),l=p.useRef([]),u=p.useRef(null),{invalidate:x}=_.useThree();p.useEffect(()=>{const o=e.joint_position.filter(i=>i!==void 0);return u.current=new E.ValueInterpolator(o,{tension:120,friction:20,threshold:.001}),()=>{var i;(i=u.current)==null||i.destroy()}},[]),_.useFrame((o,i)=>{if(u.current){const d=u.current.update(i);f(),d||x()}});function c(o){o&&(l.current=H(o),f(),x())}function f(){var i;const o=((i=u.current)==null?void 0:i.getCurrentValues())||[];if(r)r(l.current,o);else for(const[d,R]of l.current.entries()){const h=n[d],w=h.theta||0,b=h.reverse_rotation_direction?-1:1;R.rotation.y=b*(o[d]||0)+w}}const m=p.useCallback(()=>{const o=e.joint_position.filter(i=>i!==void 0);requestAnimationFrame(()=>{var i;s.current=o,(i=u.current)==null||i.setTarget(o)})},[e]);return p.useEffect(()=>{m()},[e,m]),E.useAutorun(()=>{m()}),t.jsxRuntimeExports.jsx("group",{ref:c,children:a})}const ge="line",ye="mesh";function Ee({rapidlyChangingMotionState:e,dhParameters:n,...r}){const a=new g.Matrix4,s=p.useRef([]),l=p.useRef([]);p.useEffect(()=>{s.current=new Array(n.length).fill(null),l.current=new Array(n.length).fill(null)},[n.length]);function u(f,m){const o=new g.Vector3,i=new g.Quaternion,d=new g.Vector3;a.decompose(o,i,d);const R=o.clone(),h=new g.Matrix4().makeRotationY(f.theta+m*(f.reverse_rotation_direction?-1:1)).multiply(new g.Matrix4().makeTranslation(0,f.d/1e3,0)).multiply(new g.Matrix4().makeTranslation(f.a/1e3,0,0)).multiply(new g.Matrix4().makeRotationX(f.alpha));return a.multiply(h),a.decompose(o,i,d),{a:R,b:o}}function x(f,m,o,i){if(!n)return;const d=n[f];if(!d)return;const{a:R,b:h}=u(d,i);m.geometry.setPositions([R.toArray(),h.toArray()].flat()),o.position.set(h.x,h.y,h.z)}function c(f,m){a.identity();for(let o=0;o<Math.min(f.length,m.length);o++){const i=s.current[o],d=l.current[o];i&&d&&x(o,i,d,m[o])}}return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(N,{rapidlyChangingMotionState:e,dhParameters:n,onRotationChanged:c,children:t.jsxRuntimeExports.jsxs("group",{...r,name:"Scene",children:[t.jsxRuntimeExports.jsxs("mesh",{children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.01,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),n.map((f,m)=>{const{a:o,b:i}=u(f,e.joint_position[m]??0),d=`dhrobot_J0${m}`;return t.jsxRuntimeExports.jsxs("group",{name:d,children:[t.jsxRuntimeExports.jsx(M.Line,{ref:R=>{s.current[m]=R},name:ge,points:[o,i],color:"white",lineWidth:5}),t.jsxRuntimeExports.jsxs("mesh",{ref:R=>{l.current[m]=R},name:ye,position:i,children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.01,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+m)]},d)})]})})})}const be=console.warn;function Y(){return p.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&be(e)}},[]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{})}function we(e){return e.type==="Mesh"}function Me({url:e,flangeRef:n,postModelRender:r,...a}){const s=M.useGLTF(e);let l;try{l=Re(s,"robot.glb").gltf}catch(c){throw c}const u=p.useCallback(c=>{c&&r&&r()},[r]);function x(c){try{return we(c)?c.geometry?t.jsxRuntimeExports.jsx("mesh",{name:c.name,geometry:c.geometry,material:c.material,position:c.position,rotation:c.rotation},c.uuid):t.jsxRuntimeExports.jsx("group",{name:c.name,position:c.position,rotation:c.rotation},c.uuid):t.jsxRuntimeExports.jsx("group",{name:c.name,position:c.position,rotation:c.rotation,ref:J(c)?n:void 0,children:c.children.map(x)},c.uuid)}catch(f){return console.warn("Error rendering node",c.name,f),null}}return t.jsxRuntimeExports.jsx("group",{...a,dispose:null,ref:u,children:x(l.scene)})}function X({modelURL:e,flangeRef:n,postModelRender:r,...a}){const[s,l]=p.useState(null);return p.useEffect(()=>{(async()=>{try{if(typeof e=="string")l(e);else{const x=await e;l(x)}}catch(x){console.error("Failed to resolve model URL:",x)}})()},[e]),s?t.jsxRuntimeExports.jsx(Me,{url:s,flangeRef:n,postModelRender:r,...a}):null}const K=(e,n)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof j.Mesh){r.material instanceof j.Material&&(r.material.colorWrite=!1);const a=r.clone(),s=r.clone();a.material=new j.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:j.DoubleSide}),a.userData.isGhost=!0,s.material=new j.MeshStandardMaterial({color:n,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:j.DoubleSide}),s.userData.isGhost=!0,r.parent&&(r.parent.add(a),r.parent.add(s))}}),e.userData.isGhost=!0)},Q=e=>{if(!e.userData.isGhost)return;const n=[];e.traverse(r=>{var a;r instanceof j.Mesh&&((a=r.userData)!=null&&a.isGhost?n.push(r):r.material instanceof j.Material&&(r.material.colorWrite=!0))}),n.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},Z=t.externalizeComponent(({rapidlyChangingMotionState:e,modelFromController:n,dhParameters:r,getModel:a=L,flangeRef:s,postModelRender:l,transparentColor:u,...x})=>{const[c,f]=p.useState(null),m=p.useCallback(i=>{f(i)},[]);p.useEffect(()=>{c&&(u?K(c,u):Q(c))},[c,u]);const o=t.jsxRuntimeExports.jsx(Ee,{rapidlyChangingMotionState:e,dhParameters:r,...x});return t.jsxRuntimeExports.jsxs(W.ErrorBoundary,{fallback:o,onError:i=>{console.warn(i)},children:[t.jsxRuntimeExports.jsx(p.Suspense,{fallback:o,children:t.jsxRuntimeExports.jsx("group",{ref:m,children:t.jsxRuntimeExports.jsx(N,{rapidlyChangingMotionState:e,dhParameters:r,children:t.jsxRuntimeExports.jsx(X,{modelURL:(()=>{const i=a(n);if(!i){const d=new Blob([],{type:"model/gltf-binary"}),R=new File([d],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(R))}return i})(),postModelRender:l,flangeRef:s,...x})})})}),t.jsxRuntimeExports.jsx(Y,{})]})});function ee({connectedMotionGroup:e,getModel:n=L,flangeRef:r,transparentColor:a,postModelRender:s,...l}){return e.dhParameters?t.jsxRuntimeExports.jsx(Z,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:n,flangeRef:r,transparentColor:a,postModelRender:s,...l}):null}const ve=t.externalizeComponent(ae.observer(({robotName:e,programState:n,safetyState:r,operationMode:a,driveToHomeEnabled:s=!1,onDriveToHomePress:l,onDriveToHomeRelease:u,connectedMotionGroup:x,robotComponent:c=ee,customContentComponent:f,className:m})=>{var D;const o=y.useTheme(),{t:i}=ue.useTranslation(),[d,R]=p.useState(!1),h=p.useRef(null),w=p.useRef(null),[b,G]=p.useState(!1),[S,oe]=p.useState({width:400,height:600}),[Ce,ie]=p.useState(0);p.useEffect(()=>{const T=()=>{if(w.current){const{offsetWidth:z,offsetHeight:U}=w.current;G(z>U),oe({width:z,height:U})}};T();const O=new ResizeObserver(T);return w.current&&O.observe(w.current),()=>{O.disconnect()}},[]);const P=p.useCallback(()=>{ie(T=>T+1)},[]),C=p.useCallback(()=>{!s||!l||(R(!0),l())},[s,l]),k=p.useCallback(()=>{!s||!u||(R(!1),u())},[s,u]),B=p.useCallback(()=>{d&&u&&(R(!1),u())},[d,u]),v=b?S.width<350:S.height<200,V=b?S.height<310:S.height<450;return t.jsxRuntimeExports.jsx(y.Card,{ref:w,className:m,sx:{width:"100%",height:"100%",display:"flex",flexDirection:b?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:b?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${o.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((D=o.palette.backgroundPaperElevation)==null?void 0:D[8])||"#2A2A3F",backgroundImage:"none"},children:b?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(y.Box,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:v?"none":"block"},children:!v&&t.jsxRuntimeExports.jsxs(_.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:o.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[t.jsxRuntimeExports.jsx(F,{}),t.jsxRuntimeExports.jsx(M.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:t.jsxRuntimeExports.jsx(c,{connectedMotionGroup:x,postModelRender:P})})]})}),t.jsxRuntimeExports.jsxs(y.Box,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:v?"100%":"50%"},children:[t.jsxRuntimeExports.jsxs(y.Box,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[t.jsxRuntimeExports.jsx(y.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),t.jsxRuntimeExports.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:a})]}),t.jsxRuntimeExports.jsxs(y.Box,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!V&&f&&t.jsxRuntimeExports.jsxs(y.Box,{children:[t.jsxRuntimeExports.jsx(f,{}),t.jsxRuntimeExports.jsx(y.Divider,{sx:{mt:1,mb:0,borderColor:o.palette.divider,opacity:.5}})]}),t.jsxRuntimeExports.jsx(y.Box,{sx:{mt:!V&&f?"auto":0},children:t.jsxRuntimeExports.jsx(y.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:t.jsxRuntimeExports.jsx(y.Button,{ref:h,variant:"contained",color:"secondary",size:"small",disabled:!s,onMouseDown:C,onMouseUp:k,onMouseLeave:B,onTouchStart:C,onTouchEnd:k,sx:{textTransform:"none",px:1.5,py:.5},children:i("RobotCard.DriveToHome.bt")})})})]})]})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(y.Box,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxRuntimeExports.jsxs(y.Box,{children:[t.jsxRuntimeExports.jsx(y.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),t.jsxRuntimeExports.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:a})]}),t.jsxRuntimeExports.jsx(y.Box,{sx:{flex:v?0:1,position:"relative",minHeight:v?0:{xs:120,sm:150,md:200},height:v?0:"auto",borderRadius:1,overflow:"hidden",display:v?"none":"block"},children:!v&&t.jsxRuntimeExports.jsxs(_.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:o.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[t.jsxRuntimeExports.jsx(F,{}),t.jsxRuntimeExports.jsx(M.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:t.jsxRuntimeExports.jsx(c,{connectedMotionGroup:x,postModelRender:P})})]})}),t.jsxRuntimeExports.jsxs(y.Box,{children:[!V&&f&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(f,{}),t.jsxRuntimeExports.jsx(y.Divider,{sx:{mt:1,mb:0,borderColor:o.palette.divider,opacity:.5}})]}),t.jsxRuntimeExports.jsx(y.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:!V&&f?{xs:1,sm:2,md:5}:{xs:.5,sm:1,md:2},mb:{xs:.5,sm:.75,md:1}},children:t.jsxRuntimeExports.jsx(y.Button,{ref:h,variant:"contained",color:"secondary",size:"small",disabled:!s,onMouseDown:C,onMouseUp:k,onMouseLeave:B,onTouchStart:C,onTouchEnd:k,sx:{textTransform:"none",px:1.5,py:.5},children:i("RobotCard.DriveToHome.bt")})})]})]})})})})),_e=Array(6).fill(2*Math.PI);function te({rapidlyChangingMotionState:e,dhParameters:n,onTranslationChanged:r,children:a}){const s=p.useRef([]),l=p.useRef([]),u=p.useRef(null),{invalidate:x}=_.useThree();p.useEffect(()=>{const o=e.joint_position.filter(i=>i!==void 0);return u.current=new E.ValueInterpolator(o,{tension:120,friction:20,threshold:.001}),()=>{var i;(i=u.current)==null||i.destroy()}},[]),_.useFrame((o,i)=>{if(u.current){const d=u.current.update(i);f(),d||x()}});function c(o){o&&(l.current=H(o),f(),x())}function f(){var i;const o=((i=u.current)==null?void 0:i.getCurrentValues())||[];if(r)r(l.current,o);else for(const[d,R]of l.current.entries()){const w=n[d].reverse_rotation_direction?-1:1;R.position.x=w*(o[d]||0)/1e3}}const m=p.useCallback(()=>{const o=e.joint_position.filter(i=>i!==void 0);requestAnimationFrame(()=>{var i;s.current=o,(i=u.current)==null||i.setTarget(o)})},[e]);return p.useEffect(()=>{m()},[e,m]),E.useAutorun(()=>{m()}),t.jsxRuntimeExports.jsx("group",{ref:c,children:a})}function re({rapidlyChangingMotionState:e,dhParameters:n,...r}){const a=new g.Matrix4,s=p.useRef(null),l=p.useRef(null);function u(f){const m=new g.Matrix4;for(let R=0;R<n.length;R++){const h=n[R],w=f[R]??0,b=new g.Matrix4().makeRotationY(h.theta).multiply(new g.Matrix4().makeTranslation(h.a/1e3,(h.d+w*(h.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new g.Matrix4().makeRotationX(h.alpha));m.multiply(b)}const o=new g.Vector3,i=new g.Quaternion,d=new g.Vector3;return m.decompose(o,i,d),o}const x=u(e.joint_position);function c(f,m){a.identity();let o=new g.Vector3;for(let h=0;h<n.length;h++){const w=m[h]??0,b=n[h],G=new g.Matrix4().makeRotationY(b.theta).multiply(new g.Matrix4().makeTranslation(b.a/1e3,(b.d+w*(b.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new g.Matrix4().makeRotationX(b.alpha));a.multiply(G)}const i=new g.Vector3,d=new g.Quaternion,R=new g.Vector3;if(a.decompose(i,d,R),o=i,s.current&&s.current.position.set(o.x,o.y,o.z),l.current){const h=l.current.geometry;h&&h.setPositions&&h.setPositions([0,0,0,o.x,o.y,o.z])}}return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(te,{rapidlyChangingMotionState:e,dhParameters:n,onTranslationChanged:c,children:t.jsxRuntimeExports.jsxs("group",{...r,name:"Scene",children:[t.jsxRuntimeExports.jsxs("mesh",{name:"Base",position:[0,0,0],children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.02,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"green",depthTest:!0})]}),t.jsxRuntimeExports.jsx(M.Line,{ref:l,points:[new g.Vector3(0,0,0),x],color:"White",lineWidth:5}),t.jsxRuntimeExports.jsxs("mesh",{ref:s,name:"TCP",position:x,children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.025,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"red",depthTest:!0})]})]})})})}const ne=t.externalizeComponent(({rapidlyChangingMotionState:e,modelFromController:n,dhParameters:r,getModel:a=L,flangeRef:s,postModelRender:l,transparentColor:u,...x})=>{const[c,f]=p.useState(null),m=p.useCallback(i=>{f(i)},[]);p.useEffect(()=>{c&&(u?K(c,u):Q(c))},[c,u]);const o=t.jsxRuntimeExports.jsx(re,{rapidlyChangingMotionState:e,dhParameters:r,...x});return t.jsxRuntimeExports.jsxs(W.ErrorBoundary,{fallback:o,onError:i=>{console.warn(i)},children:[t.jsxRuntimeExports.jsx(p.Suspense,{fallback:o,children:t.jsxRuntimeExports.jsx("group",{ref:m,children:t.jsxRuntimeExports.jsx(te,{rapidlyChangingMotionState:e,dhParameters:r,children:t.jsxRuntimeExports.jsx(X,{modelURL:(()=>{const i=a(n);if(!i){const d=new Blob([],{type:"model/gltf-binary"}),R=new File([d],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(R))}return i})(),postModelRender:l,flangeRef:s,...x})})})}),t.jsxRuntimeExports.jsx(Y,{})]})});function Le({connectedMotionGroup:e,getModel:n=L,flangeRef:r,transparentColor:a,postModelRender:s,...l}){if(!e.dhParameters)return null;const u=e.modelFromController||"";return u&&n(u)?t.jsxRuntimeExports.jsx(ne,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:u,dhParameters:e.dhParameters,getModel:n,flangeRef:r,transparentColor:a,postModelRender:s,...l}):t.jsxRuntimeExports.jsx(re,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,dhParameters:e.dhParameters,...l})}const I={[E.Manufacturer.Abb]:[0,0,0,0,Math.PI/2,0,0],[E.Manufacturer.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[E.Manufacturer.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[E.Manufacturer.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[E.Manufacturer.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0]};function se(e){const[n]=e.split("_");switch(n){case"ABB":return E.Manufacturer.Abb;case"FANUC":return E.Manufacturer.Fanuc;case"YASKAWA":return E.Manufacturer.Yaskawa;case"KUKA":return E.Manufacturer.Kuka;case"UniversalRobots":return E.Manufacturer.Universalrobots;default:return null}}function Se(e,n){const r=se(e);return r&&r in I?I[r]:n||null}exports.CollisionSceneRenderer=pe;exports.LinearAxis=Le;exports.MANUFACTURER_HOME_CONFIGS=I;exports.PresetEnvironment=F;exports.Robot=ee;exports.RobotCard=ve;exports.SafetyZonesRenderer=he;exports.SupportedLinearAxis=ne;exports.SupportedRobot=Z;exports.TrajectoryRenderer=je;exports.defaultAxisConfig=_e;exports.defaultGetModel=L;exports.extractManufacturer=se;exports.getDefaultHomeConfig=Se;
2
- //# sourceMappingURL=manufacturerHomePositions-B_nLYNzG.cjs.map
1
+ "use strict";const t=require("./externalizeComponent-CkVWk2F_.cjs"),g=require("three"),q=require("three-stdlib"),_=require("@react-three/fiber"),M=require("@react-three/drei"),y=require("@mui/material"),ae=require("mobx-react-lite"),p=require("react"),ue=require("react-i18next"),E=require("./interpolation-DZhBKo-u.cjs"),W=require("react-error-boundary");function ce(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return n.default=e,Object.freeze(n)}const j=ce(g);function le(e){switch(e.shape_type){case"convex_hull":return new q.ConvexGeometry(e.vertices.map(r=>new j.Vector3(r[0]/1e3,r[1]/1e3,r[2]/1e3)));case"box":return new j.BoxGeometry(e.size_x/1e3,e.size_y/1e3,e.size_z/1e3);case"sphere":return new j.SphereGeometry(e.radius/1e3);case"capsule":return new j.CapsuleGeometry(e.radius/1e3,e.cylinder_height/1e3);case"cylinder":return new j.CylinderGeometry(e.radius/1e3,e.radius/1e3,e.height/1e3);case"rectangle":return new j.BoxGeometry(e.size_x/1e3,e.size_y/1e3,0);default:return console.warn(`${e.shape_type} is not supported`),new j.BufferGeometry}}function xe({name:e,collider:n,children:r}){var l,u;const a=((l=n.pose)==null?void 0:l.position)??[0,0,0],s=((u=n.pose)==null?void 0:u.orientation)??[0,0,0];return n.margin&&console.warn(`${e} margin is not supported`),t.jsxRuntimeExports.jsx("mesh",{name:e,position:new j.Vector3(a[0],a[1],a[2]).divideScalar(1e3),rotation:new j.Euler(s[0],s[1],s[2],"XYZ"),geometry:le(n.shape),children:r})}function me({name:e,colliders:n,meshChildrenProvider:r,...a}){return t.jsxRuntimeExports.jsx("group",{name:e,...a,children:Object.entries(n).map(([s,l])=>t.jsxRuntimeExports.jsx(xe,{name:s,collider:l,children:r(s,l)},s))})}function pe({scene:e,meshChildrenProvider:n}){const r=e.colliders;return t.jsxRuntimeExports.jsx("group",{children:r&&t.jsxRuntimeExports.jsx(me,{meshChildrenProvider:n,colliders:r})})}function F(){return t.jsxRuntimeExports.jsx(M.Environment,{children:t.jsxRuntimeExports.jsx(fe,{})})}function fe({positions:e=[2,0,2,0,2,0,2,0]}){return t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(M.Lightformer,{intensity:5,"rotation-x":Math.PI/2,position:[0,5,-9],scale:[10,10,1]}),t.jsxRuntimeExports.jsx("group",{rotation:[0,.5,0],children:t.jsxRuntimeExports.jsx("group",{children:e.map((n,r)=>t.jsxRuntimeExports.jsx(M.Lightformer,{form:"circle",intensity:5,rotation:[Math.PI/2,0,0],position:[n,4,r*4],scale:[3,1,1]},r))})}),t.jsxRuntimeExports.jsx(M.Lightformer,{intensity:40,"rotation-y":Math.PI/2,position:[-5,1,-1],scale:[20,.1,1]}),t.jsxRuntimeExports.jsx(M.Lightformer,{intensity:20,"rotation-y":-Math.PI,position:[-5,-2,-1],scale:[20,.1,1]}),t.jsxRuntimeExports.jsx(M.Lightformer,{"rotation-y":Math.PI/2,position:[-5,-1,-1],scale:[20,.5,1],intensity:5}),t.jsxRuntimeExports.jsx(M.Lightformer,{"rotation-y":-Math.PI/2,position:[10,1,0],scale:[20,1,1],intensity:10}),t.jsxRuntimeExports.jsx(M.Lightformer,{form:"ring",color:"white",intensity:5,scale:10,position:[-15,4,-18],target:[0,0,0]})]})}function de(e){if(e.length<3)return console.log("Not enough vertices to define a plane"),{isCoplanar:!1};const n=new j.Vector3(e[0].x,e[0].y,e[0].z),r=new j.Vector3(e[1].x,e[1].y,e[1].z),a=new j.Vector3(e[2].x,e[2].y,e[2].z),s=new j.Vector3().subVectors(r,n),l=new j.Vector3().subVectors(a,n),u=new j.Vector3().crossVectors(s,l).normalize();for(let x=3;x<e.length;x++){const c=new j.Vector3(e[x].x,e[x].y,e[x].z),f=new j.Vector3().subVectors(c,n),m=u.dot(f);if(Math.abs(m)>1e-6)return console.log("Vertices are not on the same plane"),{isCoplanar:!1}}return{isCoplanar:!0,normal:u}}function he({safetyZones:e,...n}){return t.jsxRuntimeExports.jsx("group",{...n,children:e.map((r,a)=>{let s=[];return r.geometry&&(r.geometry.compound?s=r.geometry.compound.child_geometries:r.geometry.convex_hull&&(s=[r.geometry])),s.map((l,u)=>{if(!l.convex_hull)return null;const x=l.convex_hull.vertices.map(m=>new j.Vector3(m.x/1e3,m.y/1e3,m.z/1e3)),c=de(x);if(c.isCoplanar&&c.normal){const o=new j.Vector3().addVectors(x[0],c.normal.multiplyScalar(1e-4));x.push(o)}let f;try{f=new q.ConvexGeometry(x)}catch(m){return console.log("Error creating ConvexGeometry:",m),null}return t.jsxRuntimeExports.jsx("mesh",{geometry:f,children:t.jsxRuntimeExports.jsx("meshStandardMaterial",{attach:"material",color:"#009f4d",opacity:.2,depthTest:!1,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-u},a)},`${a}-${u}`)})})})}function je({trajectory:e,...n}){var a;const r=((a=e.trajectory)==null?void 0:a.map(s=>s.tcp_pose?new j.Vector3(s.tcp_pose.position.x/1e3,s.tcp_pose.position.z/1e3,-s.tcp_pose.position.y/1e3):null).filter(s=>s!==null))||[];return t.jsxRuntimeExports.jsx("group",{...n,children:r.length>0&&t.jsxRuntimeExports.jsx(M.Line,{points:r,lineWidth:3,polygonOffset:!0,polygonOffsetFactor:10,polygonOffsetUnits:10})})}const A=new Map;async function L(e){if(A.has(e))return A.get(e);const n=(async()=>{var l;const a=new E.NovaClient({instanceUrl:""}),s=a.api.motionGroupModels;(l=s.axios)!=null&&l.interceptors&&s.axios.interceptors.request.use(u=>{var x;return(x=u.url)!=null&&x.includes("/glb")&&(u.responseType="blob"),u});try{const u=await a.api.motionGroupModels.getMotionGroupGlbModel(e);return URL.createObjectURL(u)}catch(u){throw console.error("Failed to fetch model:",u),u}})();return A.set(e,n),n}function H(e){function n(r){return r.children.length===0?[r]:[r,...r.children.flatMap(a=>n(a))]}return n(e).filter(r=>$(r))}function J(e){return e.name.endsWith("_FLG")}function $(e){return/_J[0-9]+$/.test(e.name)}function Re(e,n){let r;function a(s){if(J(s)){if(r)throw Error(`Found multiple flange groups in robot model ${n}; first ${r.name} then ${s.name}. Only one _FLG group is allowed.`);r=s}$(s),s.children.map(a)}if(a(e.scene),!r)throw Error(`No flange group found in robot model ${n}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function N({rapidlyChangingMotionState:e,dhParameters:n,onRotationChanged:r,children:a}){const s=p.useRef([]),l=p.useRef([]),u=p.useRef(null),{invalidate:x}=_.useThree();p.useEffect(()=>{const o=e.joint_position.filter(i=>i!==void 0);return u.current=new E.ValueInterpolator(o,{tension:120,friction:20,threshold:.001}),()=>{var i;(i=u.current)==null||i.destroy()}},[]),_.useFrame((o,i)=>{if(u.current){const d=u.current.update(i);f(),d||x()}});function c(o){o&&(l.current=H(o),f(),x())}function f(){var i;const o=((i=u.current)==null?void 0:i.getCurrentValues())||[];if(r)r(l.current,o);else for(const[d,R]of l.current.entries()){const h=n[d],w=h.theta||0,b=h.reverse_rotation_direction?-1:1;R.rotation.y=b*(o[d]||0)+w}}const m=p.useCallback(()=>{const o=e.joint_position.filter(i=>i!==void 0);requestAnimationFrame(()=>{var i;s.current=o,(i=u.current)==null||i.setTarget(o)})},[e]);return p.useEffect(()=>{m()},[e,m]),E.useAutorun(()=>{m()}),t.jsxRuntimeExports.jsx("group",{ref:c,children:a})}const ge="line",ye="mesh";function Ee({rapidlyChangingMotionState:e,dhParameters:n,...r}){const a=new g.Matrix4,s=p.useRef([]),l=p.useRef([]);p.useEffect(()=>{s.current=new Array(n.length).fill(null),l.current=new Array(n.length).fill(null)},[n.length]);function u(f,m){const o=new g.Vector3,i=new g.Quaternion,d=new g.Vector3;a.decompose(o,i,d);const R=o.clone(),h=new g.Matrix4().makeRotationY(f.theta+m*(f.reverse_rotation_direction?-1:1)).multiply(new g.Matrix4().makeTranslation(0,f.d/1e3,0)).multiply(new g.Matrix4().makeTranslation(f.a/1e3,0,0)).multiply(new g.Matrix4().makeRotationX(f.alpha));return a.multiply(h),a.decompose(o,i,d),{a:R,b:o}}function x(f,m,o,i){if(!n)return;const d=n[f];if(!d)return;const{a:R,b:h}=u(d,i);m.geometry.setPositions([R.toArray(),h.toArray()].flat()),o.position.set(h.x,h.y,h.z)}function c(f,m){a.identity();for(let o=0;o<Math.min(f.length,m.length);o++){const i=s.current[o],d=l.current[o];i&&d&&x(o,i,d,m[o])}}return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(N,{rapidlyChangingMotionState:e,dhParameters:n,onRotationChanged:c,children:t.jsxRuntimeExports.jsxs("group",{...r,name:"Scene",children:[t.jsxRuntimeExports.jsxs("mesh",{children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.01,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),n.map((f,m)=>{const{a:o,b:i}=u(f,e.joint_position[m]??0),d=`dhrobot_J0${m}`;return t.jsxRuntimeExports.jsxs("group",{name:d,children:[t.jsxRuntimeExports.jsx(M.Line,{ref:R=>{s.current[m]=R},name:ge,points:[o,i],color:"white",lineWidth:5}),t.jsxRuntimeExports.jsxs("mesh",{ref:R=>{l.current[m]=R},name:ye,position:i,children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.01,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+m)]},d)})]})})})}const be=console.warn;function Y(){return p.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&be(e)}},[]),t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{})}function we(e){return e.type==="Mesh"}function Me({url:e,flangeRef:n,postModelRender:r,...a}){const s=M.useGLTF(e);let l;try{l=Re(s,"robot.glb").gltf}catch(c){throw c}const u=p.useCallback(c=>{c&&r&&r()},[r]);function x(c){try{return we(c)?c.geometry?t.jsxRuntimeExports.jsx("mesh",{name:c.name,geometry:c.geometry,material:c.material,position:c.position,rotation:c.rotation},c.uuid):t.jsxRuntimeExports.jsx("group",{name:c.name,position:c.position,rotation:c.rotation},c.uuid):t.jsxRuntimeExports.jsx("group",{name:c.name,position:c.position,rotation:c.rotation,ref:J(c)?n:void 0,children:c.children.map(x)},c.uuid)}catch(f){return console.warn("Error rendering node",c.name,f),null}}return t.jsxRuntimeExports.jsx("group",{...a,dispose:null,ref:u,children:x(l.scene)})}function X({modelURL:e,flangeRef:n,postModelRender:r,...a}){const[s,l]=p.useState(null);return p.useEffect(()=>{(async()=>{try{if(typeof e=="string")l(e);else{const x=await e;l(x)}}catch(x){console.error("Failed to resolve model URL:",x)}})()},[e]),s?t.jsxRuntimeExports.jsx(Me,{url:s,flangeRef:n,postModelRender:r,...a}):null}const K=(e,n)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof j.Mesh){r.material instanceof j.Material&&(r.material.colorWrite=!1);const a=r.clone(),s=r.clone();a.material=new j.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:j.DoubleSide}),a.userData.isGhost=!0,s.material=new j.MeshStandardMaterial({color:n,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:j.DoubleSide}),s.userData.isGhost=!0,r.parent&&(r.parent.add(a),r.parent.add(s))}}),e.userData.isGhost=!0)},Q=e=>{if(!e.userData.isGhost)return;const n=[];e.traverse(r=>{var a;r instanceof j.Mesh&&((a=r.userData)!=null&&a.isGhost?n.push(r):r.material instanceof j.Material&&(r.material.colorWrite=!0))}),n.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},Z=t.externalizeComponent(({rapidlyChangingMotionState:e,modelFromController:n,dhParameters:r,getModel:a=L,flangeRef:s,postModelRender:l,transparentColor:u,...x})=>{const[c,f]=p.useState(null),m=p.useCallback(i=>{f(i)},[]);p.useEffect(()=>{c&&(u?K(c,u):Q(c))},[c,u]);const o=t.jsxRuntimeExports.jsx(Ee,{rapidlyChangingMotionState:e,dhParameters:r,...x});return t.jsxRuntimeExports.jsxs(W.ErrorBoundary,{fallback:o,onError:i=>{console.warn(i)},children:[t.jsxRuntimeExports.jsx(p.Suspense,{fallback:o,children:t.jsxRuntimeExports.jsx("group",{ref:m,children:t.jsxRuntimeExports.jsx(N,{rapidlyChangingMotionState:e,dhParameters:r,children:t.jsxRuntimeExports.jsx(X,{modelURL:(()=>{const i=a(n);if(!i){const d=new Blob([],{type:"model/gltf-binary"}),R=new File([d],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(R))}return i})(),postModelRender:l,flangeRef:s,...x})})})}),t.jsxRuntimeExports.jsx(Y,{})]})});function ee({connectedMotionGroup:e,getModel:n=L,flangeRef:r,transparentColor:a,postModelRender:s,...l}){return e.dhParameters?t.jsxRuntimeExports.jsx(Z,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:n,flangeRef:r,transparentColor:a,postModelRender:s,...l}):null}const ve=t.externalizeComponent(ae.observer(({robotName:e,programState:n,safetyState:r,operationMode:a,driveToHomeEnabled:s=!1,onDriveToHomePress:l,onDriveToHomeRelease:u,connectedMotionGroup:x,robotComponent:c=ee,customContentComponent:f,className:m})=>{var D;const o=y.useTheme(),{t:i}=ue.useTranslation(),[d,R]=p.useState(!1),h=p.useRef(null),w=p.useRef(null),[b,G]=p.useState(!1),[S,oe]=p.useState({width:400,height:600}),[Ce,ie]=p.useState(0);p.useEffect(()=>{const T=()=>{if(w.current){const{offsetWidth:z,offsetHeight:U}=w.current;G(z>U),oe({width:z,height:U})}};T();const O=new ResizeObserver(T);return w.current&&O.observe(w.current),()=>{O.disconnect()}},[]);const P=p.useCallback(()=>{ie(T=>T+1)},[]),C=p.useCallback(()=>{!s||!l||(R(!0),l())},[s,l]),k=p.useCallback(()=>{!s||!u||(R(!1),u())},[s,u]),B=p.useCallback(()=>{d&&u&&(R(!1),u())},[d,u]),v=b?S.width<350:S.height<200,V=b?S.height<310:S.height<450;return t.jsxRuntimeExports.jsx(y.Card,{ref:w,className:m,sx:{width:"100%",height:"100%",display:"flex",flexDirection:b?"row":"column",position:"relative",overflow:"hidden",minWidth:{xs:180,sm:220,md:250},minHeight:b?{xs:200,sm:240,md:260}:{xs:150,sm:180,md:220},border:`1px solid ${o.palette.divider}`,borderRadius:"18px",boxShadow:"none",backgroundColor:((D=o.palette.backgroundPaperElevation)==null?void 0:D[8])||"#2A2A3F",backgroundImage:"none"},children:b?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(y.Box,{sx:{flex:"0 0 50%",position:"relative",height:"100%",minHeight:"100%",maxHeight:"100%",borderRadius:1,m:{xs:1.5,sm:2,md:3},mr:{xs:.75,sm:1,md:1.5},overflow:"hidden",display:v?"none":"block"},children:!v&&t.jsxRuntimeExports.jsxs(_.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:o.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute",top:0,left:0},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[t.jsxRuntimeExports.jsx(F,{}),t.jsxRuntimeExports.jsx(M.Bounds,{fit:!0,observe:!0,margin:1,maxDuration:1,children:t.jsxRuntimeExports.jsx(c,{connectedMotionGroup:x,postModelRender:P})})]})}),t.jsxRuntimeExports.jsxs(y.Box,{sx:{flex:"1",display:"flex",flexDirection:"column",justifyContent:"flex-start",width:v?"100%":"50%"},children:[t.jsxRuntimeExports.jsxs(y.Box,{sx:{p:{xs:1.5,sm:2,md:3},pb:{xs:1,sm:1.5,md:2},textAlign:"left"},children:[t.jsxRuntimeExports.jsx(y.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),t.jsxRuntimeExports.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:a})]}),t.jsxRuntimeExports.jsxs(y.Box,{sx:{p:{xs:1.5,sm:2,md:3},pt:0,flex:"1",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[!V&&f&&t.jsxRuntimeExports.jsxs(y.Box,{children:[t.jsxRuntimeExports.jsx(f,{}),t.jsxRuntimeExports.jsx(y.Divider,{sx:{mt:1,mb:0,borderColor:o.palette.divider,opacity:.5}})]}),t.jsxRuntimeExports.jsx(y.Box,{sx:{mt:!V&&f?"auto":0},children:t.jsxRuntimeExports.jsx(y.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:{xs:1,sm:1.5,md:2},mb:{xs:.5,sm:.75,md:1}},children:t.jsxRuntimeExports.jsx(y.Button,{ref:h,variant:"contained",color:"secondary",size:"small",disabled:!s,onMouseDown:C,onMouseUp:k,onMouseLeave:B,onTouchStart:C,onTouchEnd:k,sx:{textTransform:"none",px:1.5,py:.5},children:i("RobotCard.DriveToHome.bt")})})})]})]})]}):t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs(y.Box,{sx:{p:3,height:"100%",display:"flex",flexDirection:"column"},children:[t.jsxRuntimeExports.jsxs(y.Box,{children:[t.jsxRuntimeExports.jsx(y.Typography,{variant:"h6",component:"h2",sx:{mb:1},children:e}),t.jsxRuntimeExports.jsx(E.ProgramStateIndicator,{programState:n,safetyState:r,operationMode:a})]}),t.jsxRuntimeExports.jsx(y.Box,{sx:{flex:v?0:1,position:"relative",minHeight:v?0:{xs:120,sm:150,md:200},height:v?0:"auto",borderRadius:1,overflow:"hidden",display:v?"none":"block"},children:!v&&t.jsxRuntimeExports.jsxs(_.Canvas,{orthographic:!0,camera:{position:[3,2,3],zoom:1},shadows:!0,frameloop:"demand",style:{borderRadius:o.shape.borderRadius,width:"100%",height:"100%",background:"transparent",position:"absolute"},dpr:[1,2],gl:{alpha:!0,antialias:!0},children:[t.jsxRuntimeExports.jsx(F,{}),t.jsxRuntimeExports.jsx(M.Bounds,{fit:!0,clip:!0,observe:!0,margin:1,maxDuration:1,children:t.jsxRuntimeExports.jsx(c,{connectedMotionGroup:x,postModelRender:P})})]})}),t.jsxRuntimeExports.jsxs(y.Box,{children:[!V&&f&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(f,{}),t.jsxRuntimeExports.jsx(y.Divider,{sx:{mt:1,mb:0,borderColor:o.palette.divider,opacity:.5}})]}),t.jsxRuntimeExports.jsx(y.Box,{sx:{display:"flex",justifyContent:"flex-start",mt:!V&&f?{xs:1,sm:2,md:5}:{xs:.5,sm:1,md:2},mb:{xs:.5,sm:.75,md:1}},children:t.jsxRuntimeExports.jsx(y.Button,{ref:h,variant:"contained",color:"secondary",size:"small",disabled:!s,onMouseDown:C,onMouseUp:k,onMouseLeave:B,onTouchStart:C,onTouchEnd:k,sx:{textTransform:"none",px:1.5,py:.5},children:i("RobotCard.DriveToHome.bt")})})]})]})})})})),_e=Array(6).fill(2*Math.PI);function te({rapidlyChangingMotionState:e,dhParameters:n,onTranslationChanged:r,children:a}){const s=p.useRef([]),l=p.useRef([]),u=p.useRef(null),{invalidate:x}=_.useThree();p.useEffect(()=>{const o=e.joint_position.filter(i=>i!==void 0);return u.current=new E.ValueInterpolator(o,{tension:120,friction:20,threshold:.001}),()=>{var i;(i=u.current)==null||i.destroy()}},[]),_.useFrame((o,i)=>{if(u.current){const d=u.current.update(i);f(),d||x()}});function c(o){o&&(l.current=H(o),f(),x())}function f(){var i;const o=((i=u.current)==null?void 0:i.getCurrentValues())||[];if(r)r(l.current,o);else for(const[d,R]of l.current.entries()){const w=n[d].reverse_rotation_direction?-1:1;R.position.y=w*(o[d]||0)/1e3}}const m=p.useCallback(()=>{const o=e.joint_position.filter(i=>i!==void 0);requestAnimationFrame(()=>{var i;s.current=o,(i=u.current)==null||i.setTarget(o)})},[e]);return p.useEffect(()=>{m()},[e,m]),E.useAutorun(()=>{m()}),t.jsxRuntimeExports.jsx("group",{ref:c,children:a})}function re({rapidlyChangingMotionState:e,dhParameters:n,...r}){const a=new g.Matrix4,s=p.useRef(null),l=p.useRef(null);function u(f){const m=new g.Matrix4;for(let R=0;R<n.length;R++){const h=n[R],w=f[R]??0,b=new g.Matrix4().makeRotationY(h.theta).multiply(new g.Matrix4().makeTranslation(h.a/1e3,(h.d+w*(h.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new g.Matrix4().makeRotationX(h.alpha));m.multiply(b)}const o=new g.Vector3,i=new g.Quaternion,d=new g.Vector3;return m.decompose(o,i,d),o}const x=u(e.joint_position);function c(f,m){a.identity();let o=new g.Vector3;for(let h=0;h<n.length;h++){const w=m[h]??0,b=n[h],G=new g.Matrix4().makeRotationY(b.theta).multiply(new g.Matrix4().makeTranslation(b.a/1e3,(b.d+w*(b.reverse_rotation_direction?-1:1))/1e3,0)).multiply(new g.Matrix4().makeRotationX(b.alpha));a.multiply(G)}const i=new g.Vector3,d=new g.Quaternion,R=new g.Vector3;if(a.decompose(i,d,R),o=i,s.current&&s.current.position.set(o.x,o.y,o.z),l.current){const h=l.current.geometry;h&&h.setPositions&&h.setPositions([0,0,0,o.x,o.y,o.z])}}return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(te,{rapidlyChangingMotionState:e,dhParameters:n,onTranslationChanged:c,children:t.jsxRuntimeExports.jsxs("group",{...r,name:"Scene",children:[t.jsxRuntimeExports.jsxs("mesh",{name:"Base",position:[0,0,0],children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.02,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"green",depthTest:!0})]}),t.jsxRuntimeExports.jsx(M.Line,{ref:l,points:[new g.Vector3(0,0,0),x],color:"White",lineWidth:5}),t.jsxRuntimeExports.jsxs("mesh",{ref:s,name:"TCP",position:x,children:[t.jsxRuntimeExports.jsx("sphereGeometry",{args:[.025,32,32]}),t.jsxRuntimeExports.jsx("meshStandardMaterial",{color:"red",depthTest:!0})]})]})})})}const ne=t.externalizeComponent(({rapidlyChangingMotionState:e,modelFromController:n,dhParameters:r,getModel:a=L,flangeRef:s,postModelRender:l,transparentColor:u,...x})=>{const[c,f]=p.useState(null),m=p.useCallback(i=>{f(i)},[]);p.useEffect(()=>{c&&(u?K(c,u):Q(c))},[c,u]);const o=t.jsxRuntimeExports.jsx(re,{rapidlyChangingMotionState:e,dhParameters:r,...x});return t.jsxRuntimeExports.jsxs(W.ErrorBoundary,{fallback:o,onError:i=>{console.warn(i)},children:[t.jsxRuntimeExports.jsx(p.Suspense,{fallback:o,children:t.jsxRuntimeExports.jsx("group",{ref:m,children:t.jsxRuntimeExports.jsx(te,{rapidlyChangingMotionState:e,dhParameters:r,children:t.jsxRuntimeExports.jsx(X,{modelURL:(()=>{const i=a(n);if(!i){const d=new Blob([],{type:"model/gltf-binary"}),R=new File([d],`${n}.glb`,{type:"model/gltf-binary"});return Promise.resolve(URL.createObjectURL(R))}return i})(),postModelRender:l,flangeRef:s,...x})})})}),t.jsxRuntimeExports.jsx(Y,{})]})});function Le({connectedMotionGroup:e,getModel:n=L,flangeRef:r,transparentColor:a,postModelRender:s,...l}){if(!e.dhParameters)return null;const u=e.modelFromController||"";return u&&n(u)?t.jsxRuntimeExports.jsx(ne,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:u,dhParameters:e.dhParameters,getModel:n,flangeRef:r,transparentColor:a,postModelRender:s,...l}):t.jsxRuntimeExports.jsx(re,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,dhParameters:e.dhParameters,...l})}const I={[E.Manufacturer.Abb]:[0,0,0,0,Math.PI/2,0,0],[E.Manufacturer.Fanuc]:[0,0,0,0,-Math.PI/2,0,0],[E.Manufacturer.Yaskawa]:[0,0,0,0,-Math.PI/2,0,0],[E.Manufacturer.Kuka]:[0,-Math.PI/2,Math.PI/2,0,Math.PI/2,0,0],[E.Manufacturer.Universalrobots]:[0,-Math.PI/2,-Math.PI/2,-Math.PI/2,Math.PI/2,-Math.PI/2,0]};function se(e){const[n]=e.split("_");switch(n){case"ABB":return E.Manufacturer.Abb;case"FANUC":return E.Manufacturer.Fanuc;case"YASKAWA":return E.Manufacturer.Yaskawa;case"KUKA":return E.Manufacturer.Kuka;case"UniversalRobots":return E.Manufacturer.Universalrobots;default:return null}}function Se(e,n){const r=se(e);return r&&r in I?I[r]:n||null}exports.CollisionSceneRenderer=pe;exports.LinearAxis=Le;exports.MANUFACTURER_HOME_CONFIGS=I;exports.PresetEnvironment=F;exports.Robot=ee;exports.RobotCard=ve;exports.SafetyZonesRenderer=he;exports.SupportedLinearAxis=ne;exports.SupportedRobot=Z;exports.TrajectoryRenderer=je;exports.defaultAxisConfig=_e;exports.defaultGetModel=L;exports.extractManufacturer=se;exports.getDefaultHomeConfig=Se;
2
+ //# sourceMappingURL=manufacturerHomePositions-5E6JP4Zd.cjs.map