@wandelbots/wandelbots-js-react-components 4.7.1 → 4.7.2-pr.dev-RB-3348-v1-clean-up.560.cbf9c17

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.
Files changed (109) hide show
  1. package/README.md +11 -32
  2. package/dist/3d-BOCs0RwR.cjs +2 -0
  3. package/dist/3d-BOCs0RwR.cjs.map +1 -0
  4. package/dist/3d-BTtdSlR9.js +1206 -0
  5. package/dist/3d-BTtdSlR9.js.map +1 -0
  6. package/dist/3d.cjs.js +1 -2
  7. package/dist/3d.esm.js +2 -0
  8. package/dist/auth0-spa-js.production.esm-8ppNz0la.js +5007 -0
  9. package/dist/auth0-spa-js.production.esm-8ppNz0la.js.map +1 -0
  10. package/dist/auth0-spa-js.production.esm-cNFf2AtX.cjs +5 -0
  11. package/dist/auth0-spa-js.production.esm-cNFf2AtX.cjs.map +1 -0
  12. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts +1 -1
  13. package/dist/components/3d-viewport/CoordinateSystemTransform.d.ts.map +1 -1
  14. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts +1 -2
  15. package/dist/components/3d-viewport/SafetyZonesRenderer.d.ts.map +1 -1
  16. package/dist/components/3d-viewport/TrajectoryRenderer.d.ts +2 -2
  17. package/dist/components/3d-viewport/TrajectoryRenderer.d.ts.map +1 -1
  18. package/dist/components/3d-viewport/collider/ColliderCollection.d.ts +1 -1
  19. package/dist/components/3d-viewport/collider/ColliderElement.d.ts +1 -1
  20. package/dist/components/3d-viewport/collider/CollisionSceneRenderer.d.ts +2 -2
  21. package/dist/components/3d-viewport/collider/colliderShapeToBufferGeometry.d.ts +1 -1
  22. package/dist/components/jogging/JoggingStore.d.ts +5 -11
  23. package/dist/components/jogging/JoggingStore.d.ts.map +1 -1
  24. package/dist/core-DtLSGTAb.js +18258 -0
  25. package/dist/core-DtLSGTAb.js.map +1 -0
  26. package/dist/core-DufB-Zu5.cjs +52 -0
  27. package/dist/core-DufB-Zu5.cjs.map +1 -0
  28. package/dist/core.cjs.js +1 -2
  29. package/dist/core.esm.js +3 -0
  30. package/dist/index.cjs.js +1 -2
  31. package/dist/index.d.ts +0 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.esm.js +4 -0
  34. package/dist/interpolation-BmgrXVQ7.js +5859 -0
  35. package/dist/interpolation-BmgrXVQ7.js.map +1 -0
  36. package/dist/interpolation-Cz29Pgpr.cjs +8 -0
  37. package/dist/interpolation-Cz29Pgpr.cjs.map +1 -0
  38. package/dist/lib/ConnectedMotionGroup.d.ts +2 -3
  39. package/dist/lib/ConnectedMotionGroup.d.ts.map +1 -1
  40. package/dist/lib/MotionStreamConnection.d.ts +0 -1
  41. package/dist/lib/MotionStreamConnection.d.ts.map +1 -1
  42. package/dist/themes/createDarkTheme.d.ts.map +1 -1
  43. package/dist/themes/themeTypes.d.ts +0 -4
  44. package/dist/themes/themeTypes.d.ts.map +1 -1
  45. package/package.json +21 -24
  46. package/src/components/3d-viewport/CoordinateSystemTransform.tsx +29 -18
  47. package/src/components/3d-viewport/SafetyZonesRenderer.tsx +13 -96
  48. package/src/components/3d-viewport/TrajectoryRenderer.tsx +8 -8
  49. package/src/components/3d-viewport/collider/ColliderCollection.tsx +1 -1
  50. package/src/components/3d-viewport/collider/ColliderElement.tsx +1 -1
  51. package/src/components/3d-viewport/collider/CollisionSceneRenderer.tsx +2 -2
  52. package/src/components/3d-viewport/collider/colliderShapeToBufferGeometry.ts +1 -1
  53. package/src/components/jogging/JoggingStore.ts +5 -5
  54. package/src/components/utils/interpolation.test.ts +3 -3
  55. package/src/index.ts +0 -1
  56. package/src/lib/ConnectedMotionGroup.ts +0 -5
  57. package/src/lib/MotionStreamConnection.ts +0 -5
  58. package/src/themes/createDarkTheme.ts +1 -22
  59. package/src/themes/themeTypes.ts +0 -5
  60. package/dist/3d.cjs.js.map +0 -1
  61. package/dist/3d.es.js +0 -19
  62. package/dist/3d.es.js.map +0 -1
  63. package/dist/LoadingCover-B3UN1lnU.js +0 -81
  64. package/dist/LoadingCover-B3UN1lnU.js.map +0 -1
  65. package/dist/LoadingCover-DXcsXWDy.cjs +0 -2
  66. package/dist/LoadingCover-DXcsXWDy.cjs.map +0 -1
  67. package/dist/MotionGroupVisualizer-7Mw9PINy.js +0 -1366
  68. package/dist/MotionGroupVisualizer-7Mw9PINy.js.map +0 -1
  69. package/dist/MotionGroupVisualizer-C0ll-LQF.cjs +0 -2
  70. package/dist/MotionGroupVisualizer-C0ll-LQF.cjs.map +0 -1
  71. package/dist/WandelscriptEditor-6sAoniLC.cjs +0 -2
  72. package/dist/WandelscriptEditor-6sAoniLC.cjs.map +0 -1
  73. package/dist/WandelscriptEditor-kWC2VyG_.js +0 -140
  74. package/dist/WandelscriptEditor-kWC2VyG_.js.map +0 -1
  75. package/dist/auth0-spa-js.production.esm-DNao6_S5.js +0 -4064
  76. package/dist/auth0-spa-js.production.esm-DNao6_S5.js.map +0 -1
  77. package/dist/auth0-spa-js.production.esm-DaBMfOV8.cjs +0 -5
  78. package/dist/auth0-spa-js.production.esm-DaBMfOV8.cjs.map +0 -1
  79. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts +0 -16
  80. package/dist/components/wandelscript-editor/WandelscriptEditor.d.ts.map +0 -1
  81. package/dist/components/wandelscript-editor/wandelscript.tmLanguage.d.ts +0 -45
  82. package/dist/components/wandelscript-editor/wandelscript.tmLanguage.d.ts.map +0 -1
  83. package/dist/core.cjs.js.map +0 -1
  84. package/dist/core.es.js +0 -54
  85. package/dist/core.es.js.map +0 -1
  86. package/dist/externalizeComponent-B98tgTPP.cjs +0 -24
  87. package/dist/externalizeComponent-B98tgTPP.cjs.map +0 -1
  88. package/dist/externalizeComponent-BOqKMZMc.js +0 -526
  89. package/dist/externalizeComponent-BOqKMZMc.js.map +0 -1
  90. package/dist/index.cjs.js.map +0 -1
  91. package/dist/index.es.js +0 -72
  92. package/dist/index.es.js.map +0 -1
  93. package/dist/interpolation-B8AcxfdD.js +0 -7167
  94. package/dist/interpolation-B8AcxfdD.js.map +0 -1
  95. package/dist/interpolation-SWzo5zr4.cjs +0 -20
  96. package/dist/interpolation-SWzo5zr4.cjs.map +0 -1
  97. package/dist/theming-BKpqgTRM.js +0 -22360
  98. package/dist/theming-BKpqgTRM.js.map +0 -1
  99. package/dist/theming-CatQaIl_.cjs +0 -115
  100. package/dist/theming-CatQaIl_.cjs.map +0 -1
  101. package/dist/wandelscript.cjs.js +0 -2
  102. package/dist/wandelscript.cjs.js.map +0 -1
  103. package/dist/wandelscript.d.ts +0 -2
  104. package/dist/wandelscript.d.ts.map +0 -1
  105. package/dist/wandelscript.es.js +0 -5
  106. package/dist/wandelscript.es.js.map +0 -1
  107. package/src/components/wandelscript-editor/WandelscriptEditor.tsx +0 -142
  108. package/src/components/wandelscript-editor/wandelscript.tmLanguage.ts +0 -62
  109. package/src/wandelscript.ts +0 -2
@@ -0,0 +1,52 @@
1
+ const e=require(`./interpolation-Cz29Pgpr.cjs`);let t=require(`three`);t=e.S(t);let n=require(`react`);n=e.S(n);let r=require(`@mui/material`),i=require(`mobx-react-lite`),a=require(`react-i18next`),o=require(`@mui/icons-material`),s=require(`axios`),c=require(`mobx`),l=require(`prop-types`);l=e.S(l);let u=require(`@emotion/styled`);u=e.S(u);let d=require(`@emotion/react`),f=require(`@mui/x-data-grid`),p=require(`@wandelbots/nova-js`),m=require(`lodash-es`),h=require(`@mui/x-charts`);var g=e.b(),_=e=>(0,g.jsx)(r.SvgIcon,{...e,viewBox:`0 0 10 8`,children:(0,g.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`})}),v=e.m((0,i.observer)(e=>{let{appIcon:t,appName:i,apps:a=[],onAppSelect:o,disabled:s=!1,sx:c}=e,[l,u]=(0,n.useState)(null),d=!!l,f=e=>{u(e.currentTarget)},p=()=>{u(null)},m=e=>{p(),e.onClick?e.onClick():e.href&&(window.location.href=e.href),o?.(e)};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(r.AppBar,{position:`static`,sx:{boxShadow:`none`,backgroundImage:`none`,"& .MuiAppBar-root":{backgroundImage:`none`,backgroundColor:`transparent`},...c},children:(0,g.jsxs)(r.Toolbar,{sx:{minHeight:`62px !important`},children:[(0,g.jsx)(r.Box,{sx:{mr:1,display:`flex`,alignItems:`center`},children:t}),(0,g.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`center`,flexGrow:1},children:[(0,g.jsx)(r.Typography,{component:`h1`,sx:{fontWeight:`bold`,fontSize:`1rem`},children:i}),a.length>0&&(0,g.jsx)(r.IconButton,{color:`inherit`,"aria-label":`switch app`,"aria-controls":`app-menu`,"aria-haspopup":`true`,onClick:f,disabled:s,sx:{ml:1,width:28,height:28,borderRadius:`6px`,padding:0,backgroundColor:e=>(0,r.alpha)(e.palette.common.white,.1),opacity:1,"&:hover":{backgroundColor:e=>(0,r.alpha)(e.palette.common.white,.16)},"& .MuiSvgIcon-root":{fontSize:`8px`,width:`8px`,height:`6px`}},children:(0,g.jsx)(_,{})})]})]})}),(0,g.jsx)(r.Backdrop,{open:d,onClick:p,sx:{backdropFilter:`blur(4px)`,backgroundColor:`rgba(0, 0, 0, 0.3)`,zIndex:e=>e.zIndex.modal-1}}),(0,g.jsx)(r.Menu,{id:`app-menu`,anchorEl:l,open:d,onClose:p,anchorOrigin:{vertical:`bottom`,horizontal:`left`},transformOrigin:{vertical:`top`,horizontal:`left`},sx:{zIndex:e=>e.zIndex.modal,"& .MuiPaper-root":{minWidth:200,mt:1}},children:a.map(e=>(0,g.jsxs)(r.MenuItem,{onClick:()=>m(e),children:[(0,g.jsx)(r.Box,{sx:{display:`flex`,alignItems:`center`},children:e.icon}),(0,g.jsx)(r.Typography,{variant:`body1`,sx:{ml:2},children:e.name})]},e.id))})]})}));function y(){return y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},y.apply(null,arguments)}function b(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function x(e,t,n=void 0){let r={};for(let i in e){let a=e[i],o=``,s=!0;for(let e=0;e<a.length;e+=1){let r=a[e];r&&(o+=(s===!0?``:` `)+t(r),s=!1,n&&n[r]&&(o+=` `+n[r]))}r[i]=o}return r}function S(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=S(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function C(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=S(e))&&(r&&(r+=` `),r+=t);return r}function w(e,...t){let n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>n.searchParams.append(`args[]`,e)),`Minified MUI error #${e}; visit ${n} for the full message.`}var T=`$$material`;function E(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var D={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function O(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var k=!1,ee=/[A-Z]|^ms/g,A=/_EMO_([^_]+?)_([^]*?)_EMO_/g,j=function(e){return e.charCodeAt(1)===45},M=function(e){return e!=null&&typeof e!=`boolean`},te=O(function(e){return j(e)?e:e.replace(ee,`-$&`).toLowerCase()}),N=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(A,function(e,t,n){return I={name:t,styles:n,next:I},t})}return D[e]!==1&&!j(e)&&typeof t==`number`&&t!==0?t+`px`:t},ne=`Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.`;function P(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return I={name:i.name,styles:i.styles,next:I},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)I={name:o.name,styles:o.styles,next:I},o=o.next;return a.styles+`;`}return re(e,t,n);case`function`:if(e!==void 0){var s=I,c=n(e);return I=s,P(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function re(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=P(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:M(s)&&(r+=te(a)+`:`+N(a,s)+`;`)}else{if(a===`NO_COMPONENT_SELECTOR`&&k)throw Error(ne);if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)M(o[c])&&(r+=te(a)+`:`+N(a,o[c])+`;`);else{var l=P(e,t,o);switch(a){case`animation`:case`animationName`:r+=te(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}}return r}var F=/label:\s*([^\s;{]+)\s*(;|$)/g,I;function ie(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;I=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=P(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=P(n,t,e[o]),r&&(i+=a[o]);F.lastIndex=0;for(var s=``,c;(c=F.exec(i))!==null;)s+=`-`+c[1];return{name:E(i)+s,styles:i,next:I}}function ae(e,t){let n=(0,u.default)(e,t);return process.env.NODE_ENV===`production`?n:(...t)=>{let r=typeof e==`string`?`"${e}"`:`component`;return t.length===0?console.error([`MUI: Seems like you called \`styled(${r})()\` without a \`style\` argument.`,'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join(`
2
+ `)):t.some(e=>e===void 0)&&console.error(`MUI: the styled(${r})(...args) API requires all its args to be defined.`),n(...t)}}function oe(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}var se=[];function ce(e){return se[0]=e,ie(se)}var le=e.x((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.suspense_list`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.view_transition`),m=Symbol.for(`react.client.reference`);function h(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case l:case u:case p:return e;default:switch(e&&=e.$$typeof,e){case s:case c:case f:case d:return e;case o:return e;default:return m}}case n:return m}}}e.ContextConsumer=o,e.ContextProvider=s,e.Element=t,e.ForwardRef=c,e.Fragment=r,e.Lazy=f,e.Memo=d,e.Portal=n,e.Profiler=a,e.StrictMode=i,e.Suspense=l,e.SuspenseList=u,e.isContextConsumer=function(e){return h(e)===o},e.isContextProvider=function(e){return h(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===t},e.isForwardRef=function(e){return h(e)===c},e.isFragment=function(e){return h(e)===r},e.isLazy=function(e){return h(e)===f},e.isMemo=function(e){return h(e)===d},e.isPortal=function(e){return h(e)===n},e.isProfiler=function(e){return h(e)===a},e.isStrictMode=function(e){return h(e)===i},e.isSuspense=function(e){return h(e)===l},e.isSuspenseList=function(e){return h(e)===u},e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===r||e===a||e===i||e===l||e===u||typeof e==`object`&&e&&(e.$$typeof===f||e.$$typeof===d||e.$$typeof===s||e.$$typeof===o||e.$$typeof===c||e.$$typeof===m||e.getModuleId!==void 0))},e.typeOf=h})),ue=e.x((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case i:case o:case a:case u:case d:case m:return e;default:switch(e&&=e.$$typeof,e){case c:case l:case p:case f:return e;case s:return e;default:return t}}case r:return t}}}var n=Symbol.for(`react.transitional.element`),r=Symbol.for(`react.portal`),i=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.consumer`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`),m=Symbol.for(`react.view_transition`),h=Symbol.for(`react.client.reference`);e.ContextConsumer=s,e.ContextProvider=c,e.Element=n,e.ForwardRef=l,e.Fragment=i,e.Lazy=p,e.Memo=f,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=u,e.SuspenseList=d,e.isContextConsumer=function(e){return t(e)===s},e.isContextProvider=function(e){return t(e)===c},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return t(e)===l},e.isFragment=function(e){return t(e)===i},e.isLazy=function(e){return t(e)===p},e.isMemo=function(e){return t(e)===f},e.isPortal=function(e){return t(e)===r},e.isProfiler=function(e){return t(e)===o},e.isStrictMode=function(e){return t(e)===a},e.isSuspense=function(e){return t(e)===u},e.isSuspenseList=function(e){return t(e)===d},e.isValidElementType=function(e){return!!(typeof e==`string`||typeof e==`function`||e===i||e===o||e===a||e===u||e===d||typeof e==`object`&&e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===c||e.$$typeof===s||e.$$typeof===l||e.$$typeof===h||e.getModuleId!==void 0))},e.typeOf=t})()})),de=e.x(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=le():t.exports=ue()}))();function L(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function fe(e){if(n.isValidElement(e)||(0,de.isValidElementType)(e)||!L(e))return e;let t={};return Object.keys(e).forEach(n=>{t[n]=fe(e[n])}),t}function R(e,t,r={clone:!0}){let i=r.clone?{...e}:e;return L(e)&&L(t)&&Object.keys(t).forEach(a=>{n.isValidElement(t[a])||(0,de.isValidElementType)(t[a])?i[a]=t[a]:L(t[a])&&Object.prototype.hasOwnProperty.call(e,a)&&L(e[a])?i[a]=R(e[a],t[a],r):r.clone?i[a]=L(t[a])?fe(t[a]):t[a]:i[a]=t[a]}),i}var pe=e=>{let t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>({...e,[t.key]:t.val}),{})};function me(e){let{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n=`px`,step:r=5,...i}=e,a=pe(t),o=Object.keys(a);function s(e){return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n})`}function c(e){return`@media (max-width:${(typeof t[e]==`number`?t[e]:e)-r/100}${n})`}function l(e,i){let a=o.indexOf(i);return`@media (min-width:${typeof t[e]==`number`?t[e]:e}${n}) and (max-width:${(a!==-1&&typeof t[o[a]]==`number`?t[o[a]]:i)-r/100}${n})`}function u(e){return o.indexOf(e)+1<o.length?l(e,o[o.indexOf(e)+1]):s(e)}function d(e){let t=o.indexOf(e);return t===0?s(o[1]):t===o.length-1?c(o[t]):l(e,o[o.indexOf(e)+1]).replace(`@media`,`@media not all and`)}return{keys:o,values:a,up:s,down:c,between:l,only:u,not:d,unit:n,...i}}function he(e,t){if(!e.containerQueries)return t;let n=Object.keys(t).filter(e=>e.startsWith(`@container`)).sort((e,t)=>{let n=/min-width:\s*([0-9.]+)/;return(e.match(n)?.[1]||0)-+(t.match(n)?.[1]||0)});return n.length?n.reduce((e,n)=>{let r=t[n];return delete e[n],e[n]=r,e},{...t}):t}function ge(e,t){return t===`@`||t.startsWith(`@`)&&(e.some(e=>t.startsWith(`@${e}`))||!!t.match(/^@\d/))}function _e(e,t){let n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n){if(process.env.NODE_ENV!==`production`)throw Error(process.env.NODE_ENV===`production`?w(18,`(${t})`):`MUI: The provided shorthand ${`(${t})`} is invalid. The format should be \`@<breakpoint | number>\` or \`@<breakpoint | number>/<container>\`.\nFor example, \`@sm\` or \`@600\` or \`@40rem/sidebar\`.`);return null}let[,r,i]=n,a=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(a)}function ve(e){let t=(e,t)=>e.replace(`@media`,t?`@container ${t}`:`@container`);function n(n,r){n.up=(...n)=>t(e.breakpoints.up(...n),r),n.down=(...n)=>t(e.breakpoints.down(...n),r),n.between=(...n)=>t(e.breakpoints.between(...n),r),n.only=(...n)=>t(e.breakpoints.only(...n),r),n.not=(...n)=>{let i=t(e.breakpoints.not(...n),r);return i.includes(`not all and`)?i.replace(`not all and `,``).replace(`min-width:`,`width<`).replace(`max-width:`,`width>`).replace(`and`,`or`):i}}let r={},i=e=>(n(r,e),r);return n(i),{...e,containerQueries:i}}var ye={borderRadius:4},be=process.env.NODE_ENV===`production`?{}:l.default.oneOfType([l.default.number,l.default.string,l.default.object,l.default.array]);function xe(e,t){return t?R(e,t,{clone:!1}):e}var Se={xs:0,sm:600,md:900,lg:1200,xl:1536},Ce={keys:[`xs`,`sm`,`md`,`lg`,`xl`],up:e=>`@media (min-width:${Se[e]}px)`},we={containerQueries:e=>({up:t=>{let n=typeof t==`number`?t:Se[t]||t;return typeof n==`number`&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function Te(e,t,n){let r=e.theme||{};if(Array.isArray(t)){let e=r.breakpoints||Ce;return t.reduce((r,i,a)=>(r[e.up(e.keys[a])]=n(t[a]),r),{})}if(typeof t==`object`){let e=r.breakpoints||Ce;return Object.keys(t).reduce((i,a)=>{if(ge(e.keys,a)){let e=_e(r.containerQueries?r:we,a);e&&(i[e]=n(t[a],a))}else if(Object.keys(e.values||Se).includes(a)){let r=e.up(a);i[r]=n(t[a],a)}else{let e=a;i[e]=t[e]}return i},{})}return n(t)}function Ee(e={}){return e.keys?.reduce((t,n)=>{let r=e.up(n);return t[r]={},t},{})||{}}function De(e,t){return e.reduce((e,t)=>{let n=e[t];return(!n||Object.keys(n).length===0)&&delete e[t],e},t)}function Oe(e,...t){let n=Ee(e),r=[n,...t].reduce((e,t)=>R(e,t),{});return De(Object.keys(n),r)}function ke(e,t){if(typeof e!=`object`)return{};let n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((t,r)=>{r<e.length&&(n[t]=!0)}):r.forEach(t=>{e[t]!=null&&(n[t]=!0)}),n}function Ae({values:e,breakpoints:t,base:n}){let r=n||ke(e,t),i=Object.keys(r);if(i.length===0)return e;let a;return i.reduce((t,n,r)=>(Array.isArray(e)?(t[n]=e[r]==null?e[a]:e[r],a=r):typeof e==`object`?(t[n]=e[n]==null?e[a]:e[n],a=n):t[n]=e,t),{})}function je(e){if(typeof e!=`string`)throw Error(process.env.NODE_ENV===`production`?w(7):"MUI: `capitalize(string)` expects a string argument.");return e.charAt(0).toUpperCase()+e.slice(1)}function Me(e,t,n=!0){if(!t||typeof t!=`string`)return null;if(e&&e.vars&&n){let n=`vars.${t}`.split(`.`).reduce((e,t)=>e&&e[t]?e[t]:null,e);if(n!=null)return n}return t.split(`.`).reduce((e,t)=>e&&e[t]!=null?e[t]:null,e)}function Ne(e,t,n,r=n){let i;return i=typeof e==`function`?e(n):Array.isArray(e)?e[n]||r:Me(e,n)||r,t&&(i=t(i,r,e)),i}function z(e){let{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,a=e=>{if(e[t]==null)return null;let a=e[t],o=e.theme,s=Me(o,r)||{};return Te(e,a,e=>{let r=Ne(s,i,e);return e===r&&typeof e==`string`&&(r=Ne(s,i,`${t}${e===`default`?``:je(e)}`,e)),n===!1?r:{[n]:r}})};return a.propTypes=process.env.NODE_ENV===`production`?{}:{[t]:be},a.filterProps=[t],a}function Pe(e){let t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}var Fe={m:`margin`,p:`padding`},Ie={t:`Top`,r:`Right`,b:`Bottom`,l:`Left`,x:[`Left`,`Right`],y:[`Top`,`Bottom`]},Le={marginX:`mx`,marginY:`my`,paddingX:`px`,paddingY:`py`},Re=Pe(e=>{if(e.length>2)if(Le[e])e=Le[e];else return[e];let[t,n]=e.split(``),r=Fe[t],i=Ie[n]||``;return Array.isArray(i)?i.map(e=>r+e):[r+i]}),ze=[`m`,`mt`,`mr`,`mb`,`ml`,`mx`,`my`,`margin`,`marginTop`,`marginRight`,`marginBottom`,`marginLeft`,`marginX`,`marginY`,`marginInline`,`marginInlineStart`,`marginInlineEnd`,`marginBlock`,`marginBlockStart`,`marginBlockEnd`],Be=[`p`,`pt`,`pr`,`pb`,`pl`,`px`,`py`,`padding`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`paddingX`,`paddingY`,`paddingInline`,`paddingInlineStart`,`paddingInlineEnd`,`paddingBlock`,`paddingBlockStart`,`paddingBlockEnd`],Ve=[...ze,...Be];function He(e,t,n,r){let i=Me(e,t,!0)??n;return typeof i==`number`||typeof i==`string`?e=>typeof e==`string`?e:(process.env.NODE_ENV!==`production`&&typeof e!=`number`&&console.error(`MUI: Expected ${r} argument to be a number or a string, got ${e}.`),typeof i==`string`?i.startsWith(`var(`)&&e===0?0:i.startsWith(`var(`)&&e===1?i:`calc(${e} * ${i})`:i*e):Array.isArray(i)?e=>{if(typeof e==`string`)return e;let n=Math.abs(e);process.env.NODE_ENV!==`production`&&(Number.isInteger(n)?n>i.length-1&&console.error([`MUI: The value provided (${n}) overflows.`,`The supported values are: ${JSON.stringify(i)}.`,`${n} > ${i.length-1}, you need to add the missing values.`].join(`
3
+ `)):console.error([`MUI: The \`theme.${t}\` array type cannot be combined with non integer values.You should either use an integer value that can be used as index, or define the \`theme.${t}\` as a number.`].join(`
4
+ `)));let r=i[n];return e>=0?r:typeof r==`number`?-r:typeof r==`string`&&r.startsWith(`var(`)?`calc(-1 * ${r})`:`-${r}`}:typeof i==`function`?i:(process.env.NODE_ENV!==`production`&&console.error([`MUI: The \`theme.${t}\` value (${i}) is invalid.`,`It should be a number, an array or a function.`].join(`
5
+ `)),()=>void 0)}function Ue(e){return He(e,`spacing`,8,`spacing`)}function We(e,t){return typeof t==`string`||t==null?t:e(t)}function Ge(e,t){return n=>e.reduce((e,r)=>(e[r]=We(t,n),e),{})}function Ke(e,t,n,r){if(!t.includes(n))return null;let i=Ge(Re(n),r),a=e[n];return Te(e,a,i)}function qe(e,t){let n=Ue(e.theme);return Object.keys(e).map(r=>Ke(e,t,r,n)).reduce(xe,{})}function B(e){return qe(e,ze)}B.propTypes=process.env.NODE_ENV===`production`?{}:ze.reduce((e,t)=>(e[t]=be,e),{}),B.filterProps=ze;function V(e){return qe(e,Be)}V.propTypes=process.env.NODE_ENV===`production`?{}:Be.reduce((e,t)=>(e[t]=be,e),{}),V.filterProps=Be;function Je(e){return qe(e,Ve)}Je.propTypes=process.env.NODE_ENV===`production`?{}:Ve.reduce((e,t)=>(e[t]=be,e),{}),Je.filterProps=Ve;function Ye(e=8,t=Ue({spacing:e})){if(e.mui)return e;let n=(...e)=>(process.env.NODE_ENV!==`production`&&(e.length<=4||console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${e.length}`)),(e.length===0?[1]:e).map(e=>{let n=t(e);return typeof n==`number`?`${n}px`:n}).join(` `));return n.mui=!0,n}function Xe(...e){let t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?xe(n,t[r](e)):n,{});return n.propTypes=process.env.NODE_ENV===`production`?{}:e.reduce((e,t)=>Object.assign(e,t.propTypes),{}),n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Ze(e){return typeof e==`number`?`${e}px solid`:e}function Qe(e,t){return z({prop:e,themeKey:`borders`,transform:t})}var $e=Qe(`border`,Ze),et=Qe(`borderTop`,Ze),tt=Qe(`borderRight`,Ze),nt=Qe(`borderBottom`,Ze),rt=Qe(`borderLeft`,Ze),it=Qe(`borderColor`),at=Qe(`borderTopColor`),ot=Qe(`borderRightColor`),st=Qe(`borderBottomColor`),ct=Qe(`borderLeftColor`),lt=Qe(`outline`,Ze),ut=Qe(`outlineColor`),dt=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){let t=He(e.theme,`shape.borderRadius`,4,`borderRadius`);return Te(e,e.borderRadius,e=>({borderRadius:We(t,e)}))}return null};dt.propTypes=process.env.NODE_ENV===`production`?{}:{borderRadius:be},dt.filterProps=[`borderRadius`],Xe($e,et,tt,nt,rt,it,at,ot,st,ct,dt,lt,ut);var ft=e=>{if(e.gap!==void 0&&e.gap!==null){let t=He(e.theme,`spacing`,8,`gap`);return Te(e,e.gap,e=>({gap:We(t,e)}))}return null};ft.propTypes=process.env.NODE_ENV===`production`?{}:{gap:be},ft.filterProps=[`gap`];var pt=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){let t=He(e.theme,`spacing`,8,`columnGap`);return Te(e,e.columnGap,e=>({columnGap:We(t,e)}))}return null};pt.propTypes=process.env.NODE_ENV===`production`?{}:{columnGap:be},pt.filterProps=[`columnGap`];var mt=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){let t=He(e.theme,`spacing`,8,`rowGap`);return Te(e,e.rowGap,e=>({rowGap:We(t,e)}))}return null};mt.propTypes=process.env.NODE_ENV===`production`?{}:{rowGap:be},mt.filterProps=[`rowGap`],Xe(ft,pt,mt,z({prop:`gridColumn`}),z({prop:`gridRow`}),z({prop:`gridAutoFlow`}),z({prop:`gridAutoColumns`}),z({prop:`gridAutoRows`}),z({prop:`gridTemplateColumns`}),z({prop:`gridTemplateRows`}),z({prop:`gridTemplateAreas`}),z({prop:`gridArea`}));function ht(e,t){return t===`grey`?t:e}Xe(z({prop:`color`,themeKey:`palette`,transform:ht}),z({prop:`bgcolor`,cssProperty:`backgroundColor`,themeKey:`palette`,transform:ht}),z({prop:`backgroundColor`,themeKey:`palette`,transform:ht}));function gt(e){return e<=1&&e!==0?`${e*100}%`:e}var _t=z({prop:`width`,transform:gt}),vt=e=>e.maxWidth!==void 0&&e.maxWidth!==null?Te(e,e.maxWidth,t=>{let n=e.theme?.breakpoints?.values?.[t]||Se[t];return n?e.theme?.breakpoints?.unit===`px`?{maxWidth:n}:{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:gt(t)}}):null;vt.filterProps=[`maxWidth`];var yt=z({prop:`minWidth`,transform:gt}),bt=z({prop:`height`,transform:gt}),xt=z({prop:`maxHeight`,transform:gt}),St=z({prop:`minHeight`,transform:gt});z({prop:`size`,cssProperty:`width`,transform:gt}),z({prop:`size`,cssProperty:`height`,transform:gt}),Xe(_t,vt,yt,bt,xt,St,z({prop:`boxSizing`}));var Ct={border:{themeKey:`borders`,transform:Ze},borderTop:{themeKey:`borders`,transform:Ze},borderRight:{themeKey:`borders`,transform:Ze},borderBottom:{themeKey:`borders`,transform:Ze},borderLeft:{themeKey:`borders`,transform:Ze},borderColor:{themeKey:`palette`},borderTopColor:{themeKey:`palette`},borderRightColor:{themeKey:`palette`},borderBottomColor:{themeKey:`palette`},borderLeftColor:{themeKey:`palette`},outline:{themeKey:`borders`,transform:Ze},outlineColor:{themeKey:`palette`},borderRadius:{themeKey:`shape.borderRadius`,style:dt},color:{themeKey:`palette`,transform:ht},bgcolor:{themeKey:`palette`,cssProperty:`backgroundColor`,transform:ht},backgroundColor:{themeKey:`palette`,transform:ht},p:{style:V},pt:{style:V},pr:{style:V},pb:{style:V},pl:{style:V},px:{style:V},py:{style:V},padding:{style:V},paddingTop:{style:V},paddingRight:{style:V},paddingBottom:{style:V},paddingLeft:{style:V},paddingX:{style:V},paddingY:{style:V},paddingInline:{style:V},paddingInlineStart:{style:V},paddingInlineEnd:{style:V},paddingBlock:{style:V},paddingBlockStart:{style:V},paddingBlockEnd:{style:V},m:{style:B},mt:{style:B},mr:{style:B},mb:{style:B},ml:{style:B},mx:{style:B},my:{style:B},margin:{style:B},marginTop:{style:B},marginRight:{style:B},marginBottom:{style:B},marginLeft:{style:B},marginX:{style:B},marginY:{style:B},marginInline:{style:B},marginInlineStart:{style:B},marginInlineEnd:{style:B},marginBlock:{style:B},marginBlockStart:{style:B},marginBlockEnd:{style:B},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:ft},rowGap:{style:mt},columnGap:{style:pt},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:`zIndex`},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:`shadows`},width:{transform:gt},maxWidth:{style:vt},minWidth:{transform:gt},height:{transform:gt},maxHeight:{transform:gt},minHeight:{transform:gt},boxSizing:{},font:{themeKey:`font`},fontFamily:{themeKey:`typography`},fontSize:{themeKey:`typography`},fontStyle:{themeKey:`typography`},fontWeight:{themeKey:`typography`},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:`typography`}};function wt(...e){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}function Tt(e,t){return typeof e==`function`?e(t):e}function Et(){function e(e,t,n,r){let i={[e]:t,theme:n},a=r[e];if(!a)return{[e]:t};let{cssProperty:o=e,themeKey:s,transform:c,style:l}=a;if(t==null)return null;if(s===`typography`&&t===`inherit`)return{[e]:t};let u=Me(n,s)||{};return l?l(i):Te(i,t,t=>{let n=Ne(u,c,t);return t===n&&typeof t==`string`&&(n=Ne(u,c,`${e}${t===`default`?``:je(t)}`,t)),o===!1?n:{[o]:n}})}function t(n){let{sx:r,theme:i={},nested:a}=n||{};if(!r)return null;let o=i.unstable_sxConfig??Ct;function s(n){let r=n;if(typeof n==`function`)r=n(i);else if(typeof n!=`object`)return n;if(!r)return null;let s=Ee(i.breakpoints),c=Object.keys(s),l=s;return Object.keys(r).forEach(n=>{let a=Tt(r[n],i);if(a!=null)if(typeof a==`object`)if(o[n])l=xe(l,e(n,a,i,o));else{let e=Te({theme:i},a,e=>({[n]:e}));wt(e,a)?l[n]=t({sx:a,theme:i,nested:!0}):l=xe(l,e)}else l=xe(l,e(n,a,i,o))}),!a&&i.modularCssLayers?{"@layer sx":he(i,De(c,l))}:he(i,De(c,l))}return Array.isArray(r)?r.map(s):s(r)}return t}var Dt=Et();Dt.filterProps=[`sx`];function Ot(e,t){let n=this;if(n.vars){if(!n.colorSchemes?.[e]||typeof n.getColorSchemeSelector!=`function`)return{};let r=n.getColorSchemeSelector(e);return r===`&`?t:((r.includes(`data-`)||r.includes(`.`))&&(r=`*:where(${r.replace(/\s*&$/,``)}) &`),{[r]:t})}return n.palette.mode===e?t:{}}function kt(e={},...t){let{breakpoints:n={},palette:r={},spacing:i,shape:a={},...o}=e,s=me(n),c=Ye(i),l=R({breakpoints:s,direction:`ltr`,components:{},palette:{mode:`light`,...r},spacing:c,shape:{...ye,...a}},o);return l=ve(l),l.applyStyles=Ot,l=t.reduce((e,t)=>R(e,t),l),l.unstable_sxConfig={...Ct,...o?.unstable_sxConfig},l.unstable_sx=function(e){return Dt({sx:e,theme:this})},l}function At(e){return Object.keys(e).length===0}function jt(e=null){let t=n.useContext(d.ThemeContext);return!t||At(t)?e:t}var Mt=kt();function Nt(e=Mt){return jt(e)}var Pt=e=>{let t={systemProps:{},otherProps:{}},n=e?.theme?.unstable_sxConfig??Ct;return Object.keys(e).forEach(r=>{n[r]?t.systemProps[r]=e[r]:t.otherProps[r]=e[r]}),t};function Ft(e){let{sx:t,...n}=e,{systemProps:r,otherProps:i}=Pt(n),a;return a=Array.isArray(t)?[r,...t]:typeof t==`function`?(...e)=>{let n=t(...e);return L(n)?{...r,...n}:r}:{...r,...t},{...i,sx:a}}var It=e=>e,Lt=(()=>{let e=It;return{configure(t){e=t},generate(t){return e(t)},reset(){e=It}}})(),Rt={active:`active`,checked:`checked`,completed:`completed`,disabled:`disabled`,error:`error`,expanded:`expanded`,focused:`focused`,focusVisible:`focusVisible`,open:`open`,readOnly:`readOnly`,required:`required`,selected:`selected`};function zt(e,t,n=`Mui`){let r=Rt[t];return r?`${n}-${r}`:`${Lt.generate(e)}-${t}`}function Bt(e,t,n=`Mui`){let r={};return t.forEach(t=>{r[t]=zt(e,t,n)}),r}function Vt(e,t=``){return e.displayName||e.name||t}function Ht(e,t,n){let r=Vt(t);return e.displayName||(r===``?n:`${n}(${r})`)}function Ut(e){if(e!=null){if(typeof e==`string`)return e;if(typeof e==`function`)return Vt(e,`Component`);if(typeof e==`object`)switch(e.$$typeof){case de.ForwardRef:return Ht(e,e.render,`ForwardRef`);case de.Memo:return Ht(e,e.type,`memo`);default:return}}}function Wt(e){let{variants:t,...n}=e,r={variants:t,style:ce(n),isProcessed:!0};return r.style===n||t&&t.forEach(e=>{typeof e.style!=`function`&&(e.style=ce(e.style))}),r}var Gt=kt();function Kt(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}function qt(e,t){return t&&e&&typeof e==`object`&&e.styles&&!e.styles.startsWith(`@layer`)&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function Jt(e){return e?(t,n)=>n[e]:null}function Yt(e,t,n){e.theme=tn(e.theme)?n:e.theme[t]||e.theme}function Xt(e,t,n){let r=typeof t==`function`?t(e):t;if(Array.isArray(r))return r.flatMap(t=>Xt(e,t,n));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=n?qt(r.style,n):r.style;else{let{variants:e,...i}=r;t=n?qt(ce(i),n):i}return Zt(e,r.variants,[t],n)}return r?.isProcessed?n?qt(ce(r.style),n):r.style:n?qt(ce(r),n):r}function Zt(e,t,n=[],r=void 0){let i;variantLoop:for(let a=0;a<t.length;a+=1){let o=t[a];if(typeof o.props==`function`){if(i??={...e,...e.ownerState,ownerState:e.ownerState},!o.props(i))continue}else for(let t in o.props)if(e[t]!==o.props[t]&&e.ownerState?.[t]!==o.props[t])continue variantLoop;typeof o.style==`function`?(i??={...e,...e.ownerState,ownerState:e.ownerState},n.push(r?qt(ce(o.style(i)),r):o.style(i))):n.push(r?qt(ce(o.style),r):o.style)}return n}function Qt(e={}){let{themeId:t,defaultTheme:n=Gt,rootShouldForwardProp:r=Kt,slotShouldForwardProp:i=Kt}=e;function a(e){Yt(e,t,n)}return(e,t={})=>{oe(e,e=>e.filter(e=>e!==Dt));let{name:n,slot:o,skipVariantsResolver:s,skipSx:c,overridesResolver:l=Jt(rn(o)),...u}=t,d=n&&n.startsWith(`Mui`)||o?`components`:`custom`,f=s===void 0?o&&o!==`Root`&&o!==`root`||!1:s,p=c||!1,m=Kt;o===`Root`||o===`root`?m=r:o?m=i:nn(e)&&(m=void 0);let h=ae(e,{shouldForwardProp:m,label:en(n,o),...u}),g=e=>{if(e.__emotion_real===e)return e;if(typeof e==`function`)return function(t){return Xt(t,e,t.theme.modularCssLayers?d:void 0)};if(L(e)){let t=Wt(e);return function(e){return t.variants?Xt(e,t,e.theme.modularCssLayers?d:void 0):e.theme.modularCssLayers?qt(t.style,d):t.style}}return e},_=(...t)=>{let r=[],i=t.map(g),s=[];if(r.push(a),n&&l&&s.push(function(e){let t=e.theme.components?.[n]?.styleOverrides;if(!t)return null;let r={};for(let n in t)r[n]=Xt(e,t[n],e.theme.modularCssLayers?`theme`:void 0);return l(e,r)}),n&&!f&&s.push(function(e){let t=e.theme?.components?.[n]?.variants;return t?Zt(e,t,[],e.theme.modularCssLayers?`theme`:void 0):null}),p||s.push(Dt),Array.isArray(i[0])){let e=i.shift(),t=Array(r.length).fill(``),n=Array(s.length).fill(``),a;a=[...t,...e,...n],a.raw=[...t,...e.raw,...n],r.unshift(a)}let c=h(...r,...i,...s);return e.muiName&&(c.muiName=e.muiName),process.env.NODE_ENV!==`production`&&(c.displayName=$t(n,o,e)),c};return h.withConfig&&(_.withConfig=h.withConfig),_}}function $t(e,t,n){return e?`${e}${je(t||``)}`:`Styled(${Ut(n)})`}function en(e,t){let n;return process.env.NODE_ENV!==`production`&&e&&(n=`${e}-${rn(t||`Root`)}`),n}function tn(e){for(let t in e)return!1;return!0}function nn(e){return typeof e==`string`&&e.charCodeAt(0)>96}function rn(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}var an=Qt();function on(e,t,n=!1){let r={...t};for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let a=i;if(a===`components`||a===`slots`)r[a]={...e[a],...r[a]};else if(a===`componentsProps`||a===`slotProps`){let i=e[a],o=t[a];if(!o)r[a]=i||{};else if(!i)r[a]=o;else{r[a]={...o};for(let e in i)if(Object.prototype.hasOwnProperty.call(i,e)){let t=e;r[a][t]=on(i[t],o[t],n)}}}else a===`className`&&n&&t.className?r.className=C(e?.className,t?.className):a===`style`&&n&&t.style?r.style={...e?.style,...t?.style}:r[a]===void 0&&(r[a]=e[a])}return r}function sn(e){let{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:on(t.components[n].defaultProps,r)}function cn({props:e,name:t,defaultTheme:n,themeId:r}){let i=Nt(n);return r&&(i=i[r]||i),sn({theme:i,name:t,props:e})}var ln=typeof window<`u`?n.useLayoutEffect:n.useEffect;function un(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function dn(e,t=0,n=1){return process.env.NODE_ENV!==`production`&&(e<t||e>n)&&console.error(`MUI: The value provided ${e} is out of range [${t}, ${n}].`),un(e,t,n)}function fn(e){e=e.slice(1);let t=RegExp(`.{1,${e.length>=6?2:1}}`,`g`),n=e.match(t);return n&&n[0].length===1&&(n=n.map(e=>e+e)),process.env.NODE_ENV!==`production`&&e.length!==e.trim().length&&console.error(`MUI: The color: "${e}" is invalid. Make sure the color input doesn't contain leading/trailing space.`),n?`rgb${n.length===4?`a`:``}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(`, `)})`:``}function pn(e){if(e.type)return e;if(e.charAt(0)===`#`)return pn(fn(e));let t=e.indexOf(`(`),n=e.substring(0,t);if(![`rgb`,`rgba`,`hsl`,`hsla`,`color`].includes(n))throw Error(process.env.NODE_ENV===`production`?w(9,e):`MUI: Unsupported \`${e}\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().`);let r=e.substring(t+1,e.length-1),i;if(n===`color`){if(r=r.split(` `),i=r.shift(),r.length===4&&r[3].charAt(0)===`/`&&(r[3]=r[3].slice(1)),![`srgb`,`display-p3`,`a98-rgb`,`prophoto-rgb`,`rec-2020`].includes(i))throw Error(process.env.NODE_ENV===`production`?w(10,i):`MUI: unsupported \`${i}\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.`)}else r=r.split(`,`);return r=r.map(e=>parseFloat(e)),{type:n,values:r,colorSpace:i}}var mn=e=>{let t=pn(e);return t.values.slice(0,3).map((e,n)=>t.type.includes(`hsl`)&&n!==0?`${e}%`:e).join(` `)},hn=(e,t)=>{try{return mn(e)}catch{return t&&process.env.NODE_ENV!==`production`&&console.warn(t),e}};function gn(e){let{type:t,colorSpace:n}=e,{values:r}=e;return t.includes(`rgb`)?r=r.map((e,t)=>t<3?parseInt(e,10):e):t.includes(`hsl`)&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=t.includes(`color`)?`${n} ${r.join(` `)}`:`${r.join(`, `)}`,`${t}(${r})`}function _n(e){e=pn(e);let{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),o=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1),s=`rgb`,c=[Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255)];return e.type===`hsla`&&(s+=`a`,c.push(t[3])),gn({type:s,values:c})}function vn(e){e=pn(e);let t=e.type===`hsl`||e.type===`hsla`?pn(_n(e)).values:e.values;return t=t.map(t=>(e.type!==`color`&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function yn(e,t){let n=vn(e),r=vn(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function bn(e,t){return e=pn(e),t=dn(t),(e.type===`rgb`||e.type===`hsl`)&&(e.type+=`a`),e.type===`color`?e.values[3]=`/${t}`:e.values[3]=t,gn(e)}function xn(e,t,n){try{return bn(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function Sn(e,t){if(e=pn(e),t=dn(t),e.type.includes(`hsl`))e.values[2]*=1-t;else if(e.type.includes(`rgb`)||e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return gn(e)}function H(e,t,n){try{return Sn(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function Cn(e,t){if(e=pn(e),t=dn(t),e.type.includes(`hsl`))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes(`rgb`))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes(`color`))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return gn(e)}function U(e,t,n){try{return Cn(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}function wn(e,t=.15){return vn(e)>.5?Sn(e,t):Cn(e,t)}function Tn(e,t,n){try{return wn(e,t)}catch{return n&&process.env.NODE_ENV!==`production`&&console.warn(n),e}}var En=n.createContext();function Dn({value:e,...t}){return(0,g.jsx)(En.Provider,{value:e??!0,...t})}process.env.NODE_ENV!==`production`&&(Dn.propTypes={children:l.default.node,value:l.default.bool});var On=()=>n.useContext(En)??!1,kn=n.createContext(void 0);function An({value:e,children:t}){return(0,g.jsx)(kn.Provider,{value:e,children:t})}process.env.NODE_ENV!==`production`&&(An.propTypes={children:l.default.node,value:l.default.object});function jn(e){let{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;let i=t.components[n];return i.defaultProps?on(i.defaultProps,r,t.components.mergeClassNameAndStyle):!i.styleOverrides&&!i.variants?on(i,r,t.components.mergeClassNameAndStyle):r}function Mn({props:e,name:t}){return jn({props:e,name:t,theme:{components:n.useContext(kn)}})}var Nn=0;function Pn(e){let[t,r]=n.useState(e),i=e||t;return n.useEffect(()=>{t??(Nn+=1,r(`mui-${Nn}`))},[t]),i}var Fn={...n}.useId;function In(e){if(Fn!==void 0){let t=Fn();return e??t}return Pn(e)}var Ln={theme:void 0};function Rn(e){let t,n;return function(r){let i=t;return(i===void 0||r.theme!==n)&&(Ln.theme=r.theme,i=Wt(e(Ln)),t=i,n=r.theme),i}}function zn(e=``){function t(...n){if(!n.length)return``;let r=n[0];return typeof r==`string`&&!r.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:``}${r}${t(...n.slice(1))})`:`, ${r}`}return(n,...r)=>`var(--${e?`${e}-`:``}${n}${t(...r)})`}var Bn=(e,t,n,r=[])=>{let i=e;t.forEach((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=n:i&&typeof i==`object`&&(i[e]=n):i&&typeof i==`object`&&(i[e]||(i[e]=r.includes(e)?[]:{}),i=i[e])})},Vn=(e,t,n)=>{function r(e,i=[],a=[]){Object.entries(e).forEach(([e,o])=>{(!n||n&&!n([...i,e]))&&o!=null&&(typeof o==`object`&&Object.keys(o).length>0?r(o,[...i,e],Array.isArray(o)?[...a,e]:a):t([...i,e],o,a))})}r(e)},Hn=(e,t)=>typeof t==`number`?[`lineHeight`,`fontWeight`,`opacity`,`zIndex`].some(t=>e.includes(t))||e[e.length-1].toLowerCase().includes(`opacity`)?t:`${t}px`:t;function Un(e,t){let{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},a={},o={};return Vn(e,(e,t,s)=>{if((typeof t==`string`||typeof t==`number`)&&(!r||!r(e,t))){let r=`--${n?`${n}-`:``}${e.join(`-`)}`,c=Hn(e,t);Object.assign(i,{[r]:c}),Bn(a,e,`var(${r})`,s),Bn(o,e,`var(${r}, ${c})`,s)}},e=>e[0]===`vars`),{css:i,vars:a,varsWithDefaults:o}}function Wn(e,t={}){let{getSelector:n=_,disableCssColorScheme:r,colorSchemeSelector:i,enableContrastVars:a}=t,{colorSchemes:o={},components:s,defaultColorScheme:c=`light`,...l}=e,{vars:u,css:d,varsWithDefaults:f}=Un(l,t),p=f,m={},{[c]:h,...g}=o;if(Object.entries(g||{}).forEach(([e,n])=>{let{vars:r,css:i,varsWithDefaults:a}=Un(n,t);p=R(p,a),m[e]={css:i,vars:r}}),h){let{css:e,vars:n,varsWithDefaults:r}=Un(h,t);p=R(p,r),m[c]={css:e,vars:n}}function _(t,n){let r=i;if(i===`class`&&(r=`.%s`),i===`data`&&(r=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(r=`[${i}="%s"]`),t){if(r===`media`)return e.defaultColorScheme===t?`:root`:{[`@media (prefers-color-scheme: ${o[t]?.palette?.mode||t})`]:{":root":n}};if(r)return e.defaultColorScheme===t?`:root, ${r.replace(`%s`,String(t))}`:r.replace(`%s`,String(t))}return`:root`}return{vars:p,generateThemeVars:()=>{let e={...u};return Object.entries(m).forEach(([,{vars:t}])=>{e=R(e,t)}),e},generateStyleSheets:()=>{let t=[],i=e.defaultColorScheme||`light`;function s(e,n){Object.keys(n).length&&t.push(typeof e==`string`?{[e]:{...n}}:e)}s(n(void 0,{...d}),d);let{[i]:c,...l}=m;if(c){let{css:e}=c,t=o[i]?.palette?.mode,a=!r&&t?{colorScheme:t,...e}:{...e};s(n(i,{...a}),a)}return Object.entries(l).forEach(([e,{css:t}])=>{let i=o[e]?.palette?.mode,a=!r&&i?{colorScheme:i,...t}:{...t};s(n(e,{...a}),a)}),a&&t.push({":root":{"--__l-threshold":`0.7`,"--__l":`clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)`,"--__a":`clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)`}}),t}}}function Gn(e){return function(t){return e===`media`?(process.env.NODE_ENV!==`production`&&t!==`light`&&t!==`dark`&&console.error(`MUI: @media (prefers-color-scheme) supports only 'light' or 'dark', but receive '${t}'.`),`@media (prefers-color-scheme: ${t})`):e?e.startsWith(`data-`)&&!e.includes(`%s`)?`[${e}="${t}"] &`:e===`class`?`.${t} &`:e===`data`?`[data-${t}] &`:`${e.replace(`%s`,t)} &`:`&`}}var Kn=kt(),qn=an(`div`,{name:`MuiStack`,slot:`Root`});function Jn(e){return cn({props:e,name:`MuiStack`,defaultTheme:Kn})}function Yn(e,t){let r=n.Children.toArray(e).filter(Boolean);return r.reduce((e,i,a)=>(e.push(i),a<r.length-1&&e.push(n.cloneElement(t,{key:`separator-${a}`})),e),[])}var Xn=e=>({row:`Left`,"row-reverse":`Right`,column:`Top`,"column-reverse":`Bottom`})[e],Zn=({ownerState:e,theme:t})=>{let n={display:`flex`,flexDirection:`column`,...Te({theme:t},Ae({values:e.direction,breakpoints:t.breakpoints.values}),e=>({flexDirection:e}))};if(e.spacing){let r=Ue(t),i=Object.keys(t.breakpoints.values).reduce((t,n)=>((typeof e.spacing==`object`&&e.spacing[n]!=null||typeof e.direction==`object`&&e.direction[n]!=null)&&(t[n]=!0),t),{}),a=Ae({values:e.direction,base:i}),o=Ae({values:e.spacing,base:i});typeof a==`object`&&Object.keys(a).forEach((e,t,n)=>{a[e]||(a[e]=t>0?a[n[t-1]]:`column`)}),n=R(n,Te({theme:t},o,(t,n)=>e.useFlexGap?{gap:We(r,t)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${Xn(n?a[n]:e.direction)}`]:We(r,t)}}))}return n=Oe(t.breakpoints,n),n};function Qn(e={}){let{createStyledComponent:t=qn,useThemeProps:r=Jn,componentName:i=`MuiStack`}=e,a=()=>x({root:[`root`]},e=>zt(i,e),{}),o=t(Zn),s=n.forwardRef(function(e,t){let{component:n=`div`,direction:i=`column`,spacing:s=0,divider:c,children:l,className:u,useFlexGap:d=!1,...f}=Ft(r(e));return(0,g.jsx)(o,{as:n,ownerState:{direction:i,spacing:s,useFlexGap:d},ref:t,className:C(a().root,u),...f,children:c?Yn(l,c):l})});return process.env.NODE_ENV!==`production`&&(s.propTypes={children:l.default.node,direction:l.default.oneOfType([l.default.oneOf([`column-reverse`,`column`,`row-reverse`,`row`]),l.default.arrayOf(l.default.oneOf([`column-reverse`,`column`,`row-reverse`,`row`])),l.default.object]),divider:l.default.node,spacing:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.number,l.default.string])),l.default.number,l.default.object,l.default.string]),sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object])}),s}var $n={black:`#000`,white:`#fff`},er={50:`#fafafa`,100:`#f5f5f5`,200:`#eeeeee`,300:`#e0e0e0`,400:`#bdbdbd`,500:`#9e9e9e`,600:`#757575`,700:`#616161`,800:`#424242`,900:`#212121`,A100:`#f5f5f5`,A200:`#eeeeee`,A400:`#bdbdbd`,A700:`#616161`},tr={50:`#f3e5f5`,100:`#e1bee7`,200:`#ce93d8`,300:`#ba68c8`,400:`#ab47bc`,500:`#9c27b0`,600:`#8e24aa`,700:`#7b1fa2`,800:`#6a1b9a`,900:`#4a148c`,A100:`#ea80fc`,A200:`#e040fb`,A400:`#d500f9`,A700:`#aa00ff`},nr={50:`#ffebee`,100:`#ffcdd2`,200:`#ef9a9a`,300:`#e57373`,400:`#ef5350`,500:`#f44336`,600:`#e53935`,700:`#d32f2f`,800:`#c62828`,900:`#b71c1c`,A100:`#ff8a80`,A200:`#ff5252`,A400:`#ff1744`,A700:`#d50000`},rr={50:`#fff3e0`,100:`#ffe0b2`,200:`#ffcc80`,300:`#ffb74d`,400:`#ffa726`,500:`#ff9800`,600:`#fb8c00`,700:`#f57c00`,800:`#ef6c00`,900:`#e65100`,A100:`#ffd180`,A200:`#ffab40`,A400:`#ff9100`,A700:`#ff6d00`},ir={50:`#e3f2fd`,100:`#bbdefb`,200:`#90caf9`,300:`#64b5f6`,400:`#42a5f5`,500:`#2196f3`,600:`#1e88e5`,700:`#1976d2`,800:`#1565c0`,900:`#0d47a1`,A100:`#82b1ff`,A200:`#448aff`,A400:`#2979ff`,A700:`#2962ff`},ar={50:`#e1f5fe`,100:`#b3e5fc`,200:`#81d4fa`,300:`#4fc3f7`,400:`#29b6f6`,500:`#03a9f4`,600:`#039be5`,700:`#0288d1`,800:`#0277bd`,900:`#01579b`,A100:`#80d8ff`,A200:`#40c4ff`,A400:`#00b0ff`,A700:`#0091ea`},or={50:`#e8f5e9`,100:`#c8e6c9`,200:`#a5d6a7`,300:`#81c784`,400:`#66bb6a`,500:`#4caf50`,600:`#43a047`,700:`#388e3c`,800:`#2e7d32`,900:`#1b5e20`,A100:`#b9f6ca`,A200:`#69f0ae`,A400:`#00e676`,A700:`#00c853`};function sr(){return{text:{primary:`rgba(0, 0, 0, 0.87)`,secondary:`rgba(0, 0, 0, 0.6)`,disabled:`rgba(0, 0, 0, 0.38)`},divider:`rgba(0, 0, 0, 0.12)`,background:{paper:$n.white,default:$n.white},action:{active:`rgba(0, 0, 0, 0.54)`,hover:`rgba(0, 0, 0, 0.04)`,hoverOpacity:.04,selected:`rgba(0, 0, 0, 0.08)`,selectedOpacity:.08,disabled:`rgba(0, 0, 0, 0.26)`,disabledBackground:`rgba(0, 0, 0, 0.12)`,disabledOpacity:.38,focus:`rgba(0, 0, 0, 0.12)`,focusOpacity:.12,activatedOpacity:.12}}}var cr=sr();function lr(){return{text:{primary:$n.white,secondary:`rgba(255, 255, 255, 0.7)`,disabled:`rgba(255, 255, 255, 0.5)`,icon:`rgba(255, 255, 255, 0.5)`},divider:`rgba(255, 255, 255, 0.12)`,background:{paper:`#121212`,default:`#121212`},action:{active:$n.white,hover:`rgba(255, 255, 255, 0.08)`,hoverOpacity:.08,selected:`rgba(255, 255, 255, 0.16)`,selectedOpacity:.16,disabled:`rgba(255, 255, 255, 0.3)`,disabledBackground:`rgba(255, 255, 255, 0.12)`,disabledOpacity:.38,focus:`rgba(255, 255, 255, 0.12)`,focusOpacity:.12,activatedOpacity:.24}}}var ur=lr();function dr(e,t,n,r){let i=r.light||r,a=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t===`light`?e.light=Cn(e.main,i):t===`dark`&&(e.dark=Sn(e.main,a)))}function fr(e,t,n,r,i){let a=i.light||i,o=i.dark||i*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n===`light`?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(a*100).toFixed(0)}%)`:n===`dark`&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(o*100).toFixed(0)}%)`))}function pr(e=`light`){return e===`dark`?{main:ir[200],light:ir[50],dark:ir[400]}:{main:ir[700],light:ir[400],dark:ir[800]}}function mr(e=`light`){return e===`dark`?{main:tr[200],light:tr[50],dark:tr[400]}:{main:tr[500],light:tr[300],dark:tr[700]}}function hr(e=`light`){return e===`dark`?{main:nr[500],light:nr[300],dark:nr[700]}:{main:nr[700],light:nr[400],dark:nr[800]}}function gr(e=`light`){return e===`dark`?{main:ar[400],light:ar[300],dark:ar[700]}:{main:ar[700],light:ar[500],dark:ar[900]}}function _r(e=`light`){return e===`dark`?{main:or[400],light:or[300],dark:or[700]}:{main:or[800],light:or[500],dark:or[900]}}function vr(e=`light`){return e===`dark`?{main:rr[400],light:rr[300],dark:rr[700]}:{main:`#ed6c02`,light:rr[500],dark:rr[900]}}function yr(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function br(e){let{mode:t=`light`,contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:i,...a}=e,o=e.primary||pr(t),s=e.secondary||mr(t),c=e.error||hr(t),l=e.info||gr(t),u=e.success||_r(t),d=e.warning||vr(t);function f(e){if(i)return yr(e);let t=yn(e,ur.text.primary)>=n?ur.text.primary:cr.text.primary;if(process.env.NODE_ENV!==`production`){let n=yn(e,t);n<3&&console.error([`MUI: The contrast ratio of ${n}:1 for ${t} on ${e}`,`falls below the WCAG recommended absolute minimum contrast ratio of 3:1.`,`https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast`].join(`
6
+ `))}return t}let p=({color:e,name:t,mainShade:n=500,lightShade:a=300,darkShade:o=700})=>{if(e={...e},!e.main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty(`main`))throw Error(process.env.NODE_ENV===`production`?w(11,t?` (${t})`:``,n):`MUI: The color${t?` (${t})`:``} provided to augmentColor(color) is invalid.\nThe color object needs to have a \`main\` property or a \`${n}\` property.`);if(typeof e.main!=`string`)throw Error(process.env.NODE_ENV===`production`?w(12,t?` (${t})`:``,JSON.stringify(e.main)):`MUI: The color${t?` (${t})`:``} provided to augmentColor(color) is invalid.\n\`color.main\` should be a string, but \`${JSON.stringify(e.main)}\` was provided instead.\n
7
+ Did you intend to use one of the following approaches?
8
+
9
+ import { green } from "@mui/material/colors";
10
+
11
+ const theme1 = createTheme({ palette: {
12
+ primary: green,
13
+ } });
14
+
15
+ const theme2 = createTheme({ palette: {
16
+ primary: { main: green[500] },
17
+ } });`);return i?(fr(i,e,`light`,a,r),fr(i,e,`dark`,o,r)):(dr(e,`light`,a,r),dr(e,`dark`,o,r)),e.contrastText||=f(e.main),e},m;return t===`light`?m=sr():t===`dark`&&(m=lr()),process.env.NODE_ENV!==`production`&&(m||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),R({common:{...$n},mode:t,primary:p({color:o,name:`primary`}),secondary:p({color:s,name:`secondary`,mainShade:`A400`,lightShade:`A200`,darkShade:`A700`}),error:p({color:c,name:`error`}),warning:p({color:d,name:`warning`}),info:p({color:l,name:`info`}),success:p({color:u,name:`success`}),grey:er,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r,...m},a)}function xr(e){let t={};return Object.entries(e).forEach(e=>{let[n,r]=e;typeof r==`object`&&(t[n]=`${r.fontStyle?`${r.fontStyle} `:``}${r.fontVariant?`${r.fontVariant} `:``}${r.fontWeight?`${r.fontWeight} `:``}${r.fontStretch?`${r.fontStretch} `:``}${r.fontSize||``}${r.lineHeight?`/${r.lineHeight} `:``}${r.fontFamily||``}`)}),t}function Sr(e,t){return{toolbar:{minHeight:56,[e.up(`xs`)]:{"@media (orientation: landscape)":{minHeight:48}},[e.up(`sm`)]:{minHeight:64}},...t}}function Cr(e){return Math.round(e*1e5)/1e5}var wr={textTransform:`uppercase`},Tr=`"Roboto", "Helvetica", "Arial", sans-serif`;function Er(e,t){let{fontFamily:n=Tr,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:c=16,allVariants:l,pxToRem:u,...d}=typeof t==`function`?t(e):t;process.env.NODE_ENV!==`production`&&(typeof r!=`number`&&console.error("MUI: `fontSize` is required to be a number."),typeof c!=`number`&&console.error("MUI: `htmlFontSize` is required to be a number."));let f=r/14,p=u||(e=>`${e/c*f}rem`),m=(e,t,r,i,a)=>({fontFamily:n,fontWeight:e,fontSize:p(t),lineHeight:r,...n===Tr?{letterSpacing:`${Cr(i/t)}em`}:{},...a,...l});return R({htmlFontSize:c,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(o,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(o,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(o,14,1.75,.4,wr),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,wr),inherit:{fontFamily:`inherit`,fontWeight:`inherit`,fontSize:`inherit`,lineHeight:`inherit`,letterSpacing:`inherit`}},d,{clone:!1})}var Dr=.2,Or=.14,kr=.12;function W(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Dr})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Or})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${kr})`].join(`,`)}var Ar=[`none`,W(0,2,1,-1,0,1,1,0,0,1,3,0),W(0,3,1,-2,0,2,2,0,0,1,5,0),W(0,3,3,-2,0,3,4,0,0,1,8,0),W(0,2,4,-1,0,4,5,0,0,1,10,0),W(0,3,5,-1,0,5,8,0,0,1,14,0),W(0,3,5,-1,0,6,10,0,0,1,18,0),W(0,4,5,-2,0,7,10,1,0,2,16,1),W(0,5,5,-3,0,8,10,1,0,3,14,2),W(0,5,6,-3,0,9,12,1,0,3,16,2),W(0,6,6,-3,0,10,14,1,0,4,18,3),W(0,6,7,-4,0,11,15,1,0,4,20,3),W(0,7,8,-4,0,12,17,2,0,5,22,4),W(0,7,8,-4,0,13,19,2,0,5,24,4),W(0,7,9,-4,0,14,21,2,0,5,26,4),W(0,8,9,-5,0,15,22,2,0,6,28,5),W(0,8,10,-5,0,16,24,2,0,6,30,5),W(0,8,11,-5,0,17,26,2,0,6,32,5),W(0,9,11,-5,0,18,28,2,0,7,34,6),W(0,9,12,-6,0,19,29,2,0,7,36,6),W(0,10,13,-6,0,20,31,3,0,8,38,7),W(0,10,13,-6,0,21,33,3,0,8,40,7),W(0,10,14,-6,0,22,35,3,0,8,42,7),W(0,11,14,-7,0,23,36,3,0,9,44,8),W(0,11,15,-7,0,24,38,3,0,9,46,8)],jr={easeInOut:`cubic-bezier(0.4, 0, 0.2, 1)`,easeOut:`cubic-bezier(0.0, 0, 0.2, 1)`,easeIn:`cubic-bezier(0.4, 0, 1, 1)`,sharp:`cubic-bezier(0.4, 0, 0.6, 1)`},Mr={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Nr(e){return`${Math.round(e)}ms`}function Pr(e){if(!e)return 0;let t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Fr(e){let t={...jr,...e.easing},n={...Mr,...e.duration};return{getAutoHeightDuration:Pr,create:(e=[`all`],r={})=>{let{duration:i=n.standard,easing:a=t.easeInOut,delay:o=0,...s}=r;if(process.env.NODE_ENV!==`production`){let t=e=>typeof e==`string`,n=e=>!Number.isNaN(parseFloat(e));!t(e)&&!Array.isArray(e)&&console.error(`MUI: Argument "props" must be a string or Array.`),!n(i)&&!t(i)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${i}.`),t(a)||console.error(`MUI: Argument "easing" must be a string.`),!n(o)&&!t(o)&&console.error(`MUI: Argument "delay" must be a number or a string.`),typeof r!=`object`&&console.error([`MUI: Secong argument of transition.create must be an object.`,"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
18
+ `)),Object.keys(s).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(s).join(`,`)}].`)}return(Array.isArray(e)?e:[e]).map(e=>`${e} ${typeof i==`string`?i:Nr(i)} ${a} ${typeof o==`string`?o:Nr(o)}`).join(`,`)},...e,easing:t,duration:n}}var Ir={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Lr(e){return L(e)||e===void 0||typeof e==`string`||typeof e==`boolean`||typeof e==`number`||Array.isArray(e)}function Rr(e={}){let t={...e};function n(e){let t=Object.entries(e);for(let r=0;r<t.length;r++){let[i,a]=t[r];!Lr(a)||i.startsWith(`unstable_`)?delete e[i]:L(a)&&(e[i]={...a},n(e[i]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
19
+
20
+ const theme = ${JSON.stringify(t,null,2)};
21
+
22
+ theme.breakpoints = createBreakpoints(theme.breakpoints || {});
23
+ theme.transitions = createTransitions(theme.transitions || {});
24
+
25
+ export default theme;`}function zr(e){return typeof e==`number`?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}var Br=e=>{if(!Number.isNaN(+e))return+e;let t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let e=0;e<t.length;e+=1)n+=+t[e];return n};function Vr(e){Object.assign(e,{alpha(t,n){let r=this||e;return r.colorSpace?`oklch(from ${t} l c h / ${typeof n==`string`?`calc(${n})`:n})`:r.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,`var(--$1Channel)`)} / ${typeof n==`string`?`calc(${n})`:n})`:bn(t,Br(n))},lighten(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #fff ${zr(n)})`:Cn(t,n)},darken(t,n){let r=this||e;return r.colorSpace?`color-mix(in ${r.colorSpace}, ${t}, #000 ${zr(n)})`:Sn(t,n)}})}function Hr(e={},...t){let{breakpoints:n,mixins:r={},spacing:i,palette:a={},transitions:o={},typography:s={},shape:c,colorSpace:l,...u}=e;if(e.vars&&e.generateThemeVars===void 0)throw Error(process.env.NODE_ENV===`production`?w(20):"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.");let d=br({...a,colorSpace:l}),f=kt(e),p=R(f,{mixins:Sr(f.breakpoints,r),palette:d,shadows:Ar.slice(),typography:Er(d,s),transitions:Fr(o),zIndex:{...Ir}});if(p=R(p,u),p=t.reduce((e,t)=>R(e,t),p),process.env.NODE_ENV!==`production`){let e=[`active`,`checked`,`completed`,`disabled`,`error`,`expanded`,`focused`,`focusVisible`,`required`,`selected`],t=(t,n)=>{let r;for(r in t){let i=t[r];if(e.includes(r)&&Object.keys(i).length>0){if(process.env.NODE_ENV!==`production`){let e=zt(``,r);console.error([`MUI: The \`${n}\` component increases the CSS specificity of the \`${r}\` internal state.`,`You can not override it like this: `,JSON.stringify(t,null,2),``,`Instead, you need to use the '&.${e}' syntax:`,JSON.stringify({root:{[`&.${e}`]:i}},null,2),``,`https://mui.com/r/state-classes-guide`].join(`
26
+ `))}t[r]={}}}};Object.keys(p.components).forEach(e=>{let n=p.components[e].styleOverrides;n&&e.startsWith(`Mui`)&&t(n,e)})}return p.unstable_sxConfig={...Ct,...u?.unstable_sxConfig},p.unstable_sx=function(e){return Dt({sx:e,theme:this})},p.toRuntimeSource=Rr,Vr(p),p}function Ur(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}var Wr=[...Array(25)].map((e,t)=>{if(t===0)return`none`;let n=Ur(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Gr(e){return{inputPlaceholder:e===`dark`?.5:.42,inputUnderline:e===`dark`?.7:.42,switchTrackDisabled:e===`dark`?.2:.12,switchTrack:e===`dark`?.3:.38}}function Kr(e){return e===`dark`?Wr:[]}function qr(e){let{palette:t={mode:`light`},opacity:n,overlays:r,colorSpace:i,...a}=e,o=br({...t,colorSpace:i});return{palette:o,opacity:{...Gr(o.mode),...n},overlays:r||Kr(o.mode),...a}}function Jr(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]===`palette`&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}var Yr=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:``}overlays-${n}`),`--${e?`${e}-`:``}palette-AppBar-darkBg`,`--${e?`${e}-`:``}palette-AppBar-darkColor`],Xr=e=>(t,n)=>{let r=e.rootSelector||`:root`,i=e.colorSchemeSelector,a=i;if(i===`class`&&(a=`.%s`),i===`data`&&(a=`[data-%s]`),i?.startsWith(`data-`)&&!i.includes(`%s`)&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if(t===`dark`){let i={};return Yr(e.cssVarPrefix).forEach(e=>{i[e]=n[e],delete n[e]}),a===`media`?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:i}}:a?{[a.replace(`%s`,t)]:i,[`${r}, ${a.replace(`%s`,t)}`]:n}:{[r]:{...n,...i}}}if(a&&a!==`media`)return`${r}, ${a.replace(`%s`,String(t))}`}else if(t){if(a===`media`)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(a)return a.replace(`%s`,String(t))}return r};function Zr(e,t){t.forEach(t=>{e[t]||(e[t]={})})}function G(e,t,n){!e[t]&&n&&(e[t]=n)}function Qr(e){return typeof e!=`string`||!e.startsWith(`hsl`)?e:_n(e)}function $r(e,t){`${t}Channel`in e||(e[`${t}Channel`]=hn(Qr(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
27
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function ei(e){return typeof e==`number`?`${e}px`:typeof e==`string`||typeof e==`function`||Array.isArray(e)?e:`8px`}var ti=e=>{try{return e()}catch{}},ni=(e=`mui`)=>zn(e);function ri(e,t,n,r,i){if(!n)return;n=n===!0?{}:n;let a=i===`dark`?`dark`:`light`;if(!r){t[i]=qr({...n,palette:{mode:a,...n?.palette},colorSpace:e});return}let{palette:o,...s}=Hr({...r,palette:{mode:a,...n?.palette},colorSpace:e});return t[i]={...n,palette:o,opacity:{...Gr(a),...n?.opacity},overlays:n?.overlays||Kr(a)},s}function ii(e={},...t){let{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:a=`mui`,nativeColor:o=!1,shouldSkipGeneratingVar:s=Jr,colorSchemeSelector:c=n.light&&n.dark?`media`:void 0,rootSelector:l=`:root`,...u}=e,d=Object.keys(n)[0],f=r||(n.light&&d!==`light`?`light`:d),p=ni(a),{[f]:m,light:h,dark:g,..._}=n,v={..._},y=m;if((f===`dark`&&!(`dark`in n)||f===`light`&&!(`light`in n))&&(y=!0),!y)throw Error(process.env.NODE_ENV===`production`?w(21,f):`MUI: The \`colorSchemes.${f}\` option is either missing or invalid.`);let b;o&&(b=`oklch`);let x=ri(b,v,y,u,f);h&&!v.light&&ri(b,v,h,void 0,`light`),g&&!v.dark&&ri(b,v,g,void 0,`dark`);let S={defaultColorScheme:f,...x,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:l,getCssVar:p,colorSchemes:v,font:{...xr(x.typography),...x.font},spacing:ei(u.spacing)};Object.keys(S.colorSchemes).forEach(e=>{let t=S.colorSchemes[e].palette,n=e=>{let n=e.split(`-`),r=n[1],i=n[2];return p(e,t[r][i])};t.mode===`light`&&(G(t.common,`background`,`#fff`),G(t.common,`onBackground`,`#000`)),t.mode===`dark`&&(G(t.common,`background`,`#000`),G(t.common,`onBackground`,`#fff`));function r(e,t,n){if(b){let r;return e===xn&&(r=`transparent ${((1-n)*100).toFixed(0)}%`),e===H&&(r=`#000 ${(n*100).toFixed(0)}%`),e===U&&(r=`#fff ${(n*100).toFixed(0)}%`),`color-mix(in ${b}, ${t}, ${r})`}return e(t,n)}if(Zr(t,[`Alert`,`AppBar`,`Avatar`,`Button`,`Chip`,`FilledInput`,`LinearProgress`,`Skeleton`,`Slider`,`SnackbarContent`,`SpeedDialAction`,`StepConnector`,`StepContent`,`Switch`,`TableCell`,`Tooltip`]),t.mode===`light`){G(t.Alert,`errorColor`,r(H,t.error.light,.6)),G(t.Alert,`infoColor`,r(H,t.info.light,.6)),G(t.Alert,`successColor`,r(H,t.success.light,.6)),G(t.Alert,`warningColor`,r(H,t.warning.light,.6)),G(t.Alert,`errorFilledBg`,n(`palette-error-main`)),G(t.Alert,`infoFilledBg`,n(`palette-info-main`)),G(t.Alert,`successFilledBg`,n(`palette-success-main`)),G(t.Alert,`warningFilledBg`,n(`palette-warning-main`)),G(t.Alert,`errorFilledColor`,ti(()=>t.getContrastText(t.error.main))),G(t.Alert,`infoFilledColor`,ti(()=>t.getContrastText(t.info.main))),G(t.Alert,`successFilledColor`,ti(()=>t.getContrastText(t.success.main))),G(t.Alert,`warningFilledColor`,ti(()=>t.getContrastText(t.warning.main))),G(t.Alert,`errorStandardBg`,r(U,t.error.light,.9)),G(t.Alert,`infoStandardBg`,r(U,t.info.light,.9)),G(t.Alert,`successStandardBg`,r(U,t.success.light,.9)),G(t.Alert,`warningStandardBg`,r(U,t.warning.light,.9)),G(t.Alert,`errorIconColor`,n(`palette-error-main`)),G(t.Alert,`infoIconColor`,n(`palette-info-main`)),G(t.Alert,`successIconColor`,n(`palette-success-main`)),G(t.Alert,`warningIconColor`,n(`palette-warning-main`)),G(t.AppBar,`defaultBg`,n(`palette-grey-100`)),G(t.Avatar,`defaultBg`,n(`palette-grey-400`)),G(t.Button,`inheritContainedBg`,n(`palette-grey-300`)),G(t.Button,`inheritContainedHoverBg`,n(`palette-grey-A100`)),G(t.Chip,`defaultBorder`,n(`palette-grey-400`)),G(t.Chip,`defaultAvatarColor`,n(`palette-grey-700`)),G(t.Chip,`defaultIconColor`,n(`palette-grey-700`)),G(t.FilledInput,`bg`,`rgba(0, 0, 0, 0.06)`),G(t.FilledInput,`hoverBg`,`rgba(0, 0, 0, 0.09)`),G(t.FilledInput,`disabledBg`,`rgba(0, 0, 0, 0.12)`),G(t.LinearProgress,`primaryBg`,r(U,t.primary.main,.62)),G(t.LinearProgress,`secondaryBg`,r(U,t.secondary.main,.62)),G(t.LinearProgress,`errorBg`,r(U,t.error.main,.62)),G(t.LinearProgress,`infoBg`,r(U,t.info.main,.62)),G(t.LinearProgress,`successBg`,r(U,t.success.main,.62)),G(t.LinearProgress,`warningBg`,r(U,t.warning.main,.62)),G(t.Skeleton,`bg`,b?r(xn,t.text.primary,.11):`rgba(${n(`palette-text-primaryChannel`)} / 0.11)`),G(t.Slider,`primaryTrack`,r(U,t.primary.main,.62)),G(t.Slider,`secondaryTrack`,r(U,t.secondary.main,.62)),G(t.Slider,`errorTrack`,r(U,t.error.main,.62)),G(t.Slider,`infoTrack`,r(U,t.info.main,.62)),G(t.Slider,`successTrack`,r(U,t.success.main,.62)),G(t.Slider,`warningTrack`,r(U,t.warning.main,.62));let e=b?r(H,t.background.default,.6825):Tn(t.background.default,.8);G(t.SnackbarContent,`bg`,e),G(t.SnackbarContent,`color`,ti(()=>b?ur.text.primary:t.getContrastText(e))),G(t.SpeedDialAction,`fabHoverBg`,Tn(t.background.paper,.15)),G(t.StepConnector,`border`,n(`palette-grey-400`)),G(t.StepContent,`border`,n(`palette-grey-400`)),G(t.Switch,`defaultColor`,n(`palette-common-white`)),G(t.Switch,`defaultDisabledColor`,n(`palette-grey-100`)),G(t.Switch,`primaryDisabledColor`,r(U,t.primary.main,.62)),G(t.Switch,`secondaryDisabledColor`,r(U,t.secondary.main,.62)),G(t.Switch,`errorDisabledColor`,r(U,t.error.main,.62)),G(t.Switch,`infoDisabledColor`,r(U,t.info.main,.62)),G(t.Switch,`successDisabledColor`,r(U,t.success.main,.62)),G(t.Switch,`warningDisabledColor`,r(U,t.warning.main,.62)),G(t.TableCell,`border`,r(U,r(xn,t.divider,1),.88)),G(t.Tooltip,`bg`,r(xn,t.grey[700],.92))}if(t.mode===`dark`){G(t.Alert,`errorColor`,r(U,t.error.light,.6)),G(t.Alert,`infoColor`,r(U,t.info.light,.6)),G(t.Alert,`successColor`,r(U,t.success.light,.6)),G(t.Alert,`warningColor`,r(U,t.warning.light,.6)),G(t.Alert,`errorFilledBg`,n(`palette-error-dark`)),G(t.Alert,`infoFilledBg`,n(`palette-info-dark`)),G(t.Alert,`successFilledBg`,n(`palette-success-dark`)),G(t.Alert,`warningFilledBg`,n(`palette-warning-dark`)),G(t.Alert,`errorFilledColor`,ti(()=>t.getContrastText(t.error.dark))),G(t.Alert,`infoFilledColor`,ti(()=>t.getContrastText(t.info.dark))),G(t.Alert,`successFilledColor`,ti(()=>t.getContrastText(t.success.dark))),G(t.Alert,`warningFilledColor`,ti(()=>t.getContrastText(t.warning.dark))),G(t.Alert,`errorStandardBg`,r(H,t.error.light,.9)),G(t.Alert,`infoStandardBg`,r(H,t.info.light,.9)),G(t.Alert,`successStandardBg`,r(H,t.success.light,.9)),G(t.Alert,`warningStandardBg`,r(H,t.warning.light,.9)),G(t.Alert,`errorIconColor`,n(`palette-error-main`)),G(t.Alert,`infoIconColor`,n(`palette-info-main`)),G(t.Alert,`successIconColor`,n(`palette-success-main`)),G(t.Alert,`warningIconColor`,n(`palette-warning-main`)),G(t.AppBar,`defaultBg`,n(`palette-grey-900`)),G(t.AppBar,`darkBg`,n(`palette-background-paper`)),G(t.AppBar,`darkColor`,n(`palette-text-primary`)),G(t.Avatar,`defaultBg`,n(`palette-grey-600`)),G(t.Button,`inheritContainedBg`,n(`palette-grey-800`)),G(t.Button,`inheritContainedHoverBg`,n(`palette-grey-700`)),G(t.Chip,`defaultBorder`,n(`palette-grey-700`)),G(t.Chip,`defaultAvatarColor`,n(`palette-grey-300`)),G(t.Chip,`defaultIconColor`,n(`palette-grey-300`)),G(t.FilledInput,`bg`,`rgba(255, 255, 255, 0.09)`),G(t.FilledInput,`hoverBg`,`rgba(255, 255, 255, 0.13)`),G(t.FilledInput,`disabledBg`,`rgba(255, 255, 255, 0.12)`),G(t.LinearProgress,`primaryBg`,r(H,t.primary.main,.5)),G(t.LinearProgress,`secondaryBg`,r(H,t.secondary.main,.5)),G(t.LinearProgress,`errorBg`,r(H,t.error.main,.5)),G(t.LinearProgress,`infoBg`,r(H,t.info.main,.5)),G(t.LinearProgress,`successBg`,r(H,t.success.main,.5)),G(t.LinearProgress,`warningBg`,r(H,t.warning.main,.5)),G(t.Skeleton,`bg`,b?r(xn,t.text.primary,.13):`rgba(${n(`palette-text-primaryChannel`)} / 0.13)`),G(t.Slider,`primaryTrack`,r(H,t.primary.main,.5)),G(t.Slider,`secondaryTrack`,r(H,t.secondary.main,.5)),G(t.Slider,`errorTrack`,r(H,t.error.main,.5)),G(t.Slider,`infoTrack`,r(H,t.info.main,.5)),G(t.Slider,`successTrack`,r(H,t.success.main,.5)),G(t.Slider,`warningTrack`,r(H,t.warning.main,.5));let e=b?r(U,t.background.default,.985):Tn(t.background.default,.98);G(t.SnackbarContent,`bg`,e),G(t.SnackbarContent,`color`,ti(()=>b?cr.text.primary:t.getContrastText(e))),G(t.SpeedDialAction,`fabHoverBg`,Tn(t.background.paper,.15)),G(t.StepConnector,`border`,n(`palette-grey-600`)),G(t.StepContent,`border`,n(`palette-grey-600`)),G(t.Switch,`defaultColor`,n(`palette-grey-300`)),G(t.Switch,`defaultDisabledColor`,n(`palette-grey-600`)),G(t.Switch,`primaryDisabledColor`,r(H,t.primary.main,.55)),G(t.Switch,`secondaryDisabledColor`,r(H,t.secondary.main,.55)),G(t.Switch,`errorDisabledColor`,r(H,t.error.main,.55)),G(t.Switch,`infoDisabledColor`,r(H,t.info.main,.55)),G(t.Switch,`successDisabledColor`,r(H,t.success.main,.55)),G(t.Switch,`warningDisabledColor`,r(H,t.warning.main,.55)),G(t.TableCell,`border`,r(H,r(xn,t.divider,1),.68)),G(t.Tooltip,`bg`,r(xn,t.grey[700],.92))}$r(t.background,`default`),$r(t.background,`paper`),$r(t.common,`background`),$r(t.common,`onBackground`),$r(t,`divider`),Object.keys(t).forEach(e=>{let n=t[e];e!==`tonalOffset`&&n&&typeof n==`object`&&(n.main&&G(t[e],`mainChannel`,hn(Qr(n.main))),n.light&&G(t[e],`lightChannel`,hn(Qr(n.light))),n.dark&&G(t[e],`darkChannel`,hn(Qr(n.dark))),n.contrastText&&G(t[e],`contrastTextChannel`,hn(Qr(n.contrastText))),e===`text`&&($r(t[e],`primary`),$r(t[e],`secondary`)),e===`action`&&(n.active&&$r(t[e],`active`),n.selected&&$r(t[e],`selected`)))})}),S=t.reduce((e,t)=>R(e,t),S);let C={prefix:a,disableCssColorScheme:i,shouldSkipGeneratingVar:s,getSelector:Xr(S),enableContrastVars:o},{vars:T,generateThemeVars:E,generateStyleSheets:D}=Wn(S,C);return S.vars=T,Object.entries(S.colorSchemes[S.defaultColorScheme]).forEach(([e,t])=>{S[e]=t}),S.generateThemeVars=E,S.generateStyleSheets=D,S.generateSpacing=function(){return Ye(u.spacing,Ue(this))},S.getColorSchemeSelector=Gn(c),S.spacing=S.generateSpacing(),S.shouldSkipGeneratingVar=s,S.unstable_sxConfig={...Ct,...u?.unstable_sxConfig},S.unstable_sx=function(e){return Dt({sx:e,theme:this})},S.toRuntimeSource=Rr,S}function ai(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:br({...n===!0?{}:n.palette,mode:t})})}function oi(e={},...t){let{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:a=n?.mode,...o}=e,s=a||`light`,c=i?.[s],l={...i,...n?{[s]:{...typeof c!=`boolean`&&c,palette:n}}:void 0};if(r===!1){if(!(`colorSchemes`in e))return Hr(e,...t);let r=n;`palette`in e||l[s]&&(l[s]===!0?s===`dark`&&(r={mode:`dark`}):r=l[s].palette);let i=Hr({...e,palette:r},...t);return i.defaultColorScheme=s,i.colorSchemes=l,i.palette.mode===`light`&&(i.colorSchemes.light={...l.light!==!0&&l.light,palette:i.palette},ai(i,`dark`,l.dark)),i.palette.mode===`dark`&&(i.colorSchemes.dark={...l.dark!==!0&&l.dark,palette:i.palette},ai(i,`light`,l.light)),i}return!n&&!(`light`in l)&&s===`light`&&(l.light=!0),ii({...o,colorSchemes:l,defaultColorScheme:s,...typeof r!=`boolean`&&r},...t)}var si=oi();function ci(){let e=Nt(si);return process.env.NODE_ENV!==`production`&&n.useDebugValue(e),e.$$material||e}function li({props:e,name:t}){return cn({props:e,name:t,defaultTheme:si,themeId:T})}function ui(e){return e!==`ownerState`&&e!==`theme`&&e!==`sx`&&e!==`as`}var di=Qt({themeId:T,defaultTheme:si,rootShouldForwardProp:e=>ui(e)&&e!==`classes`});function fi(...e){let t=n.useRef(void 0),r=n.useCallback(t=>{let n=e.map(e=>{if(e==null)return null;if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}});return()=>{n.forEach(e=>e?.())}},e);return n.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=r(e))},e)}var pi=(e,t,n)=>{if(t.length===1&&t[0]===n){let t=!1;try{let n={};e(n)===n&&(t=!0)}catch{}if(t){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`The result function returned its own inputs without modification. e.g
28
+ \`createSelector([state => state.todos], todos => todos)\`
29
+ This could lead to inefficient memoization and unnecessary re-renders.
30
+ Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:e})}}},mi=(e,t,n)=>{let{memoize:r,memoizeOptions:i}=t,{inputSelectorResults:a,inputSelectorResultsCopy:o}=e,s=r(()=>({}),...i);if(s.apply(null,a)!==s.apply(null,o)){let e;try{throw Error()}catch(t){({stack:e}=t)}console.warn(`An input selector returned a different result when passed same arguments.
31
+ This means your output selector will likely run more frequently than intended.
32
+ Avoid returning a new reference inside your input selector, e.g.
33
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:a,secondInputs:o,stack:e})}},hi={inputStabilityCheck:`once`,identityFunctionCheck:`once`},gi=Symbol(`NOT_FOUND`);function _i(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function vi(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function yi(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var bi=e=>Array.isArray(e)?e:[e];function xi(e){let t=Array.isArray(e[0])?e[0]:e;return yi(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Si(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}var Ci=(e,t)=>{let{identityFunctionCheck:n,inputStabilityCheck:r}={...hi,...t};return{identityFunctionCheck:{shouldRun:n===`always`||n===`once`&&e,run:pi},inputStabilityCheck:{shouldRun:r===`always`||r===`once`&&e,run:mi}}};function wi(e){let t;return{get(n){return t&&e(t.key,n)?t.value:gi},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Ti(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return gi}function i(t,i){r(t)===gi&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Ei=(e,t)=>e===t;function Di(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function Oi(e,t){let{equalityCheck:n=Ei,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=Di(n),o=0,s=r<=1?wi(a):Ti(r,a);function c(){let t=s.get(arguments);if(t===gi){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var ki=class{constructor(e){this.value=e}deref(){return this.value}},Ai=typeof WeakRef<`u`?WeakRef:ki,ji=0,Mi=1;function Ni(){return{s:ji,v:void 0,o:null,p:null}}function Pi(e,t={}){let n=Ni(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=Ni(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=Ni(),e.set(n,t)):t=r}}let s=t,c;if(t.s===Mi)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new Ai(c):c}return s.s=Mi,s.v=c,c}return o.clearCache=()=>{n=Ni(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Fi(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),_i(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=Pi,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=bi(c),p=bi(u),m=xi(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=!0,_=l(function(){r++;let e=Si(m,arguments);if(i=h.apply(null,e),process.env.NODE_ENV!==`production`){let{identityFunctionCheck:t,inputStabilityCheck:n}=Ci(g,d);if(t.shouldRun&&t.run(o,e,i),n.shouldRun){let t=Si(m,arguments);n.run({inputSelectorResults:e,inputSelectorResultsCopy:t},{memoize:s,memoizeOptions:f},arguments)}g&&=!1}return i},...p);return Object.assign(_,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var Ii=Fi(Pi),Li=Object.assign((e,t=Ii)=>{vi(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>Li}),Ri=Fi({memoize:Oi,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),K=(e,t,n,r,i,a,o,s,...c)=>{if(c.length>0)throw Error(`Unsupported number of selectors`);let l;if(e&&t&&n&&r&&i&&a&&o&&s)l=(c,l,u,d)=>s(e(c,l,u,d),t(c,l,u,d),n(c,l,u,d),r(c,l,u,d),i(c,l,u,d),a(c,l,u,d),o(c,l,u,d),l,u,d);else if(e&&t&&n&&r&&i&&a&&o)l=(s,c,l,u)=>o(e(s,c,l,u),t(s,c,l,u),n(s,c,l,u),r(s,c,l,u),i(s,c,l,u),a(s,c,l,u),c,l,u);else if(e&&t&&n&&r&&i&&a)l=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)l=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)l=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)l=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)l=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)l=e;else throw Error(`Missing arguments`);return l},zi=e=>(...t)=>{let n=new WeakMap,r=1,i=t[t.length-1],a=t.length-1||1,o=Math.max(i.length-a,0);if(o>3)throw Error(`Unsupported number of arguments`);return(a,s,c,l)=>{let u=a.__cacheKey__;u||(u={id:r},a.__cacheKey__=u,r+=1);let d=n.get(u);if(!d){let r=t.length===1?[e=>e,i]:t,a=t,s=[void 0,void 0,void 0];switch(o){case 0:break;case 1:a=[...r.slice(0,-1),()=>s[0],i];break;case 2:a=[...r.slice(0,-1),()=>s[0],()=>s[1],i];break;case 3:a=[...r.slice(0,-1),()=>s[0],()=>s[1],()=>s[2],i];break;default:throw Error(`Unsupported number of arguments`)}e&&(a=[...a,e]),d=Ri(...a),d.selectorArgs=s,n.set(u,d)}switch(o){case 3:d.selectorArgs[2]=l;case 2:d.selectorArgs[1]=c;case 1:d.selectorArgs[0]=s;default:}switch(o){case 0:return d(a);case 1:return d(a,s);case 2:return d(a,s,c);case 3:return d(a,s,c,l);default:throw Error(`unreachable`)}}},q=zi(),Bi=e.x((e=>{var t=require(`react`);function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),Vi=e.x((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}function n(e,t){d||a.startTransition===void 0||(d=!0,console.error(`You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.`));var n=t();if(!f){var i=t();o(n,i)||(console.error(`The result of getSnapshot should be cached to avoid an infinite loop`),f=!0)}i=s({inst:{value:n,getSnapshot:t}});var p=i[0].inst,m=i[1];return l(function(){p.value=n,p.getSnapshot=t,r(p)&&m({inst:p})},[e,n,t]),c(function(){return r(p)&&m({inst:p}),e(function(){r(p)&&m({inst:p})})},[e]),u(n),n}function r(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch{return!0}}function i(e,t){return t()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=require(`react`),o=typeof Object.is==`function`?Object.is:t,s=a.useState,c=a.useEffect,l=a.useLayoutEffect,u=a.useDebugValue,d=!1,f=!1,p=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?i:n;e.useSyncExternalStore=a.useSyncExternalStore===void 0?p:a.useSyncExternalStore,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Hi=e.x(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Bi():t.exports=Vi()})),Ui=e.x((e=>{var t=require(`react`),n=Hi();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Wi=e.x((e=>{process.env.NODE_ENV!==`production`&&(function(){function t(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=require(`react`),r=Hi(),i=typeof Object.is==`function`?Object.is:t,a=r.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==`function`&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()})),Gi=e.x(((e,t)=>{process.env.NODE_ENV===`production`?t.exports=Ui():t.exports=Wi()})),Ki=Hi(),qi=Gi(),Ji=parseInt(n.version,10)>=19?Xi:Zi;function Yi(e,t,n,r,i){return Ji(e,t,n,r,i)}function Xi(e,t,r,i,a){let o=n.useCallback(()=>t(e.getSnapshot(),r,i,a),[e,t,r,i,a]);return(0,Ki.useSyncExternalStore)(e.subscribe,o,o)}function Zi(e,t,n,r,i){return(0,qi.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Qi={};function $i(e,t){let r=n.useRef(Qi);return r.current===Qi&&(r.current=e(t)),r}var ea=[];function ta(e){n.useEffect(e,ea)}var na=()=>{};function ra(e,t,n){let r=$i(ia,{store:e,selector:t}).current;r.effect=n,ta(r.onMount)}function ia(e){let{store:t,selector:n}=e,r=n(t.state),i={effect:na,dispose:null,subscribe:()=>{i.dispose??=t.subscribe(e=>{let t=n(e);if(!Object.is(r,t)){let e=r;r=t,i.effect(e,t)}})},onMount:()=>(i.subscribe(),()=>{i.dispose?.(),i.dispose=null})};return i.subscribe(),i}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},J.apply(null,arguments)}var aa=class e{static create(t){return new e(t)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){this.state=e,this.updateTick+=1;let t=this.updateTick,n=this.listeners.values(),r;for(;r=n.next(),!r.done;){if(t!==this.updateTick)return;let n=r.value;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState(J({},this.state,e));return}}set(e,t){Object.is(this.state[e],t)||this.setState(J({},this.state,{[e]:t}))}use=(e,t,n,r)=>Yi(this,e,t,n,r)},oa=({params:e,store:t})=>{n.useEffect(()=>{t.set(`animation`,y({},t.state.animation,{skip:e.skipAnimation}))},[t,e.skipAnimation]);let r=n.useCallback(()=>{let e=!1;return t.set(`animation`,y({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests+1})),()=>{e||(e=!0,t.set(`animation`,y({},t.state.animation,{skipAnimationRequests:t.state.animation.skipAnimationRequests-1})))}},[t]);return ln(()=>{if(typeof window>`u`||!window?.matchMedia)return;let e,t=t=>{t.matches?e=r():e?.()},n=window.matchMedia(`(prefers-reduced-motion)`);return t(n),n.addEventListener(`change`,t),()=>{n.removeEventListener(`change`,t)}},[r,t]),{instance:{disableAnimation:r}}};oa.params={skipAnimation:!0},oa.getDefaultizedParams=({params:e})=>y({},e,{skipAnimation:e.skipAnimation??!1}),oa.getInitialState=({skipAnimation:e})=>{let t=typeof window>`u`||!window?.matchMedia;return{animation:{skip:e,skipAnimationRequests:process.env.NODE_ENV===`test`&&t?1:0}}};var sa=K(e=>e.animation,e=>e.skip||e.skipAnimationRequests>0);function ca(e,t){let r=n.useRef(!0);n.useEffect(()=>{if(r.current){r.current=!1;return}return e()},t)}function la(e){return e&&e.ownerDocument||document}function ua(e){return la(e).defaultView||window}var da=`DEFAULT_X_AXIS_KEY`,fa=`DEFAULT_Y_AXIS_KEY`,pa={top:20,bottom:20,left:20,right:20},ma=e=>e.cartesianAxis?.x,ha=e=>e.cartesianAxis?.y,ga=q(K(ha,function(e){return(e??[]).reduce((e,t)=>t.position===`left`?e+(t.width||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),K(ha,function(e){return(e??[]).reduce((e,t)=>t.position===`right`?e+(t.width||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),K(ma,function(e){return(e??[]).reduce((e,t)=>t.position===`top`?e+(t.height||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),K(ma,function(e){return(e??[]).reduce((e,t)=>t.position===`bottom`?e+(t.height||0)+(t.zoom?.slider.enabled?t.zoom.slider.size:0):e,0)}),function(e,t,n,r){return{left:e,right:t,top:n,bottom:r}}),_a=e=>e.dimensions,va=q(_a,e=>e.dimensions.margin,ga,function({width:e,height:t},{top:n,right:r,bottom:i,left:a},{left:o,right:s,top:c,bottom:l}){return{width:e-a-r-o-s,left:a+o,right:r+s,height:t-n-i-c-l,top:n+c,bottom:i+l}}),ya=K(_a,e=>e.width),ba=K(_a,e=>e.height),xa=K(_a,e=>e.propsWidth),Sa=K(_a,e=>e.propsHeight);function Ca(e,t){return typeof e==`number`?{top:e,bottom:e,left:e,right:e}:t?y({},t,e):e}var wa=10,Ta=({params:e,store:t,svgRef:r})=>{let i=e.width!==void 0&&e.height!==void 0,a=n.useRef({displayError:!1,initialCompute:!0,computeRun:0}),[o,s]=n.useState(0),[c,l]=n.useState(0),u=n.useCallback(()=>{let n=r?.current;if(!n)return{};let i=ua(n).getComputedStyle(n),a=Math.floor(parseFloat(i.height))||0,o=Math.floor(parseFloat(i.width))||0;return(t.state.dimensions.width!==o||t.state.dimensions.height!==a)&&t.set(`dimensions`,{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:e.width??o,height:e.height??a,propsWidth:e.width,propsHeight:e.height}),{height:a,width:o}},[t,r,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]);ca(()=>{let n=e.width??t.state.dimensions.width,r=e.height??t.state.dimensions.height;t.set(`dimensions`,{margin:{top:e.margin.top,right:e.margin.right,bottom:e.margin.bottom,left:e.margin.left},width:n,height:r,propsHeight:e.height,propsWidth:e.width})},[t,e.height,e.width,e.margin.left,e.margin.right,e.margin.top,e.margin.bottom]),n.useEffect(()=>{a.current.displayError=!0},[]),ln(()=>{if(i||!a.current.initialCompute||a.current.computeRun>wa)return;let e=u();e.width!==o||e.height!==c?(a.current.computeRun+=1,e.width!==void 0&&s(e.width),e.height!==void 0&&l(e.height)):a.current.initialCompute&&(a.current.initialCompute=!1)},[c,o,u,i]),ln(()=>{if(i)return()=>{};u();let e=r.current;if(typeof ResizeObserver>`u`)return()=>{};let t,n=new ResizeObserver(()=>{t=requestAnimationFrame(()=>{u()})});return e&&n.observe(e),()=>{t&&cancelAnimationFrame(t),e&&n.unobserve(e)}},[u,i,r]),process.env.NODE_ENV!==`production`&&(a.current.displayError&&e.width===void 0&&o===0&&(console.error("MUI X Charts: ChartContainer does not have `width` prop, and its container has no `width` defined."),a.current.displayError=!1),a.current.displayError&&e.height===void 0&&c===0&&(console.error("MUI X Charts: ChartContainer does not have `height` prop, and its container has no `height` defined."),a.current.displayError=!1));let d=t.use(va),f=n.useCallback(e=>e>=d.left-1&&e<=d.left+d.width,[d.left,d.width]),p=n.useCallback(e=>e>=d.top-1&&e<=d.top+d.height,[d.height,d.top]);return{instance:{isPointInside:n.useCallback((e,t,n)=>n&&`closest`in n&&n.closest(`[data-drawing-container]`)?!0:f(e)&&p(t),[f,p]),isXInside:f,isYInside:p}}};Ta.params={width:!0,height:!0,margin:!0},Ta.getDefaultizedParams=({params:e})=>y({},e,{margin:Ca(e.margin,pa)}),Ta.getInitialState=({width:e,height:t,margin:n})=>({dimensions:{margin:n,width:e??0,height:t??0,propsWidth:e,propsHeight:t}});var Ea=({params:e,store:t})=>(ln(()=>{t.set(`experimentalFeatures`,e.experimentalFeatures)},[t,e.experimentalFeatures]),{});Ea.params={experimentalFeatures:!0},Ea.getInitialState=({experimentalFeatures:e})=>({experimentalFeatures:e});var Da=K(e=>e.experimentalFeatures,e=>!!e?.preferStrictDomainInLineCharts),Oa=0,ka=()=>(Oa+=1,`mui-chart-${Oa}`),Aa=({params:e,store:t})=>(n.useEffect(()=>{e.id===void 0||e.id===t.state.id.providedChartId&&t.state.id.chartId!==void 0||t.set(`id`,y({},t.state.id,{chartId:e.id??ka()}))},[t,e.id]),{});Aa.params={id:!0},Aa.getInitialState=({id:e})=>({id:{chartId:e,providedChartId:e}});var ja=K(e=>e.id,e=>e.chartId);function Ma(e){let t=n.useRef(e);return ln(()=>{t.current=e}),n.useRef((...e)=>(0,t.current)(...e)).current}var Na=[`#4254FB`,`#FFB422`,`#FA4F58`,`#0DBEFF`,`#22BF75`,`#FA83B4`,`#FF7511`],Pa=[`#495AFB`,`#FFC758`,`#F35865`,`#30C8FF`,`#44CE8D`,`#F286B3`,`#FF8C39`],Fa=e=>e===`dark`?Pa:Na,Ia=({series:e,colors:t,seriesConfig:n})=>{let r={};return e.forEach((e,i)=>{let a=n[e.type].getSeriesWithDefaultValues(e,i,t),o=a.id;if(r[e.type]===void 0&&(r[e.type]={series:{},seriesOrder:[]}),r[e.type]?.series[o]!==void 0)throw Error(`MUI X Charts: series' id "${o}" is not unique.`);r[e.type].series[o]=a,r[e.type].seriesOrder.push(o)}),r},La=(e,t,n,r)=>{let i={};return Object.keys(t).forEach(a=>{let o=e[a];o!==void 0&&(i[a]=t[a]?.seriesProcessor?.(o,n,r)??o)}),i},Ra=(e,t,n)=>{let r=!1,i={};return Object.keys(e).forEach(a=>{let o=t[a]?.seriesLayout,s=e[a];if(o!==void 0&&s!==void 0){let t=o(s,n);t&&t!==e[a]&&(r=!0,i[a]=t)}}),r?i:{}},za=(e,t)=>{let n=e[t.type]?.identifierSerializer;if(!n)throw Error(`MUI X Charts: No identifier serializer found for series type "${t.type}".`);return n(t)},Ba=({params:e,store:t,seriesConfig:n})=>{let{series:r,dataset:i,theme:a,colors:o}=e;return ca(()=>{t.set(`series`,y({},t.state.series,{defaultizedSeries:Ia({series:r,colors:typeof o==`function`?o(a):o,seriesConfig:n}),dataset:i}))},[o,i,r,a,n,t]),{instance:{serializeIdentifier:Ma(e=>za(n,e))}}};Ba.params={dataset:!0,series:!0,colors:!0,theme:!0};var Va=[];Ba.getDefaultizedParams=({params:e})=>y({},e,{series:e.series?.length?e.series:Va,colors:e.colors??Fa,theme:e.theme??`light`}),Ba.getInitialState=({series:e=[],colors:t,theme:n,dataset:r},i,a)=>({series:{seriesConfig:a,defaultizedSeries:Ia({series:e,colors:typeof t==`function`?t(n):t,seriesConfig:a}),dataset:r}});var Ha=(e,t,n)=>{let r=za(n,t);return!e.has(r)},Ua=e=>e.visibilityManager,Wa=new Map,Ga=q(K(Ua,e=>e?.visibilityMap??Wa),e=>(t,n)=>Ha(e,n,t)),Ka=e=>e.series,qa=K(Ka,e=>e.defaultizedSeries),Ja=K(Ka,e=>e.seriesConfig),Ya=q(qa,Ja,K(Ka,e=>e.dataset),Ga,function(e,t,n,r){return La(e,t,n,e=>r(t,e))});q(Ya,Ja,va,function(e,t,n){return Ra(e,t,n)});var Xa={abort:!0,animationcancel:!0,animationend:!0,animationiteration:!0,animationstart:!0,auxclick:!0,beforeinput:!0,beforetoggle:!0,blur:!0,cancel:!0,canplay:!0,canplaythrough:!0,change:!0,click:!0,close:!0,compositionend:!0,compositionstart:!0,compositionupdate:!0,contextlost:!0,contextmenu:!0,contextrestored:!0,copy:!0,cuechange:!0,cut:!0,dblclick:!0,drag:!0,dragend:!0,dragenter:!0,dragleave:!0,dragover:!0,dragstart:!0,drop:!0,durationchange:!0,emptied:!0,ended:!0,error:!0,focus:!0,focusin:!0,focusout:!0,formdata:!0,gotpointercapture:!0,input:!0,invalid:!0,keydown:!0,keypress:!0,keyup:!0,load:!0,loadeddata:!0,loadedmetadata:!0,loadstart:!0,lostpointercapture:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseout:!0,mouseover:!0,mouseup:!0,paste:!0,pause:!0,play:!0,playing:!0,pointercancel:!0,pointerdown:!0,pointerenter:!0,pointerleave:!0,pointermove:!0,pointerout:!0,pointerover:!0,pointerup:!0,progress:!0,ratechange:!0,reset:!0,resize:!0,scroll:!0,scrollend:!0,securitypolicyviolation:!0,seeked:!0,seeking:!0,select:!0,selectionchange:!0,selectstart:!0,slotchange:!0,stalled:!0,submit:!0,suspend:!0,timeupdate:!0,toggle:!0,touchcancel:!0,touchend:!0,touchmove:!0,touchstart:!0,transitioncancel:!0,transitionend:!0,transitionrun:!0,transitionstart:!0,volumechange:!0,waiting:!0,webkitanimationend:!0,webkitanimationiteration:!0,webkitanimationstart:!0,webkittransitionend:!0,wheel:!0,beforematch:!0,pointerrawupdate:!0},Za=class{customData={};constructor(e){if(!e||!e.name)throw Error(`Gesture must be initialized with a valid name.`);if(e.name in Xa)throw Error(`Gesture can't be created with a native event name. Tried to use "${e.name}". Please use a custom name instead.`);this.name=e.name,this.preventDefault=e.preventDefault??!1,this.stopPropagation=e.stopPropagation??!1,this.preventIf=e.preventIf??[],this.requiredKeys=e.requiredKeys??[],this.pointerMode=e.pointerMode??[],this.pointerOptions=e.pointerOptions??{}}init(e,t,n,r){this.element=e,this.pointerManager=t,this.gesturesRegistry=n,this.keyboardManager=r;let i=`${this.name}ChangeOptions`;this.element.addEventListener(i,this.handleOptionsChange);let a=`${this.name}ChangeState`;this.element.addEventListener(a,this.handleStateChange)}handleOptionsChange=e=>{e&&e.detail&&this.updateOptions(e.detail)};updateOptions(e){this.preventDefault=e.preventDefault??this.preventDefault,this.stopPropagation=e.stopPropagation??this.stopPropagation,this.preventIf=e.preventIf??this.preventIf,this.requiredKeys=e.requiredKeys??this.requiredKeys,this.pointerMode=e.pointerMode??this.pointerMode,this.pointerOptions=e.pointerOptions??this.pointerOptions}getBaseConfig(){return{requiredKeys:this.requiredKeys}}getEffectiveConfig(e,t){if(e!==`mouse`&&e!==`touch`&&e!==`pen`)return t;let n=this.pointerOptions[e];return n?J({},t,n):t}handleStateChange=e=>{e&&e.detail&&this.updateState(e.detail)};updateState(e){Object.assign(this.state,e)}getTargetElement(e){return this.isActive||this.element===e.target||`contains`in this.element&&this.element.contains(e.target)||`getRootNode`in this.element&&this.element.getRootNode()instanceof ShadowRoot&&e.composedPath().includes(this.element)?this.element:null}set isActive(e){e?this.gesturesRegistry.registerActiveGesture(this.element,this):this.gesturesRegistry.unregisterActiveGesture(this.element,this)}get isActive(){return this.gesturesRegistry.isGestureActive(this.element,this)??!1}shouldPreventGesture(e,t){let n=this.getEffectiveConfig(t,this.getBaseConfig());if(!this.keyboardManager.areKeysPressed(n.requiredKeys))return!0;if(this.preventIf.length===0)return!1;let r=this.gesturesRegistry.getActiveGestures(e);return this.preventIf.some(e=>r[e])}isPointerTypeAllowed(e){return!this.pointerMode||this.pointerMode.length===0?!0:this.pointerMode.includes(e)}destroy(){let e=`${this.name}ChangeOptions`;this.element.removeEventListener(e,this.handleOptionsChange);let t=`${this.name}ChangeState`;this.element.removeEventListener(t,this.handleStateChange)}},Qa=class{activeGestures=new Map;registerActiveGesture(e,t){this.activeGestures.has(e)||this.activeGestures.set(e,new Set);let n=this.activeGestures.get(e),r={gesture:t,element:e};n.add(r)}unregisterActiveGesture(e,t){let n=this.activeGestures.get(e);n&&(n.forEach(e=>{e.gesture===t&&n.delete(e)}),n.size===0&&this.activeGestures.delete(e))}getActiveGestures(e){let t=this.activeGestures.get(e);return t?Array.from(t).reduce((e,t)=>(e[t.gesture.name]=!0,e),{}):{}}isGestureActive(e,t){let n=this.activeGestures.get(e);return n?Array.from(n).some(e=>e.gesture===t):!1}destroy(){this.activeGestures.clear()}unregisterElement(e){this.activeGestures.delete(e)}},$a=class{pressedKeys=new Set;constructor(){this.initialize()}initialize(){typeof window>`u`||(window.addEventListener(`keydown`,this.handleKeyDown),window.addEventListener(`keyup`,this.handleKeyUp),window.addEventListener(`blur`,this.clearKeys))}handleKeyDown=e=>{this.pressedKeys.add(e.key)};handleKeyUp=e=>{this.pressedKeys.delete(e.key)};clearKeys=()=>{this.pressedKeys.clear()};areKeysPressed(e){return!e||e.length===0?!0:e.every(e=>e===`ControlOrMeta`?navigator.platform.includes(`Mac`)?this.pressedKeys.has(`Meta`):this.pressedKeys.has(`Control`):this.pressedKeys.has(e))}destroy(){typeof window<`u`&&(window.removeEventListener(`keydown`,this.handleKeyDown),window.removeEventListener(`keyup`,this.handleKeyUp),window.removeEventListener(`blur`,this.clearKeys)),this.clearKeys()}},eo=class{preventEventInterruption=!0;pointers=new Map;gestureHandlers=new Set;constructor(e){this.root=e.root??document.getRootNode({composed:!0})??document.body,this.touchAction=e.touchAction||`auto`,this.passive=e.passive??!1,this.preventEventInterruption=e.preventEventInterruption??!0,this.setupEventListeners()}registerGestureHandler(e){return this.gestureHandlers.add(e),()=>{this.gestureHandlers.delete(e)}}getPointers(){return new Map(this.pointers)}setupEventListeners(){this.touchAction!==`auto`&&(this.root.style.touchAction=this.touchAction),this.root.addEventListener(`pointerdown`,this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener(`pointermove`,this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener(`pointerup`,this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener(`pointercancel`,this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener(`forceCancel`,this.handlePointerEvent,{passive:this.passive}),this.root.addEventListener(`blur`,this.handleInterruptEvents),this.root.addEventListener(`contextmenu`,this.handleInterruptEvents)}handleInterruptEvents=e=>{if(this.preventEventInterruption&&`pointerType`in e&&e.pointerType===`touch`){e.preventDefault();return}let t=new PointerEvent(`forceCancel`,{bubbles:!1,cancelable:!1}),n=this.pointers.values().next().value;if(this.pointers.size>0&&n){Object.defineProperties(t,{clientX:{value:n.clientX},clientY:{value:n.clientY},pointerId:{value:n.pointerId},pointerType:{value:n.pointerType}});for(let[e,t]of this.pointers.entries()){let n=J({},t,{type:`forceCancel`});this.pointers.set(e,n)}}this.notifyHandlers(t),this.pointers.clear()};handlePointerEvent=e=>{let{type:t,pointerId:n}=e;if(t===`pointerdown`||t===`pointermove`)this.pointers.set(n,this.createPointerData(e));else if(t===`pointerup`||t===`pointercancel`||t===`forceCancel`){this.pointers.set(n,this.createPointerData(e)),this.notifyHandlers(e),this.pointers.delete(n);return}this.notifyHandlers(e)};notifyHandlers(e){this.gestureHandlers.forEach(t=>t(this.pointers,e))}createPointerData(e){return{pointerId:e.pointerId,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,timeStamp:e.timeStamp,type:e.type,isPrimary:e.isPrimary,pressure:e.pressure,width:e.width,height:e.height,pointerType:e.pointerType,srcEvent:e}}destroy(){this.root.removeEventListener(`pointerdown`,this.handlePointerEvent),this.root.removeEventListener(`pointermove`,this.handlePointerEvent),this.root.removeEventListener(`pointerup`,this.handlePointerEvent),this.root.removeEventListener(`pointercancel`,this.handlePointerEvent),this.root.removeEventListener(`forceCancel`,this.handlePointerEvent),this.root.removeEventListener(`blur`,this.handleInterruptEvents),this.root.removeEventListener(`contextmenu`,this.handleInterruptEvents),this.pointers.clear(),this.gestureHandlers.clear()}},to=class{gestureTemplates=new Map;elementGestureMap=new Map;activeGesturesRegistry=new Qa;keyboardManager=new $a;constructor(e){this.pointerManager=new eo({root:e.root,touchAction:e.touchAction,passive:e.passive}),e.gestures&&e.gestures.length>0&&e.gestures.forEach(e=>{this.addGestureTemplate(e)})}addGestureTemplate(e){this.gestureTemplates.has(e.name)&&console.warn(`Gesture template with name "${e.name}" already exists. It will be overwritten.`),this.gestureTemplates.set(e.name,e)}setGestureOptions(e,t,n){let r=this.elementGestureMap.get(t);if(!r||!r.has(e)){console.error(`Gesture "${e}" not found on the provided element.`);return}let i=new CustomEvent(`${e}ChangeOptions`,{detail:n,bubbles:!1,cancelable:!1,composed:!1});t.dispatchEvent(i)}setGestureState(e,t,n){let r=this.elementGestureMap.get(t);if(!r||!r.has(e)){console.error(`Gesture "${e}" not found on the provided element.`);return}let i=new CustomEvent(`${e}ChangeState`,{detail:n,bubbles:!1,cancelable:!1,composed:!1});t.dispatchEvent(i)}registerElement(e,t,n){return Array.isArray(e)||(e=[e]),e.forEach(e=>{let r=n?.[e];this.registerSingleGesture(e,t,r)}),t}registerSingleGesture(e,t,n){let r=this.gestureTemplates.get(e);if(!r)return console.error(`Gesture template "${e}" not found.`),!1;this.elementGestureMap.has(t)||this.elementGestureMap.set(t,new Map);let i=this.elementGestureMap.get(t);i.has(e)&&(console.warn(`Element already has gesture "${e}" registered. It will be replaced.`),this.unregisterElement(e,t));let a=r.clone(n);return a.init(t,this.pointerManager,this.activeGesturesRegistry,this.keyboardManager),i.set(e,a),!0}unregisterElement(e,t){let n=this.elementGestureMap.get(t);return!n||!n.has(e)?!1:(n.get(e).destroy(),n.delete(e),this.activeGesturesRegistry.unregisterElement(t),n.size===0&&this.elementGestureMap.delete(t),!0)}unregisterAllGestures(e){let t=this.elementGestureMap.get(e);if(t){for(let[,n]of t)n.destroy(),this.activeGesturesRegistry.unregisterElement(e);this.elementGestureMap.delete(e)}}destroy(){for(let[e]of this.elementGestureMap)this.unregisterAllGestures(e);this.gestureTemplates.clear(),this.elementGestureMap.clear(),this.activeGesturesRegistry.destroy(),this.keyboardManager.destroy(),this.pointerManager.destroy()}},no=class extends Za{unregisterHandler=null;originalTarget=null;constructor(e){super(e),this.minPointers=e.minPointers??1,this.maxPointers=e.maxPointers??1/0}init(e,t,n,r){super.init(e,t,n,r),this.unregisterHandler=this.pointerManager.registerGestureHandler(this.handlePointerEvent)}updateOptions(e){super.updateOptions(e),this.minPointers=e.minPointers??this.minPointers,this.maxPointers=e.maxPointers??this.maxPointers}getBaseConfig(){return{requiredKeys:this.requiredKeys,minPointers:this.minPointers,maxPointers:this.maxPointers}}isWithinPointerCount(e,t){let n=this.getEffectiveConfig(t,this.getBaseConfig());return e.length>=n.minPointers&&e.length<=n.maxPointers}getRelevantPointers(e,t){return e.filter(e=>this.isPointerTypeAllowed(e.pointerType)&&(t===e.target||e.target===this.originalTarget||t===this.originalTarget||`contains`in t&&t.contains(e.target))||`getRootNode`in t&&t.getRootNode()instanceof ShadowRoot&&e.srcEvent.composedPath().includes(t))}destroy(){this.unregisterHandler&&=(this.unregisterHandler(),null),super.destroy()}};function ro(e,t){let n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function io(e){if(e.length<2)return 0;let t=0,n=0;for(let r=0;r<e.length;r+=1)for(let i=r+1;i<e.length;i+=1)t+=ro({x:e[r].clientX,y:e[r].clientY},{x:e[i].clientX,y:e[i].clientY}),n+=1;return n>0?t/n:0}function ao(e){if(e.length===0)return{x:0,y:0};let t=e.reduce((e,t)=>(e.x+=t.clientX,e.y+=t.clientY,e),{x:0,y:0});return{x:t.x/e.length,y:t.y/e.length}}function oo(e,t){return`${e}${t===`ongoing`?``:t.charAt(0).toUpperCase()+t.slice(1)}`}var so=1e-5,co=1e-5,lo=.15;function uo(e,t){let n=t.x-e.x,r=t.y-e.y,i={vertical:null,horizontal:null,mainAxis:null},a=fo(t,e),o=Math.abs(n)>Math.abs(r)?`horizontal`:`vertical`,s=a||o===`horizontal`?so:lo,c=a?so:o===`horizontal`?lo:so;return Math.abs(n)>s&&(i.horizontal=n>0?`right`:`left`),Math.abs(r)>c&&(i.vertical=r>0?`down`:`up`),i.mainAxis=a?`diagonal`:o,i}function fo(e,t){let n=t.x-e.x,r=t.y-e.y,i=Math.atan2(r,n)*180/Math.PI;return i>=-45+co&&i<=-22.5+co||i>=22.5+co&&i<=45+co||i>=135+co&&i<=157.5+co||i>=-157.5+co&&i<=-135+co}function po(e,t){if(!e.vertical&&!e.horizontal)return!1;if(t.length===0)return!0;let n=e.vertical===null||t.includes(e.vertical),r=e.horizontal===null||t.includes(e.horizontal);return n&&r}var mo=0,ho=e=>e>mo?1:e<-mo?-1:0,go=e=>{e.cancelable&&e.preventDefault()},_o=class e extends no{state={lastPosition:null};constructor(e){super(e),this.threshold=e.threshold||0}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(e,t,n,r){super.init(e,t,n,r),this.element.addEventListener(`pointerenter`,this.handleElementEnter),this.element.addEventListener(`pointerleave`,this.handleElementLeave)}destroy(){this.element.removeEventListener(`pointerenter`,this.handleElementEnter),this.element.removeEventListener(`pointerleave`,this.handleElementLeave),this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e)}resetState(){this.isActive=!1,this.state={lastPosition:null}}handleElementEnter=e=>{if(e.pointerType!==`mouse`&&e.pointerType!==`pen`)return;let t=this.pointerManager.getPointers()||new Map,n=Array.from(t.values());if(this.isWithinPointerCount(n,e.pointerType)){this.isActive=!0;let t={x:e.clientX,y:e.clientY};this.state.lastPosition=t,this.emitMoveEvent(this.element,`start`,n,e),this.emitMoveEvent(this.element,`ongoing`,n,e)}};handleElementLeave=e=>{if(e.pointerType!==`mouse`&&e.pointerType!==`pen`||!this.isActive)return;let t=this.pointerManager.getPointers()||new Map,n=Array.from(t.values());this.emitMoveEvent(this.element,`end`,n,e),this.resetState()};handlePointerEvent=(e,t)=>{if(t.type!==`pointermove`||t.pointerType!==`mouse`&&t.pointerType!==`pen`)return;this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation();let n=Array.from(e.values()),r=this.getTargetElement(t);if(!r||!this.isWithinPointerCount(n,t.pointerType))return;if(this.shouldPreventGesture(r,t.pointerType)){if(!this.isActive)return;this.resetState(),this.emitMoveEvent(r,`end`,n,t);return}let i={x:t.clientX,y:t.clientY};this.state.lastPosition=i,this.isActive||(this.isActive=!0,this.emitMoveEvent(r,`start`,n,t)),this.emitMoveEvent(r,`ongoing`,n,t)};emitMoveEvent(e,t,n,r){let i=this.state.lastPosition||ao(n),a=this.gesturesRegistry.getActiveGestures(e),o={gestureName:this.name,centroid:i,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,activeGestures:a,customData:this.customData},s=oo(this.name,t),c=new CustomEvent(s,{bubbles:!0,cancelable:!0,composed:!0,detail:o});e.dispatchEvent(c)}},vo=class e extends no{state={startPointers:new Map,startCentroid:null,lastCentroid:null,movementThresholdReached:!1,totalDeltaX:0,totalDeltaY:0,activeDeltaX:0,activeDeltaY:0,lastDirection:{vertical:null,horizontal:null,mainAxis:null},lastDeltas:null};constructor(e){super(e),this.direction=e.direction||[`up`,`down`,`left`,`right`],this.threshold=e.threshold||0}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,direction:[...this.direction],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e),this.direction=e.direction||this.direction,this.threshold=e.threshold??this.threshold}resetState(){this.isActive=!1,this.state=J({},this.state,{startPointers:new Map,startCentroid:null,lastCentroid:null,lastDeltas:null,activeDeltaX:0,activeDeltaY:0,movementThresholdReached:!1,lastDirection:{vertical:null,horizontal:null,mainAxis:null}})}handlePointerEvent=(e,t)=>{let n=Array.from(e.values());if(t.type===`forceCancel`){this.cancel(t.target,n,t);return}let r=this.getTargetElement(t);if(!r)return;if(this.shouldPreventGesture(r,t.pointerType)){this.cancel(r,n,t);return}let i=this.getRelevantPointers(n,r);if(!this.isWithinPointerCount(i,t.pointerType)){this.cancel(r,i,t);return}switch(t.type){case`pointerdown`:if(!this.isActive&&!this.state.startCentroid)i.forEach(e=>{this.state.startPointers.set(e.pointerId,e)}),this.originalTarget=r,this.state.startCentroid=ao(i),this.state.lastCentroid=J({},this.state.startCentroid);else if(this.state.startCentroid&&this.state.lastCentroid){let e=this.state.lastCentroid,t=ao(i),n=t.x-e.x,r=t.y-e.y;this.state.startCentroid={x:this.state.startCentroid.x+n,y:this.state.startCentroid.y+r},this.state.lastCentroid=t,i.forEach(e=>{this.state.startPointers.has(e.pointerId)||this.state.startPointers.set(e.pointerId,e)})}break;case`pointermove`:if(this.state.startCentroid&&this.isWithinPointerCount(n,t.pointerType)){let e=ao(i),n=e.x-this.state.startCentroid.x,a=e.y-this.state.startCentroid.y,o=Math.sqrt(n*n+a*a),s=uo(this.state.lastCentroid??this.state.startCentroid,e),c=this.state.lastCentroid?e.x-this.state.lastCentroid.x:0,l=this.state.lastCentroid?e.y-this.state.lastCentroid.y:0;!this.state.movementThresholdReached&&o>=this.threshold&&po(s,this.direction)?(this.state.movementThresholdReached=!0,this.isActive=!0,this.state.lastDeltas={x:c,y:l},this.state.totalDeltaX+=c,this.state.totalDeltaY+=l,this.state.activeDeltaX+=c,this.state.activeDeltaY+=l,this.emitPanEvent(r,`start`,i,t,e),this.emitPanEvent(r,`ongoing`,i,t,e)):this.state.movementThresholdReached&&this.isActive&&(this.state.lastDeltas={x:c,y:l},this.state.totalDeltaX+=c,this.state.totalDeltaY+=l,this.state.activeDeltaX+=c,this.state.activeDeltaY+=l,this.emitPanEvent(r,`ongoing`,i,t,e)),this.state.lastCentroid=e,this.state.lastDirection=s}break;case`pointerup`:case`pointercancel`:case`forceCancel`:if(this.isActive&&this.state.movementThresholdReached){let e=i.filter(e=>e.type!==`pointerup`&&e.type!==`pointercancel`);if(!this.isWithinPointerCount(e,t.pointerType)){let e=this.state.lastCentroid||this.state.startCentroid;t.type===`pointercancel`&&this.emitPanEvent(r,`cancel`,i,t,e),this.emitPanEvent(r,`end`,i,t,e),this.resetState()}else if(e.length>=1&&this.state.lastCentroid){let t=ao(e),n=t.x-this.state.lastCentroid.x,r=t.y-this.state.lastCentroid.y;this.state.startCentroid={x:this.state.startCentroid.x+n,y:this.state.startCentroid.y+r},this.state.lastCentroid=t;let a=i.find(e=>e.type===`pointerup`||e.type===`pointercancel`)?.pointerId;a!==void 0&&this.state.startPointers.delete(a)}}else this.resetState();break;default:break}};emitPanEvent(e,t,n,r,i){if(!this.state.startCentroid)return;let a=this.state.lastDeltas?.x??0,o=this.state.lastDeltas?.y??0,s=this.state.startPointers.values().next().value,c=s?(r.timeStamp-s.timeStamp)/1e3:0,l=c>0?a/c:0,u=c>0?o/c:0,d=Math.sqrt(l*l+u*u),f=this.gesturesRegistry.getActiveGestures(e),p={gestureName:this.name,initialCentroid:this.state.startCentroid,centroid:i,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,deltaX:a,deltaY:o,direction:this.state.lastDirection,velocityX:l,velocityY:u,velocity:d,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,activeDeltaX:this.state.activeDeltaX,activeDeltaY:this.state.activeDeltaY,activeGestures:f,customData:this.customData},m=oo(this.name,t),h=new CustomEvent(m,{bubbles:!0,cancelable:!0,composed:!0,detail:p});e.dispatchEvent(h),this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation()}cancel(e,t,n){if(this.isActive){let r=e??this.element;this.emitPanEvent(r,`cancel`,t,n,this.state.lastCentroid),this.emitPanEvent(r,`end`,t,n,this.state.lastCentroid)}this.resetState()}},yo=class e extends no{state={startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,totalScale:1,deltaScale:0};constructor(e){super(J({},e,{minPointers:e.minPointers??2})),this.threshold=e.threshold??0}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,threshold:this.threshold,minPointers:this.minPointers,maxPointers:this.maxPointers,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e)}resetState(){this.isActive=!1,this.state=J({},this.state,{startDistance:0,lastDistance:0,lastScale:1,lastTime:0,velocity:0,deltaScale:0})}handlePointerEvent=(e,t)=>{let n=Array.from(e.values()),r=this.getTargetElement(t);if(!r)return;if(this.shouldPreventGesture(r,t.pointerType)){this.isActive&&(this.emitPinchEvent(r,`cancel`,n,t),this.resetState());return}let i=this.getRelevantPointers(n,r);switch(t.type){case`pointerdown`:if(i.length>=2&&!this.isActive){let e=io(i);this.state.startDistance=e,this.state.lastDistance=e,this.state.lastTime=t.timeStamp,this.originalTarget=r}else if(this.isActive&&i.length>=2){let e=io(i);this.state.startDistance=e/this.state.lastScale,this.state.lastDistance=e,this.state.lastTime=t.timeStamp}break;case`pointermove`:if(this.state.startDistance&&this.isWithinPointerCount(i,t.pointerType)){let e=io(i),n=Math.abs(e-this.state.lastDistance);if(n!==0&&n>=this.threshold){let n=this.state.startDistance?e/this.state.startDistance:1,a=n/this.state.lastScale;this.state.totalScale*=a;let o=(t.timeStamp-this.state.lastTime)/1e3;if(this.state.lastDistance){let t=(e-this.state.lastDistance)/o;this.state.velocity=Number.isNaN(t)?0:t}this.state.lastDistance=e,this.state.deltaScale=n-this.state.lastScale,this.state.lastScale=n,this.state.lastTime=t.timeStamp,this.isActive?this.emitPinchEvent(r,`ongoing`,i,t):(this.isActive=!0,this.emitPinchEvent(r,`start`,i,t),this.emitPinchEvent(r,`ongoing`,i,t))}}break;case`pointerup`:case`pointercancel`:case`forceCancel`:if(this.isActive){let e=i.filter(e=>e.type!==`pointerup`&&e.type!==`pointercancel`);if(!this.isWithinPointerCount(e,t.pointerType))t.type===`pointercancel`&&this.emitPinchEvent(r,`cancel`,i,t),this.emitPinchEvent(r,`end`,i,t),this.resetState();else if(e.length>=2){let n=io(e);this.state.startDistance=n/this.state.lastScale,this.state.lastDistance=n,this.state.lastTime=t.timeStamp}}break;default:break}};emitPinchEvent(e,t,n,r){let i=ao(n),a=this.state.lastDistance,o=this.state.lastScale,s=this.gesturesRegistry.getActiveGestures(e),c={gestureName:this.name,centroid:i,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,scale:o,deltaScale:this.state.deltaScale,totalScale:this.state.totalScale,distance:a,velocity:this.state.velocity,activeGestures:s,direction:ho(this.state.velocity),customData:this.customData};this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation();let l=oo(this.name,t),u=new CustomEvent(l,{bubbles:!0,cancelable:!0,composed:!0,detail:c});e.dispatchEvent(u)}},bo=class e extends no{state={startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1};constructor(e){super(e),this.duration=e.duration??500,this.maxDistance=e.maxDistance??10}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,duration:this.duration,maxDistance:this.maxDistance,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.clearPressTimer(),this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e),this.duration=e.duration??this.duration,this.maxDistance=e.maxDistance??this.maxDistance}resetState(){this.clearPressTimer(),this.isActive=!1,this.state=J({},this.state,{startCentroid:null,lastPosition:null,timerId:null,startTime:0,pressThresholdReached:!1})}clearPressTimer(){this.state.timerId!==null&&(clearTimeout(this.state.timerId),this.state.timerId=null)}handlePointerEvent=(e,t)=>{let n=Array.from(e.values());if(t.type===`forceCancel`){this.cancelPress(t.target,n,t);return}let r=this.getTargetElement(t);if(!r)return;if(this.shouldPreventGesture(r,t.pointerType)){this.isActive&&this.cancelPress(r,n,t);return}let i=this.getRelevantPointers(n,r);if(!this.isWithinPointerCount(i,t.pointerType)){this.isActive&&this.cancelPress(r,i,t);return}switch(t.type){case`pointerdown`:!this.isActive&&!this.state.startCentroid&&(this.state.startCentroid=ao(i),this.state.lastPosition=J({},this.state.startCentroid),this.state.startTime=t.timeStamp,this.isActive=!0,this.originalTarget=r,this.clearPressTimer(),this.state.timerId=setTimeout(()=>{if(this.isActive&&this.state.startCentroid){this.state.pressThresholdReached=!0;let e=this.state.lastPosition;this.emitPressEvent(r,`start`,i,t,e),this.emitPressEvent(r,`ongoing`,i,t,e)}},this.duration));break;case`pointermove`:if(this.isActive&&this.state.startCentroid){let e=ao(i);this.state.lastPosition=e;let n=e.x-this.state.startCentroid.x,a=e.y-this.state.startCentroid.y;Math.sqrt(n*n+a*a)>this.maxDistance&&this.cancelPress(r,i,t)}break;case`pointerup`:if(this.isActive){if(this.state.pressThresholdReached){let e=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(r,`end`,i,t,e)}this.resetState()}break;case`pointercancel`:case`forceCancel`:this.cancelPress(r,i,t);break;default:break}};emitPressEvent(e,t,n,r,i){let a=this.gesturesRegistry.getActiveGestures(e),o=r.timeStamp-this.state.startTime,s={gestureName:this.name,centroid:i,target:r.target,srcEvent:r,phase:t,pointers:n,timeStamp:r.timeStamp,x:i.x,y:i.y,duration:o,activeGestures:a,customData:this.customData},c=oo(this.name,t),l=new CustomEvent(c,{bubbles:!0,cancelable:!0,composed:!0,detail:s});e.dispatchEvent(l),this.preventDefault&&r.preventDefault(),this.stopPropagation&&r.stopPropagation()}cancelPress(e,t,n){if(this.isActive&&this.state.pressThresholdReached){let r=this.state.lastPosition||this.state.startCentroid;this.emitPressEvent(e??this.element,`cancel`,t,n,r),this.emitPressEvent(e??this.element,`end`,t,n,r)}this.resetState()}},xo=class e extends no{state={phase:`waitingForPress`,dragTimeoutId:null};constructor(e){super(e),this.pressDuration=e.pressDuration??500,this.pressMaxDistance=e.pressMaxDistance??10,this.dragTimeout=e.dragTimeout??1e3,this.dragThreshold=e.dragThreshold??0,this.dragDirection=e.dragDirection||[`up`,`down`,`left`,`right`],this.pressGesture=new bo({name:`${this.name}-press`,duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new vo({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,pressDuration:this.pressDuration,pressMaxDistance:this.pressMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(e,t,n,r){super.init(e,t,n,r),this.pressGesture.init(e,t,n,r),this.panGesture.init(e,t,n,r),this.element.addEventListener(this.pressGesture.name,this.pressHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.pressGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.pressGesture.name,this.pressHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(e){super.updateOptions(e),this.pressDuration=e.pressDuration??this.pressDuration,this.pressMaxDistance=e.pressMaxDistance??this.pressMaxDistance,this.dragTimeout=e.dragTimeout??this.dragTimeout,this.dragThreshold=e.dragThreshold??this.dragThreshold,this.dragDirection=e.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.pressGesture.name}ChangeOptions`,{detail:{duration:this.pressDuration,maxDistance:this.pressMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:`waitingForPress`,dragTimeoutId:null}}handlePointerEvent(){}pressHandler=()=>{this.state.phase===`waitingForPress`&&(this.state.phase=`pressDetected`,this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=e=>{this.state.phase===`pressDetected`&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase=`dragging`,this.isActive=!0,this.element.dispatchEvent(new CustomEvent(oo(this.name,e.detail.phase),e)))};dragMoveHandler=e=>{this.state.phase===`dragging`&&this.element.dispatchEvent(new CustomEvent(oo(this.name,e.detail.phase),e))};dragEndHandler=e=>{this.state.phase===`dragging`&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(oo(this.name,e.detail.phase),e)))};setTouchAction(){this.element.addEventListener(`touchstart`,go,{passive:!1}),this.element.addEventListener(`touchmove`,go,{passive:!1}),this.element.addEventListener(`touchend`,go,{passive:!1})}restoreTouchAction(){this.element.removeEventListener(`touchstart`,go),this.element.removeEventListener(`touchmove`,go),this.element.removeEventListener(`touchend`,go)}},So=class e extends no{state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null};constructor(e){super(e),this.maxDistance=e.maxDistance??10,this.taps=e.taps??1}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,maxDistance:this.maxDistance,taps:this.taps,requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}destroy(){this.resetState(),super.destroy()}updateOptions(e){super.updateOptions(e),this.maxDistance=e.maxDistance??this.maxDistance,this.taps=e.taps??this.taps}resetState(){this.isActive=!1,this.state={startCentroid:null,currentTapCount:0,lastTapTime:0,lastPosition:null}}handlePointerEvent=(e,t)=>{let n=Array.from(e.values()),r=this.getTargetElement(t);if(!r)return;let i=this.getRelevantPointers(n,r);if(this.shouldPreventGesture(r,t.pointerType)||!this.isWithinPointerCount(i,t.pointerType)){this.isActive&&this.cancelTap(r,i,t);return}switch(t.type){case`pointerdown`:this.isActive||(this.state.startCentroid=ao(i),this.state.lastPosition=J({},this.state.startCentroid),this.isActive=!0,this.originalTarget=r);break;case`pointermove`:if(this.isActive&&this.state.startCentroid){let e=ao(i);this.state.lastPosition=e;let n=e.x-this.state.startCentroid.x,a=e.y-this.state.startCentroid.y;Math.sqrt(n*n+a*a)>this.maxDistance&&this.cancelTap(r,i,t)}break;case`pointerup`:if(this.isActive){this.state.currentTapCount+=1;let e=this.state.lastPosition||this.state.startCentroid;if(!e){this.cancelTap(r,i,t);return}this.state.currentTapCount>=this.taps?(this.fireTapEvent(r,i,t,e),this.resetState()):(this.state.lastTapTime=t.timeStamp,this.isActive=!1,this.state.startCentroid=null,setTimeout(()=>{this.state&&this.state.currentTapCount>0&&this.state.currentTapCount<this.taps&&(this.state.currentTapCount=0)},300))}break;case`pointercancel`:case`forceCancel`:this.cancelTap(r,i,t);break;default:break}};fireTapEvent(e,t,n,r){let i=this.gesturesRegistry.getActiveGestures(e),a={gestureName:this.name,centroid:r,target:n.target,srcEvent:n,phase:`end`,pointers:t,timeStamp:n.timeStamp,x:r.x,y:r.y,tapCount:this.state.currentTapCount,activeGestures:i,customData:this.customData},o=new CustomEvent(this.name,{bubbles:!0,cancelable:!0,composed:!0,detail:a});e.dispatchEvent(o),this.preventDefault&&n.preventDefault(),this.stopPropagation&&n.stopPropagation()}cancelTap(e,t,n){if(this.state.startCentroid||this.state.lastPosition){let r=this.state.lastPosition||this.state.startCentroid,i=this.gesturesRegistry.getActiveGestures(e),a={gestureName:this.name,centroid:r,target:n.target,srcEvent:n,phase:`cancel`,pointers:t,timeStamp:n.timeStamp,x:r.x,y:r.y,tapCount:this.state.currentTapCount,activeGestures:i,customData:this.customData},o=oo(this.name,`cancel`),s=new CustomEvent(o,{bubbles:!0,cancelable:!0,composed:!0,detail:a});e.dispatchEvent(s)}this.resetState()}},Co=class e extends no{state={phase:`waitingForTap`,dragTimeoutId:null};constructor(e){super(e),this.tapMaxDistance=e.tapMaxDistance??10,this.dragTimeout=e.dragTimeout??1e3,this.dragThreshold=e.dragThreshold??0,this.dragDirection=e.dragDirection||[`up`,`down`,`left`,`right`],this.tapGesture=new So({name:`${this.name}-tap`,maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}),this.panGesture=new vo({name:`${this.name}-pan`,minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)})}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,minPointers:this.minPointers,maxPointers:this.maxPointers,tapMaxDistance:this.tapMaxDistance,dragTimeout:this.dragTimeout,dragThreshold:this.dragThreshold,dragDirection:[...this.dragDirection],requiredKeys:[...this.requiredKeys],pointerMode:[...this.pointerMode],preventIf:[...this.preventIf],pointerOptions:structuredClone(this.pointerOptions)},t))}init(e,t,n,r){super.init(e,t,n,r),this.tapGesture.init(e,t,n,r),this.panGesture.init(e,t,n,r),this.element.addEventListener(this.tapGesture.name,this.tapHandler),this.element.addEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.addEventListener(this.panGesture.name,this.dragMoveHandler),this.element.addEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.addEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler)}destroy(){this.resetState(),this.tapGesture.destroy(),this.panGesture.destroy(),this.element.removeEventListener(this.tapGesture.name,this.tapHandler),this.element.removeEventListener(`${this.panGesture.name}Start`,this.dragStartHandler),this.element.removeEventListener(this.panGesture.name,this.dragMoveHandler),this.element.removeEventListener(`${this.panGesture.name}End`,this.dragEndHandler),this.element.removeEventListener(`${this.panGesture.name}Cancel`,this.dragEndHandler),super.destroy()}updateOptions(e){super.updateOptions(e),this.tapMaxDistance=e.tapMaxDistance??this.tapMaxDistance,this.dragTimeout=e.dragTimeout??this.dragTimeout,this.dragThreshold=e.dragThreshold??this.dragThreshold,this.dragDirection=e.dragDirection||this.dragDirection,this.element.dispatchEvent(new CustomEvent(`${this.panGesture.name}ChangeOptions`,{detail:{minPointers:this.minPointers,maxPointers:this.maxPointers,threshold:this.dragThreshold,direction:this.dragDirection,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}})),this.element.dispatchEvent(new CustomEvent(`${this.tapGesture.name}ChangeOptions`,{detail:{maxDistance:this.tapMaxDistance,maxPointers:this.maxPointers,pointerMode:this.pointerMode,requiredKeys:this.requiredKeys,preventIf:this.preventIf,pointerOptions:structuredClone(this.pointerOptions)}}))}resetState(){this.state.dragTimeoutId!==null&&clearTimeout(this.state.dragTimeoutId),this.restoreTouchAction(),this.isActive=!1,this.state={phase:`waitingForTap`,dragTimeoutId:null}}handlePointerEvent(){}tapHandler=()=>{this.state.phase===`waitingForTap`&&(this.state.phase=`tapDetected`,this.setTouchAction(),this.state.dragTimeoutId=setTimeout(()=>{this.resetState()},this.dragTimeout))};dragStartHandler=e=>{this.state.phase===`tapDetected`&&(this.state.dragTimeoutId!==null&&(clearTimeout(this.state.dragTimeoutId),this.state.dragTimeoutId=null),this.restoreTouchAction(),this.state.phase=`dragging`,this.isActive=!0,this.element.dispatchEvent(new CustomEvent(oo(this.name,e.detail.phase),e)))};dragMoveHandler=e=>{this.state.phase===`dragging`&&this.element.dispatchEvent(new CustomEvent(oo(this.name,e.detail.phase),e))};dragEndHandler=e=>{this.state.phase===`dragging`&&(this.resetState(),this.element.dispatchEvent(new CustomEvent(oo(this.name,e.detail.phase),e)))};setTouchAction(){this.element.addEventListener(`touchstart`,go,{passive:!1})}restoreTouchAction(){this.element.removeEventListener(`touchstart`,go)}},wo=class e extends Za{state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0};constructor(e){super(e),this.sensitivity=e.sensitivity??1,this.max=e.max??2**53-1,this.min=e.min??-(2**53-1),this.initialDelta=e.initialDelta??0,this.invert=e.invert??!1,this.state.totalDeltaX=this.initialDelta,this.state.totalDeltaY=this.initialDelta,this.state.totalDeltaZ=this.initialDelta}clone(t){return new e(J({name:this.name,preventDefault:this.preventDefault,stopPropagation:this.stopPropagation,sensitivity:this.sensitivity,max:this.max,min:this.min,initialDelta:this.initialDelta,invert:this.invert,requiredKeys:[...this.requiredKeys],preventIf:[...this.preventIf]},t))}init(e,t,n,r){super.init(e,t,n,r),this.element.addEventListener(`wheel`,this.handleWheelEvent)}destroy(){this.element.removeEventListener(`wheel`,this.handleWheelEvent),this.resetState(),super.destroy()}resetState(){this.isActive=!1,this.state={totalDeltaX:0,totalDeltaY:0,totalDeltaZ:0}}updateOptions(e){super.updateOptions(e),this.sensitivity=e.sensitivity??this.sensitivity,this.max=e.max??this.max,this.min=e.min??this.min,this.initialDelta=e.initialDelta??this.initialDelta,this.invert=e.invert??this.invert}handleWheelEvent=e=>{if(this.shouldPreventGesture(this.element,`mouse`))return;let t=this.pointerManager.getPointers()||new Map,n=Array.from(t.values());this.state.totalDeltaX+=e.deltaX*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaY+=e.deltaY*this.sensitivity*(this.invert?-1:1),this.state.totalDeltaZ+=e.deltaZ*this.sensitivity*(this.invert?-1:1),[`totalDeltaX`,`totalDeltaY`,`totalDeltaZ`].forEach(e=>{this.state[e]<this.min&&(this.state[e]=this.min),this.state[e]>this.max&&(this.state[e]=this.max)}),this.emitWheelEvent(n,e)};emitWheelEvent(e,t){let n=e.length>0?ao(e):{x:t.clientX,y:t.clientY},r=this.gesturesRegistry.getActiveGestures(this.element),i={gestureName:this.name,centroid:n,target:t.target,srcEvent:t,phase:`ongoing`,pointers:e,timeStamp:t.timeStamp,deltaX:t.deltaX*this.sensitivity*(this.invert?-1:1),deltaY:t.deltaY*this.sensitivity*(this.invert?-1:1),deltaZ:t.deltaZ*this.sensitivity*(this.invert?-1:1),deltaMode:t.deltaMode,totalDeltaX:this.state.totalDeltaX,totalDeltaY:this.state.totalDeltaY,totalDeltaZ:this.state.totalDeltaZ,activeGestures:r,customData:this.customData};this.preventDefault&&t.preventDefault(),this.stopPropagation&&t.stopPropagation();let a=oo(this.name,`ongoing`),o=new CustomEvent(a,{bubbles:!0,cancelable:!0,composed:!0,detail:i});this.element.dispatchEvent(o)}},To=e=>e.preventDefault(),Eo=({svgRef:e})=>{let t=n.useRef(null);n.useEffect(()=>{let n=e.current;t.current||=new to({gestures:[new vo({name:`pan`,threshold:0,maxPointers:1}),new _o({name:`move`,preventIf:[`pan`,`zoomPinch`,`zoomPan`]}),new So({name:`tap`,preventIf:[`pan`,`zoomPinch`,`zoomPan`]}),new bo({name:`quickPress`,duration:50}),new vo({name:`brush`,threshold:0,maxPointers:1}),new vo({name:`zoomPan`,threshold:0,preventIf:[`zoomTapAndDrag`,`zoomPressAndDrag`]}),new yo({name:`zoomPinch`,threshold:5}),new wo({name:`zoomTurnWheel`,sensitivity:.01,initialDelta:1}),new wo({name:`panTurnWheel`,sensitivity:.5}),new Co({name:`zoomTapAndDrag`,dragThreshold:10}),new xo({name:`zoomPressAndDrag`,dragThreshold:10,preventIf:[`zoomPinch`]}),new So({name:`zoomDoubleTapReset`,taps:2})]});let r=t.current;if(!(!n||!r))return r.registerElement([`pan`,`move`,`zoomPinch`,`zoomPan`,`zoomTurnWheel`,`panTurnWheel`,`tap`,`quickPress`,`zoomTapAndDrag`,`zoomPressAndDrag`,`zoomDoubleTapReset`,`brush`],n),()=>{r.unregisterAllGestures(n)}},[e,t]);let r=n.useCallback((t,n,r)=>{let i=e.current;return i?.addEventListener(t,n,r),{cleanup:()=>i?.removeEventListener(t,n)}},[e]),i=n.useCallback((n,r)=>{let i=e.current,a=t.current;!a||!i||a.setGestureOptions(n,i,r??{})},[e,t]);return n.useEffect(()=>{let t=e.current;return t?.addEventListener(`gesturestart`,To),t?.addEventListener(`gesturechange`,To),t?.addEventListener(`gestureend`,To),()=>{t?.removeEventListener(`gesturestart`,To),t?.removeEventListener(`gesturechange`,To),t?.removeEventListener(`gestureend`,To)}},[e]),{instance:{addInteractionListener:r,updateZoomInteractionListeners:i}}};Eo.params={},Eo.getInitialState=()=>({});var Do=[Aa,Ea,Ta,Ba,Eo,oa],Oo=[`apiRef`],ko=e=>{let{plugins:t}=e,n=b(e.props,Oo),r={};t.forEach(e=>{Object.assign(r,e.params)});let i={};return Object.keys(n).forEach(e=>{let t=n[e];r[e]&&(i[e]=t)}),t.reduce((e,t)=>t.getDefaultizedParams?t.getDefaultizedParams({params:e}):e,i)},Ao=0;function jo(e,t,r){let i=In(),a=n.useMemo(()=>[...Do,...e],[e]),o=ko({plugins:a,props:t});o.id=o.id??i;let s=n.useRef({}).current,c=No(t.apiRef),l=n.useRef(null),u=n.useRef(null),d=n.useRef(null);if(d.current==null){Ao+=1;let e={cacheKey:{id:Ao}};a.forEach(t=>{t.getInitialState&&Object.assign(e,t.getInitialState(o,e,r))}),d.current=new aa(e)}return a.forEach(e=>{let t=e({instance:s,params:o,plugins:a,store:d.current,svgRef:u,chartRootRef:l,seriesConfig:r});t.publicAPI&&Object.assign(c.current,t.publicAPI),t.instance&&Object.assign(s,t.instance)}),{contextValue:n.useMemo(()=>({store:d.current,publicAPI:c.current,instance:s,svgRef:u,chartRootRef:l}),[s,c])}}function Mo(e){return e.current??={},e}function No(e){let t=n.useRef({});return e?Mo(e):t}var Po=n.createContext(null);process.env.NODE_ENV!==`production`&&(Po.displayName=`ChartContext`);var Fo=new Set;function Io(e,t=`warning`){if(process.env.NODE_ENV===`production`)return;let n=Array.isArray(e)?e.join(`
34
+ `):e;Fo.has(n)||(Fo.add(n),t===`error`?console.error(n):console.warn(n))}function Lo(e){let{componentName:t,propName:r,controlled:i,defaultValue:a,warningPrefix:o=`MUI X`}=e,[{initialDefaultValue:s,isControlled:c}]=n.useState({initialDefaultValue:a,isControlled:i!==void 0});c!==(i!==void 0)&&Io([`${o}: A component is changing the ${c?``:`un`}controlled ${r} state of ${t} to be ${c?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${r} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`],`error`),JSON.stringify(s)!==JSON.stringify(a)&&Io([`${o}: A component is changing the default ${r} state of an uncontrolled ${t} after being initialized. To suppress this warning opt to use a controlled ${t}.`],`error`)}var Ro=process.env.NODE_ENV===`production`?()=>{}:Lo,zo={minStart:0,maxEnd:100,step:5,minSpan:10,maxSpan:100,panning:!0,filterMode:`keep`,reverse:!1,slider:{enabled:!1,preview:!1,size:28,showTooltip:`hover`}},Bo=(e,t,n,r)=>{if(e)return e===!0?y({axisId:t,axisDirection:n},zo,{reverse:r??!1}):y({axisId:t,axisDirection:n},zo,{reverse:r??!1},e,{slider:y({},zo.slider,{size:e.slider?.preview??zo.slider.preview?48:28},e.slider)})};function Vo(e,t){let n={top:0,bottom:0,none:0};return(e&&e.length>0?e:[{id:da,scaleType:`linear`}]).map((e,r)=>{let i=e.dataKey,a=r===0?`bottom`:`none`,o=e.position??a,s=25+(e.label?20:0),c=e.id??`defaultized-x-axis-${r}`,l=y({offset:n[o]},e,{id:c,position:o,height:e.height??s,zoom:Bo(e.zoom,c,`x`,e.reverse)});if(o!==`none`&&(n[o]+=l.height,l.zoom?.slider.enabled&&(n[o]+=l.zoom.slider.size)),i===void 0||e.data!==void 0)return l;if(t===void 0)throw Error("MUI X Charts: x-axis uses `dataKey` but no `dataset` is provided.");return y({},l,{data:t.map(e=>e[i])})})}function Ho(e,t){let n={right:0,left:0,none:0};return(e&&e.length>0?e:[{id:fa,scaleType:`linear`}]).map((e,r)=>{let i=e.dataKey,a=r===0?`left`:`none`,o=e.position??a,s=45+(e.label?20:0),c=e.id??`defaultized-y-axis-${r}`,l=y({offset:n[o]},e,{id:c,position:o,width:e.width??s,zoom:Bo(e.zoom,c,`y`,e.reverse)});if(o!==`none`&&(n[o]+=l.width,l.zoom?.slider.enabled&&(n[o]+=l.zoom.slider.size)),i===void 0||e.data!==void 0)return l;if(t===void 0)throw Error("MUI X Charts: y-axis uses `dataKey` but no `dataset` is provided.");return y({},l,{data:t.map(e=>e[i])})})}function Uo(e,t){return function(n,r){if(r.location===`tick`){let t=r.scale.domain();return t[0]===t[1]?r.scale.tickFormat(1)(n):r.scale.tickFormat(e)(n)}return r.location===`zoom-slider-tooltip`?t.tickFormat(2)(n):`${n}`}}function Wo(e){return e.scaleType===`band`}function Go(e){return e.scaleType===`point`}function Ko(e){return e.scaleType===`symlog`}function qo(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Jo(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Yo(e){let t,n,r;e.length===2?(t=e===qo||e===Jo?e:Xo,n=e,r=e):(t=qo,n=(t,n)=>qo(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Xo(){return 0}function Zo(e){return e===null?NaN:+e}var Qo=Yo(qo),$o=Qo.right;Qo.left,Yo(Zo).center;var es=class extends Map{constructor(e,t=is){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(ts(this,e))}has(e){return super.has(ts(this,e))}set(e,t){return super.set(ns(this,e),t)}delete(e){return super.delete(rs(this,e))}};function ts({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function ns({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function rs({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function is(e){return typeof e==`object`&&e?e.valueOf():e}var as=Math.sqrt(50),os=Math.sqrt(10),ss=Math.sqrt(2);function cs(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=as?10:a>=os?5:a>=ss?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?cs(e,t,n*2):[s,c,l]}function ls(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?cs(t,e,n):cs(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function us(e,t,n){return t=+t,e=+e,n=+n,cs(e,t,n)[2]}function ds(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?us(t,e,n):us(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function fs(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function ps(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function ms(e,t){switch(arguments.length){case 0:break;case 1:typeof e==`function`?this.interpolator(e):this.range(e);break;default:this.domain(e),typeof t==`function`?this.interpolator(t):this.range(t);break}return this}var hs=Symbol(`implicit`);function gs(){var e=new es,t=[],n=[],r=hs;function i(i){let a=e.get(i);if(a===void 0){if(r!==hs)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new es;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return gs(t,n).unknown(r)},ps.apply(i,arguments),i}function _s(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vs(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ys(){}var bs=.7,xs=1/bs,Ss=`\\s*([+-]?\\d+)\\s*`,Cs=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,ws=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,Ts=/^#([0-9a-f]{3,8})$/,Es=RegExp(`^rgb\\(${Ss},${Ss},${Ss}\\)$`),Ds=RegExp(`^rgb\\(${ws},${ws},${ws}\\)$`),Os=RegExp(`^rgba\\(${Ss},${Ss},${Ss},${Cs}\\)$`),ks=RegExp(`^rgba\\(${ws},${ws},${ws},${Cs}\\)$`),As=RegExp(`^hsl\\(${Cs},${ws},${ws}\\)$`),js=RegExp(`^hsla\\(${Cs},${ws},${ws},${Cs}\\)$`),Ms={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};_s(ys,Ls,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ns,formatHex:Ns,formatHex8:Ps,formatHsl:Fs,formatRgb:Is,toString:Is});function Ns(){return this.rgb().formatHex()}function Ps(){return this.rgb().formatHex8()}function Fs(){return Xs(this).formatHsl()}function Is(){return this.rgb().formatRgb()}function Ls(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=Ts.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Rs(t):n===3?new Hs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?zs(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?zs(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Es.exec(e))?new Hs(t[1],t[2],t[3],1):(t=Ds.exec(e))?new Hs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Os.exec(e))?zs(t[1],t[2],t[3],t[4]):(t=ks.exec(e))?zs(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=As.exec(e))?Ys(t[1],t[2]/100,t[3]/100,1):(t=js.exec(e))?Ys(t[1],t[2]/100,t[3]/100,t[4]):Ms.hasOwnProperty(e)?Rs(Ms[e]):e===`transparent`?new Hs(NaN,NaN,NaN,0):null}function Rs(e){return new Hs(e>>16&255,e>>8&255,e&255,1)}function zs(e,t,n,r){return r<=0&&(e=t=n=NaN),new Hs(e,t,n,r)}function Bs(e){return e instanceof ys||(e=Ls(e)),e?(e=e.rgb(),new Hs(e.r,e.g,e.b,e.opacity)):new Hs}function Vs(e,t,n,r){return arguments.length===1?Bs(e):new Hs(e,t,n,r??1)}function Hs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}_s(Hs,Vs,vs(ys,{brighter(e){return e=e==null?xs:xs**+e,new Hs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bs:bs**+e,new Hs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Hs(qs(this.r),qs(this.g),qs(this.b),Ks(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Us,formatHex:Us,formatHex8:Ws,formatRgb:Gs,toString:Gs}));function Us(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function Ws(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function Gs(){let e=Ks(this.opacity);return`${e===1?`rgb(`:`rgba(`}${qs(this.r)}, ${qs(this.g)}, ${qs(this.b)}${e===1?`)`:`, ${e})`}`}function Ks(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return e=qs(e),(e<16?`0`:``)+e.toString(16)}function Ys(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qs(e,t,n,r)}function Xs(e){if(e instanceof Qs)return new Qs(e.h,e.s,e.l,e.opacity);if(e instanceof ys||(e=Ls(e)),!e)return new Qs;if(e instanceof Qs)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Qs(o,s,c,e.opacity)}function Zs(e,t,n,r){return arguments.length===1?Xs(e):new Qs(e,t,n,r??1)}function Qs(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}_s(Qs,Zs,vs(ys,{brighter(e){return e=e==null?xs:xs**+e,new Qs(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bs:bs**+e,new Qs(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Hs(tc(e>=240?e-240:e+120,i,r),tc(e,i,r),tc(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qs($s(this.h),ec(this.s),ec(this.l),Ks(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Ks(this.opacity);return`${e===1?`hsl(`:`hsla(`}${$s(this.h)}, ${ec(this.s)*100}%, ${ec(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function $s(e){return e=(e||0)%360,e<0?e+360:e}function ec(e){return Math.max(0,Math.min(1,e||0))}function tc(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var nc=e=>()=>e;function rc(e,t){return function(n){return e+n*t}}function ic(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function ac(e){return(e=+e)==1?oc:function(t,n){return n-t?ic(t,n,e):nc(isNaN(t)?n:t)}}function oc(e,t){var n=t-e;return n?rc(e,n):nc(isNaN(e)?t:e)}var sc=(function e(t){var n=ac(t);function r(e,t){var r=n((e=Vs(e)).r,(t=Vs(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=oc(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function cc(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function lc(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function uc(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=yc(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function dc(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function fc(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function pc(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=yc(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var mc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hc=new RegExp(mc.source,`g`);function gc(e){return function(){return e}}function _c(e){return function(t){return e(t)+``}}function vc(e,t){var n=mc.lastIndex=hc.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=mc.exec(e))&&(i=hc.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:fc(r,i)})),n=hc.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?_c(c[0].x):gc(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function yc(e,t){var n=typeof t,r;return t==null||n===`boolean`?nc(t):(n===`number`?fc:n===`string`?(r=Ls(t))?(t=r,sc):vc:t instanceof Ls?sc:t instanceof Date?dc:lc(t)?cc:Array.isArray(t)?uc:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?pc:fc)(e,t)}function bc(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function xc(e){return function(){return e}}function Sc(e){return+e}var Cc=[0,1];function wc(e){return e}function Tc(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:xc(isNaN(t)?NaN:.5)}function Ec(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Dc(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=Tc(i,r),a=n(o,a)):(r=Tc(r,i),a=n(a,o)),function(e){return a(r(e))}}function Oc(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=Tc(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=$o(e,t,1,r)-1;return a[n](i[n](t))}}function kc(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Ac(){var e=Cc,t=Cc,n=yc,r,i,a,o=wc,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==wc&&(o=Ec(e[0],e[n-1])),s=n>2?Oc:Dc,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),fc))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,Sc),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=bc,u()},d.clamp=function(e){return arguments.length?(o=e?!0:wc,u()):o!==wc},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function jc(){return Ac()(wc,wc)}function Mc(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function Nc(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Pc(e){return e=Nc(Math.abs(e)),e?e[1]:NaN}function Fc(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function Ic(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Lc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rc(e){if(!(t=Lc.exec(e)))throw Error(`invalid format: `+e);var t;return new zc({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Rc.prototype=zc.prototype;function zc(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}zc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function Bc(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var Vc;function Hc(e,t){var n=Nc(e,t);if(!n)return e+``;var r=n[0],i=n[1],a=i-(Vc=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+Nc(e,Math.max(0,t+a-1))[0]}function Uc(e,t){var n=Nc(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var Wc={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Mc,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Uc(e*100,t),r:Uc,s:Hc,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Gc(e){return e}var Kc=Array.prototype.map,qc=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function Jc(e){var t=e.grouping===void 0||e.thousands===void 0?Gc:Fc(Kc.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?Gc:Ic(Kc.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e){e=Rc(e);var l=e.fill,u=e.align,d=e.sign,f=e.symbol,p=e.zero,m=e.width,h=e.comma,g=e.precision,_=e.trim,v=e.type;v===`n`?(h=!0,v=`g`):Wc[v]||(g===void 0&&(g=12),_=!0,v=`g`),(p||l===`0`&&u===`=`)&&(p=!0,l=`0`,u=`=`);var y=f===`$`?n:f===`#`&&/[boxX]/.test(v)?`0`+v.toLowerCase():``,b=f===`$`?r:/[%p]/.test(v)?o:``,x=Wc[v],S=/[defgprs%]/.test(v);g=g===void 0?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g));function C(e){var n=y,r=b,o,f,C;if(v===`c`)r=x(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),g),_&&(e=Bc(e)),w&&+e==0&&d!==`+`&&(w=!1),n=(w?d===`(`?d:s:d===`-`||d===`(`?``:d)+n,r=(v===`s`?qc[8+Vc/3]:``)+r+(w&&d===`(`?`)`:``),S){for(o=-1,f=e.length;++o<f;)if(C=e.charCodeAt(o),48>C||C>57){r=(C===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}h&&!p&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<m?Array(m-T+1).join(l):``;switch(h&&p&&(e=t(E+e,E.length?m-r.length:1/0),E=``),u){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return C.toString=function(){return e+``},C}function u(e,t){var n=l((e=Rc(e),e.type=`f`,e)),r=Math.max(-8,Math.min(8,Math.floor(Pc(t)/3)))*3,i=10**-r,a=qc[8+r/3];return function(e){return n(i*e)+a}}return{format:l,formatPrefix:u}}var Yc,Xc,Zc;Qc({thousands:`,`,grouping:[3],currency:[`$`,``]});function Qc(e){return Yc=Jc(e),Xc=Yc.format,Zc=Yc.formatPrefix,Yc}function $c(e){return Math.max(0,-Pc(Math.abs(e)))}function el(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Pc(t)/3)))*3-Pc(Math.abs(e)))}function tl(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Pc(t)-Pc(e))+1}function nl(e,t,n,r){var i=ds(e,t,n),a;switch(r=Rc(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=el(i,o))&&(r.precision=a),Zc(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=tl(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=$c(i))&&(r.precision=a-(r.type===`%`)*2);break}return Xc(r)}function rl(e){var t=e.domain;return e.ticks=function(e){var n=t();return ls(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return nl(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=us(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function il(){var e=jc();return e.copy=function(){return kc(e,il())},ps.apply(e,arguments),rl(e)}function al(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function ol(e){return Math.log(e)}function sl(e){return Math.exp(e)}function cl(e){return-Math.log(-e)}function ll(e){return-Math.exp(-e)}function ul(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function dl(e){return e===10?ul:e===Math.E?Math.exp:t=>e**+t}function fl(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function pl(e){return(t,n)=>-e(-t,n)}function ml(e){let t=e(ol,sl),n=t.domain,r=10,i,a;function o(){return i=fl(r),a=dl(r),n()[0]<0?(i=pl(i),a=pl(a),e(cl,ll)):e(ol,sl),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=ls(o,s,p))}else m=ls(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=Rc(n)).precision==null&&(n.trim=!0),n=Xc(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(al(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function hl(){let e=ml(Ac()).domain([1,10]);return e.copy=()=>kc(e,hl()).base(e.base()),ps.apply(e,arguments),e}function gl(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _l(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function vl(e){var t=1,n=e(gl(t),_l(t));return n.constant=function(n){return arguments.length?e(gl(t=+n),_l(t)):t},rl(n)}function yl(){var e=vl(Ac());return e.copy=function(){return kc(e,yl()).constant(e.constant())},ps.apply(e,arguments)}function bl(e){return function(t){return t<0?-((-t)**+e):t**+e}}function xl(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Sl(e){return e<0?-e*e:e*e}function Cl(e){var t=e(wc,wc),n=1;function r(){return n===1?e(wc,wc):n===.5?e(xl,Sl):e(bl(n),bl(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},rl(t)}function wl(){var e=Cl(Ac());return e.copy=function(){return kc(e,wl()).exponent(e.exponent())},ps.apply(e,arguments),e}function Tl(){return wl.apply(null,arguments).exponent(.5)}function El(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[$o(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return El().domain(e).range(t).unknown(n)},ps.apply(i,arguments)}var Dl=new Date,Ol=new Date;function Y(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>Y(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Dl.setTime(+t),Ol.setTime(+r),e(Dl),e(Ol),Math.floor(n(Dl,Ol))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var kl=Y(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);kl.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Y(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):kl),kl.range;var Al=1e3,jl=Al*60,Ml=jl*60,Nl=Ml*24,Pl=Nl*7,Fl=Nl*30,Il=Nl*365,Ll=Y(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Al)},(e,t)=>(t-e)/Al,e=>e.getUTCSeconds());Ll.range;var Rl=Y(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Al)},(e,t)=>{e.setTime(+e+t*jl)},(e,t)=>(t-e)/jl,e=>e.getMinutes());Rl.range;var zl=Y(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jl)},(e,t)=>(t-e)/jl,e=>e.getUTCMinutes());zl.range;var Bl=Y(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Al-e.getMinutes()*jl)},(e,t)=>{e.setTime(+e+t*Ml)},(e,t)=>(t-e)/Ml,e=>e.getHours());Bl.range;var Vl=Y(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ml)},(e,t)=>(t-e)/Ml,e=>e.getUTCHours());Vl.range;var Hl=Y(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jl)/Nl,e=>e.getDate()-1);Hl.range;var Ul=Y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Nl,e=>e.getUTCDate()-1);Ul.range;var Wl=Y(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Nl,e=>Math.floor(e/Nl));Wl.range;function Gl(e){return Y(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jl)/Pl)}var Kl=Gl(0),ql=Gl(1),Jl=Gl(2),Yl=Gl(3),Xl=Gl(4),Zl=Gl(5),Ql=Gl(6);Kl.range,ql.range,Jl.range,Yl.range,Xl.range,Zl.range,Ql.range;function $l(e){return Y(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/Pl)}var eu=$l(0),tu=$l(1),nu=$l(2),ru=$l(3),iu=$l(4),au=$l(5),ou=$l(6);eu.range,tu.range,nu.range,ru.range,iu.range,au.range,ou.range;var su=Y(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());su.range;var cu=Y(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());cu.range;var lu=Y(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());lu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Y(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}),lu.range;var uu=Y(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());uu.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Y(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}),uu.range;function du(e,t,n,r,i,a){let o=[[Ll,1,Al],[Ll,5,5*Al],[Ll,15,15*Al],[Ll,30,30*Al],[a,1,jl],[a,5,5*jl],[a,15,15*jl],[a,30,30*jl],[i,1,Ml],[i,3,3*Ml],[i,6,6*Ml],[i,12,12*Ml],[r,1,Nl],[r,2,2*Nl],[n,1,Pl],[t,1,Fl],[t,3,3*Fl],[e,1,Il]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=Yo(([,,e])=>e).right(o,i);if(a===o.length)return e.every(ds(t/Il,n/Il,r));if(a===0)return kl.every(Math.max(ds(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[fu,pu]=du(uu,cu,eu,Wl,Vl,zl),[mu,hu]=du(lu,su,Kl,Hl,Bl,Rl);function gu(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function _u(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function vu(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function yu(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=wu(i),u=Tu(i),d=wu(a),f=Tu(a),p=wu(o),m=Tu(o),h=wu(s),g=Tu(s),_=wu(c),v=Tu(c),y={a:M,A:te,b:N,B:ne,c:null,d:Ku,e:Ku,f:Zu,g:cd,G:ud,H:qu,I:Ju,j:Yu,L:Xu,m:Qu,M:$u,p:P,q:re,Q:Nd,s:Pd,S:ed,u:td,U:nd,V:id,w:ad,W:od,x:null,X:null,y:sd,Y:ld,Z:dd,"%":Md},b={a:F,A:I,b:ie,B:ae,c:null,d:fd,e:fd,f:_d,g:Od,G:Ad,H:pd,I:md,j:hd,L:gd,m:vd,M:yd,p:oe,q:se,Q:Nd,s:Pd,S:bd,u:xd,U:Sd,V:wd,w:Td,W:Ed,x:null,X:null,y:Dd,Y:kd,Z:jd,"%":Md},x={a:E,A:D,b:O,B:k,c:ee,d:Iu,e:Iu,f:Hu,g:Mu,G:ju,H:Ru,I:Ru,j:Lu,L:Vu,m:Fu,M:zu,p:T,q:Pu,Q:Wu,s:Gu,S:Bu,u:Du,U:Ou,V:ku,w:Eu,W:Au,x:A,X:j,y:Mu,Y:ju,Z:Nu,"%":Uu};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=bu[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=vu(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=_u(vu(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?tu.ceil(a):tu(a),a=Ul.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=gu(vu(r.y,0,1)),o=a.getDay(),a=o>4||o===0?ql.ceil(a):ql(a),a=Hl.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:+(`W`in r)),o=`Z`in r?_u(vu(r.y,0,1)).getUTCDay():gu(vu(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,_u(r)):gu(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in bu?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function ee(e,n,r){return w(e,t,n,r)}function A(e,t,r){return w(e,n,t,r)}function j(e,t,n){return w(e,r,t,n)}function M(e){return o[e.getDay()]}function te(e){return a[e.getDay()]}function N(e){return c[e.getMonth()]}function ne(e){return s[e.getMonth()]}function P(e){return i[+(e.getHours()>=12)]}function re(e){return 1+~~(e.getMonth()/3)}function F(e){return o[e.getUTCDay()]}function I(e){return a[e.getUTCDay()]}function ie(e){return c[e.getUTCMonth()]}function ae(e){return s[e.getUTCMonth()]}function oe(e){return i[+(e.getUTCHours()>=12)]}function se(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var bu={"-":``,_:` `,0:`0`},X=/^\s*\d+/,xu=/^%/,Su=/[\\^$*+?|[\]().{}]/g;function Z(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function Cu(e){return e.replace(Su,`\\$&`)}function wu(e){return RegExp(`^(?:`+e.map(Cu).join(`|`)+`)`,`i`)}function Tu(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Eu(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Du(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Ou(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function ku(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Au(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ju(e,t,n){var r=X.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Mu(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Nu(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||`00`)),n+r[0].length):-1}function Pu(e,t,n){var r=X.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Fu(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function Iu(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Lu(e,t,n){var r=X.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Ru(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function zu(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Bu(e,t,n){var r=X.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Vu(e,t,n){var r=X.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Hu(e,t,n){var r=X.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Uu(e,t,n){var r=xu.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Wu(e,t,n){var r=X.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Gu(e,t,n){var r=X.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Ku(e,t){return Z(e.getDate(),t,2)}function qu(e,t){return Z(e.getHours(),t,2)}function Ju(e,t){return Z(e.getHours()%12||12,t,2)}function Yu(e,t){return Z(1+Hl.count(lu(e),e),t,3)}function Xu(e,t){return Z(e.getMilliseconds(),t,3)}function Zu(e,t){return Xu(e,t)+`000`}function Qu(e,t){return Z(e.getMonth()+1,t,2)}function $u(e,t){return Z(e.getMinutes(),t,2)}function ed(e,t){return Z(e.getSeconds(),t,2)}function td(e){var t=e.getDay();return t===0?7:t}function nd(e,t){return Z(Kl.count(lu(e)-1,e),t,2)}function rd(e){var t=e.getDay();return t>=4||t===0?Xl(e):Xl.ceil(e)}function id(e,t){return e=rd(e),Z(Xl.count(lu(e),e)+(lu(e).getDay()===4),t,2)}function ad(e){return e.getDay()}function od(e,t){return Z(ql.count(lu(e)-1,e),t,2)}function sd(e,t){return Z(e.getFullYear()%100,t,2)}function cd(e,t){return e=rd(e),Z(e.getFullYear()%100,t,2)}function ld(e,t){return Z(e.getFullYear()%1e4,t,4)}function ud(e,t){var n=e.getDay();return e=n>=4||n===0?Xl(e):Xl.ceil(e),Z(e.getFullYear()%1e4,t,4)}function dd(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+Z(t/60|0,`0`,2)+Z(t%60,`0`,2)}function fd(e,t){return Z(e.getUTCDate(),t,2)}function pd(e,t){return Z(e.getUTCHours(),t,2)}function md(e,t){return Z(e.getUTCHours()%12||12,t,2)}function hd(e,t){return Z(1+Ul.count(uu(e),e),t,3)}function gd(e,t){return Z(e.getUTCMilliseconds(),t,3)}function _d(e,t){return gd(e,t)+`000`}function vd(e,t){return Z(e.getUTCMonth()+1,t,2)}function yd(e,t){return Z(e.getUTCMinutes(),t,2)}function bd(e,t){return Z(e.getUTCSeconds(),t,2)}function xd(e){var t=e.getUTCDay();return t===0?7:t}function Sd(e,t){return Z(eu.count(uu(e)-1,e),t,2)}function Cd(e){var t=e.getUTCDay();return t>=4||t===0?iu(e):iu.ceil(e)}function wd(e,t){return e=Cd(e),Z(iu.count(uu(e),e)+(uu(e).getUTCDay()===4),t,2)}function Td(e){return e.getUTCDay()}function Ed(e,t){return Z(tu.count(uu(e)-1,e),t,2)}function Dd(e,t){return Z(e.getUTCFullYear()%100,t,2)}function Od(e,t){return e=Cd(e),Z(e.getUTCFullYear()%100,t,2)}function kd(e,t){return Z(e.getUTCFullYear()%1e4,t,4)}function Ad(e,t){var n=e.getUTCDay();return e=n>=4||n===0?iu(e):iu.ceil(e),Z(e.getUTCFullYear()%1e4,t,4)}function jd(){return`+0000`}function Md(){return`%`}function Nd(e){return+e}function Pd(e){return Math.floor(e/1e3)}var Fd,Id,Ld;Rd({dateTime:`%x, %X`,date:`%-m/%-d/%Y`,time:`%-I:%M:%S %p`,periods:[`AM`,`PM`],days:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],shortDays:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],months:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],shortMonths:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`]});function Rd(e){return Fd=yu(e),Id=Fd.format,Fd.parse,Ld=Fd.utcFormat,Fd.utcParse,Fd}function zd(e){return new Date(e)}function Bd(e){return e instanceof Date?+e:+new Date(+e)}function Vd(e,t,n,r,i,a,o,s,c,l){var u=jc(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,Bd)):f().map(zd)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(al(n,e)):u},u.copy=function(){return kc(u,Vd(e,t,n,r,i,a,o,s,c,l))},u}function Hd(){return ps.apply(Vd(mu,hu,lu,su,Kl,Hl,Bl,Rl,Ll,Id).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Ud(){return ps.apply(Vd(fu,pu,uu,cu,eu,Ul,Vl,zl,Ll,Ld).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function Wd(){var e=0,t=1,n,r,i,a,o=wc,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u(yc),l.rangeRound=u(bc),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function Gd(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function Kd(){var e=rl(Wd()(wc));return e.copy=function(){return Gd(e,Kd())},ms.apply(e,arguments)}function qd(e){return e.type===`piecewise`?El(e.thresholds,e.colors):Kd([e.min??0,e.max??100],e.color)}function Jd(e){return e.values?gs(e.values,e.colors).unknown(e.unknownColor??null):gs(e.colors.map((e,t)=>t),e.colors).unknown(e.unknownColor??null)}function Yd(e){return e.type===`ordinal`?Jd(e):qd(e)}function Xd(e,t,n){let{tickMaxStep:r,tickMinStep:i,tickNumber:a}=e,o=i===void 0?999:Math.floor(Math.abs(t[1]-t[0])/i),s=r===void 0?2:Math.ceil(Math.abs(t[1]-t[0])/r);return Math.min(o,Math.max(s,a??n))}function Zd(e,t){return t[1]-t[0]===0?1:e/((t[1]-t[0])/100)}function Qd(e){return Math.floor(Math.abs(e)/50)}function $d(e){return Array.isArray(e)?JSON.stringify(e):typeof e==`object`&&e?e.valueOf():e}function ef(...e){let t=new es(void 0,$d),n=[],r=[],i=0,a=1,o,s,c=!1,l=0,u=0,d=.5,f=e=>{let n=t.get(e);if(n!==void 0)return r[n%r.length]},p=()=>{let e=n.length,t=a<i,p=t?a:i,m=t?i:a;o=(m-p)/Math.max(1,e-l+u*2),c&&(o=Math.floor(o));let h=p+(m-p-o*(e-l))*d;s=o*(1-l);let g=c?Math.round(h):h;s=c?Math.round(s):s;let _=fs(e).map(e=>g+o*e);return r=t?_.reverse():_,f};f.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new es(void 0,$d);for(let r of e)t.has(r)||t.set(r,n.push(r)-1);return p()},f.range=function(e){if(!arguments.length)return[i,a];let[t,n]=e;return i=+t,a=+n,p()},f.rangeRound=function(e){let[t,n]=e;return i=+t,a=+n,c=!0,p()},f.bandwidth=function(){return s},f.step=function(){return o},f.round=function(e){return arguments.length?(c=!!e,p()):c},f.padding=function(e){return arguments.length?(l=Math.min(1,u=+e),p()):l},f.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),p()):l},f.paddingOuter=function(e){return arguments.length?(u=+e,p()):u},f.align=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),p()):d},f.copy=()=>ef(n,[i,a]).round(c).paddingInner(l).paddingOuter(u).align(d);let[m,h]=e;return e.length>1?(f.domain(m),f.range(h)):m?f.range(m):p(),f}function tf(...e){let t=ef(...e).paddingInner(1),n=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=()=>{let e=n();return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=t.copy,e},t}function nf(...e){let t=yl(...e),n=t.ticks,{negativeScale:r,linearScale:i,positiveScale:a}=rf(t);return t.ticks=e=>{let o=n(e),s=t.constant(),c=0,l=0,u=0;o.forEach(e=>{e>-s&&e<s&&(l+=1),e<=-s&&(c+=1),e>=s&&(u+=1)});let d=[];if(c>0&&d.push(...r.ticks(c)),l>0){let e=i.ticks(l);d.at(-1)===e[0]?d.push(...e.slice(1)):d.push(...e)}if(u>0){let e=a.ticks(u);d.at(-1)===e[0]?d.push(...e.slice(1)):d.push(...e)}return d},t.tickFormat=(e=10,n)=>{let o=t.constant(),[s,c]=t.domain(),l=c-s,u=r.domain(),d=u[1]-u[0],f=(l===0?0:d/l)*e,p=i.domain(),m=p[1]-p[0],h=(l===0?0:m/l)*e,g=a.domain(),_=g[1]-g[0],v=(l===0?0:_/l)*e,y=r.tickFormat(f,n),b=i.tickFormat(h,n),x=a.tickFormat(v,n);return e=>(e.valueOf()<=-o?y:e.valueOf()>=o?x:b)(e)},t.copy=()=>nf(t.domain(),t.range()).constant(t.constant()),t}function rf(e){let t=e.constant(),n=e.domain();return{negativeScale:hl([n[0],Math.min(n[1],-t)],e.range()),linearScale:il([Math.max(n[0],-t),Math.min(n[1],t)],e.range()),positiveScale:hl([Math.max(n[0],t),n[1]],e.range())}}function af(e,t,n){switch(e){case`log`:return hl(t,n);case`pow`:return wl(t,n);case`sqrt`:return Tl(t,n);case`time`:return Hd(t,n);case`utc`:return Ud(t,n);case`symlog`:return nf(t,n);default:return il(t,n)}}var of=e=>e?.[0]instanceof Date;function sf(e,t,n){let r=Hd(e,t);return(e,{location:t})=>t===`tick`?r.tickFormat(n)(e):`${e.toLocaleString()}`}var cf,lf,uf=class{types=new Set;constructor(){if(cf)throw Error(`You can only create one instance!`);cf=this.types}addType(e){this.types.add(e)}getTypes(){return this.types}},df=class{types=new Set;constructor(){if(lf)throw Error(`You can only create one instance!`);lf=this.types}addType(e){this.types.add(e)}getTypes(){return this.types}},ff=new uf;ff.addType(`bar`),ff.addType(`line`),ff.addType(`scatter`),new df().addType(`radar`);function pf(e){return ff.getTypes().has(e)}var mf=(e,t,n,r)=>{let i=new Set;return Object.keys(t).filter(pf).forEach(a=>{let o=n[a]?.series??{},s=t[a].axisTooltipGetter?.(o);s!==void 0&&s.forEach(({axisId:t,direction:n})=>{n===e&&i.add(t??r)})}),i};function hf(e){return e.bandwidth!==void 0}function gf(e){return hf(e)&&e.paddingOuter!==void 0}function _f(e,t,n){let r=t===`x`?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n?[r[1],r[0]]:r}function vf(e,t){return e.step()*t<.1}var yf=.2,bf=.1;function xf({scales:e,drawingArea:t,formattedSeries:n,axis:r,seriesConfig:i,axisDirection:a,zoomMap:o,domains:s}){if(r===void 0)return{axis:{},axisIds:[]};let c=mf(a,i,n,r[0].id),l={};return r.forEach(n=>{let r=n,i=e[r.id],u=o?.get(r.id),d=u?[u.start,u.end]:[0,100],f=_f(t,a,r.reverse??!1),p=s[r.id].tickNumber,m=!r.ignoreTooltip&&c.has(r.id),h=Zd(p,d),g=r.data??[];if(hf(i)){let e=a===`y`?[f[1],f[0]]:f;if(gf(i)&&Wo(r)){let e=r.categoryGapRatio??yf,t=vf(i,e),n=t?0:e,a=t?0:r.barGapRatio??bf;l[r.id]=y({offset:0,height:0,categoryGapRatio:n,barGapRatio:a,triggerTooltip:m},r,{data:g,scale:t?i.copy().padding(0):i,tickNumber:h,colorScale:r.colorMap&&(r.colorMap.type===`ordinal`?Jd(y({values:r.data},r.colorMap)):Yd(r.colorMap))})}if(Go(r)&&(l[r.id]=y({offset:0,height:0,triggerTooltip:m},r,{data:g,scale:i,tickNumber:h,colorScale:r.colorMap&&(r.colorMap.type===`ordinal`?Jd(y({values:r.data},r.colorMap)):Yd(r.colorMap))})),of(r.data)){let t=sf(r.data,e,r.tickNumber);l[r.id].valueFormatter=r.valueFormatter??t}return}if(r.scaleType===`band`||r.scaleType===`point`)return;let _=r,v=_.scaleType??`linear`;l[r.id]=y({offset:0,height:0,triggerTooltip:m},_,{data:g,scaleType:v,scale:i,tickNumber:h,colorScale:_.colorMap&&qd(_.colorMap),valueFormatter:r.valueFormatter??Uo(h,af(v,f.map(e=>i.invert(e)),f))})}),{axis:l,axisIds:r.map(({id:e})=>e)}}function Sf(e){return e!=null}function Cf(e,t,n,r){let i=e?.length??0,a=Math.floor(t*i/100),o=Math.ceil(n*i/100);return function(t,n){return(t[r]??e?.[n])==null?!0:n>=a&&n<o}}function wf(e,t,n,r,i){let a=e[0].valueOf(),o=e[1].valueOf(),s=a+t*(o-a)/100,c=a+n*(o-a)/100;return function(e,t){let n=e[r]??i?.[t];return n==null?!0:n>=s&&n<=c}}var Tf=e=>({currentAxisId:t,seriesXAxisId:n,seriesYAxisId:r,isDefaultAxis:i})=>(a,o)=>!(t===n?r:n)||i?Object.values(e??{})[0]?.(a,o)??!0:[r,n].filter(e=>e!==t).map(t=>e[t??``]).filter(Sf).every(e=>e(a,o)),Ef=e=>(t=[])=>t.reduce((t,n)=>{let{zoom:r,id:i,reverse:a}=n,o=Bo(r,i,e,a);return o&&(t[i]=o),t},{}),Df=.2;function Of(e,t,n){let r=t===`x`?[e.left,e.left+e.width]:[e.top+e.height,e.top];return n.reverse?[r[1],r[0]]:r}function kf(e,t){let n=[0,1];if(Wo(e)){let r=e.categoryGapRatio??Df;return ef(t,n).paddingInner(r).paddingOuter(r/2)}if(Go(e))return tf(t,n);let r=af(e.scaleType??`linear`,t,n);return Ko(e)&&e.constant!=null&&r.constant(e.constant),r}var Af=(e,t)=>{let n=e[1]-e[0],r=t[1]-t[0];return[e[0]-t[0]*n/r,e[1]+(100-t[1])*n/r]},jf=(e,t,n,r,i,a,o)=>{let s=n===`x`?r[e].xExtremumGetter:r[e].yExtremumGetter,c=a[e]?.series??{};return s?.({series:c,axis:t,axisIndex:i,isDefaultAxis:i===0,getFilters:o})??[1/0,-1/0]};function Mf(e,t,n,r,i,a){let o=Object.keys(n).filter(pf),s=[1/0,-1/0];for(let c of o){let[o,l]=jf(c,e,t,n,r,i,a);s=[Math.min(s[0],o),Math.max(s[1],l)]}return Number.isNaN(s[0])||Number.isNaN(s[1])?[1/0,-1/0]:s}var Nf=(e,t,n,r)=>{if(e.domainLimit!==void 0)return e.domainLimit;if(t===`x`)for(let t of r.line?.seriesOrder??[]){let i=r.line.series[t];if(i.xAxisId===e.id||i.xAxisId===void 0&&n===0)return`strict`}return`nice`};function Pf(e,t,n){return af(e??`linear`,t,[0,1]).nice(n).domain()}function Ff(e,t,n,r,[i,a],o,s){let c=Lf(e,t,n,r,s),l=Rf(e,i,a);if(typeof c==`function`){let{min:e,max:t}=c(i.valueOf(),a.valueOf());l[0]=e,l[1]=t}let u=Xd(e,l,o);return c===`nice`&&(l=Pf(e.scaleType,l,u)),l=[`min`in e?e.min??l[0]:l[0],`max`in e?e.max??l[1]:l[1]],{domain:l,tickNumber:u}}function If(e,t,n,r,[i,a],o,s){let c=Lf(e,t,n,r,s),l=Rf(e,i,a);if(typeof c==`function`){let{min:e,max:t}=c(i.valueOf(),a.valueOf());l[0]=e,l[1]=t}return c===`nice`&&(l=Pf(e.scaleType,l,o)),[e.min??l[0],e.max??l[1]]}function Lf(e,t,n,r,i){return i?Nf(e,t,n,r):e.domainLimit??`nice`}function Rf(e,t,n){let r=t,i=n;return`max`in e&&e.max!=null&&e.max<t&&(r=e.max),`min`in e&&e.min!=null&&e.min>t&&(i=e.min),!(`min`in e)&&!(`max`in e)?[r,i]:[e.min??r,e.max??i]}var zf=class{constructor(){this.ids=[],this.values=[],this.length=0}clear(){this.length=0}push(e,t){let n=this.length++;for(;n>0;){let e=n-1>>1,r=this.values[e];if(t>=r)break;this.ids[n]=this.ids[e],this.values[n]=r,n=e}this.ids[n]=e,this.values[n]=t}pop(){if(this.length===0)return;let e=this.ids,t=this.values,n=e[0],r=--this.length;if(r>0){let n=e[r],i=t[r],a=0,o=r>>1;for(;a<o;){let n=(a<<1)+1,o=n+1,s=n+(o<r&+(t[o]<t[n]));if(t[s]>=i)break;e[a]=e[s],t[a]=t[s],a=s}e[a]=n,t[a]=i}return n}peek(){return this.length>0?this.ids[0]:void 0}peekValue(){return this.length>0?this.values[0]:void 0}shrink(){this.ids.length=this.values.length=this.length}},Bf=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Vf=3,Hf=class e{static from(t,n=0){if(n%8!=0)throw Error(`byteOffset must be 8-byte aligned.`);if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[r,i]=new Uint8Array(t,n+0,2);if(r!==251)throw Error(`Data does not appear to be in a Flatbush format.`);let a=i>>4;if(a!==Vf)throw Error(`Got v${a} data when expected v${Vf}.`);let o=Bf[i&15];if(!o)throw Error(`Unrecognized array type.`);let[s]=new Uint16Array(t,n+2,1),[c]=new Uint32Array(t,n+4,1);return new e(c,s,o,void 0,t,n)}constructor(e,t=16,n=Float64Array,r=ArrayBuffer,i,a=0){if(e===void 0)throw Error(`Missing required argument: numItems.`);if(isNaN(e)||e<=0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.byteOffset=a;let o=e,s=o;this._levelBounds=[o*4];do o=Math.ceil(o/this.nodeSize),s+=o,this._levelBounds.push(s*4);while(o!==1);this.ArrayType=n,this.IndexArrayType=s<16384?Uint16Array:Uint32Array;let c=Bf.indexOf(n),l=s*4*n.BYTES_PER_ELEMENT;if(c<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this._boxes=new n(i,a+8,s*4),this._indices=new this.IndexArrayType(i,a+8+l,s),this._pos=s*4,this.minX=this._boxes[this._pos-4],this.minY=this._boxes[this._pos-3],this.maxX=this._boxes[this._pos-2],this.maxY=this._boxes[this._pos-1];else{let i=this.data=new r(8+l+s*this.IndexArrayType.BYTES_PER_ELEMENT);this._boxes=new n(i,8,s*4),this._indices=new this.IndexArrayType(i,8+l,s),this._pos=0,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,new Uint8Array(i,0,2).set([251,(Vf<<4)+c]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}this._queue=new zf}add(e,t,n=e,r=t){let i=this._pos>>2,a=this._boxes;return this._indices[i]=i,a[this._pos++]=e,a[this._pos++]=t,a[this._pos++]=n,a[this._pos++]=r,e<this.minX&&(this.minX=e),t<this.minY&&(this.minY=t),n>this.maxX&&(this.maxX=n),r>this.maxY&&(this.maxY=r),i}finish(){if(this._pos>>2!==this.numItems)throw Error(`Added ${this._pos>>2} items when expected ${this.numItems}.`);let e=this._boxes;if(this.numItems<=this.nodeSize){e[this._pos++]=this.minX,e[this._pos++]=this.minY,e[this._pos++]=this.maxX,e[this._pos++]=this.maxY;return}let t=this.maxX-this.minX||1,n=this.maxY-this.minY||1,r=new Uint32Array(this.numItems),i=65535;for(let a=0,o=0;a<this.numItems;a++){let s=e[o++],c=e[o++],l=e[o++],u=e[o++];r[a]=qf(Math.floor(i*((s+l)/2-this.minX)/t),Math.floor(i*((c+u)/2-this.minY)/n))}Gf(r,e,this._indices,0,this.numItems-1,this.nodeSize);for(let t=0,n=0;t<this._levelBounds.length-1;t++){let r=this._levelBounds[t];for(;n<r;){let t=n,i=e[n++],a=e[n++],o=e[n++],s=e[n++];for(let t=1;t<this.nodeSize&&n<r;t++)i=Math.min(i,e[n++]),a=Math.min(a,e[n++]),o=Math.max(o,e[n++]),s=Math.max(s,e[n++]);this._indices[this._pos>>2]=t,e[this._pos++]=i,e[this._pos++]=a,e[this._pos++]=o,e[this._pos++]=s}}}search(e,t,n,r,i){if(this._pos!==this._boxes.length)throw Error(`Data not yet indexed - call index.finish().`);let a=this._boxes.length-4,o=[],s=[];for(;a!==void 0;){let c=Math.min(a+this.nodeSize*4,Wf(a,this._levelBounds));for(let l=a;l<c;l+=4){if(n<this._boxes[l]||r<this._boxes[l+1]||e>this._boxes[l+2]||t>this._boxes[l+3])continue;let c=this._indices[l>>2]|0;a>=this.numItems*4?o.push(c):(i===void 0||i(c))&&(s.push(c),s.push(this._boxes[l]),s.push(this._boxes[l+1]))}a=o.pop()}return s}neighbors(e,t,n=1/0,r=1/0,i,a=Uf){if(this._pos!==this._boxes.length)throw Error(`Data not yet indexed - call index.finish().`);let o=this._boxes.length-4,s=this._queue,c=[];outer:for(;o!==void 0;){let l=Math.min(o+this.nodeSize*4,Wf(o,this._levelBounds));for(let n=o;n<l;n+=4){let c=this._indices[n>>2]|0,l=this._boxes[n],u=this._boxes[n+1],d=this._boxes[n+2],f=this._boxes[n+3],p=a(e<l?l-e:e>d?e-d:0,t<u?u-t:t>f?t-f:0);p>r||(o>=this.numItems*4?s.push(c<<1,p):(i===void 0||i(c))&&s.push((c<<1)+1,p))}for(;s.length&&s.peek()&1;)if(s.peekValue()>r||(c.push(s.pop()>>1),c.length===n))break outer;o=s.length?s.pop()>>1:void 0}return s.clear(),c}};function Uf(e,t){return e*e+t*t}function Wf(e,t){let n=0,r=t.length-1;for(;n<r;){let i=n+r>>1;t[i]>e?r=i:n=i+1}return t[n]}function Gf(e,t,n,r,i,a){if(Math.floor(r/a)>=Math.floor(i/a))return;let o=e[r],s=e[r+i>>1],c=e[i],l=c,u=Math.max(o,s);c>u?l=u:u===o?l=Math.max(s,c):u===s&&(l=Math.max(o,c));let d=r-1,f=i+1;for(;;){do d++;while(e[d]<l);do f--;while(e[f]>l);if(d>=f)break;Kf(e,t,n,d,f)}Gf(e,t,n,r,f,a),Gf(e,t,n,f+1,i,a)}function Kf(e,t,n,r,i){let a=e[r];e[r]=e[i],e[i]=a;let o=4*r,s=4*i,c=t[o],l=t[o+1],u=t[o+2],d=t[o+3];t[o]=t[s],t[o+1]=t[s+1],t[o+2]=t[s+2],t[o+3]=t[s+3],t[s]=c,t[s+1]=l,t[s+2]=u,t[s+3]=d;let f=n[r];n[r]=n[i],n[i]=f}function qf(e,t){let n=e^t,r=65535^n,i=65535^(e|t),a=e&(t^65535),o=n|r>>1,s=n>>1^n,c=i>>1^r&a>>1^i,l=n&i>>1^a>>1^a;n=o,r=s,i=c,a=l,o=n&n>>2^r&r>>2,s=n&r>>2^r&(n^r)>>2,c^=n&i>>2^r&a>>2,l^=r&i>>2^(n^r)&a>>2,n=o,r=s,i=c,a=l,o=n&n>>4^r&r>>4,s=n&r>>4^r&(n^r)>>4,c^=n&i>>4^r&a>>4,l^=r&i>>4^(n^r)&a>>4,n=o,r=s,i=c,a=l,c^=n&i>>8^r&a>>8,l^=r&i>>8^(n^r)&a>>8,n=c^c>>1,r=l^l>>1;let u=e^t,d=r|65535^(u|n);return u=(u|u<<8)&16711935,u=(u|u<<4)&252645135,u=(u|u<<2)&858993459,u=(u|u<<1)&1431655765,d=(d|d<<8)&16711935,d=(d|d<<4)&252645135,d=(d|d<<2)&858993459,d=(d|d<<1)&1431655765,(d<<1|u)>>>0}var Jf=e=>{let t=new Map;return e.forEach(e=>{t.set(e.axisId,e)}),t},Yf=e=>e.zoom;K(Yf,e=>e?.isInteracting);var Xf=q(Yf,function(e){return e?.zoomData&&Jf(e?.zoomData)});K(Xf,(e,t)=>e?.get(t));var Zf=q(ma,ha,function(e,t){return y({},Ef(`x`)(e),Ef(`y`)(t))});K(Zf,(e,t)=>e[t]);var Qf=K(va,function(e){return Qd(e.width)}),$f=K(va,function(e){return Qd(e.height)}),ep=q(ma,Ya,Ja,Da,Qf,function(e,t,n,r,i){let a={};return e?.forEach((e,o)=>{let s=e;if(Wo(s)||Go(s)){a[s.id]={domain:s.data},s.ordinalTimeTicks!==void 0&&(a[s.id].tickNumber=Xd(s,[s.data?.find(e=>e!==null),s.data?.findLast(e=>e!==null)],i));return}let c=Mf(s,`x`,n,o,t);a[s.id]=Ff(s,`x`,o,t,c,i,r)}),{axes:e,domains:a}}),tp=q(ha,Ya,Ja,Da,$f,function(e,t,n,r,i){let a={};return e?.forEach((e,o)=>{let s=e;if(Wo(s)||Go(s)){a[s.id]={domain:s.data},s.ordinalTimeTicks!==void 0&&(a[s.id].tickNumber=Xd(s,[s.data?.find(e=>e!==null),s.data?.findLast(e=>e!==null)],i));return}let c=Mf(s,`y`,n,o,t);a[s.id]=Ff(s,`y`,o,t,c,i,r)}),{axes:e,domains:a}}),np=q(Xf,Zf,ep,tp,function(e,t,{axes:n,domains:r},{axes:i,domains:a}){if(!e||!t)return;let o=!1,s={},c=[...n??[],...i??[]];for(let i=0;i<c.length;i+=1){let l=c[i];if(!t[l.id]||t[l.id].filterMode!==`discard`)continue;let u=e.get(l.id);if(u===void 0||u.start<=0&&u.end>=100)continue;let d=i<(n?.length??0)?`x`:`y`;if(l.scaleType===`band`||l.scaleType===`point`)s[l.id]=Cf(l.data,u.start,u.end,d);else{let{domain:e}=d===`x`?r[l.id]:a[l.id];s[l.id]=wf(e,u.start,u.end,d,l.data)}o=!0}if(o)return Tf(s)}),rp=q(Ya,Ja,Xf,Zf,np,Da,ep,function(e,t,n,r,i,a,{axes:o,domains:s}){let c={};return o?.forEach((o,l)=>{let u=s[o.id].domain;if(Wo(o)||Go(o)){c[o.id]=u;return}let d=n?.get(o.id),f=r?.[o.id],p=d===void 0&&!f?i:void 0;if(!p){c[o.id]=u;return}let m=s[o.id].tickNumber,h=Mf(o,`x`,t,l,e,p);c[o.id]=If(o,`x`,l,e,h,m,a)}),c}),ip=q(Ya,Ja,Xf,Zf,np,Da,tp,function(e,t,n,r,i,a,{axes:o,domains:s}){let c={};return o?.forEach((o,l)=>{let u=s[o.id].domain;if(Wo(o)||Go(o)){c[o.id]=u;return}let d=n?.get(o.id),f=r?.[o.id],p=d===void 0&&!f?i:void 0;if(!p){c[o.id]=u;return}let m=s[o.id].tickNumber,h=Mf(o,`y`,t,l,e,p);c[o.id]=If(o,`y`,l,e,h,m,a)}),c}),ap=q(ma,rp,function(e,t){let n={};return e?.forEach(e=>{let r=e,i=t[r.id];n[r.id]=kf(r,i)}),n}),op=q(ha,ip,function(e,t){let n={};return e?.forEach(e=>{let r=e,i=t[r.id];n[r.id]=kf(r,i)}),n}),sp=q(ma,ap,va,Xf,function(e,t,n,r){let i={};return e?.forEach(e=>{let a=e,o=r?.get(a.id),s=o?[o.start,o.end]:[0,100],c=Of(n,`x`,a),l=t[a.id].copy(),u=Af(c,s);l.range(u),i[a.id]=l}),i}),cp=q(ha,op,va,Xf,function(e,t,n,r){let i={};return e?.forEach(e=>{let a=e,o=r?.get(a.id),s=o?[o.start,o.end]:[0,100],c=Of(n,`y`,a),l=t[a.id].copy(),u=Af(hf(l)?c.reverse():c,s);l.range(u),i[a.id]=l}),i}),lp=q(va,Ya,Ja,Xf,ep,sp,function(e,t,n,r,{axes:i,domains:a},o){return xf({scales:o,drawingArea:e,formattedSeries:t,axis:i,seriesConfig:n,axisDirection:`x`,zoomMap:r,domains:a})}),up=q(va,Ya,Ja,Xf,tp,cp,function(e,t,n,r,{axes:i,domains:a},o){return xf({scales:o,drawingArea:e,formattedSeries:t,axis:i,seriesConfig:n,axisDirection:`y`,zoomMap:r,domains:a})});K(lp,up,(e,t,n)=>e?.axis[n]??t?.axis[n]),K(ma,ha,(e,t,n)=>{let r=e?.find(e=>e.id===n)??t?.find(e=>e.id===n)??null;if(r)return r}),q(Ya,ap,op,K(ma,e=>e[0].id),K(ha,e=>e[0].id),function(e,t,n,r,i){let a=e.scatter,o=new Map;return a&&a.seriesOrder.forEach(e=>{let{data:s,xAxisId:c=r,yAxisId:l=i}=a.series[e],u=new Hf(s.length),d=t[c],f=n[l];for(let e of s)u.add(d(e.x),f(e.y));u.finish(),o.set(e,u)}),o});function dp(e){return e instanceof Date?e.getTime():e}function fp(e,t){let{scale:n,data:r,reverse:i}=e;if(!hf(n)){let e=n.invert(t);if(r===void 0)return-1;let i=dp(e);return r?.findIndex((t,n)=>{let a=dp(t);return a>i&&(n===0||Math.abs(i-a)<=Math.abs(i-dp(r[n-1])))||a<=i&&(n===r.length-1||Math.abs(dp(e)-a)<Math.abs(dp(e)-dp(r[n+1])))})}let a=n.bandwidth()===0?Math.floor((t-Math.min(...n.range())+n.step()/2)/n.step()):Math.floor((t-Math.min(...n.range()))/n.step());return a<0||a>=r.length?-1:i?r.length-1-a:a}function pp(e,t,n,r){if(!hf(e)){if(r===null){let t=e.invert(n);return Number.isNaN(t)?null:t}return t[r]}return r===null||r<0||r>=t.length?null:t[r]}function mp(e,t){let n=e.createSVGPoint();return n.x=t.clientX,n.y=t.clientY,n.matrixTransform(e.getScreenCTM().inverse())}var hp=({store:e})=>({instance:{cleanInteraction:Ma(function(){e.update({interaction:y({},e.state.interaction,{pointer:null})})}),setLastUpdateSource:Ma(function(t){e.state.interaction.lastUpdate!==t&&e.set(`interaction`,y({},e.state.interaction,{lastUpdate:t}))}),setPointerCoordinate:Ma(function(t){e.set(`interaction`,y({},e.state.interaction,{pointer:t,lastUpdate:t===null?e.state.interaction.lastUpdate:`pointer`}))}),handlePointerEnter:Ma(function(t){e.set(`interaction`,y({},e.state.interaction,{pointerType:t.pointerType}))}),handlePointerLeave:Ma(function(){e.set(`interaction`,y({},e.state.interaction,{pointerType:null}))})}});hp.getInitialState=()=>({interaction:{item:null,pointer:null,lastUpdate:`pointer`,pointerType:null}}),hp.params={};var gp=e=>e.interaction,_p=K(gp,e=>e!==void 0),vp=K(gp,e=>e?.pointer??null),yp=K(vp,e=>e&&e.x),bp=K(vp,e=>e&&e.y);K(gp,e=>e?.lastUpdate),K(gp,e=>e?.pointerType??null);function xp(e,t){if(e===t)return!0;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(!xp(e[r],t[r]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;let n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;for(let e=0;e<n.length;e+=1){let r=n[e];if(!xp(r[1],t.get(r[0])))return!1}return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;let n=Array.from(e.entries());for(let e=0;e<n.length;e+=1)if(!t.has(n[e][0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r+=1)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();let n=Object.keys(e),r=n.length;if(r!==Object.keys(t).length)return!1;for(let e=0;e<r;e+=1)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let i=0;i<r;i+=1){let r=n[i];if(!xp(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function Sp(e,t,n=t.axisIds[0]){return Array.isArray(n)?n.map(n=>fp(t.axis[n],e)):fp(t.axis[n],e)}var Cp=(e,t,n)=>{if(e===null)return null;let r=Sp(e,t,n);return r===-1?null:r},wp=K(yp,lp,Cp),Tp=K(bp,up,Cp),Ep=K(yp,bp,lp,up,(e,t,n,r)=>[...e===null?[]:n.axisIds.map(t=>({axisId:t,dataIndex:Sp(e,n,t)})),...t===null?[]:r.axisIds.map(e=>({axisId:e,dataIndex:Sp(t,r,e)}))].filter(e=>e.dataIndex!==null&&e.dataIndex>=0));function Dp(e,t,n,r=t.axisIds[0]){return Array.isArray(r)?r.map((r,i)=>{let a=t.axis[r];return pp(a.scale,a.data,e,n[i])}):pp(t.axis[r].scale,t.axis[r].data,e,n)}K(yp,lp,wp,(e,t,n,r)=>e===null||t.axisIds.length===0?null:Dp(e,t,n,r)),K(bp,up,Tp,(e,t,n,r)=>e===null||t.axisIds.length===0?null:Dp(e,t,n,r));var Op=[];K(zi({memoizeOptions:{resultEqualityCheck:xp}})(yp,lp,(e,t)=>e===null?Op:t.axisIds.filter(e=>t.axis[e].triggerTooltip).map(n=>({axisId:n,dataIndex:fp(t.axis[n],e)})).filter(({dataIndex:e})=>e>=0)),zi({memoizeOptions:{resultEqualityCheck:xp}})(bp,up,(e,t)=>e===null?Op:t.axisIds.filter(e=>t.axis[e].triggerTooltip).map(n=>({axisId:n,dataIndex:fp(t.axis[n],e)})).filter(({dataIndex:e})=>e>=0)),(e,t)=>e.length>0||t.length>0);function kp(e){return e.setPointerCoordinate!==void 0}var Ap=new Set([`bar`,`rangeBar`,`line`]),jp=({params:e,store:t,seriesConfig:r,svgRef:i,instance:a})=>{let{xAxis:o,yAxis:s,dataset:c,onHighlightedAxisChange:l}=e;if(process.env.NODE_ENV!==`production`){let e=[...o??[],...s??[]].filter(e=>e.id).map(e=>e.id),t=new Set(e.filter((t,n)=>e.indexOf(t)!==n));t.size>0&&Io([`MUI X Charts: The following axis ids are duplicated: ${Array.from(t).join(`, `)}.`,`Please make sure that each axis has a unique id.`].join(`
35
+ `),`error`)}let u=t.use(va),d=t.use(Ya),f=t.use(_p),{axis:p,axisIds:m}=t.use(lp),{axis:h,axisIds:g}=t.use(up);Ro({warningPrefix:`MUI X Charts`,componentName:`Chart`,propName:`highlightedAxis`,controlled:e.highlightedAxis,defaultValue:void 0}),ln(()=>{e.highlightedAxis!==void 0&&t.set(`controlledCartesianAxisHighlight`,e.highlightedAxis)},[t,e.highlightedAxis]);let _=n.useRef(!0);n.useEffect(()=>{if(_.current){_.current=!1;return}t.set(`cartesianAxis`,{x:Vo(o,c),y:Ho(s,c)})},[r,u,o,s,c,t]);let v=m[0],y=g[0];ra(t,Ep,(e,t)=>{if(l&&!Object.is(e,t)){if(e.length!==t.length){l(t);return}e?.some(({axisId:e,dataIndex:n},r)=>t[r].axisId!==e||t[r].dataIndex!==n)&&l(t)}});let b=kp(a);return n.useEffect(()=>{let t=i.current;if(!f||!b||!t||e.disableAxisListener)return()=>{};let n=a.addInteractionListener(`moveEnd`,e=>{e.detail.activeGestures.pan||a.cleanInteraction()}),r=a.addInteractionListener(`panEnd`,e=>{e.detail.activeGestures.move||a.cleanInteraction()}),o=a.addInteractionListener(`quickPressEnd`,e=>{!e.detail.activeGestures.move&&!e.detail.activeGestures.pan&&a.cleanInteraction()}),s=e=>{let n=e.detail.srcEvent,r=e.detail.target,i=mp(t,n);if(e.detail.srcEvent.buttons>=1&&r?.hasPointerCapture(e.detail.srcEvent.pointerId)&&!r?.closest(`[data-charts-zoom-slider]`)&&r?.releasePointerCapture(e.detail.srcEvent.pointerId),!a.isPointInside(i.x,i.y,r)){a.cleanInteraction?.();return}a.setPointerCoordinate(i)},c=a.addInteractionListener(`move`,s),l=a.addInteractionListener(`pan`,s),u=a.addInteractionListener(`quickPress`,s);return()=>{c.cleanup(),n.cleanup(),l.cleanup(),r.cleanup(),u.cleanup(),o.cleanup()}},[i,t,p,v,h,y,a,e.disableAxisListener,f,b]),n.useEffect(()=>{let t=i.current,n=e.onAxisClick;if(t===null||!n)return()=>{};let r=a.addInteractionListener(`tap`,e=>{let r=null,i=!1,a=mp(t,e.detail.srcEvent),o=fp(p[v],a.x);i=o!==-1,r=i?o:fp(h[y],a.y);let s=i?m[0]:g[0];if(r==null||r===-1)return;let c=(i?p:h)[s].data[r],l={};Object.keys(d).filter(e=>Ap.has(e)).forEach(e=>{let t=d[e];t?.seriesOrder.forEach(e=>{let n=t.series[e],a=n.xAxisId,o=n.yAxisId,c=i?a:o;(c===void 0||c===s)&&(l[e]=n.data[r])})}),n(e.detail.srcEvent,{dataIndex:r,axisValue:c,seriesValues:l})});return()=>{r.cleanup()}},[e.onAxisClick,d,i,p,m,h,g,v,y,a]),{}};jp.params={xAxis:!0,yAxis:!0,dataset:!0,onAxisClick:!0,disableAxisListener:!0,onHighlightedAxisChange:!0,highlightedAxis:!0},jp.getDefaultizedParams=({params:e})=>y({},e,{colors:e.colors??Fa,theme:e.theme??`light`,defaultizedXAxis:Vo(e.xAxis,e.dataset),defaultizedYAxis:Ho(e.yAxis,e.dataset)}),jp.getInitialState=e=>y({cartesianAxis:{x:e.defaultizedXAxis,y:e.defaultizedYAxis}},e.highlightedAxis===void 0?{}:{controlledCartesianAxisHighlight:e.highlightedAxis});var Mp=Object.is;function Np(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(let r in e)if(n+=1,!Mp(e[r],t[r])||!(r in t))return!1;for(let e in t)r+=1;return n===r}var Pp=e=>e.keyboardNavigation;K(Pp,(e,t)=>e?.item!=null&&Np(e.item,t));var Fp=K(Pp,e=>e?.item!=null),Ip=K(Pp,e=>e?.item??null),Lp=K(Pp,e=>!!e?.enableKeyboardNavigation),Rp=e=>(t,n,r)=>{if(t==null||!(`dataIndex`in t)||t.dataIndex===void 0)return;let i=r[t.type]?.series[t.seriesId];if(!i)return;let a=e===`x`?`xAxisId`in i&&i.xAxisId:`yAxisId`in i&&i.yAxisId;return(a===void 0||a===!1)&&(a=n.axisIds[0]),{axisId:a,dataIndex:t.dataIndex}};K(Ip,lp,Ya,Rp(`x`)),K(Ip,up,Ya,Rp(`y`)),K(Pp,function(e){if(e?.item==null)return null;let{type:t,seriesId:n}=e.item;return t===void 0||n===void 0?null:e.item});var zp=({store:e,params:t})=>{Ro({warningPrefix:`MUI X Charts`,componentName:`Chart`,propName:`tooltipItem`,controlled:t.tooltipItem,defaultValue:null}),ln(()=>{e.state.tooltip.item!==t.tooltipItem&&e.set(`tooltip`,y({},e.state.tooltip,{item:t.tooltipItem}))},[e,t.tooltipItem]);let n=Ma(function(n){let r=e.state.tooltip.item;if(r!==null&&(!n||Np(r,n))){t.onTooltipItemChange?.(null),e.state.tooltip.itemIsControlled||e.set(`tooltip`,y({},e.state.tooltip,{item:null}));return}});return{instance:{setTooltipItem:Ma(function(n){Np(e.state.tooltip.item,n)||(t.onTooltipItemChange?.(n),e.state.tooltip.itemIsControlled||e.set(`tooltip`,y({},e.state.tooltip,{item:n})))}),removeTooltipItem:n}}};zp.getInitialState=e=>({tooltip:{itemIsControlled:e.tooltipItem!==void 0,item:e.tooltipItem??null}}),zp.params={tooltipItem:!0,onTooltipItemChange:!0};var Bp=(e,t)=>e===void 0?t:Math.PI*e/180;function Vp(e,t){return e.id===void 0?y({id:t},e):e}function Hp(e){return e.colorMap?y({},e,{colorScale:e.colorMap.type===`ordinal`&&e.data?Jd(y({values:e.data},e.colorMap)):Yd(e.colorMap.type===`continuous`?y({min:e.min,max:e.max},e.colorMap):e.colorMap)}):e}function Up(e,t){if(!e||e.length===0)return{axis:{},axisIds:[]};let n={},r=[];return e.forEach((e,i)=>{let a=e.dataKey,o=e.id??`defaultized-z-axis-${i}`;if(a===void 0||e.data!==void 0){n[o]=Hp(Vp(e,o)),r.push(o);return}if(t===void 0)throw Error("MUI X Charts: z-axis uses `dataKey` but no `dataset` is provided.");n[o]=Hp(Vp(y({},e,{data:t.map(e=>e[a])}),o)),r.push(o)}),{axis:n,axisIds:r}}var Wp=({params:e,store:t})=>{let{zAxis:r,dataset:i}=e,a=n.useRef(!0);return n.useEffect(()=>{if(a.current){a.current=!1;return}t.set(`zAxis`,Up(r,i))},[r,i,t]),{}};Wp.params={zAxis:!0,dataset:!0},Wp.getInitialState=e=>({zAxis:Up(e.zAxis,e.dataset)});var Gp=K(e=>e,e=>e.zAxis),Kp=({store:e,params:t})=>(Ro({warningPrefix:`MUI X Charts`,componentName:`Chart`,propName:`highlightedItem`,controlled:t.highlightedItem,defaultValue:null}),ln(()=>{e.state.highlight.item!==t.highlightedItem&&e.set(`highlight`,y({},e.state.highlight,{item:t.highlightedItem})),process.env.NODE_ENV!==`production`&&t.highlightedItem!==void 0&&!e.state.highlight.isControlled&&Io(["MUI X Charts: The `highlightedItem` switched between controlled and uncontrolled state.","To remove the highlight when using controlled state, you must provide `null` to the `highlightedItem` prop instead of `undefined`."].join(`
36
+ `))},[e,t.highlightedItem]),{instance:{clearHighlight:Ma(()=>{t.onHighlightChange?.(null);let n=e.state.highlight;n.item===null||n.isControlled||e.set(`highlight`,{item:null,lastUpdate:`pointer`,isControlled:!1})}),setHighlight:Ma(n=>{let r=e.state.highlight;Np(r.item,n)||(t.onHighlightChange?.(n),!r.isControlled&&e.set(`highlight`,{item:n,lastUpdate:`pointer`,isControlled:!1}))})}});Kp.getInitialState=e=>({highlight:{item:e.highlightedItem,lastUpdate:`pointer`,isControlled:e.highlightedItem!==void 0}}),Kp.params={highlightedItem:!0,onHighlightChange:!0};function qp(e){let t=1/0,n=-1/0;for(let r of e??[])r<t&&(t=r),r>n&&(n=r);return[t,n]}var Jp=(e,t)=>t===`x`?{x:e,y:null}:{x:null,y:e},Yp=e=>{let{axis:t,getFilters:n,isDefaultAxis:r}=e,i=n?.({currentAxisId:t.id,isDefaultAxis:r});return qp((i?t.data?.filter((e,t)=>i({x:null,y:null},t)):t.data)??[])},Xp=e=>t=>{let{series:n,axis:r,getFilters:i,isDefaultAxis:a}=t;return Object.keys(n).filter(t=>{let i=e===`x`?n[t].xAxisId:n[t].yAxisId;return i===r.id||a&&i===void 0}).reduce((t,o)=>{let{stackedData:s}=n[o],c=i?.({currentAxisId:r.id,isDefaultAxis:a,seriesXAxisId:n[o].xAxisId,seriesYAxisId:n[o].yAxisId}),[l,u]=s?.reduce((t,n,r)=>c&&(!c(Jp(n[0],e),r)||!c(Jp(n[1],e),r))?t:[Math.min(...n,t[0]),Math.max(...n,t[1])],[1/0,-1/0])??[1/0,-1/0];return[Math.min(l,t[0]),Math.max(u,t[1])]},[1/0,-1/0])},Zp=e=>Object.keys(e.series).some(t=>e.series[t].layout===`horizontal`)?Xp(`x`)(e):Yp(e),Qp=e=>Object.keys(e.series).some(t=>e.series[t].layout===`horizontal`)?Yp(e):Xp(`y`)(e);function Q(e){return function(){return e}}var $p=Math.abs,em=Math.atan2,tm=Math.cos,nm=Math.max,rm=Math.min,im=Math.sin,am=Math.sqrt,om=Math.PI,sm=om/2,cm=2*om;function lm(e){return e>1?0:e<-1?om:Math.acos(e)}function um(e){return e>=1?sm:e<=-1?-sm:Math.asin(e)}var dm=Math.PI,fm=2*dm,pm=1e-6,mm=fm-pm;function hm(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function gm(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return hm;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var _m=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?hm:gm(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>pm)if(!(Math.abs(u*s-c*l)>pm)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((dm-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>pm&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>pm||Math.abs(this._y1-l)>pm)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%fm+fm),d>mm?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>pm&&this._append`A${n},${n},0,${+(d>=dm)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function vm(){return new _m}vm.prototype=_m.prototype;function ym(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new _m(t)}function bm(e){return e.innerRadius}function xm(e){return e.outerRadius}function Sm(e){return e.startAngle}function Cm(e){return e.endAngle}function wm(e){return e&&e.padAngle}function Tm(e,t,n,r,i,a,o,s){var c=n-e,l=r-t,u=o-i,d=s-a,f=d*c-u*l;if(!(f*f<1e-12))return f=(u*(t-a)-d*(e-i))/f,[e+f*c,t+f*l]}function Em(e,t,n,r,i,a,o){var s=e-n,c=t-r,l=(o?a:-a)/am(s*s+c*c),u=l*c,d=-l*s,f=e+u,p=t+d,m=n+u,h=r+d,g=(f+m)/2,_=(p+h)/2,v=m-f,y=h-p,b=v*v+y*y,x=i-a,S=f*h-m*p,C=(y<0?-1:1)*am(nm(0,x*x*b-S*S)),w=(S*y-v*C)/b,T=(-S*v-y*C)/b,E=(S*y+v*C)/b,D=(-S*v+y*C)/b,O=w-g,k=T-_,ee=E-g,A=D-_;return O*O+k*k>ee*ee+A*A&&(w=E,T=D),{cx:w,cy:T,x01:-u,y01:-d,x11:w*(i/x-1),y11:T*(i/x-1)}}function Dm(){var e=bm,t=xm,n=Q(0),r=null,i=Sm,a=Cm,o=wm,s=null,c=ym(l);function l(){var l,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),p=i.apply(this,arguments)-sm,m=a.apply(this,arguments)-sm,h=$p(m-p),g=m>p;if(s||=l=c(),f<d&&(u=f,f=d,d=u),!(f>1e-12))s.moveTo(0,0);else if(h>cm-1e-12)s.moveTo(f*tm(p),f*im(p)),s.arc(0,0,f,p,m,!g),d>1e-12&&(s.moveTo(d*tm(m),d*im(m)),s.arc(0,0,d,m,p,g));else{var _=p,v=m,y=p,b=m,x=h,S=h,C=o.apply(this,arguments)/2,w=C>1e-12&&(r?+r.apply(this,arguments):am(d*d+f*f)),T=rm($p(f-d)/2,+n.apply(this,arguments)),E=T,D=T,O,k;if(w>1e-12){var ee=um(w/d*im(C)),A=um(w/f*im(C));(x-=ee*2)>1e-12?(ee*=g?1:-1,y+=ee,b-=ee):(x=0,y=b=(p+m)/2),(S-=A*2)>1e-12?(A*=g?1:-1,_+=A,v-=A):(S=0,_=v=(p+m)/2)}var j=f*tm(_),M=f*im(_),te=d*tm(b),N=d*im(b);if(T>1e-12){var ne=f*tm(v),P=f*im(v),re=d*tm(y),F=d*im(y),I;if(h<om)if(I=Tm(j,M,re,F,ne,P,te,N)){var ie=j-I[0],ae=M-I[1],oe=ne-I[0],se=P-I[1],ce=1/im(lm((ie*oe+ae*se)/(am(ie*ie+ae*ae)*am(oe*oe+se*se)))/2),le=am(I[0]*I[0]+I[1]*I[1]);E=rm(T,(d-le)/(ce-1)),D=rm(T,(f-le)/(ce+1))}else E=D=0}S>1e-12?D>1e-12?(O=Em(re,F,j,M,f,D,g),k=Em(ne,P,te,N,f,D,g),s.moveTo(O.cx+O.x01,O.cy+O.y01),D<T?s.arc(O.cx,O.cy,D,em(O.y01,O.x01),em(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,D,em(O.y01,O.x01),em(O.y11,O.x11),!g),s.arc(0,0,f,em(O.cy+O.y11,O.cx+O.x11),em(k.cy+k.y11,k.cx+k.x11),!g),s.arc(k.cx,k.cy,D,em(k.y11,k.x11),em(k.y01,k.x01),!g))):(s.moveTo(j,M),s.arc(0,0,f,_,v,!g)):s.moveTo(j,M),!(d>1e-12)||!(x>1e-12)?s.lineTo(te,N):E>1e-12?(O=Em(te,N,ne,P,d,-E,g),k=Em(j,M,re,F,d,-E,g),s.lineTo(O.cx+O.x01,O.cy+O.y01),E<T?s.arc(O.cx,O.cy,E,em(O.y01,O.x01),em(k.y01,k.x01),!g):(s.arc(O.cx,O.cy,E,em(O.y01,O.x01),em(O.y11,O.x11),!g),s.arc(0,0,d,em(O.cy+O.y11,O.cx+O.x11),em(k.cy+k.y11,k.cx+k.x11),g),s.arc(k.cx,k.cy,E,em(k.y11,k.x11),em(k.y01,k.x01),!g))):s.arc(0,0,d,b,y,g)}if(s.closePath(),l)return s=null,l+``||null}return l.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-om/2;return[tm(r)*n,im(r)*n]},l.innerRadius=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),l):e},l.outerRadius=function(e){return arguments.length?(t=typeof e==`function`?e:Q(+e),l):t},l.cornerRadius=function(e){return arguments.length?(n=typeof e==`function`?e:Q(+e),l):n},l.padRadius=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:Q(+e),l):r},l.startAngle=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),l):i},l.endAngle=function(e){return arguments.length?(a=typeof e==`function`?e:Q(+e),l):a},l.padAngle=function(e){return arguments.length?(o=typeof e==`function`?e:Q(+e),l):o},l.context=function(e){return arguments.length?(s=e??null,l):s},l}Array.prototype.slice;function Om(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function km(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Am(e){return e}function jm(){var e=Am,t=km,n=null,r=Q(0),i=Q(cm),a=Q(0);function o(o){var s,c=(o=Om(o)).length,l,u,d=0,f=Array(c),p=Array(c),m=+r.apply(this,arguments),h=Math.min(cm,Math.max(-cm,i.apply(this,arguments)-m)),g,_=Math.min(Math.abs(h)/c,a.apply(this,arguments)),v=_*(h<0?-1:1),y;for(s=0;s<c;++s)(y=p[f[s]=s]=+e(o[s],s,o))>0&&(d+=y);for(t==null?n!=null&&f.sort(function(e,t){return n(o[e],o[t])}):f.sort(function(e,n){return t(p[e],p[n])}),s=0,u=d?(h-c*v)/d:0;s<c;++s,m=g)l=f[s],y=p[l],g=m+(y>0?y*u:0)+v,p[l]={data:o[l],index:s,value:y,startAngle:m,endAngle:g,padAngle:_};return p}return o.value=function(t){return arguments.length?(e=typeof t==`function`?t:Q(+t),o):e},o.sortValues=function(e){return arguments.length?(t=e,n=null,o):t},o.sort=function(e){return arguments.length?(n=e,t=null,o):n},o.startAngle=function(e){return arguments.length?(r=typeof e==`function`?e:Q(+e),o):r},o.endAngle=function(e){return arguments.length?(i=typeof e==`function`?e:Q(+e),o):i},o.padAngle=function(e){return arguments.length?(a=typeof e==`function`?e:Q(+e),o):a},o}function Mm(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Nm(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Pm(e,t){return e[t]}function Fm(e){let t=[];return t.key=e,t}function Im(){var e=Q([]),t=Nm,n=Mm,r=Pm;function i(i){var a=Array.from(e.apply(this,arguments),Fm),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=Om(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:Q(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:Q(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?Nm:typeof e==`function`?e:Q(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??Mm,i):n},i}function Lm(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Mm(e,t)}}function Rm(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}Mm(e,t)}}function zm(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,Mm(e,t)}}function Bm(e){var t=e.map(Vm);return Nm(e).sort(function(e,n){return t[e]-t[n]})}function Vm(e){for(var t=-1,n=0,r=e.length,i,a=-1/0;++t<r;)(i=+e[t][1])>a&&(a=i,n=t);return n}function Hm(e){var t=e.map(Um);return Nm(e).sort(function(e,n){return t[e]-t[n]})}function Um(e){for(var t=0,n=-1,r=e.length,i;++n<r;)(i=+e[n][1])&&(t+=i);return t}function Wm(e){return Hm(e).reverse()}function Gm(e){var t=e.length,n,r,i=e.map(Um),a=Bm(e),o=0,s=0,c=[],l=[];for(n=0;n<t;++n)r=a[n],o<s?(o+=i[r],c.push(r)):(s+=i[r],l.push(r));return l.reverse().concat(c)}function Km(e){return Nm(e).reverse()}function qm(e,t){if(e.length===0)return;let n=e.length,r=t,i=e[r[0]].length;for(let t=0;t<i;t+=1){let i=0,a=0;for(let o=0;o<n;o+=1){let n=e[r[o]],s=n[t],c=s[1]-s[0];c>0?(s[0]=i,i+=c,s[1]=i):c<0?(s[1]=a,a+=c,s[0]=a):s.data[n.key]>0?(s[0]=i,s[1]=i):s.data[n.key]<0?(s[1]=a,s[0]=a):(s[0]=0,s[1]=0)}}}var Jm={appearance:Bm,ascending:Hm,descending:Wm,insideOut:Gm,none:Nm,reverse:Km},Ym={expand:Lm,diverging:qm,none:Mm,silhouette:Rm,wiggle:zm},Xm=e=>{let{series:t,seriesOrder:n,defaultStrategy:r}=e,i=[],a={};return n.forEach(e=>{let{stack:n,stackOrder:o,stackOffset:s}=t[e];n===void 0?i.push({ids:[e],stackingOrder:Jm.none,stackingOffset:Ym.none}):a[n]===void 0?(a[n]=i.length,i.push({ids:[e],stackingOrder:Jm[o??r?.stackOrder??`none`],stackingOffset:Ym[s??r?.stackOffset??`diverging`]})):(i[a[n]].ids.push(e),o!==void 0&&(i[a[n]].stackingOrder=Jm[o]),s!==void 0&&(i[a[n]].stackingOffset=Ym[s]))}),i},Zm=e=>e==null?``:e.toLocaleString(),Qm=(e,t,n)=>{let{seriesOrder:r,series:i}=e,a=Xm(e),o=t??[];r.forEach(e=>{let n=i[e].data;if(n!==void 0)n.forEach((t,n)=>{o.length<=n?o.push({[e]:t}):o[n][e]=t});else if(t===void 0)throw Error([`MUI X Charts: bar series with id='${e}' has no data.`,`Either provide a data property to the series or use the dataset prop.`].join(`
37
+ `));if(process.env.NODE_ENV!==`production`&&!n&&t){let n=i[e].dataKey;if(!n)throw Error([`MUI X Charts: bar series with id='${e}' has no data and no dataKey.`,`You must provide a dataKey when using the dataset prop.`].join(`
38
+ `));t.forEach((e,t)=>{let r=e[n];r!=null&&typeof r!=`number`&&Io([`MUI X Charts: your dataset key "${n}" is used for plotting bars, but the dataset contains the non-null non-numerical element "${r}" at index ${t}.`,`Bar plots only support numeric and null values.`].join(`
39
+ `))})}});let s={};return a.forEach(e=>{let{ids:r,stackingOffset:a,stackingOrder:c}=e,l=r.map(e=>{let t=i[e].dataKey;return i[e].data===void 0&&t!==void 0?t:e}),u=Im().keys(l).value((e,t)=>e[t]??0).order(c).offset(a)(o),d=u.map(e=>e.index),f=Im().keys(l).value((e,t)=>{let i=r[l.indexOf(t)];return n?.({type:`bar`,seriesId:i})?e[t]??0:0}).order(()=>d).offset(a)(o);r.forEach((e,r)=>{let a=i[e].dataKey,o=a?t.map(e=>{let t=e[a];return typeof t==`number`?t:null}):i[e].data,c=!n?.({type:`bar`,seriesId:e});s[e]=y({layout:`vertical`,labelMarkType:`square`,minBarSize:0,valueFormatter:i[e].valueFormatter??Zm},i[e],{data:o,hidden:c,stackedData:u[r],visibleStackedData:f[r]})})}),{seriesOrder:r,stackingGroups:a,series:s}};function $m(e,t){return typeof e==`function`?e(t):e}var eh=e=>{let{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>{let r=$m(n[t].label,`legend`);return r===void 0||e.push({type:`bar`,markType:n[t].labelMarkType,id:t,seriesId:t,color:n[t].color,label:r}),e},[])};function th(e){return e.colorGetter?e.colorGetter:()=>e.color}var nh=(e,t,n)=>{let r=e.layout===`vertical`,i=r?t?.colorScale:n?.colorScale,a=r?n?.colorScale:t?.colorScale,o=r?t?.data:n?.data,s=th(e);return a?t=>{if(t===void 0)return e.color;let n=e.data[t],r=n===null?s({value:n,dataIndex:t}):a(n);return r===null?s({value:n,dataIndex:t}):r}:i&&o?t=>{if(t===void 0)return e.color;let n=o[t],r=n===null?s({value:n,dataIndex:t}):i(n);return r===null?s({value:n,dataIndex:t}):r}:t=>{if(t===void 0)return e.color;let n=e.data[t];return s({value:n,dataIndex:t})}};function rh(e,t){return Object.keys(e).filter(e=>t.has(e)).flatMap(t=>{let n=e[t];return n.seriesOrder.filter(e=>n.series[e].data.length>0&&n.series[e].data.some(e=>e!=null)).map(e=>({type:t,seriesId:e}))})}function ih(e,t,n,r){let i=rh(e,t);if(i.length===0)return null;let a=n!==void 0&&r!==void 0?i.findIndex(e=>e.type===n&&e.seriesId===r):-1;return a<=0?i[i.length-1]:i[(a-1+i.length)%i.length]}function ah(e,t){return Object.keys(e).filter(e=>t.has(e)).flatMap(t=>{let n=e[t];return n.seriesOrder.filter(e=>n.series[e].data.length>0&&n.series[e].data.some(e=>e!=null)).map(e=>n.series[e].data.length)}).reduce((e,t)=>Math.max(e,t),0)}function oh(e,t,n,r){let i=rh(e,t);return i.length===0?null:i[((n!==void 0&&r!==void 0?i.findIndex(e=>e.type===n&&e.seriesId===r):-1)+1)%i.length]}function sh(e,t,n){if(t===`sankey`)return!1;let r=e[t]?.series[n]?.data;return r!=null&&r.length>0}function ch(e,t=!1){return function(n,r){let i=Ya(r),a=n?.seriesId,o=n?.type;if(!o||a==null||!sh(i,o,a)){let t=oh(i,e,o,a);if(t===null)return null;o=t.type,a=t.seriesId}let s=ah(i,e),c=n?.dataIndex==null?0:n.dataIndex+1;return t?c%=s:c=Math.min(s-1,c),{type:o,seriesId:a,dataIndex:c}}}function lh(e,t=!1){return function(n,r){let i=Ya(r),a=n?.seriesId,o=n?.type;if(!o||a==null||!sh(i,o,a)){let t=ih(i,e,o,a);if(t===null)return null;o=t.type,a=t.seriesId}let s=ah(i,e),c=n?.dataIndex==null?s-1:n.dataIndex-1;return c=t?(s+c)%s:Math.max(0,c),{type:o,seriesId:a,dataIndex:c}}}function uh(e){return function(t,n){let r=Ya(n),i=t?.seriesId,a=t?.type,o=oh(r,e,a,i);if(o===null)return null;a=o.type,i=o.seriesId;let s=t?.dataIndex==null?0:t.dataIndex;return{type:a,seriesId:i,dataIndex:s}}}function dh(e){return function(t,n){let r=Ya(n),i=t?.seriesId,a=t?.type,o=ih(r,e,a,i);if(o===null)return null;a=o.type,i=o.seriesId;let s=r[a].series[i].data,c=t?.dataIndex==null?s.length-1:t.dataIndex;return{type:a,seriesId:i,dataIndex:c}}}var fh=new Set([`bar`,`line`,`scatter`]),ph=e=>{switch(e.key){case`ArrowRight`:return ch(fh);case`ArrowLeft`:return lh(fh);case`ArrowDown`:return dh(fh);case`ArrowUp`:return uh(fh);default:return null}},mh=e=>{let{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;let i=$m(t.label,`tooltip`),a=t.data[r.dataIndex];if(a==null)return null;let o=t.valueFormatter(a,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:a,formattedValue:o,markType:t.labelMarkType}},hh=e=>Object.values(e).map(e=>e.layout===`horizontal`?{direction:`y`,axisId:e.yAxisId}:{direction:`x`,axisId:e.xAxisId});function gh(e,t,n){if(n===0)return{barWidth:e/t,offset:0};let r=e/(t+(t-1)*n);return{barWidth:r,offset:n*r}}function _h(e,t,n){let r=e&&t>0||!e&&t<0;return n?!r:r}function vh(e){let{verticalLayout:t,xAxisConfig:n,yAxisConfig:r,series:i,dataIndex:a,numberOfGroups:o,groupIndex:s}=e,c=t?n:r,l=(t?r.reverse:n.reverse)??!1,{barWidth:u,offset:d}=gh(c.scale.bandwidth(),o,c.barGapRatio),f=s*(u+d),p=n.scale,m=r.scale,h=c.data[a],g=i.data[a];if(g==null)return null;let[_,v]=qp(i.visibleStackedData[a].map(e=>t?m(e):p(e))).map(e=>Math.round(e)),y=0;g!==0&&(i.hidden||(y=Math.max(i.minBarSize,v-_)));let b=_h(t,g,l),x=0;return x=b?v-y:_,{x:t?p(h)+f:x,y:t?x:m(h)+f,height:t?y:u,width:t?u:y}}var yh=e=>{let{series:t,identifier:n,axesConfig:r,placement:i}=e;if(!n||n.dataIndex===void 0)return null;let a=t.bar?.series[n.seriesId];if(t.bar==null||a==null||r.x===void 0||r.y===void 0)return null;let o=vh({verticalLayout:a.layout===`vertical`,xAxisConfig:r.x,yAxisConfig:r.y,series:a,dataIndex:n.dataIndex,numberOfGroups:t.bar.stackingGroups.length,groupIndex:t.bar.stackingGroups.findIndex(e=>e.ids.includes(a.id))});if(o==null)return null;let{x:s,y:c,width:l,height:u}=o;switch(i){case`right`:return{x:s+l,y:c+u/2};case`bottom`:return{x:s+l/2,y:c+u};case`left`:return{x:s,y:c+u/2};default:return{x:s+l/2,y:c}}};function bh(e,t,n){return y({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]})}var xh=e=>`Type(${e})`,Sh=e=>`Series(${e})`,Ch=e=>e===void 0?``:`Index(${e})`,wh=e=>`${xh(e.type)}${Sh(e.seriesId)}${Ch(e.dataIndex)}`,Th={seriesProcessor:Qm,colorProcessor:nh,legendGetter:eh,tooltipGetter:mh,tooltipItemPositionGetter:yh,axisTooltipGetter:hh,xExtremumGetter:Zp,yExtremumGetter:Qp,getSeriesWithDefaultValues:bh,keyboardFocusHandler:ph,identifierSerializer:wh},Eh=e=>{let{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e,a=1/0,o=-1/0;for(let e in t){if(!Object.hasOwn(t,e))continue;let s=t[e].xAxisId;if(!(s===n.id||s===void 0&&r))continue;let c=i?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[e].xAxisId,seriesYAxisId:t[e].yAxisId}),l=t[e].data??[];for(let e=0;e<l.length;e+=1){let t=l[e];c&&!c(t,e)||t.x!==null&&(t.x<a&&(a=t.x),t.x>o&&(o=t.x))}}return[a,o]},Dh=e=>{let{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e,a=1/0,o=-1/0;for(let e in t){if(!Object.hasOwn(t,e))continue;let s=t[e].yAxisId;if(!(s===n.id||s===void 0&&r))continue;let c=i?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[e].xAxisId,seriesYAxisId:t[e].yAxisId}),l=t[e].data??[];for(let e=0;e<l.length;e+=1){let t=l[e];c&&!c(t,e)||t.y!==null&&(t.y<a&&(a=t.y),t.y>o&&(o=t.y))}}return[a,o]},Oh=({series:e,seriesOrder:t},n,r)=>({series:Object.fromEntries(Object.entries(e).map(([e,t])=>{let i=t?.datasetKeys,a=[`x`,`y`].filter(e=>typeof i?.[e]!=`string`);if(t?.datasetKeys&&a.length>0)throw Error([`MUI X Charts: scatter series with id='${e}' has incomplete datasetKeys.`,`Properties ${a.map(e=>`"${e}"`).join(`, `)} are missing.`].join(`
40
+ `));let o=i?n?.map(e=>({x:e[i.x]??null,y:e[i.y]??null,z:i.z&&e[i.z],id:i.id&&e[i.id]}))??[]:t.data??[];return[e,y({labelMarkType:`circle`,markerSize:4},t,{preview:y({markerSize:1},t?.preview),data:o,hidden:!r?.({type:`scatter`,seriesId:e}),valueFormatter:t.valueFormatter??(e=>e&&`(${e.x}, ${e.y})`)})]})),seriesOrder:t}),kh=(e,t,n,r)=>{let i=r?.colorScale,a=n?.colorScale,o=t?.colorScale,s=th(e);return i?t=>{if(t===void 0)return e.color;if(r?.data?.[t]!==void 0){let e=i(r?.data?.[t]);if(e!==null)return e}let n=e.data[t],a=n===null?s({value:n,dataIndex:t}):i(n.z);return a===null?s({value:n,dataIndex:t}):a}:a?t=>{if(t===void 0)return e.color;let n=e.data[t],r=n===null?s({value:n,dataIndex:t}):a(n.y);return r===null?s({value:n,dataIndex:t}):r}:o?t=>{if(t===void 0)return e.color;let n=e.data[t],r=n===null?s({value:n,dataIndex:t}):o(n.x);return r===null?s({value:n,dataIndex:t}):r}:t=>{if(t===void 0)return e.color;let n=e.data[t];return s({value:n,dataIndex:t})}},Ah=e=>{let{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>{let r=$m(n[t].label,`legend`);return r===void 0||e.push({type:`scatter`,markType:n[t].labelMarkType,id:t,seriesId:t,color:n[t].color,label:r}),e},[])},jh=e=>{let{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;let i=$m(t.label,`tooltip`),a=t.data[r.dataIndex],o=t.valueFormatter(a,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:a,formattedValue:o,markType:t.labelMarkType}},Mh=(e,t,n)=>y({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),Nh=e=>{let{series:t,identifier:n,axesConfig:r}=e;if(!n||n.dataIndex===void 0)return null;let i=t.scatter?.series[n.seriesId];if(i==null||r.x===void 0||r.y===void 0)return null;let a=i.data?.[n.dataIndex].x,o=i.data?.[n.dataIndex].y;return a==null||o==null?null:{x:r.x.scale(a),y:r.y.scale(o)}},Ph=new Set([`bar`,`line`,`scatter`]),Fh={seriesProcessor:Oh,colorProcessor:kh,legendGetter:Ah,tooltipGetter:jh,tooltipItemPositionGetter:Nh,xExtremumGetter:Eh,yExtremumGetter:Dh,getSeriesWithDefaultValues:Mh,keyboardFocusHandler:e=>{switch(e.key){case`ArrowRight`:return ch(Ph);case`ArrowLeft`:return lh(Ph);case`ArrowDown`:return dh(Ph);case`ArrowUp`:return uh(Ph);default:return null}},identifierSerializer:wh},Ih=e=>{let{axis:t}=e;return qp(t.data??[])};function Lh(e,t,n,r){return n.reduce((n,i,a)=>{if(t[a]===null)return n;let[o,s]=e(i);return r&&(!r({y:o,x:null},a)||!r({y:s,x:null},a))?n:[Math.min(o,s,n[0]),Math.max(o,s,n[1])]},[1/0,-1/0])}var Rh=e=>{let{series:t,axis:n,isDefaultAxis:r,getFilters:i}=e;return Object.keys(t).filter(e=>{let i=t[e].yAxisId;return i===n.id||r&&i===void 0}).reduce((e,a)=>{let{area:o,stackedData:s,data:c}=t[a],l=o!==void 0,u=i?.({currentAxisId:n.id,isDefaultAxis:r,seriesXAxisId:t[a].xAxisId,seriesYAxisId:t[a].yAxisId}),[d,f]=Lh(l&&n.scaleType!==`log`&&typeof t[a].baseline!=`string`?e=>e:e=>[e[1],e[1]],c,s,u);return[Math.min(d,e[0]),Math.max(f,e[1])]},[1/0,-1/0])},zh=e=>e==null?``:e.toLocaleString(),Bh=(e,t,n)=>{let{seriesOrder:r,series:i}=e,a=Xm(y({},e,{defaultStrategy:{stackOffset:`none`}})),o=t??[];r.forEach(e=>{let n=i[e].data;if(n!==void 0)n.forEach((t,n)=>{o.length<=n?o.push({[e]:t}):o[n][e]=t});else if(t===void 0&&process.env.NODE_ENV!==`production`)throw Error([`MUI X Charts: line series with id='${e}' has no data.`,`Either provide a data property to the series or use the dataset prop.`].join(`
41
+ `));if(process.env.NODE_ENV!==`production`&&!n&&t){let n=i[e].dataKey;if(!n)throw Error([`MUI X Charts: line series with id='${e}' has no data and no dataKey.`,`You must provide a dataKey when using the dataset prop.`].join(`
42
+ `));t.forEach((e,t)=>{let r=e[n];r!=null&&typeof r!=`number`&&Io([`MUI X Charts: your dataset key "${n}" is used for plotting lines, but the dataset contains the non-null non-numerical element "${r}" at index ${t}.`,`Line plots only support numeric and null values.`].join(`
43
+ `))})}});let s={};return a.forEach(e=>{let{ids:r,stackingOffset:a,stackingOrder:c}=e,l=r.map(e=>{let t=i[e].dataKey;return i[e].data===void 0&&t!==void 0?t:e}),u=Im().keys(l).value((e,t)=>e[t]??0).order(c).offset(a)(o),d=u.map(e=>e.index),f=Im().keys(l).value((e,t)=>{let i=r[l.indexOf(t)];return n?.({type:`line`,seriesId:i})?e[t]??0:0}).order(()=>d).offset(a)(o);r.forEach((e,r)=>{let a=i[e].dataKey,o=a?t.map(e=>{let t=e[a];return typeof t==`number`?t:null}):i[e].data,c=!n?.({type:`line`,seriesId:e});s[e]=y({labelMarkType:`line`},i[e],{data:o,valueFormatter:i[e].valueFormatter??zh,hidden:c,stackedData:u[r],visibleStackedData:f[r]})})}),{seriesOrder:r,stackingGroups:a,series:s}},Vh=(e,t,n)=>{let r=n?.colorScale,i=t?.colorScale,a=th(e);return r?t=>{if(t===void 0)return e.color;let n=e.data[t],i=n===null?a({value:n,dataIndex:t}):r(n);return i===null?a({value:n,dataIndex:t}):i}:i?n=>{if(n===void 0)return e.color;let r=t.data?.[n],o=r===null?a({value:r,dataIndex:n}):i(r);return o===null?a({value:r,dataIndex:n}):o}:t=>{if(t===void 0)return e.color;let n=e.data[t];return a({value:n,dataIndex:t})}},Hh=e=>{let{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>{let r=$m(n[t].label,`legend`);return r===void 0||e.push({type:`line`,markType:n[t].labelMarkType,id:t,seriesId:t,color:n[t].color,label:r}),e},[])},Uh=e=>{let{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;let i=$m(t.label,`tooltip`),a=t.data[r.dataIndex],o=t.valueFormatter(a,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:i,value:a,formattedValue:o,markType:t.labelMarkType}},Wh=e=>Object.values(e).map(e=>({direction:`x`,axisId:e.xAxisId})),Gh=(e,t,n)=>y({},e,{id:e.id??`auto-generated-id-${t}`,color:e.color??n[t%n.length]}),Kh=e=>{let{series:t,identifier:n,axesConfig:r}=e;if(!n||n.dataIndex===void 0)return null;let i=t.line?.series[n.seriesId];if(i==null||r.x===void 0||r.y===void 0)return null;let a=r.x.data?.[n.dataIndex],o=i.data[n.dataIndex]==null?null:i.visibleStackedData[n.dataIndex][1];return a==null||o==null?null:{x:r.x.scale(a),y:r.y.scale(o)}},qh=new Set([`bar`,`line`,`scatter`]),Jh={colorProcessor:Vh,seriesProcessor:Bh,legendGetter:Hh,tooltipGetter:Uh,tooltipItemPositionGetter:Kh,axisTooltipGetter:Wh,xExtremumGetter:Ih,yExtremumGetter:Rh,getSeriesWithDefaultValues:Gh,keyboardFocusHandler:e=>{switch(e.key){case`ArrowRight`:return ch(qh);case`ArrowLeft`:return lh(qh);case`ArrowDown`:return dh(qh);case`ArrowUp`:return uh(qh);default:return null}},identifierSerializer:wh},Yh=(e=`none`)=>{if(typeof e==`function`)return e;switch(e){case`none`:return null;case`desc`:return(e,t)=>t-e;case`asc`:return(e,t)=>e-t;default:return null}},Xh=(e,t,n)=>{let{seriesOrder:r,series:i}=e,a={};return r.forEach(e=>{let t=i[e].data.filter((t,r)=>n?.({type:`pie`,seriesId:e,dataIndex:r})),r=jm().startAngle(Bp(i[e].startAngle??0)).endAngle(Bp(i[e].endAngle??360)).padAngle(Bp(i[e].paddingAngle??0)).sortValues(Yh(i[e].sortingValues??`none`))(t.map(e=>e.value)),o=0;a[e]=y({labelMarkType:`circle`,valueFormatter:e=>e.value.toLocaleString()},i[e],{data:i[e].data.map((t,a)=>{let s=t.id??`auto-generated-pie-id-${e}-${a}`,c=!n?.({type:`pie`,seriesId:e,dataIndex:a}),l;if(c){let n=o>0?r[o-1].endAngle:Bp(i[e].startAngle??0);l={startAngle:n,endAngle:n,padAngle:0,value:t.value,index:a}}else l=r[o],o+=1;let u=y({},t,{id:s,hidden:c},l);return y({labelMarkType:`circle`},u,{formattedValue:i[e].valueFormatter?.(y({},u,{label:$m(u.label,`arc`)}),{dataIndex:a})??u.value.toLocaleString()})})})}),{seriesOrder:r,series:a}},Zh=e=>t=>e.data[t].color,Qh=e=>{let{seriesOrder:t,series:n}=e;return t.reduce((e,t)=>(n[t].data.forEach((r,i)=>{let a=$m(r.label,`legend`);if(a===void 0)return;let o=r.id??i;e.push({type:`pie`,markType:r.labelMarkType??n[t].labelMarkType,seriesId:t,id:o,itemId:o,dataIndex:i,color:r.color,label:a})}),e),[])},$h=e=>{let{series:t,getColor:n,identifier:r}=e;if(!r||r.dataIndex===void 0)return null;let i=t.data[r.dataIndex];if(i==null)return null;let a=$m(i.label,`tooltip`),o=y({},i,{label:a}),s=t.valueFormatter(o,{dataIndex:r.dataIndex});return{identifier:r,color:n(r.dataIndex),label:a,value:o,formattedValue:s,markType:i.labelMarkType??t.labelMarkType}};function eg(e,t){if(typeof e==`number`)return e;if(e===`100%`)return t;if(e.endsWith(`%`)){let n=Number.parseFloat(e.slice(0,e.length-1));if(!Number.isNaN(n))return n*t/100}if(e.endsWith(`px`)){let t=Number.parseFloat(e.slice(0,e.length-2));if(!Number.isNaN(t))return t}throw Error(`MUI X Charts: Received an unknown value "${e}". It should be a number, or a string with a percentage value.`)}function tg(e,t){let{height:n,width:r}=t,{cx:i,cy:a}=e,o=Math.min(r,n)/2;return{cx:eg(i??`50%`,r),cy:eg(a??`50%`,n),availableRadius:o}}var ng=(e,t)=>{let n={};for(let r of e.seriesOrder){let{innerRadius:i,outerRadius:a,arcLabelRadius:o,cx:s,cy:c}=e.series[r],{cx:l,cy:u,availableRadius:d}=tg({cx:s,cy:c},{width:t.width,height:t.height}),f=eg(a??d,d),p=eg(i??0,d);n[r]={radius:{available:d,inner:p,outer:f,label:o===void 0?(p+f)/2:eg(o,d)},center:{x:t.left+l,y:t.top+u}}}return n},rg=(e,t,n)=>y({},e,{id:e.id??`auto-generated-id-${t}`,data:e.data.map((e,t)=>y({},e,{color:e.color??n[t%n.length]}))}),ig=e=>{let{series:t,identifier:n,placement:r,seriesLayout:i}=e;if(!n||n.dataIndex===void 0)return null;let a=t.pie?.series[n.seriesId],o=i.pie?.[n.seriesId];if(a==null||o==null)return null;let{center:s,radius:c}=o,{data:l}=a,u=l[n.dataIndex];if(!u)return null;let d=[[c.inner,u.startAngle],[c.inner,u.endAngle],[c.outer,u.startAngle],[c.outer,u.endAngle]].map(([e,t])=>({x:s.x+e*Math.sin(t),y:s.y-e*Math.cos(t)})),[f,p]=qp(d.map(e=>e.x)),[m,h]=qp(d.map(e=>e.y));switch(r){case`bottom`:return{x:(p+f)/2,y:h};case`left`:return{x:f,y:(h+m)/2};case`right`:return{x:p,y:(h+m)/2};default:return{x:(p+f)/2,y:m}}},ag=new Set([`pie`]),og={bar:Th,scatter:Fh,line:Jh,pie:{colorProcessor:Zh,seriesProcessor:Xh,seriesLayout:ng,legendGetter:Qh,tooltipGetter:$h,tooltipItemPositionGetter:ig,getSeriesWithDefaultValues:rg,keyboardFocusHandler:e=>{switch(e.key){case`ArrowRight`:return ch(ag);case`ArrowLeft`:return lh(ag);case`ArrowDown`:return dh(ag);case`ArrowUp`:return uh(ag);default:return null}},identifierSerializer:wh}},sg=[Wp,zp,hp,jp,Kp];function cg(e){let{children:t,plugins:n=sg,pluginParams:r={},seriesConfig:i=og}=e,{contextValue:a}=jo(n,r,i);return(0,g.jsx)(Po.Provider,{value:a,children:t})}var lg=()=>{let e=n.useContext(Po);if(e==null)throw Error([`MUI X Charts: Could not find the Chart context.`,`It looks like you rendered your component outside of a ChartDataProvider.`,`This can also happen if you are bundling multiple versions of the library.`].join(`
44
+ `));return e};function ug(){let e=lg();if(!e)throw Error([`MUI X Charts: Could not find the charts context.`,`It looks like you rendered your component outside of a ChartContainer parent component.`].join(`
45
+ `));return e.store}function dg(){return ug().use(va)}function fg(){return ug().use(ja)}function pg(){let{axis:e,axisIds:t}=ug().use(lp);return{xAxis:e,xAxisIds:t}}function mg(){let{axis:e,axisIds:t}=ug().use(up);return{yAxis:e,yAxisIds:t}}function hg(){let{axis:e,axisIds:t}=ug().use(Gp)??{axis:{},axisIds:[]};return{zAxis:e,zAxisIds:t}}function gg(){let e=lg();if(!e)throw Error([`MUI X Charts: Could not find the svg ref context.`,`It looks like you rendered your component outside of a ChartContainer parent component.`].join(`
46
+ `));return e.svgRef}function _g(){let e=fg();return n.useCallback(t=>`${e}-gradient-${t}`,[e])}function vg(){let e=fg();return n.useCallback(t=>`${e}-gradient-${t}-object-bound`,[e])}var yg=e.x(((e,t)=>{var n=4,r=.001,i=1e-7,a=10,o=11,s=1/(o-1),c=typeof Float32Array==`function`;function l(e,t){return 1-3*t+3*e}function u(e,t){return 3*t-6*e}function d(e){return 3*e}function f(e,t,n){return((l(t,n)*e+u(t,n))*e+d(t))*e}function p(e,t,n){return 3*l(t,n)*e*e+2*u(t,n)*e+d(t)}function m(e,t,n,r,o){var s,c,l=0;do c=t+(n-t)/2,s=f(c,r,o)-e,s>0?n=c:t=c;while(Math.abs(s)>i&&++l<a);return c}function h(e,t,r,i){for(var a=0;a<n;++a){var o=p(t,r,i);if(o===0)return t;var s=f(t,r,i)-e;t-=s/o}return t}function g(e){return e}t.exports=function(e,t,n,i){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw Error(`bezier x values must be in [0, 1] range`);if(e===t&&n===i)return g;for(var a=c?new Float32Array(o):Array(o),l=0;l<o;++l)a[l]=f(l*s,e,n);function u(t){for(var i=0,c=1,l=o-1;c!==l&&a[c]<=t;++c)i+=s;--c;var u=(t-a[c])/(a[c+1]-a[c]),d=i+u*s,f=p(d,e,n);return f>=r?h(t,d,e,n):f===0?d:m(t,i,i+s,e,n)}return function(e){return e===0?0:e===1?1:f(u(e),t,i)}}})),bg=(0,e.S(yg()).default)(.66,0,.34,1),xg=0,Sg=0,Cg=0,wg=1e3,Tg,Eg,Dg=0,Og=0,kg=0,Ag=typeof performance==`object`&&performance.now?performance:Date,jg=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mg(){return Og||=(jg(Ng),Ag.now()+kg)}function Ng(){Og=0}function Pg(){this._call=this._time=this._next=null}Pg.prototype=Fg.prototype={constructor:Pg,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Mg():+n)+(t==null?0:+t),!this._next&&Eg!==this&&(Eg?Eg._next=this:Tg=this,Eg=this),this._call=e,this._time=n,Bg()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bg())}};function Fg(e,t,n){var r=new Pg;return r.restart(e,t,n),r}function Ig(){Mg(),++xg;for(var e=Tg,t;e;)(t=Og-e._time)>=0&&e._call.call(void 0,t),e=e._next;--xg}function Lg(){Og=(Dg=Ag.now())+kg,xg=Sg=0;try{Ig()}finally{xg=0,zg(),Og=0}}function Rg(){var e=Ag.now(),t=e-Dg;t>wg&&(kg-=t,Dg=e)}function zg(){for(var e,t=Tg,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Tg=n);Eg=e,Bg(r)}function Bg(e){xg||(Sg&&=clearTimeout(Sg),e-Og>24?(e<1/0&&(Sg=setTimeout(Lg,e-Ag.now()-kg)),Cg&&=clearInterval(Cg)):(Cg||=(Dg=Ag.now(),setInterval(Rg,wg)),xg=1,jg(Lg)))}function Vg(e,t,n){var r=new Pg;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Hg=class{elapsed=0;timer=null;constructor(e,t,n){this.duration=e,this.easingFn=t,this.onTickCallback=n,this.resume()}get running(){return this.timer!==null}timerCallback(e){this.elapsed=Math.min(e,this.duration);let t=this.duration===0?1:this.elapsed/this.duration,n=this.easingFn(t);this.onTickCallback(n),this.elapsed>=this.duration&&this.stop()}resume(){return this.running||this.elapsed>=this.duration||(this.timer=Fg(e=>this.timerCallback(e),0,Mg()-this.elapsed)),this}stop(){return this.running&&(this.timer&&=(this.timer.stop(),null)),this}finish(){return this.stop(),Vg(()=>this.timerCallback(this.duration)),this}};function Ug(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r+=1){let i=n[r];if(!Object.prototype.hasOwnProperty.call(t,i)||!Object.is(e[i],t[i]))return!1}return!0}function Wg(e,{createInterpolator:t,applyProps:r,skip:i,initialProps:a=e}){let o=n.useRef(a),s=n.useRef(null),c=n.useRef(null),l=n.useRef(e);ln(()=>{l.current=e},[e]),ln(()=>{i&&(s.current?.finish(),s.current=null,c.current=null,o.current=e)},[e,i]);let u=n.useCallback(n=>{let i=o.current,a=t(i,e);s.current=new Hg(300,bg,e=>{let t=a(e);o.current=t,r(n,t)})},[r,t,e]);return[n.useCallback(t=>{if(t===null){s.current?.stop();return}let n=c.current;if(n===t){if(Ug(l.current,e)){s.current?.resume();return}s.current?.stop()}n&&s.current?.stop(),c.current=t,(s.current||!i)&&u(t)},[u,e,i]),o.current]}function Gg(e,{createInterpolator:t,transformProps:n,applyProps:r,skip:i,initialProps:a=e,ref:o}){let s=n??(e=>e),[c,l]=Wg(e,{initialProps:a,createInterpolator:t,applyProps:(e,t)=>r(e,s(t)),skip:i});return y({},n(i?e:l),{ref:fi(c,o)})}function Kg(e){let{isReversed:t,gradientId:r,size:i,direction:a,scale:o,colorMap:s}=e;return i<=0?null:(0,g.jsx)(`linearGradient`,{id:r,x1:`0`,x2:`0`,y1:`0`,y2:`0`,[`${a}${t?1:2}`]:`${i}px`,gradientUnits:`userSpaceOnUse`,children:s.thresholds.map((e,r)=>{let a=o(e);if(a===void 0)return null;let c=t?1-a/i:a/i;return Number.isNaN(c)?null:(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(`stop`,{offset:c,stopColor:s.colors[r],stopOpacity:1}),(0,g.jsx)(`stop`,{offset:c,stopColor:s.colors[r+1],stopOpacity:1})]},e.toString()+r)})})}var qg=10;function Jg(e){let{gradientUnits:t,isReversed:n,gradientId:r,size:i,direction:a,scale:o,colorScale:s,colorMap:c}=e,l=[c.min??0,c.max??100],u=l.map(o).filter(e=>e!==void 0);if(u.length!==2)return null;let d=typeof l[0]==`number`?fc(l[0],l[1]):dc(l[0],l[1]),f=Math.round((Math.max(...u)-Math.min(...u))/qg),p=`${l[0]}-${l[1]}-`;return(0,g.jsx)(`linearGradient`,{id:r,x1:`0`,x2:`0`,y1:`0`,y2:`0`,[`${a}${n?1:2}`]:t===`objectBoundingBox`?1:`${i}px`,gradientUnits:t??`userSpaceOnUse`,children:Array.from({length:f+1},(e,t)=>{let r=d(t/f);if(r===void 0)return null;let a=o(r);if(a===void 0)return null;let c=n?1-a/i:a/i,l=s(r);return l===null?null:(0,g.jsx)(`stop`,{offset:c,stopColor:l,stopOpacity:1},p+t)})})}var Yg=10,Xg=e=>e?{x1:`1`,x2:`0`,y1:`0`,y2:`0`}:{x1:`0`,x2:`1`,y1:`0`,y2:`0`};function Zg(e){let{isReversed:t,gradientId:n,colorScale:r,colorMap:i}=e,a=[i.min??0,i.max??100],o=typeof a[0]==`number`?fc(a[0],a[1]):dc(a[0],a[1]),s=Yg,c=`${a[0]}-${a[1]}-`;return(0,g.jsx)(`linearGradient`,y({id:n},Xg(t),{gradientUnits:`objectBoundingBox`,children:Array.from({length:s+1},(e,t)=>{let n=t/s,i=o(n);if(i===void 0)return null;let a=r(i);return a===null?null:(0,g.jsx)(`stop`,{offset:n,stopColor:a,stopOpacity:1},c+t)})}))}function Qg(){let{top:e,height:t,bottom:r,left:i,width:a,right:o}=dg(),s=e+t+r,c=i+a+o,l=_g(),u=vg(),{xAxis:d,xAxisIds:f}=pg(),{yAxis:p,yAxisIds:m}=mg(),{zAxis:h,zAxisIds:_}=hg(),v=m.filter(e=>p[e].colorMap!==void 0),y=f.filter(e=>d[e].colorMap!==void 0),b=_.filter(e=>h[e].colorMap!==void 0);return v.length===0&&y.length===0&&b.length===0?null:(0,g.jsxs)(`defs`,{children:[v.map(e=>{let t=l(e),r=u(e),{colorMap:i,scale:a,colorScale:o,reverse:c}=p[e];return i?.type===`piecewise`?(0,g.jsx)(Kg,{isReversed:!c,scale:a,colorMap:i,size:s,gradientId:t,direction:`y`},t):i?.type===`continuous`?(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(Jg,{isReversed:!c,scale:a,colorScale:o,colorMap:i,size:s,gradientId:t,direction:`y`}),(0,g.jsx)(Zg,{isReversed:c,colorScale:o,colorMap:i,gradientId:r})]},t):null}),y.map(e=>{let t=l(e),r=u(e),{colorMap:i,scale:a,reverse:o,colorScale:s}=d[e];return i?.type===`piecewise`?(0,g.jsx)(Kg,{isReversed:o,scale:a,colorMap:i,size:c,gradientId:t,direction:`x`},t):i?.type===`continuous`?(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(Jg,{isReversed:o,scale:a,colorScale:s,colorMap:i,size:c,gradientId:t,direction:`x`}),(0,g.jsx)(Zg,{isReversed:o,colorScale:s,colorMap:i,gradientId:r})]},t):null}),b.map(e=>{let t=u(e),{colorMap:n,colorScale:r}=h[e];return n?.type===`continuous`?(0,g.jsx)(Zg,{colorScale:r,colorMap:n,gradientId:t},t):null})]})}function $g(e){return zt(`MuiChartsSurface`,e)}var e_=()=>x({root:[`root`]},$g);Bt(`MuiChartsSurface`,[`root`]);var t_=[`children`,`className`,`title`,`desc`],n_=di(`svg`,{name:`MuiChartsSurface`,slot:`Root`})(({ownerState:e})=>({width:e.width??`100%`,height:e.height??`100%`,display:`flex`,position:`relative`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,touchAction:`pan-y`,userSelect:`none`,gridArea:`chart`,"&:focus":{outline:`none`}})),r_=n.forwardRef(function(e,t){let{store:n,instance:r}=lg(),i=n.use(ya),a=n.use(ba),o=n.use(xa),s=n.use(Sa),c=n.use(Lp),l=n.use(Fp),u=fi(gg(),t),d=li({props:e,name:`MuiChartsSurface`}),{children:f,className:p,title:m,desc:h}=d,_=b(d,t_),v=e_(),x=a>0&&i>0;return(0,g.jsxs)(n_,y({ownerState:{width:o,height:s},viewBox:`0 0 ${i} ${a}`,className:C(v.root,p),tabIndex:c?0:void 0,"data-has-focused-item":l||void 0},_,{onPointerEnter:e=>{_.onPointerEnter?.(e),r.handlePointerEnter?.(e)},onPointerLeave:e=>{_.onPointerLeave?.(e),r.handlePointerLeave?.(e)},onClick:e=>{_.onClick?.(e),r.handleClick?.(e)},ref:u,children:[m&&(0,g.jsx)(`title`,{children:m}),h&&(0,g.jsx)(`desc`,{children:h}),(0,g.jsx)(Qg,{}),x&&f]}))});process.env.NODE_ENV!==`production`&&(r_.displayName=`ChartsSurface`),process.env.NODE_ENV!==`production`&&(r_.propTypes={children:l.default.node,className:l.default.string,desc:l.default.string,sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object]),title:l.default.string});function i_(e){let t=Bp(e);return[Math.sin(t),-Math.cos(t)]}function a_(e,t){let n=[[0,0],i_(e),i_(t)],r=Math.min(e,t),i=Math.max(e,t),a=Math.floor(r/90)*90;for(let e=1;e<=4;e+=1){let t=a+e*90;t<i&&n.push(i_(t))}let o=Math.min(...n.map(([e])=>e)),s=Math.max(...n.map(([e])=>e)),c=Math.min(...n.map(([,e])=>e)),l=Math.max(...n.map(([,e])=>e));return{cx:-o/(s-o),cy:-c/(l-c),minX:o,maxX:s,minY:c,maxY:l}}function o_(e,t,n,r,{minX:i,maxX:a,minY:o,maxY:s}){return Math.min(...[{ratio:Math.abs(i),space:e},{ratio:Math.abs(a),space:n-e},{ratio:Math.abs(o),space:t},{ratio:Math.abs(s),space:r-t}].map(({ratio:e,space:t})=>e<1e-5?1/0:t/e))}var s_=n.createContext({value:null,valueMin:0,valueMax:0,startAngle:0,endAngle:0,innerRadius:0,outerRadius:0,cornerRadius:0,cx:0,cy:0,maxRadius:0,valueAngle:null});process.env.NODE_ENV!==`production`&&(s_.displayName=`GaugeContext`);function c_(e){let{value:t=null,valueMin:r=0,valueMax:i=100,startAngle:a=0,endAngle:o=360,outerRadius:s,innerRadius:c,cornerRadius:l,cx:u,cy:d,children:f}=e,{left:p,top:m,width:h,height:_}=dg(),v=a_(a,o),y=u?eg(u,h):v.cx*h,b=d?eg(d,_):v.cy*_,x=p+y,S=m+b,C=o_(y,b,h,_,v);if(u===void 0){let e=C*(v.maxX-v.minX);x=p+(h-e)/2+v.cx*e}if(d===void 0){let e=C*(v.maxY-v.minY);S=m+(_-e)/2+v.cy*e}let w=eg(s??C,C),T=eg(c??`80%`,C),E=eg(l??0,w-T),D=n.useMemo(()=>{let e=Bp(a),n=Bp(o);return{value:t,valueMin:r,valueMax:i,startAngle:e,endAngle:n,outerRadius:w,innerRadius:T,cornerRadius:E,cx:x,cy:S,maxRadius:C,valueAngle:t===null?null:e+(n-e)*(t-r)/(i-r)}},[t,r,i,a,o,w,T,E,x,S,C]);return(0,g.jsx)(s_.Provider,{value:D,children:f})}function l_(){return n.useContext(s_)}var u_=[`width`,`height`,`margin`,`title`,`desc`,`value`,`valueMin`,`valueMax`,`startAngle`,`endAngle`,`outerRadius`,`innerRadius`,`cornerRadius`,`cx`,`cy`,`children`],d_=di(`g`,{slot:`internal`,shouldForwardProp:void 0})(({theme:e})=>({"& text":{fill:(e.vars||e).palette.text.primary}})),f_=n.forwardRef(function(e,t){let{width:n,height:r,margin:i,title:a,desc:o,value:s,valueMin:c=0,valueMax:l=100,startAngle:u,endAngle:d,outerRadius:f,innerRadius:p,cornerRadius:m,cx:h,cy:_,children:v}=e,x=b(e,u_);return(0,g.jsx)(cg,{pluginParams:{width:n,height:r,margin:Ca(i,{left:10,right:10,top:10,bottom:10})},plugins:[],children:(0,g.jsx)(c_,{value:s,valueMin:c,valueMax:l,startAngle:u,endAngle:d,outerRadius:f,innerRadius:p,cornerRadius:m,cx:h,cy:_,children:(0,g.jsx)(r_,y({title:a,desc:o,role:`meter`,"aria-valuenow":s===null?void 0:s,"aria-valuemin":c,"aria-valuemax":l},x,{ref:t,children:(0,g.jsx)(d_,{"aria-hidden":`true`,children:v})}))})})});process.env.NODE_ENV!==`production`&&(f_.displayName=`GaugeContainer`),process.env.NODE_ENV!==`production`&&(f_.propTypes={children:l.default.node,className:l.default.string,cornerRadius:l.default.oneOfType([l.default.number,l.default.string]),cx:l.default.oneOfType([l.default.number,l.default.string]),cy:l.default.oneOfType([l.default.number,l.default.string]),desc:l.default.string,endAngle:l.default.number,height:l.default.number,id:l.default.string,innerRadius:l.default.oneOfType([l.default.number,l.default.string]),margin:l.default.oneOfType([l.default.number,l.default.shape({bottom:l.default.number,left:l.default.number,right:l.default.number,top:l.default.number})]),outerRadius:l.default.oneOfType([l.default.number,l.default.string]),skipAnimation:l.default.bool,startAngle:l.default.number,sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object]),title:l.default.string,value:l.default.number,valueMax:l.default.number,valueMin:l.default.number,width:l.default.number});function p_(e){let t=ug().use(sa);return e||t}function m_(e,t){let n=fc(e.startAngle,t.startAngle),r=fc(e.endAngle,t.endAngle),i=fc(e.innerRadius,t.innerRadius),a=fc(e.outerRadius,t.outerRadius),o=fc(e.cornerRadius,t.cornerRadius);return e=>({startAngle:n(e),endAngle:r(e),innerRadius:i(e),outerRadius:a(e),cornerRadius:o(e)})}function h_(e){return Gg({startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},{createInterpolator:m_,transformProps:e=>({d:Dm().cornerRadius(e.cornerRadius)({innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle})}),applyProps(e,t){e.setAttribute(`d`,t.d)},initialProps:{startAngle:e.startAngle,endAngle:e.startAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius},skip:e.skipAnimation,ref:e.ref})}function g_(e){return zt(`MuiGauge`,e)}var __=Bt(`MuiGauge`,[`root`,`valueArc`,`referenceArc`,`valueText`]),v_=[`className`],y_=[`cx`,`cy`,`startAngle`,`endAngle`,`cornerRadius`,`innerRadius`,`outerRadius`,`skipAnimation`],b_=di(`path`,{name:`MuiGauge`,slot:`ValueArc`})(({theme:e})=>({fill:(e.vars||e).palette.primary.main}));function x_(e){let{className:t}=e,n=b(e,v_),{value:r,valueMin:i,valueMax:a,startAngle:o,endAngle:s,outerRadius:c,innerRadius:l,cornerRadius:u,cx:d,cy:f}=l_();if(r===null)return null;let p=o+(r-i)/(a-i)*(s-o);return(0,g.jsx)(S_,y({},n,{className:C(__.valueArc,t),cx:d,cy:f,startAngle:o,endAngle:p,cornerRadius:u,innerRadius:l,outerRadius:c}))}process.env.NODE_ENV!==`production`&&(x_.propTypes={skipAnimation:l.default.bool});function S_(e){let{cx:t,cy:n,startAngle:r,endAngle:i,cornerRadius:a,innerRadius:o,outerRadius:s,skipAnimation:c}=e,l=b(e,y_);return(0,g.jsx)(b_,y({},h_({startAngle:r,endAngle:i,cornerRadius:a,innerRadius:o,outerRadius:s,skipAnimation:p_(c)}),{transform:`translate(${t}, ${n})`},l))}process.env.NODE_ENV!==`production`&&(S_.propTypes={cornerRadius:l.default.number.isRequired,cx:l.default.number.isRequired,cy:l.default.number.isRequired,endAngle:l.default.number.isRequired,innerRadius:l.default.number.isRequired,outerRadius:l.default.number.isRequired,skipAnimation:l.default.bool,startAngle:l.default.number.isRequired});var C_=[`className`],w_=di(`path`,{name:`MuiGauge`,slot:`ReferenceArc`})(({theme:e})=>({fill:(e.vars||e).palette.divider}));function T_(e){let{className:t}=e,n=b(e,C_),{startAngle:r,endAngle:i,outerRadius:a,innerRadius:o,cornerRadius:s,cx:c,cy:l}=l_();return(0,g.jsx)(w_,y({className:C(__.referenceArc,t),transform:`translate(${c}, ${l})`,d:Dm().cornerRadius(s)({startAngle:r,endAngle:i,innerRadius:o,outerRadius:a})},n))}function E_(){return typeof window>`u`}var D_=new Map,O_=2e3,k_=new Set([`minWidth`,`maxWidth`,`width`,`minHeight`,`maxHeight`,`height`,`top`,`left`,`fontSize`,`padding`,`margin`,`paddingLeft`,`paddingRight`,`paddingTop`,`paddingBottom`,`marginLeft`,`marginRight`,`marginTop`,`marginBottom`]);function A_(e,t){return k_.has(e)&&t===+t?`${t}px`:t}var j_=/([A-Z])/g;function M_(e){return String(e).replace(j_,e=>`-${e.toLowerCase()}`)}function N_(e){let t=``;for(let n in e)if(Object.hasOwn(e,n)){let r=n,i=e[r];if(i===void 0)continue;t+=`${M_(r)}:${A_(r,i)};`}return t}var P_=(e,t={})=>{if(e==null||E_())return{width:0,height:0};let n=String(e),r=`${n}-${N_(t)}`,i=D_.get(r);if(i)return i;try{let e=L_(),i=document.createElementNS(`http://www.w3.org/2000/svg`,`text`);Object.keys(t).map(e=>(i.style[M_(e)]=A_(e,t[e]),e)),i.textContent=n,e.replaceChildren(i);let a=F_(i);return D_.set(r,a),D_.size+1>O_&&D_.clear(),process.env.NODE_ENV===`test`&&e.replaceChildren(),a}catch{return{width:0,height:0}}};function F_(e){try{let t=e.getBBox();return{width:t.width,height:t.height}}catch{let t=e.getBoundingClientRect();return{width:t.width,height:t.height}}}var I_=null;function L_(){return I_===null&&(I_=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`),I_.setAttribute(`aria-hidden`,`true`),I_.style.position=`absolute`,I_.style.top=`-20000px`,I_.style.left=`0`,I_.style.padding=`0`,I_.style.margin=`0`,I_.style.border=`none`,I_.style.pointerEvents=`none`,I_.style.visibility=`hidden`,I_.style.contain=`strict`,document.body.appendChild(I_)),I_}function R_({style:e,needsComputation:t,text:n}){return n.split(`
47
+ `).map(n=>y({text:n},t?P_(n,e):{width:0,height:0}))}function z_(){let[e,t]=n.useState(!1);return n.useEffect(()=>{t(!0)},[]),e}var B_=[`x`,`y`,`style`,`text`,`ownerState`],V_=[`angle`,`textAnchor`,`dominantBaseline`];function H_(e){let{x:t,y:r,style:i,text:a}=e,o=b(e,B_),s=i??{},{angle:c,textAnchor:l,dominantBaseline:u}=s,d=b(s,V_),f=z_(),p=n.useMemo(()=>R_({style:d,needsComputation:f&&a.includes(`
48
+ `),text:a}),[d,a,f]),m;switch(u){case`hanging`:case`text-before-edge`:m=0;break;case`central`:m=(p.length-1)/2*-p[0].height;break;default:m=(p.length-1)*-p[0].height;break}return(0,g.jsx)(`text`,y({},o,{transform:c?`rotate(${c}, ${t}, ${r})`:void 0,x:t,y:r,textAnchor:l,dominantBaseline:u,style:d,children:p.map((e,n)=>(0,g.jsx)(`tspan`,{x:t,dy:`${n===0?m:p[0].height}px`,dominantBaseline:u,children:e.text},n))}))}process.env.NODE_ENV!==`production`&&(H_.propTypes={lineHeight:l.default.number,needsComputation:l.default.bool,ownerState:l.default.any,style:l.default.object,text:l.default.string.isRequired});var U_=[`text`,`className`];function W_({value:e}){return e===null?null:e.toLocaleString()}function G_(e){let{text:t=W_,className:n}=e,r=b(e,U_),{value:i,valueMin:a,valueMax:o,cx:s,cy:c}=l_(),l=typeof t==`function`?t({value:i,valueMin:a,valueMax:o}):t;return l===null?null:(0,g.jsx)(`g`,{className:C(__.valueText,n),children:(0,g.jsx)(H_,y({x:s,y:c,text:l,style:{textAnchor:`middle`,dominantBaseline:`central`}},r))})}process.env.NODE_ENV!==`production`&&(G_.propTypes={lineHeight:l.default.number,needsComputation:l.default.bool,ownerState:l.default.any,style:l.default.object,text:l.default.oneOfType([l.default.func,l.default.string])});var K_=[`text`,`children`,`classes`,`className`,`skipAnimation`],q_=e=>{let{classes:t}=e;return x({root:[`root`]},g_,t)},J_=n.forwardRef(function(e,t){let{text:n,children:r,className:i,skipAnimation:a}=e;return(0,g.jsxs)(f_,y({},b(e,K_),{className:C(q_(e).root,i),ref:t,children:[(0,g.jsx)(T_,{}),(0,g.jsx)(x_,{skipAnimation:a}),(0,g.jsx)(G_,{text:n}),r]}))});process.env.NODE_ENV!==`production`&&(J_.displayName=`Gauge`),process.env.NODE_ENV!==`production`&&(J_.propTypes={children:l.default.node,classes:l.default.object,className:l.default.string,cornerRadius:l.default.oneOfType([l.default.number,l.default.string]),cx:l.default.oneOfType([l.default.number,l.default.string]),cy:l.default.oneOfType([l.default.number,l.default.string]),desc:l.default.string,endAngle:l.default.number,height:l.default.number,id:l.default.string,innerRadius:l.default.oneOfType([l.default.number,l.default.string]),margin:l.default.oneOfType([l.default.number,l.default.shape({bottom:l.default.number,left:l.default.number,right:l.default.number,top:l.default.number})]),outerRadius:l.default.oneOfType([l.default.number,l.default.string]),skipAnimation:l.default.bool,startAngle:l.default.number,sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object]),text:l.default.oneOfType([l.default.func,l.default.string]),title:l.default.string,value:l.default.number,valueMax:l.default.number,valueMin:l.default.number,width:l.default.number});var Y_=e=>{let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,a=[];return t>0?(a.push(t.toString()),a.push(n.toString().padStart(2,`0`)),a.push(r.toString().padStart(2,`0`)),a.push(i.toString().padStart(2,`0`))):n>0?(a.push(n.toString()),a.push(r.toString().padStart(2,`0`)),a.push(i.toString().padStart(2,`0`))):(a.push(r.toString()),a.push(i.toString().padStart(2,`0`))),a.join(`:`)},X_=(e,t)=>{let n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),a=e%60;if(typeof Intl<`u`&&`DurationFormat`in Intl)try{let e={};return n>0&&(e.days=n),r>0&&(e.hours=r),i>0&&(e.minutes=i),(a>0||Object.keys(e).length===0)&&(e.seconds=a),new Intl.DurationFormat(t,{style:`narrow`}).format(e)}catch{}let o=[];return n>0&&o.push(`${n}d`),r>0&&o.push(`${r}h`),i>0&&o.push(`${i}m`),(a>0||o.length===0)&&o.push(`${a}s`),o.join(` `)},Z_=(e,t,n)=>e===`countdown`&&n!==null?Math.min(100,t/n*100):e===`measuring`?t/60%1*100:0,Q_=({timerState:e,animationState:t,hasError:n,className:i})=>{let{t:o,i18n:s}=(0,a.useTranslation)(),c=(0,r.useTheme)(),{currentState:l,remainingTime:u,maxTime:d,currentProgress:f}=e,{showErrorAnimation:p,showPauseAnimation:m,showPulsatingText:h,pulsatingFinished:_,showLabels:v,showMainText:y,showIdlePulsating:b,idleDotsCount:x}=t;return(0,g.jsxs)(r.Box,{className:i,sx:{position:`relative`,width:264,height:264,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,g.jsx)(J_,{width:264,height:264,value:l===`idle`?0:f,valueMin:0,valueMax:100,innerRadius:`85%`,outerRadius:`100%`,margin:0,skipAnimation:!0,text:()=>``,sx:{opacity:m||p?.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:`#171927`,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`}}}),(0,g.jsxs)(r.Box,{sx:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:225,height:225,borderRadius:`50%`,backgroundColor:`#292B3F`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,textAlign:`center`,gap:1,transition:`background-color 0.5s ease-out`},children:[(0,g.jsx)(r.Box,{sx:{height:`16px`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:1},children:(0,g.jsx)(r.Fade,{in:v&&!n&&l!==`idle`&&l!==`success`,timeout:300,children:(0,g.jsx)(r.Typography,{variant:`body2`,sx:{fontSize:`12px`,color:l===`measured`&&(h||_)?c.palette.success.main:c.palette.text.secondary,transition:`color 0.8s ease-in-out`},children:(0,g.jsx)(`span`,{style:{opacity:l===`measured`&&_?h?1:.6:1,transition:`opacity 2s ease-in-out`},children:l===`measuring`||l===`measured`?o(`CycleTimer.CycleTime.lb`,`Cycle Time`):l===`countdown`?o(`CycleTimer.RemainingTime.lb`,`Remaining Time`):``})})})}),(0,g.jsxs)(r.Box,{sx:{position:`relative`,height:`48px`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:.5},children:[(0,g.jsx)(r.Fade,{in:y&&l===`idle`&&!n,timeout:200,children:(0,g.jsxs)(r.Typography,{variant:`body2`,sx:{position:`absolute`,fontSize:`12px`,fontWeight:400,color:`rgba(255, 255, 255, 0.7)`,lineHeight:`166%`,letterSpacing:`0.17px`,textAlign:`center`,width:`200px`,height:`20px`,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,g.jsx)(`span`,{style:{opacity:b?1:.6,transition:`opacity 2s ease-in-out`},children:o(`CycleTimer.WaitingForCycle.lb`,`Waiting for program cycle`)}),(0,g.jsx)(`span`,{style:{display:`inline-block`,width:`18px`,textAlign:`left`,opacity:b?1:.6,transition:`opacity 2s ease-in-out`},children:`.`.repeat(x)})]})}),(0,g.jsx)(r.Fade,{in:y&&n,timeout:200,children:(0,g.jsx)(r.Typography,{variant:`h3`,sx:{position:`absolute`,fontSize:`40px`,fontWeight:400,color:`#FFFFFF`,lineHeight:`116.7%`},children:o(`CycleTimer.Error.lb`,`Error`)})}),(0,g.jsx)(r.Fade,{in:y&&!n&&l!==`idle`&&l!==`success`,timeout:300,children:(0,g.jsx)(r.Typography,{variant:`h1`,sx:{position:`absolute`,fontSize:`48px`,fontWeight:500,color:c.palette.text.primary,lineHeight:1,transition:`color 0.8s ease-in-out`},children:(0,g.jsx)(`span`,{style:{opacity:1,transition:`opacity 2s ease-in-out`},children:Y_(u)})})})]}),(0,g.jsx)(r.Box,{sx:{height:`16px`,display:`flex`,marginTop:.5,alignItems:`center`,justifyContent:`center`},children:(0,g.jsx)(r.Fade,{in:v&&!n&&l!==`idle`&&l!==`success`,timeout:300,children:(0,g.jsx)(r.Typography,{variant:`body2`,sx:{fontSize:`12px`,color:l===`measured`&&(h||_)?c.palette.success.main:c.palette.text.secondary,transition:`color 0.8s ease-in-out`},children:(0,g.jsx)(`span`,{style:{opacity:l===`measured`&&_?h?1:.6:1,transition:`opacity 2s ease-in-out`},children:l===`measuring`?o(`CycleTimer.Measuring.lb`,`measuring...`):l===`measured`?o(`CycleTimer.Determined.lb`,`determined`):l===`countdown`&&d!==null?o(`CycleTimer.OfTime.lb`,{time:X_(d,s.language)}):``})})})})]})]})},$_=({timerState:e,animationState:t,hasError:n,compact:i,className:o})=>{let{t:s,i18n:c}=(0,a.useTranslation)(),l=(0,r.useTheme)(),{currentState:u,remainingTime:d,maxTime:f}=e,{showErrorAnimation:p,showPauseAnimation:m,showPulsatingText:h,pulsatingFinished:_,showIdlePulsating:v,idleDotsCount:y}=t;return i&&u===`idle`?(0,g.jsx)(r.Box,{className:o,sx:{display:`flex`,alignItems:`center`,m:0},children:(0,g.jsx)(r.Typography,{variant:`body2`,sx:{color:n?l.palette.error.light:l.palette.text.primary,fontSize:`14px`,transition:`color 0.5s ease-out`},children:n?s(`CycleTimer.Error.lb`,`Error`):u===`idle`?`0s`:X_(d,c.language)})}):(0,g.jsxs)(r.Box,{className:o,sx:{display:`flex`,alignItems:`center`,m:0,gap:1},children:[!(u===`idle`&&i)&&(0,g.jsx)(r.Box,{sx:{width:20,height:20,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:m||p?.6:1,transition:`opacity 0.5s ease-out`},children:(0,g.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,style:{transform:`rotate(-90deg)`},role:`img`,"aria-label":`Timer progress`,children:[(0,g.jsx)(`circle`,{cx:`10`,cy:`10`,r:`8`,fill:`none`,stroke:n?l.palette.error.light:u===`measured`?h||_?l.palette.success.main:l.palette.text.secondary:l.palette.success.main,strokeWidth:`2`,opacity:u===`measured`&&_?h?1:.6:.3,style:{transition:`stroke 0.8s ease-in-out, opacity 2s ease-in-out`}}),(0,g.jsx)(`circle`,{cx:`10`,cy:`10`,r:`8`,fill:`none`,stroke:n?l.palette.error.light:u===`measured`?h||_?l.palette.success.main:l.palette.text.secondary:l.palette.success.main,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-(u===`idle`?0:e.currentProgress)/100)}`,style:{opacity:u===`measured`&&_?h?1:.6:1,transition:`stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out`}})]})}),(0,g.jsx)(r.Typography,{variant:`body2`,sx:{color:n?l.palette.error.light:u===`idle`?`rgba(255, 255, 255, 0.7)`:u===`measured`?h||_?l.palette.success.main:l.palette.text.secondary:l.palette.text.primary,fontSize:`14px`,lineHeight:`normal`,letterSpacing:`normal`,opacity:u===`idle`?v?1:.6:u===`measured`&&_?h?1:.6:1,transition:`color 0.8s ease-in-out, font-size 0.3s ease-out, opacity 2s ease-in-out`},children:n?s(`CycleTimer.Error.lb`,`Error`):u===`idle`?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{children:s(`CycleTimer.WaitingForCycle.lb`,`Waiting for program cycle`)}),(0,g.jsx)(`span`,{style:{display:`inline-block`,width:`18px`,textAlign:`left`},children:`.`.repeat(y)})]}):u===`measuring`?i?X_(d,c.language):`${X_(d,c.language)} / ${s(`CycleTimer.Measuring.lb`,`measuring...`)}`:u===`measured`?i?X_(d,c.language):`${X_(d,c.language)} / ${s(`CycleTimer.Determined.lb`,`determined`)}`:u===`countdown`&&f!==null?i?X_(d,c.language):`${X_(d,c.language)} / ${s(`CycleTimer.Time.lb`,{time:X_(f,c.language)})}`:X_(d,c.language)})]})},ev=()=>{let[e,t]=(0,n.useState)({showPauseAnimation:!1,showErrorAnimation:!1,showPulsatingText:!1,pulsatingFinished:!1,showLabels:!0,showMainText:!0,showIdlePulsating:!1,idleDotsCount:0}),r=(0,n.useRef)(null),i=(0,n.useRef)(null),a=(0,n.useRef)(null),o=(0,n.useRef)(null),s=(0,n.useRef)(0),c=(0,n.useRef)(null),l=(0,n.useRef)(null);return{animationState:e,triggerPauseAnimation:(0,n.useCallback)(()=>{t(e=>({...e,showPauseAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(e=>({...e,showPauseAnimation:!1}))},800)},[]),triggerErrorAnimation:(0,n.useCallback)(()=>{t(e=>({...e,showErrorAnimation:!0})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(e=>({...e,showErrorAnimation:!1}))},600)},[]),clearErrorAnimation:(0,n.useCallback)(()=>{t(e=>({...e,showErrorAnimation:!1})),i.current&&clearTimeout(i.current)},[]),startPulsatingAnimation:(0,n.useCallback)(e=>{s.current=0,t(e=>({...e,showPulsatingText:!0,pulsatingFinished:!1})),setTimeout(()=>{t(e=>({...e,pulsatingFinished:!0})),a.current=setInterval(()=>{t(e=>({...e,showPulsatingText:!e.showPulsatingText}))},2e3),e&&e()},800)},[]),stopPulsatingAnimation:(0,n.useCallback)(()=>{a.current&&=(clearInterval(a.current),null),t(e=>({...e,showPulsatingText:!1,pulsatingFinished:!1})),s.current=0},[]),startIdleAnimations:(0,n.useCallback)(()=>{t(e=>({...e,showIdlePulsating:!0})),c.current=setInterval(()=>{t(e=>({...e,showIdlePulsating:!e.showIdlePulsating}))},2e3),l.current=setInterval(()=>{t(e=>({...e,idleDotsCount:(e.idleDotsCount+1)%4}))},800)},[]),stopIdleAnimations:(0,n.useCallback)(()=>{c.current&&=(clearInterval(c.current),null),l.current&&=(clearInterval(l.current),null),t(e=>({...e,showIdlePulsating:!1,idleDotsCount:0}))},[]),triggerFadeTransition:(0,n.useCallback)(()=>{t(e=>({...e,showLabels:!1,showMainText:!1})),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{t(e=>({...e,showLabels:!0,showMainText:!0}))},200)},[]),setInitialAnimationState:(0,n.useCallback)(()=>{t(e=>({...e,showLabels:!0,showMainText:!0}))},[]),cleanup:(0,n.useCallback)(()=>{r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current),o.current&&clearTimeout(o.current),a.current&&clearInterval(a.current),c.current&&clearInterval(c.current),l.current&&clearInterval(l.current)},[])}},tv=({autoStart:t,onCycleEnd:r,onMeasuringComplete:i,hasError:a,onPauseAnimation:o,onErrorAnimation:s,onClearErrorAnimation:c,onStartPulsating:l})=>{let[u,d]=(0,n.useState)({currentState:`idle`,remainingTime:0,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),f=(0,n.useRef)(null),p=(0,n.useRef)(null),m=(0,n.useRef)(0),[h]=e.n([0],{tension:80,friction:18,onChange:([e])=>{d(t=>({...t,currentProgress:e}))}}),g=(0,n.useCallback)(()=>{d(e=>({...e,currentState:`idle`,maxTime:null,isRunning:!1,isPausedState:!1,currentProgress:0})),m.current=0,p.current=null,h.setImmediate([0])},[h]),_=(0,n.useCallback)((e=0)=>{let n=e/60%1*100;d(t=>({...t,currentState:`measuring`,maxTime:null,remainingTime:e,isPausedState:!1,currentProgress:n})),m.current=0,h.setImmediate([n]),t?(p.current=Date.now()-e*1e3,d(e=>({...e,isRunning:!0}))):p.current=null},[t,h]),v=(0,n.useCallback)((e,n=0)=>{d(e=>({...e,isRunning:!1})),p.current=null,d(t=>({...t,currentState:`countdown`,maxTime:e,isPausedState:!1})),m.current=0;let i=Math.max(0,e-n),a=n>0?n/e*100:0;d(e=>({...e,remainingTime:i,currentProgress:a})),h.setImmediate([a]),i===0?(d(e=>({...e,isRunning:!1})),p.current=null,r&&queueMicrotask(()=>r())):t?setTimeout(()=>{p.current=Date.now()-n*1e3,d(e=>({...e,isRunning:!0}))},0):p.current=null},[t,r,h]),y=(0,n.useCallback)(()=>{d(e=>({...e,isRunning:!1,currentState:`measured`})),p.current=null,l(()=>{i&&i()})},[l,i]),b=(0,n.useCallback)(()=>{if(p.current&&u.isRunning){let e=Date.now()-p.current;m.current+=e;let t=m.current/1e3,n=Z_(u.currentState,t,u.maxTime);h.setTarget([n])}d(e=>({...e,isRunning:!1,isPausedState:!0})),o()},[u.isRunning,u.currentState,u.maxTime,h,o]),x=(0,n.useCallback)(()=>{u.isPausedState&&(u.remainingTime>0||u.currentState!==`countdown`)&&(p.current=Date.now(),d(e=>({...e,isRunning:!0,isPausedState:!1})))},[u.isPausedState,u.remainingTime,u.currentState]),S=(0,n.useCallback)(()=>u.isPausedState,[u.isPausedState]);return(0,n.useEffect)(()=>{a?(u.isRunning&&!u.isPausedState&&(d(e=>({...e,wasRunningBeforeError:!0})),b()),s()):(u.wasRunningBeforeError&&u.isPausedState&&(d(e=>({...e,wasRunningBeforeError:!1})),x()),c())},[a,u.isRunning,u.isPausedState,u.wasRunningBeforeError,b,x,s,c]),(0,n.useEffect)(()=>{if(u.isRunning){let e=()=>{if(p.current){let t=(Date.now()-p.current+m.current)/1e3;if(u.currentState===`countdown`&&u.maxTime!==null){let e=Math.max(0,u.maxTime-t);d(t=>({...t,remainingTime:Math.ceil(e)}));let n=Math.min(100,t/u.maxTime*100);if(h.setTarget([n]),e<=0){d(e=>({...e,isRunning:!1,remainingTime:0})),p.current=null,h.setTarget([100]),r&&queueMicrotask(()=>r());return}}else if(u.currentState===`measuring`){d(e=>({...e,remainingTime:Math.floor(t)}));let e=t/60%1*100;h.setTarget([e])}u.isRunning&&(f.current=requestAnimationFrame(e))}};f.current=requestAnimationFrame(e)}else f.current&&=(cancelAnimationFrame(f.current),null);return()=>{f.current&&cancelAnimationFrame(f.current)}},[u.isRunning,r,u.currentState,u.maxTime,h]),(0,n.useEffect)(()=>{let e=null,t=()=>{h.update(1/60),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{e&&cancelAnimationFrame(e)}},[h]),{timerState:u,controls:{startNewCycle:v,startMeasuring:_,setIdle:g,completeMeasuring:y,pause:b,resume:x,isPaused:S}}},nv=e.m((0,i.observer)(({onCycleComplete:e,onCycleEnd:t,onMeasuringComplete:r,autoStart:i=!0,variant:a=`default`,compact:o=!1,className:s,hasError:c=!1})=>{let l=(0,n.useRef)(void 0),{animationState:u,triggerPauseAnimation:d,triggerErrorAnimation:f,clearErrorAnimation:p,startPulsatingAnimation:m,stopPulsatingAnimation:h,startIdleAnimations:_,stopIdleAnimations:v,triggerFadeTransition:y,setInitialAnimationState:b,cleanup:x}=ev(),{timerState:S,controls:C}=tv({autoStart:i,onCycleEnd:t,onMeasuringComplete:r,hasError:c,onPauseAnimation:d,onErrorAnimation:f,onClearErrorAnimation:p,onStartPulsating:m});return(0,n.useEffect)(()=>{let e=l.current;l.current!==void 0&&e!==S.currentState?(e===`measured`&&h(),e===`idle`&&v(),y()):b(),S.currentState===`idle`&&_(),l.current=S.currentState},[S.currentState,h,v,_,y,b]),(0,n.useEffect)(()=>{let t=!0,n=setTimeout(()=>{t&&e(C)},0);return()=>{t=!1,clearTimeout(n)}},[e,C]),(0,n.useEffect)(()=>x,[x]),a===`small`?(0,g.jsx)($_,{timerState:S,animationState:u,hasError:c,compact:o,className:s}):(0,g.jsx)(Q_,{timerState:S,animationState:u,hasError:c,className:s})})),rv=je,iv=Rn;function av(e){return(0,g.jsx)(An,{...e})}process.env.NODE_ENV!==`production`&&(av.propTypes={children:l.default.node,value:l.default.object.isRequired});function ov(e){return Mn(e)}function sv(e){return zt(`MuiSvgIcon`,e)}Bt(`MuiSvgIcon`,[`root`,`colorPrimary`,`colorSecondary`,`colorAction`,`colorError`,`colorDisabled`,`fontSizeInherit`,`fontSizeSmall`,`fontSizeMedium`,`fontSizeLarge`]);var cv=e=>{let{color:t,fontSize:n,classes:r}=e;return x({root:[`root`,t!==`inherit`&&`color${rv(t)}`,`fontSize${rv(n)}`]},sv,r)},lv=di(`svg`,{name:`MuiSvgIcon`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.color!==`inherit`&&t[`color${rv(n.color)}`],t[`fontSize${rv(n.fontSize)}`]]}})(iv(({theme:e})=>({userSelect:`none`,width:`1em`,height:`1em`,display:`inline-block`,flexShrink:0,transition:e.transitions?.create?.(`fill`,{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:`currentColor`}},{props:{fontSize:`inherit`},style:{fontSize:`inherit`}},{props:{fontSize:`small`},style:{fontSize:e.typography?.pxToRem?.(20)||`1.25rem`}},{props:{fontSize:`medium`},style:{fontSize:e.typography?.pxToRem?.(24)||`1.5rem`}},{props:{fontSize:`large`},style:{fontSize:e.typography?.pxToRem?.(35)||`2.1875rem`}},...Object.entries((e.vars??e).palette).filter(([,e])=>e&&e.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:`action`},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:`disabled`},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:`inherit`},style:{color:void 0}}]}))),uv=n.forwardRef(function(e,t){let r=ov({props:e,name:`MuiSvgIcon`}),{children:i,className:a,color:o=`inherit`,component:s=`svg`,fontSize:c=`medium`,htmlColor:l,inheritViewBox:u=!1,titleAccess:d,viewBox:f=`0 0 24 24`,...p}=r,m=n.isValidElement(i)&&i.type===`svg`,h={...r,color:o,component:s,fontSize:c,instanceFontSize:e.fontSize,inheritViewBox:u,viewBox:f,hasSvgAsChild:m},_={};return u||(_.viewBox=f),(0,g.jsxs)(lv,{as:s,className:C(cv(h).root,a),focusable:`false`,color:l,"aria-hidden":d?void 0:!0,role:d?`img`:void 0,ref:t,..._,...p,...m&&i.props,ownerState:h,children:[m?i.props.children:i,d?(0,g.jsx)(`title`,{children:d}):null]})});process.env.NODE_ENV!==`production`&&(uv.propTypes={children:l.default.node,classes:l.default.object,className:l.default.string,color:l.default.oneOfType([l.default.oneOf([`inherit`,`action`,`disabled`,`primary`,`secondary`,`error`,`info`,`success`,`warning`]),l.default.string]),component:l.default.elementType,fontSize:l.default.oneOfType([l.default.oneOf([`inherit`,`large`,`medium`,`small`]),l.default.string]),htmlColor:l.default.string,inheritViewBox:l.default.bool,shapeRendering:l.default.string,sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object]),titleAccess:l.default.string,viewBox:l.default.string}),uv.muiName=`SvgIcon`;function dv(e,t){function r(n,r){return(0,g.jsx)(uv,{"data-testid":process.env.NODE_ENV===`production`?void 0:`${t}Icon`,ref:r,...n,children:e})}return process.env.NODE_ENV!==`production`&&(r.displayName=`${t}Icon`),r.muiName=uv.muiName,n.memo(n.forwardRef(r))}function fv(e){let{controlled:t,default:r,name:i,state:a=`value`}=e,{current:o}=n.useRef(t!==void 0),[s,c]=n.useState(r),l=o?t:s;if(process.env.NODE_ENV!==`production`){n.useEffect(()=>{o!==(t!==void 0)&&console.error([`MUI: A component is changing the ${o?``:`un`}controlled ${a} state of ${i} to be ${o?`un`:``}controlled.`,`Elements should not switch from uncontrolled to controlled (or vice versa).`,`Decide between using a controlled or uncontrolled ${i} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.",`More info: https://fb.me/react-controlled-components`].join(`
49
+ `))},[a,i,t]);let{current:e}=n.useRef(r);n.useEffect(()=>{!o&&JSON.stringify(r)!==JSON.stringify(e)&&console.error([`MUI: A component is changing the default ${a} state of an uncontrolled ${i} after being initialized. To suppress this warning opt to use a controlled ${i}.`].join(`
50
+ `))},[JSON.stringify(r)])}return[l,n.useCallback(e=>{o||c(e)},[])]}var pv=dv((0,g.jsx)(`path`,{d:`M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z`}),`Clear`),mv=dv((0,g.jsx)(`path`,{d:`M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z`}),`FilterList`),hv=dv((0,g.jsx)(`path`,{d:`M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14`}),`Search`),gv=e.m((0,i.observer)(({data:e,columns:t,getRowData:i,onRowClick:a,selectedItem:o,getItemId:s,title:c,showCount:l=!0,searchPlaceholder:u=`Search programs`,dataGridProps:d,CustomToolbar:p,selectFirstByDefault:m=!1,sx:h})=>{let _=(0,r.useTheme)(),v=(0,f.useGridApiRef)(),y=(0,n.useRef)(null),[b,x]=(0,n.useState)(null),S=(0,n.useMemo)(()=>e.map(i),[e,i]);(0,n.useEffect)(()=>{v.current&&S.length>0&&v.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(e=>e.field)})},[S,t,v]),(0,n.useEffect)(()=>{if(!y.current||!v.current)return;let e=new ResizeObserver(()=>{setTimeout(()=>{v.current&&S.length>0&&v.current.autosizeColumns({includeOutliers:!0,includeHeaders:!0,expand:!0,columns:t.map(e=>e.field)})},100)});return e.observe(y.current),()=>{e.disconnect()}},[v,S.length,t]);let C=(0,n.useMemo)(()=>{if(o!==void 0)return o;if(b!==null)return b;if(m&&e.length>0){let t=e[0];return x(t),t}return null},[m,e,o,b]),w=t=>{let n=e.find(e=>i(e).id===t.id);n&&(o===void 0&&x(n),a&&a(n,t))},T=(0,n.useMemo)(()=>!C||!s?null:s(C),[C,s]);function E(){return(0,g.jsx)(f.Toolbar,{children:(0,g.jsxs)(r.Box,{sx:{display:`flex`,width:`100%`,gap:1,p:.5,alignItems:`center`},children:[c&&(0,g.jsxs)(r.Typography,{variant:`h6`,sx:{fontWeight:500,color:`white`},children:[c,l&&` (${e.length})`]}),(0,g.jsxs)(r.Box,{sx:{ml:`auto`,display:`flex`,gap:.5,alignItems:`center`,pr:1},children:[(0,g.jsx)(f.FilterPanelTrigger,{render:(0,g.jsx)(f.ToolbarButton,{"aria-label":`Show filters`,children:(0,g.jsx)(mv,{fontSize:`small`})})}),(0,g.jsx)(r.Divider,{orientation:`vertical`,flexItem:!0,sx:{height:`24px`,alignSelf:`center`}}),(0,g.jsx)(f.QuickFilter,{render:(e,t)=>(0,g.jsxs)(r.Box,{...e,sx:{display:`flex`,overflow:`hidden`},children:[!t.expanded&&(0,g.jsx)(f.QuickFilterTrigger,{render:(0,g.jsx)(f.ToolbarButton,{"aria-label":`Search`,children:(0,g.jsx)(hv,{fontSize:`small`})})}),(0,g.jsxs)(r.Box,{sx:{display:`flex`,overflow:`hidden`,transition:`all 0.3s ease-in-out`,width:t.expanded?`200px`:`0px`,position:`relative`},children:[(0,g.jsxs)(r.Box,{sx:{flex:1,position:`relative`,"& .MuiInputBase-root":{height:`32px`,borderRadius:`16px`,backgroundColor:`#171927`,paddingLeft:`40px`,paddingRight:t.expanded&&t.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:[t.expanded&&(0,g.jsx)(hv,{fontSize:`small`,sx:{position:`absolute`,left:`12px`,top:`50%`,transform:`translateY(-50%)`,color:`rgba(255, 255, 255, 0.6)`,zIndex:1,pointerEvents:`none`}}),(0,g.jsx)(f.QuickFilterControl,{placeholder:u})]}),t.expanded&&t.value!==``&&(0,g.jsx)(f.QuickFilterClear,{render:(0,g.jsx)(r.Box,{sx:{position:`absolute`,right:`8px`,top:`50%`,transform:`translateY(-50%)`,zIndex:1},children:(0,g.jsx)(r.Box,{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:(0,g.jsx)(f.ToolbarButton,{"aria-label":`Clear`,children:(0,g.jsx)(pv,{fontSize:`small`})})})})})]})]})})]})]})})}let D=p||E;return(0,g.jsx)(r.Box,{ref:y,sx:{height:`100%`,display:`flex`,flexDirection:`column`,"& *":{scrollbarWidth:`none`,msOverflowStyle:`none`,"&::-webkit-scrollbar":{display:`none`}},"&:hover *":{scrollbarWidth:`thin`,scrollbarColor:`${_.palette.divider} transparent`,"&::-webkit-scrollbar":{display:`block`,width:`8px`,height:`8px`},"&::-webkit-scrollbar-track":{background:`transparent`},"&::-webkit-scrollbar-thumb":{background:_.palette.divider,borderRadius:`4px`},"&::-webkit-scrollbar-thumb:hover":{background:_.palette.action.hover}},...h},children:(0,g.jsx)(f.DataGrid,{apiRef:v,rows:S,columns:t,onRowClick:w,disableColumnMenu:!1,disableRowSelectionOnClick:!0,disableMultipleRowSelection:!0,hideFooterSelectedRowCount:!0,filterMode:`client`,sortingOrder:[`desc`,`asc`],hideFooter:!1,showToolbar:!0,slots:{toolbar:D},initialState:{sorting:{sortModel:[]},filter:{filterModel:{items:[]}},...d?.initialState},...d,autosizeOnMount:!0,autosizeOptions:{...d?.autosizeOptions||{},includeOutliers:!0,includeHeaders:!0,expand:!0,columns:d?.autosizeOptions?.columns||t.map(e=>e.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`}},...T!==null&&{[`&[data-id="${T}"]`]:{backgroundColor:`transparent !important`,"&::before":{content:`""`,position:`absolute`,top:0,left:`16px`,right:`16px`,bottom:0,backgroundColor:`rgba(255, 255, 255, 0.08) !important`,borderRadius:`16px`,zIndex:0},"&:hover":{backgroundColor:`transparent !important`},"&:hover::before":{backgroundColor:`rgba(255, 255, 255, 0.12) !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":{},...d?.sx}})})}));gv.displayName=`WandelbotsDataGrid`;var _v=Qn({createStyledComponent:di(`div`,{name:`MuiStack`,slot:`Root`}),useThemeProps:e=>ov({props:e,name:`MuiStack`})});process.env.NODE_ENV!==`production`&&(_v.propTypes={children:l.default.node,component:l.default.elementType,direction:l.default.oneOfType([l.default.oneOf([`column-reverse`,`column`,`row-reverse`,`row`]),l.default.arrayOf(l.default.oneOf([`column-reverse`,`column`,`row-reverse`,`row`])),l.default.object]),divider:l.default.node,spacing:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.number,l.default.string])),l.default.number,l.default.object,l.default.string]),sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object]),useFlexGap:l.default.bool});var vv=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:21,height:21,viewBox:`0 0 21 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`g`,{id:`JogMinus`,children:(0,g.jsx)(`path`,{id:`Minus`,d:`M0 13V8H21V13H0Z`,fill:`white`})})]})),yv=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:21,height:21,viewBox:`0 0 21 21`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`g`,{id:`JogPlus`,children:(0,g.jsxs)(`g`,{id:`Plus`,children:[(0,g.jsx)(`path`,{d:`M0 13V8H8V13H0Z`,fill:`white`}),(0,g.jsx)(`path`,{d:`M8 0L13 2.18557e-07L13 21H8L8 0Z`,fill:`white`}),(0,g.jsx)(`path`,{d:`M13 13V8H21V13H13Z`,fill:`white`})]})})]})),bv=e.m((0,i.observer)(({colors:t,label:i,getDisplayedValue:a,startJogging:o,stopJogging:s,disabled:c,activeJoggingDirection:l,...u})=>{e.r(()=>{let e=a(),t=h.current;t&&(t.textContent=e)});let d=(0,r.useTheme)(),[f,p]=(0,n.useState)(null);(0,n.useEffect)(()=>{c&&S()},[c]);let m=l||f,h=(0,n.useRef)(null);t||={color:`#fff`,backgroundColor:`#000`,borderColor:`#000`,buttonBackgroundColor:{disabled:`#000`,default:`#000`,hovered:`#000`,pressed:`#000`},labelColor:`#000`};let _=m?t.buttonBackgroundColor?.pressed:t.borderColor,v={width:`55px`,color:t.color,path:{fill:t.color},alignContent:`center`,fontSize:`37px`,svg:{pointerEvents:`none`}},y={...v,backgroundColor:t.buttonBackgroundColor?.default,":hover":{backgroundColor:t.buttonBackgroundColor?.hovered},":active":{backgroundColor:t.buttonBackgroundColor?.pressed,color:t.backgroundColor,path:{fill:t.backgroundColor}},":disabled":{backgroundColor:t.buttonBackgroundColor?.disabled,"svg path":{fill:d.palette.action.disabled}}},b={...v,backgroundColor:t.buttonBackgroundColor?.pressed,color:t.backgroundColor,path:{fill:t.backgroundColor},":disabled":{backgroundColor:t.buttonBackgroundColor?.pressed,"svg path":{fill:d.palette.action.disabled}}};function x(e,t){c||e.button===0&&(p(t),o(t))}function S(){p(null),s()}return(0,g.jsxs)(_v,{height:`64px`,direction:`row`,justifyContent:`center`,...u,children:[(0,g.jsx)(r.IconButton,{disabled:c,disableRipple:!0,onPointerDown:e=>x(e,`-`),onPointerUp:S,onPointerOut:S,size:`large`,sx:{...m===`-`?b:y,borderRadius:`16px 0px 0px 16px`,borderLeft:`2px solid ${_??`#fff`}`,borderBottom:`2px solid ${_??`#fff`}`,borderTop:`2px solid ${_??`#fff`}`},children:(0,g.jsx)(vv,{})}),(0,g.jsxs)(_v,{spacing:`6px`,sx:{width:`150px`,backgroundColor:t.backgroundColor,alignItems:`center`,justifyContent:`center`,opacity:`0.9`,borderBottom:`2px solid ${_??`#fff`}`,borderTop:`2px solid ${_??`#fff`}`},children:[(0,g.jsx)(_v,{height:`22px`,direction:`row`,alignItems:`center`,justifyItems:`center`,spacing:1,sx:{userSelect:`none`,color:t.color,".MuiTypography-root":{fontWeight:700,...c?{color:d.palette.action.disabled}:{}},...c?{"svg path":{fill:d.palette.action.disabled}}:{}},children:i}),(0,g.jsx)(r.Typography,{height:`22px`,sx:{fontSize:`15px`,color:c?d.palette.action.disabled:t.color,fontWeight:700},ref:h,children:a()})]}),(0,g.jsx)(r.IconButton,{disableRipple:!0,disabled:c,onPointerDown:e=>x(e,`+`),onPointerUp:S,onPointerOut:S,size:`large`,sx:{...m===`+`?b:y,borderRadius:`0px 16px 16px 0px`,borderRight:`2px solid ${_??`#fff`}`,borderBottom:`2px solid ${_??`#fff`}`,borderTop:`2px solid ${_??`#fff`}`},children:(0,g.jsx)(yv,{})})]})})),xv=dv((0,g.jsx)(`path`,{d:`M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z`}),`ChevronLeft`),Sv=dv((0,g.jsx)(`path`,{d:`M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z`}),`ChevronRight`);function Cv(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var wv=typeof global==`object`&&global&&global.Object===Object&&global,Tv=typeof self==`object`&&self&&self.Object===Object&&self,Ev=wv||Tv||Function(`return this`)(),Dv=function(){return Ev.Date.now()},Ov=/\s/;function kv(e){for(var t=e.length;t--&&Ov.test(e.charAt(t)););return t}var Av=/^\s+/;function jv(e){return e&&e.slice(0,kv(e)+1).replace(Av,``)}var Mv=Ev.Symbol,Nv=Object.prototype,Pv=Nv.hasOwnProperty,Fv=Nv.toString,Iv=Mv?Mv.toStringTag:void 0;function Lv(e){var t=Pv.call(e,Iv),n=e[Iv];try{e[Iv]=void 0;var r=!0}catch{}var i=Fv.call(e);return r&&(t?e[Iv]=n:delete e[Iv]),i}var Rv=Object.prototype.toString;function zv(e){return Rv.call(e)}var Bv=`[object Null]`,Vv=`[object Undefined]`,Hv=Mv?Mv.toStringTag:void 0;function Uv(e){return e==null?e===void 0?Vv:Bv:Hv&&Hv in Object(e)?Lv(e):zv(e)}function Wv(e){return typeof e==`object`&&!!e}var Gv=`[object Symbol]`;function Kv(e){return typeof e==`symbol`||Wv(e)&&Uv(e)==Gv}var qv=NaN,Jv=/^[-+]0x[0-9a-f]+$/i,Yv=/^0b[01]+$/i,Xv=/^0o[0-7]+$/i,Zv=parseInt;function Qv(e){if(typeof e==`number`)return e;if(Kv(e))return qv;if(Cv(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=Cv(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=jv(e);var n=Yv.test(e);return n||Xv.test(e)?Zv(e.slice(2),n?2:8):Jv.test(e)?qv:+e}var $v=`Expected a function`,ey=Math.max,ty=Math.min;function ny(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError($v);t=Qv(t)||0,Cv(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?ey(Qv(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?ty(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Dv();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Dv())}function x(){var e=Dv(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}var ry=`Expected a function`;function iy(e,t,n){var r=!0,i=!0;if(typeof e!=`function`)throw TypeError(ry);return Cv(n)&&(r=`leading`in n?!!n.leading:r,i=`trailing`in n?!!n.trailing:i),ny(e,t,{leading:r,maxWait:t,trailing:i})}var ay=e.m((0,i.observer)(({startJogging:t,stopJogging:o,lowerLimit:s,upperLimit:c,useDegree:l,getValue:u,disabled:d,...f})=>{let{t:m}=(0,a.useTranslation)(),[h,_]=(0,n.useState)(),v=(0,r.useTheme)(),y={background:v.palette.backgroundPaperElevation?.[4],color:v.palette.backgroundPaperElevation?.[11]},b=(0,i.useLocalObservable)(()=>({activeJoggingDir:null,startJogging(e){this.activeJoggingDir=e,t(e)},stopJogging(){this.activeJoggingDir=null,o()}}));e.r(iy(()=>{_(l?x(u()):u())},50));function x(e){if(e!=null)return(0,p.radiansToDegrees)(e)}function S(e){e.button===0&&b.startJogging(`-`)}function C(e){e.button===0&&b.startJogging(`+`)}function w(e){b.stopJogging()}function T(e){b.stopJogging()}function E(e,t=1){if(e===void 0||isNaN(e))return``;let n=m(`General.degree.variable`,{amount:e.toFixed(t)});return e>0&&t===0?`+${n}`:n}function D(e,t=1){if(e===void 0||isNaN(e))return``;let n=m(`General.mm.variable`,{amount:e.toFixed(t)});return e>0&&t===0?`+${n}`:n}return(0,g.jsxs)(_v,{height:`64px`,width:`100%`,maxWidth:`260px`,direction:`row`,...f,sx:{"& .MuiIconButton-root":{width:`52px`,color:v.palette.text.primary,alignContent:`center`,backgroundColor:v.palette.backgroundPaperElevation?.[11],"& svg":{width:`42px`,height:`42px`},"&.Mui-disabled":{backgroundColor:v.palette.backgroundPaperElevation?.[11],color:v.palette.action.disabled,opacity:1},"&:hover":{backgroundColor:v.palette.backgroundPaperElevation?.[9]},"&:active":{...y}}},children:[(0,g.jsx)(r.IconButton,{onPointerDown:S,onPointerUp:w,onPointerOut:T,disabled:d,disableRipple:!0,sx:{borderRadius:`16px 0px 0px 16px`,...b.activeJoggingDir===`-`?y:{}},children:(0,g.jsx)(xv,{sx:{pointerEvents:`none`,color:v.componentsExt?.JoggingPanel?.JoggingJoint?.Joint?.arrowColor}})}),(0,g.jsxs)(_v,{flexGrow:1,alignItems:`center`,justifyContent:`center`,sx:{borderStyle:`solid`,borderLeftWidth:0,borderRightWidth:0,border:`none`,backgroundColor:v.palette.backgroundPaperElevation?.[11],paddingLeft:`20px`,paddingRight:`20px`,zIndex:1},children:[(0,g.jsx)(r.Typography,{sx:{fontSize:`15px`,fontWeight:700,position:`relative`,top:`5px`,color:d?v.palette.action.disabled:v.palette.text.primary},children:l?E(h):D(h)}),(0,g.jsx)(r.Slider,{disabled:!0,"aria-label":`Joint position`,min:l?x(s):s,max:l?x(c):c,value:h||0,track:!1,sx:{"& .MuiSlider-mark":{display:`none`},"& .MuiSlider-thumb":{width:`5px`,height:`12px`,borderRadius:`2px`,color:d?v.palette.action.disabled:v.palette.text.primary},"& .MuiSlider-markLabel":{top:`20px`,fontSize:`12px`,color:d?v.palette.action.disabled:v.palette.text.secondary},"& .MuiSlider-rail":{backgroundColor:v.palette.backgroundPaperElevation?.[5],opacity:1}},marks:s!==void 0&&c!==void 0&&[{value:l?x(s):s,label:l?E(x(s),0):D(s)},{value:l?x(c):c,label:l?E(x(c),0):D(c)}]})]}),(0,g.jsx)(r.IconButton,{onPointerDown:C,onPointerUp:w,onPointerOut:T,disabled:d,disableRipple:!0,sx:{borderRadius:`0px 16px 16px 0px`,...b.activeJoggingDir===`+`?y:{}},children:(0,g.jsx)(Sv,{sx:{pointerEvents:`none`,color:v.componentsExt?.JoggingPanel?.JoggingJoint?.Joint?.arrowColor}})})]})})),oy=dv((0,g.jsx)(`path`,{d:`M10 9h4V6h3l-5-5-5 5h3zm-1 1H6V7l-5 5 5 5v-3h3zm14 2-5-5v3h-3v4h3v3zm-9 3h-4v3H7l5 5 5-5h-3z`}),`OpenWith`),sy=dv((0,g.jsx)(`path`,{d:`M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92`}),`Share`),cy=null;function ly(e){let t=e[0];if(typeof t==`string`&&t.startsWith(`TSL:`)){let t=e[1];t&&t.isStackTrace?e[0]+=` `+t.getLocation():e[1]=`Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.`}return e}function uy(...e){e=ly(e);let t=`THREE.`+e.shift();if(cy)cy(`warn`,t,...e);else{let n=e[0];n&&n.isStackTrace?console.warn(n.getError(t)):console.warn(t,...e)}}Math.PI/180,180/Math.PI;function dy(e,t,n){return Math.max(t,Math.min(n,e))}var fy=class{constructor(e=0,t=0,n=0,r=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=r}static slerpFlat(e,t,n,r,i,a,o){let s=n[r+0],c=n[r+1],l=n[r+2],u=n[r+3],d=i[a+0],f=i[a+1],p=i[a+2],m=i[a+3];if(u!==m||s!==d||c!==f||l!==p){let e=s*d+c*f+l*p+u*m;e<0&&(d=-d,f=-f,p=-p,m=-m,e=-e);let t=1-o;if(e<.9995){let n=Math.acos(e),r=Math.sin(n);t=Math.sin(t*n)/r,o=Math.sin(o*n)/r,s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o}else{s=s*t+d*o,c=c*t+f*o,l=l*t+p*o,u=u*t+m*o;let e=1/Math.sqrt(s*s+c*c+l*l+u*u);s*=e,c*=e,l*=e,u*=e}}e[t]=s,e[t+1]=c,e[t+2]=l,e[t+3]=u}static multiplyQuaternionsFlat(e,t,n,r,i,a){let o=n[r],s=n[r+1],c=n[r+2],l=n[r+3],u=i[a],d=i[a+1],f=i[a+2],p=i[a+3];return e[t]=o*p+l*u+s*f-c*d,e[t+1]=s*p+l*d+c*u-o*f,e[t+2]=c*p+l*f+o*d-s*u,e[t+3]=l*p-o*u-s*d-c*f,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,r){return this._x=e,this._y=t,this._z=n,this._w=r,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){let n=e._x,r=e._y,i=e._z,a=e._order,o=Math.cos,s=Math.sin,c=o(n/2),l=o(r/2),u=o(i/2),d=s(n/2),f=s(r/2),p=s(i/2);switch(a){case`XYZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`YXZ`:this._x=d*l*u+c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`ZXY`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u-d*f*p;break;case`ZYX`:this._x=d*l*u-c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u+d*f*p;break;case`YZX`:this._x=d*l*u+c*f*p,this._y=c*f*u+d*l*p,this._z=c*l*p-d*f*u,this._w=c*l*u-d*f*p;break;case`XZY`:this._x=d*l*u-c*f*p,this._y=c*f*u-d*l*p,this._z=c*l*p+d*f*u,this._w=c*l*u+d*f*p;break;default:uy(`Quaternion: .setFromEuler() encountered an unknown order: `+a)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){let n=t/2,r=Math.sin(n);return this._x=e.x*r,this._y=e.y*r,this._z=e.z*r,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){let t=e.elements,n=t[0],r=t[4],i=t[8],a=t[1],o=t[5],s=t[9],c=t[2],l=t[6],u=t[10],d=n+o+u;if(d>0){let e=.5/Math.sqrt(d+1);this._w=.25/e,this._x=(l-s)*e,this._y=(i-c)*e,this._z=(a-r)*e}else if(n>o&&n>u){let e=2*Math.sqrt(1+n-o-u);this._w=(l-s)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(i+c)/e}else if(o>u){let e=2*Math.sqrt(1+o-n-u);this._w=(i-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(s+l)/e}else{let e=2*Math.sqrt(1+u-n-o);this._w=(a-r)/e,this._x=(i+c)/e,this._y=(s+l)/e,this._z=.25*e}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<1e-8?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(dy(this.dot(e),-1,1)))}rotateTowards(e,t){let n=this.angleTo(e);if(n===0)return this;let r=Math.min(1,t/n);return this.slerp(e,r),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x*=e,this._y*=e,this._z*=e,this._w*=e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=t._x,s=t._y,c=t._z,l=t._w;return this._x=n*l+a*o+r*c-i*s,this._y=r*l+a*s+i*o-n*c,this._z=i*l+a*c+n*s-r*o,this._w=a*l-n*o-r*s-i*c,this._onChangeCallback(),this}slerp(e,t){let n=e._x,r=e._y,i=e._z,a=e._w,o=this.dot(e);o<0&&(n=-n,r=-r,i=-i,a=-a,o=-o);let s=1-t;if(o<.9995){let e=Math.acos(o),c=Math.sin(e);s=Math.sin(s*e)/c,t=Math.sin(t*e)/c,this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this._onChangeCallback()}else this._x=this._x*s+n*t,this._y=this._y*s+r*t,this._z=this._z*s+i*t,this._w=this._w*s+a*t,this.normalize();return this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){let e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(e),r*Math.cos(e),i*Math.sin(t),i*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}},py=class e{constructor(t=0,n=0,r=0){e.prototype.isVector3=!0,this.x=t,this.y=n,this.z=r}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw Error(`index is out of range: `+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error(`index is out of range: `+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(hy.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(hy.setFromAxisAngle(e,t))}applyMatrix3(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6]*r,this.y=i[1]*t+i[4]*n+i[7]*r,this.z=i[2]*t+i[5]*n+i[8]*r,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let t=this.x,n=this.y,r=this.z,i=e.elements,a=1/(i[3]*t+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*t+i[4]*n+i[8]*r+i[12])*a,this.y=(i[1]*t+i[5]*n+i[9]*r+i[13])*a,this.z=(i[2]*t+i[6]*n+i[10]*r+i[14])*a,this}applyQuaternion(e){let t=this.x,n=this.y,r=this.z,i=e.x,a=e.y,o=e.z,s=e.w,c=2*(a*r-o*n),l=2*(o*t-i*r),u=2*(i*n-a*t);return this.x=t+s*c+a*u-o*l,this.y=n+s*l+o*c-i*u,this.z=r+s*u+i*l-a*c,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let t=this.x,n=this.y,r=this.z,i=e.elements;return this.x=i[0]*t+i[4]*n+i[8]*r,this.y=i[1]*t+i[5]*n+i[9]*r,this.z=i[2]*t+i[6]*n+i[10]*r,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=dy(this.x,e.x,t.x),this.y=dy(this.y,e.y,t.y),this.z=dy(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=dy(this.x,e,t),this.y=dy(this.y,e,t),this.z=dy(this.z,e,t),this}clampLength(e,t){let n=this.length();return this.divideScalar(n||1).multiplyScalar(dy(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){let n=e.x,r=e.y,i=e.z,a=t.x,o=t.y,s=t.z;return this.x=r*s-i*o,this.y=i*a-n*s,this.z=n*o-r*a,this}projectOnVector(e){let t=e.lengthSq();if(t===0)return this.set(0,0,0);let n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return my.copy(this).projectOnVector(e),this.sub(my)}reflect(e){return this.sub(my.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;let n=this.dot(e)/t;return Math.acos(dy(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return t*t+n*n+r*r}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){let r=Math.sin(t)*e;return this.x=r*Math.sin(n),this.y=Math.cos(t)*e,this.z=r*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){let t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){let t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),r=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=r,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}},my=new py,hy=new fy;function gy(e,t,n){if(t.length!==e.length)return!0;for(let r=0;r<t.length;r++)if(Math.abs(t[r]-e[r])>n)return!1;return!0}function _y(e,t,n){if(e===void 0&&t||e&&t===void 0||e?.orientation===void 0||t?.orientation===void 0||e?.position===void 0||t?.position===void 0)return!1;if(e===void 0||t===void 0)return!0;let r=0;return r+=Math.abs(e.orientation[0]-t.orientation[0]),r+=Math.abs(e.orientation[1]-t.orientation[1]),r+=Math.abs(e.orientation[2]-t.orientation[2]),r+=Math.abs(e.position[0]-t.position[0]),r+=Math.abs(e.position[1]-t.position[1]),r+=Math.abs(e.position[2]-t.position[2]),r<=n}function vy(e,t,n){return e.coordinate_system===t.coordinate_system&&e.tcp===t.tcp&&_y(e.tcp_pose,t.tcp_pose,n)}function yy(e,n){let r=new t.Vector3(n[0],n[1],n[2]),i=new t.Vector3(e[0],e[1],e[2]),a=r.length(),o=r.normalize(),s=i.length(),c=i.normalize();c.dot(o)<0&&(s=-s,c=c.multiplyScalar(-1));let l=s-a;return l-=2*Math.PI*Math.floor((l+Math.PI)/(2*Math.PI)),s=a+l,[...c.multiplyScalar(s)]}var by=1e-4,xy=class e{static async open(t,n){let[r,i]=n.split(`@`),a=await t.api.controller.getCurrentRobotControllerState(i),o=a?.motion_groups.find(e=>e.motion_group===n);if(!a||!o)throw Error(`Controller ${i} or motion group ${n} not found`);let s=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),c=await s.firstMessage(),l=(0,p.tryParseJson)(c.data)?.result;if(!l)throw Error(`Unable to parse initial motion state message ${c.data}`);return console.log(`Connected motion state websocket to motion group ${o.motion_group}. Initial state:\n `,l),new e(t,a,o,await t.api.motionGroup.getMotionGroupDescription(i,o.motion_group),l,s)}constructor(e,t,n,r,i,a){this.nova=e,this.controller=t,this.motionGroup=n,this.description=r,this.initialMotionState=i,this.motionStateSocket=a,this.rapidlyChangingMotionState=i,a.addEventListener(`message`,e=>{let t=(0,p.tryParseJson)(e.data)?.result;if(!t)throw Error(`Failed to get motion state for ${this.motionGroupId}: ${e.data}`);gy(this.rapidlyChangingMotionState.joint_position,t.joint_position,by)||(0,c.runInAction)(()=>{this.rapidlyChangingMotionState.joint_position=t.joint_position}),vy(this.rapidlyChangingMotionState,t,by)||(0,c.runInAction)(()=>{this.rapidlyChangingMotionState.tcp_pose==null?this.rapidlyChangingMotionState.tcp_pose=t.tcp_pose:t.tcp_pose?.orientation&&t.tcp_pose?.position&&this.rapidlyChangingMotionState.tcp_pose?.orientation?this.rapidlyChangingMotionState.tcp_pose={position:t.tcp_pose.position,orientation:yy(t.tcp_pose.orientation,this.rapidlyChangingMotionState.tcp_pose.orientation)}:console.warn(`Received incomplete tcp_pose, ignoring`,t.tcp_pose)}),this.rapidlyChangingMotionState.standstill!==t.standstill&&(0,c.runInAction)(()=>{this.rapidlyChangingMotionState.standstill=t.standstill})}),(0,c.makeAutoObservable)(this)}get motionGroupId(){return this.motionGroup.motion_group}get controllerId(){return this.controller.controller}get joints(){return this.initialMotionState.joint_position.map((e,t)=>({index:t}))}dispose(){this.motionStateSocket.close()}},Sy=`Movement request rejected. Another client is currently executing a 'Jogging' motion!`,Cy=class e{static async open(t,n,r={}){let i=new e(await xy.open(t,n),r);return await i.setJoggingMode(i.mode),i}constructor(e,t={}){this.motionStream=e,this.options=t,this.ENDPOINT_JOGGING=`/execution/jogging`,this.ENDPOINT_TRAJECTORY=`/execution/trajectory`,this.DEFAULT_MODE=`off`,this.DEFAULT_TCP=`Flange`,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=t?.tcp||e.motionGroup.tcp||this.DEFAULT_TCP,this.orientation=t?.orientation||this.DEFAULT_ORIENTATION,this.timeout=t?.timeout||this.DEFAULT_INIT_TIMEOUT,this.mode=t?.mode||this.DEFAULT_MODE,this.onError=t?.onError}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 numJoints(){return this.motionStream.joints.length}async stop(){if(this.joggingSocket){let e=Array(this.numJoints).fill(0);this.joggingSocket.sendJson({message_type:`JointVelocityRequest`,velocity:e})}this.trajectorySocket&&this.trajectorySocket.sendJson({message_type:`PauseMovementRequest`})}async dispose(){let e=[this.joggingSocket,this.trajectorySocket].filter(e=>e!==null);return e.forEach(e=>{e.dispose()}),this.joggingSocket=null,this.trajectorySocket=null,Promise.all(e.map(e=>e.closed()))}async setJoggingMode(e,t=!0){if(!(this.mode===e&&t)&&(this.dispose(),this.mode=e,this.mode===`jogging`))return this.initializeJoggingWebsocket()}async initializeJoggingWebsocket(){return new Promise((e,t)=>{let n=setTimeout(()=>{t(Error(`Jogging initialization timeout after ${this.timeout} seconds`))},this.timeout);this.joggingSocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_JOGGING),this.joggingSocket.addEventListener(`message`,r=>{let i=(0,p.tryParseJson)(r.data);if(i?.result?.kind===`INITIALIZE_RECEIVED`){clearTimeout(n),e();return}if(i?.result?.kind===`MOTION_ERROR`)if(clearTimeout(n),this.onBlocked&&i?.result?.message.includes(Sy)){this.joggingSocket?.dispose(),this.onBlocked();return}else this.onError?this.onError(r.data):t(Error(r.data))}),this.joggingSocket.sendJson({message_type:`InitializeJoggingRequest`,motion_group:this.motionGroupId,tcp:this.tcp})})}async rotateJoints({joint:e,direction:t,velocityValue:n,velocityUnit:r}){if(!this.joggingSocket||this.mode!==`jogging`)throw Error(`Joint jogging websocket not connected; create one by setting jogging mode to 'jogging'`);let i=Array(this.numJoints).fill(0);i[e]=t===`-`?-n:n,this.joggingSocket.sendJson({message_type:`JointVelocityRequest`,velocity:i})}async translateTCP({axis:e,direction:t,velocityMmPerSec:n}){if(!this.joggingSocket||this.mode!==`jogging`)throw Error(`Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'`);let r=[0,0,0],i=[0,0,0];i[p.XYZ_TO_VECTOR[e]]=t===`-`?-n:n,this.joggingSocket.sendJson({message_type:`TcpVelocityRequest`,translation:i,rotation:r,use_tool_coordinate_system:this.orientation===`tool`})}async rotateTCP({axis:e,direction:t,velocityRadsPerSec:n}){if(!this.joggingSocket||this.mode!==`jogging`)throw Error(`Continuous jogging websocket not connected; create one by setting jogging mode to 'jogging'`);let r=[0,0,0],i=[0,0,0];r[p.XYZ_TO_VECTOR[e]]=t===`-`?-n:n,this.joggingSocket.sendJson({message_type:`TcpVelocityRequest`,translation:i,rotation:r})}async runIncrementalCartesianMotion({currentTcpPose:e,currentJoints:t,velocityInRelevantUnits:n,axis:r,direction:i,motion:a}){let o=[];if(this.mode!==`trajectory`)throw Error(`Set jogging mode to 'trajectory' to run incremental cartesian motions`);if(a.type===`translate`){if(!e.position)throw Error(`Current pose has no position, cannot perform translation`);let t=[...e.position];t[p.XYZ_TO_VECTOR[r]]+=a.distanceMm*(i===`-`?-1:1),o.push({limits_override:{tcp_velocity_limit:n},path:{path_definition_name:`PathLine`,target_pose:{position:t,orientation:e.orientation}}})}else if(a.type===`rotate`){if(!e.orientation)throw Error(`Current pose has no orientation, cannot perform rotation`);let t=new py(e.orientation[0],e.orientation[1],e.orientation[2]),s=t.length(),c=t.clone().normalize(),l=a.distanceRads*(i===`-`?-1:1),u=new py(0,0,0);u[r]=1;let d=Math.cos(.5*l)*Math.cos(.5*s),f=Math.sin(.5*l)*Math.sin(.5*s),p=Math.sin(.5*l)*Math.cos(.5*s),m=Math.cos(.5*l)*Math.sin(.5*s),h=u.dot(c),g=u.clone().cross(c),_=2*Math.acos(d-f*h),v=_/Math.sin(.5*_),y=new py().addScaledVector(g,f).addScaledVector(u,p).addScaledVector(c,m).multiplyScalar(v);o.push({limits_override:{tcp_orientation_velocity_limit:n},path:{path_definition_name:`PathLine`,target_pose:{position:e.position,orientation:[...y]}}})}let s=this.motionStream.description;if(s.cycle_time===void 0){console.warn(`Current motion group has no cycle time, cannot plan jogging motion`);return}let l={motion_group_model:s.motion_group_model,cycle_time:s.cycle_time,mounting:s.mounting,global:s.operation_limits.auto_limits},u=await this.nova.api.trajectoryPlanning.planTrajectory({motion_group_setup:l,start_joint_position:t,motion_commands:o}),d=u.response;if(!d)throw Error(`Failed to plan jogging increment motion ${JSON.stringify(u)}`);this.trajectorySocket&&(console.warn(`Trajectory jogging websocket already open; will close`),this.trajectorySocket.dispose()),this.trajectorySocket=this.nova.openReconnectingWebsocket(this.ENDPOINT_TRAJECTORY);let f=e=>{if(!e||e.add_trajectory_error||e.message)if(this.onError)this.onError(e);else throw Error(e?.add_trajectory_error?.message||e?.message||`Failed to execute trajectory, unknown error`);if(!this.trajectorySocket)throw Error(`Failed to execute trajectory, websocket not available anymore`);this.trajectorySocket.sendJson({message_type:`StartMovementRequest`,direction:`DIRECTION_FORWARD`})},m=async()=>{await(0,c.when)(()=>!this.motionStream.rapidlyChangingMotionState.standstill),await(0,c.when)(()=>this.motionStream.rapidlyChangingMotionState.standstill),this.trajectorySocket?.dispose(),this.trajectorySocket=null},h=async()=>{await(0,c.when)(()=>this.motionStream.rapidlyChangingMotionState.standstill),this.trajectorySocket?.dispose(),this.trajectorySocket=null},g=async e=>{if(e?.message)if(this.onError){this.onError(e);return}else throw Error(e.message||`Failed to execute trajectory, unknown error`);this.motionStream.rapidlyChangingMotionState.standstill?await m():await h()};this.trajectorySocket.addEventListener(`message`,e=>{let t=(0,p.tryParseJson)(e.data);if(!t?.result?.kind)throw Error(`Failed to execute trajectory: Received invalid message ${e.data}`);if(this.onBlocked&&t.result.message?.includes(Sy)){this.onBlocked();return}if(t.result.kind===`INITIALIZE_RECEIVED`)f(t.result);else if(t.result.kind===`START_RECEIVED`)g(t);else if(t.result.kind!==`PAUSE_RECEIVED`)if(t.result.kind===`MOTION_ERROR`&&t.result.message)if(this.onError){this.onError(t);return}else throw Error(t.result.message);else throw Error(`Failed to execute trajectory, cannot handle message type "${t.result.kind}"`)}),this.trajectorySocket.sendJson({message_type:`InitializeMovementRequest`,trajectory:{message_type:`TrajectoryData`,motion_group:this.motionGroupId,data:d,tcp:this.tcp}})}};function wy(e,t){throw Error(t+` ${JSON.stringify(e)}`)}function Ty(t){return t instanceof s.AxiosError&&t.code===`ERR_NETWORK`?`Failed to connect to the server. Please check your internet connection.`:t instanceof s.AxiosError&&t.response?`${t.response?.status} ${t.response?.statusText} from ${t.response?.config.url}: ${JSON.stringify(t.response?.data)}`:t instanceof Error?t.message:`Unexpected error: ${e.v(t)||t}`}var Ey=e=>{let t=e.softTimeout||3e3,[i,a]=(0,n.useState)(!1),o=(0,r.useTheme)();return(0,n.useEffect)(()=>{let e=setTimeout(()=>{a(!0)},t);return()=>clearTimeout(e)}),(0,g.jsx)(r.Stack,{width:`100%`,height:`100%`,alignItems:`center`,justifyContent:`center`,sx:{color:o.palette.text.primary},children:e.error?(0,g.jsx)(Dy,{loadingMessage:e.message,error:e.error}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(r.CircularProgress,{sx:{marginBottom:`24px`}}),!!e.message&&(0,g.jsx)(`div`,{children:e.message}),(0,g.jsx)(r.Stack,{sx:{visibility:i?`visible`:`hidden`,marginTop:`1rem`,color:o.palette.text.secondary},children:`This is taking longer than expected...`})]})})},Dy=e=>{let t=Ty(e.error),n=e.error instanceof Error?e.error.stack:null;return(0,g.jsxs)(r.Stack,{sx:{maxHeight:`100%`,maxWidth:`min(100%, 800px)`,padding:2,overflow:`auto`,color:(0,r.useTheme)().palette.error.main,"& pre":{whiteSpace:`pre-wrap`,wordBreak:`break-word`,paddingBottom:`3rem`}},children:[(e.loadingMessage?`Error while ${(0,m.lowerFirst)((0,r.capitalize)(e.loadingMessage))} - `:``)+t,(0,g.jsx)(`br`,{}),n&&(0,g.jsx)(`pre`,{children:n})]})},Oy=`[object AsyncFunction]`,ky=`[object Function]`,Ay=`[object GeneratorFunction]`,jy=`[object Proxy]`;function My(e){if(!Cv(e))return!1;var t=Uv(e);return t==ky||t==Ay||t==Oy||t==jy}var Ny=Ev[`__core-js_shared__`],Py=function(){var e=/[^.]+$/.exec(Ny&&Ny.keys&&Ny.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Fy(e){return!!Py&&Py in e}var Iy=Function.prototype.toString;function Ly(e){if(e!=null){try{return Iy.call(e)}catch{}try{return e+``}catch{}}return``}var Ry=/[\\^$.*+?()[\]{}|]/g,zy=/^\[object .+?Constructor\]$/,By=Function.prototype,Vy=Object.prototype,Hy=By.toString,Uy=Vy.hasOwnProperty,Wy=RegExp(`^`+Hy.call(Uy).replace(Ry,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Gy(e){return!Cv(e)||Fy(e)?!1:(My(e)?Wy:zy).test(Ly(e))}function Ky(e,t){return e?.[t]}function qy(e,t){var n=Ky(e,t);return Gy(n)?n:void 0}var Jy=function(){try{var e=qy(Object,`defineProperty`);return e({},``,{}),e}catch{}}();function Yy(e,t,n){t==`__proto__`&&Jy?Jy(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Xy(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r}function Zy(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var Qy=Zy();function $y(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var eb=`[object Arguments]`;function tb(e){return Wv(e)&&Uv(e)==eb}var nb=Object.prototype,rb=nb.hasOwnProperty,ib=nb.propertyIsEnumerable,ab=tb(function(){return arguments}())?tb:function(e){return Wv(e)&&rb.call(e,`callee`)&&!ib.call(e,`callee`)},ob=Array.isArray;function sb(){return!1}var cb=typeof exports==`object`&&exports&&!exports.nodeType&&exports,lb=cb&&typeof module==`object`&&module&&!module.nodeType&&module,ub=lb&&lb.exports===cb?Ev.Buffer:void 0,db=(ub?ub.isBuffer:void 0)||sb,fb=9007199254740991,pb=/^(?:0|[1-9]\d*)$/;function mb(e,t){var n=typeof e;return t??=fb,!!t&&(n==`number`||n!=`symbol`&&pb.test(e))&&e>-1&&e%1==0&&e<t}var hb=9007199254740991;function gb(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=hb}var _b=`[object Arguments]`,vb=`[object Array]`,yb=`[object Boolean]`,bb=`[object Date]`,xb=`[object Error]`,Sb=`[object Function]`,Cb=`[object Map]`,wb=`[object Number]`,Tb=`[object Object]`,Eb=`[object RegExp]`,Db=`[object Set]`,Ob=`[object String]`,kb=`[object WeakMap]`,Ab=`[object ArrayBuffer]`,jb=`[object DataView]`,Mb=`[object Float32Array]`,Nb=`[object Float64Array]`,Pb=`[object Int8Array]`,Fb=`[object Int16Array]`,Ib=`[object Int32Array]`,Lb=`[object Uint8Array]`,Rb=`[object Uint8ClampedArray]`,zb=`[object Uint16Array]`,Bb=`[object Uint32Array]`,$={};$[Mb]=$[Nb]=$[Pb]=$[Fb]=$[Ib]=$[Lb]=$[Rb]=$[zb]=$[Bb]=!0,$[_b]=$[vb]=$[Ab]=$[yb]=$[jb]=$[bb]=$[xb]=$[Sb]=$[Cb]=$[wb]=$[Tb]=$[Eb]=$[Db]=$[Ob]=$[kb]=!1;function Vb(e){return Wv(e)&&gb(e.length)&&!!$[Uv(e)]}function Hb(e){return function(t){return e(t)}}var Ub=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Wb=Ub&&typeof module==`object`&&module&&!module.nodeType&&module,Gb=Wb&&Wb.exports===Ub&&wv.process,Kb=function(){try{return Wb&&Wb.require&&Wb.require(`util`).types||Gb&&Gb.binding&&Gb.binding(`util`)}catch{}}(),qb=Kb&&Kb.isTypedArray,Jb=qb?Hb(qb):Vb,Yb=Object.prototype.hasOwnProperty;function Xb(e,t){var n=ob(e),r=!n&&ab(e),i=!n&&!r&&db(e),a=!n&&!r&&!i&&Jb(e),o=n||r||i||a,s=o?$y(e.length,String):[],c=s.length;for(var l in e)(t||Yb.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||mb(l,c)))&&s.push(l);return s}var Zb=Object.prototype;function Qb(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||Zb)}function $b(e,t){return function(n){return e(t(n))}}var ex=$b(Object.keys,Object),tx=Object.prototype.hasOwnProperty;function nx(e){if(!Qb(e))return ex(e);var t=[];for(var n in Object(e))tx.call(e,n)&&n!=`constructor`&&t.push(n);return t}function rx(e){return e!=null&&gb(e.length)&&!My(e)}function ix(e){return rx(e)?Xb(e):nx(e)}function ax(e,t){return e&&Qy(e,t,ix)}function ox(e,t){return function(n,r){if(n==null)return n;if(!rx(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var sx=ox(ax);function cx(e,t,n,r){return sx(e,function(e,i,a){t(r,e,n(e),a)}),r}function lx(){this.__data__=[],this.size=0}function ux(e,t){return e===t||e!==e&&t!==t}function dx(e,t){for(var n=e.length;n--;)if(ux(e[n][0],t))return n;return-1}var fx=Array.prototype.splice;function px(e){var t=this.__data__,n=dx(t,e);return n<0?!1:(n==t.length-1?t.pop():fx.call(t,n,1),--this.size,!0)}function mx(e){var t=this.__data__,n=dx(t,e);return n<0?void 0:t[n][1]}function hx(e){return dx(this.__data__,e)>-1}function gx(e,t){var n=this.__data__,r=dx(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function _x(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_x.prototype.clear=lx,_x.prototype.delete=px,_x.prototype.get=mx,_x.prototype.has=hx,_x.prototype.set=gx;function vx(){this.__data__=new _x,this.size=0}function yx(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function bx(e){return this.__data__.get(e)}function xx(e){return this.__data__.has(e)}var Sx=qy(Ev,`Map`),Cx=qy(Object,`create`);function wx(){this.__data__=Cx?Cx(null):{},this.size=0}function Tx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var Ex=`__lodash_hash_undefined__`,Dx=Object.prototype.hasOwnProperty;function Ox(e){var t=this.__data__;if(Cx){var n=t[e];return n===Ex?void 0:n}return Dx.call(t,e)?t[e]:void 0}var kx=Object.prototype.hasOwnProperty;function Ax(e){var t=this.__data__;return Cx?t[e]!==void 0:kx.call(t,e)}var jx=`__lodash_hash_undefined__`;function Mx(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Cx&&t===void 0?jx:t,this}function Nx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Nx.prototype.clear=wx,Nx.prototype.delete=Tx,Nx.prototype.get=Ox,Nx.prototype.has=Ax,Nx.prototype.set=Mx;function Px(){this.size=0,this.__data__={hash:new Nx,map:new(Sx||_x),string:new Nx}}function Fx(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Ix(e,t){var n=e.__data__;return Fx(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Lx(e){var t=Ix(this,e).delete(e);return this.size-=+!!t,t}function Rx(e){return Ix(this,e).get(e)}function zx(e){return Ix(this,e).has(e)}function Bx(e,t){var n=Ix(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Vx(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vx.prototype.clear=Px,Vx.prototype.delete=Lx,Vx.prototype.get=Rx,Vx.prototype.has=zx,Vx.prototype.set=Bx;var Hx=200;function Ux(e,t){var n=this.__data__;if(n instanceof _x){var r=n.__data__;if(!Sx||r.length<Hx-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Vx(r)}return n.set(e,t),this.size=n.size,this}function Wx(e){this.size=(this.__data__=new _x(e)).size}Wx.prototype.clear=vx,Wx.prototype.delete=yx,Wx.prototype.get=bx,Wx.prototype.has=xx,Wx.prototype.set=Ux;var Gx=`__lodash_hash_undefined__`;function Kx(e){return this.__data__.set(e,Gx),this}function qx(e){return this.__data__.has(e)}function Jx(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Vx;++t<n;)this.add(e[t])}Jx.prototype.add=Jx.prototype.push=Kx,Jx.prototype.has=qx;function Yx(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Xx(e,t){return e.has(t)}var Zx=1,Qx=2;function $x(e,t,n,r,i,a){var o=n&Zx,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Qx?new Jx:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!Yx(t,function(e,t){if(!Xx(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}var eS=Ev.Uint8Array;function tS(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function nS(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var rS=1,iS=2,aS=`[object Boolean]`,oS=`[object Date]`,sS=`[object Error]`,cS=`[object Map]`,lS=`[object Number]`,uS=`[object RegExp]`,dS=`[object Set]`,fS=`[object String]`,pS=`[object Symbol]`,mS=`[object ArrayBuffer]`,hS=`[object DataView]`,gS=Mv?Mv.prototype:void 0,_S=gS?gS.valueOf:void 0;function vS(e,t,n,r,i,a,o){switch(n){case hS:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case mS:return!(e.byteLength!=t.byteLength||!a(new eS(e),new eS(t)));case aS:case oS:case lS:return ux(+e,+t);case sS:return e.name==t.name&&e.message==t.message;case uS:case fS:return e==t+``;case cS:var s=tS;case dS:var c=r&rS;if(s||=nS,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=iS,o.set(e,t);var u=$x(s(e),s(t),r,i,a,o);return o.delete(e),u;case pS:if(_S)return _S.call(e)==_S.call(t)}return!1}function yS(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function bS(e,t,n){var r=t(e);return ob(e)?r:yS(r,n(e))}function xS(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function SS(){return[]}var CS=Object.prototype.propertyIsEnumerable,wS=Object.getOwnPropertySymbols,TS=wS?function(e){return e==null?[]:(e=Object(e),xS(wS(e),function(t){return CS.call(e,t)}))}:SS;function ES(e){return bS(e,ix,TS)}var DS=1,OS=Object.prototype.hasOwnProperty;function kS(e,t,n,r,i,a){var o=n&DS,s=ES(e),c=s.length;if(c!=ES(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:OS.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var AS=qy(Ev,`DataView`),jS=qy(Ev,`Promise`),MS=qy(Ev,`Set`),NS=qy(Ev,`WeakMap`),PS=`[object Map]`,FS=`[object Object]`,IS=`[object Promise]`,LS=`[object Set]`,RS=`[object WeakMap]`,zS=`[object DataView]`,BS=Ly(AS),VS=Ly(Sx),HS=Ly(jS),US=Ly(MS),WS=Ly(NS),GS=Uv;(AS&&GS(new AS(new ArrayBuffer(1)))!=zS||Sx&&GS(new Sx)!=PS||jS&&GS(jS.resolve())!=IS||MS&&GS(new MS)!=LS||NS&&GS(new NS)!=RS)&&(GS=function(e){var t=Uv(e),n=t==FS?e.constructor:void 0,r=n?Ly(n):``;if(r)switch(r){case BS:return zS;case VS:return PS;case HS:return IS;case US:return LS;case WS:return RS}return t});var KS=GS,qS=1,JS=`[object Arguments]`,YS=`[object Array]`,XS=`[object Object]`,ZS=Object.prototype.hasOwnProperty;function QS(e,t,n,r,i,a){var o=ob(e),s=ob(t),c=o?YS:KS(e),l=s?YS:KS(t);c=c==JS?XS:c,l=l==JS?XS:l;var u=c==XS,d=l==XS,f=c==l;if(f&&db(e)){if(!db(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new Wx,o||Jb(e)?$x(e,t,n,r,i,a):vS(e,t,c,n,r,i,a);if(!(n&qS)){var p=u&&ZS.call(e,`__wrapped__`),m=d&&ZS.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new Wx,i(h,g,n,r,a)}}return f?(a||=new Wx,kS(e,t,n,r,i,a)):!1}function $S(e,t,n,r,i){return e===t?!0:e==null||t==null||!Wv(e)&&!Wv(t)?e!==e&&t!==t:QS(e,t,n,r,$S,i)}var eC=1,tC=2;function nC(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new Wx;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?$S(u,l,eC|tC,r,d):f))return!1}}return!0}function rC(e){return e===e&&!Cv(e)}function iC(e){for(var t=ix(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,rC(i)]}return t}function aC(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function oC(e){var t=iC(e);return t.length==1&&t[0][2]?aC(t[0][0],t[0][1]):function(n){return n===e||nC(n,e,t)}}var sC=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cC=/^\w*$/;function lC(e,t){if(ob(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Kv(e)?!0:cC.test(e)||!sC.test(e)||t!=null&&e in Object(t)}var uC=`Expected a function`;function dC(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(uC);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(dC.Cache||Vx),n}dC.Cache=Vx;var fC=500;function pC(e){var t=dC(e,function(e){return n.size===fC&&n.clear(),e}),n=t.cache;return t}var mC=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hC=/\\(\\)?/g,gC=pC(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(mC,function(e,n,r,i){t.push(r?i.replace(hC,`$1`):n||e)}),t});function _C(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var vC=1/0,yC=Mv?Mv.prototype:void 0,bC=yC?yC.toString:void 0;function xC(e){if(typeof e==`string`)return e;if(ob(e))return _C(e,xC)+``;if(Kv(e))return bC?bC.call(e):``;var t=e+``;return t==`0`&&1/e==-vC?`-0`:t}function SC(e){return e==null?``:xC(e)}function CC(e,t){return ob(e)?e:lC(e,t)?[e]:gC(SC(e))}var wC=1/0;function TC(e){if(typeof e==`string`||Kv(e))return e;var t=e+``;return t==`0`&&1/e==-wC?`-0`:t}function EC(e,t){t=CC(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[TC(t[n++])];return n&&n==r?e:void 0}function DC(e,t,n){var r=e==null?void 0:EC(e,t);return r===void 0?n:r}function OC(e,t){return e!=null&&t in Object(e)}function kC(e,t,n){t=CC(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=TC(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&gb(i)&&mb(o,i)&&(ob(e)||ab(e)))}function AC(e,t){return e!=null&&kC(e,t,OC)}var jC=1,MC=2;function NC(e,t){return lC(e)&&rC(t)?aC(TC(e),t):function(n){var r=DC(n,e);return r===void 0&&r===t?AC(n,e):$S(t,r,jC|MC)}}function PC(e){return e}function FC(e){return function(t){return t?.[e]}}function IC(e){return function(t){return EC(t,e)}}function LC(e){return lC(e)?FC(TC(e)):IC(e)}function RC(e){return typeof e==`function`?e:e==null?PC:typeof e==`object`?ob(e)?NC(e[0],e[1]):oC(e):LC(e)}function zC(e,t){return function(n,r){var i=ob(n)?Xy:cx,a=t?t():{};return i(n,e,RC(r,2),a)}}var BC=zC(function(e,t,n){Yy(e,n,t)}),VC=0;function HC(e){var t=++VC;return SC(e)+t}var UC=[{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}],WC=[{id:`continuous`},...UC],GC=[`coordsys`,`tool`],KC=function(e){return e.REVOLUTE=`REVOLUTE`,e.PRISMATIC=`PRISMATIC`,e}({}),qC=class e{static async loadFor(t){let{nova:n}=t,[r,i]=await Promise.all([n.api.controller.listCoordinateSystems(t.motionStream.controllerId,`ROTATION_VECTOR`),n.api.motionGroup.getMotionGroupDescription(t.motionStream.controllerId,t.motionGroupId)]),a=Object.entries(i.tcps||{}).map(([e,t])=>({id:e,readable_name:t.name,position:t.pose.position,orientation:t.pose.orientation}));return new e(t,r||[],i,a)}constructor(e,t,n,r){this.jogger=e,this.coordSystems=t,this.motionGroupDescription=n,this.tcps=r,this.selectedTabId=`cartesian`,this.activationState=`inactive`,this.activationError=null,this.activationCounter=0,this.locks=new Set,this.blocked=!1,this.selectedCoordSystemId=`world`,this.selectedTcpId=``,this.selectedOrientation=`coordsys`,this.selectedIncrementId=`continuous`,this.selectedCartesianMotionType=`translate`,this.incrementJogInProgress=null,this.translationVelocityMmPerSec=10,this.rotationVelocityDegPerSec=1,this.minTranslationVelocityMmPerSec=5,this.maxTranslationVelocityMmPerSec=250,this.minRotationVelocityDegPerSec=1,this.maxRotationVelocityDegPerSec=60,this.showCoordSystemSelect=!1,this.showTcpSelect=!0,this.showOrientationSelect=!0,this.showIncrementSelect=!0,this.showTabIcons=!1,this.showVelocitySliderLabel=!0,this.showVelocityLegend=!1,this.showJointsLegend=!1,this.disposers=[];for(let e of t)if(e.coordinate_system===``){e.coordinate_system=`world`;break}this.selectedCoordSystemId=t[0]?.coordinate_system||`world`,this.selectedTcpId=r[0]?.id||``,(0,c.makeAutoObservable)(this,{},{autoBind:!0}),this.jogger.onBlocked=()=>{this.block()},this.loadFromLocalStorage(),this.disposers.push((0,c.autorun)(()=>this.saveToLocalStorage())),window.joggingStore=this}dispose(){for(let e of this.disposers)e();this.jogger.dispose()}get coordSystemCountByName(){return(0,m.countBy)(this.coordSystems,e=>e.name)}async deactivate(){if(this.jogger.mode===`jogging`)return this.jogger.stop()}async activate(){return this.currentTab.id===`cartesian`?((this.jogger.tcp!==this.selectedTcpId||this.jogger.orientation!==this.selectedOrientation)&&this.jogger.setOptions({tcp:this.selectedTcpId,orientation:this.selectedOrientation}),this.activeDiscreteIncrement?this.jogger.setJoggingMode(`trajectory`):this.jogger.setJoggingMode(`jogging`)):this.jogger.setJoggingMode(`jogging`),this.jogger}loadFromLocalStorage(){let e=(0,p.tryParseJson)(localStorage.getItem(`joggingToolStore`));e&&(this.tabsById[e.selectedTabId]&&(this.selectedTabId=e.selectedTabId),this.coordSystemsById[e.selectedCoordSystemId]&&(this.selectedCoordSystemId=e.selectedCoordSystemId),this.tcpsById[e.selectedTcpId]&&(this.selectedTcpId=e.selectedTcpId),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,selectedTcpId:this.selectedTcpId,selectedOrientation:this.selectedOrientation,selectedIncrementId:this.selectedIncrementId,selectedCartesianMotionType:this.selectedCartesianMotionType}}get tabs(){let e=[{id:`joint`,label:`Joints`}];return this.isTcpCartesianMoveable&&e.unshift({id:`cartesian`,label:`Cartesian`}),e}get incrementOptions(){return WC}get discreteIncrementOptions(){return UC}get incrementOptionsById(){return BC(this.incrementOptions,e=>e.id)}get tabsById(){return BC(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 BC(this.coordSystems,e=>e.coordinate_system)}get selectedCoordSystem(){return this.coordSystemsById[this.selectedCoordSystemId]}get activeCoordSystemId(){return this.selectedOrientation===`tool`?`tool`:this.selectedCoordSystemId}get tcpsById(){return BC(this.tcps,e=>e.id)}get activeDiscreteIncrement(){return this.selectedOrientation===`tool`?void 0:UC.find(e=>e.id===this.selectedIncrementId)}get rotationVelocityRadsPerSec(){return this.rotationVelocityDegPerSec*Math.PI/180}get velocityInDisplayUnits(){return this.currentMotionType===`translate`?this.translationVelocityMmPerSec:this.rotationVelocityDegPerSec}get minVelocityInDisplayUnits(){return this.currentMotionType===`translate`?this.minTranslationVelocityMmPerSec:this.minRotationVelocityDegPerSec}get maxVelocityInDisplayUnits(){return this.currentMotionType===`translate`?this.maxTranslationVelocityMmPerSec:this.maxRotationVelocityDegPerSec}get currentMotionType(){return this.selectedTabId===`cartesian`&&this.selectedCartesianMotionType===`translate`||this.jointCategory===KC.PRISMATIC?`translate`:`rotate`}get jointCategory(){return this.motionGroupDescription.motion_group_model===`ABB_IRT710`?KC.PRISMATIC:KC.REVOLUTE}get isTcpCartesianMoveable(){return this.motionGroupDescription.motion_group_model!==`ABB_IRT710`}onTabChange(e,t){this.selectedTabId=(this.tabs[t]||this.tabs[0]).id}setSelectedCoordSystemId(e){this.selectedCoordSystemId=e}setSelectedTcpId(e){this.selectedTcpId=e}setSelectedOrientation(e){this.selectedOrientation=e}setSelectedIncrementId(e){this.selectedIncrementId=e}setCurrentIncrementJog(e){this.incrementJogInProgress=e}setVelocityFromSlider(e){this.currentMotionType===`translate`?this.translationVelocityMmPerSec=e:this.rotationVelocityDegPerSec=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){let t=HC();this.lock(t);try{return await e()}finally{this.unlock(t)}}},JC=(0,i.observer)(({store:e})=>{let{t}=(0,a.useTranslation)();return(0,g.jsx)(r.Backdrop,{open:!0,sx:{position:`absolute`,zIndex:e=>e.zIndex.drawer+1,color:`#fff`,background:`rgba(15, 15, 15, 0.88)`,justifyContent:`flex-start`,alignItems:`flex-start`},children:(0,g.jsxs)(r.Stack,{sx:{m:2,width:`100%`},children:[(0,g.jsxs)(r.Alert,{severity:`error`,sx:{mb:2},children:[(0,g.jsx)(r.AlertTitle,{children:t(`Jogging.Blocked.ti`)}),t(`Jogging.Blocked.lb`)]}),(0,g.jsx)(r.Button,{variant:`contained`,color:`secondary`,onClick:()=>e.unblock(),children:t(`Jogging.Blocked.Reenable.bt`)})]})})}),YC=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:19,height:10,fill:`none`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{fill:`#fff`,fillRule:`evenodd`,d:`M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0`,clipRule:`evenodd`})]})),XC=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:19,height:10,fill:`none`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{fill:`#fff`,fillRule:`evenodd`,d:`M5.131.312a.9.9 0 0 1 0 1.272L3.07 3.645h12.44l-2.06-2.061A.9.9 0 0 1 14.72.313l3.596 3.596a.9.9 0 0 1 0 1.271l-3.596 3.597a.9.9 0 0 1-1.271-1.272l2.061-2.062H3.07L5.13 7.505A.9.9 0 0 1 3.86 8.777L.263 5.18a.9.9 0 0 1 0-1.271L3.86.312a.9.9 0 0 1 1.271 0`,clipRule:`evenodd`})]})),ZC=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:10,height:19,fill:`none`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{fill:`#fff`,fillRule:`evenodd`,d:`M9.522 14.811A.899.899 0 1 0 8.25 13.54L6.19 15.601V3.16L8.25 5.221A.9.9 0 0 0 9.522 3.95L5.926.354a.9.9 0 0 0-1.272 0L1.058 3.95a.9.9 0 1 0 1.271 1.271L4.391 3.16v12.442L2.329 13.54a.899.899 0 1 0-1.271 1.271l3.596 3.597a.9.9 0 0 0 1.272 0z`,clipRule:`evenodd`})]})),QC=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:16,height:16,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M8 16C5.76667 16 3.875 15.225 2.325 13.675C0.775 12.125 0 10.2333 0 8C0 5.76667 0.775 3.875 2.325 2.325C3.875 0.775 5.76667 0 8 0C9.15 0 10.25 0.2375 11.3 0.7125C12.35 1.1875 13.25 1.86667 14 2.75V0H16V7H9V5H13.2C12.6667 4.06667 11.9375 3.33333 11.0125 2.8C10.0875 2.26667 9.08333 2 8 2C6.33333 2 4.91667 2.58333 3.75 3.75C2.58333 4.91667 2 6.33333 2 8C2 9.66667 2.58333 11.0833 3.75 12.25C4.91667 13.4167 6.33333 14 8 14C9.28333 14 10.4417 13.6333 11.475 12.9C11.0583 14.1 12.5083 12.1667 11.475 12.9L12.9 14.325C11.4667 15.4417 9.83333 16 8 16Z`,fill:`white`})]}));function $C(e,t){return $S(e,t)}var ew=({store:t})=>{let{t:i}=(0,a.useTranslation)(),[o,s]=(0,n.useState)(t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached),c=(0,n.useRef)(o);e.r(()=>{let e=t.jogger.motionStream.rapidlyChangingMotionState.joint_limit_reached.limit_reached;$C(c.current,e)||(c.current=e,s(e))});let l=[];for(let[e,t]of o.entries())t&&l.push(e);return(0,g.jsx)(r.Typography,{color:`error`,sx:{margin:`0.5rem 1rem`,textAlign:`center`,minHeight:`1.5rem`,visibility:l.length?`visible`:`hidden`},children:i(`Jogging.JointLimitsReached.lb`,{jointNumbers:l.map(e=>e+1).join(`, `)})})},tw=(0,r.styled)(r.FormControl)(({theme:e})=>({"&.MuiFormControl-root":{".MuiSelect-select":{paddingTop:`20px`,paddingLeft:`12px`},label:{pointerEvents:`none`,fontSize:`16px`},".MuiInputLabel-root":{"&.Mui-focused":{color:e.palette.text.primary}}}}));function nw({labelValue:e,...t}){return(0,g.jsxs)(tw,{fullWidth:!0,variant:`filled`,children:[(0,g.jsx)(r.InputLabel,{id:t.labelId,children:e}),(0,g.jsx)(r.Select,{...t})]})}var rw=(0,i.observer)(({store:e})=>{let{t}=(0,a.useTranslation)(),i=(0,n.useId)(),o=[];function s(e){switch(e){case`coordsys`:return t(`Jogging.Orientation.coordsys`);case`tool`:return t(`Jogging.Orientation.tool`);default:return e}}return e.showCoordSystemSelect&&o.push((0,g.jsx)(nw,{labelId:`jogging-coord-select-${i}`,labelValue:t(`Jogging.CoordinateSystem.hlb`),value:e.selectedCoordSystemId,size:`small`,variant:`filled`,displayEmpty:!0,onChange:t=>e.setSelectedCoordSystemId(t.target.value),disabled:e.isLocked,children:e.coordSystems.map(t=>(0,g.jsx)(r.MenuItem,{value:t.coordinate_system,children:t.name&&e.coordSystemCountByName[t.name]>1?`${t.name} / ${t.coordinate_system}`:t.name||t.coordinate_system},t.coordinate_system))},`coord`)),e.showTcpSelect&&o.push((0,g.jsx)(nw,{labelId:`jogging-tcp-select-${i}`,labelValue:`TCP`,value:e.selectedTcpId,size:`small`,variant:`filled`,onChange:t=>e.setSelectedTcpId(t.target.value),disabled:e.isLocked,children:e.tcps.map(e=>(0,g.jsx)(r.MenuItem,{value:e.id,children:e.id},e.id))},`tcp`)),e.showOrientationSelect&&o.push((0,g.jsx)(nw,{labelValue:t(`Jogging.Cartesian.Orientation.lb`),labelId:`orientation-select-${i}`,value:e.selectedOrientation,onChange:t=>e.setSelectedOrientation(t.target.value),disabled:e.isLocked,children:GC.map(e=>(0,g.jsx)(r.MenuItem,{value:e,children:s(e)},e))},`orientation`)),e.showIncrementSelect&&o.push((0,g.jsxs)(nw,{labelValue:t(`Jogging.Increment.hlb`),labelId:`jogging-increment-select-${i}`,size:`small`,variant:`filled`,value:e.activeDiscreteIncrement?.id||`continuous`,onChange:t=>e.setSelectedIncrementId(t.target.value),disabled:e.isLocked,children:[(0,g.jsx)(r.MenuItem,{value:`continuous`,children:t(`Jogging.Increment.Continuous.dd`)},`continuous`),e.selectedOrientation===`tool`?null:e.discreteIncrementOptions.map(t=>(0,g.jsx)(r.MenuItem,{value:t.id,children:e.currentMotionType===`translate`?`${t.mm}mm`:`${t.degrees}°`},t.id))]},`increment`)),(0,g.jsx)(r.Box,{component:`div`,sx:{display:`grid`,gap:`16px`,gridTemplateColumns:`1fr 1fr`,gridAutoRows:`min-content`,"& label":{opacity:.7,fontSize:`12px`,marginBottom:`4px`}},children:o.map((e,t)=>(0,g.jsx)(r.Box,{sx:{gridColumn:o.length%2==1&&t===o.length-1?`span 2`:`auto`},children:e},t))})}),iw=(0,r.styled)(r.ToggleButtonGroup)(({theme:e})=>({"&.MuiToggleButtonGroup-root":{background:e.palette.backgroundPaperElevation?.[8],borderRadius:`8px`,padding:`4px`,gap:`4px`,button:{border:`none`,borderRadius:`4px`,flex:`1 1 0px`,minWidth:0,"&.MuiToggleButtonGroup-firstButton":{borderRadius:`8px 4px 4px 8px`},"&.MuiToggleButtonGroup-lastButton":{borderRadius:`4px 8px 8px 4px`}}}}));function aw(e,t){return process.env.NODE_ENV===`production`?()=>null:function(...n){return e(...n)||t(...n)}}function ow(e){return typeof e==`string`}function sw(e,t,n){return e===void 0||ow(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function cw(e,t=[]){if(e===void 0)return{};let n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]==`function`&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function lw(e){if(e===void 0)return{};let t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&typeof e[t]==`function`)).forEach(n=>{t[n]=e[n]}),t}function uw(e){let{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:a}=e;if(!t){let e=C(n?.className,a,i?.className,r?.className),t={...n?.style,...i?.style,...r?.style},o={...n,...i,...r};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}let o=cw({...i,...r}),s=lw(r),c=lw(i),l=t(o),u=C(l?.className,n?.className,a,i?.className,r?.className),d={...l?.style,...n?.style,...i?.style,...r?.style},f={...l,...n,...c,...s};return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:l.ref}}function dw(e,t,n){return typeof e==`function`?e(t,n):e}function fw(e){let{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:dw(n,r),{props:s,internalRef:c}=uw({...a,externalSlotProps:o}),l=fi(c,o?.ref,e.additionalProps?.ref);return sw(t,{...s,ref:l},r)}function pw(e){try{return e.matches(`:focus-visible`)}catch{process.env.NODE_ENV!==`production`&&!window.navigator.userAgent.includes(`jsdom`)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.",`Some components rely on this feature to work properly.`].join(`
51
+ `))}return!1}var mw={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:`1px`};function hw(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}var gw=2;function _w(e,t,n,r,i){return n===1?Math.min(e+t,i):Math.max(e-t,r)}function vw(e,t){return e-t}function yw(e,t){let{index:n}=e.reduce((e,n,r)=>{let i=Math.abs(t-n);return e===null||i<e.distance||i===e.distance?{distance:i,index:r}:e},null)??{};return n}function bw(e,t){if(t.current!==void 0&&e.changedTouches){let n=e;for(let e=0;e<n.changedTouches.length;e+=1){let r=n.changedTouches[e];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function xw(e,t,n){return(e-t)*100/(n-t)}function Sw(e,t,n){return(n-t)*e+t}function Cw(e){if(Math.abs(e)<1){let t=e.toExponential().split(`e-`),n=t[0].split(`.`)[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(`.`)[1];return t?t.length:0}function ww(e,t,n){let r=Math.round((e-n)/t)*t+n;return Number(r.toFixed(Cw(t)))}function Tw({values:e,newValue:t,index:n}){let r=e.slice();return r[n]=t,r.sort(vw)}function Ew({sliderRef:e,activeIndex:t,setActive:n}){let r=la(e.current);(!e.current?.contains(r.activeElement)||Number(r?.activeElement?.getAttribute(`data-index`))!==t)&&e.current?.querySelector(`[type="range"][data-index="${t}"]`).focus(),n&&n(t)}function Dw(e,t){return typeof e==`number`&&typeof t==`number`?e===t:typeof e==`object`&&typeof t==`object`?hw(e,t):!1}var Ow={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},kw=e=>e,Aw;function jw(){return Aw===void 0&&(Aw=typeof CSS<`u`&&typeof CSS.supports==`function`?CSS.supports(`touch-action`,`none`):!0),Aw}function Mw(e){let{"aria-labelledby":t,defaultValue:r,disabled:i=!1,disableSwap:a=!1,isRtl:o=!1,marks:s=!1,max:c=100,min:l=0,name:u,onChange:d,onChangeCommitted:f,orientation:p=`horizontal`,rootRef:m,scale:h=kw,step:g=1,shiftStep:_=10,tabIndex:v,value:y}=e,b=n.useRef(void 0),[x,S]=n.useState(-1),[C,w]=n.useState(-1),[T,E]=n.useState(!1),D=n.useRef(0),O=n.useRef(null),[k,ee]=fv({controlled:y,default:r??l,name:`Slider`}),A=d&&((e,t,n)=>{let r=e.nativeEvent||e,i=new r.constructor(r.type,r);Object.defineProperty(i,`target`,{writable:!0,value:{value:t,name:u}}),O.current=t,d(i,t,n)}),j=Array.isArray(k),M=j?k.slice().sort(vw):[k];M=M.map(e=>e==null?l:un(e,l,c));let te=s===!0&&g!==null?[...Array(Math.floor((c-l)/g)+1)].map((e,t)=>({value:l+g*t})):s||[],N=te.map(e=>e.value),[ne,P]=n.useState(-1),re=n.useRef(null),F=fi(m,re),I=e=>t=>{let n=Number(t.currentTarget.getAttribute(`data-index`));pw(t.target)&&P(n),w(n),e?.onFocus?.(t)},ie=e=>t=>{pw(t.target)||P(-1),w(-1),e?.onBlur?.(t)},ae=(e,t)=>{let n=Number(e.currentTarget.getAttribute(`data-index`)),r=M[n],i=N.indexOf(r),o=t;if(te&&g==null){let e=N[N.length-1];o=o>=e?e:o<=N[0]?N[0]:o<r?N[i-1]:N[i+1]}if(o=un(o,l,c),j){a&&(o=un(o,M[n-1]||-1/0,M[n+1]||1/0));let e=o;o=Tw({values:M,newValue:o,index:n});let t=n;a||(t=o.indexOf(e)),Ew({sliderRef:re,activeIndex:t})}ee(o),P(n),A&&!Dw(o,k)&&A(e,o,n),f&&f(e,O.current??o)},oe=e=>t=>{if([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`].includes(t.key)){t.preventDefault();let e=Number(t.currentTarget.getAttribute(`data-index`)),n=M[e],r=null;if(g!=null){let e=t.shiftKey?_:g;switch(t.key){case`ArrowUp`:r=_w(n,e,1,l,c);break;case`ArrowRight`:r=_w(n,e,o?-1:1,l,c);break;case`ArrowDown`:r=_w(n,e,-1,l,c);break;case`ArrowLeft`:r=_w(n,e,o?1:-1,l,c);break;case`PageUp`:r=_w(n,_,1,l,c);break;case`PageDown`:r=_w(n,_,-1,l,c);break;case`Home`:r=l;break;case`End`:r=c;break;default:break}}else if(te){let e=N[N.length-1],i=N.indexOf(n),a=[o?`ArrowRight`:`ArrowLeft`,`ArrowDown`,`PageDown`,`Home`],s=[o?`ArrowLeft`:`ArrowRight`,`ArrowUp`,`PageUp`,`End`];a.includes(t.key)?r=i===0?N[0]:N[i-1]:s.includes(t.key)&&(r=i===N.length-1?e:N[i+1])}r!=null&&ae(t,r)}e?.onKeyDown?.(t)};ln(()=>{i&&re.current.contains(document.activeElement)&&document.activeElement?.blur()},[i]),i&&x!==-1&&S(-1),i&&ne!==-1&&P(-1);let se=e=>t=>{e.onChange?.(t),ae(t,t.target.valueAsNumber)},ce=n.useRef(void 0),le=p;o&&p===`horizontal`&&(le+=`-reverse`);let ue=({finger:e,move:t=!1})=>{let{current:n}=re,{width:r,height:i,bottom:o,left:s}=n.getBoundingClientRect(),u;u=le.startsWith(`vertical`)?(o-e.y)/i:(e.x-s)/r,le.includes(`-reverse`)&&(u=1-u);let d;d=Sw(u,l,c),d=g?ww(d,g,l):N[yw(N,d)],d=un(d,l,c);let f=0;if(j){f=t?ce.current:yw(M,d),a&&(d=un(d,M[f-1]||-1/0,M[f+1]||1/0));let e=d;d=Tw({values:M,newValue:d,index:f}),a&&t||(f=d.indexOf(e),ce.current=f)}return{newValue:d,activeIndex:f}},de=Ma(e=>{let t=bw(e,b);if(!t)return;if(D.current+=1,e.type===`mousemove`&&e.buttons===0){L(e);return}let{newValue:n,activeIndex:r}=ue({finger:t,move:!0});Ew({sliderRef:re,activeIndex:r,setActive:S}),ee(n),!T&&D.current>gw&&E(!0),A&&!Dw(n,k)&&A(e,n,r)}),L=Ma(e=>{let t=bw(e,b);if(E(!1),!t)return;let{newValue:n}=ue({finger:t,move:!0});S(-1),e.type===`touchend`&&w(-1),f&&f(e,O.current??n),b.current=void 0,R()}),fe=Ma(e=>{if(i)return;jw()||e.preventDefault();let t=e.changedTouches[0];t!=null&&(b.current=t.identifier);let n=bw(e,b);if(n!==!1){let{newValue:t,activeIndex:r}=ue({finger:n});Ew({sliderRef:re,activeIndex:r,setActive:S}),ee(t),A&&!Dw(t,k)&&A(e,t,r)}D.current=0;let r=la(re.current);r.addEventListener(`touchmove`,de,{passive:!0}),r.addEventListener(`touchend`,L,{passive:!0})}),R=n.useCallback(()=>{let e=la(re.current);e.removeEventListener(`mousemove`,de),e.removeEventListener(`mouseup`,L),e.removeEventListener(`touchmove`,de),e.removeEventListener(`touchend`,L)},[L,de]);n.useEffect(()=>{let{current:e}=re;return e.addEventListener(`touchstart`,fe,{passive:jw()}),()=>{e.removeEventListener(`touchstart`,fe),R()}},[R,fe]),n.useEffect(()=>{i&&R()},[i,R]);let pe=e=>t=>{if(e.onMouseDown?.(t),i||t.defaultPrevented||t.button!==0)return;t.preventDefault();let n=bw(t,b);if(n!==!1){let{newValue:e,activeIndex:r}=ue({finger:n});Ew({sliderRef:re,activeIndex:r,setActive:S}),ee(e),A&&!Dw(e,k)&&A(t,e,r)}D.current=0;let r=la(re.current);r.addEventListener(`mousemove`,de,{passive:!0}),r.addEventListener(`mouseup`,L)},me=xw(j?M[0]:l,l,c),he=xw(M[M.length-1],l,c)-me,ge=(e={})=>{let t=cw(e),n={onMouseDown:pe(t||{})},r={...t,...n};return{...e,ref:F,...r}},_e=e=>t=>{e.onMouseOver?.(t),w(Number(t.currentTarget.getAttribute(`data-index`)))},ve=e=>t=>{e.onMouseLeave?.(t),w(-1)},ye=(e={})=>{let t=cw(e),n={onMouseOver:_e(t||{}),onMouseLeave:ve(t||{})};return{...e,...t,...n}},be=e=>({pointerEvents:x!==-1&&x!==e?`none`:void 0}),xe;return p===`vertical`&&(xe=o?`vertical-rl`:`vertical-lr`),{active:x,axis:le,axisProps:Ow,dragging:T,focusedThumbIndex:ne,getHiddenInputProps:(n={})=>{let r=cw(n),a={onChange:se(r||{}),onFocus:I(r||{}),onBlur:ie(r||{}),onKeyDown:oe(r||{})},s={...r,...a};return{tabIndex:v,"aria-labelledby":t,"aria-orientation":p,"aria-valuemax":h(c),"aria-valuemin":h(l),name:u,type:`range`,min:e.min,max:e.max,step:e.step===null&&e.marks?`any`:e.step??void 0,disabled:i,...n,...s,style:{...mw,direction:o?`rtl`:`ltr`,width:`100%`,height:`100%`,writingMode:xe}}},getRootProps:ge,getThumbProps:ye,marks:te,open:C,range:j,rootRef:F,trackLeap:he,trackOffset:me,values:M,getThumbStyle:be}}var Nw=e=>!e||!ow(e);function Pw(e){return typeof e.main==`string`}function Fw(e,t=[]){if(!Pw(e))return!1;for(let n of t)if(!e.hasOwnProperty(n)||typeof e[n]!=`string`)return!1;return!0}function Iw(e=[]){return([,t])=>t&&Fw(t,e)}function Lw(e){return zt(`MuiSlider`,e)}var Rw=Bt(`MuiSlider`,`root.active.colorPrimary.colorSecondary.colorError.colorInfo.colorSuccess.colorWarning.disabled.dragging.focusVisible.mark.markActive.marked.markLabel.markLabelActive.rail.sizeSmall.thumb.thumbColorPrimary.thumbColorSecondary.thumbColorError.thumbColorSuccess.thumbColorInfo.thumbColorWarning.track.trackInverted.trackFalse.thumbSizeSmall.valueLabel.valueLabelOpen.valueLabelCircle.valueLabelLabel.vertical`.split(`.`)),zw=e=>{let{open:t}=e;return{offset:C(t&&Rw.valueLabelOpen),circle:Rw.valueLabelCircle,label:Rw.valueLabelLabel}};function Bw(e){let{children:t,className:r,value:i}=e,a=zw(e);return t?n.cloneElement(t,{className:t.props.className},(0,g.jsxs)(n.Fragment,{children:[t.props.children,(0,g.jsx)(`span`,{className:C(a.offset,r),"aria-hidden":!0,children:(0,g.jsx)(`span`,{className:a.circle,children:(0,g.jsx)(`span`,{className:a.label,children:i})})})]})):null}process.env.NODE_ENV!==`production`&&(Bw.propTypes={children:l.default.element.isRequired,className:l.default.string,value:l.default.node});function Vw(e){return e}var Hw=di(`span`,{name:`MuiSlider`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[`color${rv(n.color)}`],n.size!==`medium`&&t[`size${rv(n.size)}`],n.marked&&t.marked,n.orientation===`vertical`&&t.vertical,n.track===`inverted`&&t.trackInverted,n.track===!1&&t.trackFalse]}})(iv(({theme:e})=>({borderRadius:12,boxSizing:`content-box`,display:`inline-block`,position:`relative`,cursor:`pointer`,touchAction:`none`,WebkitTapHighlightColor:`transparent`,"@media print":{colorAdjust:`exact`},[`&.${Rw.disabled}`]:{pointerEvents:`none`,cursor:`default`,color:(e.vars||e).palette.grey[400]},[`&.${Rw.dragging}`]:{[`& .${Rw.thumb}, & .${Rw.track}`]:{transition:`none`}},variants:[...Object.entries(e.palette).filter(Iw()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),{props:{orientation:`horizontal`},style:{height:4,width:`100%`,padding:`13px 0`,"@media (pointer: coarse)":{padding:`20px 0`}}},{props:{orientation:`horizontal`,size:`small`},style:{height:2}},{props:{orientation:`horizontal`,marked:!0},style:{marginBottom:20}},{props:{orientation:`vertical`},style:{height:`100%`,width:4,padding:`0 13px`,"@media (pointer: coarse)":{padding:`0 20px`}}},{props:{orientation:`vertical`,size:`small`},style:{width:2}},{props:{orientation:`vertical`,marked:!0},style:{marginRight:44}}]}))),Uw=di(`span`,{name:`MuiSlider`,slot:`Rail`})({display:`block`,position:`absolute`,borderRadius:`inherit`,backgroundColor:`currentColor`,opacity:.38,variants:[{props:{orientation:`horizontal`},style:{width:`100%`,height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{height:`100%`,width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:`inverted`},style:{opacity:1}}]}),Ww=di(`span`,{name:`MuiSlider`,slot:`Track`})(iv(({theme:e})=>({display:`block`,position:`absolute`,borderRadius:`inherit`,border:`1px solid currentColor`,backgroundColor:`currentColor`,transition:e.transitions.create([`left`,`width`,`bottom`,`height`],{duration:e.transitions.duration.shortest}),variants:[{props:{size:`small`},style:{border:`none`}},{props:{orientation:`horizontal`},style:{height:`inherit`,top:`50%`,transform:`translateY(-50%)`}},{props:{orientation:`vertical`},style:{width:`inherit`,left:`50%`,transform:`translateX(-50%)`}},{props:{track:!1},style:{display:`none`}},...Object.entries(e.palette).filter(Iw()).map(([t])=>({props:{color:t,track:`inverted`},style:{...e.vars?{backgroundColor:e.vars.palette.Slider[`${t}Track`],borderColor:e.vars.palette.Slider[`${t}Track`]}:{backgroundColor:e.lighten(e.palette[t].main,.62),borderColor:e.lighten(e.palette[t].main,.62),...e.applyStyles(`dark`,{backgroundColor:e.darken(e.palette[t].main,.5)}),...e.applyStyles(`dark`,{borderColor:e.darken(e.palette[t].main,.5)})}}}))]}))),Gw=di(`span`,{name:`MuiSlider`,slot:`Thumb`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.thumb,t[`thumbColor${rv(n.color)}`],n.size!==`medium`&&t[`thumbSize${rv(n.size)}`]]}})(iv(({theme:e})=>({position:`absolute`,width:20,height:20,boxSizing:`border-box`,borderRadius:`50%`,outline:0,backgroundColor:`currentColor`,display:`flex`,alignItems:`center`,justifyContent:`center`,transition:e.transitions.create([`box-shadow`,`left`,`bottom`],{duration:e.transitions.duration.shortest}),"&::before":{position:`absolute`,content:`""`,borderRadius:`inherit`,width:`100%`,height:`100%`,boxShadow:(e.vars||e).shadows[2]},"&::after":{position:`absolute`,content:`""`,borderRadius:`50%`,width:42,height:42,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`},[`&.${Rw.disabled}`]:{"&:hover":{boxShadow:`none`}},variants:[{props:{size:`small`},style:{width:12,height:12,"&::before":{boxShadow:`none`}}},{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-50%, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 50%)`}},...Object.entries(e.palette).filter(Iw()).map(([t])=>({props:{color:t},style:{[`&:hover, &.${Rw.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.alpha((e.vars||e).palette[t].main,.16)}`,"@media (hover: none)":{boxShadow:`none`}},[`&.${Rw.active}`]:{boxShadow:`0px 0px 0px 14px ${e.alpha((e.vars||e).palette[t].main,.16)}`}}}))]}))),Kw=di(Bw,{name:`MuiSlider`,slot:`ValueLabel`})(iv(({theme:e})=>({zIndex:1,whiteSpace:`nowrap`,...e.typography.body2,fontWeight:500,transition:e.transitions.create([`transform`],{duration:e.transitions.duration.shortest}),position:`absolute`,backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:`0.25rem 0.75rem`,variants:[{props:{orientation:`horizontal`},style:{transform:`translateY(-100%) scale(0)`,top:`-10px`,transformOrigin:`bottom center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, 50%) rotate(45deg)`,backgroundColor:`inherit`,bottom:0,left:`50%`},[`&.${Rw.valueLabelOpen}`]:{transform:`translateY(-100%) scale(1)`}}},{props:{orientation:`vertical`},style:{transform:`translateY(-50%) scale(0)`,right:`30px`,top:`50%`,transformOrigin:`right center`,"&::before":{position:`absolute`,content:`""`,width:8,height:8,transform:`translate(-50%, -50%) rotate(45deg)`,backgroundColor:`inherit`,right:-8,top:`50%`},[`&.${Rw.valueLabelOpen}`]:{transform:`translateY(-50%) scale(1)`}}},{props:{size:`small`},style:{fontSize:e.typography.pxToRem(12),padding:`0.25rem 0.5rem`}},{props:{orientation:`vertical`,size:`small`},style:{right:`20px`}}]})));process.env.NODE_ENV!==`production`&&(Kw.propTypes={children:l.default.element.isRequired,index:l.default.number.isRequired,open:l.default.bool.isRequired,value:l.default.node});var qw=di(`span`,{name:`MuiSlider`,slot:`Mark`,shouldForwardProp:e=>ui(e)&&e!==`markActive`,overridesResolver:(e,t)=>{let{markActive:n}=e;return[t.mark,n&&t.markActive]}})(iv(({theme:e})=>({position:`absolute`,width:2,height:2,borderRadius:1,backgroundColor:`currentColor`,variants:[{props:{orientation:`horizontal`},style:{top:`50%`,transform:`translate(-1px, -50%)`}},{props:{orientation:`vertical`},style:{left:`50%`,transform:`translate(-50%, 1px)`}},{props:{markActive:!0},style:{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8}}]}))),Jw=di(`span`,{name:`MuiSlider`,slot:`MarkLabel`,shouldForwardProp:e=>ui(e)&&e!==`markLabelActive`})(iv(({theme:e})=>({...e.typography.body2,color:(e.vars||e).palette.text.secondary,position:`absolute`,whiteSpace:`nowrap`,variants:[{props:{orientation:`horizontal`},style:{top:30,transform:`translateX(-50%)`,"@media (pointer: coarse)":{top:40}}},{props:{orientation:`vertical`},style:{left:36,transform:`translateY(50%)`,"@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(e.vars||e).palette.text.primary}}]}))),Yw=e=>{let{disabled:t,dragging:n,marked:r,orientation:i,track:a,classes:o,color:s,size:c}=e;return x({root:[`root`,t&&`disabled`,n&&`dragging`,r&&`marked`,i===`vertical`&&`vertical`,a===`inverted`&&`trackInverted`,a===!1&&`trackFalse`,s&&`color${rv(s)}`,c&&`size${rv(c)}`],rail:[`rail`],track:[`track`],mark:[`mark`],markActive:[`markActive`],markLabel:[`markLabel`],markLabelActive:[`markLabelActive`],valueLabel:[`valueLabel`],thumb:[`thumb`,t&&`disabled`,c&&`thumbSize${rv(c)}`,s&&`thumbColor${rv(s)}`],active:[`active`],disabled:[`disabled`],focusVisible:[`focusVisible`]},Lw,o)},Xw=({children:e})=>e,Zw=n.forwardRef(function(e,t){let r=ov({props:e,name:`MuiSlider`}),i=On(),{"aria-label":a,"aria-valuetext":o,"aria-labelledby":s,component:c=`span`,components:l={},componentsProps:u={},color:d=`primary`,classes:f,className:p,disableSwap:m=!1,disabled:h=!1,getAriaLabel:_,getAriaValueText:v,marks:y=!1,max:b=100,min:x=0,name:S,onChange:w,onChangeCommitted:T,orientation:E=`horizontal`,shiftStep:D=10,size:O=`medium`,step:k=1,scale:ee=Vw,slotProps:A,slots:j,tabIndex:M,track:te=`normal`,value:N,valueLabelDisplay:ne=`off`,valueLabelFormat:P=Vw,...re}=r,F={...r,isRtl:i,max:b,min:x,classes:f,disabled:h,disableSwap:m,orientation:E,marks:y,color:d,size:O,step:k,shiftStep:D,scale:ee,track:te,valueLabelDisplay:ne,valueLabelFormat:P},{axisProps:I,getRootProps:ie,getHiddenInputProps:ae,getThumbProps:oe,open:se,active:ce,axis:le,focusedThumbIndex:ue,range:de,dragging:L,marks:fe,values:R,trackOffset:pe,trackLeap:me,getThumbStyle:he}=Mw({...F,rootRef:t});F.marked=fe.length>0&&fe.some(e=>e.label),F.dragging=L,F.focusedThumbIndex=ue;let ge=Yw(F),_e=j?.root??l.Root??Hw,ve=j?.rail??l.Rail??Uw,ye=j?.track??l.Track??Ww,be=j?.thumb??l.Thumb??Gw,xe=j?.valueLabel??l.ValueLabel??Kw,Se=j?.mark??l.Mark??qw,Ce=j?.markLabel??l.MarkLabel??Jw,we=j?.input??l.Input??`input`,Te=A?.root??u.root,Ee=A?.rail??u.rail,De=A?.track??u.track,Oe=A?.thumb??u.thumb,ke=A?.valueLabel??u.valueLabel,Ae=A?.mark??u.mark,je=A?.markLabel??u.markLabel,Me=A?.input??u.input,Ne=fw({elementType:_e,getSlotProps:ie,externalSlotProps:Te,externalForwardedProps:re,additionalProps:{...Nw(_e)&&{as:c}},ownerState:{...F,...Te?.ownerState},className:[ge.root,p]}),z=fw({elementType:ve,externalSlotProps:Ee,ownerState:F,className:ge.rail}),Pe=fw({elementType:ye,externalSlotProps:De,additionalProps:{style:{...I[le].offset(pe),...I[le].leap(me)}},ownerState:{...F,...De?.ownerState},className:ge.track}),Fe=fw({elementType:be,getSlotProps:oe,externalSlotProps:Oe,ownerState:{...F,...Oe?.ownerState},className:ge.thumb}),Ie=fw({elementType:xe,externalSlotProps:ke,ownerState:{...F,...ke?.ownerState},className:ge.valueLabel}),Le=fw({elementType:Se,externalSlotProps:Ae,ownerState:F,className:ge.mark}),Re=fw({elementType:Ce,externalSlotProps:je,ownerState:F,className:ge.markLabel}),ze=fw({elementType:we,getSlotProps:ae,externalSlotProps:Me,ownerState:F});return(0,g.jsxs)(_e,{...Ne,children:[(0,g.jsx)(ve,{...z}),(0,g.jsx)(ye,{...Pe}),fe.filter(e=>e.value>=x&&e.value<=b).map((e,t)=>{let r=xw(e.value,x,b),i=I[le].offset(r),a;return a=te===!1?R.includes(e.value):te===`normal`&&(de?e.value>=R[0]&&e.value<=R[R.length-1]:e.value<=R[0])||te===`inverted`&&(de?e.value<=R[0]||e.value>=R[R.length-1]:e.value>=R[0]),(0,g.jsxs)(n.Fragment,{children:[(0,g.jsx)(Se,{"data-index":t,...Le,...!ow(Se)&&{markActive:a},style:{...i,...Le.style},className:C(Le.className,a&&ge.markActive)}),e.label==null?null:(0,g.jsx)(Ce,{"aria-hidden":!0,"data-index":t,...Re,...!ow(Ce)&&{markLabelActive:a},style:{...i,...Re.style},className:C(ge.markLabel,Re.className,a&&ge.markLabelActive),children:e.label})]},t)}),R.map((e,t)=>{let n=xw(e,x,b),r=I[le].offset(n),i=ne===`off`?Xw:xe;return(0,g.jsx)(i,{...!ow(i)&&{valueLabelFormat:P,valueLabelDisplay:ne,value:typeof P==`function`?P(ee(e),t):P,index:t,open:se===t||ce===t||ne===`on`,disabled:h},...Ie,children:(0,g.jsx)(be,{"data-index":t,...Fe,className:C(ge.thumb,Fe.className,ce===t&&ge.active,ue===t&&ge.focusVisible),style:{...r,...he(t),...Fe.style},children:(0,g.jsx)(we,{"data-index":t,"aria-label":_?_(t):a,"aria-valuenow":ee(e),"aria-labelledby":s,"aria-valuetext":v?v(ee(e),t):o,value:R[t],...ze})})},t)})]})});process.env.NODE_ENV!==`production`&&(Zw.propTypes={"aria-label":aw(l.default.string,e=>Array.isArray(e.value||e.defaultValue)&&e[`aria-label`]!=null?Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider."):null),"aria-labelledby":l.default.string,"aria-valuetext":aw(l.default.string,e=>Array.isArray(e.value||e.defaultValue)&&e[`aria-valuetext`]!=null?Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider."):null),children:l.default.node,classes:l.default.object,className:l.default.string,color:l.default.oneOfType([l.default.oneOf([`primary`,`secondary`,`error`,`info`,`success`,`warning`]),l.default.string]),components:l.default.shape({Input:l.default.elementType,Mark:l.default.elementType,MarkLabel:l.default.elementType,Rail:l.default.elementType,Root:l.default.elementType,Thumb:l.default.elementType,Track:l.default.elementType,ValueLabel:l.default.elementType}),componentsProps:l.default.shape({input:l.default.oneOfType([l.default.func,l.default.object]),mark:l.default.oneOfType([l.default.func,l.default.object]),markLabel:l.default.oneOfType([l.default.func,l.default.object]),rail:l.default.oneOfType([l.default.func,l.default.object]),root:l.default.oneOfType([l.default.func,l.default.object]),thumb:l.default.oneOfType([l.default.func,l.default.object]),track:l.default.oneOfType([l.default.func,l.default.object]),valueLabel:l.default.oneOfType([l.default.func,l.default.shape({children:l.default.element,className:l.default.string,open:l.default.bool,style:l.default.object,value:l.default.node,valueLabelDisplay:l.default.oneOf([`auto`,`off`,`on`])})])}),defaultValue:l.default.oneOfType([l.default.arrayOf(l.default.number),l.default.number]),disabled:l.default.bool,disableSwap:l.default.bool,getAriaLabel:l.default.func,getAriaValueText:l.default.func,marks:l.default.oneOfType([l.default.arrayOf(l.default.shape({label:l.default.node,value:l.default.number.isRequired})),l.default.bool]),max:l.default.number,min:l.default.number,name:l.default.string,onChange:l.default.func,onChangeCommitted:l.default.func,orientation:l.default.oneOf([`horizontal`,`vertical`]),scale:l.default.func,shiftStep:l.default.number,size:l.default.oneOfType([l.default.oneOf([`small`,`medium`]),l.default.string]),slotProps:l.default.shape({input:l.default.oneOfType([l.default.func,l.default.object]),mark:l.default.oneOfType([l.default.func,l.default.object]),markLabel:l.default.oneOfType([l.default.func,l.default.object]),rail:l.default.oneOfType([l.default.func,l.default.object]),root:l.default.oneOfType([l.default.func,l.default.object]),thumb:l.default.oneOfType([l.default.func,l.default.object]),track:l.default.oneOfType([l.default.func,l.default.object]),valueLabel:l.default.oneOfType([l.default.func,l.default.shape({children:l.default.element,className:l.default.string,open:l.default.bool,style:l.default.object,value:l.default.node,valueLabelDisplay:l.default.oneOf([`auto`,`off`,`on`])})])}),slots:l.default.shape({input:l.default.elementType,mark:l.default.elementType,markLabel:l.default.elementType,rail:l.default.elementType,root:l.default.elementType,thumb:l.default.elementType,track:l.default.elementType,valueLabel:l.default.elementType}),step:l.default.number,sx:l.default.oneOfType([l.default.arrayOf(l.default.oneOfType([l.default.func,l.default.object,l.default.bool])),l.default.func,l.default.object]),tabIndex:l.default.number,track:l.default.oneOf([`inverted`,`normal`,!1]),value:l.default.oneOfType([l.default.arrayOf(l.default.number),l.default.number]),valueLabelDisplay:l.default.oneOf([`auto`,`off`,`on`]),valueLabelFormat:l.default.oneOfType([l.default.func,l.default.string])});var Qw=`[object Number]`;function $w(e){return typeof e==`number`||Wv(e)&&Uv(e)==Qw}var eT=(0,i.observer)(e=>{let t=(0,r.useTheme)(),{store:n}=e,{t:i}=(0,a.useTranslation)();function o(t,n){n===e.velocity||!$w(n)||e.onVelocityChange(n)}return(0,g.jsxs)(r.Stack,{direction:`row`,gap:2,alignItems:`center`,children:[n.showVelocityLegend&&(0,g.jsx)(r.Typography,{sx:{color:t.componentsExt?.JoggingPanel?.VelocitySlider?.sliderLegendColor,fontSize:`14px`},children:i(`Jogging.Velocity.bt`)}),(0,g.jsx)(Zw,{value:e.velocity,color:`secondary`,onChange:o,min:e.min,max:e.max,"aria-labelledby":`input-slider`,disabled:e.disabled,sx:{"& .MuiSlider-valueLabelOpen":{zIndex:100,backgroundColor:`transparent`,top:`0px`}}}),n.showVelocitySliderLabel&&(e.renderValue?e.renderValue(e.velocity):(0,g.jsx)(tT,{value:e.velocity.toString()}))]})});function tT({value:e,sx:t}){let n=(0,r.useTheme)();return(0,g.jsx)(r.Stack,{direction:`row`,justifyContent:`center`,alignItems:`center`,gap:`5px`,sx:{padding:`6px 12px`,background:n.palette.backgroundPaperElevation?.[8],borderRadius:`10px`,minWidth:`111px`,...t},children:(0,g.jsx)(r.Typography,{component:`span`,sx:{textAlign:`right`,fontSize:`14px`,opacity:.8,color:n.palette.text.primary,whiteSpace:`nowrap`},children:e})})}var nT=(0,i.observer)(({store:e})=>{let{t}=(0,a.useTranslation)(),n=(0,i.useLocalObservable)(()=>({get valueLabelFormat(){return e.currentMotionType===`translate`?e=>`v = ${t(`Jogging.Cartesian.Translation.velocityMmPerSec.lb`,{amount:e})}`:e=>`ω = ${t(`Jogging.Cartesian.Rotation.velocityDegPerSec.lb`,{amount:e})}`}}));return(0,g.jsx)(eT,{store:e,velocity:e.velocityInDisplayUnits,min:e.minVelocityInDisplayUnits,max:e.maxVelocityInDisplayUnits,onVelocityChange:e.setVelocityFromSlider,disabled:e.isLocked,renderValue:e=>(0,g.jsx)(tT,{value:n.valueLabelFormat(e),sx:{minWidth:`111px`,span:{transform:`translateY(-1.5px)`}}})})}),rT=(0,i.observer)(({store:t,children:n})=>{let{t:i}=(0,a.useTranslation)(),o=(0,r.useTheme)();function s(e,n){(n===`translate`||n===`rotate`)&&t.setSelectedCartesianMotionType(n)}e.o(()=>[t.selectedCoordSystemId,t.selectedTcpId],()=>{t.jogger.motionStream.motionStateSocket.changeUrl(t.jogger.nova.makeWebsocketURL(`/controllers/${t.jogger.motionStream.controllerId}/motion-groups/${t.jogger.motionGroupId}/state-stream?tcp=${t.selectedTcpId}`))},{fireImmediately:!0});async function c(e,n){let r=await t.activate(),i=r.motionStream.rapidlyChangingMotionState.tcp_pose,a=r.motionStream.rapidlyChangingMotionState.joint_position;i&&await t.withMotionLock(async()=>{try{t.setCurrentIncrementJog({axis:e.axis,direction:e.direction}),await t.jogger.runIncrementalCartesianMotion({currentTcpPose:i,currentJoints:a,coordSystemId:t.activeCoordSystemId,velocityInRelevantUnits:t.selectedCartesianMotionType===`translate`?t.translationVelocityMmPerSec:t.rotationVelocityRadsPerSec,axis:e.axis,direction:e.direction,motion:t.selectedCartesianMotionType===`translate`?{type:`translate`,distanceMm:n.mm}:{type:`rotate`,distanceRads:(0,p.degreesToRadians)(n.degrees)}})}finally{t.setCurrentIncrementJog(null),await t.deactivate()}})}async function l(e){if(!t.isLocked){if(await t.activate(),t.activeDiscreteIncrement)return c(e,t.activeDiscreteIncrement);e.motionType===`translate`?await t.jogger.translateTCP({axis:e.axis,direction:e.direction,velocityMmPerSec:t.translationVelocityMmPerSec}):await t.jogger.rotateTCP({axis:e.axis,direction:e.direction,velocityRadsPerSec:t.rotationVelocityRadsPerSec})}}async function u(){t.isLocked||t.activeDiscreteIncrement||await t.deactivate()}function d(e,t,n){let r=n.componentsExt?.JoggingPanel?.JoggingCartesian?.Axis;if(r)return t===`translate`?r[e]:r.CustomRotation??r[e]}let f=[{id:`x`,icon:(0,g.jsx)(YC,{}),colors:d(`X`,t.selectedCartesianMotionType,o)},{id:`y`,icon:(0,g.jsx)(XC,{}),colors:d(`Y`,t.selectedCartesianMotionType,o)},{id:`z`,icon:(0,g.jsx)(ZC,{}),colors:d(`Z`,t.selectedCartesianMotionType,o)}];function m(e){return i(`General.mm.variable`,{amount:e.toFixed(1)})}function h(e){return i(`General.degree.variable`,{amount:(0,p.radiansToDegrees)(e).toFixed(1)})}return(0,g.jsxs)(r.Stack,{flexGrow:1,gap:2,sx:{padding:`18px 24px`},children:[(0,g.jsxs)(r.Stack,{gap:2,children:[(0,g.jsx)(rw,{store:t}),(0,g.jsx)(nT,{store:t}),(0,g.jsx)(r.Divider,{})]}),(0,g.jsx)(r.Stack,{marginLeft:`auto`,marginRight:`auto`,gap:`24px`,justifyContent:`center`,sx:{flexGrow:`1`},children:(0,g.jsxs)(r.Stack,{alignItems:`center`,justifyContent:`center`,gap:`24px`,sx:{flexGrow:1},children:[(0,g.jsxs)(iw,{value:t.selectedCartesianMotionType,onChange:s,exclusive:!0,"aria-label":i(`Jogging.Cartesian.MotionType.lb`),sx:{justifyContent:`center`},children:[(0,g.jsx)(r.ToggleButton,{value:`translate`,children:i(`Jogging.Cartesian.Translation.bt`)}),(0,g.jsx)(r.ToggleButton,{value:`rotate`,children:i(`Jogging.Cartesian.Rotation.bt`)})]}),t.selectedCartesianMotionType===`translate`&&f.map(e=>(0,g.jsx)(bv,{colors:e.colors,disabled:t.isLocked,activeJoggingDirection:t.incrementJogInProgress?.axis===e.id?t.incrementJogInProgress.direction:void 0,label:(0,g.jsxs)(g.Fragment,{children:[e.icon,(0,g.jsx)(r.Typography,{sx:{fontSize:`24px`,color:e.colors?.labelColor??o.palette.text.primary},children:e.id.toUpperCase()})]}),getDisplayedValue:()=>m(t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose?.position?.[p.XYZ_TO_VECTOR[e.id]]||0),startJogging:t=>l({axis:e.id,motionType:`translate`,direction:t}),stopJogging:u},e.id)),t.selectedCartesianMotionType===`rotate`&&f.map(e=>(0,g.jsx)(bv,{colors:e.colors,disabled:t.isLocked,activeJoggingDirection:t.incrementJogInProgress?.axis===e.id?t.incrementJogInProgress.direction:void 0,label:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(QC,{}),(0,g.jsx)(r.Typography,{sx:{fontSize:`24px`,color:e.colors?.labelColor??o.palette.text.primary},children:e.id.toUpperCase()})]}),getDisplayedValue:()=>h(t.jogger.motionStream.rapidlyChangingMotionState.tcp_pose?.orientation?.[p.XYZ_TO_VECTOR[e.id]]||0),startJogging:t=>l({axis:e.id,motionType:`rotate`,direction:t}),stopJogging:u},e.id))]})}),(0,g.jsx)(ew,{store:t}),n&&(0,g.jsx)(r.Divider,{}),n]})}),iT=(0,i.observer)(({store:e,children:t})=>{let n=(0,r.useTheme)();async function i(t){await e.activate(),await e.jogger.rotateJoints({joint:t.joint,direction:t.direction,velocityUnit:e.jointCategory===KC.PRISMATIC?`mm/s`:`rad/s`,velocityValue:e.jointCategory===KC.PRISMATIC?e.translationVelocityMmPerSec:e.rotationVelocityRadsPerSec})}async function a(){await e.jogger.stop(),await e.deactivate()}return(0,g.jsxs)(r.Stack,{flexGrow:1,gap:2,sx:{padding:`18px 24px`},children:[(0,g.jsx)(nT,{store:e}),(0,g.jsx)(r.Divider,{}),(0,g.jsx)(r.Stack,{justifyContent:`center`,alignItems:`stretch`,sx:{flexGrow:`1`},children:(0,g.jsx)(r.Stack,{alignItems:`center`,gap:`24px`,children:e.jogger.motionStream.joints.map(t=>{let o=e.motionGroupDescription.operation_limits.auto_limits?.joints?.[t.index]?.position;return(0,g.jsxs)(r.Stack,{direction:`row`,alignItems:`center`,justifyContent:`center`,spacing:1.5,width:`100%`,children:[e.showJointsLegend&&(0,g.jsx)(r.Typography,{color:e.isLocked?n.palette.text.disabled:n.palette.text.secondary,children:`G${t.index+1}`}),(0,g.jsx)(ay,{disabled:e.isLocked,lowerLimit:o?.lower_limit,upperLimit:o?.upper_limit,useDegree:e.currentMotionType===`rotate`,getValue:()=>{let n=e.jogger.motionStream.rapidlyChangingMotionState.joint_position[t.index];return n===void 0?void 0:n},startJogging:e=>i({joint:t.index,direction:e}),stopJogging:a})]},`joint-${t.index}`)})})}),(0,g.jsx)(ew,{store:e}),t&&(0,g.jsx)(r.Divider,{}),t]})}),aT=e.m((0,i.observer)(t=>{let a=(0,m.isString)(t.nova)?new e.s({instanceUrl:t.nova}):t.nova,o=(0,i.useLocalObservable)(()=>({joggingStore:null,loadingError:null}));async function s(){(0,c.runInAction)(()=>{o.loadingError=null,o.joggingStore=null});try{let e=t.store;if(!e){let n=await Cy.open(a,t.motionGroupId);e=await qC.loadFor(n)}(0,c.runInAction)(()=>{o.joggingStore=e}),t.onSetup&&t.onSetup(e)}catch(e){o.loadingError=e}}return(0,n.useEffect)(()=>(s(),t.store?()=>null:()=>{o.joggingStore?.dispose()}),[t.store,t.nova,t.motionGroupId]),(0,n.useEffect)(()=>{let e=o.joggingStore;e&&(t.locked?e.lock(`external`):e.unlock(`external`))},[o.joggingStore,t.locked]),(0,g.jsx)(r.Stack,{sx:{maxWidth:`460px`,minWidth:`320px`,position:`relative`,...t.sx},children:o.joggingStore?(0,g.jsx)(oT,{store:o.joggingStore,children:t.children}):(0,g.jsx)(Ey,{message:`Loading jogging`,error:o.loadingError})})})),oT=(0,i.observer)(({store:e,children:t})=>{let{t:n}=(0,a.useTranslation)();function i(){if(e.currentTab.id===`cartesian`)return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(rT,{store:e,children:t})});if(e.currentTab.id===`joint`)return(0,g.jsx)(g.Fragment,{children:(0,g.jsx)(iT,{store:e,children:t})})}return(0,g.jsxs)(r.Stack,{flexGrow:1,sx:{overflow:`hidden`},children:[(0,g.jsx)(r.Tabs,{value:e.tabIndex,onChange:e.onTabChange,variant:`fullWidth`,children:e.tabs.map(t=>{let i=t.label===`Cartesian`?n(`Jogging.Cartesian.bt`):n(`Jogging.Joints.bt`),a=t.label===`cartesian`?(0,g.jsx)(oy,{fontSize:`small`,sx:{mr:1}}):(0,g.jsx)(sy,{fontSize:`small`,sx:{mr:1}});return(0,g.jsx)(r.Tab,{label:e.showTabIcons?(0,g.jsxs)(r.Stack,{direction:`row`,alignItems:`center`,children:[a,i]}):i,id:`jogging-tab-${t.id}`,"aria-controls":`jogging-tab-${t.id}`},t.id)})}),(0,g.jsx)(r.Stack,{flexGrow:1,position:`relative`,sx:{overflowY:`auto`,overflowX:`hidden`},children:i()}),e.blocked&&(0,g.jsx)(JC,{store:e})]})}),sT=e=>{let{value:t,ref:i}=e,a=(0,r.useTheme)(),[o,s]=(0,n.useState)(!1);async function c(){if(!i||!(`current`in i))return console.warn(`No copy target found`),!1;try{return await navigator.clipboard.writeText(t),console.log(`Copied!`),s(!0),!0}catch(e){console.error(e);let t=window.getSelection();if(t&&i&&`current`in i&&i.current){let e=document.createRange();e.selectNodeContents(i.current),t.removeAllRanges(),t.addRange(e)}}return!1}return(0,n.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>s(!1),3e3);return()=>{e&&clearTimeout(e)}},[o]),(0,g.jsx)(r.Tooltip,{open:o,title:`Copied!`,children:(0,g.jsx)(r.Stack,{justifyContent:`center`,sx:{height:`100%`,boxSizing:`border-box`,padding:`6px 12px`,background:a.palette.backgroundPaperElevation?.[8],borderRadius:`10px`,minWidth:`0`,cursor:`pointer`},onClick:()=>c(),children:(0,g.jsx)(r.Typography,{ref:i,align:`center`,sx:{pointerEvents:`none`,fontSize:`12px`,color:a.palette.text.primary,whiteSpace:`nowrap`,minWidth:0,textOverflow:`ellipsis`,width:`100%`,overflow:`hidden`},children:t})})})},cT=e.m((0,i.observer)(({tcpPose:t,showCopyButton:i=!1})=>{let[a,o]=(0,n.useState)(null),s=e.c(t);return(0,g.jsxs)(r.Stack,{direction:`row`,alignItems:`center`,spacing:1,sx:{flexGrow:1,minWidth:0,overflow:`hidden`},"data-testid":`pose-cartesian-values`,children:[(0,g.jsx)(sT,{value:s}),i&&(0,g.jsx)(r.Button,{variant:`contained`,color:`secondary`,size:`small`,onClick:async()=>{try{await navigator.clipboard.writeText(s),o(`Copied!`),setTimeout(()=>o(null),2e3)}catch{o(`Copy failed`),setTimeout(()=>o(null),2e3)}},sx:{flexShrink:0},children:a||`Copy`})]})})),lT=e.m((0,i.observer)(({joints:e,showCopyButton:t=!1})=>{let[i,a]=(0,n.useState)(null),o=`[${e.map(e=>parseFloat(e.toFixed(4))).join(`, `)}]`;return(0,g.jsxs)(r.Stack,{direction:`row`,alignItems:`center`,spacing:1,sx:{flexGrow:1,minWidth:0,overflow:`hidden`},"data-testid":`pose-joint-values`,children:[(0,g.jsx)(sT,{value:o}),t&&(0,g.jsx)(r.Button,{variant:`contained`,color:`secondary`,size:`small`,onClick:async()=>{try{await navigator.clipboard.writeText(o),a(`Copied!`),setTimeout(()=>a(null),2e3)}catch{a(`Copy failed`),setTimeout(()=>a(null),2e3)}},sx:{flexShrink:0},children:i||`Copy`})]})})),uT=class{constructor(){this.messages=[],this.addMessage=(e,t=`info`)=>{let n={id:Math.random().toString(36).substring(2,11),timestamp:new Date,message:e,level:t};this.messages.push(n)},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`)},(0,c.makeObservable)(this,{messages:c.observable,addMessage:c.action,clearMessages:c.action})}},dT=(e,t,n)=>({id:n||`${Date.now()}-${Math.random().toString(36).substring(2,11)}`,timestamp:new Date,message:e,level:t}),fT=(e,t)=>dT(e,`debug`,t),pT=(e,t)=>dT(e,`info`,t),mT=(e,t)=>dT(e,`warning`,t),hT=(e,t)=>dT(e,`error`,t),gT=e.m((0,i.observer)(e=>{let{messages:t=[],onClear:i,height:a=400,sx:s}=e,c=(0,r.useTheme)(),l=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(t.length===0)return;let e=l.current;if(!e)return;let n=setTimeout(()=>{e.scrollTop=e.scrollHeight},10);return()=>clearTimeout(n)},[t.length]);let u=e=>e.toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),d=e=>{switch(e){case`error`:return c.palette.error.main;case`warning`:return c.palette.warning.main;case`info`:return c.palette.info.main;case`debug`:return c.palette.text.disabled;default:return c.palette.text.secondary}},f=({message:e})=>{let[t,i]=(0,n.useState)(!1),[a,s]=(0,n.useState)(!1),[l,f]=(0,n.useState)(!1),p=e.message.length>150,m=async()=>{try{await navigator.clipboard.writeText(e.message),s(!0),setTimeout(()=>s(!1),2e3)}catch(e){console.error(`Failed to copy message:`,e)}},h=p&&!t?e.message.substring(0,150)+`...`:e.message;return(0,g.jsx)(r.Box,{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),sx:{display:`flex`,gap:1,fontFamily:`monospace`,flexDirection:`column`,"&:hover":{backgroundColor:c.palette.action.hover},borderRadius:`4px`,padding:`2px 4px`,margin:`-2px -4px`},children:(0,g.jsxs)(r.Box,{sx:{display:`flex`,gap:1},children:[(0,g.jsxs)(r.Typography,{component:`span`,sx:{fontWeight:400,fontSize:`12px`,lineHeight:`18px`,letterSpacing:`0.4px`,color:c.palette.text.disabled,whiteSpace:`nowrap`,flexShrink:0},children:[`[`,u(e.timestamp),`]`]}),(0,g.jsx)(r.Typography,{component:`span`,sx:{fontWeight:400,fontSize:`12px`,lineHeight:`18px`,letterSpacing:`0.4px`,color:d(e.level),wordBreak:`break-word`,overflowWrap:`anywhere`,hyphens:`auto`,flex:1,whiteSpace:`pre-wrap`},children:h}),(0,g.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`flex-start`,gap:.5,opacity:+!!l,transition:`opacity 0.2s ease-in-out`,visibility:l?`visible`:`hidden`},children:[(0,g.jsx)(r.IconButton,{size:`small`,onClick:m,sx:{padding:`2px`,color:c.palette.text.secondary,"&:hover":{backgroundColor:c.palette.action.hover}},title:a?`Copied!`:`Copy message`,children:(0,g.jsx)(o.ContentCopy,{sx:{fontSize:12}})}),p&&(0,g.jsx)(r.IconButton,{size:`small`,onClick:()=>i(!t),sx:{padding:`2px`,color:c.palette.text.secondary,"&:hover":{backgroundColor:c.palette.action.hover}},title:t?`Collapse`:`Expand`,children:t?(0,g.jsx)(o.ExpandLess,{sx:{fontSize:12}}):(0,g.jsx)(o.ExpandMore,{sx:{fontSize:12}})})]})]})},e.id)};return(0,g.jsxs)(r.Paper,{sx:{backgroundColor:c.palette.backgroundPaperElevation?.[2]||`#171927`,backgroundImage:`none`,height:a,display:`flex`,flexDirection:`column`,overflow:`hidden`,...s},children:[(0,g.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`12px 16px`},children:[(0,g.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,g.jsx)(o.DescriptionOutlined,{sx:{fontSize:16,color:c.palette.action.active,opacity:.56}}),(0,g.jsx)(r.Typography,{sx:{fontWeight:500,fontSize:`14px`,lineHeight:`143%`,letterSpacing:`0.17px`,color:c.palette.text.primary},children:`Log`})]}),(0,g.jsx)(r.Button,{onClick:i,variant:`text`,sx:{fontWeight:500,fontSize:`13px`,lineHeight:`22px`,letterSpacing:`0.46px`,color:c.palette.primary.main,textTransform:`none`,minWidth:`auto`,padding:`4px 8px`,"&:hover":{backgroundColor:c.palette.primary.main+`14`}},children:`Clear`})]}),(0,g.jsx)(r.Box,{ref:l,sx:{flex:1,overflow:`auto`,padding:`8px 16px`,display:`flex`,flexDirection:`column`,gap:`2px`,scrollbarWidth:`thin`,scrollbarColor:`${c.palette.divider} transparent`,"&::-webkit-scrollbar":{width:`6px`},"&::-webkit-scrollbar-track":{background:`transparent`},"&::-webkit-scrollbar-thumb":{backgroundColor:c.palette.divider,borderRadius:`3px`,"&:hover":{backgroundColor:c.palette.divider}}},children:t.length===0?(0,g.jsx)(r.Typography,{sx:{color:c.palette.text.disabled,fontSize:`12px`,fontStyle:`italic`,textAlign:`center`,marginTop:2},children:`No log messages`}):t.map(e=>(0,g.jsx)(f,{message:e},e.id))})]})})),_T=e.m((0,i.observer)(e=>{let{store:t,onStoreReady:r,...i}=e,a=(0,n.useRef)(r);(0,n.useEffect)(()=>{a.current=r},[r]);let o=(0,n.useMemo)(()=>{let e=t||new uT;return a.current?.(e),e},[t]),s=()=>{o.clearMessages()};return(0,g.jsx)(gT,{...i,messages:o.messages,onClear:s})}));function vT(){let e=window.location.href;return e.substring(0,e.indexOf(`/`,e.indexOf(`//`)+2))}function yT({baseUrl:e=vT(),...t}){return(0,g.jsxs)(r.Dialog,{"aria-labelledby":`no-motion-group-modal-title`,open:!0,fullWidth:!0,sx:{"& .MuiModal-backdrop":{backdropFilter:`blur(10px)`},"& .MuiDialog-paper":{"::before":{content:`""`,height:`8px`,width:`100%`,background:`linear-gradient(90deg, #FF0E65 0%, #47D3FF 100%)`},background:`#101629`}},children:[(0,g.jsx)(r.DialogTitle,{id:`no-motion-group-modal-title`,children:`No motion group found`}),(0,g.jsxs)(r.DialogContent,{sx:{marginTop:`3rem`,marginBottom:`1.5rem`,textAlign:`center`},children:[(0,g.jsx)(r.Typography,{color:`#fff`,children:`Found no devices to connect to.`}),(0,g.jsx)(r.Typography,{color:`#fff`,children:`Please ensure a motion group has been created.`})]}),(0,g.jsx)(r.DialogActions,{children:(0,g.jsxs)(r.Stack,{width:`100%`,maxWidth:`300px`,margin:`auto`,marginBottom:`2rem`,children:[(0,g.jsx)(r.Button,{href:`${e}/settings`,variant:`contained`,sx:{borderRadius:`8px`,width:`100%`},children:`Go to settings app`}),(0,g.jsx)(r.Button,{href:`${e}`,variant:`text`,sx:{marginTop:`1rem`,color:`#fff`,textDecoration:`underline`,fontSize:`0.75rem`},children:`Back to Homescreen`})]})})]})}var bT=dv((0,g.jsx)(`path`,{d:`M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z`}),`Error`),xT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,fill:`none`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{fill:`#38C6F4`,fillRule:`evenodd`,d:`M6.359 14.25v2.934h7.63v-3.521L10.196 9.87 9 8.674l.859-.859.337-.337.858-.858.565.565.631.63.565.565 1.196-1.195.543-.544 1.196-1.195-1.196-1.196-2.304-2.304L11.054.75 9.86 1.946 3.446 8.359 2.25 9.554l1.196 1.196 2.913 2.913zm1.69 0v1.244h4.249v-1.13L7.804 9.87 6.608 8.674l1.196-1.196L9.86 5.424l.007-.008-.543-.543-4.681 4.681 2.912 2.913.496.496v.113h2.124l1.174 1.174zm3.005-10.022-.294.294-.543-.543.837-.837 2.304 2.304-.543.543-.565-.565z`,clipRule:`evenodd`})]})),ST=function(e){return e.PRECONDITION_NOT_FULFILLED=`PRECONDITION_NOT_FULFILLED`,e.ROBOT_DISCONNECTED=`ROBOT_DISCONNECTED`,e.CELL_OPEN=`CELL_OPEN`,e.E_STOP=`E_STOP`,e.MANUAL_MODE=`MANUAL_MODE`,e.READY=`READY`,e}({}),CT=e.m((0,i.observer)(({setupState:e,className:t})=>{let n=(0,r.useTheme)(),{t:i}=(0,a.useTranslation)(),{label:o,indicatorColor:s,backgroundColor:c,textColor:l}=(()=>{switch(e){case ST.READY:return{label:i(`RobotSetupReadinessIndicator.Ready.lb`),indicatorColor:n.palette.tertiary?.main||n.palette.primary.main,backgroundColor:n.palette.backgroundPaperElevation?.[11]||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case ST.ROBOT_DISCONNECTED:return{label:i(`RobotSetupReadinessIndicator.RobotDisconnected.lb`),indicatorColor:n.palette.error.main,backgroundColor:n.palette.backgroundPaperElevation?.[11]||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case ST.CELL_OPEN:return{label:i(`RobotSetupReadinessIndicator.CellOpen.lb`),indicatorColor:n.palette.error.main,backgroundColor:n.palette.backgroundPaperElevation?.[11]||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case ST.E_STOP:return{label:i(`RobotSetupReadinessIndicator.EStop.lb`),indicatorColor:n.palette.error.main,backgroundColor:n.palette.backgroundPaperElevation?.[11]||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case ST.MANUAL_MODE:return{label:i(`RobotSetupReadinessIndicator.ManualMode.lb`),indicatorColor:n.palette.error.main,backgroundColor:n.palette.backgroundPaperElevation?.[11]||n.palette.background.paper,textColor:n.palette.secondary.contrastText};case ST.PRECONDITION_NOT_FULFILLED:default:return{label:i(`RobotSetupReadinessIndicator.PreconditionNotFulfilled.lb`),indicatorColor:n.palette.error.main,backgroundColor:n.palette.backgroundPaperElevation?.[11]||n.palette.background.paper,textColor:n.palette.secondary.contrastText}}})();return(0,g.jsx)(r.Chip,{className:t,label:(0,g.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`center`,gap:1},children:[(0,g.jsx)(r.Box,{sx:{width:8,height:8,borderRadius:`50%`,backgroundColor:s,flexShrink:0}}),(0,g.jsx)(r.Typography,{variant:`body2`,sx:{color:l,fontSize:`0.75rem`,lineHeight:1.2},children:o})]}),variant:`filled`,sx:{backgroundColor:c,color:n.palette.getContrastText(c),fontWeight:500,height:`auto`,"& .MuiChip-label":{paddingX:1.5,paddingY:.5}}})})),wT=e.m((0,i.observer)(({robotName:e,robotType:t,setupState:n,PreconditionComponent:i=CT,className:a})=>{let o=(0,r.useTheme)(),s=t||`Robot`,c=n===ST.READY;return(0,g.jsxs)(r.Box,{className:a,sx:{border:`1px solid ${o.palette.divider}`,background:o.palette.backgroundPaperElevation?.[8]||`#292B3F`,borderRadius:`8px`,padding:`20px`,display:`flex`,alignItems:`center`,justifyContent:`space-between`,opacity:1},children:[(0,g.jsxs)(r.Box,{sx:{display:`flex`,alignItems:`center`,gap:2,flex:1},children:[c?(0,g.jsx)(r.Box,{sx:{fontSize:24,display:`flex`,alignItems:`center`,justifyContent:`center`,width:24,height:24,"& svg":{fill:`${o.palette.primary.main} !important`},"& svg path":{fill:`${o.palette.primary.main} !important`}},children:(0,g.jsx)(xT,{})}):(0,g.jsx)(bT,{sx:{color:o.palette.error.main,fontSize:24}}),(0,g.jsx)(r.Typography,{variant:`body1`,sx:{fontWeight:500,color:o.palette.text.primary},children:e}),(0,g.jsx)(r.Divider,{orientation:`vertical`,flexItem:!0,sx:{backgroundColor:o.palette.text.secondary,opacity:.3,width:`1px`}}),(0,g.jsx)(r.Typography,{variant:`body2`,sx:{color:o.palette.text.secondary},children:s})]}),i&&(0,g.jsx)(i,{setupState:n})]})})),TT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M5.248 21c-.334 0-.619-.116-.853-.35a1.153 1.153 0 0 1-.351-.848c0-.333.117-.616.351-.85.234-.233.519-.35.853-.35H7.24L4.558 9.87a2.881 2.881 0 0 1-1.126-1.042A2.77 2.77 0 0 1 3 7.317c0-.793.28-1.467.838-2.023a2.774 2.774 0 0 1 2.033-.834 2.71 2.71 0 0 1 1.728.585c.494.389.832.887 1.014 1.493h3.58V5.239c0-.22.076-.406.226-.555a.76.76 0 0 1 .558-.224c.136 0 .263.035.381.104.118.07.209.167.273.292v.14l1.835-1.702a.979.979 0 0 1 .52-.279.881.881 0 0 1 .58.091l4.01 1.85a.74.74 0 0 1 .36.364.537.537 0 0 1-.002.474.592.592 0 0 1-.366.323.657.657 0 0 1-.477-.039l-3.858-1.774L13.76 6.59v1.454l2.473 2.233 3.858-1.774a.648.648 0 0 1 .485-.03.571.571 0 0 1 .358.314.513.513 0 0 1 .01.482.79.79 0 0 1-.367.357l-4.011 1.882a.881.881 0 0 1-.58.09.979.979 0 0 1-.52-.278L13.63 9.638v.14a.92.92 0 0 1-.273.275.665.665 0 0 1-.381.12.76.76 0 0 1-.558-.224.752.752 0 0 1-.225-.555V8.096h-3.58a2.82 2.82 0 0 1-.215.54 2.552 2.552 0 0 1-.323.479l5.139 9.488h2.673c.335 0 .62.116.854.35.234.233.35.516.35.849 0 .332-.116.615-.35.849a1.167 1.167 0 0 1-.854.349H5.248Zm.623-12.385c.362 0 .67-.126.924-.378a1.25 1.25 0 0 0 .38-.92 1.25 1.25 0 0 0-.38-.92 1.261 1.261 0 0 0-.924-.379 1.26 1.26 0 0 0-.925.379 1.25 1.25 0 0 0-.38.92c0 .36.127.667.38.92.254.252.562.378.925.378Z`})]})),ET=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`m13.37 9.12 1.69 1.69 2.99-2.99-3.73-3.73-.95-.95-7.66 7.66-.95.95 3.99 3.99v3.44h7.55v-3.55l-4.72-4.72 1.79-1.79Zm-.91-2.99.91-.91 2.6 2.6-.91.91-2.6-2.6Zm-2.25 10.24h3.74l-1.34-1.34-.04-.04h-2.5l-3.25-3.25 4.59-4.59.92.92L9.5 10.9l5.33 5.33v1.48H10.2v-1.35l.01.01ZM2 2v4.99h1.41V3.4h3.58V2H2ZM22.21 2h-4.98v1.41h3.59v3.58h1.4V2h-.01ZM20.81 20.65h-3.58v1.4h4.98v-4.99h-1.4v3.59ZM3.4 17.06H2v4.98h4.99v-1.4H3.4v-3.58Z`})]})),DT=(0,i.observer)(({id:e,icon:t,color:n,title:a,name:o,label:s,explanation:c,literalValue:l,anchorOrigin:u,transformOrigin:d})=>{let f=(0,i.useLocalObservable)(()=>({anchorEl:null,get isPopoverOpen(){return!!f.anchorEl},openPopover(e){f.anchorEl=e.currentTarget},closePopover(){f.anchorEl=null}}));return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(r.Stack,{"aria-owns":f.isPopoverOpen?e:void 0,"aria-haspopup":`true`,onMouseEnter:f.openPopover,onMouseLeave:f.closePopover,direction:`row`,spacing:1,sx:{cursor:`pointer`},children:[(0,g.jsx)(r.SvgIcon,{component:t,sx:{color:n}}),s&&(0,g.jsx)(`div`,{style:{color:n},children:s})]}),(0,g.jsx)(r.Popover,{id:e,sx:{pointerEvents:`none`},open:f.isPopoverOpen,anchorEl:f.anchorEl,anchorOrigin:u??{vertical:`bottom`,horizontal:`left`},transformOrigin:d??{vertical:`top`,horizontal:`left`},onClose:f.closePopover,disableRestoreFocus:!0,children:(0,g.jsxs)(r.Stack,{gap:`1rem`,padding:2,maxWidth:`450px`,sx:{wordWrap:`break-word`},children:[(0,g.jsxs)(`div`,{children:[a&&(0,g.jsx)(r.Typography,{component:`span`,fontSize:`14px`,children:`${a}: `}),(0,g.jsx)(r.Typography,{component:`span`,color:n,fontWeight:`bold`,fontSize:`14px`,children:o})]}),(0,g.jsx)(r.Typography,{fontSize:`14px`,children:c}),l&&(0,g.jsx)(r.Typography,{fontSize:`12px`,children:l})]})})]})}),OT=(0,i.observer)(({isVirtual:e,motionGroupId:t,anchorOrigin:i,transformOrigin:o,compact:s})=>{let c=(0,r.useTheme)(),l=(0,n.useId)(),{t:u}=(0,a.useTranslation)();return e?(0,g.jsx)(DT,{id:`motion-group-virtual-${l}`,icon:ET,color:c.palette.tertiary.main,name:u(`SafetyBar.ControllerType.Virtual.lb`),label:s?null:u(`SafetyBar.ControllerType.Virtual.lb`),explanation:(0,g.jsxs)(a.Trans,{i18nKey:`SafetyBar.MotionGroup.Virtual.Explanation.lb`,values:{motionGroupId:t},children:[`Motion group `,(0,g.jsx)(`code`,{children:t}),` refers to a virtual robot with no physical counterpart. It can be freely manipulated without special safety precautions.`]}),anchorOrigin:i,transformOrigin:o}):(0,g.jsx)(DT,{id:`motion-group-physical-${l}`,icon:TT,color:c.palette.primary.main,name:u(`SafetyBar.ControllerType.Physical.lb`),label:s?null:u(`SafetyBar.ControllerType.Physical.lb`),explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.MotionGroup.Physical.Explanation.lb`,values:{motionGroupId:t},components:{code:(0,g.jsx)(`code`,{}),strong:(0,g.jsx)(`strong`,{})}}),anchorOrigin:i,transformOrigin:o})}),kT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M15.306 2.768c0-.424.344-.768.768-.768h.406C19.53 2 22 4.551 22 7.699c0 3.237-2.51 5.587-5.31 5.703-.84 1.595-2.478 2.677-4.36 2.677a4.845 4.845 0 0 1-3.146-1.163c-.6 1.783 0 3.922 1.79 4.99 1.929 1.149 4.395.467 5.508-1.524l.212-.378a.75.75 0 1 1 1.308.732l-.231.414c-1.524 2.725-4.9 3.66-7.54 2.085-2.716-1.618-3.432-5.037-2.129-7.599a5.22 5.22 0 0 1-.73-2.677c0-2.192 1.335-4.063 3.212-4.793-1.195-1.427-3.29-1.96-5.08-.892-1.928 1.15-2.589 3.696-1.475 5.687l.231.413a.75.75 0 0 1-1.308.732l-.212-.377c-1.524-2.726-.62-6.211 2.02-7.785 2.716-1.619 5.943-.55 7.44 1.897l.13-.001c2.739 0 4.96 2.292 4.96 5.12 0 .284-.023.563-.066.834 1.795-.354 3.288-1.96 3.288-4.095 0-2.3-1.805-4.163-4.032-4.163h-.406a.768.768 0 0 1-.768-.768Zm.496 8.191c0 .286-.033.564-.094.831a3.62 3.62 0 0 1-.672 1.415 3.425 3.425 0 0 1-2.706 1.338 3.402 3.402 0 0 1-2.384-.98 3.598 3.598 0 0 1-.852-1.306 3.677 3.677 0 0 1-.235-1.298c0-1.623 1.046-2.994 2.48-3.435a3.37 3.37 0 0 1 1.522-.107c1.665.264 2.94 1.75 2.94 3.542Z`})]})),AT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z`,fill:`#fff`,fillOpacity:.56})]})),jT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M12.953 5.09a1.497 1.497 0 0 0-1.653-.518l-1.35.43a1.504 1.504 0 0 0-1.726-.376L2.858 6.97c-.736.321-1.06 1.155-.726 1.862.334.707 1.202 1.02 1.937.698l4.27-1.865 1.466 1.973v.402c0 .873-.627 1.63-1.512 1.827l-2.56.567c-1.329.295-2.27 1.431-2.27 2.74v.107c0 .26.22.469.489.469h11.117c1.329 0 2.618.435 3.656 1.233l1.665 1.28A1 1 0 0 0 22 17.47V11.062c0-.312-.108-.616-.308-.863l-3.415-4.218a1.5 1.5 0 0 0-1.618-.471l-.378.12-.866-.475a1.516 1.516 0 0 0-1.188-.114l-1.06.338-.214-.289Z`})]})),MT=(0,i.observer)(({operationMode:e,anchorOrigin:t,transformOrigin:i,compact:o})=>{let{t:s}=(0,a.useTranslation)(),c=(0,r.useTheme)(),l=(0,n.useId)();switch(e){case`OPERATION_MODE_AUTO`:return(0,g.jsx)(DT,{id:`operation-mode-auto-${l}`,icon:kT,title:s(`SafetyBar.OperationMode.ti`),name:s(`SafetyBar.OperationMode.Automatic.ti`),label:o?null:s(`SafetyBar.OperationMode.Automatic.ti`),color:c.palette.text.secondary,explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.OperationMode.Auto.Explanation.lb`,children:`The robot controller is in automatic operation mode. Automated movement without manual confirmation is possible in this mode.`}),anchorOrigin:t,transformOrigin:i});case`OPERATION_MODE_MANUAL`:case`OPERATION_MODE_MANUAL_T1`:case`OPERATION_MODE_MANUAL_T2`:return(0,g.jsx)(DT,{id:`operation-mode-manual-${l}`,icon:jT,color:c.palette.warning.main,title:s(`SafetyBar.OperationMode.ti`),name:s(`SafetyBar.OperationMode.Manual.lb`),label:o?null:s(`SafetyBar.OperationMode.Manual.lb`),explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.OperationMode.Manual.Explanation.lb`,children:`The robot controller is in manual operation mode. On a physical robot, this generally indicates that an enabling switch must be held for the robot to move successfully.`}),literalValue:e,anchorOrigin:t,transformOrigin:i});default:return(0,g.jsx)(DT,{id:`operation-mode-error-${l}`,icon:AT,color:c.palette.warning.main,title:s(`SafetyBar.OperationMode.ti`),name:s(`SafetyBar.OperationMode.Error.lb`),label:o?null:s(`SafetyBar.OperationMode.Error.lb`),explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.OperationMode.Error.Explanation.lb`,children:`The robot controller has entered an unexpected operation mode. Motion group movement may not be possible.`}),literalValue:e,anchorOrigin:t,transformOrigin:i})}}),NT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M19.763 16.432 13.516 5.864c-.674-1.152-2.358-1.152-3.049 0l-6.23 10.568C3.563 17.567 4.405 19 5.753 19H18.23c1.364 0 2.206-1.432 1.532-2.568ZM12 8.498c.539 0 .96.428.96.938v.066l-.32 4.708a.639.639 0 0 1-.64.592.639.639 0 0 1-.64-.592l-.32-4.708A.953.953 0 0 1 12 8.498Zm0 8.79c-.556 0-1.01-.444-1.01-.987 0-.544.454-.988 1.01-.988s1.01.444 1.01.988c0 .542-.454.987-1.01.987Z`})]})),PT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M10.24 10.636 12 13.764l1.76-3.128h-3.52Z`}),(0,g.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M18.364 12a6.364 6.364 0 1 1-12.728 0 6.364 6.364 0 0 1 12.728 0ZM7.909 9.273 12 16.546l4.09-7.273H7.91Z`}),(0,g.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.364 0a8.636 8.636 0 1 1-17.273 0 8.636 8.636 0 0 1 17.273 0Z`})]})),FT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M9.057 15.115c-1.681 0-3.111-.59-4.29-1.768C3.59 12.17 3 10.74 3 9.057c0-.29.021-.582.064-.876a4.1 4.1 0 0 1 .214-.844.78.78 0 0 1 .273-.36c.115-.077.244-.133.389-.168a.857.857 0 0 1 .437.008c.146.04.28.12.4.24l2.806 2.787 2.26-2.261-2.775-2.786a.903.903 0 0 1-.241-.405.875.875 0 0 1-.008-.442 1.13 1.13 0 0 1 .174-.389.82.82 0 0 1 .355-.273c.268-.107.548-.182.838-.224.29-.043.581-.064.871-.064 1.682 0 3.112.59 4.29 1.768 1.179 1.178 1.768 2.608 1.768 4.29 0 .444-.042.858-.126 1.241-.084.384-.21.755-.377 1.113l5.726 5.692A2.2 2.2 0 0 1 21 18.721a2.2 2.2 0 0 1-.662 1.617A2.2 2.2 0 0 1 18.72 21a2.173 2.173 0 0 1-1.617-.679l-5.692-5.709c-.372.161-.75.285-1.133.372-.383.087-.79.13-1.222.13Z`,fill:`#fff`,fillOpacity:.56})]})),IT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`m10.6 13.8-2.15-2.15a.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275.948.948 0 0 0-.275.7c0 .283.092.517.275.7L9.9 15.9c.2.2.433.3.7.3.267 0 .5-.1.7-.3l5.65-5.65a.948.948 0 0 0 .275-.7.948.948 0 0 0-.275-.7.948.948 0 0 0-.7-.275.948.948 0 0 0-.7.275L10.6 13.8ZM12 22a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z`})]})),LT=(0,n.forwardRef)(({title:e,titleId:t,...n},r)=>(0,g.jsxs)(`svg`,{width:24,height:24,xmlns:`http://www.w3.org/2000/svg`,ref:r,"aria-labelledby":t,...n,children:[e?(0,g.jsx)(`title`,{id:t,children:e}):null,(0,g.jsx)(`path`,{d:`M9 16h6c.283 0 .52-.096.713-.287A.968.968 0 0 0 16 15V9a.967.967 0 0 0-.287-.713A.968.968 0 0 0 15 8H9a.968.968 0 0 0-.713.287A.968.968 0 0 0 8 9v6c0 .283.096.52.287.713.192.191.43.287.713.287Zm3 6a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 2 12c0-1.383.263-2.683.788-3.9a10.099 10.099 0 0 1 2.137-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 12 2c1.383 0 2.683.263 3.9.788a10.098 10.098 0 0 1 3.175 2.137c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 22 12a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 12 22Zm0-2c2.233 0 4.125-.775 5.675-2.325C19.225 16.125 20 14.233 20 12c0-2.233-.775-4.125-2.325-5.675C16.125 4.775 14.233 4 12 4c-2.233 0-4.125.775-5.675 2.325C4.775 7.875 4 9.767 4 12c0 2.233.775 4.125 2.325 5.675C7.875 19.225 9.767 20 12 20Z`})]})),RT=(0,i.observer)(({safetyState:e,anchorOrigin:t,transformOrigin:i,compact:o})=>{let{t:s}=(0,a.useTranslation)(),c=(0,r.useTheme)(),l=(0,n.useId)();switch(e){case`SAFETY_STATE_NORMAL`:return(0,g.jsx)(DT,{id:`safety-state-normal-${l}`,title:s(`SafetyBar.SafetyState.ti`),name:s(`SafetyBar.SafetyState.Normal.lb`),label:o?null:s(`SafetyBar.SafetyState.Normal.lb`),icon:IT,color:c.palette.text.secondary,explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.SafetyState.Normal.Explanation.lb`,children:`The robot controller is in a normal safety state. Movement is not prevented by this state.`}),anchorOrigin:t,transformOrigin:i});case`SAFETY_STATE_DEVICE_EMERGENCY_STOP`:case`SAFETY_STATE_ROBOT_EMERGENCY_STOP`:return(0,g.jsx)(DT,{id:`safety-state-estop-${l}`,title:s(`SafetyBar.SafetyState.ti`),name:s(`SafetyBar.SafetyState.Estop.lb`),label:o?null:s(`SafetyBar.SafetyState.Estop.lb`),icon:PT,color:c.palette.error.main,explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.StopState.Estop.Explanation.lb`,children:`An emergency stop of the robot controller has been triggered. Movement of the robot is no longer possible until the estop is released.`}),literalValue:e,anchorOrigin:t,transformOrigin:i});case`SAFETY_STATE_STOP_0`:case`SAFETY_STATE_STOP_1`:case`SAFETY_STATE_STOP_2`:case`SAFETY_STATE_PROTECTIVE_STOP`:case`SAFETY_STATE_STOP`:return(0,g.jsx)(DT,{id:`safety-state-stop-${l}`,icon:LT,title:s(`SafetyBar.SafetyState.ti`),name:s(`SafetyBar.SafetyState.Stop.lb`),label:o?null:s(`SafetyBar.SafetyState.Stop.lb`),color:c.palette.warning.main,explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.SafetyState.Stop.Explanation.lb`,children:`The robot controller has entered a stop state. Movement is no longer possible until the stop state is resolved.`}),literalValue:e,anchorOrigin:t,transformOrigin:i});case`SAFETY_STATE_REDUCED`:case`SAFETY_STATE_MASTERING`:case`SAFETY_STATE_CONFIRM_SAFETY`:case`SAFETY_STATE_OPERATOR_SAFETY`:case`SAFETY_STATE_RECOVERY`:case`SAFETY_STATE_VIOLATION`:return(0,g.jsx)(DT,{id:`safety-state-manual-action-required-${l}`,icon:FT,color:c.palette.warning.main,title:s(`SafetyBar.SafetyState.ti`),name:s(`SafetyBar.SafetyState.ManualActionRequired.lb`),label:o?null:s(`SafetyBar.SafetyState.ManualActionRequired.lb`),explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.SafetyState.ManualActionRequired.Explanation.lb`,children:`The robot controller has entered a safety state requiring manual action to resolve.`}),literalValue:e,anchorOrigin:t,transformOrigin:i});case`SAFETY_STATE_UNKNOWN`:case`SAFETY_STATE_FAULT`:return(0,g.jsx)(DT,{id:`safety-state-error-${l}`,icon:NT,color:c.palette.error.main,title:s(`SafetyBar.SafetyState.ti`),name:s(`SafetyBar.SafetyState.Error.lb`),label:o?null:s(`SafetyBar.SafetyState.Error.lb`),explanation:(0,g.jsx)(a.Trans,{i18nKey:`SafetyBar.SafetyState.Error.Explanation.lb`,children:`The robot controller has entered an unexpected safety state.`}),literalValue:e,anchorOrigin:t,transformOrigin:i});default:wy(e,`Unknown safety state ${e}`)}}),zT=e.m((0,i.observer)(({isVirtual:e,motionGroupId:t,operationMode:n,safetyState:i,anchorOrigin:a,transformOrigin:o,compact:s=!0})=>(0,g.jsxs)(r.Stack,{direction:`row`,gap:s?1:2,alignItems:`center`,sx:{height:`24px`},children:[(0,g.jsx)(RT,{safetyState:i,anchorOrigin:a,transformOrigin:o,compact:s}),(0,g.jsx)(r.Divider,{orientation:`vertical`,flexItem:!0}),(0,g.jsx)(MT,{operationMode:n,anchorOrigin:a,transformOrigin:o,compact:s}),(0,g.jsx)(r.Divider,{orientation:`vertical`,flexItem:!0}),(0,g.jsx)(OT,{isVirtual:e,motionGroupId:t,anchorOrigin:a,transformOrigin:o,compact:s})]}))),BT=(0,r.styled)(r.Fab,{shouldForwardProp:e=>e!==`selected`})(({theme:e})=>({borderRadius:`20px`,"&:hover":{background:e.palette.backgroundPaperElevation?.[7]},variants:[{props:({selected:e})=>!e,style:{background:e.palette.backgroundPaperElevation?.[0],color:e.palette.action.disabled,"> img":{opacity:.4}}},{props:({selected:e})=>e,style:{background:e.palette.backgroundPaperElevation?.[11],border:`1px solid ${e.palette.divider}`,color:e.palette.primary.contrastText}}]})),VT=e=>{let{ref:t,...n}=e;return(0,g.jsx)(BT,{ref:t,selected:e.selected,...n,color:`secondary`,variant:`circular`})};function HT(e){let{children:t,value:n,index:i,...a}=e;return(0,g.jsx)(`div`,{role:`tabpanel`,hidden:n!==i,id:`tabpanel-${i}`,"aria-labelledby":`tab-${i}`,...a,children:n===i&&(0,g.jsx)(r.Box,{children:t})})}function UT({children:e,...t}){let{fullWidth:n,indicator:i,onChange:a,orientation:o,scrollButtons:s,selectionFollowsFocus:c,textColor:l,value:u,variant:d,...f}=t;return(0,g.jsx)(r.Box,{...f,children:e})}var WT=e.m((0,i.observer)(e=>{let{items:t,activeTab:i,defaultActiveTab:a=0,onTabChange:o,sx:s,ref:c}=e,l=i!==void 0,[u,d]=(0,n.useState)(a),f=l?i:u;(0,n.useEffect)(()=>{l||t.length!==0&&(u<0||u>t.length-1)&&d(0)},[t.length,l,u]);let p=(e,t)=>{l||d(t),o?.(t)};return(0,g.jsxs)(r.Box,{ref:c,sx:{height:`100%`,display:`flex`,flexDirection:`column`,...s},children:[(0,g.jsx)(r.Box,{sx:{px:0,py:0,overflow:`visible`,position:`relative`,paddingTop:e=>e.spacing(2),paddingRight:e=>e.spacing(2.5)},children:(0,g.jsx)(r.Tabs,{value:f,onChange:p,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:t.map((e,t)=>{let n=()=>{if(!e.badge)return;let t=e.badge.content,n=e.badge.max;return typeof t==`number`&&n&&t>n?`${n}+`:t},i=()=>{if(!e.badge)return!1;let t=e.badge.content,n=e.badge.showZero;return!(t===0&&!n)},a=n(),s=i(),c=(0,g.jsx)(r.Tab,{label:e.label,icon:e.icon,iconPosition:`start`,disableRipple:!0,onClick:()=>{l||d(t),o?.(t)},sx:{minHeight:`32px`,height:`32px`,padding:`0px 10px`,borderRadius:`12px`,backgroundColor:e=>e.palette.backgroundPaperElevation?.[11]||`#32344B`,color:`text.primary`,opacity:f===t?1:.38,fontSize:`13px`,transition:`all 0.2s ease-in-out`,position:`relative`,overflow:`visible`,"&:hover":{opacity:f===t?1:.6},"&.Mui-selected":{opacity:1,backgroundColor:e=>e.palette.backgroundPaperElevation?.[11]||`#32344B`,color:`text.primary`},"&:focus":{outline:`none`},"&:active":{transform:`none`}}},e.id);return s?(0,g.jsx)(UT,{component:`span`,sx:{display:`inline-flex`},children:(0,g.jsx)(r.Badge,{badgeContent:a,color:e.badge?.color||`error`,max:e.badge?.max,showZero:e.badge?.showZero,anchorOrigin:{vertical:`top`,horizontal:`right`},overlap:`rectangular`,sx:{"& .MuiBadge-badge":{opacity:`1 !important`}},children:c})},e.id):c})})}),(0,g.jsx)(r.Box,{sx:{mt:e=>e.spacing(2),borderBottom:1,borderColor:`divider`}}),(0,g.jsx)(r.Box,{sx:{flex:1,overflow:`auto`},children:t.map((e,t)=>(0,g.jsx)(HT,{value:f,index:t,children:e.content},e.id))})]})})),GT=e=>{let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60),i=e%60,a=[];return t>0?(a.push(t.toString()),a.push(n.toString().padStart(2,`0`)),a.push(r.toString().padStart(2,`0`)),a.push(i.toString().padStart(2,`0`))):n>0?(a.push(n.toString()),a.push(r.toString().padStart(2,`0`)),a.push(i.toString().padStart(2,`0`))):(a.push(r.toString()),a.push(i.toString().padStart(2,`0`))),a.join(`:`)},KT=(e,t)=>{let n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60),a=e%60;if(typeof Intl<`u`&&`DurationFormat`in Intl)try{let e={};return n>0&&(e.days=n),r>0&&(e.hours=r),i>0&&(e.minutes=i),(a>0||Object.keys(e).length===0)&&(e.seconds=a),new Intl.DurationFormat(t,{style:`narrow`}).format(e)}catch{}let o=[];return n>0&&o.push(`${n}d`),r>0&&o.push(`${r}h`),i>0&&o.push(`${i}m`),(a>0||o.length===0)&&o.push(`${a}s`),o.join(` `)},qT=({timerState:e,animationState:t,hasError:n,className:i})=>{let{t:o}=(0,a.useTranslation)(),s=ci(),{elapsedTime:c,currentProgress:l}=e,{showErrorAnimation:u,showPauseAnimation:d,showMainText:f}=t;return(0,g.jsxs)(r.Box,{className:i,sx:{position:`relative`,width:264,height:264,display:`flex`,alignItems:`center`,justifyContent:`center`},children:[(0,g.jsx)(h.Gauge,{width:264,height:264,value:l,valueMin:0,valueMax:100,innerRadius:`85%`,outerRadius:`100%`,margin:0,skipAnimation:!0,text:()=>``,sx:{opacity:d||u?.6:1,transition:`opacity 0.5s ease-out`,"& .MuiGauge-valueArc":{fill:n?s.palette.error.light:s.palette.success.main,transition:`fill 0.5s ease-out`},"& .MuiGauge-referenceArc":{fill:`#171927`,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`}}}),(0,g.jsx)(r.Box,{sx:{position:`absolute`,top:`50%`,left:`50%`,transform:`translate(-50%, -50%)`,width:225,height:225,borderRadius:`50%`,backgroundColor:`#292B3F`,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,textAlign:`center`,gap:1,transition:`background-color 0.5s ease-out`},children:(0,g.jsxs)(r.Box,{sx:{position:`relative`,height:`48px`,display:`flex`,alignItems:`center`,justifyContent:`center`,marginBottom:.5},children:[(0,g.jsx)(r.Fade,{in:f&&n,timeout:200,children:(0,g.jsx)(r.Typography,{variant:`h6`,sx:{position:`absolute`,fontSize:`16px`,fontWeight:500,color:s.palette.error.light},children:o(`timer.error`)})}),(0,g.jsx)(r.Fade,{in:f&&!n,timeout:300,children:(0,g.jsx)(r.Typography,{variant:`h1`,sx:{position:`absolute`,fontSize:`48px`,fontWeight:500,color:s.palette.text.primary,lineHeight:1,letterSpacing:`-0.5px`},children:GT(c)})})]})})]})},JT=({timerState:e,animationState:t,hasError:n,compact:i,className:o})=>{let{t:s,i18n:c}=(0,a.useTranslation)(),l=ci(),{elapsedTime:u,currentProgress:d}=e,{showErrorAnimation:f,showPauseAnimation:p}=t;return i?(0,g.jsx)(r.Box,{className:o,sx:{display:`flex`,alignItems:`center`,m:0},children:(0,g.jsx)(r.Typography,{variant:`body2`,sx:{color:n?l.palette.error.light:l.palette.text.primary,fontSize:`14px`,transition:`color 0.5s ease-out`},children:n?s(`timer.error`):KT(u,c.language)})}):(0,g.jsxs)(r.Box,{className:o,sx:{display:`flex`,alignItems:`center`,m:0,gap:1},children:[(0,g.jsx)(r.Box,{sx:{width:20,height:20,display:`flex`,alignItems:`center`,justifyContent:`center`,opacity:p||f?.6:1,transition:`opacity 0.5s ease-out`},children:(0,g.jsxs)(`svg`,{width:`20`,height:`20`,viewBox:`0 0 20 20`,style:{transform:`rotate(-90deg)`},role:`img`,"aria-label":`Timer progress`,children:[(0,g.jsx)(`circle`,{cx:`10`,cy:`10`,r:`8`,fill:`none`,stroke:n?l.palette.error.light:l.palette.success.main,strokeWidth:`2`,opacity:.3,style:{transition:`stroke 0.8s ease-in-out, opacity 2s ease-in-out`}}),(0,g.jsx)(`circle`,{cx:`10`,cy:`10`,r:`8`,fill:`none`,stroke:n?l.palette.error.light:l.palette.success.main,strokeWidth:`2`,strokeLinecap:`round`,strokeDasharray:`${2*Math.PI*8}`,strokeDashoffset:`${2*Math.PI*8*(1-d/100)}`,style:{transition:`stroke-dashoffset 0.1s ease-out, stroke 0.8s ease-in-out, opacity 2s ease-in-out`}})]})}),(0,g.jsx)(r.Typography,{variant:`body2`,sx:{color:n?l.palette.error.light:l.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?s(`timer.error`):KT(u,c.language)})]})},YT=()=>{let[e,t]=(0,n.useState)({showPauseAnimation:!1,showErrorAnimation:!1,showMainText:!0}),r=(0,n.useRef)(null),i=(0,n.useRef)(null),a=(0,n.useRef)(null);return{animationState:e,triggerPauseAnimation:(0,n.useCallback)(()=>{t(e=>({...e,showPauseAnimation:!0})),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(e=>({...e,showPauseAnimation:!1}))},800)},[]),triggerErrorAnimation:(0,n.useCallback)(()=>{t(e=>({...e,showErrorAnimation:!0})),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{t(e=>({...e,showErrorAnimation:!1}))},600)},[]),clearErrorAnimation:(0,n.useCallback)(()=>{t(e=>({...e,showErrorAnimation:!1})),i.current&&clearTimeout(i.current)},[]),triggerFadeTransition:(0,n.useCallback)(()=>{t(e=>({...e,showMainText:!1})),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{t(e=>({...e,showMainText:!0}))},200)},[]),setInitialAnimationState:(0,n.useCallback)(()=>{t(e=>({...e,showMainText:!0}))},[]),cleanup:(0,n.useCallback)(()=>{r.current&&clearTimeout(r.current),i.current&&clearTimeout(i.current),a.current&&clearTimeout(a.current)},[])}},XT=({autoStart:t,hasError:r,onPauseAnimation:i,onErrorAnimation:a,onClearErrorAnimation:o})=>{let[s,c]=(0,n.useState)({elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0,wasRunningBeforeError:!1}),l=(0,n.useRef)(null),u=(0,n.useRef)(null),d=(0,n.useRef)(0),f=(0,n.useRef)(0),[p]=e.n([0],{tension:80,friction:18,onChange:([e])=>{c(t=>({...t,currentProgress:e}))}}),m=(0,n.useCallback)((e=0)=>{let n=e/60%1*100;c(t=>({...t,elapsedTime:e,isPausedState:!1,currentProgress:n})),d.current=0,f.current=n,p.setImmediate([n]),t?(u.current=Date.now()-e*1e3,c(e=>({...e,isRunning:!0}))):u.current=null},[t,p]),h=(0,n.useCallback)(()=>{if(u.current&&s.isRunning){let e=(Date.now()-u.current)/1e3+d.current,t=e/60%1*100;p.setTarget([t]),c(t=>({...t,elapsedTime:Math.floor(e)}))}c(e=>({...e,isRunning:!1,isPausedState:!0})),i()},[s.isRunning,p,i]),g=(0,n.useCallback)(()=>{s.isPausedState&&(d.current=s.elapsedTime,u.current=Date.now(),c(e=>({...e,isRunning:!0,isPausedState:!1})))},[s.isPausedState,s.elapsedTime]),_=(0,n.useCallback)(()=>{c(e=>({...e,elapsedTime:0,isRunning:!1,isPausedState:!1,currentProgress:0})),d.current=0,u.current=null,f.current=0,p.setImmediate([0])},[p]),v=(0,n.useCallback)(()=>s.isPausedState,[s.isPausedState]);return(0,n.useEffect)(()=>{r?(s.isRunning&&(c(e=>({...e,wasRunningBeforeError:!0})),h()),a()):(s.wasRunningBeforeError&&!s.isRunning&&(c(e=>({...e,wasRunningBeforeError:!1})),g()),o())},[r,s.isRunning,s.wasRunningBeforeError,h,g,a,o]),(0,n.useEffect)(()=>{if(s.isRunning){let e=()=>{if(u.current){let e=(Date.now()-u.current)/1e3+d.current,t=e/60%1*100;c(t=>({...t,elapsedTime:Math.floor(e)})),Math.abs(t-f.current)>.1&&(p.setTarget([t]),f.current=t)}l.current=requestAnimationFrame(e)};l.current=requestAnimationFrame(e)}else l.current&&=(cancelAnimationFrame(l.current),null);return()=>{l.current&&=(cancelAnimationFrame(l.current),null)}},[s.isRunning,p]),(0,n.useEffect)(()=>{let e=null,t=()=>{p.update(),e=requestAnimationFrame(t)};return e=requestAnimationFrame(t),()=>{e&&cancelAnimationFrame(e)}},[p]),{timerState:s,controls:{start:m,pause:h,resume:g,reset:_,isPaused:v}}},ZT=e.m((0,i.observer)(({onTimerReady:e,autoStart:t=!0,variant:r=`default`,compact:i=!1,className:a,hasError:o=!1})=>{let{animationState:s,triggerPauseAnimation:c,triggerErrorAnimation:l,clearErrorAnimation:u,setInitialAnimationState:d,cleanup:f}=YT(),{timerState:p,controls:m}=XT({autoStart:t,hasError:o,onPauseAnimation:c,onErrorAnimation:l,onClearErrorAnimation:u});return(0,n.useEffect)(()=>{d()},[d]),(0,n.useEffect)(()=>{let t=!0,n=setTimeout(()=>{t&&e(m)},0);return()=>{t=!1,clearTimeout(n)}},[e,m]),(0,n.useEffect)(()=>f,[f]),r===`small`?(0,g.jsx)(JT,{timerState:p,animationState:s,hasError:o,compact:i,className:a}):(0,g.jsx)(qT,{timerState:p,animationState:s,hasError:o,className:a})})),QT=1e-4,$T={a:0,d:0,alpha:0,theta:0,reverse_rotation_direction:!1},eE=class e{static async connectMultiple(t,n){return Promise.all(n.map(n=>e.connect(t,n)))}static async connect(t,n){let[r,i]=n.split(`@`),a=await t.api.controller.getCurrentRobotControllerState(i),o=a?.motion_groups.find(e=>e.motion_group===n);if(!a||!o)throw Error(`Controller ${i} or motion group ${n} not found`);let s=t.openReconnectingWebsocket(`/controllers/${i}/motion-groups/${n}/state-stream`),c=await s.firstMessage(),l=(0,p.tryParseJson)(c.data)?.result;if(!l)throw Error(`Unable to parse initial motion state message ${c.data}`);console.log(`Connected motion state websocket to motion group ${o.motion_group}. Initial state:\n `,l);let u=(await t.api.controller.getRobotController(a.controller)).configuration.kind===`VirtualController`,d=await t.api.motionGroup.getMotionGroupDescription(i,o.motion_group),f=Object.entries(d.tcps||{}).map(([e,t])=>({id:e,readable_name:t.name,position:t.pose.position,orientation:t.pose.orientation})),m=t.openReconnectingWebsocket(`/controllers/${a.controller}/state-stream?response_rate=1000`),h=await m.firstMessage(),g=(0,p.tryParseJson)(h.data)?.result;if(!g)throw Error(`Unable to parse initial controller state message ${h.data}`);return console.log(`Connected controller state websocket to controller ${a.controller}. Initial state:\n `,g),new e(t,a,o,l,s,u,f,d,g,m)}constructor(e,t,n,r,i,a,o,s,l,u){this.nova=e,this.controller=t,this.motionGroup=n,this.initialMotionState=r,this.motionStateSocket=i,this.isVirtual=a,this.tcps=o,this.description=s,this.initialControllerState=l,this.controllerStateSocket=u,this.connectedJoggingSocket=null,this.joggingVelocity=10,this.activationState=`inactive`,this.rapidlyChangingMotionState=r,this.controllerState=l,u.addEventListener(`message`,e=>{let t=(0,p.tryParseJson)(e.data)?.result;t&&(0,c.runInAction)(()=>{this.controllerState=t})}),i.addEventListener(`message`,e=>{let t=(0,p.tryParseJson)(e.data)?.result;if(!t)throw Error(`Failed to get motion state for ${this.motionGroupId}: ${e.data}`);gy(this.rapidlyChangingMotionState.joint_position,t.joint_position,QT)||(0,c.runInAction)(()=>{this.rapidlyChangingMotionState.joint_position=t.joint_position}),vy(this.rapidlyChangingMotionState,t,QT)||(0,c.runInAction)(()=>{this.rapidlyChangingMotionState.tcp_pose=t.tcp_pose}),this.rapidlyChangingMotionState.standstill!==t.standstill&&(0,c.runInAction)(()=>{this.rapidlyChangingMotionState.standstill=t.standstill})}),(0,c.makeAutoObservable)(this)}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,t)=>({index:t}))}get dhParameters(){if(this.description.dh_parameters!==void 0)return this.description.dh_parameters.map(e=>({...$T,...e}))}get safetyZones(){return this.description.safety_zones}get mountingPosition(){return this.description.mounting?[(this.description.mounting.position?.[0]||0)/1e3,(this.description.mounting.position?.[1]||0)/1e3,(this.description.mounting.position?.[2]||0)/1e3]:[0,0,0]}get mountingQuaternion(){let e=new t.Vector3(this.description.mounting?.orientation?.[0]||0,this.description.mounting?.orientation?.[1]||0,this.description.mounting?.orientation?.[2]||0),n=e.length(),r=e.normalize();return new t.Quaternion().setFromAxisAngle(r,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}(0,c.runInAction)(()=>{this.activationState=`deactivating`});try{await this.nova.api.controller.setDefaultMode(this.controllerId,`ROBOT_SYSTEM_MODE_MONITOR`),(0,c.runInAction)(()=>{this.activationState=`inactive`})}catch(e){throw(0,c.runInAction)(()=>{this.activationState=`active`}),e}}async activate(){if(this.activationState!==`inactive`){console.error(`Tried to activate while already activating`);return}(0,c.runInAction)(()=>{this.activationState=`activating`});try{await this.nova.api.controller.setDefaultMode(this.controllerId,`ROBOT_SYSTEM_MODE_CONTROL`),(0,c.runInAction)(()=>{this.activationState=`active`})}catch(e){throw(0,c.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}};function tE(){let e=(0,r.createTheme)({palette:{mode:`dark`,text:{primary:`rgba(255, 255, 255, 1)`,secondary:`rgba(255, 255, 255, 0.7)`,disabled:`rgba(255, 255, 255, 0.38)`},primary:{main:`rgba(142, 86, 252, 1)`,dark:`rgba(136, 58, 255, 1)`,light:`rgba(157, 131, 246, 1)`,contrastText:`rgba(255, 255, 255, 0.87)`},secondary:{main:`rgba(255, 255, 255, 1)`,dark:`rgba(255, 255, 255, 0.06)`,contrastText:`rgba(255, 255, 255, 0.87)`},tertiary:{main:`rgba(100, 255, 218, 1)`,dark:`rgba(38, 166, 154, 1)`,light:`rgba(167, 255, 235, 1)`,contrastText:`rgba(0, 0, 0, 1)`},error:{main:`rgba(239, 83, 80, 1)`,dark:`rgba(229, 57, 53, 1)`,light:`rgba(239, 154, 154, 1)`,contrastText:`rgba(255, 255, 255, 1)`},warning:{main:`rgba(255, 171, 64, 1)`,dark:`rgba(255, 145, 0, 1)`,light:`rgba(255, 209, 128, 1)`,contrastText:`rgba(0, 0, 0, 0.87)`},success:{main:`rgba(38, 166, 154, 1)`,dark:`rgba(0, 121, 107, 1)`,light:`rgba(128, 203, 196, 1)`,contrastText:`rgba(255, 255, 255, 0.87)`},background:{default:`rgba(2, 6, 23, 1)`,paper:`rgba(17, 19, 31, 1)`},action:{active:`rgba(255, 255, 255, 0.56)`,hover:`rgba(255, 255, 255, 0.08)`,selected:`rgba(255, 255, 255, 0.16)`,disabledBackground:`rgba(255, 255, 255, 0.12)`,focus:`rgba(255, 255, 255, 0.12)`,disabled:`rgba(255, 255, 255, 0.38)`},common:{white:`rgba(255, 255, 255, 1)`,black:`rgba(0, 0, 0, 1)`},divider:`rgba(255, 255, 255, 0.12)`,backgroundPaperElevation:{0:`rgba(17,19,31,1.0)`,1:`rgba(20,22,35,1.0)`,2:`rgba(23,25,39,1.0)`,3:`rgba(26,28,43,1.0)`,4:`rgba(29,31,47,1.0)`,5:`rgba(32,34,51,1.0)`,6:`rgba(35,37,55,1.0)`,7:`rgba(38,40,59,1.0)`,8:`rgba(41,43,63,1.0)`,9:`rgba(44,46,67,1.0)`,10:`rgba(47,49,71,1.0)`,11:`rgba(50,52,75,1.0)`,12:`rgba(53,55,79,1.0)`,13:`rgba(56,58,83,1.0)`,14:`rgba(59,61,87,1.0)`,15:`rgba(62,64,91,1.0)`,16:`rgba(57,63,87,1.0)`}},paletteExt:{primary:{hover:`rgba(142, 86, 252, 0.08)`,selected:`rgba(142, 86, 252, 0.16)`,focus:`rgba(142, 86, 252, 0.12)`,focusVisible:`rgba(142, 86, 252, 0.3)`,outlineBorder:`rgba(142, 86, 252, 0.5)`},secondary:{tonal:`rgba(255,255,255,0.1)`}}});return{...e,components:{MuiCssBaseline:{styleOverrides:{"html, body, *":{scrollbarWidth:`none`,msOverflowStyle:`none`},"html:hover, body:hover, *:hover":{scrollbarWidth:`thin`,scrollbarColor:`${e.palette.divider} transparent`},".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:{root:{},panelContent:{borderRadius:`16px !important`},filterForm:{"& .MuiInputBase-root":{borderRadius:`10px !important`,"& fieldset":{borderRadius:`10px !important`},"& .MuiOutlinedInput-notchedOutline":{borderRadius:`10px !important`}}},filterFormValueInput:{"& .MuiInputBase-root":{borderRadius:`10px !important`,"& fieldset":{borderRadius:`10px !important`},"& .MuiOutlinedInput-notchedOutline":{borderRadius:`10px !important`}}}}},MuiButton:{styleOverrides:{root:{textTransform:`none`,borderRadius:`10px`}},variants:[{props:{color:`secondary`,variant:`contained`},style:{border:`1px solid ${e.palette.divider}`,background:e.paletteExt?.secondary?.tonal?.toString()}},{props:{color:`secondary`,variant:`outlined`},style:{border:`1px solid ${e.palette.divider}`}}]},MuiTab:{styleOverrides:{root:{textTransform:`none`,color:e.palette.text.secondary,"&.Mui-selected":{color:e.palette.text.primary}}}},MuiTabs:{styleOverrides:{root:{background:e.palette.backgroundPaperElevation?.[1]}}},MuiToggleButtonGroup:{styleOverrides:{root:{".MuiToggleButtonGroup-firstButton":{borderRadius:`10px 0 0 10px`},".MuiToggleButtonGroup-lastButton":{borderRadius:`0 10px 10px 0`}}}},MuiToggleButton:{styleOverrides:{root:{textTransform:`none`,padding:`6px 16px`}}},MuiSelect:{variants:[{props:{variant:`filled`},style:{borderRadius:`10px`,"::before, ::after":{visibility:`collapse`},".MuiInputBase-input":{padding:`6px 16px`,borderRadius:`10px`}}}]},MuiDrawer:{styleOverrides:{paper:{border:`none`,boxShadow:`4px 0 8px -4px rgba(0, 0, 0, 0.3)`}}},MuiFab:{styleOverrides:{root:{background:e.paletteExt?.secondary?.tonal}},variants:[{props:{color:`primary`},style:{background:e.palette.primary.main}}]}},componentsExt:{JoggingPanel:{JoggingCartesian:{Axis:{X:{backgroundColor:`rgba(215, 66, 56, 1)`,borderColor:`rgba(215, 66, 56, 1)`,buttonBackgroundColor:{default:`rgba(241, 77, 66, 1)`,pressed:`rgba(138, 41, 35, 1)`,hovered:`rgba(241, 77, 66, 1)`,disabled:`rgba(241, 77, 66, 1)`},color:`rgba(255, 198, 198, 1)`,labelColor:e.palette.text.primary},Y:{backgroundColor:`rgba(20, 151, 108, 1)`,borderColor:`rgba(20, 151, 108, 1)`,buttonBackgroundColor:{default:`rgba(28, 188, 135, 1)`,pressed:`rgba(11, 89, 63, 1)`,disabled:`rgba(28, 188, 135, 1)`,hovered:`rgba(28, 188, 135, 1)`},color:`rgba(215, 255, 242, 1)`,labelColor:e.palette.text.primary},Z:{backgroundColor:`rgba(1, 87, 155, 1)`,borderColor:`rgba(1, 87, 155, 1)`,buttonBackgroundColor:{default:`rgba(2, 136, 209, 1)`,pressed:`rgba(2, 64, 114, 1)`,disabled:`rgba(2, 136, 209, 1)`,hovered:`rgba(2, 136, 209, 1)`},color:`rgba(210, 239, 255, 1)`,labelColor:e.palette.text.primary}}},JoggingJoint:{Joint:{arrowColor:e.palette.text.primary}},VelocitySlider:{sliderLegendColor:e.palette.text.primary}}}}}function nE(){let e=tE();return e.palette.mode=`light`,e}function rE(e){let t=!0;return e.palette?.mode===`light`?t=!1:e.palette?.mode!==`dark`&&(t=!(typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: light)`)?.matches)),oi(t?tE():nE(),e)}Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return _y}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return tT}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return Cy}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return Dy}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return gv}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return nv}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return yy}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return ay}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return xy}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return bv}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return eT}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return Ey}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return mT}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return VT}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return cT}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return CT}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return _T}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return gT}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return dT}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return pT}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return WT}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return vy}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return gy}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return ST}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return hT}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return eE}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return zT}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return fT}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return ZT}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return wT}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return rE}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return yT}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return uT}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return qC}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return aT}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return lT}});
52
+ //# sourceMappingURL=core-DufB-Zu5.cjs.map