@wandelbots/wandelbots-js-react-components 5.6.1 → 5.7.0-pr.feat-design-tokens.616.fff06df

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.
@@ -0,0 +1,4 @@
1
+ "use strict";const o=require("react/jsx-runtime"),D=require("@mui/material/styles"),Ke=require("@mui/material/AppBar"),Ae=require("@mui/material/Backdrop"),T=require("@mui/material/Box"),G=require("@mui/material/IconButton"),et=require("@mui/material/Menu"),H=require("@mui/material/MenuItem"),tt=require("@mui/material/Toolbar"),R=require("@mui/material/Typography"),O=require("mobx-react-lite"),h=require("react"),L=require("./externalizeComponent-OO4jcrz5.cjs"),nt=require("@mui/material/SvgIcon"),N=require("@mui/material/Fade"),ot=require("@mui/x-charts/Gauge"),B=require("react-i18next"),ee=require("./interpolation-C9sLsved.cjs"),it=require("@mui/icons-material/Clear"),rt=require("@mui/icons-material/FilterList"),Ie=require("@mui/icons-material/Search"),q=require("@mui/material/Divider"),z=require("@mui/x-data-grid"),at=require("@mui/icons-material/OpenWith"),st=require("@mui/icons-material/Share"),_=require("@mui/material/Stack"),Oe=require("@mui/material/Tab"),De=require("@mui/material/Tabs"),V=require("@wandelbots/nova-js/v2"),he=require("lodash-es"),k=require("mobx"),J=require("@wandelbots/nova-js"),ue=require("three/src/math/Vector3.js"),Je=require("@mui/material/CircularProgress"),lt=require("@mui/material/utils"),ct=require("./SafetyBar-VvOZ9aRM.cjs"),ut=require("@mui/material/Alert"),dt=require("@mui/material/AlertTitle"),Y=require("@mui/material/Button"),Me=require("@mui/material/ToggleButton"),W=require("./robot-SEtfVAmf.cjs"),gt=require("lodash-es/isEqual.js"),pt=require("@mui/material/InputAdornment"),ht=require("@mui/material/FormControl"),mt=require("@mui/material/InputLabel"),ft=require("@mui/material/Select"),oe=require("lodash-es/keyBy.js"),xt=require("lodash-es/uniqueId.js"),bt=require("@mui/material/ToggleButtonGroup"),Fe=require("@mui/material/Slider"),yt=require("lodash-es/isNumber.js"),St=require("@mui/icons-material/ChevronLeft"),jt=require("@mui/icons-material/ChevronRight"),Ct=require("lodash-es/throttle.js"),vt=require("@mui/material/Tooltip"),Tt=require("@mui/icons-material/ContentCopy"),wt=require("@mui/icons-material/DescriptionOutlined"),It=require("@mui/icons-material/ExpandLess"),Mt=require("@mui/icons-material/ExpandMore"),kt=require("@mui/material/Paper"),Rt=require("@mui/material/Dialog"),Et=require("@mui/material/DialogActions"),Pt=require("@mui/material/DialogContent"),_t=require("@mui/material/DialogTitle"),At=require("@mui/icons-material/Error"),Ot=require("@mui/material/Chip"),Dt=require("@mui/material/Fab"),Jt=require("@mui/material/Badge"),Ft=require("@mui/x-charts"),de=require("three"),Lt=require("@wandelbots/design-tokens/mui"),U=require("@wandelbots/design-tokens");require("@mui/x-data-grid/themeAugmentation");function Bt(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const ke=Bt(de),zt=t=>o.jsx(nt,{...t,viewBox:"0 0 10 8",children:o.jsx("path",{d:"M8.825 0.9125L5 4.72917L1.175 0.9125L0 2.0875L5 7.0875L10 2.0875L8.825 0.9125Z",fill:"currentColor",fillOpacity:"0.56"})}),$t=L.externalizeComponent(O.observer(t=>{const{appIcon:e,appName:n,apps:a=[],onAppSelect:r,disabled:i=!1,sx:c}=t,[s,l]=h.useState(null),u=!!s,m=d=>{l(d.currentTarget)},g=()=>{l(null)},p=d=>{g(),d.onClick?d.onClick():d.href&&(window.location.href=d.href),r==null||r(d)};return o.jsxs(o.Fragment,{children:[o.jsx(Ke,{position:"static",sx:{boxShadow:"none",backgroundImage:"none","& .MuiAppBar-root":{backgroundImage:"none",backgroundColor:"transparent"},...c},children:o.jsxs(tt,{sx:{minHeight:"62px !important"},children:[o.jsx(T,{sx:{mr:1,display:"flex",alignItems:"center"},children:e}),o.jsxs(T,{sx:{display:"flex",alignItems:"center",flexGrow:1},children:[o.jsx(R,{component:"h1",sx:{fontWeight:"bold",fontSize:"1rem"},children:n}),a.length>0&&o.jsx(G,{color:"inherit","aria-label":"switch app","aria-controls":"app-menu","aria-haspopup":"true",onClick:m,disabled:i,sx:{ml:1,width:28,height:28,borderRadius:"6px",padding:0,backgroundColor:d=>D.alpha(d.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:d=>D.alpha(d.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:"8px",width:"8px",height:"6px"}},children:o.jsx(zt,{})})]})]})}),o.jsx(Ae,{open:u,onClick:g,sx:{backdropFilter:"blur(4px)",backgroundColor:"rgba(0, 0, 0, 0.3)",zIndex:d=>d.zIndex.modal-1}}),o.jsx(et,{id:"app-menu",anchorEl:s,open:u,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},sx:{zIndex:d=>d.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:a.map(d=>o.jsxs(H,{onClick:()=>p(d),children:[o.jsx(T,{sx:{display:"flex",alignItems:"center"},children:d.icon}),o.jsx(R,{variant:"body1",sx:{ml:2},children:d.name})]},d.id))})]})})),Vt=t=>{const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),r=t%60,i=[];return e>0?(i.push(e.toString()),i.push(n.toString().padStart(2,"0")),i.push(a.toString().padStart(2,"0")),i.push(r.toString().padStart(2,"0"))):n>0?(i.push(n.toString()),i.push(a.toString().padStart(2,"0")),i.push(r.toString().padStart(2,"0"))):(i.push(a.toString()),i.push(r.toString().padStart(2,"0"))),i.join(":")},$=(t,e)=>{const n=Math.floor(t/86400),a=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),i=t%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const s={};return n>0&&(s.days=n),a>0&&(s.hours=a),r>0&&(s.minutes=r),(i>0||Object.keys(s).length===0)&&(s.seconds=i),new Intl.DurationFormat(e,{style:"narrow"}).format(s)}catch{}const c=[];return n>0&&c.push(`${n}d`),a>0&&c.push(`${a}h`),r>0&&c.push(`${r}m`),(i>0||c.length===0)&&c.push(`${i}s`),c.join(" ")},qt=(t,e,n)=>t==="countdown"&&n!==null?Math.min(100,e/n*100):t==="measuring"?e/60%1*100:0,Nt=({timerState:t,animationState:e,hasError:n,className:a})=>{var x,v;const{t:r,i18n:i}=B.useTranslation(),c=D.useTheme(),{currentState:s,remainingTime:l,maxTime:u,currentProgress:m}=t,{showErrorAnimation:g,showPauseAnimation:p,showPulsatingText:d,pulsatingFinished:b,showLabels:S,showMainText:y,showIdlePulsating:f,idleDotsCount:j}=e;return o.jsxs(T,{className:a,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[o.jsx(ot.Gauge,{width:264,height:264,value:s==="idle"?0:m,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:p||g?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?c.palette.error.light:c.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:(x=c.palette.backgroundPaperElevation)==null?void 0:x[2],stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),o.jsxs(T,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:(v=c.palette.backgroundPaperElevation)==null?void 0:v[8],display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:[o.jsx(T,{sx:{height:"16px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:1},children:o.jsx(N,{in:S&&!n&&s!=="idle"&&s!=="success",timeout:300,children:o.jsx(R,{variant:"body2",sx:{fontSize:"12px",color:s==="measured"&&(d||b)?c.palette.success.main:c.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:o.jsx("span",{style:{opacity:s==="measured"&&b?d?1:.6:1,transition:"opacity 2s ease-in-out"},children:s==="measuring"||s==="measured"?r("CycleTimer.CycleTime.lb","Cycle Time"):s==="countdown"?r("CycleTimer.RemainingTime.lb","Remaining Time"):""})})})}),o.jsxs(T,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[o.jsx(N,{in:y&&s==="idle"&&!n,timeout:200,children:o.jsxs(R,{variant:"body2",sx:{position:"absolute",fontSize:"12px",fontWeight:400,color:c.palette.text.secondary,lineHeight:"166%",letterSpacing:"0.17px",textAlign:"center",width:"200px",height:"20px",display:"flex",alignItems:"center",justifyContent:"center"},children:[o.jsx("span",{style:{opacity:f?1:.6,transition:"opacity 2s ease-in-out"},children:r("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),o.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left",opacity:f?1:.6,transition:"opacity 2s ease-in-out"},children:".".repeat(j)})]})}),o.jsx(N,{in:y&&n,timeout:200,children:o.jsx(R,{variant:"h3",sx:{position:"absolute",fontSize:"40px",fontWeight:400,color:c.palette.text.primary,lineHeight:"116.7%"},children:r("CycleTimer.Error.lb","Error")})}),o.jsx(N,{in:y&&!n&&s!=="idle"&&s!=="success",timeout:300,children:o.jsx(R,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:c.palette.text.primary,lineHeight:1,transition:"color 0.8s ease-in-out"},children:o.jsx("span",{style:{opacity:1,transition:"opacity 2s ease-in-out"},children:Vt(l)})})})]}),o.jsx(T,{sx:{height:"16px",display:"flex",marginTop:.5,alignItems:"center",justifyContent:"center"},children:o.jsx(N,{in:S&&!n&&s!=="idle"&&s!=="success",timeout:300,children:o.jsx(R,{variant:"body2",sx:{fontSize:"12px",color:s==="measured"&&(d||b)?c.palette.success.main:c.palette.text.secondary,transition:"color 0.8s ease-in-out"},children:o.jsx("span",{style:{opacity:s==="measured"&&b?d?1:.6:1,transition:"opacity 2s ease-in-out"},children:s==="measuring"?r("CycleTimer.Measuring.lb","measuring..."):s==="measured"?r("CycleTimer.Determined.lb","determined"):s==="countdown"&&u!==null?r("CycleTimer.OfTime.lb",{time:$(u,i.language)}):""})})})})]})]})},Wt=({timerState:t,animationState:e,hasError:n,compact:a,className:r})=>{const{t:i,i18n:c}=B.useTranslation(),s=D.useTheme(),{currentState:l,remainingTime:u,maxTime:m}=t,{showErrorAnimation:g,showPauseAnimation:p,showPulsatingText:d,pulsatingFinished:b,showIdlePulsating:S,idleDotsCount:y}=e;return a&&l==="idle"?o.jsx(T,{className:r,sx:{display:"flex",alignItems:"center",m:0},children:o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:s.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?i("CycleTimer.Error.lb","Error"):l==="idle"?"0s":$(u,c.language)})}):o.jsxs(T,{className:r,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[!(l==="idle"&&a)&&o.jsx(T,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:p||g?.6:1,transition:"opacity 0.5s ease-out"},children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:l==="measured"?d||b?s.palette.success.main:s.palette.text.secondary:s.palette.success.main,strokeWidth:"2",opacity:l==="measured"&&b?d?1:.6:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:l==="measured"?d||b?s.palette.success.main:s.palette.text.secondary:s.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-(l==="idle"?0:t.currentProgress)/100)}`,style:{opacity:l==="measured"&&b?d?1:.6:1,transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:l==="idle"?s.palette.text.secondary:l==="measured"?d||b?s.palette.success.main:s.palette.text.secondary:s.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",opacity:l==="idle"?S?1:.6:l==="measured"&&b?d?1:.6:1,transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?i("CycleTimer.Error.lb","Error"):l==="idle"?o.jsxs(o.Fragment,{children:[o.jsx("span",{children:i("CycleTimer.WaitingForCycle.lb","Waiting for program cycle")}),o.jsx("span",{style:{display:"inline-block",width:"18px",textAlign:"left"},children:".".repeat(y)})]}):l==="measuring"?a?$(u,c.language):`${$(u,c.language)} / ${i("CycleTimer.Measuring.lb","measuring...")}`:l==="measured"?a?$(u,c.language):`${$(u,c.language)} / ${i("CycleTimer.Determined.lb","determined")}`:l==="countdown"&&m!==null?a?$(u,c.language):`${$(u,c.language)} / ${i("CycleTimer.Time.lb",{time:$(m,c.language)})}`:$(u,c.language)})]})},Gt=()=>{const[t,e]=h.useState({showPauseAnimation:!1,showErrorAnimation:!1,showPulsatingText:!1,pulsatingFinished:!1,showLabels:!0,showMainText:!0,showIdlePulsating:!1,idleDotsCount:0}),n=h.useRef(null),a=h.useRef(null),r=h.useRef(null),i=h.useRef(null),c=h.useRef(0),s=h.useRef(null),l=h.useRef(null),u=h.useCallback(()=>{e(x=>({...x,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(x=>({...x,showPauseAnimation:!1}))},800)},[]),m=h.useCallback(()=>{e(x=>({...x,showErrorAnimation:!0})),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{e(x=>({...x,showErrorAnimation:!1}))},600)},[]),g=h.useCallback(()=>{e(x=>({...x,showErrorAnimation:!1})),a.current&&clearTimeout(a.current)},[]),p=h.useCallback(x=>{c.current=0,e(v=>({...v,showPulsatingText:!0,pulsatingFinished:!1})),setTimeout(()=>{e(v=>({...v,pulsatingFinished:!0})),r.current=setInterval(()=>{e(v=>({...v,showPulsatingText:!v.showPulsatingText}))},2e3),x&&x()},800)},[]),d=h.useCallback(()=>{r.current&&(clearInterval(r.current),r.current=null),e(x=>({...x,showPulsatingText:!1,pulsatingFinished:!1})),c.current=0},[]),b=h.useCallback(()=>{e(x=>({...x,showIdlePulsating:!0})),s.current=setInterval(()=>{e(x=>({...x,showIdlePulsating:!x.showIdlePulsating}))},2e3),l.current=setInterval(()=>{e(x=>({...x,idleDotsCount:(x.idleDotsCount+1)%4}))},800)},[]),S=h.useCallback(()=>{s.current&&(clearInterval(s.current),s.current=null),l.current&&(clearInterval(l.current),l.current=null),e(x=>({...x,showIdlePulsating:!1,idleDotsCount:0}))},[]),y=h.useCallback(()=>{e(x=>({...x,showLabels:!1,showMainText:!1})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{e(x=>({...x,showLabels:!0,showMainText:!0}))},200)},[]),f=h.useCallback(()=>{e(x=>({...x,showLabels:!0,showMainText:!0}))},[]),j=h.useCallback(()=>{n.current&&clearTimeout(n.current),a.current&&clearTimeout(a.current),i.current&&clearTimeout(i.current),r.current&&clearInterval(r.current),s.current&&clearInterval(s.current),l.current&&clearInterval(l.current)},[]);return{animationState:t,triggerPauseAnimation:u,triggerErrorAnimation:m,clearErrorAnimation:g,startPulsatingAnimation:p,stopPulsatingAnimation:d,startIdleAnimations:b,stopIdleAnimations:S,triggerFadeTransition:y,setInitialAnimationState:f,cleanup:j}},Ut=({autoStart:t,onCycleEnd:e,onMeasuringComplete:n,hasError:a,onPauseAnimation:r,onErrorAnimation:i,onClearErrorAnimation:c,onStartPulsating:s})=>{const[l,u]=h.useState({currentState:"idle",remainingTime:0,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),m=h.useRef(null),g=h.useRef(null),p=h.useRef(0),[d]=ee.useInterpolation([0],{tension:80,friction:18,onChange:([C])=>{u(w=>({...w,currentProgress:C}))}}),b=h.useCallback(()=>{u(C=>({...C,currentState:"idle",maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0})),p.current=0,g.current=null,d.setImmediate([0])},[d]),S=h.useCallback((C=0)=>{const w=C/60%1*100;u(I=>({...I,currentState:"measuring",maxTime:null,remainingTime:C,isPausedState:!1,currentProgress:w})),p.current=0,d.setImmediate([w]),t?(g.current=Date.now()-C*1e3,u(I=>({...I,isRunning:!0}))):g.current=null},[t,d]),y=h.useCallback((C,w=0)=>{u(M=>({...M,isRunning:!1})),g.current=null,u(M=>({...M,currentState:"countdown",maxTime:C,isPausedState:!1})),p.current=0;const I=Math.max(0,C-w),E=w>0?w/C*100:0;u(M=>({...M,remainingTime:I,currentProgress:E})),d.setImmediate([E]),I===0?(u(M=>({...M,isRunning:!1})),g.current=null,e&&queueMicrotask(()=>e())):t?setTimeout(()=>{g.current=Date.now()-w*1e3,u(M=>({...M,isRunning:!0}))},0):g.current=null},[t,e,d]),f=h.useCallback(()=>{u(C=>({...C,isRunning:!1,currentState:"measured"})),g.current=null,s(()=>{n&&n()})},[s,n]),j=h.useCallback(()=>{if(g.current&&l.isRunning){const w=Date.now()-g.current;p.current+=w;const I=p.current/1e3,E=qt(l.currentState,I,l.maxTime);d.setTarget([E])}u(C=>({...C,isRunning:!1,isPausedState:!0})),r()},[l.isRunning,l.currentState,l.maxTime,d,r]),x=h.useCallback(()=>{l.isPausedState&&(l.remainingTime>0||l.currentState!=="countdown")&&(g.current=Date.now(),u(C=>({...C,isRunning:!0,isPausedState:!1})))},[l.isPausedState,l.remainingTime,l.currentState]),v=h.useCallback(()=>l.isPausedState,[l.isPausedState]);return h.useEffect(()=>{a?(l.isRunning&&!l.isPausedState&&(u(C=>({...C,wasRunningBeforeError:!0})),j()),i()):(l.wasRunningBeforeError&&l.isPausedState&&(u(C=>({...C,wasRunningBeforeError:!1})),x()),c())},[a,l.isRunning,l.isPausedState,l.wasRunningBeforeError,j,x,i,c]),h.useEffect(()=>{if(l.isRunning){const C=()=>{if(g.current){const I=(Date.now()-g.current+p.current)/1e3;if(l.currentState==="countdown"&&l.maxTime!==null){const E=Math.max(0,l.maxTime-I);u(P=>({...P,remainingTime:Math.ceil(E)}));const M=Math.min(100,I/l.maxTime*100);if(d.setTarget([M]),E<=0){u(P=>({...P,isRunning:!1,remainingTime:0})),g.current=null,d.setTarget([100]),e&&queueMicrotask(()=>e());return}}else if(l.currentState==="measuring"){u(M=>({...M,remainingTime:Math.floor(I)}));const E=I/60%1*100;d.setTarget([E])}l.isRunning&&(m.current=requestAnimationFrame(C))}};m.current=requestAnimationFrame(C)}else m.current&&(cancelAnimationFrame(m.current),m.current=null);return()=>{m.current&&cancelAnimationFrame(m.current)}},[l.isRunning,e,l.currentState,l.maxTime,d]),h.useEffect(()=>{let C=null;const w=()=>{d.update(1/60),C=requestAnimationFrame(w)};return C=requestAnimationFrame(w),()=>{C&&cancelAnimationFrame(C)}},[d]),{timerState:l,controls:{startNewCycle:y,startMeasuring:S,setIdle:b,completeMeasuring:f,pause:j,resume:x,isPaused:v}}},Ht=L.externalizeComponent(O.observer(({onCycleComplete:t,onCycleEnd:e,onMeasuringComplete:n,autoStart:a=!0,variant:r="default",compact:i=!1,className:c,hasError:s=!1})=>{const l=h.useRef(void 0),{animationState:u,triggerPauseAnimation:m,triggerErrorAnimation:g,clearErrorAnimation:p,startPulsatingAnimation:d,stopPulsatingAnimation:b,startIdleAnimations:S,stopIdleAnimations:y,triggerFadeTransition:f,setInitialAnimationState:j,cleanup:x}=Gt(),{timerState:v,controls:C}=Ut({autoStart:a,onCycleEnd:e,onMeasuringComplete:n,hasError:s,onPauseAnimation:m,onErrorAnimation:g,onClearErrorAnimation:p,onStartPulsating:d});return h.useEffect(()=>{const w=l.current;l.current!==void 0&&w!==v.currentState?(w==="measured"&&b(),w==="idle"&&y(),f()):j(),v.currentState==="idle"&&S(),l.current=v.currentState},[v.currentState,b,y,S,f,j]),h.useEffect(()=>{let w=!0;const I=setTimeout(()=>{w&&t(C)},0);return()=>{w=!1,clearTimeout(I)}},[t,C]),h.useEffect(()=>x,[x]),r==="small"?o.jsx(Wt,{timerState:v,animationState:u,hasError:s,compact:i,className:c}):o.jsx(Nt,{timerState:v,animationState:u,hasError:s,className:c})})),Le=L.externalizeComponent(O.observer(({data:t,columns:e,getRowData:n,onRowClick:a,selectedItem:r,getItemId:i,title:c,showCount:s=!0,searchPlaceholder:l="Search programs",dataGridProps:u,CustomToolbar:m,selectFirstByDefault:g=!1,sx:p})=>{var E;const d=D.useTheme(),b=z.useGridApiRef(),S=h.useRef(null),[y,f]=h.useState(null),j=h.useMemo(()=>t.map(n),[t,n]);h.useEffect(()=>{b.current&&j.length>0&&b.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:e.map(M=>M.field)})},[j,e,b]),h.useEffect(()=>{if(!S.current||!b.current)return;const M=new ResizeObserver(()=>{setTimeout(()=>{b.current&&j.length>0&&b.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:e.map(P=>P.field)})},100)});return M.observe(S.current),()=>{M.disconnect()}},[b,j.length,e]);const x=h.useMemo(()=>{if(r!==void 0)return r;if(y!==null)return y;if(g&&t.length>0){const M=t[0];return f(M),M}return null},[g,t,r,y]),v=M=>{const P=t.find(F=>n(F).id===M.id);P&&(r===void 0&&f(P),a&&a(P,M))},C=h.useMemo(()=>!x||!i?null:i(x),[x,i]);function w(){return o.jsx(z.Toolbar,{children:o.jsxs(T,{sx:{display:"flex",width:"100%",gap:1,p:.5,alignItems:"center"},children:[c&&o.jsxs(R,{variant:"h6",sx:{fontWeight:500,color:"white"},children:[c,s&&` (${t.length})`]}),o.jsxs(T,{sx:{ml:"auto",display:"flex",gap:.5,alignItems:"center",pr:1},children:[o.jsx(z.FilterPanelTrigger,{render:o.jsx(z.ToolbarButton,{"aria-label":"Show filters",children:o.jsx(rt,{fontSize:"small"})})}),o.jsx(q,{orientation:"vertical",flexItem:!0,sx:{height:"24px",alignSelf:"center"}}),o.jsx(z.QuickFilter,{render:(M,P)=>{var F;return o.jsxs(T,{...M,sx:{display:"flex",overflow:"hidden"},children:[!P.expanded&&o.jsx(z.QuickFilterTrigger,{render:o.jsx(z.ToolbarButton,{"aria-label":"Search",children:o.jsx(Ie,{fontSize:"small"})})}),o.jsxs(T,{sx:{display:"flex",overflow:"hidden",transition:"all 0.3s ease-in-out",width:P.expanded?"200px":"0px",position:"relative"},children:[o.jsxs(T,{sx:{flex:1,position:"relative","& .MuiInputBase-root":{height:"32px",borderRadius:"16px",backgroundColor:(F=d.palette.backgroundPaperElevation)==null?void 0:F[2],paddingLeft:"40px",paddingRight:P.expanded&&P.value!==""?"40px":"12px",color:"white",fontSize:"14px",border:"none !important",outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"},"&:hover":{"&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&:focus-within":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"&.Mui-focused":{outline:"none !important",boxShadow:"none !important","&::before":{display:"none !important",border:"none !important"},"&::after":{display:"none !important",border:"none !important"}},"& .MuiInputBase-input":{padding:"8px 0",border:"none !important",outline:"none !important",boxShadow:"none !important","&:focus":{outline:"none !important",boxShadow:"none !important",border:"none !important"},"&::placeholder":{color:"rgba(255, 255, 255, 0.3)",opacity:1}},"& fieldset":{border:"none !important",display:"none !important"},"& .MuiOutlinedInput-notchedOutline":{border:"none !important",display:"none !important"}}},children:[P.expanded&&o.jsx(Ie,{fontSize:"small",sx:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"rgba(255, 255, 255, 0.6)",zIndex:1,pointerEvents:"none"}}),o.jsx(z.QuickFilterControl,{placeholder:l})]}),P.expanded&&P.value!==""&&o.jsx(z.QuickFilterClear,{render:o.jsx(T,{sx:{position:"absolute",right:"8px",top:"50%",transform:"translateY(-50%)",zIndex:1},children:o.jsx(T,{sx:{minWidth:"24px",width:"24px",height:"24px",padding:0,color:"rgba(255, 255, 255, 0.6)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.1)"}},children:o.jsx(z.ToolbarButton,{"aria-label":"Clear",children:o.jsx(it,{fontSize:"small"})})})})})]})]})}})]})]})})}const I=m||w;return o.jsx(T,{ref:S,sx:{height:"100%",display:"flex",flexDirection:"column","& *":{scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},"&:hover *":{scrollbarWidth:"thin",scrollbarColor:`${d.palette.divider} transparent`,"&::-webkit-scrollbar":{display:"block",width:"8px",height:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:d.palette.divider,borderRadius:"4px"},"&::-webkit-scrollbar-thumb:hover":{background:d.palette.action.hover}},...p},children:o.jsx(z.DataGrid,{apiRef:b,rows:j,columns:e,onRowClick:v,disableColumnMenu:!1,disableRowSelectionOnClick:!0,disableMultipleRowSelection:!0,hideFooterSelectedRowCount:!0,filterMode:"client",sortingOrder:["desc","asc"],hideFooter:!1,showToolbar:!0,slots:{toolbar:I},initialState:{sorting:{sortModel:[]},filter:{filterModel:{items:[]}},...u==null?void 0:u.initialState},...u,autosizeOnMount:!0,autosizeOptions:{...(u==null?void 0:u.autosizeOptions)||{},includeOutliers:!0,includeHeaders:!0,expand:!0,columns:((E=u==null?void 0:u.autosizeOptions)==null?void 0:E.columns)||e.map(M=>M.field)},sx:{border:"none",width:"100%","& .MuiPaper-root":{boxShadow:"none !important"},"& .MuiDataGrid-overlay":{},"& .MuiDataGrid-main":{border:"none","& .MuiPaper-root":{}},"& .MuiDataGrid-container--top [role=row]":{},"& .MuiDataGrid-topContainer":{borderBottom:"none !important"},"& .MuiDataGrid-columnHeaders":{border:"none",borderBottom:"none !important"},"& .MuiDataGrid-row":{cursor:a?"pointer":"default",border:"none",margin:"1px 0",position:"relative",backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:"action.hover",borderRadius:"16px",zIndex:0}},"&.Mui-selected":{backgroundColor:"transparent !important","&:hover":{backgroundColor:"transparent !important"}},...C!==null&&{[`&[data-id="${C}"]`]:{backgroundColor:"transparent !important","&::before":{content:'""',position:"absolute",top:0,left:"16px",right:"16px",bottom:0,backgroundColor:`${d.palette.action.hover} !important`,borderRadius:"16px",zIndex:0},"&:hover":{backgroundColor:"transparent !important"},"&:hover::before":{backgroundColor:`${d.palette.divider} !important`}}}},"& .MuiDataGrid-cell--textLeft":{paddingLeft:"40px"},"& .MuiDataGrid-cell":{border:"none",position:"relative",zIndex:1,"&:focus":{outline:"none"},"&:focus-within":{outline:"none"},"&:hover":{backgroundColor:"transparent !important"}},"& .MuiDataGrid-columnHeader":{border:"none",paddingLeft:"40px",paddingRight:"40px","& .MuiDataGrid-columnHeaderTitle":{color:"rgba(255, 255, 255, 0.6)"}},"& .MuiDataGrid-toolbarContainer":{padding:"8px",border:"none !important",borderBottom:"none !important","& .MuiBox-root":{},"& .MuiFormControl-root":{},"& .MuiInputBase-root":{},"& .MuiPaper-root":{boxShadow:"none !important"},"& *":{borderBottom:"none !important"}},"& .MuiDataGrid-toolbar":{borderBottom:"none !important"},"& .MuiDataGrid-toolbarFilterList":{border:"none"},"& .MuiDataGrid-withBorderColor":{borderColor:"transparent !important"},"& .MuiDataGrid-columnSeparator":{display:"none"},"& .MuiDataGrid-footerContainer":{display:"none"},"& .MuiDataGrid-filler":{border:"none !important",borderTop:"none !important",borderBottom:"none !important",borderLeft:"none !important",borderRight:"none !important","--rowBorderColor":"none !important"},"& .MuiBackdrop-root":{},"& .MuiModal-backdrop":{},...u==null?void 0:u.sx}})})}));Le.displayName="WandelbotsDataGrid";const ge=L.externalizeComponent(O.observer(({colors:t,label:e,getDisplayedValue:n,startJogging:a,stopJogging:r,disabled:i,activeJoggingDirection:c,...s})=>{var x,v,C,w,I,E,M;ee.useAnimationFrame(()=>{const P=n(),F=p.current;F&&(F.textContent=P)});const l=D.useTheme(),[u,m]=h.useState(null);h.useEffect(()=>{i&&j()},[i]);const g=c||u,p=h.useRef(null);t||(t={color:"#fff",backgroundColor:"#000",borderColor:"#000",buttonBackgroundColor:{disabled:"#000",default:"#000",hovered:"#000",pressed:"#000"},labelColor:"#000"});const d=g?(x=t.buttonBackgroundColor)==null?void 0:x.pressed:t.borderColor,b={width:"55px",color:t.color,path:{fill:t.color},alignContent:"center",fontSize:"37px",svg:{pointerEvents:"none"}},S={...b,backgroundColor:(v=t.buttonBackgroundColor)==null?void 0:v.default,":hover":{backgroundColor:(C=t.buttonBackgroundColor)==null?void 0:C.hovered},":active":{backgroundColor:(w=t.buttonBackgroundColor)==null?void 0:w.pressed,color:t.backgroundColor,path:{fill:t.backgroundColor}},":disabled":{backgroundColor:(I=t.buttonBackgroundColor)==null?void 0:I.disabled,"svg path":{fill:l.palette.action.disabled}}},y={...b,backgroundColor:(E=t.buttonBackgroundColor)==null?void 0:E.pressed,color:t.backgroundColor,path:{fill:t.backgroundColor},":disabled":{backgroundColor:(M=t.buttonBackgroundColor)==null?void 0:M.pressed,"svg path":{fill:l.palette.action.disabled}}};function f(P,F){i||P.button===0&&(m(F),a(F))}function j(){m(null),r()}return o.jsxs(_,{height:"64px",direction:"row",justifyContent:"center",...s,children:[o.jsx(G,{disabled:i,disableRipple:!0,onPointerDown:P=>f(P,"-"),onPointerUp:j,onPointerOut:j,size:"large",sx:{...g==="-"?y:S,borderRadius:"16px 0px 0px 16px",borderLeft:`2px solid ${d??"#fff"}`,borderBottom:`2px solid ${d??"#fff"}`,borderTop:`2px solid ${d??"#fff"}`},children:o.jsx(W.ForwardRef$3,{})}),o.jsxs(_,{spacing:"6px",sx:{width:"150px",backgroundColor:t.backgroundColor,alignItems:"center",justifyContent:"center",opacity:"0.9",borderBottom:`2px solid ${d??"#fff"}`,borderTop:`2px solid ${d??"#fff"}`},children:[o.jsx(_,{height:"22px",direction:"row",alignItems:"center",justifyItems:"center",spacing:1,sx:{userSelect:"none",color:t.color,".MuiTypography-root":{fontWeight:700,...i?{color:l.palette.action.disabled}:{}},...i?{"svg path":{fill:l.palette.action.disabled}}:{}},children:e}),o.jsx(R,{height:"22px",sx:{fontSize:"15px",color:i?l.palette.action.disabled:t.color,fontWeight:700,fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center"},ref:p,children:n()})]}),o.jsx(G,{disableRipple:!0,disabled:i,onPointerDown:P=>f(P,"+"),onPointerUp:j,onPointerOut:j,size:"large",sx:{...g==="+"?y:S,borderRadius:"0px 16px 16px 0px",borderRight:`2px solid ${d??"#fff"}`,borderBottom:`2px solid ${d??"#fff"}`,borderTop:`2px solid ${d??"#fff"}`},children:o.jsx(W.ForwardRef$4,{})})]})})),Be=L.externalizeComponent(O.observer(({startJogging:t,stopJogging:e,lowerLimit:n,upperLimit:a,useDegree:r,getValue:i,disabled:c,...s})=>{var w,I,E,M,P,F,Z,ne,ye,Se,je,Ce,ve,Te,we;const{t:l}=B.useTranslation(),[u,m]=h.useState(),g=D.useTheme(),p={background:(w=g.palette.backgroundPaperElevation)==null?void 0:w[4],color:(I=g.palette.backgroundPaperElevation)==null?void 0:I[11]},d=O.useLocalObservable(()=>({activeJoggingDir:null,startJogging(A){this.activeJoggingDir=A,t(A)},stopJogging(){this.activeJoggingDir=null,e()}})),b=Ct(()=>{const A=r?S(i()):i();(A===void 0||u===void 0||Math.abs(u-A)>1e-9)&&m(A)},50);ee.useAnimationFrame(b);function S(A){if(A!==void 0)return J.radiansToDegrees(A)}function y(A){A.button===0&&d.startJogging("-")}function f(A){A.button===0&&d.startJogging("+")}function j(A){d.stopJogging()}function x(A){d.stopJogging()}function v(A,X=1){if(A===void 0||Number.isNaN(A))return"";const Q=l("General.degree.variable",{amount:A.toFixed(X)});return A>0&&X===0?`+${Q}`:Q}function C(A,X=1){if(A===void 0||Number.isNaN(A))return"";const Q=l("General.mm.variable",{amount:A.toFixed(X)});return A>0&&X===0?`+${Q}`:Q}return o.jsxs(_,{height:"64px",width:"100%",maxWidth:"260px",direction:"row",...s,sx:{"& .MuiIconButton-root":{width:"52px",color:g.palette.text.primary,alignContent:"center",backgroundColor:(E=g.palette.backgroundPaperElevation)==null?void 0:E[11],"& svg":{width:"42px",height:"42px"},"&.Mui-disabled":{backgroundColor:(M=g.palette.backgroundPaperElevation)==null?void 0:M[11],color:g.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:(P=g.palette.backgroundPaperElevation)==null?void 0:P[9]},"&:active":{...p}}},children:[o.jsx(G,{onPointerDown:y,onPointerUp:j,onPointerOut:x,disabled:c,disableRipple:!0,sx:{borderRadius:"16px 0px 0px 16px",...d.activeJoggingDir==="-"?p:{}},children:o.jsx(St,{sx:{pointerEvents:"none",color:(ye=(ne=(Z=(F=g.componentsExt)==null?void 0:F.JoggingPanel)==null?void 0:Z.JoggingJoint)==null?void 0:ne.Joint)==null?void 0:ye.arrowColor}})}),o.jsxs(_,{flexGrow:1,alignItems:"center",justifyContent:"center",sx:{borderStyle:"solid",borderLeftWidth:0,borderRightWidth:0,border:"none",backgroundColor:(Se=g.palette.backgroundPaperElevation)==null?void 0:Se[11],paddingLeft:"20px",paddingRight:"20px",zIndex:1},children:[o.jsx(R,{sx:{fontSize:"15px",fontWeight:700,position:"relative",top:"5px",fontVariantNumeric:"tabular-nums",minWidth:"80px",textAlign:"center",color:c?g.palette.action.disabled:g.palette.text.primary},children:r?v(u):C(u)}),o.jsx(Fe,{disabled:!0,"aria-label":"Joint position",min:r?S(n):n,max:r?S(a):a,value:u||0,track:!1,sx:{"& .MuiSlider-mark":{display:"none"},"& .MuiSlider-thumb":{width:"5px",height:"12px",borderRadius:"2px",color:c?g.palette.action.disabled:g.palette.text.primary},"& .MuiSlider-markLabel":{top:"20px",fontSize:"12px",color:c?g.palette.action.disabled:g.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:(je=g.palette.backgroundPaperElevation)==null?void 0:je[5],opacity:1}},marks:n!==void 0&&a!==void 0&&[{value:r?S(n):n,label:r?v(S(n),0):C(n)},{value:r?S(a):a,label:r?v(S(a),0):C(a)}]})]}),o.jsx(G,{onPointerDown:f,onPointerUp:j,onPointerOut:x,disabled:c,disableRipple:!0,sx:{borderRadius:"0px 16px 16px 0px",...d.activeJoggingDir==="+"?p:{}},children:o.jsx(jt,{sx:{pointerEvents:"none",color:(we=(Te=(ve=(Ce=g.componentsExt)==null?void 0:Ce.JoggingPanel)==null?void 0:ve.JoggingJoint)==null?void 0:Te.Joint)==null?void 0:we.arrowColor}})})]})}));function me(t,e,n){if(e.length!==t.length)return!0;for(let a=0;a<e.length;a++)if(Math.abs(e[a]-t[a])>n)return!1;return!0}function ze(t,e,n){if(t===void 0&&e||t&&e===void 0||(t==null?void 0:t.orientation)===void 0||(e==null?void 0:e.orientation)===void 0||(t==null?void 0:t.position)===void 0||(e==null?void 0:e.position)===void 0)return!1;if(t===void 0||e===void 0)return!0;let a=0;return a+=Math.abs(t.orientation[0]-e.orientation[0]),a+=Math.abs(t.orientation[1]-e.orientation[1]),a+=Math.abs(t.orientation[2]-e.orientation[2]),a+=Math.abs(t.position[0]-e.position[0]),a+=Math.abs(t.position[1]-e.position[1]),a+=Math.abs(t.position[2]-e.position[2]),a<=n}function fe(t,e,n){return t.coordinate_system===e.coordinate_system&&t.tcp===e.tcp&&ze(t.tcp_pose,e.tcp_pose,n)}function $e(t,e){const n=new de.Vector3(e[0],e[1],e[2]),a=new de.Vector3(t[0],t[1],t[2]),r=n.length(),i=n.normalize();let c=a.length(),s=a.normalize();s.dot(i)<0&&(c=-c,s=s.multiplyScalar(-1));let l=c-r;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),c=r+l,[...s.multiplyScalar(c)]}function Yt(t){return"cellId"in t.api}function re(t){if(!Yt(t))return t;const e=t,n=e.api.cellId,a=new Proxy(e.api,{get(r,i){const c=Reflect.get(r,i);return!c||typeof c!="object"?c:new Proxy(c,{get(s,l){const u=Reflect.get(s,l);return typeof u!="function"?u:(...m)=>m.length>0&&m[0]===n?u.apply(s,m.slice(1)):u.apply(s,m)}})}});return new Proxy(e,{get(r,i){return i==="api"?a:i==="openReconnectingWebsocket"?c=>r.openReconnectingWebsocket(c.replace(/^\/cells\/[^/]+/,"")):Reflect.get(r,i)}})}const Re=1e-4;class se{constructor(e,n,a,r,i,c,s="cell"){this.controller=n,this.motionGroup=a,this.description=r,this.initialMotionState=i,this.motionStateSocket=c,this.cellId=s,this.nova=re(e),this.rapidlyChangingMotionState=i,c.addEventListener("message",l=>{var p;const u=(p=J.tryParseJson(l.data))==null?void 0:p.result;if(!u)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${l.data}`);me(this.rapidlyChangingMotionState.joint_position,u.joint_position,Re)||k.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=u.joint_position}),fe(this.rapidlyChangingMotionState,u,Re)||k.runInAction(()=>{var d,b,S;this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=u.tcp_pose:(d=u.tcp_pose)!=null&&d.orientation&&((b=u.tcp_pose)!=null&&b.position)&&((S=this.rapidlyChangingMotionState.tcp_pose)!=null&&S.orientation)?this.rapidlyChangingMotionState.tcp_pose={position:u.tcp_pose.position,orientation:$e(u.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation)}:console.warn("Received incomplete tcp_pose, ignoring",u.tcp_pose)}),u.tcp!==void 0&&this.rapidlyChangingMotionState.tcp!==u.tcp&&k.runInAction(()=>{this.rapidlyChangingMotionState.tcp=u.tcp}),this.rapidlyChangingMotionState.standstill!==u.standstill&&k.runInAction(()=>{this.rapidlyChangingMotionState.standstill=u.standstill});const m=this.rapidlyChangingMotionState.joint_limit_reached.limit_reached,g=u.joint_limit_reached.limit_reached;m.some((d,b)=>d!==g[b])&&k.runInAction(()=>{this.rapidlyChangingMotionState.joint_limit_reached=u.joint_limit_reached}),this.rapidlyChangingMotionState.execute!==u.execute&&k.runInAction(()=>{this.rapidlyChangingMotionState.execute=u.execute})}),k.makeAutoObservable(this)}static async open(e,n,a={}){var b;const r=re(e),i=a.cellId??"cell",[c,s]=n.split("@"),l=await r.api.controller.getCurrentRobotControllerState(i,s),u=l==null?void 0:l.motion_groups.find(S=>S.motion_group===n);if(!l||!u)throw new Error(`Controller ${s} or motion group ${n} not found`);const m=r.openReconnectingWebsocket(`/cells/${i}/controllers/${s}/motion-groups/${n}/state-stream`),g=await m.firstMessage(),p=(b=J.tryParseJson(g.data))==null?void 0:b.result;if(!p)throw new Error(`Unable to parse initial motion state message ${g.data}`);console.log(`Connected motion state websocket to motion group ${u.motion_group}. Initial state:
2
+ `,p);const d=await r.api.motionGroup.getMotionGroupDescription(i,s,u.motion_group);return new se(r,l,u,d,p,m,i)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get joints(){return this.initialMotionState.joint_position.map((e,n)=>({index:n}))}dispose(){this.motionStateSocket.close()}}const Ee="Movement request rejected. Another client is currently executing a 'Jogging' motion!";class le{constructor(e,n={}){this.motionStream=e,this.options=n,this.DEFAULT_MODE="off",this.DEFAULT_TCP="Flange",this.NO_TCP=void 0,this.DEFAULT_INIT_TIMEOUT=5e3,this.DEFAULT_ORIENTATION="coordsys",this.mode="off",this.joggingSocket=null,this.trajectorySocket=null,this.timeout=this.DEFAULT_INIT_TIMEOUT,this.tcp=(n==null?void 0:n.tcp)||e.motionGroup.tcp||this.getDefaultTcp(e),this.orientation=(n==null?void 0:n.orientation)||this.DEFAULT_ORIENTATION,this.timeout=(n==null?void 0:n.timeout)||this.DEFAULT_INIT_TIMEOUT,this.mode=(n==null?void 0:n.mode)||this.DEFAULT_MODE,this.onError=n==null?void 0:n.onError}static async open(e,n,a={}){const r=await se.open(e,n,{cellId:a.cellId}),i=new le(r,a);return await i.setJoggingMode(i.mode),i}getDefaultTcp(e){var a,r;const n=(r=(a=e.description.dh_parameters)==null?void 0:a[0])==null?void 0:r.type;return e.joints.length<6&&(n===V.JointTypeEnum.RevoluteJoint||n===V.JointTypeEnum.PrismaticJoint)?this.NO_TCP:this.DEFAULT_TCP}async setOptions(e){e.tcp&&(this.tcp=e.tcp),e.orientation&&(this.orientation=e.orientation),e.timeout&&(this.timeout=e.timeout),e.mode&&(this.mode=e.mode),e.onError&&(this.onError=e.onError),this.setJoggingMode(this.mode,!1)}get motionGroupId(){return this.motionStream.motionGroupId}get nova(){return this.motionStream.nova}get cellId(){return this.motionStream.cellId}get numJoints(){return this.motionStream.joints.length}async stop(){if(this.joggingSocket){const e=new Array(this.numJoints).fill(0);this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:e})}this.trajectorySocket&&this.trajectorySocket.sendJson({message_type:"PauseMovementRequest"})}async dispose(){const e=[this.joggingSocket,this.trajectorySocket].filter(n=>n!==null);return e.forEach(n=>{n.dispose()}),this.joggingSocket=null,this.trajectorySocket=null,Promise.all(e.map(n=>n.closed()))}async setJoggingMode(e,n=!0){if(!(this.mode===e&&n)&&(this.dispose(),this.mode=e,this.mode==="jogging"))return this.initializeJoggingWebsocket()}async initializeJoggingWebsocket(){return new Promise((e,n)=>{const a=setTimeout(()=>{n(new Error(`Jogging initialization timeout after ${this.timeout} seconds`))},this.timeout);this.joggingSocket=this.nova.openReconnectingWebsocket(`/cells/${this.cellId}/controllers/${this.motionStream.controllerId}/execution/jogging`),this.joggingSocket.addEventListener("message",r=>{var c,s,l,u;const i=J.tryParseJson(r.data);if(((c=i==null?void 0:i.result)==null?void 0:c.kind)==="INITIALIZE_RECEIVED"){clearTimeout(a),e();return}if(((s=i==null?void 0:i.result)==null?void 0:s.kind)==="MOTION_ERROR")if(clearTimeout(a),this.onBlocked&&((l=i==null?void 0:i.result)!=null&&l.message.includes(Ee))){(u=this.joggingSocket)==null||u.dispose(),this.onBlocked();return}else this.onError?this.onError(r.data):n(new Error(r.data))}),this.joggingSocket.sendJson({message_type:"InitializeJoggingRequest",motion_group:this.motionGroupId,...this.tcp?{tcp:this.tcp}:{}})})}async rotateJoints({joint:e,direction:n,velocityValue:a,velocityUnit:r}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Joint jogging websocket not connected; create one by setting jogging mode to 'jogging'");const i=new Array(this.numJoints).fill(0);i[e]=n==="-"?-a:a,this.joggingSocket.sendJson({message_type:"JointVelocityRequest",velocity:i})}async translateTCP({axis:e,direction:n,velocityMmPerSec:a}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const r=[0,0,0],i=[0,0,0];i[J.XYZ_TO_VECTOR[e]]=n==="-"?-a:a,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:i,rotation:r,use_tool_coordinate_system:this.orientation==="tool"})}async rotateTCP({axis:e,direction:n,velocityRadsPerSec:a}){if(!this.joggingSocket||this.mode!=="jogging")throw new Error("Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'");const r=[0,0,0],i=[0,0,0];r[J.XYZ_TO_VECTOR[e]]=n==="-"?-a:a,this.joggingSocket.sendJson({message_type:"TcpVelocityRequest",translation:i,rotation:r,use_tool_coordinate_system:this.orientation==="tool"})}async runIncrementalCartesianMotion({currentTcpPose:e,currentJoints:n,velocityInRelevantUnits:a,axis:r,direction:i,motion:c}){const s=[];if(this.mode!=="trajectory")throw new Error("Set jogging mode to 'trajectory' to run incremental cartesian motions");if(c.type==="translate"){if(!e.position)throw new Error("Current pose has no position, cannot perform translation");const y=[...e.position];y[J.XYZ_TO_VECTOR[r]]+=c.distanceMm*(i==="-"?-1:1),s.push({limits_override:{tcp_velocity_limit:a},path:{path_definition_name:"PathLine",target_pose:{position:y,orientation:e.orientation}}})}else if(c.type==="rotate"){if(!e.orientation)throw new Error("Current pose has no orientation, cannot perform rotation");const y=new ue.Vector3(e.orientation[0],e.orientation[1],e.orientation[2]),f=y.length(),j=y.clone().normalize(),x=c.distanceRads*(i==="-"?-1:1),v=new ue.Vector3(0,0,0);v[r]=1;const C=Math.cos(.5*x)*Math.cos(.5*f),w=Math.sin(.5*x)*Math.sin(.5*f),I=Math.sin(.5*x)*Math.cos(.5*f),E=Math.cos(.5*x)*Math.sin(.5*f),M=v.dot(j),P=v.clone().cross(j),F=2*Math.acos(C-w*M),Z=F/Math.sin(.5*F),ne=new ue.Vector3().addScaledVector(P,w).addScaledVector(v,I).addScaledVector(j,E).multiplyScalar(Z);s.push({limits_override:{tcp_orientation_velocity_limit:a},path:{path_definition_name:"PathLine",target_pose:{position:e.position,orientation:[...ne]}}})}const l=this.motionStream.description;if(l.cycle_time===void 0){console.warn("Current motion group has no cycle time, cannot plan jogging motion");return}const u={motion_group_model:l.motion_group_model,cycle_time:l.cycle_time,mounting:l.mounting,global:l.operation_limits.auto_limits},m=await this.nova.api.trajectoryPlanning.planTrajectory(this.cellId,{motion_group_setup:u,start_joint_position:n,motion_commands:s}),g=m.response;if(!g)throw new Error(`Failed to plan jogging increment motion ${JSON.stringify(m)}`);this.trajectorySocket&&(console.warn("Trajectory jogging websocket already open; will close"),this.trajectorySocket.dispose()),this.trajectorySocket=this.nova.openReconnectingWebsocket(`/cells/${this.cellId}/controllers/${this.motionStream.controllerId}/execution/trajectory`);const p=y=>{var f;if(!y||y.add_trajectory_error||y.message)if(this.onError)this.onError(y);else throw new Error(((f=y==null?void 0:y.add_trajectory_error)==null?void 0:f.message)||(y==null?void 0:y.message)||"Failed to execute trajectory, unknown error");if(!this.trajectorySocket)throw new Error("Failed to execute trajectory, websocket not available anymore");this.trajectorySocket.sendJson({message_type:"StartMovementRequest",direction:"DIRECTION_FORWARD"})},d=async()=>{var y;await k.when(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await k.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},b=async()=>{var y;await k.when(()=>this.motionStream.rapidlyChangingMotionState.standstill),(y=this.trajectorySocket)==null||y.dispose(),this.trajectorySocket=null},S=async y=>{if(y!=null&&y.message)if(this.onError){this.onError(y);return}else throw new Error(y.message||"Failed to execute trajectory, unknown error");this.motionStream.rapidlyChangingMotionState.standstill?await d():await b()};this.trajectorySocket.addEventListener("message",y=>{var j,x;const f=J.tryParseJson(y.data);if(!((j=f==null?void 0:f.result)!=null&&j.kind))throw new Error(`Failed to execute trajectory: Received invalid message ${y.data}`);if(this.onBlocked&&((x=f.result.message)!=null&&x.includes(Ee))){this.onBlocked();return}if(f.result.kind==="INITIALIZE_RECEIVED")p(f.result);else if(f.result.kind==="START_RECEIVED")S(f);else if(f.result.kind!=="PAUSE_RECEIVED")if(f.result.kind==="MOTION_ERROR"&&f.result.message)if(this.onError){this.onError(f);return}else throw new Error(f.result.message);else throw new Error(`Failed to execute trajectory, cannot handle message type "${f.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:"InitializeMovementRequest",trajectory:{message_type:"TrajectoryData",motion_group:this.motionGroupId,data:g,tcp:this.tcp}})}}const Ve=t=>{const e=t.softTimeout||3e3,[n,a]=h.useState(!1),r=D.useTheme();return h.useEffect(()=>{const i=setTimeout(()=>{a(!0)},e);return()=>clearTimeout(i)}),o.jsx(_,{width:"100%",height:"100%",alignItems:"center",justifyContent:"center",sx:{color:r.palette.text.primary},children:t.error?o.jsx(qe,{loadingMessage:t.message,error:t.error}):o.jsxs(o.Fragment,{children:[o.jsx(Je,{sx:{marginBottom:"24px"}}),!!t.message&&o.jsx("div",{children:t.message}),o.jsx(_,{sx:{visibility:n?"visible":"hidden",marginTop:"1rem",color:r.palette.text.secondary},children:"This is taking longer than expected..."})]})})},qe=t=>{const e=ct.makeErrorMessage(t.error),n=t.error instanceof Error?t.error.stack:null,a=D.useTheme();return o.jsxs(_,{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:[(t.loadingMessage?`Error while ${he.lowerFirst(lt.capitalize(t.loadingMessage))} - `:"")+e,o.jsx("br",{}),n&&o.jsx("pre",{children:n})]})},Zt=O.observer(({store:t})=>{const{t:e}=B.useTranslation();return o.jsx(Ae,{"data-testid":"jogging-blocked","aria-label":"jogging-blocked",open:!0,sx:{position:"absolute",zIndex:n=>n.zIndex.drawer+1,color:"#fff",background:"rgba(15, 15, 15, 0.88)",justifyContent:"flex-start",alignItems:"flex-start"},children:o.jsxs(_,{sx:{m:2,width:"100%"},children:[o.jsxs(ut,{severity:"error",sx:{mb:2},children:[o.jsx(dt,{children:e("Jogging.Blocked.ti")}),e("Jogging.Blocked.lb")]}),o.jsx(Y,{variant:"contained",color:"secondary",onClick:()=>t.unblock(),children:e("Jogging.Blocked.Reenable.bt")})]})})}),Ne=O.observer(({store:t})=>{const{t:e}=B.useTranslation(),[n,a]=h.useState(t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),r=h.useRef(n);ee.useAnimationFrame(()=>{const c=t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;gt(r.current,c)||(r.current=c,a(c))});const i=[];for(const[c,s]of n.entries())s&&i.push(c);return o.jsx(T,{sx:{display:"flex",flexDirection:"row",justifyContent:"center"},children:o.jsx(R,{"data-testid":"jogging-joint-limit-detector","aria-label":"jogging-joint-limit-detector",color:"error",variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2,visibility:i.length?"visible":"hidden"},children:e("Jogging.JointLimitsReached.lb",{jointNumbers:i.map(c=>c+1).join(", ")})})})}),Xt=D.styled(ht)(({theme:t})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:"20px",paddingLeft:"12px"},label:{pointerEvents:"none",fontSize:"16px"},".MuiInputLabel-root":{"&.Mui-focused":{color:t.palette.text.primary}}}}));function ie({labelValue:t,...e}){return o.jsxs(Xt,{fullWidth:!0,variant:"filled",children:[o.jsx(mt,{id:e.labelId,children:t}),o.jsx(ft,{...e})]})}const pe=[{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}],Qt=[{id:"continuous"},...pe],Kt=["coordsys","tool"];class ce{constructor(e,n,a,r,i){var c,s,l;this.jogger=e,this.coordSystems=n,this.motionGroupDescription=a,this.tcps=r,this.inverseSolverValue=i,this.selectedTabId="cartesian",this.locks=new Set,this.blocked=!1,this.selectedCoordSystemId="world",this.selectedTcpId="",this.tcpChangeInProgress=!1,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=!1,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[],this.inverseSolver=void 0,this.jointType=V.JointTypeEnum.RevoluteJoint;for(const u of n)if(u.coordinate_system===""){u.coordinate_system="world";break}this.selectedCoordSystemId=((c=n[0])==null?void 0:c.coordinate_system)||"world",this.selectedTcpId=e.motionStream.rapidlyChangingMotionState.tcp??"",this.tcpChangeInProgress=this.tcps.length>0&&!this.selectedTcpId,this.inverseSolver=i,this.jointType=((l=(s=a==null?void 0:a.dh_parameters)==null?void 0:s[0])==null?void 0:l.type)??V.JointTypeEnum.RevoluteJoint,k.makeAutoObservable(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push(k.autorun(()=>this.saveToLocalStorage())),this.disposers.push(k.autorun(()=>{const u=this.jogger.motionStream.rapidlyChangingMotionState.tcp;u&&u!==this.selectedTcpId&&k.runInAction(()=>{this.selectedTcpId=u,this.tcpChangeInProgress=!1})})),window.joggingStore=this}static async loadFor(e){const{nova:n,cellId:a}=e,[r,i]=await Promise.all([n.api.controller.listCoordinateSystems(a,e.motionStream.controllerId,"ROTATION_VECTOR"),n.api.motionGroup.getMotionGroupDescription(a,e.motionStream.controllerId,e.motionGroupId)]),c=await n.api.motionGroupModels.getMotionGroupKinematicModel(i.motion_group_model),s=Object.entries(i.tcps||{}).map(([l,u])=>({id:l,readable_name:u.name,position:u.pose.position,orientation:u.pose.orientation}));return new ce(e,r||[],i,s,c.inverse_solver)}dispose(){for(const e of this.disposers)e();this.jogger.dispose()}get coordSystemCountByName(){return he.countBy(this.coordSystems,e=>e.name)}async deactivate(){this.jogger.mode==="jogging"&&await this.jogger.setJoggingMode("off")}async activate(){return this.currentTab.id==="cartesian"?((this.jogger.tcp!==this.selectedTcpId||this.jogger.orientation!==this.selectedOrientation)&&await this.jogger.setOptions({tcp:this.selectedTcpId||void 0,orientation:this.selectedOrientation}),this.activeDiscreteIncrement?this.jogger.setJoggingMode("trajectory"):this.jogger.setJoggingMode("jogging")):this.jogger.setJoggingMode("jogging"),this.jogger}loadFromLocalStorage(){const e=J.tryParseJson(localStorage.getItem("joggingToolStore"));e&&(this.tabsById[e.selectedTabId]&&(this.selectedTabId=e.selectedTabId),this.coordSystemsById[e.selectedCoordSystemId]&&(this.selectedCoordSystemId=e.selectedCoordSystemId),this.incrementOptionsById[e.selectedIncrementId]&&(this.selectedIncrementId=e.selectedIncrementId),["translate","rotate"].includes(e.selectedCartesianMotionType)&&(this.selectedCartesianMotionType=e.selectedCartesianMotionType),["coordsys","tool"].includes(e.selectedOrientation)&&(this.selectedOrientation=e.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,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){const e=[{id:"joint",label:"Joints"}];return this.inverseSolver!==null&&e.unshift({id:"cartesian",label:"Cartesian"}),e}get incrementOptions(){return Qt}get discreteIncrementOptions(){return pe}get incrementOptionsById(){return oe(this.incrementOptions,e=>e.id)}get tabsById(){return oe(this.tabs,e=>e.id)}get currentTab(){return this.tabsById[this.selectedTabId]||this.tabs[0]}get tabIndex(){return this.tabs.indexOf(this.currentTab)}get coordSystemsById(){return oe(this.coordSystems,e=>e.coordinate_system)}get activeCoordSystemId(){return this.selectedOrientation==="tool"?"tool":this.selectedCoordSystemId}get tcpsById(){return oe(this.tcps,e=>e.id)}get activeDiscreteIncrement(){return this.selectedOrientation==="tool"?void 0:pe.find(e=>e.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}velocityInDisplayUnits(e){return e?this.rotationVelocityDegPerSec:this.translationVelocityMmPerSec}minVelocityInDisplayUnits(e){return e?this.minRotationVelocityDegPerSec:this.minTranslationVelocityMmPerSec}maxVelocityInDisplayUnits(e){return e?this.maxRotationVelocityDegPerSec:this.maxTranslationVelocityMmPerSec}onTabChange(e,n){const a=this.tabs[n]||this.tabs[0];this.selectedTabId=a.id}setSelectedCoordSystemId(e){this.selectedCoordSystemId=e}setSelectedTcpId(e){this.requestTcpChange(e).catch(n=>{console.error("Failed to change TCP:",n)})}async requestTcpChange(e){if(e===this.selectedTcpId)return;this.tcpChangeInProgress=!0;const n=this.jogger.tcp,a=this.jogger.mode!=="jogging";try{this.jogger.tcp=e,a?await this.jogger.setJoggingMode("jogging"):await this.jogger.setJoggingMode("jogging",!1);let r=await this.waitForTcpConfirmation(e,1e3);a&&await this.jogger.setJoggingMode("off"),r||(r=await this.waitForTcpConfirmation(e,2e3)),k.runInAction(()=>{r?this.selectedTcpId=e:(this.jogger.tcp=n,this.selectedTcpId=this.jogger.motionStream.rapidlyChangingMotionState.tcp??"")})}catch(r){throw a&&await this.jogger.setJoggingMode("off").catch(()=>{}),k.runInAction(()=>{this.jogger.tcp=n,this.selectedTcpId=this.jogger.motionStream.rapidlyChangingMotionState.tcp??""}),r}finally{k.runInAction(()=>{this.tcpChangeInProgress=!1})}}waitForTcpConfirmation(e,n){return new Promise(a=>{const r=setTimeout(()=>{i(),a(!1)},n),i=k.when(()=>this.jogger.motionStream.rapidlyChangingMotionState.tcp===e,()=>{clearTimeout(r),a(!0)})})}setSelectedOrientation(e){this.selectedOrientation=e}setSelectedIncrementId(e){this.selectedIncrementId=e}setCurrentIncrementJog(e){this.incrementJogInProgress=e}setVelocityFromSlider(e,n){n?this.rotationVelocityDegPerSec=e:this.translationVelocityMmPerSec=e}setSelectedCartesianMotionType(e){this.selectedCartesianMotionType=e}lock(e){this.locks.add(e)}unlock(e){this.locks.delete(e)}block(){this.blocked=!0}unblock(){this.blocked=!1,this.jogger.mode==="jogging"&&this.jogger.initializeJoggingWebsocket()}async withMotionLock(e){const n=xt();this.lock(n);try{return await e()}finally{this.unlock(n)}}}const en=O.observer(({store:t,useDegree:e})=>{var c;const{t:n}=B.useTranslation(),a=h.useId(),r=[];function i(s){switch(s){case"coordsys":return n("Jogging.Orientation.coordsys");case"tool":return n("Jogging.Orientation.tool");default:return s}}return t.showCoordSystemSelect&&r.push(o.jsx(ie,{labelId:`jogging-coord-select-${a}`,labelValue:n("Jogging.CoordinateSystem.hlb"),value:t.selectedCoordSystemId,size:"small",variant:"filled",displayEmpty:!0,onChange:s=>t.setSelectedCoordSystemId(s.target.value),disabled:t.isLocked,children:t.coordSystems.map(s=>o.jsx(H,{value:s.coordinate_system,children:s.name&&t.coordSystemCountByName[s.name]>1?`${s.name} / ${s.coordinate_system}`:s.name||s.coordinate_system},s.coordinate_system))},"coord")),t.showTcpSelect&&r.push(o.jsx(ie,{labelId:`jogging-tcp-select-${a}`,labelValue:"TCP",value:t.selectedTcpId,size:"small",variant:"filled",displayEmpty:t.tcpChangeInProgress,onChange:s=>{t.requestTcpChange(s.target.value).catch(l=>{console.error("Failed to change TCP:",l)})},disabled:t.isLocked||t.tcpChangeInProgress,endAdornment:t.tcpChangeInProgress?o.jsx(pt,{position:"end",children:o.jsx(Je,{size:16})}):void 0,children:t.tcps.map(s=>o.jsx(H,{value:s.id,children:s.id},s.id))},"tcp")),t.showOrientationSelect&&r.push(o.jsx(ie,{labelValue:n("Jogging.Cartesian.Orientation.lb"),labelId:`orientation-select-${a}`,value:t.selectedOrientation,onChange:s=>t.setSelectedOrientation(s.target.value),disabled:t.isLocked,children:Kt.map(s=>o.jsx(H,{value:s,children:i(s)},s))},"orientation")),t.showIncrementSelect&&r.push(o.jsxs(ie,{labelValue:n("Jogging.Increment.hlb"),labelId:`jogging-increment-select-${a}`,size:"small",variant:"filled",value:((c=t.activeDiscreteIncrement)==null?void 0:c.id)||"continuous",onChange:s=>t.setSelectedIncrementId(s.target.value),disabled:t.isLocked,children:[o.jsx(H,{value:"continuous",children:n("Jogging.Increment.Continuous.dd")},"continuous"),t.selectedOrientation==="tool"?null:t.discreteIncrementOptions.map(s=>o.jsx(H,{value:s.id,children:e?`${s.degrees}°`:`${s.mm}mm`},s.id))]},"increment")),o.jsx(T,{component:"div","data-testid":"jogging-options","aria-label":"jogging-options",sx:{display:"grid",gap:"16px",gridTemplateColumns:"1fr 1fr",gridAutoRows:"min-content","& label":{opacity:.7,fontSize:"12px",marginBottom:"4px"}},children:r.map((s,l)=>o.jsx(T,{sx:{gridColumn:r.length%2===1&&l===r.length-1?"span 2":"auto"},children:s},l))})}),tn=D.styled(bt)(({theme:t})=>{var e;return{"&.MuiToggleButtonGroup-root":{background:(e=t.palette.backgroundPaperElevation)==null?void 0:e[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"}}}}}),We=O.observer(t=>{var i,c,s;const e=D.useTheme(),{store:n}=t,{t:a}=B.useTranslation();function r(l,u){u===t.velocity||!yt(u)||t.onVelocityChange(u,t.useDegree)}return o.jsxs(_,{direction:"row",gap:2,alignItems:"center","data-testid":"velocity-slider","aria-label":"velocity-slider",children:[n.showVelocityLegend&&o.jsx(R,{sx:{color:(s=(c=(i=e.componentsExt)==null?void 0:i.JoggingPanel)==null?void 0:c.VelocitySlider)==null?void 0:s.sliderLegendColor,fontSize:"14px"},children:a("Jogging.Velocity.bt")}),o.jsx(Fe,{value:t.velocity,color:"secondary",onChange:r,min:t.min,max:t.max,"aria-labelledby":"input-slider",disabled:t.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:"transparent",top:"0px"}}}),n.showVelocitySliderLabel&&(t.renderValue?t.renderValue(t.velocity):o.jsx(xe,{value:t.velocity.toString()}))]})});function xe({value:t,sx:e}){var a;const n=D.useTheme();return o.jsx(_,{direction:"row",justifyContent:"center",alignItems:"center",gap:"5px",sx:{padding:"6px 12px",background:(a=n.palette.backgroundPaperElevation)==null?void 0:a[8],borderRadius:"10px",minWidth:"111px",...e},children:o.jsx(R,{component:"span",sx:{textAlign:"right",fontSize:"14px",opacity:.8,color:n.palette.text.primary,whiteSpace:"nowrap"},children:t})})}const Ge=O.observer(({store:t,useDegree:e})=>{const{t:n}=B.useTranslation();function a(r,i){return i?`ω = ${n("Jogging.Cartesian.Rotation.velocityDegPerSec.lb",{amount:r})}`:`v = ${n("Jogging.Cartesian.Translation.velocityMmPerSec.lb",{amount:r})}`}return o.jsx(We,{store:t,velocity:t.velocityInDisplayUnits(e),min:t.minVelocityInDisplayUnits(e),max:t.maxVelocityInDisplayUnits(e),onVelocityChange:t.setVelocityFromSlider,useDegree:e,disabled:t.isLocked,renderValue:r=>o.jsx(xe,{value:a(r,e),sx:{minWidth:"111px",span:{transform:"translateY(-1.5px)"}}})})}),Ue=O.observer(({store:t})=>{var r,i,c;const{t:e}=B.useTranslation(),n=D.useTheme(),a=((c=(i=(r=t.jogger.motionStream.rapidlyChangingMotionState.execute)==null?void 0:r.details)==null?void 0:i.state)==null?void 0:c.kind)??"KIND_UNKNOWN";return o.jsxs(T,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",color:n.palette.text.primary},children:[o.jsx(R,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},children:e("Jogging.StreamStateSection.lb")}),o.jsx(R,{variant:"body2",sx:{fontSize:"0.75rem",lineHeight:1.2},"data-testid":a,children:e(`Jogging.StreamStateSection.${a}.lb`)})]})}),nn=O.observer(({store:t,children:e})=>{const{t:n}=B.useTranslation(),a=D.useTheme();function r(p,d){(d==="translate"||d==="rotate")&&t.setSelectedCartesianMotionType(d)}async function i(p,d){const b=await t.activate(),S=b.motionStream.rapidlyChangingMotionState.tcp_pose,y=b.motionStream.rapidlyChangingMotionState.joint_position;S&&await t.withMotionLock(async()=>{try{t.setCurrentIncrementJog({axis:p.axis,direction:p.direction}),await t.jogger.runIncrementalCartesianMotion({currentTcpPose:S,currentJoints:y,coordSystemId:t.activeCoordSystemId,velocityInRelevantUnits:t.selectedCartesianMotionType==="translate"?t.translationVelocityMmPerSec:t.rotationVelocityRadsPerSec,axis:p.axis,direction:p.direction,motion:t.selectedCartesianMotionType==="translate"?{type:"translate",distanceMm:d.mm}:{type:"rotate",distanceRads:J.degreesToRadians(d.degrees)}})}finally{t.setCurrentIncrementJog(null),await t.deactivate()}})}async function c(p){if(!t.isLocked){if(await t.activate(),t.activeDiscreteIncrement)return i(p,t.activeDiscreteIncrement);p.motionType==="translate"?await t.jogger.translateTCP({axis:p.axis,direction:p.direction,velocityMmPerSec:t.translationVelocityMmPerSec}):await t.jogger.rotateTCP({axis:p.axis,direction:p.direction,velocityRadsPerSec:t.rotationVelocityRadsPerSec})}}async function s(){t.isLocked||t.activeDiscreteIncrement||await t.deactivate()}function l(p,d,b){var y,f,j;const S=(j=(f=(y=b.componentsExt)==null?void 0:y.JoggingPanel)==null?void 0:f.JoggingCartesian)==null?void 0:j.Axis;if(S)return d==="translate"?S[p]:S.CustomRotation??S[p]}const u=[{id:"x",icon:o.jsx(W.ForwardRef,{}),colors:l("X",t.selectedCartesianMotionType,a)},{id:"y",icon:o.jsx(W.ForwardRef$1,{}),colors:l("Y",t.selectedCartesianMotionType,a)},{id:"z",icon:o.jsx(W.ForwardRef$2,{}),colors:l("Z",t.selectedCartesianMotionType,a)}];function m(p){return n("General.mm.variable",{amount:p.toFixed(1)})}function g(p){return n("General.degree.variable",{amount:J.radiansToDegrees(p).toFixed(1)})}return o.jsxs(_,{"data-testid":"jogging-cartesian-tab","aria-label":"jogging-cartesian-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[o.jsxs(_,{gap:2,children:[o.jsx(en,{store:t,useDegree:t.selectedCartesianMotionType==="rotate"}),o.jsx(Ge,{store:t,useDegree:t.selectedCartesianMotionType==="rotate"}),o.jsx(q,{})]}),o.jsx(_,{marginLeft:"auto",marginRight:"auto",gap:"24px",justifyContent:"center",sx:{flexGrow:"1"},children:o.jsxs(_,{alignItems:"center",justifyContent:"center",gap:"24px",sx:{flexGrow:1},children:[o.jsxs(tn,{value:t.selectedCartesianMotionType,onChange:r,exclusive:!0,"aria-label":n("Jogging.Cartesian.MotionType.lb"),sx:{justifyContent:"center"},children:[o.jsx(Me,{value:"translate",children:n("Jogging.Cartesian.Translation.bt")}),o.jsx(Me,{value:"rotate",children:n("Jogging.Cartesian.Rotation.bt")})]}),t.selectedCartesianMotionType==="translate"&&u.map(p=>{var d,b;return o.jsx(ge,{"data-testid":`jogging-cartesian-axis-control-${p.id}`,"aria-label":`jogging-cartesian-axis-control-${p.id}`,colors:p.colors,disabled:t.isLocked,activeJoggingDirection:((d=t.incrementJogInProgress)==null?void 0:d.axis)===p.id?t.incrementJogInProgress.direction:void 0,label:o.jsxs(o.Fragment,{children:[p.icon,o.jsx(R,{sx:{fontSize:"24px",color:((b=p.colors)==null?void 0:b.labelColor)??a.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var S,y;return m(((y=(S=t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:S.position)==null?void 0:y[J.XYZ_TO_VECTOR[p.id]])||0)},startJogging:S=>c({axis:p.id,motionType:"translate",direction:S}),stopJogging:s},p.id)}),t.selectedCartesianMotionType==="rotate"&&u.map(p=>{var d,b;return o.jsx(ge,{"data-testid":`jogging-cartesian-axis-control-${p.id}`,"aria-label":`jogging-cartesian-axis-control-${p.id}`,colors:p.colors,disabled:t.isLocked,activeJoggingDirection:((d=t.incrementJogInProgress)==null?void 0:d.axis)===p.id?t.incrementJogInProgress.direction:void 0,label:o.jsxs(o.Fragment,{children:[o.jsx(W.ForwardRef$6,{}),o.jsx(R,{sx:{fontSize:"24px",color:((b=p.colors)==null?void 0:b.labelColor)??a.palette.text.primary},children:p.id.toUpperCase()})]}),getDisplayedValue:()=>{var S,y;return g(((y=(S=t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose)==null?void 0:S.orientation)==null?void 0:y[J.XYZ_TO_VECTOR[p.id]])||0)},startJogging:S=>c({axis:p.id,motionType:"rotate",direction:S}),stopJogging:s},p.id)})]})}),o.jsx(Ne,{store:t}),o.jsx(q,{}),o.jsx(Ue,{store:t}),e&&o.jsx(q,{}),e]})}),on=O.observer(({store:t,children:e})=>{const n=D.useTheme();async function a(i){await t.activate(),await t.jogger.rotateJoints({joint:i.joint,direction:i.direction,velocityUnit:t.jointType===V.JointTypeEnum.PrismaticJoint?"mm/s":"rad/s",velocityValue:t.jointType===V.JointTypeEnum.PrismaticJoint?t.translationVelocityMmPerSec:t.rotationVelocityRadsPerSec})}async function r(){await t.jogger.stop(),await t.deactivate()}return o.jsxs(_,{"data-testid":"jogging-joint-tab","aria-label":"jogging-joint-tab",flexGrow:1,gap:2,sx:{padding:"18px 24px"},children:[o.jsx(Ge,{store:t,useDegree:t.jointType===V.JointTypeEnum.RevoluteJoint}),o.jsx(q,{}),o.jsx(_,{justifyContent:"center",alignItems:"stretch",sx:{flexGrow:"1"},children:o.jsx(_,{"data-testid":"jogging-joint-value-controls-wrapper","aria-label":"jogging-joint-value-controls-wrapper",alignItems:"center",gap:"24px",children:t.jogger.motionStream.joints.map(i=>{var s,l,u;const c=(u=(l=(s=t.motionGroupDescription.operation_limits.auto_limits)==null?void 0:s.joints)==null?void 0:l[i.index])==null?void 0:u.position;return o.jsxs(_,{"data-testid":`jogging-joint-value-control-${i.index}`,"aria-label":`jogging-joint-value-control-${i.index}`,direction:"row",alignItems:"center",justifyContent:"center",spacing:1.5,width:"100%",children:[t.showJointsLegend&&o.jsx(R,{color:t.isLocked?n.palette.text.disabled:n.palette.text.secondary,children:`G${i.index+1}`}),o.jsx(Be,{disabled:t.isLocked,lowerLimit:c==null?void 0:c.lower_limit,upperLimit:c==null?void 0:c.upper_limit,useDegree:t.jointType===V.JointTypeEnum.RevoluteJoint,getValue:()=>{const m=t.jogger.motionStream.rapidlyChangingMotionState.joint_position[i.index];return m!==void 0?m:void 0},startJogging:m=>a({joint:i.index,direction:m}),stopJogging:r})]},`joint-${i.index}`)})})}),o.jsx(Ne,{store:t}),o.jsx(q,{}),o.jsx(Ue,{store:t}),e&&o.jsx(q,{}),e]})}),rn=L.externalizeComponent(O.observer(t=>{const e=he.isString(t.nova)?new V.Nova({instanceUrl:t.nova}):t.nova,n=O.useLocalObservable(()=>({joggingStore:null,loadingError:null}));async function a(){k.runInAction(()=>{n.loadingError=null,n.joggingStore=null});try{let r=t.store;if(!r){const i=await le.open(e,t.motionGroupId,{cellId:t.cellId});r=await ce.loadFor(i)}k.runInAction(()=>{n.joggingStore=r}),t.onSetup&&t.onSetup(r)}catch(r){n.loadingError=r}}return h.useEffect(()=>(a(),t.store?()=>null:()=>{var r;(r=n.joggingStore)==null||r.dispose()}),[t.store,t.nova,t.motionGroupId,t.cellId]),h.useEffect(()=>{const r=n.joggingStore;r&&(t.locked?r.lock("external"):r.unlock("external"))},[n.joggingStore,t.locked]),o.jsx(_,{"data-testid":"jogging-panel","aria-label":"jogging-panel",sx:{maxWidth:"460px",minWidth:"320px",position:"relative",...t.sx},children:n.joggingStore?o.jsx(an,{store:n.joggingStore,children:t.children}):o.jsx(Ve,{message:"Loading jogging",error:n.loadingError})})})),an=O.observer(({store:t,children:e})=>{const{t:n}=B.useTranslation();function a(){if(t.currentTab.id==="cartesian")return o.jsx(nn,{store:t,children:e});if(t.currentTab.id==="joint")return o.jsx(on,{store:t,children:e})}return o.jsxs(_,{flexGrow:1,sx:{overflow:"hidden"},children:[o.jsx(De,{"data-testid":"jogging-tabs","aria-label":"jogging-tabs",value:t.tabIndex,onChange:t.onTabChange,variant:"fullWidth",children:t.tabs.map(r=>{const i=r.label==="Cartesian"?n("Jogging.Cartesian.bt"):n("Jogging.Joints.bt"),c=r.label==="cartesian"?o.jsx(at,{fontSize:"small",sx:{mr:1}}):o.jsx(st,{fontSize:"small",sx:{mr:1}});return o.jsx(Oe,{"data-testid":`jogging-tab-${r.id}`,"aria-label":`jogging-tab-${r.id}`,label:t.showTabIcons?o.jsxs(_,{direction:"row",alignItems:"center",children:[c,i]}):i,id:`jogging-tab-${r.id}`,"aria-controls":`jogging-tab-${r.id}`},r.id)})}),o.jsx(_,{flexGrow:1,position:"relative",sx:{overflowY:"auto",overflowX:"hidden"},children:a()}),t.blocked&&o.jsx(Zt,{store:t})]})}),He=t=>{var s;const{value:e,ref:n}=t,a=D.useTheme(),[r,i]=h.useState(!1);async function c(){if(!n||!("current"in n))return console.warn("No copy target found"),!1;try{return await navigator.clipboard.writeText(e),console.log("Copied!"),i(!0),!0}catch(l){console.error(l);const u=window.getSelection();if(u&&n&&"current"in n&&n.current){const m=document.createRange();m.selectNodeContents(n.current),u.removeAllRanges(),u.addRange(m)}}return!1}return h.useEffect(()=>{if(!r)return;const l=setTimeout(()=>i(!1),3e3);return()=>{l&&clearTimeout(l)}},[r]),o.jsx(vt,{open:r,title:"Copied!",children:o.jsx(_,{justifyContent:"center",sx:{height:"100%",boxSizing:"border-box",padding:"6px 12px",background:(s=a.palette.backgroundPaperElevation)==null?void 0:s[8],borderRadius:"10px",minWidth:"0",cursor:"pointer"},onClick:()=>c(),children:o.jsx(R,{ref:n,align:"center",sx:{pointerEvents:"none",fontSize:"12px",color:a.palette.text.primary,whiteSpace:"nowrap",minWidth:0,textOverflow:"ellipsis",width:"100%",overflow:"hidden"},children:e})})})},sn=L.externalizeComponent(O.observer(({tcpPose:t,showCopyButton:e=!1})=>{const[n,a]=h.useState(null),r=V.poseToWandelscriptString(t),i=async()=>{try{await navigator.clipboard.writeText(r),a("Copied!"),setTimeout(()=>a(null),2e3)}catch{a("Copy failed"),setTimeout(()=>a(null),2e3)}};return o.jsxs(_,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-cartesian-values",children:[o.jsx(He,{value:r}),e&&o.jsx(Y,{variant:"contained",color:"secondary",size:"small",onClick:i,sx:{flexShrink:0},children:n||"Copy"})]})})),ln=L.externalizeComponent(O.observer(({joints:t,showCopyButton:e=!1})=>{const[n,a]=h.useState(null),r=`[${t.map(c=>parseFloat(c.toFixed(4))).join(", ")}]`,i=async()=>{try{await navigator.clipboard.writeText(r),a("Copied!"),setTimeout(()=>a(null),2e3)}catch{a("Copy failed"),setTimeout(()=>a(null),2e3)}};return o.jsxs(_,{direction:"row",alignItems:"center",spacing:1,sx:{flexGrow:1,minWidth:0,overflow:"hidden"},"data-testid":"pose-joint-values",children:[o.jsx(He,{value:r}),e&&o.jsx(Y,{variant:"contained",color:"secondary",size:"small",onClick:i,sx:{flexShrink:0},children:n||"Copy"})]})}));class Ye{constructor(){this.messages=[],this.addMessage=(e,n="info")=>{const a={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:e,level:n};this.messages.push(a)},this.clearMessages=()=>{this.messages=[]},this.addInfo=e=>{this.addMessage(e,"info")},this.addWarning=e=>{this.addMessage(e,"warning")},this.addError=e=>{this.addMessage(e,"error")},this.addDebug=e=>{this.addMessage(e,"debug")},k.makeObservable(this,{messages:k.observable,addMessage:k.action,clearMessages:k.action})}}const te=(t,e,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:t,level:e}),cn=(t,e)=>te(t,"debug",e),un=(t,e)=>te(t,"info",e),dn=(t,e)=>te(t,"warning",e),gn=(t,e)=>te(t,"error",e),Ze=L.externalizeComponent(O.observer(t=>{var m;const{messages:e=[],onClear:n,height:a=400,sx:r}=t,i=D.useTheme(),c=h.useRef(null);h.useEffect(()=>{if(e.length===0)return;const g=c.current;if(!g)return;const p=setTimeout(()=>{g.scrollTop=g.scrollHeight},10);return()=>clearTimeout(p)},[e.length]);const s=g=>g.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),l=g=>{switch(g){case"error":return i.palette.error.main;case"warning":return i.palette.warning.main;case"info":return i.palette.info.main;case"debug":return i.palette.text.disabled;default:return i.palette.text.secondary}},u=({message:g})=>{const[p,d]=h.useState(!1),[b,S]=h.useState(!1),[y,f]=h.useState(!1),j=g.message.length>150,x=async()=>{try{await navigator.clipboard.writeText(g.message),S(!0),setTimeout(()=>S(!1),2e3)}catch(C){console.error("Failed to copy message:",C)}},v=j&&!p?`${g.message.substring(0,150)}...`:g.message;return o.jsx(T,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),sx:{display:"flex",gap:1,fontFamily:"monospace",flexDirection:"column","&:hover":{backgroundColor:i.palette.action.hover},borderRadius:"4px",padding:"2px 4px",margin:"-2px -4px"},children:o.jsxs(T,{sx:{display:"flex",gap:1},children:[o.jsxs(R,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:i.palette.text.disabled,whiteSpace:"nowrap",flexShrink:0},children:["[",s(g.timestamp),"]"]}),o.jsx(R,{component:"span",sx:{fontWeight:400,fontSize:"12px",lineHeight:"18px",letterSpacing:"0.4px",color:l(g.level),wordBreak:"break-word",overflowWrap:"anywhere",hyphens:"auto",flex:1,whiteSpace:"pre-wrap"},children:v}),o.jsxs(T,{sx:{display:"flex",alignItems:"flex-start",gap:.5,opacity:y?1:0,transition:"opacity 0.2s ease-in-out",visibility:y?"visible":"hidden"},children:[o.jsx(G,{size:"small",onClick:x,sx:{padding:"2px",color:i.palette.text.secondary,"&:hover":{backgroundColor:i.palette.action.hover}},title:b?"Copied!":"Copy message",children:o.jsx(Tt,{sx:{fontSize:12}})}),j&&o.jsx(G,{size:"small",onClick:()=>d(!p),sx:{padding:"2px",color:i.palette.text.secondary,"&:hover":{backgroundColor:i.palette.action.hover}},title:p?"Collapse":"Expand",children:p?o.jsx(It,{sx:{fontSize:12}}):o.jsx(Mt,{sx:{fontSize:12}})})]})]})},g.id)};return o.jsxs(kt,{sx:{backgroundColor:((m=i.palette.backgroundPaperElevation)==null?void 0:m[2])||"#171927",backgroundImage:"none",height:a,display:"flex",flexDirection:"column",overflow:"hidden",...r},children:[o.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px"},children:[o.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(wt,{sx:{fontSize:16,color:i.palette.action.active,opacity:.56}}),o.jsx(R,{sx:{fontWeight:500,fontSize:"14px",lineHeight:"143%",letterSpacing:"0.17px",color:i.palette.text.primary},children:"Log"})]}),o.jsx(Y,{onClick:n,variant:"text",sx:{fontWeight:500,fontSize:"13px",lineHeight:"22px",letterSpacing:"0.46px",color:i.palette.primary.main,textTransform:"none",minWidth:"auto",padding:"4px 8px","&:hover":{backgroundColor:`${i.palette.primary.main}14`}},children:"Clear"})]}),o.jsx(T,{ref:c,sx:{flex:1,overflow:"auto",padding:"8px 16px",display:"flex",flexDirection:"column",gap:"2px",scrollbarWidth:"thin",scrollbarColor:`${i.palette.divider} transparent`,"&::-webkit-scrollbar":{width:"6px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:i.palette.divider,borderRadius:"3px","&:hover":{backgroundColor:i.palette.divider}}},children:e.length===0?o.jsx(R,{sx:{color:i.palette.text.disabled,fontSize:"12px",fontStyle:"italic",textAlign:"center",marginTop:2},children:"No log messages"}):e.map(g=>o.jsx(u,{message:g},g.id))})]})})),pn=L.externalizeComponent(O.observer(t=>{const{store:e,onStoreReady:n,...a}=t,r=h.useRef(n);h.useEffect(()=>{r.current=n},[n]);const i=h.useMemo(()=>{var l;const s=e||new Ye;return(l=r.current)==null||l.call(r,s),s},[e]),c=()=>{i.clearMessages()};return o.jsx(Ze,{...a,messages:i.messages,onClear:c})}));function hn(){const t=window.location.href;return t.substring(0,t.indexOf("/",t.indexOf("//")+2))}function mn({baseUrl:t=hn(),...e}){return o.jsxs(Rt,{"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:[o.jsx(_t,{id:"no-motion-group-modal-title",children:"No motion group found"}),o.jsxs(Pt,{sx:{marginTop:"3rem",marginBottom:"1.5rem",textAlign:"center"},children:[o.jsx(R,{color:"#fff",children:"Found no devices to connect to."}),o.jsx(R,{color:"#fff",children:"Please ensure a motion group has been created."})]}),o.jsx(Et,{children:o.jsxs(_,{width:"100%",maxWidth:"300px",margin:"auto",marginBottom:"2rem",children:[o.jsx(Y,{href:`${t}/settings`,variant:"contained",sx:{borderRadius:"8px",width:"100%"},children:"Go to settings app"}),o.jsx(Y,{href:`${t}`,variant:"text",sx:{marginTop:"1rem",color:"#fff",textDecoration:"underline",fontSize:"0.75rem"},children:"Back to Homescreen"})]})})]})}var be=(t=>(t.PRECONDITION_NOT_FULFILLED="PRECONDITION_NOT_FULFILLED",t.ROBOT_DISCONNECTED="ROBOT_DISCONNECTED",t.CELL_OPEN="CELL_OPEN",t.E_STOP="E_STOP",t.MANUAL_MODE="MANUAL_MODE",t.READY="READY",t))(be||{});const Xe=L.externalizeComponent(O.observer(({setupState:t,className:e})=>{const n=D.useTheme(),{t:a}=B.useTranslation(),r=()=>{var u,m,g,p,d,b,S;switch(t){case"READY":return{label:a("RobotSetupReadinessIndicator.Ready.lb"),indicatorColor:((u=n.palette.tertiary)==null?void 0:u.main)||n.palette.primary.main,backgroundColor:((m=n.palette.backgroundPaperElevation)==null?void 0:m[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"ROBOT_DISCONNECTED":return{label:a("RobotSetupReadinessIndicator.RobotDisconnected.lb"),indicatorColor:n.palette.error.main,backgroundColor:((g=n.palette.backgroundPaperElevation)==null?void 0:g[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"CELL_OPEN":return{label:a("RobotSetupReadinessIndicator.CellOpen.lb"),indicatorColor:n.palette.error.main,backgroundColor:((p=n.palette.backgroundPaperElevation)==null?void 0:p[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"E_STOP":return{label:a("RobotSetupReadinessIndicator.EStop.lb"),indicatorColor:n.palette.error.main,backgroundColor:((d=n.palette.backgroundPaperElevation)==null?void 0:d[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case"MANUAL_MODE":return{label:a("RobotSetupReadinessIndicator.ManualMode.lb"),indicatorColor:n.palette.error.main,backgroundColor:((b=n.palette.backgroundPaperElevation)==null?void 0:b[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText};default:return{label:a("RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb"),indicatorColor:n.palette.error.main,backgroundColor:((S=n.palette.backgroundPaperElevation)==null?void 0:S[11])||n.palette.background.paper,textColor:n.palette.secondary.contrastText}}},{label:i,indicatorColor:c,backgroundColor:s,textColor:l}=r();return o.jsx(Ot,{className:e,label:o.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:1},children:[o.jsx(T,{sx:{width:8,height:8,borderRadius:"50%",backgroundColor:c,flexShrink:0}}),o.jsx(R,{variant:"body2",sx:{color:l,fontSize:"0.75rem",lineHeight:1.2},children:i})]}),variant:"filled",sx:{backgroundColor:s,color:n.palette.getContrastText(s),fontWeight:500,height:"auto","& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),fn=L.externalizeComponent(O.observer(({robotName:t,robotType:e,setupState:n,PreconditionComponent:a=Xe,className:r})=>{var l;const i=D.useTheme(),c=e||"Robot",s=n===be.READY;return o.jsxs(T,{className:r,sx:{border:`1px solid ${i.palette.divider}`,background:((l=i.palette.backgroundPaperElevation)==null?void 0:l[8])||"#292B3F",borderRadius:"8px",padding:"20px",display:"flex",alignItems:"center",justifyContent:"space-between",opacity:1},children:[o.jsxs(T,{sx:{display:"flex",alignItems:"center",gap:2,flex:1},children:[s?o.jsx(T,{sx:{fontSize:24,display:"flex",alignItems:"center",justifyContent:"center",width:24,height:24,"& svg":{fill:`${i.palette.primary.main} !important`},"& svg path":{fill:`${i.palette.primary.main} !important`}},children:o.jsx(W.ForwardRef$5,{})}):o.jsx(At,{sx:{color:i.palette.error.main,fontSize:24}}),o.jsx(R,{variant:"body1",sx:{fontWeight:500,color:i.palette.text.primary},children:t}),o.jsx(q,{orientation:"vertical",flexItem:!0,sx:{backgroundColor:i.palette.text.secondary,opacity:.3,width:"1px"}}),o.jsx(R,{variant:"body2",sx:{color:i.palette.text.secondary},children:c})]}),a&&o.jsx(a,{setupState:n})]})})),xn=D.styled(Dt,{shouldForwardProp:t=>t!=="selected"})(({theme:t})=>{var e,n,a;return{borderRadius:"20px","&:hover":{background:(e=t.palette.backgroundPaperElevation)==null?void 0:e[7]},variants:[{props:({selected:r})=>!r,style:{background:(n=t.palette.backgroundPaperElevation)==null?void 0:n[0],color:t.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:r})=>r,style:{background:(a=t.palette.backgroundPaperElevation)==null?void 0:a[11],border:`1px solid ${t.palette.divider}`,color:t.palette.primary.contrastText}}]}}),bn=t=>{const{ref:e,...n}=t;return o.jsx(xn,{ref:e,selected:t.selected,...n,color:"secondary",variant:"circular"})};function yn(t){const{children:e,value:n,index:a,...r}=t;return o.jsx("div",{role:"tabpanel",hidden:n!==a,id:`tabpanel-${a}`,"aria-labelledby":`tab-${a}`,...r,children:n===a&&o.jsx(T,{children:e})})}function Sn({children:t,...e}){const{fullWidth:n,indicator:a,onChange:r,orientation:i,scrollButtons:c,selectionFollowsFocus:s,textColor:l,value:u,variant:m,...g}=e;return o.jsx(T,{...g,children:t})}const jn=L.externalizeComponent(O.observer(t=>{const{items:e,activeTab:n,defaultActiveTab:a=0,onTabChange:r,sx:i,ref:c}=t,s=n!==void 0,[l,u]=h.useState(a),m=s?n:l;h.useEffect(()=>{s||e.length!==0&&(l<0||l>e.length-1)&&u(0)},[e.length,s,l]);const g=(p,d)=>{s||u(d),r==null||r(d)};return o.jsxs(T,{ref:c,sx:{height:"100%",display:"flex",flexDirection:"column",...i},children:[o.jsx(T,{sx:{px:0,py:0,overflow:"visible",position:"relative",paddingTop:p=>p.spacing(2),paddingRight:p=>p.spacing(2.5)},children:o.jsx(De,{value:m,onChange:g,sx:{minHeight:"32px",backgroundColor:"transparent",overflow:"visible","& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:2,overflow:"visible",paddingTop:0,paddingBottom:0},"& .MuiTabs-scroller":{overflow:"visible !important"},"& .MuiTab-root":{overflow:"visible"}},children:e.map((p,d)=>{var v,C,w;const b=()=>{if(!p.badge)return;const I=p.badge.content,E=p.badge.max;return typeof I=="number"&&E&&I>E?`${E}+`:I},S=()=>{if(!p.badge)return!1;const I=p.badge.content,E=p.badge.showZero;return!(I===0&&!E)},y=b(),f=S(),j=()=>{s||u(d),r==null||r(d)},x=o.jsx(Oe,{label:p.label,icon:p.icon,iconPosition:"start",disableRipple:!0,onClick:j,sx:{minHeight:"32px",height:"32px",padding:"0px 10px",borderRadius:"12px",backgroundColor:I=>{var E;return((E=I.palette.backgroundPaperElevation)==null?void 0:E[11])||"#32344B"},color:"text.primary",opacity:m===d?1:.38,fontSize:"13px",transition:"all 0.2s ease-in-out",position:"relative",overflow:"visible","&:hover":{opacity:m===d?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:I=>{var E;return((E=I.palette.backgroundPaperElevation)==null?void 0:E[11])||"#32344B"},color:"text.primary"},"&:focus":{outline:"none"},"&:active":{transform:"none"}}},p.id);return f?o.jsx(Sn,{component:"span",sx:{display:"inline-flex"},children:o.jsx(Jt,{badgeContent:y,color:((v=p.badge)==null?void 0:v.color)||"error",max:(C=p.badge)==null?void 0:C.max,showZero:(w=p.badge)==null?void 0:w.showZero,anchorOrigin:{vertical:"top",horizontal:"right"},overlap:"rectangular",sx:{"& .MuiBadge-badge":{opacity:"1 !important"}},children:x})},p.id):x})})}),o.jsx(T,{sx:{mt:p=>p.spacing(2),borderBottom:1,borderColor:"divider"}}),o.jsx(T,{sx:{flex:1,overflow:"auto"},children:e.map((p,d)=>o.jsx(yn,{value:m,index:d,children:p.content},p.id))})]})})),Cn=t=>{const e=Math.floor(t/86400),n=Math.floor(t%86400/3600),a=Math.floor(t%3600/60),r=t%60,i=[];return e>0?(i.push(e.toString()),i.push(n.toString().padStart(2,"0")),i.push(a.toString().padStart(2,"0")),i.push(r.toString().padStart(2,"0"))):n>0?(i.push(n.toString()),i.push(a.toString().padStart(2,"0")),i.push(r.toString().padStart(2,"0"))):(i.push(a.toString()),i.push(r.toString().padStart(2,"0"))),i.join(":")},Pe=(t,e)=>{const n=Math.floor(t/86400),a=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),i=t%60;if(typeof Intl<"u"&&"DurationFormat"in Intl)try{const s={};return n>0&&(s.days=n),a>0&&(s.hours=a),r>0&&(s.minutes=r),(i>0||Object.keys(s).length===0)&&(s.seconds=i),new Intl.DurationFormat(e,{style:"narrow"}).format(s)}catch{}const c=[];return n>0&&c.push(`${n}d`),a>0&&c.push(`${a}h`),r>0&&c.push(`${r}m`),(i>0||c.length===0)&&c.push(`${i}s`),c.join(" ")},vn=({timerState:t,animationState:e,hasError:n,className:a})=>{var g,p;const{t:r}=B.useTranslation(),i=D.useTheme(),{elapsedTime:c,currentProgress:s}=t,{showErrorAnimation:l,showPauseAnimation:u,showMainText:m}=e;return o.jsxs(T,{className:a,sx:{position:"relative",width:264,height:264,display:"flex",alignItems:"center",justifyContent:"center"},children:[o.jsx(Ft.Gauge,{width:264,height:264,value:s,valueMin:0,valueMax:100,innerRadius:"85%",outerRadius:"100%",margin:0,skipAnimation:!0,text:()=>"",sx:{opacity:u||l?.6:1,transition:"opacity 0.5s ease-out","& .MuiGauge-valueArc":{fill:n?i.palette.error.light:i.palette.success.main,transition:"fill 0.5s ease-out"},"& .MuiGauge-referenceArc":{fill:(g=i.palette.backgroundPaperElevation)==null?void 0:g[2],stroke:"transparent",strokeWidth:0,transition:"fill 0.5s ease-out, stroke 0.5s ease-out, stroke-width 0.5s ease-out"},"& .MuiGauge-valueText":{display:"none"},"& .MuiGauge-text":{display:"none"}}}),o.jsx(T,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:225,height:225,borderRadius:"50%",backgroundColor:(p=i.palette.backgroundPaperElevation)==null?void 0:p[8],display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:1,transition:"background-color 0.5s ease-out"},children:o.jsxs(T,{sx:{position:"relative",height:"48px",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:.5},children:[o.jsx(N,{in:m&&n,timeout:200,children:o.jsx(R,{variant:"h6",sx:{position:"absolute",fontSize:"16px",fontWeight:500,color:i.palette.error.light},children:r("timer.error")})}),o.jsx(N,{in:m&&!n,timeout:300,children:o.jsx(R,{variant:"h1",sx:{position:"absolute",fontSize:"48px",fontWeight:500,color:i.palette.text.primary,lineHeight:1,letterSpacing:"-0.5px"},children:Cn(c)})})]})})]})},Tn=({timerState:t,animationState:e,hasError:n,compact:a,className:r})=>{const{t:i,i18n:c}=B.useTranslation(),s=D.useTheme(),{elapsedTime:l,currentProgress:u}=t,{showErrorAnimation:m,showPauseAnimation:g}=e;return a?o.jsx(T,{className:r,sx:{display:"flex",alignItems:"center",m:0},children:o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:s.palette.text.primary,fontSize:"14px",transition:"color 0.5s ease-out"},children:n?i("timer.error"):Pe(l,c.language)})}):o.jsxs(T,{className:r,sx:{display:"flex",alignItems:"center",m:0,gap:1},children:[o.jsx(T,{sx:{width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",opacity:g||m?.6:1,transition:"opacity 0.5s ease-out"},children:o.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)"},role:"img","aria-label":"Timer progress",children:[o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:s.palette.success.main,strokeWidth:"2",opacity:.3,style:{transition:"stroke 0.8s ease-in-out, opacity 2s ease-in-out"}}),o.jsx("circle",{cx:"10",cy:"10",r:"8",fill:"none",stroke:n?s.palette.error.light:s.palette.success.main,strokeWidth:"2",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-u/100)}`,style:{transition:"stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out"}})]})}),o.jsx(R,{variant:"body2",sx:{color:n?s.palette.error.light:s.palette.text.primary,fontSize:"14px",lineHeight:"normal",letterSpacing:"normal",transition:"color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out"},children:n?i("timer.error"):Pe(l,c.language)})]})},wn=()=>{const[t,e]=h.useState({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),n=h.useRef(null),a=h.useRef(null),r=h.useRef(null),i=h.useCallback(()=>{e(g=>({...g,showPauseAnimation:!0})),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{e(g=>({...g,showPauseAnimation:!1}))},800)},[]),c=h.useCallback(()=>{e(g=>({...g,showErrorAnimation:!0})),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{e(g=>({...g,showErrorAnimation:!1}))},600)},[]),s=h.useCallback(()=>{e(g=>({...g,showErrorAnimation:!1})),a.current&&clearTimeout(a.current)},[]),l=h.useCallback(()=>{e(g=>({...g,showMainText:!1})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{e(g=>({...g,showMainText:!0}))},200)},[]),u=h.useCallback(()=>{e(g=>({...g,showMainText:!0}))},[]),m=h.useCallback(()=>{n.current&&clearTimeout(n.current),a.current&&clearTimeout(a.current),r.current&&clearTimeout(r.current)},[]);return{animationState:t,triggerPauseAnimation:i,triggerErrorAnimation:c,clearErrorAnimation:s,triggerFadeTransition:l,setInitialAnimationState:u,cleanup:m}},In=({autoStart:t,hasError:e,onPauseAnimation:n,onErrorAnimation:a,onClearErrorAnimation:r})=>{const[i,c]=h.useState({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),s=h.useRef(null),l=h.useRef(null),u=h.useRef(0),m=h.useRef(0),[g]=ee.useInterpolation([0],{tension:80,friction:18,onChange:([f])=>{c(j=>({...j,currentProgress:f}))}}),p=h.useCallback((f=0)=>{const j=f/60%1*100;c(x=>({...x,elapsedTime:f,isPausedState:!1,currentProgress:j})),u.current=0,m.current=j,g.setImmediate([j]),t?(l.current=Date.now()-f*1e3,c(x=>({...x,isRunning:!0}))):l.current=null},[t,g]),d=h.useCallback(()=>{if(l.current&&i.isRunning){const j=(Date.now()-l.current)/1e3+u.current,x=j/60%1*100;g.setTarget([x]),c(v=>({...v,elapsedTime:Math.floor(j)}))}c(f=>({...f,isRunning:!1,isPausedState:!0})),n()},[i.isRunning,g,n]),b=h.useCallback(()=>{i.isPausedState&&(u.current=i.elapsedTime,l.current=Date.now(),c(f=>({...f,isRunning:!0,isPausedState:!1})))},[i.isPausedState,i.elapsedTime]),S=h.useCallback(()=>{c(f=>({...f,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),u.current=0,l.current=null,m.current=0,g.setImmediate([0])},[g]),y=h.useCallback(()=>i.isPausedState,[i.isPausedState]);return h.useEffect(()=>{e?(i.isRunning&&(c(f=>({...f,wasRunningBeforeError:!0})),d()),a()):(i.wasRunningBeforeError&&!i.isRunning&&(c(f=>({...f,wasRunningBeforeError:!1})),b()),r())},[e,i.isRunning,i.wasRunningBeforeError,d,b,a,r]),h.useEffect(()=>{if(i.isRunning){const f=()=>{if(l.current){const x=(Date.now()-l.current)/1e3+u.current,v=x/60%1*100;c(w=>({...w,elapsedTime:Math.floor(x)})),Math.abs(v-m.current)>.1&&(g.setTarget([v]),m.current=v)}s.current=requestAnimationFrame(f)};s.current=requestAnimationFrame(f)}else s.current&&(cancelAnimationFrame(s.current),s.current=null);return()=>{s.current&&(cancelAnimationFrame(s.current),s.current=null)}},[i.isRunning,g]),h.useEffect(()=>{let f=null;const j=()=>{g.update(),f=requestAnimationFrame(j)};return f=requestAnimationFrame(j),()=>{f&&cancelAnimationFrame(f)}},[g]),{timerState:i,controls:{start:p,pause:d,resume:b,reset:S,isPaused:y}}},Mn=L.externalizeComponent(O.observer(({onTimerReady:t,autoStart:e=!0,variant:n="default",compact:a=!1,className:r,hasError:i=!1})=>{const{animationState:c,triggerPauseAnimation:s,triggerErrorAnimation:l,clearErrorAnimation:u,setInitialAnimationState:m,cleanup:g}=wn(),{timerState:p,controls:d}=In({autoStart:e,hasError:i,onPauseAnimation:s,onErrorAnimation:l,onClearErrorAnimation:u});return h.useEffect(()=>{m()},[m]),h.useEffect(()=>{let b=!0;const S=setTimeout(()=>{b&&t(d)},0);return()=>{b=!1,clearTimeout(S)}},[t,d]),h.useEffect(()=>g,[g]),n==="small"?o.jsx(Tn,{timerState:p,animationState:c,hasError:i,compact:a,className:r}):o.jsx(vn,{timerState:p,animationState:c,hasError:i,className:r})})),_e=1e-4,kn={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1};class ae{constructor(e,n,a,r,i,c,s,l,u,m,g="cell"){this.controller=n,this.motionGroup=a,this.initialMotionState=r,this.motionStateSocket=i,this.isVirtual=c,this.tcps=s,this.description=l,this.initialControllerState=u,this.controllerStateSocket=m,this.cellId=g,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState="inactive",this.nova=re(e),this.rapidlyChangingMotionState=r,this.controllerState=u,m.addEventListener("message",p=>{var b;const d=(b=J.tryParseJson(p.data))==null?void 0:b.result;d&&k.runInAction(()=>{this.controllerState=d})}),i.addEventListener("message",p=>{var b;const d=(b=J.tryParseJson(p.data))==null?void 0:b.result;if(!d)throw new Error(`Failed to get motion state for ${this.motionGroupId}: ${p.data}`);me(this.rapidlyChangingMotionState.joint_position,d.joint_position,_e)||k.runInAction(()=>{this.rapidlyChangingMotionState.joint_position=d.joint_position}),fe(this.rapidlyChangingMotionState,d,_e)||k.runInAction(()=>{this.rapidlyChangingMotionState.tcp_pose=d.tcp_pose}),d.tcp!==void 0&&this.rapidlyChangingMotionState.tcp!==d.tcp&&k.runInAction(()=>{this.rapidlyChangingMotionState.tcp=d.tcp}),this.rapidlyChangingMotionState.standstill!==d.standstill&&k.runInAction(()=>{this.rapidlyChangingMotionState.standstill=d.standstill})}),k.makeAutoObservable(this)}static async connectMultiple(e,n,a={}){return Promise.all(n.map(r=>ae.connect(e,r,a)))}static async connect(e,n,a={}){var v,C;const r=re(e),i=a.cellId??"cell",[c,s]=n.split("@"),l=await r.api.controller.getCurrentRobotControllerState(i,s),u=l==null?void 0:l.motion_groups.find(w=>w.motion_group===n);if(!l||!u)throw new Error(`Controller ${s} or motion group ${n} not found`);const m=r.openReconnectingWebsocket(`/cells/${i}/controllers/${s}/motion-groups/${n}/state-stream`),g=await m.firstMessage(),p=(v=J.tryParseJson(g.data))==null?void 0:v.result;if(!p)throw new Error(`Unable to parse initial motion state message ${g.data}`);console.log(`Connected motion state websocket to motion group ${u.motion_group}. Initial state:
3
+ `,p);const b=(await r.api.controller.getRobotController(i,l.controller)).configuration.kind==="VirtualController",S=await r.api.motionGroup.getMotionGroupDescription(i,s,u.motion_group),y=Object.entries(S.tcps||{}).map(([w,I])=>({id:w,readable_name:I.name,position:I.pose.position,orientation:I.pose.orientation})),f=r.openReconnectingWebsocket(`/cells/${i}/controllers/${l.controller}/state-stream?response_rate=1000`),j=await f.firstMessage(),x=(C=J.tryParseJson(j.data))==null?void 0:C.result;if(!x)throw new Error(`Unable to parse initial controller state message ${j.data}`);return console.log(`Connected controller state websocket to controller ${l.controller}. Initial state:
4
+ `,x),new ae(r,l,u,p,m,b,y,S,x,f,i)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get modelFromController(){return this.description.motion_group_model}get joggingVelocityRads(){return this.joggingVelocity*Math.PI/180}get joints(){return this.initialMotionState.joint_position.map((e,n)=>({index:n}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(e=>({...kn,...e}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){var e,n,a;return this.description.mounting?[(((e=this.description.mounting.position)==null?void 0:e[0])||0)/1e3,(((n=this.description.mounting.position)==null?void 0:n[1])||0)/1e3,(((a=this.description.mounting.position)==null?void 0:a[2])||0)/1e3]:[0,0,0]}get mountingQuaternion(){var r,i,c,s,l,u;const e=new ke.Vector3(((i=(r=this.description.mounting)==null?void 0:r.orientation)==null?void 0:i[0])||0,((s=(c=this.description.mounting)==null?void 0:c.orientation)==null?void 0:s[1])||0,((u=(l=this.description.mounting)==null?void 0:l.orientation)==null?void 0:u[2])||0),n=e.length(),a=e.normalize();return new ke.Quaternion().setFromAxisAngle(a,n)}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"}async deactivate(){if(this.activationState!=="active"){console.error("Tried to deactivate while already deactivating");return}k.runInAction(()=>{this.activationState="deactivating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_MONITOR"),k.runInAction(()=>{this.activationState="inactive"})}catch(e){throw k.runInAction(()=>{this.activationState="active"}),e}}async activate(){if(this.activationState!=="inactive"){console.error("Tried to activate while already activating");return}k.runInAction(()=>{this.activationState="activating"});try{await this.nova.api.controller.setDefaultMode(this.cellId,this.controllerId,"ROBOT_SYSTEM_MODE_CONTROL"),k.runInAction(()=>{this.activationState="active"})}catch(e){throw k.runInAction(()=>{this.activationState="inactive"}),e}}toggleActivation(){this.activationState==="inactive"?this.activate():this.activationState==="active"&&this.deactivate()}dispose(){this.motionStateSocket.close(),this.connectedJoggingSocket&&this.connectedJoggingSocket.close()}setJoggingVelocity(e){this.joggingVelocity=e}}const K="rgba(255, 255, 255, 1)",Rn={components:{MuiCssBaseline:{styleOverrides:{".MuiDataGrid-panelContent":{borderRadius:"16px !important","& .MuiPaper-root":{borderRadius:"16px !important"}},".MuiDataGrid-filterForm":{borderRadius:"16px !important","& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}},"& .MuiTextField-root":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}},".MuiDataGrid-filterFormValueInput":{"& .MuiInputBase-root":{borderRadius:"16px !important","& fieldset":{borderRadius:"16px !important"},"& .MuiOutlinedInput-notchedOutline":{borderRadius:"16px !important"}}}}},MuiDataGrid:{styleOverrides:{panelContent:{borderRadius:"16px !important"},filterForm:{"& .MuiInputBase-root":{borderRadius:`${U.RadiusSm}px !important`,"& fieldset":{borderRadius:`${U.RadiusSm}px !important`},"& .MuiOutlinedInput-notchedOutline":{borderRadius:`${U.RadiusSm}px !important`}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:`${U.RadiusSm}px !important`,"& fieldset":{borderRadius:`${U.RadiusSm}px !important`},"& .MuiOutlinedInput-notchedOutline":{borderRadius:`${U.RadiusSm}px !important`}}}}}},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:K},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:K},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:K}}},JoggingJoint:{Joint:{arrowColor:K}},VelocitySlider:{sliderLegendColor:K}}}};function Qe(...t){return Lt.createNovaMuiTheme(Rn,...t)}function En(t={}){return Qe(t)}exports.AppHeader=$t;exports.ConnectedMotionGroup=ae;exports.CycleTimer=Ht;exports.JoggerConnection=le;exports.JoggingCartesianAxisControl=ge;exports.JoggingJointValueControl=Be;exports.JoggingPanel=rn;exports.JoggingStore=ce;exports.LoadingCover=Ve;exports.LoadingErrorMessage=qe;exports.LogPanel=pn;exports.LogStore=Ye;exports.LogViewer=Ze;exports.MotionStreamConnection=se;exports.NoMotionGroupModal=mn;exports.PoseCartesianValues=sn;exports.PoseJointValues=ln;exports.RobotListItem=fn;exports.RobotSetupReadinessIndicator=Xe;exports.RobotSetupReadinessState=be;exports.SelectableFab=bn;exports.TabBar=jn;exports.Timer=Mn;exports.VelocitySlider=We;exports.VelocitySliderLabel=xe;exports.WandelbotsDataGrid=Le;exports.createDebugMessage=cn;exports.createErrorMessage=gn;exports.createInfoMessage=un;exports.createLogMessage=te;exports.createNovaMuiTheme=En;exports.createNovaTheme=Qe;exports.createWarningMessage=dn;exports.jointValuesEqual=me;exports.poseEqual=ze;exports.tcpMotionEqual=fe;exports.unwrapRotationVector=$e;
@@ -1,12 +1,14 @@
1
1
  import type { SxProps } from "@mui/material/styles";
2
- import { NovaClient } from "@wandelbots/nova-js/v2";
2
+ import type { AnyNovaClient } from "../../lib/novaCompat";
3
3
  import { JoggingStore } from "./JoggingStore";
4
4
  export type JoggingPanelTabId = "cartesian" | "joint";
5
5
  export type JoggingPanelProps = {
6
- /** Either an existing NovaClient or the base url of a deployed Nova instance */
7
- nova: NovaClient | string;
6
+ /** Either an existing Nova client or the base url of a deployed Nova instance */
7
+ nova: AnyNovaClient | string;
8
8
  /** Id of the motion group to move e.g. 0@ur5e */
9
9
  motionGroupId: string;
10
+ /** Cell id on the Nova instance. Defaults to "cell". */
11
+ cellId?: string;
10
12
  /** Callback with the jogging panel's state store for further customization/config */
11
13
  onSetup?: (store: JoggingStore) => void;
12
14
  /** Any children will go at the bottom of the panel under the default contents */
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/theming-DTS9g0aC.cjs"),o=require("./chunks/interpolation-C9sLsved.cjs"),t=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),a=require("./chunks/SafetyBar-VvOZ9aRM.cjs");exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=o.ProgramControl;exports.ProgramState=o.ProgramState;exports.ProgramStateIndicator=o.ProgramStateIndicator;exports.ValueInterpolator=o.ValueInterpolator;exports.useAnimationFrame=o.useAnimationFrame;exports.useAutorun=o.useAutorun;exports.useInterpolation=o.useInterpolation;exports.useMounted=o.useMounted;exports.useReaction=o.useReaction;exports.i18n=t.i18n;exports.SafetyBar=a.SafetyBar;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/theming-BYmiJfgQ.cjs"),o=require("./chunks/interpolation-C9sLsved.cjs"),t=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),a=require("./chunks/SafetyBar-VvOZ9aRM.cjs");exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createNovaTheme=e.createNovaTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=o.ProgramControl;exports.ProgramState=o.ProgramState;exports.ProgramStateIndicator=o.ProgramStateIndicator;exports.ValueInterpolator=o.ValueInterpolator;exports.useAnimationFrame=o.useAnimationFrame;exports.useAutorun=o.useAutorun;exports.useInterpolation=o.useInterpolation;exports.useMounted=o.useMounted;exports.useReaction=o.useReaction;exports.i18n=t.i18n;exports.SafetyBar=a.SafetyBar;
package/dist/core.d.ts CHANGED
@@ -29,4 +29,4 @@ export * from "./lib/motionStateUpdate";
29
29
  export * from "./lib/MotionStreamConnection";
30
30
  export * from "./SafetyBar";
31
31
  export * from "./themes/themeTypes";
32
- export { createNovaMuiTheme } from "./themes/theming";
32
+ export { createNovaTheme, createNovaMuiTheme } from "./themes/theming";
package/dist/core.js CHANGED
@@ -1,7 +1,7 @@
1
- import { A as o, s, C as t, t as r, a as n, b as i, d as g, J as l, f as u, g as c, h as d, L as p, n as m, M, N as S, P as b, e as C, R as V, p as L, o as P, S as f, T as J, q as R, V as x, r as I, W as A, j as E, m as T, k as q, i as y, c as v, l as w, u as G, v as N, w as W, x as h } from "./chunks/theming-BU4-W3Wy.js";
2
- import { a as B, P as D, b as F, V as k, e as H, c as z, f as K, u as O, d as Q } from "./chunks/interpolation-DG8VTxzS.js";
3
- import { i as X } from "./chunks/externalizeComponent-EDymnaGR.js";
4
- import { S as Z } from "./chunks/SafetyBar-CxxIVVeR.js";
1
+ import { A as o, t as s, C as t, u as r, b as n, d as i, e as g, J as l, g as u, h as c, i as d, L as m, o as p, M, N as S, P as b, f as C, R as V, q as L, p as P, S as f, T as J, r as R, V as x, s as I, W as T, k as y, n as A, l as E, j as q, a as v, c as N, m as h, v as w, w as G, x as W, y as j } from "./chunks/theming-BQJrwLJN.js";
2
+ import { a as D, P as F, b as k, V as H, e as z, c as K, f as O, u as Q, d as U } from "./chunks/interpolation-DG8VTxzS.js";
3
+ import { i as Y } from "./chunks/externalizeComponent-EDymnaGR.js";
4
+ import { S as _ } from "./chunks/SafetyBar-CxxIVVeR.js";
5
5
  export {
6
6
  o as AppHeader,
7
7
  s as ConnectedMotionGroup,
@@ -14,40 +14,41 @@ export {
14
14
  u as LoadingCover,
15
15
  c as LoadingErrorMessage,
16
16
  d as LogPanel,
17
- p as LogStore,
18
- m as LogViewer,
17
+ m as LogStore,
18
+ p as LogViewer,
19
19
  M as MotionStreamConnection,
20
20
  S as NoMotionGroupModal,
21
21
  b as PoseCartesianValues,
22
22
  C as PoseJointValues,
23
- B as ProgramControl,
24
- D as ProgramState,
25
- F as ProgramStateIndicator,
23
+ D as ProgramControl,
24
+ F as ProgramState,
25
+ k as ProgramStateIndicator,
26
26
  V as RobotListItem,
27
27
  L as RobotSetupReadinessIndicator,
28
28
  P as RobotSetupReadinessState,
29
- Z as SafetyBar,
29
+ _ as SafetyBar,
30
30
  f as SelectableFab,
31
31
  J as TabBar,
32
32
  R as Timer,
33
- k as ValueInterpolator,
33
+ H as ValueInterpolator,
34
34
  x as VelocitySlider,
35
35
  I as VelocitySliderLabel,
36
- A as WandelbotsDataGrid,
37
- E as createDebugMessage,
38
- T as createErrorMessage,
39
- q as createInfoMessage,
40
- y as createLogMessage,
36
+ T as WandelbotsDataGrid,
37
+ y as createDebugMessage,
38
+ A as createErrorMessage,
39
+ E as createInfoMessage,
40
+ q as createLogMessage,
41
41
  v as createNovaMuiTheme,
42
- w as createWarningMessage,
43
- X as i18n,
44
- G as jointValuesEqual,
45
- N as poseEqual,
42
+ N as createNovaTheme,
43
+ h as createWarningMessage,
44
+ Y as i18n,
45
+ w as jointValuesEqual,
46
+ G as poseEqual,
46
47
  W as tcpMotionEqual,
47
- h as unwrapRotationVector,
48
- H as useAnimationFrame,
49
- z as useAutorun,
50
- K as useInterpolation,
51
- O as useMounted,
52
- Q as useReaction
48
+ j as unwrapRotationVector,
49
+ z as useAnimationFrame,
50
+ K as useAutorun,
51
+ O as useInterpolation,
52
+ Q as useMounted,
53
+ U as useReaction
53
54
  };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/MotionGroupVisualizer-MKZ2-1oY.cjs"),e=require("./chunks/theming-DTS9g0aC.cjs"),t=require("./chunks/interpolation-C9sLsved.cjs"),i=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),s=require("./chunks/SafetyBar-VvOZ9aRM.cjs"),a=require("./chunks/robot-SEtfVAmf.cjs"),n=require("./chunks/wbLogo-G_IfZ03l.cjs"),r=require("./chunks/safety-state-stop-CgPfwC18.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.LinearAxis=o.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=o.MANUFACTURER_HOME_CONFIGS;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.RobotCard=o.RobotCard;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedRobot=o.SupportedRobot;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultAxisConfig=o.defaultAxisConfig;exports.defaultGetModel=o.defaultGetModel;exports.extractManufacturer=o.extractManufacturer;exports.getDefaultHomeConfig=o.getDefaultHomeConfig;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=t.ProgramControl;exports.ProgramState=t.ProgramState;exports.ProgramStateIndicator=t.ProgramStateIndicator;exports.ValueInterpolator=t.ValueInterpolator;exports.useAnimationFrame=t.useAnimationFrame;exports.useAutorun=t.useAutorun;exports.useInterpolation=t.useInterpolation;exports.useMounted=t.useMounted;exports.useReaction=t.useReaction;exports.i18n=i.i18n;exports.SafetyBar=s.SafetyBar;exports.AxisXIcon=a.ForwardRef;exports.AxisYIcon=a.ForwardRef$1;exports.AxisZIcon=a.ForwardRef$2;exports.JogMinusIcon=a.ForwardRef$3;exports.JogPlusIcon=a.ForwardRef$4;exports.RobotIcon=a.ForwardRef$5;exports.RotationIcon=a.ForwardRef$6;exports.HomeIcon=n.ForwardRef;exports.JoggingIcon=n.ForwardRef$1;exports.OrientationCoordSystemIcon=n.ForwardRef$2;exports.OrientationToolIcon=n.ForwardRef$3;exports.WBLogoIcon=n.ForwardRef$4;exports.ControllerTypePhysicalIcon=r.ForwardRef;exports.ControllerTypeVirtualIcon=r.ForwardRef$1;exports.OperationModeAutomaticIcon=r.ForwardRef$2;exports.OperationModeErrorIcon=r.ForwardRef$3;exports.OperationModeManualIcon=r.ForwardRef$4;exports.SafetyStateErrorIcon=r.ForwardRef$5;exports.SafetyStateEstopIcon=r.ForwardRef$6;exports.SafetyStateManualActionRequiredIcon=r.ForwardRef$7;exports.SafetyStateNormalIcon=r.ForwardRef$8;exports.SafetyStateStopIcon=r.ForwardRef$9;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./chunks/MotionGroupVisualizer-C0QhAyXX.cjs"),e=require("./chunks/theming-BYmiJfgQ.cjs"),t=require("./chunks/interpolation-C9sLsved.cjs"),i=require("./chunks/externalizeComponent-OO4jcrz5.cjs"),s=require("./chunks/SafetyBar-VvOZ9aRM.cjs"),a=require("./chunks/robot-SEtfVAmf.cjs"),n=require("./chunks/wbLogo-G_IfZ03l.cjs"),r=require("./chunks/safety-state-stop-CgPfwC18.cjs");exports.CollisionSceneRenderer=o.CollisionSceneRenderer;exports.LinearAxis=o.LinearAxis;exports.MANUFACTURER_HOME_CONFIGS=o.MANUFACTURER_HOME_CONFIGS;exports.MotionGroupVisualizer=o.MotionGroupVisualizer;exports.PresetEnvironment=o.PresetEnvironment;exports.Robot=o.Robot;exports.RobotCard=o.RobotCard;exports.SafetyZonesRenderer=o.SafetyZonesRenderer;exports.SupportedLinearAxis=o.SupportedLinearAxis;exports.SupportedRobot=o.SupportedRobot;exports.TrajectoryRenderer=o.TrajectoryRenderer;exports.defaultAxisConfig=o.defaultAxisConfig;exports.defaultGetModel=o.defaultGetModel;exports.extractManufacturer=o.extractManufacturer;exports.getDefaultHomeConfig=o.getDefaultHomeConfig;exports.AppHeader=e.AppHeader;exports.ConnectedMotionGroup=e.ConnectedMotionGroup;exports.CycleTimer=e.CycleTimer;exports.JoggerConnection=e.JoggerConnection;exports.JoggingCartesianAxisControl=e.JoggingCartesianAxisControl;exports.JoggingJointValueControl=e.JoggingJointValueControl;exports.JoggingPanel=e.JoggingPanel;exports.JoggingStore=e.JoggingStore;exports.LoadingCover=e.LoadingCover;exports.LoadingErrorMessage=e.LoadingErrorMessage;exports.LogPanel=e.LogPanel;exports.LogStore=e.LogStore;exports.LogViewer=e.LogViewer;exports.MotionStreamConnection=e.MotionStreamConnection;exports.NoMotionGroupModal=e.NoMotionGroupModal;exports.PoseCartesianValues=e.PoseCartesianValues;exports.PoseJointValues=e.PoseJointValues;exports.RobotListItem=e.RobotListItem;exports.RobotSetupReadinessIndicator=e.RobotSetupReadinessIndicator;exports.RobotSetupReadinessState=e.RobotSetupReadinessState;exports.SelectableFab=e.SelectableFab;exports.TabBar=e.TabBar;exports.Timer=e.Timer;exports.VelocitySlider=e.VelocitySlider;exports.VelocitySliderLabel=e.VelocitySliderLabel;exports.WandelbotsDataGrid=e.WandelbotsDataGrid;exports.createDebugMessage=e.createDebugMessage;exports.createErrorMessage=e.createErrorMessage;exports.createInfoMessage=e.createInfoMessage;exports.createLogMessage=e.createLogMessage;exports.createNovaMuiTheme=e.createNovaMuiTheme;exports.createNovaTheme=e.createNovaTheme;exports.createWarningMessage=e.createWarningMessage;exports.jointValuesEqual=e.jointValuesEqual;exports.poseEqual=e.poseEqual;exports.tcpMotionEqual=e.tcpMotionEqual;exports.unwrapRotationVector=e.unwrapRotationVector;exports.ProgramControl=t.ProgramControl;exports.ProgramState=t.ProgramState;exports.ProgramStateIndicator=t.ProgramStateIndicator;exports.ValueInterpolator=t.ValueInterpolator;exports.useAnimationFrame=t.useAnimationFrame;exports.useAutorun=t.useAutorun;exports.useInterpolation=t.useInterpolation;exports.useMounted=t.useMounted;exports.useReaction=t.useReaction;exports.i18n=i.i18n;exports.SafetyBar=s.SafetyBar;exports.AxisXIcon=a.ForwardRef;exports.AxisYIcon=a.ForwardRef$1;exports.AxisZIcon=a.ForwardRef$2;exports.JogMinusIcon=a.ForwardRef$3;exports.JogPlusIcon=a.ForwardRef$4;exports.RobotIcon=a.ForwardRef$5;exports.RotationIcon=a.ForwardRef$6;exports.HomeIcon=n.ForwardRef;exports.JoggingIcon=n.ForwardRef$1;exports.OrientationCoordSystemIcon=n.ForwardRef$2;exports.OrientationToolIcon=n.ForwardRef$3;exports.WBLogoIcon=n.ForwardRef$4;exports.ControllerTypePhysicalIcon=r.ForwardRef;exports.ControllerTypeVirtualIcon=r.ForwardRef$1;exports.OperationModeAutomaticIcon=r.ForwardRef$2;exports.OperationModeErrorIcon=r.ForwardRef$3;exports.OperationModeManualIcon=r.ForwardRef$4;exports.SafetyStateErrorIcon=r.ForwardRef$5;exports.SafetyStateEstopIcon=r.ForwardRef$6;exports.SafetyStateManualActionRequiredIcon=r.ForwardRef$7;exports.SafetyStateNormalIcon=r.ForwardRef$8;exports.SafetyStateStopIcon=r.ForwardRef$9;
package/dist/index.js CHANGED
@@ -1,64 +1,64 @@
1
- import { C as e, L as s, M as t, h as r, P as n, b as i, R as c, S as l, c as g, f as u, T as d, a as p, d as S, e as I, g as f } from "./chunks/MotionGroupVisualizer-Q7ifc7Kd.js";
2
- import { A as m, s as C, C as R, t as b, a as x, b as y, d as A, J as L, f as P, g as V, h as E, L as J, n as T, M as F, N as O, P as G, e as N, R as h, p as q, o as v, S as H, T as W, q as j, V as w, r as B, W as D, j as U, m as Z, k as _, i as k, c as z, l as X, u as Y, v as K, w as Q, x as $ } from "./chunks/theming-BU4-W3Wy.js";
3
- import { a as oa, P as ea, b as sa, V as ta, e as ra, c as na, f as ia, u as ca, d as la } from "./chunks/interpolation-DG8VTxzS.js";
4
- import { i as ua } from "./chunks/externalizeComponent-EDymnaGR.js";
5
- import { S as pa } from "./chunks/SafetyBar-CxxIVVeR.js";
6
- import { F as Ia, a as fa, b as Ma, c as ma, d as Ca, e as Ra, f as ba } from "./chunks/robot-Cy9ST5-m.js";
7
- import { F as ya, a as Aa, b as La, c as Pa, d as Va } from "./chunks/wbLogo-CObCmqTw.js";
8
- import { F as Ja, a as Ta, b as Fa, c as Oa, d as Ga, e as Na, f as ha, g as qa, h as va, i as Ha } from "./chunks/safety-state-stop-CJW5CKkp.js";
1
+ import { C as e, L as s, M as t, h as r, P as n, b as i, R as c, S as l, c as g, f as u, T as d, a as p, d as S, e as I, g as f } from "./chunks/MotionGroupVisualizer-Tb3EF_Jv.js";
2
+ import { A as M, t as C, C as R, u as b, b as x, d as y, e as A, J as L, g as P, h as V, i as T, L as E, o as J, M as F, N, P as O, f as h, R as G, q, p as v, S as H, T as W, r as j, V as w, s as B, W as D, k as U, n as Z, l as _, j as k, a as z, c as X, m as Y, v as K, w as Q, x as $, y as aa } from "./chunks/theming-BQJrwLJN.js";
3
+ import { a as ea, P as sa, b as ta, V as ra, e as na, c as ia, f as ca, u as la, d as ga } from "./chunks/interpolation-DG8VTxzS.js";
4
+ import { i as da } from "./chunks/externalizeComponent-EDymnaGR.js";
5
+ import { S as Sa } from "./chunks/SafetyBar-CxxIVVeR.js";
6
+ import { F as fa, a as ma, b as Ma, c as Ca, d as Ra, e as ba, f as xa } from "./chunks/robot-Cy9ST5-m.js";
7
+ import { F as Aa, a as La, b as Pa, c as Va, d as Ta } from "./chunks/wbLogo-CObCmqTw.js";
8
+ import { F as Ja, a as Fa, b as Na, c as Oa, d as ha, e as Ga, f as qa, g as va, h as Ha, i as Wa } from "./chunks/safety-state-stop-CJW5CKkp.js";
9
9
  export {
10
- m as AppHeader,
11
- Ia as AxisXIcon,
12
- fa as AxisYIcon,
10
+ M as AppHeader,
11
+ fa as AxisXIcon,
12
+ ma as AxisYIcon,
13
13
  Ma as AxisZIcon,
14
14
  e as CollisionSceneRenderer,
15
15
  C as ConnectedMotionGroup,
16
16
  Ja as ControllerTypePhysicalIcon,
17
- Ta as ControllerTypeVirtualIcon,
17
+ Fa as ControllerTypeVirtualIcon,
18
18
  R as CycleTimer,
19
- ya as HomeIcon,
20
- ma as JogMinusIcon,
21
- Ca as JogPlusIcon,
19
+ Aa as HomeIcon,
20
+ Ca as JogMinusIcon,
21
+ Ra as JogPlusIcon,
22
22
  b as JoggerConnection,
23
23
  x as JoggingCartesianAxisControl,
24
- Aa as JoggingIcon,
24
+ La as JoggingIcon,
25
25
  y as JoggingJointValueControl,
26
26
  A as JoggingPanel,
27
27
  L as JoggingStore,
28
28
  s as LinearAxis,
29
29
  P as LoadingCover,
30
30
  V as LoadingErrorMessage,
31
- E as LogPanel,
32
- J as LogStore,
33
- T as LogViewer,
31
+ T as LogPanel,
32
+ E as LogStore,
33
+ J as LogViewer,
34
34
  t as MANUFACTURER_HOME_CONFIGS,
35
35
  r as MotionGroupVisualizer,
36
36
  F as MotionStreamConnection,
37
- O as NoMotionGroupModal,
38
- Fa as OperationModeAutomaticIcon,
37
+ N as NoMotionGroupModal,
38
+ Na as OperationModeAutomaticIcon,
39
39
  Oa as OperationModeErrorIcon,
40
- Ga as OperationModeManualIcon,
41
- La as OrientationCoordSystemIcon,
42
- Pa as OrientationToolIcon,
43
- G as PoseCartesianValues,
44
- N as PoseJointValues,
40
+ ha as OperationModeManualIcon,
41
+ Pa as OrientationCoordSystemIcon,
42
+ Va as OrientationToolIcon,
43
+ O as PoseCartesianValues,
44
+ h as PoseJointValues,
45
45
  n as PresetEnvironment,
46
- oa as ProgramControl,
47
- ea as ProgramState,
48
- sa as ProgramStateIndicator,
46
+ ea as ProgramControl,
47
+ sa as ProgramState,
48
+ ta as ProgramStateIndicator,
49
49
  i as Robot,
50
50
  c as RobotCard,
51
- Ra as RobotIcon,
52
- h as RobotListItem,
51
+ ba as RobotIcon,
52
+ G as RobotListItem,
53
53
  q as RobotSetupReadinessIndicator,
54
54
  v as RobotSetupReadinessState,
55
- ba as RotationIcon,
56
- pa as SafetyBar,
57
- Na as SafetyStateErrorIcon,
58
- ha as SafetyStateEstopIcon,
59
- qa as SafetyStateManualActionRequiredIcon,
60
- va as SafetyStateNormalIcon,
61
- Ha as SafetyStateStopIcon,
55
+ xa as RotationIcon,
56
+ Sa as SafetyBar,
57
+ Ga as SafetyStateErrorIcon,
58
+ qa as SafetyStateEstopIcon,
59
+ va as SafetyStateManualActionRequiredIcon,
60
+ Ha as SafetyStateNormalIcon,
61
+ Wa as SafetyStateStopIcon,
62
62
  l as SafetyZonesRenderer,
63
63
  H as SelectableFab,
64
64
  g as SupportedLinearAxis,
@@ -66,29 +66,30 @@ export {
66
66
  W as TabBar,
67
67
  j as Timer,
68
68
  d as TrajectoryRenderer,
69
- ta as ValueInterpolator,
69
+ ra as ValueInterpolator,
70
70
  w as VelocitySlider,
71
71
  B as VelocitySliderLabel,
72
- Va as WBLogoIcon,
72
+ Ta as WBLogoIcon,
73
73
  D as WandelbotsDataGrid,
74
74
  U as createDebugMessage,
75
75
  Z as createErrorMessage,
76
76
  _ as createInfoMessage,
77
77
  k as createLogMessage,
78
78
  z as createNovaMuiTheme,
79
- X as createWarningMessage,
79
+ X as createNovaTheme,
80
+ Y as createWarningMessage,
80
81
  p as defaultAxisConfig,
81
82
  S as defaultGetModel,
82
83
  I as extractManufacturer,
83
84
  f as getDefaultHomeConfig,
84
- ua as i18n,
85
- Y as jointValuesEqual,
86
- K as poseEqual,
87
- Q as tcpMotionEqual,
88
- $ as unwrapRotationVector,
89
- ra as useAnimationFrame,
90
- na as useAutorun,
91
- ia as useInterpolation,
92
- ca as useMounted,
93
- la as useReaction
85
+ da as i18n,
86
+ K as jointValuesEqual,
87
+ Q as poseEqual,
88
+ $ as tcpMotionEqual,
89
+ aa as unwrapRotationVector,
90
+ na as useAnimationFrame,
91
+ ia as useAutorun,
92
+ ca as useInterpolation,
93
+ la as useMounted,
94
+ ga as useReaction
94
95
  };