@wandelbots/wandelbots-js-react-components 2.26.0-pr.feature-update-to-react-19.361.fbd0985 → 2.26.0-pr.feature-update-to-react-19.361.1e3686f
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/components/utils/interpolation.d.ts +1 -0
- package/dist/components/utils/interpolation.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/utils/interpolation.test.ts +28 -0
- package/src/components/utils/interpolation.ts +17 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../../src/components/utils/interpolation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACrC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACxC;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,oBAAoB,CAAe;IAC3C,OAAO,CAAC,gBAAgB,CAAY;IACpC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,OAAO,CAAgC;
|
|
1
|
+
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../../src/components/utils/interpolation.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACrC,wDAAwD;IACxD,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACxC;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,oBAAoB,CAAe;IAC3C,OAAO,CAAC,gBAAgB,CAAY;IACpC,OAAO,CAAC,WAAW,CAAsB;IACzC,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,WAAW,CAAY;IAG/B,OAAO,CAAC,UAAU,CAAe;gBAG/B,aAAa,GAAE,MAAM,EAAO,EAC5B,OAAO,GAAE,oBAAyB;IAmBpC;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,GAAE,MAAe,GAAG,OAAO;IAkEvC;;;;;OAKG;IACH,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAgDpC;;OAEG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI/B;;;;;OAKG;IACH,eAAe,IAAI,OAAO;IAI1B;;;;;OAKG;IACH,IAAI,IAAI,IAAI;IAOZ;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI;IAWpC;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI;IAI9D;;;;;;OAMG;IACH,sBAAsB,IAAI,IAAI;IAI9B;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,OAAO,CASd;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAC9B,aAAa,GAAE,MAAM,EAAO,EAC5B,OAAO,GAAE,oBAAyB,GACjC,CAAC,iBAAiB,CAAC,CAqBrB"}
|
package/dist/index.cjs
CHANGED
|
@@ -103,5 +103,5 @@ and limitations under the License.
|
|
|
103
103
|
`,p);const g=(yield t.api.controller.getRobotController(i.controller)).configuration.kind==="VirtualController",m=yield me(this,null,function*(){try{return yield t.api.motionGroupInfos.getMounting(c.motion_group)}catch(W){return console.error(`Error fetching mounting for ${c.motion_group}`,W),null}}),x=t.openReconnectingWebsocket(`/controllers/${i.controller}/state-stream?response_rate=1000`),I=yield x.firstMessage(),G=(o=Rt(I.data))==null?void 0:o.result;if(!G)throw new Error(`Unable to parse initial controller state message ${I.data}`);console.log(`Connected controller state websocket to controller ${i.controller}. Initial state:
|
|
104
104
|
`,G);const{tcps:N}=yield t.api.motionGroupInfos.listTcps(r),D=yield t.api.motionGroupInfos.getMotionGroupSpecification(r),z=yield t.api.motionGroupInfos.getSafetySetup(r);return new Xi(t,i,c,p,d,g,N,D,z,m,G,x)})}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.motionGroup.model_from_controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replaceAll("-","_")}_${t}`}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.state.joint_position.joints.map((t,r)=>({index:r}))}get dhParameters(){return this.motionGroupSpecification.dh_parameters}get safetyZones(){return this.safetySetup.safety_zones}get mountingPosition(){return this.mounting?[this.mounting.pose.position.x/1e3,this.mounting.pose.position.y/1e3,this.mounting.pose.position.z/1e3]:[0,0,0]}get mountingQuaternion(){var t,r,a,n,o,s;const l=new Oe.Vector3(((r=(t=this.mounting)==null?void 0:t.pose.orientation)==null?void 0:r.x)||0,((n=(a=this.mounting)==null?void 0:a.pose.orientation)==null?void 0:n.y)||0,((s=(o=this.mounting)==null?void 0:o.pose.orientation)==null?void 0:s.z)||0),i=l.length(),c=l.normalize();return new Oe.Quaternion().setFromAxisAngle(c,i)}get isEstopActive(){return["SAFETY_STATE_ROBOT_EMERGENCY_STOP","SAFETY_STATE_DEVICE_EMERGENCY_STOP"].includes(this.controllerState.safety_state)}get isMoveableSafetyState(){return["SAFETY_STATE_NORMAL","SAFETY_STATE_REDUCED"].includes(this.controllerState.safety_state)}get isMoveableOperationMode(){return["OPERATION_MODE_AUTO","OPERATION_MODE_MANUAL","OPERATION_MODE_MANUAL_T1","OPERATION_MODE_MANUAL_T2"].includes(this.controllerState.operation_mode)}get canBeMoved(){return this.isMoveableSafetyState&&this.isMoveableOperationMode&&this.activationState==="active"}deactivate(){return me(this,null,function*(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}Ae.runInAction(()=>{this.activationState="deactivating"});try{yield this.nova.api.controller.setDefaultMode(this.controllerId,"MODE_MONITOR"),Ae.runInAction(()=>{this.activationState="inactive"})}catch(t){throw Ae.runInAction(()=>{this.activationState="active"}),t}})}activate(){return me(this,null,function*(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}Ae.runInAction(()=>{this.activationState="activating"});try{yield this.nova.api.controller.setDefaultMode(this.controllerId,"MODE_CONTROL"),Ae.runInAction(()=>{this.activationState="active"})}catch(t){throw Ae.runInAction(()=>{this.activationState="inactive"}),t}})}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingCartesianSocket&&this.connectedJoggingCartesianSocket.close(),this.connectedJoggingJointsSocket&&this.connectedJoggingJointsSocket.close()}setJoggingVelocity(t){this.joggingVelocity=t}},ES=class Zi{constructor(t,r={}){this.motionStream=t,this.opts=r,this.cartesianWebsocket=null,this.jointWebsocket=null,this.cartesianJoggingOpts={}}static open(t,r){return me(this,arguments,function*(a,n,o={}){const s=yield a.connectMotionStream(n);return new Zi(s,o)})}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get numJoints(){return this.motionStream.joints.length}get activeJoggingMode(){return this.cartesianWebsocket?"cartesian":this.jointWebsocket?"joint":"increment"}get activeWebsocket(){return this.cartesianWebsocket||this.jointWebsocket}stop(){return me(this,null,function*(){this.cartesianWebsocket&&this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:{x:0,y:0,z:0},rotation_direction:{x:0,y:0,z:0},position_velocity:0,rotation_velocity:0,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId}),this.jointWebsocket&&this.jointWebsocket.sendJson({motion_group:this.motionGroupId,joint_velocities:new Array(this.numJoints).fill(0)})})}dispose(){this.cartesianWebsocket&&this.cartesianWebsocket.dispose(),this.jointWebsocket&&this.jointWebsocket.dispose()}setJoggingMode(t,r){console.log("Setting jogging mode to",t),r&&(Ug(this.cartesianJoggingOpts,r)||this.cartesianWebsocket&&(this.cartesianWebsocket.dispose(),this.cartesianWebsocket=null),this.cartesianJoggingOpts=r),t!=="cartesian"&&this.cartesianWebsocket&&(this.cartesianWebsocket.dispose(),this.cartesianWebsocket=null),t!=="joint"&&this.jointWebsocket&&(this.jointWebsocket.dispose(),this.jointWebsocket=null),t==="cartesian"&&!this.cartesianWebsocket&&(this.cartesianWebsocket=this.nova.openReconnectingWebsocket("/motion-groups/move-tcp"),this.cartesianWebsocket.addEventListener("message",a=>{const n=Rt(a.data);if(n&&"error"in n)if(this.opts.onError)this.opts.onError(a.data);else throw new Error(a.data)})),t==="joint"&&!this.jointWebsocket&&(this.jointWebsocket=this.nova.openReconnectingWebsocket("/motion-groups/move-joint"),this.jointWebsocket.addEventListener("message",a=>{const n=Rt(a.data);if(n&&"error"in n)if(this.opts.onError)this.opts.onError(a.data);else throw new Error(a.data)}))}startJointRotation(t){return me(this,arguments,function*({joint:r,direction:a,velocityRadsPerSec:n}){if(!this.jointWebsocket)throw new Error("Joint jogging websocket not connected; call setJoggingMode first");const o=new Array(this.numJoints).fill(0);o[r]=a==="-"?-n:n,this.jointWebsocket.sendJson({motion_group:this.motionGroupId,joint_velocities:o})})}startTCPTranslation(t){return me(this,arguments,function*({axis:r,direction:a,velocityMmPerSec:n}){if(!this.cartesianWebsocket)throw new Error("Cartesian jogging websocket not connected; call setJoggingMode first");const o={x:0,y:0,z:0},s=Object.assign({},o);s[r]=a==="-"?-1:1,this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:s,rotation_direction:o,position_velocity:n,rotation_velocity:0,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId})})}startTCPRotation(t){return me(this,arguments,function*({axis:r,direction:a,velocityRadsPerSec:n}){if(!this.cartesianWebsocket)throw new Error("Cartesian jogging websocket not connected; call setJoggingMode first");const o={x:0,y:0,z:0},s=Object.assign({},o);s[r]=a==="-"?-1:1,this.cartesianWebsocket.sendJson({motion_group:this.motionGroupId,position_direction:o,rotation_direction:s,position_velocity:0,rotation_velocity:n,tcp:this.cartesianJoggingOpts.tcpId,coordinate_system:this.cartesianJoggingOpts.coordSystemId})})}runIncrementalCartesianMotion(t){return me(this,arguments,function*({currentTcpPose:r,currentJoints:a,coordSystemId:n,velocityInRelevantUnits:o,axis:s,direction:l,motion:i}){var c;const d=[];if(!Xg(r.coordinate_system,n))throw new Error(`Current TCP pose coordinate system ${r.coordinate_system} does not match target coordinate system ${n}`);if(i.type==="translate"){const y=Object.assign({},r.position);y[s]+=i.distanceMm*(l==="-"?-1:1),d.push({settings:{limits_override:{tcp_velocity_limit:o}},line:{position:y,orientation:r.orientation,coordinate_system:n}})}else if(i.type==="rotate"){const y=new hr(r.orientation.x,r.orientation.y,r.orientation.z),g=y.length(),m=y.clone().normalize(),x=i.distanceRads*(l==="-"?-1:1),I=new hr(0,0,0);I[s]=1;const G=Math.cos(.5*x)*Math.cos(.5*g),N=Math.sin(.5*x)*Math.sin(.5*g),D=Math.sin(.5*x)*Math.cos(.5*g),z=Math.cos(.5*x)*Math.sin(.5*g),W=I.dot(m),j=I.clone().cross(m),U=2*Math.acos(G-N*W),k=U/Math.sin(.5*U),f=new hr().addScaledVector(j,N).addScaledVector(I,D).addScaledVector(m,z).multiplyScalar(k);d.push({settings:{limits_override:{tcp_orientation_velocity_limit:o}},line:{position:r.position,orientation:f,coordinate_system:n}})}const u=yield this.nova.api.motion.planMotion({motion_group:this.motionGroupId,start_joint_position:a,tcp:this.cartesianJoggingOpts.tcpId,commands:d}),p=(c=u.plan_successful_response)==null?void 0:c.motion;if(!p)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(u)}`);yield this.nova.api.motion.streamMoveForward(p,100,void 0,void 0,void 0,{timeout:1e3*60})})}runIncrementalJointRotation(t){return me(this,arguments,function*({joint:r,currentJoints:a,velocityRadsPerSec:n,direction:o,distanceRads:s}){var l;const i=[...a.joints];i[r]+=s*(o==="-"?-1:1);const c=new Array(a.joints.length).fill(n),d=yield this.nova.api.motion.planMotion({motion_group:this.motionGroupId,start_joint_position:a,commands:[{settings:{limits_override:{joint_velocity_limits:{joints:c}}},joint_ptp:{joints:i}}]}),u=(l=d.plan_successful_response)==null?void 0:l.motion;if(!u){console.error("Failed to plan jogging increment motion",d);return}yield this.nova.api.motion.streamMoveForward(u,100,void 0,void 0,void 0,{timeout:1e3*60})})}},ll=1e-4;function MS(e,t){const r=new Ze.Vector3(t.x,t.y,t.z),a=new Ze.Vector3(e.x,e.y,e.z),n=r.length(),o=r.normalize();let s=a.length(),l=a.normalize();l.dot(o)<0&&(s=-s,l=l.multiplyScalar(-1));let i=s-n;return i-=2*Math.PI*Math.floor((i+Math.PI)/(2*Math.PI)),s=n+i,l.multiplyScalar(s)}var jS=class ec{constructor(t,r,a,n,o){this.nova=t,this.controller=r,this.motionGroup=a,this.initialMotionState=n,this.motionStateSocket=o,this.rapidlyChangingMotionState=n,o.addEventListener("message",s=>{var l;const i=(l=Rt(s.data))==null?void 0:l.result;if(!i)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${s.data}`);Ki(this.rapidlyChangingMotionState.state.joint_position.joints,i.state.joint_position.joints,ll)||Ae.runInAction(()=>{this.rapidlyChangingMotionState.state=i.state}),Yi(this.rapidlyChangingMotionState.tcp_pose,i.tcp_pose,ll)||Ae.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=i.tcp_pose:this.rapidlyChangingMotionState.tcp_pose={position:i.tcp_pose.position,orientation:MS(i.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation),tcp:i.tcp_pose.tcp,coordinate_system:i.tcp_pose.coordinate_system}})}),Ae.makeAutoObservable(this)}static open(t,r){return me(this,null,function*(){var a;const{instances:n}=yield t.api.controller.listControllers(),[o,s]=r.split("@"),l=n.find(p=>p.controller===s),i=l==null?void 0:l.physical_motion_groups.find(p=>p.motion_group===r);if(!l||!i)throw new Error(`Controller ${s} or motion group ${r} not found`);const c=t.openReconnectingWebsocket(`/motion-groups/${r}/state-stream`),d=yield c.firstMessage();console.log("got first message",d);const u=(a=Rt(d.data))==null?void 0:a.result;if(!u)throw new Error(`Unable to parse initial motion state message ${d.data}`);return console.log(`Connected motion state websocket to motion group ${i.motion_group}. Initial state:
|
|
105
105
|
`,u),new ec(t,l,i,u,c)})}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.motionGroup.model_from_controller}get wandelscriptIdentifier(){const t=this.motionGroupId.split("@")[0];return`${this.controllerId.replaceAll("-","_")}_${t}`}get joints(){return this.initialMotionState.state.joint_position.joints.map((t,r)=>({index:r}))}dispose(){this.motionStateSocket.close()}},$S=class{constructor(e,t){this.cellId=e,this.opts=t,this.system=this.withUnwrappedResponsesOnly(bS),this.cell=this.withUnwrappedResponsesOnly(j0),this.deviceConfig=this.withCellId(D0),this.motionGroup=this.withCellId(eS),this.motionGroupInfos=this.withCellId(rS),this.controller=this.withCellId(U0),this.program=this.withCellId(iS),this.programValues=this.withCellId(dS),this.controllerIOs=this.withCellId(L0),this.motionGroupKinematic=this.withCellId(sS),this.motion=this.withCellId(X0),this.coordinateSystems=this.withCellId(F0),this.application=this.withCellId(al),this.applicationGlobal=this.withUnwrappedResponsesOnly(al),this.motionGroupJogging=this.withCellId(nS),this.virtualRobot=this.withCellId(vS),this.virtualRobotSetup=this.withCellId(PS),this.virtualRobotMode=this.withCellId(CS),this.virtualRobotBehavior=this.withCellId(OS),this.libraryProgramMetadata=this.withCellId(J0),this.libraryProgram=this.withCellId(G0),this.libraryRecipeMetadata=this.withCellId(K0),this.libraryRecipe=this.withCellId(W0),this.storeObject=this.withCellId(yS),this.storeCollisionComponents=this.withCellId(pS),this.storeCollisionScenes=this.withCellId(mS)}withCellId(e){var t,r;const a=new e(po(cr({},this.opts),{isJsonMime:n=>n==="application/json"}),(t=this.opts.basePath)!=null?t:"",(r=this.opts.axiosInstance)!=null?r:v.create());for(const n of Reflect.ownKeys(Reflect.getPrototypeOf(a)))if(n!=="constructor"&&typeof a[n]=="function"){const o=a[n];a[n]=(...s)=>o.apply(a,[this.cellId,...s]).then(l=>l.data)}return a}withUnwrappedResponsesOnly(e){var t,r;const a=new e(po(cr({},this.opts),{isJsonMime:n=>n==="application/json"}),(t=this.opts.basePath)!=null?t:"",(r=this.opts.axiosInstance)!=null?r:v.create());for(const n of Reflect.ownKeys(Reflect.getPrototypeOf(a)))if(n!=="constructor"&&typeof a[n]=="function"){const o=a[n];a[n]=(...s)=>o.apply(a,s).then(l=>l.data)}return a}},US=class{constructor(){this.connections=[]}handleAPIRequest(e){return me(this,null,function*(){var t,r,a;const n=[{method:"GET",path:"/cells/:cellId/controllers",handle(){return{instances:[{controller:"mock-ur5e",model_name:"UniversalRobots::Controller",host:"mock-ur5e",allow_software_install_on_controller:!0,physical_motion_groups:[{motion_group:"0@mock-ur5e",name_from_controller:"UR5e",active:!1,model_from_controller:"UniversalRobots_UR5e"}],has_error:!1,error_details:""}]}}},{method:"GET",path:"/cells/:cellId/controllers/:controllerId",handle(){return{configuration:{kind:"VirtualController",manufacturer:"universalrobots",position:"[0,-1.571,-1.571,-1.571,1.571,-1.571,0]",type:"universalrobots-ur5e"},name:"mock-ur5"}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/specification",handle(){return{dh_parameters:[{alpha:1.5707963267948966,theta:0,a:0,d:162.25,reverse_rotation_direction:!1},{alpha:0,theta:0,a:-425,d:0,reverse_rotation_direction:!1},{alpha:0,theta:0,a:-392.2,d:0,reverse_rotation_direction:!1},{alpha:1.5707963267948966,theta:0,a:0,d:133.3,reverse_rotation_direction:!1},{alpha:-1.5707963267948966,theta:0,a:0,d:99.7,reverse_rotation_direction:!1},{alpha:0,theta:0,a:0,d:99.6,reverse_rotation_direction:!1}],mechanical_joint_limits:[{joint:"JOINTNAME_AXIS_1",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_2",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_3",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_4",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_5",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1},{joint:"JOINTNAME_AXIS_6",lower_limit:-6.335545063018799,upper_limit:6.335545063018799,unlimited:!1}]}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/safety-setup",handle(){return{safety_settings:[{safety_state:"SAFETY_NORMAL",settings:{joint_position_limits:[{joint:"JOINTNAME_AXIS_1",lower_limit:-2.96705961227417,upper_limit:2.96705961227417,unlimited:!1},{joint:"JOINTNAME_AXIS_2",lower_limit:-1.7453292608261108,upper_limit:2.7925267219543457,unlimited:!1},{joint:"JOINTNAME_AXIS_3",lower_limit:-3.3161256313323975,upper_limit:.40142571926116943,unlimited:!1},{joint:"JOINTNAME_AXIS_4",lower_limit:-3.4906585216522217,upper_limit:3.4906585216522217,unlimited:!1},{joint:"JOINTNAME_AXIS_5",lower_limit:-2.4434609413146973,upper_limit:2.4434609413146973,unlimited:!1},{joint:"JOINTNAME_AXIS_6",lower_limit:-4.71238899230957,upper_limit:4.71238899230957,unlimited:!1}],joint_velocity_limits:[{joint:"JOINTNAME_AXIS_1",limit:3.1415927410125732},{joint:"JOINTNAME_AXIS_2",limit:3.1415927410125732},{joint:"JOINTNAME_AXIS_3",limit:3.4906585216522217},{joint:"JOINTNAME_AXIS_4",limit:6.108652591705322},{joint:"JOINTNAME_AXIS_5",limit:6.108652591705322},{joint:"JOINTNAME_AXIS_6",limit:6.981317043304443}],joint_acceleration_limits:[],joint_torque_limits:[],tcp_velocity_limit:1800}}],safety_zones:[{id:1,priority:0,geometry:{compound:{child_geometries:[{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:1650,y:-1330,z:-1820},{x:1650,y:1330,z:-1820},{x:-800,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:1650,y:-1330,z:-1820},{x:1650,y:-1330,z:1500},{x:-800,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:-800,y:-1330,z:-1820},{x:-800,y:1330,z:-1820},{x:-800,y:1330,z:1500},{x:-800,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:-800,y:1330,z:1500},{x:-800,y:-1330,z:1500},{x:1650,y:-1330,z:1500}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:-800,y:1330,z:1500},{x:-800,y:1330,z:-1820},{x:1650,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"},{convex_hull:{vertices:[{x:1650,y:1330,z:1500},{x:1650,y:-1330,z:1500},{x:1650,y:-1330,z:-1820},{x:1650,y:1330,z:-1820}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"box"}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Cell workzone"},motion_group_uid:1},{id:2,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:1330,z:-1850},{x:865,y:1330,z:-1850},{x:865,y:-720,z:-1850},{x:1650,y:-720,z:-1850},{x:1650,y:1330,z:-920},{x:865,y:1330,z:-920},{x:865,y:-720,z:-920},{x:1650,y:-720,z:-920}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Transport"},motion_group_uid:1},{id:3,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:1330,z:-600},{x:865,y:1330,z:-600},{x:865,y:430,z:-600},{x:1650,y:430,z:-600},{x:1650,y:1330,z:-1250},{x:865,y:1330,z:-1250},{x:865,y:430,z:-1250},{x:1650,y:430,z:-1250}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Tunel"},motion_group_uid:1},{id:4,priority:0,geometry:{convex_hull:{vertices:[{x:1650,y:-760,z:-440},{x:900,y:-760,z:-440},{x:900,y:-1330,z:-440},{x:1650,y:-1330,z:-440},{x:1650,y:-760,z:-1800},{x:900,y:-760,z:-1800},{x:900,y:-1330,z:-1800},{x:1650,y:-1330,z:-1800}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Fanuc controller"},motion_group_uid:1},{id:6,priority:0,geometry:{convex_hull:{vertices:[{x:-200,y:-200,z:-1900},{x:200,y:-200,z:-1900},{x:200,y:200,z:-1900},{x:-200,y:200,z:-1900},{x:-200,y:-200,z:-350},{x:200,y:-200,z:-350},{x:200,y:200,z:-350},{x:-200,y:200,z:-350}]},init_pose:{position:{x:0,y:0,z:0},orientation:{x:0,y:0,z:0,w:1}},id:"Robot base"},motion_group_uid:1}],robot_model_geometries:[{link_index:1,geometry:{sphere:{radius:270},init_pose:{position:{x:-70,y:-70,z:-50},orientation:{x:0,y:0,z:0,w:1}},id:"link1_sphere"}},{link_index:2,geometry:{capsule:{radius:160,cylinder_height:800},init_pose:{position:{x:-450,y:40,z:170},orientation:{x:0,y:-.7071067811865475,z:0,w:.7071067811865476}},id:"link2_capsule"}},{link_index:3,geometry:{sphere:{radius:270},init_pose:{position:{x:-110,y:10,z:-100},orientation:{x:0,y:0,z:0,w:1}},id:"link3_sphere"}},{link_index:4,geometry:{capsule:{radius:110,cylinder_height:600},init_pose:{position:{x:0,y:300,z:40},orientation:{x:-.7071067811865475,y:0,z:0,w:.7071067811865476}},id:"link4_capsule"}},{link_index:5,geometry:{sphere:{radius:75},init_pose:{position:{x:0,y:0,z:-50},orientation:{x:0,y:0,z:0,w:1}},id:"link5_sphere"}}],tool_geometries:[]}}},{method:"GET",path:"/cells/:cellId/coordinate-systems",handle(){return{coordinatesystems:[{coordinate_system:"",name:"world",reference_uid:"",position:{x:0,y:0,z:0},rotation:{angles:[0,0,0],type:"ROTATION_VECTOR"}}]}}},{method:"GET",path:"/cells/:cellId/motion-groups/:motionGroupId/tcps",handle(){return{tcps:[{id:"Flange",readable_name:"Default-Flange",position:{x:0,y:0,z:0},rotation:{angles:[0,0,0,0],type:"ROTATION_VECTOR"}},{id:"complex-tcp-position",readable_name:"Complex TCP Position",position:{x:-200,y:300,z:150},rotation:{angles:[-.12139440409113832,-.06356210998212003,-.2023240068185639,0],type:"ROTATION_VECTOR"}}]}}}],o=((t=e.method)==null?void 0:t.toUpperCase())||"GET",s="/cells"+((a=(r=e.url)==null?void 0:r.split("/cells")[1])==null?void 0:a.split("?")[0]);for(const l of n){const i=TS.match(l.path)(s||"");if(o===l.method&&i){const c=l.handle();return{status:200,statusText:"Success",data:JSON.stringify(c),headers:{},config:e,request:{responseURL:e.url}}}}throw new So(`No mock handler matched this request: ${o} ${s}`,"404",e)})}handleWebsocketConnection(e){this.connections.push(e),setTimeout(()=>{e.dispatchEvent(new Event("open")),console.log("Websocket connection opened from",e.url),e.url.includes("/state-stream")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify(kS)})),e.url.includes("/move-joint")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{motion_group:"0@ur",state:{controller:"ur",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",timestamp:"2024-09-18T12:48:26.096266444Z",velocity_override:100,motion_groups:[{motion_group:"0@ur",controller:"ur",joint_position:{joints:[1.3492152690887451,-1.5659207105636597,1.6653711795806885,-1.0991662740707397,-1.829018235206604,1.264623761177063]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:6.437331889439328,y:-628.4123774830913,z:577.0569957147832},orientation:{x:-1.683333649797158,y:-1.9783363827298732,z:-.4928031860165713},coordinate_system:""},tcp_pose:{position:{x:6.437331889439328,y:-628.4123774830913,z:577.0569957147832},orientation:{x:-1.683333649797158,y:-1.9783363827298732,z:-.4928031860165713},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:-0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"671259"}],sequence_number:"671259"},movement_state:"MOVEMENT_STATE_MOVING"}})})),e.url.includes("/move-tcp")&&e.dispatchEvent(new MessageEvent("message",{data:JSON.stringify({result:{motion_group:"0@ur",state:{controller:"ur",operation_mode:"OPERATION_MODE_AUTO",safety_state:"SAFETY_STATE_NORMAL",timestamp:"2024-09-18T12:43:12.188335774Z",velocity_override:100,motion_groups:[{motion_group:"0@ur",controller:"ur",joint_position:{joints:[1.3352527618408203,-1.5659207105636597,1.6653711795806885,-1.110615611076355,-1.829018235206604,1.264623761177063]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:-2.763015284002938,y:-630.2151479701106,z:577.524509114342},orientation:{x:-1.704794877102097,y:-1.9722372952861567,z:-.4852079204210754},coordinate_system:""},tcp_pose:{position:{x:-2.763015284002938,y:-630.2151479701106,z:577.524509114342},orientation:{x:-1.704794877102097,y:-1.9722372952861567,z:-.4852079204210754},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:-0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"627897"}],sequence_number:"627897"},movement_state:"MOVEMENT_STATE_MOVING"}})}))},10)}handleWebsocketMessage(e,t){console.log(`Received message on ${e.url}`,t)}},kS={result:{state:{motion_group:"0@universalrobots-ur5e",controller:"universalrobots-ur5e",joint_position:{joints:[1.1699999570846558,-1.5700000524520874,1.3600000143051147,1.0299999713897705,1.2899999618530273,1.2799999713897705]},joint_velocity:{joints:[0,0,0,0,0,0]},flange_pose:{position:{x:1.3300010259703043,y:-409.2680714682808,z:531.0203477065281},orientation:{x:1.7564919306270736,y:-1.7542521568325058,z:.7326972590614671},coordinate_system:""},tcp_pose:{position:{x:1.3300010259703043,y:-409.2680714682808,z:531.0203477065281},orientation:{x:1.7564919306270736,y:-1.7542521568325058,z:.7326972590614671},coordinate_system:"",tcp:"Flange"},velocity:{linear:{x:0,y:0,z:0},angular:{x:0,y:0,z:0},coordinate_system:""},force:{force:{x:0,y:0,z:0},moment:{x:0,y:0,z:0},coordinate_system:""},joint_limit_reached:{limit_reached:[!1,!1,!1,!1,!1,!1]},joint_current:{joints:[0,0,0,0,0,0]},sequence_number:"1"},tcp_pose:{position:{x:302.90748476115556,y:-152.87065869452337,z:424.0454619321661},orientation:{x:2.3403056115045353,y:-1.1706836379431356,z:.9772511964246311},coordinate_system:"",tcp:"Flange"}}},LS=class{constructor(e){this.authPromise=null,this.accessToken=null;var t;const r=(t=e.cellId)!=null?t:"cell";this.config=cr({cellId:r},e),this.accessToken=e.accessToken||zn.getString("wbjs.access_token")||null,this.config.instanceUrl==="https://mock.example.com"&&(this.mock=new US);const a=v.create({baseURL:Kn(this.config.instanceUrl,"/api/v1"),headers:{"User-Agent":"Wandelbots-Nova-JS-SDK"}});a.interceptors.request.use(n=>me(this,null,function*(){return n.headers.Authorization||(this.accessToken?n.headers.Authorization=`Bearer ${this.accessToken}`:this.config.username&&this.config.password&&(n.headers.Authorization=`Basic ${btoa(e.username+":"+e.password)}`)),n})),typeof window<"u"&&a.interceptors.response.use(n=>n,n=>me(this,null,function*(){var o,s;if(T0(n))if(((o=n.response)==null?void 0:o.status)===401)try{if(yield this.renewAuthentication(),n.config)return this.accessToken?n.config.headers.Authorization=`Bearer ${this.accessToken}`:delete n.config.headers.Authorization,a.request(n.config)}catch(l){return Promise.reject(l)}else((s=n.response)==null?void 0:s.status)===503&&(yield fetch(window.location.href)).status===503&&window.location.reload();return Promise.reject(n)})),this.api=new $S(r,po(cr({},e),{basePath:Kn(this.config.instanceUrl,"/api/v1"),isJsonMime:n=>n==="application/json",baseOptions:cr(cr({},this.mock?{adapter:n=>this.mock.handleAPIRequest(n)}:{}),e.baseOptions),axiosInstance:a}))}renewAuthentication(){return me(this,null,function*(){if(!this.authPromise){this.authPromise=eb(this.config.instanceUrl);try{this.accessToken=yield this.authPromise,this.accessToken?zn.setString("wbjs.access_token",this.accessToken):zn.delete("wbjs.access_token")}finally{this.authPromise=null}}})}makeWebsocketURL(e){const t=new URL(Kn(this.config.instanceUrl,`/api/v1/cells/${this.config.cellId}`,e));return t.protocol=t.protocol.replace("http","ws"),t.protocol=t.protocol.replace("https","wss"),this.accessToken?t.searchParams.append("token",this.accessToken):this.config.username&&this.config.password&&(t.username=this.config.username,t.password=this.config.password),t.toString()}openReconnectingWebsocket(e){return new Kg(this.makeWebsocketURL(e),{mock:this.mock})}connectMotionStream(e){return me(this,null,function*(){return yield jS.open(this,e)})}connectJogger(e){return me(this,null,function*(){return yield ES.open(this,e)})}connectMotionGroups(e){return me(this,null,function*(){const{instances:t}=yield this.api.controller.listControllers();return Promise.all(e.map(r=>IS.connect(this,r,t)))})}connectMotionGroup(e){return me(this,null,function*(){return(yield this.connectMotionGroups([e]))[0]})}};function BS(e){try{return JSON.stringify(e)}catch{return}}function FS(e,t){throw new Error(t+` ${JSON.stringify(e)}`)}function NS(e){var t,r,a,n;return e instanceof So&&e.code==="ERR_NETWORK"?"Failed to connect to the server. Please check your internet connection.":e instanceof So&&e.response?`${(t=e.response)==null?void 0:t.status} ${(r=e.response)==null?void 0:r.statusText} from ${(a=e.response)==null?void 0:a.config.url}: ${JSON.stringify((n=e.response)==null?void 0:n.data)}`:e instanceof Error?e.message:`Unexpected error: ${BS(e)||e}`}const Lo=e=>{const t=e.softTimeout||3e3,[r,a]=Y.useState(!1),n=F.useTheme();return Y.useEffect(()=>{const o=setTimeout(()=>{a(!0)},t);return()=>clearTimeout(o)}),b.jsx(F.Stack,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:n.palette.text.primary},children:e.error?b.jsx(tc,{loadingMessage:e.message,error:e.error}):b.jsxs(b.Fragment,{children:[b.jsx(F.CircularProgress,{sx:{marginBottom:"24px"}}),!!e.message&&b.jsx("div",{children:e.message}),b.jsx(F.Stack,{sx:{visibility:r?"visible":"hidden",marginTop:"1rem",color:n.palette.text.secondary},children:"This is taking longer than expected..."})]})})},tc=e=>{const t=NS(e.error),r=e.error instanceof Error?e.error.stack:null,a=F.useTheme();return b.jsxs(F.Stack,{sx:{maxHeight:"100%",maxWidth:"min(100%, 800px)",padding:2,overflow:"auto",color:a.palette.error.main,"& pre":{whiteSpace:"pre-wrap",wordBreak:"break-word",paddingBottom:"3rem"}},children:[(e.loadingMessage?`Error while ${Ro.lowerFirst(F.capitalize(e.loadingMessage))} - `:"")+t,b.jsx("br",{}),r&&b.jsx("pre",{children:r})]})},DS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),zS=Y.forwardRef(DS),GS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:19,height:10,fill:"none",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0",clipRule:"evenodd"})),qS=Y.forwardRef(GS),JS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:10,height:19,fill:"none",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z",clipRule:"evenodd"})),HS=Y.forwardRef(JS),WS=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z",fill:"white"})),QS=Y.forwardRef(WS);function KS(){this.__data__=[],this.size=0}function rc(e,t){return e===t||e!==e&&t!==t}function vn(e,t){for(var r=e.length;r--;)if(rc(e[r][0],t))return r;return-1}var YS=Array.prototype,XS=YS.splice;function ZS(e){var t=this.__data__,r=vn(t,e);if(r<0)return!1;var a=t.length-1;return r==a?t.pop():XS.call(t,r,1),--this.size,!0}function e1(e){var t=this.__data__,r=vn(t,e);return r<0?void 0:t[r][1]}function t1(e){return vn(this.__data__,e)>-1}function r1(e,t){var r=this.__data__,a=vn(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}function St(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}St.prototype.clear=KS;St.prototype.delete=ZS;St.prototype.get=e1;St.prototype.has=t1;St.prototype.set=r1;function a1(){this.__data__=new St,this.size=0}function n1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function o1(e){return this.__data__.get(e)}function s1(e){return this.__data__.has(e)}var l1="[object AsyncFunction]",i1="[object Function]",c1="[object GeneratorFunction]",d1="[object Proxy]";function ac(e){if(!Ft(e))return!1;var t=qt(e);return t==i1||t==c1||t==l1||t==d1}var Yn=dt["__core-js_shared__"],il=function(){var e=/[^.]+$/.exec(Yn&&Yn.keys&&Yn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function u1(e){return!!il&&il in e}var p1=Function.prototype,h1=p1.toString;function Ht(e){if(e!=null){try{return h1.call(e)}catch{}try{return e+""}catch{}}return""}var m1=/[\\^$.*+?()[\]{}|]/g,f1=/^\[object .+?Constructor\]$/,y1=Function.prototype,g1=Object.prototype,b1=y1.toString,S1=g1.hasOwnProperty,v1=RegExp("^"+b1.call(S1).replace(m1,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function x1(e){if(!Ft(e)||u1(e))return!1;var t=ac(e)?v1:f1;return t.test(Ht(e))}function O1(e,t){return e==null?void 0:e[t]}function Wt(e,t){var r=O1(e,t);return x1(r)?r:void 0}var Xr=Wt(dt,"Map"),Zr=Wt(Object,"create");function w1(){this.__data__=Zr?Zr(null):{},this.size=0}function C1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var V1="__lodash_hash_undefined__",P1=Object.prototype,R1=P1.hasOwnProperty;function _1(e){var t=this.__data__;if(Zr){var r=t[e];return r===V1?void 0:r}return R1.call(t,e)?t[e]:void 0}var A1=Object.prototype,T1=A1.hasOwnProperty;function I1(e){var t=this.__data__;return Zr?t[e]!==void 0:T1.call(t,e)}var E1="__lodash_hash_undefined__";function M1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Zr&&t===void 0?E1:t,this}function zt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}zt.prototype.clear=w1;zt.prototype.delete=C1;zt.prototype.get=_1;zt.prototype.has=I1;zt.prototype.set=M1;function j1(){this.size=0,this.__data__={hash:new zt,map:new(Xr||St),string:new zt}}function $1(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function xn(e,t){var r=e.__data__;return $1(t)?r[typeof t=="string"?"string":"hash"]:r.map}function U1(e){var t=xn(this,e).delete(e);return this.size-=t?1:0,t}function k1(e){return xn(this,e).get(e)}function L1(e){return xn(this,e).has(e)}function B1(e,t){var r=xn(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}function vt(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}vt.prototype.clear=j1;vt.prototype.delete=U1;vt.prototype.get=k1;vt.prototype.has=L1;vt.prototype.set=B1;var F1=200;function N1(e,t){var r=this.__data__;if(r instanceof St){var a=r.__data__;if(!Xr||a.length<F1-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new vt(a)}return r.set(e,t),this.size=r.size,this}function yt(e){var t=this.__data__=new St(e);this.size=t.size}yt.prototype.clear=a1;yt.prototype.delete=n1;yt.prototype.get=o1;yt.prototype.has=s1;yt.prototype.set=N1;var D1="__lodash_hash_undefined__";function z1(e){return this.__data__.set(e,D1),this}function G1(e){return this.__data__.has(e)}function Ha(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new vt;++t<r;)this.add(e[t])}Ha.prototype.add=Ha.prototype.push=z1;Ha.prototype.has=G1;function q1(e,t){for(var r=-1,a=e==null?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}function J1(e,t){return e.has(t)}var H1=1,W1=2;function nc(e,t,r,a,n,o){var s=r&H1,l=e.length,i=t.length;if(l!=i&&!(s&&i>l))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var u=-1,p=!0,y=r&W1?new Ha:void 0;for(o.set(e,t),o.set(t,e);++u<l;){var g=e[u],m=t[u];if(a)var x=s?a(m,g,u,t,e,o):a(g,m,u,e,t,o);if(x!==void 0){if(x)continue;p=!1;break}if(y){if(!q1(t,function(I,G){if(!J1(y,G)&&(g===I||n(g,I,r,a,o)))return y.push(G)})){p=!1;break}}else if(!(g===m||n(g,m,r,a,o))){p=!1;break}}return o.delete(e),o.delete(t),p}var cl=dt.Uint8Array;function Q1(e){var t=-1,r=Array(e.size);return e.forEach(function(a,n){r[++t]=[n,a]}),r}function K1(e){var t=-1,r=Array(e.size);return e.forEach(function(a){r[++t]=a}),r}var Y1=1,X1=2,Z1="[object Boolean]",ev="[object Date]",tv="[object Error]",rv="[object Map]",av="[object Number]",nv="[object RegExp]",ov="[object Set]",sv="[object String]",lv="[object Symbol]",iv="[object ArrayBuffer]",cv="[object DataView]",dl=Tt?Tt.prototype:void 0,Xn=dl?dl.valueOf:void 0;function dv(e,t,r,a,n,o,s){switch(r){case cv:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case iv:return!(e.byteLength!=t.byteLength||!o(new cl(e),new cl(t)));case Z1:case ev:case av:return rc(+e,+t);case tv:return e.name==t.name&&e.message==t.message;case nv:case sv:return e==t+"";case rv:var l=Q1;case ov:var i=a&Y1;if(l||(l=K1),e.size!=t.size&&!i)return!1;var c=s.get(e);if(c)return c==t;a|=X1,s.set(e,t);var d=nc(l(e),l(t),a,n,o,s);return s.delete(e),d;case lv:if(Xn)return Xn.call(e)==Xn.call(t)}return!1}function uv(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var ct=Array.isArray;function pv(e,t,r){var a=t(e);return ct(e)?a:uv(a,r(e))}function hv(e,t){for(var r=-1,a=e==null?0:e.length,n=0,o=[];++r<a;){var s=e[r];t(s,r,e)&&(o[n++]=s)}return o}function mv(){return[]}var fv=Object.prototype,yv=fv.propertyIsEnumerable,ul=Object.getOwnPropertySymbols,gv=ul?function(e){return e==null?[]:(e=Object(e),hv(ul(e),function(t){return yv.call(e,t)}))}:mv;function bv(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var Sv="[object Arguments]";function pl(e){return Nt(e)&&qt(e)==Sv}var oc=Object.prototype,vv=oc.hasOwnProperty,xv=oc.propertyIsEnumerable,sc=pl(function(){return arguments}())?pl:function(e){return Nt(e)&&vv.call(e,"callee")&&!xv.call(e,"callee")};function Ov(){return!1}var lc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,hl=lc&&typeof module=="object"&&module&&!module.nodeType&&module,wv=hl&&hl.exports===lc,ml=wv?dt.Buffer:void 0,Cv=ml?ml.isBuffer:void 0,xo=Cv||Ov,Vv=9007199254740991,Pv=/^(?:0|[1-9]\d*)$/;function ic(e,t){var r=typeof e;return t=t??Vv,!!t&&(r=="number"||r!="symbol"&&Pv.test(e))&&e>-1&&e%1==0&&e<t}var Rv=9007199254740991;function Bo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Rv}var _v="[object Arguments]",Av="[object Array]",Tv="[object Boolean]",Iv="[object Date]",Ev="[object Error]",Mv="[object Function]",jv="[object Map]",$v="[object Number]",Uv="[object Object]",kv="[object RegExp]",Lv="[object Set]",Bv="[object String]",Fv="[object WeakMap]",Nv="[object ArrayBuffer]",Dv="[object DataView]",zv="[object Float32Array]",Gv="[object Float64Array]",qv="[object Int8Array]",Jv="[object Int16Array]",Hv="[object Int32Array]",Wv="[object Uint8Array]",Qv="[object Uint8ClampedArray]",Kv="[object Uint16Array]",Yv="[object Uint32Array]",he={};he[zv]=he[Gv]=he[qv]=he[Jv]=he[Hv]=he[Wv]=he[Qv]=he[Kv]=he[Yv]=!0;he[_v]=he[Av]=he[Nv]=he[Tv]=he[Dv]=he[Iv]=he[Ev]=he[Mv]=he[jv]=he[$v]=he[Uv]=he[kv]=he[Lv]=he[Bv]=he[Fv]=!1;function Xv(e){return Nt(e)&&Bo(e.length)&&!!he[qt(e)]}function Zv(e){return function(t){return e(t)}}var cc=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gr=cc&&typeof module=="object"&&module&&!module.nodeType&&module,ex=Gr&&Gr.exports===cc,Zn=ex&&ii.process,fl=function(){try{var e=Gr&&Gr.require&&Gr.require("util").types;return e||Zn&&Zn.binding&&Zn.binding("util")}catch{}}(),yl=fl&&fl.isTypedArray,dc=yl?Zv(yl):Xv,tx=Object.prototype,rx=tx.hasOwnProperty;function ax(e,t){var r=ct(e),a=!r&&sc(e),n=!r&&!a&&xo(e),o=!r&&!a&&!n&&dc(e),s=r||a||n||o,l=s?bv(e.length,String):[],i=l.length;for(var c in e)rx.call(e,c)&&!(s&&(c=="length"||n&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ic(c,i)))&&l.push(c);return l}var nx=Object.prototype;function ox(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||nx;return e===r}function sx(e,t){return function(r){return e(t(r))}}var lx=sx(Object.keys,Object),ix=Object.prototype,cx=ix.hasOwnProperty;function dx(e){if(!ox(e))return lx(e);var t=[];for(var r in Object(e))cx.call(e,r)&&r!="constructor"&&t.push(r);return t}function uc(e){return e!=null&&Bo(e.length)&&!ac(e)}function Fo(e){return uc(e)?ax(e):dx(e)}function gl(e){return pv(e,Fo,gv)}var ux=1,px=Object.prototype,hx=px.hasOwnProperty;function mx(e,t,r,a,n,o){var s=r&ux,l=gl(e),i=l.length,c=gl(t),d=c.length;if(i!=d&&!s)return!1;for(var u=i;u--;){var p=l[u];if(!(s?p in t:hx.call(t,p)))return!1}var y=o.get(e),g=o.get(t);if(y&&g)return y==t&&g==e;var m=!0;o.set(e,t),o.set(t,e);for(var x=s;++u<i;){p=l[u];var I=e[p],G=t[p];if(a)var N=s?a(G,I,p,t,e,o):a(I,G,p,e,t,o);if(!(N===void 0?I===G||n(I,G,r,a,o):N)){m=!1;break}x||(x=p=="constructor")}if(m&&!x){var D=e.constructor,z=t.constructor;D!=z&&"constructor"in e&&"constructor"in t&&!(typeof D=="function"&&D instanceof D&&typeof z=="function"&&z instanceof z)&&(m=!1)}return o.delete(e),o.delete(t),m}var Oo=Wt(dt,"DataView"),wo=Wt(dt,"Promise"),Co=Wt(dt,"Set"),Vo=Wt(dt,"WeakMap"),bl="[object Map]",fx="[object Object]",Sl="[object Promise]",vl="[object Set]",xl="[object WeakMap]",Ol="[object DataView]",yx=Ht(Oo),gx=Ht(Xr),bx=Ht(wo),Sx=Ht(Co),vx=Ht(Vo),Vt=qt;(Oo&&Vt(new Oo(new ArrayBuffer(1)))!=Ol||Xr&&Vt(new Xr)!=bl||wo&&Vt(wo.resolve())!=Sl||Co&&Vt(new Co)!=vl||Vo&&Vt(new Vo)!=xl)&&(Vt=function(e){var t=qt(e),r=t==fx?e.constructor:void 0,a=r?Ht(r):"";if(a)switch(a){case yx:return Ol;case gx:return bl;case bx:return Sl;case Sx:return vl;case vx:return xl}return t});var xx=1,wl="[object Arguments]",Cl="[object Array]",Ca="[object Object]",Ox=Object.prototype,Vl=Ox.hasOwnProperty;function wx(e,t,r,a,n,o){var s=ct(e),l=ct(t),i=s?Cl:Vt(e),c=l?Cl:Vt(t);i=i==wl?Ca:i,c=c==wl?Ca:c;var d=i==Ca,u=c==Ca,p=i==c;if(p&&xo(e)){if(!xo(t))return!1;s=!0,d=!1}if(p&&!d)return o||(o=new yt),s||dc(e)?nc(e,t,r,a,n,o):dv(e,t,i,r,a,n,o);if(!(r&xx)){var y=d&&Vl.call(e,"__wrapped__"),g=u&&Vl.call(t,"__wrapped__");if(y||g){var m=y?e.value():e,x=g?t.value():t;return o||(o=new yt),n(m,x,r,a,o)}}return p?(o||(o=new yt),mx(e,t,r,a,n,o)):!1}function On(e,t,r,a,n){return e===t?!0:e==null||t==null||!Nt(e)&&!Nt(t)?e!==e&&t!==t:wx(e,t,r,a,On,n)}function Cx(e,t){return On(e,t)}const pc=({store:e})=>{const{t}=we.useTranslation(),[r,a]=Y.useState(e.jogger.motionStream.rapidlyChangingMotionState.state.joint_limit_reached.limit_reached),n=Y.useRef(r);gr(()=>{const s=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_limit_reached.limit_reached;Cx(n.current,s)||(n.current=s,a(s))});const o=[];for(const[s,l]of r.entries())l&&o.push(s);return b.jsx(F.Typography,{color:"error",sx:{margin:"0.5rem 1rem",textAlign:"center",minHeight:"1.5rem",visibility:o.length?"visible":"hidden"},children:t("Jogging.JointLimitsReached.lb",{jointNumbers:o.map(s=>s+1).join(", ")})})},Vx=F.styled(F.FormControl)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function Va({labelValue:e,...t}){return b.jsxs(Vx,{fullWidth:!0,variant:"filled",children:[b.jsx(F.InputLabel,{id:t.labelId,children:e}),b.jsx(F.Select,{...t})]})}var Pl=function(){try{var e=Wt(Object,"defineProperty");return e({},"",{}),e}catch{}}();function Px(e,t,r){t=="__proto__"&&Pl?Pl(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function Rx(e,t,r,a){for(var n=-1,o=e==null?0:e.length;++n<o;){var s=e[n];t(a,s,r(s),e)}return a}function _x(e){return function(t,r,a){for(var n=-1,o=Object(t),s=a(t),l=s.length;l--;){var i=s[++n];if(r(o[i],i,o)===!1)break}return t}}var Ax=_x();function Tx(e,t){return e&&Ax(e,t,Fo)}function Ix(e,t){return function(r,a){if(r==null)return r;if(!uc(r))return e(r,a);for(var n=r.length,o=-1,s=Object(r);++o<n&&a(s[o],o,s)!==!1;);return r}}var Ex=Ix(Tx);function Mx(e,t,r,a){return Ex(e,function(n,o,s){t(a,n,r(n),s)}),a}var jx=1,$x=2;function Ux(e,t,r,a){var n=r.length,o=n;if(e==null)return!o;for(e=Object(e);n--;){var s=r[n];if(s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++n<o;){s=r[n];var l=s[0],i=e[l],c=s[1];if(s[2]){if(i===void 0&&!(l in e))return!1}else{var d=new yt,u;if(!(u===void 0?On(c,i,jx|$x,a,d):u))return!1}}return!0}function hc(e){return e===e&&!Ft(e)}function kx(e){for(var t=Fo(e),r=t.length;r--;){var a=t[r],n=e[a];t[r]=[a,n,hc(n)]}return t}function mc(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function Lx(e){var t=kx(e);return t.length==1&&t[0][2]?mc(t[0][0],t[0][1]):function(r){return r===e||Ux(r,e,t)}}var Bx=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fx=/^\w*$/;function No(e,t){if(ct(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dn(e)?!0:Fx.test(e)||!Bx.test(e)||t!=null&&e in Object(t)}var Nx="Expected a function";function Do(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Nx);var r=function(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var s=e.apply(this,a);return r.cache=o.set(n,s)||o,s};return r.cache=new(Do.Cache||vt),r}Do.Cache=vt;var Dx=500;function zx(e){var t=Do(e,function(a){return r.size===Dx&&r.clear(),a}),r=t.cache;return t}var Gx=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,qx=/\\(\\)?/g,Jx=zx(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Gx,function(r,a,n,o){t.push(n?o.replace(qx,"$1"):a||r)}),t});function Hx(e,t){for(var r=-1,a=e==null?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var Rl=Tt?Tt.prototype:void 0,_l=Rl?Rl.toString:void 0;function fc(e){if(typeof e=="string")return e;if(ct(e))return Hx(e,fc)+"";if(dn(e))return _l?_l.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function yc(e){return e==null?"":fc(e)}function gc(e,t){return ct(e)?e:No(e,t)?[e]:Jx(yc(e))}function wn(e){if(typeof e=="string"||dn(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bc(e,t){t=gc(t,e);for(var r=0,a=t.length;e!=null&&r<a;)e=e[wn(t[r++])];return r&&r==a?e:void 0}function Wx(e,t,r){var a=e==null?void 0:bc(e,t);return a===void 0?r:a}function Qx(e,t){return e!=null&&t in Object(e)}function Kx(e,t,r){t=gc(t,e);for(var a=-1,n=t.length,o=!1;++a<n;){var s=wn(t[a]);if(!(o=e!=null&&r(e,s)))break;e=e[s]}return o||++a!=n?o:(n=e==null?0:e.length,!!n&&Bo(n)&&ic(s,n)&&(ct(e)||sc(e)))}function Yx(e,t){return e!=null&&Kx(e,t,Qx)}var Xx=1,Zx=2;function eO(e,t){return No(e)&&hc(t)?mc(wn(e),t):function(r){var a=Wx(r,e);return a===void 0&&a===t?Yx(r,e):On(t,a,Xx|Zx)}}function tO(e){return e}function rO(e){return function(t){return t==null?void 0:t[e]}}function aO(e){return function(t){return bc(t,e)}}function nO(e){return No(e)?rO(wn(e)):aO(e)}function oO(e){return typeof e=="function"?e:e==null?tO:typeof e=="object"?ct(e)?eO(e[0],e[1]):Lx(e):nO(e)}function sO(e,t){return function(r,a){var n=ct(r)?Rx:Mx,o={};return n(r,e,oO(a),o)}}var Pa=sO(function(e,t,r){Px(e,r,t)}),lO=0;function iO(e){var t=++lO;return yc(e)+t}const Po=[{id:"0.1",mm:.1,degrees:.05},{id:"1",mm:1,degrees:.5},{id:"5",mm:5,degrees:2.5},{id:"10",mm:10,degrees:5}],cO=[{id:"continuous"},...Po],dO=["coordsys","tool"];class Cn{constructor(t,r,a,n){var o,s;this.jogger=t,this.motionGroupSpec=r,this.coordSystems=a,this.tcps=n,this.selectedTabId="cartesian",this.activationState="inactive",this.activationError=null,this.activationCounter=0,this.locks=new Set,this.selectedCoordSystemId="world",this.selectedTcpId="",this.selectedOrientation="coordsys",this.selectedIncrementId="continuous",this.selectedCartesianMotionType="translate",this.incrementJogInProgress=null,this.translationVelocityMmPerSec=10,this.rotationVelocityDegPerSec=1,this.minTranslationVelocityMmPerSec=5,this.maxTranslationVelocityMmPerSec=250,this.minRotationVelocityDegPerSec=1,this.maxRotationVelocityDegPerSec=60,this.showCoordSystemSelect=!0,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[];for(const l of a)if(l.coordinate_system===""){l.coordinate_system="world";break}this.selectedCoordSystemId=((o=a[0])==null?void 0:o.coordinate_system)||"world",this.selectedTcpId=((s=n[0])==null?void 0:s.id)||"",Ae.makeAutoObservable(this,{},{autoBind:!0}),this.loadFromLocalStorage(),this.disposers.push(Ae.autorun(()=>this.saveToLocalStorage())),window.joggingStore=this}static async loadFor(t){const{nova:r}=t,[a,{coordinatesystems:n},{tcps:o}]=await Promise.all([r.api.motionGroupInfos.getMotionGroupSpecification(t.motionGroupId),r.api.coordinateSystems.listCoordinateSystems("ROTATION_VECTOR"),r.api.motionGroupInfos.listTcps(t.motionGroupId,"ROTATION_VECTOR")]);return new Cn(t,a,n||[],o||[])}dispose(){for(const t of this.disposers)t();this.jogger.dispose()}get coordSystemCountByName(){return Ro.countBy(this.coordSystems,t=>t.name)}async deactivate(){const t=this.jogger.activeWebsocket;this.jogger.setJoggingMode("increment"),t&&await t.closed()}async activate(){if(this.currentTab.id==="cartesian"){const t={tcpId:this.selectedTcpId,coordSystemId:this.activeCoordSystemId};this.activeDiscreteIncrement?this.jogger.setJoggingMode("increment",t):this.jogger.setJoggingMode("cartesian",t)}else this.jogger.setJoggingMode("joint");return this.jogger}loadFromLocalStorage(){const t=kt.tryParseJson(localStorage.getItem("joggingToolStore"));t&&(this.tabsById[t.selectedTabId]&&(this.selectedTabId=t.selectedTabId),this.coordSystemsById[t.selectedCoordSystemId]&&(this.selectedCoordSystemId=t.selectedCoordSystemId),this.tcpsById[t.selectedTcpId]&&(this.selectedTcpId=t.selectedTcpId),this.incrementOptionsById[t.selectedIncrementId]&&(this.selectedIncrementId=t.selectedIncrementId),["translate","rotate"].includes(t.selectedCartesianMotionType)&&(this.selectedCartesianMotionType=t.selectedCartesianMotionType),["coordsys","tool"].includes(t.selectedOrientation)&&(this.selectedOrientation=t.selectedOrientation))}saveToLocalStorage(){localStorage.setItem("joggingToolStore",JSON.stringify(this.localStorageSave))}get isLocked(){return this.locks.size>0}get localStorageSave(){return{selectedTabId:this.selectedTabId,selectedCoordSystemId:this.selectedCoordSystemId,selectedTcpId:this.selectedTcpId,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){return[{id:"cartesian",label:"cartesian"},{id:"joint",label:"joint"}]}get incrementOptions(){return cO}get discreteIncrementOptions(){return Po}get incrementOptionsById(){return Pa(this.incrementOptions,t=>t.id)}get tabsById(){return Pa(this.tabs,t=>t.id)}get currentTab(){return this.tabsById[this.selectedTabId]||this.tabs[0]}get tabIndex(){return this.tabs.indexOf(this.currentTab)}get coordSystemsById(){return Pa(this.coordSystems,t=>t.coordinate_system)}get selectedCoordSystem(){return this.coordSystemsById[this.selectedCoordSystemId]}get activeCoordSystemId(){return this.selectedOrientation==="tool"?"tool":this.selectedCoordSystemId}get tcpsById(){return Pa(this.tcps,t=>t.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:Po.find(t=>t.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}get velocityInDisplayUnits(){return this.currentMotionType==="translate"?this.translationVelocityMmPerSec:this.rotationVelocityDegPerSec}get minVelocityInDisplayUnits(){return this.currentMotionType==="translate"?this.minTranslationVelocityMmPerSec:this.minRotationVelocityDegPerSec}get maxVelocityInDisplayUnits(){return this.currentMotionType==="translate"?this.maxTranslationVelocityMmPerSec:this.maxRotationVelocityDegPerSec}get currentMotionType(){return this.selectedTabId==="cartesian"&&this.selectedCartesianMotionType==="translate"?"translate":"rotate"}onTabChange(t,r){const a=this.tabs[r]||this.tabs[0];this.selectedTabId=a.id}setSelectedCoordSystemId(t){this.selectedCoordSystemId=t}setSelectedTcpId(t){this.selectedTcpId=t}setSelectedOrientation(t){this.selectedOrientation=t}setSelectedIncrementId(t){this.selectedIncrementId=t}setCurrentIncrementJog(t){this.incrementJogInProgress=t}setVelocityFromSlider(t){this.currentMotionType==="translate"?this.translationVelocityMmPerSec=t:this.rotationVelocityDegPerSec=t}setSelectedCartesianMotionType(t){this.selectedCartesianMotionType=t}lock(t){this.locks.add(t)}unlock(t){this.locks.delete(t)}async withMotionLock(t){const r=iO();this.lock(r);try{return await t()}finally{this.unlock(r)}}}const uO=Re.observer(({store:e})=>{var n;const{t}=we.useTranslation(),r=[];function a(o){switch(o){case"coordsys":return t("Jogging.Orientation.coordsys");case"tool":return t("Jogging.Orientation.tool");default:return o}}return e.showCoordSystemSelect&&r.push(b.jsx(Va,{labelId:"jogging-coord-select",labelValue:t("Jogging.CoordinateSystem.hlb"),value:e.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:o=>e.setSelectedCoordSystemId(o.target.value),disabled:e.isLocked,children:e.coordSystems.map(o=>b.jsx(F.MenuItem,{value:o.coordinate_system,children:o.name&&e.coordSystemCountByName[o.name]>1?`${o.name} / ${o.coordinate_system}`:o.name||o.coordinate_system},o.coordinate_system))},"coord")),e.showTcpSelect&&r.push(b.jsx(Va,{labelId:"jogging-tcp-select",labelValue:"TCP",value:e.selectedTcpId,size:"small",variant:"filled",onChange:o=>e.setSelectedTcpId(o.target.value),disabled:e.isLocked,children:e.tcps.map(o=>b.jsx(F.MenuItem,{value:o.id,children:o.id},o.id))},"tcp")),e.showOrientationSelect&&r.push(b.jsx(Va,{labelValue:t("Jogging.Cartesian.Orientation.lb"),id:"orientation-select",labelId:"orientation-select",value:e.selectedOrientation,onChange:o=>e.setSelectedOrientation(o.target.value),disabled:e.isLocked,children:dO.map(o=>b.jsx(F.MenuItem,{value:o,children:a(o)},o))},"orientation")),e.showIncrementSelect&&r.push(b.jsxs(Va,{labelValue:t("Jogging.Increment.hlb"),labelId:"jogging-increment-select",size:"small",variant:"filled",value:((n=e.activeDiscreteIncrement)==null?void 0:n.id)||"continuous",onChange:o=>e.setSelectedIncrementId(o.target.value),disabled:e.isLocked,children:[b.jsx(F.MenuItem,{value:"continuous",children:t("Jogging.Increment.Continuous.dd")},"continuous"),e.selectedOrientation==="tool"?null:e.discreteIncrementOptions.map(o=>b.jsx(F.MenuItem,{value:o.id,children:e.currentMotionType==="translate"?`${o.mm}mm`:`${o.degrees}°`},o.id))]},"increment")),b.jsx(F.Box,{component:"div",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:r.map((o,s)=>b.jsx(F.Box,{sx:{gridColumn:r.length%2===1&&s===r.length-1?"span 2":"auto"},children:o},s))})}),pO=F.styled(F.ToggleButtonGroup)(({theme:e})=>{var t;return{"&.MuiToggleButtonGroup-root":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[8],borderRadius:"8px",padding:"4px",gap:"4px",button:{border:"none",borderRadius:"4px",flex:"1 1 0px",minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:"8px 4px 4px 8px"},"&.MuiToggleButtonGroup-lastButton":{borderRadius:"4px 8px 8px 4px"}}}}});function Al(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...a){return e(...a)||t(...a)}}function hO(e){return typeof e=="string"}function mO(e,t,r){return e===void 0||hO(e)?t:{...t,ownerState:{...t.ownerState,...r}}}function Ua(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(a=>a.match(/^on[A-Z]/)&&typeof e[a]=="function"&&!t.includes(a)).forEach(a=>{r[a]=e[a]}),r}function Tl(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function fO(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:a,externalForwardedProps:n,className:o}=e;if(!t){const y=ft(r==null?void 0:r.className,o,n==null?void 0:n.className,a==null?void 0:a.className),g={...r==null?void 0:r.style,...n==null?void 0:n.style,...a==null?void 0:a.style},m={...r,...n,...a};return y.length>0&&(m.className=y),Object.keys(g).length>0&&(m.style=g),{props:m,internalRef:void 0}}const s=Ua({...n,...a}),l=Tl(a),i=Tl(n),c=t(s),d=ft(c==null?void 0:c.className,r==null?void 0:r.className,o,n==null?void 0:n.className,a==null?void 0:a.className),u={...c==null?void 0:c.style,...r==null?void 0:r.style,...n==null?void 0:n.style,...a==null?void 0:a.style},p={...c,...r,...i,...l};return d.length>0&&(p.className=d),Object.keys(u).length>0&&(p.style=u),{props:p,internalRef:c.ref}}function yO(e,t,r){return typeof e=="function"?e(t,r):e}function Ct(e){var u;const{elementType:t,externalSlotProps:r,ownerState:a,skipResolvingSlotProps:n=!1,...o}=e,s=n?{}:yO(r,a),{props:l,internalRef:i}=fO({...o,externalSlotProps:s}),c=li(i,s==null?void 0:s.ref,(u=e.additionalProps)==null?void 0:u.ref);return mO(t,{...l,ref:c},a)}function Il(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!/jsdom/.test(window.navigator.userAgent)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
|
|
106
|
-
`))}return!1}const gO={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function bO(e,t,r=(a,n)=>a===n){return e.length===t.length&&e.every((a,n)=>r(a,t[n]))}const SO=2;function lr(e,t,r,a,n){return r===1?Math.min(e+t,n):Math.max(e-t,a)}function Sc(e,t){return e-t}function El(e,t){const{index:r}=e.reduce((a,n,o)=>{const s=Math.abs(t-n);return a===null||s<a.distance||s===a.distance?{distance:s,index:o}:a},null)??{};return r}function Ra(e,t){if(t.current!==void 0&&e.changedTouches){const r=e;for(let a=0;a<r.changedTouches.length;a+=1){const n=r.changedTouches[a];if(n.identifier===t.current)return{x:n.clientX,y:n.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Wa(e,t,r){return(e-t)*100/(r-t)}function vO(e,t,r){return(r-t)*e+t}function xO(e){if(Math.abs(e)<1){const r=e.toExponential().split("e-"),a=r[0].split(".")[1];return(a?a.length:0)+parseInt(r[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function OO(e,t,r){const a=Math.round((e-r)/t)*t+r;return Number(a.toFixed(xO(t)))}function Ml({values:e,newValue:t,index:r}){const a=e.slice();return a[r]=t,a.sort(Sc)}function _a({sliderRef:e,activeIndex:t,setActive:r}){var n,o,s;const a=Ea(e.current);(!((n=e.current)!=null&&n.contains(a.activeElement))||Number((o=a==null?void 0:a.activeElement)==null?void 0:o.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),r&&r(t)}function Aa(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?bO(e,t):!1}const wO={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},CO=e=>e;let Ta;function jl(){return Ta===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ta=CSS.supports("touch-action","none"):Ta=!0),Ta}function VO(e){const{"aria-labelledby":t,defaultValue:r,disabled:a=!1,disableSwap:n=!1,isRtl:o=!1,marks:s=!1,max:l=100,min:i=0,name:c,onChange:d,onChangeCommitted:u,orientation:p="horizontal",rootRef:y,scale:g=CO,step:m=1,shiftStep:x=10,tabIndex:I,value:G}=e,N=L.useRef(void 0),[D,z]=L.useState(-1),[W,j]=L.useState(-1),[U,k]=L.useState(!1),f=L.useRef(0),M=L.useRef(null),[B,J]=zp({controlled:G,default:r??i,name:"Slider"}),H=d&&((q,Q,Z)=>{const oe=q.nativeEvent||q,ce=new oe.constructor(oe.type,oe);Object.defineProperty(ce,"target",{writable:!0,value:{value:Q,name:c}}),M.current=Q,d(ce,Q,Z)}),ne=Array.isArray(B);let te=ne?B.slice().sort(Sc):[B];te=te.map(q=>q==null?i:ir(q,i,l));const xe=s===!0&&m!==null?[...Array(Math.floor((l-i)/m)+1)].map((q,Q)=>({value:i+m*Q})):s||[],X=xe.map(q=>q.value),[be,$]=L.useState(-1),K=L.useRef(null),se=li(y,K),Ve=q=>Q=>{var oe;const Z=Number(Q.currentTarget.getAttribute("data-index"));Il(Q.target)&&$(Z),j(Z),(oe=q==null?void 0:q.onFocus)==null||oe.call(q,Q)},Je=q=>Q=>{var Z;Il(Q.target)||$(-1),j(-1),(Z=q==null?void 0:q.onBlur)==null||Z.call(q,Q)},je=(q,Q)=>{const Z=Number(q.currentTarget.getAttribute("data-index")),oe=te[Z],ce=X.indexOf(oe);let ee=Q;if(xe&&m==null){const Te=X[X.length-1];ee>=Te?ee=Te:ee<=X[0]?ee=X[0]:ee=ee<oe?X[ce-1]:X[ce+1]}if(ee=ir(ee,i,l),ne){n&&(ee=ir(ee,te[Z-1]||-1/0,te[Z+1]||1/0));const Te=ee;ee=Ml({values:te,newValue:ee,index:Z});let ke=Z;n||(ke=ee.indexOf(Te)),_a({sliderRef:K,activeIndex:ke})}J(ee),$(Z),H&&!Aa(ee,B)&&H(q,ee,Z),u&&u(q,M.current??ee)},Et=q=>Q=>{var Z;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(Q.key)){Q.preventDefault();const oe=Number(Q.currentTarget.getAttribute("data-index")),ce=te[oe];let ee=null;if(m!=null){const Te=Q.shiftKey?x:m;switch(Q.key){case"ArrowUp":ee=lr(ce,Te,1,i,l);break;case"ArrowRight":ee=lr(ce,Te,o?-1:1,i,l);break;case"ArrowDown":ee=lr(ce,Te,-1,i,l);break;case"ArrowLeft":ee=lr(ce,Te,o?1:-1,i,l);break;case"PageUp":ee=lr(ce,x,1,i,l);break;case"PageDown":ee=lr(ce,x,-1,i,l);break;case"Home":ee=i;break;case"End":ee=l;break}}else if(xe){const Te=X[X.length-1],ke=X.indexOf(ce),_e=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],He=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];_e.includes(Q.key)?ke===0?ee=X[0]:ee=X[ke-1]:He.includes(Q.key)&&(ke===X.length-1?ee=Te:ee=X[ke+1])}ee!=null&&je(Q,ee)}(Z=q==null?void 0:q.onKeyDown)==null||Z.call(q,Q)};Yl(()=>{var q;a&&K.current.contains(document.activeElement)&&((q=document.activeElement)==null||q.blur())},[a]),a&&D!==-1&&z(-1),a&&be!==-1&&$(-1);const xt=q=>Q=>{var Z;(Z=q.onChange)==null||Z.call(q,Q),je(Q,Q.target.valueAsNumber)},ye=L.useRef(void 0);let Fe=p;o&&p==="horizontal"&&(Fe+="-reverse");const Ye=({finger:q,move:Q=!1})=>{const{current:Z}=K,{width:oe,height:ce,bottom:ee,left:Te}=Z.getBoundingClientRect();let ke;Fe.startsWith("vertical")?ke=(ee-q.y)/ce:ke=(q.x-Te)/oe,Fe.includes("-reverse")&&(ke=1-ke);let _e;if(_e=vO(ke,i,l),m)_e=OO(_e,m,i);else{const Pr=El(X,_e);_e=X[Pr]}_e=ir(_e,i,l);let He=0;if(ne){Q?He=ye.current:He=El(te,_e),n&&(_e=ir(_e,te[He-1]||-1/0,te[He+1]||1/0));const Pr=_e;_e=Ml({values:te,newValue:_e,index:He}),n&&Q||(He=_e.indexOf(Pr),ye.current=He)}return{newValue:_e,activeIndex:He}},ut=kn(q=>{const Q=Ra(q,N);if(!Q)return;if(f.current+=1,q.type==="mousemove"&&q.buttons===0){at(q);return}const{newValue:Z,activeIndex:oe}=Ye({finger:Q,move:!0});_a({sliderRef:K,activeIndex:oe,setActive:z}),J(Z),!U&&f.current>SO&&k(!0),H&&!Aa(Z,B)&&H(q,Z,oe)}),at=kn(q=>{const Q=Ra(q,N);if(k(!1),!Q)return;const{newValue:Z}=Ye({finger:Q,move:!0});z(-1),q.type==="touchend"&&j(-1),u&&u(q,M.current??Z),N.current=void 0,Mt()}),$e=kn(q=>{if(a)return;jl()||q.preventDefault();const Q=q.changedTouches[0];Q!=null&&(N.current=Q.identifier);const Z=Ra(q,N);if(Z!==!1){const{newValue:ce,activeIndex:ee}=Ye({finger:Z});_a({sliderRef:K,activeIndex:ee,setActive:z}),J(ce),H&&!Aa(ce,B)&&H(q,ce,ee)}f.current=0;const oe=Ea(K.current);oe.addEventListener("touchmove",ut,{passive:!0}),oe.addEventListener("touchend",at,{passive:!0})}),Mt=L.useCallback(()=>{const q=Ea(K.current);q.removeEventListener("mousemove",ut),q.removeEventListener("mouseup",at),q.removeEventListener("touchmove",ut),q.removeEventListener("touchend",at)},[at,ut]);L.useEffect(()=>{const{current:q}=K;return q.addEventListener("touchstart",$e,{passive:jl()}),()=>{q.removeEventListener("touchstart",$e),Mt()}},[Mt,$e]),L.useEffect(()=>{a&&Mt()},[a,Mt]);const Vn=q=>Q=>{var ce;if((ce=q.onMouseDown)==null||ce.call(q,Q),a||Q.defaultPrevented||Q.button!==0)return;Q.preventDefault();const Z=Ra(Q,N);if(Z!==!1){const{newValue:ee,activeIndex:Te}=Ye({finger:Z});_a({sliderRef:K,activeIndex:Te,setActive:z}),J(ee),H&&!Aa(ee,B)&&H(Q,ee,Te)}f.current=0;const oe=Ea(K.current);oe.addEventListener("mousemove",ut,{passive:!0}),oe.addEventListener("mouseup",at)},sa=Wa(ne?te[0]:i,i,l),Ue=Wa(te[te.length-1],i,l)-sa,Vr=(q={})=>{const Q=Ua(q),Z={onMouseDown:Vn(Q||{})},oe={...Q,...Z};return{...q,ref:se,...oe}},la=q=>Q=>{var oe;(oe=q.onMouseOver)==null||oe.call(q,Q);const Z=Number(Q.currentTarget.getAttribute("data-index"));j(Z)},ia=q=>Q=>{var Z;(Z=q.onMouseLeave)==null||Z.call(q,Q),j(-1)},ca=(q={})=>{const Q=Ua(q),Z={onMouseOver:la(Q||{}),onMouseLeave:ia(Q||{})};return{...q,...Q,...Z}},da=q=>({pointerEvents:D!==-1&&D!==q?"none":void 0});let Qt;return p==="vertical"&&(Qt=o?"vertical-rl":"vertical-lr"),{active:D,axis:Fe,axisProps:wO,dragging:U,focusedThumbIndex:be,getHiddenInputProps:(q={})=>{const Q=Ua(q),Z={onChange:xt(Q||{}),onFocus:Ve(Q||{}),onBlur:Je(Q||{}),onKeyDown:Et(Q||{})},oe={...Q,...Z};return{tabIndex:I,"aria-labelledby":t,"aria-orientation":p,"aria-valuemax":g(l),"aria-valuemin":g(i),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:a,...q,...oe,style:{...gO,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:Qt}}},getRootProps:Vr,getThumbProps:ca,marks:xe,open:W,range:ne,rootRef:se,trackLeap:Ue,trackOffset:sa,values:te,getThumbStyle:da}}function ka(e){return typeof e=="string"}const PO=e=>!e||!ka(e);function RO(e){return typeof e.main=="string"}function _O(e,t=[]){if(!RO(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function zo(e=[]){return([,t])=>t&&_O(t,e)}function AO(e){return ra("MuiSlider",e)}const Qe=ql("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),TO=e=>{const{open:t}=e;return{offset:ft(t&&Qe.valueLabelOpen),circle:Qe.valueLabelCircle,label:Qe.valueLabelLabel}};function vc(e){const{children:t,className:r,value:a}=e,n=TO(e);return t?L.cloneElement(t,{className:t.props.className},b.jsxs(L.Fragment,{children:[t.props.children,b.jsx("span",{className:ft(n.offset,r),"aria-hidden":!0,children:b.jsx("span",{className:n.circle,children:b.jsx("span",{className:n.label,children:a})})})]})):null}process.env.NODE_ENV!=="production"&&(vc.propTypes={children:S.element.isRequired,className:S.string,value:S.node});function $l(e){return e}const IO=gt("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Le(r.color)}`],r.size!=="medium"&&t[`size${Le(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(Gt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Qe.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Qe.dragging}`]:{[`& .${Qe.thumb}, & .${Qe.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(zo()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),EO=gt("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),MO=gt("span",{name:"MuiSlider",slot:"Track"})(Gt(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(zo()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:Jr(e.palette[t].main,.62),borderColor:Jr(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:qr(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:qr(e.palette[t].main,.5)})}}}))]}))),jO=gt("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Le(r.color)}`],r.size!=="medium"&&t[`thumbSize${Le(r.size)}`]]}})(Gt(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Qe.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(zo()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Qe.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${ro(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${Qe.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${ro(e.palette[t].main,.16)}`}}}}))]}))),xc=gt(vc,{name:"MuiSlider",slot:"ValueLabel"})(Gt(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Qe.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Qe.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})));process.env.NODE_ENV!=="production"&&(xc.propTypes={children:S.element.isRequired,index:S.number.isRequired,open:S.bool.isRequired,value:S.node});const $O=gt("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Eo(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(Gt(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),UO=gt("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Eo(e)&&e!=="markLabelActive"})(Gt(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),kO=e=>{const{disabled:t,dragging:r,marked:a,orientation:n,track:o,classes:s,color:l,size:i}=e,c={root:["root",t&&"disabled",r&&"dragging",a&&"marked",n==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",l&&`color${Le(l)}`,i&&`size${Le(i)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",i&&`thumbSize${Le(i)}`,l&&`thumbColor${Le(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return To(c,AO,s)},LO=({children:e})=>e,Oc=L.forwardRef(function(t,r){const a=Mo({props:t,name:"MuiSlider"}),n=$u(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":l,component:i="span",components:c={},componentsProps:d={},color:u="primary",classes:p,className:y,disableSwap:g=!1,disabled:m=!1,getAriaLabel:x,getAriaValueText:I,marks:G=!1,max:N=100,min:D=0,name:z,onChange:W,onChangeCommitted:j,orientation:U="horizontal",shiftStep:k=10,size:f="medium",step:M=1,scale:B=$l,slotProps:J,slots:H,tabIndex:ne,track:te="normal",value:xe,valueLabelDisplay:X="off",valueLabelFormat:be=$l,...$}=a,K={...a,isRtl:n,max:N,min:D,classes:p,disabled:m,disableSwap:g,orientation:U,marks:G,color:u,size:f,step:M,shiftStep:k,scale:B,track:te,valueLabelDisplay:X,valueLabelFormat:be},{axisProps:se,getRootProps:Ve,getHiddenInputProps:Je,getThumbProps:je,open:Et,active:xt,axis:ye,focusedThumbIndex:Fe,range:Ye,dragging:ut,marks:at,values:$e,trackOffset:Mt,trackLeap:Vn,getThumbStyle:sa}=VO({...K,rootRef:r});K.marked=at.length>0&&at.some(Pe=>Pe.label),K.dragging=ut,K.focusedThumbIndex=Fe;const Ue=kO(K),Vr=(H==null?void 0:H.root)??c.Root??IO,la=(H==null?void 0:H.rail)??c.Rail??EO,ia=(H==null?void 0:H.track)??c.Track??MO,ca=(H==null?void 0:H.thumb)??c.Thumb??jO,da=(H==null?void 0:H.valueLabel)??c.ValueLabel??xc,Qt=(H==null?void 0:H.mark)??c.Mark??$O,ua=(H==null?void 0:H.markLabel)??c.MarkLabel??UO,q=(H==null?void 0:H.input)??c.Input??"input",Q=(J==null?void 0:J.root)??d.root,Z=(J==null?void 0:J.rail)??d.rail,oe=(J==null?void 0:J.track)??d.track,ce=(J==null?void 0:J.thumb)??d.thumb,ee=(J==null?void 0:J.valueLabel)??d.valueLabel,Te=(J==null?void 0:J.mark)??d.mark,ke=(J==null?void 0:J.markLabel)??d.markLabel,_e=(J==null?void 0:J.input)??d.input,He=Ct({elementType:Vr,getSlotProps:Ve,externalSlotProps:Q,externalForwardedProps:$,additionalProps:{...PO(Vr)&&{as:i}},ownerState:{...K,...Q==null?void 0:Q.ownerState},className:[Ue.root,y]}),Pr=Ct({elementType:la,externalSlotProps:Z,ownerState:K,className:Ue.rail}),Ic=Ct({elementType:ia,externalSlotProps:oe,additionalProps:{style:{...se[ye].offset(Mt),...se[ye].leap(Vn)}},ownerState:{...K,...oe==null?void 0:oe.ownerState},className:Ue.track}),Pn=Ct({elementType:ca,getSlotProps:je,externalSlotProps:ce,ownerState:{...K,...ce==null?void 0:ce.ownerState},className:Ue.thumb}),Ec=Ct({elementType:da,externalSlotProps:ee,ownerState:{...K,...ee==null?void 0:ee.ownerState},className:Ue.valueLabel}),Rn=Ct({elementType:Qt,externalSlotProps:Te,ownerState:K,className:Ue.mark}),_n=Ct({elementType:ua,externalSlotProps:ke,ownerState:K,className:Ue.markLabel}),Mc=Ct({elementType:q,getSlotProps:Je,externalSlotProps:_e,ownerState:K});return b.jsxs(Vr,{...He,children:[b.jsx(la,{...Pr}),b.jsx(ia,{...Ic}),at.filter(Pe=>Pe.value>=D&&Pe.value<=N).map((Pe,Ie)=>{const An=Wa(Pe.value,D,N),pa=se[ye].offset(An);let pt;return te===!1?pt=$e.includes(Pe.value):pt=te==="normal"&&(Ye?Pe.value>=$e[0]&&Pe.value<=$e[$e.length-1]:Pe.value<=$e[0])||te==="inverted"&&(Ye?Pe.value<=$e[0]||Pe.value>=$e[$e.length-1]:Pe.value>=$e[0]),b.jsxs(L.Fragment,{children:[b.jsx(Qt,{"data-index":Ie,...Rn,...!ka(Qt)&&{markActive:pt},style:{...pa,...Rn.style},className:ft(Rn.className,pt&&Ue.markActive)}),Pe.label!=null?b.jsx(ua,{"aria-hidden":!0,"data-index":Ie,..._n,...!ka(ua)&&{markLabelActive:pt},style:{...pa,..._n.style},className:ft(Ue.markLabel,_n.className,pt&&Ue.markLabelActive),children:Pe.label}):null]},Ie)}),$e.map((Pe,Ie)=>{const An=Wa(Pe,D,N),pa=se[ye].offset(An),pt=X==="off"?LO:da;return b.jsx(pt,{...!ka(pt)&&{valueLabelFormat:be,valueLabelDisplay:X,value:typeof be=="function"?be(B(Pe),Ie):be,index:Ie,open:Et===Ie||xt===Ie||X==="on",disabled:m},...Ec,children:b.jsx(ca,{"data-index":Ie,...Pn,className:ft(Ue.thumb,Pn.className,xt===Ie&&Ue.active,Fe===Ie&&Ue.focusVisible),style:{...pa,...sa(Ie),...Pn.style},children:b.jsx(q,{"data-index":Ie,"aria-label":x?x(Ie):o,"aria-valuenow":B(Pe),"aria-labelledby":l,"aria-valuetext":I?I(B(Pe),Ie):s,value:$e[Ie],...Mc})})},Ie)})]})});process.env.NODE_ENV!=="production"&&(Oc.propTypes={"aria-label":Al(S.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":S.string,"aria-valuetext":Al(S.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:S.node,classes:S.object,className:S.string,color:S.oneOfType([S.oneOf(["primary","secondary","error","info","success","warning"]),S.string]),components:S.shape({Input:S.elementType,Mark:S.elementType,MarkLabel:S.elementType,Rail:S.elementType,Root:S.elementType,Thumb:S.elementType,Track:S.elementType,ValueLabel:S.elementType}),componentsProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),defaultValue:S.oneOfType([S.arrayOf(S.number),S.number]),disabled:S.bool,disableSwap:S.bool,getAriaLabel:S.func,getAriaValueText:S.func,marks:S.oneOfType([S.arrayOf(S.shape({label:S.node,value:S.number.isRequired})),S.bool]),max:S.number,min:S.number,name:S.string,onChange:S.func,onChangeCommitted:S.func,orientation:S.oneOf(["horizontal","vertical"]),scale:S.func,shiftStep:S.number,size:S.oneOfType([S.oneOf(["small","medium"]),S.string]),slotProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),slots:S.shape({input:S.elementType,mark:S.elementType,markLabel:S.elementType,rail:S.elementType,root:S.elementType,thumb:S.elementType,track:S.elementType,valueLabel:S.elementType}),step:S.number,sx:S.oneOfType([S.arrayOf(S.oneOfType([S.func,S.object,S.bool])),S.func,S.object]),tabIndex:S.number,track:S.oneOf(["inverted","normal",!1]),value:S.oneOfType([S.arrayOf(S.number),S.number]),valueLabelDisplay:S.oneOf(["auto","off","on"]),valueLabelFormat:S.oneOfType([S.func,S.string])});var BO="[object Number]";function FO(e){return typeof e=="number"||Nt(e)&&qt(e)==BO}const wc=Re.observer(e=>{var o,s,l;const t=F.useTheme(),{store:r}=e,{t:a}=we.useTranslation();function n(i,c){c===e.velocity||!FO(c)||e.onVelocityChange(c)}return b.jsxs(F.Stack,{direction:"row",gap:2,alignItems:"center",children:[r.showVelocityLegend&&b.jsx(F.Typography,{sx:{color:(l=(s=(o=t.componentsExt)==null?void 0:o.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:l.sliderLegendColor,fontSize:"14px"},children:a("Jogging.Velocity.bt")}),b.jsx(Oc,{value:e.velocity,color:"secondary",onChange:n,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),r.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):b.jsx(Go,{value:e.velocity.toString()}))]})});function Go({value:e,sx:t}){var a;const r=F.useTheme();return b.jsx(F.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"111px",...t},children:b.jsx(F.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:r.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Cc=Re.observer(({store:e})=>{const{t}=we.useTranslation(),r=Re.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?a=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`:a=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`}}));return b.jsx(wc,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:a=>b.jsx(Go,{value:r.valueLabelFormat(a),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),NO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation(),a=F.useTheme();function n(p,y){(y==="translate"||y==="rotate")&&e.setSelectedCartesianMotionType(y)}si(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}&response_coordinate_system=${e.selectedCoordSystemId}`))},{fireImmediately:!0});async function o(p,y){const g=await e.activate(),m=g.motionStream.rapidlyChangingMotionState.tcp_pose,x=g.motionStream.rapidlyChangingMotionState.state.joint_position;m&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:p.axis,direction:p.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:m,currentJoints:x,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:p.axis,direction:p.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:y.mm}:{type:"rotate",distanceRads:kt.degreesToRadians(y.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(p){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return o(p,e.activeDiscreteIncrement);p.motionType==="translate"?await e.jogger.startTCPTranslation({axis:p.axis,direction:p.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.startTCPRotation({axis:p.axis,direction:p.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function l(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function i(p,y,g){var x,I,G;const m=(G=(I=(x=g.componentsExt)==null?void 0:x.JoggingPanel)==null?void 0:I.JoggingCartesian)==null?void 0:G.Axis;if(m)return y==="translate"?m[p]:m.CustomRotation??m[p]}const c=[{id:"x",icon:b.jsx(zS,{}),colors:i("X",e.selectedCartesianMotionType,a)},{id:"y",icon:b.jsx(qS,{}),colors:i("Y",e.selectedCartesianMotionType,a)},{id:"z",icon:b.jsx(HS,{}),colors:i("Z",e.selectedCartesianMotionType,a)}];function d(p){return r("General.mm.variable",{amount:p.toFixed(1)})}function u(p){return r("General.degree.variable",{amount:kt.radiansToDegrees(p).toFixed(1)})}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsxs(F.Stack,{gap:2,children:[b.jsx(uO,{store:e}),b.jsx(Cc,{store:e}),b.jsx(F.Divider,{})]}),b.jsx(F.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:b.jsxs(F.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[b.jsxs(pO,{value:e.selectedCartesianMotionType,onChange:n,exclusive:!0,"aria-label":r("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[b.jsx(F.ToggleButton,{value:"translate",children:r("Jogging.Cartesian.Translation.bt")}),b.jsx(F.ToggleButton,{value:"rotate",children:r("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(p=>{var y,g;return b.jsx(no,{colors:p.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===p.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[p.icon,b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=p.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var m;return d(((m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.position[p.id])||0)},startJogging:m=>s({axis:p.id,motionType:"translate",direction:m}),stopJogging:l},p.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(p=>{var y,g;return b.jsx(no,{colors:p.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===p.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[b.jsx(QS,{}),b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=p.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var m,x;return u(((x=(m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.orientation)==null?void 0:x[p.id])||0)},startJogging:m=>s({axis:p.id,motionType:"rotate",direction:m}),stopJogging:l},p.id)})]})}),b.jsx(pc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),DO=Re.observer(({store:e,children:t})=>{const r=F.useTheme();async function a(o){await e.activate(),await e.jogger.startJointRotation({joint:o.joint,direction:o.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function n(){await e.jogger.stop(),await e.deactivate()}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsx(Cc,{store:e}),b.jsx(F.Divider,{}),b.jsx(F.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},id:"JointControls",children:b.jsx(F.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(o=>{var c;const s=(c=e.motionGroupSpec.mechanical_joint_limits)==null?void 0:c[o.index],l=(s==null?void 0:s.lower_limit)!==void 0?kt.radiansToDegrees(s.lower_limit):void 0,i=(s==null?void 0:s.upper_limit)!==void 0?kt.radiansToDegrees(s.upper_limit):void 0;return b.jsxs(F.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&b.jsx(F.Typography,{color:e.isLocked?r.palette.text.disabled:r.palette.text.secondary,children:`G${o.index+1}`}),b.jsx(di,{disabled:e.isLocked,lowerLimitDegs:l,upperLimitDegs:i,getValueDegs:()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_position.joints[o.index];return d!==void 0?kt.radiansToDegrees(d):void 0},startJogging:d=>a({joint:o.index,direction:d}),stopJogging:n})]},`joint-${o.index}`)})})}),b.jsx(pc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),zO=yr(Re.observer(e=>{const t=Ro.isString(e.nova)?new LS({instanceUrl:e.nova}):e.nova,r=Re.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function a(){Ae.runInAction(()=>{r.loadingError=null,r.joggingStore=null});try{let n=e.store;if(!n){const o=await t.connectJogger(e.motionGroupId);n=await Cn.loadFor(o)}Ae.runInAction(()=>{r.joggingStore=n}),e.onSetup&&e.onSetup(n)}catch(n){r.loadingError=n}}return Y.useEffect(()=>(a(),e.store?()=>null:()=>{var n;(n=r.joggingStore)==null||n.dispose()}),[e.store,e.nova,e.motionGroupId]),Y.useEffect(()=>{const n=r.joggingStore;n&&(e.locked?n.lock("external"):n.unlock("external"))},[r.joggingStore,e.locked]),b.jsx(F.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:r.joggingStore?b.jsx(GO,{store:r.joggingStore,children:e.children}):b.jsx(Lo,{message:"Loading jogging",error:r.loadingError})})})),GO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation();function a(){if(e.currentTab.id==="cartesian")return b.jsx(b.Fragment,{children:b.jsx(NO,{store:e,children:t})});if(e.currentTab.id==="joint")return b.jsx(b.Fragment,{children:b.jsx(DO,{store:e,children:t})})}return b.jsxs(F.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[b.jsx(F.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(n=>{const o=n.label==="cartesian"?r("Jogging.Cartesian.bt"):r("Jogging.Joints.bt"),s=n.label==="cartesian"?b.jsx(yh,{fontSize:"small",sx:{mr:1}}):b.jsx(gh,{fontSize:"small",sx:{mr:1}});return b.jsx(F.Tab,{label:e.showTabIcons?b.jsxs(F.Stack,{direction:"row",alignItems:"center",children:[s,o]}):o,id:`jogging-tab-${n.id}`,"aria-controls":`jogging-tab-${n.id}`},n.id)})}),b.jsx(F.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:a()})]})}),Vc=Y.forwardRef(({label:e,value:t},r)=>{var l;const a=F.useTheme(),[n,o]=Y.useState(!1);async function s(){if(!r||!("current"in r))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),o(!0),!0}catch(i){console.error(i);const c=window.getSelection(),d=document.createRange();d.selectNodeContents(r.current),c.removeAllRanges(),c.addRange(d)}return!1}return Y.useEffect(()=>{if(!n)return;const i=setTimeout(()=>o(!1),3e3);return()=>{i&&clearTimeout(i)}},[n]),b.jsx(F.Tooltip,{open:n,title:"Copied!",children:b.jsx(F.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(l=a.palette.backgroundPaperElevation)==null?void 0:l[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:b.jsx(F.Typography,{ref:r,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:a.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})}),qO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const a=e.rapidlyChangingMotionState.tcp_pose;return a?kt.poseToWandelscriptString(a):""}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(Vc,{value:r(),ref:t})})}),JO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const{joints:a}=e.rapidlyChangingMotionState.state.joint_position;return`[${a.map(n=>parseFloat(n.toFixed(4))).join(", ")}]`}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(Vc,{value:r(),ref:t})})});function HO(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function WO({baseUrl:e=HO(),...t}){return b.jsxs(F.Dialog,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[b.jsx(F.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),b.jsxs(F.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[b.jsx(F.Typography,{color:"#fff",children:"Found no devices to connect to."}),b.jsx(F.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),b.jsx(F.DialogActions,{children:b.jsxs(F.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[b.jsx(F.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),b.jsx(F.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const QO=Array(6).fill(2*Math.PI);class qo{constructor(t=[],r={}){this.currentValues=[],this.targetValues=[],this.previousTargetValues=[],this.targetUpdateTime=0,this.animationId=null,this.velocities=[],this.animate=()=>{this.update(.016666666666666666)?this.animationId=null:this.animationId=requestAnimationFrame(this.animate)},this.options={tension:120,friction:20,threshold:.001,onChange:()=>{},onComplete:()=>{},...r},this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now()}update(t=1/60){let r=!1,a=!0;const n=Math.min(t,1/15);for(let o=0;o<this.currentValues.length;o++){const s=this.currentValues[o],l=this.targetValues[o],i=this.velocities[o],c=l-s,d=c*this.options.tension,u=i*this.options.friction,p=d-u,y=i+p*n,g=s+y*n;Math.abs(c)<this.options.threshold&&Math.abs(y)<this.options.threshold*10?this.currentValues[o]!==l&&(this.currentValues[o]=l,this.velocities[o]=0,r=!0):(a=!1,this.currentValues[o]=g,this.velocities[o]=y,r=!0)}return r&&this.options.onChange(this.currentValues),a&&this.options.onComplete(this.currentValues),a}setTarget(t){const r=performance.now(),a=r-this.targetUpdateTime;if(this.previousTargetValues=[...this.targetValues],this.targetValues=[...t],this.targetUpdateTime=r,a<8&&a>0&&this.previousTargetValues.length>0){const n=Math.min(a/8,1);for(let o=0;o<this.targetValues.length;o++){const s=this.previousTargetValues[o]||0,l=t[o]||0;Math.abs(l-s)>.1&&(this.targetValues[o]=s+(l-s)*n)}}for(;this.currentValues.length<t.length;)this.currentValues.push(t[this.currentValues.length]),this.velocities.push(0);this.currentValues.length>t.length&&(this.currentValues=this.currentValues.slice(0,t.length),this.velocities=this.velocities.slice(0,t.length))}getCurrentValues(){return[...this.currentValues]}getValue(t){return this.currentValues[t]??0}isInterpolating(){return this.animationId!==null}stop(){this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setImmediate(t){this.stop(),this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.options.onChange(this.currentValues)}updateOptions(t){this.options={...this.options,...t}}startAutoInterpolation(){this.startInterpolation()}destroy(){this.stop()}startInterpolation(){this.animationId===null&&this.animate()}}function KO(e=[],t={}){const r=Y.useRef(null);return r.current||(r.current=new qo(e,t)),Y.useEffect(()=>{var a;(a=r.current)==null||a.updateOptions(t)},[t]),Y.useEffect(()=>()=>{var a;(a=r.current)==null||a.destroy()},[]),[r.current]}const Ul="0.0.0-semantically-released";function Jo(e){let t=Ul;return Ul.startsWith("0.")&&(t=""),`https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components${t?`@${t}`:""}/public/models/${e}.glb`}function YO(e){function t(r){return r.children.length===0?[r]:[r,...r.children.flatMap(a=>t(a))]}return t(e).filter(r=>Rc(r))}function Pc(e){return e.name.endsWith("_FLG")}function Rc(e){return/_J[0-9]+$/.test(e.name)}function XO(e,t){let r;function a(n){if(Pc(n)){if(r)throw Error(`Found multiple flange groups in robot model ${t}; first ${r.name} then ${n.name}. Only one _FLG group is allowed.`);r=n}Rc(n),n.children.map(a)}if(a(e.scene),!r)throw Error(`No flange group found in robot model ${t}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function _c({rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:r,children:a}){const n=Y.useRef([]),o=Y.useRef([]),s=Y.useRef(null),{invalidate:l}=Ho.useThree();Y.useEffect(()=>{const u=e.state.joint_position.joints.filter(p=>p!==void 0);return s.current=new qo(u,{tension:120,friction:20,threshold:.001}),()=>{var p;(p=s.current)==null||p.destroy()}},[]),Ho.useFrame((u,p)=>{if(s.current){const y=s.current.update(p);d(),y||l()}});function i(u){u&&(o.current=YO(u),d(),l())}function c(u){var p;n.current=u,(p=s.current)==null||p.setTarget(u)}function d(){var p;const u=((p=s.current)==null?void 0:p.getCurrentValues())||[];if(r)r(o.current,u);else for(const[y,g]of o.current.entries()){const m=t[y],x=m.theta||0,I=m.reverse_rotation_direction?-1:1;g.rotation.y=I*(u[y]||0)+x}}return oi(()=>{const u=e.state.joint_position.joints.filter(p=>p!==void 0);requestAnimationFrame(()=>c(u))}),b.jsx("group",{ref:i,children:a})}const ZO="line",ew="mesh";function tw({rapidlyChangingMotionState:e,dhParameters:t,...r}){const a=new Ze.Matrix4,n=Y.useRef([]),o=Y.useRef([]);Y.useEffect(()=>{n.current=new Array(t.length).fill(null),o.current=new Array(t.length).fill(null)},[t.length]);function s(c,d){const u=new Ze.Vector3,p=new Ze.Quaternion,y=new Ze.Vector3;a.decompose(u,p,y);const g=u.clone(),m=new Ze.Matrix4().makeRotationY(c.theta+d*(c.reverse_rotation_direction?-1:1)).multiply(new Ze.Matrix4().makeTranslation(0,c.d/1e3,0)).multiply(new Ze.Matrix4().makeTranslation(c.a/1e3,0,0)).multiply(new Ze.Matrix4().makeRotationX(c.alpha));return a.multiply(m),a.decompose(u,p,y),{a:g,b:u}}function l(c,d,u,p){if(!t)return;const y=t[c];if(!y)return;const{a:g,b:m}=s(y,p);d.geometry.setPositions([g.toArray(),m.toArray()].flat()),u.position.set(m.x,m.y,m.z)}function i(c,d){a.identity();for(let u=0;u<Math.min(c.length,d.length);u++){const p=n.current[u],y=o.current[u];p&&y&&l(u,p,y,d[u])}}return b.jsx(b.Fragment,{children:b.jsx(_c,{rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:i,children:b.jsxs("group",{...r,name:"Scene",children:[b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),t.map((c,d)=>{const{a:u,b:p}=s(c,e.state.joint_position.joints[d]??0),y=`dhrobot_J0${d}`;return b.jsxs("group",{name:y,children:[b.jsx(et.Line,{ref:g=>{n.current[d]=g},name:ZO,points:[u,p],color:"white",lineWidth:5}),b.jsxs("mesh",{ref:g=>{o.current[d]=g},name:ew,position:p,children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+d)]},y)})]})})})}const rw=console.warn;function aw(){return Y.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&rw(e)}},[]),b.jsx(b.Fragment,{})}function nw(e){return e.type==="Mesh"}function ow({modelURL:e,flangeRef:t,postModelRender:r,...a}){const{gltf:n}=XO(et.useGLTF(e),e.split("/").pop()||e),o=Y.useCallback(l=>{l&&r&&r()},[e]);function s(l){return nw(l)?b.jsx("mesh",{name:l.name,geometry:l.geometry,material:l.material,position:l.position,rotation:l.rotation},l.uuid):b.jsx(Hc.animated.group,{name:l.name,position:l.position,rotation:l.rotation,ref:Pc(l)?t:void 0,children:l.children.map(s)},l.uuid)}return b.jsx("group",{...a,dispose:null,ref:o,children:s(n.scene)})}const sw=(e,t)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof Oe.Mesh){r.material instanceof Oe.Material&&(r.material.colorWrite=!1);const a=r.clone(),n=r.clone();a.material=new Oe.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:Oe.DoubleSide}),a.userData.isGhost=!0,n.material=new Oe.MeshStandardMaterial({color:t,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:Oe.DoubleSide}),n.userData.isGhost=!0,r.parent&&(r.parent.add(a),r.parent.add(n))}}),e.userData.isGhost=!0)},lw=e=>{if(!e.userData.isGhost)return;const t=[];e.traverse(r=>{var a;r instanceof Oe.Mesh&&((a=r.userData)!=null&&a.isGhost?t.push(r):r.material instanceof Oe.Material&&(r.material.colorWrite=!0))}),t.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},Ac=yr(({rapidlyChangingMotionState:e,modelFromController:t,dhParameters:r,getModel:a=Jo,flangeRef:n,postModelRender:o,transparentColor:s,...l})=>{const[i,c]=Y.useState(null),d=Y.useCallback(p=>{c(p)},[]);Y.useEffect(()=>{i&&(s?sw(i,s):lw(i))},[i,s]);const u=b.jsx(tw,{rapidlyChangingMotionState:e,dhParameters:r,...l});return b.jsxs(Jc.ErrorBoundary,{fallback:u,onError:p=>{console.error(p)},children:[b.jsx(Y.Suspense,{fallback:u,children:b.jsx("group",{ref:d,children:b.jsx(_c,{rapidlyChangingMotionState:e,dhParameters:r,children:b.jsx(ow,{modelURL:a(t),postModelRender:o,flangeRef:n,...l})})})}),b.jsx(aw,{})]})});function iw({connectedMotionGroup:e,getModel:t=Jo,flangeRef:r,transparentColor:a,...n}){return e.dhParameters?b.jsx(Ac,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:t,flangeRef:r,transparentColor:a,...n}):null}const cw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"})),dw=Y.forwardRef(cw),uw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"})),pw=Y.forwardRef(uw),it=Re.observer(({id:e,icon:t,color:r,title:a,name:n,explanation:o,literalValue:s,anchorOrigin:l,transformOrigin:i})=>{const c=Re.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!c.anchorEl},openPopover(d){c.anchorEl=d.currentTarget},closePopover(){c.anchorEl=null}}));return b.jsxs(b.Fragment,{children:[b.jsx(F.Stack,{"aria-owns":c.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:c.openPopover,onMouseLeave:c.closePopover,sx:{cursor:"pointer"},children:b.jsx(F.SvgIcon,{component:t,sx:{color:r}})}),b.jsx(F.Popover,{id:e,sx:{pointerEvents:"none"},open:c.isPopoverOpen,anchorEl:c.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:i??{vertical:"top",horizontal:"left"},onClose:c.closePopover,disableRestoreFocus:!0,children:b.jsxs(F.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[b.jsxs("div",{children:[a&&b.jsx(F.Typography,{component:"span",fontSize:"14px",children:`${a}: `}),b.jsx(F.Typography,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:n})]}),b.jsx(F.Typography,{fontSize:"14px",children:o}),s&&b.jsx(F.Typography,{fontSize:"12px",children:s})]})})]})}),hw=Re.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:r,transformOrigin:a})=>{const n=F.useTheme(),{t:o}=we.useTranslation();return e?b.jsx(it,{id:"motion-group-virtual",icon:pw,color:n.palette.tertiary.main,name:o("SafetyBar.ControllerType.Virtual.lb"),explanation:b.jsxs(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",b.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:a}):b.jsx(it,{id:"motion-group-physical",icon:dw,color:n.palette.primary.main,name:o("SafetyBar.ControllerType.Physical.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:b.jsx("code",{}),strong:b.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:a})}),mw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z"})),fw=Y.forwardRef(mw),yw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z",fill:"#fff",fillOpacity:.56})),gw=Y.forwardRef(yw),bw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"})),Sw=Y.forwardRef(bw),vw=Re.observer(({operationMode:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),n=F.useTheme();switch(e){case"OPERATION_MODE_AUTO":return b.jsx(it,{id:"operation-mode-auto",icon:fw,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Automatic.ti"),color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:t,transformOrigin:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return b.jsx(it,{id:"operation-mode-manual",icon:Sw,color:n.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Manual.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:return b.jsx(it,{id:"operation-mode-error",icon:gw,color:n.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Error.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:e,anchorOrigin:t,transformOrigin:r})}}),xw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"})),Ow=Y.forwardRef(xw),ww=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"}),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"})),Cw=Y.forwardRef(ww),Vw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z",fill:"#fff",fillOpacity:.56})),Pw=Y.forwardRef(Vw),Rw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),_w=Y.forwardRef(Rw),Aw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),Tw=Y.forwardRef(Aw),Iw=Re.observer(({safetyState:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),n=F.useTheme();switch(e){case"SAFETY_STATE_NORMAL":return b.jsx(it,{id:"safety-state-normal",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Normal.lb"),icon:_w,color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return b.jsx(it,{id:"safety-state-estop",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Estop.lb"),icon:Cw,color:n.palette.error.main,explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return b.jsx(it,{id:"safety-state-stop",icon:Tw,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Stop.lb"),color:n.palette.warning.main,explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return b.jsx(it,{id:"safety-state-manual-action-required",icon:Pw,color:n.palette.warning.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return b.jsx(it,{id:"safety-state-error",icon:Ow,color:n.palette.error.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Error.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:FS(e,`Unknown safety state ${e}`)}}),Ew=yr(Re.observer(e=>b.jsxs(F.Stack,{direction:"row",gap:"8px",alignItems:"center",sx:{height:"24px"},children:[b.jsx(Iw,{safetyState:e.safetyState,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(vw,{operationMode:e.operationMode,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(hw,{isVirtual:e.isVirtual,motionGroupId:e.motionGroupId,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin})]}))),Mw=F.styled(F.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,r,a;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:n})=>!n,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:n})=>n,style:{background:(a=e.palette.backgroundPaperElevation)==null?void 0:a[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),jw=Y.forwardRef((e,t)=>b.jsx(Mw,{ref:t,selected:e.selected,...e,color:"secondary",variant:"circular"})),$w={$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",name:"wandelscript",patterns:[{include:"#keywords"},{include:"#strings"},{include:"#comments"},{include:"#functions"}],repository:{keywords:{patterns:[{name:"keyword.control.flow.wandelscript",match:"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print|and|or|not)\\b"}]},strings:{name:"string.quoted.double.wandelscript",begin:'"',end:'"',patterns:[{name:"constant.character.escape.wandelscript",match:"\\\\."}]},comments:{patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.wandelscript"}},end:"$",name:"comment.line.number-sign.wandelscript"}]},functions:{patterns:[{match:"[a-zA-Z_-]+\\(",name:"entity.name.function.wandelscript"}]}},scopeName:"source.wandelscript"},Uw=Y.lazy(()=>import("@monaco-editor/react"));let eo=null;async function kw(){if(!eo){const[{createHighlighter:e},{shikiToMonaco:t}]=await Promise.all([import("shiki"),import("@shikijs/monaco")]);eo={shiki:await e({langs:[$w],themes:["dark-plus","light-plus"]}),shikiToMonaco:t}}return eo}const Lw=yr(e=>{const t=F.useTheme(),[r,a]=Y.useState("dark-plus"),n=t.palette.mode==="dark"?"dark-plus":"light-plus";async function o(s){var c,d;s.languages.register({id:"wandelscript"}),s.languages.setLanguageConfiguration("wandelscript",{comments:{lineComment:"#"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}]});const{shiki:l,shikiToMonaco:i}=await kw();i(l,s),s.editor.defineTheme(n,((d=(c=t.componentsExt)==null?void 0:c.WandelscriptEditor)==null?void 0:d.monacoTheme)??{base:t.palette.mode==="dark"?"vs-dark":"vs",inherit:!0,rules:[],colors:{}}),e.monacoSetup&&e.monacoSetup(s),a(n)}return b.jsx(Y.Suspense,{fallback:b.jsx(Lo,{}),children:b.jsx(Uw,{value:e.code,onMount:(s,l)=>{o(l)},onChange:e.onChange,defaultLanguage:"wandelscript",theme:r,options:{minimap:{enabled:!1},wordWrap:"on",automaticLayout:!0,...e.monacoOptions}})})});function Tc(){var t,r,a,n,o,s,l;const e=F.createTheme({palette:{mode:"dark",text:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.38)"},primary:{main:"rgba(142, 86, 252, 1)",dark:"rgba(136, 58, 255, 1)",light:"rgba(157, 131, 246, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},secondary:{main:"rgba(255, 255, 255, 1)",dark:"rgba(255, 255, 255, 0.06)",contrastText:"rgba(255, 255, 255, 0.87)"},tertiary:{main:"rgba(100, 255, 218, 1)",dark:"rgba(38, 166, 154, 1)",light:"rgba(167, 255, 235, 1)",contrastText:"rgba(0, 0, 0, 1)"},error:{main:"rgba(239, 83, 80, 1)",dark:"rgba(229, 57, 53, 1)",light:"rgba(239, 154, 154, 1)",contrastText:"rgba(255, 255, 255, 1)"},warning:{main:"rgba(255, 171, 64, 1)",dark:"rgba(255, 145, 0, 1)",light:"rgba(255, 209, 128, 1)",contrastText:"rgba(0, 0, 0, 0.87)"},success:{main:"rgba(38, 166, 154, 1)",dark:"rgba(0, 121, 107, 1)",light:"rgba(128, 203, 196, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},background:{default:"rgba(2, 6, 23, 1)",paper:"rgba(17, 19, 31, 1)"},action:{active:"rgba(255, 255, 255, 0.56)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabledBackground:"rgba(255, 255, 255, 0.12)",focus:"rgba(255, 255, 255, 0.12)",disabled:"rgba(255, 255, 255, 0.38)"},common:{white:"rgba(255, 255, 255, 1)",black:"rgba(0, 0, 0, 1)"},divider:"rgba(255, 255, 255, 0.12)",backgroundPaperElevation:{0:"rgba(17,19,31,1.0)",1:"rgba(20,22,35,1.0)",2:"rgba(23,25,39,1.0)",3:"rgba(26,28,43,1.0)",4:"rgba(29,31,47,1.0)",5:"rgba(32,34,51,1.0)",6:"rgba(35,37,55,1.0)",7:"rgba(38,40,59,1.0)",8:"rgba(41,43,63,1.0)",9:"rgba(44,46,67,1.0)",10:"rgba(47,49,71,1.0)",11:"rgba(50,52,75,1.0)",12:"rgba(53,55,79,1.0)",13:"rgba(56,58,83,1.0)",14:"rgba(59,61,87,1.0)",15:"rgba(62,64,91,1.0)",16:"rgba(57,63,87,1.0)"}},paletteExt:{primary:{hover:"rgba(142, 86, 252, 0.08)",selected:"rgba(142, 86, 252, 0.16)",focus:"rgba(142, 86, 252, 0.12)",focusVisible:"rgba(142, 86, 252, 0.3)",outlineBorder:"rgba(142, 86, 252, 0.5)"},secondary:{tonal:"rgba(255,255,255,0.1)"}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:"none",msOverflowStyle:"none"},"html:hover, body:hover, *:hover":{scrollbarWidth:"thin",scrollbarColor:`${e.palette.divider} transparent`}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(a=(r=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:r.tonal)==null?void 0:a.toString()}},{props:{color:"secondary",variant:"outlined"},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:"none",color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:"10px 0 0 10px"},".MuiToggleButtonGroup-lastButton":{borderRadius:"0 10px 10px 0"}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none",padding:"6px 16px"}}},MuiSelect:{variants:[{props:{variant:"filled"},style:{borderRadius:"10px","::before, ::after":{visibility:"collapse"},".MuiInputBase-input":{padding:"6px 16px",borderRadius:"10px"}}}]},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"4px 0 8px -4px rgba(0, 0, 0, 0.3)"}}},MuiFab:{styleOverrides:{root:{background:(s=(o=e.paletteExt)==null?void 0:o.secondary)==null?void 0:s.tonal}},variants:[{props:{color:"primary"},style:{background:e.palette.primary.main}}]}},componentsExt:{JoggingPanel:{JoggingCartesian:{Axis:{X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:e.palette.text.primary},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:e.palette.text.primary},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}},WandelscriptEditor:{monacoTheme:{base:"vs-dark",inherit:!0,rules:[{token:"keyword",foreground:"#b349a9ff"}],colors:{"editor.background":F.rgbToHex(((l=e.palette.backgroundPaperElevation)==null?void 0:l[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function Bw(){const e=Tc();return e.palette.mode="light",e}function Fw(e){var a,n,o,s;let t=!0;((a=e.palette)==null?void 0:a.mode)==="light"?t=!1:((n=e.palette)==null?void 0:n.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const r=t?Tc():Bw();return ni(r,e)}exports.JoggingCartesianAxisControl=no;exports.JoggingJointRotationControl=di;exports.JoggingPanel=zO;exports.JoggingStore=Cn;exports.LoadingCover=Lo;exports.LoadingErrorMessage=tc;exports.NoMotionGroupModal=WO;exports.PoseCartesianValues=qO;exports.PoseJointValues=JO;exports.PresetEnvironment=Yc;exports.Robot=iw;exports.SafetyBar=Ew;exports.SafetyZonesRenderer=ed;exports.SelectableFab=jw;exports.SupportedRobot=Ac;exports.TrajectoryRenderer=td;exports.ValueInterpolator=qo;exports.VelocitySlider=wc;exports.VelocitySliderLabel=Go;exports.WandelscriptEditor=Lw;exports.createNovaMuiTheme=Fw;exports.defaultAxisConfig=QO;exports.defaultGetModel=Jo;exports.i18n=jo;exports.useAnimationFrame=gr;exports.useAutorun=oi;exports.useInterpolation=KO;exports.useMounted=ln;exports.useReaction=si;
|
|
106
|
+
`))}return!1}const gO={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function bO(e,t,r=(a,n)=>a===n){return e.length===t.length&&e.every((a,n)=>r(a,t[n]))}const SO=2;function lr(e,t,r,a,n){return r===1?Math.min(e+t,n):Math.max(e-t,a)}function Sc(e,t){return e-t}function El(e,t){const{index:r}=e.reduce((a,n,o)=>{const s=Math.abs(t-n);return a===null||s<a.distance||s===a.distance?{distance:s,index:o}:a},null)??{};return r}function Ra(e,t){if(t.current!==void 0&&e.changedTouches){const r=e;for(let a=0;a<r.changedTouches.length;a+=1){const n=r.changedTouches[a];if(n.identifier===t.current)return{x:n.clientX,y:n.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function Wa(e,t,r){return(e-t)*100/(r-t)}function vO(e,t,r){return(r-t)*e+t}function xO(e){if(Math.abs(e)<1){const r=e.toExponential().split("e-"),a=r[0].split(".")[1];return(a?a.length:0)+parseInt(r[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}function OO(e,t,r){const a=Math.round((e-r)/t)*t+r;return Number(a.toFixed(xO(t)))}function Ml({values:e,newValue:t,index:r}){const a=e.slice();return a[r]=t,a.sort(Sc)}function _a({sliderRef:e,activeIndex:t,setActive:r}){var n,o,s;const a=Ea(e.current);(!((n=e.current)!=null&&n.contains(a.activeElement))||Number((o=a==null?void 0:a.activeElement)==null?void 0:o.getAttribute("data-index"))!==t)&&((s=e.current)==null||s.querySelector(`[type="range"][data-index="${t}"]`).focus()),r&&r(t)}function Aa(e,t){return typeof e=="number"&&typeof t=="number"?e===t:typeof e=="object"&&typeof t=="object"?bO(e,t):!1}const wO={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},CO=e=>e;let Ta;function jl(){return Ta===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Ta=CSS.supports("touch-action","none"):Ta=!0),Ta}function VO(e){const{"aria-labelledby":t,defaultValue:r,disabled:a=!1,disableSwap:n=!1,isRtl:o=!1,marks:s=!1,max:l=100,min:i=0,name:c,onChange:d,onChangeCommitted:u,orientation:p="horizontal",rootRef:y,scale:g=CO,step:m=1,shiftStep:x=10,tabIndex:I,value:G}=e,N=L.useRef(void 0),[D,z]=L.useState(-1),[W,j]=L.useState(-1),[U,k]=L.useState(!1),f=L.useRef(0),M=L.useRef(null),[B,J]=zp({controlled:G,default:r??i,name:"Slider"}),H=d&&((q,Q,Z)=>{const oe=q.nativeEvent||q,ce=new oe.constructor(oe.type,oe);Object.defineProperty(ce,"target",{writable:!0,value:{value:Q,name:c}}),M.current=Q,d(ce,Q,Z)}),ne=Array.isArray(B);let te=ne?B.slice().sort(Sc):[B];te=te.map(q=>q==null?i:ir(q,i,l));const xe=s===!0&&m!==null?[...Array(Math.floor((l-i)/m)+1)].map((q,Q)=>({value:i+m*Q})):s||[],X=xe.map(q=>q.value),[be,$]=L.useState(-1),K=L.useRef(null),se=li(y,K),Ve=q=>Q=>{var oe;const Z=Number(Q.currentTarget.getAttribute("data-index"));Il(Q.target)&&$(Z),j(Z),(oe=q==null?void 0:q.onFocus)==null||oe.call(q,Q)},Je=q=>Q=>{var Z;Il(Q.target)||$(-1),j(-1),(Z=q==null?void 0:q.onBlur)==null||Z.call(q,Q)},je=(q,Q)=>{const Z=Number(q.currentTarget.getAttribute("data-index")),oe=te[Z],ce=X.indexOf(oe);let ee=Q;if(xe&&m==null){const Te=X[X.length-1];ee>=Te?ee=Te:ee<=X[0]?ee=X[0]:ee=ee<oe?X[ce-1]:X[ce+1]}if(ee=ir(ee,i,l),ne){n&&(ee=ir(ee,te[Z-1]||-1/0,te[Z+1]||1/0));const Te=ee;ee=Ml({values:te,newValue:ee,index:Z});let ke=Z;n||(ke=ee.indexOf(Te)),_a({sliderRef:K,activeIndex:ke})}J(ee),$(Z),H&&!Aa(ee,B)&&H(q,ee,Z),u&&u(q,M.current??ee)},Et=q=>Q=>{var Z;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(Q.key)){Q.preventDefault();const oe=Number(Q.currentTarget.getAttribute("data-index")),ce=te[oe];let ee=null;if(m!=null){const Te=Q.shiftKey?x:m;switch(Q.key){case"ArrowUp":ee=lr(ce,Te,1,i,l);break;case"ArrowRight":ee=lr(ce,Te,o?-1:1,i,l);break;case"ArrowDown":ee=lr(ce,Te,-1,i,l);break;case"ArrowLeft":ee=lr(ce,Te,o?1:-1,i,l);break;case"PageUp":ee=lr(ce,x,1,i,l);break;case"PageDown":ee=lr(ce,x,-1,i,l);break;case"Home":ee=i;break;case"End":ee=l;break}}else if(xe){const Te=X[X.length-1],ke=X.indexOf(ce),_e=[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"],He=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];_e.includes(Q.key)?ke===0?ee=X[0]:ee=X[ke-1]:He.includes(Q.key)&&(ke===X.length-1?ee=Te:ee=X[ke+1])}ee!=null&&je(Q,ee)}(Z=q==null?void 0:q.onKeyDown)==null||Z.call(q,Q)};Yl(()=>{var q;a&&K.current.contains(document.activeElement)&&((q=document.activeElement)==null||q.blur())},[a]),a&&D!==-1&&z(-1),a&&be!==-1&&$(-1);const xt=q=>Q=>{var Z;(Z=q.onChange)==null||Z.call(q,Q),je(Q,Q.target.valueAsNumber)},ye=L.useRef(void 0);let Fe=p;o&&p==="horizontal"&&(Fe+="-reverse");const Ye=({finger:q,move:Q=!1})=>{const{current:Z}=K,{width:oe,height:ce,bottom:ee,left:Te}=Z.getBoundingClientRect();let ke;Fe.startsWith("vertical")?ke=(ee-q.y)/ce:ke=(q.x-Te)/oe,Fe.includes("-reverse")&&(ke=1-ke);let _e;if(_e=vO(ke,i,l),m)_e=OO(_e,m,i);else{const Pr=El(X,_e);_e=X[Pr]}_e=ir(_e,i,l);let He=0;if(ne){Q?He=ye.current:He=El(te,_e),n&&(_e=ir(_e,te[He-1]||-1/0,te[He+1]||1/0));const Pr=_e;_e=Ml({values:te,newValue:_e,index:He}),n&&Q||(He=_e.indexOf(Pr),ye.current=He)}return{newValue:_e,activeIndex:He}},ut=kn(q=>{const Q=Ra(q,N);if(!Q)return;if(f.current+=1,q.type==="mousemove"&&q.buttons===0){at(q);return}const{newValue:Z,activeIndex:oe}=Ye({finger:Q,move:!0});_a({sliderRef:K,activeIndex:oe,setActive:z}),J(Z),!U&&f.current>SO&&k(!0),H&&!Aa(Z,B)&&H(q,Z,oe)}),at=kn(q=>{const Q=Ra(q,N);if(k(!1),!Q)return;const{newValue:Z}=Ye({finger:Q,move:!0});z(-1),q.type==="touchend"&&j(-1),u&&u(q,M.current??Z),N.current=void 0,Mt()}),$e=kn(q=>{if(a)return;jl()||q.preventDefault();const Q=q.changedTouches[0];Q!=null&&(N.current=Q.identifier);const Z=Ra(q,N);if(Z!==!1){const{newValue:ce,activeIndex:ee}=Ye({finger:Z});_a({sliderRef:K,activeIndex:ee,setActive:z}),J(ce),H&&!Aa(ce,B)&&H(q,ce,ee)}f.current=0;const oe=Ea(K.current);oe.addEventListener("touchmove",ut,{passive:!0}),oe.addEventListener("touchend",at,{passive:!0})}),Mt=L.useCallback(()=>{const q=Ea(K.current);q.removeEventListener("mousemove",ut),q.removeEventListener("mouseup",at),q.removeEventListener("touchmove",ut),q.removeEventListener("touchend",at)},[at,ut]);L.useEffect(()=>{const{current:q}=K;return q.addEventListener("touchstart",$e,{passive:jl()}),()=>{q.removeEventListener("touchstart",$e),Mt()}},[Mt,$e]),L.useEffect(()=>{a&&Mt()},[a,Mt]);const Vn=q=>Q=>{var ce;if((ce=q.onMouseDown)==null||ce.call(q,Q),a||Q.defaultPrevented||Q.button!==0)return;Q.preventDefault();const Z=Ra(Q,N);if(Z!==!1){const{newValue:ee,activeIndex:Te}=Ye({finger:Z});_a({sliderRef:K,activeIndex:Te,setActive:z}),J(ee),H&&!Aa(ee,B)&&H(Q,ee,Te)}f.current=0;const oe=Ea(K.current);oe.addEventListener("mousemove",ut,{passive:!0}),oe.addEventListener("mouseup",at)},sa=Wa(ne?te[0]:i,i,l),Ue=Wa(te[te.length-1],i,l)-sa,Vr=(q={})=>{const Q=Ua(q),Z={onMouseDown:Vn(Q||{})},oe={...Q,...Z};return{...q,ref:se,...oe}},la=q=>Q=>{var oe;(oe=q.onMouseOver)==null||oe.call(q,Q);const Z=Number(Q.currentTarget.getAttribute("data-index"));j(Z)},ia=q=>Q=>{var Z;(Z=q.onMouseLeave)==null||Z.call(q,Q),j(-1)},ca=(q={})=>{const Q=Ua(q),Z={onMouseOver:la(Q||{}),onMouseLeave:ia(Q||{})};return{...q,...Q,...Z}},da=q=>({pointerEvents:D!==-1&&D!==q?"none":void 0});let Qt;return p==="vertical"&&(Qt=o?"vertical-rl":"vertical-lr"),{active:D,axis:Fe,axisProps:wO,dragging:U,focusedThumbIndex:be,getHiddenInputProps:(q={})=>{const Q=Ua(q),Z={onChange:xt(Q||{}),onFocus:Ve(Q||{}),onBlur:Je(Q||{}),onKeyDown:Et(Q||{})},oe={...Q,...Z};return{tabIndex:I,"aria-labelledby":t,"aria-orientation":p,"aria-valuemax":g(l),"aria-valuemin":g(i),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":e.step??void 0,disabled:a,...q,...oe,style:{...gO,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:Qt}}},getRootProps:Vr,getThumbProps:ca,marks:xe,open:W,range:ne,rootRef:se,trackLeap:Ue,trackOffset:sa,values:te,getThumbStyle:da}}function ka(e){return typeof e=="string"}const PO=e=>!e||!ka(e);function RO(e){return typeof e.main=="string"}function _O(e,t=[]){if(!RO(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function zo(e=[]){return([,t])=>t&&_O(t,e)}function AO(e){return ra("MuiSlider",e)}const Qe=ql("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),TO=e=>{const{open:t}=e;return{offset:ft(t&&Qe.valueLabelOpen),circle:Qe.valueLabelCircle,label:Qe.valueLabelLabel}};function vc(e){const{children:t,className:r,value:a}=e,n=TO(e);return t?L.cloneElement(t,{className:t.props.className},b.jsxs(L.Fragment,{children:[t.props.children,b.jsx("span",{className:ft(n.offset,r),"aria-hidden":!0,children:b.jsx("span",{className:n.circle,children:b.jsx("span",{className:n.label,children:a})})})]})):null}process.env.NODE_ENV!=="production"&&(vc.propTypes={children:S.element.isRequired,className:S.string,value:S.node});function $l(e){return e}const IO=gt("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Le(r.color)}`],r.size!=="medium"&&t[`size${Le(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(Gt(({theme:e})=>({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${Qe.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Qe.dragging}`]:{[`& .${Qe.thumb}, & .${Qe.track}`]:{transition:"none"}},variants:[...Object.entries(e.palette).filter(zo()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}))),EO=gt("span",{name:"MuiSlider",slot:"Rail"})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),MO=gt("span",{name:"MuiSlider",slot:"Track"})(Gt(({theme:e})=>({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(e.palette).filter(zo()).map(([t])=>({props:{color:t,track:"inverted"},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:Jr(e.palette[t].main,.62),borderColor:Jr(e.palette[t].main,.62),...e.applyStyles("dark",{backgroundColor:qr(e.palette[t].main,.5)}),...e.applyStyles("dark",{borderColor:qr(e.palette[t].main,.5)})}}}))]}))),jO=gt("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Le(r.color)}`],r.size!=="medium"&&t[`thumbSize${Le(r.size)}`]]}})(Gt(({theme:e})=>({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${Qe.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(e.palette).filter(zo()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Qe.focusVisible}`]:{...e.vars?{boxShadow:`0px 0px 0px 8px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${ro(e.palette[t].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${Qe.active}`]:{...e.vars?{boxShadow:`0px 0px 0px 14px rgba(${e.vars.palette[t].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${ro(e.palette[t].main,.16)}`}}}}))]}))),xc=gt(vc,{name:"MuiSlider",slot:"ValueLabel"})(Gt(({theme:e})=>({zIndex:1,whiteSpace:"nowrap",...e.typography.body2,fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${Qe.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${Qe.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]})));process.env.NODE_ENV!=="production"&&(xc.propTypes={children:S.element.isRequired,index:S.number.isRequired,open:S.bool.isRequired,value:S.node});const $O=gt("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Eo(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(Gt(({theme:e})=>({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),UO=gt("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Eo(e)&&e!=="markLabelActive"})(Gt(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),kO=e=>{const{disabled:t,dragging:r,marked:a,orientation:n,track:o,classes:s,color:l,size:i}=e,c={root:["root",t&&"disabled",r&&"dragging",a&&"marked",n==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",l&&`color${Le(l)}`,i&&`size${Le(i)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",i&&`thumbSize${Le(i)}`,l&&`thumbColor${Le(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return To(c,AO,s)},LO=({children:e})=>e,Oc=L.forwardRef(function(t,r){const a=Mo({props:t,name:"MuiSlider"}),n=$u(),{"aria-label":o,"aria-valuetext":s,"aria-labelledby":l,component:i="span",components:c={},componentsProps:d={},color:u="primary",classes:p,className:y,disableSwap:g=!1,disabled:m=!1,getAriaLabel:x,getAriaValueText:I,marks:G=!1,max:N=100,min:D=0,name:z,onChange:W,onChangeCommitted:j,orientation:U="horizontal",shiftStep:k=10,size:f="medium",step:M=1,scale:B=$l,slotProps:J,slots:H,tabIndex:ne,track:te="normal",value:xe,valueLabelDisplay:X="off",valueLabelFormat:be=$l,...$}=a,K={...a,isRtl:n,max:N,min:D,classes:p,disabled:m,disableSwap:g,orientation:U,marks:G,color:u,size:f,step:M,shiftStep:k,scale:B,track:te,valueLabelDisplay:X,valueLabelFormat:be},{axisProps:se,getRootProps:Ve,getHiddenInputProps:Je,getThumbProps:je,open:Et,active:xt,axis:ye,focusedThumbIndex:Fe,range:Ye,dragging:ut,marks:at,values:$e,trackOffset:Mt,trackLeap:Vn,getThumbStyle:sa}=VO({...K,rootRef:r});K.marked=at.length>0&&at.some(Pe=>Pe.label),K.dragging=ut,K.focusedThumbIndex=Fe;const Ue=kO(K),Vr=(H==null?void 0:H.root)??c.Root??IO,la=(H==null?void 0:H.rail)??c.Rail??EO,ia=(H==null?void 0:H.track)??c.Track??MO,ca=(H==null?void 0:H.thumb)??c.Thumb??jO,da=(H==null?void 0:H.valueLabel)??c.ValueLabel??xc,Qt=(H==null?void 0:H.mark)??c.Mark??$O,ua=(H==null?void 0:H.markLabel)??c.MarkLabel??UO,q=(H==null?void 0:H.input)??c.Input??"input",Q=(J==null?void 0:J.root)??d.root,Z=(J==null?void 0:J.rail)??d.rail,oe=(J==null?void 0:J.track)??d.track,ce=(J==null?void 0:J.thumb)??d.thumb,ee=(J==null?void 0:J.valueLabel)??d.valueLabel,Te=(J==null?void 0:J.mark)??d.mark,ke=(J==null?void 0:J.markLabel)??d.markLabel,_e=(J==null?void 0:J.input)??d.input,He=Ct({elementType:Vr,getSlotProps:Ve,externalSlotProps:Q,externalForwardedProps:$,additionalProps:{...PO(Vr)&&{as:i}},ownerState:{...K,...Q==null?void 0:Q.ownerState},className:[Ue.root,y]}),Pr=Ct({elementType:la,externalSlotProps:Z,ownerState:K,className:Ue.rail}),Ic=Ct({elementType:ia,externalSlotProps:oe,additionalProps:{style:{...se[ye].offset(Mt),...se[ye].leap(Vn)}},ownerState:{...K,...oe==null?void 0:oe.ownerState},className:Ue.track}),Pn=Ct({elementType:ca,getSlotProps:je,externalSlotProps:ce,ownerState:{...K,...ce==null?void 0:ce.ownerState},className:Ue.thumb}),Ec=Ct({elementType:da,externalSlotProps:ee,ownerState:{...K,...ee==null?void 0:ee.ownerState},className:Ue.valueLabel}),Rn=Ct({elementType:Qt,externalSlotProps:Te,ownerState:K,className:Ue.mark}),_n=Ct({elementType:ua,externalSlotProps:ke,ownerState:K,className:Ue.markLabel}),Mc=Ct({elementType:q,getSlotProps:Je,externalSlotProps:_e,ownerState:K});return b.jsxs(Vr,{...He,children:[b.jsx(la,{...Pr}),b.jsx(ia,{...Ic}),at.filter(Pe=>Pe.value>=D&&Pe.value<=N).map((Pe,Ie)=>{const An=Wa(Pe.value,D,N),pa=se[ye].offset(An);let pt;return te===!1?pt=$e.includes(Pe.value):pt=te==="normal"&&(Ye?Pe.value>=$e[0]&&Pe.value<=$e[$e.length-1]:Pe.value<=$e[0])||te==="inverted"&&(Ye?Pe.value<=$e[0]||Pe.value>=$e[$e.length-1]:Pe.value>=$e[0]),b.jsxs(L.Fragment,{children:[b.jsx(Qt,{"data-index":Ie,...Rn,...!ka(Qt)&&{markActive:pt},style:{...pa,...Rn.style},className:ft(Rn.className,pt&&Ue.markActive)}),Pe.label!=null?b.jsx(ua,{"aria-hidden":!0,"data-index":Ie,..._n,...!ka(ua)&&{markLabelActive:pt},style:{...pa,..._n.style},className:ft(Ue.markLabel,_n.className,pt&&Ue.markLabelActive),children:Pe.label}):null]},Ie)}),$e.map((Pe,Ie)=>{const An=Wa(Pe,D,N),pa=se[ye].offset(An),pt=X==="off"?LO:da;return b.jsx(pt,{...!ka(pt)&&{valueLabelFormat:be,valueLabelDisplay:X,value:typeof be=="function"?be(B(Pe),Ie):be,index:Ie,open:Et===Ie||xt===Ie||X==="on",disabled:m},...Ec,children:b.jsx(ca,{"data-index":Ie,...Pn,className:ft(Ue.thumb,Pn.className,xt===Ie&&Ue.active,Fe===Ie&&Ue.focusVisible),style:{...pa,...sa(Ie),...Pn.style},children:b.jsx(q,{"data-index":Ie,"aria-label":x?x(Ie):o,"aria-valuenow":B(Pe),"aria-labelledby":l,"aria-valuetext":I?I(B(Pe),Ie):s,value:$e[Ie],...Mc})})},Ie)})]})});process.env.NODE_ENV!=="production"&&(Oc.propTypes={"aria-label":Al(S.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-label"]!=null?new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":S.string,"aria-valuetext":Al(S.string,e=>Array.isArray(e.value||e.defaultValue)&&e["aria-valuetext"]!=null?new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:S.node,classes:S.object,className:S.string,color:S.oneOfType([S.oneOf(["primary","secondary","error","info","success","warning"]),S.string]),components:S.shape({Input:S.elementType,Mark:S.elementType,MarkLabel:S.elementType,Rail:S.elementType,Root:S.elementType,Thumb:S.elementType,Track:S.elementType,ValueLabel:S.elementType}),componentsProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),defaultValue:S.oneOfType([S.arrayOf(S.number),S.number]),disabled:S.bool,disableSwap:S.bool,getAriaLabel:S.func,getAriaValueText:S.func,marks:S.oneOfType([S.arrayOf(S.shape({label:S.node,value:S.number.isRequired})),S.bool]),max:S.number,min:S.number,name:S.string,onChange:S.func,onChangeCommitted:S.func,orientation:S.oneOf(["horizontal","vertical"]),scale:S.func,shiftStep:S.number,size:S.oneOfType([S.oneOf(["small","medium"]),S.string]),slotProps:S.shape({input:S.oneOfType([S.func,S.object]),mark:S.oneOfType([S.func,S.object]),markLabel:S.oneOfType([S.func,S.object]),rail:S.oneOfType([S.func,S.object]),root:S.oneOfType([S.func,S.object]),thumb:S.oneOfType([S.func,S.object]),track:S.oneOfType([S.func,S.object]),valueLabel:S.oneOfType([S.func,S.shape({children:S.element,className:S.string,open:S.bool,style:S.object,value:S.node,valueLabelDisplay:S.oneOf(["auto","off","on"])})])}),slots:S.shape({input:S.elementType,mark:S.elementType,markLabel:S.elementType,rail:S.elementType,root:S.elementType,thumb:S.elementType,track:S.elementType,valueLabel:S.elementType}),step:S.number,sx:S.oneOfType([S.arrayOf(S.oneOfType([S.func,S.object,S.bool])),S.func,S.object]),tabIndex:S.number,track:S.oneOf(["inverted","normal",!1]),value:S.oneOfType([S.arrayOf(S.number),S.number]),valueLabelDisplay:S.oneOf(["auto","off","on"]),valueLabelFormat:S.oneOfType([S.func,S.string])});var BO="[object Number]";function FO(e){return typeof e=="number"||Nt(e)&&qt(e)==BO}const wc=Re.observer(e=>{var o,s,l;const t=F.useTheme(),{store:r}=e,{t:a}=we.useTranslation();function n(i,c){c===e.velocity||!FO(c)||e.onVelocityChange(c)}return b.jsxs(F.Stack,{direction:"row",gap:2,alignItems:"center",children:[r.showVelocityLegend&&b.jsx(F.Typography,{sx:{color:(l=(s=(o=t.componentsExt)==null?void 0:o.JoggingPanel)==null?void 0:s.VelocitySlider)==null?void 0:l.sliderLegendColor,fontSize:"14px"},children:a("Jogging.Velocity.bt")}),b.jsx(Oc,{value:e.velocity,color:"secondary",onChange:n,min:e.min,max:e.max,"aria-labelledby":"input-slider",disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),r.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):b.jsx(Go,{value:e.velocity.toString()}))]})});function Go({value:e,sx:t}){var a;const r=F.useTheme();return b.jsx(F.Stack,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(a=r.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"111px",...t},children:b.jsx(F.Typography,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:r.palette.text.primary,whiteSpace:"nowrap"},children:e})})}const Cc=Re.observer(({store:e})=>{const{t}=we.useTranslation(),r=Re.useLocalObservable(()=>({get valueLabelFormat(){return e.currentMotionType==="translate"?a=>`v = ${t("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:a})}`:a=>`ω = ${t("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:a})}`}}));return b.jsx(wc,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:a=>b.jsx(Go,{value:r.valueLabelFormat(a),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),NO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation(),a=F.useTheme();function n(p,y){(y==="translate"||y==="rotate")&&e.setSelectedCartesianMotionType(y)}si(()=>[e.selectedCoordSystemId,e.selectedTcpId],()=>{e.jogger.motionStream.motionStateSocket.changeUrl(e.jogger.nova.makeWebsocketURL(`/motion-groups/${e.jogger.motionGroupId}/state-stream?tcp=${e.selectedTcpId}&response_coordinate_system=${e.selectedCoordSystemId}`))},{fireImmediately:!0});async function o(p,y){const g=await e.activate(),m=g.motionStream.rapidlyChangingMotionState.tcp_pose,x=g.motionStream.rapidlyChangingMotionState.state.joint_position;m&&await e.withMotionLock(async()=>{try{e.setCurrentIncrementJog({axis:p.axis,direction:p.direction}),await e.jogger.runIncrementalCartesianMotion({currentTcpPose:m,currentJoints:x,coordSystemId:e.activeCoordSystemId,velocityInRelevantUnits:e.selectedCartesianMotionType==="translate"?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec,axis:p.axis,direction:p.direction,motion:e.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:y.mm}:{type:"rotate",distanceRads:kt.degreesToRadians(y.degrees)}})}finally{e.setCurrentIncrementJog(null),await e.deactivate()}})}async function s(p){if(!e.isLocked){if(await e.activate(),e.activeDiscreteIncrement)return o(p,e.activeDiscreteIncrement);p.motionType==="translate"?await e.jogger.startTCPTranslation({axis:p.axis,direction:p.direction,velocityMmPerSec:e.translationVelocityMmPerSec}):await e.jogger.startTCPRotation({axis:p.axis,direction:p.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}}async function l(){e.isLocked||e.activeDiscreteIncrement||await e.deactivate()}function i(p,y,g){var x,I,G;const m=(G=(I=(x=g.componentsExt)==null?void 0:x.JoggingPanel)==null?void 0:I.JoggingCartesian)==null?void 0:G.Axis;if(m)return y==="translate"?m[p]:m.CustomRotation??m[p]}const c=[{id:"x",icon:b.jsx(zS,{}),colors:i("X",e.selectedCartesianMotionType,a)},{id:"y",icon:b.jsx(qS,{}),colors:i("Y",e.selectedCartesianMotionType,a)},{id:"z",icon:b.jsx(HS,{}),colors:i("Z",e.selectedCartesianMotionType,a)}];function d(p){return r("General.mm.variable",{amount:p.toFixed(1)})}function u(p){return r("General.degree.variable",{amount:kt.radiansToDegrees(p).toFixed(1)})}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsxs(F.Stack,{gap:2,children:[b.jsx(uO,{store:e}),b.jsx(Cc,{store:e}),b.jsx(F.Divider,{})]}),b.jsx(F.Stack,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:b.jsxs(F.Stack,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[b.jsxs(pO,{value:e.selectedCartesianMotionType,onChange:n,exclusive:!0,"aria-label":r("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[b.jsx(F.ToggleButton,{value:"translate",children:r("Jogging.Cartesian.Translation.bt")}),b.jsx(F.ToggleButton,{value:"rotate",children:r("Jogging.Cartesian.Rotation.bt")})]}),e.selectedCartesianMotionType==="translate"&&c.map(p=>{var y,g;return b.jsx(no,{colors:p.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===p.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[p.icon,b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=p.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var m;return d(((m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.position[p.id])||0)},startJogging:m=>s({axis:p.id,motionType:"translate",direction:m}),stopJogging:l},p.id)}),e.selectedCartesianMotionType==="rotate"&&c.map(p=>{var y,g;return b.jsx(no,{colors:p.colors,disabled:e.isLocked,activeJoggingDirection:((y=e.incrementJogInProgress)==null?void 0:y.axis)===p.id?e.incrementJogInProgress.direction:void 0,label:b.jsxs(b.Fragment,{children:[b.jsx(QS,{}),b.jsx(F.Typography,{sx:{fontSize:"24px",color:((g=p.colors)==null?void 0:g.labelColor)??a.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var m,x;return u(((x=(m=e.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:m.orientation)==null?void 0:x[p.id])||0)},startJogging:m=>s({axis:p.id,motionType:"rotate",direction:m}),stopJogging:l},p.id)})]})}),b.jsx(pc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),DO=Re.observer(({store:e,children:t})=>{const r=F.useTheme();async function a(o){await e.activate(),await e.jogger.startJointRotation({joint:o.joint,direction:o.direction,velocityRadsPerSec:e.rotationVelocityRadsPerSec})}async function n(){await e.jogger.stop(),await e.deactivate()}return b.jsxs(F.Stack,{flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[b.jsx(Cc,{store:e}),b.jsx(F.Divider,{}),b.jsx(F.Stack,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},id:"JointControls",children:b.jsx(F.Stack,{alignItems:"center",gap:"24px",children:e.jogger.motionStream.joints.map(o=>{var c;const s=(c=e.motionGroupSpec.mechanical_joint_limits)==null?void 0:c[o.index],l=(s==null?void 0:s.lower_limit)!==void 0?kt.radiansToDegrees(s.lower_limit):void 0,i=(s==null?void 0:s.upper_limit)!==void 0?kt.radiansToDegrees(s.upper_limit):void 0;return b.jsxs(F.Stack,{direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[e.showJointsLegend&&b.jsx(F.Typography,{color:e.isLocked?r.palette.text.disabled:r.palette.text.secondary,children:`G${o.index+1}`}),b.jsx(di,{disabled:e.isLocked,lowerLimitDegs:l,upperLimitDegs:i,getValueDegs:()=>{const d=e.jogger.motionStream.rapidlyChangingMotionState.state.joint_position.joints[o.index];return d!==void 0?kt.radiansToDegrees(d):void 0},startJogging:d=>a({joint:o.index,direction:d}),stopJogging:n})]},`joint-${o.index}`)})})}),b.jsx(pc,{store:e}),t&&b.jsx(F.Divider,{}),t]})}),zO=yr(Re.observer(e=>{const t=Ro.isString(e.nova)?new LS({instanceUrl:e.nova}):e.nova,r=Re.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function a(){Ae.runInAction(()=>{r.loadingError=null,r.joggingStore=null});try{let n=e.store;if(!n){const o=await t.connectJogger(e.motionGroupId);n=await Cn.loadFor(o)}Ae.runInAction(()=>{r.joggingStore=n}),e.onSetup&&e.onSetup(n)}catch(n){r.loadingError=n}}return Y.useEffect(()=>(a(),e.store?()=>null:()=>{var n;(n=r.joggingStore)==null||n.dispose()}),[e.store,e.nova,e.motionGroupId]),Y.useEffect(()=>{const n=r.joggingStore;n&&(e.locked?n.lock("external"):n.unlock("external"))},[r.joggingStore,e.locked]),b.jsx(F.Stack,{sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...e.sx},children:r.joggingStore?b.jsx(GO,{store:r.joggingStore,children:e.children}):b.jsx(Lo,{message:"Loading jogging",error:r.loadingError})})})),GO=Re.observer(({store:e,children:t})=>{const{t:r}=we.useTranslation();function a(){if(e.currentTab.id==="cartesian")return b.jsx(b.Fragment,{children:b.jsx(NO,{store:e,children:t})});if(e.currentTab.id==="joint")return b.jsx(b.Fragment,{children:b.jsx(DO,{store:e,children:t})})}return b.jsxs(F.Stack,{flexGrow:1,sx:{overflow:"hidden"},children:[b.jsx(F.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:"fullWidth",children:e.tabs.map(n=>{const o=n.label==="cartesian"?r("Jogging.Cartesian.bt"):r("Jogging.Joints.bt"),s=n.label==="cartesian"?b.jsx(yh,{fontSize:"small",sx:{mr:1}}):b.jsx(gh,{fontSize:"small",sx:{mr:1}});return b.jsx(F.Tab,{label:e.showTabIcons?b.jsxs(F.Stack,{direction:"row",alignItems:"center",children:[s,o]}):o,id:`jogging-tab-${n.id}`,"aria-controls":`jogging-tab-${n.id}`},n.id)})}),b.jsx(F.Stack,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:a()})]})}),Vc=Y.forwardRef(({label:e,value:t},r)=>{var l;const a=F.useTheme(),[n,o]=Y.useState(!1);async function s(){if(!r||!("current"in r))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(t),console.log("Copied!"),o(!0),!0}catch(i){console.error(i);const c=window.getSelection(),d=document.createRange();d.selectNodeContents(r.current),c.removeAllRanges(),c.addRange(d)}return!1}return Y.useEffect(()=>{if(!n)return;const i=setTimeout(()=>o(!1),3e3);return()=>{i&&clearTimeout(i)}},[n]),b.jsx(F.Tooltip,{open:n,title:"Copied!",children:b.jsx(F.Stack,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(l=a.palette.backgroundPaperElevation)==null?void 0:l[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>s(),children:b.jsx(F.Typography,{ref:r,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:a.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:t})})})}),qO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const a=e.rapidlyChangingMotionState.tcp_pose;return a?kt.poseToWandelscriptString(a):""}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(Vc,{value:r(),ref:t})})}),JO=Re.observer(({motionStream:e})=>{const t=Y.useRef(null);function r(){const{joints:a}=e.rapidlyChangingMotionState.state.joint_position;return`[${a.map(n=>parseFloat(n.toFixed(4))).join(", ")}]`}return gr(()=>{if(!t.current)return;const a=r();t.current.textContent!==a&&(t.current.textContent=a)}),b.jsx(F.Stack,{alignItems:"left",spacing:2,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},children:b.jsx(Vc,{value:r(),ref:t})})});function HO(){const e=window.location.href;return e.substring(0,e.indexOf("/",e.indexOf("//")+2))}function WO({baseUrl:e=HO(),...t}){return b.jsxs(F.Dialog,{"aria-labelledby":"no-motion-group-modal-title",open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:"blur(10px)"},"& .MuiDialog-paper":{"::before":{content:'""',height:"8px",width:"100%",background:"linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)"},background:"#101629"}},children:[b.jsx(F.DialogTitle,{id:"no-motion-group-modal-title",children:"No motion group found"}),b.jsxs(F.DialogContent,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[b.jsx(F.Typography,{color:"#fff",children:"Found no devices to connect to."}),b.jsx(F.Typography,{color:"#fff",children:"Please ensure a motion group has been created."})]}),b.jsx(F.DialogActions,{children:b.jsxs(F.Stack,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[b.jsx(F.Button,{href:`${e}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),b.jsx(F.Button,{href:`${e}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}const QO=Array(6).fill(2*Math.PI);class qo{constructor(t=[],r={}){this.currentValues=[],this.targetValues=[],this.previousTargetValues=[],this.targetUpdateTime=0,this.animationId=null,this.updateCount=0,this.velocities=[],this.animate=()=>{this.update(.016666666666666666)?this.animationId=null:this.animationId=requestAnimationFrame(this.animate)},this.options={tension:120,friction:20,threshold:.001,onChange:()=>{},onComplete:()=>{},...r},this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.updateCount=0}update(t=1/60){let r=!1,a=!0;this.updateCount++;const n=Math.min(t,1/15),o=this.updateCount<=3?Math.min(this.updateCount/3,1):1;for(let s=0;s<this.currentValues.length;s++){const l=this.currentValues[s],i=this.targetValues[s],c=this.velocities[s],d=i-l,u=d*this.options.tension*o,p=c*this.options.friction,y=u-p,g=c+y*n,m=l+g*n;Math.abs(d)<this.options.threshold&&Math.abs(g)<this.options.threshold*10?this.currentValues[s]!==i&&(this.currentValues[s]=i,this.velocities[s]=0,r=!0):(a=!1,this.currentValues[s]=m,this.velocities[s]=g,r=!0)}return r&&this.options.onChange(this.currentValues),a&&this.options.onComplete(this.currentValues),a}setTarget(t){const r=performance.now(),a=r-this.targetUpdateTime;if(this.previousTargetValues=[...this.targetValues],this.targetValues=[...t],this.targetUpdateTime=r,this.updateCount=0,a<8&&a>0&&this.previousTargetValues.length>0){const n=Math.min(a/8,1);for(let o=0;o<this.targetValues.length;o++){const s=this.previousTargetValues[o]||0,l=t[o]||0;Math.abs(l-s)>.1&&(this.targetValues[o]=s+(l-s)*n)}}for(;this.currentValues.length<t.length;)this.currentValues.push(t[this.currentValues.length]),this.velocities.push(0);this.currentValues.length>t.length&&(this.currentValues=this.currentValues.slice(0,t.length),this.velocities=this.velocities.slice(0,t.length))}getCurrentValues(){return[...this.currentValues]}getValue(t){return this.currentValues[t]??0}isInterpolating(){return this.animationId!==null}stop(){this.animationId!==null&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setImmediate(t){this.stop(),this.currentValues=[...t],this.targetValues=[...t],this.previousTargetValues=[...t],this.velocities=new Array(t.length).fill(0),this.targetUpdateTime=performance.now(),this.updateCount=0,this.options.onChange(this.currentValues)}updateOptions(t){this.options={...this.options,...t}}startAutoInterpolation(){this.startInterpolation()}destroy(){this.stop()}startInterpolation(){this.animationId===null&&this.animate()}}function KO(e=[],t={}){const r=Y.useRef(null);return r.current||(r.current=new qo(e,t)),Y.useEffect(()=>{var a;(a=r.current)==null||a.updateOptions(t)},[t]),Y.useEffect(()=>()=>{var a;(a=r.current)==null||a.destroy()},[]),[r.current]}const Ul="0.0.0-semantically-released";function Jo(e){let t=Ul;return Ul.startsWith("0.")&&(t=""),`https://cdn.jsdelivr.net/gh/wandelbotsgmbh/wandelbots-js-react-components${t?`@${t}`:""}/public/models/${e}.glb`}function YO(e){function t(r){return r.children.length===0?[r]:[r,...r.children.flatMap(a=>t(a))]}return t(e).filter(r=>Rc(r))}function Pc(e){return e.name.endsWith("_FLG")}function Rc(e){return/_J[0-9]+$/.test(e.name)}function XO(e,t){let r;function a(n){if(Pc(n)){if(r)throw Error(`Found multiple flange groups in robot model ${t}; first ${r.name} then ${n.name}. Only one _FLG group is allowed.`);r=n}Rc(n),n.children.map(a)}if(a(e.scene),!r)throw Error(`No flange group found in robot model ${t}. Flange must be identified with a name ending in _FLG.`);return{gltf:e}}function _c({rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:r,children:a}){const n=Y.useRef([]),o=Y.useRef([]),s=Y.useRef(null),{invalidate:l}=Ho.useThree();Y.useEffect(()=>{const u=e.state.joint_position.joints.filter(p=>p!==void 0);return s.current=new qo(u,{tension:120,friction:20,threshold:.001}),()=>{var p;(p=s.current)==null||p.destroy()}},[]),Ho.useFrame((u,p)=>{if(s.current){const y=s.current.update(p);d(),y||l()}});function i(u){u&&(o.current=YO(u),d(),l())}function c(u){var p;n.current=u,(p=s.current)==null||p.setTarget(u)}function d(){var p;const u=((p=s.current)==null?void 0:p.getCurrentValues())||[];if(r)r(o.current,u);else for(const[y,g]of o.current.entries()){const m=t[y],x=m.theta||0,I=m.reverse_rotation_direction?-1:1;g.rotation.y=I*(u[y]||0)+x}}return oi(()=>{const u=e.state.joint_position.joints.filter(p=>p!==void 0);requestAnimationFrame(()=>c(u))}),b.jsx("group",{ref:i,children:a})}const ZO="line",ew="mesh";function tw({rapidlyChangingMotionState:e,dhParameters:t,...r}){const a=new Ze.Matrix4,n=Y.useRef([]),o=Y.useRef([]);Y.useEffect(()=>{n.current=new Array(t.length).fill(null),o.current=new Array(t.length).fill(null)},[t.length]);function s(c,d){const u=new Ze.Vector3,p=new Ze.Quaternion,y=new Ze.Vector3;a.decompose(u,p,y);const g=u.clone(),m=new Ze.Matrix4().makeRotationY(c.theta+d*(c.reverse_rotation_direction?-1:1)).multiply(new Ze.Matrix4().makeTranslation(0,c.d/1e3,0)).multiply(new Ze.Matrix4().makeTranslation(c.a/1e3,0,0)).multiply(new Ze.Matrix4().makeRotationX(c.alpha));return a.multiply(m),a.decompose(u,p,y),{a:g,b:u}}function l(c,d,u,p){if(!t)return;const y=t[c];if(!y)return;const{a:g,b:m}=s(y,p);d.geometry.setPositions([g.toArray(),m.toArray()].flat()),u.position.set(m.x,m.y,m.z)}function i(c,d){a.identity();for(let u=0;u<Math.min(c.length,d.length);u++){const p=n.current[u],y=o.current[u];p&&y&&l(u,p,y,d[u])}}return b.jsx(b.Fragment,{children:b.jsx(_c,{rapidlyChangingMotionState:e,dhParameters:t,onRotationChanged:i,children:b.jsxs("group",{...r,name:"Scene",children:[b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]}),t.map((c,d)=>{const{a:u,b:p}=s(c,e.state.joint_position.joints[d]??0),y=`dhrobot_J0${d}`;return b.jsxs("group",{name:y,children:[b.jsx(et.Line,{ref:g=>{n.current[d]=g},name:ZO,points:[u,p],color:"white",lineWidth:5}),b.jsxs("mesh",{ref:g=>{o.current[d]=g},name:ew,position:p,children:[b.jsx("sphereGeometry",{args:[.01,32,32]}),b.jsx("meshStandardMaterial",{color:"black",depthTest:!0})]},"mesh_"+d)]},y)})]})})})}const rw=console.warn;function aw(){return Y.useEffect(()=>{console.warn=e=>{e!=="Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"&&rw(e)}},[]),b.jsx(b.Fragment,{})}function nw(e){return e.type==="Mesh"}function ow({modelURL:e,flangeRef:t,postModelRender:r,...a}){const{gltf:n}=XO(et.useGLTF(e),e.split("/").pop()||e),o=Y.useCallback(l=>{l&&r&&r()},[e]);function s(l){return nw(l)?b.jsx("mesh",{name:l.name,geometry:l.geometry,material:l.material,position:l.position,rotation:l.rotation},l.uuid):b.jsx(Hc.animated.group,{name:l.name,position:l.position,rotation:l.rotation,ref:Pc(l)?t:void 0,children:l.children.map(s)},l.uuid)}return b.jsx("group",{...a,dispose:null,ref:o,children:s(n.scene)})}const sw=(e,t)=>{e.userData.isGhost||(e.traverse(r=>{if(r instanceof Oe.Mesh){r.material instanceof Oe.Material&&(r.material.colorWrite=!1);const a=r.clone(),n=r.clone();a.material=new Oe.MeshStandardMaterial({depthTest:!0,depthWrite:!0,colorWrite:!1,polygonOffset:!0,polygonOffsetFactor:-1,side:Oe.DoubleSide}),a.userData.isGhost=!0,n.material=new Oe.MeshStandardMaterial({color:t,opacity:.3,depthTest:!0,depthWrite:!1,transparent:!0,polygonOffset:!0,polygonOffsetFactor:-2,side:Oe.DoubleSide}),n.userData.isGhost=!0,r.parent&&(r.parent.add(a),r.parent.add(n))}}),e.userData.isGhost=!0)},lw=e=>{if(!e.userData.isGhost)return;const t=[];e.traverse(r=>{var a;r instanceof Oe.Mesh&&((a=r.userData)!=null&&a.isGhost?t.push(r):r.material instanceof Oe.Material&&(r.material.colorWrite=!0))}),t.forEach(r=>{r.parent&&r.parent.remove(r)}),e.userData.isGhost=!1},Ac=yr(({rapidlyChangingMotionState:e,modelFromController:t,dhParameters:r,getModel:a=Jo,flangeRef:n,postModelRender:o,transparentColor:s,...l})=>{const[i,c]=Y.useState(null),d=Y.useCallback(p=>{c(p)},[]);Y.useEffect(()=>{i&&(s?sw(i,s):lw(i))},[i,s]);const u=b.jsx(tw,{rapidlyChangingMotionState:e,dhParameters:r,...l});return b.jsxs(Jc.ErrorBoundary,{fallback:u,onError:p=>{console.error(p)},children:[b.jsx(Y.Suspense,{fallback:u,children:b.jsx("group",{ref:d,children:b.jsx(_c,{rapidlyChangingMotionState:e,dhParameters:r,children:b.jsx(ow,{modelURL:a(t),postModelRender:o,flangeRef:n,...l})})})}),b.jsx(aw,{})]})});function iw({connectedMotionGroup:e,getModel:t=Jo,flangeRef:r,transparentColor:a,...n}){return e.dhParameters?b.jsx(Ac,{rapidlyChangingMotionState:e.rapidlyChangingMotionState,modelFromController:e.modelFromController||"",dhParameters:e.dhParameters,getModel:t,flangeRef:r,transparentColor:a,...n}):null}const cw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z"})),dw=Y.forwardRef(cw),uw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z"})),pw=Y.forwardRef(uw),it=Re.observer(({id:e,icon:t,color:r,title:a,name:n,explanation:o,literalValue:s,anchorOrigin:l,transformOrigin:i})=>{const c=Re.useLocalObservable(()=>({anchorEl:null,get isPopoverOpen(){return!!c.anchorEl},openPopover(d){c.anchorEl=d.currentTarget},closePopover(){c.anchorEl=null}}));return b.jsxs(b.Fragment,{children:[b.jsx(F.Stack,{"aria-owns":c.isPopoverOpen?e:void 0,"aria-haspopup":"true",onMouseEnter:c.openPopover,onMouseLeave:c.closePopover,sx:{cursor:"pointer"},children:b.jsx(F.SvgIcon,{component:t,sx:{color:r}})}),b.jsx(F.Popover,{id:e,sx:{pointerEvents:"none"},open:c.isPopoverOpen,anchorEl:c.anchorEl,anchorOrigin:l??{vertical:"bottom",horizontal:"left"},transformOrigin:i??{vertical:"top",horizontal:"left"},onClose:c.closePopover,disableRestoreFocus:!0,children:b.jsxs(F.Stack,{gap:"1rem",padding:2,maxWidth:"450px",sx:{wordWrap:"break-word"},children:[b.jsxs("div",{children:[a&&b.jsx(F.Typography,{component:"span",fontSize:"14px",children:`${a}: `}),b.jsx(F.Typography,{component:"span",color:r,fontWeight:"bold",fontSize:"14px",children:n})]}),b.jsx(F.Typography,{fontSize:"14px",children:o}),s&&b.jsx(F.Typography,{fontSize:"12px",children:s})]})})]})}),hw=Re.observer(({isVirtual:e,motionGroupId:t,anchorOrigin:r,transformOrigin:a})=>{const n=F.useTheme(),{t:o}=we.useTranslation();return e?b.jsx(it,{id:"motion-group-virtual",icon:pw,color:n.palette.tertiary.main,name:o("SafetyBar.ControllerType.Virtual.lb"),explanation:b.jsxs(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Virtual.Explanation.lb",values:{motionGroupId:t},children:["Motion group ",b.jsx("code",{children:t})," refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions."]}),anchorOrigin:r,transformOrigin:a}):b.jsx(it,{id:"motion-group-physical",icon:dw,color:n.palette.primary.main,name:o("SafetyBar.ControllerType.Physical.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.MotionGroup.Physical.Explanation.lb",values:{motionGroupId:t},components:{code:b.jsx("code",{}),strong:b.jsx("strong",{})}}),anchorOrigin:r,transformOrigin:a})}),mw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z"})),fw=Y.forwardRef(mw),yw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z",fill:"#fff",fillOpacity:.56})),gw=Y.forwardRef(yw),bw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z"})),Sw=Y.forwardRef(bw),vw=Re.observer(({operationMode:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),n=F.useTheme();switch(e){case"OPERATION_MODE_AUTO":return b.jsx(it,{id:"operation-mode-auto",icon:fw,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Automatic.ti"),color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.OperationMode.Auto.Explanation.lb",children:"The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode."}),anchorOrigin:t,transformOrigin:r});case"OPERATION_MODE_MANUAL":case"OPERATION_MODE_MANUAL_T1":case"OPERATION_MODE_MANUAL_T2":return b.jsx(it,{id:"operation-mode-manual",icon:Sw,color:n.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Manual.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.OperationMode.Manual.Explanation.lb",children:"The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:return b.jsx(it,{id:"operation-mode-error",icon:gw,color:n.palette.warning.main,title:a("SafetyBar.OperationMode.ti"),name:a("SafetyBar.OperationMode.Error.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.OperationMode.Error.Explanation.lb",children:"The robot controller has entered an unexpected operation mode. Motion group movement may not be possible."}),literalValue:e,anchorOrigin:t,transformOrigin:r})}}),xw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z"})),Ow=Y.forwardRef(xw),ww=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M10.24 10.636 12 13.764l1.76-3.128h-3.52Z"}),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z"}),L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z"})),Cw=Y.forwardRef(ww),Vw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z",fill:"#fff",fillOpacity:.56})),Pw=Y.forwardRef(Vw),Rw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),_w=Y.forwardRef(Rw),Aw=({title:e,titleId:t,...r},a)=>L.createElement("svg",{width:24,height:24,xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":t,...r},e?L.createElement("title",{id:t},e):null,L.createElement("path",{d:"M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z"})),Tw=Y.forwardRef(Aw),Iw=Re.observer(({safetyState:e,anchorOrigin:t,transformOrigin:r})=>{const{t:a}=we.useTranslation(),n=F.useTheme();switch(e){case"SAFETY_STATE_NORMAL":return b.jsx(it,{id:"safety-state-normal",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Normal.lb"),icon:_w,color:"rgba(255, 255, 255, 0.57)",explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Normal.Explanation.lb",children:"The robot controller is in a normal safety state. Movement is not prevented by this state."}),anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_DEVICE_EMERGENCY_STOP":case"SAFETY_STATE_ROBOT_EMERGENCY_STOP":return b.jsx(it,{id:"safety-state-estop",title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Estop.lb"),icon:Cw,color:n.palette.error.main,explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.StopState.Estop.Explanation.lb",children:"An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_STOP_0":case"SAFETY_STATE_STOP_1":case"SAFETY_STATE_STOP_2":case"SAFETY_STATE_PROTECTIVE_STOP":case"SAFETY_STATE_STOP":return b.jsx(it,{id:"safety-state-stop",icon:Tw,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Stop.lb"),color:n.palette.warning.main,explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Stop.Explanation.lb",children:"The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_REDUCED":case"SAFETY_STATE_MASTERING":case"SAFETY_STATE_CONFIRM_SAFETY":case"SAFETY_STATE_OPERATOR_SAFETY":case"SAFETY_STATE_RECOVERY":case"SAFETY_STATE_VIOLATION":return b.jsx(it,{id:"safety-state-manual-action-required",icon:Pw,color:n.palette.warning.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.ManualActionRequired.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.ManualActionRequired.Explanation.lb",children:"The robot controller has entered a safety state requiring manual action to resolve."}),literalValue:e,anchorOrigin:t,transformOrigin:r});case"SAFETY_STATE_UNKNOWN":case"SAFETY_STATE_FAULT":return b.jsx(it,{id:"safety-state-error",icon:Ow,color:n.palette.error.main,title:a("SafetyBar.SafetyState.ti"),name:a("SafetyBar.SafetyState.Error.lb"),explanation:b.jsx(we.Trans,{i18nKey:"SafetyBar.SafetyState.Error.Explanation.lb",children:"The robot controller has entered an unexpected safety state."}),literalValue:e,anchorOrigin:t,transformOrigin:r});default:FS(e,`Unknown safety state ${e}`)}}),Ew=yr(Re.observer(e=>b.jsxs(F.Stack,{direction:"row",gap:"8px",alignItems:"center",sx:{height:"24px"},children:[b.jsx(Iw,{safetyState:e.safetyState,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(vw,{operationMode:e.operationMode,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin}),b.jsx(F.Divider,{orientation:"vertical",flexItem:!0}),b.jsx(hw,{isVirtual:e.isVirtual,motionGroupId:e.motionGroupId,anchorOrigin:e.anchorOrigin,transformOrigin:e.transformOrigin})]}))),Mw=F.styled(F.Fab,{shouldForwardProp:e=>e!=="selected"})(({theme:e})=>{var t,r,a;return{borderRadius:"20px","&:hover":{background:(t=e.palette.backgroundPaperElevation)==null?void 0:t[7]},variants:[{props:({selected:n})=>!n,style:{background:(r=e.palette.backgroundPaperElevation)==null?void 0:r[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:n})=>n,style:{background:(a=e.palette.backgroundPaperElevation)==null?void 0:a[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]}}),jw=Y.forwardRef((e,t)=>b.jsx(Mw,{ref:t,selected:e.selected,...e,color:"secondary",variant:"circular"})),$w={$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",name:"wandelscript",patterns:[{include:"#keywords"},{include:"#strings"},{include:"#comments"},{include:"#functions"}],repository:{keywords:{patterns:[{name:"keyword.control.flow.wandelscript",match:"\\b(move|via|to|interrupt|def|False|True|for|if|else|elif|while|return|switch|activate|deactivate|print|and|or|not)\\b"}]},strings:{name:"string.quoted.double.wandelscript",begin:'"',end:'"',patterns:[{name:"constant.character.escape.wandelscript",match:"\\\\."}]},comments:{patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.wandelscript"}},end:"$",name:"comment.line.number-sign.wandelscript"}]},functions:{patterns:[{match:"[a-zA-Z_-]+\\(",name:"entity.name.function.wandelscript"}]}},scopeName:"source.wandelscript"},Uw=Y.lazy(()=>import("@monaco-editor/react"));let eo=null;async function kw(){if(!eo){const[{createHighlighter:e},{shikiToMonaco:t}]=await Promise.all([import("shiki"),import("@shikijs/monaco")]);eo={shiki:await e({langs:[$w],themes:["dark-plus","light-plus"]}),shikiToMonaco:t}}return eo}const Lw=yr(e=>{const t=F.useTheme(),[r,a]=Y.useState("dark-plus"),n=t.palette.mode==="dark"?"dark-plus":"light-plus";async function o(s){var c,d;s.languages.register({id:"wandelscript"}),s.languages.setLanguageConfiguration("wandelscript",{comments:{lineComment:"#"},brackets:[["(",")"],["[","]"]],autoClosingPairs:[{open:"[",close:"]"},{open:"(",close:")"}],surroundingPairs:[{open:"[",close:"]"},{open:"(",close:")"}]});const{shiki:l,shikiToMonaco:i}=await kw();i(l,s),s.editor.defineTheme(n,((d=(c=t.componentsExt)==null?void 0:c.WandelscriptEditor)==null?void 0:d.monacoTheme)??{base:t.palette.mode==="dark"?"vs-dark":"vs",inherit:!0,rules:[],colors:{}}),e.monacoSetup&&e.monacoSetup(s),a(n)}return b.jsx(Y.Suspense,{fallback:b.jsx(Lo,{}),children:b.jsx(Uw,{value:e.code,onMount:(s,l)=>{o(l)},onChange:e.onChange,defaultLanguage:"wandelscript",theme:r,options:{minimap:{enabled:!1},wordWrap:"on",automaticLayout:!0,...e.monacoOptions}})})});function Tc(){var t,r,a,n,o,s,l;const e=F.createTheme({palette:{mode:"dark",text:{primary:"rgba(255, 255, 255, 1)",secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.38)"},primary:{main:"rgba(142, 86, 252, 1)",dark:"rgba(136, 58, 255, 1)",light:"rgba(157, 131, 246, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},secondary:{main:"rgba(255, 255, 255, 1)",dark:"rgba(255, 255, 255, 0.06)",contrastText:"rgba(255, 255, 255, 0.87)"},tertiary:{main:"rgba(100, 255, 218, 1)",dark:"rgba(38, 166, 154, 1)",light:"rgba(167, 255, 235, 1)",contrastText:"rgba(0, 0, 0, 1)"},error:{main:"rgba(239, 83, 80, 1)",dark:"rgba(229, 57, 53, 1)",light:"rgba(239, 154, 154, 1)",contrastText:"rgba(255, 255, 255, 1)"},warning:{main:"rgba(255, 171, 64, 1)",dark:"rgba(255, 145, 0, 1)",light:"rgba(255, 209, 128, 1)",contrastText:"rgba(0, 0, 0, 0.87)"},success:{main:"rgba(38, 166, 154, 1)",dark:"rgba(0, 121, 107, 1)",light:"rgba(128, 203, 196, 1)",contrastText:"rgba(255, 255, 255, 0.87)"},background:{default:"rgba(2, 6, 23, 1)",paper:"rgba(17, 19, 31, 1)"},action:{active:"rgba(255, 255, 255, 0.56)",hover:"rgba(255, 255, 255, 0.08)",selected:"rgba(255, 255, 255, 0.16)",disabledBackground:"rgba(255, 255, 255, 0.12)",focus:"rgba(255, 255, 255, 0.12)",disabled:"rgba(255, 255, 255, 0.38)"},common:{white:"rgba(255, 255, 255, 1)",black:"rgba(0, 0, 0, 1)"},divider:"rgba(255, 255, 255, 0.12)",backgroundPaperElevation:{0:"rgba(17,19,31,1.0)",1:"rgba(20,22,35,1.0)",2:"rgba(23,25,39,1.0)",3:"rgba(26,28,43,1.0)",4:"rgba(29,31,47,1.0)",5:"rgba(32,34,51,1.0)",6:"rgba(35,37,55,1.0)",7:"rgba(38,40,59,1.0)",8:"rgba(41,43,63,1.0)",9:"rgba(44,46,67,1.0)",10:"rgba(47,49,71,1.0)",11:"rgba(50,52,75,1.0)",12:"rgba(53,55,79,1.0)",13:"rgba(56,58,83,1.0)",14:"rgba(59,61,87,1.0)",15:"rgba(62,64,91,1.0)",16:"rgba(57,63,87,1.0)"}},paletteExt:{primary:{hover:"rgba(142, 86, 252, 0.08)",selected:"rgba(142, 86, 252, 0.16)",focus:"rgba(142, 86, 252, 0.12)",focusVisible:"rgba(142, 86, 252, 0.3)",outlineBorder:"rgba(142, 86, 252, 0.5)"},secondary:{tonal:"rgba(255,255,255,0.1)"}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:"none",msOverflowStyle:"none"},"html:hover, body:hover, *:hover":{scrollbarWidth:"thin",scrollbarColor:`${e.palette.divider} transparent`}}},MuiButton:{styleOverrides:{root:{textTransform:"none",borderRadius:"10px"}},variants:[{props:{color:"secondary",variant:"contained"},style:{border:`1px solid ${e.palette.divider}`,background:(a=(r=(t=e.paletteExt)==null?void 0:t.secondary)==null?void 0:r.tonal)==null?void 0:a.toString()}},{props:{color:"secondary",variant:"outlined"},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:"none",color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:(n=e.palette.backgroundPaperElevation)==null?void 0:n[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:"10px 0 0 10px"},".MuiToggleButtonGroup-lastButton":{borderRadius:"0 10px 10px 0"}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:"none",padding:"6px 16px"}}},MuiSelect:{variants:[{props:{variant:"filled"},style:{borderRadius:"10px","::before, ::after":{visibility:"collapse"},".MuiInputBase-input":{padding:"6px 16px",borderRadius:"10px"}}}]},MuiDrawer:{styleOverrides:{paper:{border:"none",boxShadow:"4px 0 8px -4px rgba(0, 0, 0, 0.3)"}}},MuiFab:{styleOverrides:{root:{background:(s=(o=e.paletteExt)==null?void 0:o.secondary)==null?void 0:s.tonal}},variants:[{props:{color:"primary"},style:{background:e.palette.primary.main}}]}},componentsExt:{JoggingPanel:{JoggingCartesian:{Axis:{X:{backgroundColor:"rgba(215, 66, 56, 1)",borderColor:"rgba(215, 66, 56, 1)",buttonBackgroundColor:{default:"rgba(241, 77, 66, 1)",pressed:"rgba(138, 41, 35, 1)",hovered:"rgba(241, 77, 66, 1)",disabled:"rgba(241, 77, 66, 1)"},color:"rgba(255, 198, 198, 1)",labelColor:e.palette.text.primary},Y:{backgroundColor:"rgba(20, 151, 108, 1)",borderColor:"rgba(20, 151, 108, 1)",buttonBackgroundColor:{default:"rgba(28, 188, 135, 1)",pressed:"rgba(11, 89, 63, 1)",disabled:"rgba(28, 188, 135, 1)",hovered:"rgba(28, 188, 135, 1)"},color:"rgba(215, 255, 242, 1)",labelColor:e.palette.text.primary},Z:{backgroundColor:"rgba(1, 87, 155, 1)",borderColor:"rgba(1, 87, 155, 1)",buttonBackgroundColor:{default:"rgba(2, 136, 209, 1)",pressed:"rgba(2, 64, 114, 1)",disabled:"rgba(2, 136, 209, 1)",hovered:"rgba(2, 136, 209, 1)"},color:"rgba(210, 239, 255, 1)",labelColor:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}},WandelscriptEditor:{monacoTheme:{base:"vs-dark",inherit:!0,rules:[{token:"keyword",foreground:"#b349a9ff"}],colors:{"editor.background":F.rgbToHex(((l=e.palette.backgroundPaperElevation)==null?void 0:l[5])??""),"editor.foreground":"#d4d4d4","editorLineNumber.foreground":"#797979","editorLineNumber.activeForeground":"#e9e9e9","editor.lineHighlightBorder":"#e9e9e911"}}}}}}function Bw(){const e=Tc();return e.palette.mode="light",e}function Fw(e){var a,n,o,s;let t=!0;((a=e.palette)==null?void 0:a.mode)==="light"?t=!1:((n=e.palette)==null?void 0:n.mode)!=="dark"&&(t=!(typeof window<"u"&&((s=(o=window.matchMedia)==null?void 0:o.call(window,"(prefers-color-scheme: light)"))==null?void 0:s.matches)));const r=t?Tc():Bw();return ni(r,e)}exports.JoggingCartesianAxisControl=no;exports.JoggingJointRotationControl=di;exports.JoggingPanel=zO;exports.JoggingStore=Cn;exports.LoadingCover=Lo;exports.LoadingErrorMessage=tc;exports.NoMotionGroupModal=WO;exports.PoseCartesianValues=qO;exports.PoseJointValues=JO;exports.PresetEnvironment=Yc;exports.Robot=iw;exports.SafetyBar=Ew;exports.SafetyZonesRenderer=ed;exports.SelectableFab=jw;exports.SupportedRobot=Ac;exports.TrajectoryRenderer=td;exports.ValueInterpolator=qo;exports.VelocitySlider=wc;exports.VelocitySliderLabel=Go;exports.WandelscriptEditor=Lw;exports.createNovaMuiTheme=Fw;exports.defaultAxisConfig=QO;exports.defaultGetModel=Jo;exports.i18n=jo;exports.useAnimationFrame=gr;exports.useAutorun=oi;exports.useInterpolation=KO;exports.useMounted=ln;exports.useReaction=si;
|
|
107
107
|
//# sourceMappingURL=index.cjs.map
|